"use strict";const l=require("react"),c=require("./main-CvXvpNbP.cjs"),b=[["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)"]],h=b[Math.floor(Math.random()*b.length)],D=l.createContext({clientID:0,color:h[1],isCollabActive:!1,name:h[0],yjsDocMap:new Map});function E(e,t){return l.useContext(D)}function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k=O(function(e){const t=new URLSearchParams;t.append("code",e);for(let n=1;n<arguments.length;n++)t.append("v",arguments[n]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function m(e){const t=e.transform();return t!==null?new Set([t]):new Set}function j({initialEditor:e,children:t,initialNodes:n,initialTheme:v,skipCollabChecks:x}){const f=l.useRef(!1),u=l.useContext(c.l);u==null&&k(9);const[a,{getTheme:M}]=u,_=l.useMemo(()=>{const i=v||M()||void 0,C=c.o(u,i);if(i!==void 0&&(e._config.theme=i),e._parentEditor=a,n)for(let r of n){let s=null,o=null;if(typeof r!="function"){const g=r;r=g.replace,s=g.with,o=g.withKlass||null}const p=e._nodes.get(r.getType());e._nodes.set(r.getType(),{exportDOM:p?p.exportDOM:void 0,klass:r,replace:s,replaceWithKlass:o,transforms:m(r)})}else{const r=e._nodes=new Map(a._nodes);for(const[s,o]of r)e._nodes.set(s,{exportDOM:o.exportDOM,klass:o.klass,replace:o.replace,replaceWithKlass:o.replaceWithKlass,transforms:m(o.klass)})}return e._config.namespace=a._config.namespace,e._editable=a._editable,[e,C]},[]),{isCollabActive:w,yjsDocMap:y}=E(),d=x||f.current||y.has(e.getKey());return l.useEffect(()=>{d&&(f.current=!0)},[d]),l.useEffect(()=>a.registerEditableListener(i=>{e.setEditable(i)}),[e,a]),c.jsxRuntimeExports.jsx(c.l.Provider,{value:_,children:!w||d?t:null})}exports.d=j;
