@inkeep/open-knowledge 0.0.0-dev-20260501144307 → 0.0.0-dev-20260501150416
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +5 -5
- package/dist/constants-CGiUuTdz.mjs +2 -0
- package/dist/{dist-B-uWyCj3.mjs → dist-B969m3rv.mjs} +1 -1
- package/dist/{dist-WQbZIrx7.mjs → dist-BR3nldpO.mjs} +2 -2
- package/dist/{dist-CUghvkAf.mjs → dist-oDoSs1Bl.mjs} +7 -7
- package/dist/index.mjs +1 -1
- package/dist/init-0WpsEJer.mjs +1 -0
- package/dist/{init-DpiVQYhQ.mjs → init-B3ijkT7_.mjs} +3 -3
- package/dist/init-BRl7X3F9.mjs +1 -0
- package/dist/{init-qoXDcT6N.mjs → init-Czgpyj7J.mjs} +2 -2
- package/dist/{loader-BEUtMT2_.mjs → loader-Dk5RaTzD.mjs} +2 -2
- package/dist/loader-Jnb82Nxh.mjs +1 -0
- package/dist/paths-NLm46qS1.mjs +2 -0
- package/dist/paths-s1VdY11r.mjs +1 -0
- package/dist/{preview-BIrbsSSc.mjs → preview-BkLJiEZ1.mjs} +2 -2
- package/dist/preview-DFbaN55s.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-C3KENqJ7.js → ActivityModeContent-BASIn1jX.js} +1 -1
- package/dist/public/assets/DocumentContext-CSOslMNT.js +37 -0
- package/dist/public/assets/{GraphPanel-YIuSwj1X.js → GraphPanel-D2ZevzyI.js} +2 -2
- package/dist/public/assets/OutlinePanel-D_xYEkm6.js +2 -0
- package/dist/public/assets/SettingsPane-o4hmcrlw.js +6 -0
- package/dist/public/assets/{SourceEditor-DGIgtF_h.js → SourceEditor-Bw3inYl7.js} +2 -2
- package/dist/public/assets/{config-validation-events-Dlj9dOCp.js → config-validation-events-mqmIrycG.js} +1 -1
- package/dist/public/assets/{index-DiLfeu2w.css → index-CKzUuzYV.css} +1 -1
- package/dist/public/assets/index-CRwvkGXF.js +1848 -0
- package/dist/public/assets/{target-navigation-intent-BeUCdVKa.js → target-navigation-intent-1238Z_HW.js} +1 -1
- package/dist/public/assets/{toggle-group-CyBGhndP.js → toggle-group-C5MXNna8.js} +3 -3
- package/dist/public/assets/{tooltip-FdwzzIbl.js → tooltip-CzI9zWJi.js} +1 -1
- package/dist/public/index.html +8 -8
- package/dist/{server-Bc0tGxRk.mjs → server-Cb1yd7Zc.mjs} +2 -2
- package/dist/src-BtSrIQfg.mjs +1 -0
- package/dist/start-RBQezJG7.mjs +1 -0
- package/dist/{start-BSqokDQs.mjs → start-_eaR3T65.mjs} +2 -2
- package/package.json +2 -2
- package/dist/constants-D4b3yFb4.mjs +0 -2
- package/dist/init-CleqrmS6.mjs +0 -1
- package/dist/init-D1vMwuMO.mjs +0 -1
- package/dist/loader-CwvZAVlq.mjs +0 -1
- package/dist/paths-B1biT3Kh.mjs +0 -2
- package/dist/paths-BQoQfIvS.mjs +0 -1
- package/dist/preview-BNMytxTe.mjs +0 -1
- package/dist/public/assets/DocumentContext-gM6_1mHt.js +0 -34
- package/dist/public/assets/SettingsPane-tlYUoGwR.js +0 -6
- package/dist/public/assets/clipboard-CW1hOwDY.js +0 -5
- package/dist/public/assets/index-n9oW9uU-.js +0 -1848
- package/dist/src-CGZcpVS_.mjs +0 -1
- package/dist/start-C7hQj_dW.mjs +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-C3u7R0q7.js","./dist-dkPJvrfr.js","./chunk-DECur_0Z.js","./w3c-keyname-B5t0fahT.js","./dist-RVD4DzGH.js","./dist-Dtie9-Ui.js","./dist-C82hC0q7.js","./dist-oNAFjGrp.js","./dist-mXs-_OvZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e,t}from"./chunk-DECur_0Z.js";import{i as n,n as r,t as i}from"./propagation-api-LnD10wq2.js";import{n as a,r as o,t as s}from"./compiler-runtime-Y11fyRVL.js";import{$ as c,$t as l,An as u,B as d,Bn as f,Bt as p,C as m,Cn as h,Ct as g,Dn as _,Et as v,F as y,Fn as b,Gn as x,Gt as S,H as C,Hn as w,In as T,It as E,Kt as D,L as O,M as k,N as A,Nt as j,On as M,Ot as N,P,Pn as F,Qt as I,R as L,Rt as R,S as z,Sn as B,St as V,Tt as H,U,V as ee,Vn as te,W as ne,Xt as re,Yt as W,Z as ie,Zt as ae,_n as oe,a as se,an as ce,at as le,b as ue,bt as de,c as fe,cn as pe,ct as me,d as he,dn as ge,en as _e,et as ve,f as ye,fn as be,ft as xe,gn as Se,gt as Ce,h as we,hn as Te,ht as Ee,i as De,in as Oe,jn as ke,k as Ae,kn as je,ln as Me,lt as Ne,m as Pe,mn as Fe,n as Ie,pn as Le,qn as Re,qt as ze,s as Be,sn as Ve,st as He,t as Ue,tn as We,u as Ge,un as Ke,v as qe,vn as Je,wt as Ye,x as Xe,xn as Ze,xt as Qe,y as $e,yn as et,z as tt,zn as nt}from"./toggle-group-CyBGhndP.js";import{C as rt,S as it,_ as at,a as ot,b as st,c as ct,d as lt,g as ut,i as dt,l as ft,m as pt,p as mt,r as ht,s as gt,t as _t,u as vt,x as yt}from"./button-Dyz7QGIk.js";import{S as bt,_ as xt,a as St,c as Ct,d as wt,f as Tt,g as Et,h as Dt,i as Ot,m as kt,n as At,o as jt,p as Mt,s as Nt,t as Pt,u as Ft,v as It,x as Lt,y as Rt}from"./dialog-FUclf-NK.js";import{B as zt,Bt,D as Vt,Et as Ht,G as Ut,H as Wt,I as Gt,K as Kt,L as G,M as qt,N as Jt,Nt as Yt,P as Xt,Pt as Zt,Tt as Qt,U as $t,V as en,W as tn,Y as nn,Z as rn,_ as an,a as on,b as sn,f as cn,h as ln,i as un,j as dn,jt as fn,k as pn,kt as mn,l as hn,lt as gn,o as _n,p as vn,q as yn,r as bn,s as xn,t as Sn,u as Cn,w as wn,wt as Tn,y as En,z as Dn}from"./dist-dkPJvrfr.js";import{a as On,c as kn,s as An,t as jn}from"./dist-oNAFjGrp.js";import{i as Mn,n as Nn,r as Pn,t as Fn}from"./dist-RVD4DzGH.js";var In=it(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Ln=it(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Rn=it(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),zn=it(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Bn=it(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Vn=it(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Hn=it(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Un=it(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Wn=it(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),Gn=it(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Kn=it(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),qn=it(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),Jn=it(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Yn=it(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),Xn=it(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Zn=it(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Qn=it(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),$n=it(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),er=it(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),tr=it(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),nr=it(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),rr=it(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),ir=it(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ar=it(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),or=it(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),sr=it(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),cr=it(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),lr=it(`square-play`,[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}]]),ur=it(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),dr=it(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),fr=it(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),pr=it(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),K=e(a(),1),q=o(),mr=`Collapsible`,[hr,gr]=mt(mr),[_r,vr]=hr(mr),yr=K.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=ft({prop:r,defaultProp:i??!1,onChange:o,caller:mr});return(0,q.jsx)(_r,{scope:n,disabled:a,contentId:gt(),open:c,onOpenToggle:K.useCallback(()=>l(e=>!e),[l]),children:(0,q.jsx)(pt.div,{"data-state":Tr(c),"data-disabled":a?``:void 0,...s,ref:t})})});yr.displayName=mr;var br=`CollapsibleTrigger`,xr=K.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=vr(br,n);return(0,q.jsx)(pt.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Tr(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:lt(e.onClick,i.onOpenToggle)})});xr.displayName=br;var Sr=`CollapsibleContent`,Cr=K.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=vr(Sr,e.__scopeCollapsible);return(0,q.jsx)(ct,{present:n||i.open,children:({present:e})=>(0,q.jsx)(wr,{...r,ref:t,present:e})})});Cr.displayName=Sr;var wr=K.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=vr(Sr,n),[s,c]=K.useState(r),l=K.useRef(null),u=st(t,l),d=K.useRef(0),f=d.current,p=K.useRef(0),m=p.current,h=o.open||s,g=K.useRef(h),_=K.useRef(void 0);return K.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),vt(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,q.jsx)(pt.div,{"data-state":Tr(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function Tr(e){return e?`open`:`closed`}var Er=yr,Dr=xr,Or=Cr,kr=t((e=>{var t=a();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),a=r[0].inst,l=r[1];return s(function(){a.value=n,a.getSnapshot=t,u(a)&&l({inst:a})},[e,n,t]),o(function(){return u(a)&&l({inst:a}),e(function(){u(a)&&l({inst:a})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Ar=t(((e,t)=>{t.exports=kr()}));function jr(e){let t=K.useRef({value:e,previous:e});return K.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mr=`Popover`,[Nr,Pr]=mt(Mr,[ke]),Fr=ke(),[Ir,Lr]=Nr(Mr),Rr=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Fr(t),c=K.useRef(null),[l,d]=K.useState(!1),[f,p]=ft({prop:r,defaultProp:i??!1,onChange:a,caller:Mr});return(0,q.jsx)(u,{...s,children:(0,q.jsx)(Ir,{scope:t,contentId:gt(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:K.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:l,onCustomAnchorAdd:K.useCallback(()=>d(!0),[]),onCustomAnchorRemove:K.useCallback(()=>d(!1),[]),modal:o,children:n})})};Rr.displayName=Mr;var zr=`PopoverAnchor`,Br=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Lr(zr,n),a=Fr(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return K.useEffect(()=>(o(),()=>s()),[o,s]),(0,q.jsx)(_,{...a,...r,ref:t})});Br.displayName=zr;var Vr=`PopoverTrigger`,Hr=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Lr(Vr,n),a=Fr(n),o=st(t,i.triggerRef),s=(0,q.jsx)(pt.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ri(i.open),...r,ref:o,onClick:lt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,q.jsx)(_,{asChild:!0,...a,children:s})});Hr.displayName=Vr;var Ur=`PopoverPortal`,[Wr,Gr]=Nr(Ur,{forceMount:void 0}),Kr=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Lr(Ur,t);return(0,q.jsx)(Wr,{scope:t,forceMount:n,children:(0,q.jsx)(ct,{present:n||a.open,children:(0,q.jsx)(dt,{asChild:!0,container:i,children:r})})})};Kr.displayName=Ur;var qr=`PopoverContent`,Jr=K.forwardRef((e,t)=>{let n=Gr(qr,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Lr(qr,e.__scopePopover);return(0,q.jsx)(ct,{present:r||a.open,children:a.modal?(0,q.jsx)(Xr,{...i,ref:t}):(0,q.jsx)(Zr,{...i,ref:t})})});Jr.displayName=qr;var Yr=at(`PopoverContent.RemoveScroll`),Xr=K.forwardRef((e,t)=>{let n=Lr(qr,e.__scopePopover),r=K.useRef(null),i=st(t,r),a=K.useRef(!1);return K.useEffect(()=>{let e=r.current;if(e)return Et(e)},[]),(0,q.jsx)(xt,{as:Yr,allowPinchZoom:!0,children:(0,q.jsx)(Qr,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:lt(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:lt(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:lt(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Zr=K.forwardRef((e,t)=>{let n=Lr(qr,e.__scopePopover),r=K.useRef(!1),i=K.useRef(!1);return(0,q.jsx)(Qr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Qr=K.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Lr(qr,n),p=Fr(n);return It(),(0,q.jsx)(Rt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,q.jsx)(ot,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,q.jsx)(je,{"data-state":ri(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),$r=`PopoverClose`,ei=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Lr($r,n);return(0,q.jsx)(pt.button,{type:`button`,...r,ref:t,onClick:lt(e.onClick,()=>i.onOpenChange(!1))})});ei.displayName=$r;var ti=`PopoverArrow`,ni=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Fr(n);return(0,q.jsx)(M,{...i,...r,ref:t})});ni.displayName=ti;function ri(e){return e?`open`:`closed`}var ii=Rr,ai=Br,oi=Hr,si=Kr,ci=Jr,li=`Switch`,[ui,di]=mt(li),[fi,pi]=ui(li),mi=K.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=K.useState(null),m=st(t,e=>p(e)),h=K.useRef(!1),g=f?u||!!f.closest(`form`):!0,[_,v]=ft({prop:i,defaultProp:a??!1,onChange:l,caller:li});return(0,q.jsxs)(fi,{scope:n,checked:_,disabled:s,children:[(0,q.jsx)(pt.button,{type:`button`,role:`switch`,"aria-checked":_,"aria-required":o,"data-state":yi(_),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:lt(e.onClick,e=>{v(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,q.jsx)(vi,{control:f,bubbles:!h.current,name:r,value:c,checked:_,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});mi.displayName=li;var hi=`SwitchThumb`,gi=K.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=pi(hi,n);return(0,q.jsx)(pt.span,{"data-state":yi(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});gi.displayName=hi;var _i=`SwitchBubbleInput`,vi=K.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=K.useRef(null),s=st(o,a),c=jr(n),l=w(t);return K.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,q.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});vi.displayName=_i;function yi(e){return e?`checked`:`unchecked`}var bi=mi,xi=gi,Si=e(rt(),1),Ci=Ar(),J=s(),wi=yt(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3! font-mono uppercase`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,warning:`bg-yellow-500/10 text-yellow-600 [a]:hover:bg-yellow-500/20`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`,dashed:`border-dashed border-border text-muted-foreground rounded-sm`}},defaultVariants:{variant:`default`}});function Ti(e){let t=(0,J.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a!==void 0&&a?ut:`span`,c;t[5]!==n||t[6]!==o?(c=ht(wi({variant:o}),n),t[5]=n,t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==r||t[10]!==c||t[11]!==o?(l=(0,q.jsx)(s,{"data-slot":`badge`,"data-variant":o,className:c,...r}),t[8]=s,t[9]=r,t[10]=c,t[11]=o,t[12]=l):l=t[12],l}function Ei(e){let t=e.split(`/`);return t.length<2?`ok`:`${t[0]}/${t[1]}`}function Di(e){if(!e)return;let t=Object.entries(e);if(t.length!==0)return t.map(([e,t])=>{if(t==null)return[e,String(t)];if(typeof t==`string`)return[e,t];if(typeof t==`number`||typeof t==`boolean`)return[e,String(t)];try{return[e,JSON.stringify(t)]}catch{return[e,`[unserializable]`]}})}function Y(e,t,n){if(typeof performance>`u`||!performance.measure)return;let r=Ei(e),i=Di(t),a={devtools:{dataType:`track-entry`,track:r,...i?{properties:i}:{},...n?.tooltipText?{tooltipText:n.tooltipText}:{}}},o=performance.now(),s=n?.startTime??o,c=n?.duration??Math.max(0,o-s);try{performance.measure(e,{start:s,duration:c,detail:a})}catch{}({...t?{properties:t}:{}})}function Oi(e){let t=(0,J.c)(3),{name:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,q.jsx)(K.Profiler,{id:n,onRender:ki,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}var ki=(e,t,n,r,i,a)=>{Y(`ok/render/${e}`,{phase:t,actualDuration:Math.round(n*1e3)/1e3,baseDuration:Math.round(r*1e3)/1e3},{startTime:i,duration:Math.max(0,a-i)})},{getOwnPropertyNames:Ai,getOwnPropertySymbols:ji}=Object,{hasOwnProperty:Mi}=Object.prototype;function Ni(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function Pi(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function Fi(e){return e?.[Symbol.toStringTag]}function Ii(e){return Ai(e).concat(ji(e))}var Li=Object.hasOwn||((e,t)=>Mi.call(e,t));function Ri(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var zi=`__v`,Bi=`__o`,Vi=`_owner`,{getOwnPropertyDescriptor:Hi,keys:Ui}=Object;function Wi(e,t){return e.byteLength===t.byteLength&&ra(new Uint8Array(e),new Uint8Array(t))}function Gi(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Ki(e,t){return e.byteLength===t.byteLength&&ra(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function qi(e,t){return Ri(e.getTime(),t.getTime())}function Ji(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Yi(e,t){return e===t}function Xi(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var Zi=Ri;function Qi(e,t,n){let r=Ui(e),i=r.length;if(Ui(t).length!==i)return!1;for(;i-- >0;)if(!aa(e,t,n,r[i]))return!1;return!0}function $i(e,t,n){let r=Ii(e),i=r.length;if(Ii(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!aa(e,t,n,a)||(o=Hi(e,a),s=Hi(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function ea(e,t){return Ri(e.valueOf(),t.valueOf())}function ta(e,t){return e.source===t.source&&e.flags===t.flags}function na(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function ra(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function ia(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function aa(e,t,n,r){return(r===Vi||r===Bi||r===zi)&&(e.$$typeof||t.$$typeof)?!0:Li(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var oa=`[object ArrayBuffer]`,sa=`[object Arguments]`,ca=`[object Boolean]`,la=`[object DataView]`,ua=`[object Date]`,da=`[object Error]`,fa=`[object Map]`,pa=`[object Number]`,ma=`[object Object]`,ha=`[object RegExp]`,ga=`[object Set]`,_a=`[object String]`,va={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},ya=`[object URL]`,ba=Object.prototype.toString;function xa({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=ba.call(h);if(b===ua)return r(h,g,_);if(b===ha)return u(h,g,_);if(b===fa)return o(h,g,_);if(b===ga)return d(h,g,_);if(b===ma)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===ya)return p(h,g,_);if(b===da)return i(h,g,_);if(b===sa)return c(h,g,_);if(va[b])return f(h,g,_);if(b===oa)return e(h,g,_);if(b===la)return n(h,g,_);if(b===ca||b===pa||b===_a)return l(h,g,_);if(m){let e=m[b];if(!e){let t=Fi(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function Sa({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Wi,areArraysEqual:n?$i:Gi,areDataViewsEqual:Ki,areDatesEqual:qi,areErrorsEqual:Ji,areFunctionsEqual:Yi,areMapsEqual:n?Ni(Xi,$i):Xi,areNumbersEqual:Zi,areObjectsEqual:n?$i:Qi,arePrimitiveWrappersEqual:ea,areRegExpsEqual:ta,areSetsEqual:n?Ni(na,$i):na,areTypedArraysEqual:n?Ni(ra,$i):ra,areUrlsEqual:ia,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=Pi(r.areArraysEqual),t=Pi(r.areMapsEqual),n=Pi(r.areObjectsEqual),i=Pi(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function Ca(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function wa({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var Ta=Ea();Ea({strict:!0}),Ea({circular:!0}),Ea({circular:!0,strict:!0}),Ea({createInternalComparator:()=>Ri}),Ea({strict:!0,createInternalComparator:()=>Ri}),Ea({circular:!0,createInternalComparator:()=>Ri}),Ea({circular:!0,createInternalComparator:()=>Ri,strict:!0});function Ea(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=xa(Sa(e));return wa({circular:t,comparator:a,createState:r,equals:n?n(a):Ca(a),strict:i})}var Da=t((e=>{var t=a(),n=Ar();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),a!==void 0&&f.hasValue){var t=f.value;if(a(t,e))return c=t}return c=e}if(t=c,i(s,e))return t;var n=r(e);return a!==void 0&&a(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,a]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Oa=t(((e,t)=>{t.exports=Da()}))(),ka=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},Aa=({contentComponent:e})=>{let t=(0,Ci.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,q.jsx)(q.Fragment,{children:Object.values(t)})};function ja(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:Si.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var Ma=class extends K.Component{constructor(e){super(e),this.editorContentRef=K.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=ja(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{ref:ka(t,this.editorContentRef),...n}),e?.contentComponent&&(0,q.jsx)(Aa,{contentComponent:e.contentComponent})]})}},Na=(0,K.forwardRef)((e,t)=>{let n=K.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return K.createElement(Ma,{key:n,innerRef:t,...e})}),Pa=K.memo(Na),Fa=typeof window<`u`?K.useLayoutEffect:K.useEffect,Ia=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function La(e){let[t]=(0,K.useState)(()=>new Ia(e.editor)),n=(0,Oa.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??Ta);return Fa(()=>t.watch(e.editor),[e.editor,t]),(0,K.useDebugValue)(n),n}typeof window>`u`||typeof window<`u`&&window.next;var Ra=(0,K.createContext)({editor:null});Ra.Consumer;var za=()=>(0,K.useContext)(Ra),Ba=(0,K.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Va=()=>(0,K.useContext)(Ba);function Ha({as:e=`div`,...t}){let{nodeViewContentRef:n,nodeViewContentChildren:r}=Va();return(0,q.jsx)(e,{...t,ref:n,"data-node-view-content":``,style:{whiteSpace:`pre-wrap`,...t.style},children:r})}var Ua=K.forwardRef((e,t)=>{let{onDragStart:n}=Va();return(0,q.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function Wa(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function Ga(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function Ka(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function qa(e){if(Wa(e)||Ga(e))return!0;if(Ka(e)){let t=e.type;if(t)return Wa(t)||Ga(t)}return!1}function Ja(){try{if(K.version)return parseInt(K.version.split(`.`)[0],10)>=19}catch{}return!1}var Ya=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add(`react-renderer`),i&&this.element.classList.add(...i.split(` `)),this.editor.isEditorContentInitialized?(0,Si.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=Ja(),a=qa(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,q.jsx)(t,{...o}),(e=r?.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0,(e=this.editor?.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};K.createContext({markViewContentRef:()=>{}});var Xa=class extends ae{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.positionCheckCallback=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.dataset.nodeViewContentReact=``,this.contentDOMElement.dataset.nodeViewWrapper=``,this.contentDOMElement.style.whiteSpace=`inherit`;let e=this.dom.querySelector(`[data-node-view-content]`);if(!e)return;e.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,K.createRef)()};if(!this.component.displayName){let e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,K.memo)(e=>(0,q.jsx)(Ba.Provider,{value:t,children:(0,K.createElement)(n,e)}));r.displayName=`ReactNodeView`;let i=this.node.isInline?`span`:`div`;this.options.as&&(i=this.options.as);let{className:a=``}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new Ya(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos(),this.positionCheckCallback=()=>{let e=this.getPos();typeof e!=`number`||e===this.currentPos||(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs==`function`&&this.updateElementAttributes())},Me(this.editor,this.positionCheckCallback)}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let{from:e,to:t}=this.editor.state.selection,n=this.currentPos;if(typeof n==`number`)if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),typeof this.options.attrs==`function`&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}let i=this.getPos();return e===this.node&&this.decorations===t&&this.innerDecorations===n?i===this.currentPos?!0:(this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage,getPos:()=>this.getPos()}),!0):(this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove(`ProseMirror-selectednode`)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate),this.positionCheckCallback&&=(I(this.editor,this.positionCheckCallback),null),this.contentDOMElement=null,this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=_e(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function Za(e,t){return n=>n.editor.contentComponent?new Xa(e,n,t):{}}var Qa=(0,K.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});Qa.displayName=`TiptapContext`;var $a=()=>(0,K.useContext)(Qa);function eo({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,K.useMemo)(()=>({editor:r}),[r]),a=(0,K.useMemo)(()=>({editor:r}),[r]);return(0,q.jsx)(Ra.Provider,{value:a,children:(0,q.jsx)(Qa.Provider,{value:i,children:n})})}eo.displayName=`Tiptap`;function to({...e}){let{editor:t}=$a();return(0,q.jsx)(Pa,{editor:t,...e})}to.displayName=`Tiptap.Content`,Object.assign(eo,{Content:to});var no=()=>new Map,ro=e=>{let t=no();return e.forEach((e,n)=>{t.set(n,e)}),t},io=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},ao=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},oo=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1},so=()=>new Set,co=e=>e[e.length-1],lo=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},uo=Array.from,fo=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},po=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},mo=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},ho=Array.isArray,go=class{constructor(){this._observers=no()}on(e,t){return io(this._observers,e,so).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return uo((this._observers.get(e)||no()).values()).forEach(e=>e(...t))}destroy(){this._observers=no()}},_o=class{constructor(){this._observers=no()}on(e,t){io(this._observers,e,so).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return uo((this._observers.get(e)||no()).values()).forEach(e=>e(...t))}destroy(){this._observers=no()}},vo=Math.floor,yo=Math.abs,bo=(e,t)=>e<t?e:t,xo=(e,t)=>e>t?e:t;Number.isNaN;var So=e=>e===0?1/e<0:e<0,Co=1<<17,wo=1<<18,To=1<<19,Eo=1<<20,Do=1<<21,Oo=1<<22,ko=1<<23,Ao=1<<24,jo=1<<25,Mo=1<<26,No=1<<27,Po=1<<28,Fo=1<<29;Co-1,wo-1,To-1,Eo-1,Do-1,Oo-1,ko-1,Ao-1,jo-1,Mo-1,No-1,Po-1,Fo-1;var Io=2**53-1,Lo=-(2**53-1),Ro=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&vo(e)===e);Number.isNaN,Number.parseInt;var zo=String.fromCharCode;String.fromCodePoint,zo(65535);var Bo=e=>e.toLowerCase(),Vo=/^\s*/g,Ho=e=>e.replace(Vo,``),Uo=/([A-Z])/g,Wo=(e,t)=>Ho(e.replace(Uo,e=>`${t}${Bo(e)}`)),Go=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},Ko=typeof TextEncoder<`u`?new TextEncoder:null,qo=Ko?e=>Ko.encode(e):Go,Jo=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});Jo&&Jo.decode(new Uint8Array).length===1&&(Jo=null);var Yo=(e,t)=>mo(t,()=>e).join(``),Xo=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},Zo=()=>new Xo,Qo=e=>{let t=Zo();return e(t),es(t)},$o=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},es=e=>{let t=new Uint8Array($o(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},ts=(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(xo(n,t)*2),e.cpos=0)},ns=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},rs=ns,is=(e,t)=>{for(;t>127;)ns(e,128|127&t),t=vo(t/128);ns(e,127&t)},as=(e,t)=>{let n=So(t);for(n&&(t=-t),ns(e,(t>63?128:0)|(n?64:0)|63&t),t=vo(t/64);t>0;)ns(e,(t>127?128:0)|127&t),t=vo(t/128)},os=new Uint8Array(3e4),ss=os.length/3,cs=Ko&&Ko.encodeInto?(e,t)=>{if(t.length<ss){let n=Ko.encodeInto(t,os).written||0;is(e,n);for(let t=0;t<n;t++)ns(e,os[t])}else us(e,qo(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;is(e,r);for(let t=0;t<r;t++)ns(e,n.codePointAt(t))},ls=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=bo(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(xo(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},us=(e,t)=>{is(e,t.byteLength),ls(e,t)},ds=(e,t)=>{ts(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},fs=(e,t)=>ds(e,4).setFloat32(0,t,!1),ps=(e,t)=>ds(e,8).setFloat64(0,t,!1),ms=(e,t)=>ds(e,8).setBigInt64(0,t,!1),hs=new DataView(new ArrayBuffer(4)),gs=e=>(hs.setFloat32(0,e),hs.getFloat32(0)===e),_s=(e,t)=>{switch(typeof t){case`string`:ns(e,119),cs(e,t);break;case`number`:Ro(t)&&yo(t)<=2147483647?(ns(e,125),as(e,t)):gs(t)?(ns(e,124),fs(e,t)):(ns(e,123),ps(e,t));break;case`bigint`:ns(e,122),ms(e,t);break;case`object`:if(t===null)ns(e,126);else if(ho(t)){ns(e,117),is(e,t.length);for(let n=0;n<t.length;n++)_s(e,t[n])}else if(t instanceof Uint8Array)ns(e,116),us(e,t);else{ns(e,118);let n=Object.keys(t);is(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];cs(e,i),_s(e,t[i])}}break;case`boolean`:ns(e,t?120:121);break;default:ns(e,127)}},vs=class extends Xo{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&is(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},ys=e=>{e.count>0&&(as(e.encoder,e.count===1?e.s:-e.s),e.count>1&&is(e.encoder,e.count-2))},bs=class{constructor(){this.encoder=new Xo,this.s=0,this.count=0}write(e){this.s===e?this.count++:(ys(this),this.count=1,this.s=e)}toUint8Array(){return ys(this),es(this.encoder)}},xs=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);as(e.encoder,t),e.count>1&&is(e.encoder,e.count-2)}},Ss=class{constructor(){this.encoder=new Xo,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(xs(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return xs(this),es(this.encoder)}},Cs=class{constructor(){this.sarr=[],this.s=``,this.lensE=new bs}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 Xo;return this.sarr.push(this.s),this.s=``,cs(e,this.sarr.join(``)),ls(e,this.lensE.toUint8Array()),es(e)}},ws=e=>Error(e),Ts=()=>{throw ws(`Method unimplemented`)},Es=()=>{throw ws(`Unexpected case`)},Ds=ws(`Unexpected end of array`),Os=ws(`Integer out of Range`),ks=class{constructor(e){this.arr=e,this.pos=0}},As=e=>new ks(e),js=e=>e.pos!==e.arr.length,Ms=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},Ns=e=>Ms(e,X(e)),Ps=e=>e.arr[e.pos++],X=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>Io)throw Os}throw Ds},Fs=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>Io)throw Os}throw Ds},Is=Jo?e=>Jo.decode(Ns(e)):e=>{let t=X(e);if(t===0)return``;{let n=String.fromCodePoint(Ps(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Ps(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},Ls=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Rs=[e=>void 0,e=>null,Fs,e=>Ls(e,4).getFloat32(0,!1),e=>Ls(e,8).getFloat64(0,!1),e=>Ls(e,8).getBigInt64(0,!1),e=>!1,e=>!0,Is,e=>{let t=X(e),n={};for(let r=0;r<t;r++){let t=Is(e);n[t]=zs(e)}return n},e=>{let t=X(e),n=[];for(let r=0;r<t;r++)n.push(zs(e));return n},Ns],zs=e=>Rs[127-Ps(e)](e),Bs=class extends ks{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),js(this)?this.count=X(this)+1:this.count=-1),this.count--,this.s}},Vs=class extends ks{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Fs(this);let e=So(this.s);this.count=1,e&&(this.s=-this.s,this.count=X(this)+2)}return this.count--,this.s}},Hs=class extends ks{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=Fs(this),t=e&1;this.diff=vo(e/2),this.count=1,t&&(this.count=X(this)+2)}return this.s+=this.diff,this.count--,this.s}},Us=class{constructor(e){this.decoder=new Vs(e),this.str=Is(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}};crypto.subtle;var Ws=crypto.getRandomValues.bind(crypto),Gs=Math.random,Ks=()=>Ws(new Uint32Array(1))[0],qs=e=>e[vo(Gs()*e.length)],Js=`10000000-1000-4000-8000-100000000000`,Ys=()=>Js.replace(/[018]/g,e=>(e^Ks()&15>>e/4).toString(16)),Xs=Date.now,Zs=e=>new Promise(e);Promise.all.bind(Promise);var Qs=e=>e===void 0?null:e,$s=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}};try{typeof localStorage<`u`&&localStorage&&($s=localStorage)}catch{}var ec=$s,tc=Symbol(`Equality`),nc=(e,t)=>e===t||!!e?.[tc]?.(t)||!1,rc=e=>typeof e==`object`,ic=Object.assign,ac=Object.keys,oc=(e,t)=>{for(let n in e)t(e[n],n)},sc=e=>ac(e).length,cc=e=>{for(let t in e)return!1;return!0},lc=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},uc=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),dc=(e,t)=>e===t||sc(e)===sc(t)&&lc(e,(e,n)=>(e!==void 0||uc(t,n))&&nc(t[n],e)),fc=Object.freeze,pc=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&pc(e[t])}return fc(e)},mc=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&mc(e,t,n+1)}},hc=e=>e,gc=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[tc]!=null)return e[tc](t);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)||!gc(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(sc(e)!==sc(t))return!1;for(let n in e)if(!uc(e,n)||!gc(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(!gc(e[n],t[n]))return!1;break;default:return!1}return!0},_c=(e,t)=>t.includes(e),vc=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,yc=typeof window<`u`&&typeof document<`u`&&!vc;typeof navigator<`u`&&/Mac/.test(navigator.platform);var bc,xc=[],Sc=()=>{if(bc===void 0)if(vc){bc=no();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&bc.set(t,``),t=r):t===null?xc.push(r):(bc.set(t,r),t=null)}t!==null&&bc.set(t,``)}else typeof location==`object`?(bc=no(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);bc.set(`--${Wo(t,`-`)}`,n),bc.set(`-${Wo(t,`-`)}`,n)}})):bc=no();return bc},Cc=e=>Sc().has(e),wc=e=>Qs(vc?{}[e.toUpperCase().replaceAll(`-`,`_`)]:ec.getItem(e)),Tc=e=>Cc(`--`+e)||wc(e)!==null,Ec=Tc(`production`),Dc=vc&&_c({}.FORCE_COLOR,[`true`,`1`,`2`])||!Cc(`--no-colors`)&&!Tc(`no-color`)&&(!vc||process.stdout.isTTY)&&(!vc||Cc(`--color`)||wc(`COLORTERM`)!==null||(wc(`TERM`)||``).includes(`color`)),Oc=e=>new Uint8Array(e),kc=yc?e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=zo(e[n]);return btoa(t)}:e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),Ac=e=>{let t=Oc(e.byteLength);return t.set(e),t},jc=e=>Qo(t=>_s(t,e)),Mc=class{constructor(e,t){this.left=e,this.right=t}},Nc=(e,t)=>new Mc(e,t),Pc=(e,t)=>e.forEach(e=>t(e.left,e.right)),Fc=e=>e.next()>=.5,Ic=(e,t,n)=>vo(e.next()*(n+1-t)+t),Lc=(e,t,n)=>vo(e.next()*(n+1-t)+t),Rc=(e,t,n)=>Lc(e,t,n),zc=e=>zo(Rc(e,97,122)),Bc=(e,t=0,n=20)=>{let r=Rc(e,t,n),i=``;for(let t=0;t<r;t++)i+=zc(e);return i},Vc=(e,t)=>t[Rc(e,0,t.length-1)],Hc=Symbol(`0schema`),Uc=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(Yo(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
|
|
3
|
-
`)}},Wc=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[tc]?nc(e,t):ho(e)?fo(e,e=>po(t,t=>Wc(e,t))):rc(e)?lc(e,(e,n)=>Wc(e,t[n])):!1,Gc=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),Wc(t,n)}equals(e){return this.constructor===e.constructor&&gc(this.shape,e.shape)}[Hc](){return!0}[tc](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){Ts()}get nullable(){return wl(this,zl)}get optional(){return new nl(this)}cast(e){return Ul(e,this),e}expect(e){return Ul(e,this),e}},Kc=class extends Gc{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},qc=(e,t=null)=>new Kc(e,t);qc(Kc);var Jc=class extends Gc{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},Yc=e=>new Jc(e);qc(Jc);var Xc=class extends Gc{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},Zc=(...e)=>new Xc(e),Qc=qc(Xc),$c=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),el=e=>{if(Pl.check(e))return[$c(e)];if(Qc.check(e))return e.shape.map(e=>e+``);if(Nl.check(e))return[`[+-]?\\d+.?\\d*`];if(Fl.check(e))return[`.*`];if(Tl.check(e))return e.shape.map(el).flat(1);Es()};qc(class extends Gc{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(el).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}});var tl=Symbol(`optional`),nl=class extends Gc{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[tl](){return!0}},rl=qc(nl),il=class extends Gc{check(e,t){return t?.extend(null,`never`,typeof e),!1}};new il,qc(il);var al=class e extends Gc{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):lc(this.shape,(n,r)=>{let i=this._isPartial&&!uc(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},ol=e=>new al(e),sl=qc(al),cl=Yc(e=>e!=null&&(e.constructor===Object||e.constructor==null)),ll=class extends Gc{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&lc(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},ul=(e,t)=>new ll(e,t),dl=qc(ll),fl=class extends Gc{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&lc(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},pl=(...e)=>new fl(e);qc(fl);var ml=class extends Gc{constructor(e){super(),this.shape=e.length===1?e[0]:new Cl(e)}check(e,t){let n=ho(e)&&fo(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},hl=(...e)=>new ml(e),gl=qc(ml),_l=Yc(e=>ho(e)),vl=class extends Gc{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},yl=(e,t=null)=>new vl(e,t);qc(vl);var bl=yl(Gc),xl=qc(class extends Gc{constructor(e){super(),this.len=e.length-1,this.args=pl(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}}),Sl=Yc(e=>typeof e==`function`);qc(class extends Gc{constructor(e){super(),this.shape=e}check(e,t){let n=fo(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},e=>e.shape.length>0);var Cl=class extends Gc{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=po(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},wl=(...e)=>e.findIndex(e=>Tl.check(e))>=0?wl(...e.map(e=>Hl(e)).map(e=>Tl.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new Cl(e),Tl=qc(Cl),El=()=>!0,Dl=Yc(El),Ol=qc(Jc,e=>e.shape===El),kl=Yc(e=>typeof e==`bigint`),Al=Yc(e=>e===kl),jl=Yc(e=>typeof e==`symbol`);Yc(e=>e===jl);var Ml=Yc(e=>typeof e==`number`),Nl=Yc(e=>e===Ml),Pl=Yc(e=>typeof e==`string`),Fl=Yc(e=>e===Pl),Il=Yc(e=>typeof e==`boolean`),Ll=Yc(e=>e===Il),Rl=Zc(void 0);qc(Xc,e=>e.shape.length===1&&e.shape[0]===void 0),Zc(void 0);var zl=Zc(null),Bl=qc(Xc,e=>e.shape.length===1&&e.shape[0]===null);qc(Uint8Array),qc(Kc,e=>e.shape===Uint8Array);var Vl=wl(Ml,Pl,zl,Rl,kl,Il,jl);(()=>{let e=hl(Dl),t=ul(Pl,Dl),n=wl(Ml,Pl,zl,Il,e,t);return e.shape=n,t.shape.values=n,n})();var Hl=e=>{if(bl.check(e))return e;if(cl.check(e)){let t={};for(let n in e)t[n]=Hl(e[n]);return ol(t)}else if(_l.check(e))return wl(...e.map(Hl));else if(Vl.check(e))return Zc(e);else if(Sl.check(e))return qc(e);Es()},Ul=Ec?()=>{}:(e,t)=>{let n=new Uc;if(!t.check(e,n))throw ws(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},Wl=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:Hl(e),h:t}),this}else(e){return this.if(Dl,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw ws(`Unhandled pattern`)}}},Gl=(e=>new Wl(e))(Dl).if(Nl,(e,t)=>Ic(t,Lo,Io)).if(Fl,(e,t)=>Bc(t)).if(Ll,(e,t)=>Fc(t)).if(Al,(e,t)=>BigInt(Ic(t,Lo,Io))).if(Tl,(e,t)=>Kl(t,Vc(t,e.shape))).if(sl,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if(rl.check(i)){if(Fc(t))continue;i=i.shape}n[r]=Gl(i,t)}return n}).if(gl,(e,t)=>{let n=[],r=Lc(t,0,42);for(let i=0;i<r;i++)n.push(Kl(t,e.shape));return n}).if(Qc,(e,t)=>Vc(t,e.shape)).if(Bl,(e,t)=>null).if(xl,(e,t)=>{let n=Kl(t,e.res);return()=>n}).if(Ol,(e,t)=>Kl(t,Vc(t,[Ml,Pl,zl,Rl,kl,Il,hl(Ml),ul(wl(`a`,`b`,`c`),Ml)]))).if(dl,(e,t)=>{let n={},r=Ic(t,0,3);for(let i=0;i<r;i++){let r=Kl(t,e.shape.keys);n[r]=Kl(t,e.shape.values)}return n}).done(),Kl=(e,t)=>Gl(Hl(t),e),ql=typeof document<`u`?document:{},Jl=e=>ql.createElement(e),Yl=()=>ql.createDocumentFragment();Yc(e=>e.nodeType===su);var Xl=e=>ql.createTextNode(e);typeof DOMParser<`u`&&new DOMParser;var Zl=(e,t)=>(Pc(t,(t,n)=>{n===!1?e.removeAttribute(t):n===!0?e.setAttribute(t,``):e.setAttribute(t,n)}),e),Ql=e=>{let t=Yl();for(let n=0;n<e.length;n++)ru(t,e[n]);return t},$l=(e,t)=>(ru(e,Ql(t)),e),eu=(e,t=[],n=[])=>$l(Zl(Jl(e),t),n);Yc(e=>e.nodeType===iu);var tu=Xl;Yc(e=>e.nodeType===au);var nu=e=>ao(e,(e,t)=>`${t}:${e};`).join(``),ru=(e,t)=>e.appendChild(t),iu=ql.ELEMENT_NODE,au=ql.TEXT_NODE;ql.CDATA_SECTION_NODE,ql.COMMENT_NODE;var ou=ql.DOCUMENT_NODE;ql.DOCUMENT_TYPE_NODE;var su=ql.DOCUMENT_FRAGMENT_NODE;Yc(e=>e.nodeType===ou);var cu=(e=>class{constructor(e){this._=e}destroy(){e(this._)}})(clearTimeout),lu=(e,t)=>new cu(setTimeout(t,e)),uu=Symbol,du=uu(),fu=uu(),pu=uu(),mu=uu(),hu=uu(),gu=uu(),_u=uu(),vu=uu(),yu=uu(),bu=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(n===void 0)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(``));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n};Xs();var xu={[du]:Nc(`font-weight`,`bold`),[fu]:Nc(`font-weight`,`normal`),[pu]:Nc(`color`,`blue`),[hu]:Nc(`color`,`green`),[mu]:Nc(`color`,`grey`),[gu]:Nc(`color`,`red`),[_u]:Nc(`color`,`purple`),[vu]:Nc(`color`,`orange`),[yu]:Nc(`color`,`black`)},Su=Dc?e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=no(),i=[],a=0;for(;a<e.length;a++){let i=e[a],o=xu[i];if(o!==void 0)r.set(o.left,o.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let e=nu(r);a>0||e.length>0?(t.push(`%c`+i),n.push(e)):t.push(i)}else break}}for(a>0&&(i=n,i.unshift(t.join(``)));a<e.length;a++){let t=e[a];t instanceof Symbol||i.push(t)}return i}:bu,Cu=(...e)=>{console.log(...Su(e)),Tu.forEach(t=>t.print(e))},wu=(...e)=>{console.warn(...Su(e)),e.unshift(vu),Tu.forEach(t=>t.print(e))},Tu=so(),Eu=e=>({[Symbol.iterator](){return this},next:e}),Du=(e,t)=>Eu(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),Ou=(e,t)=>Eu(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}}),ku=class{constructor(e,t){this.clock=e,this.len=t}},Au=class{constructor(){this.clients=new Map}},ju=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])Yd(e,i,o.clock,o.len,n)}}),Mu=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=vo((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},Nu=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&Mu(n,t.clock)!==null},Pu=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new ku(r.clock,xo(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},Fu=e=>{let t=new Au;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)lo(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return Pu(t),t},Iu=(e,t,n,r)=>{io(e.clients,t,()=>[]).push(new ku(n,r))},Lu=()=>new Au,Ru=e=>{let t=Lu();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new ku(i,a))}}r.length>0&&t.clients.set(n,r)}),t},zu=(e,t)=>{is(e.restEncoder,t.clients.size),uo(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),is(e.restEncoder,t);let r=n.length;is(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},Bu=e=>{let t=new Au,n=X(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=X(e.restDecoder),r=X(e.restDecoder);if(r>0){let i=io(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new ku(e.readDsClock(),e.readDsLen()))}}return t},Vu=(e,t,n)=>{let r=new Au,i=X(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=X(e.restDecoder),a=X(e.restDecoder),o=n.clients.get(i)||[],s=Vd(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&Iu(r,i,s,a-s);let e=Ud(o,n),c=o[e];for(!c.deleted&&c.id.clock<n&&(o.splice(e+1,0,pm(t,c,n-c.id.clock)),e++);e<o.length&&(c=o[e++],c.id.clock<a);)c.deleted||(a<c.id.clock+c.length&&o.splice(e,0,pm(t,c,a-c.id.clock)),c.delete(t))}else Iu(r,i,n,a-n)}}if(r.clients.size>0){let e=new Zu;return is(e.restEncoder,0),zu(e,r),e.toUint8Array()}return null},Hu=Ks,Uu=class e extends go{constructor({guid:e=Ys(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=Hu(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new zd,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Zs(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>Zs(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&rf(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(uo(this.subdocs).map(e=>e.guid))}transact(e,t=null){return rf(this,e,t)}get(e,t=Pf){let n=io(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==Pf&&r!==t)if(r===Pf){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}else throw Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=``){return this.get(e,tp)}getText(e=``){return this.get(e,Sp)}getMap(e=``){return this.get(e,ip)}getXmlElement(e=``){return this.get(e,Dp)}getXmlFragment(e=``){return this.get(e,Tp)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,uo(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,rf(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},Wu=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return X(this.restDecoder)}readDsLen(){return X(this.restDecoder)}},Gu=class extends Wu{readLeftID(){return Z(X(this.restDecoder),X(this.restDecoder))}readRightID(){return Z(X(this.restDecoder),X(this.restDecoder))}readClient(){return X(this.restDecoder)}readInfo(){return Ps(this.restDecoder)}readString(){return Is(this.restDecoder)}readParentInfo(){return X(this.restDecoder)===1}readTypeRef(){return X(this.restDecoder)}readLen(){return X(this.restDecoder)}readAny(){return zs(this.restDecoder)}readBuf(){return Ac(Ns(this.restDecoder))}readJSON(){return JSON.parse(Is(this.restDecoder))}readKey(){return Is(this.restDecoder)}},Ku=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=X(this.restDecoder),this.dsCurrVal}readDsLen(){let e=X(this.restDecoder)+1;return this.dsCurrVal+=e,e}},qu=class extends Ku{constructor(e){super(e),this.keys=[],X(e),this.keyClockDecoder=new Hs(Ns(e)),this.clientDecoder=new Vs(Ns(e)),this.leftClockDecoder=new Hs(Ns(e)),this.rightClockDecoder=new Hs(Ns(e)),this.infoDecoder=new Bs(Ns(e),Ps),this.stringDecoder=new Us(Ns(e)),this.parentInfoDecoder=new Bs(Ns(e),Ps),this.typeRefDecoder=new Vs(Ns(e)),this.lenDecoder=new Vs(Ns(e))}readLeftID(){return new bd(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new bd(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return zs(this.restDecoder)}readBuf(){return Ns(this.restDecoder)}readJSON(){return zs(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},Ju=class{constructor(){this.restEncoder=Zo()}toUint8Array(){return es(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){is(this.restEncoder,e)}writeDsLen(e){is(this.restEncoder,e)}},Yu=class extends Ju{writeLeftID(e){is(this.restEncoder,e.client),is(this.restEncoder,e.clock)}writeRightID(e){is(this.restEncoder,e.client),is(this.restEncoder,e.clock)}writeClient(e){is(this.restEncoder,e)}writeInfo(e){rs(this.restEncoder,e)}writeString(e){cs(this.restEncoder,e)}writeParentInfo(e){is(this.restEncoder,+!!e)}writeTypeRef(e){is(this.restEncoder,e)}writeLen(e){is(this.restEncoder,e)}writeAny(e){_s(this.restEncoder,e)}writeBuf(e){us(this.restEncoder,e)}writeJSON(e){cs(this.restEncoder,JSON.stringify(e))}writeKey(e){cs(this.restEncoder,e)}},Xu=class{constructor(){this.restEncoder=Zo(),this.dsCurrVal=0}toUint8Array(){return es(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,is(this.restEncoder,t)}writeDsLen(e){e===0&&Es(),is(this.restEncoder,e-1),this.dsCurrVal+=e}},Zu=class extends Xu{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Ss,this.clientEncoder=new bs,this.leftClockEncoder=new Ss,this.rightClockEncoder=new Ss,this.infoEncoder=new vs(rs),this.stringEncoder=new Cs,this.parentInfoEncoder=new vs(rs),this.typeRefEncoder=new bs,this.lenEncoder=new bs}toUint8Array(){let e=Zo();return is(e,0),us(e,this.keyClockEncoder.toUint8Array()),us(e,this.clientEncoder.toUint8Array()),us(e,this.leftClockEncoder.toUint8Array()),us(e,this.rightClockEncoder.toUint8Array()),us(e,es(this.infoEncoder)),us(e,this.stringEncoder.toUint8Array()),us(e,es(this.parentInfoEncoder)),us(e,this.typeRefEncoder.toUint8Array()),us(e,this.lenEncoder.toUint8Array()),ls(e,es(this.restEncoder)),es(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(+!!e)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){_s(this.restEncoder,e)}writeBuf(e){us(this.restEncoder,e)}writeJSON(e){_s(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},Qu=(e,t,n,r)=>{r=xo(r,t[0].id.clock);let i=Ud(t,r);is(e.restEncoder,t.length-i),e.writeClient(n),is(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},$u=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{Vd(t,n)>e&&r.set(n,e)}),Bd(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),is(e.restEncoder,r.size),uo(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{Qu(e,t.clients.get(n),n,r)})},ed=(e,t)=>{let n=no(),r=X(e.restDecoder);for(let i=0;i<r;i++){let r=X(e.restDecoder),i=Array(r),a=e.readClient(),o=X(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new Ip(Z(a,o),t),o+=t;break}case 10:{let t=X(e.restDecoder);i[n]=new bm(Z(a,o),t),o+=t;break}default:{let s=(r&192)==0,c=new gm(Z(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,_m(e,r));i[n]=c,o+=c.length}}}}return n},td=(e,t,n)=>{let r=[],i=uo(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new zd,c=new Map,l=(e,t)=>{let n=c.get(e);(n==null||n>t)&&c.set(e,t)},u=o.refs[o.i++],d=new Map,f=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(u.constructor!==bm){let i=io(d,u.id.client,()=>Vd(t,u.id.client))-u.id.clock;if(i<0)r.push(u),l(u.id.client,u.id.clock-1),f();else{let a=u.getMissing(e,t);if(a!==null){r.push(u);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)l(a,Vd(t,a)),f();else{u=e.refs[e.i++];continue}}else (i===0||i<u.length)&&(u.integrate(e,i),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=a(),o===null)break;u=o.refs[o.i++]}}if(s.clients.size>0){let e=new Zu;return $u(e,s,new Map),is(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},nd=(e,t)=>$u(e,t.doc.store,t.beforeState),rd=(e,t,n,r=new qu(e))=>rf(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=td(e,i,ed(r,n)),o=i.pendingStructs;if(o){for(let[e,n]of o.missing)if(n<Vd(i,e)){t=!0;break}if(a){for(let[e,t]of a.missing){let n=o.missing.get(e);(n==null||n>t)&&o.missing.set(e,t)}o.update=mf([o.update,a.update])}}else i.pendingStructs=a;let s=Vu(r,e,i);if(i.pendingDs){let t=new qu(As(i.pendingDs));X(t.restDecoder);let n=Vu(t,e,i);s&&n?i.pendingDs=mf([s,n]):i.pendingDs=s||n}else i.pendingDs=s;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,id(e.doc,t)}},n,!1),id=(e,t,n,r=qu)=>{let i=As(t);rd(i,e,n,new r(i))},ad=(e,t,n)=>id(e,t,n,Gu),od=(e,t,n=new Map)=>{$u(e,t.store,n),zu(e,Ru(t.store))},sd=(e,t=new Uint8Array([0]),n=new Zu)=>{od(n,e,ud(t));let r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(hf(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===Yu)return ff(r.map((e,t)=>t===0?e:bf(e)));if(n.constructor===Zu)return mf(r)}return r[0]},cd=(e,t)=>sd(e,t,new Yu),ld=e=>{let t=new Map,n=X(e.restDecoder);for(let r=0;r<n;r++){let n=X(e.restDecoder),r=X(e.restDecoder);t.set(n,r)}return t},ud=e=>ld(new Wu(As(e))),dd=(e,t)=>(is(e.restEncoder,t.size),uo(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{is(e.restEncoder,t),is(e.restEncoder,n)}),e),fd=(e,t)=>dd(e,Bd(t.store)),pd=(e,t=new Xu)=>(e instanceof Map?dd(t,e):fd(t,e),t.toUint8Array()),md=e=>pd(e,new Ju),hd=class{constructor(){this.l=[]}},gd=()=>new hd,_d=(e,t)=>e.l.push(t),vd=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(e=>t!==e),r===e.l.length&&console.error(`[yjs] Tried to remove event handler that doesn't exist.`)},yd=(e,t,n)=>mc(e.l,[t,n]),bd=class{constructor(e,t){this.client=e,this.clock=t}},xd=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,Z=(e,t)=>new bd(e,t),Sd=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw Es()},Cd=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1},wd=class{constructor(e,t,n,r=0){this.type=e,this.tname=t,this.item=n,this.assoc=r}},Td=e=>{let t={};return e.type&&(t.type=e.type),e.tname&&(t.tname=e.tname),e.item&&(t.item=e.item),e.assoc!=null&&(t.assoc=e.assoc),t},Ed=e=>new wd(e.type==null?null:Z(e.type.client,e.type.clock),e.tname??null,e.item==null?null:Z(e.item.client,e.item.clock),e.assoc==null?0:e.assoc),Dd=class{constructor(e,t,n=0){this.type=e,this.index=t,this.assoc=n}},Od=(e,t,n=0)=>new Dd(e,t,n),kd=(e,t,n)=>{let r=null,i=null;return e._item===null?i=Sd(e):r=Z(e._item.id.client,e._item.id.clock),new wd(r,i,t,n)},Ad=(e,t,n=0)=>{let r=e._start;if(n<0){if(t===0)return kd(e,null,n);t--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>t)return kd(e,Z(r.id.client,r.id.clock+t),n);t-=r.length}if(r.right===null&&n<0)return kd(e,r.lastId,n);r=r.right}return kd(e,null,n)},jd=(e,t)=>{let n=Wd(e,t);return{item:n,diff:t.clock-n.id.clock}},Md=(e,t,n=!0)=>{let r=t.store,i=e.item,a=e.type,o=e.tname,s=e.assoc,c=null,l=0;if(i!==null){if(Vd(r,i.client)<=i.clock)return null;let e=n?dm(r,i):jd(r,i),t=e.item;if(!(t instanceof gm))return null;if(c=t.parent,c._item===null||!c._item.deleted){l=t.deleted||!t.countable?0:e.diff+(s>=0?0:1);let n=t.left;for(;n!==null;)!n.deleted&&n.countable&&(l+=n.length),n=n.left}}else{if(o!==null)c=t.get(o);else if(a!==null){if(Vd(r,a.client)<=a.clock)return null;let{item:e}=n?dm(r,a):{item:Wd(r,a)};if(e instanceof gm&&e.content instanceof lm)c=e.content.type;else return null}else throw Es();l=s>=0?c._length:0}return Od(c,l,e.assoc)},Nd=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&xd(e.item,t.item)&&xd(e.type,t.type)&&e.assoc===t.assoc,Pd=class{constructor(e,t){this.ds=e,this.sv=t}},Fd=(e,t)=>new Pd(e,t);Fd(Lu(),new Map);var Id=e=>Fd(Ru(e.store),Bd(e.store)),Ld=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!Nu(t.ds,e.id),Rd=(e,t)=>{let n=io(e.meta,Rd,so),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<Vd(r,n)&&Kd(e,Z(n,t))}),ju(e,t.ds,e=>{}),n.add(t))},zd=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},Bd=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},Vd=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},Hd=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw Es()}n.push(t)},Ud=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=vo(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=vo((n+r)/2)}throw Es()},Wd=(e,t)=>{let n=e.clients.get(t.client);return n[Ud(n,t.clock)]},Gd=(e,t,n)=>{let r=Ud(t,n),i=t[r];return i.id.clock<n&&i instanceof gm?(t.splice(r+1,0,pm(e,i,n-i.id.clock)),r+1):r},Kd=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[Gd(e,n,t.clock)]},qd=(e,t,n)=>{let r=t.clients.get(n.client),i=Ud(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==Ip&&r.splice(i+1,0,pm(e,a,n.clock-a.id.clock+1)),a},Jd=(e,t,n)=>{let r=e.clients.get(t.id.client);r[Ud(r,t.id.clock)]=n},Yd=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=Gd(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&Gd(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},Xd=class{constructor(e,t,n){this.doc=e,this.deleteSet=new Au,this.beforeState=Bd(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},Zd=(e,t)=>t.deleteSet.clients.size===0&&!oo(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(Pu(t.deleteSet),nd(e,t),zu(e,t.deleteSet),!0),Qd=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&io(e.changed,t,so).add(n)},$d=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0;n=r,r=e[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof gm&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}let a=t-i;return a&&e.splice(t+1-a,a),a},ef=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=Ud(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof gm&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},tf=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=bo(r.length-1,1+Ud(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+$d(r,e)}})},nf=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{Pu(a),n.afterState=Bd(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{(r._item===null||!r._item.deleted)&&r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&(t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),e.push(()=>{yd(r._dEH,t,n)}))}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&yp(n)})}),mc(e,[])}finally{r.gc&&ef(a,i,r.gcFilter),tf(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=xo(Ud(e,r),1);for(let t=e.length-1;t>=n;)t-=1+$d(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=Ud(r,n);a+1<r.length&&$d(r,a+1)>1||a>0&&$d(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(Cu(vu,du,`[yjs] `,fu,gu,`Changed the client-id because another client seems to be using it.`),r.clientID=Hu()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new Yu;Zd(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new Zu;Zd(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:c,subdocsRemoved:l}=n;(s.size>0||l.size>0||c.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),l.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:c,added:s,removed:l},r,n]),l.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):nf(e,t+1)}}},rf=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new Xd(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&nf(i,0)}}return o},af=class{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}},of=(e,t,n)=>{ju(e,n.deletions,n=>{n instanceof gm&&t.scope.some(t=>t===e.doc||Cd(t,n))&&fm(n,!1)})},sf=(e,t,n)=>{let r=null,i=e.doc,a=e.scope;rf(i,n=>{for(;t.length>0&&e.currStackItem===null;){let r=i.store,o=t.pop(),s=new Set,c=[],l=!1;ju(n,o.insertions,e=>{if(e instanceof gm){if(e.redone!==null){let{item:t,diff:i}=dm(r,e.id);i>0&&(t=Kd(n,Z(t.id.client,t.id.clock+i))),e=t}!e.deleted&&a.some(t=>t===n.doc||Cd(t,e))&&c.push(e)}}),ju(n,o.deletions,e=>{e instanceof gm&&a.some(t=>t===n.doc||Cd(t,e))&&!Nu(o.insertions,e.id)&&s.add(e)}),s.forEach(t=>{l=hm(n,t,s,o.insertions,e.ignoreRemoteMapChanges,e)!==null||l});for(let t=c.length-1;t>=0;t--){let r=c[t];e.deleteFilter(r)&&(r.delete(n),l=!0)}e.currStackItem=l?o:null}n.changed.forEach((e,t)=>{e.has(null)&&t._searchMarker&&(t._searchMarker.length=0)}),r=n},e);let o=e.currStackItem;if(o!=null){let t=r.changedParentTypes;e.emit(`stack-item-popped`,[{stackItem:o,type:n,changedParentTypes:t,origin:e},e]),e.currStackItem=null}return o},cf=class extends go{constructor(e,{captureTimeout:t=500,captureTransaction:n=e=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:a=!1,doc:o=ho(e)?e[0].doc:e instanceof Uu?e:e.doc}={}){super(),this.scope=[],this.doc=o,this.addToScope(e),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=a,this.captureTimeout=t,this.afterTransactionHandler=e=>{if(!this.captureTransaction(e)||!this.scope.some(t=>e.changedParentTypes.has(t)||t===this.doc)||!this.trackedOrigins.has(e.origin)&&(!e.origin||!this.trackedOrigins.has(e.origin.constructor)))return;let t=this.undoing,n=this.redoing,r=t?this.redoStack:this.undoStack;t?this.stopCapturing():n||this.clear(!1,!0);let i=new Au;e.afterState.forEach((t,n)=>{let r=e.beforeState.get(n)||0,a=t-r;a>0&&Iu(i,n,r,a)});let a=Xs(),o=!1;if(this.lastChange>0&&a-this.lastChange<this.captureTimeout&&r.length>0&&!t&&!n){let t=r[r.length-1];t.deletions=Fu([t.deletions,e.deleteSet]),t.insertions=Fu([t.insertions,i])}else r.push(new af(e.deleteSet,i)),o=!0;!t&&!n&&(this.lastChange=a),ju(e,e.deleteSet,t=>{t instanceof gm&&this.scope.some(n=>n===e.doc||Cd(n,t))&&fm(t,!0)});let s=[{stackItem:r[r.length-1],origin:e.origin,type:t?`redo`:`undo`,changedParentTypes:e.changedParentTypes},this];o?this.emit(`stack-item-added`,s):this.emit(`stack-item-updated`,s)},this.doc.on(`afterTransaction`,this.afterTransactionHandler),this.doc.on(`destroy`,()=>{this.destroy()})}addToScope(e){let t=new Set(this.scope);e=ho(e)?e:[e],e.forEach(e=>{t.has(e)||(t.add(e),(e instanceof Pf?e.doc!==this.doc:e!==this.doc)&&wu(`[yjs#509] Not same Y.Doc`),this.scope.push(e))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(n=>{e&&(this.undoStack.forEach(e=>of(n,this,e)),this.undoStack=[]),t&&(this.redoStack.forEach(e=>of(n,this,e)),this.redoStack=[]),this.emit(`stack-cleared`,[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=sf(this,this.undoStack,`undo`)}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=sf(this,this.redoStack,`redo`)}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off(`afterTransaction`,this.afterTransactionHandler),super.destroy()}};function*lf(e){let t=X(e.restDecoder);for(let n=0;n<t;n++){let t=X(e.restDecoder),n=e.readClient(),r=X(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=X(e.restDecoder);yield new bm(Z(n,r),t),r+=t}else if(31&t){let i=(t&192)==0,a=new gm(Z(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,_m(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new Ip(Z(n,r),t),r+=t}}}}var uf=class{constructor(e,t){this.gen=lf(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===bm);return this.curr}},df=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},ff=e=>mf(e,Gu,Yu),pf=(e,t)=>{if(e.constructor===Ip){let{client:n,clock:r}=e.id;return new Ip(Z(n,r+t),e.length-t)}else if(e.constructor===bm){let{client:n,clock:r}=e.id;return new bm(Z(n,r+t),e.length-t)}else{let n=e,{client:r,clock:i}=n.id;return new gm(Z(r,i+t),null,Z(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},mf=(e,t=qu,n=Zu)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(As(e))),i=r.map(e=>new uf(e,!0)),a=null,o=new n,s=new df(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===bm?1:-1:n}else return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)_f(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock)if(a.struct.constructor===bm)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{_f(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new bm(Z(t,a.struct.id.clock+a.struct.length),e),offset:0}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===bm?a.struct.length-=t:n=pf(n,t)),a.struct.mergeWith(n)||(_f(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==bm;n=e.next())_f(s,a.struct,a.offset),a={struct:n,offset:0}}return a!==null&&(_f(s,a.struct,a.offset),a=null),vf(s),zu(o,Fu(r.map(e=>Bu(e)))),o.toUint8Array()},hf=(e,t,n=qu,r=Zu)=>{let i=ud(t),a=new r,o=new df(a),s=new n(As(e)),c=new uf(s,!1);for(;c.curr;){let e=c.curr,t=e.id.client,n=i.get(t)||0;if(c.curr.constructor===bm){c.next();continue}if(e.id.clock+e.length>n)for(_f(o,e,xo(n-e.id.clock,0)),c.next();c.curr&&c.curr.id.client===t;)_f(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n;)c.next()}return vf(o),zu(a,Bu(s)),a.toUint8Array()},gf=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:es(e.encoder.restEncoder)}),e.encoder.restEncoder=Zo(),e.written=0)},_f=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&gf(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),is(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},vf=e=>{gf(e);let t=e.encoder.restEncoder;is(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];is(t,r.written),ls(t,r.restEncoder)}},yf=(e,t,n,r)=>{let i=new n(As(e)),a=new uf(i,!1),o=new r,s=new df(o);for(let e=a.curr;e!==null;e=a.next())_f(s,t(e),0);return vf(s),zu(o,Bu(i)),o.toUint8Array()},bf=e=>yf(e,hc,qu,Yu),xf=`You must not compute changes after the event-handler fired.`,Sf=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=Cf(this.currentTarget,this.target)}deletes(e){return Nu(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw ws(xf);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r))if(e!==null&&this.deletes(e))i=`delete`,a=co(e.content.getContent());else return;else e!==null&&this.deletes(e)?(i=`update`,a=co(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=co(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw ws(xf);let t=this.target,n=so(),r=so(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},Cf=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},wf=()=>{wu(`Invalid access: Add Yjs type to a document before reading data.`)},Tf=80,Ef=0,Df=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Ef++}},Of=e=>{e.timestamp=Ef++},kf=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=Ef++},Af=(e,t,n)=>{if(e.length>=Tf){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return kf(r,t,n),r}else{let r=new Df(t,n);return e.push(r),r}},jf=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>yo(t-e.index)<yo(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,Of(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&yo(n.index-i)<r.parent.length/Tf?(kf(n,r,i),n):Af(e._searchMarker,r,i)},Mf=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=xo(t,i.index+n))}},Nf=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;io(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;yd(r._eH,n,t)},Pf=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=gd(),this._dEH=gd(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw Ts()}clone(){throw Ts()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){_d(this._eH,e)}observeDeep(e){_d(this._dEH,e)}unobserve(e){vd(this._eH,e)}unobserveDeep(e){vd(this._dEH,e)}toJSON(){}},Ff=(e,t,n)=>{e.doc??wf(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},If=e=>{e.doc??wf();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},Lf=(e,t)=>{let n=[],r=e._start;for(;r!==null;){if(r.countable&&Ld(r,t)){let e=r.content.getContent();for(let t=0;t<e.length;t++)n.push(e[t])}r=r.right}return n},Rf=(e,t)=>{let n=0,r=e._start;for(e.doc??wf();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},zf=(e,t)=>{let n=[];return Rf(e,(r,i)=>{n.push(t(r,i,e))}),n},Bf=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},Vf=(e,t)=>{e.doc??wf();let n=jf(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},Hf=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,c=n===null?t._start:n.right,l=[],u=()=>{l.length>0&&(i=new gm(Z(o,Vd(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new Zp(l)),i.integrate(e,0),l=[])};r.forEach(n=>{if(n===null)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new gm(Z(o,Vd(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new Lp(new Uint8Array(n))),i.integrate(e,0);break;case Uu:i=new gm(Z(o,Vd(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new Hp(n)),i.integrate(e,0);break;default:if(n instanceof Pf)i=new gm(Z(o,Vd(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new lm(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),u()},Uf=()=>ws(`Length exceeded!`),Wf=(e,t,n,r)=>{if(n>t._length)throw Uf();if(n===0)return t._searchMarker&&Mf(t._searchMarker,n,r.length),Hf(e,t,null,r);let i=n,a=jf(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&Kd(e,Z(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&Mf(t._searchMarker,i,r.length),Hf(e,t,o,r)},Gf=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return Hf(e,t,r,n)},Kf=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=jf(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&Kd(e,Z(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&Kd(e,Z(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw Uf();t._searchMarker&&Mf(t._searchMarker,i,-a+r)},qf=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},Jf=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new Zp([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new Zp([r]);break;case Uint8Array:s=new Lp(r);break;case Uu:s=new Hp(r);break;default:if(r instanceof Pf)s=new lm(r);else throw Error(`Unexpected content type`)}new gm(Z(o,Vd(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},Yf=(e,t)=>{e.doc??wf();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},Xf=e=>{let t={};return e.doc??wf(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},Zf=(e,t)=>{e.doc??wf();let n=e._map.get(t);return n!==void 0&&!n.deleted},Qf=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&Ld(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},$f=e=>(e.doc??wf(),Du(e._map.entries(),e=>!e[1].deleted)),ep=class extends Sf{},tp=class e extends Pf{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof Pf?e.clone():e)),t}get length(){return this.doc??wf(),this._length}_callObserver(e,t){super._callObserver(e,t),Nf(this,e,new ep(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):rf(this.doc,n=>{Wf(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):rf(this.doc,t=>{Gf(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):rf(this.doc,n=>{Kf(n,this,e,t)})}get(e){return Vf(this,e)}toArray(){return If(this)}slice(e=0,t=this.length){return Ff(this,e,t)}toJSON(){return this.map(e=>e instanceof Pf?e.toJSON():e)}map(e){return zf(this,e)}forEach(e){Rf(this,e)}[Symbol.iterator](){return Bf(this)}_write(e){e.writeTypeRef(nm)}},np=e=>new tp,rp=class extends Sf{constructor(e,t,n){super(e,t),this.keysChanged=n}},ip=class e extends Pf{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof Pf?e.clone():e)}),t}_callObserver(e,t){Nf(this,e,new rp(this,e,t))}toJSON(){this.doc??wf();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof Pf?r.toJSON():r}}),e}get size(){return[...$f(this)].length}keys(){return Ou($f(this),e=>e[0])}values(){return Ou($f(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Ou($f(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??wf(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):rf(this.doc,t=>{qf(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):rf(this.doc,n=>{Jf(n,this,e,t)}),t}get(e){return Yf(this,e)}has(e){return Zf(this,e)}clear(){this.doc===null?this._prelimContent.clear():rf(this.doc,e=>{this.forEach(function(t,n,r){qf(e,r,n)})})}_write(e){e.writeTypeRef(rm)}},ap=e=>new ip,op=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&dc(e,t),sp=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&Es(),this.right.content.constructor){case Kp:this.right.deleted||dp(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}},cp=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case Kp:t.right.deleted||dp(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&Kd(e,Z(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},lp=(e,t,n,r)=>{let i=new Map,a=r?jf(t,n):null;return a?cp(e,new sp(a.p.left,a.p,a.index,i),n-a.index):cp(e,new sp(null,t._start,0,i),n)},up=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Kp&&op(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,c=n.right,l=new gm(Z(a,Vd(i.store,a)),s,s&&s.lastId,c,c&&c.id,t,null,new Kp(o,r));l.integrate(e,0),n.right=l,n.forward()})},dp=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},fp=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===Kp&&op(t[e.right.content.key]??null,e.right.content.value));)e.forward()},pp=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let c=r[s],l=n.currentAttributes.get(s)??null;if(!op(l,c)){o.set(s,l);let{left:r,right:u}=n;n.right=new gm(Z(a,Vd(i.store,a)),r,r&&r.lastId,u,u&&u.id,t,null,new Kp(s,c)),n.right.integrate(e,0),n.forward()}}return o},mp=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;fp(n,i);let s=pp(e,t,n,i),c=r.constructor===String?new $p(r):r instanceof Pf?new lm(r):new Wp(r),{left:l,right:u,index:d}=n;t._searchMarker&&Mf(t._searchMarker,n.index,c.getLength()),u=new gm(Z(o,Vd(a.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),n.right=u,n.index=d,n.forward(),up(e,t,n,s)},hp=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;fp(n,i);let s=pp(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===Kp));){if(!n.right.deleted)switch(n.right.content.constructor){case Kp:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if(op(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&Kd(e,Z(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
|
|
4
|
-
`;n.right=new gm(Z(o,Vd(a.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new $p(i)),n.right.integrate(e,0),n.forward()}up(e,t,n,s)},gp=(e,t,n,r,i)=>{let a=t,o=no();for(;a&&(!a.countable||a.deleted);){if(!a.deleted&&a.content.constructor===Kp){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t&&(c=!0),!t.deleted){let n=t.content;switch(n.constructor){case Kp:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&dp(i,n);break}}}t=t.right}return s},_p=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===Kp){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},vp=e=>{let t=0;return rf(e.doc,n=>{let r=e._start,i=e._start,a=no(),o=ro(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case Kp:dp(o,i.content);break;default:t+=gp(n,r,i,a,o),a=ro(o),r=i;break}i=i.right}}),t},yp=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a&&Yd(e,n.store.clients.get(r),a,i,e=>{!e.deleted&&e.content.constructor===Kp&&e.constructor!==Ip&&t.add(e.parent)})}rf(n,n=>{ju(e,e.deleteSet,e=>{if(e instanceof Ip||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===Kp?t.add(r):_p(n,e)});for(let e of t)vp(e)})},bp=(e,t,n)=>{let r=n,i=ro(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case lm:case Wp:case $p:n<t.right.length&&Kd(e,Z(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}a&&gp(e,a,t.right,i,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&Mf(o._searchMarker,t.index,-r+n),t},xp=class extends Sf{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){return this._changes===null&&(this._changes={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set}),this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];rf(e,e=>{let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0;break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``;break;case`retain`:c>0&&(e={retain:c},cc(o)||(e.attributes=ic({},o))),c=0;break}e&&t.push(e),a=null}};for(;i!==null;){switch(i.content.constructor){case lm:case Wp:this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1);break;case $p:this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length);break;case Kp:{let{key:t,value:s}=i.content;if(this.adds(i))this.deletes(i)||(op(n.get(t)??null,s)?s!==null&&i.delete(e):(a===`retain`&&u(),op(s,r.get(t)??null)?delete o[t]:o[t]=s));else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;op(e,s)||(a===`retain`&&u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0&&(op(n,s)?n!==null&&i.delete(e):(a===`retain`&&u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),dp(n,i.content));break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0&&e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},Sp=class e extends Pf{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??wf(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new xp(this,e,t);Nf(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??wf();let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===$p&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):rf(this.doc,n=>{let r=new sp(null,this._start,0,new Map);for(let i=0;i<e.length;i++){let a=e[i];if(a.insert!==void 0){let o=!t&&typeof a.insert==`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
|
|
5
|
-
`?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)&&mp(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&bp(n,r,a.delete):hp(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??wf();let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t&&(n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(Ld(s,e)||t!==void 0&&Ld(s,t))switch(s.content.constructor){case $p:{let r=i.get(`ychange`);e!==void 0&&!Ld(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)&&(c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0&&!Ld(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)&&(c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str;break}case lm:case Wp:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case Kp:Ld(s,e)&&(c(),dp(i,s.content));break}s=s.right}c()};return e||t?rf(a,n=>{e&&Rd(n,e),t&&Rd(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):rf(r,r=>{let i=lp(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),mp(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):rf(r,r=>{let i=lp(r,this,e,!n);mp(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):rf(n,n=>{bp(n,lp(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):rf(r,r=>{let i=lp(r,this,e,!1);i.right!==null&&hp(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):rf(this.doc,t=>{qf(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):rf(this.doc,n=>{Jf(n,this,e,t)})}getAttribute(e){return Yf(this,e)}getAttributes(){return Xf(this)}_write(e){e.writeTypeRef(im)}},Cp=e=>new Sp,wp=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??wf()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===Dp||t.constructor===Tp)&&t._start!==null)e=t._start;else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}else e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},Tp=class e extends Pf{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof Pf?e.clone():e)),t}get length(){return this.doc??wf(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new wp(this,e)}querySelector(e){e=e.toUpperCase();let t=new wp(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),uo(new wp(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){Nf(this,e,new kp(this,t,e))}toString(){return zf(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),Rf(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):rf(this.doc,n=>{Wf(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)rf(this.doc,n=>{let r=e&&e instanceof Pf?e._item:e;Hf(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0&&e!==null)throw ws(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):rf(this.doc,n=>{Kf(n,this,e,t)})}toArray(){return If(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Vf(this,e)}slice(e=0,t=this.length){return Ff(this,e,t)}forEach(e){Rf(this,e)}_write(e){e.writeTypeRef(om)}},Ep=e=>new Tp,Dp=class e extends Tp{constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName);return oc(this.getAttributes(),(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof Pf?e.clone():e)),t}toString(){let e=this.getAttributes(),t=[],n=[];for(let t in e)n.push(t);n.sort();let r=n.length;for(let i=0;i<r;i++){let r=n[i];t.push(r+`="`+e[r]+`"`)}let i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?` `+t.join(` `):``}>${super.toString()}</${i}>`}removeAttribute(e){this.doc===null?this._prelimAttrs.delete(e):rf(this.doc,t=>{qf(t,this,e)})}setAttribute(e,t){this.doc===null?this._prelimAttrs.set(e,t):rf(this.doc,n=>{Jf(n,this,e,t)})}getAttribute(e){return Yf(this,e)}hasAttribute(e){return Zf(this,e)}getAttributes(e){return e?Qf(this,e):Xf(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),i=this.getAttributes();for(let e in i){let t=i[e];typeof t==`string`&&r.setAttribute(e,t)}return Rf(this,i=>{r.appendChild(i.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(am),e.writeKey(this.nodeName)}},Op=e=>new Dp(e.readKey()),kp=class extends Sf{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{e===null?this.childListChanged=!0:this.attributesChanged.add(e)})}},Ap=class e extends ip{constructor(e){super(),this.hookName=e}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(e=document,t={},n){let r=t[this.hookName],i;return i=r===void 0?document.createElement(this.hookName):r.createDom(this),i.setAttribute(`data-yjs-hook`,this.hookName),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(sm),e.writeKey(this.hookName)}},jp=e=>new Ap(e.readKey()),Mp=class e extends Sp{get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(e=document,t,n){let r=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{let t=[];for(let n in e.attributes){let r=[];for(let t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:r})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n=``;for(let e=0;e<t.length;e++){let r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){let t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=`>`}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n}).join(``)}toJSON(){return this.toString()}_write(e){e.writeTypeRef(cm)}},Np=e=>new Mp,Pp=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw Ts()}mergeWith(e){return!1}write(e,t,n){throw Ts()}integrate(e,t){throw Ts()}},Fp=0,Ip=class extends Pp{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),Hd(e.doc.store,this)}write(e,t){e.writeInfo(Fp),e.writeLen(this.length-t)}getMissing(e,t){return null}},Lp=class e{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(e){throw Ts()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},Rp=e=>new Lp(e.readBuf()),zp=class e{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){Iu(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},Bp=e=>new zp(e.readLen()),Vp=(e,t)=>new Uu({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),Hp=class e{constructor(e){e._item&&console.error(`This document was already integrated as a sub-document. You should create a second instance instead with the same guid.`),this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(Vp(this.doc.guid,this.opts))}splice(e){throw Ts()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},Up=e=>new Hp(Vp(e.readString(),e.readAny())),Wp=class e{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(e){throw Ts()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},Gp=e=>new Wp(e.readJSON()),Kp=class e{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(e){throw Ts()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},qp=e=>new Kp(e.readKey(),e.readJSON()),Jp=class e{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeString(t===void 0?`undefined`:JSON.stringify(t))}}getRef(){return 2}},Yp=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let t=e.readString();t===`undefined`?n.push(void 0):n.push(JSON.parse(t))}return new Jp(n)},Xp=wc(`node_env`)===`development`,Zp=class e{constructor(e){this.arr=e,Xp&&pc(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeAny(t)}}getRef(){return 8}},Qp=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new Zp(n)},$p=class e{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split(``)}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+`�`,n.str=`�`+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},em=e=>new $p(e.readString()),tm=[np,ap,Cp,Op,Ep,jp,Np],nm=0,rm=1,im=2,am=3,om=4,sm=5,cm=6,lm=class e{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(e){throw Ts()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;t!==null;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},um=e=>new lm(tm[e.readTypeRef()](e)),dm=(e,t)=>{let n=t,r=0,i;do r>0&&(n=Z(n.client,n.clock+r)),i=Wd(e,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof gm);return{item:i,diff:r}},fm=(e,t)=>{for(;e!==null&&e.keep!==t;)e.keep=t,e=e.parent._item},pm=(e,t,n)=>{let{client:r,clock:i}=t.id,a=new gm(Z(r,i+n),t,Z(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&a.markDeleted(),t.keep&&(a.keep=!0),t.redone!==null&&(a.redone=Z(t.redone.client,t.redone.clock+n)),t.right=a,a.right!==null&&(a.right.left=a),e._mergeStructs.push(a),a.parentSub!==null&&a.right===null&&a.parent._map.set(a.parentSub,a),t.length=n,a},mm=(e,t)=>po(e,e=>Nu(e.deletions,t)),hm=(e,t,n,r,i,a)=>{let o=e.doc,s=o.store,c=o.clientID,l=t.redone;if(l!==null)return Kd(e,l);let u=t.parent._item,d=null,f;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!n.has(u)||hm(e,u,n,r,i,a)===null))return null;for(;u.redone!==null;)u=Kd(e,u.redone)}let p=u===null?t.parent:u.content.type;if(t.parentSub===null){for(d=t.left,f=t;d!==null;){let t=d;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:Kd(e,t.redone);if(t!==null&&t.parent._item===u){d=t;break}d=d.left}for(;f!==null;){let t=f;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:Kd(e,t.redone);if(t!==null&&t.parent._item===u){f=t;break}f=f.right}}else if(f=null,t.right&&!i){for(d=t;d!==null&&d.right!==null&&(d.right.redone||Nu(r,d.right.id)||mm(a.undoStack,d.right.id)||mm(a.redoStack,d.right.id));)for(d=d.right;d.redone;)d=Kd(e,d.redone);if(d&&d.right!==null)return null}else d=p._map.get(t.parentSub)||null;let m=Z(c,Vd(s,c)),h=new gm(m,d,d&&d.lastId,f,f&&f.id,p,t.parentSub,t.content.copy());return t.redone=m,fm(h,!0),h.integrate(e,0),h},gm=class e extends Pp{constructor(e,t,n,r,i,a,o,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=a,this.parentSub=o,this.redone=null,this.content=s,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Vd(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Vd(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===bd&&this.id.client!==this.parent.client&&this.parent.clock>=Vd(n,this.parent.client))return this.parent.client;if(this.origin&&=(this.left=qd(t,n,this.origin),this.left.lastId),this.rightOrigin&&=(this.right=Kd(t,this.rightOrigin),this.right.id),this.left&&this.left.constructor===Ip||this.right&&this.right.constructor===Ip)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===bd){let e=Wd(n,this.parent);e.constructor===Ip?this.parent=null:this.parent=e.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=qd(e,e.doc.store,Z(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let t=this.left,n;if(t!==null)n=t.right;else if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start;let r=new Set,i=new Set;for(;n!==null&&n!==this.right;){if(i.add(n),r.add(n),xd(this.origin,n.origin)){if(n.id.client<this.id.client)t=n,r.clear();else if(xd(this.rightOrigin,n.rightOrigin))break}else if(n.origin!==null&&i.has(Wd(e.doc.store,n.origin)))r.has(Wd(e.doc.store,n.origin))||(t=n,r.clear());else break;n=n.right}this.left=t}if(this.left!==null)this.right=this.left.right,this.left.right=this;else{let e;if(this.parentSub!==null)for(e=this.parent._map.get(this.parentSub)||null;e!==null&&e.left!==null;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}this.right===null?this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)):this.right.left=this,this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Hd(e.doc.store,this),this.content.integrate(e,this),Qd(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new Ip(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Z(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&xd(e.origin,this.lastId)&&this.right===e&&xd(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),Iu(e.deleteSet,this.id.client,this.id.clock,this.length),Qd(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw Es();this.content.gc(e),t?Jd(e,this,new Ip(this.id,this.length)):this.content=new zp(this.length)}write(e,t){let n=t>0?Z(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(i===null?0:32);if(e.writeInfo(a),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let t=this.parent;if(t._item!==void 0){let n=t._item;if(n===null){let n=Sd(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===bd?(e.writeParentInfo(!1),e.writeLeftID(t)):Es();i!==null&&e.writeString(i)}this.content.write(e,t)}},_m=(e,t)=>vm[t&31](e),vm=[()=>{Es()},Bp,Yp,Rp,em,Gp,qp,um,Qp,Up,()=>{Es()}],ym=10,bm=class extends Pp{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){Es()}write(e,t){e.writeInfo(ym),is(e.restEncoder,this.length-t)}getMissing(e,t){return null}},xm=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:{},Sm=`__ $YJS$ __`;xm[Sm]===!0&&console.error(`Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438`),xm[Sm]=!0;var Cm=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},wm=/[\uD800-\uDBFF]/,Tm=/[\uDC00-\uDFFF]/,Em=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&wm.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&Tm.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},Dm=(e,t)=>e>>>t|e<<32-t,Om=e=>Dm(e,2)^Dm(e,13)^Dm(e,22),km=e=>Dm(e,6)^Dm(e,11)^Dm(e,25),Am=e=>Dm(e,7)^Dm(e,18)^e>>>3,jm=e=>Dm(e,17)^Dm(e,19)^e>>>10,Mm=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Nm=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pm=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(Nm),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=jm(t[e-2])+t[e-7]+Am(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+km(o)+(o&s^~o&c)+Mm[e]+t[e]>>>0,d=Om(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/Fo,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},Fm=e=>new Pm().digest(e),Im=new Te(`y-sync`),Lm=new Te(`y-undo`),Rm=new Te(`yjs-cursor`),zm=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},Bm=e=>kc(zm(Fm(jc(e)))),Vm=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!Nu(t.ds,e.id),Hm=[{light:`#ecd44433`,dark:`#ecd444`}],Um=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=so();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,qs(t))}return e.get(n)},Wm=(e,{colors:t=Hm,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new Jm(e,a),c=new Fe({props:{editable:e=>{let t=Im.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:Im,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(Im);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&lu(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=Lm.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},Im)})}},destroy:()=>{s.destroy()}})});return c},Gm=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new be(e.doc));else if(t.type===`node`){let r=Ch(n.doc,n.type,t.anchor,n.mapping);e.setSelection(Km(e,r))}else{let r=Ch(n.doc,n.type,t.anchor,n.mapping),i=Ch(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(Je.between(e.doc.resolve(r),e.doc.resolve(i)))}},Km=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?Le.create(e.doc,t):Je.near(n)},qm=(e,t)=>({type:t.selection.jsonID,anchor:xh(t.selection.anchor,e.type,e.mapping),head:xh(t.selection.head,e.type,e.mapping)}),Jm=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=Cm(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=qm(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(yc&&this._domSelectionInView===null&&(lu(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=ql.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=Fd(Lu(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(Im,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>Xm(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new h(Ze.from(e),0,0));t.setMeta(Im,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>Xm(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new h(Ze.from(t),0,0));if(e){let t=bo(xo(e.anchor,0),n.doc.content.size),r=bo(xo(e.head,0),n.doc.content.size);n.setSelection(Je.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(Im,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=Id(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Es(),r=new Uu({gc:!1}),id(r,t),t=Id(r),id(r,e),e=Id(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[Ud(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{ju(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:Um(n.colorMapping,n.colors,r)}},s=Lf(i,new Pd(t.ds,e.sv)).map(n=>!n._item.deleted||Vm(n._item,e)||Vm(n._item,t)?Xm(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new h(Ze.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(Im,{isChangeOrigin:!0}))},Im)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=Im.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);ju(t,t.deleteSet,e=>{if(e.constructor===gm){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>Ym(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new h(Ze.from(n),0,0));Gm(r,this.beforeTransactionSelection,this),r=r.setMeta(Im,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof cf}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{mh(this.doc,this.type,e,this),this.beforeTransactionSelection=qm(this,this.prosemirrorView.state)},Im)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},Ym=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof Dp)return Xm(e,t,n,r,i,a);throw Ts()}return o},Xm=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof Dp){let s=Ym(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof Sp&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=Zm(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):Lf(e,new Pd(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(Vm(e._item,r)?Vm(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=t.node(e.nodeName,s,o);return n.mapping.set(e,c),c}catch(r){console.warn(`[y-prosemirror] schema.node(`+e.nodeName+`) threw:`,String(r&&r.message||r));let i=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};if(t.nodes[e.nodeName]&&t.nodes[e.nodeName].spec&&t.nodes[e.nodeName].spec.inline)i.inline++;else if(i.block++,t.nodes.rawMdxFallback)try{let i=t.node(`rawMdxFallback`,{reason:String(r&&r.message||r)},[t.text(e.nodeName)]);return n.mapping.set(e,i),i}catch(e){console.warn(`[y-prosemirror] rawMdxFallback substitution also failed:`,String(e&&e.message||e))}return n.mapping.delete(e),null}},Zm=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,fh(n.attributes,t)))}}catch(e){console.warn(`[y-prosemirror] schema.text() threw:`,String(e&&e.message||e));let t=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};return t.inline++,null}return o},Qm=(e,t)=>{let n=new Mp,r=e.map(e=>({insert:e.text,attributes:ph(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},$m=(e,t)=>{let n=new Dp(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}return n.insert(0,rh(e).map(e=>eh(e,t))),t.mapping.set(n,e),n},eh=(e,t)=>e instanceof Array?Qm(e,t):$m(e,t),th=e=>typeof e==`object`&&!!e,nh=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||th(o)&&th(s)&&nh(o,s)}return r},rh=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},ih=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&ac(e.attributes||{}).length===t[n].marks.length&&lc(e.attributes,(e,r)=>{let i=dh(r),a=t[n].marks;return a.find(e=>e.type.name===i)?nh(e,a.find(e=>e.type.name===i)?.attrs):!1}))},ah=(e,t)=>{if(e instanceof Dp&&!(t instanceof Array)&&hh(e,t)){let n=rh(t);return e._length===n.length&&nh(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>ah(e,n[t]))}return e instanceof Mp&&t instanceof Array&&ih(e,t)},oh=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),sh=(e,t,n)=>{let r=e.toArray(),i=rh(t),a=i.length,o=r.length,s=bo(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(oh(n.mapping.get(e),t))u=!0;else if(!ah(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(oh(n.mapping.get(e),t))u=!0;else if(!ah(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},ch=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof $p?t+=n.content.str:n.content instanceof Kp&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},lh=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=ch(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,ph(e.marks,n))})),{insert:o,remove:s,index:c}=Em(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},uh=/(.*)(--[a-zA-Z0-9+/=]{8})$/,dh=e=>uh.exec(e)?.[1]??e,fh=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(dh(r),e[r]));return n},ph=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=io(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${Bm(e.toJSON())}`:e.type.name]=e.attrs}}),n},mh=(e,t,n,r)=>{if(t instanceof Dp&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof Dp){let e=t.getAttributes(),r=n.attrs;for(let n in r)r[n]===null?t.removeAttribute(n):e[n]!==r[n]&&n!==`ychange`&&t.setAttribute(n,r[n]);for(let n in e)r[n]===void 0&&t.removeAttribute(n)}let i=rh(n),a=i.length,o=t.toArray(),s=o.length,c=bo(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!oh(r.mapping.get(e),t))if(ah(e,t))r.mapping.set(e,t);else break}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!oh(r.mapping.get(e),t))if(ah(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof Mp&&c instanceof Array)ih(n,c)||lh(n,c,r),l+=1;else{let i=n instanceof Dp&&hh(n,c),a=d instanceof Dp&&hh(d,f);if(i&&a){let e=sh(n,c,r),t=sh(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(mh(e,n,c,r),l+=1):a?(mh(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[eh(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof Mp?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(eh(i[t],r));t.insert(l,e)}},Im)},hh=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,gh=null,_h=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=Im.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},vh=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=gh;gh=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new _h(t,r,e))})}),new e(n)}},yh=(e=vh.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||lu(0,()=>yh(e,!0));return}throw r}n=!1,e.dequeueFirst()}},bh=(e,t,n)=>{gh||(gh=new Map,lu(0,yh)),io(gh,e,no).set(t,n)},xh=(e,t,n)=>{if(e===0)return Ad(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof Mp){if(r._length>=e)return Ad(r,e,-1);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new wd(r._item===null?null:r._item.id,r._item===null?Sd(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new wd(r._item===null?null:r._item.id,r._item===null?Sd(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw Es();if(e===0&&r.constructor!==Mp&&r!==t)return Sh(r._item.parent,r._item)}return Ad(t,t._length,-1)},Sh=(e,t)=>{let n=null,r=null;return e._item===null?r=Sd(e):n=Z(e._item.id.client,e._item.id.clock),new wd(n,r,t.id)},Ch=(e,t,n,r)=>{let i=Md(n,e);if(i===null||i.type!==t&&!Cd(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===Mp)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;t++,n instanceof Mp?o+=n._length:o+=r.get(n).nodeSize}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;t.deleted||(e instanceof Mp?o+=e._length:o+=r.get(e).nodeSize),t=t.right}}a=e}return o-1},wh=(e,t,n)=>e!==t,Th=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(``),i=document.createTextNode(``);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},Eh=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),Dh=/^#[0-9a-fA-F]{6}$/,Oh=(e,t,n,r,i)=>{let a=Im.getState(e);if(a==null||a.doc==null||a.binding==null)return ge.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?ge.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:Dh.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=Ch(o,a.type,Ed(t.cursor.anchor),a.binding.mapping),u=Ch(o,a.type,Ed(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=xo(e.doc.content.size-1,0);l=bo(l,t),u=bo(u,t),s.push(Ke.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=bo(l,u),o=xo(l,u);s.push(Ke.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),ge.create(e.doc,s))},kh=(e,{awarenessStateFilter:t=wh,cursorBuilder:n=Th,selectionBuilder:r=Eh,getSelection:i=e=>e.selection}={},a=`cursor`)=>new Fe({key:Rm,state:{init(i,a){return Oh(a,e,t,n,r)},apply(i,a,o,s){let c=Im.getState(s),l=i.getMeta(Rm);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?Oh(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>Rm.getState(e)},view:t=>{let n=()=>{t.docView&&bh(t,Rm,{awarenessUpdated:!0})},r=()=>{let n=Im.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=xh(o.anchor,n.type,n.binding.mapping),c=xh(o.head,n.type,n.binding.mapping);(r.cursor==null||!Nd(Ed(r.cursor.anchor),s)||!Nd(Ed(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&Ch(n.doc,n.type,Ed(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),Ah=e=>{let t=Lm.getState(e).undoManager;if(t!=null)return t.undo(),!0},jh=e=>{let t=Lm.getState(e).undoManager;if(t!=null)return t.redo(),!0},Mh=new Set([`paragraph`]),Nh=(e,t)=>!(e instanceof gm)||!(e.content instanceof lm)||!(e.content.type instanceof Sp||e.content.type instanceof Dp&&t.has(e.content.type.nodeName))||e.content.type._length===0,Ph=({protectedNodes:e=Mh,trackedOrigins:t=[],undoManager:n=null}={})=>new Fe({key:Lm,state:{init:(r,i)=>{let a=Im.getState(i),o=n||new cf(a.type,{trackedOrigins:new Set([Im].concat(t)),deleteFilter:t=>Nh(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=Im.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:qm(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=Im.getState(e.state),n=Lm.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,Lm.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}});D({event:S(`ok-branch-switched-clear-failed`),branch:ze(),docName:ze(),reason:ze()});async function Fh(e,t){let n=[];for(let[r,i]of e.entries)i.kind===`active`&&i.persistence!==null&&n.push(i.persistence.clearData().catch(e=>{let n={event:`ok-branch-switched-clear-failed`,docName:r,branch:t,reason:e instanceof Error?e.message:String(e)};console.warn(JSON.stringify(n))}));await Promise.all(n),e.clearBufferedUpdates(),e.recycleAllEntries()}function Ih(e){let t=!1;return()=>{t?e():t=!0}}function Lh(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}async function Rh(e,t=``){let n;try{n=await fetch(`${t}/api/server-info`,{signal:AbortSignal.timeout(5e3)})}catch{return}if(!n.ok)return;let r;try{r=await n.json()}catch{return}let i=d.safeParse(r);if(!i.success){console.warn(JSON.stringify({event:`ok-server-info-schema-mismatch`,issues:i.error.issues}));return}if(e.setExpectedServerInstanceId(i.data.serverInstanceId),i.data.currentBranch!==void 0&&e.compareAndUpdateObservedBranch(i.data.currentBranch)&&Fh(e,i.data.currentBranch),i.data.currentDiskAckSVs!==void 0){let t={};for(let[e,n]of Object.entries(i.data.currentDiskAckSVs))try{t[e]=Lh(n)}catch{}e.observeDiskAckBatch(t)}}async function zh(e){let t;try{t=await fetch(`/api/config`,{signal:e,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return{status:`error`,code:`network`}}if(t.status===404||t.status===501)return{status:`absent`};if(!t.ok)return{status:`error`,code:t.status};let n;try{n=await t.json()}catch{return{status:`error`,code:`invalid-body`}}if(typeof n!=`object`||!n||Array.isArray(n))return{status:`error`,code:`invalid-body`};let r=n;return{status:`ok`,config:{collabUrl:typeof r.collabUrl==`string`?r.collabUrl:null,previewUrl:typeof r.previewUrl==`string`?r.previewUrl:null,port:typeof r.port==`number`?r.port:0}}}function Bh(e){return qh(e,Xe)}function Vh(e){return qh(e,m)}function Hh(e){return qh(e,$e)}function Uh(e){return qh(e,ue)}function Wh(e){let t=qh(e,z);if(!t)return null;try{return{docName:t.docName,sv:Gh(t.sv)}}catch{return null}}function Gh(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Kh(e,t){let n=Vh(e);if(n){t.onServerInfo?.(n);return}let r=Hh(e);if(r){t.onBranchSwitched?.(r);return}let i=Wh(e);if(i){t.onDiskAck?.(i);return}let a=Bh(e);if(a){t.onDerivedView?.(a);return}let o=Uh(e);if(o){t.onConfigValidationRejected?.(o);return}t.onUnknown?.(e)}function qh(e,t){let n;try{n=JSON.parse(e)}catch{return null}let r=t.safeParse(n);return r.success?r.data:null}function Jh(){return typeof location>`u`?`ws://localhost/collab`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/collab`}function Yh(e){if(e===void 0)return null;let t=e.okDesktop;return!t||!t.config.collabUrl||t.config.collabUrl.length===0?null:t}function Xh(e){return{collabUrl:e.collabUrl,attempts:0,terminal:!1,lastError:null}}var Zh=2e3,Qh=15e3;function $h(e){let t=e.terminalAfterMs??3e4,n=e.initialDelayMs??Zh,r=e.maxDelayMs??Qh,i=e.log??{info:console.info,warn:console.warn},a=new AbortController,o=null,s=n,c=0,l=!1,u=!1,d=null,f=e.now(),p=async()=>{c+=1;let n=null;try{let t=await e.fetchConfig(a.signal);t.status===`absent`?(n=e.fallbackUrl(),d=null):t.status===`ok`&&t.config.collabUrl!==null?(n=t.config.collabUrl,d=null):t.status===`ok`?(u||(u=!0,i.info(`[collab-url] ok ui responded but server.lock has no port yet — retrying`)),d={kind:`null-collab`}):t.status===`error`&&(i.warn(`[collab-url] /api/config error (${t.code}) — retrying in ${s}ms`),d={kind:`error`,code:t.code})}catch(e){if(e.name===`AbortError`)return;d={kind:`error`,code:`network`}}if(!l){if(n!==null){e.onStateChange({collabUrl:n,attempts:c,terminal:!1,lastError:null});return}if(e.now()-f>=t){e.onStateChange({collabUrl:null,attempts:c,terminal:!0,lastError:d});return}e.onStateChange({collabUrl:null,attempts:c,terminal:!1,lastError:d}),o=e.setTimeout(()=>{p()},s),s=Math.min(s*2,r)}};return p(),{cancel:()=>{l=!0,a.abort(),o!==null&&(e.clearTimeout(o),o=null)}}}function eg(){let e=(0,J.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={collabUrl:null,attempts:0,terminal:!1,lastError:null},e[0]=t):t=e[0];let[n,r]=(0,K.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i={token:0},e[1]=i):i=e[1];let a=(0,K.useRef)(i),[o,s]=(0,K.useState)(0),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=a.current.token=a.current.token+1,t=Yh(typeof window<`u`?window:void 0);if(t){r(Xh(t.config));let n=t.onProjectSwitched(t=>{e===a.current.token&&r(Xh(t))});return()=>{n()}}let n=$h({fetchConfig:zh,fallbackUrl:Jh,now:Date.now,setTimeout:ig,clearTimeout:rg,onStateChange:t=>{e===a.current.token&&r(t)}});return()=>{n.cancel()}},e[2]=c):c=e[2];let l;e[3]===o?l=e[4]:(l=[o],e[3]=o,e[4]=l),(0,K.useEffect)(c,l);let u;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{a.current.token=a.current.token+1,r(ng),s(tg)},e[5]=u):u=e[5];let d=u,f;return e[6]===n?f=e[7]:(f={...n,retry:d},e[6]=n,e[7]=f),f}function tg(e){return e+1}function ng(e){return{...e,terminal:!1,lastError:null}}function rg(e){return globalThis.clearTimeout(e)}function ig(e,t){return globalThis.setTimeout(e,t)}function ag(e){try{let t=e.state;return Lm.getState(t)?.undoManager??null}catch{return null}}function og(e){return!(e.viewCount>0&&e.viewCount>=50||e.bytes>5e5)}var sg=new Map,cg=new Map,lg=[],ug=[],dg=new Set,fg=null;function pg(){if(fg)return fg;if(typeof document>`u`||typeof document.createElement!=`function`)return null;let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-parking`,``),e.style.display=`none`,e.style.position=`absolute`,e.style.left=`-99999px`,fg=e,e}function mg(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!og(i)){let e=r(n);return Y(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`}),{editor:e.editor,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,__uncached:!0}}let a=sg.get(t);if(a){if(Sg(a,n),a.activeMountKey=t,wg(lg,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.editor.commands.focus()}catch{}return Y(`ok/cache/hit`,{docName:t,kind:`tiptap`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`tiptap`}),a}for(;sg.size>=10;){let e=Tg(lg,t);if(!e)break;gg(e)}let o=r(n),s={editor:o.editor,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t};return sg.set(t,s),wg(lg,t),Y(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`tiptap`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`tiptap`}),s}function hg(e){if(e.__uncached){let t=ag(e.editor);try{e.editor.destroy()}catch{}t&&(t.restore=void 0),e.activeMountKey=null;return}let t=bg(e.editor);if(t){e.hadFocus=xg(t.dom),e.scrollTop=(t.scrollDOM??t.dom.parentElement??t.dom).scrollTop??0;let n=t.dom.parentElement;n&&n.removeChild(t.dom);let r=pg();r&&r.appendChild(t.dom)}e.activeMountKey=null}function gg(e){let t=sg.get(e);if(!t)return!1;let n=ag(t.editor);try{t.editor.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`editor`,message:t instanceof Error?t.message:String(t)})}n&&(n.restore=void 0);try{t.provider.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}sg.delete(e);let r=lg.indexOf(e);return r!==-1&&lg.splice(r,1),Y(`ok/cache/evict`,{docName:e,kind:`tiptap`}),!0}function _g(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!og(i)){let e=r(n);return Y(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`,kind:`cm`}),{view:e.view,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,__uncached:!0}}let a=cg.get(t);if(a){if(Cg(a,n),a.activeMountKey=t,wg(ug,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.view.focus()}catch{}return Y(`ok/cache/hit`,{docName:t,kind:`cm`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`cm`}),a}for(;cg.size>=10;){let e=Tg(ug,t);if(!e)break;yg(e)}let o=r(n),s={view:o.view,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t};return cg.set(t,s),wg(ug,t),Y(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`cm`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`cm`}),s}function vg(e){if(e.__uncached){try{e.view.destroy()}catch{}e.activeMountKey=null;return}let t=e.view.dom;e.hadFocus=xg(t),e.scrollTop=(e.view.scrollDOM??t).scrollTop??0;let n=t.parentElement;n&&n.removeChild(t);let r=pg();r&&r.appendChild(t),e.activeMountKey=null}function yg(e){let t=cg.get(e);if(!t)return!1;try{t.view.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`view`,message:t instanceof Error?t.message:String(t)})}try{t.provider.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}cg.delete(e);let n=ug.indexOf(e);return n!==-1&&ug.splice(n,1),Y(`ok/cache/evict`,{docName:e,kind:`cm`}),!0}function bg(e){return e.editorView??null}function xg(e){if(typeof document>`u`)return!1;let t=document.activeElement;return t?t===e?!0:e.contains(t):!1}function Sg(e,t){let n=bg(e.editor);if(!n)return;let r=n.dom,i=r.parentElement;i&&i!==t&&i.removeChild(r),r.parentElement!==t&&t.appendChild(r)}function Cg(e,t){let n=e.view.dom,r=n.parentElement;r&&r!==t&&r.removeChild(n),n.parentElement!==t&&t.appendChild(n)}function wg(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.push(t)}function Tg(e,t){for(let n of e)if(n!==t&&!dg.has(n))return n;Y(`ok/cache/evict-fallback-activity-saturated`,{mountingDocName:t,lruLength:e.length,activityMountCount:dg.size});for(let n of e)if(n!==t)return n;return null}function Eg(e){let t=dg,n=new Set(e);for(let e of t){if(n.has(e))continue;let t=Og(e);if(t)try{t.disconnect(),Y(`ok/cache/disconnect`,{docName:e})}catch(t){Y(`ok/cache/disconnect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}}for(let e of n){if(t.has(e))continue;let n=Og(e);if(!n)continue;let r=t=>{Y(`ok/cache/connect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})};try{let t=n.connect();t&&typeof t.then==`function`?t.then(()=>Y(`ok/cache/connect`,{docName:e}),e=>r(e)):Y(`ok/cache/connect`,{docName:e})}catch(e){r(e)}}dg=n}var Dg=null;function Og(e){let t=sg.get(e);if(t)return t.provider;let n=cg.get(e);if(n)return n.provider;if(Dg){let t=Dg.entries.get(e);if(t)return t.provider}return null}function kg(e){Dg=e;let t=e.onEvict(e=>{gg(e),yg(e)});return()=>{t(),Dg===e&&(Dg=null)}}var Ag=Math.floor,jg=(e,t)=>e<t?e:t,Mg=(e,t)=>e>t?e:t;Number.isNaN;var Ng=128,Pg=1<<17,Fg=1<<18,Ig=1<<19,Lg=1<<20,Rg=1<<21,zg=1<<22,Bg=1<<23,Vg=1<<24,Hg=1<<25,Ug=1<<26,Wg=1<<27,Gg=1<<28,Kg=1<<29,qg=1<<30,Jg=127;Pg-1,Fg-1,Ig-1,Lg-1,Rg-1,zg-1,Bg-1,Vg-1,Hg-1,Ug-1,Wg-1,Gg-1,Kg-1,qg-1;var Yg=2**53-1;Number.isInteger,Number.isNaN,Number.parseInt;var Xg=String.fromCharCode;String.fromCodePoint,Xg(65535);var Zg=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},Qg=typeof TextEncoder<`u`?new TextEncoder:null,$g=Qg?e=>Qg.encode(e):Zg,e_=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});e_&&e_.decode(new Uint8Array).length===1&&(e_=null);var t_=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},n_=(e,t)=>{for(;t>Jg;)t_(e,Ng|Jg&t),t=Ag(t/128);t_(e,Jg&t)},r_=new Uint8Array(3e4),i_=r_.length/3,a_=Qg&&Qg.encodeInto?(e,t)=>{if(t.length<i_){let n=Qg.encodeInto(t,r_).written||0;n_(e,n);for(let t=0;t<n;t++)t_(e,r_[t])}else s_(e,$g(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;n_(e,r);for(let t=0;t<r;t++)t_(e,n.codePointAt(t))},o_=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=jg(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Mg(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},s_=(e,t)=>{n_(e,t.byteLength),o_(e,t)},c_=e=>Error(e),l_=c_(`Unexpected end of array`),u_=c_(`Integer out of Range`),d_=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},f_=e=>d_(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&Jg)*n,n*=128,r<Ng)return t;if(t>Yg)throw u_}throw l_},h_=e_?e=>e_.decode(f_(e)):e=>{let t=m_(e);if(t===0)return``;{let n=String.fromCodePoint(p_(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(p_(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},g_=function(e){return e[e.Token=0]=`Token`,e[e.PermissionDenied=1]=`PermissionDenied`,e[e.Authenticated=2]=`Authenticated`,e}({}),__=(e,t)=>{n_(e,g_.Token),a_(e,t)},v_=(e,t,n,r)=>{switch(m_(e)){case g_.Token:t();break;case g_.PermissionDenied:n(h_(e));break;case g_.Authenticated:r(h_(e));break;default:}},y_=e=>Array.from(e.entries()).map(([e,t])=>({clientId:e,...t})),b_=`\0`;function x_(e,t){return e+b_+t}function S_(e){let t=e.indexOf(b_);return t===-1?{documentName:e,sessionId:null}:{documentName:e.substring(0,t),sessionId:e.substring(t+1)}}var C_=function(e){return e[e.Connecting=0]=`Connecting`,e[e.Open=1]=`Open`,e[e.Closing=2]=`Closing`,e[e.Closed=3]=`Closed`,e}({});function w_(e){return e||={},{delay:e.delay===void 0?200:e.delay,initialDelay:e.initialDelay===void 0?0:e.initialDelay,minDelay:e.minDelay===void 0?0:e.minDelay,maxDelay:e.maxDelay===void 0?0:e.maxDelay,factor:e.factor===void 0?0:e.factor,maxAttempts:e.maxAttempts===void 0?3:e.maxAttempts,timeout:e.timeout===void 0?0:e.timeout,jitter:e.jitter===!0,initialJitter:e.initialJitter===!0,handleError:e.handleError===void 0?null:e.handleError,handleTimeout:e.handleTimeout===void 0?null:e.handleTimeout,beforeAttempt:e.beforeAttempt===void 0?null:e.beforeAttempt,calculateDelay:e.calculateDelay===void 0?null:e.calculateDelay}}async function T_(e){return new Promise(t=>setTimeout(t,e))}function E_(e,t){let n=t.delay;if(n===0)return 0;if(t.factor&&(n*=t.factor**(e.attemptNum-1),t.maxDelay!==0&&(n=Math.min(n,t.maxDelay))),t.jitter){let e=Math.ceil(t.minDelay);n=Math.floor(Math.random()*(Math.floor(n)-e+1))+e}return Math.round(n)}async function D_(e,t){let n=w_(t);for(let e of[`delay`,`initialDelay`,`minDelay`,`maxDelay`,`maxAttempts`,`timeout`]){let t=n[e];if(!Number.isInteger(t)||t<0)throw Error(`Value for ${e} must be an integer greater than or equal to 0`)}if(n.factor.constructor!==Number||n.factor<0)throw Error(`Value for factor must be a number greater than or equal to 0`);if(n.delay<n.minDelay)throw Error(`delay cannot be less than minDelay (delay: ${n.delay}, minDelay: ${n.minDelay}`);let r={attemptNum:0,attemptsRemaining:n.maxAttempts?n.maxAttempts:-1,aborted:!1,abort(){r.aborted=!0}},i=n.calculateDelay||E_;async function a(){if(n.beforeAttempt&&n.beforeAttempt(r,n),r.aborted){let e=Error(`Attempt aborted`);throw e.code=`ATTEMPT_ABORTED`,e}let t=async e=>{if(n.handleError&&await n.handleError(e,r,n),r.aborted||r.attemptsRemaining===0)throw e;r.attemptNum++;let t=i(r,n);return t&&await T_(t),a()};return r.attemptsRemaining>0&&r.attemptsRemaining--,n.timeout?new Promise((i,a)=>{let o=setTimeout(()=>{if(n.handleTimeout)try{i(n.handleTimeout(r,n))}catch(e){a(e)}else{let e=Error(`Retry timeout (attemptNum: ${r.attemptNum}, timeout: ${n.timeout})`);e.code=`ATTEMPT_TIMEOUT`,a(e)}},n.timeout);e(r,n).then(e=>{clearTimeout(o),i(e)}).catch(e=>{clearTimeout(o),t(e).then(i).catch(a)})}):e(r,n).catch(t)}let o=n.calculateDelay?n.calculateDelay(r,n):n.initialDelay;if(o&&await T_(o),r.attemptNum<1&&n.initialJitter){let e=i(r,n);e&&await T_(e)}return a()}var O_=Math.floor,k_=(e,t)=>e<t?e:t,A_=(e,t)=>e>t?e:t;Number.isNaN;var j_=64,M_=128,N_=1<<17,P_=1<<18,F_=1<<19,I_=1<<20,L_=1<<21,R_=1<<22,z_=1<<23,B_=1<<24,V_=1<<25,H_=1<<26,U_=1<<27,W_=1<<28,G_=1<<29,K_=1<<30,q_=63,J_=127;N_-1,P_-1,F_-1,I_-1,L_-1,R_-1,z_-1,B_-1,V_-1,H_-1,U_-1,W_-1,G_-1,K_-1;var Y_=2**53-1;Number.isInteger,Number.isNaN,Number.parseInt;var X_=()=>new Set,Z_=Array.from;Array.isArray;var Q_=String.fromCharCode;String.fromCodePoint,Q_(65535);var $_=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},ev=typeof TextEncoder<`u`?new TextEncoder:null,tv=ev?e=>ev.encode(e):$_,nv=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});nv&&nv.decode(new Uint8Array).length===1&&(nv=null);var rv=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},iv=()=>new rv,av=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},ov=e=>{let t=new Uint8Array(av(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},sv=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},cv=(e,t)=>{for(;t>J_;)sv(e,M_|J_&t),t=O_(t/128);sv(e,J_&t)},lv=new Uint8Array(3e4),uv=lv.length/3,dv=ev&&ev.encodeInto?(e,t)=>{if(t.length<uv){let n=ev.encodeInto(t,lv).written||0;cv(e,n);for(let t=0;t<n;t++)sv(e,lv[t])}else pv(e,tv(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;cv(e,r);for(let t=0;t<r;t++)sv(e,n.codePointAt(t))},fv=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=k_(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(A_(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},pv=(e,t)=>{cv(e,t.byteLength),fv(e,t)},mv=e=>Error(e),hv=mv(`Unexpected end of array`),gv=mv(`Integer out of Range`),_v=class{constructor(e){this.arr=e,this.pos=0}},vv=e=>new _v(e),yv=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},bv=e=>yv(e,Sv(e)),xv=e=>e.arr[e.pos++],Sv=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&J_)*n,n*=128,r<M_)return t;if(t>Y_)throw gv}throw hv},Cv=e=>{let t=e.arr[e.pos++],n=t&q_,r=64,i=(t&j_)>0?-1:1;if((t&M_)===0)return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&J_)*r,r*=128,t<M_)return i*n;if(n>Y_)throw gv}throw hv},wv=nv?e=>nv.decode(bv(e)):e=>{let t=Sv(e);if(t===0)return``;{let n=String.fromCodePoint(xv(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(xv(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},Tv=e=>{let t=e.pos,n=wv(e);return e.pos=t,n},Ev=Date.now,Dv=()=>new Map,Ov=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},kv=class{constructor(){this._observers=Dv()}on(e,t){Ov(this._observers,e,X_).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return Z_((this._observers.get(e)||Dv()).values()).forEach(e=>e(...t))}destroy(){this._observers=Dv()}},Av=Symbol(`Equality`),jv=Object.keys,Mv=e=>jv(e).length,Nv=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Pv=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[Av]!=null)return e[Av](t);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)||!Pv(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(Mv(e)!==Mv(t))return!1;for(let n in e)if(!Nv(e,n)||!Pv(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(!Pv(e[n],t[n]))return!1;break;default:return!1}return!0},Fv=3e4,Iv=class extends kv{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=Ev();this.getLocalState()!==null&&Fv/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&Fv<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&Lv(this,t,`timeout`)},O_(Fv/10)),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),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:Ev()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),Pv(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},Lv=(e,t,n)=>{let r=[];for(let n=0;n<t.length;n++){let i=t[n];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:Ev()})}r.push(i)}}r.length>0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},Rv=(e,t,n=e.states)=>{let r=t.length,i=iv();cv(i,r);for(let a=0;a<r;a++){let r=t[a],o=n.get(r)||null,s=e.meta.get(r).clock;cv(i,r),cv(i,s),dv(i,JSON.stringify(o))}return ov(i)},zv=(e,t,n)=>{let r=vv(t),i=Ev(),a=[],o=[],s=[],c=[],l=Sv(r);for(let t=0;t<l;t++){let t=Sv(r),n=Sv(r),l=JSON.parse(wv(r)),u=e.meta.get(t),d=e.states.get(t),f=u===void 0?0:u.clock;(f<n||f===n&&l===null&&e.states.has(t))&&(l===null?t===e.clientID&&e.getLocalState()!=null?n++:e.states.delete(t):e.states.set(t,l),e.meta.set(t,{clock:n,lastUpdated:i}),u===void 0&&l!==null?a.push(t):u!==void 0&&l===null?c.push(t):l!==null&&(Pv(l,d)||s.push(t),o.push(t)))}(a.length>0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])},Bv=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}},Vv=class{constructor(e){this.data=e,this.encoder=iv(),this.decoder=vv(new Uint8Array(this.data))}peekVarString(){return Tv(this.decoder)}readVarUint(){return Sv(this.decoder)}readVarString(){return wv(this.decoder)}readVarUint8Array(){return bv(this.decoder)}writeVarUint(e){return cv(this.encoder,e)}writeVarString(e){return dv(this.encoder,e)}writeVarUint8Array(e){return pv(this.encoder,e)}length(){return av(this.encoder)}},Hv=function(e){return e[e.Sync=0]=`Sync`,e[e.Awareness=1]=`Awareness`,e[e.Auth=2]=`Auth`,e[e.QueryAwareness=3]=`QueryAwareness`,e[e.Stateless=5]=`Stateless`,e[e.CLOSE=7]=`CLOSE`,e[e.SyncStatus=8]=`SyncStatus`,e[e.Ping=9]=`Ping`,e[e.Pong=10]=`Pong`,e}({}),Uv=function(e){return e.Connecting=`connecting`,e.Connected=`connected`,e.Disconnected=`disconnected`,e}({}),Wv=class{constructor(){this.encoder=iv()}get(e){return e.encoder}toUint8Array(){return ov(this.encoder)}},Gv=class extends Wv{constructor(...e){super(...e),this.type=Hv.CLOSE,this.description=`Ask the server to close the connection`}get(e){return dv(this.encoder,e.documentName),cv(this.encoder,this.type),this.encoder}},Kv=class e extends Bv{static{this.DEDUPLICATABLE_TYPES=new Set([Hv.Awareness,Hv.QueryAwareness])}constructor(e){super(),this.messageQueue=[],this.configuration={url:``,autoConnect:!0,preserveTrailingSlash:!1,document:void 0,WebSocketPolyfill:void 0,messageReconnectTimeout:3e4,delay:1e3,initialDelay:0,factor:2,maxAttempts:0,minDelay:1e3,maxDelay:3e4,jitter:!0,timeout:0,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,handleTimeout:null,providerMap:new Map},this.webSocket=null,this.webSocketHandlers={},this.shouldConnect=!0,this.status=Uv.Disconnected,this.lastMessageReceived=0,this.identifier=0,this.intervals={connectionChecker:null},this.connectionAttempt=null,this.receivedOnOpenPayload=void 0,this.closeTries=0,this.setConfiguration(e),this.configuration.WebSocketPolyfill=e.WebSocketPolyfill?e.WebSocketPolyfill:WebSocket,this.on(`open`,this.configuration.onOpen),this.on(`open`,this.onOpen.bind(this)),this.on(`connect`,this.configuration.onConnect),this.on(`message`,this.configuration.onMessage),this.on(`outgoingMessage`,this.configuration.onOutgoingMessage),this.on(`status`,this.configuration.onStatus),this.on(`disconnect`,this.configuration.onDisconnect),this.on(`close`,this.configuration.onClose),this.on(`destroy`,this.configuration.onDestroy),this.on(`awarenessUpdate`,this.configuration.onAwarenessUpdate),this.on(`awarenessChange`,this.configuration.onAwarenessChange),this.on(`close`,this.onClose.bind(this)),this.on(`message`,this.onMessage.bind(this)),this.intervals.connectionChecker=setInterval(this.checkConnection.bind(this),this.configuration.messageReconnectTimeout/10),this.shouldConnect&&this.connect()}async onOpen(e){this.status=Uv.Connected,this.emit(`status`,{status:Uv.Connected}),this.cancelWebsocketRetry=void 0,this.receivedOnOpenPayload=e}attach(e){let t=e.effectiveName,n=this.configuration.providerMap.get(t);if(n&&n!==e&&n.isAuthenticated)throw Error(`Cannot attach two providers with the same effective name "${t}". Use sessionAwareness: true to multiplex providers with the same document name.`);this.configuration.providerMap.set(t,e),this.status===Uv.Disconnected&&this.shouldConnect&&this.connect(),this.receivedOnOpenPayload&&this.status===Uv.Connected&&e.onOpen(this.receivedOnOpenPayload)}detach(e){let t=e.effectiveName;this.configuration.providerMap.has(t)&&(e.send(Gv,{documentName:t}),this.configuration.providerMap.delete(t))}setConfiguration(e={}){this.configuration={...this.configuration,...e},this.configuration.autoConnect||(this.shouldConnect=!1)}async connect(){if(this.status===Uv.Connected)return;this.cancelWebsocketRetry&&=(this.cancelWebsocketRetry(),void 0),this.receivedOnOpenPayload=void 0,this.shouldConnect=!0;let{retryPromise:e,cancelFunc:t}=(()=>{let e=!1;return{retryPromise:D_(this.createWebSocketConnection.bind(this),{delay:this.configuration.delay,initialDelay:this.configuration.initialDelay,factor:this.configuration.factor,maxAttempts:this.configuration.maxAttempts,minDelay:this.configuration.minDelay,maxDelay:this.configuration.maxDelay,jitter:this.configuration.jitter,timeout:this.configuration.timeout,handleTimeout:this.configuration.handleTimeout,beforeAttempt:t=>{(!this.shouldConnect||e)&&t.abort()}}).catch(e=>{if(e&&e.code!==`ATTEMPT_ABORTED`)throw e}),cancelFunc:()=>{e=!0}}})();return this.cancelWebsocketRetry=t,e}attachWebSocketListeners(e,t){let{identifier:n}=e,r=e=>this.emit(`message`,e),i=e=>this.emit(`close`,{event:e}),a=e=>this.emit(`open`,e),o=e=>{t(e)};this.webSocketHandlers[n]={message:r,close:i,open:a,error:o};let s=this.webSocketHandlers[e.identifier];Object.keys(s).forEach(t=>{e.addEventListener(t,s[t])})}cleanupWebSocket(){if(!this.webSocket)return;let{identifier:e}=this.webSocket,t=this.webSocketHandlers[e];Object.keys(t).forEach(n=>{this.webSocket?.removeEventListener(n,t[n]),delete this.webSocketHandlers[e]}),this.webSocket.close(),this.webSocket=null}createWebSocketConnection(){return new Promise((e,t)=>{this.webSocket&&(this.messageQueue=[],this.cleanupWebSocket()),this.lastMessageReceived=0,this.identifier+=1;let n=new this.configuration.WebSocketPolyfill(this.url);n.binaryType=`arraybuffer`,n.identifier=this.identifier,this.attachWebSocketListeners(n,t),this.webSocket=n,this.status=Uv.Connecting,this.emit(`status`,{status:Uv.Connecting}),this.connectionAttempt={resolve:e,reject:t}})}onMessage(e){this.resolveConnectionAttempt(),this.lastMessageReceived=Ev();let t=new Uint8Array(e.data);if(t.length===1&&t[0]===Hv.Ping){this.sendPong();return}let n=new Vv(t).peekVarString();this.configuration.providerMap.get(n)?.onMessage(e)}sendPong(){let e=iv();cv(e,Hv.Pong),this.send(ov(e))}resolveConnectionAttempt(){this.connectionAttempt&&(this.connectionAttempt.resolve(),this.connectionAttempt=null,this.status=Uv.Connected,this.emit(`status`,{status:Uv.Connected}),this.emit(`connect`),this.messageQueue.forEach(e=>this.send(e)),this.messageQueue=[])}stopConnectionAttempt(){this.connectionAttempt=null}rejectConnectionAttempt(){this.connectionAttempt?.reject(),this.connectionAttempt=null}checkConnection(){this.status===Uv.Connected&&this.lastMessageReceived&&(this.configuration.messageReconnectTimeout>=Ev()-this.lastMessageReceived||(this.closeTries+=1,this.closeTries>2?(this.onClose({event:{code:4408,reason:`forced`}}),this.closeTries=0):(this.webSocket?.close(),this.messageQueue=[])))}get serverUrl(){if(this.configuration.preserveTrailingSlash)return this.configuration.url;let e=this.configuration.url;for(;e[e.length-1]===`/`;)e=e.slice(0,e.length-1);return e}get url(){return this.serverUrl}disconnect(){if(this.shouldConnect=!1,this.webSocket!==null)try{this.webSocket.close(),this.messageQueue=[]}catch(e){console.error(e)}}parseQueuedMessage(e){try{let t=vv(e);return{documentName:wv(t),messageType:Sv(t)}}catch{return null}}addToQueue(t){if(t instanceof Uint8Array){let n=this.parseQueuedMessage(t);n&&e.DEDUPLICATABLE_TYPES.has(n.messageType)&&(this.messageQueue=this.messageQueue.filter(e=>{if(!(e instanceof Uint8Array))return!0;let t=this.parseQueuedMessage(e);return t?!(t.documentName===n.documentName&&t.messageType===n.messageType):!0}))}this.messageQueue.push(t)}send(e){this.webSocket?.readyState===C_.Open?this.webSocket.send(e):this.addToQueue(e)}onClose({event:e}){this.closeTries=0,this.cleanupWebSocket(),this.connectionAttempt&&this.rejectConnectionAttempt(),this.status=Uv.Disconnected,this.emit(`status`,{status:Uv.Disconnected}),this.emit(`disconnect`,{event:e}),!this.cancelWebsocketRetry&&this.shouldConnect&&setTimeout(()=>{this.connect()},this.configuration.delay)}destroy(){this.emit(`destroy`),clearInterval(this.intervals.connectionChecker),this.stopConnectionAttempt(),this.disconnect(),this.removeAllListeners(),this.cleanupWebSocket()}},qv=0,Jv=1,Yv=2,Xv=(e,t)=>{cv(e,qv),pv(e,md(t))},Zv=(e,t,n)=>{cv(e,Jv),pv(e,cd(t,n))},Qv=(e,t,n)=>Zv(t,n,bv(e)),$v=(e,t,n,r)=>{try{ad(t,bv(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},ey=(e,t)=>{cv(e,Yv),pv(e,t)},ty=$v,ny=(e,t,n,r,i)=>{let a=Sv(e);switch(a){case qv:Qv(e,t,n);break;case Jv:$v(e,n,r,i);break;case Yv:ty(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a},ry=class{constructor(e){this.message=e}apply(e,t){let{message:n}=this,r=n.readVarUint(),i=n.length();switch(r){case Hv.Sync:this.applySyncMessage(e,t);break;case Hv.Awareness:this.applyAwarenessMessage(e);break;case Hv.Auth:this.applyAuthMessage(e);break;case Hv.QueryAwareness:this.applyQueryAwarenessMessage(e);break;case Hv.Stateless:e.receiveStateless(wv(n.decoder));break;case Hv.SyncStatus:this.applySyncStatusMessage(e,Cv(n.decoder)===1);break;case Hv.CLOSE:let i={code:1e3,reason:wv(n.decoder)};e.onClose(),e.configuration.onClose({event:i}),e.forwardClose({event:i});break;default:console.error(`Can’t apply message of unknown type: ${r}`)}n.length()>i+1&&e.send(Wv,{encoder:n.encoder})}applySyncMessage(e,t){let{message:n}=this;n.writeVarUint(Hv.Sync);let r=ny(n.decoder,n.encoder,e.document,e);t&&r===Jv&&(e.synced=!0)}applySyncStatusMessage(e,t){t&&e.decrementUnsyncedChanges()}applyAwarenessMessage(e){if(!e.awareness)return;let{message:t}=this;zv(e.awareness,t.readVarUint8Array(),e)}applyAuthMessage(e){let{message:t}=this;v_(t.decoder,e.sendToken.bind(e),e.permissionDeniedHandler.bind(e),e.authenticatedHandler.bind(e))}applyQueryAwarenessMessage(e){if(!e.awareness)return;let{message:t}=this;t.writeVarUint(Hv.Awareness),t.writeVarUint8Array(Rv(e.awareness,Array.from(e.awareness.getStates().keys())))}},iy=class{constructor(e,t={}){this.message=new e,this.encoder=this.message.get(t)}create(){return ov(this.encoder)}send(e){e?.send(this.create())}},ay=`4.0.0-rc.1`,oy=class extends Wv{constructor(...e){super(...e),this.type=Hv.Auth,this.description=`Authentication`}get(e){if(e.token===void 0)throw Error("The authentication message requires `token` as an argument.");return dv(this.encoder,e.documentName),cv(this.encoder,this.type),__(this.encoder,e.token),dv(this.encoder,ay),this.encoder}},sy=class extends Wv{constructor(...e){super(...e),this.type=Hv.Awareness,this.description=`Awareness states update`}get(e){if(e.awareness===void 0)throw Error(`The awareness message requires awareness as an argument`);if(e.clients===void 0)throw Error(`The awareness message requires clients as an argument`);dv(this.encoder,e.documentName),cv(this.encoder,this.type);let t;return t=e.states===void 0?Rv(e.awareness,e.clients):Rv(e.awareness,e.clients,e.states),pv(this.encoder,t),this.encoder}},cy=class extends Wv{constructor(...e){super(...e),this.type=Hv.Stateless,this.description=`A stateless message`}get(e){return dv(this.encoder,e.documentName),cv(this.encoder,this.type),dv(this.encoder,e.payload??``),this.encoder}},ly=class extends Wv{constructor(...e){super(...e),this.type=Hv.Sync,this.description=`First sync step`}get(e){if(e.document===void 0)throw Error(`The sync step one message requires document as an argument`);return dv(this.encoder,e.documentName),cv(this.encoder,this.type),Xv(this.encoder,e.document),this.encoder}},uy=class extends Wv{constructor(...e){super(...e),this.type=Hv.Sync,this.description=`A document update`}get(e){return dv(this.encoder,e.documentName),cv(this.encoder,this.type),ey(this.encoder,e.update),this.encoder}},dy=class extends Error{constructor(...e){super(...e),this.code=1001}},fy=class extends Bv{get effectiveName(){return this.configuration.sessionAwareness?x_(this.configuration.name,this.sessionId):this.configuration.name}constructor(e){super(),this.configuration={name:``,document:void 0,awareness:void 0,token:null,sessionAwareness:!0,forceSyncInterval:!1,onAuthenticated:()=>null,onAuthenticationFailed:()=>null,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onSynced:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,onStateless:()=>null,onUnsyncedChanges:()=>null},this.isSynced=!1,this.unsyncedChanges=0,this.isAuthenticated=!1,this.authorizedScope=void 0,this.manageSocket=!1,this._isAttached=!1,this.sessionId=Math.random().toString(36).slice(2),this.intervals={forceSync:null},this.boundDocumentUpdateHandler=this.documentUpdateHandler.bind(this),this.boundAwarenessUpdateHandler=this.awarenessUpdateHandler.bind(this),this.boundPageHide=this.pageHide.bind(this),this.boundOnOpen=this.onOpen.bind(this),this.boundOnClose=this.onClose.bind(this),this.forwardConnect=()=>this.emit(`connect`),this.forwardStatus=e=>this.emit(`status`,e),this.forwardClose=e=>this.emit(`close`,e),this.forwardDisconnect=e=>this.emit(`disconnect`,e),this.forwardDestroy=()=>this.emit(`destroy`),this.setConfiguration(e),this.configuration.document=e.document?e.document:new Uu,this.configuration.awareness=e.awareness===void 0?new Iv(this.document):e.awareness,this.on(`open`,this.configuration.onOpen),this.on(`message`,this.configuration.onMessage),this.on(`outgoingMessage`,this.configuration.onOutgoingMessage),this.on(`synced`,this.configuration.onSynced),this.on(`destroy`,this.configuration.onDestroy),this.on(`awarenessUpdate`,this.configuration.onAwarenessUpdate),this.on(`awarenessChange`,this.configuration.onAwarenessChange),this.on(`stateless`,this.configuration.onStateless),this.on(`unsyncedChanges`,this.configuration.onUnsyncedChanges),this.on(`authenticated`,this.configuration.onAuthenticated),this.on(`authenticationFailed`,this.configuration.onAuthenticationFailed),this.awareness?.on(`update`,()=>{this.emit(`awarenessUpdate`,{states:y_(this.awareness.getStates())})}),this.awareness?.on(`change`,()=>{this.emit(`awarenessChange`,{states:y_(this.awareness.getStates())})}),this.document.on(`update`,this.boundDocumentUpdateHandler),this.awareness?.on(`update`,this.boundAwarenessUpdateHandler),this.registerEventListeners(),this.configuration.forceSyncInterval&&typeof this.configuration.forceSyncInterval==`number`&&(this.intervals.forceSync=setInterval(this.forceSync.bind(this),this.configuration.forceSyncInterval)),this.manageSocket&&this.attach()}setConfiguration(e={}){e.websocketProvider||(this.manageSocket=!0,this.configuration.websocketProvider=new Kv(e)),this.configuration={...this.configuration,...e}}get document(){return this.configuration.document}get isAttached(){return this._isAttached}get awareness(){return this.configuration.awareness}get hasUnsyncedChanges(){return this.unsyncedChanges>0}resetUnsyncedChanges(){this.unsyncedChanges=1,this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}incrementUnsyncedChanges(){this.unsyncedChanges+=1,this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}decrementUnsyncedChanges(){this.unsyncedChanges>0&&--this.unsyncedChanges,this.unsyncedChanges===0&&(this.synced=!0),this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}forceSync(){this.resetUnsyncedChanges(),this.send(ly,{document:this.document,documentName:this.effectiveName})}pageHide(){this.awareness&&Lv(this.awareness,[this.document.clientID],`page hide`)}registerEventListeners(){typeof window>`u`||!(`addEventListener`in window)||window.addEventListener(`pagehide`,this.boundPageHide)}sendStateless(e){this.send(cy,{documentName:this.effectiveName,payload:e})}async sendToken(){let e;try{e=await this.getToken()}catch(e){this.permissionDeniedHandler(`Failed to get token during sendToken(): ${e}`);return}this.send(oy,{token:e??``,documentName:this.effectiveName})}documentUpdateHandler(e,t){t!==this&&(this.incrementUnsyncedChanges(),this.send(uy,{update:e,documentName:this.effectiveName}))}awarenessUpdateHandler({added:e,updated:t,removed:n},r){let i=e.concat(t).concat(n);this.send(sy,{awareness:this.awareness,clients:i,documentName:this.effectiveName})}get synced(){return this.isSynced}set synced(e){this.isSynced!==e&&(this.isSynced=e,e&&this.emit(`synced`,{state:e}))}receiveStateless(e){this.emit(`stateless`,{payload:e})}async connect(){if(this.manageSocket)return this.configuration.websocketProvider.connect();console.warn(`HocuspocusProvider::connect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.`)}disconnect(){if(this.manageSocket)return this.configuration.websocketProvider.disconnect();console.warn(`HocuspocusProvider::disconnect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.`)}async onOpen(e){this.isAuthenticated=!1,this.emit(`open`,{event:e}),await this.sendToken(),this.startSync()}async getToken(){return typeof this.configuration.token==`function`?await this.configuration.token():this.configuration.token}startSync(){this.resetUnsyncedChanges(),this.send(ly,{document:this.document,documentName:this.effectiveName}),this.awareness&&this.awareness.getLocalState()!==null&&this.send(sy,{awareness:this.awareness,clients:[this.document.clientID],documentName:this.effectiveName})}send(e,t){if(!this._isAttached)return;let n=new iy(e,t);this.emit(`outgoingMessage`,{message:n.message}),n.send(this.configuration.websocketProvider)}onMessage(e){let t=new Vv(e.data),{documentName:n}=S_(t.readVarString());t.writeVarString(this.effectiveName),this.emit(`message`,{event:e,message:new Vv(e.data)}),new ry(t).apply(this,!0)}onClose(){this.isAuthenticated=!1,this.synced=!1,this.awareness&&Lv(this.awareness,Array.from(this.awareness.getStates().keys()).filter(e=>e!==this.document.clientID),this)}destroy(){this.emit(`destroy`),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),this.awareness&&(Lv(this.awareness,[this.document.clientID],`provider destroy`),this.awareness.off(`update`,this.boundAwarenessUpdateHandler),this.awareness.destroy()),this.document.off(`update`,this.boundDocumentUpdateHandler),this.removeAllListeners(),this.detach(),this.manageSocket&&this.configuration.websocketProvider.destroy(),!(typeof window>`u`||!(`removeEventListener`in window))&&window.removeEventListener(`pagehide`,this.boundPageHide)}detach(){this.configuration.websocketProvider.off(`connect`,this.configuration.onConnect),this.configuration.websocketProvider.off(`connect`,this.forwardConnect),this.configuration.websocketProvider.off(`status`,this.forwardStatus),this.configuration.websocketProvider.off(`status`,this.configuration.onStatus),this.configuration.websocketProvider.off(`open`,this.boundOnOpen),this.configuration.websocketProvider.off(`close`,this.boundOnClose),this.configuration.websocketProvider.off(`close`,this.configuration.onClose),this.configuration.websocketProvider.off(`close`,this.forwardClose),this.configuration.websocketProvider.off(`disconnect`,this.configuration.onDisconnect),this.configuration.websocketProvider.off(`disconnect`,this.forwardDisconnect),this.configuration.websocketProvider.off(`destroy`,this.configuration.onDestroy),this.configuration.websocketProvider.off(`destroy`,this.forwardDestroy),this.configuration.websocketProvider.detach(this),this._isAttached=!1}attach(){this._isAttached||=(this.configuration.websocketProvider.on(`connect`,this.configuration.onConnect),this.configuration.websocketProvider.on(`connect`,this.forwardConnect),this.configuration.websocketProvider.on(`status`,this.configuration.onStatus),this.configuration.websocketProvider.on(`status`,this.forwardStatus),this.configuration.websocketProvider.on(`open`,this.boundOnOpen),this.configuration.websocketProvider.on(`close`,this.boundOnClose),this.configuration.websocketProvider.on(`close`,this.configuration.onClose),this.configuration.websocketProvider.on(`close`,this.forwardClose),this.configuration.websocketProvider.on(`disconnect`,this.configuration.onDisconnect),this.configuration.websocketProvider.on(`disconnect`,this.forwardDisconnect),this.configuration.websocketProvider.on(`destroy`,this.configuration.onDestroy),this.configuration.websocketProvider.on(`destroy`,this.forwardDestroy),this.configuration.websocketProvider.attach(this),!0)}permissionDeniedHandler(e){this.emit(`authenticationFailed`,{reason:e}),this.isAuthenticated=!1}authenticatedHandler(e){this.isAuthenticated=!0,this.authorizedScope=e,this.emit(`authenticated`,{scope:e})}setAwarenessField(e,t){if(!this.awareness)throw new dy(`Cannot set awareness field "${e}" to ${JSON.stringify(t)}. You have disabled Awareness for this provider by explicitly passing awareness: null in the provider configuration.`);this.awareness.setLocalStateField(e,t)}},py=e=>Zs((t,n)=>{e.onerror=e=>n(Error(e.target.error)),e.onsuccess=e=>t(e.target.result)}),my=(e,t)=>Zs((n,r)=>{let i=indexedDB.open(e);i.onupgradeneeded=e=>t(e.target.result),i.onerror=e=>r(ws(e.target.error)),i.onsuccess=e=>{let t=e.target.result;t.onversionchange=()=>{t.close()},n(t)}}),hy=e=>py(indexedDB.deleteDatabase(e)),gy=(e,t)=>t.forEach(t=>e.createObjectStore.apply(e,t)),_y=(e,t,n=`readwrite`)=>{let r=e.transaction(t,n);return t.map(e=>Oy(r,e))},vy=(e,t)=>py(e.count(t)),yy=(e,t)=>py(e.get(t)),by=(e,t)=>py(e.delete(t)),xy=(e,t,n)=>py(e.put(t,n)),Sy=(e,t)=>py(e.add(t)),Cy=(e,t,n)=>py(e.getAll(t,n)),wy=(e,t,n)=>{let r=null;return Dy(e,t,e=>(r=e,!1),n).then(()=>r)},Ty=(e,t=null)=>wy(e,t,`prev`),Ey=(e,t)=>Zs((n,r)=>{e.onerror=r,e.onsuccess=async e=>{let r=e.target.result;if(r===null||await t(r)===!1)return n();r.continue()}}),Dy=(e,t,n,r=`next`)=>Ey(e.openKeyCursor(t,r),e=>n(e.key)),Oy=(e,t)=>e.objectStore(t),ky=(e,t)=>IDBKeyRange.upperBound(e,t),Ay=(e,t)=>IDBKeyRange.lowerBound(e,t),jy=`custom`,My=`updates`,Ny=(e,t=()=>{},n=()=>{})=>{let[r]=_y(e.db,[My]);return Cy(r,Ay(e._dbref,!1)).then(i=>{e._destroyed||(t(r),rf(e.doc,()=>{i.forEach(t=>ad(e.doc,t))},e,!1),n(r))}).then(()=>Ty(r).then(t=>{e._dbref=t+1})).then(()=>vy(r).then(t=>{e._dbsize=t})).then(()=>r)},Py=(e,t=!0)=>Ny(e).then(n=>{(t||e._dbsize>=500)&&Sy(n,cd(e.doc)).then(()=>by(n,ky(e._dbref,!0))).then(()=>vy(n).then(t=>{e._dbsize=t}))}),Fy=class extends _o{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=my(e,e=>gy(e,[[`updates`,{autoIncrement:!0}],[`custom`]])),this.whenSynced=Zs(e=>this.on(`synced`,()=>e(this))),this._db.then(e=>{this.db=e,Ny(this,async e=>{await vy(e)>0&&Sy(e,cd(t))},()=>{if(this._destroyed)return this;this.synced=!0,this.emit(`synced`,[this])})}),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){let[t]=_y(this.db,[My]);Sy(t,e).catch(e=>{globalThis.__okYdbWriteWarned||(globalThis.__okYdbWriteWarned=!0,console.warn(JSON.stringify({event:`ok-ydb-write-failed`,cause:e?.name??`unknown`,message:e?.message??String(e)})))}),++this._dbsize>=500&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{Py(this,!1),this._storeTimeoutId=null},this._storeTimeout))}},t.on(`update`,this._storeUpdate),this.destroy=this.destroy.bind(this),t.on(`destroy`,this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off(`update`,this._storeUpdate),this.doc.off(`destroy`,this.destroy),this._destroyed=!0,this._db.then(e=>{e.close()})}clearData(){return this.destroy().then(()=>{hy(this.name)})}get(e){return this._db.then(t=>{let[n]=_y(t,[jy],`readonly`);return yy(n,e)})}set(e,t){return this._db.then(n=>{let[r]=_y(n,[jy]);return xy(r,t,e)})}del(e){return this._db.then(t=>{let[n]=_y(t,[jy]);return by(n,e)})}},Iy=class{_idb;_dbName;whenSynced;constructor({branch:e,serverInstanceId:t,docName:n,doc:r}){if(typeof t!=`string`||t.length===0)throw Error(`createClientPersistence: serverInstanceId is required and must be non-empty`);this._dbName=`ok-ydoc:${e}:${t}:${n}`,this._idb=new Fy(this._dbName,r),this.whenSynced=this._idb.whenSynced.then(()=>this)}get synced(){return this._idb.synced}async destroy(){await this._idb.destroy()}async clearData(){await this._idb.destroy();let e=this._dbName;await new Promise((t,n)=>{let r=indexedDB.deleteDatabase(e);r.onsuccess=()=>t(),r.onerror=()=>n(r.error),r.onblocked=()=>{console.warn(JSON.stringify({event:`ok-client-persistence-clear-blocked`,dbName:e})),n(Error(`idb-clear-blocked: ${e}`))}})}};function Ly(e){return new Iy(e)}function Ry(e){return md(e)}function zy(e,t){return t===null?cd(e):cd(e,t)}function By(e,t){if(e===null)return t;if(t===null)return e;let n=ud(e),r=ud(t),i=new Map;for(let[e,t]of n)i.set(e,t);for(let[e,t]of r){let n=i.get(e);(n===void 0||t>n)&&i.set(e,t)}return md(i)}function Vy(e){let t={};if(i.inject(r.active(),t),!t.traceparent)return e;let n=e.includes(`?`)?`&`:`?`,a=[`traceparent=${encodeURIComponent(t.traceparent)}`];return t.tracestate&&a.push(`tracestate=${encodeURIComponent(t.tracestate)}`),`${e}${n}${a.join(`&`)}`}var Hy=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new Fe({key:e||new Te(`fileHandler`),props:{handleDrop(e,n){if(!r||!n.dataTransfer?.files.length)return!1;let a=e.posAtCoords({left:n.clientX,top:n.clientY}),o=Array.from(n.dataTransfer.files);return i&&(o=o.filter(e=>i.includes(e.type))),o.length===0?!1:(n.preventDefault(),n.stopPropagation(),r(t,o,a?.pos||0),!0)},handlePaste(e,r){if(!n||!r.clipboardData?.files.length)return!1;let a=Array.from(r.clipboardData.files),o=r.clipboardData.getData(`text/html`);return i&&(a=a.filter(e=>i.includes(e.type))),!(a.length===0||(r.preventDefault(),r.stopPropagation(),n(t,a,o),o.length>0))}}}),Uy=W.create({name:`fileHandler`,addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[Hy({key:new Te(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}}),Wy=W.create({name:`keyboardNav`,priority:50,addKeyboardShortcuts(){return{Escape:({editor:e})=>{let{state:t}=e;if(t.selection instanceof Le){let n=t.selection.from+t.selection.node.nodeSize,r=t.doc.resolve(Math.min(n,t.doc.content.size)),i=Je.near(r);return e.view.dispatch(t.tr.setSelection(i)),!0}return t.selection instanceof Je?e.commands.selectParentNode():!1},ArrowUp:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof Le))return!1;let n=t.selection.from,r=t.doc.resolve(n);if(r.index(r.depth)===0)return!1;let i=r.before(r.depth);if(i<=0)return!1;let a=t.doc.resolve(i-1).nodeBefore;if(!a||i-1-a.nodeSize+1<0)return!1;try{let n=Le.create(t.doc,i-a.nodeSize);return e.view.dispatch(t.tr.setSelection(n).scrollIntoView()),!0}catch{return!1}},ArrowDown:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof Le))return!1;let n=t.selection.from+t.selection.node.nodeSize;if(n>=t.doc.content.size)return!1;try{if(!t.doc.nodeAt(n))return!1;let r=Le.create(t.doc,n);return e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0}catch{return!1}},Enter:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof Je)||!t.selection.empty)return!1;let n=t.selection.$from,r=n.parent;if(r.type.name!==`paragraph`||r.textContent!==``||n.depth<2)return!1;let i=-1;for(let e=n.depth-1;e>=1;e--)if(n.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;let a=n.node(i);if(n.index(i)!==a.childCount-1)return!1;let o=n.after(i);if(o>t.doc.content.size)return!1;let s=t.tr,c=n.before(n.depth),l=n.after(n.depth);s.delete(c,l);let u=o-(l-c),d=t.schema.nodes.paragraph.create();s.insert(u,d);let f=u+1;return s.setSelection(Je.create(s.doc,f)),e.view.dispatch(s.scrollIntoView()),!0}}}}),Gy=new WeakMap;function Ky(e,t){if(t===null){Gy.delete(e);return}Gy.set(e,t)}function qy(e){return Gy.get(e)??null}function Jy(e){return`pagesBySlug`in e}function Yy(e){return Jy(e)?e.pages:e}function Xy(e,t){let n=p(e);if(n){if(Jy(t))return t.pagesBySlug.get(n);for(let e of t)if(p(e)===n)return e}}function Zy(e){let t=e.trim();if(!t)return null;let n=p(t);return n?{target:n,alias:n===t?null:t,anchor:null}:null}function Qy(e){let t=e.trim();if(!t)return[];let n=p(t);return n.length>0&&n!==t?[n]:[]}function $y(e,t){let n=e.trim();if(!n)return!1;let r=Yy(t);return r.has(n)||Qy(n).some(e=>r.has(e))?!0:Xy(n,t)!==void 0}var eb={ChevronRight:Bn};function tb(e){if(!e||!e.startsWith(`lucide:`))return null;let t=e.slice(7);return Object.hasOwn(eb,t)?eb[t]:null}function nb(e){let t=(0,J.c)(23),n;t[0]===e.icon?n=t[1]:(n=tb(e.icon),t[0]=e.icon,t[1]=n);let r=n,i=r?`custom`:void 0,a;t[2]===r?a=t[3]:(a=r?(0,q.jsx)(r,{size:16,className:`accordion-icon`,"aria-hidden":`true`}):null,t[2]=r,t[3]=a);let o=e.title??`Accordion`,s;t[4]===o?s=t[5]:(s=(0,q.jsx)(`span`,{className:`accordion-title`,children:o}),t[4]=o,t[5]=s);let c;t[6]===e.description?c=t[7]:(c=e.description?(0,q.jsx)(`span`,{className:`accordion-description`,children:e.description}):null,t[6]=e.description,t[7]=c);let l;t[8]!==s||t[9]!==c?(l=(0,q.jsxs)(`span`,{className:`accordion-title-group`,children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10];let u;t[11]!==a||t[12]!==l?(u=(0,q.jsxs)(`summary`,{className:`accordion-summary`,contentEditable:!1,children:[a,l]}),t[11]=a,t[12]=l,t[13]=u):u=t[13];let d;t[14]===e.children?d=t[15]:(d=(0,q.jsx)(`div`,{className:`accordion-body`,children:e.children}),t[14]=e.children,t[15]=d);let f;return t[16]!==e.defaultOpen||t[17]!==e.id||t[18]!==e.name||t[19]!==i||t[20]!==u||t[21]!==d?(f=(0,q.jsxs)(`details`,{className:`accordion`,"data-accordion-icon":i,open:e.defaultOpen,id:e.id,name:e.name,children:[u,d]}),t[16]=e.defaultOpen,t[17]=e.id,t[18]=e.name,t[19]=i,t[20]=u,t[21]=d,t[22]=f):f=t[22],f}function rb(e){return e!==!1}function ib(e){let t=(0,J.c)(10),n=e.src,r=e.title,i;t[0]===e.controls?i=t[1]:(i=rb(e.controls),t[0]=e.controls,t[1]=i);let a;return t[2]!==e.autoplay||t[3]!==e.loop||t[4]!==e.muted||t[5]!==e.preload||t[6]!==e.src||t[7]!==e.title||t[8]!==i?(a=(0,q.jsx)(`audio`,{className:`ok-audio`,src:n,title:r,controls:i,autoPlay:e.autoplay,loop:e.loop,muted:e.muted,preload:e.preload}),t[2]=e.autoplay,t[3]=e.loop,t[4]=e.muted,t[5]=e.preload,t[6]=e.src,t[7]=e.title,t[8]=i,t[9]=a):a=t[9],a}var ab={note:Zn,tip:Qn,important:rr,warning:x,caution:ar},ob={Info:Zn,Lightbulb:Qn,MessageSquareWarning:rr,AlertTriangle:x,AlertOctagon:ar};function sb(e,t){if(!e||!e.startsWith(`lucide:`))return ab[t];let n=e.slice(7);return Object.hasOwn(ob,n)?ob[n]:ab[t]}function cb(e){return e===`note`||e===`tip`||e===`important`||e===`warning`||e===`caution`?e:`note`}function lb(e){let t=(0,J.c)(28),n,r;t[0]!==e.icon||t[1]!==e.type?(r=cb(e.type),n=sb(e.icon,r),t[0]=e.icon,t[1]=e.type,t[2]=n,t[3]=r):(n=t[2],r=t[3]);let i=n,a;t[4]===e.color?a=t[5]:(a=e.color?{"--callout-type-color":e.color}:{},t[4]=e.color,t[5]=a);let o=a,s;t[6]!==i||t[7]!==e.title?(s=e.title||i?(0,q.jsxs)(`span`,{className:`callout-header`,contentEditable:!1,children:[(0,q.jsx)(i,{size:16,className:`callout-icon`,"aria-hidden":`true`}),e.title?(0,q.jsx)(`span`,{className:`callout-title`,children:e.title}):null]}):null,t[6]=i,t[7]=e.title,t[8]=s):s=t[8];let c=s;if(e.collapsible){let n=e.defaultOpen??!0,i;t[9]===c?i=t[10]:(i=c??(0,q.jsx)(`span`,{className:`callout-title`,children:`Details`}),t[9]=c,t[10]=i);let a;t[11]===i?a=t[12]:(a=(0,q.jsx)(`summary`,{className:`callout-summary`,contentEditable:!1,children:i}),t[11]=i,t[12]=a);let s;t[13]===e.children?s=t[14]:(s=(0,q.jsx)(`div`,{className:`callout-body`,children:e.children}),t[13]=e.children,t[14]=s);let l;return t[15]!==n||t[16]!==o||t[17]!==a||t[18]!==s||t[19]!==r?(l=(0,q.jsxs)(`details`,{className:`callout callout-collapsible`,"data-callout-type":r,open:n,style:o,children:[a,s]}),t[15]=n,t[16]=o,t[17]=a,t[18]=s,t[19]=r,t[20]=l):l=t[20],l}let l;t[21]===e.children?l=t[22]:(l=(0,q.jsx)(`div`,{className:`callout-body`,children:e.children}),t[21]=e.children,t[22]=l);let u;return t[23]!==c||t[24]!==o||t[25]!==l||t[26]!==r?(u=(0,q.jsxs)(`div`,{className:`callout callout-static`,"data-callout-type":r,style:o,children:[c,l]}),t[23]=c,t[24]=o,t[25]=l,t[26]=r,t[27]=u):u=t[27],u}function ub(){return K.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-unzoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},K.createElement(`path`,{d:`M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z`}))}function db(){return K.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-zoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},K.createElement(`path`,{d:`M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z`}))}function fb(e){return typeof Element>`u`?!1:e instanceof Element}var pb=(e,t)=>fb(t)&&t.tagName.toUpperCase()===e,mb=e=>pb(`DIV`,e)||pb(`SPAN`,e),hb=e=>pb(`IMG`,e),gb=e=>e.complete&&e.naturalHeight!==0,_b=e=>pb(`SVG`,e),vb=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),yb=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=vb({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},bb=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?yb({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):vb({height:e,offset:r,width:t}),xb=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,Sb=e=>{if(e!==null){if(hb(e))return e.currentSrc===``?void 0:e.currentSrc;if(mb(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return xb.exec(t)?.[1]}}},Cb=e=>{if(e!==null)return hb(e)?e.alt:e.getAttribute(`aria-label`)??void 0},wb=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=bb({containerHeight:e,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s});return{top:n,left:t,width:r*c,height:e*c,transform:`translate(0,0) scale(${1/c})`}},Tb=({position:e,relativeNum:t})=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},Eb=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,objectFit:a,objectPosition:o,offset:s,targetHeight:c,targetWidth:l})=>{let u=a;if(u===`scale-down`&&(u=l<=r&&c<=e?`none`:`contain`),u===`cover`||u===`contain`){let a=r/l,d=e/c,f=u===`cover`?Math.max(a,d):Math.min(a,d),[p=`50%`,m=`50%`]=o.split(` `),h=Tb({position:p,relativeNum:r-l*f}),g=Tb({position:m,relativeNum:e-c*f}),_=bb({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+g,left:t+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(u===`none`){let[a=`50%`,u=`50%`]=o.split(` `),d=Tb({position:a,relativeNum:r-l}),f=Tb({position:u,relativeNum:e-c}),p=bb({containerHeight:c,containerWidth:l,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+f,left:t+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else if(u===`fill`){let t=r/l,n=e/c,a=Math.max(t,n),o=bb({containerHeight:c*a,containerWidth:l*a,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{width:r*o,height:e*o,transform:`translate(0,0) scale(${1/o})`}}else return{}},Db=({backgroundPosition:e,backgroundSize:t,containerHeight:n,containerLeft:r,containerTop:i,containerWidth:a,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l})=>{if(t===`cover`||t===`contain`){let u=a/l,d=n/c,f=t===`cover`?Math.max(u,d):Math.min(u,d),[p=`50%`,m=`50%`]=e.split(` `),h=Tb({position:p,relativeNum:a-l*f}),g=Tb({position:m,relativeNum:n-c*f}),_=bb({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+g,left:r+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(t===`auto`){let[t=`50%`,u=`50%`]=e.split(` `),d=Tb({position:t,relativeNum:a-l}),f=Tb({position:u,relativeNum:n-c}),p=bb({containerHeight:c,containerWidth:l,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+f,left:r+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else{let[u=`50%`,d=`50%`]=t.split(` `),f=Tb({position:u,relativeNum:a}),p=Tb({position:d,relativeNum:n}),m=f/l,h=p/c,g=Math.min(m,h),[_=`50%`,v=`50%`]=e.split(` `),y=Tb({position:_,relativeNum:a-l*g}),b=Tb({position:v,relativeNum:n-c*g}),x=bb({containerHeight:c*g,containerWidth:l*g,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+b,left:r+y,width:l*g*x,height:c*g*x,transform:`translate(0,0) scale(${1/x})`}}},Ob=/\.svg$/i,kb=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:i,offset:a,shouldRefresh:o,targetEl:s})=>{let c=n||t?.slice(0,18)===`data:image/svg+xml`||e||t!==void 0&&Ob.test(t),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&mb(s),f=i!=null&&!d,p=i!=null&&i.naturalHeight!==0?i.naturalHeight:l.height,m=i!=null&&i.naturalWidth!==0?i.naturalWidth:l.width,h=wb({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}),g=f?Eb({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,objectFit:u.objectFit,objectPosition:u.objectPosition,offset:a,targetHeight:p,targetWidth:m}):void 0,_=d?Db({backgroundPosition:u.backgroundPosition,backgroundSize:u.backgroundSize,containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}):void 0,v={...h,...g,..._};if(r){let e=window.innerWidth/2,t=window.innerHeight/2,n=parseFloat(String(v.left??0))+parseFloat(String(v.width??0))/2,r=parseFloat(String(v.top??0))+parseFloat(String(v.height??0))/2,i=e-n,a=t-r;o&&(v.transitionDuration=`0.01ms`),v.transform=`translate(${i}px,${a}px) scale(1)`}return v},Ab=e=>{if(e==null)return{};if(_b(e)){let{parentElement:t}=e,n=e.getBoundingClientRect();if(t==null)return{height:n.height,left:n.left,width:n.width,top:n.top};{let e=t.getBoundingClientRect();return{height:n.height,left:e.left-n.left,top:e.top-n.top,width:n.width}}}else return{height:e.offsetHeight,left:e.offsetLeft,width:e.offsetWidth,top:e.offsetTop}},jb=e=>{let t=`-zoom`,n=[`clip-path`,`fill`,`mask`,`marker-start`,`marker-mid`,`marker-end`],r=new Map;if(e.hasAttribute(`id`)){let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}e.querySelectorAll(`[id]`).forEach(e=>{let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}),r.forEach((t,r)=>{let i=`url(#${r})`,a=`url(#${t})`,o=n.map(e=>`[${e}="${i}"]`).join(`, `);e.querySelectorAll(o).forEach(e=>{n.forEach(t=>{e.getAttribute(t)===i&&e.setAttribute(t,a)})})}),e.querySelectorAll(`style`).forEach(e=>{r.forEach((t,n)=>{let{textContent:r}=e;if(r!==``){let i=e;i.textContent=r.replaceAll(`#${n}`,`#${t}`)}})})},Mb=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),Nb={overflow:``,width:``};function Pb(){let e=document.querySelector(`[data-rmiz-portal]`);if(e!=null)return e;let t=document.createElement(`div`);return t.setAttribute(`data-rmiz-portal`,``),document.body.appendChild(t),t}function Fb(e){e.preventDefault()}function Ib(e){return K.createElement(Lb,{...e})}var Lb=class extends K.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=K.createRef(),this.refDialog=K.createRef(),this.refModalContent=K.createRef(),this.refModalImg=K.createRef(),this.refWrap=K.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=Nb,this.styleModalImg={},this.handleModalStateChange=e=>{let{state:{modalState:t}}=this;e!==`LOADING`&&t===`LOADING`?(this.loadZoomImg(),window.addEventListener(`resize`,this.handleResize,{passive:!0}),window.addEventListener(`touchstart`,this.handleTouchStart,{passive:!0}),window.addEventListener(`touchmove`,this.handleTouchMove,{passive:!0}),window.addEventListener(`touchend`,this.handleTouchEnd,{passive:!0}),window.addEventListener(`touchcancel`,this.handleTouchCancel,{passive:!0}),document.addEventListener(`keydown`,this.handleKeyDown,!0)):e!==`LOADED`&&t===`LOADED`?window.addEventListener(`wheel`,this.handleWheel,{passive:!0}):e!==`UNLOADING`&&t===`UNLOADING`?(this.ensureImgTransitionEnd(),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),document.removeEventListener(`keydown`,this.handleKeyDown,!0)):e!==`UNLOADED`&&t===`UNLOADED`&&(this.bodyScrollEnable(),window.removeEventListener(`resize`,this.handleResize),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),this.refDialog.current?.close())},this.setId=()=>{let e=()=>Math.random().toString(16).slice(-4);this.setState({id:e()+e()+e()})},this.setAndTrackImg=()=>{let{refContent:{current:e}}=this;e!=null&&(this.imgEl=e.querySelector(Mb),this.imgEl===null?this.contentNotFoundChangeObserver??(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(e,{childList:!0,subtree:!0})):(this.contentNotFoundChangeObserver?.disconnect(),this.imgEl.addEventListener(`load`,this.handleImgLoad),this.imgEl.addEventListener(`click`,this.handleZoom),this.state.loadedImgEl??this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(e=>{let[t]=e;t?.target!==void 0&&(this.imgEl=t.target,this.setState({styleGhost:Ab(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:Ab(this.imgEl)})}),this.contentChangeObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}))))},this.handleIfZoomChanged=e=>{let{props:{isZoomed:t}}=this;!e&&t?this.zoom():e&&!t&&this.unzoom()},this.handleImgLoad=()=>{let e=Sb(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(hb(n)){let{sizes:e,srcset:r,crossOrigin:i}=n;t.sizes=e,t.srcset=r,t.crossOrigin=i}t.src=e;let r=()=>{this.setState({loadedImgEl:t,styleGhost:Ab(this.imgEl)})};t.decode().then(r).catch(()=>{if(gb(t)){r();return}t.onload=r})},this.handleZoom=e=>{this.props.isDisabled!==!0&&this.hasImage()&&this.props.onZoomChange?.(!0,{event:e})},this.handleUnzoom=e=>{this.props.isDisabled!==!0&&this.props.onZoomChange?.(!1,{event:e})},this.handleBtnUnzoomClick=e=>{e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e)},this.handleDialogClick=e=>{(e.target===this.refModalContent.current||e.target===this.refModalImg.current)&&(e.stopPropagation(),this.handleUnzoom(e))},this.handleDialogClose=e=>{e.stopPropagation(),this.handleUnzoom(e)},this.handleKeyDown=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e))},this.handleWheel=e=>{e.ctrlKey||(e.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(e)}))},this.handleTouchStart=e=>{if(e.touches.length>1){this.isScaling=!0;return}let{changedTouches:t}=e,[n]=t;if(t.length===1&&n!==void 0){let{screenY:e}=n;this.touchYStart=e}},this.handleTouchMove=e=>{let t=window.visualViewport?.scale??1,{changedTouches:n}=e,[r]=n;if(this.props.canSwipeToUnzoom&&!this.isScaling&&t<=1&&this.touchYStart!=null&&r!==void 0){let{screenY:t}=r;this.touchYEnd=t;let n=Math.max(this.touchYStart,this.touchYEnd),i=Math.min(this.touchYStart,this.touchYEnd);Math.abs(n-i)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(e))}},this.handleTouchEnd=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||_b(this.imgEl))&&window.getComputedStyle(this.imgEl).display!==`none`,this.zoom=()=>{this.bodyScrollDisable(),this.refDialog.current?.showModal(),this.refModalImg.current?.addEventListener(`transitionend`,this.handleImgTransitionEnd),this.setState({modalState:`LOADING`})},this.unzoom=()=>{this.setState({modalState:`UNLOADING`})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState===`LOADING`?this.setState({modalState:`LOADED`}):this.state.modalState===`UNLOADING`&&this.setState({shouldRefresh:!1,modalState:`UNLOADED`})},this.ensureImgTransitionEnd=()=>{if(this.refModalImg.current!==null){let{transitionDuration:e}=window.getComputedStyle(this.refModalImg.current),t=parseFloat(e);if(t!==0&&!Number.isNaN(t)){let n=t*(e.endsWith(`ms`)?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,n)}}},this.bodyScrollDisable=()=>{this.prevBodyAttrs={overflow:document.body.style.overflow,width:document.body.style.width};let{body:{clientWidth:e}}=document;document.body.style.overflow=`hidden`,document.body.style.width=`${e}px`},this.bodyScrollEnable=()=>{let{prevBodyAttrs:{overflow:e,width:t}}=this;document.body.style.width=t,document.body.style.overflow=e,this.prevBodyAttrs=Nb},this.loadZoomImg=()=>{let{props:{zoomImg:e}}=this;if(e==null)return;let{src:t}=e;if(t!==void 0&&t!==``){let n=new Image;n.sizes=e.sizes??``,n.srcset=e.srcSet??``,n.crossOrigin=e.crossOrigin??void 0,n.src=t;let r=()=>{this.setState({isZoomImgLoaded:!0})};n.decode().then(r).catch(()=>{if(gb(n)){r();return}n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(_b(e)){let r=e.cloneNode(!0);jb(r),r.style.width=`${n.width??0}px`,r.style.height=`${n.height??0}px`,r.addEventListener(`click`,this.handleUnzoom),t.current?.firstChild?.remove(),t.current?.appendChild(r)}}}render(){let{handleBtnUnzoomClick:e,handleDialogClick:t,handleDialogClose:n,handleUnzoom:r,handleZoom:i,imgEl:a,props:{a11yNameButtonUnzoom:o,a11yNameButtonZoom:s,children:c,classDialog:l,IconUnzoom:u,IconZoom:d,isZoomed:f,wrapElement:p,ZoomContent:m,zoomImg:h,zoomMargin:g},refContent:_,refDialog:v,refModalContent:y,refModalImg:b,refWrap:x,state:{id:S,isZoomImgLoaded:C,loadedImgEl:w,modalState:T,shouldRefresh:E,styleGhost:D}}=this,O=`rmiz-modal-${S}`,k=`rmiz-modal-img-${S}`,A=mb(a),j=hb(a),M=_b(a),N=Cb(a),P=Sb(a),F=j?a.sizes:void 0,I=j?a.srcset:void 0,L=j?a.crossOrigin:void 0,R=h?.src!==void 0&&h.src!==``,z=this.hasImage(),B=N!==void 0&&N!==``?`${s}: ${N}`:s,V=T===`LOADING`||T===`LOADED`,H=z?`found`:`not-found`,U=T===`UNLOADED`||T===`UNLOADING`?`hidden`:`visible`,ee={visibility:T===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=z&&a!==null?kb({hasZoomImg:R,imgSrc:P,isSvg:M,isZoomed:f&&V,loadedImgEl:w,offset:g,shouldRefresh:E,targetEl:a}):{};let te=null;if(z){let t=j||A?K.createElement(`img`,{alt:N,crossOrigin:L,sizes:F,src:P,srcSet:I,...C&&T===`LOADED`?h:{},"data-rmiz-modal-img":``,height:this.styleModalImg.height??void 0,id:k,ref:b,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):M?K.createElement(`div`,{"data-rmiz-modal-img":!0,ref:b,style:this.styleModalImg}):null,n=K.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},K.createElement(u,null));te=m==null?K.createElement(K.Fragment,null,t,n):K.createElement(m,{buttonUnzoom:n,modalState:T,img:t,isZoomImgLoaded:C,onUnzoom:r})}return K.createElement(p,{"aria-owns":O,"data-rmiz":``,ref:x},K.createElement(p,{"data-rmiz-content":H,ref:_,style:ee},c),z&&K.createElement(p,{"data-rmiz-ghost":``,style:D},K.createElement(`button`,{"aria-label":B,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},K.createElement(d,null))),z&&Si.createPortal(K.createElement(`dialog`,{"aria-labelledby":k,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:O,onClick:t,onClose:n,onCancel:Fb,ref:v,role:`dialog`},K.createElement(`div`,{"data-rmiz-modal-overlay":U}),K.createElement(`div`,{"data-rmiz-modal-content":``,ref:y},te)),Pb()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){this.state.modalState!==`UNLOADED`&&this.bodyScrollEnable(),this.contentChangeObserver?.disconnect(),this.contentNotFoundChangeObserver?.disconnect(),this.imgElResizeObserver?.disconnect(),this.imgEl?.removeEventListener(`load`,this.handleImgLoad),this.imgEl?.removeEventListener(`click`,this.handleZoom),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`keydown`,this.handleKeyDown,!0)}componentDidUpdate(e,t){this.handleModalStateChange(t.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(e.isZoomed)}};Lb.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:ub,IconZoom:db,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function Rb({onZoomChange:e,...t}){let[n,r]=K.useState(!1),i=K.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return K.createElement(Ib,{...t,isZoomed:n,onZoomChange:i})}function zb(e){return e??`lazy`}function Bb(e){let t=(0,J.c)(15),n=e.src,r=e.alt??``,i=e.width,a=e.height,o=e.title,s;t[0]===e.loading?s=t[1]:(s=zb(e.loading),t[0]=e.loading,t[1]=s);let c;return t[2]!==e.crossorigin||t[3]!==e.decoding||t[4]!==e.fetchpriority||t[5]!==e.height||t[6]!==e.referrerpolicy||t[7]!==e.sizes||t[8]!==e.src||t[9]!==e.srcset||t[10]!==e.title||t[11]!==e.width||t[12]!==r||t[13]!==s?(c=(0,q.jsx)(`img`,{src:n,alt:r,width:i,height:a,title:o,loading:s,srcSet:e.srcset,sizes:e.sizes,decoding:e.decoding,fetchPriority:e.fetchpriority,crossOrigin:e.crossorigin,referrerPolicy:e.referrerpolicy}),t[2]=e.crossorigin,t[3]=e.decoding,t[4]=e.fetchpriority,t[5]=e.height,t[6]=e.referrerpolicy,t[7]=e.sizes,t[8]=e.src,t[9]=e.srcset,t[10]=e.title,t[11]=e.width,t[12]=r,t[13]=s,t[14]=c):c=t[14],c}function Vb(e){let t=(0,J.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={sizes:void 0},t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,q.jsx)(Rb,{wrapElement:`span`,zoomMargin:20,zoomImg:n,children:(0,q.jsx)(Bb,{...e})}),t[1]=e,t[2]=r),r}function Hb(e){return e!==!1}function Ub(e){let t=(0,J.c)(14),n=e.src,r=e.title,i;t[0]===e.controls?i=t[1]:(i=Hb(e.controls),t[0]=e.controls,t[1]=i);let a;return t[2]!==e.autoplay||t[3]!==e.height||t[4]!==e.loop||t[5]!==e.muted||t[6]!==e.playsinline||t[7]!==e.poster||t[8]!==e.preload||t[9]!==e.src||t[10]!==e.title||t[11]!==e.width||t[12]!==i?(a=(0,q.jsx)(`video`,{className:`ok-video`,src:n,title:r,controls:i,autoPlay:e.autoplay,muted:e.muted,loop:e.loop,playsInline:e.playsinline,poster:e.poster,preload:e.preload,width:e.width,height:e.height}),t[2]=e.autoplay,t[3]=e.height,t[4]=e.loop,t[5]=e.muted,t[6]=e.playsinline,t[7]=e.poster,t[8]=e.preload,t[9]=e.src,t[10]=e.title,t[11]=e.width,t[12]=i,t[13]=a):a=t[13],a}function Wb(e){let t=(0,J.c)(2),n;return t[0]===e.children?n=t[1]:(n=(0,q.jsx)(`div`,{className:`prose-no-margin`,children:e.children}),t[0]=e.children,t[1]=n),n}var Gb={Callout:lb,img:Vb,video:Ub,audio:ib,Accordion:nb,"*":Wb};function Kb(e){let t=new Set;for(let n of e)n.type===`reactnode`&&t.add(n.name);return t}var qb=le(),Jb=new Map;function Yb(e){if(e.surface===`compat`){let t=Gb[e.rendersAs];if(!t)throw Error(`Compat descriptor '${e.name}' declares rendersAs: '${e.rendersAs}', but no React component is registered under that name in componentMap. Add the canonical component before registering the compat descriptor.`);return{Component:t,reactNodePropNames:Kb(e.props)}}let t=Gb[e.name];return t?{Component:t,reactNodePropNames:Kb(e.props)}:null}for(let[e,t]of qb.entries()){let n=Yb(t);n&&Jb.set(e,n)}function Xb(e,t){return{...e,Component:t.Component,reactNodePropNames:t.reactNodePropNames}}function Zb(e){let t=qb.getOrWildcard(e),n=Jb.get(t.name)??Jb.get(`*`);if(!n)throw Error(`No React component registered for ${t.name} (and no '*' wildcard)`);return Xb(t,n)}function Qb(){let e=[];for(let[t,n]of qb.entries()){if(t===`*`)continue;let r=Jb.get(t);r&&e.push(Xb(n,r))}return e}var $b={ChevronRight:Bn,Image:Xn,MessageSquareWarning:rr,SquarePlay:lr,Volume2:pr};function ex(e){return e&&Object.hasOwn($b,e)?$b[e]:Rn}var tx=``+new URL(`image-preview-BJSGEOo4.png`,import.meta.url).href,nx=``+new URL(`video-preview-vLovc_Vy.png`,import.meta.url).href,rx={Callout:{description:`Highlight tips, warnings, and notes.`,props:{type:`note`,title:`Heads up`},children:`Callouts draw attention to key information.`},Accordion:{description:`Collapsible section with a clickable summary.`,props:{title:`Click to expand`,defaultOpen:!0},children:`Hidden content goes here.`},img:{description:`Embed an image with optional alt text.`,props:{src:tx,alt:`Sample image`}},video:{description:`Embed a video with native player controls.`,props:{controls:!0,poster:nx}},audio:{description:`Embed an audio file with native player controls.`,props:{controls:!0}}};function ix(e){let t={};for(let n of e.props)n.type!==`reactnode`&&`defaultValue`in n&&n.defaultValue!==void 0&&(t[n.name]=n.defaultValue);return t}function ax(e){let t=Zb(e),n=ix(t);return{type:`jsxComponent`,attrs:{componentName:t.name,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:n},content:t.hasChildren?[{type:`paragraph`}]:void 0}}var ox=new Set;function sx(e){ox.add(e)}function cx(e){if(typeof e==`number`)return ox.delete(e);let t=ox.values().next();return t.done?!1:(ox.delete(t.value),!0)}function lx(e,t,n){n.props.some(e=>!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`)?(sx(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)})):n.hasChildren&&e.commands.setTextSelection(t+2)}function ux(e){return t=>{let n=new WeakSet;t.state.doc.descendants(t=>{t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&n.add(t)}),t.chain().focus().insertContent(ax(e.name)).run();let r=-1;t.state.doc.descendants((t,i)=>{if(r>=0)return!1;t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&!n.has(t)&&(r=i)}),!(r<0)&&lx(t,r,e)}}function dx(){return Qb().filter(e=>e.surface===`canonical`).map(e=>{let t=rx[e.name],n=e.Component,r=t?{description:t.description,render:()=>(0,q.jsx)(n,{...t.props,children:t.children})}:void 0;return{name:`component-${e.name}`,label:e.displayName??e.name,icon:ex(e.icon),category:e.category??`content`,command:ux(e),aliases:e.searchTerms,description:e.description,preview:r}})}var fx=new Te(`imageUpload`);function px(e){let t=document.createElement(`div`);return t.className=`image-upload-skeleton w-full h-40 rounded-md bg-muted animate-pulse motion-reduce:animate-none my-2`,t.setAttribute(`data-upload-widget`,`loading`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-label`,e?.name?`Uploading ${e.name}…`:`Uploading file…`),t}var mx=new Fe({key:fx,state:{init(){return{decorations:ge.empty,uploads:new Map}},apply(e,t){let n=t.decorations.map(e.mapping,e.doc),r=new Map;for(let[n,i]of t.uploads)r.set(n,e.mapping.map(i));let i=e.getMeta(fx);if(!i)return{decorations:n,uploads:r};if(i.type===`add`){let t=Ke.widget(i.pos,i.widget,{id:i.id,stopEvent:()=>!0}),a=n.add(e.doc,[t]),o=new Map(r);return o.set(i.id,e.mapping.map(i.pos)),{decorations:a,uploads:o}}if(i.type===`remove`){let e=n.find(void 0,void 0,e=>e.id===i.id),t=n.remove(e),a=new Map(r);return a.delete(i.id),{decorations:t,uploads:a}}return{decorations:n,uploads:r}}},props:{decorations(e){return fx.getState(e)?.decorations??ge.empty}}});function hx(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function gx(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function _x(e){return e.split(`/`).filter(e=>e!==``)}function vx(e,t){let n=hx(e),r=hx(t),i=gx(e);if(n===r)return i;let a=_x(r),o=_x(n),s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s++;let c=a.length-s,l=o.slice(s);return c===0?`./${[...l,i].join(`/`)}`:[...Array(c).fill(`..`),...l,i].join(`/`)}function yx(e){return qy(e)}function bx(e,t){return{type:`jsxComponent`,attrs:{componentName:e===`jsx-img`?`img`:e===`jsx-video`?`video`:`audio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:e===`jsx-img`?{src:t,alt:``}:{src:t,controls:!0}}}}function xx(e){let t=me(e);return t===`md`||t===`mdx`?{kind:`wiki-link`,ext:t}:k.has(t)?{kind:`jsx-img`,ext:t}:ee.has(t)?{kind:`jsx-video`,ext:t}:qe.has(t)?{kind:`jsx-audio`,ext:t}:C.has(t)?{kind:`wikiembed`,ext:t}:{kind:`markdown-link`,ext:t}}async function Sx(e,t,n){let r=yx(t),i=r?`${r}.md`:``;if(!i){Lt.error(`Cannot upload: no document is open`);return}let a=crypto.randomUUID(),o=px(e);t.view.dispatch(t.state.tr.setMeta(fx,{type:`add`,id:a,pos:n,widget:o}));let s=new FormData;s.append(`file`,e),s.append(`parentDocName`,i);let c;try{c=await fetch(`/api/upload`,{method:`POST`,body:s})}catch(e){console.error(`[uploadAndInsert] Network error:`,e),Cx(t,a);return}let l={};try{l=await c.json()}catch{}if(!c.ok){let e=l.message??l.error??`Upload failed (${c.status})`;console.error(`[uploadAndInsert] Server error:`,e),Cx(t,a,e);return}if(typeof l.src!=`string`){console.error(`[uploadAndInsert] Response missing src:`,l),Cx(t,a);return}let u=l.src,d=l.deduped===!0,f=hx(i),p=typeof l.path==`string`&&l.path.length>0?l.path:f?`${f}/${u}`:u;d&&Lt.info(`Already at ${p} — reusing.`);let m=xx(e.name),{state:h}=t,g=fx.getState(h)?.uploads.get(a)??n,_=h.tr.setMeta(fx,{type:`remove`,id:a}),v=vx(p,i),y=`/${p}`;if(m.kind===`jsx-img`||m.kind===`jsx-video`||m.kind===`jsx-audio`){if(!h.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),Cx(t,a);return}let e=bx(m.kind,y),n=e.attrs.componentName;t.chain().command(({tr:e})=>(e.setMeta(fx,{type:`remove`,id:a}),!0)).focus().insertContentAt(g,e).run(),lx(t,g,Zb(n));return}if(m.kind===`wikiembed`){let e=h.schema.nodes.wikiLinkEmbed;if(!e){console.error(`[uploadAndInsert] wikiLinkEmbed node missing from schema`),Cx(t,a);return}_.insert(g,e.create({target:u,alias:null,anchor:null,resolvedSrc:y}))}else if(m.kind===`wiki-link`){let n=h.schema.nodes.wikiLink;if(!n){console.error(`[uploadAndInsert] wikiLink node missing from schema`),Cx(t,a);return}let r=Zy(e.name.replace(/\.(md|mdx)$/i,``));r?_.insert(g,n.create(r)):_.insert(g,h.schema.text(e.name))}else{let t=h.schema.marks.link;if(t){let n=h.schema.text(e.name,[t.create({href:v})]);_.insert(g,n)}else _.insert(g,h.schema.text(e.name))}t.view.dispatch(_)}function Cx(e,t,n){e.view.dispatch(e.state.tr.setMeta(fx,{type:`remove`,id:t})),Lt.error(n??`Upload failed`)}var wx=[{name:`heading1`,label:`Heading 1`,icon:qn,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:1}).run(),aliases:[`h1`],preview:{description:`Big section heading.`,render:()=>(0,q.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Heading 1`})}},{name:`heading2`,label:`Heading 2`,icon:Jn,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:2}).run(),aliases:[`h2`],preview:{description:`Medium section heading.`,render:()=>(0,q.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Heading 2`})}},{name:`heading3`,label:`Heading 3`,icon:Yn,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:3}).run(),aliases:[`h3`],preview:{description:`Small section heading.`,render:()=>(0,q.jsx)(`h3`,{className:`text-base font-semibold tracking-tight`,children:`Heading 3`})}},{name:`bulletList`,label:`Bullet List`,icon:tr,category:`basic`,command:e=>e.chain().focus().toggleBulletList().run(),aliases:[`ul`,`unordered`],preview:{description:`Unordered list of items.`,render:()=>(0,q.jsxs)(`ul`,{className:`list-disc pl-5 text-sm leading-7`,children:[(0,q.jsx)(`li`,{children:`First item`}),(0,q.jsx)(`li`,{children:`Second item`})]})}},{name:`orderedList`,label:`Ordered List`,icon:$n,category:`basic`,command:e=>e.chain().focus().toggleOrderedList().run(),aliases:[`ol`,`numbered`],preview:{description:`Numbered list of items.`,render:()=>(0,q.jsxs)(`ol`,{className:`list-decimal pl-5 text-sm leading-7`,children:[(0,q.jsx)(`li`,{children:`First item`}),(0,q.jsx)(`li`,{children:`Second item`})]})}},{name:`taskList`,label:`Task List`,icon:er,category:`basic`,command:e=>e.chain().focus().toggleTaskList().run(),aliases:[`todo`,`checklist`,`checkbox`],preview:{description:`Checklist with checkboxes.`,render:()=>(0,q.jsxs)(`ul`,{className:`space-y-1.5 text-sm`,children:[(0,q.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:!0,readOnly:!0,className:`size-3.5`}),(0,q.jsx)(`span`,{className:`text-muted-foreground line-through`,children:`Done`})]}),(0,q.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`checkbox`,readOnly:!0,className:`size-3.5`}),(0,q.jsx)(`span`,{children:`To do`})]})]})}},{name:`blockquote`,label:`Quote`,icon:sr,category:`basic`,command:e=>e.chain().focus().toggleBlockquote().run(),aliases:[`quote`],preview:{description:`Indented blockquote for citations.`,render:()=>(0,q.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/40 pl-3 text-sm italic text-muted-foreground`,children:`A pull quote stands out from the surrounding text.`})}},{name:`codeBlock`,label:`Code Block`,icon:Hn,category:`basic`,command:e=>e.chain().focus().toggleCodeBlock().run(),aliases:[`code`,`fence`],preview:{description:`Fenced code block with monospace text.`,render:()=>(0,q.jsx)(`pre`,{className:`rounded-md bg-muted px-2.5 py-2 font-mono text-xs leading-5`,children:(0,q.jsx)(`code`,{children:`const greeting = "Hello";
|
|
6
|
-
console.log(greeting);`})})}},{name:`table`,label:`Table`,icon:ur,category:`insert`,command:e=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),aliases:[`grid`],preview:{description:`Grid of rows and columns with a header row.`,render:()=>(0,q.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{className:`border border-border bg-muted/50 px-2 py-1 text-left font-semibold`,children:`Name`}),(0,q.jsx)(`th`,{className:`border border-border bg-muted/50 px-2 py-1 text-left font-semibold`,children:`Role`})]})}),(0,q.jsxs)(`tbody`,{children:[(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Ada`}),(0,q.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Engineer`})]}),(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Grace`}),(0,q.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Admiral`})]})]})]})}},{name:`separator`,label:`Separator`,icon:ir,category:`insert`,command:e=>e.chain().focus().setHorizontalRule().run(),aliases:[`hr`,`divider`,`rule`],preview:{description:`Horizontal rule that divides sections.`,render:()=>(0,q.jsxs)(`div`,{className:`w-full`,children:[(0,q.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:`Above`}),(0,q.jsx)(`hr`,{className:`border-border`}),(0,q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Below`})]})}}];function Tx(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(n)||e.name.toLowerCase().includes(n)||e.aliases?.some(e=>e.toLowerCase().includes(n)))}function Ex(e){let{$from:t}=e.selection;return t.depth===0?null:{from:t.before(1),to:t.after(1)}}function Dx(e,t){let n=Ex(e);if(!n)return!1;let{from:r,to:i}=n;if(r===0)return!1;let a=e.doc.resolve(r-1);if(a.depth===0)return!1;let o=a.before(1),s=e.doc.slice(r,i).content,c=e.doc.slice(o,r).content;if(!t)return!0;let l=e.tr;l.replaceWith(o,i,s.append(c));let u=o+1,d=o+s.size,f=e.selection.from-r,p=Math.min(u+f,d);return l.setSelection(Je.near(l.doc.resolve(p))),l.scrollIntoView(),t(l),!0}function Ox(e,t){let n=Ex(e);if(!n)return!1;let{from:r,to:i}=n;if(i>=e.doc.content.size)return!1;let a=e.doc.resolve(i+1);if(a.depth===0)return!1;let o=a.after(1),s=e.doc.slice(r,i).content,c=e.doc.slice(i,o).content;if(!t)return!0;let l=e.tr;l.replaceWith(r,o,c.append(s));let u=r+c.size+1,d=r+c.size+s.size,f=e.selection.from-r,p=Math.min(u+f,d);return l.setSelection(Je.near(l.doc.resolve(p))),l.scrollIntoView(),t(l),!0}var kx=W.create({name:`blockMover`,addKeyboardShortcuts(){return{"Mod-Shift-ArrowUp":({editor:e})=>Dx(e.state,e.view.dispatch),"Mod-Shift-ArrowDown":({editor:e})=>Ox(e.state,e.view.dispatch)}}}),Ax=new Te(`y-sync`);new Te(`y-undo`),new Te(`yjs-cursor`);var jx=new Te(`bridgeId`);function Mx(e){let t=Ax.getState(e);return t?.binding?.mapping?t.binding.mapping:null}function Nx(e){let t=Mx(e);if(!t)return null;let n=new Map;for(let[e,r]of t)r&&`nodeName`in e&&typeof e.getAttribute==`function`&&n.set(r,e);return n}function Px(e,t){return e?e.get(t)??null:null}var Fx=W.create({name:`bridgeIdPlugin`,priority:1e3,addProseMirrorPlugins(){return[new Fe({key:jx,state:{init(e,t){let n={yElementToId:new WeakMap,posToId:new Map,counter:0},r=Nx(t);return t.doc.descendants((e,t)=>{if(e.type.name!==`jsxComponent`)return;let i=Px(r,e);if(i){let e=`b${++n.counter}`;n.yElementToId.set(i,e),n.posToId.set(t,e)}else{let e=`b${++n.counter}`;n.posToId.set(t,e)}}),n},apply(e,t,n,r){if(!e.docChanged){let n=new Map;for(let[i,a]of t.posToId){let t=e.mapping.map(i);r.doc.nodeAt(t)?.type.name===`jsxComponent`&&n.set(t,a)}return{...t,posToId:n}}let i=new Map,{counter:a}=t,{yElementToId:o}=t,s=Nx(r);return r.doc.descendants((n,r)=>{if(n.type.name!==`jsxComponent`)return;let c=Px(s,n);if(c){let e=o.get(c);if(e)i.set(r,e);else{let e=`b${++a}`;o.set(c,e),i.set(r,e)}}else{let n=!1;for(let[a,o]of t.posToId)if(e.mapping.map(a)===r){i.set(r,o),n=!0;break}if(!n){let e=`b${++a}`;i.set(r,e)}}}),{yElementToId:o,posToId:i,counter:a}}}})]}});function Ix(e){return!!e.getMeta(Im)}function Lx(e,t){let n=Im.getState(e);return Ch(n.doc,n.type,t,n.binding.mapping)||0}function Rx(e,t){let n=Im.getState(e);return xh(t,n.type,n.binding.mapping)}var zx=class e extends re{constructor(e,t){super(e),this.yRelativePosition=t}static fromJSON(t){return new e(t.position,t.yRelativePosition)}toJSON(){return{position:this.position,yRelativePosition:this.yRelativePosition}}};function Bx(e,t){return new zx(e,Rx(t,e))}function Vx(e,t,n){let r=e instanceof zx?e.yRelativePosition:null;if(Ix(t)&&r)return{position:new zx(Lx(n,r),r),mapResult:null};let i=Oe(e,t),a=i.position.position;return{position:new zx(a,r??Rx(n,a)),mapResult:i.mapResult}}var Hx=W.create({name:`collaboration`,priority:1e3,addOptions(){return{document:null,field:`default`,fragment:null,provider:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(e=>e.name===`undoRedo`)&&console.warn(`[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-undo-redo".`)},onBeforeCreate(){this.editor.utils.getUpdatedPosition=(e,t)=>Vx(e,t,this.editor.state),this.editor.utils.createMappablePosition=e=>Bx(e,this.editor.state)},addCommands(){return{undo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),Lm.getState(t).undoManager.undoStack.length===0?!1:n?Ah(t):!0),redo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),Lm.getState(t).undoManager.redoStack.length===0?!1:n?jh(t):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){let e=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),t=Ph(this.options.yUndoOptions),n=t.spec.view;return t.spec.view=e=>{let{undoManager:t}=Lm.getState(e.state);t.restore&&=(t.restore(),()=>{});let r=n?n(e):void 0;return{destroy:()=>{let e=t.trackedOrigins.has(t),n=t._observers;t.restore=()=>{e&&t.trackedOrigins.add(t),t.doc.on(`afterTransaction`,t.afterTransactionHandler),t._observers=n},r?.destroy&&r.destroy()}}},[Wm(e,{...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender}),t,this.editor.options.enableContentCheck&&new Fe({key:new Te(`filterInvalidContent`),filterTransaction:t=>{if(!Ix(t))return!0;if(this.storage.isDisabled)return!1;if(!t.docChanged)return!0;try{return t.doc.check(),!0}catch(t){return this.storage.isDisabled=!0,this.editor.emit(`contentError`,{error:t,editor:this.editor,disableCollaboration:()=>{var t;(t=e.doc)==null||t.destroy()}}),!1}}})].filter(Boolean)}});function Ux(e){if(!e.length)return ge.empty;let t=[],n=e[0].$from.node(0);return e.forEach(e=>{let n=e.$from.pos,r=e.$from.nodeAfter;r&&t.push(Ke.node(n,n+r.nodeSize,{class:`ProseMirror-selectednoderange`}))}),ge.create(n,t)}function Wx(e,t,n){let r=n.isText||n.isAtom?0:1;return{start:e+r,end:e+t-r}}function Gx(e,t,n,r={}){let i=[],a=e.node(0),{extendOnBoundaryOverlap:o=!0}=r;typeof n==`number`&&n>=0||(n=e.sameParent(t)?Math.max(0,e.sharedDepth(t.pos)-1):e.sharedDepth(t.pos));let s=new B(e,t,n),c=s.depth===0?0:a.resolve(s.start).posAtIndex(0);return s.parent.forEach((n,r)=>{let l=c+r,u=l+n.nodeSize,d=Wx(l,n.nodeSize,n),f=o?t.pos>=d.start&&e.pos<=d.end:t.pos>d.start&&e.pos<d.end;if(l<s.start||l>=s.end||!f)return;let p=new oe(a.resolve(l),a.resolve(u));i.push(p)}),i}var Kx=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return new qx(e.resolve(this.anchor),e.resolve(this.head))}},qx=class e extends Se{constructor(e,t,n,r=1){let{doc:i}=e,a=e===t,o=e.pos===i.content.size&&t.pos===i.content.size,s=a&&!o?i.resolve(t.pos+(r>0?1:-1)):t,c=a&&o?i.resolve(e.pos-(r>0?1:-1)):e,l=Gx(c.min(s),c.max(s),n),u=s.pos>=e.pos?l[0].$from:l[l.length-1].$to,d=s.pos>=e.pos?l[l.length-1].$to:l[0].$from;super(u,d,l),this.depth=n}get $to(){return this.ranges[this.ranges.length-1].$to}eq(t){return t instanceof e&&t.$from.pos===this.$from.pos&&t.$to.pos===this.$to.pos}map(t,n){return new e(t.resolve(n.map(this.anchor)),t.resolve(n.map(this.head)))}toJSON(){return{type:`nodeRange`,anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){let{doc:t}=this.$from;if(this.isForwards&&this.ranges.length>1){let t=this.ranges.slice(0,-1),n=t[0].$from,r=t[t.length-1].$to;return new e(n,r,this.depth)}let n=this.ranges[0],r=t.resolve(Math.max(0,n.$from.pos-1));return new e(this.$anchor,r,this.depth)}extendForwards(){let{doc:t}=this.$from;if(this.isBackwards&&this.ranges.length>1){let t=this.ranges.slice(1),n=t[0].$from,r=t[t.length-1].$to;return new e(r,n,this.depth)}let n=this.ranges[this.ranges.length-1],r=t.resolve(Math.min(t.content.size,n.$to.pos+1));return new e(this.$anchor,r,this.depth)}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n,r,i=1){return new this(e.resolve(t),e.resolve(n),r,i)}getBookmark(){return new Kx(this.anchor,this.head)}};qx.prototype.visible=!1;function Jx(e){return e instanceof qx}W.create({name:`nodeRange`,addOptions(){return{depth:void 0,key:`Mod`}},addKeyboardShortcuts(){return{"Shift-ArrowUp":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!Jx(a)){let e=qx.create(i,s,c,t,-1);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendBackwards();return o.setSelection(l),n.dispatch(o),!0},"Shift-ArrowDown":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!Jx(a)){let e=qx.create(i,s,c,t);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendForwards();return o.setSelection(l),n.dispatch(o),!0},"Mod-a":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,tr:a}=r,o=qx.create(i,0,i.content.size,t);return a.setSelection(o),n.dispatch(a),!0}}},onSelectionUpdate(){let{selection:e}=this.editor.state;Jx(e)&&this.editor.view.dom.classList.add(`ProseMirror-noderangeselection`)},addProseMirrorPlugins(){let e=!1,t=!1;return[new Fe({key:new Te(`nodeRange`),props:{attributes:()=>e?{class:`ProseMirror-noderangeselection`}:{class:``},handleDOMEvents:{mousedown:(e,n)=>{let{key:r}=this.options,i=/Mac/.test(navigator.platform),a=!!n.shiftKey,o=!!n.ctrlKey,s=!!n.altKey,c=!!n.metaKey;return(r==null||r===`Shift`&&a||r===`Control`&&o||r===`Alt`&&s||r===`Meta`&&c||r===`Mod`&&(i?c:o))&&(t=!0),t&&document.addEventListener(`mouseup`,()=>{t=!1;let{state:n}=e,{doc:r,selection:i,tr:a}=n,{$anchor:o,$head:s}=i;if(o.sameParent(s))return;let c=qx.create(r,o.pos,s.pos,this.options.depth);a.setSelection(c),e.dispatch(a)},{once:!0}),!1}},decorations:n=>{let{selection:r}=n,i=Jx(r);if(e=!1,!t)return i?(e=!0,Ux(r.ranges)):null;let{$from:a,$to:o}=r;if(!i&&a.sameParent(o))return null;let s=Gx(a,o,this.options.depth);return s.length?(e=!0,Ux(s)):null}}})]}});function Yx(e){let t=``,n=getComputedStyle(e);for(let e=0;e<n.length;e+=1)t+=`${n[e]}:${n.getPropertyValue(n[e])};`;return t}function Xx(e){let t=e.cloneNode(!0),n=[e,...Array.from(e.getElementsByTagName(`*`))],r=[t,...Array.from(t.getElementsByTagName(`*`))];return n.forEach((e,t)=>{r[t].style.cssText=Yx(e)}),t}var Zx=[{id:`listItemFirstChild`,evaluate:({parent:e,isFirst:t})=>t&&e&&[`listItem`,`taskItem`].includes(e.type.name)?1e3:0},{id:`listWrapperDeprioritize`,evaluate:({node:e})=>{let t=[`listItem`,`taskItem`],n=e.firstChild;return n&&t.includes(n.type.name)?1e3:0}},{id:`tableStructure`,evaluate:({node:e,parent:t})=>[`tableRow`,`tableCell`,`tableHeader`].includes(e.type.name)||t&&t.type.name===`tableHeader`?1e3:0},{id:`inlineContent`,evaluate:({node:e})=>e.isInline||e.isText?1e3:0}],Qx={edges:[`left`,`top`],threshold:12,strength:500};function $x(e){return e===void 0||e===`left`?{...Qx}:e===`right`?{edges:[`right`,`top`],threshold:12,strength:500}:e===`both`?{edges:[`left`,`right`,`top`],threshold:12,strength:500}:e===`none`?{edges:[],threshold:0,strength:0}:{...Qx,...e}}function eS(e,t,n){if(n.edges.length===0)return!1;let r=t.getBoundingClientRect(),{threshold:i,edges:a}=n;return a.some(t=>t===`left`?e.x-r.left<i:t===`right`?r.right-e.x<i:t===`top`?e.y-r.top<i:t===`bottom`?r.bottom-e.y<i:!1)}function tS(e,t,n,r){return!t||n.edges.length===0?0:eS(e,t,n)?n.strength*r:0}var nS=1e3;function rS(e,t,n,r){let i=nS,a=!1;if(t.every(t=>{let n=t.evaluate(e);return i-=n,i<=0?(a=!0,!1):!0}),a)return-1;let o=e.view.nodeDOM(e.pos);return i-=tS(r,o,n,e.depth),i<=0?-1:i}function iS(e,t,n){return Array.from({length:t},(e,n)=>t-1-n).some(t=>n.includes(e.node(t).type.name))}function aS(e,t,n){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let r=e.posAtCoords({left:t.x,top:t.y});if(!r)return null;let{doc:i}=e.state,a=i.resolve(r.pos),o=[];n.defaultRules&&o.push(...Zx),o.push(...n.rules);let s=Array.from({length:a.depth},(e,t)=>a.depth-t).map(r=>{let i=a.node(r),s=a.before(r);if(n.allowedContainers&&r>0&&!iS(a,r,n.allowedContainers))return null;let c=r>0?a.node(r-1):null,l=r>0?a.index(r-1):0,u=c?c.childCount:1,d=rS({node:i,pos:s,depth:r,parent:c,index:l,isFirst:l===0,isLast:l===u-1,$pos:a,view:e},o,n.edgeDetection,t);return d<0?null:{node:i,pos:s,depth:r,score:d,dom:e.nodeDOM(s)}}).filter(e=>e!==null),c=a.nodeAfter;if(c&&c.isAtom&&!c.isInline){let i=r.pos,l=a.depth+1,u=a.parent,d=a.index(),f=u.childCount,p=!0;if(n.allowedContainers&&(p=iS(a,l,n.allowedContainers)),p){let r=rS({node:c,pos:i,depth:l,parent:u,index:d,isFirst:d===0,isLast:d===f-1,$pos:a,view:e},o,n.edgeDetection,t);if(r>=0){let t=e.nodeDOM(i);t&&s.push({node:c,pos:i,depth:l,score:r,dom:t})}}}if(s.length===0)return null;s.sort((e,t)=>t.score===e.score?t.depth-e.depth:t.score-e.score);let l=s[0];return l.dom?{node:l.node,pos:l.pos,dom:l.dom}:null}function oS(e,t){let n=e;for(;n?.parentElement&&n.parentElement!==t.dom;)n=n.parentElement;return n?.parentElement===t.dom?n:void 0}function sS(e){return Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)&&e.width>0&&e.height>0}function cS(e,t,n,r=5){if(!Number.isFinite(t)||!Number.isFinite(n))return null;let i=e.dom,a=i.firstElementChild,o=i.lastElementChild;if(!a||!o)return null;let s=a.getBoundingClientRect(),c=o.getBoundingClientRect();if(!sS(s)||!sS(c))return null;let l=Math.min(Math.max(s.top+r,n),c.bottom-r),u=.5,d=Math.abs(s.left-c.left)<u,f=Math.abs(s.right-c.right)<u,p=s;d&&f&&(p=s);let m=Math.min(Math.max(p.left+r,t),p.right-r);return!Number.isFinite(m)||!Number.isFinite(l)?null:{x:m,y:l}}var lS=e=>{let{x:t,y:n,editor:r,nestedOptions:i}=e,{view:a,state:o}=r,s=cS(a,t,n,5);if(!s)return{resultElement:null,resultNode:null,pos:null};let{x:c,y:l}=s;if(i?.enabled){let e=aS(a,{x:c,y:l},i);return e?{resultElement:e.dom,resultNode:e.node,pos:e.pos}:{resultElement:null,resultNode:null,pos:null}}let u=a.root.elementsFromPoint(c,l),d;if(Array.prototype.some.call(u,e=>{if(!a.dom.contains(e))return!1;let t=oS(e,a);return t?(d=t,!0):!1}),!d){let e=a.posAtCoords({left:c,top:l});if(e){let t=o.doc.resolve(e.pos),n=Math.min(t.depth,1),r=n>0?t.before(n):t.pos,i=o.doc.nodeAt(r);if(i){let e=a.nodeDOM(r);return{resultElement:e instanceof HTMLElement?e:null,resultNode:i,pos:r}}}return{resultElement:null,resultNode:null,pos:null}}let f;try{f=a.posAtDOM(d,0)}catch{return{resultElement:null,resultNode:null,pos:null}}let p=o.doc.nodeAt(f);if(!p){let e=o.doc.resolve(f),t=e.parent;return{resultElement:d,resultNode:t,pos:e.start()}}return{resultElement:d,resultNode:p,pos:f}};function uS(e,t){let n=null,r=e.nodeDOM(t);if(r instanceof Element)n=r;else{let{node:r,offset:i}=e.domAtPos(t),a=r.childNodes[i];a instanceof Element?n=a:r instanceof Element?n=r:r.nodeType===Node.TEXT_NODE&&r.parentElement&&(n=r.parentElement)}return(n?getComputedStyle(n).direction:getComputedStyle(e.dom).direction)||`ltr`}function dS(e){var t;(t=e.parentNode)==null||t.removeChild(e)}function fS(e,t,n,r){let{doc:i}=t.view.state;if(n?.enabled&&r?.node&&r.pos>=0){let e=r.pos,t=r.pos+r.node.nodeSize;return[{$from:i.resolve(e),$to:i.resolve(t)}]}let a=lS({editor:t,x:e.clientX,y:e.clientY,direction:`right`,nestedOptions:n});if(!a.resultNode||a.pos===null)return[];let o=a.resultNode.isText||a.resultNode.isAtom?0:-1;return Gx(i.resolve(a.pos),i.resolve(a.pos+a.resultNode.nodeSize+o),0,{extendOnBoundaryOverlap:!1})}function pS(e,t,n,r){let{view:i}=t;if(!e.dataTransfer)return;let{empty:a,$from:o,$to:s}=i.state.selection,c=fS(e,t,n,r),l=Gx(o,s,0,{extendOnBoundaryOverlap:!1}),u=l.some(e=>c.find(t=>t.$from===e.$from&&t.$to===e.$to)),d=a||!u?c:l;if(!d.length)return;let{tr:f}=i.state,p=document.createElement(`div`),m=d[0].$from.pos,h=d[d.length-1].$to.pos;p.setAttribute(`dir`,uS(i,m));let g=n?.enabled&&r?.node,_,v;g?(_=i.state.doc.slice(m,h),v=Le.create(i.state.doc,m)):(v=qx.create(i.state.doc,m,h),_=v.content()),d.forEach(e=>{let t=Xx(i.nodeDOM(e.$from.pos));p.append(t)}),p.style.position=`absolute`,p.style.top=`-10000px`,document.body.append(p),e.dataTransfer.clearData();let y=p.getBoundingClientRect(),b=e.clientX-y.left;e.dataTransfer.setDragImage(p,Math.max(0,Math.min(b,y.width)),0);let x=!1,S=()=>{x||(x=!0,dS(p),document.removeEventListener(`drop`,S),document.removeEventListener(`dragend`,S))},C=v instanceof Le?v:void 0;i.dragging={slice:_,move:!0,node:C},f.setSelection(v),i.dispatch(f),document.addEventListener(`drop`,S),document.addEventListener(`dragend`,S)}var mS=(e,t)=>{let n=e.resolve(t),{depth:r}=n;return r===0?t:n.pos-n.parentOffset-1},hS=(e,t)=>{let n=e.nodeAt(t),r=e.resolve(t),{depth:i}=r,a=n;for(;i>0;){let e=r.node(i);--i,i===0&&(a=e)}return a},gS=(e,t)=>{let n=Im.getState(e);return n?xh(t,n.type,n.binding.mapping):null},_S=(e,t)=>{let n=Im.getState(e);return n?Ch(n.doc,n.type,t,n.binding.mapping)||0:-1},vS=(e,t)=>{let n=t;for(;n?.parentNode&&n.parentNode!==e.dom;)n=n.parentNode;return n},yS=new Te(`dragHandle`),bS=({pluginKey:e=yS,element:t,editor:n,computePositionConfig:r,getReferencedVirtualElement:i,onNodeChange:a,onElementDragStart:o,onElementDragEnd:s,nestedOptions:c})=>{let l=document.createElement(`div`),u=!1,d=null,f=-1,p,m=null,h=null;function g(){t&&(t.style.visibility=`hidden`,t.style.pointerEvents=`none`)}function _(){if(t){if(!n.isEditable){g();return}t.style.visibility=``,t.style.pointerEvents=`auto`}}function v(e){b(i?.()||{getBoundingClientRect:()=>e.getBoundingClientRect()},t,r).then(e=>{Object.assign(t.style,{position:e.strategy,left:`${e.x}px`,top:`${e.y}px`})})}function y(e){o?.(e),pS(e,n,c,{node:d,pos:f}),t&&(t.dataset.dragging=`true`),setTimeout(()=>{t&&(t.style.pointerEvents=`none`)},0)}function x(e){s?.(e),g(),t&&(t.style.pointerEvents=`auto`,t.dataset.dragging=`false`)}function S(){if(ce()){let e=n.view.dom;requestAnimationFrame(()=>{e.isContentEditable&&(e.contentEditable=`false`,e.contentEditable=`true`)})}}return l.appendChild(t),{unbind(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,x),document.removeEventListener(`drop`,S),m&&(cancelAnimationFrame(m),m=null,h=null)},plugin:new Fe({key:typeof e==`string`?new Te(e):e,state:{init(){return{locked:!1}},apply(e,r,i,o){let s=e.getMeta(`lockDragHandle`),c=e.getMeta(`hideDragHandle`);if(s!==void 0&&(u=s),c)return g(),u=!1,d=null,f=-1,a?.({editor:n,node:null,pos:-1}),r;if(e.docChanged&&f!==-1&&t)if(Ix(e)){let e=_S(o,p);e!==f&&(f=e)}else{let t=e.mapping.map(f);t!==f&&(f=t,p=gS(o,f))}return r}},view:e=>{var r;return t.draggable=!0,t.style.pointerEvents=`auto`,t.dataset.dragging=`false`,(r=n.view.dom.parentElement)==null||r.appendChild(l),l.style.pointerEvents=`none`,l.style.position=`absolute`,l.style.top=`0`,l.style.left=`0`,t.addEventListener(`dragstart`,y),t.addEventListener(`dragend`,x),document.addEventListener(`drop`,S),{update(r,i){if(!t)return;if(!n.isEditable){g();return}if(u?t.draggable=!1:t.draggable=!0,e.state.doc.eq(i.doc)||f===-1)return;let o=e.nodeDOM(f);if(o=vS(e,o),o===e.dom||o?.nodeType!==1)return;let s=e.posAtDOM(o,0),c=hS(n.state.doc,s),l=mS(n.state.doc,s);d=c,f=l,p=gS(e.state,f),a?.({editor:n,node:d,pos:f}),v(o)},destroy(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,x),document.removeEventListener(`drop`,S),m&&(cancelAnimationFrame(m),m=null,h=null),t&&dS(l)}}},props:{handleDOMEvents:{keydown(e){return!t||u?!1:e.hasFocus()?(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1}),!1):!1},mouseleave(e,t){return u||t.target&&!l.contains(t.relatedTarget)&&(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1})),!1},mousemove(e,r){return!t||u||(h={x:r.clientX,y:r.clientY},m)||(m=requestAnimationFrame(()=>{if(m=null,!h)return;let{x:t,y:r}=h;h=null;let i=lS({x:t,y:r,direction:`right`,editor:n,nestedOptions:c});if(!i.resultElement)return;let o=i.resultElement,s=i.resultNode,l=i.pos;if(!c?.enabled){if(o=vS(e,o),o===e.dom||o?.nodeType!==1)return;let t=e.posAtDOM(o,0);s=hS(n.state.doc,t),l=mS(n.state.doc,t)}s!==d&&(d=s,f=l??-1,p=gS(e.state,f),a?.({editor:n,node:d,pos:f}),v(o),_())})),!1}}}})}};function xS(e){return e===!1||e===void 0?{enabled:!1,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:$x(`none`)}:e===!0?{enabled:!0,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:$x(`left`)}:{enabled:!0,rules:e.rules??[],defaultRules:e.defaultRules??!0,allowedContainers:e.allowedContainers,edgeDetection:$x(e.edgeDetection)}}var SS={placement:`left-start`,strategy:`absolute`};W.create({name:`dragHandle`,addOptions(){return{render(){let e=document.createElement(`div`);return e.classList.add(`drag-handle`),e},computePositionConfig:{},locked:!1,onNodeChange:()=>null,onElementDragStart:void 0,onElementDragEnd:void 0,nested:!1}},addCommands(){return{lockDragHandle:()=>({editor:e})=>(this.options.locked=!0,e.commands.setMeta(`lockDragHandle`,this.options.locked)),unlockDragHandle:()=>({editor:e})=>(this.options.locked=!1,e.commands.setMeta(`lockDragHandle`,this.options.locked)),toggleDragHandle:()=>({editor:e})=>(this.options.locked=!this.options.locked,e.commands.setMeta(`lockDragHandle`,this.options.locked))}},addProseMirrorPlugins(){let e=this.options.render(),t=xS(this.options.nested);return[bS({computePositionConfig:{...SS,...this.options.computePositionConfig},getReferencedVirtualElement:this.options.getReferencedVirtualElement,element:e,editor:this.editor,onNodeChange:this.options.onNodeChange,onElementDragStart:this.options.onElementDragStart,onElementDragEnd:this.options.onElementDragEnd,nestedOptions:t}).plugin]}});var CS=20,wS=44,TS=28;function ES(){let e=document.createElement(`div`);e.className=`ok-block-controls`,e.style.visibility=`hidden`;let t=document.createElement(`button`);t.className=`ok-add-block-btn`,t.setAttribute(`aria-label`,`Add block below`),t.setAttribute(`type`,`button`),t.innerHTML=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`,t.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()});let n=document.createElement(`div`);return n.className=`ok-drag-grip`,n.setAttribute(`aria-hidden`,`true`),n.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-grip-vertical-icon lucide-grip-vertical"><circle cx="9" cy="12" r="1"/><circle cx="9" cy="5" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="19" r="1"/></svg>`,e.appendChild(t),e.appendChild(n),{container:e,addBtn:t}}function DS(e,t,n){let{state:r,view:i}=e;if(n.type.name===`jsxComponent`){let i=n.attrs.componentName??``;if(i){let a=Zb(i);if(a.emptyChildName){let i=t+1+n.content.size;if(i>r.doc.content.size)return;let o=a.emptyChildName;e.chain().focus().insertContentAt(i,ax(o)).run(),lx(e,i,Zb(o));return}}}let a=t+n.nodeSize;if(a>r.doc.content.size)return;let{tr:o}=r,s=r.schema.nodes.paragraph?.create();if(!s)return;o.insert(a,s);let c=Je.near(o.doc.resolve(a+1));o.setSelection(c).scrollIntoView(),i.dispatch(o),i.focus(),e.commands.insertContent(`/`)}var OS=W.create({name:`blockDragHandle`,addProseMirrorPlugins(){let e=this.editor,t=null,n=-1,{container:r,addBtn:i}=ES();return i.addEventListener(`click`,()=>{t&&n>=0&&DS(e,n,t)}),[bS({element:r,editor:e,onNodeChange({node:e,pos:r}){t=e,n=r??-1},computePositionConfig:{placement:`left-start`,strategy:`absolute`,middleware:[nt(({rects:e})=>({mainAxis:10,crossAxis:((e.reference.height<=wS?e.reference.height:TS)-CS)/2}))]},nestedOptions:xS(!1)}).plugin]}}),kS=W.create({name:`headingAnchors`,addProseMirrorPlugins(){return[new Fe({props:{decorations(e){let t=[],n=new Map;return e.doc.descendants((e,r)=>{if(e.type.name===`heading`){let i=xe(e.textContent,n);if(!i)return;t.push(Ke.node(r,r+e.nodeSize,{id:i}))}}),ge.create(e.doc,t)}}})]}}),AS=new class{byExt=new Map;register(e){for(let t of e.exts)this.byExt.set(t.toLowerCase(),e)}lookup(e){let t=this.byExt.get(e.toLowerCase());return t?{found:!0,viewer:t}:{found:!1}}clearForTests(){this.byExt.clear()}get size(){return this.byExt.size}};function jS(e){globalThis.window?.open(e,`_blank`,`noopener,noreferrer`)}async function MS(e,t={}){let n=t.registry??AS,r=`desktopBridge`in t?t.desktopBridge:globalThis.window?.okDesktop,i=t.openUrl??jS;if(!e.forceOsDelegation){let t=n.lookup(e.ext);if(t.found){t.viewer.render(e);return}}if(r){let t=await r.shell.openAsset(e.projectRelPath);t.ok||console.warn(`[asset-dispatch] openAsset refused:`,t.reason,{projectRelPath:e.projectRelPath,ext:e.ext});return}i(e.url)}var NS=new Set([`http:`,`https:`,`mailto:`,`tel:`]);function PS(e){try{let t=new URL(e);return NS.has(t.protocol)}catch{return!1}}function FS(e=window.location.hash){let t=e.match(/^#\/([^?#]+)/);return t?decodeURIComponent(t[1]):``}function IS(e,t=window.location.hash){return c(e,FS(t))}function LS({docName:e,anchor:t}){return t?`#/${e}?anchor=${encodeURIComponent(t)}`:`#/${e}`}function RS(e){e.startsWith(`#`)||PS(e)?window.open(e,`_blank`,`noopener,noreferrer`):console.warn(`[safe-nav] blocked non-safe scheme:`,e)}function zS(e){window.location.assign(LS(e))}function BS(e){RS(LS(e))}function VS(e){return e.metaKey||e.ctrlKey}function HS(e,t=window.location.hash){let n=FS(t);if(!n)return;let r=document.getElementById(e);r&&r.scrollIntoView({behavior:`smooth`,block:`start`}),window.location.assign(Ge(n,e))}function US(e,t=window.location.hash){if(e.kind===`doc`){zS(e);return}if(e.kind===`anchor`){HS(e.anchor,t);return}RS(e.url)}function WS(e,t,n=window.location.hash){return ie(FS(n),e,t)}function GS(e,t){let n=e;for(;n&&typeof n.hasAttribute==`function`;){if(n.hasAttribute(`data-wiki-embed`)){let e=n.getAttribute(`data-target`)??``;if(!e)return null;let r=E(e,t);return r?{kind:n.tagName===`IMG`?`image`:`asset`,relPath:r,title:r.split(`/`).pop()??e}:null}if(n.hasAttribute(`data-wiki-link`)){let e=n.getAttribute(`data-target`)??``;return e?{kind:`wiki-link`,relPath:`${e}.md`,title:e}:null}if(n.tagName===`A`&&n.hasAttribute(`href`)){let e=c(n.getAttribute(`href`)??``,t);if(e?.kind===`asset`){let n=E(e.url,t);return n?{kind:`asset`,relPath:n,title:n.split(`/`).pop()??e.url}:null}}if(n.tagName===`IMG`){let e=n.getAttribute(`src`)??``;if(e){let n=c(e,t);if(n?.kind===`asset`){let e=E(n.url,t);return e?{kind:`image`,relPath:e,title:e.split(`/`).pop()??n.url}:null}}}n=n.parentElement}return null}var KS=new Te(`asset-context-menu`);function qS(e){return new Fe({key:KS,view(t){let n=e.showAssetMenu??(e=>{let t=globalThis.window?.okDesktop;return t?t.shell.showAssetMenu({relPath:e.relPath,title:e.title,kind:e.kind}):Promise.resolve()}),r=t=>{if(!(t.target instanceof Element))return;let r=GS(t.target,e.sourceDocName);r&&(t.preventDefault(),n(r))};return t.dom.addEventListener(`contextmenu`,r),{destroy(){t.dom.removeEventListener(`contextmenu`,r)}}}})}var JS=e=>{let t=(0,J.c)(17),{kind:n,ariaLabel:r,onDeactivate:i,children:a,triggerReference:o,layout:s,className:c,"data-slot":l}=e,u=s===void 0?`standard`:s,d=(0,K.useRef)(null),p,m;t[0]===o?(p=t[1],m=t[2]):(p=()=>{let e=d.current;if(e)return F(o,e,()=>{b(o,e,{placement:`bottom-start`,strategy:`fixed`,middleware:[nt(8),T(),f({padding:8})]}).then(t=>{let{x:n,y:r}=t;e.isConnected&&(e.style.left=`${n}px`,e.style.top=`${r}px`)}).catch(YS)})},m=[o],t[0]=o,t[1]=p,t[2]=m),(0,K.useLayoutEffect)(p,m);let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h={position:`fixed`,left:`-9999px`,top:`-9999px`},t[3]=h):h=t[3];let g=u===`wide`?`w-[min(720px,calc(100%-1rem))]`:`w-80`,_;t[4]!==c||t[5]!==g?(_=ht(`ok-interaction-prop-panel pointer-events-auto z-40 rounded-md border border-border bg-popover p-3 shadow-lg`,g,c),t[4]=c,t[5]=g,t[6]=_):_=t[6];let v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,q.jsx)(bt,{className:`size-3.5`,"aria-hidden":`true`}),t[7]=v):v=t[7];let y;t[8]===i?y=t[9]:(y=(0,q.jsx)(_t,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:i,className:`absolute right-1 top-1 size-7`,children:v}),t[8]=i,t[9]=y);let x;return t[10]!==r||t[11]!==a||t[12]!==l||t[13]!==n||t[14]!==_||t[15]!==y?(x=(0,q.jsxs)(`div`,{ref:d,role:`dialog`,"aria-label":r,"data-ok-prop-panel":n,"data-slot":l,style:h,className:_,children:[a,y]}),t[10]=r,t[11]=a,t[12]=l,t[13]=n,t[14]=_,t[15]=y,t[16]=x):x=t[16],x};function YS(){}function XS(e,t){let n=[e,...t.fallbackTargets??[]],r=new Set,i=null;for(let e of n){if(r.has(e))continue;r.add(e);let n=ye(e,{pages:t.pages,folderPaths:t.folderPaths,pagesBySlug:t.pagesBySlug});if(n.kind===`missing`){i??=n;continue}return{kind:`navigate`,displayState:n.kind===`folder`?`folder`:`resolved`,resolvedTarget:n,hashDocName:n.target}}let a=i??ye(e,{pages:t.pages,folderPaths:t.folderPaths,pagesBySlug:t.pagesBySlug});if(a.kind!==`missing`)return{kind:`navigate`,displayState:a.kind===`folder`?`folder`:`resolved`,resolvedTarget:a,hashDocName:a.target};let o=t.createDialogSeed??Pe(a.target);return{kind:`create`,displayState:`missing`,resolvedTarget:a,initialDir:o.initialDir,suggestedName:o.suggestedName}}function ZS(e){if(e.kind!==`navigate`||e.displayState!==`folder`)return null;let t=e.resolvedTarget;return`folderPath`in t?{initialDir:t.folderPath,suggestedName:`index.md`}:null}function QS(e){let t=(0,J.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,type:a,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===n?o=t[6]:(o=ht(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[5]=n,t[6]=o);let s;return t[7]!==r||t[8]!==i||t[9]!==o||t[10]!==a?(s=(0,q.jsx)(`input`,{type:a,ref:i,"data-slot":`input`,className:o,...r}),t[7]=r,t[8]=i,t[9]=o,t[10]=a,t[11]=s):s=t[11],s}var $S=[`.md`,`.mdx`];function eC(e){let t=e.toLowerCase();for(let e of $S)if(t.endsWith(e))return e;return null}function tC(e){let t=eC(e);return t?e.slice(0,-t.length):e}function nC(e){return e.trim()?e.includes(`..`)?`Path cannot contain ".."`:e.startsWith(`/`)?`Path cannot start with "/"`:e.includes(`\\`)?`Path cannot contain backslashes`:e.includes(`\0`)?`Path cannot contain null bytes`:null:`Name cannot be empty`}function rC(e){let t=e.fileName.trim(),n=eC(t)?t:`${t}${e.fileExtension??`.md`}`;if(e.kind===`folder`){let t=(e.folderName??``).trim();return`${e.initialDir?`${e.initialDir}/${t}`:t}/${n}`}return e.initialDir?`${e.initialDir}/${n}`:n}function iC(e){let t=e.target;return t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.isContentEditable?!1:!!((e.metaKey||e.ctrlKey)&&e.altKey&&e.key.toLowerCase()===`n`)}function aC(e){let t=e.value.lastIndexOf(`.`);t>0?e.setSelectionRange(0,t):e.select()}function oC(e){let t=(0,J.c)(96),{open:n,onOpenChange:r,kind:i,initialDir:a,suggestedName:o,description:s,onCreated:c}=e,{addPage:l}=De(),[u,d]=(0,K.useState)(``),[f,p]=(0,K.useState)(``),[m,h]=(0,K.useState)(`.md`),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(null),S=(0,K.useId)(),C=(0,K.useId)(),w=(0,K.useId)(),T=(0,K.useRef)(null),E=(0,K.useRef)(null),D,O;t[0]!==i||t[1]!==n||t[2]!==o?(D=()=>{if(n){_(null),x(null),y(!1),p(``);let e=i===`file`?o??`untitled`:`index`,t=eC(e);h(t??`.md`),d(t?tC(e):e)}},O=[n,i,o],t[0]=i,t[1]=n,t[2]=o,t[3]=D,t[4]=O):(D=t[3],O=t[4]),(0,K.useEffect)(D,O);let k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(k=function(e){let t=eC(e);t?(h(t),d(tC(e))):d(e),_(null)},t[5]=k):k=t[5];let A=k,j;t[6]!==m||t[7]!==u||t[8]!==f||t[9]!==a||t[10]!==i?(j=function(){return rC({kind:i,initialDir:a,fileName:u,fileExtension:m,folderName:f})},t[6]=m,t[7]=u,t[8]=f,t[9]=a,t[10]=i,t[11]=j):j=t[11];let M=j,N;t[12]!==u||t[13]!==f||t[14]!==i?(N=function(){if(i===`folder`){let e=nC(f.trim());if(e)return{message:`Folder name: ${e}`,field:`folder`}}let e=nC(u.trim());return e?{message:e,field:`file`}:null},t[12]=u,t[13]=f,t[14]=i,t[15]=N):N=t[15];let P=N,F;t[16]!==v||t[17]!==u||t[18]!==f||t[19]!==i?(F=v||!u.trim()||i===`folder`&&!f.trim(),t[16]=v,t[17]=u,t[18]=f,t[19]=i,t[20]=F):F=t[20];let I=F,L;t[21]!==l||t[22]!==M||t[23]!==P||t[24]!==i||t[25]!==c||t[26]!==r?(L=async function(){let e=P();if(e){_(e.message),x(e.field);return}y(!0),_(null),x(null);let t=M();try{let e=await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:t})});if(!e.ok){let t=`Server error (HTTP ${e.status})`;try{let n=await e.json();n?.error&&(t=n.error)}catch{}y(!1),_(t),x(`form`);return}let n=await e.json();if(y(!1),!n.ok){_(n.error??`Failed to create ${i}`),x(`form`);return}let a=n.docName??t.replace(/\.(mdx|md)$/,``);r(!1),window.location.hash=`#/${a}`,l(a),se([`files`,`backlinks`,`graph`]),c?.(a)}catch(e){console.warn(`[NewItemDialog] create failed:`,e),y(!1),_(`Network error — please try again`),x(`form`)}},t[21]=l,t[22]=M,t[23]=P,t[24]=i,t[25]=c,t[26]=r,t[27]=L):L=t[27];let R=L,z=a||`(root)`,B=i===`file`?`New file`:`New folder`,V;t[28]===B?V=t[29]:(V=(0,q.jsx)(Ct,{children:B}),t[28]=B,t[29]=V);let H;t[30]!==s||t[31]!==z?(H=s??(0,q.jsxs)(q.Fragment,{children:[`Create in `,(0,q.jsx)(`span`,{className:`font-medium text-foreground`,children:z})]}),t[30]=s,t[31]=z,t[32]=H):H=t[32];let U;t[33]===H?U=t[34]:(U=(0,q.jsx)(St,{children:H}),t[33]=H,t[34]=U);let ee;t[35]!==U||t[36]!==V?(ee=(0,q.jsxs)(Nt,{children:[V,U]}),t[35]=U,t[36]=V,t[37]=ee):ee=t[37];let te;t[38]!==g||t[39]!==b||t[40]!==S||t[41]!==C||t[42]!==f||t[43]!==i?(te=i===`folder`&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:C,children:`Folder name`}),(0,q.jsx)(QS,{ref:E,id:C,value:f,onChange:e=>{p(e.target.value),_(null)},placeholder:`folder-name`,autoFocus:!0,"aria-describedby":g&&(b===`folder`||b===`form`)?S:void 0,"aria-invalid":g&&(b===`folder`||b===`form`)?!0:void 0,onKeyDown:e=>{if(e.key===`Enter`){e.preventDefault();let t=nC(f.trim());if(t){_(`Folder name: ${t}`),x(`folder`);return}T.current?.focus()}}})]}),t[38]=g,t[39]=b,t[40]=S,t[41]=C,t[42]=f,t[43]=i,t[44]=te):te=t[44];let ne=i===`folder`?`First file name`:`File name`,re;t[45]!==w||t[46]!==ne?(re=(0,q.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:w,children:ne}),t[45]=w,t[46]=ne,t[47]=re):re=t[47];let W;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>A(e.target.value),t[48]=W):W=t[48];let ie=i===`file`,ae=g&&(b===`file`||b===`form`)?S:void 0,oe=g&&(b===`file`||b===`form`)?!0:void 0,ce;t[49]!==R||t[50]!==I?(ce=e=>{e.key===`Enter`&&!I&&R()},t[49]=R,t[50]=I,t[51]=ce):ce=t[51];let le;t[52]!==w||t[53]!==u||t[54]!==ie||t[55]!==ae||t[56]!==oe||t[57]!==ce?(le=(0,q.jsx)(QS,{ref:T,id:w,value:u,onChange:W,placeholder:`my-note`,autoFocus:ie,"aria-describedby":ae,"aria-invalid":oe,onFocus:cC,onKeyDown:ce,className:`flex-1`}),t[52]=w,t[53]=u,t[54]=ie,t[55]=ae,t[56]=oe,t[57]=ce,t[58]=le):le=t[58];let ue;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>{(e===`.md`||e===`.mdx`)&&h(e)},t[59]=ue):ue=t[59];let de;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(de=$S.map(sC),t[60]=de):de=t[60];let fe;t[61]===m?fe=t[62]:(fe=(0,q.jsx)(Ue,{type:`single`,value:m,onValueChange:ue,variant:`outline`,size:`sm`,"aria-label":`File extension`,className:`shrink-0`,children:de}),t[61]=m,t[62]=fe);let pe;t[63]!==le||t[64]!==fe?(pe=(0,q.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[le,fe]}),t[63]=le,t[64]=fe,t[65]=pe):pe=t[65];let me;t[66]!==g||t[67]!==S?(me=g&&(0,q.jsx)(`p`,{id:S,role:`alert`,className:`text-xs text-red-600 dark:text-red-400`,children:g}),t[66]=g,t[67]=S,t[68]=me):me=t[68];let he;t[69]!==re||t[70]!==pe||t[71]!==me?(he=(0,q.jsxs)(`div`,{children:[re,pe,me]}),t[69]=re,t[70]=pe,t[71]=me,t[72]=he):he=t[72];let ge;t[73]!==te||t[74]!==he?(ge=(0,q.jsx)(At,{children:(0,q.jsxs)(`div`,{className:`space-y-3`,children:[te,he]})}),t[73]=te,t[74]=he,t[75]=ge):ge=t[75];let _e;t[76]===r?_e=t[77]:(_e=()=>r(!1),t[76]=r,t[77]=_e);let ve;t[78]!==v||t[79]!==_e?(ve=(0,q.jsx)(_t,{variant:`outline`,className:`font-mono uppercase`,onClick:_e,disabled:v,children:`Cancel`}),t[78]=v,t[79]=_e,t[80]=ve):ve=t[80];let ye=v?`Creating...`:`Create`,be;t[81]!==R||t[82]!==I||t[83]!==ye?(be=(0,q.jsx)(_t,{onClick:R,disabled:I,children:ye}),t[81]=R,t[82]=I,t[83]=ye,t[84]=be):be=t[84];let xe;t[85]!==ve||t[86]!==be?(xe=(0,q.jsxs)(jt,{children:[ve,be]}),t[85]=ve,t[86]=be,t[87]=xe):xe=t[87];let Se;t[88]!==ee||t[89]!==ge||t[90]!==xe?(Se=(0,q.jsxs)(Ot,{className:`sm:max-w-md`,"data-ok-layer-spawned":``,children:[ee,ge,xe]}),t[88]=ee,t[89]=ge,t[90]=xe,t[91]=Se):Se=t[91];let Ce;return t[92]!==r||t[93]!==n||t[94]!==Se?(Ce=(0,q.jsx)(Pt,{open:n,onOpenChange:r,children:Se}),t[92]=r,t[93]=n,t[94]=Se,t[95]=Ce):Ce=t[95],Ce}function sC(e){return(0,q.jsx)(Ie,{value:e,"aria-label":`Use ${e} extension`,children:e},e)}function cC(e){return aC(e.currentTarget)}var lC=class{registry=new Map;_activeNodeId=null;listeners=new Set;_snapshot={activeNodeId:null,active:null};register(e){this.registry.set(e.nodeId,e),this._activeNodeId===e.nodeId&&this.refreshSnapshot()}deregister(e){this.registry.delete(e)&&this._activeNodeId===e&&(this._activeNodeId=null,this.refreshSnapshot())}setActiveNode(e){this._activeNodeId!==e&&(e!==null&&!this.registry.has(e)||(this._activeNodeId=e,this.refreshSnapshot()))}getActiveNode(){return this._activeNodeId}getRegistration(e){return this.registry.get(e)}hasRegistration(e){return this.registry.has(e)}clear(){this.registry.clear(),this._activeNodeId=null,this.refreshSnapshot()}getSnapshot=()=>this._snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});refreshSnapshot(){let e=this._activeNodeId==null?null:this.registry.get(this._activeNodeId)??null;this._snapshot={activeNodeId:this._activeNodeId,active:e};for(let e of this.listeners)e()}};function uC(e,t){let n=e??null;for(;n&&typeof n==`object`;){let e=n.getAttribute;if(typeof e==`function`){let r=e.call(n,`data-mark-id`);if(r&&t.hasRegistration(r))return r;let i=e.call(n,`data-node-id`);if(i&&t.hasRegistration(i))return i}n=n.parentElement??null}return null}var dC=e=>{let t=(0,J.c)(18),{store:n}=e,r;t[0]===n?r=t[1]:(r=()=>n.getSnapshot(),t[0]=n,t[1]=r);let[i,a]=(0,K.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>(a(n.getSnapshot()),n.subscribe(()=>{a(n.getSnapshot())})),s=[n],t[2]=n,t[3]=o,t[4]=s),(0,K.useEffect)(o,s);let{active:c}=i;if(!c)return null;let l;t[5]===n?l=t[6]:(l=()=>n.setActiveNode(null),t[5]=n,t[6]=l);let u,d,f;if(t[7]!==c.controls||t[8]!==c.nodeId||t[9]!==c.type||t[10]!==l){let e={nodeId:c.nodeId,type:c.type,deactivate:l};u=c.controls.propPanel?.(e),d=c.controls.toolbar?.(e),f=c.controls.breadcrumb?.(e),t[7]=c.controls,t[8]=c.nodeId,t[9]=c.type,t[10]=l,t[11]=u,t[12]=d,t[13]=f}else u=t[11],d=t[12],f=t[13];let p;return t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,q.jsxs)(q.Fragment,{children:[u,d,f]}),t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p};function fC(e){return e.editorView?.dom??e.view?.dom??null}function pC(e,t){let n=e;for(;n;){if(n.getAttribute?.(`data-mark-id`)===t||n.getAttribute?.(`data-node-id`)===t)return!0;n=n.parentElement}return!1}function mC(e){let{editor:t}=e,n=new lC,r=fC(t),i=!1,a=null,o=n.subscribe(()=>{let e=n.getActiveNode();if(e!==null){if(typeof document<`u`){let t=document.activeElement;a=t&&pC(t,e)?t:null}return}if(typeof document>`u`)return;let i=a;if(a=null,i&&document.contains(i)&&typeof i.focus==`function`){try{i.focus({preventScroll:!0})}catch{}return}let o=r??fC(t);if(o&&typeof o.focus==`function`)try{o.focus({preventScroll:!0})}catch{}}),s=e=>{let t=e;if(t.button===2)return;if(t.metaKey||t.ctrlKey||t.button===1){t.button===1&&t.preventDefault?.();return}let r=uC(e.target,n);if(r===null)return;let i=n.getRegistration(r);i?.handlePrimary&&i.handlePrimary({nodeId:r,type:i.type,newTab:!1})||n.setActiveNode(r)},c=e=>{let t=e;if(t.button===2||t.type===`click`&&t.button===1||!(t.metaKey||t.ctrlKey||t.button===1))return;let r=uC(e.target,n);if(r===null)return;let i=n.getRegistration(r);i?.handlePrimary&&i.handlePrimary({nodeId:r,type:i.type,newTab:!0})&&t.preventDefault?.()},l=e=>{let t=e;if(t.key===`Escape`){n.getActiveNode()!==null&&(n.setActiveNode(null),t.preventDefault?.());return}if(t.key!==`Enter`&&t.key!==` `&&t.key!==`Spacebar`)return;let r=uC(e.target,n);if(r===null)return;let i=n.getRegistration(r);t.preventDefault?.(),!(i?.handlePrimary&&i.handlePrimary({nodeId:r,type:i.type,newTab:!1}))&&n.setActiveNode(r)},u=e=>{if(n.getActiveNode()===null)return;let t=e.target;t&&(r?.contains(t)||t instanceof Element&&(t.closest(`[data-ok-interaction-layer]`)||t.closest(`[data-ok-prop-panel]`)||t.closest(`[data-ok-layer-spawned]`))||n.setActiveNode(null))},d=()=>{i||(r=fC(t),r&&(r.addEventListener(`pointerdown`,s,!0),r.addEventListener(`click`,c,!0),r.addEventListener(`auxclick`,c,!0),r.addEventListener(`keydown`,l,!0),typeof document<`u`&&document.addEventListener(`pointerdown`,u,!0),i=!0))},f=()=>{i&&=(r?.removeEventListener(`pointerdown`,s,!0),r?.removeEventListener(`click`,c,!0),r?.removeEventListener(`auxclick`,c,!0),r?.removeEventListener(`keydown`,l,!0),typeof document<`u`&&document.removeEventListener(`pointerdown`,u,!0),!1)};return d(),{register(e){n.register(e),i||d()},deregister(e){n.deregister(e)},setActiveNode(e){n.setActiveNode(e)},getActiveNode(){return n.getActiveNode()},getRegistration(e){return n.getRegistration(e)},destroy(){f(),o(),n.clear()},store:n}}var hC=e=>{let t=(0,J.c)(2),{store:n}=e,r;return t[0]===n?r=t[1]:(r=(0,q.jsx)(`div`,{"data-ok-interaction-layer":``,className:`contents`,children:(0,q.jsx)(dC,{store:n})}),t[0]=n,t[1]=r),r},gC=new WeakMap;function _C(e){let t=gC.get(e);if(t)return t;let n=mC({editor:e});return gC.set(e,n),e.on(`destroy`,()=>{n.destroy(),gC.delete(e)}),n}var vC=new Te(`markIdentity`);function yC(){return{byId:new Map,counter:0}}function bC(e,t,n,r,i){let a=[];for(let e of t.byId.values()){let t=i?i.map(e.from,-1):e.from,n=i?i.map(e.to,1):e.to;n<=t||a.push({id:e.id,markType:e.markType,attrs:e.attrs,from:t,to:n})}let o=new Map,s=new Set,c=t.counter;return e.descendants((e,t)=>{if(!(!e.isInline||e.marks.length===0))for(let i of e.marks){if(!n.has(i.type.name)||r&&!r(i))continue;let l=null;for(let e of a)if(!s.has(e.id)&&e.markType===i.type.name&&xC(e.attrs,i.attrs)&&!(t<e.from||t>=e.to)){l=e.id;break}let u=l??`m${++c}`;s.add(u);let d=t,f=t+e.nodeSize,p=o.get(u);p?p.to=Math.max(p.to,f):o.set(u,{id:u,markType:i.type.name,attrs:i.attrs,from:d,to:f})}}),{byId:o,counter:c}}function xC(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(n!==i&&!(typeof n==`object`&&n&&typeof i==`object`&&i&&xC(n,i)))return!1}return!0}function SC(e,t,n,r){let i=new Set(t.byId.keys());for(let[r,i]of t.byId)e.has(r)||n?.(i);for(let t of e)i.has(t)||r?.(t);return i}function CC(e){let{markTypes:t,predicate:n,onRegister:r,onDeregister:i}=e,a=new Set(t);return new Fe({key:vC,state:{init(e,t){return bC(t.doc,yC(),a,n)},apply(e,t,r,i){return e.docChanged?bC(i.doc,t,a,n,e.mapping):t}},view(){let e=new Set;return{update(t){let n=vC.getState(t.state);n&&(e=SC(e,n,r,i))},destroy(){for(let t of e)i?.(t);e=new Set}}}})}function wC(e,t){return vC.getState(e)?.byId.get(t)??null}function TC(e){let{editor:t,layer:n,renderPropPanel:r,handlePrimary:i}=e;return{onRegister:e=>{n.register({type:e.markType,nodeId:e.id,controls:{propPanel:e=>r({editor:t,nodeId:e.nodeId,deactivate:e.deactivate})},handlePrimary:i?e=>i({editor:t,nodeId:e.nodeId,newTab:e.newTab}):void 0})},onDeregister:e=>{n.deregister(e)}}}function EC(e){let{editor:t,layer:n,markTypes:r,predicate:i,renderPropPanel:a,handlePrimary:o}=e,s=TC({editor:t,layer:n,renderPropPanel:a,handlePrimary:o});return CC({markTypes:[...r],predicate:i,onRegister:s.onRegister,onDeregister:s.onDeregister})}function DC(e){let t=_C(e.editor);return EC({...e,layer:t})}function OC(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=l(t),u=RegExp(`\\s${c}$`),d=a?`^`:``,f=r?``:c,p=RegExp(s?`${d}${c}.*?(?=\\s${f}|$)`:`${d}(?:^)?${c}[^\\s${f}]*`,`gm`),m=o.nodeBefore?.isText&&o.nodeBefore.text;if(!m)return null;let h=o.pos-m.length,g=Array.from(m.matchAll(p)).pop();if(!g||g.input===void 0||g.index===void 0)return null;let _=g.input.slice(Math.max(0,g.index-1),g.index),v=RegExp(`^[${i?.join(``)}\0]?$`).test(_);if(i!==null&&!v)return null;let y=h+g.index,b=y+g[0].length;return s&&u.test(m.slice(b-1,b+1))&&(g[0]+=` `,b+=1),y<o.pos&&b>=o.pos?{range:{from:y,to:b},query:g[0].slice(t.length),text:g[0]}:null}function kC(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
|
|
7
|
-
`);return/\s/.test(n)}):!1}var AC=new Te(`suggestion`);function jC({pluginKey:e=AC,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:h=OC,shouldShow:g,shouldResetDismissed:_}){let v,y=p?.(),b=r&&!i,x=()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=t.view.coordsAtPos(e);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}},S=(n,r)=>r?()=>{let r=e.getState(t.state)?.decorationId;return n.dom.querySelector(`[data-decoration-id="${r}"]`)?.getBoundingClientRect()||null}:x,C=({match:e,dismissedRange:n,state:r,transaction:i})=>_?.({editor:t,state:r,range:n,match:e,transaction:i,allowSpaces:b})?!1:b?e.range.from===n.from:e.range.from===n.from&&!kC(i);function w(n,r){var i;try{let r=e.getState(n.state),a=r?.decorationId?n.dom.querySelector(`[data-decoration-id="${r.decorationId}"]`):null,o={editor:t,range:r?.range||{from:0,to:0},query:r?.query||null,text:r?.text||null,items:[],command:e=>d({editor:t,range:r?.range||{from:0,to:0},props:e}),decorationNode:a,clientRect:S(n,a)};(i=y?.onExit)==null||i.call(y,o)}catch{}let a=n.state.tr.setMeta(r,{exit:!0});n.dispatch(a)}let T=new Fe({key:e,view(){return{update:async(e,n)=>{var r,i,a,o,s;let c=this.key?.getState(n),l=this.key?.getState(e.state),u=c.active&&l.active&&c.range.from!==l.range.from,p=!c.active&&l.active,m=c.active&&!l.active,h=!p&&!m&&c.query!==l.query,g=p||u&&h,_=h||u,b=m||u&&h;if(!g&&!_&&!b)return;let x=b&&!g?c:l,C=e.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);v={editor:t,range:x.range,query:x.query,text:x.text,items:[],command:e=>d({editor:t,range:x.range,props:e}),decorationNode:C,clientRect:S(e,C)},g&&((r=y?.onBeforeStart)==null||r.call(y,v)),_&&((i=y?.onBeforeUpdate)==null||i.call(y,v)),(_||g)&&(v.items=await f({editor:t,query:x.query})),b&&((a=y?.onExit)==null||a.call(y,v)),_&&((o=y?.onUpdate)==null||o.call(y,v)),g&&((s=y?.onStart)==null||s.call(y,v))},destroy:()=>{var e;v&&((e=y?.onExit)==null||e.call(y,v))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(s,c,l,u){let{isEditable:d}=t,{composing:f}=t.view,{selection:p}=s,{empty:_,from:v}=p,y={...c},b=s.getMeta(e);if(b&&b.exit)return y.active=!1,y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null,y.dismissedRange=c.active?{...c.range}:c.dismissedRange,y;if(y.composing=f,s.docChanged&&y.dismissedRange!==null&&(y.dismissedRange={from:s.mapping.map(y.dismissedRange.from),to:s.mapping.map(y.dismissedRange.to)}),d&&(_||t.view.composing)){(v<c.range.from||v>c.range.to)&&!f&&!c.composing&&(y.active=!1);let e=h({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:p.$from}),l=`id_${Math.floor(Math.random()*4294967295)}`;e&&m({editor:t,state:u,range:e.range,isActive:c.active})&&(!g||g({editor:t,range:e.range,query:e.query,text:e.text,transaction:s}))?(y.dismissedRange!==null&&!C({match:e,dismissedRange:y.dismissedRange,state:u,transaction:s})&&(y.dismissedRange=null),y.dismissedRange===null?(y.active=!0,y.decorationId=c.decorationId?c.decorationId:l,y.range=e.range,y.query=e.query,y.text=e.text):y.active=!1):(e||(y.dismissedRange=null),y.active=!1)}else y.active=!1;return y.active||(y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null),y}},props:{handleKeyDown(t,n){var r;let{active:i,range:a}=T.getState(t.state);if(!i)return!1;if(n.key===`Escape`||n.key===`Esc`){let i=T.getState(t.state);return(r=y?.onKeyDown)==null||r.call(y,{view:t,event:n,range:i.range}),w(t,e),!0}return(y?.onKeyDown)?.call(y,{view:t,event:n,range:a})||!1},decorations(e){let{active:t,range:n,decorationId:r,query:i}=T.getState(e);if(!t)return null;let a=!i?.length,o=[c];return a&&o.push(u),ge.create(e.doc,[Ke.inline(n.from,n.to,{nodeName:s,class:o.join(` `),"data-decoration-id":r,"data-decoration-content":l})])}}});return T}var MC=jC,NC=e(t(((e,t)=>{((e,n)=>{typeof define==`function`&&define.amd?define([],n):typeof t==`object`&&t.exports?t.exports=n():e.fuzzysort=n()})(e,e=>{var t=(e,t)=>{if(!e||!t)return F;var n=p(e);j(t)||(t=f(t));var r=n.bitflags;return(r&t._bitflags)===r?h(n,t):F},n=(e,t,n)=>{if(!e)return n?.all?m(t,n):P;var r=p(e),i=r.bitflags,a=r.containsSpace,o=u(n?.threshold||0),c=n?.limit||M,l=0,d=0,g=t.length;function _(e){l<c?(L.add(e),++l):(++d,e._score>L.peek()._score&&L.replaceTop(e))}if(n?.key)for(var v=n.key,y=0;y<g;++y){var b=t[y],x=A(b,v);if(x&&(j(x)||(x=f(x)),(i&x._bitflags)===i)){var S=h(r,x);S!==F&&(S._score<o||(S.obj=b,_(S)))}}else if(n?.keys){var C=n.keys,w=C.length;outer:for(var y=0;y<g;++y){for(var b=t[y],T=0,R=0;R<w;++R){var v=C[R],x=A(b,v);if(!x){O[R]=I;continue}j(x)||(x=f(x)),O[R]=x,T|=x._bitflags}if((i&T)===i){if(a)for(let e=0;e<r.spaceSearches.length;e++)E[e]=N;for(var R=0;R<w;++R){if(x=O[R],x===I){k[R]=I;continue}if(k[R]=h(r,x,!1,a),k[R]===F){k[R]=I;continue}if(a)for(let e=0;e<r.spaceSearches.length;e++){if(D[e]>-1e3&&E[e]>N){var z=(E[e]+D[e])/4;z>E[e]&&(E[e]=z)}D[e]>E[e]&&(E[e]=D[e])}}if(a){for(let e=0;e<r.spaceSearches.length;e++)if(E[e]===N)continue outer}else{var B=!1;for(let e=0;e<w;e++)if(k[e]._score!==N){B=!0;break}if(!B)continue}var V=new s(w);for(let e=0;e<w;e++)V[e]=k[e];if(a){var H=0;for(let e=0;e<r.spaceSearches.length;e++)H+=E[e]}else{var H=N;for(let e=0;e<w;e++){var S=V[e];if(S._score>-1e3&&H>N){var z=(H+S._score)/4;z>H&&(H=z)}S._score>H&&(H=S._score)}}if(V.obj=b,V._score=H,n?.scoreFn){if(H=n.scoreFn(V),!H)continue;H=u(H),V._score=H}H<o||_(V)}}}else for(var y=0;y<g;++y){var x=t[y];if(x&&(j(x)||(x=f(x)),(i&x._bitflags)===i)){var S=h(r,x);S!==F&&(S._score<o||_(S))}}if(l===0)return P;for(var U=Array(l),y=l-1;y>=0;--y)U[y]=L.poll();return U.total=l+d,U},r=(e,t=`<b>`,n=`</b>`)=>{for(var r=typeof t==`function`?t:void 0,i=e.target,a=i.length,o=e.indexes,s=``,c=0,l=0,u=!1,d=[],f=0;f<a;++f){var p=i[f];if(o[l]===f){if(++l,u||(u=!0,r?(d.push(s),s=``):s+=t),l===o.length){r?(s+=p,d.push(r(s,c++)),s=``,d.push(i.substr(f+1))):s+=p+n+i.substr(f+1);break}}else u&&(u=!1,r?(d.push(r(s,c++)),s=``):s+=n);s+=p}return r?d:s},i=e=>{typeof e==`number`?e=``+e:typeof e!=`string`&&(e=``);var t=v(e);return c(e,{_targetLower:t._lower,_targetLowerCodes:t.lowerCodes,_bitflags:t.bitflags})},a=()=>{x.clear(),S.clear()};class o{get indexes(){return this._indexes.slice(0,this._indexes.len).sort((e,t)=>e-t)}set indexes(e){return this._indexes=e}highlight(e,t){return r(this,e,t)}get score(){return l(this._score)}set score(e){this._score=u(e)}}class s extends Array{get score(){return l(this._score)}set score(e){this._score=u(e)}}var c=(e,t)=>{let n=new o;return n.target=e,n.obj=t.obj??F,n._score=t._score??N,n._indexes=t._indexes??[],n._targetLower=t._targetLower??``,n._targetLowerCodes=t._targetLowerCodes??F,n._nextBeginningIndexes=t._nextBeginningIndexes??F,n._bitflags=t._bitflags??0,n},l=e=>e===N?0:e>1?e:Math.E**(((-e+1)**.04307-1)*-2),u=e=>e===0?N:e>1?e:1-(Math.log(e)/-2+1)**(1/.04307),d=e=>{typeof e==`number`?e=``+e:typeof e!=`string`&&(e=``),e=e.trim();var t=v(e),n=[];if(t.containsSpace){var r=e.split(/\s+/);r=[...new Set(r)];for(var i=0;i<r.length;i++)if(r[i]!==``){var a=v(r[i]);n.push({lowerCodes:a.lowerCodes,_lower:r[i].toLowerCase(),containsSpace:!1})}}return{lowerCodes:t.lowerCodes,_lower:t._lower,containsSpace:t.containsSpace,bitflags:t.bitflags,spaceSearches:n}},f=e=>{if(e.length>999)return i(e);var t=x.get(e);return t===void 0?(t=i(e),x.set(e,t),t):t},p=e=>{if(e.length>999)return d(e);var t=S.get(e);return t===void 0?(t=d(e),S.set(e,t),t):t},m=(e,t)=>{var n=[];n.total=e.length;var r=t?.limit||M;if(t?.key)for(var i=0;i<e.length;i++){var a=e[i],o=A(a,t.key);if(o!=F){j(o)||(o=f(o));var l=c(o.target,{_score:o._score,obj:a});if(n.push(l),n.length>=r)return n}}else if(t?.keys)for(var i=0;i<e.length;i++){for(var a=e[i],u=new s(t.keys.length),d=t.keys.length-1;d>=0;--d){var o=A(a,t.keys[d]);if(!o){u[d]=I;continue}j(o)||(o=f(o)),o._score=N,o._indexes.len=0,u[d]=o}if(u.obj=a,u._score=N,n.push(u),n.length>=r)return n}else for(var i=0;i<e.length;i++){var o=e[i];if(o!=F&&(j(o)||(o=f(o)),o._score=N,o._indexes.len=0,n.push(o),n.length>=r))return n}return n},h=(e,t,n=!1,r=!1)=>{if(n===!1&&e.containsSpace)return g(e,t,r);for(var i=e._lower,a=e.lowerCodes,s=a[0],c=t._targetLowerCodes,l=a.length,u=c.length,d=0,f=0,p=0;;){var m=s===c[f];if(m){if(C[p++]=f,++d,d===l)break;s=a[d]}if(++f,f>=u)return F}var d=0,h=!1,_=0,v=t._nextBeginningIndexes;v===F&&(v=t._nextBeginningIndexes=b(t.target)),f=C[0]===0?0:v[C[0]-1];var y=0;if(f!==u)for(;;)if(f>=u){if(d<=0||(++y,y>200))break;--d;var x=w[--_];f=v[x]}else{var m=a[d]===c[f];if(m){if(w[_++]=f,++d,d===l){h=!0;break}++f}else f=v[f]}var S=l<=1?-1:t._targetLower.indexOf(i,C[0]),T=!!~S,E=T?S===0||t._nextBeginningIndexes[S-1]===S:!1;if(T&&!E){for(var D=0;D<v.length;D=v[D])if(!(D<=S)){for(var O=0;O<l&&a[O]===t._targetLowerCodes[D+O];O++);if(O===l){S=D,E=!0;break}}}var k=e=>{for(var t=0,n=0,r=1;r<l;++r)e[r]-e[r-1]!==1&&(t-=e[r],++n);var i=e[l-1]-e[0]-(l-1);if(t-=(12+i)*n,e[0]!==0&&(t-=e[0]*e[0]*.2),!h)t*=1e3;else{for(var a=1,r=v[0];r<u;r=v[r])++a;a>24&&(t*=(a-24)*10)}return t-=(u-l)/2,T&&(t/=1+l*l*1),E&&(t/=1+l*l*1),t-=(u-l)/2,t};if(!h){if(T)for(var D=0;D<l;++D)C[D]=S+D;var A=C,j=k(A)}else if(E){for(var D=0;D<l;++D)C[D]=S+D;var A=C,j=k(C)}else var A=w,j=k(w);t._score=j;for(var D=0;D<l;++D)t._indexes[D]=A[D];t._indexes.len=l;let M=new o;return M.target=t.target,M._score=t._score,M._indexes=t._indexes,M},g=(e,t,n)=>{for(var r=new Set,i=0,a=F,o=0,s=e.spaceSearches,c=s.length,l=0,u=()=>{for(let e=l-1;e>=0;e--)t._nextBeginningIndexes[T[e*2+0]]=T[e*2+1]},d=!1,f=0;f<c;++f){D[f]=N;var p=s[f];if(a=h(p,t),n){if(a===F)continue;d=!0}else if(a===F)return u(),F;if(f!==c-1){var m=a._indexes,g=!0;for(let e=0;e<m.len-1;e++)if(m[e+1]-m[e]!==1){g=!1;break}if(g){var _=m[m.len-1]+1,v=t._nextBeginningIndexes[_-1];for(let e=_-1;e>=0&&v===t._nextBeginningIndexes[e];e--)t._nextBeginningIndexes[e]=_,T[l*2+0]=e,T[l*2+1]=v,l++}}i+=a._score/c,D[f]=a._score/c,a._indexes[0]<o&&(i-=(o-a._indexes[0])*2),o=a._indexes[0];for(var y=0;y<a._indexes.len;++y)r.add(a._indexes[y])}if(n&&!d)return F;u();var b=h(e,t,!0);if(b!==F&&b._score>i){if(n)for(var f=0;f<c;++f)D[f]=b._score/c;return b}n&&(a=t),a._score=i;var f=0;for(let e of r)a._indexes[f++]=e;return a._indexes.len=f,a},_=e=>e.replace(/\p{Script=Latin}+/gu,e=>e.normalize(`NFD`)).replace(/[\u0300-\u036f]/g,``),v=e=>{e=_(e);for(var t=e.length,n=e.toLowerCase(),r=[],i=0,a=!1,o=0;o<t;++o){var s=r[o]=n.charCodeAt(o);if(s===32){a=!0;continue}var c=s>=97&&s<=122?s-97:s>=48&&s<=57?26:s<=127?30:31;i|=1<<c}return{lowerCodes:r,bitflags:i,containsSpace:a,_lower:n}},y=e=>{for(var t=e.length,n=[],r=0,i=!1,a=!1,o=0;o<t;++o){var s=e.charCodeAt(o),c=s>=65&&s<=90,l=c||s>=97&&s<=122||s>=48&&s<=57,u=c&&!i||!a||!l;i=c,a=l,u&&(n[r++]=o)}return n},b=e=>{e=_(e);for(var t=e.length,n=y(e),r=[],i=n[0],a=0,o=0;o<t;++o)i>o?r[o]=i:(i=n[++a],r[o]=i===void 0?t:i);return r},x=new Map,S=new Map,C=[],w=[],T=[],E=[],D=[],O=[],k=[],A=(e,t)=>{var n=e[t];if(n!==void 0)return n;if(typeof t==`function`)return t(e);var r=t;Array.isArray(t)||(r=t.split(`.`));for(var i=r.length,a=-1;e&&++a<i;)e=e[r[a]];return e},j=e=>typeof e==`object`&&typeof e._bitflags==`number`,M=1/0,N=-M,P=[];P.total=0;var F=null,I=i(``),L=(e=>{var t=[],n=0,r={},i=e=>{for(var r=0,i=t[r],a=1;a<n;){var o=a+1;r=a,o<n&&t[o]._score<t[a]._score&&(r=o),t[r-1>>1]=t[r],a=1+(r<<1)}for(var s=r-1>>1;r>0&&i._score<t[s]._score;s=(r=s)-1>>1)t[r]=t[s];t[r]=i};return r.add=(e=>{var r=n;t[n++]=e;for(var i=r-1>>1;r>0&&e._score<t[i]._score;i=(r=i)-1>>1)t[r]=t[i];t[r]=e}),r.poll=(e=>{if(n!==0){var r=t[0];return t[0]=t[--n],i(),r}}),r.peek=(e=>{if(n!==0)return t[0]}),r.replaceTop=(e=>{t[0]=e,i()}),r})();return{single:t,go:n,prepare:i,cleanup:a}})}))(),1);function PC(e){return e.kind===`anchor`?`${e.docName}#${e.slug}`:e.docName}function FC(e){return e.kind===`anchor`?`Heading H${e.level}: ${e.text}`:e.kind===`create`?e.actionLabel:e.title}function IC(e){let t=(0,J.c)(41),{items:n,query:r,selectedIndex:i,onSelect:a,loading:o,error:s,mode:c,pageTarget:l,anchorQuery:u}=e,d=o===void 0?!1:o,f=s===void 0?null:s,p=c===void 0?`page`:c,m=l===void 0?``:l,h=u===void 0?``:u,g=(0,K.useRef)(null),_=(0,K.useId)(),v=i>=0&&i<n.length?`${_}-option-${i}`:void 0,y,b;t[0]===i?(y=t[1],b=t[2]):(y=()=>{let e=g.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(i);t&&t.scrollIntoView({block:`nearest`})},b=[i],t[0]=i,t[1]=y,t[2]=b),(0,K.useEffect)(y,b);let x=LC;if(d){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[3]=e):e=t[3];let n=p===`anchor`?`Loading headings for ${m}…`:`Loading pages…`,r;return t[4]===n?r=t[5]:(r=(0,q.jsx)(`div`,{ref:g,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:e,onMouseDown:x,children:n}),t[4]=n,t[5]=r),r}if(n.length===0){let e;t[6]!==h||t[7]!==f||t[8]!==p||t[9]!==m||t[10]!==r?(e=f??(p===`anchor`?h.trim()?`No headings match "${h.trim()}"`:`No headings in ${m}`:r.trim()?`No pages found for "${r.trim()}"`:`No pages found`),t[6]=h,t[7]=f,t[8]=p,t[9]=m,t[10]=r,t[11]=e):e=t[11];let n=e,i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[12]=i):i=t[12];let a;return t[13]===n?a=t[14]:(a=(0,q.jsx)(`div`,{ref:g,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:i,onMouseDown:x,children:n}),t[13]=n,t[14]=a),a}let S=i>=0&&i<n.length?n[i]:null,C=p===`anchor`?`Heading suggestions`:`Wiki link suggestions`,w;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[15]=w):w=t[15];let T;t[16]===S?T=t[17]:(T=S?FC(S):``,t[16]=S,t[17]=T);let E;t[18]===T?E=t[19]:(E=(0,q.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:T}),t[18]=T,t[19]=E);let D;t[20]===f?D=t[21]:(D=f&&(0,q.jsx)(`div`,{className:`rounded-md px-2 py-1.5 text-xs text-amber-700 dark:text-amber-300`,children:f}),t[20]=f,t[21]=D);let O;t[22]!==p||t[23]!==m?(O=p===`anchor`&&(0,q.jsx)(`div`,{className:`px-2 py-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:m}),t[22]=p,t[23]=m,t[24]=O):O=t[24];let k;if(t[25]!==n||t[26]!==_||t[27]!==a||t[28]!==i){let e;t[30]!==_||t[31]!==a||t[32]!==i?(e=(e,t)=>{let n=t===i,r=PC(e);return e.kind===`anchor`?(0,q.jsxs)(`button`,{id:`${_}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,style:{paddingLeft:`${(e.level-1)*10+8}px`},onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,q.jsxs)(`span`,{className:`w-6 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.text})]},r):(0,q.jsxs)(`button`,{id:`${_}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full flex-col rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.kind===`create`?e.actionLabel:e.title}),e.kind===`page`&&e.title!==e.docName&&(0,q.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.docName}),e.kind===`create`&&(0,q.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[e.docName,`.md`]})]},r)},t[30]=_,t[31]=a,t[32]=i,t[33]=e):e=t[33],k=n.map(e),t[25]=n,t[26]=_,t[27]=a,t[28]=i,t[29]=k}else k=t[29];let A;return t[34]!==v||t[35]!==E||t[36]!==D||t[37]!==O||t[38]!==k||t[39]!==C?(A=(0,q.jsxs)(`div`,{ref:g,role:`listbox`,"aria-label":C,"aria-activedescendant":v,tabIndex:-1,onMouseDown:x,className:`w-64 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,style:w,children:[E,D,O,k]}),t[34]=v,t[35]=E,t[36]=D,t[37]=O,t[38]=k,t[39]=C,t[40]=A):A=t[40],A}function LC(e){return e.preventDefault()}function RC(e,t){let n=document.createElement(`div`);n.style.position=`fixed`,n.style.zIndex=`50`,n.style.visibility=`hidden`,document.body.appendChild(n);let r={getBoundingClientRect:()=>e()?.clientRect?.()??new DOMRect,get contextElement(){return e()?.editor.view.dom}},i=!1,a=!1,o=()=>{n.isConnected&&(n.style.removeProperty(`--suggestion-menu-max-height`),b(r,n,{placement:`bottom-start`,middleware:[nt(4),T(),f({padding:8}),te({apply({availableHeight:e}){n.isConnected&&n.style.setProperty(`--suggestion-menu-max-height`,`${Math.min(e,window.innerHeight*.4)}px`)}})]}).then(({x:e,y:t})=>{n.isConnected&&(n.style.left=`${e}px`,n.style.top=`${t}px`,i&&!a&&(n.style.removeProperty(`visibility`),a=!0))}).catch(e=>{n.isConnected&&console.warn(`[${t}] computePosition failed`,e)}))};return{popup:n,doPosition:o,startAutoUpdate:()=>F(r,n,o),reveal:()=>{a||(i=!0,o())}}}function zC(e){e.stopAutoUpdate?.(),e.stopAutoUpdate=null,e.popup?.remove(),e.popup=null}var BC=new Te(`wikiLinkSuggestion`),VC=8;function HC(e){let t=e.indexOf(`#`);return t>0?{mode:`anchor`,pageTarget:e.slice(0,t),anchorQuery:e.slice(t+1)}:{mode:`page`,pageTarget:``,anchorQuery:``}}function UC(e,t){return t?NC.default.go(t,e,{keys:[`title`,`docName`],threshold:-1e4}).map(e=>e.obj).slice(0,VC):e.slice(0,VC)}function WC(e,t){return t?NC.default.go(t,e,{key:`text`,threshold:-1e4}).map(e=>e.obj).slice(0,VC):e.slice(0,VC)}function GC(e,t){let n=UC(e,t);if(n.length>0)return n.map(e=>({kind:`page`,...e}));let r=Zy(t);return r?[{kind:`create`,docName:r.target,title:t.trim(),actionLabel:`Insert unresolved link "${t.trim()}"`}]:[]}function KC(e,t,n){return WC(t,n).map(t=>({kind:`anchor`,docName:e,level:t.level,text:t.text,slug:t.slug}))}function qC(e){let{mode:t,pageTarget:n,anchorQuery:r}=HC(e);return t===`anchor`&&n?{target:n,alias:null,anchor:r.trim()||null}:Zy(e)}function JC(e){let{$position:t}=e,n=t.parent.textBetween(0,t.parentOffset,void 0,``),r=n.match(/\[\[([^\]]*)$/);if(!r)return null;let i=r[1];return{range:{from:t.start()+n.lastIndexOf(`[[`),to:t.pos},query:i,text:r[0]}}async function YC(){let e=await fetch(`/api/pages`);if(!e.ok)throw Error(`/api/pages responded with ${e.status}`);let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function XC(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`/api/page-headings responded with ${t.status}`);let n=await t.json();return n.ok&&Array.isArray(n.headings)?n.headings:[]}function ZC(e){let t=[],n=!1,r=!1,i=new Map,a=null,o=null,s=null;return MC({editor:e,pluginKey:BC,char:`[[`,allowedPrefixes:null,findSuggestionMatch:JC,items:async({query:e})=>{let{mode:c,pageTarget:l,anchorQuery:u}=HC(e);if(c===`anchor`){if(!i.has(l)&&a!==l){a=l;try{let e=await XC(l);i.set(l,e),s=null}catch(e){console.error(`[wiki-link-suggestion] Failed to fetch headings:`,e),i.set(l,[]),s=`Failed to load headings for ${l}. Press Escape and type [[ again to retry.`}finally{a=null}}return KC(l,i.get(l)??[],u)}if(!n&&!r){r=!0;try{t=await YC(),o=null}catch(e){console.error(`[wiki-link-suggestion] Failed to fetch pages:`,e),o=`Failed to load pages. Press Escape and type [[ again to retry, or continue typing to insert an unresolved link.`,t=[]}finally{n=!0,r=!1}}return GC(t,e)},command:({editor:e,range:t,props:n})=>{try{let r=null;if(n.kind===`page`?r={target:n.docName,alias:null,anchor:null}:n.kind===`anchor`?r={target:n.docName,alias:null,anchor:n.slug}:n.kind===`create`&&(r=Zy(n.title)),!r)return;e.chain().focus().deleteRange(t).insertContent({type:`wikiLink`,attrs:r}).run()}catch(e){console.error(`[wiki-link-suggestion] command failed`,{item:n,range:t},e)}},render:()=>{let e=null,c=null,l=0,u={popup:null,stopAutoUpdate:null},d=null,f=null,p=e=>{c?.command(e)};function m(e,t,r){let{mode:a,pageTarget:c,anchorQuery:u}=HC(e.query??``),d=t===null?a===`anchor`?!i.has(c):!n:t;return{items:e.items,query:e.query??``,selectedIndex:l,onSelect:r,loading:d,error:a===`page`?o:s,mode:a,pageTarget:c,anchorQuery:u}}let h=t=>{!e||!c||e.updateProps(m(c,t,p))},g=()=>{if(!c)return;let{editor:e,range:t}=c,n=qC(c.query??``);if(n)try{e.chain().focus().deleteRange(t).insertContent({type:`wikiLink`,attrs:n}).run()}catch(e){console.error(`[wiki-link-suggestion] fallback insert error:`,e)}};return{onBeforeStart(t){c=t,l=0;let n=RC(()=>c,`wiki-link-suggestion`);u.popup=n.popup,d=n.doPosition,f=n.reveal,e=new Ya(IC,{props:m(t,!0,p),editor:t.editor}),n.popup.appendChild(e.element),u.stopAutoUpdate=n.startAutoUpdate()},onBeforeUpdate(e){let t=c?HC(c.query??``).mode:null,n=HC(e.query??``).mode;c=e,t!==n&&(l=0,h(!0))},onStart(e){c=e,l=0,h(null),f?.()},onUpdate(e){c=e,l=Math.min(l,Math.max(0,e.items.length-1)),h(null),d?.()},onKeyDown({event:e}){if(!c)return!1;let t=c.items;if(e.key===`ArrowDown`)return t.length===0?!1:(l=(l+1)%t.length,h(null),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(l=(l-1+t.length)%t.length,h(null),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[l];return e?c.command(e):g(),!0}return e.key,!1},onExit(){zC(u),d=null,f=null,e?.destroy(),e=null,c=null,l=0,t=[],i=new Map,o=null,s=null,n=!1,r=!1,a=null}}}})}function QC(e,t){let n=(0,J.c)(4),[r,i]=(0,K.useState)(null),a,o;return n[0]!==e||n[1]!==t?(a=()=>{if(!t||!e){i(null);return}let n=!1;return i(null),XC(e).then(e=>{n||i(e)}).catch(()=>{n||i([])}),()=>{n=!0}},o=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,K.useEffect)(a,o),r}function $C(e,t){let n=e.trim();return n?n.startsWith(`#`)?`anchor`:n.startsWith(`/`)||N(n)?`external`:`doc`:t}function ew(e){return e?.kind===`doc`?`doc`:e?.kind===`anchor`?`anchor`:`external`}function tw(e){let t=(0,J.c)(64),{open:n,href:r,pages:i,onOpenChange:a,onSave:o}=e,[s,c]=(0,K.useState)(``),[l,u]=(0,K.useState)(``),[d,f]=(0,K.useState)(`doc`),p=(0,K.useId)(),m=(0,K.useId)(),h=(0,K.useId)(),g,_;t[0]!==r||t[1]!==n?(g=()=>{if(!n)return;let e=IS(r);if(f(ew(e)),e?.kind===`doc`){c(e.docName),u(e.anchor??``);return}if(e?.kind===`anchor`){c(`#${e.anchor}`),u(``);return}c(e?.kind===`external`?e.url:r),u(``)},_=[r,n],t[0]=r,t[1]=n,t[2]=g,t[3]=_):(g=t[2],_=t[3]),(0,K.useEffect)(g,_);let v,y,b;t[4]!==d||t[5]!==s||t[6]!==i?(v=we(s),y=d===`doc`,b=y&&$y(v,i),t[4]=d,t[5]=s,t[6]=i,t[7]=v,t[8]=y,t[9]=b):(v=t[7],y=t[8],b=t[9]);let x=QC(v,b&&n),S=!!x?.length,C;t[10]!==v||t[11]!==y||t[12]!==l||t[13]!==s||t[14]!==a||t[15]!==o?(C=function(){let e=s.trim();e&&(o(y?WS(v,l.trim()||null):e),a(!1))},t[10]=v,t[11]=y,t[12]=l,t[13]=s,t[14]=a,t[15]=o,t[16]=C):C=t[16];let w=C,T;t[17]===w?T=t[18]:(T=function(e){e.key===`Enter`&&(e.preventDefault(),w())},t[17]=w,t[18]=T);let E=T,D;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,q.jsx)(Tt,{className:`fixed inset-0 z-50 bg-black/40 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`}),t[19]=D):D=t[19];let O,k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,q.jsx)(Dt,{className:`mb-1 text-base font-semibold`,children:`Edit markdown link`}),k=(0,q.jsx)(wt,{className:`mb-4 text-sm text-muted-foreground`,children:`Update the destination and optional section anchor.`}),t[20]=O,t[21]=k):(O=t[20],k=t[21]);let A=y?`Page`:`Link target`,j;t[22]!==A||t[23]!==p?(j=(0,q.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:p,children:A}),t[22]=A,t[23]=p,t[24]=j):j=t[24];let M;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{let t=e.target.value;c(t),f(e=>$C(t,e))},t[25]=M):M=t[25];let N;t[26]!==s||t[27]!==E||t[28]!==p?(N=(0,q.jsx)(QS,{id:p,value:s,onChange:M,placeholder:`guides/install or https://example.com`,autoFocus:!0,onKeyDown:E}),t[26]=s,t[27]=E,t[28]=p,t[29]=N):N=t[29];let P;t[30]===y?P=t[31]:(P=y?(0,q.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:`This changes the destination page. The visible link text stays editable inline in the document.`}):null,t[30]=y,t[31]=P);let F;t[32]!==j||t[33]!==N||t[34]!==P?(F=(0,q.jsxs)(`div`,{children:[j,N,P]}),t[32]=j,t[33]=N,t[34]=P,t[35]=F):F=t[35];let I;t[36]!==m||t[37]!==y||t[38]!==l||t[39]!==E||t[40]!==h||t[41]!==x||t[42]!==S?(I=y?(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:m,children:[`Section`,` `,(0,q.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional heading anchor)`})]}),(0,q.jsx)(QS,{id:m,value:l,onChange:e=>u(e.target.value),placeholder:`heading-slug`,"aria-controls":S?h:void 0,"aria-expanded":S?!0:void 0,"aria-haspopup":S?`listbox`:void 0,onKeyDown:E}),S?(0,q.jsx)(`div`,{role:`listbox`,id:h,"aria-label":`Heading anchors`,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:x.map(e=>(0,q.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":l===e.slug,className:ht(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,l===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>u(l===e.slug?``:e.slug),children:[(0,q.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,q.jsx)(`span`,{className:`truncate`,children:e.text})]},`${e.slug}-${e.level}-${e.text}`))}):null]}):null,t[36]=m,t[37]=y,t[38]=l,t[39]=E,t[40]=h,t[41]=x,t[42]=S,t[43]=I):I=t[43];let L;t[44]!==F||t[45]!==I?(L=(0,q.jsxs)(`div`,{className:`mb-4 space-y-6`,children:[F,I]}),t[44]=F,t[45]=I,t[46]=L):L=t[46];let R;t[47]===a?R=t[48]:(R=(0,q.jsx)(_t,{variant:`outline`,onClick:()=>a(!1),children:`Cancel`}),t[47]=a,t[48]=R);let z;t[49]===s?z=t[50]:(z=s.trim(),t[49]=s,t[50]=z);let B=!z,V;t[51]!==w||t[52]!==B?(V=(0,q.jsx)(_t,{onClick:w,disabled:B,children:`Save`}),t[51]=w,t[52]=B,t[53]=V):V=t[53];let H;t[54]!==R||t[55]!==V?(H=(0,q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[R,V]}),t[54]=R,t[55]=V,t[56]=H):H=t[56];let U;t[57]!==L||t[58]!==H?(U=(0,q.jsxs)(Mt,{children:[D,(0,q.jsxs)(Ft,{"data-slot":`dialog-content`,"data-ok-layer-spawned":``,className:`fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-background p-6 shadow-xl data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,children:[O,k,L,H]})]}),t[57]=L,t[58]=H,t[59]=U):U=t[59];let ee;return t[60]!==a||t[61]!==n||t[62]!==U?(ee=(0,q.jsx)(kt,{open:n,onOpenChange:a,children:U}),t[60]=a,t[61]=n,t[62]=U,t[63]=ee):ee=t[63],ee}function nw(e){let t=(0,J.c)(90),{editor:n,nodeId:r,sourceDocName:i,onClose:a}=e,o=wC(n.state,r),s=o?.attrs?.href??``,[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(null),{folderPaths:p,pages:m,loading:h}=De();if(!o||!s)return null;let g=c(s,i),_=g?.kind===`doc`?`${g.docName}${g.anchor?`#${g.anchor}`:``}`:g?.kind===`anchor`?`#${g.anchor}`:g?.kind===`external`?g.url:s,v;t[0]!==n||t[1]!==r?(v=function(e){let t=wC(n.state,r);t&&n.chain().setTextSelection({from:t.from,to:t.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:e}).run()},t[0]=n,t[1]=r,t[2]=v):v=t[2];let y=v,b;t[3]!==n||t[4]!==r||t[5]!==a?(b=function(){let e=wC(n.state,r);e&&(n.chain().focus().setTextSelection({from:e.from,to:e.to}).extendMarkRange(`link`).unsetLink().run(),a())},t[3]=n,t[4]=r,t[5]=a,t[6]=b):b=t[6];let x=b,S=function(e){if(g){if(g.kind===`asset`){let t=E(g.url,i);if(!t)return;MS({url:g.url,projectRelPath:t,ext:g.ext,title:t.split(`/`).pop()??g.url,forceOsDelegation:e.newTab??!1});return}if(g.kind===`external`){US(g);return}if(g.kind===`anchor`||g.kind===`doc`){let t=g.kind===`doc`?g.docName:i,n=g.anchor??null;e.newTab?BS({docName:t,anchor:n}):window.location.assign(LS({docName:t,anchor:n}))}}},C=function(e){if(d!==`missing`)return;let t=wC(n.state,r);t&&n.chain().setTextSelection({from:t.from,to:t.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:WS(e,g?.kind===`doc`?g.anchor??null:null)}).run()},w,T=!1,D=!1,O=null;if(h){let e;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(nr,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[7]=e):e=t[7],w={icon:e,text:`Loading…`,className:`text-muted-foreground`}}else if(g?.kind===`asset`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Gn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[8]=e):e=t[8],w={icon:e,text:`Asset reference`,className:`text-foreground`}}else if(g?.kind===`external`){let e;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Un,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[9]=e):e=t[9],w={icon:e,text:`External link`,className:`text-foreground`}}else if(g?.kind===`anchor`){let e;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Gn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[10]=e):e=t[10],w={icon:e,text:`Anchor in this page`,className:`text-foreground`}}else if(g?.kind===`doc`){let e=XS(g.docName,{pages:m,folderPaths:p});if(O=ZS(e),D=e.kind===`navigate`&&e.displayState===`folder`,T=e.kind===`create`,D){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Kn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[11]=e):e=t[11],w={icon:e,text:`Folder (no index)`,className:`text-foreground`}}else if(T){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Vn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[12]=e):e=t[12],w={icon:e,text:`Page not found`,className:`text-red-700 dark:text-red-300`}}else{let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Gn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[13]=e):e=t[13],w={icon:e,text:`Page link`,className:`text-foreground`}}}else{let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Vn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[14]=e):e=t[14],w={icon:e,text:`Unrecognized link`,className:`text-muted-foreground`}}let k;t[15]!==n.state||t[16]!==n.view||t[17]!==r?(k=()=>{let e=wC(n.state,r);if(!e)return new DOMRect;try{return pe(n.view,e.from,e.to)}catch{return new DOMRect}},t[15]=n.state,t[16]=n.view,t[17]=r,t[18]=k):k=t[18];let A;t[19]!==n.view.dom||t[20]!==k?(A={getBoundingClientRect:k,contextElement:n.view.dom},t[19]=n.view.dom,t[20]=k,t[21]=A):A=t[21];let j=A,M=ht(`text-sm font-medium`,w.className),N;t[22]!==w.text||t[23]!==M?(N=(0,q.jsx)(`div`,{className:M,children:w.text}),t[22]=w.text,t[23]=M,t[24]=N):N=t[24];let P;t[25]===_?P=t[26]:(P=(0,q.jsx)(`div`,{className:`truncate font-mono text-xs text-muted-foreground`,title:_,children:_}),t[25]=_,t[26]=P);let F;t[27]!==N||t[28]!==P?(F=(0,q.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[N,P]}),t[27]=N,t[28]=P,t[29]=F):F=t[29];let I;t[30]!==S||t[31]!==T||t[32]!==a||t[33]!==g?.kind?(I=T?null:(0,q.jsx)(_t,{size:`sm`,variant:`default`,onClick:()=>{S({}),a()},children:g?.kind===`external`?`Open in new tab`:`Open`}),t[30]=S,t[31]=T,t[32]=a,t[33]=g?.kind,t[34]=I):I=t[34];let L;t[35]!==T||t[36]!==f?(L=T?(0,q.jsx)(_t,{size:`sm`,variant:`default`,onClick:()=>f(`missing`),children:`Create page`}):null,t[35]=T,t[36]=f,t[37]=L):L=t[37];let R;t[38]!==O||t[39]!==D||t[40]!==f?(R=D&&O?(0,q.jsxs)(_t,{size:`sm`,variant:`outline`,onClick:()=>f(`folder-index`),children:[(0,q.jsx)(Wn,{className:`size-3.5`,"aria-hidden":`true`}),`Create index`]}):null,t[38]=O,t[39]=D,t[40]=f,t[41]=R):R=t[41];let z;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,q.jsx)(`div`,{className:`flex-1`}),t[42]=z):z=t[42];let B;t[43]===u?B=t[44]:(B=()=>u(!0),t[43]=u,t[44]=B);let V;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,q.jsx)(or,{className:`size-3.5`,"aria-hidden":`true`}),t[45]=V):V=t[45];let H;t[46]===B?H=t[47]:(H=(0,q.jsxs)(_t,{size:`sm`,variant:`outline`,onClick:B,children:[V,`Edit`]}),t[46]=B,t[47]=H);let U;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,q.jsx)(dr,{className:`size-3.5`,"aria-hidden":`true`}),t[48]=U):U=t[48];let ee;t[49]===x?ee=t[50]:(ee=(0,q.jsxs)(_t,{size:`sm`,variant:`destructive`,onClick:x,children:[U,`Remove`]}),t[49]=x,t[50]=ee);let te;t[51]!==I||t[52]!==L||t[53]!==R||t[54]!==H||t[55]!==ee?(te=(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[I,L,R,z,H,ee]}),t[51]=I,t[52]=L,t[53]=R,t[54]=H,t[55]=ee,t[56]=te):te=t[56];let ne=d!==null,re;t[57]===f?re=t[58]:(re=e=>{e||f(null)},t[57]=f,t[58]=re);let W;t[59]!==d||t[60]!==O||t[61]!==p||t[62]!==T||t[63]!==m||t[64]!==g?(W=d===`folder-index`&&O?O.initialDir:T&&g?.kind===`doc`&&XS(g.docName,{pages:m,folderPaths:p}).kind===`create`?XS(g.docName,{pages:m,folderPaths:p}).initialDir:``,t[59]=d,t[60]=O,t[61]=p,t[62]=T,t[63]=m,t[64]=g,t[65]=W):W=t[65];let ie;t[66]!==d||t[67]!==O||t[68]!==p||t[69]!==T||t[70]!==m||t[71]!==g?(ie=d===`folder-index`&&O?O.suggestedName:T&&g?.kind===`doc`&&XS(g.docName,{pages:m,folderPaths:p}).kind===`create`?XS(g.docName,{pages:m,folderPaths:p}).suggestedName:void 0,t[66]=d,t[67]=O,t[68]=p,t[69]=T,t[70]=m,t[71]=g,t[72]=ie):ie=t[72];let ae;t[73]!==d||t[74]!==O||t[75]!==g?(ae=d===`folder-index`&&O?(0,q.jsxs)(q.Fragment,{children:[`Create an index note for`,` `,(0,q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[O.initialDir,`/`]})]}):(0,q.jsxs)(q.Fragment,{children:[`Create a page for`,` `,(0,q.jsx)(`span`,{className:`font-medium text-foreground`,children:g?.kind===`doc`?g.docName:``})]}),t[73]=d,t[74]=O,t[75]=g,t[76]=ae):ae=t[76];let oe;t[77]!==C||t[78]!==ne||t[79]!==re||t[80]!==W||t[81]!==ie||t[82]!==ae?(oe=(0,q.jsx)(oC,{open:ne,onOpenChange:re,kind:`file`,initialDir:W,suggestedName:ie,description:ae,onCreated:C}),t[77]=C,t[78]=ne,t[79]=re,t[80]=W,t[81]=ie,t[82]=ae,t[83]=oe):oe=t[83];let se;return t[84]!==l||t[85]!==y||t[86]!==s||t[87]!==m||t[88]!==u?(se=(0,q.jsx)(tw,{open:l,href:s,pages:m,onOpenChange:u,onSave:y}),t[84]=l,t[85]=y,t[86]=s,t[87]=m,t[88]=u,t[89]=se):se=t[89],(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(JS,{kind:`internal-link`,ariaLabel:`Link options`,onDeactivate:a,triggerReference:j,children:[(0,q.jsxs)(`div`,{className:`mb-2 flex items-start gap-2 pr-8`,children:[(0,q.jsx)(`div`,{className:ht(`mt-0.5 flex shrink-0`,w.className),children:w.icon}),F]}),te]}),oe,se]})}function rw(e,t,n){let r=c(e,t);if(!r)return`unresolved`;if(r.kind===`external`)return`external`;if(r.kind===`anchor`)return`anchor`;if(r.kind===`asset`)return`asset`;if(n===null)return`loading`;let i=XS(r.docName,{pages:n.pages,folderPaths:n.folderPaths});return i.kind===`create`?`unresolved`:i.displayState}function iw(e,t,n){let r=e.attrs?.href;return typeof r!=`string`||r.length===0||e.attrs?.sourceForm===`wikiembed`?null:{"data-resolution-state":rw(r,n,t)}}function aw(e){return(t,n)=>iw(t,n,e)}var ow=new Te(`linkResolutionDecoration`);function sw(e,t,n,r,i){if(t.size===0)return null;let a=[];for(let e of t.values()){if(!n.has(e.markType))continue;let t=r(e,i);t!==null&&a.push(Ke.inline(e.from,e.to,t))}return a.length===0?null:ge.create(e,a)}function cw(e){let t=new Set(e.markTypes),{computeAttrs:n}=e;return new Fe({key:ow,state:{init:()=>({version:0}),apply(e,t){let n=e.getMeta(ow);return n&&typeof n==`object`&&n.refresh?{version:t.version+1}:t}},props:{decorations(e){let r=vC.getState(e);if(!r)return null;let i=Be();return sw(e.doc,r.byId,t,n,i)}},view(e){let t=fe(()=>{e.dispatch(e.state.tr.setMeta(ow,{refresh:!0}))});return{destroy(){t()}}}})}var lw=new Te(`markIdentityDecoration`),uw=`data-mark-id`;function dw(){return new Fe({key:lw,props:{decorations(e){let t=vC.getState(e);if(!t||t.byId.size===0)return null;let n=[];for(let e of t.byId.values())n.push(Ke.inline(e.from,e.to,{[uw]:e.id}));return ge.create(e.doc,n)}}})}var fw=P.extend({addOptions(){return{...this.parent?.(),docName:``}},renderHTML({HTMLAttributes:e}){let t=typeof e.href==`string`?e.href:``;return[`span`,Ve(e,{"data-link":``,role:`link`,tabindex:`0`,"aria-label":t?`Link: ${t}`:`Link`,style:`touch-action: manipulation;`}),0]},addProseMirrorPlugins(){let e=this.options.docName??``;return[DC({editor:this.editor,markTypes:[`link`],renderPropPanel:({editor:t,nodeId:n,deactivate:r})=>(0,K.createElement)(nw,{editor:t,nodeId:n,sourceDocName:e,onClose:r}),handlePrimary:({editor:t,nodeId:n,newTab:r})=>{let i=wC(t.state,n),a=i?.attrs?.href;if(typeof a!=`string`||!a)return!1;let o=i?.attrs?.sourceForm,s=c(a,e),l=Ne(a);if(s?.kind===`asset`||o===`wikiembed`&&l!==null){let t=s?.kind===`asset`?s.url:a,n=s?.kind===`asset`?s.ext:l??``,i=E(t,e);return i?(MS({url:t,projectRelPath:i,ext:n,title:i.split(`/`).pop()??t,forceOsDelegation:r}),!0):!1}return!r||!s?!1:s.kind===`doc`?(BS({docName:s.docName,anchor:s.anchor}),!0):s.kind===`anchor`?(BS({docName:e,anchor:s.anchor}),!0):PS(s.url)?(RS(s.url),!0):!1}}),dw(),cw({markTypes:[`link`],computeAttrs:aw(e)}),qS({sourceDocName:e})]}}),pw=(0,K.createContext)(null),mw={didCatch:!1,error:null},hw=class extends K.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=mw}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(mw))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&gw(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(mw))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,K.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,K.createElement)(pw.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function gw(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}function _w(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,q.jsx)(ii,{"data-slot":`popover`,...n}),t[2]=n,t[3]=r),r}function vw(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,q.jsx)(oi,{"data-slot":`popover-trigger`,...n}),t[2]=n,t[3]=r),r}function yw(e){let t=(0,J.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,align:i,sideOffset:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`center`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=ht(`z-50 w-72 rounded-lg border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,q.jsx)(si,{children:(0,q.jsx)(ci,{"data-slot":`popover-content`,align:o,sideOffset:s,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function bw(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,q.jsx)(ai,{"data-slot":`popover-anchor`,...n}),t[2]=n,t[3]=r),r}function xw(e){let t=(0,J.c)(23),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({label:i,Icon:n,onClick:a,selected:s,className:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=s?`true`:void 0,l;t[7]===a?l=t[8]:(l=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},t[7]=a,t[8]=l);let u;t[9]===r?u=t[10]:(u=ht(`flex w-full items-center justify-center gap-2 rounded-md border border-dashed border-border bg-transparent px-3 py-2 text-center text-sm text-muted-foreground transition-colors hover:bg-muted/50 cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,r),t[9]=r,t[10]=u);let d;t[11]===n?d=t[12]:(d=(0,q.jsx)(n,{size:16,"aria-hidden":`true`}),t[11]=n,t[12]=d);let f;t[13]===i?f=t[14]:(f=(0,q.jsx)(`span`,{children:i}),t[13]=i,t[14]=f);let p;return t[15]!==a||t[16]!==o||t[17]!==c||t[18]!==l||t[19]!==u||t[20]!==d||t[21]!==f?(p=(0,q.jsxs)(`div`,{...o,role:`button`,tabIndex:-1,contentEditable:!1,"data-descriptor-placeholder":``,"data-selected":c,onClick:a,onMouseDown:Sw,onKeyDown:l,className:u,children:[d,f]}),t[15]=a,t[16]=o,t[17]=c,t[18]=l,t[19]=u,t[20]=d,t[21]=f,t[22]=p):p=t[22],p}function Sw(e){e.preventDefault(),e.stopPropagation()}function Cw(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,q.jsx)(Er,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function ww(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,q.jsx)(Dr,{"data-slot":`collapsible-trigger`,...n}),t[2]=n,t[3]=r),r}function Tw(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,q.jsx)(Or,{"data-slot":`collapsible-content`,...n}),t[2]=n,t[3]=r),r}function Ew(e){let t=(0,J.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]===n?o=t[5]:(o=ht(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,n),t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(xi,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`}),t[6]=s):s=t[6];let c;return t[7]!==r||t[8]!==a||t[9]!==o?(c=(0,q.jsx)(bi,{"data-slot":`switch`,"data-size":a,className:o,...r,children:s}),t[7]=r,t[8]=a,t[9]=o,t[10]=c):c=t[10],c}function Dw(){if(typeof window>`u`)return null;let e=window.location.hash.match(/^#\/([^?#]+)/);return e?decodeURIComponent(e[1]):null}var Ow=`/api/upload`;async function kw(e,t,n={}){let r=n.fetch??globalThis.fetch,i=n.docName===void 0?Dw():n.docName;if(!i)throw Error(`No document is open`);let a=new FormData;a.append(`file`,e),a.append(`parentDocName`,i);let o;try{o=await r(Ow,{method:`POST`,body:a})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Upload failed: ${t}`)}if(!o.ok){let e=`Upload failed (${o.status})`;try{let t=await o.json();t.error&&(e=t.error)}catch{}throw Error(e)}let s;try{let e=await o.json(),t=e.path??e.src;if(typeof t!=`string`)throw Error(`Server response missing "path"/"src" field`);s=t.startsWith(`/`)?t:`/${t}`}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Upload response parse error: ${t}`)}return{url:s}}var Aw=new Intl.PluralRules(`en-US`);function jw(e,t,n){return n<=0?`${e} (empty)`:`${e} with ${n} ${Aw.select(n)===`one`?`item`:`items`}`}var Mw=`Document`;function Nw(e){for(let t of e)if(t.type===`string`&&t.hidden!==!0&&t.advanced!==!0&&t.autoFocus===!0)return t.name;return null}function Pw(e){if(!e)return e;let t=e.replace(/[_-]+/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1)}function Fw(e){return`ok.propPanel.advanced.${e}`}function Iw(e){try{return typeof localStorage>`u`?!1:localStorage.getItem(Fw(e))===`true`}catch{return!1}}function Lw(e,t){try{if(typeof localStorage>`u`)return;localStorage.setItem(Fw(e),t?`true`:`false`)}catch{}}function Rw(e,t){let n=0;for(let r of e){let e=t[r.name],i=`defaultValue`in r?r.defaultValue:void 0;e!==void 0&&e!==i&&(n+=1)}return n}async function zw(e,t,n){try{let{url:r}=await kw(e,t);n(r)}catch(e){let t=e instanceof Error?e.message:String(e);Lt.error(`Upload failed: ${t}`)}}function Bw(e){let t=(0,J.c)(11),{descriptor:n,values:r,onChange:i}=e,a=n.props.filter(Uw),o=a.filter(Hw),s=a.filter(Vw),c=Rw(s,r),l;t[0]===n.props?l=t[1]:(l=Nw(n.props),t[0]=n.props,t[1]=l);let u=l,d;t[2]===n.name?d=t[3]:(d=()=>Iw(n.name),t[2]=n.name,t[3]=d);let[f,p]=(0,K.useState)(d);if(a.length===0)return null;let m;t[4]!==u||t[5]!==i||t[6]!==r?(m=e=>(0,q.jsx)(Gw,{propDef:e,value:r[e.name],onChange:t=>i(e.name,t),isAutoFocused:e.name===u},e.name),t[4]=u,t[5]=i,t[6]=r,t[7]=m):m=t[7];let h=o.map(m),g=s.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,q.jsxs)(Cw,{open:f,onOpenChange:e=>{p(e),Lw(n.name,e)},children:[(0,q.jsxs)(ww,{"data-prop-panel-advanced-trigger":``,className:`group flex w-full items-center justify-between rounded px-1 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(zn,{className:`size-3 transition-transform group-data-[state=closed]:-rotate-90`}),`Advanced`]}),c>0&&(0,q.jsx)(Ti,{variant:`secondary`,"data-prop-panel-advanced-count":``,children:c})]}),(0,q.jsx)(Tw,{className:`flex flex-col gap-2 pt-2`,children:s.map(e=>(0,q.jsx)(Gw,{propDef:e,value:r[e.name],onChange:t=>i(e.name,t),isAutoFocused:e.name===u},e.name))})]})]}),_;return t[8]!==h||t[9]!==g?(_=(0,q.jsxs)(`div`,{"data-prop-panel":``,className:`flex flex-col gap-2 p-3 text-sm`,children:[h,g]}),t[8]=h,t[9]=g,t[10]=_):_=t[10],_}function Vw(e){return`advanced`in e&&e.advanced}function Hw(e){return!(`advanced`in e&&e.advanced)}function Uw(e){return!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`}function Ww(e){throw Error(`PropPanel: unhandled PropDef type ${JSON.stringify(e)}`)}function Gw(e){let t=(0,J.c)(71),{propDef:n,value:r,onChange:i,isAutoFocused:a}=e;switch(n.type){case`reactnode`:return null;case`string`:{let e=`prop-${n.name}`,o=n.accept,s=o!==void 0&&o.length>0,c=!n.required&&n.defaultValue===void 0,l;t[0]===n.name?l=t[1]:(l=Pw(n.name),t[0]=n.name,t[1]=l);let u;t[2]!==e||t[3]!==l?(u=(0,q.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:l}),t[2]=e,t[3]=l,t[4]=u):u=t[4];let d=r??``,f;t[5]!==i||t[6]!==c?(f=e=>{let t=e.target.value;if(t===``&&c){i(void 0);return}i(t)},t[5]=i,t[6]=c,t[7]=f):f=t[7];let p=a?``:void 0,m;t[8]!==a||t[9]!==e||t[10]!==d||t[11]!==f||t[12]!==p?(m=(0,q.jsx)(QS,{id:e,type:`text`,value:d,onChange:f,autoFocus:a,"data-prop-autofocus":p,className:`h-7 text-sm`}),t[8]=a,t[9]=e,t[10]=d,t[11]=f,t[12]=p,t[13]=m):m=t[13];let h;t[14]!==o||t[15]!==i||t[16]!==s?(h=s&&(0,q.jsx)(qw,{accept:o,onUploaded:e=>i(e)}),t[14]=o,t[15]=i,t[16]=s,t[17]=h):h=t[17];let g;t[18]!==m||t[19]!==h?(g=(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20];let _;return t[21]!==u||t[22]!==g?(_=(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[u,g]}),t[21]=u,t[22]=g,t[23]=_):_=t[23],_}case`boolean`:{let e=`prop-${n.name}`,a;t[24]===n.name?a=t[25]:(a=Pw(n.name),t[24]=n.name,t[25]=a);let o=a,s;t[26]!==e||t[27]!==o?(s=(0,q.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:o}),t[26]=e,t[27]=o,t[28]=s):s=t[28];let c=!!r,l;t[29]===i?l=t[30]:(l=e=>i(e),t[29]=i,t[30]=l);let u;t[31]!==e||t[32]!==c||t[33]!==l?(u=(0,q.jsx)(Ew,{id:e,checked:c,onCheckedChange:l}),t[31]=e,t[32]=c,t[33]=l,t[34]=u):u=t[34];let d;return t[35]!==s||t[36]!==u?(d=(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[s,u]}),t[35]=s,t[36]=u,t[37]=d):d=t[37],d}case`enum`:{let e=`prop-${n.name}`,a;t[38]===n.name?a=t[39]:(a=Pw(n.name),t[38]=n.name,t[39]=a);let o;t[40]!==e||t[41]!==a?(o=(0,q.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:a}),t[40]=e,t[41]=a,t[42]=o):o=t[42];let s=r??n.enumValues[0]??``,c;t[43]===i?c=t[44]:(c=e=>i(e.target.value),t[43]=i,t[44]=c);let l;t[45]===n.enumValues?l=t[46]:(l=n.enumValues.map(Kw),t[45]=n.enumValues,t[46]=l);let u;t[47]!==e||t[48]!==s||t[49]!==c||t[50]!==l?(u=(0,q.jsx)(`select`,{id:e,value:s,onChange:c,className:`h-7 rounded border border-input bg-background px-2 text-sm`,children:l}),t[47]=e,t[48]=s,t[49]=c,t[50]=l,t[51]=u):u=t[51];let d;return t[52]!==o||t[53]!==u?(d=(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[o,u]}),t[52]=o,t[53]=u,t[54]=d):d=t[54],d}case`number`:{let e=`prop-${n.name}`,a;t[55]===n.name?a=t[56]:(a=Pw(n.name),t[55]=n.name,t[56]=a);let o;t[57]!==e||t[58]!==a?(o=(0,q.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:a}),t[57]=e,t[58]=a,t[59]=o):o=t[59];let s=r==null?``:String(r),c;t[60]===i?c=t[61]:(c=e=>{let t=e.target.value;if(t===``){i(void 0);return}if(t===`-`)return;let n=Number(t);Number.isNaN(n)||i(n)},t[60]=i,t[61]=c);let l;t[62]!==e||t[63]!==s||t[64]!==c?(l=(0,q.jsx)(QS,{id:e,type:`number`,inputMode:`numeric`,value:s,onChange:c,className:`h-7 text-sm`}),t[62]=e,t[63]=s,t[64]=c,t[65]=l):l=t[65];let u;return t[66]!==o||t[67]!==l?(u=(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[o,l]}),t[66]=o,t[67]=l,t[68]=u):u=t[68],u}default:{let e;return t[69]===n?e=t[70]:(e=Ww(n),t[69]=n,t[70]=e),e}}}function Kw(e){return(0,q.jsx)(`option`,{value:e,children:e},e)}function qw(e){let t=(0,J.c)(17),{accept:n,onUploaded:r}=e,[i,a]=(0,K.useState)(!1),o=(0,K.useRef)(null),s;t[0]===n?s=t[1]:(s=n.join(`,`),t[0]=n,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=async e=>{let t=e.target.files?.[0];if(t){a(!0);try{await zw(t,n,r)}catch{}a(!1),o.current&&(o.current.value=``)}},t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==c?(l=(0,q.jsx)(`input`,{ref:o,type:`file`,accept:s,className:`hidden`,"data-prop-upload-input":``,onChange:c}),t[5]=s,t[6]=c,t[7]=l):l=t[7];let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>o.current?.click(),t[8]=u):u=t[8];let d;t[9]===i?d=t[10]:(d=i?(0,q.jsx)(nr,{className:`size-3.5 animate-spin`}):(0,q.jsx)(fr,{className:`size-3.5`}),t[9]=i,t[10]=d);let f;t[11]!==d||t[12]!==i?(f=(0,q.jsx)(_t,{type:`button`,variant:`outline`,size:`sm`,disabled:i,"aria-label":`Upload file`,"data-prop-upload-trigger":``,className:`h-7 px-2`,onClick:u,children:d}),t[11]=d,t[12]=i,t[13]=f):f=t[13];let p;return t[14]!==l||t[15]!==f?(p=(0,q.jsxs)(q.Fragment,{children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16],p}var Jw=`selectionStatePlugin/origin`,Yw=`selectionStatePlugin/refresh`,Xw=new Te(`selectionState`),Zw={selectedBlockId:null,ancestorChain:[],selectionOrigin:`programmatic`,isDragging:!1};function Qw(e){return Xw.getState(e.state)??Zw}function $w(e,t){let n=[],{$from:r}=t;for(let t=1;t<=r.depth;t++){let i=r.node(t);if(i.type.name!==`jsxComponent`)continue;let a=r.before(t);n.push(eT(e,i,a))}if(t instanceof Le){let r=t.node;r.type.name===`jsxComponent`&&n.push(eT(e,r,t.from))}return n}function eT(e,t,n){let r=t.attrs.componentName??`unknown`;return{bridgeId:tT(e,n),componentName:r,pos:n}}function tT(e,t){return jx.getState(e)?.posToId.get(t)??`pos-${t}`}function nT(e,t,n={}){let r=$w(e,e.selection),i={selectedBlockId:r[r.length-1]?.bridgeId??null,ancestorChain:r,selectionOrigin:n.origin??t.selectionOrigin,isDragging:n.isDragging??t.isDragging};return rT(t,i)?t:i}function rT(e,t){if(e===t)return!0;if(e.selectedBlockId!==t.selectedBlockId||e.selectionOrigin!==t.selectionOrigin||e.isDragging!==t.isDragging||e.ancestorChain.length!==t.ancestorChain.length)return!1;for(let n=0;n<e.ancestorChain.length;n++){let r=e.ancestorChain[n],i=t.ancestorChain[n];if(r.bridgeId!==i.bridgeId||r.componentName!==i.componentName||r.pos!==i.pos)return!1}return!0}var iT=new WeakMap;function aT(e,t,n,r){let i=r?.isDragging??t.isDragging,a=!!e.getMeta(Yw),o=e.selectionSet&&!a,s=e.getMeta(Jw),c=o?r?.pendingOrigin??null:null,l=s??c??t.selectionOrigin;return o&&r&&(r.pendingOrigin=null),nT(n,t,{origin:l,isDragging:i})}var oT=W.create({name:`selectionStatePlugin`,addProseMirrorPlugins(){let e=this.editor,t=new Fe({key:Xw,state:{init(e,t){return nT(t,Zw)},apply(e,n,r,i){return aT(e,n,i,iT.get(t))}},props:{handleDOMEvents:{mousedown:()=>{let e=iT.get(t);return e&&(e.pendingOrigin=`pointer`),!1},pointerdown:()=>{let e=iT.get(t);return e&&(e.pendingOrigin=`pointer`),!1}},handleKeyDown:(e,n)=>{if(sT(n.key)){let e=iT.get(t);e&&(e.pendingOrigin=`keyboard`)}return!1}},view(n){iT.set(t,{pendingOrigin:null,isDragging:!1});let r=()=>{let n=iT.get(t);n&&(n.isDragging=!0,cT(e))},i=()=>{let n=iT.get(t);n&&(n.isDragging=!1,cT(e))};return n.dom.addEventListener(`dragstart`,r,!0),n.dom.addEventListener(`dragend`,i,!0),n.dom.addEventListener(`drop`,i,!0),{destroy:()=>{n.dom.removeEventListener(`dragstart`,r,!0),n.dom.removeEventListener(`dragend`,i,!0),n.dom.removeEventListener(`drop`,i,!0),iT.delete(t)}}}});return[t]}});function sT(e){return e===`ArrowUp`||e===`ArrowDown`||e===`ArrowLeft`||e===`ArrowRight`||e===`Tab`||e===`Escape`||e===`Enter`||e===`Home`||e===`End`||e===`PageUp`||e===`PageDown`}function cT(e){queueMicrotask(()=>{if(!e.isDestroyed)try{let t=e.state.tr.setMeta(Yw,!0);e.view.dispatch(t)}catch{}})}function lT(e){let t=(0,J.c)(5),n;t[0]===e?n=t[1]:(n=()=>e?Qw(e):null,t[0]=e,t[1]=n);let[r,i]=(0,K.useState)(n),a,o;return t[2]===e?(a=t[3],o=t[4]):(a=()=>{if(!e){i(null);return}i(Qw(e));let t=()=>{i(Qw(e))};return e.on(`transaction`,t),e.on(`selectionUpdate`,t),()=>{e.off(`transaction`,t),e.off(`selectionUpdate`,t)}},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,K.useEffect)(a,o),r}function uT(){}function dT(e){let{xmlFragment:t,ytext:n}=e,r=(e,t)=>{},i=(e,t)=>{};return t.observeDeep(r),n.observe(i),()=>{t.unobserveDeep(r),n.unobserve(i)}}function fT(e,t){if(e.hasChildren)return!1;let n=Nw(e.props);return n===null?!1:t[n]===``}function pT(e){let t=e.placeholder?.label,n=`Add ${(e.displayName??e.name).toLowerCase()}`;return{label:t??n,Icon:ex(e.placeholder?.icon??e.icon)}}var mT=null;function hT(){return mT||=new y({extensions:R}),mT}function gT(e){if(!e.attrs.sourceDirty&&e.attrs.sourceRaw)return e.attrs.sourceRaw;let t=hT(),n=e.type.schema.node(`doc`,null,[e]);return t.serialize(n.toJSON()).trim()}var _T=new Set([`http:`,`https:`,`mailto:`,`tel:`,`ftp:`,`sms:`]),vT=6e4,yT=10,bT=new Map;function xT(e,t){let n=t.toLowerCase();g(n);let r=Date.now(),i=bT.get(n);if(!i||r-i.windowStart>=vT)bT.set(n,{windowStart:r,count:1});else if(i.count+=1,i.count>yT)return;typeof console<`u`&&typeof console.warn==`function`&&console.warn(JSON.stringify({event:`jsx-prop-dropped`,reason:e,prop:t}))}var ST=new Set([`href`,`src`,`action`,`formaction`,`poster`,`cite`,`data`,`manifest`,`background`,`ping`,`xlinkhref`,`xlinkactuate`,`xlinkrole`,`xlinkarcrole`,`xlinkshow`,`url`,`link`]),CT=new Set([`dangerouslysetinnerhtml`,`ref`,`key`,`defaultvalue`,`defaultchecked`,`__proto__`,`constructor`,`prototype`]),wT=1e4;function TT(e){let t=e.toLowerCase();return!!(CT.has(t)||t.length>=3&&t.startsWith(`on`))}function ET(e){return ST.has(e.toLowerCase())}function DT(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t||t.startsWith(`#`)||t.startsWith(`//`))return e;let n=t.indexOf(`:`);if(n===-1||n>[t.indexOf(`/`),t.indexOf(`?`),t.indexOf(`#`)].filter(e=>e!==-1).reduce((e,t)=>Math.min(e,t),1/0))return e;let r=t.slice(0,n+1).toLowerCase();return _T.has(r)?e:`#`}function OT(e){if(e.length>wT)return``;let t=e.toLowerCase();return/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/.test(t)||/\bexpression\s*\(/.test(t)?``:e}function kT(e){if(e==null)return e;if(Array.isArray(e)){let t=!1,n=Array(e.length);for(let r=0;r<e.length;r++){let i=kT(e[r]);n[r]=i,i!==e[r]&&(t=!0)}return t?n:e}if(typeof e!=`object`)return e;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=e,r=!1,i={};for(let[e,t]of Object.entries(n)){if(TT(e)){xT(`dangerous-prop-name-nested`,e),r=!0;continue}if(ET(e)&&typeof t==`string`){let n=DT(t);n!==t&&(r=!0),i[e]=n}else{let n=kT(t);n!==t&&(r=!0),i[e]=n}}return r?i:e}function AT(e){let t=!1,n={};for(let[r,i]of Object.entries(e)){if(TT(r)){xT(`dangerous-prop-name`,r),t=!0;continue}if(ET(r)){let e=DT(i);e!==i&&(t=!0),n[r]=e;continue}if(r===`style`){if(typeof i==`string`){let e=OT(i);e!==i&&(t=!0),n[r]=e}else t=!0;continue}let e=kT(i);e!==i&&(t=!0),n[r]=e}return t?n:e}function jT(e){let t=(0,J.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,q.jsx)(`div`,{className:`jsx-component-error-fallback`,children:n}),t[0]=n,t[1]=r),r}function MT(e){let t=(0,J.c)(13),{children:n,resetKey:r,onError:i,descriptorName:a,rawComponentName:o}=e,s;t[0]===r?s=t[1]:(s=[r],t[0]=r,t[1]=s);let c;t[2]!==a||t[3]!==i||t[4]!==o?(c=(e,t)=>{let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:a,rawComponentName:String(o??``).slice(0,200),error:String(n),stack:t.componentStack})),Ye(a),i(n)},t[2]=a,t[3]=i,t[4]=o,t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=e=>(0,q.jsx)(jT,{...e,children:n}),t[6]=n,t[7]=l);let u;return t[8]!==n||t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,q.jsx)(hw,{resetKeys:s,onError:c,fallbackRender:l,children:n}),t[8]=n,t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function NT(e){if(typeof e!=`object`||!e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(NT).join(`,`)}]`;let t=Object.entries(e);return t.sort(([e],[t])=>e<t?-1:+(e>t)),`{${t.map(([e,t])=>`${JSON.stringify(e)}:${NT(t)}`).join(`,`)}}`}function PT(e,t){let n=e.props??{},r={};for(let[e,i]of Object.entries(n))t.has(e)||(r[e]=i);return AT(r)}var FT=3;function IT(e){let t=(0,J.c)(152),{node:n,editor:r,getPos:i,selected:a}=e,o=Zb(n.attrs.componentName),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1),d=(0,K.useRef)(!1),f=typeof i==`function`?i():void 0,p=!1,m=0,h=1;try{if(f!==void 0){let e=r.state.doc.resolve(f);e.depth>0&&e.parent.type.name===`jsxComponent`&&(p=!0,m=e.index(e.depth),h=e.parent.childCount)}}catch(e){let t=e;if(!(t instanceof RangeError))throw t}let g=p&&m>0,_=p&&m<h-1,y=lT(r),b=typeof f==`number`?tT(r.state,f):null,x=b!==null&&y?.selectedBlockId===b,S=b!==null&&!x&&(y?.ancestorChain.some(e=>e.bridgeId===b)??!1),C=x&&y?y.selectionOrigin:void 0,w=x&&(y?.isDragging??!1),T=o.props.some(BT),E=n.attrs.props??{},D=T&&o.props.some(e=>e.type!==`string`||`hidden`in e&&e.hidden?!1:E[e.name]===``),O=fT(o,E),k=O?pT(o):null,A=!o.hasChildren||!!o.isSelfClosing;(0,K.useEffect)(()=>{a&&!d.current&&T&&cx(f)&&u(!0),d.current=a},[a,T,f]);let j=PT(n.attrs,o.reactNodePropNames),M=o.surface===`compat`?o.translateProps(j):j,N=`${o.name}::${NT(j)}`,P;t[0]!==i||t[1]!==n.content.size?(P=()=>(typeof i==`function`?i()??0:0)+1+n.content.size,t[0]=i,t[1]=n.content.size,t[2]=P):P=t[2];let F=P,I=o.name===`*`||s!==null,L=(0,K.useRef)(!1),R=(0,K.useRef)(0),[z,B]=(0,K.useState)(!1),U;t[3]!==o.displayName||t[4]!==o.name||t[5]!==r||t[6]!==i||t[7]!==I||t[8]!==n||t[9]!==s?.message||t[10]!==z?(U=()=>{if(!I||L.current||z)return;let e=typeof i==`function`?i():void 0;if(typeof e!=`number`)return;let t=gT(n),a=o.name===`*`?`Unregistered component: ${n.attrs.componentName}`:`Render error in <${o.displayName??o.name}>: ${s?.message??`unknown`}`,c=n.type.schema.nodes.rawMdxFallback.create({reason:a},n.type.schema.text(t)),l=!1,u,d=()=>{if(!l)try{r.view.dispatch(r.state.tr.replaceWith(e,e+n.nodeSize,c)),L.current=!0,Qe(o.name===`*`?`wildcard`:o.name)}catch(e){let t=e,r=o.name===`*`?`wildcard`:o.name;if(console.warn(JSON.stringify({event:`jsx-component-auto-convert-failed`,component:r,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t).slice(0,500),retry:R.current})),de(r),R.current+=1,R.current<FT){let e=50*(2**R.current-1);u=setTimeout(()=>{l||d()},e)}else l||B(!0)}},f=requestAnimationFrame(d);return()=>{l=!0,cancelAnimationFrame(f),u!==void 0&&clearTimeout(u)}},t[3]=o.displayName,t[4]=o.name,t[5]=r,t[6]=i,t[7]=I,t[8]=n,t[9]=s?.message,t[10]=z,t[11]=U):U=t[11];let ee;if(t[12]!==o||t[13]!==r||t[14]!==i||t[15]!==I||t[16]!==n||t[17]!==s||t[18]!==z?(ee=[I,n,r,i,o,s,z],t[12]=o,t[13]=r,t[14]=i,t[15]=I,t[16]=n,t[17]=s,t[18]=z,t[19]=ee):ee=t[19],(0,K.useEffect)(U,ee),z){let e=o.name===`*`?`<${n.attrs.componentName}> isn't a known component. Copy the source to use it elsewhere, or delete the block.`:`<${o.displayName??o.name}> failed to render (likely a bad prop). Copy the source to see what went wrong, or delete the block.`,a;t[20]!==o.name||t[21]!==n?(a=()=>{try{let e=gT(n);typeof navigator<`u`&&navigator.clipboard?.writeText&&navigator.clipboard.writeText(e)}catch(e){let t=e;H(o.name),console.warn(JSON.stringify({event:`jsx-component-stuck-copy-failed`,component:o.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t).slice(0,500)}))}},t[20]=o.name,t[21]=n,t[22]=a):a=t[22];let s=a,c;t[23]!==o.name||t[24]!==r||t[25]!==i||t[26]!==n.attrs.componentName?(c=()=>{let e=typeof i==`function`?i():void 0;if(typeof e==`number`)try{r.chain().focus().setNodeSelection(e).deleteSelection().run()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;v(o.name),console.warn(JSON.stringify({event:`jsx-component-stuck-delete-failed`,component:o.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},t[23]=o.name,t[24]=r,t[25]=i,t[26]=n.attrs.componentName,t[27]=c):c=t[27];let l=c,u;t[28]===e?u=t[29]:(u=(0,q.jsx)(`span`,{className:`flex-1`,children:e}),t[28]=e,t[29]=u);let d;t[30]===s?d=t[31]:(d=(0,q.jsx)(`button`,{type:`button`,className:`text-xs underline hover:no-underline`,onClick:s,children:`Copy source`}),t[30]=s,t[31]=d);let f;t[32]===l?f=t[33]:(f=(0,q.jsx)(`button`,{type:`button`,className:`text-xs underline hover:no-underline`,onClick:l,children:`Delete`}),t[32]=l,t[33]=f);let p;t[34]!==u||t[35]!==d||t[36]!==f?(p=(0,q.jsxs)(`div`,{className:`text-xs font-mono text-muted-foreground px-2 py-2 border border-destructive/40 rounded bg-destructive/5 flex items-center gap-2`,contentEditable:!1,children:[u,d,f]}),t[34]=u,t[35]=d,t[36]=f,t[37]=p):p=t[37];let m;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,q.jsx)(Ha,{className:`component-children`}),t[38]=m):m=t[38];let h;return t[39]===p?h=t[40]:(h=(0,q.jsxs)(Ua,{className:`jsx-component-wrapper my-2`,children:[p,m]}),t[39]=p,t[40]=h),h}if(I){let e=o.name===`*`?`Unknown component: ${n.attrs.componentName} — source editable below`:`${o.displayName??o.name} — render error, source editable below`,r;t[41]===e?r=t[42]:(r=(0,q.jsx)(`div`,{className:`text-xs font-mono text-muted-foreground px-2 py-1`,contentEditable:!1,children:e}),t[41]=e,t[42]=r);let i;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,q.jsx)(Ha,{className:`component-children`}),t[43]=i):i=t[43];let a;return t[44]===r?a=t[45]:(a=(0,q.jsxs)(Ua,{className:`jsx-component-wrapper my-2`,children:[r,i]}),t[44]=r,t[45]=a),a}let te=o.Component,ne;t[46]!==r||t[47]!==A||t[48]!==f||t[49]!==O?(ne=e=>{if(O||!A)return;let t=e.target;if(!e.currentTarget.contains(t)||t.closest(`.jsx-component-chrome`)||t.closest(`.jsx-add-child-pill, .jsx-empty-child-placeholder`)||typeof f!=`number`)return;let n=r.state.doc.nodeAt(f);if(!n)return;let i=f+n.nodeSize,a=r.state.selection.from;a<f||a>=i||r.chain().focus().setNodeSelection(f).run()},t[46]=r,t[47]=A,t[48]=f,t[49]=O,t[50]=ne):ne=t[50];let re=ne,W;t[51]!==r||t[52]!==i||t[53]!==u?(W=()=>{let e=typeof i==`function`?i():void 0;typeof e==`number`&&(r.chain().focus().setNodeSelection(e).run(),u(!0))},t[51]=r,t[52]=i,t[53]=u,t[54]=W):W=t[54];let ie=W,ae=o.displayName??o.name,oe=!!o.emptyChildName,se;t[55]!==ae||t[56]!==o.emptyChildName||t[57]!==oe||t[58]!==n.childCount?(se=oe?jw(ae,o.emptyChildName,n.childCount):void 0,t[55]=ae,t[56]=o.emptyChildName,t[57]=oe,t[58]=n.childCount,t[59]=se):se=t[59];let ce=se,le;t[60]!==T||t[61]!==a||t[62]!==u?(le=e=>{if(e.key!==`Enter`&&e.key!==` `||!a||!T)return;let t=e.target;t.closest(`.jsx-component-chrome`)||t.closest(`input, textarea, select, button`)||(e.preventDefault(),u(!0))},t[60]=T,t[61]=a,t[62]=u,t[63]=le):le=t[63];let ue=le,fe;t[64]!==r||t[65]!==i||t[66]!==A||t[67]!==u?(fe=e=>{u(e),!e&&A&&requestAnimationFrame(()=>{let e=typeof i==`function`?i():void 0;if(typeof e!=`number`)return;let t=r.state.doc.nodeAt(e);if(!t)return;let n=e+t.nodeSize,a=r.state.selection.from;if(a<e||a>=n)return;let o=r.state.doc.resolve(Math.min(n,r.state.doc.content.size)),s=Je.near(o,1);r.view.dispatch(r.state.tr.setSelection(s).scrollIntoView())})},t[64]=r,t[65]=i,t[66]=A,t[67]=u,t[68]=fe):fe=t[68];let pe=fe,me;t[69]===o.name?me=t[70]:(me=o.name.toLowerCase(),t[69]=o.name,t[70]=me);let he=x?`true`:void 0,ge=S?`true`:void 0,_e=w?`true`:void 0,ve=D?`true`:void 0,ye=oe?`group`:void 0,be=x?0:-1,xe;t[71]===p?xe=t[72]:(xe=p?{draggable:`false`,onDragStart:zT}:{"data-drag-handle":``,draggable:`true`},t[71]=p,t[72]=xe);let Se;t[73]!==g||t[74]!==o.name||t[75]!==r||t[76]!==n.attrs.componentName||t[77]!==n.nodeSize||t[78]!==f?(Se=g&&(0,q.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":`Move up`,onClick:()=>{try{if(typeof f!=`number`)return;let e=r.state.doc.resolve(f),t=e.index(e.depth);if(t===0)return;let i=f-e.node(e.depth).child(t-1).nodeSize,a=f+n.nodeSize,o=r.state.tr,s=r.state.doc.slice(f,f+n.nodeSize),c=r.state.doc.slice(i,f);o.replaceWith(i,a,s.content.append(c.content)),r.view.dispatch(o.scrollIntoView())}catch(e){let t=e;if(!(t instanceof RangeError))throw t;V(`up`),console.warn(JSON.stringify({event:`jsx-component-move-failed`,direction:`up`,component:o.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},children:(0,q.jsx)(Ln,{size:12,"aria-hidden":`true`})}),t[73]=g,t[74]=o.name,t[75]=r,t[76]=n.attrs.componentName,t[77]=n.nodeSize,t[78]=f,t[79]=Se):Se=t[79];let Ce;t[80]!==_||t[81]!==o.name||t[82]!==r||t[83]!==n.attrs.componentName||t[84]!==n.nodeSize||t[85]!==f?(Ce=_&&(0,q.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":`Move down`,onClick:()=>{try{if(typeof f!=`number`)return;let e=r.state.doc.resolve(f),t=e.index(e.depth),i=e.node(e.depth);if(t>=i.childCount-1)return;let a=i.child(t+1),o=f,s=f+n.nodeSize+a.nodeSize,c=r.state.tr,l=r.state.doc.slice(f,f+n.nodeSize),u=r.state.doc.slice(f+n.nodeSize,s);c.replaceWith(o,s,u.content.append(l.content)),r.view.dispatch(c.scrollIntoView())}catch(e){let t=e;if(!(t instanceof RangeError))throw t;V(`down`),console.warn(JSON.stringify({event:`jsx-component-move-failed`,direction:`down`,component:o.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},children:(0,q.jsx)(In,{size:12,"aria-hidden":`true`})}),t[80]=_,t[81]=o.name,t[82]=r,t[83]=n.attrs.componentName,t[84]=n.nodeSize,t[85]=f,t[86]=Ce):Ce=t[86];let we=`Delete ${o.displayName??o.name}`,Te;t[87]!==r||t[88]!==f?(Te=()=>{typeof f==`number`&&r.chain().focus().setNodeSelection(f).deleteSelection().run()},t[87]=r,t[88]=f,t[89]=Te):Te=t[89];let Ee;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,q.jsx)(dr,{size:12,"aria-hidden":`true`}),t[90]=Ee):Ee=t[90];let De;t[91]!==we||t[92]!==Te?(De=(0,q.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn jsx-chrome-btn--delete`,"aria-label":we,onClick:Te,children:Ee}),t[91]=we,t[92]=Te,t[93]=De):De=t[93];let Oe;t[94]!==o.displayName||t[95]!==o.name||t[96]!==T?(Oe=T&&(0,q.jsx)(vw,{asChild:!0,children:(0,q.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":`${o.displayName??o.name} properties`,children:(0,q.jsx)(cr,{size:12,"aria-hidden":`true`})})}),t[94]=o.displayName,t[95]=o.name,t[96]=T,t[97]=Oe):Oe=t[97];let ke;t[98]!==Se||t[99]!==Ce||t[100]!==De||t[101]!==Oe?(ke=(0,q.jsxs)(`div`,{className:`jsx-component-chrome`,contentEditable:!1,onMouseDown:RT,children:[Se,Ce,De,Oe]}),t[98]=Se,t[99]=Ce,t[100]=De,t[101]=Oe,t[102]=ke):ke=t[102];let Ae;t[103]!==te||t[104]!==o.hasChildren||t[105]!==o.isSelfClosing||t[106]!==o.name||t[107]!==x||t[108]!==n.attrs.componentName||t[109]!==n.childCount||t[110]!==ie||t[111]!==M||t[112]!==N||t[113]!==k||t[114]!==c||t[115]!==O?(Ae=O&&k?(0,q.jsx)(bw,{asChild:!0,children:(0,q.jsx)(xw,{label:k.label,Icon:k.Icon,onClick:ie,selected:x})}):(0,q.jsx)(MT,{resetKey:N,onError:c,descriptorName:o.name===`*`?`wildcard`:o.name,rawComponentName:n.attrs.componentName??``,children:(0,q.jsx)(te,{...M,children:(0,q.jsx)(Ha,{className:`component-children ${!o.hasChildren&&n.childCount===0?`min-h-0 m-0 p-0`:``}`,...!o.hasChildren||o.isSelfClosing?{contentEditable:!1}:{}})})}),t[103]=te,t[104]=o.hasChildren,t[105]=o.isSelfClosing,t[106]=o.name,t[107]=x,t[108]=n.attrs.componentName,t[109]=n.childCount,t[110]=ie,t[111]=M,t[112]=N,t[113]=k,t[114]=c,t[115]=O,t[116]=Ae):Ae=t[116];let je;t[117]!==o.emptyChildName||t[118]!==r||t[119]!==F||t[120]!==n.childCount?(je=o.emptyChildName&&(0,q.jsx)(`button`,{type:`button`,contentEditable:!1,className:n.childCount===0?`jsx-empty-child-placeholder`:`jsx-add-child-pill`,onMouseDown:LT,onClick:()=>{let e=o.emptyChildName,t=ax(e),n=F();r.chain().focus().insertContentAt(n,t).run(),lx(r,n,Zb(e))},children:(0,q.jsxs)(`span`,{children:[`+ Add `,o.emptyChildName]})}),t[117]=o.emptyChildName,t[118]=r,t[119]=F,t[120]=n.childCount,t[121]=je):je=t[121];let Me;t[122]!==o.name||t[123]!==ce||t[124]!==re||t[125]!==ue||t[126]!==C||t[127]!==me||t[128]!==he||t[129]!==ge||t[130]!==_e||t[131]!==ve||t[132]!==ye||t[133]!==be||t[134]!==xe||t[135]!==ke||t[136]!==Ae||t[137]!==je?(Me=(0,q.jsxs)(Ua,{className:`jsx-component-wrapper my-2`,"data-jsx-component":``,"data-component-type":me,"data-selected":he,"data-has-child-selected":ge,"data-selection-origin":C,"data-dragging":_e,"data-needs-config":ve,role:ye,"aria-label":ce,tabIndex:be,...xe,"data-component-name":o.name,onClick:re,onKeyDown:ue,children:[ke,Ae,je]}),t[122]=o.name,t[123]=ce,t[124]=re,t[125]=ue,t[126]=C,t[127]=me,t[128]=he,t[129]=ge,t[130]=_e,t[131]=ve,t[132]=ye,t[133]=be,t[134]=xe,t[135]=ke,t[136]=Ae,t[137]=je,t[138]=Me):Me=t[138];let Ne;t[139]!==o||t[140]!==r||t[141]!==i||t[142]!==T||t[143]!==A||t[144]!==j||t[145]!==O?(Ne=T&&(0,q.jsxs)(yw,{side:O?`bottom`:`right`,align:O?`center`:`start`,sideOffset:O?-4:8,className:`w-64 p-3 z-[60]`,onCloseAutoFocus:A?e=>{e.preventDefault(),r.view.focus()}:void 0,children:[(0,q.jsxs)(`div`,{className:`text-xs font-medium text-muted-foreground mb-2`,children:[o.displayName??o.name,` Properties`]}),(0,q.jsx)(Bw,{descriptor:o,values:j,onChange:(e,t)=>{let n=typeof i==`function`?i():void 0;if(typeof n!=`number`)return;let a=r.state.doc.nodeAt(n);if(!a||a.attrs.kind!==`element`)return;let o={...a.attrs.props??{}},s=Array.isArray(a.attrs.attributes)?a.attrs.attributes:[],c=s;t===void 0?(delete o[e],c=s.filter(t=>!(typeof t==`object`&&t&&t.type===`mdxJsxAttribute`&&t.name===e))):o[e]=t,r.view.dispatch(r.state.tr.setNodeMarkup(n,null,{...a.attrs,attributes:c,props:o,sourceDirty:!0}))}})]}),t[139]=o,t[140]=r,t[141]=i,t[142]=T,t[143]=A,t[144]=j,t[145]=O,t[146]=Ne):Ne=t[146];let Pe;return t[147]!==pe||t[148]!==l||t[149]!==Me||t[150]!==Ne?(Pe=(0,q.jsxs)(_w,{open:l,onOpenChange:pe,children:[Me,Ne]}),t[147]=pe,t[148]=l,t[149]=Me,t[150]=Ne,t[151]=Pe):Pe=t[151],Pe}function LT(e){return e.stopPropagation()}function RT(e){return e.stopPropagation()}function zT(e){return e.preventDefault()}function BT(e){return!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`}var VT=A.extend({addNodeView(){return Za(IT)}});function HT(e){return e.editorView}function UT(e){if(!e.isDestroyed)return e.extensionManager.extensions.find(e=>e.name===`collaboration`)?.options?.document}function WT(e){return e?e.startsWith(`Unregistered component:`)?`info`:e.startsWith(`Render error in`)?`warn`:`error`:`error`}var GT={info:{wrapperClass:`border-muted-foreground/30 bg-muted/30`,badgeClass:`text-muted-foreground bg-muted`,label:`unknown`},warn:{wrapperClass:`border-amber-400/60 dark:border-amber-500/40 bg-amber-50/50 dark:bg-amber-900/10`,badgeClass:`text-amber-600 dark:text-amber-400 bg-amber-100 dark:bg-amber-900/30`,label:`render error`},error:{wrapperClass:`border-destructive/60 bg-destructive/5`,badgeClass:`text-destructive bg-destructive/10`,label:`parse error`}},KT=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[zt.contextHash,r]]}addChild(e,t){e.prop(zt.contextHash)!=this.hash&&(e=new Ut(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new Ut(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new Ut(Wt.none,e,t,n,this.hashProp)})}},Q;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(Q||={});var qT=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},JT=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return QT(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function YT(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==Q.OrderedList?aE:iE)(n,t,!1);return r>0&&(e.type!=Q.BulletList||nE(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var XT={[Q.Blockquote](e,t,n){return n.next==62?(n.markers.push(NE(Q.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(ZT(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[Q.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[Q.OrderedList]:YT,[Q.BulletList]:YT,[Q.Document](){return!0}};function ZT(e){return e==32||e==9||e==10||e==13}function QT(e,t=0){for(;t<e.length&&ZT(e.charCodeAt(t));)t++;return t}function $T(e,t,n){for(;t>n&&ZT(e.charCodeAt(t-1));)t--;return t}function eE(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function tE(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function nE(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!ZT(n))return-1}return n&&e.next==45&&sE(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(yE.SetextHeading)>-1||r<3?-1:1}function rE(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function iE(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||ZT(e.text.charCodeAt(e.pos+1)))&&(!n||rE(t,Q.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function aE(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!ZT(e.text.charCodeAt(r+1))||n&&!rE(t,Q.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function oE(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function sE(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&ZT(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var cE=/^[ \t]*$/,lE=/-->/,uE=/\?>/,dE=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,lE],[/^\s*<\?/,uE],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,cE],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,cE]];function fE(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=dE.length-+!!n;e<t;e++)if(dE[e][0].test(r))return e;return-1}function pE(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function mE(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==Q.CodeText?e[r].to=n:e.push(NE(Q.CodeText,t,n))}var hE={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(mE(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){mE(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==Q.CodeText?mE(o,e.from,e.to):o.push(e);s=[]}mE(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&mE(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=Q.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(Q.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=eE(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=$T(t.text,t.text.length,o),c=[NE(Q.CodeMark,r,r+a)];o<s&&c.push(NE(Q.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&mE(c,e.lineStart-1,e.lineStart),c.push(NE(Q.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(mE(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(mE(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(Q.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=tE(t);return n<0?!1:(e.startContext(Q.Blockquote,t.pos),e.addNode(Q.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(nE(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(Q.HorizontalRule,n),!0},BulletList(e,t){let n=iE(t,e,!1);if(n<0)return!1;e.block.type!=Q.BulletList&&e.startContext(Q.BulletList,t.basePos,t.next);let r=pE(t,t.pos+1);return e.startContext(Q.ListItem,t.basePos,r-t.baseIndent),e.addNode(Q.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=aE(t,e,!1);if(n<0)return!1;e.block.type!=Q.OrderedList&&e.startContext(Q.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=pE(t,t.pos+n);return e.startContext(Q.ListItem,t.basePos,r-t.baseIndent),e.addNode(Q.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=oE(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=$T(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!ZT(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(Q.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(Q.HeaderMark,o-r,a-r);let c=s.finish(Q.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=fE(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=dE[n][1],a=[],o=i!=cE;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==lE?Q.CommentBlock:i==uE?Q.ProcessingInstructionBlock:Q.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},gE=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
|
|
8
|
-
`+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&QT(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,NE(Q.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(GE(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(NE(Q.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(UE(e,QT(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=QT(e,this.pos),n=0;if(t>this.pos){let r=WE(e,t,this.start);if(r){let t=_E(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=_E(e,this.pos),n>0&&n<e.length?n:-1}else return _E(e,this.pos)}};function _E(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!ZT(n))return-1}return t}var vE=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:sE(t),i=t.next;if(r<0)return!1;let a=NE(Q.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,NE(i==61?Q.SetextHeading1:Q.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},yE={LinkReference(e,t){return t.content.charCodeAt(0)==91?new gE(t):null},SetextHeading(){return new vE}},bE=[(e,t)=>oE(t)>=0,(e,t)=>eE(t)>=0,(e,t)=>tE(t)>=0,(e,t)=>iE(t,e,!0)>=0,(e,t)=>aE(t,e,!0)>=0,(e,t)=>nE(t,e,!0)>=0,(e,t)=>fE(t,e,!0)>=0],xE={text:``,end:0},SE=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new JT,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=KT.create(Q.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new YE(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new qT(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
|
|
9
|
-
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=XE(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=xE;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+Q[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
|
|
10
|
-
`?``:t;else{let e=t.indexOf(`
|
|
11
|
-
`);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=KT.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new Ut(this.parser.nodeSet.types[e],kE,kE,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(qE(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?CE(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=qE(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(Q.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?NE(this.parser.getNodeType(e),t,n,r):new ME(e,t)}get buffer(){return new AE(this.parser.nodeSet)}};function CE(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=CE(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new Ut(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var wE=class e extends tn{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new SE(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=EE(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(TE(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=Q.ATXHeading1&&c<=Q.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(Wt.define({id:c,name:n,props:l&&[[zt.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof Xt?t[n]=s:Object.assign(t,s))}r=new en(e),t&&(r=r.extend(Gt(t)))}if(TE(n.props)&&(r=r.extend(...n.props)),TE(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(TE(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?DE(s,e.before):e.after?DE(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(TE(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?DE(l,e.before):e.after?DE(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new KE(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function TE(e){return e!=null&&e.length>0}function EE(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=EE(e[0]);if(e.length==1)return t;let n=EE(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||kE).concat(t||kE),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function DE(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var OE=[Wt.none];for(let e=1,t;t=Q[e];e++)OE[e]=Wt.define({id:e,name:t,props:e>=Q.Escape?[]:[[zt.group,e in XT?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var kE=[],AE=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return Ut.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},jE=class{constructor(e,t,n,r=kE){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new AE(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},ME=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return kE}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function NE(e,t,n,r){return new jE(e,t,n,r)}var PE={resolve:`Emphasis`,mark:`EmphasisMark`},FE={resolve:`Emphasis`,mark:`EmphasisMark`},IE={},LE={},RE=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},zE=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,BE=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{BE=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var VE={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(zE.charCodeAt(t)==r)return e.append(NE(Q.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(NE(Q.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(NE(Q.InlineCode,n,r+1,[NE(Q.CodeMark,n,n+i),NE(Q.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(NE(Q.Autolink,n,n+1+i[0].length,[NE(Q.LinkMark,n,n+1),NE(Q.URL,n+1,n+i[0].length),NE(Q.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(NE(Q.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(NE(Q.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(NE(Q.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=BE.test(i),s=BE.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new RE(t==95?PE:FE,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(NE(Q.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(NE(Q.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new RE(IE,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new RE(LE,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof RE&&(r.type==IE||r.type==LE)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=HE(e,i,r.type==IE?Q.Link:Q.Image,r.from,n+1);if(r.type==IE)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof RE&&t.type==IE&&(t.side=0)}return a.to}}return-1}};function HE(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(NE(Q.LinkMark,r,r+(n==Q.Image?2:1))),t.push(NE(Q.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=UE(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=WE(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(NE(Q.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(NE(Q.LinkMark,n,s)))}else if(o==91){let n=GE(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return NE(n,r,s,t)}function UE(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return NE(Q.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(ZT(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?NE(Q.URL,t+n,i+n):i==e.length?null:!1}}function WE(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return NE(Q.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function GE(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:NE(Q.LinkLabel,t+n,a+1+n);else{if(r&&!ZT(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var KE=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new RE(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof RE&&(t.type==IE||t.type==LE))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof RE&&n.type.resolve&&n.side&2))continue;let r=n.type==PE||n.type==FE,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof RE&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof jE&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new RE(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new RE(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof jE&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof RE&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof RE?t:null}skipSpace(e){return QT(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?NE(this.parser.getNodeType(e),t,n,r):new ME(e,t)}};KE.linkStart=IE,KE.imageStart=LE;function qE(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof jE&&(n[r]=new jE(t.type,t.from,t.to,qE(t.children,[e])))}else n.splice(r++,0,e)}return n}var JE=[Q.CodeBlock,Q.ListItem,Q.OrderedList,Q.BulletList],YE=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
|
|
12
|
-
`;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(zt.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=XE(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new Ut(e.parser.nodeSet.types[Q.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(JE.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function XE(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var ZE=Gt({"Blockquote/...":G.quote,HorizontalRule:G.contentSeparator,"ATXHeading1/... SetextHeading1/...":G.heading1,"ATXHeading2/... SetextHeading2/...":G.heading2,"ATXHeading3/...":G.heading3,"ATXHeading4/...":G.heading4,"ATXHeading5/...":G.heading5,"ATXHeading6/...":G.heading6,"Comment CommentBlock":G.comment,Escape:G.escape,Entity:G.character,"Emphasis/...":G.emphasis,"StrongEmphasis/...":G.strong,"Link/... Image/...":G.link,"OrderedList/... BulletList/...":G.list,"BlockQuote/...":G.quote,"InlineCode CodeText":G.monospace,"URL Autolink":G.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":G.processingInstruction,"CodeInfo LinkLabel":G.labelName,LinkTitle:G.string,Paragraph:G.content}),QE=new wE(new en(OE).extend(ZE),Object.keys(hE).map(e=>hE[e]),Object.keys(hE).map(e=>yE[e]),Object.keys(hE),bE,XT,Object.keys(VE).map(e=>VE[e]),Object.keys(VE),[]);function $E(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function eD(e){let{codeParser:t,htmlParser:n}=e;return{wrap:Kt((e,r)=>{let i=e.type.id;if(t&&(i==Q.CodeBlock||i==Q.FencedCode)){let n=``;if(i==Q.FencedCode){let t=e.node.getChild(Q.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==Q.CodeText,bracketed:i==Q.FencedCode}}else if(n&&(i==Q.HTMLBlock||i==Q.HTMLTag||i==Q.CommentBlock))return{parser:n,overlay:$E(e.node,e.from,e.to)};return null})}}var tD={resolve:`Strikethrough`,mark:`StrikethroughMark`},nD={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":G.strikethrough}},{name:`StrikethroughMark`,style:G.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=BE.test(r),c=BE.test(i);return e.addDelimiter(tD,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function rD(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function iD(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var aD=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,oD=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&aD.test(r=t.text.slice(t.pos))){let i=[];rD(e,n.content,0,i,n.start)==rD(e,r,t.pos)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];rD(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},sD={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":G.heading}},`TableRow`,{name:`TableCell`,style:G.content},{name:`TableDelimiter`,style:G.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return iD(t.content,0)?new oD:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof oD)||!iD(t.text,t.basePos))return!1;let r=e.peekLine();return aD.test(r)&&rD(e,t.text,t.basePos)==rD(e,r,t.basePos)},before:`SetextHeading`}]},cD=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},lD={defineNodes:[{name:`Task`,block:!0,style:G.list},{name:`TaskMarker`,style:G.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new cD:null},after:`SetextHeading`}]},uD=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,dD=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,fD=/[\w-]+\.[\w-]+($|\/)/,pD=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,mD=/\/[a-zA-Z\d@.]+/gy;function hD(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function gD(e,t){dD.lastIndex=t;let n=dD.exec(e);if(!n||fD.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&hD(e,t,r,`)`)>hD(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function _D(e,t){pD.lastIndex=t;let n=pD.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var vD=[sD,lD,nD,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;uD.lastIndex=r;let i=uD.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=gD(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=_D(e.text,r):(a=_D(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(mD.lastIndex=a,i=mD.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function yD(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),ZT(s))break}return-1}}var bD={defineNodes:[{name:`Superscript`,style:G.special(G.content)},{name:`SuperscriptMark`,style:G.processingInstruction}],parseInline:[{name:`Superscript`,parse:yD(94,`Superscript`,`SuperscriptMark`)}]},xD={defineNodes:[{name:`Subscript`,style:G.special(G.content)},{name:`SubscriptMark`,style:G.processingInstruction}],parseInline:[{name:`Subscript`,parse:yD(126,`Subscript`,`SubscriptMark`)}]},SD={defineNodes:[{name:`Emoji`,style:G.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},CD=55,wD=1,TD=56,ED=2,DD=57,OD=3,kD=4,AD=5,jD=6,MD=7,ND=8,PD=9,FD=10,ID=11,LD=12,RD=13,zD=58,BD=14,VD=15,HD=59,UD=21,WD=23,GD=24,KD=25,qD=27,JD=28,YD=29,XD=32,ZD=35,QD=37,$D=38,eO=0,tO=1,nO={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},rO={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},iO={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function aO(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var oO=null,sO=null,cO=0;function lO(e,t){let n=e.pos+t;if(cO==n&&sO==e)return oO;let r=e.peek(t),i=``;for(;aO(r);)i+=String.fromCharCode(r),r=e.peek(++t);return sO=e,cO=n,oO=i?i.toLowerCase():r==pO||r==mO?void 0:null}var uO=60,dO=62,fO=47,pO=63,mO=33,hO=45;function gO(e,t){this.name=e,this.parent=t}var _O=[jD,FD,MD,ND,PD],vO=new Fn({start:null,shift(e,t,n,r){return _O.indexOf(t)>-1?new gO(lO(r,1)||``,e):e},reduce(e,t){return t==UD&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==jD||i==QD?new gO(lO(r,1)||``,e):e},strict:!1}),yO=new Nn((e,t)=>{if(e.next!=uO){e.next<0&&t.context&&e.acceptToken(zD);return}e.advance();let n=e.next==fO;n&&e.advance();let r=lO(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?VD:BD);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(ID);if(i&&rO[i])return e.acceptToken(zD,-2);if(t.dialectEnabled(eO))return e.acceptToken(LD);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(RD)}else{if(r==`script`)return e.acceptToken(MD);if(r==`style`)return e.acceptToken(ND);if(r==`textarea`)return e.acceptToken(PD);if(nO.hasOwnProperty(r))return e.acceptToken(FD);i&&iO[i]&&iO[i][r]?e.acceptToken(zD,-1):e.acceptToken(jD)}},{contextual:!0}),bO=new Nn(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(HD);break}if(e.next==hO)t++;else if(e.next==dO&&t>=2){n>=3&&e.acceptToken(HD,-2);break}else t=0;e.advance()}});function xO(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var SO=new Nn((e,t)=>{if(e.next==fO&&e.peek(1)==dO){let n=t.dialectEnabled(tO)||xO(t.context);e.acceptToken(n?AD:kD,2)}else e.next==dO&&e.acceptToken(kD,1)});function CO(e,t,n){let r=2+e.length;return new Nn(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==uO||a==1&&i.next==fO||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==dO){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var wO=CO(`script`,CD,wD),TO=CO(`style`,TD,ED),EO=CO(`textarea`,DD,OD),DO=Gt({"Text RawText IncompleteTag IncompleteCloseTag":G.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":G.angleBracket,TagName:G.tagName,"MismatchedCloseTag/TagName":[G.tagName,G.invalid],AttributeName:G.attributeName,"AttributeValue UnquotedAttributeValue":G.attributeValue,Is:G.definitionOperator,"EntityReference CharacterReference":G.character,Comment:G.blockComment,ProcessingInst:G.processingInstruction,DoctypeDecl:G.documentMeta}),OO=Pn.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ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VPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:vO,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[DO],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!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pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[wO,TO,EO,SO,yO,bO,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function kO(e,t){let n=Object.create(null);for(let r of e.getChildren(GD)){let e=r.getChild(KD),i=r.getChild(qD)||r.getChild(JD);e&&(n[t.read(e.from,e.to)]=i?i.type.id==qD?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function AO(e,t){let n=e.getChild(WD);return n?t.read(n.from,n.to):` `}function jO(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=kO(e.node.parent.firstChild,t)))return{parser:i.parser,bracketed:!0};return null}function MO(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return Kt((e,t)=>{let s=e.type.id;if(s==YD)return jO(e,t,n);if(s==XD)return jO(e,t,r);if(s==ZD)return jO(e,t,i);if(s==UD&&a.length){let n=e.node,r=n.firstChild,i=r&&AO(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=kO(r,t)))){let t=n.lastChild,i=t.type.id==$D?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==GD){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=AO(n.parent,t))continue;let e=n.lastChild;if(e.type.id==qD){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}],bracketed:!0}}else if(e.type.id==JD)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var NO=135,PO=1,FO=136,IO=137,LO=2,RO=138,zO=3,BO=4,VO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],HO=58,UO=40,WO=95,GO=91,KO=45,qO=46,JO=35,YO=37,XO=38,ZO=92,QO=10,$O=42;function ek(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function tk(e){return e>=48&&e<=57}function nk(e){return tk(e)||e>=97&&e<=102||e>=65&&e<=70}var rk=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(ek(c)||c==KO||c==WO||a&&tk(c))!a&&(c!=KO||s>0)&&(a=!0),o===s&&c==KO&&o++,r.advance();else if(c==ZO&&r.peek(1)!=QO){if(r.advance(),nk(r.next)){do r.advance();while(nk(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(LO)?t:c==UO?n:e);break}}},ik=new Nn(rk(FO,LO,IO),{contextual:!0}),ak=new Nn(rk(RO,zO,BO),{contextual:!0}),ok=new Nn(e=>{if(VO.includes(e.peek(-1))){let{next:t}=e;(ek(t)||t==WO||t==JO||t==qO||t==$O||t==GO||t==HO&&ek(e.peek(1))||t==KO||t==XO)&&e.acceptToken(NO)}}),sk=new Nn(e=>{if(!VO.includes(e.peek(-1))){let{next:t}=e;if(t==YO&&(e.advance(),e.acceptToken(PO)),ek(t)){do e.advance();while(ek(e.next)||tk(e.next));e.acceptToken(PO)}}}),ck=Gt({"AtKeyword import charset namespace keyframes media supports font-feature-values":G.definitionKeyword,"from to selector scope MatchFlag":G.keyword,NamespaceName:G.namespace,KeyframeName:G.labelName,KeyframeRangeName:G.operatorKeyword,TagName:G.tagName,ClassName:G.className,PseudoClassName:G.constant(G.className),IdName:G.labelName,"FeatureName PropertyName":G.propertyName,AttributeName:G.attributeName,NumberLiteral:G.number,KeywordQuery:G.keyword,UnaryQueryOp:G.operatorKeyword,"CallTag ValueName FontName":G.atom,VariableName:G.variableName,Callee:G.operatorKeyword,Unit:G.unit,"UniversalSelector NestingSelector":G.definitionOperator,"MatchOp CompareOp":G.compareOperator,"ChildOp SiblingOp, LogicOp":G.logicOperator,BinOp:G.arithmeticOperator,Important:G.modifier,Comment:G.blockComment,ColorLiteral:G.color,"ParenthesizedContent StringLiteral":G.string,":":G.punctuation,"PseudoOp #":G.derefOperator,"; , |":G.separator,"( )":G.paren,"[ ]":G.squareBracket,"{ }":G.brace}),lk={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},uk={__proto__:null,or:104,and:104,not:112,only:112,layer:186},dk={__proto__:null,selector:118,layer:182},fk={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-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!qR%q$e",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles`,maxTerm:159,nodeProps:[[`isolate`,-2,5,39,``],[`openedBy`,23,`(`,31,`[`,34,`{`],[`closedBy`,24,`)`,32,`]`,35,`}`]],propSources:[ck],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#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`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[ok,sk,ik,ak,1,2,3,4,new Mn(`m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~`,28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>lk[e]||-1},{term:138,get:e=>uk[e]||-1},{term:4,get:e=>dk[e]||-1},{term:28,get:e=>fk[e]||-1},{term:136,get:e=>pk[e]||-1}],tokenPrec:2256}),hk=null;function gk(){if(!hk&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));hk=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return hk||[]}var _k=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),vk=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),yk=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),bk=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),xk=/^(\w[\w-]*|-\w[\w-]*|)$/,Sk=/^-(-[\w-]*)?$/;function Ck(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var wk=new $t,Tk=[`Declaration`];function Ek(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function Dk(e,t,n){if(t.to-t.from>4096){let r=wk.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(Dn.IncludeAnonymous);if(o.firstChild())do for(let t of Dk(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return wk.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(Tk)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var Ok=(e=>t=>{let{state:n,pos:r}=t,i=Jt(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:gk(),validFor:xk};if(i.name==`ValueName`)return{from:i.from,options:vk,validFor:xk};if(i.name==`PseudoClassName`)return{from:i.from,options:_k,validFor:xk};if(e(i)||(t.explicit||a)&&Ck(i,n.doc))return{from:e(i)||a?i.from:r,options:Dk(n.doc,Ek(i),e),validFor:Sk};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:gk(),validFor:xk};return{from:i.from,options:yk,validFor:xk}}if(i.name==`AtKeyword`)return{from:i.from,options:bk,validFor:xk};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:_k,validFor:xk}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:vk,validFor:xk}:o.name==`Block`||o.name==`Styles`?{from:r,options:gk(),validFor:xk}:null})(e=>e.name==`VariableName`),kk=bn.define({name:`css`,parser:mk.configure({props:[wn.add({Declaration:Cn()}),En.add({"Block KeyframeList":an})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function Ak(){return new _n(kk,kk.data.of({autocomplete:Ok}))}var jk=316,Mk=317,Nk=1,Pk=2,Fk=3,Ik=4,Lk=318,Rk=320,zk=321,Bk=5,Vk=6,Hk=0,Uk=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Wk=125,Gk=59,Kk=47,qk=42,Jk=43,Yk=45,Xk=60,Zk=44,Qk=63,$k=46,eA=91,tA=new Fn({start:!1,shift(e,t){return t==Bk||t==Vk||t==Rk?e:t==zk},strict:!1}),nA=new Nn((e,t)=>{let{next:n}=e;(n==Wk||n==-1||t.context)&&e.acceptToken(Lk)},{contextual:!0,fallback:!0}),rA=new Nn((e,t)=>{let{next:n}=e,r;Uk.indexOf(n)>-1||n==Kk&&((r=e.peek(1))==Kk||r==qk)||n!=Wk&&n!=Gk&&n!=-1&&!t.context&&e.acceptToken(jk)},{contextual:!0}),iA=new Nn((e,t)=>{e.next==eA&&!t.context&&e.acceptToken(Mk)},{contextual:!0}),aA=new Nn((e,t)=>{let{next:n}=e;if(n==Jk||n==Yk){if(e.advance(),n==e.next){e.advance();let n=!t.context&&t.canShift(Nk);e.acceptToken(n?Nk:Pk)}}else n==Qk&&e.peek(1)==$k&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(Fk))},{contextual:!0});function oA(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}var sA=new Nn((e,t)=>{if(e.next!=Xk||!t.dialectEnabled(Hk)||(e.advance(),e.next==Kk))return;let n=0;for(;Uk.indexOf(e.next)>-1;)e.advance(),n++;if(oA(e.next,!0)){for(e.advance(),n++;oA(e.next,!1);)e.advance(),n++;for(;Uk.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==Zk)return;for(let t=0;;t++){if(t==7){if(!oA(e.next,!0))return;break}if(e.next!=`extends`.charCodeAt(t))break;e.advance(),n++}}e.acceptToken(Ik,-n)}),cA=Gt({"get set async static":G.modifier,"for while do if else switch try catch finally return throw break continue default case defer":G.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":G.operatorKeyword,"let var const using function class extends":G.definitionKeyword,"import export from":G.moduleKeyword,"with debugger new":G.keyword,TemplateString:G.special(G.string),super:G.atom,BooleanLiteral:G.bool,this:G.self,null:G.null,Star:G.modifier,VariableName:G.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":G.function(G.variableName),VariableDefinition:G.definition(G.variableName),Label:G.labelName,PropertyName:G.propertyName,PrivatePropertyName:G.special(G.propertyName),"CallExpression/MemberExpression/PropertyName":G.function(G.propertyName),"FunctionDeclaration/VariableDefinition":G.function(G.definition(G.variableName)),"ClassDeclaration/VariableDefinition":G.definition(G.className),"NewExpression/VariableName":G.className,PropertyDefinition:G.definition(G.propertyName),PrivatePropertyDefinition:G.definition(G.special(G.propertyName)),UpdateOp:G.updateOperator,"LineComment Hashbang":G.lineComment,BlockComment:G.blockComment,Number:G.number,String:G.string,Escape:G.escape,ArithOp:G.arithmeticOperator,LogicOp:G.logicOperator,BitOp:G.bitwiseOperator,CompareOp:G.compareOperator,RegExp:G.regexp,Equals:G.definitionOperator,Arrow:G.function(G.punctuation),": Spread":G.punctuation,"( )":G.paren,"[ ]":G.squareBracket,"{ }":G.brace,"InterpolationStart InterpolationEnd":G.special(G.brace),".":G.derefOperator,", ;":G.separator,"@":G.meta,TypeName:G.typeName,TypeDefinition:G.definition(G.typeName),"type enum interface implements namespace module declare":G.definitionKeyword,"abstract global Privacy readonly override":G.modifier,"is keyof unique infer asserts":G.operatorKeyword,JSXAttributeValue:G.attributeValue,JSXText:G.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":G.angleBracket,"JSXIdentifier JSXNameSpacedName":G.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":G.attributeName,"JSXBuiltin/JSXIdentifier":G.standard(G.tagName)}),lA={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},uA={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},dA={__proto__:null,"<":193},fA=Pn.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'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4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:`⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem`,maxTerm:380,context:tA,nodeProps:[[`isolate`,-8,5,6,14,37,39,51,53,55,``],[`group`,-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,`Statement`,-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,`Expression`,-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,`Type`,-3,88,103,109,`ClassItem`],[`openedBy`,23,`<`,38,`InterpolationStart`,56,`[`,60,`{`,73,`(`,160,`JSXStartCloseTag`],[`closedBy`,-2,24,168,`>`,40,`InterpolationEnd`,50,`]`,61,`}`,74,`)`,165,`JSXEndTag`]],propSources:[cA],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!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Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Mn(`j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~`,25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>lA[e]||-1},{term:343,get:e=>uA[e]||-1},{term:95,get:e=>dA[e]||-1}],tokenPrec:15201}),pA=[kn("function ${name}(${params}) {\n ${}\n}",{label:`function`,detail:`definition`,type:`keyword`}),kn("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:`for`,detail:`loop`,type:`keyword`}),kn("for (let ${name} of ${collection}) {\n ${}\n}",{label:`for`,detail:`of loop`,type:`keyword`}),kn(`do {
|
|
13
|
-
\${}
|
|
14
|
-
} while (\${})`,{label:`do`,detail:`loop`,type:`keyword`}),kn(`while (\${}) {
|
|
15
|
-
\${}
|
|
16
|
-
}`,{label:`while`,detail:`loop`,type:`keyword`}),kn(`try {
|
|
17
|
-
\${}
|
|
18
|
-
} catch (\${error}) {
|
|
19
|
-
\${}
|
|
20
|
-
}`,{label:`try`,detail:`/ catch block`,type:`keyword`}),kn(`if (\${}) {
|
|
21
|
-
\${}
|
|
22
|
-
}`,{label:`if`,detail:`block`,type:`keyword`}),kn(`if (\${}) {
|
|
23
|
-
\${}
|
|
24
|
-
} else {
|
|
25
|
-
\${}
|
|
26
|
-
}`,{label:`if`,detail:`/ else block`,type:`keyword`}),kn(`class \${name} {
|
|
27
|
-
constructor(\${params}) {
|
|
28
|
-
\${}
|
|
29
|
-
}
|
|
30
|
-
}`,{label:`class`,detail:`definition`,type:`keyword`}),kn('import {${names}} from "${module}"\n${}',{label:`import`,detail:`named`,type:`keyword`}),kn('import ${name} from "${module}"\n${}',{label:`import`,detail:`default`,type:`keyword`})],mA=pA.concat([kn(`interface \${name} {
|
|
31
|
-
\${}
|
|
32
|
-
}`,{label:`interface`,detail:`definition`,type:`keyword`}),kn("type ${name} = ${type}",{label:`type`,detail:`definition`,type:`keyword`}),kn(`enum \${name} {
|
|
33
|
-
\${}
|
|
34
|
-
}`,{label:`enum`,detail:`definition`,type:`keyword`})]),hA=new $t,gA=new Set([`Script`,`Block`,`FunctionExpression`,`FunctionDeclaration`,`ArrowFunction`,`MethodDeclaration`,`ForStatement`]);function _A(e){return(t,n)=>{let r=t.node.getChild(`VariableDefinition`);return r&&n(r,e),!0}}var vA=[`FunctionDeclaration`],yA={FunctionDeclaration:_A(`function`),ClassDeclaration:_A(`class`),ClassExpression:()=>!0,EnumDeclaration:_A(`constant`),TypeAliasDeclaration:_A(`type`),NamespaceDeclaration:_A(`namespace`),VariableDefinition(e,t){e.matchContext(vA)||t(e,`variable`)},TypeDefinition(e,t){t(e,`type`)},__proto__:null};function bA(e,t){let n=hA.get(t);if(n)return n;let r=[],i=!0;function a(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}return t.cursor(Dn.IncludeAnonymous).iterate(t=>{if(i)i=!1;else if(t.name){let e=yA[t.name];if(e&&e(t,a)||gA.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of bA(e,t.node))r.push(n);return!1}}),hA.set(t,r),r}var xA=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,SA=[`TemplateString`,`String`,`RegExp`,`LineComment`,`BlockComment`,`VariableDefinition`,`TypeDefinition`,`Label`,`PropertyDefinition`,`PropertyName`,`PrivatePropertyDefinition`,`PrivatePropertyName`,`JSXText`,`JSXAttributeValue`,`JSXOpenTag`,`JSXCloseTag`,`JSXSelfClosingTag`,`.`,`?.`];function CA(e){let t=Jt(e.state).resolveInner(e.pos,-1);if(SA.indexOf(t.name)>-1)return null;let n=t.name==`VariableName`||t.to-t.from<20&&xA.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)gA.has(n.name)&&(r=r.concat(bA(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:xA}}var wA=bn.define({name:`javascript`,parser:fA.configure({props:[wn.add({IfStatement:Cn({except:/^\s*({|else\b)/}),TryStatement:Cn({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:ln,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:vn({closing:`}`}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Cn({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),En.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":an,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name==`JSXSelfClosingTag`)return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){let t=e.firstChild?.nextSibling,n=e.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:`$`}}),TA={test:e=>/^JSX/.test(e.name),facet:cn({commentTokens:{block:{open:`{/*`,close:`*/}`}}})},EA=wA.configure({dialect:`ts`},`typescript`),DA=wA.configure({dialect:`jsx`,props:[dn.add(e=>e.isTop?[TA]:void 0)]}),OA=wA.configure({dialect:`jsx ts`,props:[dn.add(e=>e.isTop?[TA]:void 0)]},`typescript`),kA=e=>({label:e,type:`keyword`}),AA=`break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield`.split(` `).map(kA),jA=AA.concat([`declare`,`implements`,`private`,`protected`,`public`].map(kA));function MA(e={}){let t=e.jsx?e.typescript?OA:DA:e.typescript?EA:wA,n=e.typescript?mA.concat(jA):pA.concat(AA);return new _n(t,[wA.data.of({autocomplete:An(SA,On(n))}),wA.data.of({autocomplete:CA}),e.jsx?IA:[]])}function NA(e){for(;;){if(e.name==`JSXOpenTag`||e.name==`JSXSelfClosingTag`||e.name==`JSXFragmentTag`)return e;if(e.name==`JSXEscape`||!e.parent)return null;e=e.parent}}function PA(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name==`JSXIdentifier`||r.name==`JSXBuiltin`||r.name==`JSXNamespacedName`||r.name==`JSXMemberExpression`)return e.sliceString(r.from,Math.min(r.to,n));return``}var FA=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),IA=nn.inputHandler.of((e,t,n,r,i)=>{if((FA?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!wA.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=Jt(o).resolveInner(t-1,-1),i;if(n.name==`JSXStartTag`&&(n=n.parent),!(o.doc.sliceString(t-1,t)!=r||n.name==`JSXAttributeValue`&&n.to>t)){if(r==`>`&&n.name==`JSXFragmentTag`)return{range:e,changes:{from:t,insert:`</>`}};if(r==`/`&&n.name==`JSXStartCloseTag`){let e=n.parent,r=e.parent;if(r&&e.from==t-2&&((i=PA(o.doc,r.firstChild,t))||r.firstChild?.name==`JSXFragmentTag`)){let e=`${i}>`;return{range:Qt.cursor(t+e.length,-1),changes:{from:t,insert:e}}}}else if(r==`>`){let r=NA(n);if(r&&r.name==`JSXOpenTag`&&!/^\/?>|^<\//.test(o.doc.sliceString(t,t+2))&&(i=PA(o.doc,r,t)))return{range:e,changes:{from:t,insert:`</${i}>`}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),LA=[`_blank`,`_self`,`_top`,`_parent`],RA=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],zA=[`get`,`post`,`put`,`delete`],BA=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],VA=[`true`,`false`],$={},HA={a:{attrs:{href:null,ping:null,type:null,media:null,target:LA,hreflang:null}},abbr:$,address:$,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:$,aside:$,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:$,base:{attrs:{href:null,target:LA}},bdi:$,bdo:$,blockquote:{attrs:{cite:null}},body:$,br:$,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:BA,formmethod:zA,formnovalidate:[`novalidate`],formtarget:LA,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:$,center:$,cite:$,code:$,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:$,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:$,div:$,dl:$,dt:$,em:$,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:$,figure:$,footer:$,form:{attrs:{action:null,name:null,"accept-charset":RA,autocomplete:[`on`,`off`],enctype:BA,method:zA,novalidate:[`novalidate`],target:LA}},h1:$,h2:$,h3:$,h4:$,h5:$,h6:$,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:$,hgroup:$,hr:$,html:{attrs:{manifest:null}},i:$,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:BA,formmethod:zA,formnovalidate:[`novalidate`],formtarget:LA,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:$,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:$,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:$,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:RA,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:$,noscript:$,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:$,param:{attrs:{name:null,value:null}},pre:$,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:$,rt:$,ruby:$,samp:$,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:RA}},section:$,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:$,source:{attrs:{src:null,type:null,media:null}},span:$,strong:$,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:$,summary:$,sup:$,table:$,tbody:$,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:$,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:$,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:$,time:{attrs:{datetime:null}},title:$,tr:$,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:$,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:$},UA={accesskey:null,class:null,contenteditable:VA,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:VA,autocorrect:VA,autocapitalize:VA,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":VA,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":VA,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":VA,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":VA,"aria-hidden":VA,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":VA,"aria-multiselectable":VA,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":VA,"aria-relevant":null,"aria-required":VA,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},WA=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of WA)UA[e]=null;var GA=class{constructor(e,t){this.tags={...HA,...e},this.globalAttrs={...UA,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};GA.default=new GA;function KA(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function qA(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function JA(e,t,n){return n.tags[KA(e,qA(t))]?.children||n.allTags}function YA(e,t){let n=[];for(let r=qA(t);r&&!r.type.isTop;r=qA(r.parent)){let i=KA(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var XA=/^[:\-\.\w\u00b7-\uffff]*$/;function ZA(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=qA(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:JA(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(YA(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function QA(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:YA(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:XA}}function $A(e,t,n,r){let i=[],a=0;for(let r of JA(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of YA(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function ej(e,t,n,r,i){let a=qA(n),o=a?t.tags[KA(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:XA}}function tj(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=qA(n),i=r?t.tags[KA(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function nj(e,t){let{state:n,pos:r}=t,i=Jt(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?QA(n,i,i.from,r):ZA(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?ZA(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?QA(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?ej(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?tj(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?$A(n,e,i,r):null}function rj(e){return nj(GA.default,e)}function ij(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new GA(t,n):GA.default;return e=>nj(r,e)}var aj=wA.parser.configure({top:`SingleExpression`}),oj=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:EA.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:DA.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:OA.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:aj},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:wA.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:kk.parser}],sj=[{name:`style`,parser:kk.parser.configure({top:`Styles`})}].concat(WA.map(e=>({name:e,parser:wA.parser}))),cj=bn.define({name:`html`,parser:OO.configure({props:[wn.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),En.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),hn.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),lj=cj.configure({wrap:MO(oj,sj)});function uj(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=MO((e.nestedLanguages||[]).concat(oj),(e.nestedAttributes||[]).concat(sj))),new _n(n?cj.configure({wrap:n,dialect:t}):t?lj.configure({dialect:t}):lj,[lj.data.of({autocomplete:ij(e)}),e.autoCloseTags===!1?[]:fj,MA().support,Ak().support])}var dj=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),fj=nn.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!lj.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=Jt(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=KA(o.doc,t.parent,n))&&!dj.has(a))return{range:e,changes:{from:n,to:n+ +(o.doc.sliceString(n,n+1)===`>`),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=KA(o.doc,e,n))&&!dj.has(a)){let e=n+ +(o.doc.sliceString(n,n+1)===`>`),t=`${a}>`;return{range:Qt.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),pj=cn({commentTokens:{block:{open:`<!--`,close:`-->`}}}),mj=new zt,hj=QE.configure({props:[En.add(e=>!e.is(`Block`)||e.is(`Document`)||gj(e)!=null||_j(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),mj.add(gj),wn.add({Document:()=>null}),pn.add({Document:pj})]});function gj(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function _j(e){return e.name==`OrderedList`||e.name==`BulletList`}function vj(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=gj(e.type))!=null&&r<=t)break;n=e}return n.to}var yj=sn.of((e,t,n)=>{for(let r=Jt(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(mj);if(e==null)continue;let t=vj(r,e);if(t>n)return{from:n,to:t}}return null});function bj(e){return new un(pj,e,[],`markdown`)}var xj=bj(hj),Sj=bj(hj.configure([vD,xD,bD,SD,{props:[En.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function Cj(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):on.matchLanguageName(e,n,!0),t instanceof on)return t.support?t.support.language.parser:xn.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var wj=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+Ej(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function Tj(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new wj(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new wj(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new wj(i.parent,s,s+t,a[1],e,n,i))}}return r}function Ej(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Dj(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=Ej(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function Oj(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(Vt)!=` `)return e;let r=Bt(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var kj=((e={})=>({state:t,dispatch:n})=>{let r=Jt(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!Sj.isActiveAt(t,n.from,-1)&&!Sj.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=Tj(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&Dj(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&Dj(e.item,i,r),{range:Qt.cursor(t+n.length),changes:r}}else{let e=Mj(c,t,s);return{range:Qt.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&Dj(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?Bt(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=Oj(p,t),jj(l.node,t.doc)&&(p=Mj(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:Qt.cursor(m+p.length+1),changes:d}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)})();function Aj(e){return e.name==`QuoteMark`||e.name==`ListMark`}function jj(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function Mj(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?Bt(n.text,4,e[t+1].from)-r.length:null,t<i);return Oj(r,t)}function Nj(e,t){let n=e.resolveInner(t,-1),r=t;Aj(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(Aj(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var Pj=[{key:`Enter`,run:kj},{key:`Backspace`,run:({state:e,dispatch:t})=>{let n=Jt(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&Sj.isActiveAt(e,t.from)){let t=a.lineAt(i),r=Tj(Nj(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:Qt.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(Bt(t.text,4,n.to)-Bt(t.text,4,n.from));return r==t.from&&(i=Oj(i,e)),{range:Qt.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:Qt.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)}}],Fj=uj({matchClosingTags:!1});function Ij(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=xj,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=Fj}=e;if(!(i instanceof wE))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,yj],u;o&&l.push(Vj),n instanceof _n?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?Cj(t,u):void 0;c.push(eD({codeParser:d,htmlParser:s.language.parser})),r&&l.push(mn.high(gn.of(Pj)));let f=bj(i.configure(c));return a&&l.push(f.data.of({autocomplete:Lj})),new _n(f,l)}function Lj(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=Jt(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:zj(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var Rj=null;function zj(){if(Rj)return Rj;let e=rj(new jn(Ht.create({extensions:Fj}),0,!0));return Rj=e?e.options:[]}var Bj=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Vj=nn.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!Sj.isActiveAt(t.state,n.from,1)))return!1;let i=Jt(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||Bj.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});function Hj(){return Hj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hj.apply(null,arguments)}var Uj=e=>{var{theme:t,settings:n={},styles:r=[]}=e,i={".cm-gutters":{}},a={};n.background&&(a.backgroundColor=n.background),n.backgroundImage&&(a.backgroundImage=n.backgroundImage),n.foreground&&(a.color=n.foreground),n.fontSize&&(a.fontSize=n.fontSize),(n.background||n.foreground)&&(i[`&`]=a),n.fontFamily&&(i[`&.cm-editor .cm-scroller`]={fontFamily:n.fontFamily}),n.gutterBackground&&(i[`.cm-gutters`].backgroundColor=n.gutterBackground),n.gutterForeground&&(i[`.cm-gutters`].color=n.gutterForeground),n.gutterBorder&&(i[`.cm-gutters`].borderRightColor=n.gutterBorder),n.caret&&(i[`.cm-content`]={caretColor:n.caret},i[`.cm-cursor, .cm-dropCursor`]={borderLeftColor:n.caret});var o={};return n.gutterActiveForeground&&(o.color=n.gutterActiveForeground),n.lineHighlight&&(i[`.cm-activeLine`]={backgroundColor:n.lineHighlight},o.backgroundColor=n.lineHighlight),i[`.cm-activeLineGutter`]=o,n.selection&&(i[`&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection`]={background:n.selection+` !important`}),n.selectionMatch&&(i[`& .cm-selectionMatch`]={backgroundColor:n.selectionMatch}),[nn.theme(i,{dark:t===`dark`}),qt(Sn.define(r))]},Wj={background:`#2E3235`,foreground:`#DDDDDD`,caret:`#DDDDDD`,selection:`#202325`,selectionMatch:`#202325`,gutterBackground:`#292d30`,gutterForeground:`#808080`,gutterBorder:`1px solid #ffffff10`,lineHighlight:`#B9D2FF30`},Gj=[{tag:G.keyword,color:`#fda331`},{tag:[G.name,G.deleted,G.character,G.propertyName,G.macroName],color:`#b5bd68`},{tag:[G.variableName],color:`#6fb3d2`},{tag:[G.function(G.variableName)],color:`#fda331`},{tag:[G.labelName],color:`#fc6d24`},{tag:[G.color,G.constant(G.name),G.standard(G.name)],color:`#fda331`},{tag:[G.definition(G.name),G.separator],color:`#cc99cc`},{tag:[G.brace],color:`#cc99cc`},{tag:[G.annotation],color:`#fc6d24`},{tag:[G.number,G.changed,G.annotation,G.modifier,G.self,G.namespace],color:`#fda331`},{tag:[G.typeName,G.className],color:`#6fb3d2`},{tag:[G.operator,G.operatorKeyword],color:`#cc99cc`},{tag:[G.tagName],color:`#fda331`},{tag:[G.squareBracket],color:`#cc99cc`},{tag:[G.angleBracket],color:`#cc99cc`},{tag:[G.attributeName],color:`#6fb3d2`},{tag:[G.regexp],color:`#fda331`},{tag:[G.quote],color:`#DDDDDD`},{tag:[G.string],color:`#b5bd68`},{tag:G.link,color:`#6987AF`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[G.url,G.escape,G.special(G.string)],color:`#8abeb7`},{tag:[G.meta],color:`#A54543`},{tag:[G.comment],color:`#808080`,fontStyle:`italic`},{tag:G.monospace,color:`#DDDDDD`},{tag:G.strong,fontWeight:`bold`,color:`#fda331`},{tag:G.emphasis,fontStyle:`italic`,color:`#6fb3d2`},{tag:G.strikethrough,textDecoration:`line-through`},{tag:G.heading,fontWeight:`bold`,color:`#DDDDDD`},{tag:G.special(G.heading1),fontWeight:`bold`,color:`#DDDDDD`},{tag:G.heading1,fontWeight:`bold`,color:`#DDDDDD`},{tag:[G.heading2,G.heading3,G.heading4],fontWeight:`bold`,color:`#DDDDDD`},{tag:[G.heading5,G.heading6],color:`#DDDDDD`},{tag:[G.atom,G.bool,G.special(G.variableName)],color:`#8abeb7`},{tag:[G.processingInstruction,G.inserted],color:`#8abeb7`},{tag:[G.contentSeparator],color:`#6fb3d2`},{tag:G.invalid,color:`#B9D2FF`,borderBottom:`1px dotted #fc6d24`}],Kj=e=>{var{theme:t=`dark`,settings:n={},styles:r=[]}=e||{};return Uj({theme:t,settings:Hj({},Wj,n),styles:[...Gj,...r]})};Kj();var qj={background:`#ffffff`,foreground:`#2e3440`,caret:`#3b4252`,selection:`#eceff4`,selectionMatch:`#e5e9f0`,gutterBackground:`#eceff4`,gutterForeground:`#2e3440`,gutterBorder:`none`,lineHighlight:`#02255f11`},Jj=[{tag:G.keyword,color:`#5e81ac`},{tag:[G.name,G.deleted,G.character,G.propertyName,G.macroName],color:`#d08770`},{tag:[G.variableName],color:`#d08770`},{tag:[G.function(G.variableName)],color:`#5e81ac`},{tag:[G.labelName],color:`#81a1c1`},{tag:[G.color,G.constant(G.name),G.standard(G.name)],color:`#5e81ac`},{tag:[G.definition(G.name),G.separator],color:`#a3be8c`},{tag:[G.brace],color:`#8fbcbb`},{tag:[G.annotation],color:`#d30102`},{tag:[G.number,G.changed,G.annotation,G.modifier,G.self,G.namespace],color:`#88c0d0`},{tag:[G.typeName,G.className],color:`#ebcb8b`},{tag:[G.operator,G.operatorKeyword],color:`#a3be8c`},{tag:[G.tagName],color:`#b48ead`},{tag:[G.squareBracket],color:`#bf616a`},{tag:[G.angleBracket],color:`#d08770`},{tag:[G.attributeName],color:`#ebcb8b`},{tag:[G.regexp],color:`#5e81ac`},{tag:[G.quote],color:`#3b4252`},{tag:[G.string],color:`#d08770`},{tag:G.link,color:`#8fbcbb`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[G.url,G.escape,G.special(G.string)],color:`#d08770`},{tag:[G.meta],color:`#88c0d0`},{tag:[G.comment],color:`#434c5e`,fontStyle:`italic`},{tag:G.strong,fontWeight:`bold`,color:`#5e81ac`},{tag:G.emphasis,fontStyle:`italic`,color:`#5e81ac`},{tag:G.strikethrough,textDecoration:`line-through`},{tag:G.heading,fontWeight:`bold`,color:`#5e81ac`},{tag:G.special(G.heading1),fontWeight:`bold`,color:`#5e81ac`},{tag:G.heading1,fontWeight:`bold`,color:`#5e81ac`},{tag:[G.heading2,G.heading3,G.heading4],fontWeight:`bold`,color:`#5e81ac`},{tag:[G.heading5,G.heading6],color:`#5e81ac`},{tag:[G.atom,G.bool,G.special(G.variableName)],color:`#d08770`},{tag:[G.processingInstruction,G.inserted],color:`#8fbcbb`},{tag:[G.contentSeparator],color:`#ebcb8b`},{tag:G.invalid,color:`#434c5e`,borderBottom:`1px dotted #d30102`}],Yj=e=>{var{theme:t=`light`,settings:n={},styles:r=[]}=e||{};return Uj({theme:t,settings:Hj({},qj,n),styles:[...Jj,...r]})};Yj();var Xj=[on.of({name:`javascript`,alias:[`js`,`jsx`],extensions:[`js`,`mjs`,`cjs`,`jsx`],load:async()=>MA({jsx:!0})}),on.of({name:`typescript`,alias:[`ts`,`tsx`],extensions:[`ts`,`mts`,`cts`,`tsx`],load:async()=>MA({typescript:!0,jsx:!0})}),on.of({name:`json`,alias:[`jsonc`],extensions:[`json`,`jsonc`],load:()=>n(()=>import(`./dist-C3u7R0q7.js`).then(e=>e.json()),__vite__mapDeps([0,1,2,3,4]),import.meta.url)}),on.of({name:`yaml`,alias:[`yml`],extensions:[`yaml`,`yml`],load:()=>n(()=>import(`./dist-Dtie9-Ui.js`).then(e=>e.yaml()),__vite__mapDeps([5,1,2,3,4]),import.meta.url)}),on.of({name:`css`,alias:[`scss`,`less`],extensions:[`css`,`scss`,`less`],load:async()=>Ak()}),on.of({name:`html`,alias:[`htm`],extensions:[`html`,`htm`],load:async()=>uj()}),on.of({name:`python`,alias:[`py`],extensions:[`py`,`pyw`],load:()=>n(()=>import(`./dist-C82hC0q7.js`).then(e=>e.python()),__vite__mapDeps([6,7,1,2,3,4]),import.meta.url)}),on.of({name:`rust`,alias:[`rs`],extensions:[`rs`],load:()=>n(()=>import(`./dist-mXs-_OvZ.js`).then(e=>e.rust()),__vite__mapDeps([8,1,2,3,4]),import.meta.url)}),on.of({name:`markdown`,alias:[`md`,`mdx`],extensions:[`md`,`mdx`,`markdown`],load:async()=>Ij()}),on.of({name:`bash`,alias:[`sh`,`shell`,`zsh`],extensions:[`sh`,`bash`,`zsh`],load:async()=>{let[{StreamLanguage:e,LanguageSupport:t},{shell:r}]=await Promise.all([n(()=>import(`./dist-dkPJvrfr.js`).then(e=>e.m),__vite__mapDeps([1,2,3]),import.meta.url),n(()=>import(`./shell-BXlbE6k8.js`),[],import.meta.url)]);return new t(e.define(r))}}),on.of({name:`go`,alias:[`golang`],extensions:[`go`],load:async()=>{let[{StreamLanguage:e,LanguageSupport:t},{go:r}]=await Promise.all([n(()=>import(`./dist-dkPJvrfr.js`).then(e=>e.m),__vite__mapDeps([1,2,3]),import.meta.url),n(()=>import(`./go-DoDnGodl.js`),[],import.meta.url)]);return new t(e.define(r))}})],Zj=Yt.define(),Qj=Yt.define(),$j=yn.line({class:`agent-flash`}),eM=Zt.define({create(){return yn.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(Zj)){let{from:r,to:i}=n.value,a=[];for(let e=r;e<=i;){let n=t.state.doc.lineAt(e);a.push($j.range(n.from)),e=n.to+1}e=e.update({add:a,sort:!0})}else n.is(Qj)&&(e=yn.none);return e},provide:e=>nn.decorations.from(e)});function tM(e){let t=e.getMap(`agent-flash`);return[eM,rn.define(e=>{let n=0,r=Date.now(),i=null,a=null,o=!1;function s(){let t=e.state.doc.length;t!==0&&(o||(e.dispatch({effects:Zj.of({from:0,to:t})}),a&&clearTimeout(a),a=setTimeout(()=>{a=null,!o&&e.dispatch({effects:Qj.of(null)})},Ae)))}let c=e=>{if(He(t),!Ce(t,r))return;r=Date.now();let a=Date.now();if(a-n<500){if(!i){let e=500-(a-n);i=setTimeout(()=>{i=null,n=Date.now(),s()},e)}return}n=a,s()};t.observe(c);let l=()=>{document.visibilityState===`visible`?Ce(t,r)&&(r=Date.now(),n=Date.now(),s()):r=Date.now()};return document.addEventListener(`visibilitychange`,l),{update(e){},destroy(){o=!0,t.unobserve(c),document.removeEventListener(`visibilitychange`,l),i&&=(clearTimeout(i),null),a&&=(clearTimeout(a),null)}}})]}var nM=/\[([^\]\n]*)\]\((<[^>\n]+>|[^)\s\n]+)(?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?\)/g,rM=yn.mark({class:`cm-md-internal-link`});function iM(e,t){return t>0&&e[t-1]===`!`}function aM(e){let t=e[2]??``;return t.startsWith(`<`)&&t.endsWith(`>`)?t.slice(1,-1):t}function oM(e){let t=new fn;for(let{from:n,to:r}of e.visibleRanges){let i=e.state.doc.sliceString(n,r);nM.lastIndex=0;let a=nM.exec(i);for(;a!==null;){let e=iM(i,a.index)?null:IS(aM(a));e&&e.kind!==`external`&&t.add(n+a.index,n+a.index+a[0].length,rM),a=nM.exec(i)}}return t.finish()}var sM=rn.fromClass(class{decorations;constructor(e){this.decorations=oM(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=oM(e.view))}},{decorations:e=>e.decorations}),cM=nn.domEventHandlers({mousedown(e,t){if(!e.ctrlKey&&!e.metaKey)return!1;let n=t.posAtCoords({x:e.clientX,y:e.clientY});if(n===null)return!1;let r=t.state.doc.lineAt(n);nM.lastIndex=0;let i=nM.exec(r.text);for(;i!==null;){let t=r.from+i.index,a=t+i[0].length;if(n>=t&&n<=a){let t=iM(r.text,i.index)?null:IS(aM(i));if(t&&t.kind!==`external`)return e.preventDefault(),t.kind===`doc`&&VS(e)?(BS(t),!0):(US(t),!0)}i=nM.exec(r.text)}return!1}}),lM=nn.theme({".cm-md-internal-link":{color:`oklch(52.7% 0.154 228.4)`,fontWeight:`500`},".cm-md-internal-link:hover":{textDecoration:`underline`,cursor:`pointer`}});function uM(){return[sM,cM,lM]}var dM=5e3,fM=null,pM=0,mM=null,hM=new Map;async function gM(){let e=Date.now();return fM&&e-pM<dM?fM:(fM=await YC(),pM=e,mM=SM(fM),fM)}async function _M(e){let t=Date.now(),n=hM.get(e);if(n!==void 0&&t-n.time<dM)return n.headings;try{let n=await XC(e);return hM.set(e,{headings:n,time:t}),n}catch(n){return console.warn(`[wiki-link-source] /api/page-headings fetch failed:`,n),hM.set(e,{headings:[],time:t}),[]}}var vM=/\[\[[^\]]*?\]\]/g,yM=yn.mark({class:`cm-wiki-link`}),bM=yn.mark({class:`cm-wiki-link cm-wiki-link-broken`});function xM(e){let t=new Set;for(let n of e)t.add(n.docName.toLowerCase()),n.title&&t.add(n.title.toLowerCase());return t}function SM(e){let t=xM(e);for(let n of e){let e=n.docName.split(`/`);e.pop();let r=``;for(let n of e)r=r?`${r}/${n}`:n,t.add(r.toLowerCase())}return t}function CM(e){return e.split(/[#|]/)[0].trim().toLowerCase()}function wM(e){let t=new fn,n=fM?mM:null;for(let{from:r,to:i}of e.visibleRanges){let a=e.state.doc.sliceString(r,i);vM.lastIndex=0;let o=vM.exec(a);for(;o!==null;){let e=yM;if(n){let t=CM(o[0].slice(2,-2));t&&!n.has(t)&&(e=bM)}t.add(r+o.index,r+o.index+o[0].length,e),o=vM.exec(a)}}return t.finish()}var TM=rn.fromClass(class{decorations;cacheWarmAtBuild;constructor(e){this.cacheWarmAtBuild=fM!==null,this.decorations=wM(e),this.cacheWarmAtBuild||this.warmCache(e)}update(e){let t=fM!==null;(e.docChanged||e.viewportChanged||!this.cacheWarmAtBuild&&t)&&(this.cacheWarmAtBuild=t,this.decorations=wM(e.view))}warmCache(e){gM().then(()=>{try{e.dispatch({})}catch{}}).catch(e=>{console.warn(`[wiki-link-source] warmCache fetch failed:`,e)})}},{decorations:e=>e.decorations}),EM=/\[\[([^[\]|#]+?)(?:#([^\]|]+?))?(?:\|([^\]]+?))?\]\]/g,DM=nn.domEventHandlers({mousedown(e,t){if(!e.ctrlKey&&!e.metaKey)return!1;let n=t.posAtCoords({x:e.clientX,y:e.clientY});if(n===null)return!1;let r=t.state.doc.lineAt(n);EM.lastIndex=0;let i=EM.exec(r.text);for(;i!==null;){let t=r.from+i.index,a=t+i[0].length;if(n>=t&&n<=a){let t=i[1]?.trim(),n=i[2]?.trim()||null;if(t){let r=ve(t,n);if(!r)return!1;e.preventDefault(),r.kind===`external`?window.open(r.url,`_blank`,`noopener,noreferrer`):VS(e)?BS(r):window.location.hash=r.anchor?`#/${r.docName}?anchor=${encodeURIComponent(r.anchor)}`:`#/${r.docName}`}return!0}i=EM.exec(r.text)}return!1}});async function OM(e){let t=e.state.doc.sliceString(0,e.pos).match(/\[\[([^\]]*)$/);if(!t)return null;let n=t[1],r=e.pos-n.length,i=n.indexOf(`#`);if(i>0){let e=n.slice(0,i),t=n.slice(i+1),a=r+i+1,o=await _M(e);if(!o.length)return null;let s=WC(o,t);return s.length?{from:a,filter:!1,options:s.map(e=>({label:e.text,detail:`H${e.level}`,apply(t,n,r,i){let a=t.state.doc.sliceString(i,i+2)===`]]`?``:`]]`;t.dispatch({changes:{from:r,to:i,insert:e.slug+a},selection:{anchor:r+e.slug.length+a.length}})}}))}:null}return{from:r,filter:!1,options:UC(await gM().catch(e=>(console.warn(`[wiki-link-source] Failed to fetch pages:`,e),[])),n).map(e=>({label:e.title,detail:e.title===e.docName?void 0:e.docName,apply(t,n,r,i){let a=t.state.doc.sliceString(i,i+2)===`]]`?``:`]]`;t.dispatch({changes:{from:r,to:i,insert:e.docName+a},selection:{anchor:r+e.docName.length+a.length}})}}))}}var kM=nn.theme({".cm-wiki-link":{color:`oklch(52.7% 0.154 228.4)`,fontWeight:`500`},".cm-wiki-link:hover":{textDecoration:`underline`,cursor:`pointer`}});function AM(){return[TM,DM,kM,Sj.data.of({autocomplete:OM})]}var jM=Kj({settings:{background:`transparent`,gutterBackground:`transparent`}}),MM=Yj({settings:{background:`transparent`,gutterBackground:`transparent`}});function NM(e){let{themeCompartment:t,resolvedTheme:n,ydoc:r}=e,i=n===`dark`?jM:MM;return[Ij({base:Sj,extensions:[vD],codeLanguages:Xj}),AM(),uM(),...r?[tM(r)]:[],gn.of([]),t.of(i),nn.lineWrapping,...e.extraKeymaps?[e.extraKeymaps]:[]]}function PM(e,t,n){let{state:r}=e,i=r.selection.main;if(!i.empty)return!1;if(t===`line`){let e=r.doc.lineAt(i.head);return n<0?e.from===0:e.to===r.doc.length}return n<0?i.head===0:i.head===r.doc.length}function FM(e){let{pmSel:t,nodePos:n,nodeSize:r,cmDocLen:i,cmSel:a,cmHasFocus:o}=e;if(t instanceof Le&&t.from===n)return o?{kind:`noop`}:{kind:`focus`};let s=n+1,c=n+r-1;if(t.from>=s&&t.to<=c){let e=Math.max(0,Math.min(t.anchor-s,i)),n=Math.max(0,Math.min(t.head-s,i));return a.anchor===e&&a.head===n&&o?{kind:`noop`}:{kind:`selection`,anchor:e,head:n}}return{kind:`noop`}}function IM(e,t){let n=hT().parseWithFallback(e),r;try{r=t.nodeFromJSON(n)}catch(e){return console.warn(JSON.stringify({event:`raw-mdx-upgrade-failure`,reason:e instanceof Error?e.message:String(e)})),null}if(r.childCount===0)return null;let i=[];for(let e=0;e<r.childCount;e++){let t=r.child(e);if(t.type.name===`rawMdxFallback`)return null;i.push(t)}return i}function LM(e,t){if(e===t)return null;let n=0,r=e.length,i=t.length;for(;n<r&&e.charCodeAt(n)===t.charCodeAt(n);)n++;for(;r>n&&i>n&&e.charCodeAt(r-1)===t.charCodeAt(i-1);)r--,i--;return{from:n,to:r,text:t.slice(n,i)}}function RM(e){let t=(0,J.c)(41),{node:n,editor:r,getPos:i}=e,a=(0,K.useRef)(null),o=(0,K.useRef)(null),s=(0,K.useRef)(!1),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=new Tn,t[0]=c):c=t[0];let l=(0,K.useRef)(c),{resolvedTheme:u}=Re(),d=n.attrs.reason||`Parse failed`,f;t[1]===d?f=t[2]:(f=WT(d),t[1]=d,t[2]=f);let p=f,m=GT[p],h;t[3]!==r||t[4]!==i?(h=e=>{let t=typeof i==`function`?i():void 0;if(t===void 0)return;let n=HT(r);if(!n)return;let a=n.state.doc.nodeAt(t);if(!a||a.type.name!==`rawMdxFallback`)return;let o=t+1,c=t+a.nodeSize-1;s.current=!0;try{let t=n.state.tr;if(e.length===0)t.delete(o,c);else{let r=n.state.schema.text(e);t.replaceWith(o,c,r)}n.dispatch(t)}catch(e){let t=e;throw s.current=!1,t}s.current=!1},t[3]=r,t[4]=i,t[5]=h):h=t[5];let g=h,_;t[6]!==r||t[7]!==g||t[8]!==i||t[9]!==n.textContent||t[10]!==u?(_=()=>{let e=a.current;if(!e)return;let t=l.current,c=gn.of([{key:`Mod-z`,run:()=>(r.commands.undo(),!0)},{key:`Mod-y`,run:()=>(r.commands.redo(),!0)},{key:`Mod-Shift-z`,run:()=>(r.commands.redo(),!0)}]),d=e=>{let t=typeof i==`function`?i():void 0;if(typeof t!=`number`)return!1;let n=HT(r);if(!n)return!1;let a=n.state.doc.nodeAt(t);if(!a||a.type.name!==`rawMdxFallback`)return!1;let o=e<0?t:t+a.nodeSize,s=Se.near(n.state.doc.resolve(o),e);return n.dispatch(n.state.tr.setSelection(s).scrollIntoView()),n.focus(),!0},f=gn.of([{key:`ArrowUp`,run:e=>PM(e,`line`,-1)?d(-1):!1},{key:`ArrowLeft`,run:e=>PM(e,`char`,-1)?d(-1):!1},{key:`ArrowDown`,run:e=>PM(e,`line`,1)?d(1):!1},{key:`ArrowRight`,run:e=>PM(e,`char`,1)?d(1):!1}]),p=NM({themeCompartment:t,resolvedTheme:u,ydoc:UT(r)??void 0,extraKeymaps:c});p.push(f),p.push(nn.updateListener.of(e=>{if(e.docChanged&&!s.current&&g(e.state.doc.toString()),e.focusChanged&&e.view.hasFocus&&!s.current){let e=typeof i==`function`?i():void 0;if(typeof e!=`number`)return;let t=HT(r);if(!t)return;let n=t.state.selection;if(n instanceof Le&&n.from===e)return;let a=t.state.doc.nodeAt(e);if(!a||a.type.name!==`rawMdxFallback`)return;s.current=!0;try{t.dispatch(t.state.tr.setSelection(Le.create(t.state.doc,e)))}catch(e){let t=e;throw s.current=!1,t}s.current=!1}if(e.focusChanged&&!e.view.hasFocus&&!s.current){let t=typeof i==`function`?i():void 0;if(typeof t!=`number`)return;let n=HT(r);if(!n)return;let a=n.state.doc.nodeAt(t);if(!a||a.type.name!==`rawMdxFallback`)return;let o=IM(e.view.state.doc.toString(),n.state.schema);if(!o)return;s.current=!0;try{n.dispatch(n.state.tr.replaceWith(t,t+a.nodeSize,o))}catch(e){let t=e;throw s.current=!1,t}s.current=!1}}));let m=new nn({doc:n.textContent,extensions:p,parent:e});o.current=m;let h=BM,_=m.contentDOM;_.addEventListener(`keydown`,h),_.addEventListener(`paste`,h),_.addEventListener(`drop`,h),_.addEventListener(`cut`,h);let v=()=>{_.removeEventListener(`keydown`,h),_.removeEventListener(`paste`,h),_.removeEventListener(`drop`,h),_.removeEventListener(`cut`,h)};return()=>{v(),m.destroy(),o.current=null}},t[6]=r,t[7]=g,t[8]=i,t[9]=n.textContent,t[10]=u,t[11]=_):_=t[11];let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],t[12]=v):v=t[12],(0,K.useEffect)(_,v);let y,b;t[13]===u?(y=t[14],b=t[15]):(y=()=>{let e=o.current;if(!e)return;let t=u===`dark`?jM:MM;e.dispatch({effects:l.current.reconfigure(t)})},b=[u],t[13]=u,t[14]=y,t[15]=b),(0,K.useEffect)(y,b);let x,S;t[16]!==r||t[17]!==i?(x=()=>{let e=()=>{let e=typeof i==`function`?i():void 0;if(typeof e!=`number`)return;let t=o.current;if(!t||s.current)return;let n=HT(r);if(!n)return;let a=n.state.doc.nodeAt(e);if(!a)return;let c=FM({pmSel:n.state.selection,nodePos:e,nodeSize:a.nodeSize,cmDocLen:t.state.doc.length,cmSel:{anchor:t.state.selection.main.anchor,head:t.state.selection.main.head},cmHasFocus:t.hasFocus});if(c.kind!==`noop`){s.current=!0;try{c.kind===`selection`&&t.dispatch({selection:{anchor:c.anchor,head:c.head}}),t.hasFocus||t.focus()}catch(e){let t=e;throw s.current=!1,t}s.current=!1}};return r.on(`selectionUpdate`,e),()=>{r.off(`selectionUpdate`,e)}},S=[r,i],t[16]=r,t[17]=i,t[18]=x,t[19]=S):(x=t[18],S=t[19]),(0,K.useEffect)(x,S);let C=n.textContent,w,T;t[20]===C?(w=t[21],T=t[22]):(w=()=>{let e=o.current;if(!e||s.current)return;let t=LM(e.state.doc.toString(),C);if(t){s.current=!0;try{e.dispatch({changes:{from:t.from,to:t.to,insert:t.text}})}catch(e){let t=e;throw s.current=!1,t}s.current=!1}},T=[C],t[20]=C,t[21]=w,t[22]=T),(0,K.useEffect)(w,T);let E;t[23]!==r||t[24]!==i?(E=()=>{let e=typeof i==`function`?i():void 0;typeof e==`number`&&r.chain().focus().setNodeSelection(e).deleteSelection().run()},t[23]=r,t[24]=i,t[25]=E):E=t[25];let D=E,O=`raw-mdx-fallback-wrapper relative my-2 py-2 rounded border border-dashed ${m.wrapperClass}`,k=`rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider ${m.badgeClass}`,A;t[26]!==d||t[27]!==m.label||t[28]!==k?(A=(0,q.jsx)(`span`,{className:k,title:d,children:m.label}),t[26]=d,t[27]=m.label,t[28]=k,t[29]=A):A=t[29];let j;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,q.jsx)(dr,{size:12}),t[30]=j):j=t[30];let M;t[31]===D?M=t[32]:(M=(0,q.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn jsx-chrome-btn--delete`,"aria-label":`Delete block`,onClick:D,children:j}),t[31]=D,t[32]=M);let N;t[33]!==A||t[34]!==M?(N=(0,q.jsxs)(`div`,{className:`absolute top-1 right-1 z-10 flex items-center gap-1.5`,contentEditable:!1,onMouseDown:zM,children:[A,M]}),t[33]=A,t[34]=M,t[35]=N):N=t[35];let P;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,q.jsx)(`div`,{ref:a,className:`raw-mdx-fallback-cm`}),t[36]=P):P=t[36];let F;return t[37]!==p||t[38]!==O||t[39]!==N?(F=(0,q.jsxs)(Ua,{className:O,contentEditable:!1,"data-drag-handle":``,draggable:`true`,"data-severity":p,children:[N,P]}),t[37]=p,t[38]=O,t[39]=N,t[40]=F):F=t[40],F}function zM(e){return e.stopPropagation()}function BM(){}function VM(e,t){if(!e.selection.empty)return null;let n=t===`up`||t===`left`?-1:1,r=e.selection.$head,i=n>0?r.after():r.before();if(typeof i!=`number`)return null;let a=Se.near(e.doc.resolve(i),n);return a.$head?.parent.type.name===`rawMdxFallback`?a:null}function HM(e,t){let{state:n,view:r}=e;if(!r.endOfTextblock(t))return!1;let i=VM(n,t);return i?(r.dispatch(n.tr.setSelection(i)),!0):!1}var UM=L.extend({addKeyboardShortcuts(){return{ArrowLeft:({editor:e})=>HM(e,`left`),ArrowRight:({editor:e})=>HM(e,`right`),ArrowUp:({editor:e})=>HM(e,`up`),ArrowDown:({editor:e})=>HM(e,`down`)}},addNodeView(){return Za(RM,{stopEvent:()=>!0,ignoreMutation:()=>!0})}});function WM(e){let t=(0,J.c)(47),{items:n,selectedIndex:r,categoryLabels:i,onSelect:a,onHoverIndex:o}=e,s=(0,K.useRef)(null),c=(0,K.useId)(),l=r>=0&&r<n.length?`${c}-option-${r}`:void 0,u=KM,d,f;if(t[0]===r?(d=t[1],f=t[2]):(d=()=>{let e=s.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(r);t&&t.scrollIntoView({block:`nearest`})},f=[r],t[0]=r,t[1]=d,t[2]=f),(0,K.useEffect)(d,f),n.length===0){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(`div`,{ref:s,role:`status`,"aria-live":`polite`,className:`w-56 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:{maxHeight:`var(--suggestion-menu-max-height, 40vh)`},onMouseDown:u,children:`No results`}),t[3]=e):e=t[3],e}let p,m,h,g,_,v,y,b,x,S,C,w,T;if(t[4]!==l||t[5]!==i||t[6]!==n||t[7]!==c||t[8]!==o||t[9]!==a||t[10]!==r){let e=[],d=0,f=new Map;for(let t of n){f.set(t,d++);let n=e.find(e=>e.key===t.category);n?n.items.push(t):e.push({key:t.category,items:[t]})}m=r>=0&&r<n.length?n[r]:null;let E;t[24]===n?E=t[25]:(E=n.some(GM),t[24]=n,t[25]=E),p=E,v=`flex items-start gap-2`,y=s,b=`listbox`,x=`Slash commands`,S=l,C=-1,w=u,T=`w-56 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,t[26]===Symbol.for(`react.memo_cache_sentinel`)?(h={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[26]=h):h=t[26];let D=m?`${m.label}${m.preview?`. ${m.preview.description}`:``}`:``;t[27]===D?g=t[28]:(g=(0,q.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:D}),t[27]=D,t[28]=g),_=e.map(e=>(0,q.jsxs)(`div`,{role:`group`,"aria-labelledby":`${c}-group-${e.key}`,children:[(0,q.jsx)(`div`,{id:`${c}-group-${e.key}`,className:`px-2 py-1.5 text-xs font-semibold text-muted-foreground`,children:i[e.key]??e.key}),e.items.map(e=>{let t=f.get(e)??0,n=t===r,i=e.icon;return(0,q.jsxs)(`button`,{id:`${c}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseEnter:()=>o?.(t),onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,q.jsx)(i,{className:`size-4 shrink-0 text-muted-foreground`}),(0,q.jsx)(`div`,{className:`flex flex-col min-w-0`,children:(0,q.jsx)(`span`,{className:`truncate`,children:e.label})})]},e.name)})]},e.key)),t[4]=l,t[5]=i,t[6]=n,t[7]=c,t[8]=o,t[9]=a,t[10]=r,t[11]=p,t[12]=m,t[13]=h,t[14]=g,t[15]=_,t[16]=v,t[17]=y,t[18]=b,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T}else p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=t[16],y=t[17],b=t[18],x=t[19],S=t[20],C=t[21],w=t[22],T=t[23];let E;t[29]!==h||t[30]!==g||t[31]!==_||t[32]!==y||t[33]!==b||t[34]!==x||t[35]!==S||t[36]!==C||t[37]!==w||t[38]!==T?(E=(0,q.jsxs)(`div`,{ref:y,role:b,"aria-label":x,"aria-activedescendant":S,tabIndex:C,onMouseDown:w,className:T,style:h,children:[g,_]}),t[29]=h,t[30]=g,t[31]=_,t[32]=y,t[33]=b,t[34]=x,t[35]=S,t[36]=C,t[37]=w,t[38]=T,t[39]=E):E=t[39];let D;t[40]!==p||t[41]!==m?(D=p?(0,q.jsx)(`aside`,{"aria-hidden":`true`,onMouseDown:u,className:`w-64 rounded-lg border bg-popover p-2 shadow-md ${m?.preview?``:`invisible`}`,children:m?.preview?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`mb-2 flex aspect-5/3 items-center justify-center overflow-hidden rounded-md bg-muted/40 p-3 *:max-h-full *:max-w-full [&_img]:size-full [&_img]:rounded-md [&_img]:object-contain`,children:m.preview.render()}),(0,q.jsx)(`p`,{className:`px-1 pb-1 text-xs text-muted-foreground`,children:m.preview.description})]}):null}):null,t[40]=p,t[41]=m,t[42]=D):D=t[42];let O;return t[43]!==v||t[44]!==E||t[45]!==D?(O=(0,q.jsxs)(`div`,{className:v,children:[E,D]}),t[43]=v,t[44]=E,t[45]=D,t[46]=O):O=t[46],O}function GM(e){return e.preview}function KM(e){return e.preventDefault()}var qM=new Te(`slashCommand`),JM=W.create({name:`slashCommand`,addOptions(){return{itemsSources:[()=>wx],categoryLabels:{basic:`Basic blocks`,insert:`Insert`}}},addProseMirrorPlugins(){let e=this;return[MC({editor:this.editor,pluginKey:qM,char:`/`,startOfLine:!1,items:({query:t})=>{let n=e.options.itemsSources.flatMap(e=>{try{return e()}catch(e){return console.error(`[slash-command] item source threw an error`,e),[]}}),r=Object.keys(e.options.categoryLabels),i=e=>{let t=r.indexOf(e);return t===-1?1/0:t};return Tx(n.map((e,t)=>({item:e,i:t})).sort((e,t)=>{let n=i(e.item.category)-i(t.item.category);return n===0?e.i-t.i:n}).map(e=>e.item),t)},command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).run()}catch(e){console.error(`[slash-command] deleteRange failed for "${n.name}"`,e);return}try{n.command(e)}catch(e){console.error(`[slash-command] command "${n.name}" threw an error`,e)}},render:()=>{let t=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=e=>{e!==r&&(r=e,s())},s=()=>{!t||!n||t.updateProps({items:n.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:n.command,onHoverIndex:o})};return{onStart(s){n=s,r=0;let c=RC(()=>n,`slash-command`);i.popup=c.popup,a=c.doPosition,t=new Ya(WM,{props:{items:s.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:s.command,onHoverIndex:o},editor:s.editor}),c.popup.appendChild(t.element),i.stopAutoUpdate=c.startAutoUpdate(),c.reveal()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),s(),a?.()},onKeyDown({event:e}){if(!n||n.items.length===0)return!1;let t=n.items;if(e.key===`ArrowDown`)return r=(r+1)%t.length,s(),!0;if(e.key===`ArrowUp`)return r=(r-1+t.length)%t.length,s(),!0;if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e&&n.command(e),!0}return e.key,!1},onExit(){zC(i),a=null,t?.destroy(),t=null,n=null,r=0}}}})]}}),YM=new Te(`sourceDirty`),XM=W.create({name:`sourceDirtyObserver`,addProseMirrorPlugins(){return[new Fe({key:YM,appendTransaction(e,t,n){if(!e.some(e=>!e.getMeta(Ax))||!e.some(e=>e.docChanged))return null;let r=new et;for(let t of e)r.appendMapping(t.mapping);let i=r.invert(),a=[];if(n.doc.descendants((e,n)=>{if(e.type.name!==`jsxComponent`||e.attrs.sourceDirty)return;let r=i.map(n),o=t.doc.nodeAt(r),s=!o||o.type.name!==`jsxComponent`,c=typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0;if(s&&c)return;if(!o){(e.content.size>0||Object.keys(e.attrs.props??{}).length>0)&&a.push({pos:n});return}if(o.type.name!==`jsxComponent`){a.push({pos:n});return}let l=!ZM(o.attrs.props,e.attrs.props),u=!o.content.eq(e.content);(l||u)&&a.push({pos:n})}),a.length===0)return null;let o=n.tr;for(let{pos:e}of a)o.setNodeAttribute(e,`sourceDirty`,!0);return o}})]}});function ZM(e,t){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ZM(e[n],t[n]))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!ZM(e[r],t[r]))return!1;return!0}function QM(e){let t=(0,J.c)(112),{open:n,target:r,alias:i,anchor:a,pages:o,onOpenChange:s,onSave:c}=e,[l,u]=(0,K.useState)(r),[d,f]=(0,K.useState)(i??``),[p,m]=(0,K.useState)(a??``),h=(0,K.useId)(),g=(0,K.useId)(),_=(0,K.useId)(),v=(0,K.useId)(),y;t[0]!==l||t[1]!==o?(y=$y(l,o),t[0]=l,t[1]=o,t[2]=y):y=t[2];let b=QC(l,y&&n),x,S;t[3]!==i||t[4]!==a||t[5]!==n||t[6]!==r?(x=()=>{n&&(u(r),f(i??``),m(a??``))},S=[n,r,i,a],t[3]=i,t[4]=a,t[5]=n,t[6]=r,t[7]=x,t[8]=S):(x=t[7],S=t[8]),(0,K.useEffect)(x,S);let C;t[9]!==d||t[10]!==p||t[11]!==l||t[12]!==s||t[13]!==c?(C=function(){let e=l.trim();e&&(c(e,d.trim()||null,p.trim()||null),s(!1))},t[9]=d,t[10]=p,t[11]=l,t[12]=s,t[13]=c,t[14]=C):C=t[14];let w=C,T;t[15]===w?T=t[16]:(T=function(e){e.key===`Enter`&&w()},t[15]=w,t[16]=T);let E=T,D,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H;if(t[17]!==g||t[18]!==p||t[19]!==l||t[20]!==E||t[21]!==v||t[22]!==b||t[23]!==s||t[24]!==n||t[25]!==h){let e=new Map,r=b?.map(t=>{let n=e.get(t.slug)??0;e.set(t.slug,n+1);let r=n===0?t.slug:`${t.slug}-${n}`;return{...t,reactKey:r}}),i=!!r?.length;k=kt,L=n,R=s,O=Mt,t[42]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,q.jsx)(Tt,{className:`fixed inset-0 z-50 bg-black/40 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`}),t[42]=I):I=t[42],D=Ft,j=`dialog-content`,M=``,N=`fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-background p-6 shadow-xl data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t[43]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,q.jsx)(Dt,{className:`mb-1 text-base font-semibold`,children:`Edit wiki link`}),F=(0,q.jsx)(wt,{className:`mb-4 text-sm text-muted-foreground`,children:`Modify the link target, anchor, and display label.`}),t[43]=P,t[44]=F):(P=t[43],F=t[44]),H=`mb-4 space-y-6`;let a;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,q.jsx)(`span`,{className:`text-red-500`,children:`*`}),t[45]=a):a=t[45];let o;t[46]===h?o=t[47]:(o=(0,q.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:h,children:[`Page `,a]}),t[46]=h,t[47]=o);let c;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>u(e.target.value),t[48]=c):c=t[48];let d;t[49]!==l||t[50]!==E||t[51]!==h?(d=(0,q.jsx)(QS,{id:h,value:l,onChange:c,placeholder:`page-name`,autoFocus:!0,"aria-required":`true`,onKeyDown:E}),t[49]=l,t[50]=E,t[51]=h,t[52]=d):d=t[52],t[53]!==o||t[54]!==d?(A=(0,q.jsxs)(`div`,{children:[o,d]}),t[53]=o,t[54]=d,t[55]=A):A=t[55];let f;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,q.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional heading anchor)`}),t[56]=f):f=t[56],t[57]===g?z=t[58]:(z=(0,q.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:g,children:[`Section`,` `,f]}),t[57]=g,t[58]=z);let _;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>m(e.target.value),t[59]=_):_=t[59],t[60]!==g||t[61]!==p||t[62]!==E?(B=(0,q.jsx)(QS,{id:g,value:p,onChange:_,placeholder:`heading-slug`,onKeyDown:E}),t[60]=g,t[61]=p,t[62]=E,t[63]=B):B=t[63],V=i&&(0,q.jsx)(`div`,{role:`listbox`,id:v,"aria-label":`Heading anchors`,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:r.map(e=>(0,q.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":p===e.slug,className:ht(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,p===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>m(p===e.slug?``:e.slug),children:[(0,q.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,q.jsx)(`span`,{className:`truncate`,children:e.text})]},e.reactKey))}),t[17]=g,t[18]=p,t[19]=l,t[20]=E,t[21]=v,t[22]=b,t[23]=s,t[24]=n,t[25]=h,t[26]=D,t[27]=O,t[28]=k,t[29]=A,t[30]=j,t[31]=M,t[32]=N,t[33]=P,t[34]=F,t[35]=I,t[36]=L,t[37]=R,t[38]=z,t[39]=B,t[40]=V,t[41]=H}else D=t[26],O=t[27],k=t[28],A=t[29],j=t[30],M=t[31],N=t[32],P=t[33],F=t[34],I=t[35],L=t[36],R=t[37],z=t[38],B=t[39],V=t[40],H=t[41];let U;t[64]!==z||t[65]!==B||t[66]!==V?(U=(0,q.jsxs)(`div`,{children:[z,B,V]}),t[64]=z,t[65]=B,t[66]=V,t[67]=U):U=t[67];let ee;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,q.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional display text)`}),t[68]=ee):ee=t[68];let te;t[69]===_?te=t[70]:(te=(0,q.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:_,children:[`Label`,` `,ee]}),t[69]=_,t[70]=te);let ne;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ne=e=>f(e.target.value),t[71]=ne):ne=t[71];let re;t[72]!==_||t[73]!==d||t[74]!==E?(re=(0,q.jsx)(QS,{id:_,value:d,onChange:ne,placeholder:`Custom display text`,onKeyDown:E}),t[72]=_,t[73]=d,t[74]=E,t[75]=re):re=t[75];let W;t[76]!==te||t[77]!==re?(W=(0,q.jsxs)(`div`,{children:[te,re]}),t[76]=te,t[77]=re,t[78]=W):W=t[78];let ie;t[79]!==A||t[80]!==U||t[81]!==W||t[82]!==H?(ie=(0,q.jsxs)(`div`,{className:H,children:[A,U,W]}),t[79]=A,t[80]=U,t[81]=W,t[82]=H,t[83]=ie):ie=t[83];let ae;t[84]===s?ae=t[85]:(ae=(0,q.jsx)(_t,{variant:`outline`,onClick:()=>s(!1),children:`Cancel`}),t[84]=s,t[85]=ae);let oe;t[86]===l?oe=t[87]:(oe=l.trim(),t[86]=l,t[87]=oe);let se=!oe,ce;t[88]!==w||t[89]!==se?(ce=(0,q.jsx)(_t,{onClick:w,disabled:se,children:`Save`}),t[88]=w,t[89]=se,t[90]=ce):ce=t[90];let le;t[91]!==ae||t[92]!==ce?(le=(0,q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[ae,ce]}),t[91]=ae,t[92]=ce,t[93]=le):le=t[93];let ue;t[94]!==D||t[95]!==j||t[96]!==M||t[97]!==N||t[98]!==P||t[99]!==F||t[100]!==ie||t[101]!==le?(ue=(0,q.jsxs)(D,{"data-slot":j,"data-ok-layer-spawned":M,className:N,children:[P,F,ie,le]}),t[94]=D,t[95]=j,t[96]=M,t[97]=N,t[98]=P,t[99]=F,t[100]=ie,t[101]=le,t[102]=ue):ue=t[102];let de;t[103]!==O||t[104]!==I||t[105]!==ue?(de=(0,q.jsxs)(O,{children:[I,ue]}),t[103]=O,t[104]=I,t[105]=ue,t[106]=de):de=t[106];let fe;return t[107]!==k||t[108]!==L||t[109]!==R||t[110]!==de?(fe=(0,q.jsx)(k,{open:L,onOpenChange:R,children:de}),t[107]=k,t[108]=L,t[109]=R,t[110]=de,t[111]=fe):fe=t[111],fe}function $M(e){let t=(0,J.c)(128),{editor:n,getPos:r,onClose:i}=e,a=r(),o=a==null?null:n.state.doc.nodeAt(a),s=String(o?.attrs.target??``),c=j(o?.attrs.alias),l=j(o?.attrs.anchor),u=Ee({target:s,alias:c,anchor:l}),{folderPaths:d,pages:f,pagesBySlug:p,loading:m}=De(),h=ve(s,l),g=h?.kind===`external`?h:null,_=XS(s,{pages:f,folderPaths:d,pagesBySlug:p,fallbackTargets:Qy(s)}),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(null),S=ZS(_);if(!o)return null;let C;t[0]!==n.state||t[1]!==n.view||t[2]!==r?(C=function(e,t,i){let a=r();a!=null&&n.view.dispatch(n.state.tr.setNodeMarkup(a,void 0,{...n.state.doc.nodeAt(a)?.attrs,target:e,alias:t,anchor:i}))},t[0]=n.state,t[1]=n.view,t[2]=r,t[3]=C):C=t[3];let w=C,T;t[4]!==n.state||t[5]!==n.view||t[6]!==r||t[7]!==i?(T=function(){let e=r();if(e==null)return;let t=n.state.doc.nodeAt(e);t&&(n.view.dispatch(n.state.tr.delete(e,e+t.nodeSize)),i())},t[4]=n.state,t[5]=n.view,t[6]=r,t[7]=i,t[8]=T):T=t[8];let E=T,D;t[9]!==l||t[10]!==g||t[11]!==_||t[12]!==x?(D=function(e){if(g){PS(g.url)?window.open(g.url,`_blank`,`noopener,noreferrer`):console.warn(`[safe-nav] blocked non-safe scheme:`,g.url);return}if(_.kind===`create`){x(`missing`);return}let t=_.hashDocName;if(e.newTab){BS({docName:t,anchor:l});return}if(l){let e=window.location.hash.match(/^#\/([^?#/]+)/);if((e?decodeURIComponent(e[1]):null)===t){let e=document.getElementById(l);e&&e.scrollIntoView({behavior:`smooth`,block:`start`})}window.location.hash=`#/${t}?anchor=${encodeURIComponent(l)}`;return}window.location.hash=`#/${t}`},t[9]=l,t[10]=g,t[11]=_,t[12]=x,t[13]=D):D=t[13];let O=D,k;t[14]!==c||t[15]!==b||t[16]!==n.state||t[17]!==n.view||t[18]!==r||t[19]!==u||t[20]!==s?(k=function(e){if(b===`missing`&&e!==s){let t=r();if(t==null)return;n.view.dispatch(n.state.tr.setNodeMarkup(t,void 0,{...n.state.doc.nodeAt(t)?.attrs,target:e,alias:c??u}))}},t[14]=c,t[15]=b,t[16]=n.state,t[17]=n.view,t[18]=r,t[19]=u,t[20]=s,t[21]=k):k=t[21];let A=k,M=!g&&!m&&_.kind===`navigate`&&_.displayState===`resolved`,N=!g&&!m&&_.kind===`navigate`&&_.displayState===`folder`,P=!g&&!m&&_.kind===`create`,F,I,L,R,z,B,V,H,U,ee;if(t[22]!==n.state||t[23]!==n.view||t[24]!==g||t[25]!==r||t[26]!==N||t[27]!==M||t[28]!==P||t[29]!==m||t[30]!==i){if(m){let e;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(nr,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[41]=e):e=t[41],I={icon:e,text:`Loading…`,className:`text-muted-foreground`}}else if(g){let e;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Un,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[42]=e):e=t[42],I={icon:e,text:`External wiki link`,className:`text-foreground`}}else if(N){let e;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Kn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[43]=e):e=t[43],I={icon:e,text:`Folder (no index)`,className:`text-foreground`}}else if(P){let e;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Vn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[44]=e):e=t[44],I={icon:e,text:`Page not found`,className:`text-red-700 dark:text-red-300`}}else if(M){let e;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Gn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[45]=e):e=t[45],I={icon:e,text:`Wiki link`,className:`text-foreground`}}else{let e;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(Vn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[46]=e):e=t[46],I={icon:e,text:`Unrecognized wiki link`,className:`text-muted-foreground`}}let e;t[47]!==n.state||t[48]!==n.view||t[49]!==r?(e=()=>{let e=r();if(typeof e!=`number`)return new DOMRect;let t=n.state.doc.nodeAt(e);if(!t)return new DOMRect;try{return pe(n.view,e,e+t.nodeSize)}catch{return new DOMRect}},t[47]=n.state,t[48]=n.view,t[49]=r,t[50]=e):e=t[50];let a;t[51]!==n.view.dom||t[52]!==e?(a={getBoundingClientRect:e,contextElement:n.view.dom},t[51]=n.view.dom,t[52]=e,t[53]=a):a=t[53];let o=a;F=JS,ee=`wiki-link`,L=`Wiki link options`,R=i,z=o,H=`mb-2 flex items-start gap-2 pr-8`,U=(0,q.jsx)(`div`,{className:ht(`mt-0.5 flex shrink-0`,I.className),children:I.icon}),V=`flex-1 min-w-0`,B=ht(`text-sm font-medium`,I.className),t[22]=n.state,t[23]=n.view,t[24]=g,t[25]=r,t[26]=N,t[27]=M,t[28]=P,t[29]=m,t[30]=i,t[31]=F,t[32]=I,t[33]=L,t[34]=R,t[35]=z,t[36]=B,t[37]=V,t[38]=H,t[39]=U,t[40]=ee}else F=t[31],I=t[32],L=t[33],R=t[34],z=t[35],B=t[36],V=t[37],H=t[38],U=t[39],ee=t[40];let te;t[54]!==I.text||t[55]!==B?(te=(0,q.jsx)(`div`,{className:B,children:I.text}),t[54]=I.text,t[55]=B,t[56]=te):te=t[56];let ne=g?g.url:`${s}${l?`#${l}`:``}`,re=g?g.url:`${s}${l?`#${l}`:``}`,W;t[57]!==ne||t[58]!==re?(W=(0,q.jsx)(`div`,{className:`truncate font-mono text-xs text-muted-foreground`,title:ne,children:re}),t[57]=ne,t[58]=re,t[59]=W):W=t[59];let ie;t[60]!==te||t[61]!==W||t[62]!==V?(ie=(0,q.jsxs)(`div`,{className:V,children:[te,W]}),t[60]=te,t[61]=W,t[62]=V,t[63]=ie):ie=t[63];let ae;t[64]!==ie||t[65]!==H||t[66]!==U?(ae=(0,q.jsxs)(`div`,{className:H,children:[U,ie]}),t[64]=ie,t[65]=H,t[66]=U,t[67]=ae):ae=t[67];let oe;t[68]!==g||t[69]!==O||t[70]!==P||t[71]!==i?(oe=P?null:(0,q.jsx)(_t,{size:`sm`,variant:`default`,onClick:()=>{O({}),i()},children:g?`Open in new tab`:`Open`}),t[68]=g,t[69]=O,t[70]=P,t[71]=i,t[72]=oe):oe=t[72];let se;t[73]!==P||t[74]!==x?(se=P?(0,q.jsx)(_t,{size:`sm`,variant:`default`,onClick:()=>x(`missing`),children:`Create page`}):null,t[73]=P,t[74]=x,t[75]=se):se=t[75];let ce;t[76]!==S||t[77]!==N||t[78]!==x?(ce=N&&S?(0,q.jsxs)(_t,{size:`sm`,variant:`outline`,onClick:()=>x(`folder-index`),children:[(0,q.jsx)(Wn,{className:`size-3.5`,"aria-hidden":`true`}),`Create index`]}):null,t[76]=S,t[77]=N,t[78]=x,t[79]=ce):ce=t[79];let le;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,q.jsx)(`div`,{className:`flex-1`}),t[80]=le):le=t[80];let ue;t[81]===y?ue=t[82]:(ue=()=>y(!0),t[81]=y,t[82]=ue);let de;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,q.jsx)(or,{className:`size-3.5`,"aria-hidden":`true`}),t[83]=de):de=t[83];let fe;t[84]===ue?fe=t[85]:(fe=(0,q.jsxs)(_t,{size:`sm`,variant:`outline`,onClick:ue,children:[de,`Edit`]}),t[84]=ue,t[85]=fe);let me;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,q.jsx)(dr,{className:`size-3.5`,"aria-hidden":`true`}),t[86]=me):me=t[86];let he;t[87]===E?he=t[88]:(he=(0,q.jsxs)(_t,{size:`sm`,variant:`destructive`,onClick:E,children:[me,`Remove`]}),t[87]=E,t[88]=he);let ge;t[89]!==oe||t[90]!==se||t[91]!==ce||t[92]!==fe||t[93]!==he?(ge=(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[oe,se,ce,le,fe,he]}),t[89]=oe,t[90]=se,t[91]=ce,t[92]=fe,t[93]=he,t[94]=ge):ge=t[94];let _e;t[95]!==F||t[96]!==L||t[97]!==R||t[98]!==z||t[99]!==ae||t[100]!==ge||t[101]!==ee?(_e=(0,q.jsxs)(F,{kind:ee,ariaLabel:L,onDeactivate:R,triggerReference:z,children:[ae,ge]}),t[95]=F,t[96]=L,t[97]=R,t[98]=z,t[99]=ae,t[100]=ge,t[101]=ee,t[102]=_e):_e=t[102];let ye=b!==null,be;t[103]===x?be=t[104]:(be=e=>{e||x(null)},t[103]=x,t[104]=be);let xe=b===`folder-index`&&S?S.initialDir:_.kind===`create`?_.initialDir:``,Se=b===`folder-index`&&S?S.suggestedName:_.kind===`create`?_.suggestedName:void 0,Ce;t[105]!==b||t[106]!==S||t[107]!==s?(Ce=b===`folder-index`&&S?(0,q.jsxs)(q.Fragment,{children:[`Create an index note for`,` `,(0,q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[S.initialDir,`/`]})]}):(0,q.jsxs)(q.Fragment,{children:[`Create a page for `,(0,q.jsx)(`span`,{className:`font-medium text-foreground`,children:s})]}),t[105]=b,t[106]=S,t[107]=s,t[108]=Ce):Ce=t[108];let we;t[109]!==A||t[110]!==ye||t[111]!==be||t[112]!==xe||t[113]!==Se||t[114]!==Ce?(we=(0,q.jsx)(oC,{open:ye,onOpenChange:be,kind:`file`,initialDir:xe,suggestedName:Se,description:Ce,onCreated:A}),t[109]=A,t[110]=ye,t[111]=be,t[112]=xe,t[113]=Se,t[114]=Ce,t[115]=we):we=t[115];let Te;t[116]!==c||t[117]!==l||t[118]!==v||t[119]!==w||t[120]!==f||t[121]!==y||t[122]!==s?(Te=(0,q.jsx)(QM,{open:v,target:s,alias:c,anchor:l,pages:f,onOpenChange:y,onSave:w}),t[116]=c,t[117]=l,t[118]=v,t[119]=w,t[120]=f,t[121]=y,t[122]=s,t[123]=Te):Te=t[123];let Oe;return t[124]!==_e||t[125]!==we||t[126]!==Te?(Oe=(0,q.jsxs)(q.Fragment,{children:[_e,we,Te]}),t[124]=_e,t[125]=we,t[126]=Te,t[127]=Oe):Oe=t[127],Oe}var eN=0;function tN(){return`wiki-link-${++eN}`}function nN(e){let t=e.doc??(typeof document<`u`?document:{createElement:null,createTextNode:null}),n=t.createElement(`span`);n.setAttribute(`data-wiki-link`,``),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`data-target`,e.target),n.setAttribute(`data-alias`,e.alias??``),n.setAttribute(`data-anchor`,e.anchor??``),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`Wiki link: ${e.target}${e.anchor?`#${e.anchor}`:``}`),n.classList.add(`wiki-link-chip`),n.style.touchAction=`manipulation`;let r=e.alias??`${e.target}${e.anchor?`#${e.anchor}`:``}`,i=t.createTextNode(r);return n.appendChild(i),{dom:n}}var rN=U.extend({priority:200,addNodeView(){return({editor:e,node:t,getPos:n})=>{let r=tN(),{dom:i}=nN({nodeId:r,target:String(t.attrs.target??``),alias:t.attrs.alias==null?null:String(t.attrs.alias),anchor:t.attrs.anchor==null?null:String(t.attrs.anchor)}),a=t,o=()=>{let e=n();return typeof e==`number`?e:void 0},s=_C(e);return s.register({type:`wikiLink`,nodeId:r,getPos:o,controls:{propPanel:t=>(0,K.createElement)($M,{editor:e,getPos:o,onClose:t.deactivate})},handlePrimary:({newTab:e})=>{if(!e)return!1;let t=a.attrs,n=typeof t.target==`string`?t.target:``;if(!n)return!1;let r=ve(n,typeof t.anchor==`string`?t.anchor:null);return r?r.kind===`doc`?(BS({docName:r.docName,anchor:r.anchor}),!0):PS(r.url)?(RS(r.url),!0):!1:!1}}),{dom:i,ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`wikiLink`)return!1;a=e;let t=String(e.attrs.target??``),n=e.attrs.alias==null?null:String(e.attrs.alias),r=e.attrs.anchor==null?null:String(e.attrs.anchor);return i.setAttribute(`data-target`,t),i.setAttribute(`data-alias`,n??``),i.setAttribute(`data-anchor`,r??``),i.setAttribute(`aria-label`,`Wiki link: ${t}${r?`#${r}`:``}`),i.textContent=n??`${t}${r?`#${r}`:``}`,!0},destroy:()=>{s.deregister(r)}}}},addKeyboardShortcuts(){return{Backspace:()=>{if(BC.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeBefore;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from-t.nodeSize,e.from)),!0}return!1},Delete:()=>{if(BC.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeAfter;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from,e.from+t.nodeSize)),!0}return!1}}},addProseMirrorPlugins(){return[ZC(this.editor)]}}),iN=0;function aN(){return`wiki-link-embed-${++iN}`}function oN(e){let t=e.doc??(typeof document<`u`?document:{createElement:null,createTextNode:null}),n=t.createElement(`a`);n.setAttribute(`data-wiki-embed`,``),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`data-target`,e.target),n.setAttribute(`data-alias`,e.alias??``),n.setAttribute(`data-anchor`,e.anchor??``),n.setAttribute(`href`,e.href),n.setAttribute(`target`,`_blank`),n.setAttribute(`rel`,`noopener noreferrer`),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`Embed: ${e.target}${e.anchor?`#${e.anchor}`:``}`),n.classList.add(`wiki-link-embed-chip`),n.style.touchAction=`manipulation`;let r=e.alias??`${e.target}${e.anchor?`#${e.anchor}`:``}`,i=t.createTextNode(r);return n.appendChild(i),{dom:n}}function sN(e){let t=(e.doc??(typeof document<`u`?document:{createElement:null})).createElement(`img`);return t.setAttribute(`data-wiki-embed`,``),t.setAttribute(`data-node-id`,e.nodeId),t.setAttribute(`data-target`,e.target),t.setAttribute(`data-alias`,e.alias??``),t.setAttribute(`src`,e.src),t.setAttribute(`alt`,e.alias??e.target),{dom:t}}function cN(e){let t=Ne(e);return t!==null&&k.has(t)}var lN=ne.extend({addNodeView(){return({editor:e,node:t,getPos:n})=>{let r=aN(),i=t,a=String(t.attrs.target??``),o=t.attrs.alias==null?null:String(t.attrs.alias),s=t.attrs.anchor==null?null:String(t.attrs.anchor),c=t.attrs.resolvedSrc==null?null:String(t.attrs.resolvedSrc);if(cN(a)){let{dom:e}=sN({nodeId:r,target:a,alias:o,src:c??a});return{dom:e,ignoreMutation:()=>!0,update:t=>{if(t.type.name!==`wikiLinkEmbed`)return!1;i=t;let n=String(t.attrs.target??``),r=t.attrs.alias==null?null:String(t.attrs.alias),a=t.attrs.resolvedSrc==null?null:String(t.attrs.resolvedSrc);if(!cN(n))return!1;let o=a??n;return e.setAttribute(`data-target`,n),e.setAttribute(`data-alias`,r??``),e.setAttribute(`src`,o),e.setAttribute(`alt`,r??n),!0}}}let{dom:l}=oN({nodeId:r,target:a,alias:o,anchor:s,href:c??a});l.addEventListener(`click`,e=>{e.preventDefault()});let u=()=>{let e=n();return typeof e==`number`?e:void 0},d=_C(e);return d.register({type:`wikiLinkEmbed`,nodeId:r,getPos:u,controls:{},handlePrimary:({newTab:e})=>{let t=i.attrs,n=typeof t.target==`string`?t.target:``;if(!n)return!1;let r=(typeof t.resolvedSrc==`string`&&t.resolvedSrc.length>0?t.resolvedSrc:null)??n,a=Ne(n);if(a===null)return!1;let o=E(r,``)??n;return MS({url:r,projectRelPath:o,ext:a,title:o.split(`/`).pop()??r,forceOsDelegation:e}),!0}}),{dom:l,ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`wikiLinkEmbed`)return!1;i=e;let t=String(e.attrs.target??``);if(cN(t))return!1;let n=e.attrs.alias==null?null:String(e.attrs.alias),r=e.attrs.anchor==null?null:String(e.attrs.anchor),a=(e.attrs.resolvedSrc==null?null:String(e.attrs.resolvedSrc))??t;return l.setAttribute(`data-target`,t),l.setAttribute(`data-alias`,n??``),l.setAttribute(`data-anchor`,r??``),l.setAttribute(`href`,a),l.setAttribute(`aria-label`,`Embed: ${t}${r?`#${r}`:``}`),l.textContent=n??`${t}${r?`#${r}`:``}`,!0},destroy:()=>{d.deregister(r)}}}}}),uN=[...R.map(e=>e.name===`jsxComponent`?VT:e.name===`rawMdxFallback`?UM:e.name===`wikiLink`?rN:e.name===`wikiLinkEmbed`?lN:e.name===`link`?fw:e),JM.configure({itemsSources:[()=>wx,()=>dx()],categoryLabels:{content:`Components`,layout:`Layout`,media:`Media`,data:`Data`}}),Uy.configure({onDrop(e,t,n){for(let r of t)Sx(r,e,n)},onPaste(e,t,n){for(let n of t)Sx(n,e,e.state.selection.from)}}),kS,OS,kx,XM,Wy,Fx,oT];function dN(e){return e===tt}var fN=3e4,pN=class extends Error{docName;elapsedMs;constructor(e,t){super(`Sync timed out for "${e}" after ${t}ms`),this.name=`SyncTimeoutError`,this.docName=e,this.elapsedMs=t}},mN=class extends Error{docName;constructor(e){super(`Provider disconnected before sync for "${e}"`),this.name=`PreSyncDisconnectError`,this.docName=e}},hN=class extends Error{docName;constructor(e){super(`Document not found: "${e}"`),this.name=`DocumentNotFoundError`,this.docName=e}},gN=class extends Error{docName;cause;constructor(e,t){let n=t instanceof Error?t.message:String(t??`unknown`);super(`Bridge setup failed for "${e}": ${n}`),this.name=`BridgeSetupError`,this.docName=e,this.cause=t}},_N=class extends Error{docName;missingCapability;constructor(e,t){super(`Server is missing capability "${t}" required to open "${e}".`),this.name=`ServerCapabilityMismatchError`,this.docName=e,this.missingCapability=t}},vN=new Map,yN=!1;function bN(){for(let e of vN.values())if(!e.settled)return!0;return!1}function xN(){typeof document>`u`||document.visibilityState===`visible`&&SN(Date.now())}function SN(e){let t=[];for(let[n,r]of vN){if(r.settled)continue;let i=e-r.createdAt;if(i<3e4)continue;r.settled=!0;let a=new pN(n,i);EN(r),r.reject(a),t.push({docName:n,elapsedMs:i})}if(t.length>0){let e=t.map(e=>`${e.docName} (${e.elapsedMs}ms)`).join(`, `);console.warn(`[syncPromise] reaped ${t.length} timed-out ${t.length===1?`entry`:`entries`} on visibility restore (tab-sleep recovered): ${e}`)}return bN()||wN(),t.length}function CN(){yN||typeof document>`u`||(document.addEventListener(`visibilitychange`,xN),yN=!0)}function wN(){yN&&(typeof document>`u`||(document.removeEventListener(`visibilitychange`,xN),yN=!1))}var TN=new Map;function EN(e){e.detached||(e.detached=!0,e.timeoutHandle!==null&&clearTimeout(e.timeoutHandle),e.provider.off(`synced`,e.onSynced),e.provider.off(`close`,e.onClose))}function DN(e,t){let n=vN.get(e);if(n)return n.promise;let r=TN.get(e);if(r!==void 0){TN.delete(e);let n=r===`timeout`?new pN(e,0):new mN(e);console.warn(`[syncPromise] ${e} rejected on creation (test hook, armed ${r}): ${n.message}`),Y(`ok/sync/create`,{docName:e,warm:!1,armed:r}),Y(`ok/sync/reject`,{docName:e,reason:`armed-${r}`});let i=kN(n);return vN.set(e,AN(i,t)),i}if(t.synced){console.log(`[syncPromise] ${e} resolved synchronously (warm provider)`),Y(`ok/sync/create`,{docName:e,warm:!0}),Y(`ok/sync/resolve`,{docName:e,elapsedMs:0,warm:!0});let n=Promise.resolve();return vN.set(e,ON(n,t)),n}let i=Date.now(),a=()=>{},o=()=>{},s=new Promise((e,t)=>{a=e,o=t}),c=()=>{let t=vN.get(e);if(!t||t.settled)return;t.settled=!0;let n=Date.now()-t.createdAt;console.log(`[syncPromise] ${e} resolved in ${n}ms`),Y(`ok/sync/resolve`,{docName:e,elapsedMs:n,warm:!1}),EN(t),bN()||wN(),t.resolve()},l=t=>{let n=vN.get(e);if(!n||n.settled)return;n.settled=!0;let r=new mN(e);console.warn(`[syncPromise] ${e} rejected: ${r.message}`),Y(`ok/sync/reject`,{docName:e,reason:`pre-sync-disconnect`}),EN(n),bN()||wN(),n.reject(r)},u=setTimeout(()=>{let t=vN.get(e);if(!t||t.settled)return;t.settled=!0;let n=Date.now()-t.createdAt,r=new pN(e,n);console.warn(`[syncPromise] ${e} rejected: ${r.message}`),Y(`ok/sync/reject`,{docName:e,reason:`timeout`,elapsedMs:n}),EN(t),bN()||wN(),t.reject(r)},fN),d={promise:s,resolve:a,reject:o,createdAt:i,timeoutHandle:u,provider:t,onSynced:c,onClose:l,settled:!1,detached:!1};return vN.set(e,d),t.on(`synced`,c),t.on(`close`,l),CN(),Y(`ok/sync/create`,{docName:e,warm:!1}),s}function ON(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,detached:!0}}function kN(e){let t=Promise.reject(e);t.catch(()=>{});let n=t;return n.status=`rejected`,n.reason=e,n}function AN(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,detached:!0}}function jN(e){let t=vN.get(e);t&&(t.settled=!0,EN(t),vN.delete(e),bN()||wN())}function MN(e,t){let n=vN.get(e);return!n||n.settled?!1:(n.settled=!0,console.warn(`[syncPromise] ${e} rejected: ${t.message}`),EN(n),bN()||wN(),n.reject(t),!0)}var NN=Object.freeze({kind:`tab-replay`}),PN=Object.freeze({kind:`idle`}),FN=We(uN),IN=4e3,LN=1e4,RN=class extends Error{constructor(e,t){super(`client persistence clearData timed out for ${e} after ${t}ms`),this.docName=e,this.timeoutMs=t,this.name=`ClientPersistenceClearTimeoutError`}},zN=`ok-last-observed-branch`,BN=5e3,VN=1*1024*1024;function HN(e,t,n=null){let r={};if(e!==null&&(r.principalId=e.principalId,r.tabSessionId=e.tabSessionId),t!==null&&t.length>0&&(r.expectedServerInstanceId=t),n!==null&&n.length>0&&(r.expectedBranch=n),Object.keys(r).length!==0)return JSON.stringify(r)}var UN=class{_entries=new Map;get entries(){return this._entries}lruOrder=[];activeDocName=null;maxSize;wsUrl;recycleDebounceMs;clearDataTimeoutMs;onChange=null;tabIdentity=null;serverRestartRecoveryState=PN;cachedServerInstanceId=null;pendingServerInstanceKnown=null;recoveryMismatchStaleClaim;bufferedUpdates=new Map;persistenceFactory;storage;constructor(e,t,n){this.maxSize=e,this.wsUrl=t,this.recycleDebounceMs=n?.recycleDebounceMs??IN,this.clearDataTimeoutMs=n?.clearDataTimeoutMs??LN,this.persistenceFactory=n?.persistenceFactory??Ly,n?.storage===void 0?this.storage=globalThis.localStorage===void 0?null:globalThis.localStorage:this.storage=n.storage}setTabIdentity(e){this.tabIdentity=e}setExpectedServerInstanceId(e){if(this.cachedServerInstanceId=e,!(e===null||e.length===0)){if(this.pendingServerInstanceKnown!==null){let t=this.pendingServerInstanceKnown;this.pendingServerInstanceKnown=null,t.resolve(e)}this.attachDeferredPersistence(e)}}whenServerInstanceKnown(){if(this.cachedServerInstanceId!==null&&this.cachedServerInstanceId.length>0)return Promise.resolve(this.cachedServerInstanceId);if(this.pendingServerInstanceKnown!==null)return this.pendingServerInstanceKnown.promise;let e,t=new Promise(t=>{e=t});return this.pendingServerInstanceKnown={promise:t,resolve:e},t}buildPersistence(e,t,n){return this.persistenceFactory({branch:this.getOrInitObservedBranch()??`_unknown_`,serverInstanceId:e,docName:t,doc:n})}attachDeferredPersistence(e){for(let t of this._entries.values())if(t.kind===`active`&&t.persistence===null)try{t.persistence=this.buildPersistence(e,t.docName,t.provider.document)}catch(e){let n=e instanceof Error?e.name:`non-error-throw`;this.emitStructuredClientRecoveryEvent({event:`ok-client-persistence-attach-failed`,...this.recoveryTelemetryBase(t.docName),errorName:n,errorMessage:e instanceof Error?e.message:String(e)})}}getServerRestartRecoveryState(){return this.serverRestartRecoveryState}observeDiskAck(e,t){let n=this.entries.get(e);!n||n.kind!==`active`||(n.lastDiskAckedSV=By(n.lastDiskAckedSV,t))}observeDiskAckBatch(e){for(let[t,n]of Object.entries(e))this.observeDiskAck(t,n)}lastObservedBranch=null;lastObservedBranchInitialized=!1;getOrInitObservedBranch(){if(this.lastObservedBranchInitialized)return this.lastObservedBranch;this.lastObservedBranchInitialized=!0;try{let e=this.storage?.getItem(zN)??null;e!==null&&e.length>0&&(this.lastObservedBranch=e)}catch{}return this.lastObservedBranch}persistObservedBranch(e){this.lastObservedBranch=e,this.lastObservedBranchInitialized=!0;try{e===null||e.length===0?this.storage?.removeItem(zN):this.storage?.setItem(zN,e)}catch{}}withClearDataTimeout(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>{r(new RN(e,this.clearDataTimeoutMs))},this.clearDataTimeoutMs);t.then(()=>{clearTimeout(i),n()},e=>{clearTimeout(i),r(e)})})}recoveryTelemetryBase(e,t){let n={docName:e,branch:this.getOrInitObservedBranch()??`_unknown_`},r=t===void 0?this.recoveryMismatchStaleClaim:t;return r!==void 0&&r.length>0&&(n.serverInstanceId=r),n}emitStructuredClientRecoveryEvent(e){console.warn(JSON.stringify(e))}clearRecoveryMismatchStaleClaimIfTerminal(){let e=this.serverRestartRecoveryState.kind;(e===`idle`||e===`failed`)&&(this.recoveryMismatchStaleClaim=void 0)}beginServerRestartRecovery(e,t){this.serverRestartRecoveryState={kind:`recovering`,phase:`clearing-local-cache`,docNames:e,failedDocNames:[],startedAt:t};for(let t of e)jN(t);this.notify()}enterServerRestartReconnect(e,t,n,r){if(e.length===0){this.serverRestartRecoveryState=t.length===0?PN:{kind:`failed`,reason:r,docNames:t,failedDocNames:t,startedAt:n},this.clearRecoveryMismatchStaleClaimIfTerminal(),this.notify();return}this.serverRestartRecoveryState={kind:`recovering`,phase:`reconnecting`,docNames:e,failedDocNames:t,startedAt:n,...t.length>0?{clearFailureReason:r}:{}},this.notify()}markServerRestartRecoverySynced(e){let t=this.serverRestartRecoveryState;if(t.kind!==`recovering`||t.phase!==`reconnecting`||!t.docNames.includes(e))return;let n=t.docNames.filter(t=>t!==e);if(n.length>0){this.serverRestartRecoveryState={...t,docNames:n};return}if(t.failedDocNames.length>0){this.serverRestartRecoveryState={kind:`failed`,reason:t.clearFailureReason??`clear-data-failed`,docNames:t.failedDocNames,failedDocNames:t.failedDocNames,startedAt:t.startedAt},this.clearRecoveryMismatchStaleClaimIfTerminal();return}this.serverRestartRecoveryState=PN,this.clearRecoveryMismatchStaleClaimIfTerminal()}setObservedBranch(e){this.persistObservedBranch(e)}compareAndUpdateObservedBranch(e){let t=this.getOrInitObservedBranch();return this.persistObservedBranch(e),t!==null&&t!==e}onBranchMismatch=null;branchMismatchInFlight=null;mismatchInFlight=null;setOnBranchMismatch(e){if(e===null){this.onBranchMismatch=null;return}this.onBranchMismatch=()=>{if(this.branchMismatchInFlight!==null)return;let t=Promise.resolve().then(e).finally(()=>{this.branchMismatchInFlight===t&&(this.branchMismatchInFlight=null)});this.branchMismatchInFlight=t}}setOnChange(e){this.onChange=e}notify(){this.onChange?.()}evictListeners=new Set;onEvict(e){return this.evictListeners.add(e),()=>{this.evictListeners.delete(e)}}fireEvict(e){for(let t of this.evictListeners)try{t(e)}catch(t){console.warn(`[ProviderPool] evict listener threw for ${e}:`,t)}}touch(e){let t=this.lruOrder.indexOf(e);t!==-1&&this.lruOrder.splice(t,1),this.lruOrder.push(e)}open(e){if(dN(e))return null;let t=this.entries.get(e);if(t)return t.lastAccessedAt=Date.now(),this.touch(e),this.notify(),t;this.entries.size>=this.maxSize&&this.evictLru();let n=this.cachedServerInstanceId,r=HN(this.tabIdentity,n,this.getOrInitObservedBranch()),i=new fy({url:Vy(this.wsUrl),name:e,forceSyncInterval:BN,...r===void 0?{}:{token:r}}),a=this.cachedServerInstanceId,o={kind:`active`,provider:i,persistence:a!==null&&a.length>0?this.buildPersistence(a,e,i.document):null,lastServerSyncedSV:null,lastDiskAckedSV:null,observerCleanup:null,syncState:`connecting`,docName:e,lastAccessedAt:Date.now(),hasSynced:!1,pendingRecycleTimer:null,bridgeSetupFailed:!1};if(i.on(`status`,({status:t})=>{o.kind!==`active`||this.entries.get(e)!==o||t===`disconnected`&&(o.syncState=`disconnected`,this.notify())}),i.on(`synced`,()=>{if(!(o.kind!==`active`||this.entries.get(e)!==o)&&(o.syncState=`synced`,o.hasSynced=!0,o.lastServerSyncedSV=Ry(i.document),o.pendingRecycleTimer&&=(clearTimeout(o.pendingRecycleTimer),null),this.markServerRestartRecoverySynced(e),this.notify(),!o.observerCleanup))try{let t=i.document,n=new y({extensions:uN});o.observerCleanup=dT({doc:t,xmlFragment:t.getXmlFragment(`default`),ytext:t.getText(`source`),mdManager:n,schema:FN,onSyncError:(t,n)=>{console.warn(`[Sync] ${t} failed for ${e}:`,n.message)}})}catch(t){console.error(`[ProviderPool] setupObservers init failed for ${e}:`,t),o.bridgeSetupFailed=!0,MN(e,new gN(e,t))}}),i.on(`disconnect`,()=>{o.kind!==`active`||this.entries.get(e)!==o||(o.syncState=`disconnected`,this.notify(),o.hasSynced&&i.unsyncedChanges===0&&!o.pendingRecycleTimer&&(o.pendingRecycleTimer=setTimeout(()=>{o.kind===`active`&&(o.pendingRecycleTimer=null,this.entries.get(e)===o&&this.recycleDisconnectedEntry(e))},this.recycleDebounceMs)))}),i.on(`authenticationFailed`,({reason:e})=>{if(![`server-instance-mismatch`,`branch-mismatch`].includes(e)){console.warn(JSON.stringify({event:`ok-auth-failed-unknown-reason`,reason:e}));return}let t=e;if(t===`server-instance-mismatch`){if(n===null||this.cachedServerInstanceId!==n)return;let e=n;this.cachedServerInstanceId=null,this.handleServerInstanceMismatch(e);return}if(t===`branch-mismatch`){this.onBranchMismatch?.();return}}),this.bufferedUpdates.get(e)!==void 0){let t=this.recoveryMismatchStaleClaim,n=()=>{if(i.off(`synced`,n),o.kind!==`active`||this.entries.get(e)!==o)return;let r=this.bufferedUpdates.get(e);if(r!==void 0){this.bufferedUpdates.delete(e);try{ad(i.document,r,NN)}catch(n){let i=n instanceof Error?n.name:`non-error-throw`;this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-failed`,...this.recoveryTelemetryBase(e,t),replayByteLength:r.byteLength,errorName:i,errorMessage:n instanceof Error?n.message:String(n)})}}};i.on(`synced`,n)}return this._entries.set(e,o),this.touch(e),this.notify(),o}handleServerInstanceMismatch(e){this.recoveryMismatchStaleClaim=e.length>0?e:void 0;let t=Array.from(this.entries.entries()),n=Date.now(),r=this.activeDocName,i=r!==null&&t.some(([e,t])=>e===r&&t.kind===`active`)?[r]:[],a=r??t.find(([,e])=>e.kind===`active`)?.[0]??``;a.length>0&&this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-epoch-mismatch`,...this.recoveryTelemetryBase(a)}),this.beginServerRestartRecovery(i,n);for(let[e,n]of t)n.kind===`active`&&!i.includes(e)&&jN(e);for(let[e,n]of t){if(n.kind!==`active`)continue;let t=n.lastDiskAckedSV??n.lastServerSyncedSV;if(t===null){this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-skipped-no-baseline`,...this.recoveryTelemetryBase(e),reason:`no-disk-ack-or-server-sync-vector`});continue}let r=zy(n.provider.document,t);if(r.byteLength>VN){Y(`ok/pool/buffer-overflow`,{docName:e,bytes:r.byteLength});continue}r.byteLength>0&&this.bufferedUpdates.set(e,r)}let o=[];for(let[e,n]of t)n.kind===`active`&&n.persistence!==null&&o.push({docName:e,promise:this.withClearDataTimeout(e,n.persistence.clearData())});let s=Promise.allSettled(o.map(e=>e.promise)).then(e=>{let t=[],i=[],a=!1;e.forEach((e,n)=>{let r=o[n];if(!r)return;let s=r.docName;if(e.status===`rejected`){t.push(s);let n=e.reason instanceof RN;if(n&&(a=!0),n)this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-clear-failed`,...this.recoveryTelemetryBase(s),failureKind:`timeout`});else{let t=e.reason instanceof Error?e.reason.name:`unknown`;this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-clear-failed`,...this.recoveryTelemetryBase(s),failureKind:`rejected`,errorName:t,errorMessage:e.reason instanceof Error?e.reason.message:String(e.reason)})}}else i.push(s)});let s=i.filter(e=>e===r);if(t.length>0){let e=a?`clear-data-timeout`:`clear-data-failed`;console.warn(JSON.stringify({event:`ok-mismatch-recycle-partial-clears-failed`,failedDocs:t,clearedDocs:i})),this.enterServerRestartReconnect(s,t,n,e);for(let e of i)this.recycleDisconnectedEntry(e);return}this.enterServerRestartReconnect(s,[],n,`clear-data-failed`),this.recycleAllEntries()}).finally(()=>{this.mismatchInFlight===s&&(this.mismatchInFlight=null)});this.mismatchInFlight=s}awaitMismatchSettled(){return this.mismatchInFlight??Promise.resolve()}recycleAllEntries(){let e=Array.from(this.entries.keys());for(let t of e)this.recycleDisconnectedEntry(t)}prewarm(e){if(dN(e))return null;let t=this.entries.get(e);if(t)return t;let n=this.open(e);if(!n)return null;let r=this.lruOrder.indexOf(e);return r!==-1&&(this.lruOrder.splice(r,1),this.lruOrder.unshift(e)),n}close(e){let t=this.entries.get(e);t&&(this.destroyEntry(t),this._entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),this.bufferedUpdates.delete(e),this.activeDocName===e&&(this.activeDocName=null),this.notify())}async closeAndClearPersistence(e){let t=this.entries.get(e);if(t?.kind===`active`&&t.persistence!==null){try{await t.persistence.clearData()}catch(t){console.warn(`[ProviderPool] clearData on rename failed for ${e}:`,t)}this.close(e);return}t&&this.close(e);let n=this.getOrInitObservedBranch(),r=this.cachedServerInstanceId;if(n===null||r===null)return;let i=`ok-ydoc:${n}:${r}:${e}`;try{await new Promise((e,t)=>{let n=indexedDB.deleteDatabase(i);n.onsuccess=()=>e(),n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`[ProviderPool] IDB delete blocked for ${i}`),t(Error(`idb-clear-blocked: ${i}`))}})}catch(e){console.warn(`[ProviderPool] IDB delete on rename failed for ${i}:`,e)}}clearBufferedUpdates(){this.bufferedUpdates.clear()}__test_seedBufferedUpdate(e,t){this.bufferedUpdates.set(e,t)}__test_bufferedUpdatesSize(){return this.bufferedUpdates.size}__test_hasBufferedUpdate(e){return this.bufferedUpdates.has(e)}__test_getBufferedUpdate(e){return this.bufferedUpdates.get(e)}setActive(e){let t=this.entries.get(e);if(!t)throw Error(`[ProviderPool] Cannot setActive — "${e}" is not open`);t.lastAccessedAt=Date.now(),this.touch(e),this.activeDocName=e,this.notify()}clearActive(){this.activeDocName!==null&&(this.activeDocName=null,this.notify())}getActive(){return this.activeDocName?this.entries.get(this.activeDocName)??null:null}getActiveDocName(){return this.activeDocName}has(e){return this.entries.has(e)}recycle(e){this.recycleDisconnectedEntry(e)}dispose(){for(let e of this._entries.values())this.destroyEntry(e);this._entries.clear(),this.lruOrder=[],this.activeDocName=null,this.onChange=null,this.bufferedUpdates.clear(),this.onBranchMismatch=null,this.branchMismatchInFlight=null,this.evictListeners.clear(),this.serverRestartRecoveryState=PN,this.cachedServerInstanceId=null,this.pendingServerInstanceKnown=null,this.tabIdentity=null,this.recoveryMismatchStaleClaim=void 0}evictLru(){for(let e of this.lruOrder)if(e!==this.activeDocName){Y(`ok/pool/evict-lru`,{docName:e}),this.close(e);return}}destroyEntry(e){if(e.kind===`tearing-down`)return;let t=e.observerCleanup,n=e.persistence,r=e.pendingRecycleTimer,i=e.docName,a=e;a.kind=`tearing-down`,a.persistence=null,a.observerCleanup=null,a.pendingRecycleTimer=null,r&&clearTimeout(r),jN(i),this.fireEvict(i),t?.(),n!==null&&n.destroy().catch(e=>{console.warn(`[ProviderPool] persistence destroy failed for ${i}:`,e)});try{a.provider.destroy()}catch(e){console.warn(`[ProviderPool] Provider destroy failed for ${i}:`,e)}}recycleDisconnectedEntry(e){let t=this.entries.get(e);if(!t||t.kind!==`active`)return;let n=this.activeDocName===e;if(Y(`ok/pool/recycle-disconnected`,{docName:e,wasActive:n}),this.destroyEntry(t),this._entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),n){this.open(e)&&this.setActive(e);return}this.notify()}},WN=crypto.randomUUID(),GN=!1;function KN(e){GN||(GN=!0,console.warn(`[principal-fetch] failed to resolve principal — falling back to random identity.`,e))}var qN=(0,K.createContext)(null),JN=null;function YN(e){return JN||(JN=new UN(10,e),kg(JN)),JN}var XN={activeDocName:null,activeProvider:null,syncState:`connecting`,serverRestartRecovery:{kind:`idle`},poolEntries:[]};function ZN(e){let t=e.getActive(),n=[];for(let t of e.entries.values())n.push({docName:t.docName,provider:t.provider,lastAccessedAt:t.lastAccessedAt});return n.sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt),{activeDocName:e.getActiveDocName(),activeProvider:t?.provider??null,syncState:t?.syncState??`connecting`,serverRestartRecovery:e.getServerRestartRecoveryState(),poolEntries:n}}function QN(e){let t=(0,J.c)(61),{children:n}=e,[r,i]=(0,K.useState)(XN),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)(`doc`),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(0),{collabUrl:_,terminal:v,lastError:y,retry:b}=eg(),x,S;t[0]===_?(x=t[1],S=t[2]):(x=()=>{if(_===null)return;let e=YN(_);return i(ZN(e)),e.setOnBranchMismatch(()=>Rh(e)),e.setOnChange(()=>i(ZN(e))),fetch(`/api/principal`).then(tP).then(t=>{let n=O.safeParse(t);n.success?(e.setTabIdentity({principalId:n.data.id,tabSessionId:WN}),c(n.data)):KN(n.error)}).catch(eP),Rh(e),()=>{e.setOnChange(null)}},S=[_],t[0]=_,t[1]=x,t[2]=S),(0,K.useEffect)(x,S);let C;t[3]===_?C=t[4]:(C=e=>{if(Y(`ok/nav/open-document`,{docName:e,transition:!1}),_===null)return;let t=YN(_);t.open(e)&&(t.setActive(e),o({kind:`doc`,target:e,docName:e}))},t[3]=_,t[4]=C);let w=C,T;t[5]===w?T=t[6]:(T=e=>{Y(`ok/nav/open-document`,{docName:e,transition:!1}),w(e)},t[5]=w,t[6]=T);let E=T,D;t[7]===_?D=t[8]:(D=e=>{if(_===null)return;let t=YN(_),n=he(e);n?(t.open(n),t.setActive(n)):t.clearActive(),o(e)},t[7]=_,t[8]=D);let k=D,A;t[9]===k?A=t[10]:(A=e=>{Y(`ok/nav/open-target`,{docName:he(e),kind:e.kind,transition:!1}),k(e)},t[9]=k,t[10]=A);let j=A,M,N,P,F,I;t[11]===_?(M=t[12],N=t[13],P=t[14],F=t[15],I=t[16]):(P=()=>{if(_===null){o(null);return}YN(_).clearActive(),o(null)},F=e=>{_!==null&&(YN(_).close(e),o(t=>t&&(he(t)===e?null:t)))},I=async e=>{_!==null&&(await YN(_).closeAndClearPersistence(e),o(t=>t&&(he(t)===e?null:t)))},M=e=>{_!==null&&YN(_).recycle(e)},N=e=>{_!==null&&YN(_).prewarm(e)},t[11]=_,t[12]=M,t[13]=N,t[14]=P,t[15]=F,t[16]=I);let L,R,z,B,V;t[17]===_?(L=t[18],R=t[19],z=t[20],B=t[21],V=t[22]):(L=e=>{_!==null&&YN(_).setExpectedServerInstanceId(e)},R=async e=>{if(_===null)return;let t=YN(_);t.setObservedBranch(e),await Fh(t,e)},z=async e=>{if(_===null)return;let t=YN(_);t.compareAndUpdateObservedBranch(e)&&await Fh(t,e)},B=(e,t)=>{_!==null&&YN(_).observeDiskAck(e,t)},V=async()=>{_!==null&&await Rh(YN(_))},t[17]=_,t[18]=L,t[19]=R,t[20]=z,t[21]=B,t[22]=V);let H;t[23]!==p||t[24]!==d?(H=e=>{if(d===`agent`&&p===e){f(`doc`);return}m(e),f(`agent`),g($N)},t[23]=p,t[24]=d,t[25]=H):H=t[25];let U;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=()=>{f(`doc`),m(null)},t[26]=U):U=t[26];let ee;t[27]!==a||t[28]!==y||t[29]!==v||t[30]!==_||t[31]!==p||t[32]!==h||t[33]!==d||t[34]!==w||t[35]!==E||t[36]!==k||t[37]!==j||t[38]!==s||t[39]!==b||t[40]!==r.activeDocName||t[41]!==r.activeProvider||t[42]!==r.poolEntries||t[43]!==r.serverRestartRecovery||t[44]!==r.syncState||t[45]!==l||t[46]!==M||t[47]!==N||t[48]!==L||t[49]!==R||t[50]!==z||t[51]!==B||t[52]!==V||t[53]!==H||t[54]!==P||t[55]!==F||t[56]!==I?(ee={principal:s,activeTarget:a,activeDocName:r.activeDocName,activeProvider:r.activeProvider,syncState:r.syncState,serverRestartRecovery:r.serverRestartRecovery,poolEntries:r.poolEntries,openDocument:w,openDocumentTransition:E,openTarget:k,openTargetTransition:j,clearTarget:P,closeDocument:F,closeAndClearForRename:I,recycleDocument:M,prewarm:N,systemProvider:l,setSystemProvider:u,updateServerInstanceId:L,onBranchSwitched:R,observeBranch:z,observeDiskAck:B,refreshServerInfo:V,collabUrl:_,collabTerminal:v,collabLastError:y,retryCollab:b,docPanelMode:d,docPanelAgentId:p,docPanelExpandSignal:h,openActivityPanel:H,closeActivityPanel:U},t[27]=a,t[28]=y,t[29]=v,t[30]=_,t[31]=p,t[32]=h,t[33]=d,t[34]=w,t[35]=E,t[36]=k,t[37]=j,t[38]=s,t[39]=b,t[40]=r.activeDocName,t[41]=r.activeProvider,t[42]=r.poolEntries,t[43]=r.serverRestartRecovery,t[44]=r.syncState,t[45]=l,t[46]=M,t[47]=N,t[48]=L,t[49]=R,t[50]=z,t[51]=B,t[52]=V,t[53]=H,t[54]=P,t[55]=F,t[56]=I,t[57]=ee):ee=t[57];let te=ee,ne;return t[58]!==n||t[59]!==te?(ne=(0,q.jsx)(qN,{value:te,children:n}),t[58]=n,t[59]=te,t[60]=ne):ne=t[60],ne}function $N(e){return e+1}function eP(e){KN(e)}function tP(e){return e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))}function nP(){let e=(0,K.use)(qN);if(!e)throw Error(`useDocumentContext must be used within <DocumentProvider />`);return e}function rP(){let e=(0,J.c)(3),{openDocumentTransition:t,openTargetTransition:n}=nP(),r;return e[0]!==t||e[1]!==n?(r={openDocumentTransition:t,openTargetTransition:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}export{Cm as $,vw as A,Kn as At,jx as B,Mw as C,tr as Ct,ww as D,Yn as Dt,Tw as E,Zn as Et,iC as F,Ln as Ft,_g as G,Zb as H,QS as I,In as It,hg as J,mg as K,ZS as L,_C as M,Vn as Mt,hC as N,Bn as Nt,_w as O,Jn as Ot,oC as P,zn as Pt,kh as Q,XS as R,Jw as S,nr as St,Cw as T,$n as Tt,Ky as U,mx as V,fy as W,Kh as X,Eg as Y,Ih as Z,Kj as _,Ti as _t,hN as a,Ad as at,uT as b,sr as bt,pN as c,tu as ct,dN as d,bo as dt,Uu as et,uN as f,Pa as ft,Yj as g,Y as gt,MM as h,Oi as ht,gN as i,Ed as it,hw as j,Gn as jt,yw as k,qn as kt,jN as l,Nc as lt,jM as m,La as mt,nP as n,Nd as nt,mN as o,Td as ot,NM as p,za as pt,vg as q,rP as r,Md as rt,_N as s,eu as st,QN as t,cf as tt,DN as u,xo as ut,Ij as v,jr as vt,Ew as w,er as wt,lT as x,or as xt,HT as y,dr as yt,Hx as z};
|