"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1703],{4610:(e,t,n)=>{n.d(t,{JT:()=>o,k9:()=>i,o6:()=>a});class l{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}}let r=new l,s=!0;try{"undefined"!=typeof localStorage&&localStorage&&(r=localStorage,s=!1)}catch(e){}let o=r,i=e=>s||addEventListener("storage",e),a=e=>s||removeEventListener("storage",e)},13293:(e,t,n)=>{n.d(t,{G:()=>C});var l=n(69717),r=n(30889),s=n(32532),o=n(92749);let i=[];class a extends s.fGB{static getType(){return"mark"}static clone(e){return new a(e.__ids,e.__key)}static importDOM(){return null}static importJSON(e){return c().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIDs(e.ids)}exportJSON(){return{...super.exportJSON(),ids:this.getIDs()}}constructor(e=i,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 l=e.__ids,r=this.__ids,s=l.length,i=r.length,a=n.theme.markOverlap;return s!==i&&(1===s?2===i&&(0,o.ZB)(t,a):1===i&&(0,o.HE)(t,a)),!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 l=Array.from(t.__ids);return l.splice(n,1),t.setIDs(l)}insertNewAfter(e,t=!0){let n=c(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,s.I2P)(t)||"html"===n)return!1;let l=t.anchor,r=t.focus,o=l.getNode(),i=r.getNode(),a=t.isBackward()?l.offset-r.offset:r.offset-l.offset;return this.isParentOf(o)&&this.isParentOf(i)&&this.getTextContent().length===a}excludeFromCopy(e){return"clone"!==e}}function c(e=i){return(0,s.pTq)(new a(e))}var u=n(41747),f=n(12115),d=n(95155);let h=Object.freeze({"	":"\\t","\n":"\\n"}),g=RegExp(Object.keys(h).join("|"),"g"),p=Object.freeze({ancestorHasNextSibling:"|",ancestorIsLastChild:" ",hasNextSibling:"├",isLastChild:"└",selectedChar:"^",selectedLine:">"}),m=[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"],_=[e=>e.isDirectionless()&&"Directionless",e=>e.isUnmergeable()&&"Unmergeable"],b=[e=>e.isToken()&&"Token",e=>e.isSegmented()&&"Segmented"];function v(e,t=!1){let n=Object.entries(h).reduce((e,[t,n])=>e.replace(RegExp(t,"g"),String(n)),e);return t?n.replace(/[^\s]/g,"*"):n}function w(e){let t=m.map(t=>t(e)).filter(Boolean).join(", ").toLocaleLowerCase();return""!==t&&(t="format: "+t),t}let x=(0,f.forwardRef)(function({treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:l,viewClassName:r,timeTravelPanelClassName:s,editorState:o,setEditorState:i,setEditorReadOnly:a,generateContent:c,commandsLog:u=[]},h){let[g,p]=(0,f.useState)([]),[m,y]=(0,f.useState)(""),[_,b]=(0,f.useState)(!1),[v,w]=(0,f.useState)(!1),x=(0,f.useRef)(0),C=(0,f.useRef)(null),[k,S]=(0,f.useState)(!1),[E,T]=(0,f.useState)(!1),[N,I]=(0,f.useState)(!1),F=(0,f.useRef)(),O=(0,f.useRef)([]),D=(0,f.useRef)(0),P=(0,f.useCallback)(e=>{let t=++D.current;c(e).then(e=>{t===D.current&&y(e)}).catch(e=>{t===D.current&&y(`Error rendering tree: ${e.message}

Stack:
${e.stack}`)})},[c]);(0,f.useEffect)(()=>{if((N||!(o._nodeMap.size>1e3)||(T(!0),N))&&(F.current!==o||O.current!==u)){let e=F.current!==o;F.current=o,O.current=u,P(v),!_&&e&&p(e=>[...e,[Date.now(),o]])}},[o,P,v,N,_,u]);let L=g.length;return(0,f.useEffect)(()=>{if(k){let e,t=()=>{let n=x.current;if(n===L-1)return void S(!1);let l=g[n][0];e=setTimeout(()=>{x.current++;let e=x.current,n=C.current;null!==n&&(n.value=String(e)),i(g[e][1]),t()},g[n+1][0]-l)};return t(),()=>{clearTimeout(e)}}},[g,k,L,i]),(0,d.jsxs)("div",{className:r,children:[!N&&E?(0,d.jsxs)("div",{style:{padding:20},children:[(0,d.jsx)("span",{style:{marginRight:20},children:"Detected large EditorState, this can impact debugging performance."}),(0,d.jsx)("button",{onClick:()=>{I(!0)},style:{background:"transparent",border:"1px solid white",color:"white",cursor:"pointer",padding:5},children:"Show full tree"})]}):null,N?null:(0,d.jsx)("button",{onClick:()=>(P(!v),void w(!v)),className:e,type:"button",children:v?"Tree":"Export DOM"}),!_&&(N||!E)&&L>2&&(0,d.jsx)("button",{onClick:()=>{a(!0),x.current=L-1,b(!0)},className:t,type:"button",children:"Time Travel"}),(N||!E)&&(0,d.jsx)("pre",{ref:h,children:m}),_&&(N||!E)&&(0,d.jsxs)("div",{className:s,children:[(0,d.jsx)("button",{className:l,onClick:()=>{x.current===L-1&&(x.current=1),S(!k)},type:"button",children:k?"Pause":"Play"}),(0,d.jsx)("input",{className:n,ref:C,onChange:e=>{let t=Number(e.target.value),n=g[t];n&&(x.current=t,i(n[1]))},type:"range",min:"1",max:L-1}),(0,d.jsx)("button",{className:l,onClick:()=>{a(!1);let e=g.length-1;i(g[e][1]);let t=C.current;null!==t&&(t.value=String(e)),b(!1),S(!1)},type:"button",children:"Exit"})]})]})});function C({treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:i,timeTravelPanelClassName:c,viewClassName:h,editor:m,customPrintNode:C}){let k=f.createRef(),[S,E]=(0,f.useState)(m.getEditorState()),T=function(e){let[t,n]=(0,f.useState)([]);return(0,f.useEffect)(()=>(function(e,t){let n=new Set,l=0;for(let[r]of e._commands)n.add(e.registerCommand(r,e=>(t(t=>{let n=[...t];return n.push({index:l+=1,payload:e,type:r.type?r.type:"UNKNOWN"}),n.length>10&&n.shift(),n}),!1),s.da8));return()=>n.forEach(e=>e())})(e,n),[e]),(0,f.useMemo)(()=>t,[t])}(m);return(0,f.useEffect)(()=>(0,o.Sd)(m.registerUpdateListener(({editorState:e})=>{E(e)}),m.registerEditableListener(()=>{E(m.getEditorState())})),[m]),(0,f.useEffect)(()=>{let e=k.current;if(null!==e)return e.__lexicalEditor=m,()=>{e.__lexicalEditor=null}},[m,k]),(0,d.jsx)(x,{treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:i,viewClassName:h,timeTravelPanelClassName:c,setEditorReadOnly:e=>{let t=m.getRootElement();null!=t&&(t.contentEditable=e?"false":"true")},editorState:S,setEditorState:e=>m.setEditorState(e),generateContent:async function(e){return function(e,t,n,o,i=!1){let c=e.getEditorState(),f=e._config,d=e._compositionKey,h=e._editable;if(n){let t="";return c.read(()=>{t=function(e){let t=document.createElement("div");return t.innerHTML=e.trim(),function e(t,n){let l,r=Array(1+n++).join("  "),s=Array(n-1).join("  ");for(let o=0;o<t.children.length;o++)l=document.createTextNode("\n"+r),t.insertBefore(l,t.children[o]),e(t.children[o],n),t.lastElementChild===t.children[o]&&(l=document.createTextNode("\n"+s),t.appendChild(l));return t}(t,0).innerHTML}((0,l.g)(e))}),t}let m=" root\n",x=c.read(()=>{let e=(0,s.vJq)();return function e(t,n,l=[]){let r=t.getChildren(),o=r.length;r.forEach((t,r)=>{n(t,l.concat(r===o-1?p.isLastChild:p.hasNextSibling)),(0,s.ff4)(t)&&e(t,n,l.concat(r===o-1?p.ancestorIsLastChild:p.ancestorHasNextSibling))})}((0,s.NiT)(),(t,n)=>{let l=`(${t.getKey()})`,c=t.getType()||"",u=t.isSelected();m+=`${u?p.selectedLine:" "} ${n.join(" ")} ${l} ${c} ${function(e,t,n=!1){let l=t?t(e,n):void 0;if(void 0!==l&&l.length>0)return l;if((0,s.kFe)(e)){var o,i;let t,l,r=e.getTextContent(),s=0===r.length?"(empty)":`"${v(r,n)}"`,a=[w(e),(o=e,""!==(t=_.map(e=>e(o)).filter(Boolean).join(", ").toLocaleLowerCase())&&(t="detail: "+t),t),(i=e,""!==(l=b.map(e=>e(i)).filter(Boolean).join(", ").toLocaleLowerCase())&&(l="mode: "+l),l)].filter(Boolean).join(", ");return[s,0!==a.length?`{ ${a} }`:null].filter(Boolean).join(" ").trim()}if((0,r.FJ)(e)){let t,l,r,s=e.getURL(),o=0===s.length?"(empty)":`"${v(s,n)}"`,i=[(null!=(t=e.getTarget())&&(t="target: "+t),t),(null!=(l=e.getRel())&&(l="rel: "+l),l),(null!=(r=e.getTitle())&&(r="title: "+r),r)].filter(Boolean).join(", ");return[o,0!==i.length?`{ ${i} }`:null].filter(Boolean).join(" ").trim()}if(e instanceof a)return`ids: [ ${e.getIDs().join(", ")} ]`;if((0,s.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,i)}
`,m+=function({indent:e,isSelected:t,node:n,nodeKeyDisplay:l,selection:r,typeDisplay:o}){if(!(0,s.kFe)(n)||!(0,s.I2P)(r)||!t||(0,s.ff4)(n))return"";let i=r.anchor,a=r.focus;if(""===n.getTextContent()||i.getNode()===r.focus.getNode()&&i.offset===a.offset)return"";let[c,u]=function(e,t){let n=t.getStartEndPoints();if((0,s.RTZ)(t)||null===n)return[-1,-1];let[l,r]=n,o=e.getTextContent(),i=o.length,a=-1,c=-1;if("text"===l.type&&"text"===r.type){let t=l.getNode(),n=r.getNode();t===n&&e===t&&l.offset!==r.offset?[a,c]=l.offset<r.offset?[l.offset,r.offset]:[r.offset,l.offset]:[a,c]=e===t?t.isBefore(n)?[l.offset,i]:[0,l.offset]:e===n?n.isBefore(t)?[r.offset,i]:[0,r.offset]:[0,i]}let u=(o.slice(0,a).match(g)||[]).length,f=(o.slice(a,c).match(g)||[]).length;return[a+u,c+u+f]}(n,r);if(c===u)return"";let f=e[e.length-1]===p.hasNextSibling?p.ancestorHasNextSibling:p.ancestorIsLastChild,d=[...e.slice(0,e.length-1),f],h=Array(c+1).fill(" "),m=Array(u-c).fill(p.selectedChar),y=o.length+2,_=Array(l.length+y).fill(" ");return[p.selectedLine,d.join(" "),[..._,...h,...m].join("")].join(" ")+"\n"}({indent:n,isSelected:u,node:t,nodeKeyDisplay:l,selection:e,typeDisplay:c})}),null===e?": null":(0,s.I2P)(e)?function(e){let t="",n=w(e);t+=`: range ${""!==n?`{ ${n} }`:""} ${""!==e.style?`{ style: ${e.style} } `:""}`;let l=e.anchor,r=e.focus,s=l.offset,o=r.offset;return t+`
  ├ anchor { key: ${l.key}, offset: ${null===s?"null":s}, type: ${l.type} }
  └ focus { key: ${r.key}, offset: ${null===o?"null":o}, type: ${r.type} }`}(e):(0,u.Ln)(e)?`: table
  └ { table: ${e.tableKey}, anchorCell: ${e.anchor.key}, focusCell: ${e.focus.key} }`:(0,s.RTZ)(e)?`: node
  └ [${Array.from(e._nodes).join(", ")}]`:""});if(m+="\n selection"+x,m+="\n\n commands:",t.length)for(let{index:e,type:n,payload:l}of t)m+=`
  └ ${e}. { type: ${n}, payload: ${l instanceof Event?l.constructor.name:l} }`;else m+="\n  └ None dispatched.";let{version:C}=e.constructor;return m+=`

 editor${C?` (v${C})`:""}:`,m+=`
  └ namespace ${f.namespace}`,null!==d&&(m+=`
  └ compositionKey ${d}`),m+=`
  └ editable ${String(h)}`}(m,T,e,C)},ref:k,commandsLog:T})}},13959:(e,t,n)=>{n.d(t,{s:()=>u});var l=n(90142),r=n(94271),s=n(12115),o=n(95155);function i(e){let t=e.transform();return new Set(t?[t]:[])}let a=()=>{},c=()=>{};function u({initialEditor:e,children:t,initialNodes:n,initialTheme:u,skipCollabChecks:f,skipEditableListener:d}){let h=(0,s.useRef)(!1),g=(0,s.useContext)(r.Gu);null==g&&function(e,...t){let n=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;for(let e of(l.append("code",9),t))l.append("v",e);throw n.search=l.toString(),Error(`Minified Lexical error #${9}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(9);let[p,{getTheme:m}]=g,y=(0,s.useMemo)(()=>{let t=u||m()||void 0,l=(0,r.Mx)(g,t);void 0!==t&&(e._config.theme=t),e._parentEditor=e._parentEditor||p;let s=e._createEditorArgs,o=s&&s.namespace;if(n)for(let t of(a(),o||(c(),e._config.namespace=p._config.namespace),n)){let n=null,l=null;if("function"!=typeof t){let e=t;t=e.replace,n=e.with,l=e.withKlass||null}let r=e._nodes.get(t.getType());e._nodes.set(t.getType(),{exportDOM:r?r.exportDOM:void 0,klass:t,replace:n,replaceWithKlass:l,transforms:i(t)})}else if(s&&s.nodes)o||(c(),e._config.namespace=p._config.namespace);else{let t=e._nodes=new Map(p._nodes);for(let[n,l]of(o||(e._config.namespace=p._config.namespace),t))e._nodes.set(n,{exportDOM:l.exportDOM,klass:l.klass,replace:l.replace,replaceWithKlass:l.replaceWithKlass,transforms:i(l.klass)})}return[e,l]},[]),{isCollabActive:_,yjsDocMap:b}=(0,l.k)(),v=f||h.current||b.has(e.getKey());return(0,s.useEffect)(()=>{v&&(h.current=!0)},[v]),(0,s.useEffect)(()=>{if(!d){let t=t=>e.setEditable(t);return t(p.isEditable()),p.registerEditableListener(t)}},[e,p,d]),(0,o.jsx)(r.Gu.Provider,{value:y,children:!_||v?t:null})}},28495:(e,t,n)=>{n.d(t,{Ey:()=>u,HR:()=>f,nk:()=>c,zS:()=>a});var l=n(63108),r=n(42878),s=n(44134).hp;let o=e=>new Uint8Array(e),i=(e,t,n)=>new Uint8Array(e,t,n),a=e=>new Uint8Array(e),c=r.Bd?e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=l.QV(e[n]);return btoa(t)}:e=>s.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),u=r.Bd?e=>{let t=atob(e),n=o(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}:e=>{let t=s.from(e,"base64");return i(t.buffer,t.byteOffset,t.byteLength)},f=e=>{let t=o(e.byteLength);return t.set(e),t}},29979:(e,t,n)=>{n.d(t,{BB:()=>f,QP:()=>_,mx:()=>y});var l=n(94271),r=n(32532),s=n(12115),o=n(92749),i=n(95155);let a="startTransition",c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,u=c?s.useLayoutEffect:s.useEffect;class f{constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}let d=e=>{let t=document.getElementById("typeahead-menu");if(!t)return;let n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function h(e,t){let n=e.getBoundingClientRect(),l=t.getBoundingClientRect();return n.top>l.top&&n.top<l.bottom}let g=(0,r.guI)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function p({close:e,editor:t,anchorElementRef:n,resolution:l,options:i,menuRenderFn:a,onSelectOption:c,shouldSplitNodeWithQuery:f=!1,commandPriority:h=r.AcJ,preselectFirstItem:p=!0}){let[m,y]=(0,s.useState)(null),_=l.match&&l.match.matchingString;(0,s.useEffect)(()=>{p&&y(0)},[_,p]);let b=(0,s.useCallback)(n=>{t.update(()=>{c(n,null!=l.match&&f?function(e){let t,n=(0,r.vJq)();if(!(0,r.I2P)(n)||!n.isCollapsed())return null;let l=n.anchor;if("text"!==l.type)return null;let s=l.getNode();if(!s.isSimpleText())return null;let o=l.offset,i=s.getTextContent().slice(0,o),a=e.replaceableString.length,c=o-function(e,t,n){let l=n;for(let n=l;n<=t.length;n++)e.slice(-n)===t.substring(0,n)&&(l=n);return l}(i,e.matchingString,a);return c<0?null:(0===c?[t]=s.splitText(o):[,t]=s.splitText(c,o),t)}(l.match):null,e,l.match?l.match.matchingString:"")})},[t,f,l.match,c,e]),v=(0,s.useCallback)(e=>{let n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),y(e))},[t]);return(0,s.useEffect)(()=>()=>{let e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")},[t]),u(()=>{null===i?y(null):null===m&&p&&v(0)},[i,m,v,p]),(0,s.useEffect)(()=>(0,o.Sd)(t.registerCommand(g,({option:e})=>!(!e.ref||null==e.ref.current)&&(d(e.ref.current),!0),h)),[t,v,h]),(0,s.useEffect)(()=>(0,o.Sd)(t.registerCommand(r.bbF,e=>{if(null!==i&&i.length){let n=null===m?0:m!==i.length-1?m+1:0;v(n);let l=i[n];null!=l.ref&&l.ref.current&&t.dispatchCommand(g,{index:n,option:l}),e.preventDefault(),e.stopImmediatePropagation()}return!0},h),t.registerCommand(r.UDz,e=>{if(null!==i&&i.length){let t=null===m?i.length-1:0!==m?m-1:i.length-1;v(t);let n=i[t];null!=n.ref&&n.ref.current&&d(n.ref.current),e.preventDefault(),e.stopImmediatePropagation()}return!0},h),t.registerCommand(r.Q$N,t=>(t.preventDefault(),t.stopImmediatePropagation(),e(),!0),h),t.registerCommand(r.OXk,e=>null!==i&&null!==m&&null!=i[m]&&(e.preventDefault(),e.stopImmediatePropagation(),b(i[m]),!0),h),t.registerCommand(r.RTo,e=>null!==i&&null!==m&&null!=i[m]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),b(i[m]),!0),h)),[b,e,t,i,m,v,h]),a(n,(0,s.useMemo)(()=>({options:i,selectOptionAndCleanUp:b,selectedIndex:m,setHighlightedIndex:y}),[b,m,i]),l.match?l.match.matchingString:"")}function m(e,t){null!=t&&(e.className=t),e.setAttribute("aria-label","Typeahead menu"),e.setAttribute("role","listbox"),e.style.display="block",e.style.position="absolute"}function y(e,{minLength:t=1,maxLength:n=75}){return(0,s.useCallback)(l=>{let r=RegExp("(^|\\s|\\()(["+e+"]((?:"+("[^"+e)+"\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;\\s]){0,"+n+"}))$").exec(l);if(null!==r){let e=r[1],n=r[3];if(n.length>=t)return{leadOffset:r.index+e.length,matchingString:n,replaceableString:r[2]}}return null},[n,t,e])}function _({options:e,onQueryChange:t,onSelectOption:n,onOpen:o,onClose:u,menuRenderFn:f,triggerFn:d,anchorClassName:g,commandPriority:y=r.AcJ,parent:_,preselectFirstItem:b=!0}){let[v]=(0,l.DF)(),[w,x]=(0,s.useState)(null),C=function(e,t,n,r=c?document.body:void 0,o=!0){let[i]=(0,l.DF)(),a=(0,s.useRef)(c?document.createElement("div"):null),u=(0,s.useCallback)(()=>{if(null===a.current||void 0===r)return;a.current.style.top=a.current.style.bottom;let t=i.getRootElement(),l=a.current,s=l.firstChild;if(null!==t&&null!==e){let{left:i,top:c,width:u,height:f}=e.getRect(),d=a.current.offsetHeight;if(l.style.top=`${c+d+3+(o?window.pageYOffset:0)}px`,l.style.left=`${i+window.pageXOffset}px`,l.style.height=`${f}px`,l.style.width=`${u}px`,null!==s){s.style.top=`${c}`;let e=s.getBoundingClientRect(),n=e.height,r=e.width,a=t.getBoundingClientRect();i+r>a.right&&(l.style.left=`${a.right-r+window.pageXOffset}px`),(c+n>window.innerHeight||c+n>a.bottom)&&c-a.top>n+f&&(l.style.top=`${c-n-f+(o?window.pageYOffset:0)}px`)}l.isConnected||(m(l,n),r.append(l)),l.setAttribute("id","typeahead-menu"),a.current=l,t.setAttribute("aria-controls","typeahead-menu")}},[i,e,o,n,r]);(0,s.useEffect)(()=>{let t=i.getRootElement();return null!==e&&u(),()=>{null!==t&&t.removeAttribute("aria-controls");let e=a.current;null!==e&&e.isConnected&&(e.remove(),e.removeAttribute("id"))}},[i,u,e]);let f=(0,s.useCallback)(n=>{null!==e&&(n||t(null))},[e,t]);var d=a.current;let[g]=(0,l.DF)();(0,s.useEffect)(()=>{if(null!=d&&null!=e){let e=g.getRootElement(),t=null!=e?function(e,t){let n=getComputedStyle(e),l="absolute"===n.position,r=/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!l||"static"!==n.position)&&r.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body}(e):document.body,n=!1,l=h(d,t),r=function(){n||(window.requestAnimationFrame(function(){u(),n=!1}),n=!0);let e=h(d,t);e!==l&&(l=e,null!=f&&f(e))},s=new ResizeObserver(u);return window.addEventListener("resize",u),document.addEventListener("scroll",r,{capture:!0,passive:!0}),s.observe(d),()=>{s.unobserve(d),window.removeEventListener("resize",u),document.removeEventListener("scroll",r,!0)}}},[d,g,f,u,e]);let p=a.current;return null!=p&&(m(p,n),null!=r&&r.append(p)),a}(w,x,g,_),k=(0,s.useCallback)(()=>{x(null),null!=u&&null!==w&&u()},[u,w]),S=(0,s.useCallback)(e=>{x(e),null!=o&&null===w&&o(e)},[o,w]);return(0,s.useEffect)(()=>{let e=v.registerUpdateListener(()=>{v.getEditorState().read(()=>{var e;let n;if(!v.isEditable())return void k();let l=v._window||window,o=l.document.createRange(),i=(0,r.vJq)(),c=(n=null,v.getEditorState().read(()=>{let e=(0,r.vJq)();(0,r.I2P)(e)&&(n=function(e){let t=e.anchor;if("text"!==t.type)return null;let n=t.getNode();if(!n.isSimpleText())return null;let l=t.offset;return n.getTextContent().slice(0,l)}(e))}),n);if(!(0,r.I2P)(i)||!i.isCollapsed()||null===c||null===o)return void k();let u=d(c,v);if(t(u?u.matchingString:null),null!==u&&!(0===u.leadOffset&&v.getEditorState().read(()=>{let e=(0,r.vJq)();if((0,r.I2P)(e)){let t=e.anchor.getNode().getPreviousSibling();return(0,r.kFe)(t)&&t.isTextEntity()}return!1}))&&null!==function(e,t,n){let l=(0,r.peL)(n);if(null===l||!l.isCollapsed)return!1;let s=l.anchorNode,o=l.anchorOffset;if(null==s||null==o)return!1;try{t.setStart(s,e),t.setEnd(s,o)}catch(e){return!1}return!0}(u.leadOffset,o,l))return e=()=>S({getRect:()=>o.getBoundingClientRect(),match:u}),void(a in s?s[a](e):e());k()})});return()=>{e()}},[v,d,t,w,k,S]),(0,s.useEffect)(()=>v.registerEditableListener(e=>{e||k()}),[v,k]),null===w||null===v||null===C.current?null:(0,i.jsx)(p,{close:k,resolution:w,editor:v,anchorElementRef:C,options:e,menuRenderFn:f,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:y,preselectFirstItem:b})}(0,r.guI)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND")},32293:(e,t,n)=>{n.d(t,{Mq:()=>s,bD:()=>r,vt:()=>l});let l=e=>Error(e),r=()=>{throw l("Method unimplemented")},s=()=>{throw l("Unexpected case")}},34712:(e,t,n)=>{n.d(t,{$R:()=>B});var l=n(61077),r=n(95279),s=n(28495),o=n(4610);let i=new Map;class a{constructor(e){this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&null!==this.onmessage&&this.onmessage({data:s.Ey(t.newValue||"")}),o.k9(this._onChange)}postMessage(e){o.JT.setItem(this.room,s.nk(s.zS(e)))}close(){o.o6(this._onChange)}}let c="undefined"==typeof BroadcastChannel?a:BroadcastChannel,u=e=>l._4(i,e,()=>{let t=r.vt(),n=new c(e);return n.onmessage=e=>t.forEach(t=>t(e.data,"broadcastchannel")),{bc:n,subs:t}}),f=(e,t)=>(u(e).subs.add(t),t),d=(e,t)=>{let n=u(e),l=n.subs.delete(t);return l&&0===n.subs.size&&(n.bc.close(),i.delete(e)),l},h=(e,t,n=null)=>{let l=u(e);l.bc.postMessage(t),l.subs.forEach(e=>e(t,n))};var g=n(90224),p=n(83600),m=n(98628),y=n(95644);let _=(e,t)=>{p.zd(e,0);let n=y.FX(t);p.Gu(e,n)},b=(e,t,n)=>{p.zd(e,1),p.Gu(e,y.PR(t,n))},v=(e,t,n)=>b(t,n,m.bo(e)),w=(e,t,n)=>{try{y.QE(t,m.bo(e),n)}catch(e){console.error("Caught error while handling a Yjs update",e)}},x=(e,t)=>{p.zd(e,2),p.Gu(e,t)},C=(e,t,n,l)=>{let r=m.cw(e);switch(r){case 0:v(e,t,n);break;case 1:case 2:w(e,n,l);break;default:throw Error("Unknown message type")}return r},k=(e,t,n)=>{0===m.cw(e)&&n(t,m.t3(e))};var S=n(88755),E=n(95460),T=n(57717);class N extends E.c{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=g._g();null!==this.getLocalState()&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,l)=>{l!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(l)&&t.push(l)}),t.length>0&&I(this,t,"timeout")},S.RI(3e3)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),l=void 0===n?0:n.clock+1,r=this.states.get(t);null===e?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:l,lastUpdated:g._g()});let s=[],o=[],i=[],a=[];null===e?a.push(t):null==r?null!=e&&s.push(t):(o.push(t),T.vo(r,e)||i.push(t)),(s.length>0||i.length>0||a.length>0)&&this.emit("change",[{added:s,updated:i,removed:a},"local"]),this.emit("update",[{added:s,updated:o,removed:a},"local"])}setLocalStateField(e,t){let n=this.getLocalState();null!==n&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}}let I=(e,t,n)=>{let l=[];for(let n=0;n<t.length;n++){let r=t[n];if(e.states.has(r)){if(e.states.delete(r),r===e.clientID){let t=e.meta.get(r);e.meta.set(r,{clock:t.clock+1,lastUpdated:g._g()})}l.push(r)}}l.length>0&&(e.emit("change",[{added:[],updated:[],removed:l},n]),e.emit("update",[{added:[],updated:[],removed:l},n]))},F=(e,t,n=e.states)=>{let l=t.length,r=p.xv();p.zd(r,l);for(let s=0;s<l;s++){let l=t[s],o=n.get(l)||null,i=e.meta.get(l).clock;p.zd(r,l),p.zd(r,i),p.Qj(r,JSON.stringify(o))}return p.Fo(r)},O=(e,t,n)=>{let l=m.$C(t),r=g._g(),s=[],o=[],i=[],a=[],c=m.cw(l);for(let t=0;t<c;t++){let t=m.cw(l),n=m.cw(l),c=JSON.parse(m.t3(l)),u=e.meta.get(t),f=e.states.get(t),d=void 0===u?0:u.clock;(d<n||d===n&&null===c&&e.states.has(t))&&(null===c?t===e.clientID&&null!=e.getLocalState()?n++:e.states.delete(t):e.states.set(t,c),e.meta.set(t,{clock:n,lastUpdated:r}),void 0===u&&null!==c?s.push(t):void 0!==u&&null===c?a.push(t):null!==c&&(T.vo(c,f)||i.push(t),o.push(t)))}(s.length>0||i.length>0||a.length>0)&&e.emit("change",[{added:s,updated:i,removed:a},n]),(s.length>0||o.length>0||a.length>0)&&e.emit("update",[{added:s,updated:o,removed:a},n])};var D=n(67402);let P=e=>D.Tj(e,(e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&");var L=n(42878),A=n(49509);let j=[];j[0]=(e,t,n,l,r)=>{p.zd(e,0);let s=C(t,e,n.doc,n);l&&1===s&&!n.synced&&(n.synced=!0)},j[3]=(e,t,n,l,r)=>{p.zd(e,1),p.Gu(e,F(n.awareness,Array.from(n.awareness.getStates().keys())))},j[1]=(e,t,n,l,r)=>{O(n.awareness,m.bo(t),n)},j[2]=(e,t,n,l,r)=>{k(t,n.doc,(e,t)=>M(n,t))};let M=(e,t)=>console.warn(`Permission denied to access ${e.url}.
${t}`),R=(e,t,n)=>{let l=m.$C(t),r=p.xv(),s=m.cw(l),o=e.messageHandlers[s];return o?o(r,l,e,n,s):console.error("Unable to compute message"),r},$=e=>{if(e.shouldConnect&&null===e.ws){let t=new e._WS(e.url);t.binaryType="arraybuffer",e.ws=t,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,t.onmessage=n=>{e.wsLastMessageReceived=g._g();let l=R(e,new Uint8Array(n.data),!0);p.Bw(l)>1&&t.send(p.Fo(l))},t.onerror=t=>{e.emit("connection-error",[t,e])},t.onclose=t=>{e.emit("connection-close",[t,e]),e.ws=null,e.wsconnecting=!1,e.wsconnected?(e.wsconnected=!1,e.synced=!1,I(e.awareness,Array.from(e.awareness.getStates().keys()).filter(t=>t!==e.doc.clientID),e),e.emit("status",[{status:"disconnected"}])):e.wsUnsuccessfulReconnects++,setTimeout($,S.jk(100*S.n7(2,e.wsUnsuccessfulReconnects),e.maxBackoffTime),e)},t.onopen=()=>{e.wsLastMessageReceived=g._g(),e.wsconnecting=!1,e.wsconnected=!0,e.wsUnsuccessfulReconnects=0,e.emit("status",[{status:"connected"}]);let n=p.xv();if(p.zd(n,0),_(n,e.doc),t.send(p.Fo(n)),null!==e.awareness.getLocalState()){let n=p.xv();p.zd(n,1),p.Gu(n,F(e.awareness,[e.doc.clientID])),t.send(p.Fo(n))}},e.emit("status",[{status:"connecting"}])}},U=(e,t)=>{let n=e.ws;e.wsconnected&&n&&n.readyState===n.OPEN&&n.send(t),e.bcconnected&&h(e.bcChannel,t,e)};class B extends E.c{constructor(e,t,n,{connect:l=!0,awareness:r=new N(n),params:s={},WebSocketPolyfill:o=WebSocket,resyncInterval:i=-1,maxBackoffTime:a=2500,disableBc:c=!1}={}){for(super();"/"===e[e.length-1];)e=e.slice(0,e.length-1);let u=P(s);this.maxBackoffTime=a,this.bcChannel=e+"/"+t,this.url=e+"/"+t+(0===u.length?"":"?"+u),this.roomname=t,this.doc=n,this._WS=o,this.awareness=r,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=c,this.wsUnsuccessfulReconnects=0,this.messageHandlers=j.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=l,this._resyncInterval=0,i>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){let e=p.xv();p.zd(e,0),_(e,n),this.ws.send(p.Fo(e))}},i)),this._bcSubscriber=(e,t)=>{if(t!==this){let t=R(this,new Uint8Array(e),!1);p.Bw(t)>1&&h(this.bcChannel,p.Fo(t),this)}},this._updateHandler=(e,t)=>{if(t!==this){let t=p.xv();p.zd(t,0),x(t,e),U(this,p.Fo(t))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:e,updated:t,removed:n},l)=>{let s=e.concat(t).concat(n),o=p.xv();p.zd(o,1),p.Gu(o,F(r,s)),U(this,p.Fo(o))},this._exitHandler=()=>{I(this.awareness,[n.clientID],"app closed")},L.Ll&&void 0!==A&&A.on("exit",this._exitHandler),r.on("update",this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&3e4<g._g()-this.wsLastMessageReceived&&this.ws.close()},3e3),l&&this.connect()}get synced(){return this._synced}set synced(e){this._synced!==e&&(this._synced=e,this.emit("synced",[e]),this.emit("sync",[e]))}destroy(){0!==this._resyncInterval&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),L.Ll&&void 0!==A&&A.off("exit",this._exitHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.doc.off("update",this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;this.bcconnected||(f(this.bcChannel,this._bcSubscriber),this.bcconnected=!0);let e=p.xv();p.zd(e,0),_(e,this.doc),h(this.bcChannel,p.Fo(e),this);let t=p.xv();p.zd(t,0),b(t,this.doc),h(this.bcChannel,p.Fo(t),this);let n=p.xv();p.zd(n,3),h(this.bcChannel,p.Fo(n),this);let l=p.xv();p.zd(l,1),p.Gu(l,F(this.awareness,[this.doc.clientID])),h(this.bcChannel,p.Fo(l),this)}disconnectBc(){let e=p.xv();p.zd(e,1),p.Gu(e,F(this.awareness,[this.doc.clientID],new Map)),U(this,p.Fo(e)),this.bcconnected&&(d(this.bcChannel,this._bcSubscriber),this.bcconnected=!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),null!==this.ws&&this.ws.close()}connect(){this.shouldConnect=!0,this.wsconnected||null!==this.ws||($(this),this.connectBc())}}},35261:(e,t,n)=>{n.d(t,{yy:()=>h,R8:()=>g});var l=n(42878),r=n(95279);class s{constructor(e,t){this.left=e,this.right=t}}let o=(e,t)=>new s(e,t);var i=n(61077);let a="undefined"!=typeof document?document:{};"undefined"!=typeof DOMParser&&new DOMParser;let c=e=>i.Tj(e,(e,t)=>`${t}:${e};`).join("");a.ELEMENT_NODE,a.TEXT_NODE,a.CDATA_SECTION_NODE,a.COMMENT_NODE,a.DOCUMENT_NODE,a.DOCUMENT_TYPE_NODE,a.DOCUMENT_FRAGMENT_NODE;var u=n(78176);let f={[u.Y]:o("font-weight","bold"),[u.Ny]:o("font-weight","normal"),[u.ft]:o("color","blue"),[u.AV]:o("color","green"),[u.Qu]:o("color","grey"),[u.UH]:o("color","red"),[u.hr]:o("color","purple"),[u.hN]:o("color","orange"),[u.Tx]:o("color","black")},d=l.WI?e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],l=i.vt(),r=[],s=0;for(;s<e.length;s++){let r=e[s],o=f[r];if(void 0!==o)l.set(o.left,o.right);else{if(void 0===r)break;if(r.constructor===String||r.constructor===Number){let e=c(l);s>0||e.length>0?(t.push("%c"+r),n.push(e)):t.push(r)}else break}}for(s>0&&(r=n).unshift(t.join(""));s<e.length;s++){let t=e[s];t instanceof Symbol||r.push(t)}return r}:u.ET,h=(...e)=>{console.log(...d(e)),p.forEach(t=>t.print(e))},g=(...e)=>{console.warn(...d(e)),e.unshift(u.hN),p.forEach(t=>t.print(e))},p=r.vt()},42878:(e,t,n)=>{let l;n.d(t,{dn:()=>p,Bd:()=>f,Ll:()=>u,WI:()=>y});var r=n(61077),s=n(63108);let o=e=>void 0===e?null:e;var i=n(4610),a=n(57717),c=n(49509);let u=void 0!==c&&c.release&&/node|io\.js/.test(c.release.name)&&"[object process]"===Object.prototype.toString.call(void 0!==c?c:0),f="undefined"!=typeof window&&"undefined"!=typeof document&&!u;"undefined"!=typeof navigator&&/Mac/.test(navigator.platform);let d=[],h=()=>{if(void 0===l)if(u){l=r.vt();let e=c.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];"-"===r[0]?(null!==t&&l.set(t,""),t=r):null!==t?(l.set(t,r),t=null):d.push(r)}null!==t&&l.set(t,"")}else"object"==typeof location?(l=r.vt(),(location.search||"?").slice(1).split("&").forEach(e=>{if(0!==e.length){let[t,n]=e.split("=");l.set(`--${s.jN(t,"-")}`,n),l.set(`-${s.jN(t,"-")}`,n)}})):l=r.vt();return l},g=e=>h().has(e),p=e=>u?o(c.env[e.toUpperCase().replaceAll("-","_")]):o(i.JT.getItem(e)),m=e=>g("--"+e)||null!==p(e);m("production");let y=u&&a.EK(c.env.FORCE_COLOR,["true","1","2"])||!g("--no-colors")&&!m("no-color")&&(!u||c.stdout.isTTY)&&(!u||g("--color")||null!==p("COLORTERM")||(p("TERM")||"").includes("color"))},49889:(e,t,n)=>{n.d(t,{V:()=>et});var l=n(90142),r=n(94271),s=n(32532),o=n(95644);function i(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.`)}function a(e,t,n,l,r){let s=n._offsetMap,o=l._offsetMap,i=new Set,a=e,u=t;for(;null!==u;){let e=u.key,t=s.get(e),n=u.end-u.start;if(i.add(e),void 0===t)a+=n;else{let e=t.end-t.start;e!==n&&(a+=n-e)}let l=u.prev;if(null!==l){u=l;continue}let r=u.parent;for(;null!==r;){let e=r.prev;if(null!==e){let t=e.key,n=s.get(t),l=e.end-e.start;if(i.add(t),void 0===n)a+=l;else{let e=n.end-n.start;e!==l&&(a+=l-e)}e=e.prev}r=r.parent}break}let f=n._firstNode;if(null!==f){u=c(f,e,r);let t=!1;for(;null!==u;){if(!i.has(u.key)){t=!0;break}u=u.parent}if(!t)for(;null!==u;){let e=u.key;if(!i.has(e)){let t=o.get(e),n=u.end-u.start;if(void 0===t)a-=n;else{let e=t.end-t.start;n!==e&&(a+=e-n)}}u=u.prev}}return a}function c(e,t,n){let l=e;for(;null!==l;){if(t<l.end+ +("element"!==l.type||0===n)){let e=l.child;if(null!==e){l=e;continue}return l}let e=l.next;if(null===e)break;l=e}return null}function u(e,t,n,l,r,s){return{child:e,end:l,key:r,next:null,parent:s,prev:null,start:n,type:t}}function f(e,t){let n=[],l=e.__first;for(;null!==l;){let e=null===t?(0,s.nsf)(l):t.get(l);null==e&&i(174),n.push(l),l=e.__next}return n}var d=n(61731);function h(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.`)}class g{constructor(e,t){this._key="",this._map=e,this._parent=t,this._type="linebreak"}getNode(){let e=(0,s.nsf)(this._key);return(0,s.wH$)(e)?e:null}getKey(){return this._key}getSharedType(){return this._map}getType(){return this._type}getSize(){return 1}getOffset(){return this._parent.getChildOffset(this)}destroy(e){let t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function p(e,t){let n=new g(e,t);return e._collabNode=n,n}class m{constructor(e,t,n,l){this._key="",this._map=e,this._parent=n,this._text=t,this._type=l,this._normalized=!1}getPrevNode(e){if(null===e)return null;let t=e.get(this._key);return(0,s.kFe)(t)?t:null}getNode(){let e=(0,s.nsf)(this._key);return(0,s.kFe)(e)?e:null}getSharedType(){return this._map}getType(){return this._type}getKey(){return this._key}getSize(){return this._text.length+ +!this._normalized}getOffset(){return this._parent.getChildOffset(this)}spliceText(e,t,n){let l=this._parent._xmlText,r=this.getOffset()+1+e;0!==t&&l.delete(r,t),""!==n&&l.insert(r,n)}syncPropertiesAndTextFromLexical(e,t,n){let l=this.getPrevNode(n),r=t.__text;if(I(e,this._map,l,t),null!==l){let e=l.__text;e!==r&&(!function(e,t,n,l){let r=(0,s.vJq)(),o=l.length;if((0,s.I2P)(r)&&r.isCollapsed()){let e=r.anchor;e.key===t&&(o=e.offset)}let i=function(e,t,n){let l=e.length,r=t.length,s=0,o=0;for(;s<l&&s<r&&e[s]===t[s]&&s<n;)s++;for(;o+s<l&&o+s<r&&e[l-o-1]===t[r-o-1];)o++;for(;o+s<l&&o+s<r&&e[s]===t[s];)s++;return{index:s,insert:t.slice(s,r-o),remove:l-s-o}}(n,l,o);e.spliceText(i.index,i.remove,i.insert)}(this,t.__key,e,r),this._text=r)}}syncPropertiesAndTextFromYjs(e,t){let n=this.getNode();null===n&&h(84),E(e,this._map,n,t);let l=this._text;n.__text!==l&&(n.getWritable().__text=l)}destroy(e){let t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function y(e,t,n,l){let r=new m(e,t,n,l);return e._collabNode=r,r}let _=new Set(["__key","__parent","__next","__prev","__state"]),b=new Set(["__first","__last","__size","__dir"]),v=new Set(["__cachedText"]),w=new Set(["__text"]);function x(e,t,n){if(_.has(e)||"function"==typeof t[e])return!0;if((0,s.kFe)(t)){if(w.has(e))return!0}else if((0,s.ff4)(t)&&(b.has(e)||(0,s.hVZ)(t)&&v.has(e)))return!0;let l=t.constructor,r=n.excludedProperties.get(l);return null!=r&&r.has(e)}function C(e,t,n){let l,r=t.__type;if((0,s.ff4)(t))(l=M(new o.ZQ,n,r)).syncPropertiesFromLexical(e,t,null),l.syncChildrenFromLexical(e,t,null,null,null);else if((0,s.kFe)(t))(l=y(new o.T5,t.__text,n,r)).syncPropertiesAndTextFromLexical(e,t,null);else if((0,s.wH$)(t)){let e=new o.T5;e.set("__type","linebreak"),l=p(e,n)}else(0,s.Cyw)(t)?(l=A(new o.WF,n,r)).syncPropertiesFromLexical(e,t,null):h(86);return l._key=t.__key,l}function k(e){let t=T(e,"__type");return"string"!=typeof t&&void 0!==t&&h(87),t}function S(e,t,n){let l=t._collabNode;if(void 0===l){let l=e.editor._nodes,r=k(t);"string"!=typeof r&&h(87),void 0===l.get(r)&&h(88,r);let s=t.parent,i=void 0===n&&null!==s?S(e,s):n||null;if(i instanceof j||h(89),t instanceof o.ZQ)return M(t,i,r);if(t instanceof o.T5)return"linebreak"===r?p(t,i):y(t,"",i,r);if(t instanceof o.WF)return A(t,i,r)}return l}function E(e,t,n,l){let r,i=null===l?t instanceof o.T5?Array.from(t.keys()):Object.keys(t.getAttributes()):Array.from(l);for(let l=0;l<i.length;l++){let a=i[l];if(x(a,n,e)){"__state"===a&&(r||(r=n.getWritable()),function(e,t,n){let l=T(t,"__state");l instanceof o.T5&&(0,s.swd)(n).updateFromJSON(l.toJSON())}(0,t,r));continue}let c=n[a],u=T(t,a);if(c!==u){if(u instanceof o.JA){let t=e.docMap;c instanceof o.JA&&t.delete(c.guid);let n=(0,s.ieJ)(),l=u.guid;n._key=l,t.set(l,u),u=n}void 0===r&&(r=n.getWritable()),r[a]=u}}}function T(e,t){return e instanceof o.T5?e.get(t):e.getAttribute(t)}function N(e,t,n){e instanceof o.T5?e.set(t,n):e.setAttribute(t,n)}function I(e,t,n,l){let r=l.__type,s=e.nodeProperties,i=s.get(r);void 0===i&&(i=Object.keys(l).filter(t=>!x(t,l,e)),s.set(r,i));let a=e.editor.constructor;!function(e,t,n,l){let r=l.__state,s=T(t,"__state");if(!r)return;let[i,a]=r.getInternalState(),c=n&&n.__state,u=s instanceof o.T5?s:new o.T5;if(c===r)return;let[f,d]=c&&u.doc?c.getInternalState():[void 0,new Map];if(i)for(let[e,t]of Object.entries(i))f&&t!==f[e]&&u.set(e,t);for(let[e,t]of a)d.get(e)!==t&&u.set(e.key,e.unparse(t));s||N(t,"__state",u)}(0,t,n,l);for(let r=0;r<i.length;r++){let s=i[r],c=null===n?void 0:n[s],u=l[s];if(c!==u){if(u instanceof a){let t,n=e.docMap;if(c instanceof a){let e=c._key;t=n.get(e),n.delete(e)}let r=t||new o.JA,s=r.guid;u._key=s,n.set(s,r),u=r,e.editor.update(()=>{l.markDirty()})}N(t,s,u)}}}function F(e,t,n,l){return e.slice(0,t)+l+e.slice(t+n)}function O(e,t,n){let l=0,r=0,s=e._children,o=s.length;for(;r<o;r++){let e=s[r],i=l;if(l+=e.getSize(),(n?l>=t:l>t)&&e instanceof m){let n=t-i-1;return n<0&&(n=0),{length:l-t,node:e,nodeIndex:r,offset:n}}if(l>t)return{length:0,node:e,nodeIndex:r,offset:i};if(r===o-1)return{length:0,node:null,nodeIndex:r+1,offset:i+1}}return{length:0,node:null,nodeIndex:0,offset:0}}function D(e){let t=e.anchor,n=e.focus,l=!1;try{let e=t.getNode(),r=n.getNode();(!e.isAttached()||!r.isAttached()||(0,s.kFe)(e)&&t.offset>e.getTextContentSize()||(0,s.kFe)(r)&&n.offset>r.getTextContentSize())&&(l=!0)}catch(e){l=!0}return l}function P(e){let t=e.getParent();if(null!==t){let n=e.getWritable(),l=t.getWritable(),r=e.getPreviousSibling(),s=e.getNextSibling();if(null===r)if(null!==s){let e=s.getWritable();l.__first=s.__key,e.__prev=null}else l.__first=null;else{let e=r.getWritable();if(null!==s){let t=s.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===s)if(null!==r){let e=r.getWritable();l.__last=r.__key,e.__next=null}else l.__last=null;else{let e=s.getWritable();if(null!==r){let t=r.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}l.__size--,n.__parent=null}}class L{constructor(e,t,n){this._key="",this._xmlElem=e,this._parent=t,this._type=n}getPrevNode(e){if(null===e)return null;let t=e.get(this._key);return(0,s.Cyw)(t)?t:null}getNode(){let e=(0,s.nsf)(this._key);return(0,s.Cyw)(e)?e:null}getSharedType(){return this._xmlElem}getType(){return this._type}getKey(){return this._key}getSize(){return 1}getOffset(){return this._parent.getChildOffset(this)}syncPropertiesFromLexical(e,t,n){let l=this.getPrevNode(n);I(e,this._xmlElem,l,t)}syncPropertiesFromYjs(e,t){let n=this.getNode();null===n&&h(83),E(e,this._xmlElem,n,t)}destroy(e){let t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function A(e,t,n){let l=new L(e,t,n);return e._collabNode=l,l}class j{constructor(e,t,n){this._key="",this._children=[],this._xmlText=e,this._type=n,this._parent=t}getPrevNode(e){if(null===e)return null;let t=e.get(this._key);return(0,s.ff4)(t)?t:null}getNode(){let e=(0,s.nsf)(this._key);return(0,s.ff4)(e)?e:null}getSharedType(){return this._xmlText}getType(){return this._type}getKey(){return this._key}isEmpty(){return 0===this._children.length}getSize(){return 1}getOffset(){let e=this._parent;return null===e&&h(90),e.getChildOffset(this)}syncPropertiesFromYjs(e,t){let n=this.getNode();null===n&&h(91),E(e,this._xmlText,n,t)}applyChildrenYjsDelta(e,t){let n=this._children,l=0,r=null;for(let s=0;s<t.length;s++){let o=t[s],i=o.insert,a=o.delete;if(null!=o.retain)l+=o.retain;else if("number"==typeof a){let e=a;for(;e>0;){let{node:t,nodeIndex:r,offset:s,length:o}=O(this,l,!1);if(t instanceof j||t instanceof g||t instanceof L)n.splice(r,1),e-=1;else{if(!(t instanceof m))break;{let l=Math.min(e,o),i=0!==r?n[r-1]:null,a=t.getSize();if(0===s&&o===a){n.splice(r,1);let e=F(t._text,s,l-1,"");e.length>0&&(i instanceof m?i._text+=e:this._xmlText.delete(s,e.length))}else t._text=F(t._text,s,l,"");e-=l}}}}else{if(null==i)throw Error("Unexpected delta format");if("string"==typeof i){let{node:e,offset:t}=O(this,l,!0);e instanceof m?e._text=F(e._text,t,0,i):this._xmlText.delete(t,i.length),l+=i.length}else{let{node:t,nodeIndex:s,length:o}=O(this,l,!1),a=S(e,i,this);if(t instanceof m&&o>0&&o<t._text.length){let e=t._text,l=e.length-o;t._text=F(e,l,o,""),n.splice(s+1,0,a),r=F(e,0,l,"")}else n.splice(s,0,a);null!==r&&a instanceof m&&(a._text=r+a._text,r=null),l+=1}}}}syncChildrenFromYjs(e){let t=this.getNode();null===t&&h(92);let n=t.__key,l=f(t,null),r=l.length,o=this._children,i=o.length,a=e.collabNodeMap,c=new Set,u,d,p=0,y=null;i!==r&&(d=t.getWritable());for(let r=0;r<i;r++){let f=l[p],_=o[r],b=_.getNode(),v=_._key;if(null!==b&&f===v){let t=(0,s.kFe)(b);if(c.add(f),t)if(_._key=f,_ instanceof j){let t=_._xmlText;_.syncPropertiesFromYjs(e,null),_.applyChildrenYjsDelta(e,t.toDelta()),_.syncChildrenFromYjs(e)}else _ instanceof m?_.syncPropertiesAndTextFromYjs(e,null):_ instanceof L?_.syncPropertiesFromYjs(e,null):_ instanceof g||h(93);y=b,p++}else{if(void 0===u){u=new Set;for(let e=0;e<i;e++){let t=o[e]._key;""!==t&&u.add(t)}}if(null!==b&&void 0!==f&&!u.has(f)){P((0,s.GbW)(f)),r--,p++;continue}d=t.getWritable();let l=function(e,t,n){let l=t.getType(),r=e.editor._nodes.get(l);void 0===r&&h(88,l);let s=new r.klass;if(s.__parent=n,t._key=s.__key,t instanceof j){let n=t._xmlText;t.syncPropertiesFromYjs(e,null),t.applyChildrenYjsDelta(e,n.toDelta()),t.syncChildrenFromYjs(e)}else t instanceof m?t.syncPropertiesAndTextFromYjs(e,null):t instanceof L&&t.syncPropertiesFromYjs(e,null);return e.collabNodeMap.set(s.__key,t),s}(e,_,n),c=l.__key;if(a.set(c,_),null===y){let e=d.getFirstChild();if(d.__first=c,null!==e){let t=e.getWritable();t.__prev=c,l.__next=t.__key}}else{let e=y.getWritable(),t=y.getNextSibling();if(e.__next=c,l.__prev=y.__key,null!==t){let e=t.getWritable();e.__prev=c,l.__next=e.__key}}r===i-1&&(d.__last=c),d.__size++,y=l}}for(let t=0;t<r;t++){let n=l[t];if(!c.has(n)){let t=(0,s.GbW)(n),l=e.collabNodeMap.get(n);void 0!==l&&l.destroy(e),P(t)}}}syncPropertiesFromLexical(e,t,n){I(e,this._xmlText,this.getPrevNode(n),t)}_syncChildFromLexical(e,t,n,l,r,o){let i=this._children[t],a=(0,s.GbW)(n);i instanceof j&&(0,s.ff4)(a)?(i.syncPropertiesFromLexical(e,a,l),i.syncChildrenFromLexical(e,a,l,r,o)):i instanceof m&&(0,s.kFe)(a)?i.syncPropertiesAndTextFromLexical(e,a,l):i instanceof L&&(0,s.Cyw)(a)&&i.syncPropertiesFromLexical(e,a,l)}syncChildrenFromLexical(e,t,n,l,r){let o=this.getPrevNode(n),i=null===o?[]:f(o,n),a=f(t,null),c=i.length-1,u=a.length-1,d=e.collabNodeMap,h,g,p=0,m=0;for(;p<=c&&m<=u;){let t=i[p],o=a[m];if(t===o)this._syncChildFromLexical(e,m,o,n,l,r),p++,m++;else{void 0===h&&(h=new Set(i)),void 0===g&&(g=new Set(a));let n=g.has(t),l=h.has(o);if(n){let t=C(e,(0,s.GbW)(o),this);d.set(o,t),l?(this.splice(e,m,1,t),p++):this.splice(e,m,0,t),m++}else this.splice(e,m,1),p++}}let y=p>c,_=m>u;if(y&&!_)for(;m<=u;++m){let t=a[m],n=C(e,(0,s.GbW)(t),this);this.append(n),d.set(t,n)}else if(_&&!y)for(let t=this._children.length-1;t>=m;t--)this.splice(e,t,1)}append(e){let t=this._xmlText,n=this._children,l=n[n.length-1],r=void 0!==l?l.getOffset()+l.getSize():0;if(e instanceof j)t.insertEmbed(r,e._xmlText);else if(e instanceof m){let n=e._map;null===n.parent&&t.insertEmbed(r,n),t.insert(r+1,e._text)}else e instanceof g?t.insertEmbed(r,e._map):e instanceof L&&t.insertEmbed(r,e._xmlElem);this._children.push(e)}splice(e,t,n,l){let r=this._children,s=r[t];if(void 0===s)return void 0===l&&h(94),void this.append(l);let o=s.getOffset();-1===o&&h(95);let i=this._xmlText;if(0!==n&&i.delete(o,s.getSize()),l instanceof j)i.insertEmbed(o,l._xmlText);else if(l instanceof m){let e=l._map;null===e.parent&&i.insertEmbed(o,e),i.insert(o+1,l._text)}else l instanceof g?i.insertEmbed(o,l._map):l instanceof L&&i.insertEmbed(o,l._xmlElem);if(0!==n){let l=r.slice(t,t+n);for(let t=0;t<l.length;t++)l[t].destroy(e)}void 0!==l?r.splice(t,n,l):r.splice(t,n)}getChildOffset(e){let t=0,n=this._children;for(let l=0;l<n.length;l++){let r=n[l];if(r===e)return t;t+=r.getSize()}return -1}destroy(e){let t=e.collabNodeMap,n=this._children;for(let t=0;t<n.length;t++)n[t].destroy(e);t.get(this._key)===this&&t.delete(this._key)}}function M(e,t,n){let l=new j(e,t,n);return e._collabNode=l,l}function R(e,t){let n=t.collabNodeMap.get(e.key);if(void 0===n)return null;let l=e.offset,r=n.getSharedType();if(n instanceof m){r=n._parent._xmlText;let e=n.getOffset();if(-1===e)return null;l=e+1+l}else if(n instanceof j&&"element"===e.type){let t=e.getNode();(0,s.ff4)(t)||h(184);let n=0,r=0,o=t.getFirstChild();for(;null!==o&&r++<l;)(0,s.kFe)(o)?n+=o.getTextContentSize()+1:n++,o=o.getNextSibling();l=n}return(0,o.SF)(r,l)}function $(e,t){return(0,o.IT)(e,t.doc)}function U(e,t){if(null==e){if(null!=t)return!0}else if(null==t||!(0,o.uG)(e,t))return!0;return!1}function B(e,t){let n=e.cursorsContainer;if(null!==n){let e=t.selections,l=e.length;for(let t=0;t<l;t++)n.removeChild(e[t])}}function z(e,t){let{anchorPos:n,focusPos:l}=t,r=null,s=0,o=null,i=0;if(null!==n&&null!==l){let t=$(n,e),a=$(l,e);null!==t&&null!==a&&([r,s]=H(t.type,t.index),[o,i]=H(a.type,a.index))}return{anchorCollabNode:r,anchorOffset:s,focusCollabNode:o,focusOffset:i}}function W(e,t){let n=t.awareness.getLocalState();if(null===n)return;let{anchorCollabNode:l,anchorOffset:r,focusCollabNode:o,focusOffset:i}=z(e,n);if(null!==l&&null!==o){let e=l.getKey(),t=o.getKey(),n=(0,s.vJq)();if(!(0,s.I2P)(n))return;J(n.anchor,e,r),J(n.focus,t,i)}}function J(e,t,n){if(e.key!==t||e.offset!==n){let l=(0,s.nsf)(t);if(null!==l&&!(0,s.ff4)(l)&&!(0,s.kFe)(l)){let e=l.getParentOrThrow();t=e.getKey(),n=l.getIndexWithinParent(),l=e}e.set(t,n,(0,s.ff4)(l)?"element":"text")}}function H(e,t){let n=e._collabNode;if(void 0===n)return[null,0];if(n instanceof j){let{node:e,offset:l}=O(n,t,!0);return null===e?[n,0]:[e,l]}return[null,0]}function K(e,t){let n=Array.from(t.awareness.getStates()),l=e.clientID,r=e.cursors,o=e.editor._editorState._nodeMap,i=new Set;for(let t=0;t<n.length;t++){let[a,c]=n[t];if(a!==l){i.add(a);let{name:t,color:n,focusing:l}=c,u=null,f=r.get(a);if(void 0===f&&(f={color:n,name:t,selection:null},r.set(a,f)),l){let{anchorCollabNode:t,anchorOffset:n,focusCollabNode:l,focusOffset:r}=z(e,c);if(null!==t&&null!==l){let e=t.getKey(),s=l.getKey();if(null===(u=f.selection))u=function(e,t,n,l,r){let s=e.color,o=document.createElement("span");o.style.cssText=`position:absolute;top:0;bottom:0;right:-1px;width:1px;background-color:${s};z-index:10;`;let i=document.createElement("span");return i.textContent=e.name,i.style.cssText=`position:absolute;left:-2px;top:-16px;background-color:${s};color:#fff;line-height:12px;font-size:12px;padding:2px;font-family:Arial;font-weight:bold;white-space:nowrap;`,o.appendChild(i),{anchor:{key:t,offset:n},caret:o,color:s,focus:{key:l,offset:r},name:i,selections:[]}}(f,e,n,s,r);else{let t=u.anchor,l=u.focus;t.key=e,t.offset=n,l.key=s,l.offset=r}}}!function(e,t,n,l){let r,o=e.editor,i=o.getRootElement(),a=e.cursorsContainer;if(null===a||null===i)return;let c=a.offsetParent;if(null===c)return;let u=c.getBoundingClientRect(),f=t.selection;if(null===n)return null===f||(t.selection=null,B(e,f));t.selection=n;let h=n.caret,g=n.color,p=n.selections,m=n.anchor,y=n.focus,_=m.key,b=y.key,v=l.get(_),w=l.get(b);if(null==v||null==w)return;if(v===w&&(0,s.wH$)(v))r=[o.getElementByKey(_).getBoundingClientRect()];else{let e=(0,d.cb)(o,v,m.offset,w,y.offset);if(null===e)return;r=(0,d.zT)(o,e)}let x=p.length,C=r.length;for(let e=0;e<C;e++){let t=r[e],n=p[e];if(void 0===n){n=document.createElement("span"),p[e]=n;let t=document.createElement("span");n.appendChild(t),a.appendChild(n)}let l=`position:absolute;top:${t.top-u.top}px;left:${t.left-u.left}px;height:${t.height}px;width:${t.width}px;pointer-events:none;z-index:5;`;n.style.cssText=l,n.firstChild.style.cssText=`${l}left:0;top:0;background-color:${g};opacity:0.3;`,e===C-1&&h.parentNode!==n&&n.appendChild(h)}for(let e=x-1;e>=C;e--){let t=p[e];a.removeChild(t),p.pop()}}(e,f,u,o)}}let a=Array.from(r.keys());for(let t=0;t<a.length;t++){let n=a[t];if(!i.has(n)){let t=r.get(n);void 0!==t&&(function(e,t){let n=t.selection;null!==n&&B(e,n)}(e,t),r.delete(n))}}}function Y(e,t,n,l){let r=t.awareness,o=r.getLocalState();if(null===o)return;let{anchorPos:i,focusPos:a,name:c,color:u,focusing:f,awarenessData:d}=o,h=null,g=null;(null!==l&&(null===i||l.is(n))||null!==n)&&((0,s.I2P)(l)&&(h=R(l.anchor,e),g=R(l.focus,e)),(U(i,h)||U(a,g))&&r.setLocalState({...o,anchorPos:h,awarenessData:d,color:u,focusPos:g,focusing:f,name:c}))}let G=(0,s.guI)("CONNECTED_COMMAND"),Z=(0,s.guI)("TOGGLE_CONNECT_COMMAND");function Q(e,t,n,l,r){let{awareness:s}=e,o=s.getLocalState();null===o&&(o={anchorPos:null,awarenessData:r,color:n,focusPos:null,focusing:l,name:t}),o.focusing=l,s.setLocalState(o)}var q=n(12115),V=n(92749),X=n(47650),ee=n(95155);function et({id:e,providerFactory:t,shouldBootstrap:n,username:s,cursorColor:i,cursorsContainerRef:a,initialEditorState:c,excludedProperties:u,awarenessData:f}){let d=(0,q.useRef)(!1),g=(0,q.useRef)(!1),p=(0,l.k)(s,i),{yjsDocMap:m,name:y,color:_}=p,[b]=(0,r.DF)();(0,q.useEffect)(()=>(p.isCollabActive=!0,()=>{null==b._parentEditor&&(p.isCollabActive=!1)}),[p,b]);let[v,w]=(0,q.useState)();(0,q.useEffect)(()=>{if(g.current)return;g.current=!0;let n=t(e,m);return w(n),()=>{n.disconnect()}},[e,t,m]);let[x,C]=(0,q.useState)(m.get(e)),[k,S]=(0,q.useState)();return(0,q.useEffect)(()=>{if(!v||d.current)return;d.current=!0;let t=function(e,t,n,l,r,s){null==l&&h(81);let i=M(l.get("root",o.ZQ),null,"root");return i._key="root",{clientID:l.clientID,collabNodeMap:new Map,cursors:new Map,cursorsContainer:null,doc:l,docMap:r,editor:e,excludedProperties:s||new Map,id:n,nodeProperties:new Map,root:i}}(b,0,e,x||m.get(e),m,u);return S(t),()=>{t.root.destroy(t)}},[b,v,e,m,x,u]),v&&k?(0,ee.jsx)(en,{awarenessData:f,binding:k,collabContext:p,color:_,cursorsContainerRef:a,editor:b,id:e,initialEditorState:c,name:y,provider:v,setDoc:C,shouldBootstrap:n,yjsDocMap:m}):(0,ee.jsx)(ee.Fragment,{})}function en({editor:e,id:t,provider:n,yjsDocMap:l,name:r,color:i,shouldBootstrap:a,cursorsContainerRef:c,initialEditorState:u,awarenessData:f,collabContext:d,binding:g,setDoc:p}){let y=function(e,t,n,l,r,i,a,c,u,f,d,g,p=K){let y=(0,q.useRef)(!1),_=(0,q.useCallback)(()=>n.connect(),[n]),b=(0,q.useCallback)(()=>{try{n.disconnect()}catch(e){}},[n]);(0,q.useEffect)(()=>{var f,v;let{root:w}=c,{awareness:x}=n,C=({status:t})=>{e.dispatchCommand(G,"connected"===t)},E=t=>{a&&t&&w.isEmpty()&&0===w._xmlText._length&&!1===y.current&&e.update(()=>{let t=(0,s.NiT)();if(t.isEmpty())if(d)switch(typeof d){case"string":{let t=e.parseEditorState(d);e.setEditorState(t,{tag:"history-merge"});break}case"object":e.setEditorState(d,{tag:"history-merge"});break;case"function":e.update(()=>{(0,s.NiT)().isEmpty()&&d(e)},{tag:"history-merge"})}else{let n=(0,s.lJ7)();t.append(n);let{activeElement:l}=document;(null!==(0,s.vJq)()||null!==l&&l===e.getRootElement())&&n.select()}},{tag:"history-merge"}),y.current=!1},T=()=>{p(c,n)},N=(e,t)=>{let l=t.origin;l!==c&&function(e,t,n,l,r=K){let i=e.editor,a=i._editorState;n.forEach(e=>e.delta),i.update(()=>{for(let t=0;t<n.length;t++)!function(e,t){if(t instanceof o.Cr&&function(e,t){let{target:n}=t;if(!n._item||"__state"!==n._item.parentSub||void 0!==k(n)||!(n.parent instanceof o.ZQ||n.parent instanceof o.WF||n.parent instanceof o.T5))return!1;let l=S(e,n.parent).getNode();if(l){let e=(0,s.swd)(l.getWritable());for(let l of t.keysChanged)e.updateFromUnknown(l,n.get(l))}return!0}(e,t))return;let{target:n}=t,l=S(e,n);if(l instanceof j&&t instanceof o.zN){let{keysChanged:n,childListChanged:r,delta:s}=t;n.size>0&&l.syncPropertiesFromYjs(e,n),r&&(l.applyChildrenYjsDelta(e,s),l.syncChildrenFromYjs(e))}else if(l instanceof m&&t instanceof o.Cr){let{keysChanged:n}=t;n.size>0&&l.syncPropertiesAndTextFromYjs(e,n)}else if(l instanceof L&&t instanceof o.xz){let{attributesChanged:n}=t;n.size>0&&l.syncPropertiesFromYjs(e,n)}else h(82)}(e,n[t]);let r=(0,s.vJq)();if((0,s.I2P)(r))if(D(r)){let n=a._selection;(0,s.I2P)(n)&&(W(e,t),D(r))&&function e(t,n){let l=n._nodeMap.get(t);if(!l)return void(0,s.NiT)().selectStart();let r=l.__prev,o=null;r&&(o=(0,s.nsf)(r)),null===o&&null!==l.__parent&&(o=(0,s.nsf)(l.__parent)),null!==o?null!==o&&o.isAttached()?o.selectEnd():e(o.__key,n):(0,s.NiT)().selectStart()}(r.anchor.key,a),Y(e,t,n,(0,s.vJq)())}else W(e,t);l||(0,s.JAT)("skip-scroll-into-view")},{onUpdate:()=>{r(e,t),i.update(()=>{0===(0,s.NiT)().getChildrenSize()&&(0,s.NiT)().append((0,s.lJ7)())})},skipTransforms:!0,tag:l?"historic":"collaboration"})}(c,n,e,l instanceof o.ad,p)};f=document.activeElement===e.getRootElement(),v=g||{},n.awareness.setLocalState({anchorPos:null,awarenessData:v,color:i,focusPos:null,focusing:f,name:r});let I=n=>{!function(e,t){if(e.update(()=>{let e=(0,s.NiT)();e.clear(),e.select()},{tag:"skip-collab"}),null==t.cursors)return;let n=t.cursors;if(null==n)return;let l=t.cursorsContainer;if(null==l)return;let r=Array.from(n.values());for(let e=0;e<r.length;e++){let t=r[e].selection;if(t&&null!=t.selections){let n=t.selections;for(let t=0;t<n.length;t++)l.removeChild(n[e])}}}(e,c),u(n),l.set(t,n),y.current=!0};n.on("reload",I),n.on("status",C),n.on("sync",E),x.on("update",T),w.getSharedType().observeDeep(N);let F=e.registerUpdateListener(({prevEditorState:e,editorState:t,dirtyLeaves:l,dirtyElements:r,normalizedNodes:o,tags:i})=>{!1===i.has("skip-collab")&&c.doc.transact(()=>{t.read(()=>{if(i.has("collaboration")||i.has("historic"))return void(o.size>0&&function(e,t){let n=Array.from(t),l=e.collabNodeMap,r=[],o=[];for(let e=0;e<n.length;e++){let t=n[e],i=(0,s.nsf)(t),a=l.get(t);if(a instanceof m)if((0,s.kFe)(i))r.push([a,i.__text]);else{let e=a.getOffset();if(-1===e)continue;let t=a._parent;a._normalized=!0,t._xmlText.delete(e,1),o.push(a)}}for(let e=0;e<o.length;e++){let t=o[e],n=t.getKey();l.delete(n);let r=t._parent._children,s=r.indexOf(t);r.splice(s,1)}for(let e=0;e<r.length;e++){let[t,n]=r[e];t._text=n}}(c,o));if(r.has("root")){let t=e._nodeMap,n=(0,s.NiT)(),o=c.root;o.syncPropertiesFromLexical(c,n,t),o.syncChildrenFromLexical(c,n,t,r,l)}let t=(0,s.vJq)();Y(c,n,e._selection,t)})},c)}),O=_();return()=>{!1===y.current&&(O?O.then(b):b()),n.off("sync",E),n.off("status",C),n.off("reload",I),x.off("update",T),w.getSharedType().unobserveDeep(N),l.delete(t),F()}},[c,i,_,b,l,e,t,d,r,n,a,g,u,p]);let v=(0,q.useMemo)(()=>(0,X.createPortal)((0,ee.jsx)("div",{ref:e=>{c.cursorsContainer=e}}),f&&f.current||document.body),[c,f]);return(0,q.useEffect)(()=>e.registerCommand(Z,e=>(e?(console.log("Collaboration connected!"),_()):(console.log("Collaboration disconnected!"),b()),!0),s.jZM),[_,b,e]),v}(e,t,n,l,r,i,a,g,p,c,u,f);return d.clientID=g.clientID,function(e,t){let n=(0,q.useMemo)(()=>{var e;return e=t.root.getSharedType(),new o.ad(e,{trackedOrigins:new Set([t,null])})},[t]);(0,q.useEffect)(()=>(0,V.Sd)(e.registerCommand(s.ZKf,()=>(n.undo(),!0),s.jZM),e.registerCommand(s.V30,()=>(n.redo(),!0),s.jZM))),(0,q.useCallback)(()=>{n.clear()},[n]),q.useEffect(()=>{let t=()=>{e.dispatchCommand(s.KfJ,n.undoStack.length>0),e.dispatchCommand(s.WWb,n.redoStack.length>0)};return n.on("stack-item-added",t),n.on("stack-item-popped",t),n.on("stack-cleared",t),()=>{n.off("stack-item-added",t),n.off("stack-item-popped",t),n.off("stack-cleared",t)}},[e,n])}(e,g),(0,q.useEffect)(()=>(0,V.Sd)(e.registerCommand(s.$7r,()=>(Q(n,r,i,!0,f||{}),!1),s.jZM),e.registerCommand(s.I2H,()=>(Q(n,r,i,!1,f||{}),!1),s.jZM)),[i,e,r,n,f]),y}},50047:(e,t,n)=>{n.d(t,{$5:()=>r,n:()=>s});let l=e=>({[Symbol.iterator](){return this},next:e}),r=(e,t)=>l(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),s=(e,t)=>l(()=>{let{done:n,value:l}=e.next();return{done:n,value:n?void 0:t(l)}})},55498:(e,t,n)=>{n.d(t,{vt:()=>l});let l=e=>new Promise(e);Promise.all.bind(Promise)},57717:(e,t,n)=>{n.d(t,{EK:()=>c,OK:()=>s,id:()=>o,vo:()=>a});var l=n(57802),r=n(67402);let s=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&s(e,t,n+1)}},o=e=>e,i=(e,t)=>e===t,a=(e,t)=>{if(null==e||null==t)return i(e,t);if(e.constructor!==t.constructor)return!1;if(e===t)return!0;switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!a(e.get(n),t.get(n)))return!1;break;case Object:if(r.Bw(e)!==r.Bw(t))return!1;for(let n in e)if(!r.i5(e,n)||!a(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!a(e[n],t[n]))return!1;break;default:return!1}return!0},c=(e,t)=>t.includes(e);l.cy},57802:(e,t,n)=>{n.d(t,{HT:()=>s,HV:()=>l,S2:()=>r,cy:()=>i,zN:()=>o});let l=e=>e[e.length-1],r=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},s=Array.from,o=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},i=Array.isArray},61077:(e,t,n)=>{n.d(t,{C:()=>r,Tj:()=>o,_4:()=>s,bz:()=>i,vt:()=>l});let l=()=>new Map,r=e=>{let t=l();return e.forEach((e,n)=>{t.set(n,e)}),t},s=(e,t,n)=>{let l=e.get(t);return void 0===l&&e.set(t,l=n()),l},o=(e,t)=>{let n=[];for(let[l,r]of e)n.push(t(r,l));return n},i=(e,t)=>{for(let[n,l]of e)if(t(l,n))return!0;return!1}},63108:(e,t,n)=>{n.d(t,{Af:()=>u,QV:()=>l,db:()=>c,jN:()=>a,tv:()=>f});let l=String.fromCharCode;String.fromCodePoint,l(65535);let r=e=>e.toLowerCase(),s=/^\s*/g,o=e=>e.replace(s,""),i=/([A-Z])/g,a=(e,t)=>o(e.replace(i,e=>`${t}${r(e)}`)),c="undefined"!=typeof TextEncoder?new TextEncoder:null,u=c?e=>c.encode(e):e=>{let t=unescape(encodeURIComponent(e)),n=t.length,l=new Uint8Array(n);for(let e=0;e<n;e++)l[e]=t.codePointAt(e);return l},f="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});f&&1===f.decode(new Uint8Array).length&&(f=null)},67402:(e,t,n)=>{n.d(t,{Bw:()=>i,Im:()=>c,SQ:()=>d,Tj:()=>o,i5:()=>f,jJ:()=>s,kp:()=>l,ol:()=>g});let l=Object.assign,r=Object.keys,s=(e,t)=>{for(let n in e)t(e[n],n)},o=(e,t)=>{let n=[];for(let l in e)n.push(t(e[l],l));return n},i=e=>r(e).length,a=e=>r(e).length,c=e=>{for(let t in e)return!1;return!0},u=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},f=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d=(e,t)=>e===t||a(e)===a(t)&&u(e,(e,n)=>(void 0!==e||f(t,n))&&t[n]===e),h=Object.freeze,g=e=>{for(let t in e){let n=e[t];("object"==typeof n||"function"==typeof n)&&g(e[t])}return h(e)}},68665:(e,t,n)=>{n.d(t,{S8:()=>r,gZ:()=>s}),crypto.subtle;let l=crypto.getRandomValues.bind(crypto),r=()=>l(new Uint32Array(1))[0],s=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(e^r()&15>>e/4).toString(16))},71055:(e,t,n)=>{n.d(t,{CW:()=>g,D1:()=>s,D7:()=>a,Dk:()=>l,KD:()=>r,KJ:()=>i,P1:()=>f,WD:()=>d,WY:()=>u,vZ:()=>h,wn:()=>o,wt:()=>c});let l=1,r=2,s=4,o=8,i=32,a=64,c=128,u=31,f=63,d=127,h=0x7fffffff,g=0xffffffff},78176:(e,t,n)=>{n.d(t,{ft:()=>i,Y:()=>s,AV:()=>c,Qu:()=>a,hN:()=>d,hr:()=>f,UH:()=>u,Ny:()=>o,Tx:()=>h,ET:()=>g});let l=Symbol;var r=n(90224);let s=l(),o=l(),i=l(),a=l(),c=l(),u=l(),f=l(),d=l(),h=l(),g=e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],l=0;for(;l<e.length;l++){let n=e[l];if(void 0===n)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(l>0&&n.push(t.join(""));l<e.length;l++){let t=e[l];t instanceof Symbol||n.push(t)}return n};r._g()},83600:(e,t,n)=>{n.d(t,{Bw:()=>u,D$:()=>O,FA:()=>P,Fo:()=>f,Gu:()=>w,IO:()=>N,LH:()=>v,QJ:()=>g,Qj:()=>b,Sw:()=>L,cq:()=>I,xv:()=>c,zd:()=>p});var l=n(88755),r=n(99968),s=n(71055),o=n(63108),i=n(57802);class a{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}let c=()=>new a,u=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},f=e=>{let t=new Uint8Array(u(e)),n=0;for(let l=0;l<e.bufs.length;l++){let r=e.bufs[l];t.set(r,n),n+=r.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},d=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(2*l.T9(n,t)),e.cpos=0)},h=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(2*n),e.cpos=0),e.cbuf[e.cpos++]=t},g=h,p=(e,t)=>{for(;t>s.WD;)h(e,s.wt|s.WD&t),t=l.RI(t/128);h(e,s.WD&t)},m=(e,t)=>{let n=l.sj(t);for(n&&(t=-t),h(e,(t>s.P1?s.wt:0)|(n?s.D7:0)|s.P1&t),t=l.RI(t/64);t>0;)h(e,(t>s.WD?s.wt:0)|s.WD&t),t=l.RI(t/128)},y=new Uint8Array(3e4),_=y.length/3,b=o.db&&o.db.encodeInto?(e,t)=>{if(t.length<_){let n=o.db.encodeInto(t,y).written||0;p(e,n);for(let t=0;t<n;t++)h(e,y[t])}else w(e,o.Af(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),l=n.length;p(e,l);for(let t=0;t<l;t++)h(e,n.codePointAt(t))},v=(e,t)=>{let n=e.cbuf.length,r=e.cpos,s=l.jk(n-r,t.length),o=t.length-s;e.cbuf.set(t.subarray(0,s),r),e.cpos+=s,o>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(l.T9(2*n,o)),e.cbuf.set(t.subarray(s)),e.cpos=o)},w=(e,t)=>{p(e,t.byteLength),v(e,t)},x=(e,t)=>{d(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},C=(e,t)=>x(e,4).setFloat32(0,t,!1),k=(e,t)=>x(e,8).setFloat64(0,t,!1),S=(e,t)=>x(e,8).setBigInt64(0,t,!1),E=new DataView(new ArrayBuffer(4)),T=e=>(E.setFloat32(0,e),E.getFloat32(0)===e),N=(e,t)=>{switch(typeof t){case"string":h(e,119),b(e,t);break;case"number":r.Fq(t)&&l.tn(t)<=s.vZ?(h(e,125),m(e,t)):T(t)?(h(e,124),C(e,t)):(h(e,123),k(e,t));break;case"bigint":h(e,122),S(e,t);break;case"object":if(null===t)h(e,126);else if(i.cy(t)){h(e,117),p(e,t.length);for(let n=0;n<t.length;n++)N(e,t[n])}else if(t instanceof Uint8Array)h(e,116),w(e,t);else{h(e,118);let n=Object.keys(t);p(e,n.length);for(let l=0;l<n.length;l++){let r=n[l];b(e,r),N(e,t[r])}}break;case"boolean":h(e,t?120:121);break;default:h(e,127)}};class I extends a{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&p(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}let F=e=>{e.count>0&&(m(e.encoder,1===e.count?e.s:-e.s),e.count>1&&p(e.encoder,e.count-2))};class O{constructor(){this.encoder=new a,this.s=0,this.count=0}write(e){this.s===e?this.count++:(F(this),this.count=1,this.s=e)}toUint8Array(){return F(this),f(this.encoder)}}let D=e=>{if(e.count>0){let t=2*e.diff+ +(1!==e.count);m(e.encoder,t),e.count>1&&p(e.encoder,e.count-2)}};class P{constructor(){this.encoder=new a,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(D(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return D(this),f(this.encoder)}}class L{constructor(){this.sarr=[],this.s="",this.lensE=new O}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){let e=new a;return this.sarr.push(this.s),this.s="",b(e,this.sarr.join("")),v(e,this.lensE.toUint8Array()),f(e)}}},88755:(e,t,n)=>{n.d(t,{RI:()=>l,T9:()=>o,jk:()=>s,n7:()=>i,sj:()=>a,tn:()=>r});let l=Math.floor,r=Math.abs,s=(e,t)=>e<t?e:t,o=(e,t)=>e>t?e:t,i=Math.pow,a=e=>0!==e?e<0:1/e<0},90142:(e,t,n)=>{n.d(t,{k:()=>i});var l=n(12115);let r=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],s=r[Math.floor(Math.random()*r.length)],o=(0,l.createContext)({clientID:0,color:s[1],isCollabActive:!1,name:s[0],yjsDocMap:new Map});function i(e,t){let n=(0,l.useContext)(o);return null!=e&&(n.name=e),null!=t&&(n.color=t),n}},90224:(e,t,n)=>{n.d(t,{_g:()=>l});let l=Date.now},95279:(e,t,n)=>{n.d(t,{vt:()=>l});let l=()=>new Set},95460:(e,t,n)=>{n.d(t,{W:()=>o,c:()=>i});var l=n(61077),r=n(95279),s=n(57802);class o{constructor(){this._observers=l.vt()}on(e,t){return l._4(this._observers,e,r.vt).add(t),t}once(e,t){let n=(...l)=>{this.off(e,n),t(...l)};this.on(e,n)}off(e,t){let n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return s.HT((this._observers.get(e)||l.vt()).values()).forEach(e=>e(...t))}destroy(){this._observers=l.vt()}}class i{constructor(){this._observers=l.vt()}on(e,t){l._4(this._observers,e,r.vt).add(t)}once(e,t){let n=(...l)=>{this.off(e,n),t(...l)};this.on(e,n)}off(e,t){let n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return s.HT((this._observers.get(e)||l.vt()).values()).forEach(e=>e(...t))}destroy(){this._observers=l.vt()}}},98628:(e,t,n)=>{n.d(t,{$C:()=>f,Ib:()=>S,Jg:()=>w,VQ:()=>C,bo:()=>g,cQ:()=>x,cw:()=>m,t3:()=>_,xK:()=>k,xh:()=>p});var l=n(71055),r=n(88755),s=n(99968),o=n(63108),i=n(32293);let a=i.vt("Unexpected end of array"),c=i.vt("Integer out of Range");class u{constructor(e){this.arr=e,this.pos=0}}let f=e=>new u(e),d=e=>e.pos!==e.arr.length,h=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},g=e=>h(e,m(e)),p=e=>e.arr[e.pos++],m=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&l.WD)*n,n*=128,r<l.wt)return t;if(t>s.Is)throw c}throw a},y=e=>{let t=e.arr[e.pos++],n=t&l.P1,r=64,o=(t&l.D7)>0?-1:1;if((t&l.wt)==0)return o*n;let i=e.arr.length;for(;e.pos<i;){if(n+=((t=e.arr[e.pos++])&l.WD)*r,r*=128,t<l.wt)return o*n;if(n>s.Is)throw c}throw a},_=o.tv?e=>o.tv.decode(g(e)):e=>{let t=m(e);if(0===t)return"";{let n=String.fromCodePoint(p(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(p(e));else for(;t>0;){let l=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+l);e.pos+=l,n+=String.fromCodePoint.apply(null,r),t-=l}return decodeURIComponent(escape(n))}},b=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},v=[e=>void 0,e=>null,y,e=>b(e,4).getFloat32(0,!1),e=>b(e,8).getFloat64(0,!1),e=>b(e,8).getBigInt64(0,!1),e=>!1,e=>!0,_,e=>{let t=m(e),n={};for(let l=0;l<t;l++)n[_(e)]=w(e);return n},e=>{let t=m(e),n=[];for(let l=0;l<t;l++)n.push(w(e));return n},g],w=e=>v[127-p(e)](e);class x extends u{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),d(this)?this.count=m(this)+1:this.count=-1),this.count--,this.s}}class C extends u{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=y(this);let e=r.sj(this.s);this.count=1,e&&(this.s=-this.s,this.count=m(this)+2)}return this.count--,this.s}}class k extends u{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){let e=y(this);this.diff=r.RI(e/2),this.count=1,1&e&&(this.count=m(this)+2)}return this.s+=this.diff,this.count--,this.s}}class S{constructor(e){this.decoder=new C(e),this.str=_(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}},99968:(e,t,n)=>{n.d(t,{Fq:()=>o,Is:()=>s});var l=n(88755),r=n(71055);let s=Number.MAX_SAFE_INTEGER;Number.MIN_SAFE_INTEGER,r.vZ,r.CW;let o=Number.isInteger||(e=>"number"==typeof e&&isFinite(e)&&l.RI(e)===e);Number.parseInt}}]);