@marimo-team/frontend 0.13.13-dev4 → 0.13.13-dev6
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/assets/{ConnectedDataExplorerComponent-BVeV8KcP.js → ConnectedDataExplorerComponent-DbE7cWQ2.js} +1 -1
- package/dist/assets/{VegaLite-Chzl6Klz.js → VegaLite-dQfDh_4z.js} +1 -1
- package/dist/assets/{_baseEach-qrlxhQe_.js → _baseEach-CG6PP0on.js} +1 -1
- package/dist/assets/_baseMap-6ilXjA7X.js +1 -0
- package/dist/assets/{_baseUniq-D3AsTxEW.js → _baseUniq-CF2J4B6u.js} +1 -1
- package/dist/assets/{_createAggregator-BpRmtuml.js → _createAggregator-8Wb1NIiQ.js} +1 -1
- package/dist/assets/{any-language-editor-BR0J_eLC.js → any-language-editor-BTeE5iii.js} +1 -1
- package/dist/assets/{architectureDiagram-IEHRJDOE-BwQIjjoT.js → architectureDiagram-IEHRJDOE-Q-Oaa_V0.js} +1 -1
- package/dist/assets/{blockDiagram-JOT3LUYC-rgvwhGsL.js → blockDiagram-JOT3LUYC-DlnhdsUb.js} +1 -1
- package/dist/assets/{c4Diagram-VJAJSXHY-DGS-Aqg6.js → c4Diagram-VJAJSXHY-COZD3WwB.js} +1 -1
- package/dist/assets/channel-exkzrsGf.js +1 -0
- package/dist/assets/{chunk-4BMEZGHF-Bg1ci0cO.js → chunk-4BMEZGHF-Dpq9dNPd.js} +1 -1
- package/dist/assets/{chunk-A2AXSNBT-qF9yiYuV.js → chunk-A2AXSNBT-788RUc6-.js} +1 -1
- package/dist/assets/{chunk-AEK57VVT-DoozRLtL.js → chunk-AEK57VVT-CnQturSd.js} +1 -1
- package/dist/assets/{chunk-D6G4REZN-Dg60bIYa.js → chunk-D6G4REZN-VhfdsYz1.js} +1 -1
- package/dist/assets/{chunk-RZ5BOZE2-CkkmMeo2.js → chunk-RZ5BOZE2-D2RPOQgD.js} +1 -1
- package/dist/assets/{chunk-XZIHB7SX-CksHOa-k.js → chunk-XZIHB7SX-TACP26t0.js} +1 -1
- package/dist/assets/{circle-play-_gdLbL4a.js → circle-play-BMISM9zc.js} +1 -1
- package/dist/assets/classDiagram-GIVACNV2-BFqh50yG.js +1 -0
- package/dist/assets/classDiagram-v2-COTLJTTW-BFqh50yG.js +1 -0
- package/dist/assets/clone-DOC_5w9d.js +1 -0
- package/dist/assets/{compile-DMQXjl_Y.js → compile-D8KCyynq.js} +1 -1
- package/dist/assets/{dagre-OKDRZEBW-CtSQrYFn.js → dagre-OKDRZEBW-wvhLy6RI.js} +1 -1
- package/dist/assets/{data-editor-D_BD6547.js → data-editor-4xfJBVDQ.js} +1 -1
- package/dist/assets/{diagram-SSKATNLV-CB5lO6DU.js → diagram-SSKATNLV-sQVw-rnu.js} +1 -1
- package/dist/assets/{diagram-VNBRO52H-BXup41B9.js → diagram-VNBRO52H-67rjVh4M.js} +1 -1
- package/dist/assets/{edit-page-Jjz-homB.js → edit-page-D6tlSgZT.js} +4 -4
- package/dist/assets/{erDiagram-Q7BY3M3F-DJqMDxj0.js → erDiagram-Q7BY3M3F-CrhWNOza.js} +1 -1
- package/dist/assets/{flowDiagram-4HSFHLVR-C5hUE3-p.js → flowDiagram-4HSFHLVR-Bt2FO03D.js} +1 -1
- package/dist/assets/{ganttDiagram-APWFNJXF-DD_zILEZ.js → ganttDiagram-APWFNJXF-SQACZpjD.js} +1 -1
- package/dist/assets/{gitGraphDiagram-7IBYFJ6S-CD26ihgc.js → gitGraphDiagram-7IBYFJ6S-g1o6aYZE.js} +1 -1
- package/dist/assets/{graph-C0b_RzoR.js → graph-QZKAlDGU.js} +1 -1
- package/dist/assets/{home-page-C4A3_jCI.js → home-page-DvJR4_8d.js} +1 -1
- package/dist/assets/{index-CurBdce7.js → index-B-C746qM.js} +1 -1
- package/dist/assets/{index-Owb_we9-.js → index-B27l1Lmz.js} +1 -1
- package/dist/assets/{index-Ze9t1SIE.js → index-BAHdmgR5.js} +1 -1
- package/dist/assets/{index-ZQx31dH9.js → index-BllzF65m.js} +1 -1
- package/dist/assets/{index-CkCRW5g7.js → index-BwKcs-n_.js} +13 -13
- package/dist/assets/{index-C78WI1Uh.js → index-CP6hlJiS.js} +1 -1
- package/dist/assets/{index-CoIgo7I5.js → index-Cc6r7pvR.js} +1 -1
- package/dist/assets/{index-p_DQKl91.js → index-CqrLm8ZJ.js} +1 -1
- package/dist/assets/{index-CIVhpZq2.js → index-Cz4AU9ew.js} +1 -1
- package/dist/assets/{index-DJXKJ7hv.js → index-D8ERw2CT.js} +1 -1
- package/dist/assets/{index-EcPQr1JM.js → index-DHWMBFuC.js} +1 -1
- package/dist/assets/{index-DaDHnfSS.js → index-DKHQmm_O.js} +1 -1
- package/dist/assets/{index-MuAGPXtv.js → index-Dz8QpDFW.js} +1 -1
- package/dist/assets/{index-BVSDgNfo.js → index-J-H_YIWG.js} +1 -1
- package/dist/assets/{index-BF3KiVZc.js → index-PM_fXUvN.js} +1 -1
- package/dist/assets/{index-BbT8ZBT4.js → index-_T9unogb.js} +1 -1
- package/dist/assets/{index-gEOaAA4k.js → index-by9J7LvV.js} +1 -1
- package/dist/assets/{index-cjE7oWZW.js → index-gxpBAnaK.js} +1 -1
- package/dist/assets/{index-DX-lEjsV.js → index-tTIKcc2K.js} +1 -1
- package/dist/assets/infoDiagram-PH2N3AL5-SecV5Zrc.js +2 -0
- package/dist/assets/{journeyDiagram-U35MCT3I-CkjpJ473.js → journeyDiagram-U35MCT3I-Cu9zo_0E.js} +1 -1
- package/dist/assets/{kanban-definition-NDS4AKOZ-CliBcALk.js → kanban-definition-NDS4AKOZ-CEUq4ITx.js} +1 -1
- package/dist/assets/{layout-De_0LerP.js → layout-CA4-e4ni.js} +1 -1
- package/dist/assets/{linear-CQy8tugT.js → linear-D6wapWEB.js} +1 -1
- package/dist/assets/{mermaid-Bkjoe36G.js → mermaid-BVHdUJri.js} +4 -4
- package/dist/assets/{min-ByreTgv3.js → min-DGzdenCJ.js} +1 -1
- package/dist/assets/{mindmap-definition-ALO5MXBD-DG4TOXgk.js → mindmap-definition-ALO5MXBD-BpwRiDyj.js} +1 -1
- package/dist/assets/{pieDiagram-IB7DONF6-KJmnivDN.js → pieDiagram-IB7DONF6-BSo4zNyP.js} +1 -1
- package/dist/assets/{quadrantDiagram-7GDLP6J5-TIRov7Ev.js → quadrantDiagram-7GDLP6J5-DrGu8dpV.js} +1 -1
- package/dist/assets/{radar-MK3ICKWK-Cdjx3qG6.js → radar-MK3ICKWK-CH6ZEkOy.js} +1 -1
- package/dist/assets/{react-plotly-Bj_1f840.js → react-plotly-JNP3SFAp.js} +1 -1
- package/dist/assets/{requirementDiagram-KVF5MWMF-Dz9jOsSU.js → requirementDiagram-KVF5MWMF-Tvy3tYag.js} +1 -1
- package/dist/assets/{run-page-BOZy7xGv.js → run-page-C9O1d9ku.js} +1 -1
- package/dist/assets/{sankeyDiagram-QLVOVGJD-U-VbMBKE.js → sankeyDiagram-QLVOVGJD-DVOKbbBJ.js} +1 -1
- package/dist/assets/{sequenceDiagram-X6HHIX6F-CTpsO8Q4.js → sequenceDiagram-X6HHIX6F-BpclEGfO.js} +1 -1
- package/dist/assets/{slides-component-BcKviJmP.js → slides-component-er_rRwTM.js} +1 -1
- package/dist/assets/{sortBy-Bq421T3M.js → sortBy-BCuX-Whj.js} +1 -1
- package/dist/assets/{stateDiagram-DGXRK772-EMIHMD_F.js → stateDiagram-DGXRK772-CAs8Hyiz.js} +1 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-DoNns4sy.js +1 -0
- package/dist/assets/{terminal-CgyaavGX.js → terminal-DC1Y_3lM.js} +1 -1
- package/dist/assets/{time-DybTIIou.js → time-BA2I39A6.js} +1 -1
- package/dist/assets/{timeline-definition-BDJGKUSR-Q83IsaSB.js → timeline-definition-BDJGKUSR-DPEtkvS3.js} +1 -1
- package/dist/assets/{tracing-Fv2F91hb.js → tracing-CJpPOtw8.js} +2 -2
- package/dist/assets/{tree-h9ynbVJ9.js → tree-DFS5q1V-.js} +1 -1
- package/dist/assets/{useMarimoWebSocket-DPRk_7Ws.js → useMarimoWebSocket-BL3Rc0Jm.js} +3 -3
- package/dist/assets/{vega-component-DV_O0MsU.js → vega-component-7AFbhupl.js} +1 -1
- package/dist/assets/{xychartDiagram-VJFVF3MP-sJy_45N9.js → xychartDiagram-VJFVF3MP-sKAstW6S.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-DjPetstd.js +0 -1
- package/dist/assets/channel-KOoWUUH6.js +0 -1
- package/dist/assets/classDiagram-GIVACNV2-OuFfYWMc.js +0 -1
- package/dist/assets/classDiagram-v2-COTLJTTW-OuFfYWMc.js +0 -1
- package/dist/assets/clone-BPJ2bdIl.js +0 -1
- package/dist/assets/infoDiagram-PH2N3AL5-kW_pvuIu.js +0 -2
- package/dist/assets/stateDiagram-v2-YXO3MK2T-CfvwMNtB.js +0 -1
@@ -1,5 +1,5 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
2
|
-
var bF=Object.defineProperty;var S3=Ft=>{throw TypeError(Ft)};var yF=(Ft,jt,pn)=>jt in Ft?bF(Ft,jt,{enumerable:!0,configurable:!0,writable:!0,value:pn}):Ft[jt]=pn;var ee=(Ft,jt,pn)=>yF(Ft,typeof jt!="symbol"?jt+"":jt,pn),xF=(Ft,jt,pn)=>jt.has(Ft)||S3("Cannot "+pn);var C3=(Ft,jt,pn)=>(xF(Ft,jt,"read from private field"),pn?pn.call(Ft):jt.get(Ft)),N3=(Ft,jt,pn)=>jt.has(Ft)?S3("Cannot add the same private member more than once"):jt instanceof WeakSet?jt.add(Ft):jt.set(Ft,pn);import{u as Pe,S as A,i3 as wF,i4 as vF,i5 as j3,i6 as kF,i7 as SF,i8 as CF,R as K,i9 as NF,ia as Er,ib as jF,ic as em,id as E3,ie as EF,ig as IF,ih as I3,ii as nc,d as X,ac as Jn,ij as tm,j as h,dp as nm,dq as A3,dr as AF,dt as om,dv as rm,f2 as oc,ik as sm,dm as im,dn as am,ds as lm,il as TF,im as T3,ec as M3,bl as Qe,Q as Lt,io as MF,dR as mo,ip as O3,iq as D3,ir as cm,is as R3,it as dm,L as Qt,aj as Ut,cz as um,a2 as Ae,iu as OF,ed as dt,iv as P3,iw as DF,a8 as lt,ix as hm,eh as rc,iy as L3,iz as sc,T as $e,aX as Un,al as Gt,iA as ic,iB as Ts,e1 as Ms,iC as RF,iD as Qi,iE as PF,ea as LF,iF as F3,iG as z3,dJ as FF,as as fm,iH as Ir,aG as ac,aI as lr,iI as zF,iJ as lc,iK as B3,aq as ea,ey as U3,ar as ta,iL as BF,a7 as xn,iM as mm,iN as Ar,a3 as cr,a4 as Os,a5 as dr,bd as Tr,af as po,e2 as Ds,gh as V3,fJ as Rs,gk as UF,a$ as hn,iO as VF,iP as $F,fH as pm,aF as cc,iQ as gm,iR as HF,iS as $3,iT as _m,iU as WF,iV as qF,iW as go,iX as H3,fN as bm,iY as na,iZ as dc,dY as GF,Z as Kn,a6 as Ps,bb as ur,i_ as oa,bp as fn,a9 as Ls,ap as Oe,e_ as _o,b4 as W3,ej as en,i$ as YF,eL as JF,dw as uc,j0 as ym,aK as xm,j1 as KF,j2 as wm,e7 as Fs,j3 as XF,j4 as vm,bg as Vn,j5 as ZF,dP as Te,j6 as Je,j7 as km,j8 as Mt,j9 as q3,ja as QF,fo as Sm,aB as En,aQ as Xn,g5 as G3,g6 as Y3,g7 as ez,gb as tz,g8 as J3,ag as Me,dI as nz,aD as hc,aO as fc,aE as mc,aL as sn,eb as Fo,jb as oz,g9 as K3,jc as rz,f_ as X3,g0 as Z3,jd as zs,je as Q3,jf as sz,jg as iz,a1 as az,a0 as lz,e6 as ra,jh as pc,ji as Bs,jj as gc,jk as cz,jl as dz,jm as e4,jn as mn,fM as t4,dK as _c,b7 as uz,jo as hz,ab as Cm,aH as fz,jp as mz,gl as n4,b3 as bc,jq as Nm,aa as sa,dZ as o4,jr as pz,$ as gz,g2 as _z,js as bz,jt as yz,ju as xz,jv as wz,jw as vz,jx as kz,dk as zo,jy as yc,jz as Us,o as Bo,n as st,fr as Zn,jA as In,jB as ut,jC as Vs,jD as Vt,fI as Yt,jE as jm,dO as Qn,jF as Sz,jG as Cz,b1 as r4,b2 as s4,jH as i4,jI as Nz,go as $s,jJ as xc,a_ as wc,gn as Mr,jK as a4,jL as ia,ee as Em,jM as jz,jN as Ez,jO as Iz,jP as Az,jQ as l4,jR as Tz,jS as c4,jT as d4,jU as Mz,jV as u4,jW as h4,ef as vc,jX as Oz,bm as Dz,jY as Rz,fq as $n,jZ as Pz,j_ as Lz,j$ as Hs,k0 as kc,k1 as Ws,fB as Uo,k2 as Im,k3 as aa,k4 as la,k5 as ca,k6 as Fz,fh as Sc,k7 as Am,k8 as f4,k9 as Cc,eK as Nc,fi as zz,r as Bz,ka as Uz,kb as Vz,kc as m4,t as D,kd as $z,ke as Hz,kf as Tm,fU as jc,kg as p4,fu as Wz,aN as Mm,kh as g4,ki as qz,kj as Gz,kk as Yz,kl as Jz,km as Kz,kn as Xz,ko as Zz,kp as Qz,kq as eB,kr as tB,ks as nB,kt as oB,ku as rB,kv as sB,kw as iB,kx as aB,ky as lB,kz as cB,kA as dB,kB as uB,kC as da,kD as hB,kE as fB,kF as mB,kG as pB,kH as gB,kI as _B,kJ as _4,kK as bB,kL as yB,kM as xB,kN as b4,kO as wB,kP as vB,kQ as y4,kR as kB,kS as qs,kT as Hn,kU as SB,kV as CB,kW as NB,kX as jB,kY as EB,kZ as IB,k_ as AB,k$ as TB,l0 as MB,l1 as OB,l2 as hr,l3 as DB,l4 as RB,l5 as PB,l6 as LB,ek as FB,l7 as zB,l8 as x4,eo as BB,l9 as Ec,la as UB,lb as VB,lc as $B,ld as HB,ah as Or,le as Ic,en as WB,lf as Om,lg as Ac,lh as ua,li as ha,lj as Tc,lk as fr,ll as w4,lm as Vo,ln as Gs,lo as Dm,lp as fa,lq as Ys,lr as Rm,ls as Pm,lt as v4,lu as Mc,lv as qB,ad as ma,lw as pa,lx as GB,eJ as Oc,ly as YB,lz as Lm,lA as JB,lB as KB,lC as Dc,lD as XB,lE as ZB,lF as k4,lG as Fm,gm as Js,lH as QB,lI as eU,lJ as tU,lK as nU,fz as oU,ba as rU,gp as Nt,lL as ga,lM as Ks,lN as sU,lO as iU,lP as zm,lQ as aU,lR as lU,b0 as S4,lS as cU,lT as dU,lU as Rc,lV as C4,eD as Pc,bc as N4,ak as Lc,lW as j4,lX as uU,lY as hU,lZ as Bm,l_ as Um,l$ as fU,m0 as E4,m1 as I4,m2 as _a,d$ as mU,fl as pU,f0 as gU,W as A4,fn as _U,m3 as T4,m4 as bU,m5 as yU,m6 as M4,m7 as xU,m8 as wU,m9 as O4,ma as D4,mb as vU,be as R4,mc as kU,md as Vm,e5 as SU,me as $o,dG as P4,mf as L4,e9 as F4,fb as $m,mg as Hm,mh as z4,br as Wm,dH as Fc,mi as B4,mj as CU,mk as NU,ml as jU,b9 as zc,mm as EU,f4 as qm,f$ as IU,g3 as AU,ga as Gm,gd as TU,mn as MU,mo as Ym,mp as OU,mq as DU,mr as RU,ms as PU,mt as LU,mu as FU,mv as zU,mw as BU,U as UU,mx as Bc,V as VU,my as U4,mz as $U,e$ as HU,mA as V4,aY as eo,ff as WU,dy as $4,mB as qU,mC as H4,mD as GU,eI as YU,mE as JU,mF as KU,e0 as XU,mG as ZU,mH as QU,an as Uc,mI as eV,ao as mr,dB as W4,mJ as Jm,mK as tV,ei as q4,mL as nV,mM as G4,mN as oV,mO as rV,mP as sV,mQ as iV,mR as aV,mS as lV,mT as Y4,fX as Km,fV as Xm,fQ as Xs,fW as Dr,mU as J4,fY as Zm,fR as Rr,dS as cV,mV as Qm,mW as dV,am as uV,mX as hV,fA as K4,E as Zs,mY as fV,mZ as mV,m_ as pV,m$ as gV,n0 as ba,n1 as _V,n2 as bV,n3 as yV,n4 as xV,n5 as wV,n6 as X4,n7 as vV,fp as kV,n8 as SV,n9 as CV,na as NV,nb as jV,gc as EV,nc as IV,nd as AV,ne as TV,nf as Z4,ng as Q4,eZ as eS,nh as MV,ni as OV,nj as tS,nk as DV,nl as RV,nm as Vc,nn as PV,no as LV,np as FV,C as ep,nq as zV,nr as BV,ns as UV,aC as VV,nt as pr,nu as nS,dQ as $V,fS as HV,fT as WV,nv as qV,nw as Qs,nx as GV,ny as $c,nz as YV,nA as JV,y as oS,nB as KV,de as XV,nC as ZV,eQ as QV,aZ as e$,aW as t$,nD as Hc,nE as rS,nF as sS,nG as iS,nH as n$,e4 as o$,__tla as r$}from"./index-CkCRW5g7.js";import{G as s$,L as aS,g as i$,b as ya,A as a$,s as l$,k as c$,B as lS,a as d$,M as u$,Y as h$,c as wn,u as Wc,C as f$,S as m$,K as p$,d as g$,i as _$,e as cS,f as b$,h as y$,j as x$,l as xa,P as tp,m as dS,n as w$,o as v$,p as np,T as k$}from"./tree-h9ynbVJ9.js";import{c as uS,d as hS,L as fS,P as ei,I as op,e as S$,f as mS,N as pS,V as gS,S as _S,F as bS,g as yS,M as C$,l as xS,h as N$,E as wS,i as j$,j as rp,k as E$,m as I$,n as A$,o as T$,p as M$,q as O$,s as D$,t as R$,v as P$,u as L$,C as F$,R as vS,a as z$,A as B$,w as U$,x as V$,O as $$,T as H$,y as W$,z as q$,__tla as G$}from"./useMarimoWebSocket-DPRk_7Ws.js";import{c as Y$}from"./_createAggregator-BpRmtuml.js";import{s as to,i as gr,T as sp,a as ip}from"./transform-Cyp0GDF-.js";import{g as kS}from"./timer-DFzT7np-.js";import{i as J$}from"./zoom-COrs4lFh.js";import{s as wa}from"./sortBy-Bq421T3M.js";let ap,qc,An,lp,SS,va,cp,K$=Promise.all([(()=>{try{return r$}catch{}})(),(()=>{try{return G$}catch{}})()]).then(async()=>{var Ql,k3;var Ft=Y$(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let jt,pn,dp,Gc,ti,ni,up,hp,fp,mp,ka,Yc,pp,Sa,gp,Jc,_p,bp,Kc,yp,xp,wp,Ca,vp,Xc,kp,Sp,Cp,Np,jp,Ep,Zc,Ip,Qc,Ap,Tp,Mp,Op,Dp,Na,Rp,Pp,ed,Lp,Fp,zp,td,Bp,Up,Vp,ja,nd,od,$p,Hp,Wp,qp,Gp,Yp,oi,Jp,Kp,Xp,rd,sd,Zp,Qp,eg,Ea,_r,br;jt=Pe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),pn=Pe("arrow-right-from-line",[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M21 12H7",key:"13ipq5"}],["path",{d:"m15 18 6-6-6-6",key:"6tx3qv"}]]),dp=Pe("arrow-right-to-line",[["path",{d:"M17 12H3",key:"8awo09"}],["path",{d:"m11 18 6-6-6-6",key:"8c2y43"}],["path",{d:"M21 5v14",key:"nzette"}]]),Gc=Pe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),ti=Pe("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),ni=Pe("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),up=Pe("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),hp=Pe("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),lp=Pe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),fp=Pe("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),mp=Pe("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),ka=Pe("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Yc=Pe("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),pp=Pe("clipboard-paste",[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]),Sa=Pe("cloud-download",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]),gp=Pe("code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),Jc=Pe("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),_p=Pe("copy-minus",[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),bp=Pe("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),Kc=Pe("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),yp=Pe("eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]),xp=Pe("fast-forward",[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]]),wp=Pe("file-pen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]),Ca=Pe("file-plus-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]]),vp=Pe("files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]),Xc=Pe("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),kp=Pe("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]),Sp=Pe("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),Cp=Pe("hard-drive-download",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]]),Np=Pe("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),jp=Pe("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),Ep=Pe("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),Zc=Pe("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),Ip=Pe("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Qc=Pe("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),Ap=Pe("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]),Tp=Pe("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),Mp=Pe("memory-stick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]),Op=Pe("message-circle-question",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Dp=Pe("microchip",[["path",{d:"M18 12h2",key:"quuxs7"}],["path",{d:"M18 16h2",key:"zsn3lv"}],["path",{d:"M18 20h2",key:"9x5y9y"}],["path",{d:"M18 4h2",key:"1luxfb"}],["path",{d:"M18 8h2",key:"nxqzg"}],["path",{d:"M4 12h2",key:"1ltxp0"}],["path",{d:"M4 16h2",key:"8a5zha"}],["path",{d:"M4 20h2",key:"27dk57"}],["path",{d:"M4 4h2",key:"10groj"}],["path",{d:"M4 8h2",key:"18vq6w"}],["path",{d:"M8 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-1.5c-.276 0-.494.227-.562.495a2 2 0 0 1-3.876 0C9.994 2.227 9.776 2 9.5 2z",key:"1681fp"}]]),Na=Pe("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),Rp=Pe("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"}]]),Pp=Pe("package-check",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),ed=Pe("package-x",[["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["path",{d:"m17 13 5 5m-5 0 5-5",key:"im3w4b"}]]),Lp=Pe("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Fp=Pe("party-popper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]),zp=Pe("pen-line",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]),td=Pe("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),Bp=Pe("regex",[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]]),Up=Pe("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),Vp=Pe("rows-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]),ja=Pe("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),nd=Pe("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]),od=Pe("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),$p=Pe("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Hp=Pe("square-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Wp=Pe("square-dashed-bottom-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["path",{d:"M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2",key:"as5y1o"}],["path",{d:"M9 21h1",key:"15o7lz"}]]),qp=Pe("square-equal",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}]]),Gp=Pe("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),Yp=Pe("square-play",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]]),oi=Pe("square-plus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Jp=Pe("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Kp=Pe("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]),Xp=Pe("text-cursor-input",[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]]),rd=Pe("text-search",[["path",{d:"M21 6H3",key:"1jwq7v"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 18H3",key:"13769t"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),sd=Pe("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),Zp=Pe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),Qp=Pe("view",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]),eg=Pe("whole-word",[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]),Ea=Pe("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),_r=Pe("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),br=Pe("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);const CS=A.createContext({}),NS=A.forwardRef(function(t,e){[t,e]=SF(t,e,CS);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,u]=A.useState(!1);wF(()=>{var p;u(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=vF(),m=f==="rtl"&&c==="horizontal";let _=kF(i);const g=A.useRef(null);return{toolbarProps:{...j3(s,{labelable:!0}),role:d?"group":"toolbar","aria-orientation":c,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:d?void 0:p=>{if(p.currentTarget.contains(p.target)){if(c==="horizontal"&&p.key==="ArrowRight"||c==="vertical"&&p.key==="ArrowDown")m?_.focusPrevious():_.focusNext();else{if(!(c==="horizontal"&&p.key==="ArrowLeft"||c==="vertical"&&p.key==="ArrowUp"))return p.key==="Tab"?(p.stopPropagation(),g.current=document.activeElement,void(p.shiftKey?_.focusFirst():_.focusLast())):void 0;m?_.focusNext():_.focusPrevious()}p.stopPropagation(),p.preventDefault()}},onFocusCapture:d?void 0:p=>{var b,x;g.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(p.target))&&((x=g.current)===null||x===void 0||x.focus(),g.current=null)},onBlurCapture:d?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||g.current||(g.current=p.target)}}}}(t,e),o=CF({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=j3(t);return delete r.id,K.createElement("div",{...NF(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)});function Ia(t,e){const n=+Er(t)-+Er(e);return n<0?-1:n>0?1:n}function jS(t,e){const n=Er(t,e==null?void 0:e.in);return+function(o,r){const s=Er(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=Er(o,r==null?void 0:r.in),i=s.getMonth();return s.setFullYear(s.getFullYear(),i+1,0),s.setHours(23,59,59,999),s}(n,e)}function ES(t,e,n){const[o,r,s]=em(n==null?void 0:n.in,t,t,e),i=Ia(r,s),a=Math.abs(function(d,u,f){const[m,_]=em(f==null?void 0:f.in,d,u);return 12*(m.getFullYear()-_.getFullYear())+(m.getMonth()-_.getMonth())}(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=Ia(r,s)===-i;jS(o)&&a===1&&Ia(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function IS(t,e,n){const o=function(r,s){return+Er(r)-+Er(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function AS(t,e){return function(n,o,r){const s=EF(),i=(r==null?void 0:r.locale)??s.locale??IF,a=Ia(n,o);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:a}),[c,d]=em(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),u=IS(d,c),f=(E3(d)-E3(c))/1e3,m=Math.round((u-f)/60);let _;if(m<2)return m===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",m,l);if(m<45)return i.formatDistance("xMinutes",m,l);if(m<90)return i.formatDistance("aboutXHours",1,l);if(m<I3){const g=Math.round(m/60);return i.formatDistance("aboutXHours",g,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<nc){const g=Math.round(m/I3);return i.formatDistance("xDays",g,l)}if(m<2*nc)return _=Math.round(m/nc),i.formatDistance("aboutXMonths",_,l);if(_=ES(d,c),_<12){const g=Math.round(m/nc);return i.formatDistance("xMonths",g,l)}{const g=_%12,p=Math.trunc(_/12);return g<3?i.formatDistance("aboutXYears",p,l):g<9?i.formatDistance("overXYears",p,l):i.formatDistance("almostXYears",p+1,l)}}(t,function(n){return jF(n,Date.now())}(t),e)}const TS=()=>{const t=X.c(7),{selectedLayout:e}=uS(),{setLayoutView:n}=hS();if(Jn()&&!tm("wasm_layouts"))return null;let o,r,s,i;return t[0]!==n?(o=a=>n(a),t[0]=n,t[1]=o):o=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(im,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:h.jsx(am,{placeholder:"Select a view"})}),t[2]=r):r=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(nm,{children:h.jsxs(A3,{children:[h.jsx(AF,{children:"View as"}),fS.map(OS)]})}),t[3]=s):s=t[3],t[4]!==e||t[5]!==o?(i=h.jsxs(lm,{"data-testid":"layout-select",value:e,onValueChange:o,children:[r,s]}),t[4]=e,t[5]=o,t[6]=i):i=t[6],i};function MS(t){const e=tg(t);return h.jsx(e,{className:"h-4 w-4"})}function tg(t){switch(t){case"vertical":return Ap;case"grid":return s$;case"slides":return td;default:return oc(t),sm}}function ng(t){return rm(t)}function OS(t){return h.jsx(om,{value:t,children:h.jsxs("div",{className:"flex items-center gap-1.5 leading-5",children:[MS(t),h.jsx("span",{children:ng(t)})]})},t)}function DS(){const t=X.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];const[n,o]=function(i,a){const l=X.c(11);let c;l[0]!==a?(c=new TF(a),l[0]=a,l[1]=c):c=l[1];const d=c;let u;l[2]!==i||l[3]!==d?(u=()=>d.get(i),l[2]=i,l[3]=d,l[4]=u):u=l[4];const[f,m]=A.useState(u);let _;l[5]!==i||l[6]!==d?(_=b=>{m(b),d.set(i,b)},l[5]=i,l[6]=d,l[7]=_):_=l[7];const g=_;let p;return l[8]!==g||l[9]!==f?(p=[f,g],l[8]=g,l[9]=f,l[10]=p):p=l[10],p}("marimo:commands",e);let r,s;return t[1]!==n||t[2]!==o?(r=i=>{const a=(l=[i,...n],[...new Set(l)]);var l;o(a.slice(0,3))},t[1]=n,t[2]=o,t[3]=r):r=t[3],t[4]!==n||t[5]!==r?(s={recentCommands:n,addRecentCommand:r},t[4]=n,t[5]=r,t[6]=s):s=t[6],s}function og(t){return t.dropdown!==void 0}function Aa(t,e=""){return t.flatMap(n=>n.label?og(n)?Aa(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const ri=t=>{const e=X.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=K.Children.toArray(n),e[0]=n,e[1]=s):s=e[1];const[i,a]=s,l=`second-icon absolute ${r?"top-[-2px] left-[-2px]":"bottom-[-2px] right-[-2px]"} rounded-full`;let c,d;return e[2]!==a||e[3]!==l?(c=h.jsx("div",{className:l,children:a}),e[2]=a,e[3]=l,e[4]=c):c=e[4],e[5]!==i||e[6]!==c?(d=h.jsxs("div",{className:"multi-icon relative w-fit",children:[i,c]}),e[5]=i,e[6]=c,e[7]=d):d=e[7],d};function id(t){const e=X.c(3),n=ad();let o;return e[0]!==t||e[1]!==n?(o=()=>{t!==void 0&&n([t])},e[0]=t,e[1]=n,e[2]=o):o=e[2],Qe(o)}function rg(){const t=X.c(2),e=ad();let n;return t[0]!==e?(n=()=>e(O3(mo())),t[0]=e,t[1]=n):n=t[1],Qe(n)}function ad(){const t=X.c(2),{prepareForRun:e}=Lt();let n;return t[0]!==e?(n=async o=>{var a;if(o.length===0)return;const{cellHandles:r,cellData:s}=mo(),i=[];for(const l of o){const c=r[l],d=(a=c.current)==null?void 0:a.editorView;let u;d?(D3(d)!=="markdown"&&cm(d),u=R3(d)):u=s[l].code,i.push(u),e({cellId:l})}await dm({cellIds:o,codes:i}).catch(RS)},t[0]=e,t[1]=n):n=t[1],Qe(n)}function RS(t){Qt.error(t)}const Ta=Ut(null),PS=Ut(!1),ld=Ut({chats:[],activeChatId:null}),LS=Ut(t=>{const e=t(ld);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(ld,o=>({...o,activeChatId:n}))}),cd=t=>{const e=X.c(7);let n,o;e[0]!==t?(n=a=>{var l;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(l=t.onClick)==null||l.call(t,a))},e[0]=t,e[1]=n):n=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(o={capture:!0},e[2]=o):o=e[2],um(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(OF,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=h.jsxs(Ae,{"data-testid":"undo-button",size:"sm",variant:"outline",...t,children:[r," ",s]}),e[4]=r,e[5]=t,e[6]=i):i=e[6],i};function dd(){const t=X.c(3),{deleteCell:e,undoDeleteCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{if(dt.get(P3))return;const{cellId:s}=r;e({cellId:s}),DF({cellId:s}).catch(()=>{n()});const{dismiss:i}=lt({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:h.jsx(cd,{"data-testid":"undo-delete-button",onClick:()=>{n(),a()}})}),a=i},t[0]=e,t[1]=n,t[2]=o):o=t[2],Qe(o)}function sg(t,e,n,o=dt){if(e in o.get(hm))return!1;const{cellData:r,cellIds:s}=o.get(rc),i=new RegExp(`import[ ]+${t}[ ]+as[ ]+${e}`,"g");for(const a of s.inOrderIds)if(i.test(r[a].code))return!1;return n(`import ${t} as ${e}`),!0}function Ho(t,e,n){return sg("marimo","mo",o=>{const r=L3.create();e({cellId:n??"__end__",before:!1,code:o,lastCodeRun:t?o:void 0,newCellId:r,autoFocus:!1}),t&&dm({cellIds:[r],codes:[o]})})}function ig(){const t=X.c(3),{splitCell:e,undoSplitCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=sc(r.cellId);if(!s)return;const i=R3(s);e(r);const{dismiss:a}=lt({title:"Cell split",action:h.jsx(cd,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:i}),l()},children:"Undo"})}),l=a},t[0]=e,t[1]=n,t[2]=o):o=t[2],Qe(o)}function ud(t){const e=X.c(49),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:c,clearCellOutput:d}=Lt(),u=ig(),f=id(n==null?void 0:n.cellId),m=!$e(P3),_=dd(),{openModal:g}=Un(),p=Gt(Ta),b=$e(ic),x=$e(Ts),y=$e(Ms),v=$e(RF);if(!n||y){let N;return e[0]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[0]=N):N=e[0],N}const{cellId:S,config:k,getEditorView:j,name:E,hasOutput:I,hasConsoleOutput:T,status:M}=n;let R;e[1]!==S||e[2]!==k.disabled||e[3]!==r?(R=async()=>{const N={disabled:!k.disabled};await Ar({configs:{[S]:N}}),r({cellId:S,config:N})},e[1]=S,e[2]=k.disabled,e[3]=r,e[4]=R):R=e[4];const B=R;let O;e[5]!==S||e[6]!==k.hide_code||e[7]!==j||e[8]!==r?(O=async()=>{const N={hide_code:!k.hide_code};await Ar({configs:{[S]:N}}),r({cellId:S,config:N});const H=j();H&&(N.hide_code?H.contentDOM.blur():H.focus())},e[5]=S,e[6]=k.hide_code,e[7]=j,e[8]=r,e[9]=O):O=e[9];const z=O;let F,V,L,C,$;return e[10]===Symbol.for("react.memo_cache_sentinel")?(F=h.jsx(Xp,{size:13,strokeWidth:1.5}),e[10]=F):F=e[10],e[11]!==S||e[12]!==E||e[13]!==g||e[14]!==s?(V=()=>{g(h.jsxs(cr,{children:[h.jsx(Os,{children:h.jsx(dr,{children:"Rename cell"})}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(Tr,{htmlFor:"cell-name",children:"Cell name"}),h.jsx(pS,{placeholder:"cell name",value:E,onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),N.stopPropagation(),g(null))},onChange:N=>s({cellId:S,name:N})})]})]}))},e[11]=S,e[12]=E,e[13]=g,e[14]=s,e[15]=V):V=e[15],e[16]!==S||e[17]!==s?(L=N=>s({cellId:S,name:N}),e[16]=S,e[17]=s,e[18]=L):L=e[18],e[19]!==E||e[20]!==L?(C=h.jsx(pS,{placeholder:"cell name",value:E,onChange:L}),e[19]=E,e[20]=L,e[21]=C):C=e[21],e[22]!==c||e[23]!==b||e[24]!==v||e[25]!==x||e[26]!==m||e[27]!==S||e[28]!==d||e[29]!==k.disabled||e[30]!==k.hide_code||e[31]!==o||e[32]!==_||e[33]!==j||e[34]!==T||e[35]!==I||e[36]!==i||e[37]!==E||e[38]!==f||e[39]!==l||e[40]!==a||e[41]!==p||e[42]!==u||e[43]!==M||e[44]!==V||e[45]!==C||e[46]!==B||e[47]!==z?($=[[{icon:F,label:"Name",disableClick:!0,handle:US,handleHeadless:V,rightElement:C},{icon:h.jsx(ei,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:M==="running"||M==="queued"||M==="disabled-transitively"||k.disabled,handle:()=>f()},{icon:h.jsx(Qi,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(N=>(N==null?void 0:N.cellId)===S?null:{cellId:S})},hotkey:"cell.aiCompletion"},{icon:h.jsx(nd,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>u({cellId:S})},{icon:h.jsx(op,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!I,handle:()=>function(N){const H=document.getElementById(T3.create(N));H&&(H.classList.add("printing-output"),M3(H,"result.png").finally(()=>{H.classList.remove("printing-output")}))}(S)},{icon:h.jsx(LF,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const N=j();N&&PF({[S]:N})}},{icon:k.hide_code?h.jsx(F3,{size:13,strokeWidth:1.5}):h.jsx(z3,{size:13,strokeWidth:1.5}),label:k.hide_code?"Show code":"Hide code",handle:z,hotkey:"cell.hideCode"},{icon:k.disabled?h.jsx(_r,{size:13,strokeWidth:1.5}):h.jsx(br,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:h.jsx(FF,{"data-testid":"cell-disable-switch",checked:!k.disabled,size:"sm",onCheckedChange:B}),handle:B},{icon:h.jsx(fm,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(I||T),handle:()=>{d({cellId:S})}}],[{icon:h.jsx(ac,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const N=j();N&&(Ho(x,o),Ir(N,"markdown",{keepCodeAsIs:!0}))}},{icon:h.jsx(lr,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const N=j();N&&(Ho(x,o),Ir(N,"sql",{keepCodeAsIs:!0}))}},{icon:h.jsx(lc,{}),label:"Toggle as Python",handle:()=>{const N=j();N&&(Ho(x,o),zF(N,"python",{force:!0}))}}],[{icon:h.jsxs(ri,{children:[h.jsx(ka,{size:13,strokeWidth:1.5}),h.jsx(B3,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:S,before:!0})},{icon:h.jsxs(ri,{children:[h.jsx(ka,{size:13,strokeWidth:1.5}),h.jsx(ea,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:S,before:!1})},{icon:h.jsx(B3,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:S,before:!0})},{icon:h.jsx(ea,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:S,before:!1})},{icon:h.jsx(U3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:S,direction:"left"}),hidden:v!=="columns"},{icon:h.jsx(ta,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:S,direction:"right"}),hidden:v!=="columns"},{icon:h.jsx(hp,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:S})},{icon:h.jsx(up,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:S})},{icon:h.jsx(BF,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:v!=="columns",handle:()=>c({cellId:S})}],[{icon:h.jsx(aS,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!mS(E),tooltip:mS(E)?void 0:"Only named cells can be linked to",handle:async()=>{await xn(S$(E)),lt({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:h.jsx(mm,{size:13,strokeWidth:1.5}),handle:()=>{_({cellId:S})}}]].map(zS).filter(FS),e[22]=c,e[23]=b,e[24]=v,e[25]=x,e[26]=m,e[27]=S,e[28]=d,e[29]=k.disabled,e[30]=k.hide_code,e[31]=o,e[32]=_,e[33]=j,e[34]=T,e[35]=I,e[36]=i,e[37]=E,e[38]=f,e[39]=l,e[40]=a,e[41]=p,e[42]=u,e[43]=M,e[44]=V,e[45]=C,e[46]=B,e[47]=z,e[48]=$):$=e[48],$}function FS(t){return t.length>0}function zS(t){return t.filter(BS)}function BS(t){return!t.hidden}function US(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function VS(t){return!t.hidden}const hd=Ut(!1),ag=()=>{const t=X.c(37),[e,n]=hn(hd),o=VF(),r=$e($F),s=$e(pm);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=ud(i).flat();a=Aa(a);const l=function(){const L=X.c(45),{theme:C}=po(),[$,N]=Ds(),[H,Y]=V3();let Z;L[0]!==N?(Z=async le=>{await Rs({config:le}).then(()=>{N(le)})},L[0]=N,L[1]=Z):Z=L[1];const q=Z;let re;L[2]!==Y?(re=async le=>{await UF({config:le}).then(()=>{Y(le)})},L[2]=Y,L[3]=re):re=L[3];const ne=re;let oe;if(L[4]!==H||L[5]!==$||L[6]!==ne||L[7]!==q||L[8]!==C){let le,fe,de;L[10]!==H?(le=et=>et!==H.width,L[10]=H,L[11]=le):le=L[11],L[12]!==H||L[13]!==ne?(fe=et=>({label:`App config > Set width=${et}`,handle:()=>{ne({...H,width:et})}}),L[12]=H,L[13]=ne,L[14]=fe):fe=L[14],L[15]!==$||L[16]!==q||L[17]!==C?(de={label:"Config > Toggle dark mode",handle:()=>{q({...$,display:{...$.display,theme:C==="dark"?"light":"dark"}})}},L[15]=$,L[16]=q,L[17]=C,L[18]=de):de=L[18];const he=$.keymap.preset==="vim";let se,ye;L[19]!==$||L[20]!==q?(se=()=>{q({...$,keymap:{...$.keymap,preset:"vim"}})},L[19]=$,L[20]=q,L[21]=se):se=L[21],L[22]!==he||L[23]!==se?(ye={label:"Config > Switch keymap to VIM",hidden:he,handle:se},L[22]=he,L[23]=se,L[24]=ye):ye=L[24];const je=$.keymap.preset==="default";let ce,Ee,_e;L[25]!==$||L[26]!==q?(ce=()=>{q({...$,keymap:{...$.keymap,preset:"default"}})},L[25]=$,L[26]=q,L[27]=ce):ce=L[27],L[28]!==ce||L[29]!==je?(Ee={label:"Config > Switch keymap to default (current: VIM)",hidden:je,handle:ce},L[28]=ce,L[29]=je,L[30]=Ee):Ee=L[30],L[31]!==$||L[32]!==q?(_e=()=>{q({...$,completion:{...$.completion,copilot:!1}})},L[31]=$,L[32]=q,L[33]=_e):_e=L[33];const De=$.completion.copilot!=="github";let Fe,He;L[34]!==_e||L[35]!==De?(Fe={label:"Config > Disable GitHub Copilot",handle:_e,hidden:De},L[34]=_e,L[35]=De,L[36]=Fe):Fe=L[36],L[37]!==$||L[38]!==q?(He=()=>{q({...$,completion:{...$.completion,copilot:"github"}})},L[37]=$,L[38]=q,L[39]=He):He=L[39];const Xe=$.completion.copilot==="github";let Le;L[40]!==He||L[41]!==Xe?(Le={label:"Config > Enable GitHub Copilot",handle:He,hidden:Xe},L[40]=He,L[41]=Xe,L[42]=Le):Le=L[42],oe=[...i$().filter(le).map(fe),de,ye,Ee,Fe,Le],L[4]=H,L[5]=$,L[6]=ne,L[7]=q,L[8]=C,L[9]=oe}else oe=L[9];const G=oe;let Q;return L[43]!==G?(Q=G.filter(VS),L[43]=G,L[44]=Q):Q=L[44],Q}();let c=Pg();c=[...Aa(c),...Aa(l)];const d=c.filter($S),u=cc.keyBy(d,HS),{recentCommands:f,addRecentCommand:m}=DS();let _;t[2]!==f?(_=new Set(f),t[2]=f,t[3]=_):_=t[3];const g=_;let p,b;t[4]!==s||t[5]!==n?(p=L=>{qF(s.getHotkey("global.commandPalette").key)(L)&&(L.preventDefault(),n(WS))},t[4]=s,t[5]=n,t[6]=p):p=t[6],um(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(L,C)=>{const $=o[L];if(!$)return null;const N=s.getHotkey(L);return h.jsxs(go,{disabled:C.disabled,onSelect:()=>{m(L),n(!1),requestAnimationFrame(()=>{$()})},value:N.name,children:[h.jsxs("span",{children:[N.name,C.tooltip&&h.jsx("span",{className:"ml-2",children:C.tooltip})]}),h.jsx(H3,{children:h.jsx(bm,{shortcut:N.key})})]},L)},t[7]=m,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const x=b;let y;t[12]!==m||t[13]!==s||t[14]!==n?(y=(L,C,$,N)=>{const H=$===void 0?{}:$;return h.jsxs(go,{disabled:H.disabled,onSelect:()=>{m(L),n(!1),requestAnimationFrame(()=>{C()})},value:L,children:[h.jsxs("span",{children:[L,H.tooltip&&h.jsxs("span",{className:"ml-2",children:["(",H.tooltip,")"]})]}),N&&h.jsx(H3,{children:h.jsx(bm,{shortcut:s.getHotkey(N).key})})]},L)},t[12]=m,t[13]=s,t[14]=n,t[15]=y):y=t[15];const v=y,S=WF;let k;t[16]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(na,{placeholder:"Type to search..."}),t[16]=k):k=t[16];const j=_m;let E;t[17]===Symbol.for("react.memo_cache_sentinel")?(E=h.jsx(dc,{children:"No results found."}),t[17]=E):E=t[17];const I=f.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(gm,{heading:"Recently Used",children:f.map(L=>{const C=u[L];return HF(L)?x(L,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip}):C&&!og(C)?v(C.label,C.handleHeadless||C.handle,{disabled:C.disabled,tooltip:C.tooltip}):null})}),h.jsx($3,{})]}),T=gm,M=s.iterate().map(L=>{if(g.has(L))return null;const C=u[L];return x(L,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip})}),R=d.map(L=>g.has(L.label)?null:v(L.label,L.handleHeadless||L.handle,{disabled:L.disabled,tooltip:L.tooltip}));let B;t[18]!==g||t[19]!==v?(B=L=>g.has(L.label)?null:v(`Cell > ${L.label}`,L.handleHeadless||L.handle,{disabled:L.disabled,tooltip:L.tooltip}),t[18]=g,t[19]=v,t[20]=B):B=t[20];const O=a.map(B);let z,F,V;return t[21]!==T||t[22]!==R||t[23]!==O||t[24]!==M?(z=h.jsxs(T,{heading:"Commands",children:[M,R,O]}),t[21]=T,t[22]=R,t[23]=O,t[24]=M,t[25]=z):z=t[25],t[26]!==j||t[27]!==z||t[28]!==E||t[29]!==I?(F=h.jsxs(j,{children:[E,I,z]}),t[26]=j,t[27]=z,t[28]=E,t[29]=I,t[30]=F):F=t[30],t[31]!==S||t[32]!==e||t[33]!==n||t[34]!==F||t[35]!==k?(V=h.jsxs(S,{open:e,onOpenChange:n,children:[k,F]}),t[31]=S,t[32]=e,t[33]=n,t[34]=F,t[35]=k,t[36]=V):V=t[36],V};function $S(t){return!t.hotkey}function HS(t){return t.label}function WS(t){return!t}const Ma="https://static.marimo.app",qS=t=>{const e=X.c(24),{onClose:n}=t,[o,r]=A.useState("");let s;s=Math.random().toString(36).slice(2,6);const i=`${o}-${s}`,a=`${Ma}/static/${i}`;let l,c,d,u,f,m,_,g,p,b,x;return e[0]!==n||e[1]!==i?(l=async y=>{y.preventDefault(),n();const v=await GF({download:!1,includeCode:!0,files:gS.INSTANCE.filenames()}),S=lt({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ma}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:v,path:i})}).catch(()=>{S.dismiss(),lt({title:"Error uploading static page",description:h.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",h.jsx("a",{href:Kn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),S.dismiss(),lt({title:"Static page uploaded!",description:h.jsxs("div",{children:["The URL has been copied to your clipboard.",h.jsx("br",{}),"You can share it with anyone."]})})},e[0]=n,e[1]=i,e[2]=l):l=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(dr,{children:"Share static notebook"}),e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsxs(Os,{children:[c,h.jsxs(Ps,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",h.jsx("a",{href:Ma,target:"_blank",children:Ma}),"."]})]}),e[4]=d):d=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{const v=y.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(v)},e[5]=u):u=e[5],e[6]!==o?(f=h.jsx(ur,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:u,required:!0,autoComplete:"off"}),e[6]=o,e[7]=f):f=e[7],e[8]!==a?(m=h.jsxs("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(GS,{text:a}),h.jsx("span",{className:"text-primary",children:a})]})]}),e[8]=a,e[9]=m):m=e[9],e[10]!==f||e[11]!==m?(_=h.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[f,m]}),e[10]=f,e[11]=m,e[12]=_):_=e[12],e[13]!==n?(g=h.jsx(Ae,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[13]=n,e[14]=g):g=e[14],e[15]!==a?(p=h.jsx(Ae,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await xn(a)},children:"Create"}),e[15]=a,e[16]=p):p=e[16],e[17]!==p||e[18]!==g?(b=h.jsxs(oa,{children:[g,p]}),e[17]=p,e[18]=g,e[19]=b):b=e[19],e[20]!==b||e[21]!==l||e[22]!==_?(x=h.jsx(cr,{className:"w-fit",children:h.jsxs("form",{onSubmit:l,children:[d,_,b]})}),e[20]=b,e[21]=l,e[22]=_,e[23]=x):x=e[23],x},GS=t=>{const e=X.c(8),[n,o]=K.useState(!1);let r;e[0]!==t.text?(r=fn.stopPropagation(async c=>{c.preventDefault(),await xn(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=r):r=e[1];const s=r;let i,a,l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(Ls,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=h.jsx(Ae,{"data-testid":"copy-static-notebook-url-button",onClick:s,size:"xs",variant:"secondary",children:i}),e[3]=s,e[4]=a):a=e[4],e[5]!==n||e[6]!==a?(l=h.jsx(Oe,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function lg(){const t=X.c(3),{openConfirm:e}=Un(),n=Gt(_o);let o;return t[0]!==e||t[1]!==n?(o=()=>{e({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:h.jsx(W3,{onClick:async()=>{n({state:en.CLOSING}),await YF(),JF()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=n,t[2]=o):o=t[2],o}const fd=[{type:"files",Icon:kp,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:uc,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:lr,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:Na,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:ya,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:od,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:ym,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:rd,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:xm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:a$,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Wp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:Ep,tooltip:"Secrets",hidden:Jn(),position:"sidebar"},{type:"scratchpad",Icon:KF,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:fm,tooltip:"View errors",position:"footer"}];function cg(){const t=X.c(2),e=Gt(wm);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s;s=null;for(const i of Array.from(o)){const a=i.getBoundingClientRect();if(a.top>=0&&a.top<=r||a.bottom>=0&&a.bottom<=r){s=Fs.parse(i.parentNode.id);break}}e(i=>({mode:XF(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(Fs.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function Pr(){return Te.string().optional().describe(Je.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function dg(){return Te.string().optional().describe(Je.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Oa(){return Te.string().optional().describe(Je.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function ug(){return Te.string().optional().describe(Je.of({label:"URI",optionRegex:".*uri.*"}))}function Lr(){return Te.string().nonempty().describe(Je.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function Wo(){return Te.string().describe(Je.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Fr(){return Te.string().nonempty().describe(Je.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function zr(t){const e=Te.coerce.string().describe(Je.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(n=>n>=0&&n<=65535,{message:"Port must be between 0 and 65535"});return t!==void 0?e.default(t.toString()):e}function hg(){return Te.boolean().default(!1).describe(Je.of({label:"Read Only"}))}const fg=Te.object({type:Te.literal("postgres"),host:Lr(),port:zr(5432).optional(),database:Wo(),username:Fr(),password:Pr(),ssl:Te.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),mg=Te.object({type:Te.literal("mysql"),host:Lr(),port:zr(3306),database:Wo(),username:Fr(),password:Pr(),ssl:Te.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),pg=Te.object({type:Te.literal("sqlite"),database:Wo().describe(Je.of({label:"Database Path"}))}).describe(Je.of({direction:"two-columns"})),gg=Te.object({type:Te.literal("duckdb"),database:Wo().describe(Je.of({label:"Database Path"})),read_only:hg()}).describe(Je.of({direction:"two-columns"})),_g=Te.object({type:Te.literal("motherduck"),database:Wo().default("my_db").describe(Je.of({label:"Database Name"})),token:dg()}).describe(Je.of({direction:"two-columns"})),bg=Te.object({type:Te.literal("snowflake"),account:Te.string().nonempty().describe(Je.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:Te.string().optional().describe(Je.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:Wo(),schema:Te.string().optional().describe(Je.of({label:"Schema",optionRegex:".*snowflake.*"})),username:Fr(),password:Pr(),role:Te.string().optional().describe(Je.of({label:"Role"}))}).describe(Je.of({direction:"two-columns"})),yg=Te.object({type:Te.literal("bigquery"),project:Te.string().nonempty().describe(Je.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:Te.string().nonempty().describe(Je.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:Te.string().describe(Je.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(Je.of({direction:"two-columns"})),xg=Te.object({type:Te.literal("clickhouse_connect"),host:Lr(),port:zr(8123).optional(),username:Fr(),password:Pr(),secure:Te.boolean().default(!1).describe(Je.of({label:"Use HTTPs"}))}).describe(Je.of({direction:"two-columns"})),wg=Te.object({type:Te.literal("timeplus"),host:Lr().default("localhost"),port:zr(8123).optional(),username:Fr().default("default"),password:Pr().default("")}).describe(Je.of({direction:"two-columns"})),vg=Te.object({type:Te.literal("chdb"),database:Wo().describe(Je.of({label:"Database Path"})),read_only:hg()}).describe(Je.of({direction:"two-columns"})),kg=Te.object({type:Te.literal("trino"),host:Lr(),port:zr(8080),database:Wo(),schema:Te.string().describe(Je.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:Fr(),password:Pr(),async_support:Te.boolean().default(!1).describe(Je.of({label:"Async Support"}))}).describe(Je.of({direction:"two-columns"})),Sg=Te.object({type:Te.literal("iceberg"),name:Te.string().describe(Je.of({label:"Catalog Name"})),catalog:Te.discriminatedUnion("type",[Te.object({type:Te.literal("REST"),warehouse:Oa(),uri:Te.string().optional().describe(Je.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:dg()}),Te.object({type:Te.literal("SQL"),warehouse:Oa(),uri:Te.string().optional().describe(Je.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),Te.object({type:Te.literal("Hive"),warehouse:Oa(),uri:ug()}),Te.object({type:Te.literal("Glue"),warehouse:Oa(),uri:ug()}),Te.object({type:Te.literal("DynamoDB"),"dynamodb.profile-name":Te.string().optional().describe(Je.of({label:"Profile Name"})),"dynamodb.region":Te.string().optional().describe(Je.of({label:"Region"})),"dynamodb.access-key-id":Te.string().optional().describe(Je.of({label:"Access Key ID"})),"dynamodb.secret-access-key":Te.string().optional().describe(Je.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":Te.string().optional().describe(Je.of({label:"Session Token",inputType:"password"}))})]).describe(Je.of({special:"tabs"}))}),Cg=Te.object({type:Te.literal("datafusion"),sessionContext:Te.boolean().optional().describe(Je.of({label:"Use Session Context"}))}),Ng=Te.object({type:Te.literal("pyspark"),host:Lr().optional(),port:zr().optional()}),YS=Te.discriminatedUnion("type",[fg,mg,pg,gg,_g,bg,yg,xg,wg,vg,kg,Sg,Cg,Ng]),md="env:";function Da(t){return typeof t=="string"&&t.startsWith(md)}function pd(t){return`${md}${t}`}const jg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck"};class gn{constructor(e,n,o){this.connection=void 0,this.orm=void 0,this.secrets=void 0,this.connection=e,this.orm=n,this.secrets=o}get imports(){const e=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":e.add("import sqlalchemy");break;case"sqlmodel":e.add("import sqlmodel");break;case"duckdb":e.add("import duckdb")}return e}}class JS{constructor(){this.secrets={}}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(e,n,o){if(e=(r=>`_${r}`)(e),Da(n)){const r=n.replace(md,""),s=o?`os.environ.get("${r}", "${o}")`:`os.environ.get("${r}")`;return this.secrets[e]=s,e}if(o!=null){const r=`os.environ.get("${n}", "${o}")`;return this.secrets[e]=r,e}return typeof n=="number"||typeof n=="number"?`${n}`:typeof n=="boolean"?Br(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return Br(n);const r=this.print(e,n,o);return r.startsWith('"')&&r.endsWith('"')?r.slice(1,-1):`{${r}}`}printPassword(e,n,o){const r=o?this.printInFString.bind(this):this.print.bind(this);return Da(e)?r("password",e):r("password",n,e)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([e,n])=>`${e} = ${n}`).join(`
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-by9J7LvV.js","./VegaLite-dQfDh_4z.js","./index-BwKcs-n_.js","./index-DwqiUb8v.css","./compile-D8KCyynq.js","./time-BA2I39A6.js","./timer-DFzT7np-.js","./linear-D6wapWEB.js","./init-DLRA0X12.js","./range-CtcPcB_L.js","./zoom-COrs4lFh.js","./ordinal-DDUp3AbE.js","./colors-bszWmPJw.js","./arc-Cuwikxov.js","./step-BwsUM5iJ.js","./index-_T9unogb.js","./tracing-CJpPOtw8.js","./useMarimoWebSocket-BL3Rc0Jm.js","./index-CP6hlJiS.js","./index-PM_fXUvN.js","./index-Cc6r7pvR.js","./index-gxpBAnaK.js","./index-tTIKcc2K.js","./index-DKHQmm_O.js","./index-Cz4AU9ew.js","./index-D8ERw2CT.js","./index-B27l1Lmz.js","./index-DHWMBFuC.js","./index-J-H_YIWG.js","./index-BAHdmgR5.js","./index-B-C746qM.js","./apl-CXdQSnD-.js","./asciiarmor-D5V0T9Cu.js","./asterisk-B46aRdXb.js","./brainfuck-CtZaYBKt.js","./clike-BgBwzOhw.js","./cmake-DXn5xaP-.js","./cobol-stawOqaz.js","./coffeescript-BTDxI-eT.js","./commonlisp-vq6DHwts.js","./crystal-CRzZ78HM.js","./cypher-gJDei3ni.js","./d-BShv7fp-.js","./diff-UJJ5BM9S.js","./dockerfile-knGOOxt4.js","./simple-mode-C3vEBAcb.js","./dtd-DI9Herc-.js","./dylan-CHJ5qNM_.js","./ebnf-B-Df8AvO.js","./ecl-DPFc0Uaf.js","./eiffel-DR5c0IrL.js","./elm-D7xaZ7Da.js","./erlang-BuqgqA5h.js","./factor-CFXhaUWb.js","./fcl-CVaBTCzQ.js","./forth-Dri_5nFc.js","./fortran-DL7KluxX.js","./gas-5kEe4nk0.js","./gherkin-B6X1vGSW.js","./groovy-DnIzCrpZ.js","./haskell-CmdsSjFB.js","./haxe-D25e-2l-.js","./http-BKJkqRj4.js","./idl-pcmmZuaN.js","./jinja2-DhgKlfW7.js","./julia-DjdwvFuI.js","./livescript-HO6ttBFx.js","./lua-8DXOpKDz.js","./mathematica-IIbmv7SK.js","./mbox-z_N2Mo3d.js","./mirc-DkvFAiy5.js","./modelica-DSrSSXCg.js","./mscgen-B2igx18G.js","./mumps-zvxmGV4l.js","./nginx-B4hAVlXN.js","./nsis-BvKfQ9lQ.js","./ntriples-FFvkTduk.js","./octave-C4hdQ5Hf.js","./oz-qQq7irPq.js","./pascal-CafrKXZF.js","./perl-tdMlh9QA.js","./pig-CwGJVRC4.js","./powershell-D1ly3AHC.js","./properties-_nPj978X.js","./protobuf-B4y9do6W.js","./puppet-Bc-yJKzi.js","./q-B0kTJ4cI.js","./r-BA4EbLKE.js","./ruby-CR-u2WLS.js","./sas-Bqaci40L.js","./scheme-qjP0V5Ag.js","./shell-BLav31RL.js","./sieve-r025o_jW.js","./smalltalk-C7J3IyEP.js","./solr-78MBEUkU.js","./sparql-BRLJFz69.js","./spreadsheet-CGlWr0eM.js","./stylus-OdhglgkO.js","./swift-B_XXVlXX.js","./tcl-B2fODqDH.js","./textile-BuVhTOzU.js","./tiddlywiki-BgR6AEZu.js","./tiki-CI-ztowC.js","./toml-BQXy8elZ.js","./troff-Ce85hlLp.js","./ttcn-BxnYHtq8.js","./turtle-BkSuIpt-.js","./vb-BHgjm0DN.js","./vbscript-Dawdd5GZ.js","./velocity-BdD_26Jv.js","./verilog-B4LBqg_1.js","./vhdl-CWWH2SUo.js","./webidl-CGwyPRYs.js","./xquery-CVDBqZPY.js","./yacas-I8QjZlxf.js","./z80-D8p3gKXp.js","./useMarimoWebSocket-DcAzAz16.css","./tree-DFS5q1V-.js","./tree-C1rhMrxo.css","./circle-play-BMISM9zc.js","./_createAggregator-8Wb1NIiQ.js","./_baseEach-CG6PP0on.js","./transform-Cyp0GDF-.js","./sortBy-BCuX-Whj.js","./_baseMap-6ilXjA7X.js","./terminal-DC1Y_3lM.js","./terminal-WqMRJt5Z.css"])))=>i.map(i=>d[i]);
|
2
|
+
var bF=Object.defineProperty;var S3=Ft=>{throw TypeError(Ft)};var yF=(Ft,jt,pn)=>jt in Ft?bF(Ft,jt,{enumerable:!0,configurable:!0,writable:!0,value:pn}):Ft[jt]=pn;var ee=(Ft,jt,pn)=>yF(Ft,typeof jt!="symbol"?jt+"":jt,pn),xF=(Ft,jt,pn)=>jt.has(Ft)||S3("Cannot "+pn);var C3=(Ft,jt,pn)=>(xF(Ft,jt,"read from private field"),pn?pn.call(Ft):jt.get(Ft)),N3=(Ft,jt,pn)=>jt.has(Ft)?S3("Cannot add the same private member more than once"):jt instanceof WeakSet?jt.add(Ft):jt.set(Ft,pn);import{u as Pe,S as A,i3 as wF,i4 as vF,i5 as j3,i6 as kF,i7 as SF,i8 as CF,R as K,i9 as NF,ia as Er,ib as jF,ic as em,id as E3,ie as EF,ig as IF,ih as I3,ii as nc,d as X,ac as Jn,ij as tm,j as h,dp as nm,dq as A3,dr as AF,dt as om,dv as rm,f2 as oc,ik as sm,dm as im,dn as am,ds as lm,il as TF,im as T3,ec as M3,bl as Qe,Q as Lt,io as MF,dR as mo,ip as O3,iq as D3,ir as cm,is as R3,it as dm,L as Qt,aj as Ut,cz as um,a2 as Ae,iu as OF,ed as dt,iv as P3,iw as DF,a8 as lt,ix as hm,eh as rc,iy as L3,iz as sc,T as $e,aX as Un,al as Gt,iA as ic,iB as Ts,e1 as Ms,iC as RF,iD as Qi,iE as PF,ea as LF,iF as F3,iG as z3,dJ as FF,as as fm,iH as Ir,aG as ac,aI as lr,iI as zF,iJ as lc,iK as B3,aq as ea,ey as U3,ar as ta,iL as BF,a7 as xn,iM as mm,iN as Ar,a3 as cr,a4 as Os,a5 as dr,bd as Tr,af as po,e2 as Ds,gh as V3,fJ as Rs,gk as UF,a$ as hn,iO as VF,iP as $F,fH as pm,aF as cc,iQ as gm,iR as HF,iS as $3,iT as _m,iU as WF,iV as qF,iW as go,iX as H3,fN as bm,iY as na,iZ as dc,dY as GF,Z as Kn,a6 as Ps,bb as ur,i_ as oa,bp as fn,a9 as Ls,ap as Oe,e_ as _o,b4 as W3,ej as en,i$ as YF,eL as JF,dw as uc,j0 as ym,aK as xm,j1 as KF,j2 as wm,e7 as Fs,j3 as XF,j4 as vm,bg as Vn,j5 as ZF,dP as Te,j6 as Je,j7 as km,j8 as Mt,j9 as q3,ja as QF,fo as Sm,aB as En,aQ as Xn,g5 as G3,g6 as Y3,g7 as ez,gb as tz,g8 as J3,ag as Me,dI as nz,aD as hc,aO as fc,aE as mc,aL as sn,eb as Fo,jb as oz,g9 as K3,jc as rz,f_ as X3,g0 as Z3,jd as zs,je as Q3,jf as sz,jg as iz,a1 as az,a0 as lz,e6 as ra,jh as pc,ji as Bs,jj as gc,jk as cz,jl as dz,jm as e4,jn as mn,fM as t4,dK as _c,b7 as uz,jo as hz,ab as Cm,aH as fz,jp as mz,gl as n4,b3 as bc,jq as Nm,aa as sa,dZ as o4,jr as pz,$ as gz,g2 as _z,js as bz,jt as yz,ju as xz,jv as wz,jw as vz,jx as kz,dk as zo,jy as yc,jz as Us,o as Bo,n as st,fr as Zn,jA as In,jB as ut,jC as Vs,jD as Vt,fI as Yt,jE as jm,dO as Qn,jF as Sz,jG as Cz,b1 as r4,b2 as s4,jH as i4,jI as Nz,go as $s,jJ as xc,a_ as wc,gn as Mr,jK as a4,jL as ia,ee as Em,jM as jz,jN as Ez,jO as Iz,jP as Az,jQ as l4,jR as Tz,jS as c4,jT as d4,jU as Mz,jV as u4,jW as h4,ef as vc,jX as Oz,bm as Dz,jY as Rz,fq as $n,jZ as Pz,j_ as Lz,j$ as Hs,k0 as kc,k1 as Ws,fB as Uo,k2 as Im,k3 as aa,k4 as la,k5 as ca,k6 as Fz,fh as Sc,k7 as Am,k8 as f4,k9 as Cc,eK as Nc,fi as zz,r as Bz,ka as Uz,kb as Vz,kc as m4,t as D,kd as $z,ke as Hz,kf as Tm,fU as jc,kg as p4,fu as Wz,aN as Mm,kh as g4,ki as qz,kj as Gz,kk as Yz,kl as Jz,km as Kz,kn as Xz,ko as Zz,kp as Qz,kq as eB,kr as tB,ks as nB,kt as oB,ku as rB,kv as sB,kw as iB,kx as aB,ky as lB,kz as cB,kA as dB,kB as uB,kC as da,kD as hB,kE as fB,kF as mB,kG as pB,kH as gB,kI as _B,kJ as _4,kK as bB,kL as yB,kM as xB,kN as b4,kO as wB,kP as vB,kQ as y4,kR as kB,kS as qs,kT as Hn,kU as SB,kV as CB,kW as NB,kX as jB,kY as EB,kZ as IB,k_ as AB,k$ as TB,l0 as MB,l1 as OB,l2 as hr,l3 as DB,l4 as RB,l5 as PB,l6 as LB,ek as FB,l7 as zB,l8 as x4,eo as BB,l9 as Ec,la as UB,lb as VB,lc as $B,ld as HB,ah as Or,le as Ic,en as WB,lf as Om,lg as Ac,lh as ua,li as ha,lj as Tc,lk as fr,ll as w4,lm as Vo,ln as Gs,lo as Dm,lp as fa,lq as Ys,lr as Rm,ls as Pm,lt as v4,lu as Mc,lv as qB,ad as ma,lw as pa,lx as GB,eJ as Oc,ly as YB,lz as Lm,lA as JB,lB as KB,lC as Dc,lD as XB,lE as ZB,lF as k4,lG as Fm,gm as Js,lH as QB,lI as eU,lJ as tU,lK as nU,fz as oU,ba as rU,gp as Nt,lL as ga,lM as Ks,lN as sU,lO as iU,lP as zm,lQ as aU,lR as lU,b0 as S4,lS as cU,lT as dU,lU as Rc,lV as C4,eD as Pc,bc as N4,ak as Lc,lW as j4,lX as uU,lY as hU,lZ as Bm,l_ as Um,l$ as fU,m0 as E4,m1 as I4,m2 as _a,d$ as mU,fl as pU,f0 as gU,W as A4,fn as _U,m3 as T4,m4 as bU,m5 as yU,m6 as M4,m7 as xU,m8 as wU,m9 as O4,ma as D4,mb as vU,be as R4,mc as kU,md as Vm,e5 as SU,me as $o,dG as P4,mf as L4,e9 as F4,fb as $m,mg as Hm,mh as z4,br as Wm,dH as Fc,mi as B4,mj as CU,mk as NU,ml as jU,b9 as zc,mm as EU,f4 as qm,f$ as IU,g3 as AU,ga as Gm,gd as TU,mn as MU,mo as Ym,mp as OU,mq as DU,mr as RU,ms as PU,mt as LU,mu as FU,mv as zU,mw as BU,U as UU,mx as Bc,V as VU,my as U4,mz as $U,e$ as HU,mA as V4,aY as eo,ff as WU,dy as $4,mB as qU,mC as H4,mD as GU,eI as YU,mE as JU,mF as KU,e0 as XU,mG as ZU,mH as QU,an as Uc,mI as eV,ao as mr,dB as W4,mJ as Jm,mK as tV,ei as q4,mL as nV,mM as G4,mN as oV,mO as rV,mP as sV,mQ as iV,mR as aV,mS as lV,mT as Y4,fX as Km,fV as Xm,fQ as Xs,fW as Dr,mU as J4,fY as Zm,fR as Rr,dS as cV,mV as Qm,mW as dV,am as uV,mX as hV,fA as K4,E as Zs,mY as fV,mZ as mV,m_ as pV,m$ as gV,n0 as ba,n1 as _V,n2 as bV,n3 as yV,n4 as xV,n5 as wV,n6 as X4,n7 as vV,fp as kV,n8 as SV,n9 as CV,na as NV,nb as jV,gc as EV,nc as IV,nd as AV,ne as TV,nf as Z4,ng as Q4,eZ as eS,nh as MV,ni as OV,nj as tS,nk as DV,nl as RV,nm as Vc,nn as PV,no as LV,np as FV,C as ep,nq as zV,nr as BV,ns as UV,aC as VV,nt as pr,nu as nS,dQ as $V,fS as HV,fT as WV,nv as qV,nw as Qs,nx as GV,ny as $c,nz as YV,nA as JV,y as oS,nB as KV,de as XV,nC as ZV,eQ as QV,aZ as e$,aW as t$,nD as Hc,nE as rS,nF as sS,nG as iS,nH as n$,e4 as o$,__tla as r$}from"./index-BwKcs-n_.js";import{G as s$,L as aS,g as i$,b as ya,A as a$,s as l$,k as c$,B as lS,a as d$,M as u$,Y as h$,c as wn,u as Wc,C as f$,S as m$,K as p$,d as g$,i as _$,e as cS,f as b$,h as y$,j as x$,l as xa,P as tp,m as dS,n as w$,o as v$,p as np,T as k$}from"./tree-DFS5q1V-.js";import{c as uS,d as hS,L as fS,P as ei,I as op,e as S$,f as mS,N as pS,V as gS,S as _S,F as bS,g as yS,M as C$,l as xS,h as N$,E as wS,i as j$,j as rp,k as E$,m as I$,n as A$,o as T$,p as M$,q as O$,s as D$,t as R$,v as P$,u as L$,C as F$,R as vS,a as z$,A as B$,w as U$,x as V$,O as $$,T as H$,y as W$,z as q$,__tla as G$}from"./useMarimoWebSocket-BL3Rc0Jm.js";import{c as Y$}from"./_createAggregator-8Wb1NIiQ.js";import{s as to,i as gr,T as sp,a as ip}from"./transform-Cyp0GDF-.js";import{g as kS}from"./timer-DFzT7np-.js";import{i as J$}from"./zoom-COrs4lFh.js";import{s as wa}from"./sortBy-BCuX-Whj.js";let ap,qc,An,lp,SS,va,cp,K$=Promise.all([(()=>{try{return r$}catch{}})(),(()=>{try{return G$}catch{}})()]).then(async()=>{var Ql,k3;var Ft=Y$(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let jt,pn,dp,Gc,ti,ni,up,hp,fp,mp,ka,Yc,pp,Sa,gp,Jc,_p,bp,Kc,yp,xp,wp,Ca,vp,Xc,kp,Sp,Cp,Np,jp,Ep,Zc,Ip,Qc,Ap,Tp,Mp,Op,Dp,Na,Rp,Pp,ed,Lp,Fp,zp,td,Bp,Up,Vp,ja,nd,od,$p,Hp,Wp,qp,Gp,Yp,oi,Jp,Kp,Xp,rd,sd,Zp,Qp,eg,Ea,_r,br;jt=Pe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),pn=Pe("arrow-right-from-line",[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M21 12H7",key:"13ipq5"}],["path",{d:"m15 18 6-6-6-6",key:"6tx3qv"}]]),dp=Pe("arrow-right-to-line",[["path",{d:"M17 12H3",key:"8awo09"}],["path",{d:"m11 18 6-6-6-6",key:"8c2y43"}],["path",{d:"M21 5v14",key:"nzette"}]]),Gc=Pe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),ti=Pe("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),ni=Pe("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),up=Pe("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),hp=Pe("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),lp=Pe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),fp=Pe("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),mp=Pe("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),ka=Pe("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Yc=Pe("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),pp=Pe("clipboard-paste",[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]),Sa=Pe("cloud-download",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]),gp=Pe("code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),Jc=Pe("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),_p=Pe("copy-minus",[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),bp=Pe("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),Kc=Pe("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),yp=Pe("eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]),xp=Pe("fast-forward",[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]]),wp=Pe("file-pen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]),Ca=Pe("file-plus-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]]),vp=Pe("files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]),Xc=Pe("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),kp=Pe("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]),Sp=Pe("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),Cp=Pe("hard-drive-download",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]]),Np=Pe("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),jp=Pe("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),Ep=Pe("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),Zc=Pe("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),Ip=Pe("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Qc=Pe("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),Ap=Pe("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]),Tp=Pe("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),Mp=Pe("memory-stick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]),Op=Pe("message-circle-question",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Dp=Pe("microchip",[["path",{d:"M18 12h2",key:"quuxs7"}],["path",{d:"M18 16h2",key:"zsn3lv"}],["path",{d:"M18 20h2",key:"9x5y9y"}],["path",{d:"M18 4h2",key:"1luxfb"}],["path",{d:"M18 8h2",key:"nxqzg"}],["path",{d:"M4 12h2",key:"1ltxp0"}],["path",{d:"M4 16h2",key:"8a5zha"}],["path",{d:"M4 20h2",key:"27dk57"}],["path",{d:"M4 4h2",key:"10groj"}],["path",{d:"M4 8h2",key:"18vq6w"}],["path",{d:"M8 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-1.5c-.276 0-.494.227-.562.495a2 2 0 0 1-3.876 0C9.994 2.227 9.776 2 9.5 2z",key:"1681fp"}]]),Na=Pe("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),Rp=Pe("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"}]]),Pp=Pe("package-check",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),ed=Pe("package-x",[["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["path",{d:"m17 13 5 5m-5 0 5-5",key:"im3w4b"}]]),Lp=Pe("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Fp=Pe("party-popper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]),zp=Pe("pen-line",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]),td=Pe("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),Bp=Pe("regex",[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]]),Up=Pe("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),Vp=Pe("rows-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]),ja=Pe("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),nd=Pe("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]),od=Pe("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),$p=Pe("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Hp=Pe("square-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Wp=Pe("square-dashed-bottom-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["path",{d:"M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2",key:"as5y1o"}],["path",{d:"M9 21h1",key:"15o7lz"}]]),qp=Pe("square-equal",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}]]),Gp=Pe("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),Yp=Pe("square-play",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]]),oi=Pe("square-plus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Jp=Pe("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Kp=Pe("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]),Xp=Pe("text-cursor-input",[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]]),rd=Pe("text-search",[["path",{d:"M21 6H3",key:"1jwq7v"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 18H3",key:"13769t"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),sd=Pe("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),Zp=Pe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),Qp=Pe("view",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]),eg=Pe("whole-word",[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]),Ea=Pe("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),_r=Pe("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),br=Pe("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);const CS=A.createContext({}),NS=A.forwardRef(function(t,e){[t,e]=SF(t,e,CS);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,u]=A.useState(!1);wF(()=>{var p;u(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=vF(),m=f==="rtl"&&c==="horizontal";let _=kF(i);const g=A.useRef(null);return{toolbarProps:{...j3(s,{labelable:!0}),role:d?"group":"toolbar","aria-orientation":c,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:d?void 0:p=>{if(p.currentTarget.contains(p.target)){if(c==="horizontal"&&p.key==="ArrowRight"||c==="vertical"&&p.key==="ArrowDown")m?_.focusPrevious():_.focusNext();else{if(!(c==="horizontal"&&p.key==="ArrowLeft"||c==="vertical"&&p.key==="ArrowUp"))return p.key==="Tab"?(p.stopPropagation(),g.current=document.activeElement,void(p.shiftKey?_.focusFirst():_.focusLast())):void 0;m?_.focusNext():_.focusPrevious()}p.stopPropagation(),p.preventDefault()}},onFocusCapture:d?void 0:p=>{var b,x;g.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(p.target))&&((x=g.current)===null||x===void 0||x.focus(),g.current=null)},onBlurCapture:d?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||g.current||(g.current=p.target)}}}}(t,e),o=CF({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=j3(t);return delete r.id,K.createElement("div",{...NF(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)});function Ia(t,e){const n=+Er(t)-+Er(e);return n<0?-1:n>0?1:n}function jS(t,e){const n=Er(t,e==null?void 0:e.in);return+function(o,r){const s=Er(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=Er(o,r==null?void 0:r.in),i=s.getMonth();return s.setFullYear(s.getFullYear(),i+1,0),s.setHours(23,59,59,999),s}(n,e)}function ES(t,e,n){const[o,r,s]=em(n==null?void 0:n.in,t,t,e),i=Ia(r,s),a=Math.abs(function(d,u,f){const[m,_]=em(f==null?void 0:f.in,d,u);return 12*(m.getFullYear()-_.getFullYear())+(m.getMonth()-_.getMonth())}(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=Ia(r,s)===-i;jS(o)&&a===1&&Ia(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function IS(t,e,n){const o=function(r,s){return+Er(r)-+Er(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function AS(t,e){return function(n,o,r){const s=EF(),i=(r==null?void 0:r.locale)??s.locale??IF,a=Ia(n,o);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:a}),[c,d]=em(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),u=IS(d,c),f=(E3(d)-E3(c))/1e3,m=Math.round((u-f)/60);let _;if(m<2)return m===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",m,l);if(m<45)return i.formatDistance("xMinutes",m,l);if(m<90)return i.formatDistance("aboutXHours",1,l);if(m<I3){const g=Math.round(m/60);return i.formatDistance("aboutXHours",g,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<nc){const g=Math.round(m/I3);return i.formatDistance("xDays",g,l)}if(m<2*nc)return _=Math.round(m/nc),i.formatDistance("aboutXMonths",_,l);if(_=ES(d,c),_<12){const g=Math.round(m/nc);return i.formatDistance("xMonths",g,l)}{const g=_%12,p=Math.trunc(_/12);return g<3?i.formatDistance("aboutXYears",p,l):g<9?i.formatDistance("overXYears",p,l):i.formatDistance("almostXYears",p+1,l)}}(t,function(n){return jF(n,Date.now())}(t),e)}const TS=()=>{const t=X.c(7),{selectedLayout:e}=uS(),{setLayoutView:n}=hS();if(Jn()&&!tm("wasm_layouts"))return null;let o,r,s,i;return t[0]!==n?(o=a=>n(a),t[0]=n,t[1]=o):o=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(im,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:h.jsx(am,{placeholder:"Select a view"})}),t[2]=r):r=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(nm,{children:h.jsxs(A3,{children:[h.jsx(AF,{children:"View as"}),fS.map(OS)]})}),t[3]=s):s=t[3],t[4]!==e||t[5]!==o?(i=h.jsxs(lm,{"data-testid":"layout-select",value:e,onValueChange:o,children:[r,s]}),t[4]=e,t[5]=o,t[6]=i):i=t[6],i};function MS(t){const e=tg(t);return h.jsx(e,{className:"h-4 w-4"})}function tg(t){switch(t){case"vertical":return Ap;case"grid":return s$;case"slides":return td;default:return oc(t),sm}}function ng(t){return rm(t)}function OS(t){return h.jsx(om,{value:t,children:h.jsxs("div",{className:"flex items-center gap-1.5 leading-5",children:[MS(t),h.jsx("span",{children:ng(t)})]})},t)}function DS(){const t=X.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];const[n,o]=function(i,a){const l=X.c(11);let c;l[0]!==a?(c=new TF(a),l[0]=a,l[1]=c):c=l[1];const d=c;let u;l[2]!==i||l[3]!==d?(u=()=>d.get(i),l[2]=i,l[3]=d,l[4]=u):u=l[4];const[f,m]=A.useState(u);let _;l[5]!==i||l[6]!==d?(_=b=>{m(b),d.set(i,b)},l[5]=i,l[6]=d,l[7]=_):_=l[7];const g=_;let p;return l[8]!==g||l[9]!==f?(p=[f,g],l[8]=g,l[9]=f,l[10]=p):p=l[10],p}("marimo:commands",e);let r,s;return t[1]!==n||t[2]!==o?(r=i=>{const a=(l=[i,...n],[...new Set(l)]);var l;o(a.slice(0,3))},t[1]=n,t[2]=o,t[3]=r):r=t[3],t[4]!==n||t[5]!==r?(s={recentCommands:n,addRecentCommand:r},t[4]=n,t[5]=r,t[6]=s):s=t[6],s}function og(t){return t.dropdown!==void 0}function Aa(t,e=""){return t.flatMap(n=>n.label?og(n)?Aa(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const ri=t=>{const e=X.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=K.Children.toArray(n),e[0]=n,e[1]=s):s=e[1];const[i,a]=s,l=`second-icon absolute ${r?"top-[-2px] left-[-2px]":"bottom-[-2px] right-[-2px]"} rounded-full`;let c,d;return e[2]!==a||e[3]!==l?(c=h.jsx("div",{className:l,children:a}),e[2]=a,e[3]=l,e[4]=c):c=e[4],e[5]!==i||e[6]!==c?(d=h.jsxs("div",{className:"multi-icon relative w-fit",children:[i,c]}),e[5]=i,e[6]=c,e[7]=d):d=e[7],d};function id(t){const e=X.c(3),n=ad();let o;return e[0]!==t||e[1]!==n?(o=()=>{t!==void 0&&n([t])},e[0]=t,e[1]=n,e[2]=o):o=e[2],Qe(o)}function rg(){const t=X.c(2),e=ad();let n;return t[0]!==e?(n=()=>e(O3(mo())),t[0]=e,t[1]=n):n=t[1],Qe(n)}function ad(){const t=X.c(2),{prepareForRun:e}=Lt();let n;return t[0]!==e?(n=async o=>{var a;if(o.length===0)return;const{cellHandles:r,cellData:s}=mo(),i=[];for(const l of o){const c=r[l],d=(a=c.current)==null?void 0:a.editorView;let u;d?(D3(d)!=="markdown"&&cm(d),u=R3(d)):u=s[l].code,i.push(u),e({cellId:l})}await dm({cellIds:o,codes:i}).catch(RS)},t[0]=e,t[1]=n):n=t[1],Qe(n)}function RS(t){Qt.error(t)}const Ta=Ut(null),PS=Ut(!1),ld=Ut({chats:[],activeChatId:null}),LS=Ut(t=>{const e=t(ld);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(ld,o=>({...o,activeChatId:n}))}),cd=t=>{const e=X.c(7);let n,o;e[0]!==t?(n=a=>{var l;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(l=t.onClick)==null||l.call(t,a))},e[0]=t,e[1]=n):n=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(o={capture:!0},e[2]=o):o=e[2],um(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(OF,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=h.jsxs(Ae,{"data-testid":"undo-button",size:"sm",variant:"outline",...t,children:[r," ",s]}),e[4]=r,e[5]=t,e[6]=i):i=e[6],i};function dd(){const t=X.c(3),{deleteCell:e,undoDeleteCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{if(dt.get(P3))return;const{cellId:s}=r;e({cellId:s}),DF({cellId:s}).catch(()=>{n()});const{dismiss:i}=lt({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:h.jsx(cd,{"data-testid":"undo-delete-button",onClick:()=>{n(),a()}})}),a=i},t[0]=e,t[1]=n,t[2]=o):o=t[2],Qe(o)}function sg(t,e,n,o=dt){if(e in o.get(hm))return!1;const{cellData:r,cellIds:s}=o.get(rc),i=new RegExp(`import[ ]+${t}[ ]+as[ ]+${e}`,"g");for(const a of s.inOrderIds)if(i.test(r[a].code))return!1;return n(`import ${t} as ${e}`),!0}function Ho(t,e,n){return sg("marimo","mo",o=>{const r=L3.create();e({cellId:n??"__end__",before:!1,code:o,lastCodeRun:t?o:void 0,newCellId:r,autoFocus:!1}),t&&dm({cellIds:[r],codes:[o]})})}function ig(){const t=X.c(3),{splitCell:e,undoSplitCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=sc(r.cellId);if(!s)return;const i=R3(s);e(r);const{dismiss:a}=lt({title:"Cell split",action:h.jsx(cd,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:i}),l()},children:"Undo"})}),l=a},t[0]=e,t[1]=n,t[2]=o):o=t[2],Qe(o)}function ud(t){const e=X.c(49),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:c,clearCellOutput:d}=Lt(),u=ig(),f=id(n==null?void 0:n.cellId),m=!$e(P3),_=dd(),{openModal:g}=Un(),p=Gt(Ta),b=$e(ic),x=$e(Ts),y=$e(Ms),v=$e(RF);if(!n||y){let N;return e[0]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[0]=N):N=e[0],N}const{cellId:S,config:k,getEditorView:j,name:E,hasOutput:I,hasConsoleOutput:T,status:M}=n;let R;e[1]!==S||e[2]!==k.disabled||e[3]!==r?(R=async()=>{const N={disabled:!k.disabled};await Ar({configs:{[S]:N}}),r({cellId:S,config:N})},e[1]=S,e[2]=k.disabled,e[3]=r,e[4]=R):R=e[4];const B=R;let O;e[5]!==S||e[6]!==k.hide_code||e[7]!==j||e[8]!==r?(O=async()=>{const N={hide_code:!k.hide_code};await Ar({configs:{[S]:N}}),r({cellId:S,config:N});const H=j();H&&(N.hide_code?H.contentDOM.blur():H.focus())},e[5]=S,e[6]=k.hide_code,e[7]=j,e[8]=r,e[9]=O):O=e[9];const z=O;let F,V,L,C,$;return e[10]===Symbol.for("react.memo_cache_sentinel")?(F=h.jsx(Xp,{size:13,strokeWidth:1.5}),e[10]=F):F=e[10],e[11]!==S||e[12]!==E||e[13]!==g||e[14]!==s?(V=()=>{g(h.jsxs(cr,{children:[h.jsx(Os,{children:h.jsx(dr,{children:"Rename cell"})}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(Tr,{htmlFor:"cell-name",children:"Cell name"}),h.jsx(pS,{placeholder:"cell name",value:E,onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),N.stopPropagation(),g(null))},onChange:N=>s({cellId:S,name:N})})]})]}))},e[11]=S,e[12]=E,e[13]=g,e[14]=s,e[15]=V):V=e[15],e[16]!==S||e[17]!==s?(L=N=>s({cellId:S,name:N}),e[16]=S,e[17]=s,e[18]=L):L=e[18],e[19]!==E||e[20]!==L?(C=h.jsx(pS,{placeholder:"cell name",value:E,onChange:L}),e[19]=E,e[20]=L,e[21]=C):C=e[21],e[22]!==c||e[23]!==b||e[24]!==v||e[25]!==x||e[26]!==m||e[27]!==S||e[28]!==d||e[29]!==k.disabled||e[30]!==k.hide_code||e[31]!==o||e[32]!==_||e[33]!==j||e[34]!==T||e[35]!==I||e[36]!==i||e[37]!==E||e[38]!==f||e[39]!==l||e[40]!==a||e[41]!==p||e[42]!==u||e[43]!==M||e[44]!==V||e[45]!==C||e[46]!==B||e[47]!==z?($=[[{icon:F,label:"Name",disableClick:!0,handle:US,handleHeadless:V,rightElement:C},{icon:h.jsx(ei,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:M==="running"||M==="queued"||M==="disabled-transitively"||k.disabled,handle:()=>f()},{icon:h.jsx(Qi,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(N=>(N==null?void 0:N.cellId)===S?null:{cellId:S})},hotkey:"cell.aiCompletion"},{icon:h.jsx(nd,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>u({cellId:S})},{icon:h.jsx(op,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!I,handle:()=>function(N){const H=document.getElementById(T3.create(N));H&&(H.classList.add("printing-output"),M3(H,"result.png").finally(()=>{H.classList.remove("printing-output")}))}(S)},{icon:h.jsx(LF,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const N=j();N&&PF({[S]:N})}},{icon:k.hide_code?h.jsx(F3,{size:13,strokeWidth:1.5}):h.jsx(z3,{size:13,strokeWidth:1.5}),label:k.hide_code?"Show code":"Hide code",handle:z,hotkey:"cell.hideCode"},{icon:k.disabled?h.jsx(_r,{size:13,strokeWidth:1.5}):h.jsx(br,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:h.jsx(FF,{"data-testid":"cell-disable-switch",checked:!k.disabled,size:"sm",onCheckedChange:B}),handle:B},{icon:h.jsx(fm,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(I||T),handle:()=>{d({cellId:S})}}],[{icon:h.jsx(ac,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const N=j();N&&(Ho(x,o),Ir(N,"markdown",{keepCodeAsIs:!0}))}},{icon:h.jsx(lr,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const N=j();N&&(Ho(x,o),Ir(N,"sql",{keepCodeAsIs:!0}))}},{icon:h.jsx(lc,{}),label:"Toggle as Python",handle:()=>{const N=j();N&&(Ho(x,o),zF(N,"python",{force:!0}))}}],[{icon:h.jsxs(ri,{children:[h.jsx(ka,{size:13,strokeWidth:1.5}),h.jsx(B3,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:S,before:!0})},{icon:h.jsxs(ri,{children:[h.jsx(ka,{size:13,strokeWidth:1.5}),h.jsx(ea,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:S,before:!1})},{icon:h.jsx(B3,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:S,before:!0})},{icon:h.jsx(ea,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:S,before:!1})},{icon:h.jsx(U3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:S,direction:"left"}),hidden:v!=="columns"},{icon:h.jsx(ta,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:S,direction:"right"}),hidden:v!=="columns"},{icon:h.jsx(hp,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:S})},{icon:h.jsx(up,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:S})},{icon:h.jsx(BF,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:v!=="columns",handle:()=>c({cellId:S})}],[{icon:h.jsx(aS,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!mS(E),tooltip:mS(E)?void 0:"Only named cells can be linked to",handle:async()=>{await xn(S$(E)),lt({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:h.jsx(mm,{size:13,strokeWidth:1.5}),handle:()=>{_({cellId:S})}}]].map(zS).filter(FS),e[22]=c,e[23]=b,e[24]=v,e[25]=x,e[26]=m,e[27]=S,e[28]=d,e[29]=k.disabled,e[30]=k.hide_code,e[31]=o,e[32]=_,e[33]=j,e[34]=T,e[35]=I,e[36]=i,e[37]=E,e[38]=f,e[39]=l,e[40]=a,e[41]=p,e[42]=u,e[43]=M,e[44]=V,e[45]=C,e[46]=B,e[47]=z,e[48]=$):$=e[48],$}function FS(t){return t.length>0}function zS(t){return t.filter(BS)}function BS(t){return!t.hidden}function US(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function VS(t){return!t.hidden}const hd=Ut(!1),ag=()=>{const t=X.c(37),[e,n]=hn(hd),o=VF(),r=$e($F),s=$e(pm);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=ud(i).flat();a=Aa(a);const l=function(){const L=X.c(45),{theme:C}=po(),[$,N]=Ds(),[H,Y]=V3();let Z;L[0]!==N?(Z=async le=>{await Rs({config:le}).then(()=>{N(le)})},L[0]=N,L[1]=Z):Z=L[1];const q=Z;let re;L[2]!==Y?(re=async le=>{await UF({config:le}).then(()=>{Y(le)})},L[2]=Y,L[3]=re):re=L[3];const ne=re;let oe;if(L[4]!==H||L[5]!==$||L[6]!==ne||L[7]!==q||L[8]!==C){let le,fe,de;L[10]!==H?(le=et=>et!==H.width,L[10]=H,L[11]=le):le=L[11],L[12]!==H||L[13]!==ne?(fe=et=>({label:`App config > Set width=${et}`,handle:()=>{ne({...H,width:et})}}),L[12]=H,L[13]=ne,L[14]=fe):fe=L[14],L[15]!==$||L[16]!==q||L[17]!==C?(de={label:"Config > Toggle dark mode",handle:()=>{q({...$,display:{...$.display,theme:C==="dark"?"light":"dark"}})}},L[15]=$,L[16]=q,L[17]=C,L[18]=de):de=L[18];const he=$.keymap.preset==="vim";let se,ye;L[19]!==$||L[20]!==q?(se=()=>{q({...$,keymap:{...$.keymap,preset:"vim"}})},L[19]=$,L[20]=q,L[21]=se):se=L[21],L[22]!==he||L[23]!==se?(ye={label:"Config > Switch keymap to VIM",hidden:he,handle:se},L[22]=he,L[23]=se,L[24]=ye):ye=L[24];const je=$.keymap.preset==="default";let ce,Ee,_e;L[25]!==$||L[26]!==q?(ce=()=>{q({...$,keymap:{...$.keymap,preset:"default"}})},L[25]=$,L[26]=q,L[27]=ce):ce=L[27],L[28]!==ce||L[29]!==je?(Ee={label:"Config > Switch keymap to default (current: VIM)",hidden:je,handle:ce},L[28]=ce,L[29]=je,L[30]=Ee):Ee=L[30],L[31]!==$||L[32]!==q?(_e=()=>{q({...$,completion:{...$.completion,copilot:!1}})},L[31]=$,L[32]=q,L[33]=_e):_e=L[33];const De=$.completion.copilot!=="github";let Fe,He;L[34]!==_e||L[35]!==De?(Fe={label:"Config > Disable GitHub Copilot",handle:_e,hidden:De},L[34]=_e,L[35]=De,L[36]=Fe):Fe=L[36],L[37]!==$||L[38]!==q?(He=()=>{q({...$,completion:{...$.completion,copilot:"github"}})},L[37]=$,L[38]=q,L[39]=He):He=L[39];const Xe=$.completion.copilot==="github";let Le;L[40]!==He||L[41]!==Xe?(Le={label:"Config > Enable GitHub Copilot",handle:He,hidden:Xe},L[40]=He,L[41]=Xe,L[42]=Le):Le=L[42],oe=[...i$().filter(le).map(fe),de,ye,Ee,Fe,Le],L[4]=H,L[5]=$,L[6]=ne,L[7]=q,L[8]=C,L[9]=oe}else oe=L[9];const G=oe;let Q;return L[43]!==G?(Q=G.filter(VS),L[43]=G,L[44]=Q):Q=L[44],Q}();let c=Pg();c=[...Aa(c),...Aa(l)];const d=c.filter($S),u=cc.keyBy(d,HS),{recentCommands:f,addRecentCommand:m}=DS();let _;t[2]!==f?(_=new Set(f),t[2]=f,t[3]=_):_=t[3];const g=_;let p,b;t[4]!==s||t[5]!==n?(p=L=>{qF(s.getHotkey("global.commandPalette").key)(L)&&(L.preventDefault(),n(WS))},t[4]=s,t[5]=n,t[6]=p):p=t[6],um(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(L,C)=>{const $=o[L];if(!$)return null;const N=s.getHotkey(L);return h.jsxs(go,{disabled:C.disabled,onSelect:()=>{m(L),n(!1),requestAnimationFrame(()=>{$()})},value:N.name,children:[h.jsxs("span",{children:[N.name,C.tooltip&&h.jsx("span",{className:"ml-2",children:C.tooltip})]}),h.jsx(H3,{children:h.jsx(bm,{shortcut:N.key})})]},L)},t[7]=m,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const x=b;let y;t[12]!==m||t[13]!==s||t[14]!==n?(y=(L,C,$,N)=>{const H=$===void 0?{}:$;return h.jsxs(go,{disabled:H.disabled,onSelect:()=>{m(L),n(!1),requestAnimationFrame(()=>{C()})},value:L,children:[h.jsxs("span",{children:[L,H.tooltip&&h.jsxs("span",{className:"ml-2",children:["(",H.tooltip,")"]})]}),N&&h.jsx(H3,{children:h.jsx(bm,{shortcut:s.getHotkey(N).key})})]},L)},t[12]=m,t[13]=s,t[14]=n,t[15]=y):y=t[15];const v=y,S=WF;let k;t[16]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(na,{placeholder:"Type to search..."}),t[16]=k):k=t[16];const j=_m;let E;t[17]===Symbol.for("react.memo_cache_sentinel")?(E=h.jsx(dc,{children:"No results found."}),t[17]=E):E=t[17];const I=f.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(gm,{heading:"Recently Used",children:f.map(L=>{const C=u[L];return HF(L)?x(L,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip}):C&&!og(C)?v(C.label,C.handleHeadless||C.handle,{disabled:C.disabled,tooltip:C.tooltip}):null})}),h.jsx($3,{})]}),T=gm,M=s.iterate().map(L=>{if(g.has(L))return null;const C=u[L];return x(L,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip})}),R=d.map(L=>g.has(L.label)?null:v(L.label,L.handleHeadless||L.handle,{disabled:L.disabled,tooltip:L.tooltip}));let B;t[18]!==g||t[19]!==v?(B=L=>g.has(L.label)?null:v(`Cell > ${L.label}`,L.handleHeadless||L.handle,{disabled:L.disabled,tooltip:L.tooltip}),t[18]=g,t[19]=v,t[20]=B):B=t[20];const O=a.map(B);let z,F,V;return t[21]!==T||t[22]!==R||t[23]!==O||t[24]!==M?(z=h.jsxs(T,{heading:"Commands",children:[M,R,O]}),t[21]=T,t[22]=R,t[23]=O,t[24]=M,t[25]=z):z=t[25],t[26]!==j||t[27]!==z||t[28]!==E||t[29]!==I?(F=h.jsxs(j,{children:[E,I,z]}),t[26]=j,t[27]=z,t[28]=E,t[29]=I,t[30]=F):F=t[30],t[31]!==S||t[32]!==e||t[33]!==n||t[34]!==F||t[35]!==k?(V=h.jsxs(S,{open:e,onOpenChange:n,children:[k,F]}),t[31]=S,t[32]=e,t[33]=n,t[34]=F,t[35]=k,t[36]=V):V=t[36],V};function $S(t){return!t.hotkey}function HS(t){return t.label}function WS(t){return!t}const Ma="https://static.marimo.app",qS=t=>{const e=X.c(24),{onClose:n}=t,[o,r]=A.useState("");let s;s=Math.random().toString(36).slice(2,6);const i=`${o}-${s}`,a=`${Ma}/static/${i}`;let l,c,d,u,f,m,_,g,p,b,x;return e[0]!==n||e[1]!==i?(l=async y=>{y.preventDefault(),n();const v=await GF({download:!1,includeCode:!0,files:gS.INSTANCE.filenames()}),S=lt({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ma}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:v,path:i})}).catch(()=>{S.dismiss(),lt({title:"Error uploading static page",description:h.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",h.jsx("a",{href:Kn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),S.dismiss(),lt({title:"Static page uploaded!",description:h.jsxs("div",{children:["The URL has been copied to your clipboard.",h.jsx("br",{}),"You can share it with anyone."]})})},e[0]=n,e[1]=i,e[2]=l):l=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(dr,{children:"Share static notebook"}),e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsxs(Os,{children:[c,h.jsxs(Ps,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",h.jsx("a",{href:Ma,target:"_blank",children:Ma}),"."]})]}),e[4]=d):d=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{const v=y.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(v)},e[5]=u):u=e[5],e[6]!==o?(f=h.jsx(ur,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:u,required:!0,autoComplete:"off"}),e[6]=o,e[7]=f):f=e[7],e[8]!==a?(m=h.jsxs("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(GS,{text:a}),h.jsx("span",{className:"text-primary",children:a})]})]}),e[8]=a,e[9]=m):m=e[9],e[10]!==f||e[11]!==m?(_=h.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[f,m]}),e[10]=f,e[11]=m,e[12]=_):_=e[12],e[13]!==n?(g=h.jsx(Ae,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[13]=n,e[14]=g):g=e[14],e[15]!==a?(p=h.jsx(Ae,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await xn(a)},children:"Create"}),e[15]=a,e[16]=p):p=e[16],e[17]!==p||e[18]!==g?(b=h.jsxs(oa,{children:[g,p]}),e[17]=p,e[18]=g,e[19]=b):b=e[19],e[20]!==b||e[21]!==l||e[22]!==_?(x=h.jsx(cr,{className:"w-fit",children:h.jsxs("form",{onSubmit:l,children:[d,_,b]})}),e[20]=b,e[21]=l,e[22]=_,e[23]=x):x=e[23],x},GS=t=>{const e=X.c(8),[n,o]=K.useState(!1);let r;e[0]!==t.text?(r=fn.stopPropagation(async c=>{c.preventDefault(),await xn(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=r):r=e[1];const s=r;let i,a,l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(Ls,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=h.jsx(Ae,{"data-testid":"copy-static-notebook-url-button",onClick:s,size:"xs",variant:"secondary",children:i}),e[3]=s,e[4]=a):a=e[4],e[5]!==n||e[6]!==a?(l=h.jsx(Oe,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function lg(){const t=X.c(3),{openConfirm:e}=Un(),n=Gt(_o);let o;return t[0]!==e||t[1]!==n?(o=()=>{e({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:h.jsx(W3,{onClick:async()=>{n({state:en.CLOSING}),await YF(),JF()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=n,t[2]=o):o=t[2],o}const fd=[{type:"files",Icon:kp,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:uc,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:lr,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:Na,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:ya,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:od,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:ym,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:rd,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:xm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:a$,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Wp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:Ep,tooltip:"Secrets",hidden:Jn(),position:"sidebar"},{type:"scratchpad",Icon:KF,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:fm,tooltip:"View errors",position:"footer"}];function cg(){const t=X.c(2),e=Gt(wm);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s;s=null;for(const i of Array.from(o)){const a=i.getBoundingClientRect();if(a.top>=0&&a.top<=r||a.bottom>=0&&a.bottom<=r){s=Fs.parse(i.parentNode.id);break}}e(i=>({mode:XF(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(Fs.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function Pr(){return Te.string().optional().describe(Je.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function dg(){return Te.string().optional().describe(Je.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Oa(){return Te.string().optional().describe(Je.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function ug(){return Te.string().optional().describe(Je.of({label:"URI",optionRegex:".*uri.*"}))}function Lr(){return Te.string().nonempty().describe(Je.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function Wo(){return Te.string().describe(Je.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Fr(){return Te.string().nonempty().describe(Je.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function zr(t){const e=Te.coerce.string().describe(Je.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(n=>n>=0&&n<=65535,{message:"Port must be between 0 and 65535"});return t!==void 0?e.default(t.toString()):e}function hg(){return Te.boolean().default(!1).describe(Je.of({label:"Read Only"}))}const fg=Te.object({type:Te.literal("postgres"),host:Lr(),port:zr(5432).optional(),database:Wo(),username:Fr(),password:Pr(),ssl:Te.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),mg=Te.object({type:Te.literal("mysql"),host:Lr(),port:zr(3306),database:Wo(),username:Fr(),password:Pr(),ssl:Te.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),pg=Te.object({type:Te.literal("sqlite"),database:Wo().describe(Je.of({label:"Database Path"}))}).describe(Je.of({direction:"two-columns"})),gg=Te.object({type:Te.literal("duckdb"),database:Wo().describe(Je.of({label:"Database Path"})),read_only:hg()}).describe(Je.of({direction:"two-columns"})),_g=Te.object({type:Te.literal("motherduck"),database:Wo().default("my_db").describe(Je.of({label:"Database Name"})),token:dg()}).describe(Je.of({direction:"two-columns"})),bg=Te.object({type:Te.literal("snowflake"),account:Te.string().nonempty().describe(Je.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:Te.string().optional().describe(Je.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:Wo(),schema:Te.string().optional().describe(Je.of({label:"Schema",optionRegex:".*snowflake.*"})),username:Fr(),password:Pr(),role:Te.string().optional().describe(Je.of({label:"Role"}))}).describe(Je.of({direction:"two-columns"})),yg=Te.object({type:Te.literal("bigquery"),project:Te.string().nonempty().describe(Je.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:Te.string().nonempty().describe(Je.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:Te.string().describe(Je.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(Je.of({direction:"two-columns"})),xg=Te.object({type:Te.literal("clickhouse_connect"),host:Lr(),port:zr(8123).optional(),username:Fr(),password:Pr(),secure:Te.boolean().default(!1).describe(Je.of({label:"Use HTTPs"}))}).describe(Je.of({direction:"two-columns"})),wg=Te.object({type:Te.literal("timeplus"),host:Lr().default("localhost"),port:zr(8123).optional(),username:Fr().default("default"),password:Pr().default("")}).describe(Je.of({direction:"two-columns"})),vg=Te.object({type:Te.literal("chdb"),database:Wo().describe(Je.of({label:"Database Path"})),read_only:hg()}).describe(Je.of({direction:"two-columns"})),kg=Te.object({type:Te.literal("trino"),host:Lr(),port:zr(8080),database:Wo(),schema:Te.string().describe(Je.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:Fr(),password:Pr(),async_support:Te.boolean().default(!1).describe(Je.of({label:"Async Support"}))}).describe(Je.of({direction:"two-columns"})),Sg=Te.object({type:Te.literal("iceberg"),name:Te.string().describe(Je.of({label:"Catalog Name"})),catalog:Te.discriminatedUnion("type",[Te.object({type:Te.literal("REST"),warehouse:Oa(),uri:Te.string().optional().describe(Je.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:dg()}),Te.object({type:Te.literal("SQL"),warehouse:Oa(),uri:Te.string().optional().describe(Je.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),Te.object({type:Te.literal("Hive"),warehouse:Oa(),uri:ug()}),Te.object({type:Te.literal("Glue"),warehouse:Oa(),uri:ug()}),Te.object({type:Te.literal("DynamoDB"),"dynamodb.profile-name":Te.string().optional().describe(Je.of({label:"Profile Name"})),"dynamodb.region":Te.string().optional().describe(Je.of({label:"Region"})),"dynamodb.access-key-id":Te.string().optional().describe(Je.of({label:"Access Key ID"})),"dynamodb.secret-access-key":Te.string().optional().describe(Je.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":Te.string().optional().describe(Je.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(Je.of({special:"tabs"}))}),Cg=Te.object({type:Te.literal("datafusion"),sessionContext:Te.boolean().optional().describe(Je.of({label:"Use Session Context"}))}),Ng=Te.object({type:Te.literal("pyspark"),host:Lr().optional(),port:zr().optional()}),YS=Te.discriminatedUnion("type",[fg,mg,pg,gg,_g,bg,yg,xg,wg,vg,kg,Sg,Cg,Ng]),md="env:";function Da(t){return typeof t=="string"&&t.startsWith(md)}function pd(t){return`${md}${t}`}const jg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck"};class gn{constructor(e,n,o){this.connection=void 0,this.orm=void 0,this.secrets=void 0,this.connection=e,this.orm=n,this.secrets=o}get imports(){const e=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":e.add("import sqlalchemy");break;case"sqlmodel":e.add("import sqlmodel");break;case"duckdb":e.add("import duckdb")}return e}}class JS{constructor(){this.secrets={}}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(e,n,o){if(e=(r=>`_${r}`)(e),Da(n)){const r=n.replace(md,""),s=o?`os.environ.get("${r}", "${o}")`:`os.environ.get("${r}")`;return this.secrets[e]=s,e}if(o!=null){const r=`os.environ.get("${n}", "${o}")`;return this.secrets[e]=r,e}return typeof n=="number"||typeof n=="number"?`${n}`:typeof n=="boolean"?Br(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return Br(n);const r=this.print(e,n,o);return r.startsWith('"')&&r.endsWith('"')?r.slice(1,-1):`{${r}}`}printPassword(e,n,o){const r=o?this.printInFString.bind(this):this.print.bind(this);return Da(e)?r("password",e):r("password",n,e)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([e,n])=>`${e} = ${n}`).join(`
|
3
3
|
`)}}class KS extends gn{generateImports(){return[]}generateConnectionCode(){const e=this.connection.ssl?", connect_args={'sslmode': 'require'}":"",n=this.secrets.printPassword(this.connection.password,"POSTGRES_PASSWORD",!0),o=this.secrets.printInFString("username",this.connection.username),r=this.secrets.printInFString("host",this.connection.host),s=this.secrets.printInFString("port",this.connection.port),i=this.secrets.printInFString("database",this.connection.database);return Mt(`
|
4
4
|
DATABASE_URL = f"postgresql://${o}:${n}@${r}:${s}/${i}"
|
5
5
|
engine = ${this.orm}.create_engine(DATABASE_URL${e})
|
@@ -116,7 +116,7 @@ ${t.stack}`:o}function ro(t,e){return t>>>=0,Zr().subarray(t/1,t/1+e)}function K
|
|
116
116
|
hover/column:hover:bg-primary/60 dark:hover/column:hover:bg-primary/60`})}const mM=Ut(t=>{const e=t(rc);for(const n of e.cellIds.inOrderIds){const o=e.cellRuntime[n];if(o.status==="idle"&&o.consoleOutputs.some(r=>r.channel==="stdin"&&r.response===void 0))return!0}return!1}),pM=()=>{const t=X.c(3),e=gM;if(!$e(mM))return null;let n,o,r;if(t[0]===Symbol.for("react.memo_cache_sentinel")?(n=h.jsx("div",{className:"flex justify-between",children:h.jsx("span",{className:"font-bold text-lg flex items-center mb-1",children:"Program waiting for input"})}),t[0]=n):n=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(jc,{className:"inline",children:"stdin"}),t[1]=o):o=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")){const s=h.jsx("div",{className:"flex flex-col gap-4 mb-5 fixed top-5 left-1/2 transform -translate-x-1/2 z-[200] opacity-95",children:h.jsxs(zc,{kind:"info",className:"flex flex-col rounded py-2 px-4 animate-in slide-in-from-top w-fit",children:[n,h.jsx("div",{className:"flex flex-col gap-4 justify-between items-start text-muted-foreground text-base",children:h.jsx("div",{children:h.jsxs("p",{children:["The program is still running, but blocked on"," ",o,".",h.jsx(Ae,{variant:"link",className:"h-auto font-normal",onClick:e,children:"Jump to the cell"})]})})})]})});r=h.jsx(D4,{milliseconds:2e3,children:s}),t[2]=r}else r=t[2];return r};function gM(){const t=document.querySelector("[data-stdin-blocking]");t?(t.scrollIntoView({behavior:"smooth",block:"center"}),requestAnimationFrame(()=>{t.focus()})):Qt.error("No element with data-stdin-blocking found")}const _M=t=>{const e=X.c(8),n=$e(RU),o=t.appConfig.width==="columns";let r,s,i;return e[0]!==t?(r=h.jsx(bM,{...t}),e[0]=t,e[1]=r):r=e[1],e[2]!==n||e[3]!==r?(s=h.jsx(m0,{id:"column-container",items:n,strategy:YE,children:r}),e[2]=n,e[3]=r,e[4]=s):s=e[4],e[5]!==o||e[6]!==s?(i=h.jsx(iM,{multiColumn:o,children:s}),e[5]=o,e[6]=s,e[7]=i):i=e[7],i},bM=t=>{const e=X.c(50),{mode:n,userConfig:o,appConfig:r,connStatus:s}=t,i=vc(),a=Lt(),{theme:l}=po(),{toggleSidebarPanel:c}=Bs(),{invisible:d}=D$(i.cellIds.idLength,n);Yt("global.focusTop",a.focusTopCell),Yt("global.focusBottom",a.focusBottomCell),Yt("global.toggleSidebar",c),Yt("global.foldCode",a.foldAll),Yt("global.unfoldCode",a.unfoldAll),Yt("global.formatAll",wM),Yt("cell.hideCode",En.NOOP),Yt("cell.format",En.NOOP);const u=dd(),f=a.scrollToTarget;let m,_,g,p,b,x,y,v,S,k,j,E,I,T,M;if(e[0]!==i.scrollKey||e[1]!==f?(m=()=>{i.scrollKey!==null&&f()},e[0]=i.scrollKey,e[1]=f,e[2]=m):m=e[2],e[3]!==i.cellIds||e[4]!==i.scrollKey||e[5]!==f?(_=[i.cellIds,i.scrollKey,f],e[3]=i.cellIds,e[4]=i.scrollKey,e[5]=f,e[6]=_):_=e[6],A.useEffect(m,_),e[7]!==a||e[8]!==r||e[9]!==s||e[10]!==d||e[11]!==n||e[12]!==i||e[13]!==u||e[14]!==l||e[15]!==o){const R=i.cellIds.getColumns();let B;e[26]!==i.cellIds?(B=i.cellIds.hasOnlyOneId(),e[26]=i.cellIds,e[27]=B):B=e[27];const O=B;let z;e[28]!==i.cellIds.inOrderIds?(z=i.cellIds.inOrderIds.includes($o),e[28]=i.cellIds.inOrderIds,e[29]=z):z=e[29];const F=z;g=R$,v="pb-[40vh]",S=d,k=r,j="pr-4",e[30]===Symbol.for("react.memo_cache_sentinel")?(E=h.jsx(J7,{}),p=h.jsx(pM,{}),e[30]=p,e[31]=E):(p=e[30],E=e[31]),e[32]!==r.width?(b=h.jsx(q7,{width:r.width}),e[32]=r.width,e[33]=b):b=e[33];const V=r.width==="columns"&&"grid grid-flow-col auto-cols-min gap-6";e[34]!==V?(x=Me(V),e[34]=V,e[35]=x):x=e[35],y=R.map((L,C)=>h.jsx(yM,{column:L,index:C,columnsLength:R.length,appConfig:r,notebook:i,mode:n,userConfig:o,connStatus:s,actions:a,theme:l,hasOnlyOneCell:O,invisible:d,hasSetupCell:F,onDeleteCell:u},L.id)),e[7]=a,e[8]=r,e[9]=s,e[10]=d,e[11]=n,e[12]=i,e[13]=u,e[14]=l,e[15]=o,e[16]=g,e[17]=p,e[18]=b,e[19]=x,e[20]=y,e[21]=v,e[22]=S,e[23]=k,e[24]=j,e[25]=E}else g=e[16],p=e[17],b=e[18],x=e[19],y=e[20],v=e[21],S=e[22],k=e[23],j=e[24],E=e[25];return e[36]!==x||e[37]!==y?(I=h.jsx("div",{className:x,children:y}),e[36]=x,e[37]=y,e[38]=I):I=e[38],e[39]===Symbol.for("react.memo_cache_sentinel")?(T=h.jsx(P$,{}),e[39]=T):T=e[39],e[40]!==g||e[41]!==p||e[42]!==b||e[43]!==I||e[44]!==v||e[45]!==S||e[46]!==k||e[47]!==j||e[48]!==E?(M=h.jsxs(g,{className:v,invisible:S,appConfig:k,innerClassName:j,children:[E,p,b,I,T]}),e[40]=g,e[41]=p,e[42]=b,e[43]=I,e[44]=v,e[45]=S,e[46]=k,e[47]=j,e[48]=E,e[49]=M):M=e[49],M},yM=t=>{const e=X.c(42),{column:n,index:o,columnsLength:r,appConfig:s,notebook:i,mode:a,userConfig:l,connStatus:c,actions:d,theme:u,hasOnlyOneCell:f,invisible:m,hasSetupCell:_,onDeleteCell:g}=t,p=c.state!==en.OPEN,b=n.id,x=o>0,y=o<r-1,v=s.width,S=r>1,k=n.id,j=s.width==="columns"&&"opacity-0 group-hover/column:opacity-100";let E,I;e[0]!==j?(E=Me(j),e[0]=j,e[1]=E):E=e[1],e[2]!==n.id||e[3]!==E?(I=h.jsx(xM,{columnId:k,className:E}),e[2]=n.id,e[3]=E,e[4]=I):I=e[4];const T=`column-${o+1}`,M=n.topLevelIds;let R,B,O,z;return e[5]!==d||e[6]!==p||e[7]!==_||e[8]!==o||e[9]!==m||e[10]!==a||e[11]!==i||e[12]!==g||e[13]!==u||e[14]!==l?(R=o===0&&_&&h.jsx(Ax,{theme:u,showPlaceholder:!1,allowFocus:!m,...i.cellData[$o],...i.cellRuntime[$o],...d,runElapsedTimeMs:i.cellRuntime[$o].runElapsedTimeMs??i.cellData[$o].lastExecutionTime,canDelete:!0,mode:a,appClosed:p,ref:i.cellHandles[$o],userConfig:l,isCollapsed:!1,collapseCount:0,canMoveX:!1,actions:d,deleteCell:g},$o),e[5]=d,e[6]=p,e[7]=_,e[8]=o,e[9]=m,e[10]=a,e[11]=i,e[12]=g,e[13]=u,e[14]=l,e[15]=R):R=e[15],e[16]!==d||e[17]!==p||e[18]!==s.width||e[19]!==n||e[20]!==f||e[21]!==m||e[22]!==a||e[23]!==i||e[24]!==g||e[25]!==u||e[26]!==l?(B=n.topLevelIds.map(F=>{if(F===$o)return null;const V=i.cellData[F],L=i.cellRuntime[F];return h.jsx(Ax,{theme:u,showPlaceholder:f,allowFocus:!m,...V,...L,runElapsedTimeMs:L.runElapsedTimeMs??V.lastExecutionTime,canDelete:!f,mode:a,appClosed:p,ref:i.cellHandles[F],userConfig:l,config:V.config,name:V.name,isCollapsed:n.isCollapsed(F),collapseCount:n.getCount(F),canMoveX:s.width==="columns",actions:d,deleteCell:g},V.id.toString())}),e[16]=d,e[17]=p,e[18]=s.width,e[19]=n,e[20]=f,e[21]=m,e[22]=a,e[23]=i,e[24]=g,e[25]=u,e[26]=l,e[27]=B):B=e[27],e[28]!==n.topLevelIds||e[29]!==T||e[30]!==R||e[31]!==B?(O=h.jsxs(m0,{id:T,items:M,strategy:JE,children:[R,B]}),e[28]=n.topLevelIds,e[29]=T,e[30]=R,e[31]=B,e[32]=O):O=e[32],e[33]!==s.width||e[34]!==n.id||e[35]!==o||e[36]!==O||e[37]!==x||e[38]!==y||e[39]!==S||e[40]!==I?(z=h.jsx(Mx,{columnId:b,index:o,canMoveLeft:x,canMoveRight:y,width:v,canDelete:S,footer:I,children:O}),e[33]=s.width,e[34]=n.id,e[35]=o,e[36]=O,e[37]=x,e[38]=y,e[39]=S,e[40]=I,e[41]=z):z=e[41],z},xM=t=>{const e=X.c(17),{columnId:n,className:o}=t,{createNewCell:r}=Lt(),s=$e(Ts),[i,a]=PU(!1),l=$e(ic);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Me("mb-0 rounded-none sm:px-4 md:px-5 lg:px-8 tracking-wide no-wrap whitespace-nowrap","hover:bg-accent hover:text-accent-foreground font-semibold uppercase text-xs"),e[0]=c):c=e[0];const d=c;let u;e[1]!==l||e[2]!==s||e[3]!==n||e[4]!==r||e[5]!==i||e[6]!==a.toggle?(u=()=>i?h.jsx(LU,{onClose:a.toggle}):h.jsxs(h.Fragment,{children:[h.jsxs(Ae,{className:d,variant:"text",size:"sm",onClick:()=>r({cellId:{type:"__end__",columnId:n},before:!1}),children:[h.jsx(Hp,{className:"mr-2 size-4 flex-shrink-0"}),"Python"]}),h.jsxs(Ae,{className:d,variant:"text",size:"sm",onClick:()=>{Ho(s,r),r({cellId:{type:"__end__",columnId:n},before:!1,code:new ra().defaultCode})},children:[h.jsx(Gp,{className:"mr-2 size-4 flex-shrink-0"}),"Markdown"]}),h.jsxs(Ae,{className:d,variant:"text",size:"sm",onClick:()=>{Ho(s,r),r({cellId:{type:"__end__",columnId:n},before:!1,code:new Ic().defaultCode})},children:[h.jsx(lr,{className:"mr-2 size-4 flex-shrink-0"}),"SQL"]}),h.jsx(Oe,{content:l?null:h.jsx("span",{children:"Enable via settings under AI Assist"}),delayDuration:100,asChild:!1,children:h.jsxs(Ae,{className:d,variant:"text",size:"sm",disabled:!l,onClick:a.toggle,children:[h.jsx(Qi,{className:"mr-2 size-4 flex-shrink-0"}),"Generate with AI"]})})]}),e[1]=l,e[2]=s,e[3]=n,e[4]=r,e[5]=i,e[6]=a.toggle,e[7]=u):u=e[7];const f=u,m=!i&&"w-fit",_=i&&"opacity-100 w-full max-w-4xl shadow-lg shadow-[var(--blue-3)]";let g,p,b;return e[8]!==o||e[9]!==m||e[10]!==_?(g=Me("shadow-sm border border-border rounded transition-all duration-200 overflow-hidden divide-x divide-border flex",m,_,o),e[8]=o,e[9]=m,e[10]=_,e[11]=g):g=e[11],e[12]!==f?(p=f(),e[12]=f,e[13]=p):p=e[13],e[14]!==g||e[15]!==p?(b=h.jsx("div",{className:"flex justify-center mt-4 pt-6 pb-32 group gap-4 w-full print:hidden",children:h.jsx("div",{className:g,children:p})}),e[14]=g,e[15]=p,e[16]=b):b=e[16],b};function wM(){u4()}const Ox=t=>{const e=X.c(65),{userConfig:n,appConfig:o,hideControls:r}=t,s=r!==void 0&&r;FU(U4,TN);const{setCells:i,mergeAllColumns:a,collapseAllCells:l,expandAllCells:c}=Lt(),d=$e(wm),u=$e(zU),f=$e(BU),m=pc(),_=Gt(yd),g=d.mode==="edit",p=d.mode==="present",b=$e(UU);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0],A.useEffect(kM,x);const y=n.runtime.auto_instantiate;let v,S,k;e[1]!==i||e[2]!==_?(v=(le,fe)=>{i(le);const de=le.map(SM),he=le.map(CM),se=le.map(NM);_({names:de,codes:he,configs:se,layout:fe})},e[1]=i,e[2]=_,e[3]=v):v=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(S=A4(),e[4]=S):S=e[4],e[5]!==v||e[6]!==n.runtime.auto_instantiate?(k={autoInstantiate:y,setCells:v,sessionId:S},e[5]=v,e[6]=n.runtime.auto_instantiate,e[7]=k):k=e[7];const{connection:j}=L$(k);let E,I;e[8]!==o.app_title||e[9]!==m?(E=()=>{document.title=o.app_title||Vn.basename(m??"")||"Untitled Notebook"},I=[o.app_title,m],e[8]=o.app_title,e[9]=m,e[10]=E,e[11]=I):(E=e[10],I=e[11]),A.useEffect(E,I);const T=Oc(o.width);let M,R;e[12]!==o.width||e[13]!==a||e[14]!==T?(M=()=>{T==="columns"&&o.width!=="columns"&&a()},e[12]=o.width,e[13]=a,e[14]=T,e[15]=M):M=e[15],e[16]!==o.width||e[17]!==a||e[18]!==u||e[19]!==T?(R=[o.width,T,a,u],e[16]=o.width,e[17]=a,e[18]=u,e[19]=T,e[20]=R):R=e[20],A.useEffect(M,R);const B=function(){const le=X.c(2),fe=ad();let de;return le[0]!==fe?(de=()=>fe(MF(mo())),le[0]=fe,le[1]=de):de=le[1],Qe(de)}(),O=rg(),z=cg();let F,V,L,C,$,N;e[21]!==B?(F=()=>{B()},e[21]=B,e[22]=F):F=e[22],Yt("global.runStale",F),Yt("global.interrupt",jM),e[23]!==z?(V=()=>{z()},e[23]=z,e[24]=V):V=e[24],Yt("global.hideCode",V),e[25]!==O?(L=()=>{O()},e[25]=O,e[26]=L):L=e[26],Yt("global.runAll",L),e[27]!==l?(C=()=>{l()},e[27]=l,e[28]=C):C=e[28],Yt("global.collapseAllSections",C),e[29]!==c?($=()=>{c()},e[29]=c,e[30]=$):$=e[30],Yt("global.expandAllSections",$),e[31]!==o||e[32]!==j||e[33]!==n||e[34]!==d.mode?(N=h.jsx(_M,{connStatus:j,mode:d.mode,userConfig:n,appConfig:o}),e[31]=o,e[32]=j,e[33]=n,e[34]=d.mode,e[35]=N):N=e[35];const H=N,Y=o.width;let Z,q,re,ne,oe,G,Q;return e[36]===Symbol.for("react.memo_cache_sentinel")?(Z=Me("pt-4 sm:pt-12 pb-2 mb-4 print:hidden z-50","sticky left-0"),e[36]=Z):Z=e[36],e[37]!==m||e[38]!==g?(q=g&&h.jsx("div",{className:"flex items-center justify-center container",children:h.jsx(IN,{filename:m})}),e[37]=m,e[38]=g,e[39]=q):q=e[39],e[40]!==j||e[41]!==q?(re=h.jsx(z$,{connection:j,className:Z,children:q}),e[40]=j,e[41]=q,e[42]=re):re=e[42],e[43]!==o||e[44]!==H||e[45]!==f||e[46]!==d.mode?(ne=f&&h.jsx(F$,{appConfig:o,mode:d.mode,children:H}),e[43]=o,e[44]=H,e[45]=f,e[46]=d.mode,e[47]=ne):ne=e[47],e[48]!==o.width||e[49]!==j||e[50]!==b||e[51]!==re||e[52]!==ne?(oe=h.jsxs(B$,{connection:j,isRunning:b,width:Y,children:[re,ne]}),e[48]=o.width,e[49]=j,e[50]=b,e[51]=re,e[52]=ne,e[53]=oe):oe=e[53],e[54]!==o||e[55]!==j||e[56]!==s||e[57]!==p||e[58]!==b||e[59]!==B||e[60]!==z?(G=!s&&h.jsx(Bc,{children:h.jsx(SN,{presenting:p,onTogglePresenting:z,onInterrupt:Vm,onRun:B,closed:j.state===en.CLOSED,running:b,appConfig:o})}),e[54]=o,e[55]=j,e[56]=s,e[57]=p,e[58]=b,e[59]=B,e[60]=z,e[61]=G):G=e[61],e[62]!==oe||e[63]!==G?(Q=h.jsxs(h.Fragment,{children:[oe,G]}),e[62]=oe,e[63]=G,e[64]=Q):Q=e[64],Q};function vM(){vS.INSTANCE.stop()}function kM(){return vS.INSTANCE.start(VU),vM}function SM(t){return t.name}function CM(t){return t.code}function NM(t){return t.config}function jM(){Vm()}const EM=t=>{const e=X.c(17),[n,o]=A.useState(0),r=$e(_o);let s,i,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>o(MM),i={delayMs:1e4,whenVisible:!0},e[0]=s,e[1]=i):(s=e[0],i=e[1]),Wc(s,i),e[2]!==r.state?(a=async()=>Jn()||r.state!==en.OPEN?null:$U(),e[2]=r.state,e[3]=a):a=e[3],e[4]!==r.state||e[5]!==n?(l=[n,r.state],e[4]=r.state,e[5]=n,e[6]=l):l=e[6];const{data:c}=Xn(a,l);let d,u,f,m;return e[7]!==c?(d=(c==null?void 0:c.gpu)&&c.gpu.length>0&&h.jsx(TM,{gpus:c.gpu}),e[7]=c,e[8]=d):d=e[8],e[9]!==c?(u=c&&h.jsx(IM,{memory:c.memory,kernel:c.kernel,server:c.server}),e[9]=c,e[10]=u):u=e[10],e[11]!==c?(f=c&&h.jsx(AM,{cpu:c.cpu}),e[11]=c,e[12]=f):f=e[12],e[13]!==d||e[14]!==u||e[15]!==f?(m=h.jsxs("div",{className:"flex gap-2 items-center px-1",children:[d,u,f]}),e[13]=d,e[14]=u,e[15]=f,e[16]=m):m=e[16],m},IM=t=>{const e=X.c(25),{memory:n,kernel:o,server:r}=t,{percent:s,total:i,available:a}=n;let l;e[0]!==s?(l=Math.round(s),e[0]=s,e[1]=l):l=e[1];const c=l;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx("b",{children:"computer memory:"}),e[2]=d):d=e[2];const u=i-a;let f,m,_,g,p,b,x,y,v;return e[3]!==u?(f=Hu(u),e[3]=u,e[4]=f):f=e[4],e[5]!==i?(m=Hu(i),e[5]=i,e[6]=m):m=e[6],e[7]!==c||e[8]!==f||e[9]!==m?(_=h.jsxs("span",{children:[d," ",f," / ",m," GB (",c,"%)"]}),e[7]=c,e[8]=f,e[9]=m,e[10]=_):_=e[10],e[11]!==r?(g=(r==null?void 0:r.memory)&&h.jsxs("span",{children:[h.jsx("b",{children:"marimo server:"})," ",Nl(r.memory)]}),e[11]=r,e[12]=g):g=e[12],e[13]!==o?(p=(o==null?void 0:o.memory)&&h.jsxs("span",{children:[h.jsx("b",{children:"kernel:"})," ",Nl(o.memory)]}),e[13]=o,e[14]=p):p=e[14],e[15]!==_||e[16]!==g||e[17]!==p?(b=h.jsxs("div",{className:"flex flex-col gap-1",children:[_,g,p]}),e[15]=_,e[16]=g,e[17]=p,e[18]=b):b=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(x=h.jsx(Mp,{className:"w-4 h-4"}),e[19]=x):x=e[19],e[20]!==c?(y=h.jsxs("div",{className:"flex items-center gap-1",children:[x,h.jsx($u,{percent:c,colorClassName:"bg-primary"})]}),e[20]=c,e[21]=y):y=e[21],e[22]!==y||e[23]!==b?(v=h.jsx(Oe,{delayDuration:200,content:b,children:y}),e[22]=y,e[23]=b,e[24]=v):v=e[24],v},AM=t=>{const e=X.c(11),{cpu:n}=t,{percent:o}=n;let r;e[0]!==o?(r=Math.round(o),e[0]=o,e[1]=r):r=e[1];const s=r;let i,a,l,c,d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx("b",{children:"CPU:"}),e[2]=i):i=e[2],e[3]!==s?(a=h.jsxs("span",{children:[i," ",s,"%"]}),e[3]=s,e[4]=a):a=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(x$,{className:"w-4 h-4"}),e[5]=l):l=e[5],e[6]!==s?(c=h.jsxs("div",{className:"flex items-center gap-1",children:[l,h.jsx($u,{percent:s,colorClassName:"bg-primary"})]}),e[6]=s,e[7]=c):c=e[7],e[8]!==a||e[9]!==c?(d=h.jsx(Oe,{delayDuration:200,content:a,children:c}),e[8]=a,e[9]=c,e[10]=d):d=e[10],d},TM=t=>{const e=X.c(12),{gpus:n}=t;let o;e[0]!==n?(o=Math.round(n.reduce(OM,0)/n.length),e[0]=n,e[1]=o):o=e[1];const r=o;let s,i,a,l,c;return e[2]!==n?(s=n.map(DM),e[2]=n,e[3]=s):s=e[3],e[4]!==s?(i=h.jsx("div",{className:"flex flex-col gap-1",children:s}),e[4]=s,e[5]=i):i=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(Dp,{className:"w-4 h-4"}),e[6]=a):a=e[6],e[7]!==r?(l=h.jsxs("div",{className:"flex items-center gap-1",children:[a,h.jsx($u,{percent:r,colorClassName:"bg-[var(--grass-9)]"})]}),e[7]=r,e[8]=l):l=e[8],e[9]!==i||e[10]!==l?(c=h.jsx(Oe,{delayDuration:200,content:i,children:l}),e[9]=i,e[10]=l,e[11]=c):c=e[11],c},$u=t=>{const e=X.c(7),{percent:n,colorClassName:o}=t;let r;e[0]!==o?(r=Me("h-full bg-primary",o),e[0]=o,e[1]=r):r=e[1];const s=`${n}%`;let i,a;return e[2]!==s?(i={width:s},e[2]=s,e[3]=i):i=e[3],e[4]!==r||e[5]!==i?(a=h.jsx("div",{className:"h-3 w-20 bg-[var(--slate-4)] rounded-lg overflow-hidden border",children:h.jsx("div",{className:r,style:i})}),e[4]=r,e[5]=i,e[6]=a):a=e[6],a};function Nl(t){return t>1073741824?`${Hu(t)} GB`:`${function(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0}).format(e/1048576)}(t)} MB`}function Hu(t){return new Intl.NumberFormat("en-US",{maximumFractionDigits:2}).format(t/1073741824)}function MM(t){return t+1}function OM(t,e){return t+e.memory.percent}function DM(t){return h.jsxs("span",{children:[h.jsxs("b",{children:["GPU ",t.index," (",t.name,"):"]})," ",Nl(t.memory.used)," / ",Nl(t.memory.total)," GB (",Math.round(t.memory.percent),"%)"]},t.index)}const Dx=t=>$e(HU)[t.capability]?t.children:null,io=A.forwardRef((t,e)=>{const n=X.c(18);let o,r,s,i,a;n[0]!==t?({children:o,tooltip:a,selected:i,className:r,...s}=t,n[0]=t,n[1]=o,n[2]=r,n[3]=s,n[4]=i,n[5]=a):(o=n[1],r=n[2],s=n[3],i=n[4],a=n[5]);const l=!i&&"hover:bg-[var(--sage-3)]",c=i&&"bg-[var(--sage-4)]";let d,u;n[6]!==r||n[7]!==l||n[8]!==c?(d=Me("h-full flex items-center p-2 text-sm shadow-inset font-mono cursor-pointer rounded",l,c,r),n[6]=r,n[7]=l,n[8]=c,n[9]=d):d=n[9],n[10]!==o||n[11]!==e||n[12]!==s||n[13]!==d?(u=h.jsx("div",{ref:e,className:d,...s,children:o}),n[10]=o,n[11]=e,n[12]=s,n[13]=d,n[14]=u):u=n[14];const f=u;if(a){let m;return n[15]!==f||n[16]!==a?(m=h.jsx(Oe,{content:a,side:"top",delayDuration:200,children:f}),n[15]=f,n[16]=a,n[17]=m):m=n[17],m}return f});io.displayName="FooterItem";const RM=()=>{var d;const t=X.c(14),e=$e(V4),n=$e(ic),o=((d=e==null?void 0:e.open_ai)==null?void 0:d.model)||"gpt-4-turbo",{handleClick:r}=xa();if(!n){let u,f,m;return t[0]!==r?(u=()=>r("ai"),t[0]=r,t[1]=u):u=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(f=h.jsx(Qi,{className:"h-4 w-4 opacity-60"}),t[2]=f):f=t[2],t[3]!==u?(m=h.jsx(io,{tooltip:"Assist is disabled",selected:!1,onClick:u,children:f}),t[3]=u,t[4]=m):m=t[4],m}let s,i,a,l,c;return t[5]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx("b",{children:"Assist model:"}),t[5]=s):s=t[5],t[6]!==o?(i=h.jsxs(h.Fragment,{children:[s," ",o]}),t[6]=o,t[7]=i):i=t[7],t[8]!==r?(a=()=>r("ai"),t[8]=r,t[9]=a):a=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(Qi,{className:"h-4 w-4"}),t[10]=l):l=t[10],t[11]!==i||t[12]!==a?(c=h.jsx(io,{tooltip:i,onClick:a,selected:!1,children:l}),t[11]=i,t[12]=a,t[13]=c):c=t[13],c},PM=()=>{const t=X.c(18),e=$e(_o).state;let n,o,r,s,i,a,l;return t[0]!==e?(n=rm(e.toLowerCase()),t[0]=e,t[1]=n):n=t[1],t[2]!==e?(o=e===en.OPEN&&h.jsx(lp,{className:"w-4 h-4"}),t[2]=e,t[3]=o):o=t[3],t[4]!==e?(r=e===en.CLOSED&&h.jsx(tp,{className:"w-4 h-4"}),t[4]=e,t[5]=r):r=t[5],t[6]!==e?(s=e===en.CONNECTING&&h.jsx(eo,{size:"small"}),t[6]=e,t[7]=s):s=t[7],t[8]!==e?(i=e===en.CLOSING&&h.jsx(eo,{className:"text-destructive",size:"small"}),t[8]=e,t[9]=i):i=t[9],t[10]!==o||t[11]!==r||t[12]!==s||t[13]!==i?(a=h.jsxs("div",{className:"px-2",children:[o,r,s,i]}),t[10]=o,t[11]=r,t[12]=s,t[13]=i,t[14]=a):a=t[14],t[15]!==n||t[16]!==a?(l=h.jsx(Oe,{delayDuration:200,content:n,children:a}),t[15]=n,t[16]=a,t[17]=l):l=t[17],l},LM=t=>{const e=X.c(3);let n,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=h.jsx("path",{d:"M205.28 31.36c14.096 14.88 20.016 35.2 22.512 63.68c6.626 0 12.805 1.47 16.976 7.152l7.792 10.56A17.55 17.55 0 0 1 256 123.2v28.688c-.008 3.704-1.843 7.315-4.832 9.504C215.885 187.222 172.35 208 128 208c-49.066 0-98.19-28.273-123.168-46.608c-2.989-2.189-4.825-5.8-4.832-9.504V123.2c0-3.776 1.2-7.424 3.424-10.464l7.792-10.544c4.173-5.657 10.38-7.152 16.992-7.152c2.496-28.48 8.4-48.8 22.512-63.68C77.331 3.165 112.567.06 127.552 0H128c14.72 0 50.4 2.88 77.28 31.36m-77.264 47.376c-3.04 0-6.544.176-10.272.544c-1.312 4.896-3.248 9.312-6.08 12.128c-11.2 11.2-24.704 12.928-31.936 12.928c-6.802 0-13.927-1.42-19.744-5.088c-5.502 1.808-10.786 4.415-11.136 10.912c-.586 12.28-.637 24.55-.688 36.824c-.026 6.16-.05 12.322-.144 18.488c.024 3.579 2.182 6.903 5.44 8.384C79.936 185.92 104.976 192 128.016 192c23.008 0 48.048-6.08 74.512-18.144c3.258-1.48 5.415-4.805 5.44-8.384c.317-18.418.062-36.912-.816-55.312h.016c-.342-6.534-5.648-9.098-11.168-10.912c-5.82 3.652-12.927 5.088-19.728 5.088c-7.232 0-20.72-1.728-31.936-12.928c-2.832-2.816-4.768-7.232-6.08-12.128a106 106 0 0 0-10.24-.544m-26.941 43.93c5.748 0 10.408 4.66 10.408 10.409v19.183c0 5.749-4.66 10.409-10.408 10.409s-10.408-4.66-10.408-10.409v-19.183c0-5.748 4.66-10.408 10.408-10.408m53.333 0c5.749 0 10.409 4.66 10.409 10.409v19.183c0 5.749-4.66 10.409-10.409 10.409c-5.748 0-10.408-4.66-10.408-10.409v-19.183c0-5.748 4.66-10.408 10.408-10.408M81.44 28.32c-11.2 1.12-20.64 4.8-25.44 9.92c-10.4 11.36-8.16 40.16-2.24 46.24c4.32 4.32 12.48 7.2 21.28 7.2c6.72 0 19.52-1.44 30.08-12.16c4.64-4.48 7.52-15.68 7.2-27.04c-.32-9.12-2.88-16.64-6.72-19.84c-4.16-3.68-13.6-5.28-24.16-4.32m68.96 4.32c-3.84 3.2-6.4 10.72-6.72 19.84c-.32 11.36 2.56 22.56 7.2 27.04c10.56 10.72 23.36 12.16 30.08 12.16c8.8 0 16.96-2.88 21.28-7.2c5.92-6.08 8.16-34.88-2.24-46.24c-4.8-5.12-14.24-8.8-25.44-9.92c-10.56-.96-20 .64-24.16 4.32M128 56c-2.56 0-5.6.16-8.96.48c.32 1.76.48 3.68.64 5.76c0 1.44 0 2.88-.16 4.48c3.2-.32 5.92-.32 8.48-.32s5.28 0 8.48.32c-.16-1.6-.16-3.04-.16-4.48c.16-2.08.32-4 .64-5.76c-3.36-.32-6.4-.48-8.96-.48"}),e[0]=n):n=e[0],e[1]!==t?(o=h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.24em",height:"1em",viewBox:"0 0 256 208",fill:"currentColor",...t,children:n}),e[1]=t,e[2]=o):o=e[2],o},FM=Ut(t=>t(WU).completion.copilot),zM=()=>{const t=X.c(1);if($e(FM)==="github"){let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(BM,{}),t[0]=e):e=t[0],e}return null},Rx=Qt.get("[copilot-status-bar]"),BM=()=>{const t=$e(dS),e=$e(w$)!==null,{handleClick:n}=xa(),o=()=>n("ai"),r=t?"Ready":"Not connected",s=Gt(dS),i=Gt(v$);return $4(()=>{const a=cS();let l=!0;return(async()=>{try{if(await a.initializePromise.catch(d=>{throw Rx.error("Failed to initialize",d),a.close(),d}),!l)return;const c=await a.signedIn();if(!l)return;s(c),i(c?"signedIn":"signedOut")}catch(c){if(!l)return;Rx.warn("Connection failed",c),s(!1),i("connectionError"),lt({title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Check settings and try again.",variant:"danger",action:h.jsx(Ae,{variant:"link",onClick:o,children:"Settings"})})}})(),()=>{l=!1}}),h.jsx(io,{tooltip:h.jsxs(h.Fragment,{children:[h.jsx("b",{children:"GitHub Copilot:"})," ",r]}),selected:!1,onClick:o,children:h.jsx("span",{children:e?h.jsx(eo,{className:"h-4 w-4"}):h.jsx(LM,{className:Me("h-4 w-4",!t&&"opacity-60")})})})},UM=()=>{const t=X.c(13),e=$e(os),[n,o]=hn(T4),[r,s]=A.useState(!1);if(!_a()||e==="disabled")return null;const i=e?"Real-time collaboration active":"Connecting to real-time collaboration";let a,l,c,d,u,f;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(Zp,{className:"w-4 h-4"}),t[0]=a):a=t[0],t[1]!==i?(l=h.jsx(Js,{asChild:!0,children:h.jsx(io,{tooltip:i,selected:!1,children:a})}),t[1]=i,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsxs("div",{className:"space-y-2",children:[h.jsx("h4",{className:"font-medium leading-none",children:"Username"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Set your username for real-time collaboration"})]}),t[3]=c):c=t[3],t[4]!==o?(d=m=>o(m.target.value),t[4]=o,t[5]=d):d=t[5],t[6]!==d||t[7]!==n?(u=h.jsx($s,{className:"w-80",children:h.jsxs("div",{className:"space-y-4",children:[c,h.jsx(ur,{value:n,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",onChange:d,placeholder:"Enter your username"})]})}),t[6]=d,t[7]=n,t[8]=u):u=t[8],t[9]!==r||t[10]!==l||t[11]!==u?(f=h.jsxs(Mr,{open:r,onOpenChange:s,children:[l,u]}),t[9]=r,t[10]=l,t[11]=u,t[12]=f):f=t[12],f},VM=()=>{const t=X.c(56),{selectedPanel:e,isTerminalOpen:n}=gc(),{toggleApplication:o,toggleTerminal:r}=Bs(),[s,i]=Ds(),a=$e(qU),l=$M,c=fd.find(HM);let d;zo(c,"Error panel not found"),t[0]!==r?(d=()=>{r()},t[0]=r,t[1]=d):d=t[1],Yt("global.toggleTerminal",d);const u=io,f=c.tooltip,m=e===c.type,_=()=>o(c.type),g=l(c,a>0?"text-destructive":"");let p,b,x,y,v;t[2]!==a?(p=h.jsx("span",{className:"ml-1 font-mono mt-[0.125rem]",children:a}),t[2]=a,t[3]=p):p=t[3],t[4]!==u||t[5]!==c||t[6]!==m||t[7]!==_||t[8]!==g||t[9]!==p?(b=h.jsxs(u,{tooltip:f,selected:m,onClick:_,children:[g,p]}),t[4]=u,t[5]=c,t[6]=m,t[7]=_,t[8]=g,t[9]=p,t[10]=b):b=t[10],t[11]!==r?(x=()=>r(),t[11]=r,t[12]=x):x=t[12],t[13]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(Kp,{className:"h-5 w-5"}),t[13]=y):y=t[13],t[14]!==n||t[15]!==x?(v=h.jsx(Dx,{capability:"terminal",children:h.jsx(io,{tooltip:"Open terminal",selected:n,onClick:x,children:y})}),t[14]=n,t[15]=x,t[16]=v):v=t[16];const S=s.runtime.auto_instantiate?"Disable autorun on startup":"Enable autorun on startup";let k,j,E;t[17]!==s||t[18]!==i?(k=async()=>{const q={...s,runtime:{...s.runtime,auto_instantiate:!s.runtime.auto_instantiate}};await Rs({config:q}).then(()=>i(q))},t[17]=s,t[18]=i,t[19]=k):k=t[19],t[20]===Symbol.for("react.memo_cache_sentinel")?(j=h.jsx("span",{children:"on startup: "}),t[20]=j):j=t[20],t[21]!==s.runtime.auto_instantiate?(E=s.runtime.auto_instantiate?h.jsx(br,{size:14}):h.jsx(_r,{size:14}),t[21]=s.runtime.auto_instantiate,t[22]=E):E=t[22];const I=s.runtime.auto_instantiate?"autorun":"lazy";let T,M,R,B;t[23]!==I?(T=h.jsx("span",{children:I}),t[23]=I,t[24]=T):T=t[24],t[25]!==E||t[26]!==T?(M=h.jsxs("div",{className:"font-prose text-sm flex items-center gap-1",children:[j,E,T]}),t[25]=E,t[26]=T,t[27]=M):M=t[27],t[28]!==S||t[29]!==k||t[30]!==M?(R=h.jsx(io,{tooltip:S,selected:!1,onClick:k,children:M}),t[28]=S,t[29]=k,t[30]=M,t[31]=R):R=t[31],t[32]===Symbol.for("react.memo_cache_sentinel")?(B=h.jsx("div",{className:"border-r border-border h-6 mx-1"}),t[32]=B):B=t[32];const O=s.runtime.on_cell_change==="autorun"?"Disable autorun":"Enable autorun";let z,F,V,L,C,$,N,H,Y,Z;return t[33]!==s||t[34]!==i?(z=async()=>{const q={...s,runtime:{...s.runtime,on_cell_change:s.runtime.on_cell_change==="autorun"?"lazy":"autorun"}};await Rs({config:q}).then(()=>i(q))},t[33]=s,t[34]=i,t[35]=z):z=t[35],t[36]===Symbol.for("react.memo_cache_sentinel")?(F=h.jsx("span",{children:"on cell change: "}),t[36]=F):F=t[36],t[37]!==s.runtime.on_cell_change?(V=h.jsxs("div",{className:"font-prose text-sm flex items-center gap-1",children:[F,s.runtime.on_cell_change==="autorun"?h.jsx(br,{size:14}):h.jsx(_r,{size:14}),h.jsx("span",{children:s.runtime.on_cell_change})]}),t[37]=s.runtime.on_cell_change,t[38]=V):V=t[38],t[39]!==O||t[40]!==z||t[41]!==V?(L=h.jsx(io,{tooltip:O,selected:!1,onClick:z,children:V}),t[39]=O,t[40]=z,t[41]=V,t[42]=L):L=t[42],t[43]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx("div",{className:"border-r border-border h-6 mx-1"}),t[43]=C):C=t[43],t[44]!==s||t[45]!==i?($=!Jn()&&h.jsx(io,{tooltip:null,selected:!1,children:h.jsxs(hc,{children:[h.jsxs(fc,{className:"font-prose text-sm flex items-center gap-1",children:[h.jsx("span",{children:"on module change: "}),s.runtime.auto_reload==="off"&&h.jsx(tp,{size:14}),s.runtime.auto_reload==="lazy"&&h.jsx(_r,{size:14}),s.runtime.auto_reload==="autorun"&&h.jsx(br,{size:14}),h.jsx("span",{children:s.runtime.auto_reload}),h.jsx(ea,{size:14})]}),h.jsx(mc,{children:["off","lazy","autorun"].map(q=>h.jsxs(sn,{onClick:async()=>{const re={...s,runtime:{...s.runtime,auto_reload:q}};await Rs({config:re}).then(()=>i(re))},children:[q==="off"&&h.jsx(tp,{size:14,className:"mr-2 text-muted-foreground"}),q==="lazy"&&h.jsx(_r,{size:14,className:"mr-2 text-muted-foreground"}),q==="autorun"&&h.jsx(br,{size:14,className:"mr-2 text-muted-foreground"}),q]},q))})]})}),t[44]=s,t[45]=i,t[46]=$):$=t[46],t[47]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx("div",{className:"mx-auto"}),t[47]=N):N=t[47],t[48]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx(lN,{children:h.jsx(Oe,{content:h.jsx("div",{className:"w-[200px]",children:"Kiosk mode is enabled. This allows you to view the outputs of the cells without the ability to edit them."}),children:h.jsx("span",{className:"text-muted-foreground text-sm mr-4",children:"kiosk mode"})})}),t[48]=H):H=t[48],t[49]===Symbol.for("react.memo_cache_sentinel")?(Y=h.jsxs("div",{className:"flex items-center",children:[h.jsx(EM,{}),h.jsx(RM,{}),h.jsx(zM,{}),h.jsx(UM,{}),h.jsx(PM,{})]}),t[49]=Y):Y=t[49],t[50]!==v||t[51]!==R||t[52]!==L||t[53]!==$||t[54]!==b?(Z=h.jsxs("footer",{className:"h-10 py-2 bg-background flex items-center text-muted-foreground text-md px-1 border-t border-border select-none no-print text-sm shadow-[0_0_4px_1px_rgba(0,0,0,0.1)] z-50 print:hidden hide-on-fullscreen",children:[b,v,R,B,L,C,$,N,H,Y]}),t[50]=v,t[51]=R,t[52]=L,t[53]=$,t[54]=b,t[55]=Z):Z=t[55],Z};function $M(t,e){const{Icon:n}=t;return h.jsx(n,{className:Me("h-5 w-5",e)})}function HM(t){return t.type==="errors"}const WM=t=>{const e=X.c(6),{children:n}=t,{openModal:o,closeModal:r}=Un();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(h.jsx(qM,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=h.jsx(H4,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},qM=t=>{const e=X.c(9),{onClose:n}=t;let o,r,s,i,a,l,c;return e[0]!==n?(o=async d=>{d.preventDefault();const u=new FormData(d.target),f=u.get("rating"),m=u.get("message");fetch("https://marimo.io/api/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rating:f,message:m})}),n(),lt({title:"Feedback sent!",description:"Thank you for your feedback!"})},e[0]=n,e[1]=o):o=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(dr,{children:"Send Feedback"}),e[2]=r):r=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx("p",{className:"my-2 prose dark:prose-invert",children:"We want to hear from you \u2014 from minor bug reports to wishlist features and everything in between. Here are some ways you can get in touch:"}),e[3]=s):s=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsxs("li",{className:"my-0",children:["Take our"," ",h.jsx("a",{href:Kn.feedbackForm,target:"_blank",className:"underline",children:"two-minute survey."})]}),e[4]=i):i=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsxs("li",{className:"my-0",children:["File a"," ",h.jsx("a",{href:Kn.issuesPage,target:"_blank",className:"underline",children:"GitHub issue."})]}),e[5]=a):a=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsxs(Os,{children:[r,h.jsxs(Ps,{children:[s,h.jsxs("ul",{className:"list-disc ml-8 my-2 prose dark:prose-invert",children:[i,a,h.jsxs("li",{className:"my-0",children:["Chat with us on"," ",h.jsx("a",{href:Kn.discordLink,target:"_blank",className:"underline",children:"Discord."})]})]}),h.jsx("p",{className:"my-2 prose dark:prose-invert",children:"We're excited you're here as we build the future of Python data tooling. Thanks for being part of our community!"})]})]}),e[6]=l):l=e[6],e[7]!==o?(c=h.jsx(cr,{className:"w-fit",children:h.jsx("form",{onSubmit:o,children:l})}),e[7]=o,e[8]=c):c=e[8],c},GM=()=>{const t=X.c(10),{selectedPanel:e}=gc(),{toggleApplication:n}=Bs(),o=JM;let r,s,i,a,l,c;return t[0]!==e||t[1]!==n?(r="h-full pt-4 pb-1 px-1 flex flex-col items-start text-muted-foreground text-md select-none no-print text-sm z-50 dark:bg-background print:hidden hide-on-fullscreen",s=fd.filter(KM).map(d=>h.jsx(Px,{tooltip:d.tooltip,selected:e===d.type,onClick:()=>n(d.type),children:o(d)},d.type)),t[0]=e,t[1]=n,t[2]=r,t[3]=s):(r=t[2],s=t[3]),t[4]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(WM,{children:h.jsx(Px,{tooltip:"Send feedback!",selected:!1,children:h.jsx(Op,{className:"h-5 w-5"})})}),a=h.jsx("div",{className:"flex-1"}),l=h.jsx(YM,{}),t[4]=i,t[5]=a,t[6]=l):(i=t[4],a=t[5],l=t[6]),t[7]!==r||t[8]!==s?(c=h.jsxs("div",{className:r,children:[s,i,a,l]}),t[7]=r,t[8]=s,t[9]=c):c=t[9],c},YM=()=>{const t=X.c(7),e=$e(GU);let n,o,r;return t[0]!==e?(n=e>0?h.jsxs("span",{children:[e," cell",e>1?"s":""," queued or running"]}):"No cells queued or running",t[0]=e,t[1]=n):n=t[1],t[2]!==e?(o=h.jsx("div",{className:"flex flex-col-reverse gap-[1px] overflow-hidden",children:Array.from({length:e}).map(XM)}),t[2]=e,t[3]=o):o=t[3],t[4]!==n||t[5]!==o?(r=h.jsx(Oe,{content:n,side:"right",delayDuration:200,children:o}),t[4]=n,t[5]=o,t[6]=r):r=t[6],r},Px=t=>{const e=X.c(17);let n,o,r,s,i;e[0]!==t?({children:n,tooltip:i,selected:s,className:o,...r}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=s,e[5]=i):(n=e[1],o=e[2],r=e[3],s=e[4],i=e[5]);const a=!s&&"hover:bg-[var(--sage-3)]",l=s&&"bg-[var(--sage-4)]";let c,d,u;return e[6]!==o||e[7]!==a||e[8]!==l?(c=Me("flex items-center p-2 text-sm mx-[1px] shadow-inset font-mono cursor-pointer rounded",a,l,o),e[6]=o,e[7]=a,e[8]=l,e[9]=c):c=e[9],e[10]!==n||e[11]!==r||e[12]!==c?(d=h.jsx("div",{className:c,...r,children:n}),e[10]=n,e[11]=r,e[12]=c,e[13]=d):d=e[13],e[14]!==d||e[15]!==i?(u=h.jsx(Oe,{content:i,side:"right",delayDuration:200,children:d}),e[14]=d,e[15]=i,e[16]=u):u=e[16],u};function JM(t,e){const{Icon:n}=t;return h.jsx(n,{className:Me("h-5 w-5",e)})}function KM(t){return!t.hidden&&t.position==="sidebar"}function XM(t,e){return h.jsx("div",{className:"flex-shrink-0 h-1 w-2 bg-[var(--grass-6)] border border-[var(--grass-7)]"},e.toString())}Te.record(Te.tuple([Te.number(),Te.number()]));let Wu=null,Lx;An=t=>{const e=X.c(15),{title:n,description:o,icon:r,action:s}=t;let i,a,l,c,d,u;return e[0]!==r?(i=r&&K.cloneElement(r,{className:"text-accent-foreground"}),e[0]=r,e[1]=i):i=e[1],e[2]!==n?(a=h.jsx("span",{className:"mt-1 text-accent-foreground",children:n}),e[2]=n,e[3]=a):a=e[3],e[4]!==i||e[5]!==a?(l=h.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[i,a]}),e[4]=i,e[5]=a,e[6]=l):l=e[6],e[7]!==o?(c=h.jsx("span",{className:"text-muted-foreground text-sm",children:o}),e[7]=o,e[8]=c):c=e[8],e[9]!==s?(d=s&&h.jsx("div",{className:"mt-2",children:s}),e[9]=s,e[10]=d):d=e[10],e[11]!==l||e[12]!==c||e[13]!==d?(u=h.jsxs("div",{className:"mx-6 my-6 flex flex-col gap-2",children:[l,c,d]}),e[11]=l,e[12]=c,e[13]=d,e[14]=u):u=e[14],u},Lx=()=>{const t=X.c(5),e=YU();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(An,{title:"No errors!",icon:h.jsx(Fp,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(ZM),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=h.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function ZM(t){return h.jsxs("div",{children:[h.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:h.jsx(JU,{cellId:t.cellId})}),h.jsx("div",{className:"px-2",children:h.jsx(KU,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}const QM=()=>{const t=X.c(6),{items:e}=$e(XU);let n,o;t[0]!==e?(o=U$(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s}=V$(r);if(e.length===0){let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(An,{title:"No outline",description:"Add markdown headings to your notebook to create an outline.",icon:h.jsx(od,{})}),t[2]=a):a=t[2],a}let i;return t[3]!==s||t[4]!==e?(i=h.jsx($$,{items:e,activeHeaderId:s}),t[3]=s,t[4]=e,t[5]=i):i=t[5],i};function dn(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n,o=0;o<t.length;o++)(n=dn(t[o]))!==""&&(e+=(e&&" ")+n);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}const{useDebugValue:eO}=K,{useSyncExternalStoreWithSelector:tO}=ZU,nO=t=>t;function Fx(t,e=nO,n){const o=tO(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return eO(o),o}const zx=(t,e)=>{const n=QU(t),o=(r,s=e)=>Fx(n,r,s);return Object.assign(o,n),o};function nn(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[o,r]of t)if(!Object.is(r,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||!Object.is(t[o],e[o]))return!1;return!0}function ao(t,e){if(t=function(s){let i;for(;i=s.sourceEvent;)s=i;return s}(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,[(o=o.matrixTransform(e.getScreenCTM().inverse())).x,o.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const oO={passive:!1},Ri={capture:!0,passive:!1};function qu(t){t.stopImmediatePropagation()}function ss(t){t.preventDefault(),t.stopImmediatePropagation()}function Bx(t){var e=t.document.documentElement,n=to(t).on("dragstart.drag",ss,Ri);"onselectstart"in e?n.on("selectstart.drag",ss,Ri):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Ux(t,e){var n=t.document.documentElement,o=to(t).on("dragstart.drag",null);e&&(o.on("click.drag",ss,Ri),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const jl=t=>()=>t;function Gu(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:s,x:i,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}function rO(t){return!t.ctrlKey&&!t.button}function sO(){return this.parentNode}function iO(t,e){return e??{x:t.x,y:t.y}}function aO(){return navigator.maxTouchPoints||"ontouchstart"in this}Gu.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};const El=t=>()=>t;function lO(t,{sourceEvent:e,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Yu(t){t.stopImmediatePropagation()}function Pi(t){t.preventDefault(),t.stopImmediatePropagation()}function cO(t){return!(t.ctrlKey&&t.type!=="wheel"||t.button)}function dO(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Vx(){return this.__zoom||gr}function uO(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function hO(){return navigator.maxTouchPoints||"ontouchstart"in this}function fO(t,e,n){var o=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],i=t.invertY(e[1][1])-n[1][1];return t.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}const Il=A.createContext(null),mO=Il.Provider,pO=t=>`Node type "${t}" not found. Using fallback type "default".`,gO=()=>"The React Flow parent container needs a width and a height to render the graph.",_O=()=>"Only child nodes can use a parent extent.",bO=t=>`Marker type "${t}" doesn't exist.`,yO=(t,e)=>`Couldn't create edge for ${t?"target":"source"} handle id: "${t?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,xO=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",wO=t=>`Edge type "${t}" not found. Using fallback type "default".`,vO=t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,$x="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function mt(t,e){const n=A.useContext(Il);if(n===null)throw new Error($x);return Fx(n,t,e)}const qt=()=>{const t=A.useContext(Il);if(t===null)throw new Error($x);return A.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},kO=t=>t.userSelectionActive?"none":"all";function Al({position:t,children:e,className:n,style:o,...r}){const s=mt(kO),i=`${t}`.split("-");return K.createElement("div",{className:dn(["react-flow__panel",n,...i]),style:{...o,pointerEvents:s},...r},e)}function SO({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:K.createElement(Al,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},K.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var CO=A.memo(({x:t,y:e,label:n,labelStyle:o={},labelShowBg:r=!0,labelBgStyle:s={},labelBgPadding:i=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d})=>{const u=A.useRef(null),[f,m]=A.useState({x:0,y:0,width:0,height:0}),_=dn(["react-flow__edge-textwrapper",c]);return A.useEffect(()=>{if(u.current){const g=u.current.getBBox();m({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n!==void 0&&n?K.createElement("g",{transform:`translate(${t-f.width/2} ${e-f.height/2})`,className:_,visibility:f.width?"visible":"hidden",...d},r&&K.createElement("rect",{width:f.width+2*i[0],x:-i[0],y:-i[1],height:f.height+2*i[1],className:"react-flow__edge-textbg",style:s,rx:a,ry:a}),K.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:u,style:o},n),l):null});const Ju=t=>({width:t.offsetWidth,height:t.offsetHeight}),is=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Ku=(t={x:0,y:0},e)=>({x:is(t.x,e[0][0],e[1][0]),y:is(t.y,e[0][1],e[1][1])}),Hx=(t,e,n)=>t<e?is(Math.abs(t-e),1,50)/50:t>n?-is(Math.abs(t-n),1,50)/50:0,Wx=(t,e)=>[20*Hx(t.x,35,e.width-35),20*Hx(t.y,35,e.height-35)],qx=t=>{var e;return((e=t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},Xu=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),Gx=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),Zu=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)},Pn=t=>!isNaN(t)&&isFinite(t),Ct=Symbol.for("internals"),Yx=["Enter"," ","Escape"];function Qu(t){var o,r;const e=(s=>"nativeEvent"in s)(t)?t.nativeEvent:t,n=((r=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:r[0])||t.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const Jx=t=>"clientX"in t,Qo=(t,e)=>{var s,i;const n=Jx(t),o=n?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,r=n?t.clientY:(i=t.touches)==null?void 0:i[0].clientY;return{x:o-((e==null?void 0:e.left)??0),y:r-((e==null?void 0:e.top)??0)}},Tl=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0},Li=({id:t,path:e,labelX:n,labelY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:f,interactionWidth:m=20})=>K.createElement(K.Fragment,null,K.createElement("path",{id:t,style:d,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:u,markerStart:f}),m&&K.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}),r&&Pn(n)&&Pn(o)?K.createElement(CO,{x:n,y:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null);function Fi(t,e,n){return n===void 0?n:o=>{const r=e().edges.find(s=>s.id===t);r&&n(o,{...r})}}function Kx({sourceX:t,sourceY:e,targetX:n,targetY:o}){const r=Math.abs(n-t)/2,s=n<t?n+r:n-r,i=Math.abs(o-e)/2;return[s,o<e?o+i:o-i,r,i]}function Xx({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:r,sourceControlY:s,targetControlX:i,targetControlY:a}){const l=.125*t+.375*r+.375*i+.125*n,c=.125*e+.375*s+.375*a+.125*o;return[l,c,Math.abs(l-t),Math.abs(c-e)]}var Cr,Zx,er,eh,zi,Qx,tr,Bi,as,ew,Ve,Ml;function tw({pos:t,x1:e,y1:n,x2:o,y2:r}){return t===Ve.Left||t===Ve.Right?[.5*(e+o),n]:[e,.5*(n+r)]}function nw({sourceX:t,sourceY:e,sourcePosition:n=Ve.Bottom,targetX:o,targetY:r,targetPosition:s=Ve.Top}){const[i,a]=tw({pos:n,x1:t,y1:e,x2:o,y2:r}),[l,c]=tw({pos:s,x1:o,y1:r,x2:t,y2:e}),[d,u,f,m]=Xx({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${t},${e} C${i},${a} ${l},${c} ${o},${r}`,d,u,f,m]}Li.displayName="BaseEdge",(Zx=Cr||(Cr={})).Strict="strict",Zx.Loose="loose",(eh=er||(er={})).Free="free",eh.Vertical="vertical",eh.Horizontal="horizontal",(Qx=zi||(zi={})).Partial="partial",Qx.Full="full",(Bi=tr||(tr={})).Bezier="default",Bi.Straight="straight",Bi.Step="step",Bi.SmoothStep="smoothstep",Bi.SimpleBezier="simplebezier",(ew=as||(as={})).Arrow="arrow",ew.ArrowClosed="arrowclosed",(Ml=Ve||(Ve={})).Left="left",Ml.Top="top",Ml.Right="right",Ml.Bottom="bottom";const th=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Ve.Bottom,targetPosition:s=Ve.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,markerEnd:m,markerStart:_,interactionWidth:g})=>{const[p,b,x]=nw({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s});return K.createElement(Li,{path:p,labelX:b,labelY:x,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,markerEnd:m,markerStart:_,interactionWidth:g})});th.displayName="SimpleBezierEdge";const ow={[Ve.Left]:{x:-1,y:0},[Ve.Right]:{x:1,y:0},[Ve.Top]:{x:0,y:-1},[Ve.Bottom]:{x:0,y:1}},rw=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function NO({source:t,sourcePosition:e=Ve.Bottom,target:n,targetPosition:o=Ve.Top,center:r,offset:s}){const i=ow[e],a=ow[o],l={x:t.x+i.x*s,y:t.y+i.y*s},c={x:n.x+a.x*s,y:n.y+a.y*s},d=(({source:k,sourcePosition:j=Ve.Bottom,target:E})=>j===Ve.Left||j===Ve.Right?k.x<E.x?{x:1,y:0}:{x:-1,y:0}:k.y<E.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:e,target:c}),u=d.x!==0?"x":"y",f=d[u];let m,_,g=[];const p={x:0,y:0},b={x:0,y:0},[x,y,v,S]=Kx({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(i[u]*a[u]==-1){m=r.x??x,_=r.y??y;const k=[{x:m,y:l.y},{x:m,y:c.y}],j=[{x:l.x,y:_},{x:c.x,y:_}];g=i[u]===f?u==="x"?k:j:u==="x"?j:k}else{const k=[{x:l.x,y:c.y}],j=[{x:c.x,y:l.y}];if(g=u==="x"?i.x===f?j:k:i.y===f?k:j,e===o){const T=Math.abs(t[u]-n[u]);if(T<=s){const M=Math.min(s-1,s-T);i[u]===f?p[u]=(l[u]>t[u]?-1:1)*M:b[u]=(c[u]>n[u]?-1:1)*M}}if(e!==o){const T=u==="x"?"y":"x",M=i[u]===a[T],R=l[T]>c[T],B=l[T]<c[T];(i[u]===1&&(!M&&R||M&&B)||i[u]!==1&&(!M&&B||M&&R))&&(g=u==="x"?k:j)}const E={x:l.x+p.x,y:l.y+p.y},I={x:c.x+b.x,y:c.y+b.y};Math.max(Math.abs(E.x-g[0].x),Math.abs(I.x-g[0].x))>=Math.max(Math.abs(E.y-g[0].y),Math.abs(I.y-g[0].y))?(m=(E.x+I.x)/2,_=g[0].y):(m=g[0].x,_=(E.y+I.y)/2)}return[[t,{x:l.x+p.x,y:l.y+p.y},...g,{x:c.x+b.x,y:c.y+b.y},n],m,_,v,S]}function nh({sourceX:t,sourceY:e,sourcePosition:n=Ve.Bottom,targetX:o,targetY:r,targetPosition:s=Ve.Top,borderRadius:i=5,centerX:a,centerY:l,offset:c=20}){const[d,u,f,m,_]=NO({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:r},targetPosition:s,center:{x:a,y:l},offset:c});return[d.reduce((g,p,b)=>{let x="";return x=b>0&&b<d.length-1?function(y,v,S,k){const j=Math.min(rw(y,v)/2,rw(v,S)/2,k),{x:E,y:I}=v;if(y.x===E&&E===S.x||y.y===I&&I===S.y)return`L${E} ${I}`;if(y.y===I)return`L ${E+j*(y.x<S.x?-1:1)},${I}Q ${E},${I} ${E},${I+j*(y.y<S.y?1:-1)}`;const T=y.x<S.x?1:-1;return`L ${E},${I+j*(y.y<S.y?-1:1)}Q ${E},${I} ${E+j*T},${I}`}(d[b-1],p,d[b+1],i):`${b===0?"M":"L"}${p.x} ${p.y}`,g+=x},""),u,f,m,_]}const Ol=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,sourcePosition:u=Ve.Bottom,targetPosition:f=Ve.Top,markerEnd:m,markerStart:_,pathOptions:g,interactionWidth:p})=>{const[b,x,y]=nh({sourceX:t,sourceY:e,sourcePosition:u,targetX:n,targetY:o,targetPosition:f,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset});return K.createElement(Li,{path:b,labelX:x,labelY:y,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:m,markerStart:_,interactionWidth:p})});Ol.displayName="SmoothStepEdge";const oh=A.memo(t=>{var e;return K.createElement(Ol,{...t,pathOptions:A.useMemo(()=>{var n;return{borderRadius:0,offset:(n=t.pathOptions)==null?void 0:n.offset}},[(e=t.pathOptions)==null?void 0:e.offset])})});oh.displayName="StepEdge";const rh=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:f,interactionWidth:m})=>{const[_,g,p]=function({sourceX:b,sourceY:x,targetX:y,targetY:v}){const[S,k,j,E]=Kx({sourceX:b,sourceY:x,targetX:y,targetY:v});return[`M ${b},${x}L ${y},${v}`,S,k,j,E]}({sourceX:t,sourceY:e,targetX:n,targetY:o});return K.createElement(Li,{path:_,labelX:g,labelY:p,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:u,markerStart:f,interactionWidth:m})});function Dl(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function sw({pos:t,x1:e,y1:n,x2:o,y2:r,c:s}){switch(t){case Ve.Left:return[e-Dl(e-o,s),n];case Ve.Right:return[e+Dl(o-e,s),n];case Ve.Top:return[e,n-Dl(n-r,s)];case Ve.Bottom:return[e,n+Dl(r-n,s)]}}function iw({sourceX:t,sourceY:e,sourcePosition:n=Ve.Bottom,targetX:o,targetY:r,targetPosition:s=Ve.Top,curvature:i=.25}){const[a,l]=sw({pos:n,x1:t,y1:e,x2:o,y2:r,c:i}),[c,d]=sw({pos:s,x1:o,y1:r,x2:t,y2:e,c:i}),[u,f,m,_]=Xx({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${t},${e} C${a},${l} ${c},${d} ${o},${r}`,u,f,m,_]}rh.displayName="StraightEdge";const Rl=A.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Ve.Bottom,targetPosition:s=Ve.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,markerEnd:m,markerStart:_,pathOptions:g,interactionWidth:p})=>{const[b,x,y]=iw({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s,curvature:g==null?void 0:g.curvature});return K.createElement(Li,{path:b,labelX:x,labelY:y,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:f,markerEnd:m,markerStart:_,interactionWidth:p})});Rl.displayName="BezierEdge";const sh=A.createContext(null),jO=sh.Provider;sh.Consumer;const EO=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`reactflow__edge-${t}${e||""}-${n}${o||""}`,ih=(t,e)=>t===void 0?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`,ah=({x:t,y:e},[n,o,r],s,[i,a])=>{const l={x:(t-n)/r,y:(e-o)/r};return s?{x:i*Math.round(l.x/i),y:a*Math.round(l.y/a)}:l},aw=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o}),ls=(t,e=[0,0])=>{if(!t)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(t.width??0)*e[0],o=(t.height??0)*e[1],r={x:t.position.x-n,y:t.position.y-o};return{...r,positionAbsolute:t.positionAbsolute?{x:t.positionAbsolute.x-n,y:t.positionAbsolute.y-o}:r}},lh=(t,e=[0,0])=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((o,r)=>{const{x:s,y:i}=ls(r,e).positionAbsolute;return a=o,l=Xu({x:s,y:i,width:r.width||0,height:r.height||0}),{x:Math.min(a.x,l.x),y:Math.min(a.y,l.y),x2:Math.max(a.x2,l.x2),y2:Math.max(a.y2,l.y2)};var a,l},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:o,y:r,x2:s,y2:i})=>({x:o,y:r,width:s-o,height:i-r}))(n)},lw=(t,e,[n,o,r]=[0,0,1],s=!1,i=!1,a=[0,0])=>{const l={x:(e.x-n)/r,y:(e.y-o)/r,width:e.width/r,height:e.height/r},c=[];return t.forEach(d=>{const{width:u,height:f,selectable:m=!0,hidden:_=!1}=d;if(i&&!m||_)return!1;const{positionAbsolute:g}=ls(d,a),p={x:g.x,y:g.y,width:u||0,height:f||0},b=Zu(l,p);(u===void 0||f===void 0||u===null||f===null||s&&b>0||b>=(u||0)*(f||0)||d.dragging)&&c.push(d)}),c},cw=(t,e)=>{const n=t.map(o=>o.id);return e.filter(o=>n.includes(o.source)||n.includes(o.target))},dw=(t,e,n,o,r,s=.1)=>{const i=e/(t.width*(1+s)),a=n/(t.height*(1+s)),l=Math.min(i,a),c=is(l,o,r);return{x:e/2-(t.x+t.width/2)*c,y:n/2-(t.y+t.height/2)*c,zoom:c}},Nr=(t,e=0)=>t.transition().duration(e);function uw(t,e,n,o){return(e[n]||[]).reduce((r,s)=>{var i,a;return`${t.id}-${s.id}-${n}`!==o&&r.push({id:s.id||null,type:n,nodeId:t.id,x:(((i=t.positionAbsolute)==null?void 0:i.x)??0)+s.x+s.width/2,y:(((a=t.positionAbsolute)==null?void 0:a.y)??0)+s.y+s.height/2}),r},[])}const IO={source:null,target:null,sourceHandle:null,targetHandle:null},hw=()=>({handleDomNode:null,isValid:!1,connection:IO,endHandle:null});function fw(t,e,n,o,r,s,i){const a=r==="target",l=i.querySelector(`.react-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),c={...hw(),handleDomNode:l};if(l){const d=ch(void 0,l),u=l.getAttribute("data-nodeid"),f=l.getAttribute("data-handleid"),m=l.classList.contains("connectable"),_=l.classList.contains("connectableend"),g={source:a?u:n,sourceHandle:a?f:o,target:a?n:u,targetHandle:a?o:f};c.connection=g,m&&_&&(e===Cr.Strict?a&&d==="source"||!a&&d==="target":u!==n||f!==o)&&(c.endHandle={nodeId:u,handleId:f,type:d},c.isValid=s(g))}return c}function ch(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function dh(t){t==null||t.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function AO(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function mw({event:t,handleId:e,nodeId:n,onConnect:o,isTarget:r,getState:s,setState:i,isValidConnection:a,edgeUpdaterType:l,onReconnectEnd:c}){const d=qx(t.target),{connectionMode:u,domNode:f,autoPanOnConnect:m,connectionRadius:_,onConnectStart:g,panBy:p,getNodes:b,cancelConnection:x}=s();let y,v=0;const{x:S,y:k}=Qo(t),j=d==null?void 0:d.elementFromPoint(S,k),E=ch(l,j),I=f==null?void 0:f.getBoundingClientRect();if(!I||!E)return;let T,M=Qo(t,I),R=!1,B=null,O=!1,z=null;const F=function({nodes:$,nodeId:N,handleId:H,handleType:Y}){return $.reduce((Z,q)=>{if(q[Ct]){const{handleBounds:re}=q[Ct];let ne=[],oe=[];re&&(ne=uw(q,re,"source",`${N}-${H}-${Y}`),oe=uw(q,re,"target",`${N}-${H}-${Y}`)),Z.push(...ne,...oe)}return Z},[])}({nodes:b(),nodeId:n,handleId:e,handleType:E}),V=()=>{if(!m)return;const[$,N]=Wx(M,I);p({x:$,y:N}),v=requestAnimationFrame(V)};function L($){const{transform:N}=s();M=Qo($,I);const{handle:H,validHandleResult:Y}=function(Z,q,re,ne,oe,G){const{x:Q,y:le}=Qo(Z),fe=q.elementsFromPoint(Q,le).find(je=>je.classList.contains("react-flow__handle"));if(fe){const je=fe.getAttribute("data-nodeid");if(je){const ce=ch(void 0,fe),Ee=fe.getAttribute("data-handleid"),_e=G({nodeId:je,id:Ee,type:ce});if(_e){const De=oe.find(Fe=>Fe.nodeId===je&&Fe.type===ce&&Fe.id===Ee);return{handle:{id:Ee,type:ce,nodeId:je,x:(De==null?void 0:De.x)||re.x,y:(De==null?void 0:De.y)||re.y},validHandleResult:_e}}}}let de=[],he=1/0;if(oe.forEach(je=>{const ce=Math.sqrt((je.x-re.x)**2+(je.y-re.y)**2);if(ce<=ne){const Ee=G(je);ce<=he&&(ce<he?de=[{handle:je,validHandleResult:Ee}]:ce===he&&de.push({handle:je,validHandleResult:Ee}),he=ce)}}),!de.length)return{handle:null,validHandleResult:hw()};if(de.length===1)return de[0];const se=de.some(({validHandleResult:je})=>je.isValid),ye=de.some(({handle:je})=>je.type==="target");return de.find(({handle:je,validHandleResult:ce})=>ye?je.type==="target":!se||ce.isValid)||de[0]}($,d,ah(M,N,!1,[1,1]),_,F,Z=>fw(Z,u,n,e,r?"target":"source",a,d));if(y=H,R||(V(),R=!0),z=Y.handleDomNode,B=Y.connection,O=Y.isValid,i({connectionPosition:y&&O?aw({x:y.x,y:y.y},N):M,connectionStatus:AO(!!y,O),connectionEndHandle:Y.endHandle}),!y&&!O&&!z)return dh(T);B.source!==B.target&&z&&(dh(T),T=z,z.classList.add("connecting","react-flow__handle-connecting"),z.classList.toggle("valid",O),z.classList.toggle("react-flow__handle-valid",O))}function C($){var N,H;(y||z)&&B&&O&&(o==null||o(B)),(H=(N=s()).onConnectEnd)==null||H.call(N,$),l&&(c==null||c($)),dh(T),x(),cancelAnimationFrame(v),R=!1,O=!1,B=null,z=null,d.removeEventListener("mousemove",L),d.removeEventListener("mouseup",C),d.removeEventListener("touchmove",L),d.removeEventListener("touchend",C)}i({connectionPosition:M,connectionStatus:null,connectionNodeId:n,connectionHandleId:e,connectionHandleType:E,connectionStartHandle:{nodeId:n,handleId:e,type:E},connectionEndHandle:null}),g==null||g(t,{nodeId:n,handleId:e,handleType:E}),d.addEventListener("mousemove",L),d.addEventListener("mouseup",C),d.addEventListener("touchmove",L),d.addEventListener("touchend",C)}const pw=()=>!0,TO=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),gw=A.forwardRef(({type:t="source",position:e=Ve.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:i,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:u,...f},m)=>{var E,I;const _=i||null,g=t==="target",p=qt(),b=A.useContext(sh),{connectOnClick:x,noPanClassName:y}=mt(TO,nn),{connecting:v,clickConnecting:S}=mt(((T,M,R)=>B=>{const{connectionStartHandle:O,connectionEndHandle:z,connectionClickStartHandle:F}=B;return{connecting:(O==null?void 0:O.nodeId)===T&&(O==null?void 0:O.handleId)===M&&(O==null?void 0:O.type)===R||(z==null?void 0:z.nodeId)===T&&(z==null?void 0:z.handleId)===M&&(z==null?void 0:z.type)===R,clickConnecting:(F==null?void 0:F.nodeId)===T&&(F==null?void 0:F.handleId)===M&&(F==null?void 0:F.type)===R}})(b,_,t),nn);b||((I=(E=p.getState()).onError)==null||I.call(E,"010",xO()));const k=T=>{const{defaultEdgeOptions:M,onConnect:R,hasDefaultEdges:B}=p.getState(),O={...M,...T};if(B){const{edges:z,setEdges:F}=p.getState();F(((V,L)=>{if(!V.source||!V.target)return L;let C;return C=($=>"id"in $&&"source"in $&&"target"in $)(V)?{...V}:{...V,id:EO(V)},(($,N)=>N.some(H=>!(H.source!==$.source||H.target!==$.target||H.sourceHandle!==$.sourceHandle&&(H.sourceHandle||$.sourceHandle)||H.targetHandle!==$.targetHandle&&(H.targetHandle||$.targetHandle))))(C,L)?L:L.concat(C)})(O,z))}R==null||R(O),a==null||a(O)},j=T=>{if(!b)return;const M=Jx(T);r&&(M&&T.button===0||!M)&&mw({event:T,handleId:_,nodeId:b,onConnect:k,isTarget:g,getState:p.getState,setState:p.setState,isValidConnection:n||p.getState().isValidConnection||pw}),M?d==null||d(T):u==null||u(T)};return K.createElement("div",{"data-handleid":_,"data-nodeid":b,"data-handlepos":e,"data-id":`${b}-${_}-${t}`,className:dn(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",y,c,{source:!g,target:g,connectable:o,connectablestart:r,connectableend:s,connecting:S,connectionindicator:o&&(r&&!v||s&&v)}]),onMouseDown:j,onTouchStart:j,onClick:x?T=>{const{onClickConnectStart:M,onClickConnectEnd:R,connectionClickStartHandle:B,connectionMode:O,isValidConnection:z}=p.getState();if(!b||!B&&!r)return;if(!B)return M==null||M(T,{nodeId:b,handleId:_,handleType:t}),void p.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:_}});const F=qx(T.target),V=n||z||pw,{connection:L,isValid:C}=fw({nodeId:b,id:_,type:t},O,B.nodeId,B.handleId||null,B.type,V,F);C&&k(L),R==null||R(T),p.setState({connectionClickStartHandle:null})}:void 0,ref:m,...f},l)});gw.displayName="Handle";var nr=A.memo(gw);const _w=({data:t,isConnectable:e,targetPosition:n=Ve.Top,sourcePosition:o=Ve.Bottom})=>K.createElement(K.Fragment,null,K.createElement(nr,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,K.createElement(nr,{type:"source",position:o,isConnectable:e}));_w.displayName="DefaultNode";var uh=A.memo(_w);const bw=({data:t,isConnectable:e,sourcePosition:n=Ve.Bottom})=>K.createElement(K.Fragment,null,t==null?void 0:t.label,K.createElement(nr,{type:"source",position:n,isConnectable:e}));bw.displayName="InputNode";var yw=A.memo(bw);const xw=({data:t,isConnectable:e,targetPosition:n=Ve.Top})=>K.createElement(K.Fragment,null,K.createElement(nr,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label);xw.displayName="OutputNode";var ww=A.memo(xw);const hh=()=>null;hh.displayName="GroupNode";const MO=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),Pl=t=>t.id;function OO(t,e){return nn(t.selectedNodes.map(Pl),e.selectedNodes.map(Pl))&&nn(t.selectedEdges.map(Pl),e.selectedEdges.map(Pl))}const vw=A.memo(({onSelectionChange:t})=>{const e=qt(),{selectedNodes:n,selectedEdges:o}=mt(MO,OO);return A.useEffect(()=>{const r={nodes:n,edges:o};t==null||t(r),e.getState().onSelectionChange.forEach(s=>s(r))},[n,o,t]),null});vw.displayName="SelectionListener";const DO=t=>!!t.onSelectionChange;function RO({onSelectionChange:t}){const e=mt(DO);return t||e?K.createElement(vw,{onSelectionChange:t}):null}const PO=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset});function cs(t,e){A.useEffect(()=>{t!==void 0&&e(t)},[t])}function at(t,e,n){A.useEffect(()=>{e!==void 0&&n({[t]:e})},[e])}const LO=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:r,onConnectStart:s,onConnectEnd:i,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:u,edgesFocusable:f,edgesUpdatable:m,elevateNodesOnSelect:_,minZoom:g,maxZoom:p,nodeExtent:b,onNodesChange:x,onEdgesChange:y,elementsSelectable:v,connectionMode:S,snapGrid:k,snapToGrid:j,translateExtent:E,connectOnClick:I,defaultEdgeOptions:T,fitView:M,fitViewOptions:R,onNodesDelete:B,onEdgesDelete:O,onNodeDrag:z,onNodeDragStart:F,onNodeDragStop:V,onSelectionDrag:L,onSelectionDragStart:C,onSelectionDragStop:$,noPanClassName:N,nodeOrigin:H,rfId:Y,autoPanOnConnect:Z,autoPanOnNodeDrag:q,onError:re,connectionRadius:ne,isValidConnection:oe,nodeDragThreshold:G})=>{const{setNodes:Q,setEdges:le,setDefaultNodesAndEdges:fe,setMinZoom:de,setMaxZoom:he,setTranslateExtent:se,setNodeExtent:ye,reset:je}=mt(PO,nn),ce=qt();return A.useEffect(()=>{const Ee=o==null?void 0:o.map(_e=>({..._e,...T}));return fe(n,Ee),()=>{je()}},[]),at("defaultEdgeOptions",T,ce.setState),at("connectionMode",S,ce.setState),at("onConnect",r,ce.setState),at("onConnectStart",s,ce.setState),at("onConnectEnd",i,ce.setState),at("onClickConnectStart",a,ce.setState),at("onClickConnectEnd",l,ce.setState),at("nodesDraggable",c,ce.setState),at("nodesConnectable",d,ce.setState),at("nodesFocusable",u,ce.setState),at("edgesFocusable",f,ce.setState),at("edgesUpdatable",m,ce.setState),at("elementsSelectable",v,ce.setState),at("elevateNodesOnSelect",_,ce.setState),at("snapToGrid",j,ce.setState),at("snapGrid",k,ce.setState),at("onNodesChange",x,ce.setState),at("onEdgesChange",y,ce.setState),at("connectOnClick",I,ce.setState),at("fitViewOnInit",M,ce.setState),at("fitViewOnInitOptions",R,ce.setState),at("onNodesDelete",B,ce.setState),at("onEdgesDelete",O,ce.setState),at("onNodeDrag",z,ce.setState),at("onNodeDragStart",F,ce.setState),at("onNodeDragStop",V,ce.setState),at("onSelectionDrag",L,ce.setState),at("onSelectionDragStart",C,ce.setState),at("onSelectionDragStop",$,ce.setState),at("noPanClassName",N,ce.setState),at("nodeOrigin",H,ce.setState),at("rfId",Y,ce.setState),at("autoPanOnConnect",Z,ce.setState),at("autoPanOnNodeDrag",q,ce.setState),at("onError",re,ce.setState),at("connectionRadius",ne,ce.setState),at("isValidConnection",oe,ce.setState),at("nodeDragThreshold",G,ce.setState),cs(t,Q),cs(e,le),cs(g,de),cs(p,he),cs(E,se),cs(b,ye),null},kw={display:"none"},FO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Sw="react-flow__node-desc",Cw="react-flow__edge-desc",zO=t=>t.ariaLiveMessage;function BO({rfId:t}){const e=mt(zO);return K.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:FO},e)}function UO({rfId:t,disableKeyboardA11y:e}){return K.createElement(K.Fragment,null,K.createElement("div",{id:`${Sw}-${t}`,style:kw},"Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),K.createElement("div",{id:`${Cw}-${t}`,style:kw},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&K.createElement(BO,{rfId:t}))}var Ui=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,o]=A.useState(!1),r=A.useRef(!1),s=A.useRef(new Set([])),[i,a]=A.useMemo(()=>{if(t!==null){const l=(Array.isArray(t)?t:[t]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=l.reduce((d,u)=>d.concat(...u),[]);return[l,c]}return[[],[]]},[t]);return A.useEffect(()=>{const l=typeof document<"u"?document:null,c=(e==null?void 0:e.target)||l;if(t!==null){const d=m=>{if(r.current=m.ctrlKey||m.metaKey||m.shiftKey,(!r.current||r.current&&!e.actInsideInputWithModifier)&&Qu(m))return!1;const _=jw(m.code,a);s.current.add(m[_]),Nw(i,s.current,!1)&&(m.preventDefault(),o(!0))},u=m=>{if((!r.current||r.current&&!e.actInsideInputWithModifier)&&Qu(m))return!1;const _=jw(m.code,a);Nw(i,s.current,!0)?(o(!1),s.current.clear()):s.current.delete(m[_]),m.key==="Meta"&&s.current.clear(),r.current=!1},f=()=>{s.current.clear(),o(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",u),window.addEventListener("blur",f),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",u),window.removeEventListener("blur",f)}}},[t,o]),n};function Nw(t,e,n){return t.filter(o=>n||o.length===e.size).some(o=>o.every(r=>e.has(r)))}function jw(t,e){return e.includes(t)?"code":"key"}function Ew(t,e,n,o){var a,l;const r=t.parentNode||t.parentId;if(!r)return n;const s=e.get(r),i=ls(s,o);return Ew(s,e,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((a=s[Ct])==null?void 0:a.z)??0)>(n.z??0)?((l=s[Ct])==null?void 0:l.z)??0:n.z??0},o)}function Iw(t,e,n){t.forEach(o=>{var s;const r=o.parentNode||o.parentId;if(r&&!t.has(r))throw new Error(`Parent node ${r} not found`);if(r||n!=null&&n[o.id]){const{x:i,y:a,z:l}=Ew(o,t,{...o.position,z:((s=o[Ct])==null?void 0:s.z)??0},e);o.positionAbsolute={x:i,y:a},o[Ct].z=l,n!=null&&n[o.id]&&(o[Ct].isParent=!0)}})}function fh(t,e,n,o){const r=new Map,s={},i=o?1e3:0;return t.forEach(a=>{var m;const l=(Pn(a.zIndex)?a.zIndex:0)+(a.selected?i:0),c=e.get(a.id),d={...a,positionAbsolute:{x:a.position.x,y:a.position.y}},u=a.parentNode||a.parentId;u&&(s[u]=!0);const f=(c==null?void 0:c.type)&&(c==null?void 0:c.type)!==a.type;Object.defineProperty(d,Ct,{enumerable:!1,value:{handleBounds:f||(m=c==null?void 0:c[Ct])==null?void 0:m.handleBounds,z:l}}),r.set(a.id,d)}),Iw(r,n,s),r}function Aw(t,e={}){const{getNodes:n,width:o,height:r,minZoom:s,maxZoom:i,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:u}=t(),f=e.initial&&!c&&d;if(a&&l&&(f||!e.initial)){const m=n().filter(g=>{var b;const p=e.includeHiddenNodes?g.width&&g.height:!g.hidden;return(b=e.nodes)!=null&&b.length?p&&e.nodes.some(x=>x.id===g.id):p}),_=m.every(g=>g.width&&g.height);if(m.length>0&&_){const g=lh(m,u),{x:p,y:b,zoom:x}=dw(g,o,r,e.minZoom??s,e.maxZoom??i,e.padding??.1),y=gr.translate(p,b).scale(x);return typeof e.duration=="number"&&e.duration>0?a.transform(Nr(l,e.duration),y):a.transform(l,y),!0}}return!1}function VO(t,e){return t.forEach(n=>{const o=e.get(n.id);o&&e.set(o.id,{...o,[Ct]:o[Ct],selected:n.selected})}),new Map(e)}function $O(t,e){return e.map(n=>{const o=t.find(r=>r.id===n.id);return o&&(n.selected=o.selected),n})}function Ll({changedNodes:t,changedEdges:e,get:n,set:o}){const{nodeInternals:r,edges:s,onNodesChange:i,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=n();t!=null&&t.length&&(l&&o({nodeInternals:VO(t,r)}),i==null||i(t)),e!=null&&e.length&&(c&&o({edges:$O(e,s)}),a==null||a(e))}const ds=()=>{},HO={zoomIn:ds,zoomOut:ds,zoomTo:ds,getZoom:()=>1,setViewport:ds,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ds,fitBounds:ds,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},WO=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection});function Vi(){const t=(()=>{const g=qt(),{d3Zoom:p,d3Selection:b}=mt(WO,nn);return A.useMemo(()=>b&&p?{zoomIn:y=>p.scaleBy(Nr(b,y==null?void 0:y.duration),1.2),zoomOut:y=>p.scaleBy(Nr(b,y==null?void 0:y.duration),1/1.2),zoomTo:(y,v)=>p.scaleTo(Nr(b,v==null?void 0:v.duration),y),getZoom:()=>g.getState().transform[2],setViewport:(y,v)=>{const[S,k,j]=g.getState().transform,E=gr.translate(y.x??S,y.y??k).scale(y.zoom??j);p.transform(Nr(b,v==null?void 0:v.duration),E)},getViewport:()=>{const[y,v,S]=g.getState().transform;return{x:y,y:v,zoom:S}},fitView:y=>Aw(g.getState,y),setCenter:(y,v,S)=>{const{width:k,height:j,maxZoom:E}=g.getState(),I=(S==null?void 0:S.zoom)!==void 0?S.zoom:E,T=k/2-y*I,M=j/2-v*I,R=gr.translate(T,M).scale(I);p.transform(Nr(b,S==null?void 0:S.duration),R)},fitBounds:(y,v)=>{const{width:S,height:k,minZoom:j,maxZoom:E}=g.getState(),{x:I,y:T,zoom:M}=dw(y,S,k,j,E,(v==null?void 0:v.padding)??.1),R=gr.translate(I,T).scale(M);p.transform(Nr(b,v==null?void 0:v.duration),R)},project:y=>{const{transform:v,snapToGrid:S,snapGrid:k}=g.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),ah(y,v,S,k)},screenToFlowPosition:y=>{const{transform:v,snapToGrid:S,snapGrid:k,domNode:j}=g.getState();if(!j)return y;const{x:E,y:I}=j.getBoundingClientRect(),T={x:y.x-E,y:y.y-I};return ah(T,v,S,k)},flowToScreenPosition:y=>{const{transform:v,domNode:S}=g.getState();if(!S)return y;const{x:k,y:j}=S.getBoundingClientRect(),E=aw(y,v);return{x:E.x+k,y:E.y+j}},viewportInitialized:!0}:HO,[p,b])})(),e=qt(),n=A.useCallback(()=>e.getState().getNodes().map(g=>({...g})),[]),o=A.useCallback(g=>e.getState().nodeInternals.get(g),[]),r=A.useCallback(()=>{const{edges:g=[]}=e.getState();return g.map(p=>({...p}))},[]),s=A.useCallback(g=>{const{edges:p=[]}=e.getState();return p.find(b=>b.id===g)},[]),i=A.useCallback(g=>{const{getNodes:p,setNodes:b,hasDefaultNodes:x,onNodesChange:y}=e.getState(),v=p(),S=typeof g=="function"?g(v):g;if(x)b(S);else if(y){const k=S.length===0?v.map(j=>({type:"remove",id:j.id})):S.map(j=>({item:j,type:"reset"}));y(k)}},[]),a=A.useCallback(g=>{const{edges:p=[],setEdges:b,hasDefaultEdges:x,onEdgesChange:y}=e.getState(),v=typeof g=="function"?g(p):g;x?b(v):y&&y(v.length===0?p.map(S=>({type:"remove",id:S.id})):v.map(S=>({item:S,type:"reset"})))},[]),l=A.useCallback(g=>{const p=Array.isArray(g)?g:[g],{getNodes:b,setNodes:x,hasDefaultNodes:y,onNodesChange:v}=e.getState();if(y)x([...b(),...p]);else if(v){const S=p.map(k=>({item:k,type:"add"}));v(S)}},[]),c=A.useCallback(g=>{const p=Array.isArray(g)?g:[g],{edges:b=[],setEdges:x,hasDefaultEdges:y,onEdgesChange:v}=e.getState();y?x([...b,...p]):v&&v(p.map(S=>({item:S,type:"add"})))},[]),d=A.useCallback(()=>{const{getNodes:g,edges:p=[],transform:b}=e.getState(),[x,y,v]=b;return{nodes:g().map(S=>({...S})),edges:p.map(S=>({...S})),viewport:{x,y,zoom:v}}},[]),u=A.useCallback(({nodes:g,edges:p})=>{const{nodeInternals:b,getNodes:x,edges:y,hasDefaultNodes:v,hasDefaultEdges:S,onNodesDelete:k,onEdgesDelete:j,onNodesChange:E,onEdgesChange:I}=e.getState(),T=(g||[]).map(z=>z.id),M=(p||[]).map(z=>z.id),R=x().reduce((z,F)=>{const V=F.parentNode||F.parentId,L=!T.includes(F.id)&&V&&z.find(C=>C.id===V);return(typeof F.deletable!="boolean"||F.deletable)&&(T.includes(F.id)||L)&&z.push(F),z},[]),B=y.filter(z=>typeof z.deletable!="boolean"||z.deletable),O=B.filter(z=>M.includes(z.id));if(R||O){const z=cw(R,B),F=[...O,...z],V=F.reduce((L,C)=>(L.includes(C.id)||L.push(C.id),L),[]);(S||v)&&(S&&e.setState({edges:y.filter(L=>!V.includes(L.id))}),v&&(R.forEach(L=>{b.delete(L.id)}),e.setState({nodeInternals:new Map(b)}))),V.length>0&&(j==null||j(F),I&&I(V.map(L=>({id:L,type:"remove"})))),R.length>0&&(k==null||k(R),E)&&E(R.map(L=>({id:L.id,type:"remove"})))}},[]),f=A.useCallback(g=>{const p=Pn((b=g).width)&&Pn(b.height)&&Pn(b.x)&&Pn(b.y);var b;const x=p?null:e.getState().nodeInternals.get(g.id);return!p&&!x?[null,null,p]:[p?g:Gx(x),x,p]},[]),m=A.useCallback((g,p=!0,b)=>{const[x,y,v]=f(g);return x?(b||e.getState().getNodes()).filter(S=>{if(!(v||S.id!==y.id&&S.positionAbsolute))return!1;const k=Gx(S),j=Zu(k,x);return p&&j>0||j>=x.width*x.height}):[]},[]),_=A.useCallback((g,p,b=!0)=>{const[x]=f(g);if(!x)return!1;const y=Zu(x,p);return b&&y>0||y>=x.width*x.height},[]);return A.useMemo(()=>({...t,getNodes:n,getNode:o,getEdges:r,getEdge:s,setNodes:i,setEdges:a,addNodes:l,addEdges:c,toObject:d,deleteElements:u,getIntersectingNodes:m,isNodeIntersecting:_}),[t,n,o,r,s,i,a,l,c,d,u,m,_])}const qO={actInsideInputWithModifier:!1},mh={position:"absolute",width:"100%",height:"100%",top:0,left:0},Fl=t=>({x:t.x,y:t.y,zoom:t.k}),us=(t,e)=>t.target.closest(`.${e}`),Tw=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),Mw=t=>{const e=t.ctrlKey&&Tl()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},GO=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),YO=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:o,zoomOnScroll:r=!0,zoomOnPinch:s=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=er.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:u=!0,defaultViewport:f,translateExtent:m,minZoom:_,maxZoom:g,zoomActivationKeyCode:p,preventScrolling:b=!0,children:x,noWheelClassName:y,noPanClassName:v})=>{const S=A.useRef(),k=qt(),j=A.useRef(!1),E=A.useRef(!1),I=A.useRef(null),T=A.useRef({x:0,y:0,zoom:0}),{d3Zoom:M,d3Selection:R,d3ZoomHandler:B,userSelectionActive:O}=mt(GO,nn),z=Ui(p),F=A.useRef(0),V=A.useRef(!1),L=A.useRef();return function(C){const $=qt();A.useEffect(()=>{let N;const H=()=>{var Z,q;if(!C.current)return;const Y=Ju(C.current);Y.height!==0&&Y.width!==0||((q=(Z=$.getState()).onError)==null||q.call(Z,"004",gO())),$.setState({width:Y.width||500,height:Y.height||500})};return H(),window.addEventListener("resize",H),C.current&&(N=new ResizeObserver(()=>H()),N.observe(C.current)),()=>{window.removeEventListener("resize",H),N&&C.current&&N.unobserve(C.current)}},[])}(I),A.useEffect(()=>{if(I.current){const C=I.current.getBoundingClientRect(),$=function(){var q,re,ne,oe=cO,G=dO,Q=fO,le=uO,fe=hO,de=[0,1/0],he=[[-1/0,-1/0],[1/0,1/0]],se=250,ye=J$,je=kS("start","zoom","end"),ce=0,Ee=10;function _e(J){J.property("__zoom",Vx).on("wheel.zoom",nt,{passive:!1}).on("mousedown.zoom",it).on("dblclick.zoom",te).filter(fe).on("touchstart.zoom",ke).on("touchmove.zoom",Ie).on("touchend.zoom touchcancel.zoom",ze).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function De(J,pe){return(pe=Math.max(de[0],Math.min(de[1],pe)))===J.k?J:new sp(pe,J.x,J.y)}function Fe(J,pe,ge){var ue=pe[0]-ge[0]*J.k,Se=pe[1]-ge[1]*J.k;return ue===J.x&&Se===J.y?J:new sp(J.k,ue,Se)}function He(J){return[(+J[0][0]+ +J[1][0])/2,(+J[0][1]+ +J[1][1])/2]}function Xe(J,pe,ge,ue){J.on("start.zoom",function(){Le(this,arguments).event(ue).start()}).on("interrupt.zoom end.zoom",function(){Le(this,arguments).event(ue).end()}).tween("zoom",function(){var Se=this,we=arguments,Ue=Le(Se,we).event(ue),Ze=G.apply(Se,we),ae=ge==null?He(Ze):typeof ge=="function"?ge.apply(Se,we):ge,Ce=Math.max(Ze[1][0]-Ze[0][0],Ze[1][1]-Ze[0][1]),Ne=Se.__zoom,Be=typeof pe=="function"?pe.apply(Se,we):pe,We=ye(Ne.invert(ae).concat(Ce/Ne.k),Be.invert(ae).concat(Ce/Be.k));return function(Re){if(Re===1)Re=Be;else{var Ge=We(Re),ot=Ce/Ge[2];Re=new sp(ot,ae[0]-Ge[0]*ot,ae[1]-Ge[1]*ot)}Ue.zoom(null,Re)}})}function Le(J,pe,ge){return!ge&&J.__zooming||new et(J,pe)}function et(J,pe){this.that=J,this.args=pe,this.active=0,this.sourceEvent=null,this.extent=G.apply(J,pe),this.taps=0}function nt(J,...pe){if(oe.apply(this,arguments)){var ge=Le(this,pe).event(J),ue=this.__zoom,Se=Math.max(de[0],Math.min(de[1],ue.k*Math.pow(2,le.apply(this,arguments)))),we=ao(J);if(ge.wheel)ge.mouse[0][0]===we[0]&&ge.mouse[0][1]===we[1]||(ge.mouse[1]=ue.invert(ge.mouse[0]=we)),clearTimeout(ge.wheel);else{if(ue.k===Se)return;ge.mouse=[we,ue.invert(we)],ip(this),ge.start()}Pi(J),ge.wheel=setTimeout(function(){ge.wheel=null,ge.end()},150),ge.zoom("mouse",Q(Fe(De(ue,Se),ge.mouse[0],ge.mouse[1]),ge.extent,he))}}function it(J,...pe){if(!ne&&oe.apply(this,arguments)){var ge=J.currentTarget,ue=Le(this,pe,!0).event(J),Se=to(J.view).on("mousemove.zoom",function(ae){if(Pi(ae),!ue.moved){var Ce=ae.clientX-Ue,Ne=ae.clientY-Ze;ue.moved=Ce*Ce+Ne*Ne>ce}ue.event(ae).zoom("mouse",Q(Fe(ue.that.__zoom,ue.mouse[0]=ao(ae,ge),ue.mouse[1]),ue.extent,he))},!0).on("mouseup.zoom",function(ae){Se.on("mousemove.zoom mouseup.zoom",null),Ux(ae.view,ue.moved),Pi(ae),ue.event(ae).end()},!0),we=ao(J,ge),Ue=J.clientX,Ze=J.clientY;Bx(J.view),Yu(J),ue.mouse=[we,this.__zoom.invert(we)],ip(this),ue.start()}}function te(J,...pe){if(oe.apply(this,arguments)){var ge=this.__zoom,ue=ao(J.changedTouches?J.changedTouches[0]:J,this),Se=ge.invert(ue),we=ge.k*(J.shiftKey?.5:2),Ue=Q(Fe(De(ge,we),ue,Se),G.apply(this,pe),he);Pi(J),se>0?to(this).transition().duration(se).call(Xe,Ue,ue,J):to(this).call(_e.transform,Ue,ue,J)}}function ke(J,...pe){if(oe.apply(this,arguments)){var ge,ue,Se,we,Ue=J.touches,Ze=Ue.length,ae=Le(this,pe,J.changedTouches.length===Ze).event(J);for(Yu(J),ue=0;ue<Ze;++ue)we=[we=ao(Se=Ue[ue],this),this.__zoom.invert(we),Se.identifier],ae.touch0?ae.touch1||ae.touch0[2]===we[2]||(ae.touch1=we,ae.taps=0):(ae.touch0=we,ge=!0,ae.taps=1+!!q);q&&(q=clearTimeout(q)),ge&&(ae.taps<2&&(re=we[0],q=setTimeout(function(){q=null},500)),ip(this),ae.start())}}function Ie(J,...pe){if(this.__zooming){var ge,ue,Se,we,Ue=Le(this,pe).event(J),Ze=J.changedTouches,ae=Ze.length;for(Pi(J),ge=0;ge<ae;++ge)Se=ao(ue=Ze[ge],this),Ue.touch0&&Ue.touch0[2]===ue.identifier?Ue.touch0[0]=Se:Ue.touch1&&Ue.touch1[2]===ue.identifier&&(Ue.touch1[0]=Se);if(ue=Ue.that.__zoom,Ue.touch1){var Ce=Ue.touch0[0],Ne=Ue.touch0[1],Be=Ue.touch1[0],We=Ue.touch1[1],Re=(Re=Be[0]-Ce[0])*Re+(Re=Be[1]-Ce[1])*Re,Ge=(Ge=We[0]-Ne[0])*Ge+(Ge=We[1]-Ne[1])*Ge;ue=De(ue,Math.sqrt(Re/Ge)),Se=[(Ce[0]+Be[0])/2,(Ce[1]+Be[1])/2],we=[(Ne[0]+We[0])/2,(Ne[1]+We[1])/2]}else{if(!Ue.touch0)return;Se=Ue.touch0[0],we=Ue.touch0[1]}Ue.zoom("touch",Q(Fe(ue,Se,we),Ue.extent,he))}}function ze(J,...pe){if(this.__zooming){var ge,ue,Se=Le(this,pe).event(J),we=J.changedTouches,Ue=we.length;for(Yu(J),ne&&clearTimeout(ne),ne=setTimeout(function(){ne=null},500),ge=0;ge<Ue;++ge)ue=we[ge],Se.touch0&&Se.touch0[2]===ue.identifier?delete Se.touch0:Se.touch1&&Se.touch1[2]===ue.identifier&&delete Se.touch1;if(Se.touch1&&!Se.touch0&&(Se.touch0=Se.touch1,delete Se.touch1),Se.touch0)Se.touch0[1]=this.__zoom.invert(Se.touch0[0]);else if(Se.end(),Se.taps===2&&(ue=ao(ue,this),Math.hypot(re[0]-ue[0],re[1]-ue[1])<Ee)){var Ze=to(this).on("dblclick.zoom");Ze&&Ze.apply(this,arguments)}}}return _e.transform=function(J,pe,ge,ue){var Se=J.selection?J.selection():J;Se.property("__zoom",Vx),J!==Se?Xe(J,pe,ge,ue):Se.interrupt().each(function(){Le(this,arguments).event(ue).start().zoom(null,typeof pe=="function"?pe.apply(this,arguments):pe).end()})},_e.scaleBy=function(J,pe,ge,ue){_e.scaleTo(J,function(){return this.__zoom.k*(typeof pe=="function"?pe.apply(this,arguments):pe)},ge,ue)},_e.scaleTo=function(J,pe,ge,ue){_e.transform(J,function(){var Se=G.apply(this,arguments),we=this.__zoom,Ue=ge==null?He(Se):typeof ge=="function"?ge.apply(this,arguments):ge,Ze=we.invert(Ue),ae=typeof pe=="function"?pe.apply(this,arguments):pe;return Q(Fe(De(we,ae),Ue,Ze),Se,he)},ge,ue)},_e.translateBy=function(J,pe,ge,ue){_e.transform(J,function(){return Q(this.__zoom.translate(typeof pe=="function"?pe.apply(this,arguments):pe,typeof ge=="function"?ge.apply(this,arguments):ge),G.apply(this,arguments),he)},null,ue)},_e.translateTo=function(J,pe,ge,ue,Se){_e.transform(J,function(){var we=G.apply(this,arguments),Ue=this.__zoom,Ze=ue==null?He(we):typeof ue=="function"?ue.apply(this,arguments):ue;return Q(gr.translate(Ze[0],Ze[1]).scale(Ue.k).translate(typeof pe=="function"?-pe.apply(this,arguments):-pe,typeof ge=="function"?-ge.apply(this,arguments):-ge),we,he)},ue,Se)},et.prototype={event:function(J){return J&&(this.sourceEvent=J),this},start:function(){return++this.active==1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(J,pe){return this.mouse&&J!=="mouse"&&(this.mouse[1]=pe.invert(this.mouse[0])),this.touch0&&J!=="touch"&&(this.touch0[1]=pe.invert(this.touch0[0])),this.touch1&&J!=="touch"&&(this.touch1[1]=pe.invert(this.touch1[0])),this.that.__zoom=pe,this.emit("zoom"),this},end:function(){return--this.active==0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(J){var pe=to(this.that).datum();je.call(J,this.that,new lO(J,{sourceEvent:this.sourceEvent,target:_e,transform:this.that.__zoom,dispatch:je}),pe)}},_e.wheelDelta=function(J){return arguments.length?(le=typeof J=="function"?J:El(+J),_e):le},_e.filter=function(J){return arguments.length?(oe=typeof J=="function"?J:El(!!J),_e):oe},_e.touchable=function(J){return arguments.length?(fe=typeof J=="function"?J:El(!!J),_e):fe},_e.extent=function(J){return arguments.length?(G=typeof J=="function"?J:El([[+J[0][0],+J[0][1]],[+J[1][0],+J[1][1]]]),_e):G},_e.scaleExtent=function(J){return arguments.length?(de[0]=+J[0],de[1]=+J[1],_e):[de[0],de[1]]},_e.translateExtent=function(J){return arguments.length?(he[0][0]=+J[0][0],he[1][0]=+J[1][0],he[0][1]=+J[0][1],he[1][1]=+J[1][1],_e):[[he[0][0],he[0][1]],[he[1][0],he[1][1]]]},_e.constrain=function(J){return arguments.length?(Q=J,_e):Q},_e.duration=function(J){return arguments.length?(se=+J,_e):se},_e.interpolate=function(J){return arguments.length?(ye=J,_e):ye},_e.on=function(){var J=je.on.apply(je,arguments);return J===je?_e:J},_e.clickDistance=function(J){return arguments.length?(ce=(J=+J)*J,_e):Math.sqrt(ce)},_e.tapDistance=function(J){return arguments.length?(Ee=+J,_e):Ee},_e}().scaleExtent([_,g]).translateExtent(m),N=to(I.current).call($),H=gr.translate(f.x,f.y).scale(is(f.zoom,_,g)),Y=[[0,0],[C.width,C.height]],Z=$.constrain()(H,Y,m);$.transform(N,Z),$.wheelDelta(Mw),k.setState({d3Zoom:$,d3Selection:N,d3ZoomHandler:N.on("wheel.zoom"),transform:[Z.x,Z.y,Z.k],domNode:I.current.closest(".react-flow")})}},[]),A.useEffect(()=>{R&&M&&(!i||z||O?B!==void 0&&R.on("wheel.zoom",function(C,$){if(!b&&C.type==="wheel"&&!C.ctrlKey||us(C,y))return null;C.preventDefault(),B.call(this,C,$)},{passive:!1}):R.on("wheel.zoom",C=>{if(us(C,y))return!1;C.preventDefault(),C.stopImmediatePropagation();const $=R.property("__zoom").k||1;if(C.ctrlKey&&s){const oe=ao(C),G=Mw(C),Q=$*Math.pow(2,G);return void M.scaleTo(R,Q,oe,C)}const N=C.deltaMode===1?20:1;let H=l===er.Vertical?0:C.deltaX*N,Y=l===er.Horizontal?0:C.deltaY*N;!Tl()&&C.shiftKey&&l!==er.Vertical&&(H=C.deltaY*N,Y=0),M.translateBy(R,-H/$*a,-Y/$*a,{internal:!0});const Z=Fl(R.property("__zoom")),{onViewportChangeStart:q,onViewportChange:re,onViewportChangeEnd:ne}=k.getState();clearTimeout(L.current),V.current||(V.current=!0,e==null||e(C,Z),q==null||q(Z)),V.current&&(t==null||t(C,Z),re==null||re(Z),L.current=setTimeout(()=>{n==null||n(C,Z),ne==null||ne(Z),V.current=!1},150))},{passive:!1}))},[O,i,l,R,M,B,z,s,b,y,e,t,n]),A.useEffect(()=>{M&&M.on("start",C=>{var H,Y;if(!C.sourceEvent||C.sourceEvent.internal)return null;F.current=(H=C.sourceEvent)==null?void 0:H.button;const{onViewportChangeStart:$}=k.getState(),N=Fl(C.transform);j.current=!0,T.current=N,((Y=C.sourceEvent)==null?void 0:Y.type)==="mousedown"&&k.setState({paneDragging:!0}),$==null||$(N),e==null||e(C.sourceEvent,N)})},[M,e]),A.useEffect(()=>{M&&(O&&!j.current?M.on("zoom",null):O||M.on("zoom",C=>{var N;const{onViewportChange:$}=k.getState();if(k.setState({transform:[C.transform.x,C.transform.y,C.transform.k]}),E.current=!(!o||!Tw(u,F.current??0)),(t||$)&&!((N=C.sourceEvent)!=null&&N.internal)){const H=Fl(C.transform);$==null||$(H),t==null||t(C.sourceEvent,H)}}))},[O,M,t,u,o]),A.useEffect(()=>{M&&M.on("end",C=>{if(!C.sourceEvent||C.sourceEvent.internal)return null;const{onViewportChangeEnd:$}=k.getState();if(j.current=!1,k.setState({paneDragging:!1}),o&&Tw(u,F.current??0)&&!E.current&&o(C.sourceEvent),E.current=!1,(n||$)&&(N=T.current,H=C.transform,N.x!==H.x||N.y!==H.y||N.zoom!==H.k)){const Y=Fl(C.transform);T.current=Y,clearTimeout(S.current),S.current=setTimeout(()=>{$==null||$(Y),n==null||n(C.sourceEvent,Y)},i?150:0)}var N,H})},[M,i,u,n,o]),A.useEffect(()=>{M&&M.filter(C=>{const $=z||r,N=s&&C.ctrlKey;if((u===!0||Array.isArray(u)&&u.includes(1))&&C.button===1&&C.type==="mousedown"&&(us(C,"react-flow__node")||us(C,"react-flow__edge")))return!0;if(!(u||$||i||c||s)||O||!c&&C.type==="dblclick"||us(C,y)&&C.type==="wheel"||us(C,v)&&(C.type!=="wheel"||i&&C.type==="wheel"&&!z)||!s&&C.ctrlKey&&C.type==="wheel"||!$&&!i&&!N&&C.type==="wheel"||!u&&(C.type==="mousedown"||C.type==="touchstart")||Array.isArray(u)&&!u.includes(C.button)&&C.type==="mousedown")return!1;const H=Array.isArray(u)&&u.includes(C.button)||!C.button||C.button<=1;return(!C.ctrlKey||C.type==="wheel")&&H})},[O,M,r,s,i,c,u,d,z]),K.createElement("div",{className:"react-flow__renderer",ref:I,style:mh},x)},JO=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function KO(){const{userSelectionActive:t,userSelectionRect:e}=mt(JO,nn);return t&&e?K.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function Ow(t,e){const n=e.parentNode||e.parentId,o=t.find(r=>r.id===n);if(o){const r=e.position.x+e.width-o.width,s=e.position.y+e.height-o.height;if(r>0||s>0||e.position.x<0||e.position.y<0){if(o.style={...o.style},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,r>0&&(o.style.width+=r),s>0&&(o.style.height+=s),e.position.x<0){const i=Math.abs(e.position.x);o.position.x=o.position.x-i,o.style.width+=i,e.position.x=0}if(e.position.y<0){const i=Math.abs(e.position.y);o.position.y=o.position.y-i,o.style.height+=i,e.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function Dw(t,e){if(t.some(o=>o.type==="reset"))return t.filter(o=>o.type==="reset").map(o=>o.item);const n=t.filter(o=>o.type==="add").map(o=>o.item);return e.reduce((o,r)=>{const s=t.filter(a=>a.id===r.id);if(s.length===0)return o.push(r),o;const i={...r};for(const a of s)if(a)switch(a.type){case"select":i.selected=a.selected;break;case"position":a.position!==void 0&&(i.position=a.position),a.positionAbsolute!==void 0&&(i.positionAbsolute=a.positionAbsolute),a.dragging!==void 0&&(i.dragging=a.dragging),i.expandParent&&Ow(o,i);break;case"dimensions":a.dimensions!==void 0&&(i.width=a.dimensions.width,i.height=a.dimensions.height),a.updateStyle!==void 0&&(i.style={...i.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(i.resizing=a.resizing),i.expandParent&&Ow(o,i);break;case"remove":return o}return o.push(i),o},n)}function Rw(t,e){return Dw(t,e)}const or=(t,e)=>({id:t,type:"select",selected:e});function hs(t,e){return t.reduce((n,o)=>{const r=e.includes(o.id);return!o.selected&&r?(o.selected=!0,n.push(or(o.id,!0))):o.selected&&!r&&(o.selected=!1,n.push(or(o.id,!1))),n},[])}const ph=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},XO=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),Pw=A.memo(({isSelecting:t,selectionMode:e=zi.Full,panOnDrag:n,onSelectionStart:o,onSelectionEnd:r,onPaneClick:s,onPaneContextMenu:i,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:u})=>{const f=A.useRef(null),m=qt(),_=A.useRef(0),g=A.useRef(0),p=A.useRef(),{userSelectionActive:b,elementsSelectable:x,dragging:y}=mt(XO,nn),v=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),_.current=0,g.current=0},S=E=>{s==null||s(E),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},k=a?E=>a(E):void 0,j=x&&(t||b);return K.createElement("div",{className:dn(["react-flow__pane",{dragging:y,selection:t}]),onClick:j?void 0:ph(S,f),onContextMenu:ph(E=>{Array.isArray(n)&&(n!=null&&n.includes(2))?E.preventDefault():i==null||i(E)},f),onWheel:ph(k,f),onMouseEnter:j?void 0:l,onMouseDown:j?E=>{const{resetSelectedElements:I,domNode:T}=m.getState();if(p.current=T==null?void 0:T.getBoundingClientRect(),!x||!t||E.button!==0||E.target!==f.current||!p.current)return;const{x:M,y:R}=Qo(E,p.current);I(),m.setState({userSelectionRect:{width:0,height:0,startX:M,startY:R,x:M,y:R}}),o==null||o(E)}:void 0,onMouseMove:j?E=>{const{userSelectionRect:I,nodeInternals:T,edges:M,transform:R,onNodesChange:B,onEdgesChange:O,nodeOrigin:z,getNodes:F}=m.getState();if(!t||!p.current||!I)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const V=Qo(E,p.current),L=I.startX??0,C=I.startY??0,$={...I,x:V.x<L?V.x:L,y:V.y<C?V.y:C,width:Math.abs(V.x-L),height:Math.abs(V.y-C)},N=F(),H=lw(T,$,R,e===zi.Partial,!0,z),Y=cw(H,M).map(q=>q.id),Z=H.map(q=>q.id);if(_.current!==Z.length){_.current=Z.length;const q=hs(N,Z);q.length&&(B==null||B(q))}if(g.current!==Y.length){g.current=Y.length;const q=hs(M,Y);q.length&&(O==null||O(q))}m.setState({userSelectionRect:$})}:c,onMouseUp:j?E=>{if(E.button!==0)return;const{userSelectionRect:I}=m.getState();!b&&I&&E.target===f.current&&(S==null||S(E)),m.setState({nodesSelectionActive:_.current>0}),v(),r==null||r(E)}:void 0,onMouseLeave:j?E=>{b&&(m.setState({nodesSelectionActive:_.current>0}),r==null||r(E)),v()}:d,ref:f,style:mh},u,K.createElement(KO,null))});function Lw(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const o=e.get(n);return!!o&&(!!o.selected||Lw(o,e))}function Fw(t,e,n){let o=t;do{if(o!=null&&o.matches(e))return!0;if(o===n.current)return!1;o=o.parentElement}while(o);return!1}function ZO(t,e,n,o){return Array.from(t.values()).filter(r=>(r.selected||r.id===o)&&(!r.parentNode||r.parentId||!Lw(r,t))&&(r.draggable||e&&r.draggable===void 0)).map(r=>{var s,i;return{id:r.id,position:r.position||{x:0,y:0},positionAbsolute:r.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((s=r.positionAbsolute)==null?void 0:s.x)??0),y:n.y-(((i=r.positionAbsolute)==null?void 0:i.y)??0)},delta:{x:0,y:0},extent:r.extent,parentNode:r.parentNode||r.parentId,parentId:r.parentNode||r.parentId,width:r.width,height:r.height,expandParent:r.expandParent}})}function zw(t,e,n,o,r=[0,0],s){const i=function(u,f){return f&&f!=="parent"?[f[0],[f[1][0]-(u.width||0),f[1][1]-(u.height||0)]]:f}(t,t.extent||o);let a=i;const l=t.parentNode||t.parentId;if(t.extent!=="parent"||t.expandParent){if(t.extent&&l&&t.extent!=="parent"){const u=n.get(l),{x:f,y:m}=ls(u,r).positionAbsolute;a=[[t.extent[0][0]+f,t.extent[0][1]+m],[t.extent[1][0]+f,t.extent[1][1]+m]]}}else if(l&&t.width&&t.height){const u=n.get(l),{x:f,y:m}=ls(u,r).positionAbsolute;a=u&&Pn(f)&&Pn(m)&&Pn(u.width)&&Pn(u.height)?[[f+t.width*r[0],m+t.height*r[1]],[f+u.width-t.width+t.width*r[0],m+u.height-t.height+t.height*r[1]]]:a}else s==null||s("005",_O()),a=i;let c={x:0,y:0};if(l){const u=n.get(l);c=ls(u,r).positionAbsolute}const d=a&&a!=="parent"?Ku(e,a):e;return{position:{x:d.x-c.x,y:d.y-c.y},positionAbsolute:d}}function gh({nodeId:t,dragItems:e,nodeInternals:n}){const o=e.map(r=>({...n.get(r.id),position:r.position,positionAbsolute:r.positionAbsolute}));return[t?o.find(r=>r.id===t):o[0],o]}Pw.displayName="Pane";const Bw=(t,e,n,o)=>{const r=e.querySelectorAll(t);if(!r||!r.length)return null;const s=Array.from(r),i=e.getBoundingClientRect(),a=i.width*o[0],l=i.height*o[1];return s.map(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(d.left-i.left-a)/n,y:(d.top-i.top-l)/n,...Ju(c)}})};function $i(t,e,n){return n===void 0?n:o=>{const r=e().nodeInternals.get(t);r&&n(o,{...r})}}function _h({id:t,store:e,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:i,nodeInternals:a,onError:l}=e.getState(),c=a.get(t);c?(e.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(s({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=o==null?void 0:o.current)==null?void 0:d.blur()})):r([t])):l==null||l("012",vO(t))}function bh(t){return(e,n,o)=>t==null?void 0:t(e,o)}function Uw({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:s,selectNodesOnDrag:i}){const a=qt(),[l,c]=A.useState(!1),d=A.useRef([]),u=A.useRef({x:null,y:null}),f=A.useRef(0),m=A.useRef(null),_=A.useRef({x:0,y:0}),g=A.useRef(null),p=A.useRef(!1),b=A.useRef(!1),x=A.useRef(!1),y=function(){const v=qt();return A.useCallback(({sourceEvent:k})=>{const{transform:j,snapGrid:E,snapToGrid:I}=v.getState(),T=k.touches?k.touches[0].clientX:k.clientX,M=k.touches?k.touches[0].clientY:k.clientY,R={x:(T-j[0])/j[2],y:(M-j[1])/j[2]};return{xSnapped:I?E[0]*Math.round(R.x/E[0]):R.x,ySnapped:I?E[1]*Math.round(R.y/E[1]):R.y,...R}},[])}();return A.useEffect(()=>{if(t!=null&&t.current){const v=to(t.current),S=({x:E,y:I})=>{const{nodeInternals:T,onNodeDrag:M,onSelectionDrag:R,updateNodePositions:B,nodeExtent:O,snapGrid:z,snapToGrid:F,nodeOrigin:V,onError:L}=a.getState();u.current={x:E,y:I};let C=!1,$={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&O){const H=lh(d.current,V);$=Xu(H)}if(d.current=d.current.map(H=>{const Y={x:E-H.distance.x,y:I-H.distance.y};F&&(Y.x=z[0]*Math.round(Y.x/z[0]),Y.y=z[1]*Math.round(Y.y/z[1]));const Z=[[O[0][0],O[0][1]],[O[1][0],O[1][1]]];d.current.length>1&&O&&!H.extent&&(Z[0][0]=H.positionAbsolute.x-$.x+O[0][0],Z[1][0]=H.positionAbsolute.x+(H.width??0)-$.x2+O[1][0],Z[0][1]=H.positionAbsolute.y-$.y+O[0][1],Z[1][1]=H.positionAbsolute.y+(H.height??0)-$.y2+O[1][1]);const q=zw(H,Y,T,Z,V,L);return C=C||H.position.x!==q.position.x||H.position.y!==q.position.y,H.position=q.position,H.positionAbsolute=q.positionAbsolute,H}),!C)return;B(d.current,!0,!0),c(!0);const N=r?M:bh(R);if(N&&g.current){const[H,Y]=gh({nodeId:r,dragItems:d.current,nodeInternals:T});N(g.current,H,Y)}},k=()=>{if(!m.current)return;const[E,I]=Wx(_.current,m.current);if(E!==0||I!==0){const{transform:T,panBy:M}=a.getState();u.current.x=(u.current.x??0)-E/T[2],u.current.y=(u.current.y??0)-I/T[2],M({x:E,y:I})&&S(u.current)}f.current=requestAnimationFrame(k)},j=E=>{var V;const{nodeInternals:I,multiSelectionActive:T,nodesDraggable:M,unselectNodesAndEdges:R,onNodeDragStart:B,onSelectionDragStart:O}=a.getState();b.current=!0;const z=r?B:bh(O);i&&s||T||!r||(V=I.get(r))!=null&&V.selected||R(),r&&s&&i&&_h({id:r,store:a,nodeRef:t});const F=y(E);if(u.current=F,d.current=ZO(I,M,F,r),z&&d.current){const[L,C]=gh({nodeId:r,dragItems:d.current,nodeInternals:I});z(E.sourceEvent,L,C)}};if(!e){const E=function(){var I,T,M,R,B=rO,O=sO,z=iO,F=aO,V={},L=kS("start","drag","end"),C=0,$=0;function N(G){G.on("mousedown.drag",H).filter(F).on("touchstart.drag",q).on("touchmove.drag",re,oO).on("touchend.drag touchcancel.drag",ne).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function H(G,Q){if(!R&&B.call(this,G,Q)){var le=oe(this,O.call(this,G,Q),G,Q,"mouse");le&&(to(G.view).on("mousemove.drag",Y,Ri).on("mouseup.drag",Z,Ri),Bx(G.view),qu(G),M=!1,I=G.clientX,T=G.clientY,le("start",G))}}function Y(G){if(ss(G),!M){var Q=G.clientX-I,le=G.clientY-T;M=Q*Q+le*le>$}V.mouse("drag",G)}function Z(G){to(G.view).on("mousemove.drag mouseup.drag",null),Ux(G.view,M),ss(G),V.mouse("end",G)}function q(G,Q){if(B.call(this,G,Q)){var le,fe,de=G.changedTouches,he=O.call(this,G,Q),se=de.length;for(le=0;le<se;++le)(fe=oe(this,he,G,Q,de[le].identifier,de[le]))&&(qu(G),fe("start",G,de[le]))}}function re(G){var Q,le,fe=G.changedTouches,de=fe.length;for(Q=0;Q<de;++Q)(le=V[fe[Q].identifier])&&(ss(G),le("drag",G,fe[Q]))}function ne(G){var Q,le,fe=G.changedTouches,de=fe.length;for(R&&clearTimeout(R),R=setTimeout(function(){R=null},500),Q=0;Q<de;++Q)(le=V[fe[Q].identifier])&&(qu(G),le("end",G,fe[Q]))}function oe(G,Q,le,fe,de,he){var se,ye,je,ce=L.copy(),Ee=ao(he||le,Q);if((je=z.call(G,new Gu("beforestart",{sourceEvent:le,target:N,identifier:de,active:C,x:Ee[0],y:Ee[1],dx:0,dy:0,dispatch:ce}),fe))!=null)return se=je.x-Ee[0]||0,ye=je.y-Ee[1]||0,function _e(De,Fe,He){var Xe,Le=Ee;switch(De){case"start":V[de]=_e,Xe=C++;break;case"end":delete V[de],--C;case"drag":Ee=ao(He||Fe,Q),Xe=C}ce.call(De,G,new Gu(De,{sourceEvent:Fe,subject:je,target:N,identifier:de,active:Xe,x:Ee[0]+se,y:Ee[1]+ye,dx:Ee[0]-Le[0],dy:Ee[1]-Le[1],dispatch:ce}),fe)}}return N.filter=function(G){return arguments.length?(B=typeof G=="function"?G:jl(!!G),N):B},N.container=function(G){return arguments.length?(O=typeof G=="function"?G:jl(G),N):O},N.subject=function(G){return arguments.length?(z=typeof G=="function"?G:jl(G),N):z},N.touchable=function(G){return arguments.length?(F=typeof G=="function"?G:jl(!!G),N):F},N.on=function(){var G=L.on.apply(L,arguments);return G===L?N:G},N.clickDistance=function(G){return arguments.length?($=(G=+G)*G,N):Math.sqrt($)},N}().on("start",I=>{const{domNode:T,nodeDragThreshold:M}=a.getState();M===0&&j(I),x.current=!1;const R=y(I);u.current=R,m.current=(T==null?void 0:T.getBoundingClientRect())||null,_.current=Qo(I.sourceEvent,m.current)}).on("drag",I=>{var B,O;const T=y(I),{autoPanOnNodeDrag:M,nodeDragThreshold:R}=a.getState();if(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1&&(x.current=!0),!x.current){if(!p.current&&b.current&&M&&(p.current=!0,k()),!b.current){const z=T.xSnapped-(((B=u==null?void 0:u.current)==null?void 0:B.x)??0),F=T.ySnapped-(((O=u==null?void 0:u.current)==null?void 0:O.y)??0);Math.sqrt(z*z+F*F)>R&&j(I)}(u.current.x!==T.xSnapped||u.current.y!==T.ySnapped)&&d.current&&b.current&&(g.current=I.sourceEvent,_.current=Qo(I.sourceEvent,m.current),S(T))}}).on("end",I=>{if(b.current&&!x.current&&(c(!1),p.current=!1,b.current=!1,cancelAnimationFrame(f.current),d.current)){const{updateNodePositions:T,nodeInternals:M,onNodeDragStop:R,onSelectionDragStop:B}=a.getState(),O=r?R:bh(B);if(T(d.current,!1,!1),O){const[z,F]=gh({nodeId:r,dragItems:d.current,nodeInternals:M});O(I.sourceEvent,z,F)}}}).filter(I=>{const T=I.target;return!I.button&&(!n||!Fw(T,`.${n}`,t))&&(!o||Fw(T,o,t))});return v.call(E),()=>{v.on(".drag",null)}}v.on(".drag",null)}},[t,e,n,o,s,a,r,i,y]),l}function Vw(){const t=qt();return A.useCallback(n=>{const{nodeInternals:o,nodeExtent:r,updateNodePositions:s,getNodes:i,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:d}=t.getState(),u=i().filter(x=>x.selected&&(x.draggable||d&&x.draggable===void 0)),f=a?l[0]:5,m=a?l[1]:5,_=n.isShiftPressed?4:1,g=n.x*f*_,p=n.y*m*_,b=u.map(x=>{if(x.positionAbsolute){const y={x:x.positionAbsolute.x+g,y:x.positionAbsolute.y+p};a&&(y.x=l[0]*Math.round(y.x/l[0]),y.y=l[1]*Math.round(y.y/l[1]));const{positionAbsolute:v,position:S}=zw(x,y,o,r,void 0,c);x.position=S,x.positionAbsolute=v}return x});s(b,!0,!1)},[])}const fs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Hi=t=>{const e=({id:n,type:o,data:r,xPos:s,yPos:i,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:u,onMouseMove:f,onMouseLeave:m,onContextMenu:_,onDoubleClick:g,style:p,className:b,isDraggable:x,isSelectable:y,isConnectable:v,isFocusable:S,selectNodesOnDrag:k,sourcePosition:j,targetPosition:E,hidden:I,resizeObserver:T,dragHandle:M,zIndex:R,isParent:B,noDragClassName:O,noPanClassName:z,initialized:F,disableKeyboardA11y:V,ariaLabel:L,rfId:C,hasHandleBounds:$})=>{const N=qt(),H=A.useRef(null),Y=A.useRef(null),Z=A.useRef(j),q=A.useRef(E),re=A.useRef(o),ne=y||x||d||u||f||m,oe=Vw(),G=$i(n,N.getState,u),Q=$i(n,N.getState,f),le=$i(n,N.getState,m),fe=$i(n,N.getState,_),de=$i(n,N.getState,g);A.useEffect(()=>()=>{Y.current&&(T==null||T.unobserve(Y.current),Y.current=null)},[]),A.useEffect(()=>{if(H.current&&!I){const se=H.current;F&&$&&Y.current===se||(Y.current&&(T==null||T.unobserve(Y.current)),T==null||T.observe(se),Y.current=se)}},[I,F,$]),A.useEffect(()=>{const se=re.current!==o,ye=Z.current!==j,je=q.current!==E;H.current&&(se||ye||je)&&(se&&(re.current=o),ye&&(Z.current=j),je&&(q.current=E),N.getState().updateNodeDimensions([{id:n,nodeElement:H.current,forceUpdate:!0}]))},[n,o,j,E]);const he=Uw({nodeRef:H,disabled:I||!x,noDragClassName:O,handleSelector:M,nodeId:n,isSelectable:y,selectNodesOnDrag:k});return I?null:K.createElement("div",{className:dn(["react-flow__node",`react-flow__node-${o}`,{[z]:x},b,{selected:c,selectable:y,parent:B,dragging:he}]),ref:H,style:{zIndex:R,transform:`translate(${a}px,${l}px)`,pointerEvents:ne?"all":"none",visibility:F?"visible":"hidden",...p},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:G,onMouseMove:Q,onMouseLeave:le,onContextMenu:fe,onClick:se=>{const{nodeDragThreshold:ye}=N.getState();if(y&&(!k||!x||ye>0)&&_h({id:n,store:N,nodeRef:H}),d){const je=N.getState().nodeInternals.get(n);je&&d(se,{...je})}},onDoubleClick:de,onKeyDown:S?se=>{if(!Qu(se)&&!V)if(Yx.includes(se.key)&&y){const ye=se.key==="Escape";_h({id:n,store:N,unselect:ye,nodeRef:H})}else x&&c&&Object.prototype.hasOwnProperty.call(fs,se.key)&&(N.setState({ariaLiveMessage:`Moved selected node ${se.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~s}, y: ${~~i}`}),oe({x:fs[se.key].x,y:fs[se.key].y,isShiftPressed:se.shiftKey}))}:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":V?void 0:`${Sw}-${C}`,"aria-label":L},K.createElement(jO,{value:n},K.createElement(t,{id:n,data:r,type:o,xPos:s,yPos:i,selected:c,isConnectable:v,sourcePosition:j,targetPosition:E,dragging:he,dragHandle:M,zIndex:R})))};return e.displayName="NodeWrapper",A.memo(e)};const QO=t=>{const e=t.getNodes().filter(n=>n.selected);return{...lh(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};var e9=A.memo(function({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const o=qt(),{width:r,height:s,x:i,y:a,transformString:l,userSelectionActive:c}=mt(QO,nn),d=Vw(),u=A.useRef(null);if(A.useEffect(()=>{var m;n||((m=u.current)==null||m.focus({preventScroll:!0}))},[n]),Uw({nodeRef:u}),c||!r||!s)return null;const f=t?m=>{const _=o.getState().getNodes().filter(g=>g.selected);t(m,_)}:void 0;return K.createElement("div",{className:dn(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l}},K.createElement("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m=>{Object.prototype.hasOwnProperty.call(fs,m.key)&&d({x:fs[m.key].x,y:fs[m.key].y,isShiftPressed:m.shiftKey})},style:{width:r,height:s,top:a,left:i}}))});const t9=t=>t.nodesSelectionActive,$w=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:u,selectionOnDrag:f,selectionMode:m,onSelectionStart:_,onSelectionEnd:g,multiSelectionKeyCode:p,panActivationKeyCode:b,zoomActivationKeyCode:x,elementsSelectable:y,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:k,panOnScrollSpeed:j,panOnScrollMode:E,zoomOnDoubleClick:I,panOnDrag:T,defaultViewport:M,translateExtent:R,minZoom:B,maxZoom:O,preventScrolling:z,onSelectionContextMenu:F,noWheelClassName:V,noPanClassName:L,disableKeyboardA11y:C})=>{const $=mt(t9),N=Ui(u),H=Ui(b),Y=H||T,Z=H||k,q=N||f&&Y!==!0;return(({deleteKeyCode:re,multiSelectionKeyCode:ne})=>{const oe=qt(),{deleteElements:G}=Vi(),Q=Ui(re,qO),le=Ui(ne);A.useEffect(()=>{if(Q){const{edges:fe,getNodes:de}=oe.getState(),he=de().filter(ye=>ye.selected),se=fe.filter(ye=>ye.selected);G({nodes:he,edges:se}),oe.setState({nodesSelectionActive:!1})}},[Q]),A.useEffect(()=>{oe.setState({multiSelectionActive:le})},[le])})({deleteKeyCode:a,multiSelectionKeyCode:p}),K.createElement(YO,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:Z,panOnScrollSpeed:j,panOnScrollMode:E,zoomOnDoubleClick:I,panOnDrag:!N&&Y,defaultViewport:M,translateExtent:R,minZoom:B,maxZoom:O,zoomActivationKeyCode:x,preventScrolling:z,noWheelClassName:V,noPanClassName:L},K.createElement(Pw,{onSelectionStart:_,onSelectionEnd:g,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,panOnDrag:Y,isSelecting:!!q,selectionMode:m},t,$&&K.createElement(e9,{onSelectionContextMenu:F,noPanClassName:L,disableKeyboardA11y:C})))};$w.displayName="FlowRenderer";var n9=A.memo($w);function o9(t){return{input:Hi(t.input||yw),default:Hi(t.default||uh),output:Hi(t.output||ww),group:Hi(t.group||hh),...Object.keys(t).filter(e=>!["input","default","output","group"].includes(e)).reduce((e,n)=>(e[n]=Hi(t[n]||uh),e),{})}}const r9=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),Hw=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,updateNodeDimensions:s,onError:i}=mt(r9,nn),a=(l=t.onlyRenderVisibleElements,mt(A.useCallback(u=>l?lw(u.nodeInternals,{x:0,y:0,width:u.width,height:u.height},u.transform,!0):u.getNodes(),[l])));var l;const c=A.useRef(),d=A.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const u=new ResizeObserver(f=>{const m=f.map(_=>({id:_.target.getAttribute("data-id"),nodeElement:_.target,forceUpdate:!0}));s(m)});return c.current=u,u},[]);return A.useEffect(()=>()=>{var u;(u=c==null?void 0:c.current)==null||u.disconnect()},[]),K.createElement("div",{className:"react-flow__nodes",style:mh},a.map(u=>{var k,j,E;let f=u.type||"default";t.nodeTypes[f]||(i==null||i("003",pO(f)),f="default");const m=t.nodeTypes[f]||t.nodeTypes.default,_=!!(u.draggable||e&&u.draggable===void 0),g=!!(u.selectable||r&&u.selectable===void 0),p=!!(u.connectable||n&&u.connectable===void 0),b=!!(u.focusable||o&&u.focusable===void 0),x=t.nodeExtent?Ku(u.positionAbsolute,t.nodeExtent):u.positionAbsolute,y=(x==null?void 0:x.x)??0,v=(x==null?void 0:x.y)??0,S=(({x:I,y:T,width:M,height:R,origin:B})=>M&&R?B[0]<0||B[1]<0||B[0]>1||B[1]>1?{x:I,y:T}:{x:I-M*B[0],y:T-R*B[1]}:{x:I,y:T})({x:y,y:v,width:u.width??0,height:u.height??0,origin:t.nodeOrigin});return K.createElement(m,{key:u.id,id:u.id,className:u.className,style:u.style,type:f,data:u.data,sourcePosition:u.sourcePosition||Ve.Bottom,targetPosition:u.targetPosition||Ve.Top,hidden:u.hidden,xPos:y,yPos:v,xPosOrigin:S.x,yPosOrigin:S.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!u.selected,isDraggable:_,isSelectable:g,isConnectable:p,isFocusable:b,resizeObserver:d,dragHandle:u.dragHandle,zIndex:((k=u[Ct])==null?void 0:k.z)??0,isParent:!!((j=u[Ct])!=null&&j.isParent),noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!u.width&&!!u.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:u.ariaLabel,hasHandleBounds:!!((E=u[Ct])!=null&&E.handleBounds)})}))};Hw.displayName="NodeRenderer";var s9=A.memo(Hw);const i9=(t,e,n)=>n===Ve.Left?t-e:n===Ve.Right?t+e:t,a9=(t,e,n)=>n===Ve.Top?t-e:n===Ve.Bottom?t+e:t,Ww="react-flow__edgeupdater",qw=({position:t,centerX:e,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:s,onMouseOut:i,type:a})=>K.createElement("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:i,className:dn([Ww,`${Ww}-${a}`]),cx:i9(e,o,t),cy:a9(n,o,t),r:o,stroke:"transparent",fill:"transparent"}),l9=()=>!0;var ms=t=>{const e=({id:n,className:o,type:r,data:s,onClick:i,onEdgeDoubleClick:a,selected:l,animated:c,label:d,labelStyle:u,labelShowBg:f,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:g,style:p,source:b,target:x,sourceX:y,sourceY:v,targetX:S,targetY:k,sourcePosition:j,targetPosition:E,elementsSelectable:I,hidden:T,sourceHandleId:M,targetHandleId:R,onContextMenu:B,onMouseEnter:O,onMouseMove:z,onMouseLeave:F,reconnectRadius:V,onReconnect:L,onReconnectStart:C,onReconnectEnd:$,markerEnd:N,markerStart:H,rfId:Y,ariaLabel:Z,isFocusable:q,isReconnectable:re,pathOptions:ne,interactionWidth:oe,disableKeyboardA11y:G})=>{const Q=A.useRef(null),[le,fe]=A.useState(!1),[de,he]=A.useState(!1),se=qt(),ye=A.useMemo(()=>`url('#${ih(H,Y)}')`,[H,Y]),je=A.useMemo(()=>`url('#${ih(N,Y)}')`,[N,Y]);if(T)return null;const ce=Fi(n,se.getState,a),Ee=Fi(n,se.getState,B),_e=Fi(n,se.getState,O),De=Fi(n,se.getState,z),Fe=Fi(n,se.getState,F),He=(nt,it)=>{if(nt.button!==0)return;const{edges:te,isValidConnection:ke}=se.getState(),Ie=it?x:b,ze=(it?R:M)||null,J=it?"target":"source",pe=ke||l9,ge=it,ue=te.find(Se=>Se.id===n);he(!0),C==null||C(nt,ue,J),mw({event:nt,handleId:ze,nodeId:Ie,onConnect:Se=>L==null?void 0:L(ue,Se),isTarget:ge,getState:se.getState,setState:se.setState,isValidConnection:pe,edgeUpdaterType:J,onReconnectEnd:Se=>{he(!1),$==null||$(Se,ue,J)}})},Xe=()=>fe(!0),Le=()=>fe(!1),et=!I&&!i;return K.createElement("g",{className:dn(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:l,animated:c,inactive:et,updating:le}]),onClick:nt=>{var J;const{edges:it,addSelectedEdges:te,unselectNodesAndEdges:ke,multiSelectionActive:Ie}=se.getState(),ze=it.find(pe=>pe.id===n);ze&&(I&&(se.setState({nodesSelectionActive:!1}),ze.selected&&Ie?(ke({nodes:[],edges:[ze]}),(J=Q.current)==null||J.blur()):te([n])),i&&i(nt,ze))},onDoubleClick:ce,onContextMenu:Ee,onMouseEnter:_e,onMouseMove:De,onMouseLeave:Fe,onKeyDown:q?nt=>{var it;if(!G&&Yx.includes(nt.key)&&I){const{unselectNodesAndEdges:te,addSelectedEdges:ke,edges:Ie}=se.getState();nt.key==="Escape"?((it=Q.current)==null||it.blur(),te({edges:[Ie.find(ze=>ze.id===n)]})):ke([n])}}:void 0,tabIndex:q?0:void 0,role:q?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":Z===null?void 0:Z||`Edge from ${b} to ${x}`,"aria-describedby":q?`${Cw}-${Y}`:void 0,ref:Q},!de&&K.createElement(t,{id:n,source:b,target:x,selected:l,animated:c,label:d,labelStyle:u,labelShowBg:f,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:g,data:s,style:p,sourceX:y,sourceY:v,targetX:S,targetY:k,sourcePosition:j,targetPosition:E,sourceHandleId:M,targetHandleId:R,markerStart:ye,markerEnd:je,pathOptions:ne,interactionWidth:oe}),re&&K.createElement(K.Fragment,null,(re==="source"||re===!0)&&K.createElement(qw,{position:j,centerX:y,centerY:v,radius:V,onMouseDown:nt=>He(nt,!0),onMouseEnter:Xe,onMouseOut:Le,type:"source"}),(re==="target"||re===!0)&&K.createElement(qw,{position:E,centerX:S,centerY:k,radius:V,onMouseDown:nt=>He(nt,!1),onMouseEnter:Xe,onMouseOut:Le,type:"target"})))};return e.displayName="EdgeWrapper",A.memo(e)};function c9(t){return{default:ms(t.default||Rl),straight:ms(t.bezier||rh),step:ms(t.step||oh),smoothstep:ms(t.step||Ol),simplebezier:ms(t.simplebezier||th),...Object.keys(t).filter(e=>!["default","bezier"].includes(e)).reduce((e,n)=>(e[n]=ms(t[n]||Rl),e),{})}}function Gw(t,e,n=null){const o=((n==null?void 0:n.x)||0)+e.x,r=((n==null?void 0:n.y)||0)+e.y,s=(n==null?void 0:n.width)||e.width,i=(n==null?void 0:n.height)||e.height;switch(t){case Ve.Top:return{x:o+s/2,y:r};case Ve.Right:return{x:o+s,y:r+i/2};case Ve.Bottom:return{x:o+s/2,y:r+i};case Ve.Left:return{x:o,y:r+i/2}}}function Yw(t,e){return t?t.length!==1&&e?e&&t.find(n=>n.id===e)||null:t[0]:null}function Jw(t){var o,r,s,i,a;const e=((o=t==null?void 0:t[Ct])==null?void 0:o.handleBounds)||null,n=e&&(t==null?void 0:t.width)&&(t==null?void 0:t.height)&&((r=t==null?void 0:t.positionAbsolute)==null?void 0:r.x)!==void 0&&((s=t==null?void 0:t.positionAbsolute)==null?void 0:s.y)!==void 0;return[{x:((i=t==null?void 0:t.positionAbsolute)==null?void 0:i.x)||0,y:((a=t==null?void 0:t.positionAbsolute)==null?void 0:a.y)||0,width:(t==null?void 0:t.width)||0,height:(t==null?void 0:t.height)||0},e,!!n]}const d9=[{level:0,isMaxLevel:!0,edges:[]}];function u9(t,e,n){return function(o,r,s=!1){let i=-1;const a=o.reduce((c,d)=>{var m,_;const u=Pn(d.zIndex);let f=u?d.zIndex:0;if(s){const g=r.get(d.target),p=r.get(d.source),b=d.selected||(g==null?void 0:g.selected)||(p==null?void 0:p.selected),x=Math.max(((m=p==null?void 0:p[Ct])==null?void 0:m.z)||0,((_=g==null?void 0:g[Ct])==null?void 0:_.z)||0,1e3);f=(u?d.zIndex:0)+(b?x:0)}return c[f]?c[f].push(d):c[f]=[d],i=f>i?f:i,c},{}),l=Object.entries(a).map(([c,d])=>{const u=+c;return{edges:d,level:u,isMaxLevel:u===i}});return l.length===0?d9:l}(mt(A.useCallback(o=>t?o.edges.filter(r=>{const s=e.get(r.source),i=e.get(r.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&function({sourcePos:a,targetPos:l,sourceWidth:c,sourceHeight:d,targetWidth:u,targetHeight:f,width:m,height:_,transform:g}){const p={x:Math.min(a.x,l.x),y:Math.min(a.y,l.y),x2:Math.max(a.x+c,l.x+u),y2:Math.max(a.y+d,l.y+f)};p.x===p.x2&&(p.x2+=1),p.y===p.y2&&(p.y2+=1);const b=Xu({x:(0-g[0])/g[2],y:(0-g[1])/g[2],width:m/g[2],height:_/g[2]}),x=Math.max(0,Math.min(b.x2,p.x2)-Math.max(b.x,p.x)),y=Math.max(0,Math.min(b.y2,p.y2)-Math.max(b.y,p.y));return Math.ceil(x*y)>0}({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:i.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:i.width,targetHeight:i.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[t,e])),e,n)}const Kw={[as.Arrow]:({color:t="none",strokeWidth:e=1})=>K.createElement("polyline",{style:{stroke:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[as.ArrowClosed]:({color:t="none",strokeWidth:e=1})=>K.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},h9=({id:t,type:e,color:n,width:o=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:i,orient:a="auto-start-reverse"})=>{const l=function(c){const d=qt();return A.useMemo(()=>{var u,f;return Object.prototype.hasOwnProperty.call(Kw,c)?Kw[c]:((f=(u=d.getState()).onError)==null||f.call(u,"009",bO(c)),null)},[c])}(e);return l?K.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:a,refX:"0",refY:"0"},K.createElement(l,{color:n,strokeWidth:i})):null},Xw=({defaultColor:t,rfId:e})=>{const n=mt(A.useCallback((({defaultColor:o,rfId:r})=>s=>{const i=[];return s.edges.reduce((a,l)=>([l.markerStart,l.markerEnd].forEach(c=>{if(c&&typeof c=="object"){const d=ih(c,r);i.includes(d)||(a.push({id:d,color:c.color||o,...c}),i.push(d))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))})({defaultColor:t,rfId:e}),[t,e]),(o,r)=>!(o.length!==r.length||o.some((s,i)=>s.id!==r[i].id)));return K.createElement("defs",null,n.map(o=>K.createElement(h9,{id:o.id,key:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient})))};Xw.displayName="MarkerDefinitions";var f9=A.memo(Xw);const m9=t=>({nodesConnectable:t.nodesConnectable,edgesFocusable:t.edgesFocusable,edgesUpdatable:t.edgesUpdatable,elementsSelectable:t.elementsSelectable,width:t.width,height:t.height,connectionMode:t.connectionMode,nodeInternals:t.nodeInternals,onError:t.onError}),Zw=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:o,edgeTypes:r,noPanClassName:s,onEdgeContextMenu:i,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,onEdgeDoubleClick:u,onReconnect:f,onReconnectStart:m,onReconnectEnd:_,reconnectRadius:g,children:p,disableKeyboardA11y:b})=>{const{edgesFocusable:x,edgesUpdatable:y,elementsSelectable:v,width:S,height:k,connectionMode:j,nodeInternals:E,onError:I}=mt(m9,nn),T=u9(e,E,n);return S?K.createElement(K.Fragment,null,T.map(({level:M,edges:R,isMaxLevel:B})=>K.createElement("svg",{key:M,style:{zIndex:M},width:S,height:k,className:"react-flow__edges react-flow__container"},B&&K.createElement(f9,{defaultColor:t,rfId:o}),K.createElement("g",null,R.map(O=>{const[z,F,V]=Jw(E.get(O.source)),[L,C,$]=Jw(E.get(O.target));if(!V||!$)return null;let N=O.type||"default";r[N]||(I==null||I("011",wO(N)),N="default");const H=r[N]||r.default,Y=j===Cr.Strict?C.target:(C.target??[]).concat(C.source??[]),Z=Yw(F.source,O.sourceHandle),q=Yw(Y,O.targetHandle),re=(Z==null?void 0:Z.position)||Ve.Bottom,ne=(q==null?void 0:q.position)||Ve.Top,oe=!!(O.focusable||x&&O.focusable===void 0),G=O.reconnectable||O.updatable,Q=f!==void 0&&(G||y&&G===void 0);if(!Z||!q)return I==null||I("008",yO(Z,O)),null;const{sourceX:le,sourceY:fe,targetX:de,targetY:he}=((se,ye,je,ce,Ee,_e)=>{const De=Gw(je,se,ye),Fe=Gw(_e,ce,Ee);return{sourceX:De.x,sourceY:De.y,targetX:Fe.x,targetY:Fe.y}})(z,Z,re,L,q,ne);return K.createElement(H,{key:O.id,id:O.id,className:dn([O.className,s]),type:N,data:O.data,selected:!!O.selected,animated:!!O.animated,hidden:!!O.hidden,label:O.label,labelStyle:O.labelStyle,labelShowBg:O.labelShowBg,labelBgStyle:O.labelBgStyle,labelBgPadding:O.labelBgPadding,labelBgBorderRadius:O.labelBgBorderRadius,style:O.style,source:O.source,target:O.target,sourceHandleId:O.sourceHandle,targetHandleId:O.targetHandle,markerEnd:O.markerEnd,markerStart:O.markerStart,sourceX:le,sourceY:fe,targetX:de,targetY:he,sourcePosition:re,targetPosition:ne,elementsSelectable:v,onContextMenu:i,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:d,onEdgeDoubleClick:u,onReconnect:f,onReconnectStart:m,onReconnectEnd:_,reconnectRadius:g,rfId:o,ariaLabel:O.ariaLabel,isFocusable:oe,isReconnectable:Q,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth,disableKeyboardA11y:b})})))),p):null};Zw.displayName="EdgeRenderer";var p9=A.memo(Zw);const g9=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function _9({children:t}){const e=mt(g9);return K.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}const b9={[Ve.Left]:Ve.Right,[Ve.Right]:Ve.Left,[Ve.Top]:Ve.Bottom,[Ve.Bottom]:Ve.Top},Qw=({nodeId:t,handleType:e,style:n,type:o=tr.Bezier,CustomComponent:r,connectionStatus:s})=>{var k,j,E;const{fromNode:i,handleId:a,toX:l,toY:c,connectionMode:d}=mt(A.useCallback(I=>({fromNode:I.nodeInternals.get(t),handleId:I.connectionHandleId,toX:(I.connectionPosition.x-I.transform[0])/I.transform[2],toY:(I.connectionPosition.y-I.transform[1])/I.transform[2],connectionMode:I.connectionMode}),[t]),nn),u=(k=i==null?void 0:i[Ct])==null?void 0:k.handleBounds;let f=u==null?void 0:u[e];if(d===Cr.Loose&&(f=f||(u==null?void 0:u[e==="source"?"target":"source"])),!i||!f)return null;const m=a?f.find(I=>I.id===a):f[0],_=m?m.x+m.width/2:(i.width??0)/2,g=m?m.y+m.height/2:i.height??0,p=(((j=i.positionAbsolute)==null?void 0:j.x)??0)+_,b=(((E=i.positionAbsolute)==null?void 0:E.y)??0)+g,x=m==null?void 0:m.position,y=x?b9[x]:null;if(!x||!y)return null;if(r)return K.createElement(r,{connectionLineType:o,connectionLineStyle:n,fromNode:i,fromHandle:m,fromX:p,fromY:b,toX:l,toY:c,fromPosition:x,toPosition:y,connectionStatus:s});let v="";const S={sourceX:p,sourceY:b,sourcePosition:x,targetX:l,targetY:c,targetPosition:y};return o===tr.Bezier?[v]=iw(S):o===tr.Step?[v]=nh({...S,borderRadius:0}):o===tr.SmoothStep?[v]=nh(S):o===tr.SimpleBezier?[v]=nw(S):v=`M${p},${b} ${l},${c}`,K.createElement("path",{d:v,fill:"none",className:"react-flow__connection-path",style:n})};Qw.displayName="ConnectionLine";const y9=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function x9({containerStyle:t,style:e,type:n,component:o}){const{nodeId:r,handleType:s,nodesConnectable:i,width:a,height:l,connectionStatus:c}=mt(y9,nn);return r&&s&&a&&i?K.createElement("svg",{style:t,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},K.createElement("g",{className:dn(["react-flow__connection",c])},K.createElement(Qw,{nodeId:r,handleType:s,style:e,type:n,CustomComponent:o,connectionStatus:c}))):null}function ev(t,e){return A.useRef(null),qt(),A.useMemo(()=>e(t),[t])}const tv=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:o,onMoveEnd:r,onInit:s,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:m,onSelectionContextMenu:_,onSelectionStart:g,onSelectionEnd:p,connectionLineType:b,connectionLineStyle:x,connectionLineComponent:y,connectionLineContainerStyle:v,selectionKeyCode:S,selectionOnDrag:k,selectionMode:j,multiSelectionKeyCode:E,panActivationKeyCode:I,zoomActivationKeyCode:T,deleteKeyCode:M,onlyRenderVisibleElements:R,elementsSelectable:B,selectNodesOnDrag:O,defaultViewport:z,translateExtent:F,minZoom:V,maxZoom:L,preventScrolling:C,defaultMarkerColor:$,zoomOnScroll:N,zoomOnPinch:H,panOnScroll:Y,panOnScrollSpeed:Z,panOnScrollMode:q,zoomOnDoubleClick:re,panOnDrag:ne,onPaneClick:oe,onPaneMouseEnter:G,onPaneMouseMove:Q,onPaneMouseLeave:le,onPaneScroll:fe,onPaneContextMenu:de,onEdgeContextMenu:he,onEdgeMouseEnter:se,onEdgeMouseMove:ye,onEdgeMouseLeave:je,onReconnect:ce,onReconnectStart:Ee,onReconnectEnd:_e,reconnectRadius:De,noDragClassName:Fe,noWheelClassName:He,noPanClassName:Xe,elevateEdgesOnSelect:Le,disableKeyboardA11y:et,nodeOrigin:nt,nodeExtent:it,rfId:te})=>{const ke=ev(t,o9),Ie=ev(e,c9);return function(ze){const J=Vi(),pe=A.useRef(!1);A.useEffect(()=>{!pe.current&&J.viewportInitialized&&ze&&(setTimeout(()=>ze(J),1),pe.current=!0)},[ze,J.viewportInitialized])}(s),K.createElement(n9,{onPaneClick:oe,onPaneMouseEnter:G,onPaneMouseMove:Q,onPaneMouseLeave:le,onPaneContextMenu:de,onPaneScroll:fe,deleteKeyCode:M,selectionKeyCode:S,selectionOnDrag:k,selectionMode:j,onSelectionStart:g,onSelectionEnd:p,multiSelectionKeyCode:E,panActivationKeyCode:I,zoomActivationKeyCode:T,elementsSelectable:B,onMove:n,onMoveStart:o,onMoveEnd:r,zoomOnScroll:N,zoomOnPinch:H,zoomOnDoubleClick:re,panOnScroll:Y,panOnScrollSpeed:Z,panOnScrollMode:q,panOnDrag:ne,defaultViewport:z,translateExtent:F,minZoom:V,maxZoom:L,onSelectionContextMenu:_,preventScrolling:C,noDragClassName:Fe,noWheelClassName:He,noPanClassName:Xe,disableKeyboardA11y:et},K.createElement(_9,null,K.createElement(p9,{edgeTypes:Ie,onEdgeClick:a,onEdgeDoubleClick:c,onlyRenderVisibleElements:R,onEdgeContextMenu:he,onEdgeMouseEnter:se,onEdgeMouseMove:ye,onEdgeMouseLeave:je,onReconnect:ce,onReconnectStart:Ee,onReconnectEnd:_e,reconnectRadius:De,defaultMarkerColor:$,noPanClassName:Xe,elevateEdgesOnSelect:!!Le,disableKeyboardA11y:et,rfId:te},K.createElement(x9,{style:x,type:b,component:y,containerStyle:v})),K.createElement("div",{className:"react-flow__edgelabel-renderer"}),K.createElement(s9,{nodeTypes:ke,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:m,selectNodesOnDrag:O,onlyRenderVisibleElements:R,noPanClassName:Xe,noDragClassName:Fe,disableKeyboardA11y:et,nodeOrigin:nt,nodeExtent:it,rfId:te})))};tv.displayName="GraphView";var w9=A.memo(tv);const yh=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],rr={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:yh,nodeExtent:yh,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Cr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:(t,e)=>{},isValidConnection:void 0},v9=()=>((t,e)=>t?zx(t,e):zx)((t,e)=>({...rr,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:s}=e();t({nodeInternals:fh(n,o,r,s)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:o={}}=e();t({edges:n.map(r=>({...o,...r}))})},setDefaultNodesAndEdges:(n,o)=>{const r=n!==void 0,s=o!==void 0,i=r?fh(n,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;t({nodeInternals:i,edges:s?o:[],hasDefaultNodes:r,hasDefaultEdges:s})},updateNodeDimensions:n=>{const{onNodesChange:o,nodeInternals:r,fitViewOnInit:s,fitViewOnInitDone:i,fitViewOnInitOptions:a,domNode:l,nodeOrigin:c}=e(),d=l==null?void 0:l.querySelector(".react-flow__viewport");if(!d)return;const u=window.getComputedStyle(d),{m22:f}=new window.DOMMatrixReadOnly(u.transform),m=n.reduce((g,p)=>{const b=r.get(p.id);if(b!=null&&b.hidden)r.set(b.id,{...b,[Ct]:{...b[Ct],handleBounds:void 0}});else if(b){const x=Ju(p.nodeElement);!(!x.width||!x.height||b.width===x.width&&b.height===x.height&&!p.forceUpdate)&&(r.set(b.id,{...b,[Ct]:{...b[Ct],handleBounds:{source:Bw(".source",p.nodeElement,f,c),target:Bw(".target",p.nodeElement,f,c)}},...x}),g.push({id:b.id,type:"dimensions",dimensions:x}))}return g},[]);Iw(r,c);const _=i||s&&!i&&Aw(e,{initial:!0,...a});t({nodeInternals:new Map(r),fitViewOnInitDone:_}),(m==null?void 0:m.length)>0&&(o==null||o(m))},updateNodePositions:(n,o=!0,r=!1)=>{const{triggerNodeChanges:s}=e(),i=n.map(a=>{const l={id:a.id,type:"position",dragging:r};return o&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});s(i)},triggerNodeChanges:n=>{const{onNodesChange:o,nodeInternals:r,hasDefaultNodes:s,nodeOrigin:i,getNodes:a,elevateNodesOnSelect:l}=e();if(n!=null&&n.length){if(s){const c=fh(Rw(n,a()),r,i,l);t({nodeInternals:c})}o==null||o(n)}},addSelectedNodes:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let i,a=null;o?i=n.map(l=>or(l,!0)):(i=hs(s(),n),a=hs(r,[])),Ll({changedNodes:i,changedEdges:a,get:e,set:t})},addSelectedEdges:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let i,a=null;o?i=n.map(l=>or(l,!0)):(i=hs(r,n),a=hs(s(),[])),Ll({changedNodes:a,changedEdges:i,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:s}=e(),i=o||r;Ll({changedNodes:(n||s()).map(a=>(a.selected=!1,or(a.id,!1))),changedEdges:i.map(a=>or(a.id,!1)),get:e,set:t})},setMinZoom:n=>{const{d3Zoom:o,maxZoom:r}=e();o==null||o.scaleExtent([n,r]),t({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:o,minZoom:r}=e();o==null||o.scaleExtent([r,n]),t({maxZoom:n})},setTranslateExtent:n=>{var o;(o=e().d3Zoom)==null||o.translateExtent(n),t({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:o}=e();Ll({changedNodes:o().filter(r=>r.selected).map(r=>or(r.id,!1)),changedEdges:n.filter(r=>r.selected).map(r=>or(r.id,!1)),get:e,set:t})},setNodeExtent:n=>{const{nodeInternals:o}=e();o.forEach(r=>{r.positionAbsolute=Ku(r.position,n)}),t({nodeExtent:n,nodeInternals:new Map(o)})},panBy:n=>{const{transform:o,width:r,height:s,d3Zoom:i,d3Selection:a,translateExtent:l}=e();if(!i||!a||!n.x&&!n.y)return!1;const c=gr.translate(o[0]+n.x,o[1]+n.y).scale(o[2]),d=[[0,0],[r,s]],u=i==null?void 0:i.constrain()(c,d,l);return i.transform(a,u),o[0]!==u.x||o[1]!==u.y||o[2]!==u.k},cancelConnection:()=>t({connectionNodeId:rr.connectionNodeId,connectionHandleId:rr.connectionHandleId,connectionHandleType:rr.connectionHandleType,connectionStatus:rr.connectionStatus,connectionStartHandle:rr.connectionStartHandle,connectionEndHandle:rr.connectionEndHandle}),reset:()=>t({...rr})}),Object.is),xh=({children:t})=>{const e=A.useRef(null);return e.current||(e.current=v9()),K.createElement(mO,{value:e.current},t)};xh.displayName="ReactFlowProvider";const nv=({children:t})=>A.useContext(Il)?K.createElement(K.Fragment,null,t):K.createElement(xh,null,t);nv.displayName="ReactFlowWrapper";const k9={input:yw,default:uh,output:ww,group:hh},S9={default:Rl,straight:rh,step:oh,smoothstep:Ol,simplebezier:th},C9=[0,0],N9=[15,15],j9={x:0,y:0,zoom:1},E9={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},wh=A.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:s=k9,edgeTypes:i=S9,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:u,onMoveEnd:f,onConnect:m,onConnectStart:_,onConnectEnd:g,onClickConnectStart:p,onClickConnectEnd:b,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:k,onNodeDragStart:j,onNodeDrag:E,onNodeDragStop:I,onNodesDelete:T,onEdgesDelete:M,onSelectionChange:R,onSelectionDragStart:B,onSelectionDrag:O,onSelectionDragStop:z,onSelectionContextMenu:F,onSelectionStart:V,onSelectionEnd:L,connectionMode:C=Cr.Strict,connectionLineType:$=tr.Bezier,connectionLineStyle:N,connectionLineComponent:H,connectionLineContainerStyle:Y,deleteKeyCode:Z="Backspace",selectionKeyCode:q="Shift",selectionOnDrag:re=!1,selectionMode:ne=zi.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:G=Tl()?"Meta":"Control",zoomActivationKeyCode:Q=Tl()?"Meta":"Control",snapToGrid:le=!1,snapGrid:fe=N9,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:he=!0,nodesDraggable:se,nodesConnectable:ye,nodesFocusable:je,nodeOrigin:ce=C9,edgesFocusable:Ee,edgesUpdatable:_e,elementsSelectable:De,defaultViewport:Fe=j9,minZoom:He=.5,maxZoom:Xe=2,translateExtent:Le=yh,preventScrolling:et=!0,nodeExtent:nt,defaultMarkerColor:it="#b1b1b7",zoomOnScroll:te=!0,zoomOnPinch:ke=!0,panOnScroll:Ie=!1,panOnScrollSpeed:ze=.5,panOnScrollMode:J=er.Free,zoomOnDoubleClick:pe=!0,panOnDrag:ge=!0,onPaneClick:ue,onPaneMouseEnter:Se,onPaneMouseMove:we,onPaneMouseLeave:Ue,onPaneScroll:Ze,onPaneContextMenu:ae,children:Ce,onEdgeContextMenu:Ne,onEdgeDoubleClick:Be,onEdgeMouseEnter:We,onEdgeMouseMove:Re,onEdgeMouseLeave:Ge,onEdgeUpdate:ot,onEdgeUpdateStart:Ye,onEdgeUpdateEnd:rt,onReconnect:pt,onReconnectStart:yt,onReconnectEnd:Tt,reconnectRadius:xt=10,edgeUpdaterRadius:Bt=10,onNodesChange:Cn,onEdgesChange:un,noDragClassName:rn="nodrag",noWheelClassName:Zt="nowheel",noPanClassName:Yn="nopan",fitView:fo=!1,fitViewOptions:vs,connectOnClick:ks=!0,attributionPosition:Ss,proOptions:Cs,defaultEdgeOptions:Ns,elevateNodesOnSelect:ar=!0,elevateEdgesOnSelect:js=!1,disableKeyboardA11y:Es=!1,autoPanOnConnect:Is=!0,autoPanOnNodeDrag:Pt=!0,connectionRadius:wt=20,isValidConnection:Nn,onError:jn,style:As,id:ec,nodeDragThreshold:Xf,...Zf},tc)=>{const Qf=ec||"1";return K.createElement("div",{...Zf,style:{...As,...E9},ref:tc,className:dn(["react-flow",r]),"data-testid":"rf__wrapper",id:ec},K.createElement(nv,null,K.createElement(w9,{onInit:c,onMove:d,onMoveStart:u,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:k,nodeTypes:s,edgeTypes:i,connectionLineType:$,connectionLineStyle:N,connectionLineComponent:H,connectionLineContainerStyle:Y,selectionKeyCode:q,selectionOnDrag:re,selectionMode:ne,deleteKeyCode:Z,multiSelectionKeyCode:G,panActivationKeyCode:oe,zoomActivationKeyCode:Q,onlyRenderVisibleElements:de,selectNodesOnDrag:he,defaultViewport:Fe,translateExtent:Le,minZoom:He,maxZoom:Xe,preventScrolling:et,zoomOnScroll:te,zoomOnPinch:ke,zoomOnDoubleClick:pe,panOnScroll:Ie,panOnScrollSpeed:ze,panOnScrollMode:J,panOnDrag:ge,onPaneClick:ue,onPaneMouseEnter:Se,onPaneMouseMove:we,onPaneMouseLeave:Ue,onPaneScroll:Ze,onPaneContextMenu:ae,onSelectionContextMenu:F,onSelectionStart:V,onSelectionEnd:L,onEdgeContextMenu:Ne,onEdgeDoubleClick:Be,onEdgeMouseEnter:We,onEdgeMouseMove:Re,onEdgeMouseLeave:Ge,onReconnect:pt??ot,onReconnectStart:yt??Ye,onReconnectEnd:Tt??rt,reconnectRadius:xt??Bt,defaultMarkerColor:it,noDragClassName:rn,noWheelClassName:Zt,noPanClassName:Yn,elevateEdgesOnSelect:js,rfId:Qf,disableKeyboardA11y:Es,nodeOrigin:ce,nodeExtent:nt}),K.createElement(LO,{nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:m,onConnectStart:_,onConnectEnd:g,onClickConnectStart:p,onClickConnectEnd:b,nodesDraggable:se,nodesConnectable:ye,nodesFocusable:je,edgesFocusable:Ee,edgesUpdatable:_e,elementsSelectable:De,elevateNodesOnSelect:ar,minZoom:He,maxZoom:Xe,nodeExtent:nt,onNodesChange:Cn,onEdgesChange:un,snapToGrid:le,snapGrid:fe,connectionMode:C,translateExtent:Le,connectOnClick:ks,defaultEdgeOptions:Ns,fitView:fo,fitViewOptions:vs,onNodesDelete:T,onEdgesDelete:M,onNodeDragStart:j,onNodeDrag:E,onNodeDragStop:I,onSelectionDrag:O,onSelectionDragStart:B,onSelectionDragStop:z,noPanClassName:Yn,nodeOrigin:ce,rfId:Qf,autoPanOnConnect:Is,autoPanOnNodeDrag:Pt,onError:jn,connectionRadius:wt,isValidConnection:Nn,nodeDragThreshold:Xf}),K.createElement(RO,{onSelectionChange:R}),Ce,K.createElement(SO,{proOptions:Cs,position:Ss}),K.createElement(UO,{rfId:Qf,disableKeyboardA11y:Es})))});function ov(t){return e=>{const[n,o]=A.useState(e),r=A.useCallback(s=>o(i=>t(s,i)),[]);return[n,o,r]}}wh.displayName="ReactFlow";const rv=ov(Rw),sv=ov(function(t,e){return Dw(t,e)});function I9(){return K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},K.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function A9(){return K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},K.createElement("path",{d:"M0 0h32v4.2H0z"}))}function T9(){return K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},K.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function M9(){return K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},K.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function O9(){return K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},K.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const ps=({children:t,className:e,...n})=>K.createElement("button",{type:"button",className:dn(["react-flow__controls-button",e]),...n},t);ps.displayName="ControlButton";const D9=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),iv=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:i,onFitView:a,onInteractiveChange:l,className:c,children:d,position:u="bottom-left"})=>{const f=qt(),[m,_]=A.useState(!1),{isInteractive:g,minZoomReached:p,maxZoomReached:b}=mt(D9,nn),{zoomIn:x,zoomOut:y,fitView:v}=Vi();return A.useEffect(()=>{_(!0)},[]),m?K.createElement(Al,{className:dn(["react-flow__controls",c]),position:u,style:t,"data-testid":"rf__controls"},e&&K.createElement(K.Fragment,null,K.createElement(ps,{onClick:()=>{x(),s==null||s()},className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:b},K.createElement(I9,null)),K.createElement(ps,{onClick:()=>{y(),i==null||i()},className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:p},K.createElement(A9,null))),n&&K.createElement(ps,{className:"react-flow__controls-fitview",onClick:()=>{v(r),a==null||a()},title:"fit view","aria-label":"fit view"},K.createElement(T9,null)),o&&K.createElement(ps,{className:"react-flow__controls-interactive",onClick:()=>{f.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),l==null||l(!g)},title:"toggle interactivity","aria-label":"toggle interactivity"},g?K.createElement(O9,null):K.createElement(M9,null)),d):null};iv.displayName="Controls";var Ln,R9=A.memo(iv);function P9({color:t,dimensions:e,lineWidth:n}){return K.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function L9({color:t,radius:e}){return K.createElement("circle",{cx:e,cy:e,r:e,fill:t})}(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Ln||(Ln={}));const F9={[Ln.Dots]:"#91919a",[Ln.Lines]:"#eee",[Ln.Cross]:"#e2e2e2"},z9={[Ln.Dots]:1,[Ln.Lines]:1,[Ln.Cross]:6},B9=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function av({id:t,variant:e=Ln.Dots,gap:n=20,size:o,lineWidth:r=1,offset:s=2,color:i,style:a,className:l}){const c=A.useRef(null),{transform:d,patternId:u}=mt(B9,nn),f=i||F9[e],m=o||z9[e],_=e===Ln.Dots,g=e===Ln.Cross,p=Array.isArray(n)?n:[n,n],b=[p[0]*d[2]||1,p[1]*d[2]||1],x=m*d[2],y=g?[x,x]:b,v=_?[x/s,x/s]:[y[0]/s,y[1]/s];return K.createElement("svg",{className:dn(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background"},K.createElement("pattern",{id:u+t,x:d[0]%b[0],y:d[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${v[0]},-${v[1]})`},_?K.createElement(L9,{color:f,radius:x/s}):K.createElement(P9,{dimensions:y,color:f,lineWidth:r})),K.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${u+t})`}))}av.displayName="Background";var U9=A.memo(av);function vh(t){return Math.min(11*t+35,200)}const lv=K.createContext("LR"),cv=A.memo(t=>{const e=X.c(51),{data:n,selected:o}=t,r=$e(n.atom),s=Uc().inOrderIds.indexOf(r.id),i=o?"var(--gray-9)":"var(--gray-3)",a=mt(V9),l=A.useContext(lv);let c,d,u,f,m;if(e[0]!==r.code||e[1]!==i||e[2]!==l||e[3]!==o){const M=r.code.split(`
|
117
117
|
`).length,R=l==="LR"?Ve.Left:Ve.Top;let B;e[8]!==i?(B={background:i},e[8]=i,e[9]=B):B=e[9],e[10]!==R||e[11]!==B?(u=h.jsx(nr,{type:"target",id:"inputs",position:R,style:B}),e[10]=R,e[11]=B,e[12]=u):u=e[12];const O=l==="LR"?Ve.Left:Ve.Top;let z;e[13]!==i?(z={background:i},e[13]=i,e[14]=z):z=e[14],e[15]!==O||e[16]!==z?(f=h.jsx(nr,{type:"source",id:"inputs",position:O,style:z}),e[15]=O,e[16]=z,e[17]=f):f=e[17];const F=o&&"border-primary";e[18]!==F?(d=Me("flex flex-col bg-card border border-input/50 rounded-md mx-[2px] overflow-hidden",F),e[18]=F,e[19]=d):d=e[19],c=vh(M),e[0]=r.code,e[1]=i,e[2]=l,e[3]=o,e[4]=c,e[5]=d,e[6]=u,e[7]=f}else c=e[4],d=e[5],u=e[6],f=e[7];var _;let g;e[20]!==n.forceWidth||e[21]!==a?(m=n.forceWidth||(_=a,Math.min(Math.max(_-100,100),400)),e[20]=n.forceWidth,e[21]=a,e[22]=m):m=e[22],e[23]!==c||e[24]!==m?(g={height:c,width:m},e[23]=c,e[24]=m,e[25]=g):g=e[25];const p=eV(r.name,s);let b,x,y;e[26]!==p?(b=h.jsx("div",{className:"text-muted-foreground font-semibold text-xs py-1 px-2 bg-muted border-b",children:p}),e[26]=p,e[27]=b):b=e[27],e[28]!==r.code?(x=h.jsx(H$,{code:r.code}),e[28]=r.code,e[29]=x):x=e[29],e[30]!==d||e[31]!==g||e[32]!==b||e[33]!==x?(y=h.jsxs("div",{className:d,style:g,children:[b,x]}),e[30]=d,e[31]=g,e[32]=b,e[33]=x,e[34]=y):y=e[34];const v=l==="LR"?Ve.Right:Ve.Bottom;let S,k;e[35]!==i?(S={background:i},e[35]=i,e[36]=S):S=e[36],e[37]!==v||e[38]!==S?(k=h.jsx(nr,{type:"source",id:"outputs",position:v,style:S}),e[37]=v,e[38]=S,e[39]=k):k=e[39];const j=l==="LR"?Ve.Right:Ve.Bottom;let E,I,T;return e[40]!==i?(E={background:i},e[40]=i,e[41]=E):E=e[41],e[42]!==j||e[43]!==E?(I=h.jsx(nr,{type:"target",id:"outputs",position:j,style:E}),e[42]=j,e[43]=E,e[44]=I):I=e[44],e[45]!==y||e[46]!==k||e[47]!==I||e[48]!==u||e[49]!==f?(T=h.jsxs("div",{children:[u,f,y,k,I]}),e[45]=y,e[46]=k,e[47]=I,e[48]=u,e[49]=f,e[50]=T):T=e[50],T},(t,e)=>["data","selected","id"].every(n=>t[n]===e[n]));cv.displayName="CustomNode";const dv={custom:cv};function V9(t){const{width:e}=t;return e}const uv=t=>{const e=X.c(18),{maxCount:n,cellIds:o,onClick:r,skipScroll:s}=t,i=Uc();let a,l,c,d;if(e[0]!==o||e[1]!==i||e[2]!==n||e[3]!==r||e[4]!==s){c=Symbol.for("react.early_return_sentinel");e:{let u;e[8]!==i?(u=(_,g)=>i.inOrderIds.indexOf(_)-i.inOrderIds.indexOf(g),e[8]=i,e[9]=u):u=e[9];const f=[...o].sort(u);if(o.length===0){let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx("div",{className:"text-muted-foreground",children:"--"}),e[10]=_):_=e[10],c=_;break e}let m;e[11]!==o.length||e[12]!==r||e[13]!==s?(m=(_,g)=>h.jsxs("span",{className:"truncate",children:[h.jsx(mr,{variant:"focus",cellId:_,skipScroll:s,className:"whitespace-nowrap",onClick:r?()=>r(_):void 0},_),g<o.length-1&&", "]},_),e[11]=o.length,e[12]=r,e[13]=s,e[14]=m):m=e[14],a=f.slice(0,n).map(m),l=o.length>n&&h.jsxs(Mr,{children:[h.jsx(Js,{asChild:!0,children:h.jsxs("span",{className:"whitespace-nowrap text-muted-foreground text-xs hover:underline cursor-pointer",children:["+",o.length-n," more"]})}),h.jsx($s,{className:"w-auto",children:h.jsx("div",{className:"flex flex-col gap-1 py-1",children:f.slice(n).map(_=>h.jsx(mr,{variant:"focus",cellId:_,className:"whitespace-nowrap",onClick:r?()=>r(_):void 0},_))})})]})}e[0]=o,e[1]=i,e[2]=n,e[3]=r,e[4]=s,e[5]=a,e[6]=l,e[7]=c}else a=e[5],l=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:(e[15]!==a||e[16]!==l?(d=h.jsxs(h.Fragment,{children:[a,l]}),e[15]=a,e[16]=l,e[17]=d):d=e[17],d)},kh=t=>{const e=X.c(15);let n,o,r,s;e[0]!==t?({name:o,declaredBy:n,onClick:r,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=s):(n=e[1],o=e[2],r=e[3],s=e[4]);const i=n.length>1?"destructive":"outline";let a,l,c;return e[5]!==o||e[6]!==r?(a=async d=>{r?r(d):(await xn(o),lt({title:"Copied to clipboard"}))},e[5]=o,e[6]=r,e[7]=a):a=e[7],e[8]!==o||e[9]!==i||e[10]!==a?(l=h.jsx(W4,{title:o,variant:i,className:"rounded-sm text-ellipsis block overflow-hidden max-w-fit cursor-pointer font-medium",onClick:a,children:o}),e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],e[12]!==s||e[13]!==l?(c=h.jsx("div",{className:"max-w-[130px]",...s,children:l}),e[12]=s,e[13]=l,e[14]=c):c=e[14],c},Sh=A.memo(t=>{const e=X.c(38),{onChange:n,view:o,settings:r,onSettingsChange:s}=t;let i;e[0]!==s||e[1]!==r?(i=(O,z)=>{s({...r,[O]:z})},e[0]=s,e[1]=r,e[2]=i):i=e[2];const a=i;let l,c,d,u,f,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(Js,{asChild:!0,children:h.jsx(Ae,{variant:"text",size:"xs",children:h.jsx(n4,{className:"w-4 h-4"})})}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx("div",{className:"font-semibold pb-4",children:"Settings"}),e[4]=c):c=e[4],e[5]!==a?(d=O=>a("hidePureMarkdown",!!O),e[5]=a,e[6]=d):d=e[6],e[7]!==r.hidePureMarkdown||e[8]!==d?(u=h.jsx(N4,{"data-testid":"hide-pure-markdown-checkbox",id:"hide-pure-markdown",checked:r.hidePureMarkdown,onCheckedChange:d}),e[7]=r.hidePureMarkdown,e[8]=d,e[9]=u):u=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(f=h.jsx(Tr,{htmlFor:"hide-pure-markdown",children:"Hide pure markdown"}),e[10]=f):f=e[10],e[11]!==u?(m=h.jsxs(Mr,{children:[l,h.jsxs($s,{className:"w-auto p-2 text-muted-foreground",children:[c,h.jsxs("div",{className:"flex items-center gap-2",children:[u,f]})]})]}),e[11]=u,e[12]=m):m=e[12];const _=m,g=o==="_minimap_";let p,b,x;e[13]!==n?(p=()=>n("_minimap_"),e[13]=n,e[14]=p):p=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(Vp,{className:"w-4 h-4 mr-1"}),e[15]=b):b=e[15],e[16]!==g||e[17]!==p?(x=h.jsxs(Ae,{variant:"outline",className:"bg-background","aria-selected":g,size:"xs",onClick:p,children:[b,"Mini Map"]}),e[16]=g,e[17]=p,e[18]=x):x=e[18];const y=o==="TB";let v,S,k;e[19]!==n?(v=()=>n("TB"),e[19]=n,e[20]=v):v=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(S=h.jsx(Na,{className:"w-4 h-4 mr-1"}),e[21]=S):S=e[21],e[22]!==y||e[23]!==v?(k=h.jsxs(Ae,{variant:"outline",className:"bg-background","aria-selected":y,size:"xs",onClick:v,children:[S,"Vertical Tree"]}),e[22]=y,e[23]=v,e[24]=k):k=e[24];const j=o==="LR";let E,I,T,M;e[25]!==n?(E=()=>n("LR"),e[25]=n,e[26]=E):E=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(I=h.jsx(Na,{className:"w-4 h-4 mr-1 transform -rotate-90"}),e[27]=I):I=e[27],e[28]!==j||e[29]!==E?(T=h.jsxs(Ae,{variant:"outline",className:"bg-background","aria-selected":j,size:"xs",onClick:E,children:[I," ","Horizontal Tree"]}),e[28]=j,e[29]=E,e[30]=T):T=e[30],e[31]!==x||e[32]!==k||e[33]!==T?(M=h.jsxs("div",{className:"flex gap-2",children:[x,k,T]}),e[31]=x,e[32]=k,e[33]=T,e[34]=M):M=e[34];const R=o!=="_minimap_"&&_;let B;return e[35]!==M||e[36]!==R?(B=h.jsxs(Al,{position:"top-right",className:"flex flex-col items-end gap-2",children:[M,R]}),e[35]=M,e[36]=R,e[37]=B):B=e[37],B});Sh.displayName="GraphToolbar";const zl=A.memo(t=>{const e=X.c(11),{selection:n,variables:o,onClearSelection:r}=t;if(!n)return null;const s=$9;let i;e[0]!==r||e[1]!==n.id||e[2]!==n.source||e[3]!==n.target||e[4]!==n.type||e[5]!==o?(i=()=>{if(n.type==="node"){const d=Object.values(o).filter(m=>m.usedBy.includes(n.id)),u=Object.values(o).filter(m=>m.declaredBy.includes(n.id)),f=(m,_)=>h.jsxs(h.Fragment,{children:[m.length===0&&h.jsx("div",{className:"text-muted-foreground text-sm text-center",children:"--"}),h.jsx("div",{className:"grid grid-cols-5 gap-3 items-center text-sm py-1 flex-1 empty:hidden",children:m.map(g=>h.jsxs(K.Fragment,{children:[h.jsx(kh,{declaredBy:g.declaredBy,name:g.name}),h.jsxs("div",{className:"truncate col-span-2",title:g.value??"",children:[g.value,h.jsxs("span",{className:"ml-1 truncate text-foreground/60 font-mono",children:["(",g.dataType,")"]})]}),h.jsx("div",{className:"truncate col-span-2 gap-1 items-center",children:h.jsx(uv,{skipScroll:!0,onClick:()=>s(_==="in"?g.declaredBy[0]:g.usedBy[0],g.name),maxCount:3,cellIds:g.usedBy})})]},g.name))})]});return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[h.jsx(uc,{className:"w-5 h-5"}),h.jsx(mr,{cellId:n.id}),h.jsx("div",{className:"flex-1"}),h.jsx(k0,{cellId:n.id,children:h.jsx(Ae,{variant:"ghost",size:"icon",children:h.jsx(Kc,{className:"w-4 h-4"})})}),h.jsx(Ae,{variant:"text",size:"icon",onClick:()=>{r()},children:h.jsx(Qn,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"text-sm flex flex-col py-3 pl-2 pr-4 flex-1 justify-center",children:[h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[h.jsx(pn,{className:"w-4 h-4"}),"Outputs"]}),f(u,"out")]}),h.jsx("hr",{className:"border-divider my-3"}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[h.jsx(dp,{className:"w-4 h-4"}),"Inputs"]}),f(d,"in")]})]})]})}if(n.type==="edge"){const d=Object.values(o).filter(u=>u.declaredBy.includes(n.source)&&u.usedBy.includes(n.target));return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[h.jsx(Ea,{className:"w-4 h-4"}),h.jsx(mr,{cellId:n.source}),h.jsx(Gc,{className:"w-4 h-4"}),h.jsx(mr,{cellId:n.target})]}),h.jsx("div",{className:"grid grid-cols-4 gap-3 max-w-[350px] items-center text-sm p-3 flex-1",children:d.map(u=>h.jsxs(K.Fragment,{children:[h.jsx(kh,{declaredBy:u.declaredBy,name:u.name,onClick:()=>{s(u.declaredBy[0],u.name)}}),h.jsx("div",{className:"truncate text-foreground/60 font-mono",children:u.dataType}),h.jsx("div",{className:"truncate col-span-2",title:u.value??"",children:u.value})]},u.name))})]})}},e[0]=r,e[1]=n.id,e[2]=n.source,e[3]=n.target,e[4]=n.type,e[5]=o,e[6]=i):i=e[6];const a=i;let l,c;return e[7]!==a?(l=a(),e[7]=a,e[8]=l):l=e[8],e[9]!==l?(c=h.jsx(Al,{position:"bottom-left",className:"max-h-[90%] flex flex-col w-[calc(100%-5rem)]",children:h.jsx("div",{className:"min-h-[100px] shadow-md rounded-md border max-w-[550px] border-primary/40 my-4 min-w-[240px] bg-[var(--slate-1)] text-muted-foreground/80 flex flex-col overflow-y-auto",children:l})}),e[9]=l,e[10]=c):c=e[10],c});function $9(t,e){const n=sc(t);n&&Jm(n,e)}function hv(){const t=X.c(7),e=Vi(),n=mt(W9),o=mt(H9);let r;t[0]!==e?(r=()=>{e.fitView({duration:100})},t[0]=e,t[1]=r):r=t[1];const s=tV(r,100);let i,a;t[2]!==s||t[3]!==o||t[4]!==n?(i=()=>{n&&o&&s()},a=[n,o,s],t[2]=s,t[3]=o,t[4]=n,t[5]=i,t[6]=a):(i=t[5],a=t[6]),A.useEffect(i,a)}function H9(t){const{height:e}=t;return e}function W9(t){const{width:e}=t;return e}zl.displayName="GraphSelectionPanel";const fv=new class{createEdge(t,e,n){return{type:"smoothstep",pathOptions:{offset:20,borderRadius:100},data:{direction:n},markerEnd:{type:as.Arrow},id:`${t}-${e}-${n}`,source:t,sourceHandle:n,targetHandle:n,target:e}}createNode(t,e,n){return{id:t,data:{atom:e},width:250,type:"custom",height:vh(dt.get(e).code.trim().split(`
|
118
118
|
`).length),position:{x:0,y:n+20}}}createElements(t,e,n,o){let r=0;const s=[],i=[];for(const[l,c]of Ym.zip(t,e)){const d=this.createNode(l,c,r);s.push(d),r=d.position.y+(d.height||0)}const a=new Set;for(const l of Object.values(n)){const{declaredBy:c,usedBy:d}=l;for(const u of c)for(const f of d){const m=`${u}-${f}`;a.has(m)||(a.add(m),i.push(this.createEdge(u,f,"inputs"),this.createEdge(u,f,"outputs")))}}return{nodes:s,edges:i}}},q9=t=>{const e=X.c(37),{cellIds:n,variables:o,cellAtoms:r,children:s}=t;let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=fv.createElements(n,r,o,!1),e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const{nodes:a,edges:l}=i;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[4]=c):c=e[4];const[d,u]=sv(c),[f,m]=rv(a),[_,g]=A.useState(),[p,b]=A.useState(),x=A.useRef(!1);hv();const y=mt(G9);let v;e[5]!==u||e[6]!==m?(v=C=>{m(C.nodes),u([])},e[5]=u,e[6]=m,e[7]=v):v=e[7];const S=Qe(v);let k,j,E,I;e[8]!==r||e[9]!==n||e[10]!==S||e[11]!==o?(k=()=>{x.current?S(fv.createElements(n,r,o,!1)):x.current=!0},j=[n,o,r,S],e[8]=r,e[9]=n,e[10]=S,e[11]=o,e[12]=k,e[13]=j):(k=e[12],j=e[13]),A.useEffect(k,j),e[14]!==l||e[15]!==_||e[16]!==u?(E=()=>{if(_){const C=l.filter($=>{const{source:N,target:H,data:Y}=$;return N===_&&Y.direction==="outputs"||H===_&&Y.direction==="inputs"});u(C)}},I=[_,u,l],e[14]=l,e[15]=_,e[16]=u,e[17]=E,e[18]=I):(E=e[17],I=e[18]),A.useEffect(E,I);const T=function(C,$){const N=X.c(17);let H,Y;if(N[0]!==$||N[1]!==C){let Q;N[3]!==$?(Q=(le,fe)=>{const{position:de}=fe;return Math.min(le,de.y-$/2-10)},N[3]=$,N[4]=Q):Q=N[4],Y=C.reduce(Q,Number.POSITIVE_INFINITY),N[0]=$,N[1]=C,N[2]=Y}else Y=N[2];const Z=Y;let q;if(N[5]!==$||N[6]!==C){let Q;N[8]!==$?(Q=(le,fe)=>{const{position:de}=fe;return Math.max(le,de.y+$/2+10)},N[8]=$,N[9]=Q):Q=N[9],q=C.reduce(Q,Number.NEGATIVE_INFINITY),N[5]=$,N[6]=C,N[7]=q}else q=N[7];const re=q;let ne,oe,G;return N[10]!==Z?(ne=[Number.NEGATIVE_INFINITY,Z],N[10]=Z,N[11]=ne):ne=N[11],N[12]!==re?(oe=[Number.POSITIVE_INFINITY,re],N[12]=re,N[13]=oe):oe=N[13],N[14]!==ne||N[15]!==oe?(G=[ne,oe],N[14]=ne,N[15]=oe,N[16]=G):G=N[16],H=G,H}(f,y);let M;e[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{g(void 0),b(void 0)},e[19]=M):M=e[19];const R=M;let B;e[20]!==d||e[21]!==p||e[22]!==_||e[23]!==o?(B=()=>p?h.jsx(zl,{selection:{type:"edge",source:p.source,target:p.target},onClearSelection:R,variables:o,edges:d}):_?h.jsx(zl,{selection:{type:"node",id:_},variables:o,edges:d,onClearSelection:R}):null,e[20]=d,e[21]=p,e[22]=_,e[23]=o,e[24]=B):B=e[24];const O=B;let z,F,V,L;return e[25]!==u?(z=(C,$)=>{const N=$.id;g(N),b(void 0),u([])},e[25]=u,e[26]=z):z=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(F=(C,$)=>{b($)},e[27]=F):F=e[27],e[28]!==O?(V=O(),e[28]=O,e[29]=V):V=e[29],e[30]!==s||e[31]!==d||e[32]!==f||e[33]!==z||e[34]!==V||e[35]!==T?(L=h.jsxs(wh,{nodes:f,edges:d,nodeTypes:dv,translateExtent:T,onNodeClick:z,onNodeDoubleClick:Y9,onEdgeClick:F,snapToGrid:!0,fitView:!0,elementsSelectable:!0,minZoom:1,maxZoom:1,draggable:!1,panOnScrollMode:er.Vertical,zoomOnDoubleClick:!1,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,edgesFocusable:!1,selectNodesOnDrag:!1,panOnDrag:!1,preventScrolling:!1,zoomOnPinch:!1,panOnScroll:!0,autoPanOnNodeDrag:!1,autoPanOnConnect:!1,children:[V,s]}),e[30]=s,e[31]=d,e[32]=f,e[33]=z,e[34]=V,e[35]=T,e[36]=L):L=e[36],L};function G9(t){const{height:e}=t;return e}function Y9(t,e){q4(e.id,"focus")}var Ch,mv,pv,gv,_v,bv,Nh,yv,jh,xv,Eh,wv,Ih,vv,Ah,kv,Th,Sv,Mh,Cv,Oh,Nv,Dh,jv,Rh,Ev,Ph,Iv,Lh,Av,Fh,Tv,zh,Mv,Ov,Dv,Rv,Pv,Lv,Fv,Bh,zv,Uh,Bv,Vh,Uv,$h,Vv,Hh,$v,Wh,Hv,qh,Wv,Gh,qv,Yh,Gv,Jh,Yv,Kh,Jv,Xh,Kv,Zh,Xv,Qh,Zv,Qv,e2,t2,n2,o2,r2,ef,s2,tf,i2,a2,l2,nf,c2,of,d2,rf,u2,sf,h2,af,f2,m2,p2,g2,_2;function lf(){if(mv)return Ch;mv=1;var t="\0";function e(s,i){s[i]?s[i]++:s[i]=1}function n(s,i){--s[i]||delete s[i]}function o(s,i,a,l){var c=""+i,d=""+a;if(!s&&c>d){var u=c;c=d,d=u}return c+""+d+""+(l===void 0?"\0":l)}function r(s,i){return o(s,i.v,i.w,i.name)}return Ch=class{constructor(s){ee(this,"_isDirected",!0);ee(this,"_isMultigraph",!1);ee(this,"_isCompound",!1);ee(this,"_label");ee(this,"_defaultNodeLabelFn",()=>{});ee(this,"_defaultEdgeLabelFn",()=>{});ee(this,"_nodes",{});ee(this,"_in",{});ee(this,"_preds",{});ee(this,"_out",{});ee(this,"_sucs",{});ee(this,"_edgeObjs",{});ee(this,"_edgeLabels",{});ee(this,"_nodeCount",0);ee(this,"_edgeCount",0);ee(this,"_parent");ee(this,"_children");s&&(this._isDirected=!Object.hasOwn(s,"directed")||s.directed,this._isMultigraph=!!Object.hasOwn(s,"multigraph")&&s.multigraph,this._isCompound=!!Object.hasOwn(s,"compound")&&s.compound),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(s){return this._label=s,this}graph(){return this._label}setDefaultNodeLabel(s){return this._defaultNodeLabelFn=s,typeof s!="function"&&(this._defaultNodeLabelFn=()=>s),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var s=this;return this.nodes().filter(i=>Object.keys(s._in[i]).length===0)}sinks(){var s=this;return this.nodes().filter(i=>Object.keys(s._out[i]).length===0)}setNodes(s,i){var a=arguments,l=this;return s.forEach(function(c){a.length>1?l.setNode(c,i):l.setNode(c)}),this}setNode(s,i){return Object.hasOwn(this._nodes,s)?(arguments.length>1&&(this._nodes[s]=i),this):(this._nodes[s]=arguments.length>1?i:this._defaultNodeLabelFn(s),this._isCompound&&(this._parent[s]=t,this._children[s]={},this._children[t][s]=!0),this._in[s]={},this._preds[s]={},this._out[s]={},this._sucs[s]={},++this._nodeCount,this)}node(s){return this._nodes[s]}hasNode(s){return Object.hasOwn(this._nodes,s)}removeNode(s){var i=this;if(Object.hasOwn(this._nodes,s)){var a=l=>i.removeEdge(i._edgeObjs[l]);delete this._nodes[s],this._isCompound&&(this._removeFromParentsChildList(s),delete this._parent[s],this.children(s).forEach(function(l){i.setParent(l)}),delete this._children[s]),Object.keys(this._in[s]).forEach(a),delete this._in[s],delete this._preds[s],Object.keys(this._out[s]).forEach(a),delete this._out[s],delete this._sucs[s],--this._nodeCount}return this}setParent(s,i){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(i===void 0)i=t;else{for(var a=i+="";a!==void 0;a=this.parent(a))if(a===s)throw new Error("Setting "+i+" as parent of "+s+" would create a cycle");this.setNode(i)}return this.setNode(s),this._removeFromParentsChildList(s),this._parent[s]=i,this._children[i][s]=!0,this}_removeFromParentsChildList(s){delete this._children[this._parent[s]][s]}parent(s){if(this._isCompound){var i=this._parent[s];if(i!==t)return i}}children(s=t){if(this._isCompound){var i=this._children[s];if(i)return Object.keys(i)}else{if(s===t)return this.nodes();if(this.hasNode(s))return[]}}predecessors(s){var i=this._preds[s];if(i)return Object.keys(i)}successors(s){var i=this._sucs[s];if(i)return Object.keys(i)}neighbors(s){var i=this.predecessors(s);if(i){const l=new Set(i);for(var a of this.successors(s))l.add(a);return Array.from(l.values())}}isLeaf(s){return(this.isDirected()?this.successors(s):this.neighbors(s)).length===0}filterNodes(s){var i=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});i.setGraph(this.graph());var a=this;Object.entries(this._nodes).forEach(function([d,u]){s(d)&&i.setNode(d,u)}),Object.values(this._edgeObjs).forEach(function(d){i.hasNode(d.v)&&i.hasNode(d.w)&&i.setEdge(d,a.edge(d))});var l={};function c(d){var u=a.parent(d);return u===void 0||i.hasNode(u)?(l[d]=u,u):u in l?l[u]:c(u)}return this._isCompound&&i.nodes().forEach(d=>i.setParent(d,c(d))),i}setDefaultEdgeLabel(s){return this._defaultEdgeLabelFn=s,typeof s!="function"&&(this._defaultEdgeLabelFn=()=>s),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(s,i){var a=this,l=arguments;return s.reduce(function(c,d){return l.length>1?a.setEdge(c,d,i):a.setEdge(c,d),d}),this}setEdge(){var s,i,a,l,c=!1,d=arguments[0];typeof d=="object"&&d!==null&&"v"in d?(s=d.v,i=d.w,a=d.name,arguments.length===2&&(l=arguments[1],c=!0)):(s=d,i=arguments[1],a=arguments[3],arguments.length>2&&(l=arguments[2],c=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);var u=o(this._isDirected,s,i,a);if(Object.hasOwn(this._edgeLabels,u))return c&&(this._edgeLabels[u]=l),this;if(a!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(i),this._edgeLabels[u]=c?l:this._defaultEdgeLabelFn(s,i,a);var f=function(m,_,g,p){var b=""+_,x=""+g;if(!m&&b>x){var y=b;b=x,x=y}var v={v:b,w:x};return p&&(v.name=p),v}(this._isDirected,s,i,a);return s=f.v,i=f.w,Object.freeze(f),this._edgeObjs[u]=f,e(this._preds[i],s),e(this._sucs[s],i),this._in[i][u]=f,this._out[s][u]=f,this._edgeCount++,this}edge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a);return this._edgeLabels[l]}edgeAsObj(){const s=this.edge(...arguments);return typeof s!="object"?{label:s}:s}hasEdge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a);return Object.hasOwn(this._edgeLabels,l)}removeEdge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a),c=this._edgeObjs[l];return c&&(s=c.v,i=c.w,delete this._edgeLabels[l],delete this._edgeObjs[l],n(this._preds[i],s),n(this._sucs[s],i),delete this._in[i][l],delete this._out[s][l],this._edgeCount--),this}inEdges(s,i){var a=this._in[s];if(a){var l=Object.values(a);return i?l.filter(c=>c.v===i):l}}outEdges(s,i){var a=this._out[s];if(a){var l=Object.values(a);return i?l.filter(c=>c.w===i):l}}nodeEdges(s,i){var a=this.inEdges(s,i);if(a)return a.concat(this.outEdges(s,i))}},Ch}function J9(){return bv?_v:(bv=1,_v={Graph:lf(),version:gv?pv:(gv=1,pv="2.2.4")})}function K9(){if(yv)return Nh;yv=1;var t=lf();function e(o){return o.nodes().map(function(r){var s=o.node(r),i=o.parent(r),a={v:r};return s!==void 0&&(a.value=s),i!==void 0&&(a.parent=i),a})}function n(o){return o.edges().map(function(r){var s=o.edge(r),i={v:r.v,w:r.w};return r.name!==void 0&&(i.name=r.name),s!==void 0&&(i.value=s),i})}return Nh={write:function(o){var r={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:e(o),edges:n(o)};return o.graph()!==void 0&&(r.value=structuredClone(o.graph())),r},read:function(o){var r=new t(o.options).setGraph(o.value);return o.nodes.forEach(function(s){r.setNode(s.v,s.value),s.parent&&r.setParent(s.v,s.parent)}),o.edges.forEach(function(s){r.setEdge({v:s.v,w:s.w,name:s.name},s.value)}),r}},Nh}function X9(){return xv||(xv=1,jh=function(t){var e,n={},o=[];function r(s){Object.hasOwn(n,s)||(n[s]=!0,e.push(s),t.successors(s).forEach(r),t.predecessors(s).forEach(r))}return t.nodes().forEach(function(s){e=[],r(s),e.length&&o.push(e)}),o}),jh}function b2(){return wv?Eh:(wv=1,Eh=class{constructor(){ee(this,"_arr",[]);ee(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(t){return t.key})}has(t){return Object.hasOwn(this._keyIndices,t)}priority(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,e){var n=this._keyIndices;if(t=String(t),!Object.hasOwn(n,t)){var o=this._arr,r=o.length;return n[t]=r,o.push({key:t,priority:e}),this._decrease(r),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)}_heapify(t){var e=this._arr,n=2*t,o=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,o<e.length&&(r=e[o].priority<e[r].priority?o:r),r!==t&&(this._swap(t,r),this._heapify(r)))}_decrease(t){for(var e,n=this._arr,o=n[t].priority;t!==0&&!(n[e=t>>1].priority<o);)this._swap(t,e),t=e}_swap(t,e){var n=this._arr,o=this._keyIndices,r=n[t],s=n[e];n[t]=s,n[e]=r,o[s.key]=t,o[r.key]=e}},Eh)}function y2(){if(vv)return Ih;vv=1;var t=b2();Ih=function(n,o,r,s){return function(i,a,l,c){var d,u,f={},m=new t,_=function(g){var p=g.v!==d?g.v:g.w,b=f[p],x=l(g),y=u.distance+x;if(x<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+x);y<b.distance&&(b.distance=y,b.predecessor=d,m.decrease(p,y))};for(i.nodes().forEach(function(g){var p=g===a?0:Number.POSITIVE_INFINITY;f[g]={distance:p},m.add(g,p)});m.size()>0&&(d=m.removeMin(),(u=f[d]).distance!==Number.POSITIVE_INFINITY);)c(d).forEach(_);return f}(n,String(o),r||e,s||function(i){return n.outEdges(i)})};var e=()=>1;return Ih}function Z9(){if(kv)return Ah;kv=1;var t=y2();return Ah=function(e,n,o){return e.nodes().reduce(function(r,s){return r[s]=t(e,s,n,o),r},{})},Ah}function x2(){return Sv||(Sv=1,Th=function(t){var e=0,n=[],o={},r=[];function s(i){var a=o[i]={onStack:!0,lowlink:e,index:e++};if(n.push(i),t.successors(i).forEach(function(d){Object.hasOwn(o,d)?o[d].onStack&&(a.lowlink=Math.min(a.lowlink,o[d].index)):(s(d),a.lowlink=Math.min(a.lowlink,o[d].lowlink))}),a.lowlink===a.index){var l,c=[];do l=n.pop(),o[l].onStack=!1,c.push(l);while(i!==l);r.push(c)}}return t.nodes().forEach(function(i){Object.hasOwn(o,i)||s(i)}),r}),Th}function Q9(){if(Cv)return Mh;Cv=1;var t=x2();return Mh=function(e){return t(e).filter(function(n){return n.length>1||n.length===1&&e.hasEdge(n[0],n[0])})},Mh}function eD(){if(Nv)return Oh;Nv=1,Oh=function(e,n,o){return function(r,s,i){var a={},l=r.nodes();return l.forEach(function(c){a[c]={},a[c][c]={distance:0},l.forEach(function(d){c!==d&&(a[c][d]={distance:Number.POSITIVE_INFINITY})}),i(c).forEach(function(d){var u=d.v===c?d.w:d.v,f=s(d);a[c][u]={distance:f,predecessor:c}})}),l.forEach(function(c){var d=a[c];l.forEach(function(u){var f=a[u];l.forEach(function(m){var _=f[c],g=d[m],p=f[m],b=_.distance+g.distance;b<p.distance&&(p.distance=b,p.predecessor=g.predecessor)})})}),a}(e,n||t,o||function(r){return e.outEdges(r)})};var t=()=>1;return Oh}function w2(){if(jv)return Dh;function t(n){var o={},r={},s=[];if(n.sinks().forEach(function i(a){if(Object.hasOwn(r,a))throw new e;Object.hasOwn(o,a)||(r[a]=!0,o[a]=!0,n.predecessors(a).forEach(i),delete r[a],s.push(a))}),Object.keys(o).length!==n.nodeCount())throw new e;return s}jv=1;class e extends Error{constructor(){super(...arguments)}}return Dh=t,t.CycleException=e,Dh}function tD(){if(Ev)return Rh;Ev=1;var t=w2();return Rh=function(e){try{t(e)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0},Rh}function v2(){if(Iv)return Ph;function t(o,r,s,i){for(var a=[[o,!1]];a.length>0;){var l=a.pop();l[1]?i.push(l[0]):Object.hasOwn(s,l[0])||(s[l[0]]=!0,a.push([l[0],!0]),n(r(l[0]),c=>a.push([c,!1])))}}function e(o,r,s,i){for(var a=[o];a.length>0;){var l=a.pop();Object.hasOwn(s,l)||(s[l]=!0,i.push(l),n(r(l),c=>a.push(c)))}}function n(o,r){for(var s=o.length;s--;)r(o[s],s,o);return o}return Iv=1,Ph=function(o,r,s){Array.isArray(r)||(r=[r]);var i=o.isDirected()?d=>o.successors(d):d=>o.neighbors(d),a=s==="post"?t:e,l=[],c={};return r.forEach(d=>{if(!o.hasNode(d))throw new Error("Graph does not have node: "+d);a(d,i,c,l)}),l},Ph}function nD(){if(Av)return Lh;Av=1;var t=v2();return Lh=function(e,n){return t(e,n,"post")},Lh}function oD(){if(Tv)return Fh;Tv=1;var t=v2();return Fh=function(e,n){return t(e,n,"pre")},Fh}function rD(){if(Mv)return zh;Mv=1;var t=lf(),e=b2();return zh=function(n,o){var r,s=new t,i={},a=new e;function l(d){var u=d.v===r?d.w:d.v,f=a.priority(u);if(f!==void 0){var m=o(d);m<f&&(i[u]=r,a.decrease(u,m))}}if(n.nodeCount()===0)return s;n.nodes().forEach(function(d){a.add(d,Number.POSITIVE_INFINITY),s.setNode(d)}),a.decrease(n.nodes()[0],0);for(var c=!1;a.size()>0;){if(r=a.removeMin(),Object.hasOwn(i,r))s.setEdge(r,i[r]);else{if(c)throw new Error("Input graph is not connected: "+n);c=!0}n.nodeEdges(r).forEach(l)}return s},zh}function Gn(){if(Pv)return Rv;Pv=1;var t=J9();return Rv={Graph:t.Graph,json:K9(),alg:Dv?Ov:(Dv=1,Ov={components:X9(),dijkstra:y2(),dijkstraAll:Z9(),findCycles:Q9(),floydWarshall:eD(),isAcyclic:tD(),postorder:nD(),preorder:oD(),prim:rD(),tarjan:x2(),topsort:w2()}),version:t.version}}function sD(){if(zv)return Bh;zv=1;let t=Gn().Graph,e=function(){if(Fv)return Lv;function s(a){a._prev._next=a._next,a._next._prev=a._prev,delete a._next,delete a._prev}function i(a,l){if(a!=="_next"&&a!=="_prev")return l}return Fv=1,Lv=class{constructor(){let a={};a._next=a._prev=a,this._sentinel=a}dequeue(){let a=this._sentinel,l=a._prev;if(l!==a)return s(l),l}enqueue(a){let l=this._sentinel;a._prev&&a._next&&s(a),a._next=l._next,l._next._prev=a,l._next=a,a._prev=l}toString(){let a=[],l=this._sentinel,c=l._prev;for(;c!==l;)a.push(JSON.stringify(c,i)),c=c._prev;return"["+a.join(", ")+"]"}}}();Bh=function(s,i){if(s.nodeCount()<=1)return[];let a=function(l,c){let d=new t,u=0,f=0;l.nodes().forEach(g=>{d.setNode(g,{v:g,in:0,out:0})}),l.edges().forEach(g=>{let p=d.edge(g.v,g.w)||0,b=c(g),x=p+b;d.setEdge(g.v,g.w,x),f=Math.max(f,d.node(g.v).out+=b),u=Math.max(u,d.node(g.w).in+=b)});let m=function(g){const p=[];for(let b=0;b<g;b++)p.push(b);return p}(f+u+3).map(()=>new e),_=u+1;return d.nodes().forEach(g=>{r(m,_,d.node(g))}),{graph:d,buckets:m,zeroIdx:_}}(s,i||n);return function(l,c,d){let u,f=[],m=c[c.length-1],_=c[0];for(;l.nodeCount();){for(;u=_.dequeue();)o(l,c,d,u);for(;u=m.dequeue();)o(l,c,d,u);if(l.nodeCount()){for(let g=c.length-2;g>0;--g)if(u=c[g].dequeue(),u){f=f.concat(o(l,c,d,u,!0));break}}}return f}(a.graph,a.buckets,a.zeroIdx).flatMap(l=>s.outEdges(l.v,l.w))};let n=()=>1;function o(s,i,a,l,c){let d=c?[]:void 0;return s.inEdges(l.v).forEach(u=>{let f=s.edge(u),m=s.node(u.v);c&&d.push({v:u.v,w:u.w}),m.out-=f,r(i,a,m)}),s.outEdges(l.v).forEach(u=>{let f=s.edge(u),m=u.w,_=s.node(m);_.in-=f,r(i,a,_)}),s.removeNode(l.v),d}function r(s,i,a){a.out?a.in?s[a.out-a.in+i].enqueue(a):s[s.length-1].enqueue(a):s[0].enqueue(a)}return Bh}function Dt(){if(Bv)return Uh;Bv=1;let t=Gn().Graph;function e(c,d,u,f){let m;do m=i(f);while(c.hasNode(m));return u.dummy=d,c.setNode(m,u),m}Uh={addBorderNode:function(c,d,u,f){let m={width:0,height:0};return arguments.length>=4&&(m.rank=u,m.order=f),e(c,"border",m,d)},addDummyNode:e,applyWithChunking:o,asNonCompoundGraph:function(c){let d=new t({multigraph:c.isMultigraph()}).setGraph(c.graph());return c.nodes().forEach(u=>{c.children(u).length||d.setNode(u,c.node(u))}),c.edges().forEach(u=>{d.setEdge(u,c.edge(u))}),d},buildLayerMatrix:function(c){let d=a(r(c)+1).map(()=>[]);return c.nodes().forEach(u=>{let f=c.node(u),m=f.rank;m!==void 0&&(d[m][f.order]=u)}),d},intersectRect:function(c,d){let u,f,m=c.x,_=c.y,g=d.x-m,p=d.y-_,b=c.width/2,x=c.height/2;if(!g&&!p)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(p)*b>Math.abs(g)*x?(p<0&&(x=-x),u=x*g/p,f=x):(g<0&&(b=-b),u=b,f=b*p/g),{x:m+u,y:_+f}},mapValues:function(c,d){let u=d;return typeof d=="string"&&(u=f=>f[d]),Object.entries(c).reduce((f,[m,_])=>(f[m]=u(_,m),f),{})},maxRank:r,normalizeRanks:function(c){let d=c.nodes().map(f=>{let m=c.node(f).rank;return m===void 0?Number.MAX_VALUE:m}),u=o(Math.min,d);c.nodes().forEach(f=>{let m=c.node(f);Object.hasOwn(m,"rank")&&(m.rank-=u)})},notime:function(c,d){return d()},partition:function(c,d){let u={lhs:[],rhs:[]};return c.forEach(f=>{d(f)?u.lhs.push(f):u.rhs.push(f)}),u},pick:function(c,d){const u={};for(const f of d)c[f]!==void 0&&(u[f]=c[f]);return u},predecessorWeights:function(c){let d=c.nodes().map(u=>{let f={};return c.inEdges(u).forEach(m=>{f[m.v]=(f[m.v]||0)+c.edge(m).weight}),f});return l(c.nodes(),d)},range:a,removeEmptyRanks:function(c){let d=c.nodes().map(g=>c.node(g).rank),u=o(Math.min,d),f=[];c.nodes().forEach(g=>{let p=c.node(g).rank-u;f[p]||(f[p]=[]),f[p].push(g)});let m=0,_=c.graph().nodeRankFactor;Array.from(f).forEach((g,p)=>{g===void 0&&p%_!=0?--m:g!==void 0&&m&&g.forEach(b=>c.node(b).rank+=m)})},simplify:function(c){let d=new t().setGraph(c.graph());return c.nodes().forEach(u=>d.setNode(u,c.node(u))),c.edges().forEach(u=>{let f=d.edge(u.v,u.w)||{weight:0,minlen:1},m=c.edge(u);d.setEdge(u.v,u.w,{weight:f.weight+m.weight,minlen:Math.max(f.minlen,m.minlen)})}),d},successorWeights:function(c){let d=c.nodes().map(u=>{let f={};return c.outEdges(u).forEach(m=>{f[m.w]=(f[m.w]||0)+c.edge(m).weight}),f});return l(c.nodes(),d)},time:function(c,d){let u=Date.now();try{return d()}finally{console.log(c+" time: "+(Date.now()-u)+"ms")}},uniqueId:i,zipObject:l};const n=65535;function o(c,d){if(d.length>n){const u=function(f,m=n){const _=[];for(let g=0;g<f.length;g+=m){const p=f.slice(g,g+m);_.push(p)}return _}(d);return c.apply(null,u.map(f=>c.apply(null,f)))}return c.apply(null,d)}function r(c){const d=c.nodes().map(u=>{let f=c.node(u).rank;return f===void 0?Number.MIN_VALUE:f});return o(Math.max,d)}let s=0;function i(c){var d=++s;return toString(c)+d}function a(c,d,u=1){d==null&&(d=c,c=0);let f=_=>_<d;u<0&&(f=_=>d<_);const m=[];for(let _=c;f(_);_+=u)m.push(_);return m}function l(c,d){return c.reduce((u,f,m)=>(u[f]=d[m],u),{})}return Uh}function iD(){if(Uv)return Vh;Uv=1;let t=sD(),e=Dt().uniqueId;return Vh={run:function(n){(n.graph().acyclicer==="greedy"?t(n,function(r){return s=>r.edge(s).weight}(n)):function(r){let s=[],i={},a={};function l(c){Object.hasOwn(a,c)||(a[c]=!0,i[c]=!0,r.outEdges(c).forEach(d=>{Object.hasOwn(i,d.w)?s.push(d):l(d.w)}),delete i[c])}return r.nodes().forEach(l),s}(n)).forEach(r=>{let s=n.edge(r);n.removeEdge(r),s.forwardName=r.name,s.reversed=!0,n.setEdge(r.w,r.v,s,e("rev"))})},undo:function(n){n.edges().forEach(o=>{let r=n.edge(o);if(r.reversed){n.removeEdge(o);let s=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(o.w,o.v,r,s)}})}},Vh}function aD(){if(Vv)return $h;Vv=1;let t=Dt();return $h={run:function(e){e.graph().dummyChains=[],e.edges().forEach(n=>function(o,r){let s,i,a,l=r.v,c=o.node(l).rank,d=r.w,u=o.node(d).rank,f=r.name,m=o.edge(r),_=m.labelRank;if(u!==c+1){for(o.removeEdge(r),a=0,++c;c<u;++a,++c)m.points=[],i={width:0,height:0,edgeLabel:m,edgeObj:r,rank:c},s=t.addDummyNode(o,"edge",i,"_d"),c===_&&(i.width=m.width,i.height=m.height,i.dummy="edge-label",i.labelpos=m.labelpos),o.setEdge(l,s,{weight:m.weight},f),a===0&&o.graph().dummyChains.push(s),l=s;o.setEdge(l,d,{weight:m.weight},f)}}(e,n))},undo:function(e){e.graph().dummyChains.forEach(n=>{let o,r=e.node(n),s=r.edgeLabel;for(e.setEdge(r.edgeObj,s);r.dummy;)o=e.successors(n)[0],e.removeNode(n),s.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(s.x=r.x,s.y=r.y,s.width=r.width,s.height=r.height),n=o,r=e.node(n)})}},$h}function Bl(){if($v)return Hh;$v=1;const{applyWithChunking:t}=Dt();return Hh={longestPath:function(e){var n={};e.sources().forEach(function o(r){var s=e.node(r);if(Object.hasOwn(n,r))return s.rank;n[r]=!0;let i=e.outEdges(r).map(l=>l==null?Number.POSITIVE_INFINITY:o(l.w)-e.edge(l).minlen);var a=t(Math.min,i);return a===Number.POSITIVE_INFINITY&&(a=0),s.rank=a})},slack:function(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}},Hh}function k2(){if(Hv)return Wh;Hv=1;var t=Gn().Graph,e=Bl().slack;function n(s,i){return s.nodes().forEach(function a(l){i.nodeEdges(l).forEach(c=>{var d=c.v,u=l===d?c.w:d;s.hasNode(u)||e(i,c)||(s.setNode(u,{}),s.setEdge(l,u,{}),a(u))})}),s.nodeCount()}function o(s,i){return i.edges().reduce((a,l)=>{let c=Number.POSITIVE_INFINITY;return s.hasNode(l.v)!==s.hasNode(l.w)&&(c=e(i,l)),c<a[0]?[c,l]:a},[Number.POSITIVE_INFINITY,null])[1]}function r(s,i,a){s.nodes().forEach(l=>i.node(l).rank+=a)}return Wh=function(s){var i,a,l=new t({directed:!1}),c=s.nodes()[0],d=s.nodeCount();for(l.setNode(c,{});n(l,s)<d;)i=o(l,s),a=l.hasNode(i.v)?e(s,i):-e(s,i),r(l,s,a);return l},Wh}function lD(){if(Wv)return qh;Wv=1;var t=k2(),e=Bl().slack,n=Bl().longestPath,o=Gn().alg.preorder,r=Gn().alg.postorder,s=Dt().simplify;function i(g){g=s(g),n(g);var p,b=t(g);for(c(b),a(b,g);p=u(b);)m(b,g,p,f(b,g,p))}function a(g,p){var b=r(g,g.nodes());(b=b.slice(0,b.length-1)).forEach(x=>function(y,v,S){var k=y.node(S),j=k.parent;y.edge(S,j).cutvalue=l(y,v,S)}(g,p,x))}function l(g,p,b){var x=g.node(b).parent,y=!0,v=p.edge(b,x),S=0;return v||(y=!1,v=p.edge(x,b)),S=v.weight,p.nodeEdges(b).forEach(k=>{var j,E,I=k.v===b,T=I?k.w:k.v;if(T!==x){var M=I===y,R=p.edge(k).weight;if(S+=M?R:-R,j=b,E=T,g.hasEdge(j,E)){var B=g.edge(b,T).cutvalue;S+=M?-B:B}}}),S}function c(g,p){arguments.length<2&&(p=g.nodes()[0]),d(g,{},1,p)}function d(g,p,b,x,y){var v=b,S=g.node(x);return p[x]=!0,g.neighbors(x).forEach(k=>{Object.hasOwn(p,k)||(b=d(g,p,b,k,x))}),S.low=v,S.lim=b++,y?S.parent=y:delete S.parent,b}function u(g){return g.edges().find(p=>g.edge(p).cutvalue<0)}function f(g,p,b){var x=b.v,y=b.w;p.hasEdge(x,y)||(x=b.w,y=b.v);var v=g.node(x),S=g.node(y),k=v,j=!1;v.lim>S.lim&&(k=S,j=!0);var E=p.edges().filter(I=>j===_(g,g.node(I.v),k)&&j!==_(g,g.node(I.w),k));return E.reduce((I,T)=>e(p,T)<e(p,I)?T:I)}function m(g,p,b,x){var y=b.v,v=b.w;g.removeEdge(y,v),g.setEdge(x.v,x.w,{}),c(g),a(g,p),function(S,k){var j=S.nodes().find(I=>!k.node(I).parent),E=o(S,j);(E=E.slice(1)).forEach(I=>{var T=S.node(I).parent,M=k.edge(I,T),R=!1;M||(M=k.edge(T,I),R=!0),k.node(I).rank=k.node(T).rank+(R?M.minlen:-M.minlen)})}(g,p)}function _(g,p,b){return b.low<=p.lim&&p.lim<=b.lim}return qh=i,i.initLowLimValues=c,i.initCutValues=a,i.calcCutValue=l,i.leaveEdge=u,i.enterEdge=f,i.exchangeEdges=m,qh}function cD(){if(qv)return Gh;qv=1;var t=Bl().longestPath,e=k2(),n=lD();Gh=function(s){switch(s.graph().ranker){case"network-simplex":default:r(s);break;case"tight-tree":(function(i){t(i),e(i)})(s);break;case"longest-path":o(s)}};var o=t;function r(s){n(s)}return Gh}function dD(){return Gv||(Gv=1,Yh=function(t){let e=function(n){let o={},r=0;function s(i){let a=r;n.children(i).forEach(s),o[i]={low:a,lim:r++}}return n.children().forEach(s),o}(t);t.graph().dummyChains.forEach(n=>{let o=t.node(n),r=o.edgeObj,s=function(u,f,m,_){let g,p,b=[],x=[],y=Math.min(f[m].low,f[_].low),v=Math.max(f[m].lim,f[_].lim);g=m;do g=u.parent(g),b.push(g);while(g&&(f[g].low>y||v>f[g].lim));for(p=g,g=_;(g=u.parent(g))!==p;)x.push(g);return{path:b.concat(x.reverse()),lca:p}}(t,e,r.v,r.w),i=s.path,a=s.lca,l=0,c=i[l],d=!0;for(;n!==r.w;){if(o=t.node(n),d){for(;(c=i[l])!==a&&t.node(c).maxRank<o.rank;)l++;c===a&&(d=!1)}if(!d){for(;l<i.length-1&&t.node(c=i[l+1]).minRank<=o.rank;)l++;c=i[l]}t.setParent(n,c),n=t.successors(n)[0]}})}),Yh}function uD(){if(Yv)return Jh;Yv=1;let t=Dt();function e(n,o,r,s,i,a,l){let c=n.children(l);if(!c.length)return void(l!==o&&n.setEdge(o,l,{weight:0,minlen:r}));let d=t.addBorderNode(n,"_bt"),u=t.addBorderNode(n,"_bb"),f=n.node(l);n.setParent(d,l),f.borderTop=d,n.setParent(u,l),f.borderBottom=u,c.forEach(m=>{e(n,o,r,s,i,a,m);let _=n.node(m),g=_.borderTop?_.borderTop:m,p=_.borderBottom?_.borderBottom:m,b=_.borderTop?s:2*s,x=g!==p?1:i-a[l]+1;n.setEdge(d,g,{weight:b,minlen:x,nestingEdge:!0}),n.setEdge(p,u,{weight:b,minlen:x,nestingEdge:!0})}),n.parent(l)||n.setEdge(o,d,{weight:0,minlen:i+a[l]})}return Jh={run:function(n){let o=t.addDummyNode(n,"root",{},"_root"),r=function(c){var d={};function u(f,m){var _=c.children(f);_&&_.length&&_.forEach(g=>u(g,m+1)),d[f]=m}return c.children().forEach(f=>u(f,1)),d}(n),s=Object.values(r),i=t.applyWithChunking(Math.max,s)-1,a=2*i+1;n.graph().nestingRoot=o,n.edges().forEach(c=>n.edge(c).minlen*=a);let l=function(c){return c.edges().reduce((d,u)=>d+c.edge(u).weight,0)}(n)+1;n.children().forEach(c=>e(n,o,a,l,i,r,c)),n.graph().nodeRankFactor=a},cleanup:function(n){var o=n.graph();n.removeNode(o.nestingRoot),delete o.nestingRoot,n.edges().forEach(r=>{n.edge(r).nestingEdge&&n.removeEdge(r)})}},Jh}function hD(){if(Kv)return Xh;function t(r){r.nodes().forEach(s=>e(r.node(s))),r.edges().forEach(s=>e(r.edge(s)))}function e(r){let s=r.width;r.width=r.height,r.height=s}function n(r){r.y=-r.y}function o(r){let s=r.x;r.x=r.y,r.y=s}return Kv=1,Xh={adjust:function(r){let s=r.graph().rankdir.toLowerCase();s!=="lr"&&s!=="rl"||t(r)},undo:function(r){let s=r.graph().rankdir.toLowerCase();s!=="bt"&&s!=="rl"||function(i){i.nodes().forEach(a=>n(i.node(a))),i.edges().forEach(a=>{let l=i.edge(a);l.points.forEach(n),Object.hasOwn(l,"y")&&n(l)})}(r),s!=="lr"&&s!=="rl"||(function(i){i.nodes().forEach(a=>o(i.node(a))),i.edges().forEach(a=>{let l=i.edge(a);l.points.forEach(o),Object.hasOwn(l,"x")&&o(l)})}(r),t(r))}},Xh}function fD(){if(n2)return t2;n2=1;let t=Dt();return t2=function(e,n){let o={};return e.forEach((r,s)=>{let i=o[r.v]={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(i.barycenter=r.barycenter,i.weight=r.weight)}),n.edges().forEach(r=>{let s=o[r.v],i=o[r.w];s!==void 0&&i!==void 0&&(i.indegree++,s.out.push(o[r.w]))}),function(r){let s=[];function i(l){return c=>{c.merged||(c.barycenter===void 0||l.barycenter===void 0||c.barycenter>=l.barycenter)&&function(d,u){let f=0,m=0;d.weight&&(f+=d.barycenter*d.weight,m+=d.weight),u.weight&&(f+=u.barycenter*u.weight,m+=u.weight),d.vs=u.vs.concat(d.vs),d.barycenter=f/m,d.weight=m,d.i=Math.min(u.i,d.i),u.merged=!0}(l,c)}}function a(l){return c=>{c.in.push(l),--c.indegree==0&&r.push(c)}}for(;r.length;){let l=r.pop();s.push(l),l.in.reverse().forEach(i(l)),l.out.forEach(a(l))}return s.filter(l=>!l.merged).map(l=>t.pick(l,["vs","i","barycenter","weight"]))}(Object.values(o).filter(r=>!r.indegree))}}function mD(){if(s2)return ef;s2=1;let t=(e2||(e2=1,Qv=function(o,r=[]){return r.map(s=>{let i=o.inEdges(s);if(i.length){let a=i.reduce((l,c)=>{let d=o.edge(c),u=o.node(c.v);return{sum:l.sum+d.weight*u.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}return{v:s}})}),Qv),e=fD(),n=function(){if(r2)return o2;r2=1;let o=Dt();function r(s,i,a){let l;for(;i.length&&(l=i[i.length-1]).i<=a;)i.pop(),s.push(l.vs),a++;return a}return o2=function(s,i){let a=o.partition(s,p=>Object.hasOwn(p,"barycenter")),l=a.lhs,c=a.rhs.sort((p,b)=>b.i-p.i),d=[],u=0,f=0,m=0;var _;l.sort((_=!!i,(p,b)=>p.barycenter<b.barycenter?-1:p.barycenter>b.barycenter?1:_?b.i-p.i:p.i-b.i)),m=r(d,c,m),l.forEach(p=>{m+=p.vs.length,d.push(p.vs),u+=p.barycenter*p.weight,f+=p.weight,m=r(d,c,m)});let g={vs:d.flat(!0)};return f&&(g.barycenter=u/f,g.weight=f),g}}();return ef=function o(r,s,i,a){let l=r.children(s),c=r.node(s),d=c?c.borderLeft:void 0,u=c?c.borderRight:void 0,f={};d&&(l=l.filter(p=>p!==d&&p!==u));let m=t(r,l);m.forEach(p=>{if(r.children(p.v).length){let y=o(r,p.v,i,a);f[p.v]=y,Object.hasOwn(y,"barycenter")&&(x=y,(b=p).barycenter!==void 0?(b.barycenter=(b.barycenter*b.weight+x.barycenter*x.weight)/(b.weight+x.weight),b.weight+=x.weight):(b.barycenter=x.barycenter,b.weight=x.weight))}var b,x});let _=e(m,i);(function(p,b){p.forEach(x=>{x.vs=x.vs.flatMap(y=>b[y]?b[y].vs:y)})})(_,f);let g=n(_,a);if(d&&(g.vs=[d,g.vs,u].flat(!0),r.predecessors(d).length)){let p=r.node(r.predecessors(d)[0]),b=r.node(r.predecessors(u)[0]);Object.hasOwn(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+p.order+b.order)/(g.weight+2),g.weight+=2}return g},ef}function pD(){if(i2)return tf;i2=1;let t=Gn().Graph,e=Dt();return tf=function(n,o,r){let s=function(a){for(var l;a.hasNode(l=e.uniqueId("_root")););return l}(n),i=new t({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>n.node(a));return n.nodes().forEach(a=>{let l=n.node(a),c=n.parent(a);(l.rank===o||l.minRank<=o&&o<=l.maxRank)&&(i.setNode(a),i.setParent(a,c||s),n[r](a).forEach(d=>{let u=d.v===a?d.w:d.v,f=i.edge(u,a),m=f!==void 0?f.weight:0;i.setEdge(u,a,{weight:n.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[o],borderRight:l.borderRight[o]}))}),i},tf}function gD(){if(c2)return nf;c2=1;let t=function(){if(Xv)return Zh;Xv=1;let d=Dt();return Zh=function(u){let f={},m=u.nodes().filter(x=>!u.children(x).length),_=m.map(x=>u.node(x).rank),g=d.applyWithChunking(Math.max,_),p=d.range(g+1).map(()=>[]);function b(x){if(f[x])return;f[x]=!0;let y=u.node(x);p[y.rank].push(x),u.successors(x).forEach(b)}return m.sort((x,y)=>u.node(x).rank-u.node(y).rank).forEach(b),p},Zh}(),e=function(){if(Zv)return Qh;Zv=1;let d=Dt().zipObject;function u(f,m,_){let g=d(_,_.map((S,k)=>k)),p=m.flatMap(S=>f.outEdges(S).map(k=>({pos:g[k.w],weight:f.edge(k).weight})).sort((k,j)=>k.pos-j.pos)),b=1;for(;b<_.length;)b<<=1;let x=2*b-1;b-=1;let y=new Array(x).fill(0),v=0;return p.forEach(S=>{let k=S.pos+b;y[k]+=S.weight;let j=0;for(;k>0;)k%2&&(j+=y[k+1]),k=k-1>>1,y[k]+=S.weight;v+=S.weight*j}),v}return Qh=function(f,m){let _=0;for(let g=1;g<m.length;++g)_+=u(f,m[g-1],m[g]);return _},Qh}(),n=mD(),o=pD(),r=(l2||(l2=1,a2=function(d,u,f){let m,_={};f.forEach(g=>{let p,b,x=d.parent(g);for(;x;){if(p=d.parent(x),p?(b=_[p],_[p]=x):(b=m,m=x),b&&b!==x)return void u.setEdge(b,x);x=p}})}),a2),s=Gn().Graph,i=Dt();function a(d,u,f){return u.map(function(m){return o(d,m,f)})}function l(d,u){let f=new s;d.forEach(function(m){let _=m.graph().root,g=n(m,_,f,u);g.vs.forEach((p,b)=>m.node(p).order=b),r(m,f,g.vs)})}function c(d,u){Object.values(u).forEach(f=>f.forEach((m,_)=>d.node(m).order=_))}return nf=function d(u,f){if(f&&typeof f.customOrder=="function")return void f.customOrder(u,d);let m=i.maxRank(u),_=a(u,i.range(1,m+1),"inEdges"),g=a(u,i.range(m-1,-1,-1),"outEdges"),p=t(u);if(c(u,p),f&&f.disableOptimalOrderHeuristic)return;let b,x=Number.POSITIVE_INFINITY;for(let y=0,v=0;v<4;++y,++v){l(y%2?_:g,y%4>=2),p=i.buildLayerMatrix(u);let S=e(u,p);S<x&&(v=0,b=Object.assign({},p),x=S)}c(u,b)},nf}function _D(){if(d2)return of;d2=1;let t=Gn().Graph,e=Dt();function n(u,f){let m={};return f.length&&f.reduce(function(_,g){let p=0,b=0,x=_.length,y=g[g.length-1];return g.forEach((v,S)=>{let k=function(E,I){if(E.node(I).dummy)return E.predecessors(I).find(T=>E.node(T).dummy)}(u,v),j=k?u.node(k).order:x;(k||v===y)&&(g.slice(b,S+1).forEach(E=>{u.predecessors(E).forEach(I=>{let T=u.node(I),M=T.order;!(M<p||j<M)||T.dummy&&u.node(E).dummy||r(m,I,E)})}),b=S+1,p=j)}),g}),m}function o(u,f){let m={};function _(g,p,b,x,y){let v;e.range(p,b).forEach(S=>{v=g[S],u.node(v).dummy&&u.predecessors(v).forEach(k=>{let j=u.node(k);j.dummy&&(j.order<x||j.order>y)&&r(m,k,v)})})}return f.length&&f.reduce(function(g,p){let b,x=-1,y=0;return p.forEach((v,S)=>{if(u.node(v).dummy==="border"){let k=u.predecessors(v);k.length&&(b=u.node(k[0]).order,_(p,y,S,x,b),y=S,x=b)}_(p,y,p.length,b,g.length)}),p}),m}function r(u,f,m){if(f>m){let g=f;f=m,m=g}let _=u[f];_||(u[f]=_={}),_[m]=!0}function s(u,f,m){if(f>m){let _=f;f=m,m=_}return!!u[f]&&Object.hasOwn(u[f],m)}function i(u,f,m,_){let g={},p={},b={};return f.forEach(x=>{x.forEach((y,v)=>{g[y]=y,p[y]=y,b[y]=v})}),f.forEach(x=>{let y=-1;x.forEach(v=>{let S=_(v);if(S.length){S=S.sort((j,E)=>b[j]-b[E]);let k=(S.length-1)/2;for(let j=Math.floor(k),E=Math.ceil(k);j<=E;++j){let I=S[j];p[v]===v&&y<b[I]&&!s(m,v,I)&&(p[I]=v,p[v]=g[v]=g[I],y=b[I])}}})}),{root:g,align:p}}function a(u,f,m,_,g){let p={},b=function(v,S,k,j){let E=new t,I=v.graph(),T=function(M,R,B){return(O,z,F)=>{let V,L=O.node(z),C=O.node(F),$=0;if($+=L.width/2,Object.hasOwn(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":V=-L.width/2;break;case"r":V=L.width/2}if(V&&($+=B?V:-V),V=0,$+=(L.dummy?R:M)/2,$+=(C.dummy?R:M)/2,$+=C.width/2,Object.hasOwn(C,"labelpos"))switch(C.labelpos.toLowerCase()){case"l":V=C.width/2;break;case"r":V=-C.width/2}return V&&($+=B?V:-V),V=0,$}}(I.nodesep,I.edgesep,j);return S.forEach(M=>{let R;M.forEach(B=>{let O=k[B];if(E.setNode(O),R){var z=k[R],F=E.edge(z,O);E.setEdge(z,O,Math.max(T(v,B,R),F||0))}R=B})}),E}(u,f,m,g),x=g?"borderLeft":"borderRight";function y(v,S){let k=b.nodes(),j=k.pop(),E={};for(;j;)E[j]?v(j):(E[j]=!0,k.push(j),k=k.concat(S(j))),j=k.pop()}return y(function(v){p[v]=b.inEdges(v).reduce((S,k)=>Math.max(S,p[k.v]+b.edge(k)),0)},b.predecessors.bind(b)),y(function(v){let S=b.outEdges(v).reduce((j,E)=>Math.min(j,p[E.w]-b.edge(E)),Number.POSITIVE_INFINITY),k=u.node(v);S!==Number.POSITIVE_INFINITY&&k.borderType!==x&&(p[v]=Math.max(p[v],S))},b.successors.bind(b)),Object.keys(_).forEach(v=>p[v]=p[m[v]]),p}function l(u,f){return Object.values(f).reduce((m,_)=>{let g=Number.NEGATIVE_INFINITY,p=Number.POSITIVE_INFINITY;Object.entries(_).forEach(([x,y])=>{let v=function(S,k){return S.node(k).width}(u,x)/2;g=Math.max(y+v,g),p=Math.min(y-v,p)});const b=g-p;return b<m[0]&&(m=[b,_]),m},[Number.POSITIVE_INFINITY,null])[1]}function c(u,f){let m=Object.values(f),_=e.applyWithChunking(Math.min,m),g=e.applyWithChunking(Math.max,m);["u","d"].forEach(p=>{["l","r"].forEach(b=>{let x=p+b,y=u[x];if(y===f)return;let v=Object.values(y),S=_-e.applyWithChunking(Math.min,v);b!=="l"&&(S=g-e.applyWithChunking(Math.max,v)),S&&(u[x]=e.mapValues(y,k=>k+S))})})}function d(u,f){return e.mapValues(u.ul,(m,_)=>{if(f)return u[f.toLowerCase()][_];{let g=Object.values(u).map(p=>p[_]).sort((p,b)=>p-b);return(g[1]+g[2])/2}})}return of={positionX:function(u){let f,m=e.buildLayerMatrix(u),_=Object.assign(n(u,m),o(u,m)),g={};["u","d"].forEach(b=>{f=b==="u"?m:Object.values(m).reverse(),["l","r"].forEach(x=>{x==="r"&&(f=f.map(k=>Object.values(k).reverse()));let y=(b==="u"?u.predecessors:u.successors).bind(u),v=i(u,f,_,y),S=a(u,f,v.root,v.align,x==="r");x==="r"&&(S=e.mapValues(S,k=>-k)),g[b+x]=S})});let p=l(u,g);return c(g,p),d(g,u.graph().align)},findType1Conflicts:n,findType2Conflicts:o,addConflict:r,hasConflict:s,verticalAlignment:i,horizontalCompaction:a,alignCoordinates:c,findSmallestWidthAlignment:l,balance:d},of}function bD(){if(u2)return rf;u2=1;let t=Dt(),e=_D().positionX;return rf=function(n){n=t.asNonCompoundGraph(n),function(o){let r=t.buildLayerMatrix(o),s=o.graph().ranksep,i=0;r.forEach(a=>{const l=a.reduce((c,d)=>{const u=o.node(d).height;return c>u?c:u},0);a.forEach(c=>o.node(c).y=i+l/2),i+=l+s})}(n),Object.entries(e(n)).forEach(([o,r])=>n.node(o).x=r)},rf}function yD(){if(h2)return sf;h2=1;let t=iD(),e=aD(),n=cD(),o=Dt().normalizeRanks,r=dD(),s=Dt().removeEmptyRanks,i=uD(),a=function(){if(Jv)return Kh;Jv=1;let j=Dt();function E(I,T,M,R,B,O){let z={width:0,height:0,rank:O,borderType:T},F=B[T][O-1],V=j.addDummyNode(I,"border",z,M);B[T][O]=V,I.setParent(V,R),F&&I.setEdge(F,V,{weight:1})}return Kh=function(I){I.children().forEach(function T(M){let R=I.children(M),B=I.node(M);if(R.length&&R.forEach(T),Object.hasOwn(B,"minRank")){B.borderLeft=[],B.borderRight=[];for(let O=B.minRank,z=B.maxRank+1;O<z;++O)E(I,"borderLeft","_bl",M,B,O),E(I,"borderRight","_br",M,B,O)}})},Kh}(),l=hD(),c=gD(),d=bD(),u=Dt(),f=Gn().Graph;sf=function(j,E){let I=E&&E.debugTiming?u.time:u.notime;I("layout",()=>{let T=I(" buildLayoutGraph",()=>function(M){let R=new f({multigraph:!0,compound:!0}),B=k(M.graph());return R.setGraph(Object.assign({},_,S(B,m),u.pick(B,g))),M.nodes().forEach(O=>{const z=S(k(M.node(O)),p);Object.keys(b).forEach(F=>{z[F]===void 0&&(z[F]=b[F])}),R.setNode(O,z),R.setParent(O,M.parent(O))}),M.edges().forEach(O=>{let z=k(M.edge(O));R.setEdge(O,Object.assign({},y,S(z,x),u.pick(z,v)))}),R}(j));I(" runLayout",()=>function(M,R,B){R(" makeSpaceForEdgeLabels",()=>function(O){let z=O.graph();z.ranksep/=2,O.edges().forEach(F=>{let V=O.edge(F);V.minlen*=2,V.labelpos.toLowerCase()!=="c"&&(z.rankdir==="TB"||z.rankdir==="BT"?V.width+=V.labeloffset:V.height+=V.labeloffset)})}(M)),R(" removeSelfEdges",()=>function(O){O.edges().forEach(z=>{if(z.v===z.w){var F=O.node(z.v);F.selfEdges||(F.selfEdges=[]),F.selfEdges.push({e:z,label:O.edge(z)}),O.removeEdge(z)}})}(M)),R(" acyclic",()=>t.run(M)),R(" nestingGraph.run",()=>i.run(M)),R(" rank",()=>n(u.asNonCompoundGraph(M))),R(" injectEdgeLabelProxies",()=>function(O){O.edges().forEach(z=>{let F=O.edge(z);if(F.width&&F.height){let V=O.node(z.v),L={rank:(O.node(z.w).rank-V.rank)/2+V.rank,e:z};u.addDummyNode(O,"edge-proxy",L,"_ep")}})}(M)),R(" removeEmptyRanks",()=>s(M)),R(" nestingGraph.cleanup",()=>i.cleanup(M)),R(" normalizeRanks",()=>o(M)),R(" assignRankMinMax",()=>function(O){let z=0;O.nodes().forEach(F=>{let V=O.node(F);V.borderTop&&(V.minRank=O.node(V.borderTop).rank,V.maxRank=O.node(V.borderBottom).rank,z=Math.max(z,V.maxRank))}),O.graph().maxRank=z}(M)),R(" removeEdgeLabelProxies",()=>function(O){O.nodes().forEach(z=>{let F=O.node(z);F.dummy==="edge-proxy"&&(O.edge(F.e).labelRank=F.rank,O.removeNode(z))})}(M)),R(" normalize.run",()=>e.run(M)),R(" parentDummyChains",()=>r(M)),R(" addBorderSegments",()=>a(M)),R(" order",()=>c(M,B)),R(" insertSelfEdges",()=>function(O){var z=u.buildLayerMatrix(O);z.forEach(F=>{var V=0;F.forEach((L,C)=>{var $=O.node(L);$.order=C+V,($.selfEdges||[]).forEach(N=>{u.addDummyNode(O,"selfedge",{width:N.label.width,height:N.label.height,rank:$.rank,order:C+ ++V,e:N.e,label:N.label},"_se")}),delete $.selfEdges})})}(M)),R(" adjustCoordinateSystem",()=>l.adjust(M)),R(" position",()=>d(M)),R(" positionSelfEdges",()=>function(O){O.nodes().forEach(z=>{var F=O.node(z);if(F.dummy==="selfedge"){var V=O.node(F.e.v),L=V.x+V.width/2,C=V.y,$=F.x-L,N=V.height/2;O.setEdge(F.e,F.label),O.removeNode(z),F.label.points=[{x:L+2*$/3,y:C-N},{x:L+5*$/6,y:C-N},{x:L+$,y:C},{x:L+5*$/6,y:C+N},{x:L+2*$/3,y:C+N}],F.label.x=F.x,F.label.y=F.y}})}(M)),R(" removeBorderNodes",()=>function(O){O.nodes().forEach(z=>{if(O.children(z).length){let F=O.node(z),V=O.node(F.borderTop),L=O.node(F.borderBottom),C=O.node(F.borderLeft[F.borderLeft.length-1]),$=O.node(F.borderRight[F.borderRight.length-1]);F.width=Math.abs($.x-C.x),F.height=Math.abs(L.y-V.y),F.x=C.x+F.width/2,F.y=V.y+F.height/2}}),O.nodes().forEach(z=>{O.node(z).dummy==="border"&&O.removeNode(z)})}(M)),R(" normalize.undo",()=>e.undo(M)),R(" fixupEdgeLabelCoords",()=>function(O){O.edges().forEach(z=>{let F=O.edge(z);if(Object.hasOwn(F,"x"))switch(F.labelpos!=="l"&&F.labelpos!=="r"||(F.width-=F.labeloffset),F.labelpos){case"l":F.x-=F.width/2+F.labeloffset;break;case"r":F.x+=F.width/2+F.labeloffset}})}(M)),R(" undoCoordinateSystem",()=>l.undo(M)),R(" translateGraph",()=>function(O){let z=Number.POSITIVE_INFINITY,F=0,V=Number.POSITIVE_INFINITY,L=0,C=O.graph(),$=C.marginx||0,N=C.marginy||0;function H(Y){let Z=Y.x,q=Y.y,re=Y.width,ne=Y.height;z=Math.min(z,Z-re/2),F=Math.max(F,Z+re/2),V=Math.min(V,q-ne/2),L=Math.max(L,q+ne/2)}O.nodes().forEach(Y=>H(O.node(Y))),O.edges().forEach(Y=>{let Z=O.edge(Y);Object.hasOwn(Z,"x")&&H(Z)}),z-=$,V-=N,O.nodes().forEach(Y=>{let Z=O.node(Y);Z.x-=z,Z.y-=V}),O.edges().forEach(Y=>{let Z=O.edge(Y);Z.points.forEach(q=>{q.x-=z,q.y-=V}),Object.hasOwn(Z,"x")&&(Z.x-=z),Object.hasOwn(Z,"y")&&(Z.y-=V)}),C.width=F-z+$,C.height=L-V+N}(M)),R(" assignNodeIntersects",()=>function(O){O.edges().forEach(z=>{let F,V,L=O.edge(z),C=O.node(z.v),$=O.node(z.w);L.points?(F=L.points[0],V=L.points[L.points.length-1]):(L.points=[],F=$,V=C),L.points.unshift(u.intersectRect(C,F)),L.points.push(u.intersectRect($,V))})}(M)),R(" reversePoints",()=>function(O){O.edges().forEach(z=>{let F=O.edge(z);F.reversed&&F.points.reverse()})}(M)),R(" acyclic.undo",()=>t.undo(M))}(T,I,E)),I(" updateInputGraph",()=>function(M,R){M.nodes().forEach(B=>{let O=M.node(B),z=R.node(B);O&&(O.x=z.x,O.y=z.y,O.rank=z.rank,R.children(B).length&&(O.width=z.width,O.height=z.height))}),M.edges().forEach(B=>{let O=M.edge(B),z=R.edge(B);O.points=z.points,Object.hasOwn(z,"x")&&(O.x=z.x,O.y=z.y)}),M.graph().width=R.graph().width,M.graph().height=R.graph().height}(j,T))})};let m=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},g=["acyclicer","ranker","rankdir","align"],p=["width","height"],b={width:0,height:0},x=["minlen","weight","width","height","labeloffset"],y={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},v=["labelpos"];function S(j,E){return u.mapValues(u.pick(j,E),Number)}function k(j){var E={};return j&&Object.entries(j).forEach(([I,T])=>{typeof I=="string"&&(I=I.toLowerCase()),E[I]=T}),E}return sf}function xD(){if(f2)return af;f2=1;let t=Dt(),e=Gn().Graph;return af={debugOrdering:function(n){let o=t.buildLayerMatrix(n),r=new e({compound:!0,multigraph:!0}).setGraph({});return n.nodes().forEach(s=>{r.setNode(s,{label:s}),r.setParent(s,"layer"+n.node(s).rank)}),n.edges().forEach(s=>r.setEdge(s.v,s.w,{},s.name)),o.forEach((s,i)=>{let a="layer"+i;r.setNode(a,{rank:"same"}),s.reduce((l,c)=>(r.setEdge(l,c,{style:"invis"}),c))}),r}},af}var S2=_2?g2:(_2=1,g2={graphlib:Gn(),layout:yD(),debug:xD(),util:{time:Dt().time,notime:Dt().notime},version:p2?m2:(p2=1,m2="1.1.4")});const Wi=new S2.graphlib.Graph().setDefaultEdgeLabel(()=>({})),C2=(t,e,n)=>(Wi.setGraph({rankdir:n.direction,nodesep:150,ranksep:200,ranker:"longest-path"}),e.forEach(o=>Wi.setEdge(o.source,o.target)),t.forEach(o=>Wi.setNode(o.id,{...o,width:o.width??0,height:o.height??0})),S2.layout(Wi),{nodes:t.map(o=>{const{x:r,y:s}=Wi.node(o.id);return{...o,position:{x:r,y:s}}}),edges:e}),N2=new class{createEdge(t,e){return{animated:!0,markerEnd:{type:as.ArrowClosed},id:`${t}-${e}`,style:{strokeWidth:2},source:t,sourceHandle:"outputs",targetHandle:"inputs",target:e}}createNode(t,e){return{id:t,data:{atom:e,forceWidth:300},width:300,type:"custom",height:vh(dt.get(e).code.trim().split(`
|
119
|
-
`).length),position:{x:0,y:0}}}createElements(t,e,n,o){const r=[],s=[],i=new Set,a=new Set;for(const l of Object.values(n)){if(l.value==="marimo"&&l.name==="mo")continue;const{declaredBy:c,usedBy:d}=l;for(const u of c)for(const f of d){const m=`${u}-${f}`;a.has(m)||(a.add(m),i.add(u),i.add(f),s.push(this.createEdge(u,f)))}}for(const[l,c]of Ym.zip(t,e)){o||r.push(this.createNode(l,c));const d=i.has(l),u=dt.get(c).code.trim().startsWith("mo.md");!d&&u||r.push(this.createNode(l,c))}return{nodes:r,edges:s}}},wD=t=>{const e=X.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:i,settings:a}=t;let l;e[0]!==r||e[1]!==n||e[2]!==i||e[3]!==a.hidePureMarkdown||e[4]!==o?(l=()=>{let C=N2.createElements(n,r,o,a.hidePureMarkdown);return C=C2(C.nodes,C.edges,{direction:i}),C},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[c]=A.useState(l),[d,u,f]=rv(c.nodes),[m,_,g]=sv(c.edges),p=Vi();let b;e[6]!==i||e[7]!==_||e[8]!==u?(b=C=>{const $=C2(C.nodes,C.edges,{direction:i});u($.nodes),_($.edges)},e[6]=i,e[7]=_,e[8]=u,e[9]=b):b=e[9];const x=Qe(b);let y,v;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==x||e[14]!==o?(y=()=>{x(N2.createElements(n,r,o,a.hidePureMarkdown))},v=[n,o,r,x,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=x,e[14]=o,e[15]=y,e[16]=v):(y=e[15],v=e[16]),A.useEffect(y,v);const[S,k]=A.useState();let j;hv(),e[17]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{k(void 0)},e[17]=j):j=e[17];const E=j;let I,T,M,R,B,O,z,F,V,L;return e[18]===Symbol.for("react.memo_cache_sentinel")?(I={minZoom:.5,maxZoom:1.5},T=(C,$)=>{k({type:"node",id:$.id})},M=(C,$)=>{const{source:N,target:H}=$;k({type:"edge",source:N,target:H})},e[18]=I,e[19]=T,e[20]=M):(I=e[18],T=e[19],M=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(R=h.jsx(U9,{color:"#ccc",variant:Ln.Dots}),e[21]=R):R=e[21],e[22]!==p||e[23]!==d?(B=()=>{const C=dt.get(nV);if(C){const $=d.find(N=>N.id===C);$&&(p.fitView({padding:1,duration:600,nodes:[$]}),k({type:"node",id:C}))}},e[22]=p,e[23]=d,e[24]=B):B=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(O=h.jsx(Tp,{className:"size-4"}),e[25]=O):O=e[25],e[26]!==B?(z=h.jsx(R9,{position:"bottom-right",showInteractive:!1,children:h.jsx(Oe,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:h.jsx(ps,{onMouseDown:fn.preventFocus,onClick:B,children:O})})}),e[26]=B,e[27]=z):z=e[27],e[28]!==m||e[29]!==S||e[30]!==o?(F=h.jsx(zl,{selection:S,variables:o,edges:m,onClearSelection:E}),e[28]=m,e[29]=S,e[30]=o,e[31]=F):F=e[31],e[32]!==s||e[33]!==m||e[34]!==d||e[35]!==g||e[36]!==f||e[37]!==z||e[38]!==F?(V=h.jsxs(wh,{nodes:d,edges:m,nodeTypes:dv,minZoom:.2,fitViewOptions:I,onNodeClick:T,onEdgeClick:M,onNodeDoubleClick:vD,fitView:!0,onNodesChange:f,onEdgesChange:g,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[R,z,F,s]}),e[32]=s,e[33]=m,e[34]=d,e[35]=g,e[36]=f,e[37]=z,e[38]=F,e[39]=V):V=e[39],e[40]!==i||e[41]!==V?(L=h.jsx(lv.Provider,{value:i,children:V}),e[40]=i,e[41]=V,e[42]=L):L=e[42],L};function vD(t,e){q4(e.id,"focus")}const kD=Ut("_minimap_"),SD=Ut({hidePureMarkdown:!0}),CD=t=>{const e=X.c(11),[n,o]=hn(kD),[r,s]=hn(SD);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?h.jsx(q9,{...t,children:h.jsx(Sh,{settings:r,onSettingsChange:s,view:n,onChange:o})}):h.jsx(wD,{...t,settings:r,layoutDirection:n,children:h.jsx(Sh,{settings:r,onSettingsChange:s,view:n,onChange:o})}),e[0]=n,e[1]=t,e[2]=o,e[3]=s,e[4]=r,e[5]=i):i=e[5];const a=i;let l,c;return e[6]!==a?(l=a(),e[6]=a,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(c=h.jsx(xh,{children:l},n),e[8]=n,e[9]=l,e[10]=c):c=e[10],c},ND=()=>{const t=X.c(5),e=G4(),n=Uc(),[o]=oV();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Me("w-full h-full flex-1 mx-auto -mb-4 relative"),t[0]=r):r=t[0],t[1]!==n.inOrderIds||t[2]!==o||t[3]!==e?(s=h.jsx("div",{className:r,children:h.jsx(CD,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},j2="name",E2="type-value",cf="defs-refs",jD=[{id:j2,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>h.jsx(Qm,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return h.jsx(kh,{name:e,declaredBy:n})}},{id:E2,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>h.jsx(Qm,{header:h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{children:"Type"}),h.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return h.jsxs("div",{className:"max-w-[150px]",children:[h.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),h.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:cf,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>h.jsx(Qm,{header:h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{children:"Declared By"}),h.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=sc(s);i&&Jm(i,o)};return h.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[h.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[h.jsx("span",{title:"Declared by",children:h.jsx(qp,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?h.jsx(mr,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):h.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>h.jsxs("span",{className:"flex",children:[h.jsx(mr,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),h.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[h.jsx("span",{title:"Used by",children:h.jsx(Ea,{className:"w-3.5 h-3.5 text-muted-foreground"})}),h.jsx(uv,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],I2=A.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=K.useState([]),[s,i]=K.useState(""),a=rV(),l=A.useMemo(()=>{const u=f=>{const m=a[f];return cV(m)?`cell-${e.indexOf(f)}`:m??`cell-${e.indexOf(f)}`};return Object.values(n).map(f=>({...f,declaredByNames:f.declaredBy.map(u),usedByNames:f.usedBy.map(u)}))},[n,a,e]),c=A.useMemo(()=>{const u=new Map;return e.forEach((f,m)=>u.set(f,m)),function(f,m,_){m||(m={id:cf,desc:!1});let g=[];switch(m.id){case j2:g=wa(f,p=>p.name);break;case E2:g=wa(f,p=>p.dataType);break;case cf:g=wa(f,p=>_.get(p.declaredBy[0]))}return m.desc?g.reverse():g}(l,o[0],u)},[l,o,e]),d=sV({data:c,columns:jD,getCoreRowModel:lV(),onGlobalFilterChange:i,getFilteredRowModel:aV(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:u=>u.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:iV(),state:{sorting:o,globalFilter:s}});return h.jsxs(h.Fragment,{children:[h.jsx(Y4,{className:"w-full",placeholder:"Search",value:s,onChange:u=>i(u.target.value)}),h.jsxs(Km,{className:Me("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[h.jsx(Xm,{children:h.jsx(Xs,{className:"whitespace-nowrap text-xs",children:d.getFlatHeaders().map(u=>h.jsx(Dr,{className:"sticky top-0 bg-background border-b",children:J4(u.column.columnDef.header,u.getContext())},u.id))})}),h.jsx(Zm,{children:d.getRowModel().rows.map(u=>h.jsx(Xs,{className:"hover:bg-accent",children:u.getVisibleCells().map(f=>h.jsx(Rr,{className:"border-b",children:J4(f.column.columnDef.cell,f.getContext())},f.id))},u.id))})]})]})});I2.displayName="VariableTable";let A2,T2,M2;A2=()=>{const t=X.c(4),e=G4(),n=Uc();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(An,{title:"No variables",description:"Global variables will appear here.",icon:h.jsx(uc,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=h.jsx(I2,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},ap=t=>{const e=X.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=Me("text-xs font-semibold text-accent-foreground",t.className),e[0]=t.className,e[1]=o):o=e[1],e[2]!==t.dataTestId||e[3]!==t.onClick||e[4]!==o?(r=h.jsx("button",{type:"button","data-testid":n,className:o,onClick:t.onClick,children:"Clear"}),e[2]=t.dataTestId,e[3]=t.onClick,e[4]=o,e[5]=r):r=e[5],r},T2=()=>{const t=X.c(9),e=dV(),{clearLogs:n}=Lt();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(An,{title:"No logs",description:h.jsxs("span",{children:[i," and"," ",h.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:h.jsx(xm,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=h.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:h.jsx(ap,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=h.jsx("div",{className:"overflow-auto flex-1",children:h.jsx(M2,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=h.jsxs(h.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},M2=t=>{const e=X.c(10),{logs:n,className:o}=t;let r,s,i,a,l;return e[0]!==o?(r=Me("flex flex-col",o),e[0]=o,e[1]=r):r=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(s={whiteSpace:"pre-wrap"},e[2]=s):s=e[2],e[3]!==n?(i=n.map(AD),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=h.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:h.jsx("div",{className:"grid grid-cols-[30px,1fr]",style:s,children:i})}),e[5]=i,e[6]=a):a=e[6],e[7]!==r||e[8]!==a?(l=h.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function ED(t){const e=uV(t.timestamp),n=ID[t.level],o=t.level.toUpperCase();return h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:["[",e,"]"]}),h.jsx("span",{className:Me("flex-shrink-0",n),children:o}),h.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)]",children:["(",h.jsx(mr,{cellId:t.cellId}),")"]}),t.message]})}const ID={stdout:"text-[var(--grass-9)]",stderr:"text-[var(--red-9)]"};function AD(t,e){return h.jsxs("div",{className:"contents group",children:[h.jsx("span",{className:Me("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),h.jsx("span",{className:Me("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:ED(t)})]},e)}const TD=()=>{const t=X.c(5),{documentation:e}=$e(hV);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(An,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:h.jsx(rd,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=qm({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=h.jsx("div",{className:"p-3 overflow-y-auto overflow-x-hidden h-full docs-documentation flex flex-col gap-4",children:n}),t[3]=n,t[4]=o):o=t[4],o};function O2(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}cp=function(t){t===void 0&&(t={});var e=t.onResize,n=A.useRef(void 0);n.current=e;var o=t.round||Math.round,r=A.useRef(),s=A.useState({width:void 0,height:void 0}),i=s[0],a=s[1],l=A.useRef(!1);A.useEffect(function(){return l.current=!1,function(){l.current=!0}},[]);var c=A.useRef({width:void 0,height:void 0}),d=function(u,f){var m=A.useRef(null),_=A.useRef(null);_.current=f;var g=A.useRef(null);A.useEffect(function(){p()});var p=A.useCallback(function(){var b=g.current,x=_.current,y=b||(x?x instanceof Element?x:x.current:null);m.current&&m.current.element===y&&m.current.subscriber===u||(m.current&&m.current.cleanup&&m.current.cleanup(),m.current={element:y,subscriber:u,cleanup:y?u(y):void 0})},[u]);return A.useEffect(function(){return function(){m.current&&m.current.cleanup&&(m.current.cleanup(),m.current=null)}},[]),A.useCallback(function(b){g.current=b,p()},[p])}(A.useCallback(function(u){return r.current&&r.current.box===t.box&&r.current.round===o||(r.current={box:t.box,round:o,instance:new ResizeObserver(function(f){var m=f[0],_=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",g=O2(m,_,"inlineSize"),p=O2(m,_,"blockSize"),b=g?o(g):void 0,x=p?o(p):void 0;if(c.current.width!==b||c.current.height!==x){var y={width:b,height:x};c.current.width=b,c.current.height=x,n.current?n.current(y):l.current||a(y)}})}),r.current.instance.observe(u,{box:t.box}),function(){r.current&&r.current.instance.unobserve(u)}},[t.box,o]),t.ref);return A.useMemo(function(){return{ref:d,width:i.width,height:i.height}},[d,i.width,i.height])};const df=new Map,MD=({file:t,onOpenNotebook:e})=>{const{theme:n}=po(),o=$e(pm),[r,s]=A.useState(""),{data:i,loading:a,error:l,setData:c}=Xn(async()=>{const g=await K4({path:t.path}),p=g.contents||"";return s(df.get(t.path)||p),g},[t.path]),d=async()=>{r!==(i==null?void 0:i.contents)&&await yV({path:t.path,contents:r}).then(g=>{g.success&&(c(p=>p?{...p,contents:r}:void 0),s(r))})},u=A.useRef(r);if(u.current=r,A.useEffect(()=>()=>{if(!(i!=null&&i.contents))return;const g=u.current;g===i.contents?df.delete(t.path):df.set(t.path,g)},[t.path,i==null?void 0:i.contents]),l)return h.jsx(Zs,{error:l});if(a||!i)return null;const f=i.mimeType||"text/plain",m=f in uf;if(!i.contents&&!m)return h.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[h.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),h.jsx("div",{children:i.file.name}),h.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),h.jsx("div",{children:f})]});const _=h.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!Jn()&&h.jsx(Oe,{content:"Open notebook",children:h.jsx(wn,{size:"small",onClick:g=>e(g),children:h.jsx(bc,{})})}),h.jsx(Oe,{content:"Download",children:h.jsx(wn,{size:"small",onClick:()=>{if(D2(f)){const g=_V(i.contents,f);bV(g,i.file.name)}else sa(new Blob([i.contents||r],{type:f}),i.file.name)},children:h.jsx(Cm,{})})}),!D2(f)&&h.jsxs(h.Fragment,{children:[h.jsx(Oe,{content:"Copy contents to clipboard",children:h.jsx(wn,{size:"small",onClick:async()=>{await xn(r)},children:h.jsx(Ls,{})})}),h.jsx(Oe,{content:mn("global.save"),children:h.jsx(wn,{size:"small",color:r===i.contents?void 0:"green",onClick:d,disabled:r===i.contents,children:h.jsx(ja,{})})})]})]});return f.startsWith("image/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(fV,{base64:i.contents,mime:f})})]}):f==="text/csv"&&i.contents?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(mV,{contents:i.contents})})]}):f.startsWith("audio/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(pV,{base64:i.contents,mime:f})})]}):f.startsWith("video/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(gV,{base64:i.contents,mime:f})})]}):h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-auto",children:h.jsx(ba,{theme:n==="dark"?"dark":"light",language:uf[f]||uf.default,className:"border-b",extensions:[st.lineWrapping,$n.of([{key:o.getHotkey("global.save").key,stopPropagation:!0,run:()=>r!==i.contents&&(d(),!0)}])],value:r,onChange:s})})]})},D2=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/"),uf={"application/javascript":"javascript","text/markdown":"markdown","text/html":"html","text/css":"css","text/x-python":"python","application/json":"json","application/xml":"xml","text/x-yaml":"yaml","text/csv":"markdown","text/plain":"markdown",default:"markdown"},R2=Ut(new class{constructor(t){this.callbacks=t,this.delegate=new np([]),this.rootPath="",this.onChange=En.NOOP,this.path=new vm("/"),this.initialize=async e=>{if(this.onChange=e,this.delegate.data.length===0)try{const n=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new np(n.files),this.rootPath=n.root,this.path=vm.guessDeliminator(n.root)}catch(n){lt({title:"Failed",description:S4(n)})}this.onChange(this.delegate.data)},this.refreshAll=async e=>{const n=[this.rootPath,...e.map(r=>{var s;return(s=this.delegate.find(r))==null?void 0:s.data.path})].filter(Boolean),o=await Promise.all(n.map(r=>this.callbacks.listFiles({path:r}).catch(()=>({files:[]}))));for(const[r,s]of n.entries()){const i=o[r];s===this.rootPath?this.delegate=new np(i.files):this.delegate.update({id:s,changes:{children:i.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=e=>{const n=function(o){return o.endsWith("/")?o:`${o}/`}(this.rootPath);return e.startsWith(n)?e.slice(n.length):e},this.handleResponse=e=>e.success?e:(lt({title:"Failed",description:e.message}),null)}async expand(t){const e=this.delegate.find(t);if(!e||!e.data.isDirectory)return!1;if(e.children&&e.children.length>0)return!0;const n=await this.callbacks.listFiles({path:e.data.path});return this.delegate.update({id:t,changes:{children:n.files}}),this.onChange(this.delegate.data),!0}async rename(t,e){const n=this.delegate.find(t);if(!n)return;const o=n.data.path,r=this.path.join(this.path.dirname(o),e);await this.callbacks.renameFileOrFolder({path:o,newPath:r}).then(this.handleResponse),this.delegate.update({id:t,changes:{name:e,path:r}}),this.onChange(this.delegate.data),await this.refreshAll([r])}async move(t,e){var o;const n=e?((o=this.delegate.find(e))==null?void 0:o.data.path)??e:this.rootPath;await Promise.all(t.map(r=>{this.delegate.move({id:r,parentId:e,index:0});const s=this.delegate.find(r);if(!s)return Promise.resolve();const i=this.path.join(n,this.path.basename(s.data.path));return this.delegate.update({id:r,changes:{path:i}}),this.callbacks.renameFileOrFolder({path:s.data.path,newPath:i}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([n])}async createFile(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"file",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async createFolder(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"directory",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async delete(t){const e=this.delegate.find(t);e&&(await this.callbacks.deleteFileOrFolder({path:e.data.path}).then(this.handleResponse),this.delegate.drop({id:t}),this.onChange(this.delegate.data))}}({listFiles:i4,createFileOrFolder:X4,deleteFileOrFolder:wV,renameFileOrFolder:xV})),OD=Ut({});function DD(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=r=>{var s;e((s=r.target)==null?void 0:s.result)},o.onerror=r=>{n(new Error(`Failed to read blob: ${r.type}`))},o.readAsDataURL(t)})}function P2(t){const e=X.c(4);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const o=n;let r;return e[2]!==o?(r={multiple:!0,maxSize:104857600,onError:zD,onDropRejected:PD,onDrop:RD,...o},e[2]=o,e[3]=r):r=e[3],vV(r)}async function RD(t){for(const e of t){const n=(await DD(e)).split(",")[1];await X4({path:"",type:"file",name:e.name,contents:n})}await async function(){await dt.get(R2).refreshAll([])}()}function PD(t){lt({title:"File upload failed",description:h.jsx("div",{className:"flex flex-col gap-1",children:t.map(LD)}),variant:"danger"})}function LD(t){return h.jsxs("div",{children:[t.file.name," (",t.errors.map(FD).join(", "),")"]},t.file.name)}function FD(t){return t.message}function zD(t){Qt.error(t),lt({title:"File upload failed",description:t.message,variant:"danger"})}const L2=K.createContext(null),BD=t=>{const e=X.c(60),{height:n}=t,o=A.useRef(null),[r]=hn(R2);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=A.useState(s),[l,c]=A.useState(null),{openPrompt:d}=Un(),[u,f]=hn(OD);let m,_;e[1]!==r?(m=()=>r.initialize(a),e[1]=r,e[2]=m):m=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(_=[],e[3]=_):_=e[3];const{loading:g,error:p}=Xn(m,_);let b;e[4]!==u||e[5]!==r?(b=()=>{r.refreshAll(Object.keys(u).filter(C=>u[C]))},e[4]=u,e[5]=r,e[6]=b):b=e[6];const x=Qe(b);let y;e[7]!==d||e[8]!==r?(y=async()=>{d({title:"Folder name",onConfirm:async C=>{r.createFolder(C,null)}})},e[7]=d,e[8]=r,e[9]=y):y=e[9];const v=Qe(y);let S;e[10]!==d||e[11]!==r?(S=async()=>{d({title:"File name",onConfirm:async C=>{r.createFile(C,null)}})},e[10]=d,e[11]=r,e[12]=S):S=e[12];const k=Qe(S);let j;e[13]!==f?(j=()=>{var C;(C=o.current)==null||C.closeAll(),f({})},e[13]=f,e[14]=j):j=e[14];const E=Qe(j);if(g){let C;return e[15]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(eo,{size:"medium",centered:!0}),e[15]=C):C=e[15],C}if(p){let C;return e[16]!==p?(C=h.jsx(Zs,{error:p}),e[16]=p,e[17]=C):C=e[17],C}if(l){let C,$,N,H,Y,Z;return e[18]===Symbol.for("react.memo_cache_sentinel")?(C=()=>c(null),e[18]=C):C=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?($=h.jsx(Ae,{onClick:C,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:h.jsx(jt,{size:16})}),e[19]=$):$=e[19],e[20]!==l.name?(N=h.jsxs("div",{className:"flex items-center pl-1 pr-3 flex-shrink-0 border-b justify-between",children:[$,h.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=N):N=e[21],e[22]!==l.path||e[23]!==r?(H=q=>F2(q,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=H):H=e[24],e[25]!==l||e[26]!==H?(Y=h.jsx(A.Suspense,{children:h.jsx(MD,{onOpenNotebook:H,file:l})}),e[25]=l,e[26]=H,e[27]=Y):Y=e[27],e[28]!==N||e[29]!==Y?(Z=h.jsxs(h.Fragment,{children:[N,Y]}),e[28]=N,e[29]=Y,e[30]=Z):Z=e[30],Z}let I;e[31]!==E||e[32]!==k||e[33]!==v||e[34]!==x||e[35]!==r?(I=h.jsx(VD,{onRefresh:x,onCreateFile:k,onCreateFolder:v,onCollapseAll:E,tree:r}),e[31]=E,e[32]=k,e[33]=v,e[34]=x,e[35]=r,e[36]=I):I=e[36];const T=n-33;let M,R,B,O,z,F,V,L;return e[37]!==r?(M=async C=>{const{ids:$}=C;for(const N of $)await r.delete(N)},R=async C=>{const{id:$,name:N}=C;await r.rename($,N)},B=async C=>{const{dragIds:$,parentId:N}=C;await r.move($,N)},e[37]=r,e[38]=M,e[39]=R,e[40]=B):(M=e[38],R=e[39],B=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(O=C=>{const $=C[0];$&&($.data.isDirectory||c($.data))},e[41]=O):O=e[41],e[42]!==u||e[43]!==f||e[44]!==r?(z=async C=>{if(await r.expand(C)){const $=u[C]??!1;f({...u,[C]:!$})}},e[42]=u,e[43]=f,e[44]=r,e[45]=z):z=e[45],e[46]!==i||e[47]!==u||e[48]!==M||e[49]!==R||e[50]!==B||e[51]!==z||e[52]!==T?(F=h.jsx(k$,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:u,openByDefault:!1,renderCursor:GD,disableDrop:YD,onDelete:M,onRename:R,onMove:B,onSelect:O,onToggle:z,padding:15,rowHeight:30,indent:UD,overscanCount:1e3,disableMultiSelection:!0,children:WD}),e[46]=i,e[47]=u,e[48]=M,e[49]=R,e[50]=B,e[51]=z,e[52]=T,e[53]=F):F=e[53],e[54]!==F||e[55]!==r?(V=h.jsx(L2.Provider,{value:r,children:F}),e[54]=F,e[55]=r,e[56]=V):V=e[56],e[57]!==V||e[58]!==I?(L=h.jsxs(h.Fragment,{children:[I,V]}),e[57]=V,e[58]=I,e[59]=L):L=e[59],L},UD=15,VD=t=>{const e=X.c(30),{onRefresh:n,onCreateFile:o,onCreateFolder:r,onCollapseAll:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={noDrag:!0,noDragEventsBubbling:!0},e[0]=i):i=e[0];const{getRootProps:a,getInputProps:l}=P2(i);let c,d,u,f,m,_,g,p,b,x,y,v,S,k,j;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(Ca,{size:16}),e[1]=c):c=e[1],e[2]!==o?(d=h.jsx(Oe,{content:"Add file",children:h.jsx(Ae,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:c})}),e[2]=o,e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(Xc,{size:16}),e[4]=u):u=e[4],e[5]!==r?(f=h.jsx(Oe,{content:"Add folder",children:h.jsx(Ae,{"data-testid":"file-explorer-add-folder-button",onClick:r,variant:"text",size:"xs",children:u})}),e[5]=r,e[6]=f):f=e[6],e[7]!==a?(m=a({}),e[7]=a,e[8]=m):m=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(_=kV({variant:"text",size:"xs"}),g=h.jsx(SV,{size:16}),e[9]=_,e[10]=g):(_=e[9],g=e[10]),e[11]!==m?(p=h.jsx(Oe,{content:"Upload file",children:h.jsx("button",{"data-testid":"file-explorer-upload-button",...m,className:_,children:g})}),e[11]=m,e[12]=p):p=e[12],e[13]!==l?(b=l({}),e[13]=l,e[14]=b):b=e[14],e[15]!==b?(x=h.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=x):x=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(R4,{size:16}),e[17]=y):y=e[17],e[18]!==n?(v=h.jsx(Oe,{content:"Refresh",children:h.jsx(Ae,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:y})}),e[18]=n,e[19]=v):v=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(S=h.jsx(_p,{size:16}),e[20]=S):S=e[20],e[21]!==s?(k=h.jsx(Oe,{content:"Collapse all folders",children:h.jsx(Ae,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:S})}),e[21]=s,e[22]=k):k=e[22],e[23]!==x||e[24]!==v||e[25]!==k||e[26]!==d||e[27]!==f||e[28]!==p?(j=h.jsxs("div",{className:"flex items-center justify-end px-2 flex-shrink-0 border-b",children:[d,f,p,x,v,k]}),e[23]=x,e[24]=v,e[25]=k,e[26]=d,e[27]=f,e[28]=p,e[29]=j):j=e[29],j},$D=t=>{const e=X.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,i;return e[0]!==n?(r=a=>{n.data.isDirectory||(a.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!Jn()&&h.jsxs("span",{className:"flex-shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",h.jsx(bc,{className:"inline ml-1",size:12})]}),e[2]=n.data.isMarimoFile,e[3]=o,e[4]=s):s=e[4],e[5]!==n.data.name||e[6]!==r||e[7]!==s?(i=h.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:r,children:[n.data.name,s]}),e[5]=n.data.name,e[6]=r,e[7]=s,e[8]=i):i=e[8],i},HD=t=>{const e=X.c(10),{node:n}=t,o=A.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var c,d;(c=o.current)==null||c.focus(),(d=o.current)==null||d.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),A.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=c=>{c.key==="Escape"&&n.reset(),c.key==="Enter"&&n.submit(c.currentTarget.value)},e[3]=n,e[4]=i,e[5]=a):(i=e[4],a=e[5]),e[6]!==n.data.name||e[7]!==i||e[8]!==a?(l=h.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:JD,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},WD=t=>{const e=X.c(53),{node:n,style:o,dragHandle:r}=t;let s;e[0]!==n.data.isDirectory||e[1]!==n.data.name?(s=n.data.isDirectory?"directory":r4(n.data.name),e[0]=n.data.isDirectory,e[1]=n.data.name,e[2]=s):s=e[2];const i=s,a=s4[i],{openConfirm:l,openPrompt:c}=Un(),d=A.useContext(L2);let u;e[3]!==n.data.path||e[4]!==d?(u=async F=>{F2(F,d?d.relativeFromRoot(n.data.path):n.data.path)},e[3]=n.data.path,e[4]=d,e[5]=u):u=e[5];const f=u;let m;e[6]!==n.data.name||e[7]!==n.id||e[8]!==n.tree||e[9]!==l?(m=async F=>{F.stopPropagation(),F.preventDefault(),l({title:"Delete file",description:`Are you sure you want to delete ${n.data.name}?`,confirmAction:h.jsx(W3,{onClick:async()=>{await n.tree.delete(n.id)},"aria-label":"Confirm",children:"Delete"})})},e[6]=n.data.name,e[7]=n.id,e[8]=n.tree,e[9]=l,e[10]=m):m=e[10];const _=m;let g;e[11]!==n||e[12]!==c||e[13]!==d?(g=async()=>{n.open(),c({title:"Folder name",onConfirm:async F=>{d==null||d.createFolder(F,n.id)}})},e[11]=n,e[12]=c,e[13]=d,e[14]=g):g=e[14];const p=Qe(g);let b;e[15]!==n||e[16]!==c||e[17]!==d?(b=async()=>{n.open(),c({title:"File name",onConfirm:async F=>{d==null||d.createFile(F,n.id)}})},e[15]=n,e[16]=c,e[17]=d,e[18]=b):b=e[18];const x=Qe(b);let y;e[19]!==i||e[20]!==x||e[21]!==p||e[22]!==_||e[23]!==f||e[24]!==n||e[25]!==d?(y=()=>{const F={size:14,strokeWidth:1.5,className:"mr-2"};return h.jsxs(mc,{align:"end",className:"no-print w-[220px]",onClick:KD,onCloseAutoFocus:XD,children:[!n.data.isDirectory&&h.jsxs(sn,{onSelect:()=>n.select(),children:[h.jsx(Qp,{...F}),"Open file"]}),!n.data.isDirectory&&!Jn()&&h.jsxs(sn,{onSelect:()=>{CV({path:n.data.path})},children:[h.jsx(bc,{...F}),"Open file in external editor"]}),n.data.isDirectory&&h.jsxs(h.Fragment,{children:[h.jsxs(sn,{onSelect:()=>x(),children:[h.jsx(Ca,{...F}),"Create file"]}),h.jsxs(sn,{onSelect:()=>p(),children:[h.jsx(Xc,{...F}),"Create folder"]}),h.jsx(Fo,{})]}),h.jsxs(sn,{onSelect:()=>n.edit(),children:[h.jsx(zp,{...F}),"Rename"]}),h.jsxs(sn,{onSelect:async()=>{await xn(n.data.path),lt({title:"Copied to clipboard"})},children:[h.jsx(Ls,{...F}),"Copy path"]}),d&&h.jsxs(sn,{onSelect:async()=>{await xn(d.relativeFromRoot(n.data.path)),lt({title:"Copied to clipboard"})},children:[h.jsx(Ls,{...F}),"Copy relative path"]}),h.jsxs(sn,{onSelect:async()=>{lt({title:"Copied to clipboard",description:"Code to open the file has been copied to your clipboard. You can also drag and drop this file into the editor"});const{path:V}=n.data,L=jV[i](V);await xn(L)},children:[h.jsx(NV,{...F}),"Copy snippet for reading file"]}),n.data.isMarimoFile&&!Jn()&&h.jsxs(h.Fragment,{children:[h.jsx(Fo,{}),h.jsxs(sn,{onSelect:f,children:[h.jsx(Yp,{...F}),"Open notebook"]})]}),h.jsx(Fo,{}),!n.data.isDirectory&&h.jsxs(h.Fragment,{children:[h.jsxs(sn,{onSelect:async()=>{const V=(await K4({path:n.data.path})).contents||"";sa(new Blob([V]),n.data.name)},children:[h.jsx(Cm,{...F}),"Download"]}),h.jsx(Fo,{})]}),h.jsxs(sn,{onSelect:_,variant:"danger",children:[h.jsx(mm,{...F}),"Delete"]})]})},e[19]=i,e[20]=x,e[21]=p,e[22]=_,e[23]=f,e[24]=n,e[25]=d,e[26]=y):y=e[26];const v=y;let S,k,j;e[27]===Symbol.for("react.memo_cache_sentinel")?(S=Me("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),e[27]=S):S=e[27],e[28]!==n?(k=F=>{F.stopPropagation(),n.data.isDirectory&&n.toggle()},j=h.jsx(qD,{node:n}),e[28]=n,e[29]=k,e[30]=j):(k=e[29],j=e[30]);const E=n.willReceiveDrop&&n.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground";let I,T,M,R,B,O,z;return e[31]!==E?(I=Me("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",E),e[31]=E,e[32]=I):I=e[32],e[33]!==a||e[34]!==n.data.isMarimoFile?(T=n.data.isMarimoFile?h.jsx("img",{src:"./favicon.ico",className:"w-5 h-5 flex-shrink-0 mr-2 filter grayscale",alt:"Marimo"}):h.jsx(a,{className:"w-5 h-5 flex-shrink-0 mr-2",strokeWidth:1.5}),e[33]=a,e[34]=n.data.isMarimoFile,e[35]=T):T=e[35],e[36]!==f||e[37]!==n?(M=n.isEditing?h.jsx(HD,{node:n}):h.jsx($D,{node:n,onOpenMarimoFile:f}),e[36]=f,e[37]=n,e[38]=M):M=e[38],e[39]===Symbol.for("react.memo_cache_sentinel")?(R=h.jsx(fc,{asChild:!0,tabIndex:-1,onClick:ZD,children:h.jsx(Ae,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:h.jsx(Kc,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),e[39]=R):R=e[39],e[40]!==v?(B=h.jsxs(hc,{modal:!1,children:[R,v()]}),e[40]=v,e[41]=B):B=e[41],e[42]!==I||e[43]!==T||e[44]!==M||e[45]!==B?(O=h.jsxs("span",{className:I,children:[T,M,B]}),e[42]=I,e[43]=T,e[44]=M,e[45]=B,e[46]=O):O=e[46],e[47]!==r||e[48]!==o||e[49]!==O||e[50]!==k||e[51]!==j?(z=h.jsxs("div",{style:o,ref:r,className:S,draggable:!0,onClick:k,children:[j,O]}),e[47]=r,e[48]=o,e[49]=O,e[50]=k,e[51]=j,e[52]=z):z=e[52],z},qD=t=>{const e=X.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx("span",{className:"w-5 h-5 flex-shrink-0"}),e[0]=r):r=e[0],r}let o;return e[1]!==n.isOpen?(o=n.isOpen?h.jsx(ea,{className:"w-5 h-5 flex-shrink-0"}):h.jsx(ta,{className:"w-5 h-5 flex-shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function F2(t,e){t.stopPropagation(),t.preventDefault(),window.open(`/?file=${e}`,"_blank")}function GD(){return null}function YD(t){const{parentNode:e}=t;return!e.data.isDirectory}function JD(t){return t.stopPropagation()}function KD(t){return t.stopPropagation()}function XD(t){return t.preventDefault()}function ZD(t){return t.stopPropagation()}const QD=()=>{const t=X.c(20),{ref:e,height:n}=cp(),o=n===void 0?1:n;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={noClick:!0,noKeyboard:!0},t[0]=r):r=t[0];const{getRootProps:s,getInputProps:i,isDragActive:a}=P2(r);let l,c,d,u,f,m,_,g;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=Me("flex flex-col flex-1 overflow-hidden relative"),t[3]=c):c=t[3],t[4]!==i?(d=i(),t[4]=i,t[5]=d):d=t[5],t[6]!==d?(u=h.jsx("input",{...d}),t[6]=d,t[7]=u):u=t[7],t[8]!==a?(f=a&&h.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=a,t[9]=f):f=t[9],t[10]!==o?(m=h.jsx(BD,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(_=h.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:m}),t[12]=e,t[13]=m,t[14]=_):_=t[14],t[15]!==l||t[16]!==u||t[17]!==f||t[18]!==_?(g=h.jsxs("div",{...l,className:c,children:[u,f,_]}),t[15]=l,t[16]=u,t[17]=f,t[18]=_,t[19]=g):g=t[19],g},eR=t=>{const e=X.c(6),{children:n}=t,{openModal:o,closeModal:r}=Un();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(h.jsx(nR,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=h.jsx(H4,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},tR=[st.lineWrapping],nR=t=>{const e=X.c(23),{onClose:n}=t,[o,r]=A.useState(""),{theme:s}=po();let i,a,l,c,d,u;e[0]!==n?(i=async y=>{y.preventDefault();const v=new FormData(y.target),S=v.get("title"),k=v.get("description"),j=v.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S,description:k,code:j})}),n(),lt({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(dr,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsxs(Os,{children:[a,h.jsxs(Ps,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",h.jsx("a",{href:Kn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(ur,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),d=h.jsx(EV,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=c,e[5]=d):(c=e[4],d=e[5]),e[6]!==o?(u=h.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=u):u=e[7];const f=s==="dark"?"dark":"light";let m,_,g,p,b,x;return e[8]!==o||e[9]!==f?(m=h.jsx(ba,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:tR,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==u||e[12]!==m?(_=h.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[c,d,u,m]}),e[11]=u,e[12]=m,e[13]=_):_=e[13],e[14]!==n?(g=h.jsx(Ae,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=g):g=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(Ae,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=p):p=e[16],e[17]!==g?(b=h.jsxs(oa,{children:[g,p]}),e[17]=g,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==_?(x=h.jsx(cr,{className:"w-fit",children:h.jsxs("form",{onSubmit:i,children:[l,_,b]})}),e[19]=i,e[20]=b,e[21]=_,e[22]=x):x=e[22],x},oR=[st.lineWrapping],rR=()=>{const t=X.c(20),[e,n]=K.useState();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,error:s,loading:i}=Xn(aR,o);if(s){let b;return t[1]!==s?(b=h.jsx(Zs,{error:s}),t[1]=s,t[2]=b):b=t[2],b}if(i||!r){let b;return t[3]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(eo,{size:"medium",centered:!0}),t[3]=b):b=t[3],b}const a=e?"h-1/3":"h-full";let l,c,d,u,f,m,_,g,p;return t[4]!==a?(l=Me("border-b rounded-none",a),t[4]=a,t[5]=l):l=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(na,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[6]=c):c=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsxs("div",{className:"flex items-center w-full",children:[c,h.jsx(eR,{children:h.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:h.jsx(Or,{className:"h-4 w-4"})})})]}),u=h.jsx(dc,{children:"No results"}),t[7]=d,t[8]=u):(d=t[7],u=t[8]),t[9]===Symbol.for("react.memo_cache_sentinel")?(f=b=>n(b),t[9]=f):f=t[9],t[10]!==r.snippets?(m=h.jsx(iR,{onSelect:f,snippets:r.snippets}),t[10]=r.snippets,t[11]=m):m=t[11],t[12]!==l||t[13]!==m?(_=h.jsxs(xc,{className:l,children:[d,u,m]}),t[12]=l,t[13]=m,t[14]=_):_=t[14],t[15]!==e?(g=h.jsx(A.Suspense,{children:h.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:e?h.jsx(sR,{snippet:e},e.title):h.jsx(An,{title:"",description:"Click on a snippet to view its content."})})}),t[15]=e,t[16]=g):g=t[16],t[17]!==_||t[18]!==g?(p=h.jsxs("div",{className:"flex-1 overflow-hidden",children:[_,g]}),t[17]=_,t[18]=g,t[19]=p):p=t[19],p},sR=t=>{const e=X.c(27),{snippet:n}=t,{theme:o}=po(),{createNewCell:r}=Lt(),s=zs();let i;e[0]!==r||e[1]!==s||e[2]!==n.sections?(i=()=>{for(const p of[...n.sections].reverse())p.code&&r({code:p.code,before:!1,cellId:s??"__end__",skipIfCodeExists:!0})},e[0]=r,e[1]=s,e[2]=n.sections,e[3]=i):i=e[3];const a=i;let l;e[4]!==r||e[5]!==s?(l=p=>{r({code:p,before:!1,cellId:s??"__end__"})},e[4]=r,e[5]=s,e[6]=l):l=e[6];const c=l;let d,u,f,m,_,g;if(e[7]!==n.title?(d=h.jsx("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1",children:n.title}),e[7]=n.title,e[8]=d):d=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(ni,{className:"ml-2 h-4 w-4"}),e[9]=u):u=e[9],e[10]!==a?(f=h.jsx("div",{className:"flex justify-end",children:h.jsx(ii,{children:h.jsxs(Ae,{className:"float-right",size:"xs",variant:"outline",onClick:a,children:["Insert snippet",u]})})}),e[10]=a,e[11]=f):f=e[11],e[12]!==c||e[13]!==n.sections||e[14]!==n.title||e[15]!==o){let p;e[17]!==c||e[18]!==n.title||e[19]!==o?(p=b=>{const{code:x,html:y,id:v}=b;return y?h.jsx("div",{children:qm({html:y})},`${n.title}-${v}`):x?h.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[h.jsx(ii,{children:h.jsx(Oe,{content:"Insert snippet",children:h.jsx(Ae,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{c(x)},children:h.jsx(ni,{className:"h-5 w-5"})})})}),h.jsx(ba,{theme:o==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:oR,value:x,readOnly:!0},`${n.title}-${v}`)]},`${n.title}-${v}`):null},e[17]=c,e[18]=n.title,e[19]=o,e[20]=p):p=e[20],m=n.sections.map(p),e[12]=c,e[13]=n.sections,e[14]=n.title,e[15]=o,e[16]=m}else m=e[16];return e[21]!==f||e[22]!==m?(_=h.jsxs("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[f,m]}),e[21]=f,e[22]=m,e[23]=_):_=e[23],e[24]!==d||e[25]!==_?(g=h.jsxs(h.Fragment,{children:[d,_]}),e[24]=d,e[25]=_,e[26]=g):g=e[26],g},iR=t=>{const e=X.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>h.jsx(go,{className:"rounded-none",onSelect:()=>o(a),children:h.jsx("div",{className:"flex flex-row gap-2 items-center",children:h.jsx("span",{className:"mt-1 text-accent-foreground",children:a.title})})},a.title),e[3]=o,e[4]=i):i=e[4],r=n.map(i),e[0]=o,e[1]=n,e[2]=r}else r=e[2];return e[5]!==r?(s=h.jsx(Fm,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s};function aR(){return IV()}const lR=t=>{const e=X.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(d){const u=dt.get(hm)[d];if(u)return u.declaredBy[0]}(n);if(!l)return;const c=sc(l);c&&Jm(c,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=Me("text-link opacity-80 hover:opacity-100 hover:underline",o),e[2]=o,e[3]=i):i=e[3],e[4]!==s||e[5]!==i||e[6]!==n?(a=h.jsx("button",{type:"button",onClick:s,className:i,children:n}),e[4]=s,e[5]=i,e[6]=n,e[7]=a):a=e[7],a},z2=t=>{const e=X.c(4),{isExpanded:n}=t,o=n&&"rotate-90";let r,s;return e[0]!==o?(r=Me("h-3 w-3 transition-transform",o),e[0]=o,e[1]=r):r=e[1],e[2]!==r?(s=h.jsx(ta,{className:r}),e[2]=r,e[3]=s):s=e[3],s},B2=t=>{const e=X.c(2),{children:n}=t;let o;return e[0]!==n?(o=h.jsx("div",{className:"flex gap-1.5 items-center font-bold px-2 py-1.5 text-muted-foreground bg-[var(--slate-2)] text-sm",children:n}),e[0]=n,e[1]=o):o=e[1],o},hf=t=>{const e=X.c(5),{content:n,className:o}=t;let r,s;return e[0]!==o?(r=Me("text-sm text-muted-foreground py-1",o),e[0]=o,e[1]=r):r=e[1],e[2]!==n||e[3]!==r?(s=h.jsx("div",{className:r,children:n}),e[2]=n,e[3]=r,e[4]=s):s=e[4],s},U2=t=>{const e=X.c(3),{error:n}=t;let o,r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(Qn,{className:"h-4 w-4"}),e[0]=o):o=e[0],e[1]!==n.message?(r=h.jsxs("div",{className:"pl-12 text-sm bg-red-50 dark:bg-red-900 text-red-600 dark:text-red-50 flex items-center gap-2 p-2 h-8",children:[o,n.message]}),e[1]=n.message,e[2]=r):r=e[2],r},V2=t=>{const e=X.c(3),{message:n}=t;let o,r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(Pc,{className:"h-4 w-4 animate-spin"}),e[0]=o):o=e[0],e[1]!==n?(r=h.jsxs("div",{className:"pl-12 text-sm bg-blue-50 dark:bg-[var(--accent)] text-blue-500 dark:text-blue-50 flex items-center gap-2 p-2 h-8",children:[o,n]}),e[1]=n,e[2]=r):r=e[2],r},ff=Ut(null),cR=t=>{const e=X.c(9),{packages:n}=t,o=Bs(),r=Gt(ff);if(!n||n.length===0)return null;let s;e[0]!==o||e[1]!==n||e[2]!==r?(s=()=>{const c=n.join(", ");r(c),o.toggleApplication("packages")},e[0]=o,e[1]=n,e[2]=r,e[3]=s):s=e[3];const i=s;let a,l;return e[4]!==n?(a=n.join(", "),e[4]=n,e[5]=a):a=e[5],e[6]!==i||e[7]!==a?(l=h.jsxs(Ae,{variant:"outline",size:"xs",onClick:i,className:"ml-2",children:["Install ",a]}),e[6]=i,e[7]=a,e[8]=l):l=e[8],l},dR=Ut(t=>{const e=t(AV),n=t(hm),o=t(U4);return wa(e,r=>{if(!r.variable_name)return-1;const s=Object.values(n).find(a=>a.name===r.variable_name);if(!s)return 0;const i=o.inOrderIds.indexOf(s.declaredBy[0]);return i===-1?0:i})}),uR=Ut(t=>{const e=new Map(t(TV));for(const n of Z4){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return wa([...e.values()],n=>Z4.has(n.name)?1:0)}),hR=()=>{const t=X.c(32),[e,n]=K.useState(""),o=Gt(Q4),r=$e(dR),s=$e(uR);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(An,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:h.jsx(Dg,{children:h.jsxs(Ae,{variant:"outline",size:"sm",children:["Add database or catalog",h.jsx(Or,{className:"h-4 w-4 ml-2"})]})}),icon:h.jsx(lr,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,c,d,u,f,m,_,g,p;if(t[1]!==o?(a=b=>{o(b.length>0),n(b)},t[1]=o,t[2]=a):a=t[2],t[3]!==e||t[4]!==a?(l=h.jsx(na,{placeholder:"Search tables...",className:"h-6 m-1",value:e,onValueChange:a,rootClassName:"flex-1 border-r"}),t[3]=e,t[4]=a,t[5]=l):l=t[5],t[6]!==i?(c=i&&h.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:()=>n(""),children:h.jsx(Qn,{className:"h-4 w-4"})}),t[6]=i,t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(Dg,{children:h.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:h.jsx(Or,{className:"h-4 w-4"})})}),t[8]=d):d=t[8],t[9]!==l||t[10]!==c?(u=h.jsxs("div",{className:"flex items-center w-full",children:[l,c,d]}),t[9]=l,t[10]=c,t[11]=u):u=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=x=>h.jsx(fR,{connection:x,hasChildren:x.databases.length>0,children:x.databases.map(y=>h.jsx(mR,{engineName:x.name,database:y,hasSearch:i,children:h.jsx(pR,{schemas:y.schemas,defaultSchema:x.default_schema,defaultDatabase:x.default_database,engineName:x.name,databaseName:y.name,hasSearch:i,searchValue:e})},y.name))},x.name),t[16]=i,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=i,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(m=s.length>0&&r.length>0&&h.jsxs(B2,{children:[h.jsx(lc,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=m):m=t[21],t[22]!==e||t[23]!==r?(_=r.length>0&&h.jsx($2,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=_):_=t[24],t[25]!==f||t[26]!==m||t[27]!==_?(g=h.jsxs(Fm,{className:"flex flex-col",children:[f,m,_]}),t[25]=f,t[26]=m,t[27]=_,t[28]=g):g=t[28],t[29]!==u||t[30]!==g?(p=h.jsxs(xc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-none",shouldFilter:!1,children:[u,g]}),t[29]=u,t[30]=g,t[31]=p):p=t[31],p},fR=t=>{const e=X.c(25),{connection:n,children:o,hasChildren:r}=t,s=n.name===MV,i=s?"In-Memory":n.name,[a,l]=K.useState(!1);let c;e[0]!==n.name?(c=async()=>{l(!0),await DV({engine:n.name}),setTimeout(()=>l(!1),500)},e[0]=n.name,e[1]=c):c=e[1];const d=c;let u,f,m;e[2]!==n.dialect?(u=h.jsx(Q3,{className:"h-4 w-4 text-muted-foreground",name:n.dialect}),e[2]=n.dialect,e[3]=u):u=e[3],e[4]!==n.dialect?(f=OV(n.dialect),e[4]=n.dialect,e[5]=f):f=e[5],e[6]!==f?(m=h.jsx("span",{className:"text-xs",children:f}),e[6]=f,e[7]=m):m=e[7];const _=i;let g,p,b,x,y;return e[8]!==_?(g=h.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",h.jsx(lR,{variableName:_}),")"]}),e[8]=_,e[9]=g):g=e[9],e[10]!==d||e[11]!==s||e[12]!==a?(p=!s&&h.jsx(Oe,{content:"Refresh connection",children:h.jsx(Ae,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:d,children:h.jsx(Ac,{className:Me("h-4 w-4 text-muted-foreground hover:text-foreground",a&&"animate-[spin_0.5s]")})})}),e[10]=d,e[11]=s,e[12]=a,e[13]=p):p=e[13],e[14]!==u||e[15]!==m||e[16]!==g||e[17]!==p?(b=h.jsxs(B2,{children:[u,m,g,p]}),e[14]=u,e[15]=m,e[16]=g,e[17]=p,e[18]=b):b=e[18],e[19]!==o||e[20]!==r?(x=r?o:h.jsx(hf,{content:"No databases available",className:"pl-2"}),e[19]=o,e[20]=r,e[21]=x):x=e[21],e[22]!==b||e[23]!==x?(y=h.jsxs(h.Fragment,{children:[b,x]}),e[22]=b,e[23]=x,e[24]=y):y=e[24],y},mR=t=>{const e=X.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=K.useState(!1),[l,c]=K.useState(!1);let d,u,f;e[0]!==n?(d=()=>{a(n)},u=[n],e[0]=n,e[1]=d,e[2]=u):(d=e[1],u=e[2]),K.useEffect(d,u),e[3]!==i||e[4]!==l?(f=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let _;e[6]!==i?(_=h.jsx(z2,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i?"text-foreground":"text-muted-foreground";let p,b;e[8]!==g?(p=Me("h-4 w-4",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=h.jsx(lr,{className:p}),e[10]=p,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,S,k;e[12]!==x?(y=Me(x),e[12]=x,e[13]=y):y=e[13],e[14]!==r.name?(v=r.name===""?h.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=v):v=e[15],e[16]!==y||e[17]!==v?(S=h.jsx("span",{className:y,children:v}),e[16]=y,e[17]=v,e[18]=S):S=e[18],e[19]!==S||e[20]!==f||e[21]!==m||e[22]!==_||e[23]!==b?(k=h.jsxs(go,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[_,b,S]}),e[19]=S,e[20]=f,e[21]=m,e[22]=_,e[23]=b,e[24]=k):k=e[24];const j=i&&s;let E;return e[25]!==k||e[26]!==j?(E=h.jsxs(h.Fragment,{children:[k,j]}),e[25]=k,e[26]=j,e[27]=E):E=e[27],E},pR=t=>{const e=X.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:i,hasSearch:a,searchValue:l}=t;if(n.length===0){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(hf,{content:"No schemas available",className:"pl-6"}),e[0]=u):u=e[0],u}let c,d;if(e[1]!==i||e[2]!==r||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==n||e[7]!==l){let u;e[9]!==l?(u=_=>!l||_.tables.some(g=>g.name.toLowerCase().includes(l.toLowerCase())),e[9]=l,e[10]=u):u=e[10];const f=n.filter(u);let m;e[11]!==i||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==a||e[16]!==l?(m=_=>h.jsx(gR,{databaseName:i,schema:_,hasSearch:a,children:h.jsx($2,{tables:_.tables,searchValue:l,sqlTableContext:{engine:s,database:i,schema:_.name,defaultSchema:o,defaultDatabase:r}})},_.name),e[11]=i,e[12]=r,e[13]=o,e[14]=s,e[15]=a,e[16]=l,e[17]=m):m=e[17],c=f.map(m),e[1]=i,e[2]=r,e[3]=o,e[4]=s,e[5]=a,e[6]=n,e[7]=l,e[8]=c}else c=e[8];return e[18]!==c?(d=h.jsx(h.Fragment,{children:c}),e[18]=c,e[19]=d):d=e[19],d},gR=t=>{const e=X.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=K.useState(!1),[l,c]=K.useState(!1),d=`${n}:${o.name}`;let u,f,m,_;if(e[0]!==s?(u=()=>{a(s)},f=[s],e[0]=s,e[1]=u,e[2]=f):(u=e[1],f=e[2]),K.useEffect(u,f),tS(o.name))return r;e[3]!==i||e[4]!==l?(m=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=m):m=e[5],e[6]!==i?(_=h.jsx(z2,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i&&"text-foreground";let p,b;e[8]!==g?(p=Me("h-4 w-4 text-muted-foreground",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=h.jsx(BV,{className:p}),e[10]=p,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,S;e[12]!==x?(y=Me(x),e[12]=x,e[13]=y):y=e[13],e[14]!==o.name||e[15]!==y?(v=h.jsx("span",{className:y,children:o.name}),e[14]=o.name,e[15]=y,e[16]=v):v=e[16],e[17]!==v||e[18]!==m||e[19]!==_||e[20]!==b||e[21]!==d?(S=h.jsxs(go,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:d,children:[_,b,v]}),e[17]=v,e[18]=m,e[19]=_,e[20]=b,e[21]=d,e[22]=S):S=e[22];const k=i&&r;let j;return e[23]!==S||e[24]!==k?(j=h.jsxs(h.Fragment,{children:[S,k]}),e[23]=S,e[24]=k,e[25]=j):j=e[25],j},$2=t=>{const e=X.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=eS(),[i,a]=K.useState(!1),[l,c]=K.useState(!1);let d,u;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==i?(d=async()=>{if(n.length===0&&o&&!i){a(!0),c(!0);const{engine:p,database:b,schema:x}=o,y=await W$.request({engine:p,database:b,schema:x});if(!(y!=null&&y.tables))throw c(!1),new Error("No tables available");s({tables:y.tables,sqlTableContext:o}),c(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=i,e[4]=d):d=e[4],e[5]!==o||e[6]!==n.length||e[7]!==i?(u=[n.length,o,i],e[5]=o,e[6]=n.length,e[7]=i,e[8]=u):u=e[8];const{loading:f,error:m}=Xn(d,u);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(V2,{message:"Loading tables..."}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=h.jsx(U2,{error:m}),e[10]=m,e[11]=p):p=e[11],p}if(n.length===0){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(hf,{content:"No tables found",className:"pl-9"}),e[12]=p):p=e[12],p}let _,g;if(e[13]!==r||e[14]!==o||e[15]!==n){let p;e[17]!==r?(p=y=>!r||y.name.toLowerCase().includes(r.toLowerCase()),e[17]=r,e[18]=p):p=e[18];const b=n.filter(p);let x;e[19]!==r||e[20]!==o?(x=y=>h.jsx(_R,{table:y,sqlTableContext:o,isSearching:!!r},y.name),e[19]=r,e[20]=o,e[21]=x):x=e[21],_=b.map(x),e[13]=r,e[14]=o,e[15]=n,e[16]=_}else _=e[16];return e[22]!==_?(g=h.jsx(h.Fragment,{children:_}),e[22]=_,e[23]=g):g=e[23],g},_R=t=>{const e=X.c(62),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=eS(),[i,a]=K.useState(!1),[l,c]=K.useState(!1),d=n.columns.length>0;let u,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==d||e[5]!==l?(u=async()=>{if(i&&!d&&o&&!l){c(!0);const{engine:q,database:re,schema:ne}=o,oe=await q$.request({engine:q,database:re,schema:ne,tableName:n.name});if(!(oe!=null&&oe.table))throw new Error("No table details available");s({table:oe.table,sqlTableContext:o})}},e[0]=s,e[1]=i,e[2]=o,e[3]=n.name,e[4]=d,e[5]=l,e[6]=u):u=e[6],e[7]!==i||e[8]!==d?(f=[i,d],e[7]=i,e[8]=d,e[9]=f):f=e[9];const{loading:m,error:_}=Xn(u,f),g=$e(Ts),p=zs(),{createNewCell:b}=Lt();let x;e[10]!==g||e[11]!==b||e[12]!==p||e[13]!==o||e[14]!==n?(x=()=>{Ho(g,b,p),b({code:(()=>{if(n.source_type==="catalog"){const q=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${q}")`}if(o)return Vc(n,"*",o);switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return Vc(n,"*",o);default:return oc(n.source_type),""}})(),before:!1,cellId:p??"__end__"})},e[10]=g,e[11]=b,e[12]=p,e[13]=o,e[14]=n,e[15]=x):x=e[15];const y=x;let v;e[16]!==n.num_columns||e[17]!==n.num_rows?(v=()=>{const q=[];return n.num_rows!=null&&q.push(`${n.num_rows} rows`),n.num_columns!=null&&q.push(`${n.num_columns} columns`),q.length===0?null:h.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:h.jsx("span",{className:"text-xs text-muted-foreground",children:q.join(", ")})})},e[16]=n.num_columns,e[17]=n.num_rows,e[18]=v):v=e[18];const S=v;let k;e[19]!==_||e[20]!==m||e[21]!==o||e[22]!==n?(k=()=>m?h.jsx(V2,{message:"Loading columns..."}):_?h.jsx(U2,{error:_}):n.columns.map(q=>h.jsx(bR,{table:n,column:q,sqlTableContext:o},q.name)),e[19]=_,e[20]=m,e[21]=o,e[22]=n,e[23]=k):k=e[23];const j=k;let E;e[24]!==i||e[25]!==r||e[26]!==n.source_type||e[27]!==n.type?(E=()=>{if(n.source_type==="local")return;const q=n.type==="table"?RV:F3;return h.jsx(q,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[24]=i,e[25]=r,e[26]=n.source_type,e[27]=n.type,e[28]=E):E=e[28];const I=E,T=o?`${o.database}.${o.schema}.${n.name}`:n.name,M=o&&(tS(o.schema)?"pl-9":"pl-12"),R=(i||r)&&"font-semibold";let B,O,z,F,V,L,C,$,N,H,Y,Z;return e[29]!==M||e[30]!==R?(B=Me("rounded-none group h-8 cursor-pointer",M,R),e[29]=M,e[30]=R,e[31]=B):B=e[31],e[32]!==i?(O=()=>a(!i),e[32]=i,e[33]=O):O=e[33],e[34]!==I?(z=I(),e[34]=I,e[35]=z):z=e[35],e[36]!==n.name?(F=h.jsx("span",{className:"text-sm",children:n.name}),e[36]=n.name,e[37]=F):F=e[37],e[38]!==z||e[39]!==F?(V=h.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[z,F]}),e[38]=z,e[39]=F,e[40]=V):V=e[40],e[41]!==S?(L=S(),e[41]=S,e[42]=L):L=e[42],e[43]!==y?(C=fn.stopPropagation(()=>y()),e[43]=y,e[44]=C):C=e[44],e[45]===Symbol.for("react.memo_cache_sentinel")?($=h.jsx(oi,{className:"h-3 w-3"}),e[45]=$):$=e[45],e[46]!==C?(N=h.jsx(Oe,{content:"Add table to notebook",delayDuration:400,children:h.jsx(Ae,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:C,children:$})}),e[46]=C,e[47]=N):N=e[47],e[48]!==i||e[49]!==O||e[50]!==V||e[51]!==L||e[52]!==N||e[53]!==B||e[54]!==T?(H=h.jsxs(go,{className:B,value:T,"aria-selected":i,forceMount:!0,onSelect:O,children:[V,L,N]}),e[48]=i,e[49]=O,e[50]=V,e[51]=L,e[52]=N,e[53]=B,e[54]=T,e[55]=H):H=e[55],e[56]!==i||e[57]!==j?(Y=i&&j(),e[56]=i,e[57]=j,e[58]=Y):Y=e[58],e[59]!==H||e[60]!==Y?(Z=h.jsxs(h.Fragment,{children:[H,Y]}),e[59]=H,e[60]=Y,e[61]=Z):Z=e[61],Z},bR=t=>{var H,Y;const e=X.c(52),{table:n,column:o,sqlTableContext:r}=t,[s,i]=K.useState(!1),a=$e(Q4),l=Gt(PV);let c,d;e[0]!==a?(c=()=>{a&&i(!1)},d=[a],e[0]=a,e[1]=c,e[2]=d):(c=e[1],d=e[2]),K.useEffect(c,d),l(s?Z=>new Set([...Z,`${n.name}:${o.name}`]):Z=>(Z.delete(`${n.name}:${o.name}`),new Set(Z)));const u=LV[o.type],f=$e(Ts),m=zs(),{createNewCell:_}=Lt(),{columnsPreviews:g}=FV();let p;e[3]!==o.name||e[4]!==n.primary_keys?(p=((H=n.primary_keys)==null?void 0:H.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=p):p=e[5];const b=p;let x;e[6]!==o.name||e[7]!==n.indexes?(x=((Y=n.indexes)==null?void 0:Y.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=x):x=e[8];const y=x;let v;e[9]!==f||e[10]!==_||e[11]!==m?(v=Z=>{Z.includes("alt")&&function(q,re,ne){sg("altair","alt",oe=>{const G=L3.create();re({cellId:ne??"__end__",before:!1,code:oe,lastCodeRun:q?oe:void 0,newCellId:G,autoFocus:!1}),q&&dm({cellIds:[G],codes:[oe]})})}(f,_,m),_({code:Z,before:!1,cellId:m??"__end__"})},e[9]=f,e[10]=_,e[11]=m,e[12]=v):v=e[12];const S=v,k=wR,j=`${n.name}.${o.name}`,E=`${n.name}.${o.name}`;let I;e[13]!==s?(I=()=>i(!s),e[13]=s,e[14]=I):I=e[14];const T=r?"pl-14":"pl-7";let M,R,B,O,z,F,V,L,C,$,N;return e[15]!==T?(M=Me("flex flex-row gap-2 items-center flex-1",T),e[15]=T,e[16]=M):M=e[16],e[17]!==u?(R=h.jsx(u,{className:"flex-shrink-0 h-3 w-3",strokeWidth:1.5}),e[17]=u,e[18]=R):R=e[18],e[19]!==o.name?(B=h.jsx("span",{children:o.name}),e[19]=o.name,e[20]=B):B=e[20],e[21]!==b?(O=b&&k({tooltipContent:"Primary key",content:"PK"}),e[21]=b,e[22]=O):O=e[22],e[23]!==y?(z=y&&k({tooltipContent:"Indexed",content:"IDX"}),e[23]=y,e[24]=z):z=e[24],e[25]!==M||e[26]!==R||e[27]!==B||e[28]!==O||e[29]!==z?(F=h.jsxs("div",{className:M,children:[R,B,O,z]}),e[25]=M,e[26]=R,e[27]=B,e[28]=O,e[29]=z,e[30]=F):F=e[30],e[31]!==o.name?(V=h.jsx(Oe,{content:"Copy column name",delayDuration:400,children:h.jsx(Ae,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:h.jsx(ep,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[31]=o.name,e[32]=V):V=e[32],e[33]!==o.external_type?(L=h.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[33]=o.external_type,e[34]=L):L=e[34],e[35]!==F||e[36]!==V||e[37]!==L||e[38]!==j||e[39]!==E||e[40]!==I?(C=h.jsxs(go,{className:"rounded-none py-1 group cursor-pointer",value:E,onSelect:I,children:[F,V,L]},j),e[35]=F,e[36]=V,e[37]=L,e[38]=j,e[39]=E,e[40]=I,e[41]=C):C=e[41],e[42]!==o||e[43]!==g||e[44]!==S||e[45]!==s||e[46]!==r||e[47]!==n?($=s&&h.jsx("div",{className:"pl-10 pr-2 py-2 bg-[var(--slate-1)] shadow-inner border-b",children:h.jsx(wc,{children:h.jsx(xR,{table:n,column:o,onAddColumnChart:S,preview:g.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[42]=o,e[43]=g,e[44]=S,e[45]=s,e[46]=r,e[47]=n,e[48]=$):$=e[48],e[49]!==C||e[50]!==$?(N=h.jsxs(h.Fragment,{children:[C,$]}),e[49]=C,e[50]=$,e[51]=N):N=e[51],N},yR=K.lazy(()=>Lc(()=>import("./index-gEOaAA4k.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url).then(t=>({default:t.VegaLite}))),xR=t=>{const e=X.c(50),{table:n,column:o,preview:r,onAddColumnChart:s,sqlTableContext:i}=t,{theme:a}=po();let l,c;if(e[0]!==o||e[1]!==r||e[2]!==i||e[3]!==n.name||e[4]!==n.source||e[5]!==n.source_type?(l=()=>{r||UV({source:n.source,tableName:n.name,columnName:o.name,sourceType:n.source_type,fullyQualifiedTableName:i?`${i.database}.${i.schema}.${n.name}`:n.name})},e[0]=o,e[1]=r,e[2]=i,e[3]=n.name,e[4]=n.source,e[5]=n.source_type,e[6]=l):l=e[6],$4(l),n.source_type==="connection"){const j=o.name,E=o.external_type;let I,T,M,R;return e[7]!==o.name||e[8]!==s||e[9]!==i||e[10]!==n?(I=fn.stopPropagation(()=>{s(Vc(n,o.name,i))}),e[7]=o.name,e[8]=s,e[9]=i,e[10]=n,e[11]=I):I=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(T=h.jsx(oi,{className:"h-3 w-3 mr-1"}),e[12]=T):T=e[12],e[13]!==I?(M=h.jsxs(Ae,{variant:"outline",size:"xs",onClick:I,children:[T," Add SQL cell"]}),e[13]=I,e[14]=M):M=e[14],e[15]!==o.external_type||e[16]!==o.name||e[17]!==M?(R=h.jsxs("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[j," (",E,")",M]}),e[15]=o.external_type,e[16]=o.name,e[17]=M,e[18]=R):R=e[18],R}if(n.source_type==="catalog"){let j;return e[19]!==o.external_type||e[20]!==o.name?(j=h.jsxs("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[o.name," (",o.external_type,")"]}),e[19]=o.external_type,e[20]=o.name,e[21]=j):j=e[21],j}if(!r){let j;return e[22]===Symbol.for("react.memo_cache_sentinel")?(j=h.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading..."}),e[22]=j):j=e[22],j}e[23]!==r.error||e[24]!==r.missing_packages?(c=r.error&&h.jsxs("div",{className:"text-xs text-muted-foreground p-2 border border-muted rounded flex items-center",children:[h.jsx("span",{children:r.error}),r.missing_packages&&h.jsx(cR,{packages:r.missing_packages})]}),e[23]=r.error,e[24]=r.missing_packages,e[25]=c):c=e[25];const d=c;let u;e[26]!==r.stats?(u=r.stats&&h.jsx("div",{className:"gap-x-16 gap-y-1 grid grid-cols-2-fit border rounded p-2 empty:hidden",children:Object.entries(r.stats).map(vR)}),e[26]=r.stats,e[27]=u):u=e[27];const f=u,m=kR;let _;e[28]!==r.chart_spec||e[29]!==a?(_=r.chart_spec&&h.jsx(yR,{spec:m(JSON.parse(r.chart_spec)),width:"container",height:100,actions:!1,theme:a==="dark"?"dark":"vox"}),e[28]=r.chart_spec,e[29]=a,e[30]=_):_=e[30];const g=_;let p;e[31]!==s||e[32]!==r.chart_code||e[33]!==n.source_type?(p=r.chart_code&&n.source_type==="local"&&h.jsx(Oe,{content:"Add chart to notebook",delayDuration:400,children:h.jsx(Ae,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-1",onClick:fn.stopPropagation(()=>s(r.chart_code||"")),children:h.jsx(oi,{className:"h-3 w-3"})})}),e[31]=s,e[32]=r.chart_code,e[33]=n.source_type,e[34]=p):p=e[34];const b=p;let x;e[35]!==o||e[36]!==s||e[37]!==i||e[38]!==n?(x=n.source_type==="duckdb"&&h.jsx(Oe,{content:"Add SQL cell",delayDuration:400,children:h.jsx(Ae,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-1",onClick:fn.stopPropagation(()=>{s(Vc(n,o.name,i))}),children:h.jsx(oi,{className:"h-3 w-3"})})}),e[35]=o,e[36]=s,e[37]=i,e[38]=n,e[39]=x):x=e[39];const y=x;let v;e[40]!==r.chart_max_rows_errors?(v=r.chart_max_rows_errors&&h.jsx("span",{className:"text-xs text-muted-foreground",children:"Too many rows to render the chart."}),e[40]=r.chart_max_rows_errors,e[41]=v):v=e[41];const S=v;if(!(d||f||g||S)){let j;return e[42]===Symbol.for("react.memo_cache_sentinel")?(j=h.jsx("span",{className:"text-xs text-muted-foreground",children:"No data"}),e[42]=j):j=e[42],j}let k;return e[43]!==b||e[44]!==y||e[45]!==g||e[46]!==S||e[47]!==d||e[48]!==f?(k=h.jsxs("div",{className:"flex flex-col gap-2 relative",children:[d,b,y,S,g,f]}),e[43]=b,e[44]=y,e[45]=g,e[46]=S,e[47]=d,e[48]=f,e[49]=k):k=e[49],k};function wR(t){const{tooltipContent:e,content:n}=t;return h.jsx(Oe,{content:e,delayDuration:100,children:h.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}function vR(t){const[e,n]=t;return n==null?null:h.jsxs("div",{className:"flex items-center gap-1 group",children:[h.jsx(ep,{className:"h-3 w-3 invisible group-hover:visible",value:String(n)}),h.jsx("span",{className:"text-xs min-w-[60px] uppercase",children:e}),h.jsx("span",{className:"text-xs font-bold text-muted-foreground tracking-wide",children:zV(n)})]},e)}function kR(t){return{...t,config:{...t.config,background:"transparent"}}}const SR=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(hR,{}),t[0]=e):e=t[0],e},CR=t=>{const e=X.c(4),{isOpen:n,children:o}=t,[r,s]=K.useState(!1);let i,a;return e[0]!==r||e[1]!==n?(i=()=>{n&&!r&&s(!0)},a=[n,r],e[0]=r,e[1]=n,e[2]=i,e[3]=a):(i=e[2],a=e[3]),K.useEffect(i,a),r?o:null},mf=VV("marimo:scratchpadHistory:v1",[]),NR=Ut(!1),jR=Ut(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(mf),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(mf,r)}),ER={hide_code:!1,disabled:!1},IR=()=>{const t=X.c(69),e=vc(),[n]=Ds(),{theme:o}=po(),r=A.useRef(null),s=zs(),{createNewCell:i,updateCellCode:a}=Lt(),l=e.cellRuntime[pr],c=l==null?void 0:l.output,d=l==null?void 0:l.status,u=l==null?void 0:l.consoleOutputs,f=e.cellData[pr],m=(f==null?void 0:f.code)??"",_=Gt(jR),[g,p]=hn(NR),b=$e(mf);let x;t[0]!==_||t[1]!==m?(x=()=>{nS({code:m}),_(m)},t[0]=_,t[1]=m,t[2]=x):x=t[2];const y=Qe(x);let v;t[3]!==m||t[4]!==i||t[5]!==s?(v=()=>{m.trim()&&i({code:m,before:!1,cellId:s??"__end__"})},t[3]=m,t[4]=i,t[5]=s,t[6]=v):v=t[6];const S=Qe(v);let k;t[7]!==a?(k=()=>{a({cellId:pr,code:"",formattingChange:!1}),nS({code:""});const ce=r.current;ce&&ce.dispatch({changes:{from:0,to:ce.state.doc.length,insert:""}})},t[7]=a,t[8]=k):k=t[8];const j=Qe(k);let E;t[9]!==p||t[10]!==a?(E=ce=>{p(!1),a({cellId:pr,code:ce,formattingChange:!1});const Ee=r.current;Ee&&Ee.dispatch({changes:{from:0,to:Ee.state.doc.length,insert:ce}})},t[9]=p,t[10]=a,t[11]=E):E=t[11];const I=Qe(E),[T,M]=A.useState();let R;t[12]!==m||t[13]!==u||t[14]!==y||t[15]!==T||t[16]!==c||t[17]!==o||t[18]!==n?(R=()=>h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[40%]",children:h.jsx(Uu,{theme:o,allowFocus:!1,showPlaceholder:!1,id:pr,code:m,config:ER,status:"idle",serializedEditorState:null,runCell:y,userConfig:n,editorViewRef:r,setEditorView:ce=>{r.current=ce},hidden:!1,temporarilyShowCode:En.NOOP,languageAdapter:T,setLanguageAdapter:M})}),h.jsx("div",{className:"flex-1 overflow-auto flex-shrink-0",children:h.jsx(Fc,{allowExpand:!1,output:c,className:"output-area",cellId:pr,stale:!1,loading:!1})}),h.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[35%]",children:h.jsx(rp,{consoleOutputs:u,className:"overflow-auto",stale:!1,cellName:$V,onSubmitDebugger:En.NOOP,cellId:pr,debuggerActive:!1})})]}),t[12]=m,t[13]=u,t[14]=y,t[15]=T,t[16]=c,t[17]=o,t[18]=n,t[19]=R):R=t[19];const B=R;let O;t[20]!==I||t[21]!==b||t[22]!==g||t[23]!==o?(O=()=>g?h.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:h.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:b.map((ce,Ee)=>h.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>I(ce),children:h.jsx(ba,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ce.trim(),editable:!1,readOnly:!0})},Ee))})}):null,t[20]=I,t[21]=b,t[22]=g,t[23]=o,t[24]=O):O=t[24];const z=O;let F,V,L,C,$,N,H,Y,Z,q,re;t[25]===Symbol.for("react.memo_cache_sentinel")?(F=Fs.create(pr),V=h.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[25]=F,t[26]=V):(F=t[25],V=t[26]),t[27]===Symbol.for("react.memo_cache_sentinel")?(L=mn("cell.run"),t[27]=L):L=t[27],t[28]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(ei,{color:"var(--grass-11)",size:16}),t[28]=C):C=t[28],t[29]!==y||t[30]!==g?($=h.jsx(Oe,{content:L,children:h.jsx(Ae,{"data-testid":"scratchpad-run-button",onClick:y,disabled:g,variant:"text",size:"xs",children:C})}),t[29]=y,t[30]=g,t[31]=$):$=t[31],t[32]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx(yp,{size:16}),t[32]=N):N=t[32],t[33]!==j||t[34]!==g?(H=h.jsx(Oe,{content:"Clear code and outputs",children:h.jsx(Ae,{disabled:g,size:"xs",variant:"text",onClick:j,children:N})}),t[33]=j,t[34]=g,t[35]=H):H=t[35],t[36]===Symbol.for("react.memo_cache_sentinel")?(Y=h.jsx(ni,{size:16}),t[36]=Y):Y=t[36],t[37]!==S||t[38]!==g?(Z=h.jsx(ii,{children:h.jsx(Oe,{content:"Insert code",children:h.jsx(Ae,{disabled:g,size:"xs",variant:"text",onClick:S,children:Y})})}),t[37]=S,t[38]=g,t[39]=Z):Z=t[39],t[40]!==d?(q=(d==="running"||d==="queued")&&h.jsx(eo,{className:"inline",size:"small"}),t[40]=d,t[41]=q):q=t[41],t[42]===Symbol.for("react.memo_cache_sentinel")?(re=h.jsx("div",{className:"flex-1"}),t[42]=re):re=t[42];const ne=g&&"bg-[var(--sky-3)] rounded-none";let oe,G;t[43]!==ne?(oe=Me(ne),t[43]=ne,t[44]=oe):oe=t[44],t[45]!==g||t[46]!==p?(G=()=>p(!g),t[45]=g,t[46]=p,t[47]=G):G=t[47];const Q=b.length===0;let le,fe,de,he,se,ye,je;return t[48]===Symbol.for("react.memo_cache_sentinel")?(le=h.jsx(Np,{size:16}),t[48]=le):le=t[48],t[49]!==oe||t[50]!==G||t[51]!==Q?(fe=h.jsx(Oe,{content:"Toggle history",children:h.jsx(Ae,{size:"xs",variant:"text",className:oe,onClick:G,disabled:Q,children:le})}),t[49]=oe,t[50]=G,t[51]=Q,t[52]=fe):fe=t[52],t[53]!==$||t[54]!==H||t[55]!==Z||t[56]!==q||t[57]!==fe?(de=h.jsxs("div",{className:"flex items-center flex-shrink-0",children:[$,H,Z,q,re,fe]}),t[53]=$,t[54]=H,t[55]=Z,t[56]=q,t[57]=fe,t[58]=de):de=t[58],t[59]!==B?(he=B(),t[59]=B,t[60]=he):he=t[60],t[61]!==z?(se=z(),t[61]=z,t[62]=se):se=t[62],t[63]!==he||t[64]!==se?(ye=h.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[he,se]}),t[63]=he,t[64]=se,t[65]=ye):ye=t[65],t[66]!==de||t[67]!==ye?(je=h.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:F,children:[V,de,ye]}),t[66]=de,t[67]=ye,t[68]=je):je=t[68],je},AR=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(IR,{}),t[0]=e):e=t[0],e},TR=()=>{const t=X.c(16),[e]=Ds(),n=e.package_management.manager;let o;t[0]!==n?(o=[n],t[0]=n,t[1]=o):o=t[1];const{data:r,loading:s,error:i,reload:a}=Xn(RR,o);if(s&&!r){let m;return t[2]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(eo,{size:"medium",centered:!0}),t[2]=m):m=t[2],m}if(i){let m;return t[3]!==i?(m=h.jsx(Zs,{error:i}),t[3]=i,t[4]=m):m=t[4],m}let l;t[5]!==(r==null?void 0:r.packages)?(l=(r==null?void 0:r.packages)||[],t[5]=r==null?void 0:r.packages,t[6]=l):l=t[6];const c=l;let d,u,f;return t[7]!==n||t[8]!==a?(d=h.jsx(MR,{packageManager:n,onSuccess:a}),t[7]=n,t[8]=a,t[9]=d):d=t[9],t[10]!==c||t[11]!==a?(u=h.jsx(OR,{packages:c,onSuccess:a}),t[10]=c,t[11]=a,t[12]=u):u=t[12],t[13]!==d||t[14]!==u?(f=h.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d,u]}),t[13]=d,t[14]=u,t[15]=f):f=t[15],f},MR=({onSuccess:t,packageManager:e})=>{const[n,o]=K.useState(""),[r,s]=K.useState(!1),{handleClick:i}=xa(),a=$e(ff),l=Gt(ff);K.useEffect(()=>{a&&(o(a),l(null))},[a,l]);const c=async()=>{try{s(!0);const d=await WV({package:n});d.success?(t(),lt({title:"Package added",description:h.jsxs("span",{children:["The package ",h.jsx(jc,{className:"inline",children:n})," and its dependencies has been added to your environment."]})})):lt({title:"Failed to add package",description:d.error,variant:"danger"})}finally{o(""),s(!1)}};return h.jsxs("div",{className:"flex items-center w-full border-b",children:[h.jsx(Y4,{placeholder:`Install packages with ${e}...`,id:t_,icon:r?h.jsx(eo,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):h.jsx(Oe,{content:"Change package manager",children:h.jsx(ya,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),rootClassName:"flex-1 border-none",value:n,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),c())},onChange:d=>o(d.target.value)}),h.jsx(Oe,{delayDuration:300,side:"left",align:"start",content:h.jsxs("div",{className:"text-sm flex flex-col w-full max-w-[360px]",children:["Packages are installed using the package manager specified in your user configuration. Depending on your package manager, you can install packages with various formats:",h.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"})," A package name; this will install the latest version.",h.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"})," ","A package with a specific version or version range.",h.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Git:"})," A Git repository",h.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"URL:"})," A remote wheel or source distribution.",h.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Path:"})," A local wheel, source distribution, or project directory.",h.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:h.jsx(Wm,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),h.jsx("button",{type:"button",className:Me("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",n&&"bg-accent text-accent-foreground","disabled:cursor-not-allowed disabled:opacity-50"),onClick:c,disabled:!n,children:"Add"})]})},OR=t=>{const e=X.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(An,{title:"No packages",description:"No packages are installed in this environment.",icon:h.jsx(ya,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(Xm,{children:h.jsxs(Xs,{children:[h.jsx(Dr,{children:"Name"}),h.jsx(Dr,{children:"Version"}),h.jsx(Dr,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>h.jsxs(Xs,{className:"group",onClick:async()=>{await xn(`${l.name}==${l.version}`),lt({title:"Copied to clipboard"})},children:[h.jsx(Rr,{children:l.name}),h.jsx(Rr,{children:l.version}),h.jsx(Rr,{children:h.jsx(DR,{packageName:l.name,onSuccess:n})})]},l.name),e[5]=n,e[6]=a):a=e[6],s=o.map(a),e[2]=n,e[3]=o,e[4]=s}else s=e[4];return e[7]!==s?(i=h.jsxs(Km,{className:"overflow-auto flex-1",children:[r,h.jsx(Zm,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},DR=({packageName:t,onSuccess:e})=>{const[n,o]=K.useState(!1);return n?h.jsx(eo,{size:"small",className:"float-right mr-2 h-4 w-4 shrink-0 opacity-50"}):h.jsx("button",{type:"button",className:Me("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible"),onClick:fn.stopPropagation(async()=>{try{o(!0);const r=await qV({package:t});r.success?(e(),lt({title:"Package removed",description:h.jsxs("span",{children:["The package ",h.jsx(jc,{className:"inline",children:t})," has been removed from your environment."]})})):lt({title:"Failed to add package",description:r.error,variant:"danger"})}finally{o(!1)}}),children:"Remove"})};function RR(){return HV()}var pf="ScrollArea",[H2,Z$]=y4(pf),[PR,Fn]=H2(pf),W2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:o="hover",dir:r,scrollHideDelay:s=600,...i}=t,[a,l]=A.useState(null),[c,d]=A.useState(null),[u,f]=A.useState(null),[m,_]=A.useState(null),[g,p]=A.useState(null),[b,x]=A.useState(0),[y,v]=A.useState(0),[S,k]=A.useState(!1),[j,E]=A.useState(!1),I=Qs(e,M=>l(M)),T=GV(r);return h.jsx(PR,{scope:n,type:o,dir:T,scrollHideDelay:s,scrollArea:a,viewport:c,onViewportChange:d,content:u,onContentChange:f,scrollbarX:m,onScrollbarXChange:_,scrollbarXEnabled:S,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:p,scrollbarYEnabled:j,onScrollbarYEnabledChange:E,onCornerWidthChange:x,onCornerHeightChange:v,children:h.jsx(qs.div,{dir:T,...i,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":y+"px",...t.style}})})});W2.displayName=pf;var q2="ScrollAreaViewport",G2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:o,nonce:r,...s}=t,i=Fn(q2,n),a=A.useRef(null),l=Qs(e,a,i.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(qs.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t.style},children:h.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});G2.displayName=q2;var lo="ScrollAreaScrollbar",gf=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(lo,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=r,a=t.orientation==="horizontal";return A.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),r.type==="hover"?h.jsx(LR,{...o,ref:e,forceMount:n}):r.type==="scroll"?h.jsx(FR,{...o,ref:e,forceMount:n}):r.type==="auto"?h.jsx(Y2,{...o,ref:e,forceMount:n}):r.type==="always"?h.jsx(_f,{...o,ref:e}):null});gf.displayName=lo;var LR=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(lo,t.__scopeScrollArea),[s,i]=A.useState(!1);return A.useEffect(()=>{const a=r.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),i(!0)},d=()=>{l=window.setTimeout(()=>i(!1),r.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[r.scrollArea,r.scrollHideDelay]),h.jsx($c,{present:n||s,children:h.jsx(Y2,{"data-state":s?"visible":"hidden",...o,ref:e})})}),FR=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(lo,t.__scopeScrollArea),s=t.orientation==="horizontal",i=Hl(()=>l("SCROLL_END"),100),[a,l]=function(c,d){return A.useReducer((u,f)=>d[u][f]??u,c)}("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return A.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,r.scrollHideDelay,l]),A.useEffect(()=>{const c=r.viewport,d=s?"scrollLeft":"scrollTop";if(c){let u=c[d];const f=()=>{const m=c[d];u!==m&&(l("SCROLL"),i()),u=m};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[r.viewport,s,l,i]),h.jsx($c,{present:n||a!=="hidden",children:h.jsx(_f,{"data-state":a==="hidden"?"hidden":"visible",...o,ref:e,onPointerEnter:Hn(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Hn(t.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Y2=A.forwardRef((t,e)=>{const n=Fn(lo,t.__scopeScrollArea),{forceMount:o,...r}=t,[s,i]=A.useState(!1),a=t.orientation==="horizontal",l=Hl(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?c:d)}},10);return gs(n.viewport,l),gs(n.content,l),h.jsx($c,{present:o||s,children:h.jsx(_f,{"data-state":s?"visible":"hidden",...r,ref:e})})}),_f=A.forwardRef((t,e)=>{const{orientation:n="vertical",...o}=t,r=Fn(lo,t.__scopeScrollArea),s=A.useRef(null),i=A.useRef(0),[a,l]=A.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Q2(a.viewport,a.content),d={...o,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>s.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function u(f,m){return function(_,g,p,b="ltr"){const x=$l(p),y=x/2,v=g||y,S=x-v,k=p.scrollbar.paddingStart+v,j=p.scrollbar.size-p.scrollbar.paddingEnd-S,E=p.content-p.viewport,I=b==="ltr"?[0,E]:[-1*E,0];return tk([k,j],I)(_)}(f,i.current,a,m)}return n==="horizontal"?h.jsx(zR,{...d,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const f=ek(r.viewport.scrollLeft,a,r.dir);s.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:f=>{r.viewport&&(r.viewport.scrollLeft=f)},onDragScroll:f=>{r.viewport&&(r.viewport.scrollLeft=u(f,r.dir))}}):n==="vertical"?h.jsx(BR,{...d,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const f=ek(r.viewport.scrollTop,a);s.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:f=>{r.viewport&&(r.viewport.scrollTop=f)},onDragScroll:f=>{r.viewport&&(r.viewport.scrollTop=u(f))}}):null}),zR=A.forwardRef((t,e)=>{const{sizes:n,onSizesChange:o,...r}=t,s=Fn(lo,t.__scopeScrollArea),[i,a]=A.useState(),l=A.useRef(null),c=Qs(e,l,s.onScrollbarXChange);return A.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(K2,{"data-orientation":"horizontal",...r,ref:c,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":$l(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,u)=>{if(s.viewport){const f=s.viewport.scrollLeft+d.deltaX;t.onWheelScroll(f),nk(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Vl(i.paddingLeft),paddingEnd:Vl(i.paddingRight)}})}})}),BR=A.forwardRef((t,e)=>{const{sizes:n,onSizesChange:o,...r}=t,s=Fn(lo,t.__scopeScrollArea),[i,a]=A.useState(),l=A.useRef(null),c=Qs(e,l,s.onScrollbarYChange);return A.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(K2,{"data-orientation":"vertical",...r,ref:c,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":$l(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,u)=>{if(s.viewport){const f=s.viewport.scrollTop+d.deltaY;t.onWheelScroll(f),nk(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Vl(i.paddingTop),paddingEnd:Vl(i.paddingBottom)}})}})}),[UR,J2]=H2(lo),K2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:r,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:u,...f}=t,m=Fn(lo,n),[_,g]=A.useState(null),p=Qs(e,I=>g(I)),b=A.useRef(null),x=A.useRef(""),y=m.viewport,v=o.content-o.viewport,S=hr(d),k=hr(l),j=Hl(u,10);function E(I){if(b.current){const T=I.clientX-b.current.left,M=I.clientY-b.current.top;c({x:T,y:M})}}return A.useEffect(()=>{const I=T=>{const M=T.target;(_==null?void 0:_.contains(M))&&S(T,v)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[y,_,v,S]),A.useEffect(k,[o,k]),gs(_,j),gs(m.content,j),h.jsx(UR,{scope:n,scrollbar:_,hasThumb:r,onThumbChange:hr(s),onThumbPointerUp:hr(i),onThumbPositionChange:k,onThumbPointerDown:hr(a),children:h.jsx(qs.div,{...f,ref:p,style:{position:"absolute",...f.style},onPointerDown:Hn(t.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),b.current=_.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),E(I))}),onPointerMove:Hn(t.onPointerMove,E),onPointerUp:Hn(t.onPointerUp,I=>{const T=I.target;T.hasPointerCapture(I.pointerId)&&T.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=x.current,m.viewport&&(m.viewport.style.scrollBehavior=""),b.current=null})})})}),Ul="ScrollAreaThumb",X2=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=J2(Ul,t.__scopeScrollArea);return h.jsx($c,{present:n||r.hasThumb,children:h.jsx(VR,{ref:e,...o})})}),VR=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:o,...r}=t,s=Fn(Ul,n),i=J2(Ul,n),{onThumbPositionChange:a}=i,l=Qs(e,u=>i.onThumbChange(u)),c=A.useRef(void 0),d=Hl(()=>{c.current&&(c.current(),c.current=void 0)},100);return A.useEffect(()=>{const u=s.viewport;if(u){const f=()=>{if(d(),!c.current){const m=HR(u,a);c.current=m,a()}};return a(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[s.viewport,d,a]),h.jsx(qs.div,{"data-state":i.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:Hn(t.onPointerDownCapture,u=>{const f=u.target.getBoundingClientRect(),m=u.clientX-f.left,_=u.clientY-f.top;i.onThumbPointerDown({x:m,y:_})}),onPointerUp:Hn(t.onPointerUp,i.onThumbPointerUp)})});X2.displayName=Ul;var bf="ScrollAreaCorner",Z2=A.forwardRef((t,e)=>{const n=Fn(bf,t.__scopeScrollArea),o=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&o?h.jsx($R,{...t,ref:e}):null});Z2.displayName=bf;var $R=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,...o}=t,r=Fn(bf,n),[s,i]=A.useState(0),[a,l]=A.useState(0),c=!!(s&&a);return gs(r.scrollbarX,()=>{var u;const d=((u=r.scrollbarX)==null?void 0:u.offsetHeight)||0;r.onCornerHeightChange(d),l(d)}),gs(r.scrollbarY,()=>{var u;const d=((u=r.scrollbarY)==null?void 0:u.offsetWidth)||0;r.onCornerWidthChange(d),i(d)}),c?h.jsx(qs.div,{...o,ref:e,style:{width:s,height:a,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Vl(t){return t?parseInt(t,10):0}function Q2(t,e){const n=t/e;return isNaN(n)?0:n}function $l(t){const e=Q2(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=(t.scrollbar.size-n)*e;return Math.max(o,18)}function ek(t,e,n="ltr"){const o=$l(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,i=e.content-e.viewport,a=s-o,l=JV(t,n==="ltr"?[0,i]:[-1*i,0]);return tk([0,i],[0,a])(l)}function tk(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const o=(e[1]-e[0])/(t[1]-t[0]);return e[0]+o*(n-t[0])}}function nk(t,e){return t>0&&t<e}var HR=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},o=0;return function r(){const s={left:t.scrollLeft,top:t.scrollTop},i=n.left!==s.left,a=n.top!==s.top;(i||a)&&e(),n=s,o=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(o)};function Hl(t,e){const n=hr(t),o=A.useRef(0);return A.useEffect(()=>()=>window.clearTimeout(o.current),[]),A.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(n,e)},[n,e])}function gs(t,e){const n=hr(e);YV(()=>{let o=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(t),()=>{window.cancelAnimationFrame(o),r.unobserve(t)}}},[t,n])}var ok=W2,WR=G2,qR=Z2;const rk=A.forwardRef((t,e)=>{const n=X.c(15);let o,r,s,i,a,l,c,d;return n[0]!==t?({className:r,children:o,...s}=t,n[0]=t,n[1]=o,n[2]=r,n[3]=s):(o=n[1],r=n[2],s=n[3]),n[4]!==r?(i=Me("relative overflow-hidden",r),n[4]=r,n[5]=i):i=n[5],n[6]!==o?(a=h.jsx(WR,{className:"h-full w-full rounded-[inherit]",children:o}),n[6]=o,n[7]=a):a=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(sk,{}),c=h.jsx(qR,{}),n[8]=l,n[9]=c):(l=n[8],c=n[9]),n[10]!==s||n[11]!==e||n[12]!==i||n[13]!==a?(d=h.jsxs(ok,{ref:e,className:i,...s,children:[a,l,c]}),n[10]=s,n[11]=e,n[12]=i,n[13]=a,n[14]=d):d=n[14],d});rk.displayName=ok.displayName;const sk=A.forwardRef((t,e)=>{const n=X.c(14);let o,r,s;n[0]!==t?({className:o,orientation:s,...r}=t,n[0]=t,n[1]=o,n[2]=r,n[3]=s):(o=n[1],r=n[2],s=n[3]);const i=s===void 0?"vertical":s,a=i==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",l=i==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]";let c,d,u;return n[4]!==o||n[5]!==a||n[6]!==l?(c=Me("flex touch-none select-none transition-colors",a,l,o),n[4]=o,n[5]=a,n[6]=l,n[7]=c):c=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(X2,{className:"relative flex-1 rounded-full bg-border"}),n[8]=d):d=n[8],n[9]!==i||n[10]!==r||n[11]!==e||n[12]!==c?(u=h.jsx(gf,{ref:e,orientation:i,className:c,...r,children:d}),n[9]=i,n[10]=r,n[11]=e,n[12]=c,n[13]=u):u=n[13],u});sk.displayName=gf.displayName;const GR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,YR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JR={};function ik(t,e){return(JR.jsx?YR:GR).test(t)}const KR=/[ \t\n\f\r]/g;function ak(t){return t.replace(KR,"")===""}class qi{constructor(e,n,o){this.property=e,this.normal=n,o&&(this.space=o)}}function lk(t,e){const n={},o={};let r=-1;for(;++r<t.length;)Object.assign(n,t[r].property),Object.assign(o,t[r].normal);return new qi(n,o,e)}function yf(t){return t.toLowerCase()}qi.prototype.property={},qi.prototype.normal={},qi.prototype.space=null;class zn{constructor(e,n){this.property=e,this.attribute=n}}zn.prototype.space=null,zn.prototype.boolean=!1,zn.prototype.booleanish=!1,zn.prototype.overloadedBoolean=!1,zn.prototype.number=!1,zn.prototype.commaSeparated=!1,zn.prototype.spaceSeparated=!1,zn.prototype.commaOrSpaceSeparated=!1,zn.prototype.mustUseProperty=!1,zn.prototype.defined=!1;let XR=0;const tt=jr(),Rt=jr(),ck=jr(),xe=jr(),_t=jr(),_s=jr(),kn=jr();function jr(){return 2**++XR}const xf=Object.freeze(Object.defineProperty({__proto__:null,boolean:tt,booleanish:Rt,commaOrSpaceSeparated:kn,commaSeparated:_s,number:xe,overloadedBoolean:ck,spaceSeparated:_t},Symbol.toStringTag,{value:"Module"})),wf=Object.keys(xf);class vf extends zn{constructor(e,n,o,r){let s=-1;if(super(e,n),dk(this,"space",r),typeof o=="number")for(;++s<wf.length;){const i=wf[s];dk(this,wf[s],(o&xf[i])===xf[i])}}}function dk(t,e,n){n&&(t[e]=n)}vf.prototype.defined=!0;const ZR={}.hasOwnProperty;function bs(t){const e={},n={};let o;for(o in t.properties)if(ZR.call(t.properties,o)){const r=t.properties[o],s=new vf(o,t.transform(t.attributes||{},o),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(o)&&(s.mustUseProperty=!0),e[o]=s,n[yf(o)]=o,n[yf(s.attribute)]=o}return new qi(e,n,t.space)}const uk=bs({space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),hk=bs({space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function fk(t,e){return e in t?t[e]:e}function mk(t,e){return fk(t,e.toLowerCase())}const pk=bs({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:mk,properties:{xmlns:null,xmlnsXLink:null}}),gk=bs({transform:(t,e)=>e==="role"?e:"aria-"+e.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Rt,ariaAutoComplete:null,ariaBusy:Rt,ariaChecked:Rt,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:_t,ariaCurrent:null,ariaDescribedBy:_t,ariaDetails:null,ariaDisabled:Rt,ariaDropEffect:_t,ariaErrorMessage:null,ariaExpanded:Rt,ariaFlowTo:_t,ariaGrabbed:Rt,ariaHasPopup:null,ariaHidden:Rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_t,ariaLevel:xe,ariaLive:null,ariaModal:Rt,ariaMultiLine:Rt,ariaMultiSelectable:Rt,ariaOrientation:null,ariaOwns:_t,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:Rt,ariaReadOnly:Rt,ariaRelevant:null,ariaRequired:Rt,ariaRoleDescription:_t,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:Rt,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null}}),QR=bs({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:mk,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_s,acceptCharset:_t,accessKey:_t,action:null,allow:null,allowFullScreen:tt,allowPaymentRequest:tt,allowUserMedia:tt,alt:null,as:null,async:tt,autoCapitalize:null,autoComplete:_t,autoFocus:tt,autoPlay:tt,blocking:_t,capture:null,charSet:null,checked:tt,cite:null,className:_t,cols:xe,colSpan:null,content:null,contentEditable:Rt,controls:tt,controlsList:_t,coords:xe|_s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tt,defer:tt,dir:null,dirName:null,disabled:tt,download:ck,draggable:Rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tt,formTarget:null,headers:_t,height:xe,hidden:tt,high:xe,href:null,hrefLang:null,htmlFor:_t,httpEquiv:_t,id:null,imageSizes:null,imageSrcSet:null,inert:tt,inputMode:null,integrity:null,is:null,isMap:tt,itemId:null,itemProp:_t,itemRef:_t,itemScope:tt,itemType:_t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tt,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:tt,muted:tt,name:null,nonce:null,noModule:tt,noValidate:tt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:tt,optimum:xe,pattern:null,ping:_t,placeholder:null,playsInline:tt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tt,referrerPolicy:null,rel:_t,required:tt,reversed:tt,rows:xe,rowSpan:xe,sandbox:_t,scope:null,scoped:tt,seamless:tt,selected:tt,shadowRootClonable:tt,shadowRootDelegatesFocus:tt,shadowRootMode:null,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:Rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:tt,useMap:null,value:Rt,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_t,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tt,declare:tt,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:tt,noHref:tt,noShade:tt,noWrap:tt,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:Rt,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:tt,disableRemotePlayback:tt,prefix:null,property:null,results:xe,security:null,unselectable:null}}),eP=bs({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:fk,properties:{about:kn,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:_t,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:tt,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_s,g2:_s,glyphName:_s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kn,rev:kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kn,requiredFeatures:kn,requiredFonts:kn,requiredFormats:kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kn,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),tP=/^data[-\w.:]+$/i,_k=/-[a-z]/g,nP=/[A-Z]/g;function oP(t){return"-"+t.toLowerCase()}function rP(t){return t.charAt(1).toUpperCase()}const sP={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},iP=lk([hk,uk,pk,gk,QR],"html"),kf=lk([hk,uk,pk,gk,eP],"svg"),bk=oS(KV()),aP=bk.default||bk,yk=xk("end"),Sf=xk("start");function xk(t){return function(e){const n=e&&e.position&&e.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Gi(t){return t&&typeof t=="object"?"position"in t||"type"in t?wk(t.position):"start"in t||"end"in t?wk(t):"line"in t||"column"in t?Cf(t):"":""}function Cf(t){return vk(t&&t.line)+":"+vk(t&&t.column)}function wk(t){return Cf(t&&t.start)+"-"+Cf(t&&t.end)}function vk(t){return t&&typeof t=="number"?t:1}class on extends Error{constructor(e,n,o){super(),typeof n=="string"&&(o=n,n=void 0);let r="",s={},i=!1;if(n&&(s="line"in n&&"column"in n||"start"in n&&"end"in n?{place:n}:"type"in n?{ancestors:[n],place:n.position}:{...n}),typeof e=="string"?r=e:!s.cause&&e&&(i=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof o=="string"){const l=o.indexOf(":");l===-1?s.ruleId=o:(s.source=o.slice(0,l),s.ruleId=o.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=a?a.line:void 0,this.name=Gi(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=i&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}on.prototype.file="",on.prototype.name="",on.prototype.reason="",on.prototype.message="",on.prototype.stack="",on.prototype.column=void 0,on.prototype.line=void 0,on.prototype.ancestors=void 0,on.prototype.cause=void 0,on.prototype.fatal=void 0,on.prototype.place=void 0,on.prototype.ruleId=void 0,on.prototype.source=void 0;const Nf={}.hasOwnProperty,lP=new Map,cP=/[A-Z]/g,dP=/-([a-z])/g,uP=new Set(["table","tbody","thead","tfoot","tr"]),hP=new Set(["td","th"]),kk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function fP(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let o;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=function(i,a){return l;function l(c,d,u,f){const m=Array.isArray(u.children),_=Sf(c);return a(d,u,f,m,{columnNumber:_?_.column-1:void 0,fileName:i,lineNumber:_?_.line:void 0},void 0)}}(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=function(i,a,l){return c;function c(d,u,f,m){const _=Array.isArray(f.children)?l:a;return m?_(u,f,m):_(u,f)}}(0,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:o,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?kf:iP,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=Sk(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function Sk(t,e,n){return e.type==="element"?function(o,r,s){const i=o.schema;let a=i;r.tagName.toLowerCase()==="svg"&&i.space==="html"&&(a=kf,o.schema=a),o.ancestors.push(r);const l=Nk(o,r.tagName,!1),c=function(u,f){const m={};let _,g;for(g in f.properties)if(g!=="children"&&Nf.call(f.properties,g)){const p=mP(u,g,f.properties[g]);if(p){const[b,x]=p;u.tableCellAlignToStyle&&b==="align"&&typeof x=="string"&&hP.has(f.tagName)?_=x:m[b]=x}}return _&&((m.style||(m.style={}))[u.stylePropertyNameCase==="css"?"text-align":"textAlign"]=_),m}(o,r);let d=Ef(o,r);return uP.has(r.tagName)&&(d=d.filter(function(u){return typeof u!="string"||!(typeof(f=u)=="object"?f.type==="text"&&ak(f.value):ak(f));var f})),Ck(o,c,l,r),jf(c,d),o.ancestors.pop(),o.schema=i,o.create(r,l,c,s)}(t,e,n):e.type==="mdxFlowExpression"||e.type==="mdxTextExpression"?function(o,r){if(r.data&&r.data.estree&&o.evaluater){const s=r.data.estree.body[0];return s.type,o.evaluater.evaluateExpression(s.expression)}Yi(o,r.position)}(t,e):e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement"?function(o,r,s){const i=o.schema;let a=i;r.name==="svg"&&i.space==="html"&&(a=kf,o.schema=a),o.ancestors.push(r);const l=r.name===null?o.Fragment:Nk(o,r.name,!0),c=function(u,f){const m={};for(const _ of f.attributes)if(_.type==="mdxJsxExpressionAttribute")if(_.data&&_.data.estree&&u.evaluater){const g=_.data.estree.body[0];g.type;const p=g.expression;p.type;const b=p.properties[0];b.type,Object.assign(m,u.evaluater.evaluateExpression(b.argument))}else Yi(u,f.position);else{const g=_.name;let p;if(_.value&&typeof _.value=="object")if(_.value.data&&_.value.data.estree&&u.evaluater){const b=_.value.data.estree.body[0];b.type,p=u.evaluater.evaluateExpression(b.expression)}else Yi(u,f.position);else p=_.value===null||_.value;m[g]=p}return m}(o,r),d=Ef(o,r);return Ck(o,c,l,r),jf(c,d),o.ancestors.pop(),o.schema=i,o.create(r,l,c,s)}(t,e,n):e.type==="mdxjsEsm"?function(o,r){if(r.data&&r.data.estree&&o.evaluater)return o.evaluater.evaluateProgram(r.data.estree);Yi(o,r.position)}(t,e):e.type==="root"?function(o,r,s){const i={};return jf(i,Ef(o,r)),o.create(r,o.Fragment,i,s)}(t,e,n):e.type==="text"?function(o,r){return r.value}(0,e):void 0}function Ck(t,e,n,o){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=o)}function jf(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function Ef(t,e){const n=[];let o=-1;const r=t.passKeys?new Map:lP;for(;++o<e.children.length;){const s=e.children[o];let i;if(t.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=r.get(l)||0;i=l+"-"+c,r.set(l,c+1)}}const a=Sk(t,s,i);a!==void 0&&n.push(a)}return n}function mP(t,e,n){const o=function(r,s){const i=yf(s);let a=s,l=zn;if(i in r.normal)return r.property[r.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&tP.test(s)){if(s.charAt(4)==="-"){const c=s.slice(5).replace(_k,rP);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=s.slice(4);if(!_k.test(c)){let d=c.replace(nP,oP);d.charAt(0)!=="-"&&(d="-"+d),s="data"+d}}l=vf}return new l(a,s)}(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=o.commaSeparated?function(r){const s={};return(r[r.length-1]===""?[...r,""]:r).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}(n):n.join(" ").trim()),o.property==="style"){let r=typeof n=="object"?n:function(s,i){const a={};try{aP(i,l)}catch(c){if(!s.ignoreInvalidStyle){const d=c,u=new on("Cannot parse `style` attribute",{ancestors:s.ancestors,cause:d,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=s.filePath||void 0,u.url=kk+"#cannot-parse-style-attribute",u}}return a;function l(c,d){let u=c;u.slice(0,2)!=="--"&&(u.slice(0,4)==="-ms-"&&(u="ms-"+u.slice(4)),u=u.replace(dP,gP)),a[u]=d}}(t,String(n));return t.stylePropertyNameCase==="css"&&(r=function(s){const i={};let a;for(a in s)Nf.call(s,a)&&(i[pP(a)]=s[a]);return i}(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&o.space?sP[o.property]||o.property:o.attribute,n]}}function Nk(t,e,n){let o;if(n)if(e.includes(".")){const r=e.split(".");let s,i=-1;for(;++i<r.length;){const a=ik(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}o=s}else o=ik(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};else o={type:"Literal",value:e};if(o.type==="Literal"){const r=o.value;return Nf.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(o);Yi(t)}function Yi(t,e){const n=new on("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=kk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pP(t){let e=t.replace(cP,_P);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function gP(t,e){return e.toUpperCase()}function _P(t){return"-"+t.toLowerCase()}const If={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Wl={};function jk(t,e,n){if(function(o){return!!(o&&typeof o=="object")}(t)){if("value"in t)return t.type!=="html"||n?t.value:"";if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Ek(t.children,e,n)}return Array.isArray(t)?Ek(t,e,n):""}function Ek(t,e,n){const o=[];let r=-1;for(;++r<t.length;)o[r]=jk(t[r],e,n);return o.join("")}const Ik=document.createElement("i");function Af(t){const e="&"+t+";";Ik.innerHTML=e;const n=Ik.textContent;return(n.charCodeAt(n.length-1)!==59||t==="semi")&&n!==e&&n}function co(t,e,n,o){const r=t.length;let s,i=0;if(e=e<0?-e>r?0:r+e:e>r?r:e,n=n>0?n:0,o.length<1e4)s=Array.from(o),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);i<o.length;)s=o.slice(i,i+1e4),s.unshift(e,0),t.splice(...s),i+=1e4,e+=1e4}function Bn(t,e){return t.length>0?(co(t,t.length,0,e),t):e}const Ak={}.hasOwnProperty;function bP(t,e){let n;for(n in e){const o=(Ak.call(t,n)?t[n]:void 0)||(t[n]={}),r=e[n];let s;if(r)for(s in r){Ak.call(o,s)||(o[s]=[]);const i=r[s];yP(o[s],Array.isArray(i)?i:i?[i]:[])}}}function yP(t,e){let n=-1;const o=[];for(;++n<e.length;)(e[n].add==="after"?t:o).push(e[n]);co(t,0,0,o)}function Tk(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||(65535&n)==65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function ys(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const uo=sr(/[A-Za-z]/),Sn=sr(/[\dA-Za-z]/),xP=sr(/[#-'*+\--9=?A-Z^-~]/);function Tf(t){return t!==null&&(t<32||t===127)}const Mf=sr(/\d/),wP=sr(/[\dA-Fa-f]/),vP=sr(/[!-/:-@[-`{-~]/);function Ke(t){return t!==null&&t<-2}function bn(t){return t!==null&&(t<0||t===32)}function ht(t){return t===-2||t===-1||t===32}const kP=sr(new RegExp("\\p{P}|\\p{S}","u")),SP=sr(/\s/);function sr(t){return function(e){return e!==null&&e>-1&&t.test(String.fromCharCode(e))}}function xs(t){const e=[];let n=-1,o=0,r=0;for(;++n<t.length;){const s=t.charCodeAt(n);let i="";if(s===37&&Sn(t.charCodeAt(n+1))&&Sn(t.charCodeAt(n+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(i=String.fromCharCode(s));else if(s>55295&&s<57344){const a=t.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(i=String.fromCharCode(s,a),r=1):i="\uFFFD"}else i=String.fromCharCode(s);i&&(e.push(t.slice(o,n),encodeURIComponent(i)),o=n+r+1,i=""),r&&(n+=r,r=0)}return e.join("")+t.slice(o)}function bt(t,e,n,o){const r=o?o-1:Number.POSITIVE_INFINITY;let s=0;return function(a){return ht(a)?(t.enter(n),i(a)):e(a)};function i(a){return ht(a)&&s++<r?(t.consume(a),i):(t.exit(n),e(a))}}const CP={tokenize:function(t){const e=t.attempt(this.parser.constructs.contentInitial,function(s){return s===null?void t.consume(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),bt(t,e,"linePrefix"))},function(s){return t.enter("paragraph"),o(s)});let n;return e;function o(s){const i=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=i),n=i,r(s)}function r(s){return s===null?(t.exit("chunkText"),t.exit("paragraph"),void t.consume(s)):Ke(s)?(t.consume(s),t.exit("chunkText"),o):(t.consume(s),r)}}},NP={tokenize:function(t){const e=this,n=[];let o,r,s,i=0;return a;function a(y){if(i<n.length){const v=n[i];return e.containerState=v[1],t.attempt(v[0].continuation,l,c)(y)}return c(y)}function l(y){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,o&&x();const v=e.events.length;let S,k=v;for(;k--;)if(e.events[k][0]==="exit"&&e.events[k][1].type==="chunkFlow"){S=e.events[k][1].end;break}b(i);let j=v;for(;j<e.events.length;)e.events[j][1].end={...S},j++;return co(e.events,k+1,0,e.events.slice(v)),e.events.length=j,c(y)}return a(y)}function c(y){if(i===n.length){if(!o)return f(y);if(o.currentConstruct&&o.currentConstruct.concrete)return _(y);e.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Mk,d,u)(y)}function d(y){return o&&x(),b(i),f(y)}function u(y){return e.parser.lazy[e.now().line]=i!==n.length,s=e.now().offset,_(y)}function f(y){return e.containerState={},t.attempt(Mk,m,_)(y)}function m(y){return i++,n.push([e.currentConstruct,e.containerState]),f(y)}function _(y){return y===null?(o&&x(),b(0),void t.consume(y)):(o=o||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:r}),g(y))}function g(y){return y===null?(p(t.exit("chunkFlow"),!0),b(0),void t.consume(y)):Ke(y)?(t.consume(y),p(t.exit("chunkFlow")),i=0,e.interrupt=void 0,a):(t.consume(y),g)}function p(y,v){const S=e.sliceStream(y);if(v&&S.push(null),y.previous=r,r&&(r.next=y),r=y,o.defineSkip(y.start),o.write(S),e.parser.lazy[y.start.line]){let k=o.events.length;for(;k--;)if(o.events[k][1].start.offset<s&&(!o.events[k][1].end||o.events[k][1].end.offset>s))return;const j=e.events.length;let E,I,T=j;for(;T--;)if(e.events[T][0]==="exit"&&e.events[T][1].type==="chunkFlow"){if(E){I=e.events[T][1].end;break}E=!0}for(b(i),k=j;k<e.events.length;)e.events[k][1].end={...I},k++;co(e.events,T+1,0,e.events.slice(j)),e.events.length=k}}function b(y){let v=n.length;for(;v-- >y;){const S=n[v];e.containerState=S[1],S[0].exit.call(e,t)}n.length=y}function x(){o.write([null]),r=void 0,o=void 0,e.containerState._closeFlow=void 0}}},Mk={tokenize:function(t,e,n){return bt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function Ok(t){return t===null||bn(t)||SP(t)?1:kP(t)?2:void 0}function Of(t,e,n){const o=[];let r=-1;for(;++r<t.length;){const s=t[r].resolveAll;s&&!o.includes(s)&&(e=s(e,n),o.push(s))}return e}const Df={name:"attention",resolveAll:function(t,e){let n,o,r,s,i,a,l,c,d=-1;for(;++d<t.length;)if(t[d][0]==="enter"&&t[d][1].type==="attentionSequence"&&t[d][1]._close){for(n=d;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[d][1]).charCodeAt(0)){if((t[n][1]._close||t[d][1]._open)&&(t[d][1].end.offset-t[d][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[d][1].end.offset-t[d][1].start.offset)%3))continue;a=t[n][1].end.offset-t[n][1].start.offset>1&&t[d][1].end.offset-t[d][1].start.offset>1?2:1;const u={...t[n][1].end},f={...t[d][1].start};Dk(u,-a),Dk(f,a),s={type:a>1?"strongSequence":"emphasisSequence",start:u,end:{...t[n][1].end}},i={type:a>1?"strongSequence":"emphasisSequence",start:{...t[d][1].start},end:f},r={type:a>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[d][1].start}},o={type:a>1?"strong":"emphasis",start:{...s.start},end:{...i.end}},t[n][1].end={...s.start},t[d][1].start={...i.end},l=[],t[n][1].end.offset-t[n][1].start.offset&&(l=Bn(l,[["enter",t[n][1],e],["exit",t[n][1],e]])),l=Bn(l,[["enter",o,e],["enter",s,e],["exit",s,e],["enter",r,e]]),l=Bn(l,Of(e.parser.constructs.insideSpan.null,t.slice(n+1,d),e)),l=Bn(l,[["exit",r,e],["enter",i,e],["exit",i,e],["exit",o,e]]),t[d][1].end.offset-t[d][1].start.offset?(c=2,l=Bn(l,[["enter",t[d][1],e],["exit",t[d][1],e]])):c=0,co(t,n-1,d-n+3,l),d=n+l.length-c-2;break}}for(d=-1;++d<t.length;)t[d][1].type==="attentionSequence"&&(t[d][1].type="data");return t},tokenize:function(t,e){const n=this.parser.constructs.attentionMarkers.null,o=this.previous,r=Ok(o);let s;return function(a){return s=a,t.enter("attentionSequence"),i(a)};function i(a){if(a===s)return t.consume(a),i;const l=t.exit("attentionSequence"),c=Ok(a),d=!c||c===2&&r||n.includes(a),u=!r||r===2&&c||n.includes(o);return l._open=!!(s===42?d:d&&(r||!u)),l._close=!!(s===42?u:u&&(c||!d)),e(a)}}};function Dk(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const jP={name:"autolink",tokenize:function(t,e,n){let o=0;return function(f){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),r};function r(f){return uo(f)?(t.consume(f),s):f===64?n(f):l(f)}function s(f){return f===43||f===45||f===46||Sn(f)?(o=1,i(f)):l(f)}function i(f){return f===58?(t.consume(f),o=0,a):(f===43||f===45||f===46||Sn(f))&&o++<32?(t.consume(f),i):(o=0,l(f))}function a(f){return f===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):f===null||f===32||f===60||Tf(f)?n(f):(t.consume(f),a)}function l(f){return f===64?(t.consume(f),c):xP(f)?(t.consume(f),l):n(f)}function c(f){return Sn(f)?d(f):n(f)}function d(f){return f===46?(t.consume(f),o=0,c):f===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):u(f)}function u(f){if((f===45||Sn(f))&&o++<63){const m=f===45?u:d;return t.consume(f),m}return n(f)}}},ql={partial:!0,tokenize:function(t,e,n){return function(r){return ht(r)?bt(t,o,"linePrefix")(r):o(r)};function o(r){return r===null||Ke(r)?e(r):n(r)}}},Rk={continuation:{tokenize:function(t,e,n){const o=this;return function(s){return ht(s)?bt(t,r,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):r(s)};function r(s){return t.attempt(Rk,e,n)(s)}}},exit:function(t){t.exit("blockQuote")},name:"blockQuote",tokenize:function(t,e,n){const o=this;return function(s){if(s===62){const i=o.containerState;return i.open||(t.enter("blockQuote",{_container:!0}),i.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),r}return n(s)};function r(s){return ht(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}},Pk={name:"characterEscape",tokenize:function(t,e,n){return function(r){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(r),t.exit("escapeMarker"),o};function o(r){return vP(r)?(t.enter("characterEscapeValue"),t.consume(r),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(r)}}},Lk={name:"characterReference",tokenize:function(t,e,n){const o=this;let r,s,i=0;return function(d){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),a};function a(d){return d===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(d),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),r=31,s=Sn,c(d))}function l(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),r=6,s=wP,c):(t.enter("characterReferenceValue"),r=7,s=Mf,c(d))}function c(d){if(d===59&&i){const u=t.exit("characterReferenceValue");return s!==Sn||Af(o.sliceSerialize(u))?(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e):n(d)}return s(d)&&i++<r?(t.consume(d),c):n(d)}}},Fk={partial:!0,tokenize:function(t,e,n){const o=this;return function(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),r)};function r(s){return o.parser.lazy[o.now().line]?n(s):e(s)}}},zk={concrete:!0,name:"codeFenced",tokenize:function(t,e,n){const o=this,r={partial:!0,tokenize:function(y,v,S){let k=0;return j;function j(R){return y.enter("lineEnding"),y.consume(R),y.exit("lineEnding"),E}function E(R){return y.enter("codeFencedFence"),ht(R)?bt(y,I,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):I(R)}function I(R){return R===s?(y.enter("codeFencedFenceSequence"),T(R)):S(R)}function T(R){return R===s?(k++,y.consume(R),T):k>=a?(y.exit("codeFencedFenceSequence"),ht(R)?bt(y,M,"whitespace")(R):M(R)):S(R)}function M(R){return R===null||Ke(R)?(y.exit("codeFencedFence"),v(R)):S(R)}}};let s,i=0,a=0;return function(y){return function(v){const S=o.events[o.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,s=v,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),l(v)}(y)};function l(y){return y===s?(a++,t.consume(y),l):a<3?n(y):(t.exit("codeFencedFenceSequence"),ht(y)?bt(t,c,"whitespace")(y):c(y))}function c(y){return y===null||Ke(y)?(t.exit("codeFencedFence"),o.interrupt?e(y):t.check(Fk,m,x)(y)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===null||Ke(y)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),c(y)):ht(y)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),bt(t,u,"whitespace")(y)):y===96&&y===s?n(y):(t.consume(y),d)}function u(y){return y===null||Ke(y)?c(y):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===null||Ke(y)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),c(y)):y===96&&y===s?n(y):(t.consume(y),f)}function m(y){return t.attempt(r,x,_)(y)}function _(y){return t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),g}function g(y){return i>0&&ht(y)?bt(t,p,"linePrefix",i+1)(y):p(y)}function p(y){return y===null||Ke(y)?t.check(Fk,m,x)(y):(t.enter("codeFlowValue"),b(y))}function b(y){return y===null||Ke(y)?(t.exit("codeFlowValue"),p(y)):(t.consume(y),b)}function x(y){return t.exit("codeFenced"),e(y)}}},Rf={name:"codeIndented",tokenize:function(t,e,n){const o=this;return function(l){return t.enter("codeIndented"),bt(t,r,"linePrefix",5)(l)};function r(l){const c=o.events[o.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?a(l):Ke(l)?t.attempt(EP,s,a)(l):(t.enter("codeFlowValue"),i(l))}function i(l){return l===null||Ke(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),i)}function a(l){return t.exit("codeIndented"),e(l)}}},EP={partial:!0,tokenize:function(t,e,n){const o=this;return r;function r(i){return o.parser.lazy[o.now().line]?n(i):Ke(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r):bt(t,s,"linePrefix",5)(i)}function s(i){const a=o.events[o.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(i):Ke(i)?r(i):n(i)}}},IP={name:"codeText",previous:function(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"},resolve:function(t){let e,n,o=t.length-4,r=3;if(!(t[r][1].type!=="lineEnding"&&t[r][1].type!=="space"||t[o][1].type!=="lineEnding"&&t[o][1].type!=="space")){for(e=r;++e<o;)if(t[e][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[o][1].type="codeTextPadding",r+=2,o-=2;break}}for(e=r-1,o++;++e<=o;)n===void 0?e!==o&&t[e][1].type!=="lineEnding"&&(n=e):e!==o&&t[e][1].type!=="lineEnding"||(t[n][1].type="codeTextData",e!==n+2&&(t[n][1].end=t[e-1][1].end,t.splice(n+2,e-n-2),o-=e-n-2,e=n+2),n=void 0);return t},tokenize:function(t,e,n){let o,r,s=0;return function(d){return t.enter("codeText"),t.enter("codeTextSequence"),i(d)};function i(d){return d===96?(t.consume(d),s++,i):(t.exit("codeTextSequence"),a(d))}function a(d){return d===null?n(d):d===32?(t.enter("space"),t.consume(d),t.exit("space"),a):d===96?(r=t.enter("codeTextSequence"),o=0,c(d)):Ke(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),a):(t.enter("codeTextData"),l(d))}function l(d){return d===null||d===32||d===96||Ke(d)?(t.exit("codeTextData"),a(d)):(t.consume(d),l)}function c(d){return d===96?(t.consume(d),o++,c):o===s?(t.exit("codeTextSequence"),t.exit("codeText"),e(d)):(r.type="codeTextData",l(d))}}};class AP{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const o=n??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(e,o):e>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(e,n,o){const r=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return o&&Ji(this.left,o),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Ji(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ji(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Ji(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Ji(this.left,n.reverse())}}}function Ji(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Bk(t){const e={};let n,o,r,s,i,a,l,c=-1;const d=new AP(t);for(;++c<d.length;){for(;c in e;)c=e[c];if(n=d.get(c),c&&n[1].type==="chunkFlow"&&d.get(c-1)[1].type==="listItemPrefix"&&(a=n[1]._tokenizer.events,r=0,r<a.length&&a[r][1].type==="lineEndingBlank"&&(r+=2),r<a.length&&a[r][1].type==="content"))for(;++r<a.length&&a[r][1].type!=="content";)a[r][1].type==="chunkText"&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,TP(d,c)),c=e[c],l=!0);else if(n[1]._container){for(r=c,o=void 0;r--&&(s=d.get(r),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(o&&(d.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=r);o&&(n[1].end={...d.get(o)[1].start},i=d.slice(o,c),i.unshift(n),d.splice(o,c-o+1,i))}}return co(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function TP(t,e){const n=t.get(e)[1],o=t.get(e)[2];let r=e-1;const s=[],i=n._tokenizer||o.parser[n.contentType](n.start),a=i.events,l=[],c={};let d,u,f=-1,m=n,_=0,g=0;const p=[g];for(;m;){for(;t.get(++r)[1]!==m;);s.push(r),m._tokenizer||(d=o.sliceStream(m),m.next||d.push(null),u&&i.defineSkip(m.start),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(d),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),u=m,m=m.next}for(m=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(g=f+1,p.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(i.events=[],m?(m._tokenizer=void 0,m.previous=void 0):p.pop(),f=p.length;f--;){const b=a.slice(p[f],p[f+1]),x=s.pop();l.push([x,x+b.length-1]),t.splice(x,2,b)}for(l.reverse(),f=-1;++f<l.length;)c[_+l[f][0]]=_+l[f][1],_+=l[f][1]-l[f][0]-1;return c}const MP={resolve:function(t){return Bk(t),t},tokenize:function(t,e){let n;return function(i){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),o(i)};function o(i){return i===null?r(i):Ke(i)?t.check(OP,s,r)(i):(t.consume(i),o)}function r(i){return t.exit("chunkContent"),t.exit("content"),e(i)}function s(i){return t.consume(i),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}},OP={partial:!0,tokenize:function(t,e,n){const o=this;return function(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),bt(t,r,"linePrefix")};function r(s){if(s===null||Ke(s))return n(s);const i=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?e(s):t.interrupt(o.parser.constructs.flow,n,e)(s)}}};function Uk(t,e,n,o,r,s,i,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return function(p){return p===60?(t.enter(o),t.enter(r),t.enter(s),t.consume(p),t.exit(s),u):p===null||p===32||p===41||Tf(p)?n(p):(t.enter(o),t.enter(i),t.enter(a),t.enter("chunkString",{contentType:"string"}),_(p))};function u(p){return p===62?(t.enter(s),t.consume(p),t.exit(s),t.exit(r),t.exit(o),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===62?(t.exit("chunkString"),t.exit(a),u(p)):p===null||p===60||Ke(p)?n(p):(t.consume(p),p===92?m:f)}function m(p){return p===60||p===62||p===92?(t.consume(p),f):f(p)}function _(p){return d||p!==null&&p!==41&&!bn(p)?d<c&&p===40?(t.consume(p),d++,_):p===41?(t.consume(p),d--,_):p===null||p===32||p===40||Tf(p)?n(p):(t.consume(p),p===92?g:_):(t.exit("chunkString"),t.exit(a),t.exit(i),t.exit(o),e(p))}function g(p){return p===40||p===41||p===92?(t.consume(p),_):_(p)}}function Vk(t,e,n,o,r,s){const i=this;let a,l=0;return function(f){return t.enter(o),t.enter(r),t.consume(f),t.exit(r),t.enter(s),c};function c(f){return l>999||f===null||f===91||f===93&&!a||f===94&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?n(f):f===93?(t.exit(s),t.enter(r),t.consume(f),t.exit(r),t.exit(o),e):Ke(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||Ke(f)||l++>999?(t.exit("chunkString"),c(f)):(t.consume(f),a||(a=!ht(f)),f===92?u:d)}function u(f){return f===91||f===92||f===93?(t.consume(f),l++,d):d(f)}}function $k(t,e,n,o,r,s){let i;return function(u){return u===34||u===39||u===40?(t.enter(o),t.enter(r),t.consume(u),t.exit(r),i=u===40?41:u,a):n(u)};function a(u){return u===i?(t.enter(r),t.consume(u),t.exit(r),t.exit(o),e):(t.enter(s),l(u))}function l(u){return u===i?(t.exit(s),a(i)):u===null?n(u):Ke(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),bt(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(u))}function c(u){return u===i||u===null||Ke(u)?(t.exit("chunkString"),l(u)):(t.consume(u),u===92?d:c)}function d(u){return u===i||u===92?(t.consume(u),c):c(u)}}function Ki(t,e){let n;return function o(r){return Ke(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,o):ht(r)?bt(t,o,n?"linePrefix":"lineSuffix")(r):e(r)}}const DP={name:"definition",tokenize:function(t,e,n){const o=this;let r;return function(u){return t.enter("definition"),function(f){return Vk.call(o,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}(u)};function s(u){return r=ys(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),u===58?(t.enter("definitionMarker"),t.consume(u),t.exit("definitionMarker"),i):n(u)}function i(u){return bn(u)?Ki(t,a)(u):a(u)}function a(u){return Uk(t,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(u)}function l(u){return t.attempt(RP,c,c)(u)}function c(u){return ht(u)?bt(t,d,"whitespace")(u):d(u)}function d(u){return u===null||Ke(u)?(t.exit("definition"),o.parser.defined.push(r),e(u)):n(u)}}},RP={partial:!0,tokenize:function(t,e,n){return function(i){return bn(i)?Ki(t,o)(i):n(i)};function o(i){return $k(t,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function r(i){return ht(i)?bt(t,s,"whitespace")(i):s(i)}function s(i){return i===null||Ke(i)?e(i):n(i)}}},PP={name:"hardBreakEscape",tokenize:function(t,e,n){return function(r){return t.enter("hardBreakEscape"),t.consume(r),o};function o(r){return Ke(r)?(t.exit("hardBreakEscape"),e(r)):n(r)}}},LP={name:"headingAtx",resolve:function(t,e){let n,o,r=t.length-2,s=3;return t[s][1].type==="whitespace"&&(s+=2),r-2>s&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&t[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(n={type:"atxHeadingText",start:t[s][1].start,end:t[r][1].end},o={type:"chunkText",start:t[s][1].start,end:t[r][1].end,contentType:"text"},co(t,s,r-s+1,[["enter",n,e],["enter",o,e],["exit",o,e],["exit",n,e]])),t},tokenize:function(t,e,n){let o=0;return function(l){return t.enter("atxHeading"),function(c){return t.enter("atxHeadingSequence"),r(c)}(l)};function r(l){return l===35&&o++<6?(t.consume(l),r):l===null||bn(l)?(t.exit("atxHeadingSequence"),s(l)):n(l)}function s(l){return l===35?(t.enter("atxHeadingSequence"),i(l)):l===null||Ke(l)?(t.exit("atxHeading"),e(l)):ht(l)?bt(t,s,"whitespace")(l):(t.enter("atxHeadingText"),a(l))}function i(l){return l===35?(t.consume(l),i):(t.exit("atxHeadingSequence"),s(l))}function a(l){return l===null||l===35||bn(l)?(t.exit("atxHeadingText"),s(l)):(t.consume(l),a)}}},FP=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Hk=["pre","script","style","textarea"],zP={concrete:!0,name:"htmlFlow",resolveTo:function(t){let e=t.length;for(;e--&&(t[e][0]!=="enter"||t[e][1].type!=="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t},tokenize:function(t,e,n){const o=this;let r,s,i,a,l;return function(N){return function(H){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(H),c}(N)};function c(N){return N===33?(t.consume(N),d):N===47?(t.consume(N),s=!0,m):N===63?(t.consume(N),r=3,o.interrupt?e:L):uo(N)?(t.consume(N),i=String.fromCharCode(N),_):n(N)}function d(N){return N===45?(t.consume(N),r=2,u):N===91?(t.consume(N),r=5,a=0,f):uo(N)?(t.consume(N),r=4,o.interrupt?e:L):n(N)}function u(N){return N===45?(t.consume(N),o.interrupt?e:L):n(N)}function f(N){return N==="CDATA[".charCodeAt(a++)?(t.consume(N),a===6?o.interrupt?e:T:f):n(N)}function m(N){return uo(N)?(t.consume(N),i=String.fromCharCode(N),_):n(N)}function _(N){if(N===null||N===47||N===62||bn(N)){const H=N===47,Y=i.toLowerCase();return H||s||!Hk.includes(Y)?FP.includes(i.toLowerCase())?(r=6,H?(t.consume(N),g):o.interrupt?e(N):T(N)):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(N):s?p(N):b(N)):(r=1,o.interrupt?e(N):T(N))}return N===45||Sn(N)?(t.consume(N),i+=String.fromCharCode(N),_):n(N)}function g(N){return N===62?(t.consume(N),o.interrupt?e:T):n(N)}function p(N){return ht(N)?(t.consume(N),p):E(N)}function b(N){return N===47?(t.consume(N),E):N===58||N===95||uo(N)?(t.consume(N),x):ht(N)?(t.consume(N),b):E(N)}function x(N){return N===45||N===46||N===58||N===95||Sn(N)?(t.consume(N),x):y(N)}function y(N){return N===61?(t.consume(N),v):ht(N)?(t.consume(N),y):b(N)}function v(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),l=N,S):ht(N)?(t.consume(N),v):k(N)}function S(N){return N===l?(t.consume(N),l=null,j):N===null||Ke(N)?n(N):(t.consume(N),S)}function k(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||bn(N)?y(N):(t.consume(N),k)}function j(N){return N===47||N===62||ht(N)?b(N):n(N)}function E(N){return N===62?(t.consume(N),I):n(N)}function I(N){return N===null||Ke(N)?T(N):ht(N)?(t.consume(N),I):n(N)}function T(N){return N===45&&r===2?(t.consume(N),O):N===60&&r===1?(t.consume(N),z):N===62&&r===4?(t.consume(N),C):N===63&&r===3?(t.consume(N),L):N===93&&r===5?(t.consume(N),V):!Ke(N)||r!==6&&r!==7?N===null||Ke(N)?(t.exit("htmlFlowData"),M(N)):(t.consume(N),T):(t.exit("htmlFlowData"),t.check(BP,$,M)(N))}function M(N){return t.check(UP,R,$)(N)}function R(N){return t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),B}function B(N){return N===null||Ke(N)?M(N):(t.enter("htmlFlowData"),T(N))}function O(N){return N===45?(t.consume(N),L):T(N)}function z(N){return N===47?(t.consume(N),i="",F):T(N)}function F(N){if(N===62){const H=i.toLowerCase();return Hk.includes(H)?(t.consume(N),C):T(N)}return uo(N)&&i.length<8?(t.consume(N),i+=String.fromCharCode(N),F):T(N)}function V(N){return N===93?(t.consume(N),L):T(N)}function L(N){return N===62?(t.consume(N),C):N===45&&r===2?(t.consume(N),L):T(N)}function C(N){return N===null||Ke(N)?(t.exit("htmlFlowData"),$(N)):(t.consume(N),C)}function $(N){return t.exit("htmlFlow"),e(N)}}},BP={partial:!0,tokenize:function(t,e,n){return function(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(ql,e,n)}}},UP={partial:!0,tokenize:function(t,e,n){const o=this;return function(s){return Ke(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),r):n(s)};function r(s){return o.parser.lazy[o.now().line]?n(s):e(s)}}},VP={name:"htmlText",tokenize:function(t,e,n){const o=this;let r,s,i;return function(C){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(C),a};function a(C){return C===33?(t.consume(C),l):C===47?(t.consume(C),v):C===63?(t.consume(C),x):uo(C)?(t.consume(C),j):n(C)}function l(C){return C===45?(t.consume(C),c):C===91?(t.consume(C),s=0,m):uo(C)?(t.consume(C),b):n(C)}function c(C){return C===45?(t.consume(C),f):n(C)}function d(C){return C===null?n(C):C===45?(t.consume(C),u):Ke(C)?(i=d,F(C)):(t.consume(C),d)}function u(C){return C===45?(t.consume(C),f):d(C)}function f(C){return C===62?z(C):C===45?u(C):d(C)}function m(C){return C==="CDATA[".charCodeAt(s++)?(t.consume(C),s===6?_:m):n(C)}function _(C){return C===null?n(C):C===93?(t.consume(C),g):Ke(C)?(i=_,F(C)):(t.consume(C),_)}function g(C){return C===93?(t.consume(C),p):_(C)}function p(C){return C===62?z(C):C===93?(t.consume(C),p):_(C)}function b(C){return C===null||C===62?z(C):Ke(C)?(i=b,F(C)):(t.consume(C),b)}function x(C){return C===null?n(C):C===63?(t.consume(C),y):Ke(C)?(i=x,F(C)):(t.consume(C),x)}function y(C){return C===62?z(C):x(C)}function v(C){return uo(C)?(t.consume(C),S):n(C)}function S(C){return C===45||Sn(C)?(t.consume(C),S):k(C)}function k(C){return Ke(C)?(i=k,F(C)):ht(C)?(t.consume(C),k):z(C)}function j(C){return C===45||Sn(C)?(t.consume(C),j):C===47||C===62||bn(C)?E(C):n(C)}function E(C){return C===47?(t.consume(C),z):C===58||C===95||uo(C)?(t.consume(C),I):Ke(C)?(i=E,F(C)):ht(C)?(t.consume(C),E):z(C)}function I(C){return C===45||C===46||C===58||C===95||Sn(C)?(t.consume(C),I):T(C)}function T(C){return C===61?(t.consume(C),M):Ke(C)?(i=T,F(C)):ht(C)?(t.consume(C),T):E(C)}function M(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(t.consume(C),r=C,R):Ke(C)?(i=M,F(C)):ht(C)?(t.consume(C),M):(t.consume(C),B)}function R(C){return C===r?(t.consume(C),r=void 0,O):C===null?n(C):Ke(C)?(i=R,F(C)):(t.consume(C),R)}function B(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||bn(C)?E(C):(t.consume(C),B)}function O(C){return C===47||C===62||bn(C)?E(C):n(C)}function z(C){return C===62?(t.consume(C),t.exit("htmlTextData"),t.exit("htmlText"),e):n(C)}function F(C){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),V}function V(C){return ht(C)?bt(t,L,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):L(C)}function L(C){return t.enter("htmlTextData"),i(C)}}},Pf={name:"labelEnd",resolveAll:function(t){let e=-1;const n=[];for(;++e<t.length;){const o=t[e][1];if(n.push(t[e]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const r=o.type==="labelImage"?4:2;o.type="data",e+=r}}return t.length!==n.length&&co(t,0,t.length,n),t},resolveTo:function(t,e){let n,o,r,s,i=t.length,a=0;for(;i--;)if(n=t[i][1],o){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;t[i][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(r){if(t[i][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(o=i,n.type!=="labelLink")){a=2;break}}else n.type==="labelEnd"&&(r=i);const l={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},c={type:"label",start:{...t[o][1].start},end:{...t[r][1].end}},d={type:"labelText",start:{...t[o+a+2][1].end},end:{...t[r-2][1].start}};return s=[["enter",l,e],["enter",c,e]],s=Bn(s,t.slice(o+1,o+a+3)),s=Bn(s,[["enter",d,e]]),s=Bn(s,Of(e.parser.constructs.insideSpan.null,t.slice(o+a+4,r-3),e)),s=Bn(s,[["exit",d,e],t[r-2],t[r-1],["exit",c,e]]),s=Bn(s,t.slice(r+1)),s=Bn(s,[["exit",l,e]]),co(t,o,t.length,s),t},tokenize:function(t,e,n){const o=this;let r,s,i=o.events.length;for(;i--;)if((o.events[i][1].type==="labelImage"||o.events[i][1].type==="labelLink")&&!o.events[i][1]._balanced){r=o.events[i][1];break}return function(u){return r?r._inactive?d(u):(s=o.parser.defined.includes(ys(o.sliceSerialize({start:r.end,end:o.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelEnd"),a):n(u)};function a(u){return u===40?t.attempt($P,c,s?c:d)(u):u===91?t.attempt(HP,c,s?l:d)(u):s?c(u):d(u)}function l(u){return t.attempt(WP,c,d)(u)}function c(u){return e(u)}function d(u){return r._balanced=!0,n(u)}}},$P={tokenize:function(t,e,n){return function(d){return t.enter("resource"),t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),o};function o(d){return bn(d)?Ki(t,r)(d):r(d)}function r(d){return d===41?c(d):Uk(t,s,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return bn(d)?Ki(t,a)(d):c(d)}function i(d){return n(d)}function a(d){return d===34||d===39||d===40?$k(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function l(d){return bn(d)?Ki(t,c)(d):c(d)}function c(d){return d===41?(t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),t.exit("resource"),e):n(d)}}},HP={tokenize:function(t,e,n){const o=this;return function(i){return Vk.call(o,t,r,s,"reference","referenceMarker","referenceString")(i)};function r(i){return o.parser.defined.includes(ys(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?e(i):n(i)}function s(i){return n(i)}}},WP={tokenize:function(t,e,n){return function(r){return t.enter("reference"),t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),o};function o(r){return r===93?(t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),t.exit("reference"),e):n(r)}}},qP={name:"labelStartImage",resolveAll:Pf.resolveAll,tokenize:function(t,e,n){const o=this;return function(i){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(i),t.exit("labelImageMarker"),r};function r(i){return i===91?(t.enter("labelMarker"),t.consume(i),t.exit("labelMarker"),t.exit("labelImage"),s):n(i)}function s(i){return i===94&&"_hiddenFootnoteSupport"in o.parser.constructs?n(i):e(i)}}},GP={name:"labelStartLink",resolveAll:Pf.resolveAll,tokenize:function(t,e,n){const o=this;return function(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),r};function r(s){return s===94&&"_hiddenFootnoteSupport"in o.parser.constructs?n(s):e(s)}}},Lf={name:"lineEnding",tokenize:function(t,e){return function(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),bt(t,e,"linePrefix")}}},Gl={name:"thematicBreak",tokenize:function(t,e,n){let o,r=0;return function(a){return t.enter("thematicBreak"),function(l){return o=l,s(l)}(a)};function s(a){return a===o?(t.enter("thematicBreakSequence"),i(a)):r>=3&&(a===null||Ke(a))?(t.exit("thematicBreak"),e(a)):n(a)}function i(a){return a===o?(t.consume(a),r++,i):(t.exit("thematicBreakSequence"),ht(a)?bt(t,s,"whitespace")(a):s(a))}}},yn={continuation:{tokenize:function(t,e,n){const o=this;return o.containerState._closeFlow=void 0,t.check(ql,r,s);function r(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,bt(t,e,"listItemIndent",o.containerState.size+1)(a)}function s(a){return o.containerState.furtherBlankLines||!ht(a)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,i(a)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,t.attempt(JP,e,i)(a))}function i(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,bt(t,t.attempt(yn,e,n),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(t){t.exit(this.containerState.type)},name:"list",tokenize:function(t,e,n){const o=this,r=o.events[o.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,i=0;return function(f){const m=o.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!o.containerState.marker||f===o.containerState.marker:Mf(f)){if(o.containerState.type||(o.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(Gl,n,l)(f):l(f);if(!o.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),a(f)}return n(f)};function a(f){return Mf(f)&&++i<10?(t.consume(f),a):(!o.interrupt||i<2)&&(o.containerState.marker?f===o.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),l(f)):n(f)}function l(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||f,t.check(ql,o.interrupt?n:c,t.attempt(YP,u,d))}function c(f){return o.containerState.initialBlankLine=!0,s++,u(f)}function d(f){return ht(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),u):n(f)}function u(f){return o.containerState.size=s+o.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}},YP={partial:!0,tokenize:function(t,e,n){const o=this;return bt(t,function(r){const s=o.events[o.events.length-1];return!ht(r)&&s&&s[1].type==="listItemPrefixWhitespace"?e(r):n(r)},"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},JP={partial:!0,tokenize:function(t,e,n){const o=this;return bt(t,function(r){const s=o.events[o.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===o.containerState.size?e(r):n(r)},"listItemIndent",o.containerState.size+1)}},Wk={name:"setextUnderline",resolveTo:function(t,e){let n,o,r,s=t.length;for(;s--;)if(t[s][0]==="enter"){if(t[s][1].type==="content"){n=s;break}t[s][1].type==="paragraph"&&(o=s)}else t[s][1].type==="content"&&t.splice(s,1),r||t[s][1].type!=="definition"||(r=s);const i={type:"setextHeading",start:{...t[o][1].start},end:{...t[t.length-1][1].end}};return t[o][1].type="setextHeadingText",r?(t.splice(o,0,["enter",i,e]),t.splice(r+1,0,["exit",t[n][1],e]),t[n][1].end={...t[r][1].end}):t[n][1]=i,t.push(["exit",i,e]),t},tokenize:function(t,e,n){const o=this;let r;return function(a){let l,c=o.events.length;for(;c--;)if(o.events[c][1].type!=="lineEnding"&&o.events[c][1].type!=="linePrefix"&&o.events[c][1].type!=="content"){l=o.events[c][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||l)?(t.enter("setextHeadingLine"),r=a,function(d){return t.enter("setextHeadingLineSequence"),s(d)}(a)):n(a)};function s(a){return a===r?(t.consume(a),s):(t.exit("setextHeadingLineSequence"),ht(a)?bt(t,i,"lineSuffix")(a):i(a))}function i(a){return a===null||Ke(a)?(t.exit("setextHeadingLine"),e(a)):n(a)}}},KP={tokenize:function(t){const e=this,n=t.attempt(ql,function(r){return r===null?void t.consume(r):(t.enter("lineEndingBlank"),t.consume(r),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n)},t.attempt(this.parser.constructs.flowInitial,o,bt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(MP,o)),"linePrefix")));return n;function o(r){if(r!==null)return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),e.currentConstruct=void 0,n;t.consume(r)}}},XP={resolveAll:Gk()},ZP=qk("string"),QP=qk("text");function qk(t){return{resolveAll:Gk(t==="text"?eL:void 0),tokenize:function(e){const n=this,o=this.parser.constructs[t],r=e.attempt(o,s,i);return s;function s(c){return l(c)?r(c):i(c)}function i(c){if(c!==null)return e.enter("data"),e.consume(c),a;e.consume(c)}function a(c){return l(c)?(e.exit("data"),r(c)):(e.consume(c),a)}function l(c){if(c===null)return!0;const d=o[c];let u=-1;if(d)for(;++u<d.length;){const f=d[u];if(!f.previous||f.previous.call(n,n.previous))return!0}return!1}}}}function Gk(t){return function(e,n){let o,r=-1;for(;++r<=e.length;)o===void 0?e[r]&&e[r][1].type==="data"&&(o=r,r++):e[r]&&e[r][1].type==="data"||(r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),r=o+2),o=void 0);return t?t(e,n):e}}function eL(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const o=t[n-1][1],r=e.sliceStream(o);let s,i=r.length,a=-1,l=0;for(;i--;){const c=r[i];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(c===-2)s=!0,l++;else if(c!==-1){i++;break}}if(l){const c={type:n===t.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:o.start._bufferIndex+a,_index:o.start._index+i,line:o.end.line,column:o.end.column-l,offset:o.end.offset-l},end:{...o.end}};o.end={...c.start},o.start.offset===o.end.offset?Object.assign(o,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}const tL={42:yn,43:yn,45:yn,48:yn,49:yn,50:yn,51:yn,52:yn,53:yn,54:yn,55:yn,56:yn,57:yn,62:Rk},nL={91:DP},oL={[-2]:Rf,[-1]:Rf,32:Rf},rL={35:LP,42:Gl,45:[Wk,Gl],60:zP,61:Wk,95:Gl,96:zk,126:zk},sL={38:Lk,92:Pk},iL={[-5]:Lf,[-4]:Lf,[-3]:Lf,33:qP,38:Lk,42:Df,60:[jP,VP],91:GP,92:[PP,Pk],93:Pf,95:Df,96:IP},aL={null:[Df,XP]},lL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:nL,disable:{null:[]},document:tL,flow:rL,flowInitial:oL,insideSpan:aL,string:sL,text:iL},Symbol.toStringTag,{value:"Module"}));function cL(t,e,n){let o={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},s=[];let i=[],a=[];const l={attempt:p(function(y,v){b(y,v.from)}),check:p(g),consume:function(y){Ke(y)?(o.line++,o.column=1,o.offset+=y===-3?2:1,x()):y!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===i[o._index].length&&(o._bufferIndex=-1,o._index++)),c.previous=y},enter:function(y,v){const S=v||{};return S.type=y,S.start=f(),c.events.push(["enter",S,c]),a.push(S),S},exit:function(y){const v=a.pop();return v.end=f(),c.events.push(["exit",v,c]),v},interrupt:p(g,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(y){r[y.line]=y.column,x()},events:[],now:f,parser:t,previous:null,sliceSerialize:function(y,v){return function(S,k){let j=-1;const E=[];let I;for(;++j<S.length;){const T=S[j];let M;if(typeof T=="string")M=T;else switch(T){case-5:M="\r";break;case-4:M=`
|
119
|
+
`).length),position:{x:0,y:0}}}createElements(t,e,n,o){const r=[],s=[],i=new Set,a=new Set;for(const l of Object.values(n)){if(l.value==="marimo"&&l.name==="mo")continue;const{declaredBy:c,usedBy:d}=l;for(const u of c)for(const f of d){const m=`${u}-${f}`;a.has(m)||(a.add(m),i.add(u),i.add(f),s.push(this.createEdge(u,f)))}}for(const[l,c]of Ym.zip(t,e)){o||r.push(this.createNode(l,c));const d=i.has(l),u=dt.get(c).code.trim().startsWith("mo.md");!d&&u||r.push(this.createNode(l,c))}return{nodes:r,edges:s}}},wD=t=>{const e=X.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:i,settings:a}=t;let l;e[0]!==r||e[1]!==n||e[2]!==i||e[3]!==a.hidePureMarkdown||e[4]!==o?(l=()=>{let C=N2.createElements(n,r,o,a.hidePureMarkdown);return C=C2(C.nodes,C.edges,{direction:i}),C},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[c]=A.useState(l),[d,u,f]=rv(c.nodes),[m,_,g]=sv(c.edges),p=Vi();let b;e[6]!==i||e[7]!==_||e[8]!==u?(b=C=>{const $=C2(C.nodes,C.edges,{direction:i});u($.nodes),_($.edges)},e[6]=i,e[7]=_,e[8]=u,e[9]=b):b=e[9];const x=Qe(b);let y,v;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==x||e[14]!==o?(y=()=>{x(N2.createElements(n,r,o,a.hidePureMarkdown))},v=[n,o,r,x,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=x,e[14]=o,e[15]=y,e[16]=v):(y=e[15],v=e[16]),A.useEffect(y,v);const[S,k]=A.useState();let j;hv(),e[17]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{k(void 0)},e[17]=j):j=e[17];const E=j;let I,T,M,R,B,O,z,F,V,L;return e[18]===Symbol.for("react.memo_cache_sentinel")?(I={minZoom:.5,maxZoom:1.5},T=(C,$)=>{k({type:"node",id:$.id})},M=(C,$)=>{const{source:N,target:H}=$;k({type:"edge",source:N,target:H})},e[18]=I,e[19]=T,e[20]=M):(I=e[18],T=e[19],M=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(R=h.jsx(U9,{color:"#ccc",variant:Ln.Dots}),e[21]=R):R=e[21],e[22]!==p||e[23]!==d?(B=()=>{const C=dt.get(nV);if(C){const $=d.find(N=>N.id===C);$&&(p.fitView({padding:1,duration:600,nodes:[$]}),k({type:"node",id:C}))}},e[22]=p,e[23]=d,e[24]=B):B=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(O=h.jsx(Tp,{className:"size-4"}),e[25]=O):O=e[25],e[26]!==B?(z=h.jsx(R9,{position:"bottom-right",showInteractive:!1,children:h.jsx(Oe,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:h.jsx(ps,{onMouseDown:fn.preventFocus,onClick:B,children:O})})}),e[26]=B,e[27]=z):z=e[27],e[28]!==m||e[29]!==S||e[30]!==o?(F=h.jsx(zl,{selection:S,variables:o,edges:m,onClearSelection:E}),e[28]=m,e[29]=S,e[30]=o,e[31]=F):F=e[31],e[32]!==s||e[33]!==m||e[34]!==d||e[35]!==g||e[36]!==f||e[37]!==z||e[38]!==F?(V=h.jsxs(wh,{nodes:d,edges:m,nodeTypes:dv,minZoom:.2,fitViewOptions:I,onNodeClick:T,onEdgeClick:M,onNodeDoubleClick:vD,fitView:!0,onNodesChange:f,onEdgesChange:g,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[R,z,F,s]}),e[32]=s,e[33]=m,e[34]=d,e[35]=g,e[36]=f,e[37]=z,e[38]=F,e[39]=V):V=e[39],e[40]!==i||e[41]!==V?(L=h.jsx(lv.Provider,{value:i,children:V}),e[40]=i,e[41]=V,e[42]=L):L=e[42],L};function vD(t,e){q4(e.id,"focus")}const kD=Ut("_minimap_"),SD=Ut({hidePureMarkdown:!0}),CD=t=>{const e=X.c(11),[n,o]=hn(kD),[r,s]=hn(SD);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?h.jsx(q9,{...t,children:h.jsx(Sh,{settings:r,onSettingsChange:s,view:n,onChange:o})}):h.jsx(wD,{...t,settings:r,layoutDirection:n,children:h.jsx(Sh,{settings:r,onSettingsChange:s,view:n,onChange:o})}),e[0]=n,e[1]=t,e[2]=o,e[3]=s,e[4]=r,e[5]=i):i=e[5];const a=i;let l,c;return e[6]!==a?(l=a(),e[6]=a,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(c=h.jsx(xh,{children:l},n),e[8]=n,e[9]=l,e[10]=c):c=e[10],c},ND=()=>{const t=X.c(5),e=G4(),n=Uc(),[o]=oV();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Me("w-full h-full flex-1 mx-auto -mb-4 relative"),t[0]=r):r=t[0],t[1]!==n.inOrderIds||t[2]!==o||t[3]!==e?(s=h.jsx("div",{className:r,children:h.jsx(CD,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},j2="name",E2="type-value",cf="defs-refs",jD=[{id:j2,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>h.jsx(Qm,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return h.jsx(kh,{name:e,declaredBy:n})}},{id:E2,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>h.jsx(Qm,{header:h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{children:"Type"}),h.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return h.jsxs("div",{className:"max-w-[150px]",children:[h.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),h.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:cf,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>h.jsx(Qm,{header:h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{children:"Declared By"}),h.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=sc(s);i&&Jm(i,o)};return h.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[h.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[h.jsx("span",{title:"Declared by",children:h.jsx(qp,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?h.jsx(mr,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):h.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>h.jsxs("span",{className:"flex",children:[h.jsx(mr,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),h.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[h.jsx("span",{title:"Used by",children:h.jsx(Ea,{className:"w-3.5 h-3.5 text-muted-foreground"})}),h.jsx(uv,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],I2=A.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=K.useState([]),[s,i]=K.useState(""),a=rV(),l=A.useMemo(()=>{const u=f=>{const m=a[f];return cV(m)?`cell-${e.indexOf(f)}`:m??`cell-${e.indexOf(f)}`};return Object.values(n).map(f=>({...f,declaredByNames:f.declaredBy.map(u),usedByNames:f.usedBy.map(u)}))},[n,a,e]),c=A.useMemo(()=>{const u=new Map;return e.forEach((f,m)=>u.set(f,m)),function(f,m,_){m||(m={id:cf,desc:!1});let g=[];switch(m.id){case j2:g=wa(f,p=>p.name);break;case E2:g=wa(f,p=>p.dataType);break;case cf:g=wa(f,p=>_.get(p.declaredBy[0]))}return m.desc?g.reverse():g}(l,o[0],u)},[l,o,e]),d=sV({data:c,columns:jD,getCoreRowModel:lV(),onGlobalFilterChange:i,getFilteredRowModel:aV(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:u=>u.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:iV(),state:{sorting:o,globalFilter:s}});return h.jsxs(h.Fragment,{children:[h.jsx(Y4,{className:"w-full",placeholder:"Search",value:s,onChange:u=>i(u.target.value)}),h.jsxs(Km,{className:Me("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[h.jsx(Xm,{children:h.jsx(Xs,{className:"whitespace-nowrap text-xs",children:d.getFlatHeaders().map(u=>h.jsx(Dr,{className:"sticky top-0 bg-background border-b",children:J4(u.column.columnDef.header,u.getContext())},u.id))})}),h.jsx(Zm,{children:d.getRowModel().rows.map(u=>h.jsx(Xs,{className:"hover:bg-accent",children:u.getVisibleCells().map(f=>h.jsx(Rr,{className:"border-b",children:J4(f.column.columnDef.cell,f.getContext())},f.id))},u.id))})]})]})});I2.displayName="VariableTable";let A2,T2,M2;A2=()=>{const t=X.c(4),e=G4(),n=Uc();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(An,{title:"No variables",description:"Global variables will appear here.",icon:h.jsx(uc,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=h.jsx(I2,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},ap=t=>{const e=X.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=Me("text-xs font-semibold text-accent-foreground",t.className),e[0]=t.className,e[1]=o):o=e[1],e[2]!==t.dataTestId||e[3]!==t.onClick||e[4]!==o?(r=h.jsx("button",{type:"button","data-testid":n,className:o,onClick:t.onClick,children:"Clear"}),e[2]=t.dataTestId,e[3]=t.onClick,e[4]=o,e[5]=r):r=e[5],r},T2=()=>{const t=X.c(9),e=dV(),{clearLogs:n}=Lt();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(An,{title:"No logs",description:h.jsxs("span",{children:[i," and"," ",h.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:h.jsx(xm,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=h.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:h.jsx(ap,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=h.jsx("div",{className:"overflow-auto flex-1",children:h.jsx(M2,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=h.jsxs(h.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},M2=t=>{const e=X.c(10),{logs:n,className:o}=t;let r,s,i,a,l;return e[0]!==o?(r=Me("flex flex-col",o),e[0]=o,e[1]=r):r=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(s={whiteSpace:"pre-wrap"},e[2]=s):s=e[2],e[3]!==n?(i=n.map(AD),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=h.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:h.jsx("div",{className:"grid grid-cols-[30px,1fr]",style:s,children:i})}),e[5]=i,e[6]=a):a=e[6],e[7]!==r||e[8]!==a?(l=h.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function ED(t){const e=uV(t.timestamp),n=ID[t.level],o=t.level.toUpperCase();return h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)] dark:text-[var(--gray-11)]",children:["[",e,"]"]}),h.jsx("span",{className:Me("flex-shrink-0",n),children:o}),h.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)]",children:["(",h.jsx(mr,{cellId:t.cellId}),")"]}),t.message]})}const ID={stdout:"text-[var(--grass-9)]",stderr:"text-[var(--red-9)]"};function AD(t,e){return h.jsxs("div",{className:"contents group",children:[h.jsx("span",{className:Me("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),h.jsx("span",{className:Me("opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:ED(t)})]},e)}const TD=()=>{const t=X.c(5),{documentation:e}=$e(hV);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(An,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:h.jsx(rd,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=qm({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=h.jsx("div",{className:"p-3 overflow-y-auto overflow-x-hidden h-full docs-documentation flex flex-col gap-4",children:n}),t[3]=n,t[4]=o):o=t[4],o};function O2(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}cp=function(t){t===void 0&&(t={});var e=t.onResize,n=A.useRef(void 0);n.current=e;var o=t.round||Math.round,r=A.useRef(),s=A.useState({width:void 0,height:void 0}),i=s[0],a=s[1],l=A.useRef(!1);A.useEffect(function(){return l.current=!1,function(){l.current=!0}},[]);var c=A.useRef({width:void 0,height:void 0}),d=function(u,f){var m=A.useRef(null),_=A.useRef(null);_.current=f;var g=A.useRef(null);A.useEffect(function(){p()});var p=A.useCallback(function(){var b=g.current,x=_.current,y=b||(x?x instanceof Element?x:x.current:null);m.current&&m.current.element===y&&m.current.subscriber===u||(m.current&&m.current.cleanup&&m.current.cleanup(),m.current={element:y,subscriber:u,cleanup:y?u(y):void 0})},[u]);return A.useEffect(function(){return function(){m.current&&m.current.cleanup&&(m.current.cleanup(),m.current=null)}},[]),A.useCallback(function(b){g.current=b,p()},[p])}(A.useCallback(function(u){return r.current&&r.current.box===t.box&&r.current.round===o||(r.current={box:t.box,round:o,instance:new ResizeObserver(function(f){var m=f[0],_=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",g=O2(m,_,"inlineSize"),p=O2(m,_,"blockSize"),b=g?o(g):void 0,x=p?o(p):void 0;if(c.current.width!==b||c.current.height!==x){var y={width:b,height:x};c.current.width=b,c.current.height=x,n.current?n.current(y):l.current||a(y)}})}),r.current.instance.observe(u,{box:t.box}),function(){r.current&&r.current.instance.unobserve(u)}},[t.box,o]),t.ref);return A.useMemo(function(){return{ref:d,width:i.width,height:i.height}},[d,i.width,i.height])};const df=new Map,MD=({file:t,onOpenNotebook:e})=>{const{theme:n}=po(),o=$e(pm),[r,s]=A.useState(""),{data:i,loading:a,error:l,setData:c}=Xn(async()=>{const g=await K4({path:t.path}),p=g.contents||"";return s(df.get(t.path)||p),g},[t.path]),d=async()=>{r!==(i==null?void 0:i.contents)&&await yV({path:t.path,contents:r}).then(g=>{g.success&&(c(p=>p?{...p,contents:r}:void 0),s(r))})},u=A.useRef(r);if(u.current=r,A.useEffect(()=>()=>{if(!(i!=null&&i.contents))return;const g=u.current;g===i.contents?df.delete(t.path):df.set(t.path,g)},[t.path,i==null?void 0:i.contents]),l)return h.jsx(Zs,{error:l});if(a||!i)return null;const f=i.mimeType||"text/plain",m=f in uf;if(!i.contents&&!m)return h.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[h.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),h.jsx("div",{children:i.file.name}),h.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),h.jsx("div",{children:f})]});const _=h.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!Jn()&&h.jsx(Oe,{content:"Open notebook",children:h.jsx(wn,{size:"small",onClick:g=>e(g),children:h.jsx(bc,{})})}),h.jsx(Oe,{content:"Download",children:h.jsx(wn,{size:"small",onClick:()=>{if(D2(f)){const g=_V(i.contents,f);bV(g,i.file.name)}else sa(new Blob([i.contents||r],{type:f}),i.file.name)},children:h.jsx(Cm,{})})}),!D2(f)&&h.jsxs(h.Fragment,{children:[h.jsx(Oe,{content:"Copy contents to clipboard",children:h.jsx(wn,{size:"small",onClick:async()=>{await xn(r)},children:h.jsx(Ls,{})})}),h.jsx(Oe,{content:mn("global.save"),children:h.jsx(wn,{size:"small",color:r===i.contents?void 0:"green",onClick:d,disabled:r===i.contents,children:h.jsx(ja,{})})})]})]});return f.startsWith("image/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(fV,{base64:i.contents,mime:f})})]}):f==="text/csv"&&i.contents?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(mV,{contents:i.contents})})]}):f.startsWith("audio/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(pV,{base64:i.contents,mime:f})})]}):f.startsWith("video/")?h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(gV,{base64:i.contents,mime:f})})]}):h.jsxs(h.Fragment,{children:[_,h.jsx("div",{className:"flex-1 overflow-auto",children:h.jsx(ba,{theme:n==="dark"?"dark":"light",language:uf[f]||uf.default,className:"border-b",extensions:[st.lineWrapping,$n.of([{key:o.getHotkey("global.save").key,stopPropagation:!0,run:()=>r!==i.contents&&(d(),!0)}])],value:r,onChange:s})})]})},D2=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/"),uf={"application/javascript":"javascript","text/markdown":"markdown","text/html":"html","text/css":"css","text/x-python":"python","application/json":"json","application/xml":"xml","text/x-yaml":"yaml","text/csv":"markdown","text/plain":"markdown",default:"markdown"},R2=Ut(new class{constructor(t){this.callbacks=t,this.delegate=new np([]),this.rootPath="",this.onChange=En.NOOP,this.path=new vm("/"),this.initialize=async e=>{if(this.onChange=e,this.delegate.data.length===0)try{const n=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new np(n.files),this.rootPath=n.root,this.path=vm.guessDeliminator(n.root)}catch(n){lt({title:"Failed",description:S4(n)})}this.onChange(this.delegate.data)},this.refreshAll=async e=>{const n=[this.rootPath,...e.map(r=>{var s;return(s=this.delegate.find(r))==null?void 0:s.data.path})].filter(Boolean),o=await Promise.all(n.map(r=>this.callbacks.listFiles({path:r}).catch(()=>({files:[]}))));for(const[r,s]of n.entries()){const i=o[r];s===this.rootPath?this.delegate=new np(i.files):this.delegate.update({id:s,changes:{children:i.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=e=>{const n=function(o){return o.endsWith("/")?o:`${o}/`}(this.rootPath);return e.startsWith(n)?e.slice(n.length):e},this.handleResponse=e=>e.success?e:(lt({title:"Failed",description:e.message}),null)}async expand(t){const e=this.delegate.find(t);if(!e||!e.data.isDirectory)return!1;if(e.children&&e.children.length>0)return!0;const n=await this.callbacks.listFiles({path:e.data.path});return this.delegate.update({id:t,changes:{children:n.files}}),this.onChange(this.delegate.data),!0}async rename(t,e){const n=this.delegate.find(t);if(!n)return;const o=n.data.path,r=this.path.join(this.path.dirname(o),e);await this.callbacks.renameFileOrFolder({path:o,newPath:r}).then(this.handleResponse),this.delegate.update({id:t,changes:{name:e,path:r}}),this.onChange(this.delegate.data),await this.refreshAll([r])}async move(t,e){var o;const n=e?((o=this.delegate.find(e))==null?void 0:o.data.path)??e:this.rootPath;await Promise.all(t.map(r=>{this.delegate.move({id:r,parentId:e,index:0});const s=this.delegate.find(r);if(!s)return Promise.resolve();const i=this.path.join(n,this.path.basename(s.data.path));return this.delegate.update({id:r,changes:{path:i}}),this.callbacks.renameFileOrFolder({path:s.data.path,newPath:i}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([n])}async createFile(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"file",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async createFolder(t,e){var r;const n=e?((r=this.delegate.find(e))==null?void 0:r.data.path)??e:this.rootPath,o=await this.callbacks.createFileOrFolder({path:n,type:"directory",name:t}).then(this.handleResponse);o!=null&&o.info&&(this.delegate.create({parentId:e,index:0,data:o.info}),this.onChange(this.delegate.data),await this.refreshAll([n]))}async delete(t){const e=this.delegate.find(t);e&&(await this.callbacks.deleteFileOrFolder({path:e.data.path}).then(this.handleResponse),this.delegate.drop({id:t}),this.onChange(this.delegate.data))}}({listFiles:i4,createFileOrFolder:X4,deleteFileOrFolder:wV,renameFileOrFolder:xV})),OD=Ut({});function DD(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=r=>{var s;e((s=r.target)==null?void 0:s.result)},o.onerror=r=>{n(new Error(`Failed to read blob: ${r.type}`))},o.readAsDataURL(t)})}function P2(t){const e=X.c(4);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const o=n;let r;return e[2]!==o?(r={multiple:!0,maxSize:104857600,onError:zD,onDropRejected:PD,onDrop:RD,...o},e[2]=o,e[3]=r):r=e[3],vV(r)}async function RD(t){for(const e of t){const n=(await DD(e)).split(",")[1];await X4({path:"",type:"file",name:e.name,contents:n})}await async function(){await dt.get(R2).refreshAll([])}()}function PD(t){lt({title:"File upload failed",description:h.jsx("div",{className:"flex flex-col gap-1",children:t.map(LD)}),variant:"danger"})}function LD(t){return h.jsxs("div",{children:[t.file.name," (",t.errors.map(FD).join(", "),")"]},t.file.name)}function FD(t){return t.message}function zD(t){Qt.error(t),lt({title:"File upload failed",description:t.message,variant:"danger"})}const L2=K.createContext(null),BD=t=>{const e=X.c(60),{height:n}=t,o=A.useRef(null),[r]=hn(R2);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=A.useState(s),[l,c]=A.useState(null),{openPrompt:d}=Un(),[u,f]=hn(OD);let m,_;e[1]!==r?(m=()=>r.initialize(a),e[1]=r,e[2]=m):m=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(_=[],e[3]=_):_=e[3];const{loading:g,error:p}=Xn(m,_);let b;e[4]!==u||e[5]!==r?(b=()=>{r.refreshAll(Object.keys(u).filter(C=>u[C]))},e[4]=u,e[5]=r,e[6]=b):b=e[6];const x=Qe(b);let y;e[7]!==d||e[8]!==r?(y=async()=>{d({title:"Folder name",onConfirm:async C=>{r.createFolder(C,null)}})},e[7]=d,e[8]=r,e[9]=y):y=e[9];const v=Qe(y);let S;e[10]!==d||e[11]!==r?(S=async()=>{d({title:"File name",onConfirm:async C=>{r.createFile(C,null)}})},e[10]=d,e[11]=r,e[12]=S):S=e[12];const k=Qe(S);let j;e[13]!==f?(j=()=>{var C;(C=o.current)==null||C.closeAll(),f({})},e[13]=f,e[14]=j):j=e[14];const E=Qe(j);if(g){let C;return e[15]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(eo,{size:"medium",centered:!0}),e[15]=C):C=e[15],C}if(p){let C;return e[16]!==p?(C=h.jsx(Zs,{error:p}),e[16]=p,e[17]=C):C=e[17],C}if(l){let C,$,N,H,Y,Z;return e[18]===Symbol.for("react.memo_cache_sentinel")?(C=()=>c(null),e[18]=C):C=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?($=h.jsx(Ae,{onClick:C,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:h.jsx(jt,{size:16})}),e[19]=$):$=e[19],e[20]!==l.name?(N=h.jsxs("div",{className:"flex items-center pl-1 pr-3 flex-shrink-0 border-b justify-between",children:[$,h.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=N):N=e[21],e[22]!==l.path||e[23]!==r?(H=q=>F2(q,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=H):H=e[24],e[25]!==l||e[26]!==H?(Y=h.jsx(A.Suspense,{children:h.jsx(MD,{onOpenNotebook:H,file:l})}),e[25]=l,e[26]=H,e[27]=Y):Y=e[27],e[28]!==N||e[29]!==Y?(Z=h.jsxs(h.Fragment,{children:[N,Y]}),e[28]=N,e[29]=Y,e[30]=Z):Z=e[30],Z}let I;e[31]!==E||e[32]!==k||e[33]!==v||e[34]!==x||e[35]!==r?(I=h.jsx(VD,{onRefresh:x,onCreateFile:k,onCreateFolder:v,onCollapseAll:E,tree:r}),e[31]=E,e[32]=k,e[33]=v,e[34]=x,e[35]=r,e[36]=I):I=e[36];const T=n-33;let M,R,B,O,z,F,V,L;return e[37]!==r?(M=async C=>{const{ids:$}=C;for(const N of $)await r.delete(N)},R=async C=>{const{id:$,name:N}=C;await r.rename($,N)},B=async C=>{const{dragIds:$,parentId:N}=C;await r.move($,N)},e[37]=r,e[38]=M,e[39]=R,e[40]=B):(M=e[38],R=e[39],B=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(O=C=>{const $=C[0];$&&($.data.isDirectory||c($.data))},e[41]=O):O=e[41],e[42]!==u||e[43]!==f||e[44]!==r?(z=async C=>{if(await r.expand(C)){const $=u[C]??!1;f({...u,[C]:!$})}},e[42]=u,e[43]=f,e[44]=r,e[45]=z):z=e[45],e[46]!==i||e[47]!==u||e[48]!==M||e[49]!==R||e[50]!==B||e[51]!==z||e[52]!==T?(F=h.jsx(k$,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:u,openByDefault:!1,renderCursor:GD,disableDrop:YD,onDelete:M,onRename:R,onMove:B,onSelect:O,onToggle:z,padding:15,rowHeight:30,indent:UD,overscanCount:1e3,disableMultiSelection:!0,children:WD}),e[46]=i,e[47]=u,e[48]=M,e[49]=R,e[50]=B,e[51]=z,e[52]=T,e[53]=F):F=e[53],e[54]!==F||e[55]!==r?(V=h.jsx(L2.Provider,{value:r,children:F}),e[54]=F,e[55]=r,e[56]=V):V=e[56],e[57]!==V||e[58]!==I?(L=h.jsxs(h.Fragment,{children:[I,V]}),e[57]=V,e[58]=I,e[59]=L):L=e[59],L},UD=15,VD=t=>{const e=X.c(30),{onRefresh:n,onCreateFile:o,onCreateFolder:r,onCollapseAll:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={noDrag:!0,noDragEventsBubbling:!0},e[0]=i):i=e[0];const{getRootProps:a,getInputProps:l}=P2(i);let c,d,u,f,m,_,g,p,b,x,y,v,S,k,j;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(Ca,{size:16}),e[1]=c):c=e[1],e[2]!==o?(d=h.jsx(Oe,{content:"Add file",children:h.jsx(Ae,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:c})}),e[2]=o,e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(Xc,{size:16}),e[4]=u):u=e[4],e[5]!==r?(f=h.jsx(Oe,{content:"Add folder",children:h.jsx(Ae,{"data-testid":"file-explorer-add-folder-button",onClick:r,variant:"text",size:"xs",children:u})}),e[5]=r,e[6]=f):f=e[6],e[7]!==a?(m=a({}),e[7]=a,e[8]=m):m=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(_=kV({variant:"text",size:"xs"}),g=h.jsx(SV,{size:16}),e[9]=_,e[10]=g):(_=e[9],g=e[10]),e[11]!==m?(p=h.jsx(Oe,{content:"Upload file",children:h.jsx("button",{"data-testid":"file-explorer-upload-button",...m,className:_,children:g})}),e[11]=m,e[12]=p):p=e[12],e[13]!==l?(b=l({}),e[13]=l,e[14]=b):b=e[14],e[15]!==b?(x=h.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=x):x=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(R4,{size:16}),e[17]=y):y=e[17],e[18]!==n?(v=h.jsx(Oe,{content:"Refresh",children:h.jsx(Ae,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:y})}),e[18]=n,e[19]=v):v=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(S=h.jsx(_p,{size:16}),e[20]=S):S=e[20],e[21]!==s?(k=h.jsx(Oe,{content:"Collapse all folders",children:h.jsx(Ae,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:S})}),e[21]=s,e[22]=k):k=e[22],e[23]!==x||e[24]!==v||e[25]!==k||e[26]!==d||e[27]!==f||e[28]!==p?(j=h.jsxs("div",{className:"flex items-center justify-end px-2 flex-shrink-0 border-b",children:[d,f,p,x,v,k]}),e[23]=x,e[24]=v,e[25]=k,e[26]=d,e[27]=f,e[28]=p,e[29]=j):j=e[29],j},$D=t=>{const e=X.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,i;return e[0]!==n?(r=a=>{n.data.isDirectory||(a.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!Jn()&&h.jsxs("span",{className:"flex-shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",h.jsx(bc,{className:"inline ml-1",size:12})]}),e[2]=n.data.isMarimoFile,e[3]=o,e[4]=s):s=e[4],e[5]!==n.data.name||e[6]!==r||e[7]!==s?(i=h.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:r,children:[n.data.name,s]}),e[5]=n.data.name,e[6]=r,e[7]=s,e[8]=i):i=e[8],i},HD=t=>{const e=X.c(10),{node:n}=t,o=A.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var c,d;(c=o.current)==null||c.focus(),(d=o.current)==null||d.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),A.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=c=>{c.key==="Escape"&&n.reset(),c.key==="Enter"&&n.submit(c.currentTarget.value)},e[3]=n,e[4]=i,e[5]=a):(i=e[4],a=e[5]),e[6]!==n.data.name||e[7]!==i||e[8]!==a?(l=h.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:JD,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},WD=t=>{const e=X.c(53),{node:n,style:o,dragHandle:r}=t;let s;e[0]!==n.data.isDirectory||e[1]!==n.data.name?(s=n.data.isDirectory?"directory":r4(n.data.name),e[0]=n.data.isDirectory,e[1]=n.data.name,e[2]=s):s=e[2];const i=s,a=s4[i],{openConfirm:l,openPrompt:c}=Un(),d=A.useContext(L2);let u;e[3]!==n.data.path||e[4]!==d?(u=async F=>{F2(F,d?d.relativeFromRoot(n.data.path):n.data.path)},e[3]=n.data.path,e[4]=d,e[5]=u):u=e[5];const f=u;let m;e[6]!==n.data.name||e[7]!==n.id||e[8]!==n.tree||e[9]!==l?(m=async F=>{F.stopPropagation(),F.preventDefault(),l({title:"Delete file",description:`Are you sure you want to delete ${n.data.name}?`,confirmAction:h.jsx(W3,{onClick:async()=>{await n.tree.delete(n.id)},"aria-label":"Confirm",children:"Delete"})})},e[6]=n.data.name,e[7]=n.id,e[8]=n.tree,e[9]=l,e[10]=m):m=e[10];const _=m;let g;e[11]!==n||e[12]!==c||e[13]!==d?(g=async()=>{n.open(),c({title:"Folder name",onConfirm:async F=>{d==null||d.createFolder(F,n.id)}})},e[11]=n,e[12]=c,e[13]=d,e[14]=g):g=e[14];const p=Qe(g);let b;e[15]!==n||e[16]!==c||e[17]!==d?(b=async()=>{n.open(),c({title:"File name",onConfirm:async F=>{d==null||d.createFile(F,n.id)}})},e[15]=n,e[16]=c,e[17]=d,e[18]=b):b=e[18];const x=Qe(b);let y;e[19]!==i||e[20]!==x||e[21]!==p||e[22]!==_||e[23]!==f||e[24]!==n||e[25]!==d?(y=()=>{const F={size:14,strokeWidth:1.5,className:"mr-2"};return h.jsxs(mc,{align:"end",className:"no-print w-[220px]",onClick:KD,onCloseAutoFocus:XD,children:[!n.data.isDirectory&&h.jsxs(sn,{onSelect:()=>n.select(),children:[h.jsx(Qp,{...F}),"Open file"]}),!n.data.isDirectory&&!Jn()&&h.jsxs(sn,{onSelect:()=>{CV({path:n.data.path})},children:[h.jsx(bc,{...F}),"Open file in external editor"]}),n.data.isDirectory&&h.jsxs(h.Fragment,{children:[h.jsxs(sn,{onSelect:()=>x(),children:[h.jsx(Ca,{...F}),"Create file"]}),h.jsxs(sn,{onSelect:()=>p(),children:[h.jsx(Xc,{...F}),"Create folder"]}),h.jsx(Fo,{})]}),h.jsxs(sn,{onSelect:()=>n.edit(),children:[h.jsx(zp,{...F}),"Rename"]}),h.jsxs(sn,{onSelect:async()=>{await xn(n.data.path),lt({title:"Copied to clipboard"})},children:[h.jsx(Ls,{...F}),"Copy path"]}),d&&h.jsxs(sn,{onSelect:async()=>{await xn(d.relativeFromRoot(n.data.path)),lt({title:"Copied to clipboard"})},children:[h.jsx(Ls,{...F}),"Copy relative path"]}),h.jsxs(sn,{onSelect:async()=>{lt({title:"Copied to clipboard",description:"Code to open the file has been copied to your clipboard. You can also drag and drop this file into the editor"});const{path:V}=n.data,L=jV[i](V);await xn(L)},children:[h.jsx(NV,{...F}),"Copy snippet for reading file"]}),n.data.isMarimoFile&&!Jn()&&h.jsxs(h.Fragment,{children:[h.jsx(Fo,{}),h.jsxs(sn,{onSelect:f,children:[h.jsx(Yp,{...F}),"Open notebook"]})]}),h.jsx(Fo,{}),!n.data.isDirectory&&h.jsxs(h.Fragment,{children:[h.jsxs(sn,{onSelect:async()=>{const V=(await K4({path:n.data.path})).contents||"";sa(new Blob([V]),n.data.name)},children:[h.jsx(Cm,{...F}),"Download"]}),h.jsx(Fo,{})]}),h.jsxs(sn,{onSelect:_,variant:"danger",children:[h.jsx(mm,{...F}),"Delete"]})]})},e[19]=i,e[20]=x,e[21]=p,e[22]=_,e[23]=f,e[24]=n,e[25]=d,e[26]=y):y=e[26];const v=y;let S,k,j;e[27]===Symbol.for("react.memo_cache_sentinel")?(S=Me("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),e[27]=S):S=e[27],e[28]!==n?(k=F=>{F.stopPropagation(),n.data.isDirectory&&n.toggle()},j=h.jsx(qD,{node:n}),e[28]=n,e[29]=k,e[30]=j):(k=e[29],j=e[30]);const E=n.willReceiveDrop&&n.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground";let I,T,M,R,B,O,z;return e[31]!==E?(I=Me("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",E),e[31]=E,e[32]=I):I=e[32],e[33]!==a||e[34]!==n.data.isMarimoFile?(T=n.data.isMarimoFile?h.jsx("img",{src:"./favicon.ico",className:"w-5 h-5 flex-shrink-0 mr-2 filter grayscale",alt:"Marimo"}):h.jsx(a,{className:"w-5 h-5 flex-shrink-0 mr-2",strokeWidth:1.5}),e[33]=a,e[34]=n.data.isMarimoFile,e[35]=T):T=e[35],e[36]!==f||e[37]!==n?(M=n.isEditing?h.jsx(HD,{node:n}):h.jsx($D,{node:n,onOpenMarimoFile:f}),e[36]=f,e[37]=n,e[38]=M):M=e[38],e[39]===Symbol.for("react.memo_cache_sentinel")?(R=h.jsx(fc,{asChild:!0,tabIndex:-1,onClick:ZD,children:h.jsx(Ae,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:h.jsx(Kc,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),e[39]=R):R=e[39],e[40]!==v?(B=h.jsxs(hc,{modal:!1,children:[R,v()]}),e[40]=v,e[41]=B):B=e[41],e[42]!==I||e[43]!==T||e[44]!==M||e[45]!==B?(O=h.jsxs("span",{className:I,children:[T,M,B]}),e[42]=I,e[43]=T,e[44]=M,e[45]=B,e[46]=O):O=e[46],e[47]!==r||e[48]!==o||e[49]!==O||e[50]!==k||e[51]!==j?(z=h.jsxs("div",{style:o,ref:r,className:S,draggable:!0,onClick:k,children:[j,O]}),e[47]=r,e[48]=o,e[49]=O,e[50]=k,e[51]=j,e[52]=z):z=e[52],z},qD=t=>{const e=X.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx("span",{className:"w-5 h-5 flex-shrink-0"}),e[0]=r):r=e[0],r}let o;return e[1]!==n.isOpen?(o=n.isOpen?h.jsx(ea,{className:"w-5 h-5 flex-shrink-0"}):h.jsx(ta,{className:"w-5 h-5 flex-shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function F2(t,e){t.stopPropagation(),t.preventDefault(),window.open(`/?file=${e}`,"_blank")}function GD(){return null}function YD(t){const{parentNode:e}=t;return!e.data.isDirectory}function JD(t){return t.stopPropagation()}function KD(t){return t.stopPropagation()}function XD(t){return t.preventDefault()}function ZD(t){return t.stopPropagation()}const QD=()=>{const t=X.c(20),{ref:e,height:n}=cp(),o=n===void 0?1:n;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={noClick:!0,noKeyboard:!0},t[0]=r):r=t[0];const{getRootProps:s,getInputProps:i,isDragActive:a}=P2(r);let l,c,d,u,f,m,_,g;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=Me("flex flex-col flex-1 overflow-hidden relative"),t[3]=c):c=t[3],t[4]!==i?(d=i(),t[4]=i,t[5]=d):d=t[5],t[6]!==d?(u=h.jsx("input",{...d}),t[6]=d,t[7]=u):u=t[7],t[8]!==a?(f=a&&h.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=a,t[9]=f):f=t[9],t[10]!==o?(m=h.jsx(BD,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(_=h.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:m}),t[12]=e,t[13]=m,t[14]=_):_=t[14],t[15]!==l||t[16]!==u||t[17]!==f||t[18]!==_?(g=h.jsxs("div",{...l,className:c,children:[u,f,_]}),t[15]=l,t[16]=u,t[17]=f,t[18]=_,t[19]=g):g=t[19],g},eR=t=>{const e=X.c(6),{children:n}=t,{openModal:o,closeModal:r}=Un();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(h.jsx(nR,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=h.jsx(H4,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},tR=[st.lineWrapping],nR=t=>{const e=X.c(23),{onClose:n}=t,[o,r]=A.useState(""),{theme:s}=po();let i,a,l,c,d,u;e[0]!==n?(i=async y=>{y.preventDefault();const v=new FormData(y.target),S=v.get("title"),k=v.get("description"),j=v.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S,description:k,code:j})}),n(),lt({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(dr,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsxs(Os,{children:[a,h.jsxs(Ps,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",h.jsx("a",{href:Kn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(ur,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),d=h.jsx(EV,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=c,e[5]=d):(c=e[4],d=e[5]),e[6]!==o?(u=h.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=u):u=e[7];const f=s==="dark"?"dark":"light";let m,_,g,p,b,x;return e[8]!==o||e[9]!==f?(m=h.jsx(ba,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:tR,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==u||e[12]!==m?(_=h.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[c,d,u,m]}),e[11]=u,e[12]=m,e[13]=_):_=e[13],e[14]!==n?(g=h.jsx(Ae,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=g):g=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(Ae,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=p):p=e[16],e[17]!==g?(b=h.jsxs(oa,{children:[g,p]}),e[17]=g,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==_?(x=h.jsx(cr,{className:"w-fit",children:h.jsxs("form",{onSubmit:i,children:[l,_,b]})}),e[19]=i,e[20]=b,e[21]=_,e[22]=x):x=e[22],x},oR=[st.lineWrapping],rR=()=>{const t=X.c(20),[e,n]=K.useState();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,error:s,loading:i}=Xn(aR,o);if(s){let b;return t[1]!==s?(b=h.jsx(Zs,{error:s}),t[1]=s,t[2]=b):b=t[2],b}if(i||!r){let b;return t[3]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(eo,{size:"medium",centered:!0}),t[3]=b):b=t[3],b}const a=e?"h-1/3":"h-full";let l,c,d,u,f,m,_,g,p;return t[4]!==a?(l=Me("border-b rounded-none",a),t[4]=a,t[5]=l):l=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(na,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[6]=c):c=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsxs("div",{className:"flex items-center w-full",children:[c,h.jsx(eR,{children:h.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:h.jsx(Or,{className:"h-4 w-4"})})})]}),u=h.jsx(dc,{children:"No results"}),t[7]=d,t[8]=u):(d=t[7],u=t[8]),t[9]===Symbol.for("react.memo_cache_sentinel")?(f=b=>n(b),t[9]=f):f=t[9],t[10]!==r.snippets?(m=h.jsx(iR,{onSelect:f,snippets:r.snippets}),t[10]=r.snippets,t[11]=m):m=t[11],t[12]!==l||t[13]!==m?(_=h.jsxs(xc,{className:l,children:[d,u,m]}),t[12]=l,t[13]=m,t[14]=_):_=t[14],t[15]!==e?(g=h.jsx(A.Suspense,{children:h.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:e?h.jsx(sR,{snippet:e},e.title):h.jsx(An,{title:"",description:"Click on a snippet to view its content."})})}),t[15]=e,t[16]=g):g=t[16],t[17]!==_||t[18]!==g?(p=h.jsxs("div",{className:"flex-1 overflow-hidden",children:[_,g]}),t[17]=_,t[18]=g,t[19]=p):p=t[19],p},sR=t=>{const e=X.c(27),{snippet:n}=t,{theme:o}=po(),{createNewCell:r}=Lt(),s=zs();let i;e[0]!==r||e[1]!==s||e[2]!==n.sections?(i=()=>{for(const p of[...n.sections].reverse())p.code&&r({code:p.code,before:!1,cellId:s??"__end__",skipIfCodeExists:!0})},e[0]=r,e[1]=s,e[2]=n.sections,e[3]=i):i=e[3];const a=i;let l;e[4]!==r||e[5]!==s?(l=p=>{r({code:p,before:!1,cellId:s??"__end__"})},e[4]=r,e[5]=s,e[6]=l):l=e[6];const c=l;let d,u,f,m,_,g;if(e[7]!==n.title?(d=h.jsx("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1",children:n.title}),e[7]=n.title,e[8]=d):d=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(ni,{className:"ml-2 h-4 w-4"}),e[9]=u):u=e[9],e[10]!==a?(f=h.jsx("div",{className:"flex justify-end",children:h.jsx(ii,{children:h.jsxs(Ae,{className:"float-right",size:"xs",variant:"outline",onClick:a,children:["Insert snippet",u]})})}),e[10]=a,e[11]=f):f=e[11],e[12]!==c||e[13]!==n.sections||e[14]!==n.title||e[15]!==o){let p;e[17]!==c||e[18]!==n.title||e[19]!==o?(p=b=>{const{code:x,html:y,id:v}=b;return y?h.jsx("div",{children:qm({html:y})},`${n.title}-${v}`):x?h.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[h.jsx(ii,{children:h.jsx(Oe,{content:"Insert snippet",children:h.jsx(Ae,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{c(x)},children:h.jsx(ni,{className:"h-5 w-5"})})})}),h.jsx(ba,{theme:o==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:oR,value:x,readOnly:!0},`${n.title}-${v}`)]},`${n.title}-${v}`):null},e[17]=c,e[18]=n.title,e[19]=o,e[20]=p):p=e[20],m=n.sections.map(p),e[12]=c,e[13]=n.sections,e[14]=n.title,e[15]=o,e[16]=m}else m=e[16];return e[21]!==f||e[22]!==m?(_=h.jsxs("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[f,m]}),e[21]=f,e[22]=m,e[23]=_):_=e[23],e[24]!==d||e[25]!==_?(g=h.jsxs(h.Fragment,{children:[d,_]}),e[24]=d,e[25]=_,e[26]=g):g=e[26],g},iR=t=>{const e=X.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>h.jsx(go,{className:"rounded-none",onSelect:()=>o(a),children:h.jsx("div",{className:"flex flex-row gap-2 items-center",children:h.jsx("span",{className:"mt-1 text-accent-foreground",children:a.title})})},a.title),e[3]=o,e[4]=i):i=e[4],r=n.map(i),e[0]=o,e[1]=n,e[2]=r}else r=e[2];return e[5]!==r?(s=h.jsx(Fm,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s};function aR(){return IV()}const lR=t=>{const e=X.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(d){const u=dt.get(hm)[d];if(u)return u.declaredBy[0]}(n);if(!l)return;const c=sc(l);c&&Jm(c,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=Me("text-link opacity-80 hover:opacity-100 hover:underline",o),e[2]=o,e[3]=i):i=e[3],e[4]!==s||e[5]!==i||e[6]!==n?(a=h.jsx("button",{type:"button",onClick:s,className:i,children:n}),e[4]=s,e[5]=i,e[6]=n,e[7]=a):a=e[7],a},z2=t=>{const e=X.c(4),{isExpanded:n}=t,o=n&&"rotate-90";let r,s;return e[0]!==o?(r=Me("h-3 w-3 transition-transform",o),e[0]=o,e[1]=r):r=e[1],e[2]!==r?(s=h.jsx(ta,{className:r}),e[2]=r,e[3]=s):s=e[3],s},B2=t=>{const e=X.c(2),{children:n}=t;let o;return e[0]!==n?(o=h.jsx("div",{className:"flex gap-1.5 items-center font-bold px-2 py-1.5 text-muted-foreground bg-[var(--slate-2)] text-sm",children:n}),e[0]=n,e[1]=o):o=e[1],o},hf=t=>{const e=X.c(5),{content:n,className:o}=t;let r,s;return e[0]!==o?(r=Me("text-sm text-muted-foreground py-1",o),e[0]=o,e[1]=r):r=e[1],e[2]!==n||e[3]!==r?(s=h.jsx("div",{className:r,children:n}),e[2]=n,e[3]=r,e[4]=s):s=e[4],s},U2=t=>{const e=X.c(3),{error:n}=t;let o,r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(Qn,{className:"h-4 w-4"}),e[0]=o):o=e[0],e[1]!==n.message?(r=h.jsxs("div",{className:"pl-12 text-sm bg-red-50 dark:bg-red-900 text-red-600 dark:text-red-50 flex items-center gap-2 p-2 h-8",children:[o,n.message]}),e[1]=n.message,e[2]=r):r=e[2],r},V2=t=>{const e=X.c(3),{message:n}=t;let o,r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(Pc,{className:"h-4 w-4 animate-spin"}),e[0]=o):o=e[0],e[1]!==n?(r=h.jsxs("div",{className:"pl-12 text-sm bg-blue-50 dark:bg-[var(--accent)] text-blue-500 dark:text-blue-50 flex items-center gap-2 p-2 h-8",children:[o,n]}),e[1]=n,e[2]=r):r=e[2],r},ff=Ut(null),cR=t=>{const e=X.c(9),{packages:n}=t,o=Bs(),r=Gt(ff);if(!n||n.length===0)return null;let s;e[0]!==o||e[1]!==n||e[2]!==r?(s=()=>{const c=n.join(", ");r(c),o.toggleApplication("packages")},e[0]=o,e[1]=n,e[2]=r,e[3]=s):s=e[3];const i=s;let a,l;return e[4]!==n?(a=n.join(", "),e[4]=n,e[5]=a):a=e[5],e[6]!==i||e[7]!==a?(l=h.jsxs(Ae,{variant:"outline",size:"xs",onClick:i,className:"ml-2",children:["Install ",a]}),e[6]=i,e[7]=a,e[8]=l):l=e[8],l},dR=Ut(t=>{const e=t(AV),n=t(hm),o=t(U4);return wa(e,r=>{if(!r.variable_name)return-1;const s=Object.values(n).find(a=>a.name===r.variable_name);if(!s)return 0;const i=o.inOrderIds.indexOf(s.declaredBy[0]);return i===-1?0:i})}),uR=Ut(t=>{const e=new Map(t(TV));for(const n of Z4){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return wa([...e.values()],n=>Z4.has(n.name)?1:0)}),hR=()=>{const t=X.c(32),[e,n]=K.useState(""),o=Gt(Q4),r=$e(dR),s=$e(uR);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(An,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:h.jsx(Dg,{children:h.jsxs(Ae,{variant:"outline",size:"sm",children:["Add database or catalog",h.jsx(Or,{className:"h-4 w-4 ml-2"})]})}),icon:h.jsx(lr,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,c,d,u,f,m,_,g,p;if(t[1]!==o?(a=b=>{o(b.length>0),n(b)},t[1]=o,t[2]=a):a=t[2],t[3]!==e||t[4]!==a?(l=h.jsx(na,{placeholder:"Search tables...",className:"h-6 m-1",value:e,onValueChange:a,rootClassName:"flex-1 border-r"}),t[3]=e,t[4]=a,t[5]=l):l=t[5],t[6]!==i?(c=i&&h.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:()=>n(""),children:h.jsx(Qn,{className:"h-4 w-4"})}),t[6]=i,t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(Dg,{children:h.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:h.jsx(Or,{className:"h-4 w-4"})})}),t[8]=d):d=t[8],t[9]!==l||t[10]!==c?(u=h.jsxs("div",{className:"flex items-center w-full",children:[l,c,d]}),t[9]=l,t[10]=c,t[11]=u):u=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=x=>h.jsx(fR,{connection:x,hasChildren:x.databases.length>0,children:x.databases.map(y=>h.jsx(mR,{engineName:x.name,database:y,hasSearch:i,children:h.jsx(pR,{schemas:y.schemas,defaultSchema:x.default_schema,defaultDatabase:x.default_database,engineName:x.name,databaseName:y.name,hasSearch:i,searchValue:e})},y.name))},x.name),t[16]=i,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=i,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(m=s.length>0&&r.length>0&&h.jsxs(B2,{children:[h.jsx(lc,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=m):m=t[21],t[22]!==e||t[23]!==r?(_=r.length>0&&h.jsx($2,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=_):_=t[24],t[25]!==f||t[26]!==m||t[27]!==_?(g=h.jsxs(Fm,{className:"flex flex-col",children:[f,m,_]}),t[25]=f,t[26]=m,t[27]=_,t[28]=g):g=t[28],t[29]!==u||t[30]!==g?(p=h.jsxs(xc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-none",shouldFilter:!1,children:[u,g]}),t[29]=u,t[30]=g,t[31]=p):p=t[31],p},fR=t=>{const e=X.c(25),{connection:n,children:o,hasChildren:r}=t,s=n.name===MV,i=s?"In-Memory":n.name,[a,l]=K.useState(!1);let c;e[0]!==n.name?(c=async()=>{l(!0),await DV({engine:n.name}),setTimeout(()=>l(!1),500)},e[0]=n.name,e[1]=c):c=e[1];const d=c;let u,f,m;e[2]!==n.dialect?(u=h.jsx(Q3,{className:"h-4 w-4 text-muted-foreground",name:n.dialect}),e[2]=n.dialect,e[3]=u):u=e[3],e[4]!==n.dialect?(f=OV(n.dialect),e[4]=n.dialect,e[5]=f):f=e[5],e[6]!==f?(m=h.jsx("span",{className:"text-xs",children:f}),e[6]=f,e[7]=m):m=e[7];const _=i;let g,p,b,x,y;return e[8]!==_?(g=h.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",h.jsx(lR,{variableName:_}),")"]}),e[8]=_,e[9]=g):g=e[9],e[10]!==d||e[11]!==s||e[12]!==a?(p=!s&&h.jsx(Oe,{content:"Refresh connection",children:h.jsx(Ae,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:d,children:h.jsx(Ac,{className:Me("h-4 w-4 text-muted-foreground hover:text-foreground",a&&"animate-[spin_0.5s]")})})}),e[10]=d,e[11]=s,e[12]=a,e[13]=p):p=e[13],e[14]!==u||e[15]!==m||e[16]!==g||e[17]!==p?(b=h.jsxs(B2,{children:[u,m,g,p]}),e[14]=u,e[15]=m,e[16]=g,e[17]=p,e[18]=b):b=e[18],e[19]!==o||e[20]!==r?(x=r?o:h.jsx(hf,{content:"No databases available",className:"pl-2"}),e[19]=o,e[20]=r,e[21]=x):x=e[21],e[22]!==b||e[23]!==x?(y=h.jsxs(h.Fragment,{children:[b,x]}),e[22]=b,e[23]=x,e[24]=y):y=e[24],y},mR=t=>{const e=X.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=K.useState(!1),[l,c]=K.useState(!1);let d,u,f;e[0]!==n?(d=()=>{a(n)},u=[n],e[0]=n,e[1]=d,e[2]=u):(d=e[1],u=e[2]),K.useEffect(d,u),e[3]!==i||e[4]!==l?(f=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let _;e[6]!==i?(_=h.jsx(z2,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i?"text-foreground":"text-muted-foreground";let p,b;e[8]!==g?(p=Me("h-4 w-4",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=h.jsx(lr,{className:p}),e[10]=p,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,S,k;e[12]!==x?(y=Me(x),e[12]=x,e[13]=y):y=e[13],e[14]!==r.name?(v=r.name===""?h.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=v):v=e[15],e[16]!==y||e[17]!==v?(S=h.jsx("span",{className:y,children:v}),e[16]=y,e[17]=v,e[18]=S):S=e[18],e[19]!==S||e[20]!==f||e[21]!==m||e[22]!==_||e[23]!==b?(k=h.jsxs(go,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[_,b,S]}),e[19]=S,e[20]=f,e[21]=m,e[22]=_,e[23]=b,e[24]=k):k=e[24];const j=i&&s;let E;return e[25]!==k||e[26]!==j?(E=h.jsxs(h.Fragment,{children:[k,j]}),e[25]=k,e[26]=j,e[27]=E):E=e[27],E},pR=t=>{const e=X.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:i,hasSearch:a,searchValue:l}=t;if(n.length===0){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(hf,{content:"No schemas available",className:"pl-6"}),e[0]=u):u=e[0],u}let c,d;if(e[1]!==i||e[2]!==r||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==n||e[7]!==l){let u;e[9]!==l?(u=_=>!l||_.tables.some(g=>g.name.toLowerCase().includes(l.toLowerCase())),e[9]=l,e[10]=u):u=e[10];const f=n.filter(u);let m;e[11]!==i||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==a||e[16]!==l?(m=_=>h.jsx(gR,{databaseName:i,schema:_,hasSearch:a,children:h.jsx($2,{tables:_.tables,searchValue:l,sqlTableContext:{engine:s,database:i,schema:_.name,defaultSchema:o,defaultDatabase:r}})},_.name),e[11]=i,e[12]=r,e[13]=o,e[14]=s,e[15]=a,e[16]=l,e[17]=m):m=e[17],c=f.map(m),e[1]=i,e[2]=r,e[3]=o,e[4]=s,e[5]=a,e[6]=n,e[7]=l,e[8]=c}else c=e[8];return e[18]!==c?(d=h.jsx(h.Fragment,{children:c}),e[18]=c,e[19]=d):d=e[19],d},gR=t=>{const e=X.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=K.useState(!1),[l,c]=K.useState(!1),d=`${n}:${o.name}`;let u,f,m,_;if(e[0]!==s?(u=()=>{a(s)},f=[s],e[0]=s,e[1]=u,e[2]=f):(u=e[1],f=e[2]),K.useEffect(u,f),tS(o.name))return r;e[3]!==i||e[4]!==l?(m=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=m):m=e[5],e[6]!==i?(_=h.jsx(z2,{isExpanded:i}),e[6]=i,e[7]=_):_=e[7];const g=l&&i&&"text-foreground";let p,b;e[8]!==g?(p=Me("h-4 w-4 text-muted-foreground",g),e[8]=g,e[9]=p):p=e[9],e[10]!==p?(b=h.jsx(BV,{className:p}),e[10]=p,e[11]=b):b=e[11];const x=l&&i&&"font-semibold";let y,v,S;e[12]!==x?(y=Me(x),e[12]=x,e[13]=y):y=e[13],e[14]!==o.name||e[15]!==y?(v=h.jsx("span",{className:y,children:o.name}),e[14]=o.name,e[15]=y,e[16]=v):v=e[16],e[17]!==v||e[18]!==m||e[19]!==_||e[20]!==b||e[21]!==d?(S=h.jsxs(go,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:d,children:[_,b,v]}),e[17]=v,e[18]=m,e[19]=_,e[20]=b,e[21]=d,e[22]=S):S=e[22];const k=i&&r;let j;return e[23]!==S||e[24]!==k?(j=h.jsxs(h.Fragment,{children:[S,k]}),e[23]=S,e[24]=k,e[25]=j):j=e[25],j},$2=t=>{const e=X.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=eS(),[i,a]=K.useState(!1),[l,c]=K.useState(!1);let d,u;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==i?(d=async()=>{if(n.length===0&&o&&!i){a(!0),c(!0);const{engine:p,database:b,schema:x}=o,y=await W$.request({engine:p,database:b,schema:x});if(!(y!=null&&y.tables))throw c(!1),new Error("No tables available");s({tables:y.tables,sqlTableContext:o}),c(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=i,e[4]=d):d=e[4],e[5]!==o||e[6]!==n.length||e[7]!==i?(u=[n.length,o,i],e[5]=o,e[6]=n.length,e[7]=i,e[8]=u):u=e[8];const{loading:f,error:m}=Xn(d,u);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(V2,{message:"Loading tables..."}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=h.jsx(U2,{error:m}),e[10]=m,e[11]=p):p=e[11],p}if(n.length===0){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(hf,{content:"No tables found",className:"pl-9"}),e[12]=p):p=e[12],p}let _,g;if(e[13]!==r||e[14]!==o||e[15]!==n){let p;e[17]!==r?(p=y=>!r||y.name.toLowerCase().includes(r.toLowerCase()),e[17]=r,e[18]=p):p=e[18];const b=n.filter(p);let x;e[19]!==r||e[20]!==o?(x=y=>h.jsx(_R,{table:y,sqlTableContext:o,isSearching:!!r},y.name),e[19]=r,e[20]=o,e[21]=x):x=e[21],_=b.map(x),e[13]=r,e[14]=o,e[15]=n,e[16]=_}else _=e[16];return e[22]!==_?(g=h.jsx(h.Fragment,{children:_}),e[22]=_,e[23]=g):g=e[23],g},_R=t=>{const e=X.c(62),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=eS(),[i,a]=K.useState(!1),[l,c]=K.useState(!1),d=n.columns.length>0;let u,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==d||e[5]!==l?(u=async()=>{if(i&&!d&&o&&!l){c(!0);const{engine:q,database:re,schema:ne}=o,oe=await q$.request({engine:q,database:re,schema:ne,tableName:n.name});if(!(oe!=null&&oe.table))throw new Error("No table details available");s({table:oe.table,sqlTableContext:o})}},e[0]=s,e[1]=i,e[2]=o,e[3]=n.name,e[4]=d,e[5]=l,e[6]=u):u=e[6],e[7]!==i||e[8]!==d?(f=[i,d],e[7]=i,e[8]=d,e[9]=f):f=e[9];const{loading:m,error:_}=Xn(u,f),g=$e(Ts),p=zs(),{createNewCell:b}=Lt();let x;e[10]!==g||e[11]!==b||e[12]!==p||e[13]!==o||e[14]!==n?(x=()=>{Ho(g,b,p),b({code:(()=>{if(n.source_type==="catalog"){const q=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${q}")`}if(o)return Vc(n,"*",o);switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return Vc(n,"*",o);default:return oc(n.source_type),""}})(),before:!1,cellId:p??"__end__"})},e[10]=g,e[11]=b,e[12]=p,e[13]=o,e[14]=n,e[15]=x):x=e[15];const y=x;let v;e[16]!==n.num_columns||e[17]!==n.num_rows?(v=()=>{const q=[];return n.num_rows!=null&&q.push(`${n.num_rows} rows`),n.num_columns!=null&&q.push(`${n.num_columns} columns`),q.length===0?null:h.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:h.jsx("span",{className:"text-xs text-muted-foreground",children:q.join(", ")})})},e[16]=n.num_columns,e[17]=n.num_rows,e[18]=v):v=e[18];const S=v;let k;e[19]!==_||e[20]!==m||e[21]!==o||e[22]!==n?(k=()=>m?h.jsx(V2,{message:"Loading columns..."}):_?h.jsx(U2,{error:_}):n.columns.map(q=>h.jsx(bR,{table:n,column:q,sqlTableContext:o},q.name)),e[19]=_,e[20]=m,e[21]=o,e[22]=n,e[23]=k):k=e[23];const j=k;let E;e[24]!==i||e[25]!==r||e[26]!==n.source_type||e[27]!==n.type?(E=()=>{if(n.source_type==="local")return;const q=n.type==="table"?RV:F3;return h.jsx(q,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[24]=i,e[25]=r,e[26]=n.source_type,e[27]=n.type,e[28]=E):E=e[28];const I=E,T=o?`${o.database}.${o.schema}.${n.name}`:n.name,M=o&&(tS(o.schema)?"pl-9":"pl-12"),R=(i||r)&&"font-semibold";let B,O,z,F,V,L,C,$,N,H,Y,Z;return e[29]!==M||e[30]!==R?(B=Me("rounded-none group h-8 cursor-pointer",M,R),e[29]=M,e[30]=R,e[31]=B):B=e[31],e[32]!==i?(O=()=>a(!i),e[32]=i,e[33]=O):O=e[33],e[34]!==I?(z=I(),e[34]=I,e[35]=z):z=e[35],e[36]!==n.name?(F=h.jsx("span",{className:"text-sm",children:n.name}),e[36]=n.name,e[37]=F):F=e[37],e[38]!==z||e[39]!==F?(V=h.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[z,F]}),e[38]=z,e[39]=F,e[40]=V):V=e[40],e[41]!==S?(L=S(),e[41]=S,e[42]=L):L=e[42],e[43]!==y?(C=fn.stopPropagation(()=>y()),e[43]=y,e[44]=C):C=e[44],e[45]===Symbol.for("react.memo_cache_sentinel")?($=h.jsx(oi,{className:"h-3 w-3"}),e[45]=$):$=e[45],e[46]!==C?(N=h.jsx(Oe,{content:"Add table to notebook",delayDuration:400,children:h.jsx(Ae,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:C,children:$})}),e[46]=C,e[47]=N):N=e[47],e[48]!==i||e[49]!==O||e[50]!==V||e[51]!==L||e[52]!==N||e[53]!==B||e[54]!==T?(H=h.jsxs(go,{className:B,value:T,"aria-selected":i,forceMount:!0,onSelect:O,children:[V,L,N]}),e[48]=i,e[49]=O,e[50]=V,e[51]=L,e[52]=N,e[53]=B,e[54]=T,e[55]=H):H=e[55],e[56]!==i||e[57]!==j?(Y=i&&j(),e[56]=i,e[57]=j,e[58]=Y):Y=e[58],e[59]!==H||e[60]!==Y?(Z=h.jsxs(h.Fragment,{children:[H,Y]}),e[59]=H,e[60]=Y,e[61]=Z):Z=e[61],Z},bR=t=>{var H,Y;const e=X.c(52),{table:n,column:o,sqlTableContext:r}=t,[s,i]=K.useState(!1),a=$e(Q4),l=Gt(PV);let c,d;e[0]!==a?(c=()=>{a&&i(!1)},d=[a],e[0]=a,e[1]=c,e[2]=d):(c=e[1],d=e[2]),K.useEffect(c,d),l(s?Z=>new Set([...Z,`${n.name}:${o.name}`]):Z=>(Z.delete(`${n.name}:${o.name}`),new Set(Z)));const u=LV[o.type],f=$e(Ts),m=zs(),{createNewCell:_}=Lt(),{columnsPreviews:g}=FV();let p;e[3]!==o.name||e[4]!==n.primary_keys?(p=((H=n.primary_keys)==null?void 0:H.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=p):p=e[5];const b=p;let x;e[6]!==o.name||e[7]!==n.indexes?(x=((Y=n.indexes)==null?void 0:Y.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=x):x=e[8];const y=x;let v;e[9]!==f||e[10]!==_||e[11]!==m?(v=Z=>{Z.includes("alt")&&function(q,re,ne){sg("altair","alt",oe=>{const G=L3.create();re({cellId:ne??"__end__",before:!1,code:oe,lastCodeRun:q?oe:void 0,newCellId:G,autoFocus:!1}),q&&dm({cellIds:[G],codes:[oe]})})}(f,_,m),_({code:Z,before:!1,cellId:m??"__end__"})},e[9]=f,e[10]=_,e[11]=m,e[12]=v):v=e[12];const S=v,k=wR,j=`${n.name}.${o.name}`,E=`${n.name}.${o.name}`;let I;e[13]!==s?(I=()=>i(!s),e[13]=s,e[14]=I):I=e[14];const T=r?"pl-14":"pl-7";let M,R,B,O,z,F,V,L,C,$,N;return e[15]!==T?(M=Me("flex flex-row gap-2 items-center flex-1",T),e[15]=T,e[16]=M):M=e[16],e[17]!==u?(R=h.jsx(u,{className:"flex-shrink-0 h-3 w-3",strokeWidth:1.5}),e[17]=u,e[18]=R):R=e[18],e[19]!==o.name?(B=h.jsx("span",{children:o.name}),e[19]=o.name,e[20]=B):B=e[20],e[21]!==b?(O=b&&k({tooltipContent:"Primary key",content:"PK"}),e[21]=b,e[22]=O):O=e[22],e[23]!==y?(z=y&&k({tooltipContent:"Indexed",content:"IDX"}),e[23]=y,e[24]=z):z=e[24],e[25]!==M||e[26]!==R||e[27]!==B||e[28]!==O||e[29]!==z?(F=h.jsxs("div",{className:M,children:[R,B,O,z]}),e[25]=M,e[26]=R,e[27]=B,e[28]=O,e[29]=z,e[30]=F):F=e[30],e[31]!==o.name?(V=h.jsx(Oe,{content:"Copy column name",delayDuration:400,children:h.jsx(Ae,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:h.jsx(ep,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[31]=o.name,e[32]=V):V=e[32],e[33]!==o.external_type?(L=h.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[33]=o.external_type,e[34]=L):L=e[34],e[35]!==F||e[36]!==V||e[37]!==L||e[38]!==j||e[39]!==E||e[40]!==I?(C=h.jsxs(go,{className:"rounded-none py-1 group cursor-pointer",value:E,onSelect:I,children:[F,V,L]},j),e[35]=F,e[36]=V,e[37]=L,e[38]=j,e[39]=E,e[40]=I,e[41]=C):C=e[41],e[42]!==o||e[43]!==g||e[44]!==S||e[45]!==s||e[46]!==r||e[47]!==n?($=s&&h.jsx("div",{className:"pl-10 pr-2 py-2 bg-[var(--slate-1)] shadow-inner border-b",children:h.jsx(wc,{children:h.jsx(xR,{table:n,column:o,onAddColumnChart:S,preview:g.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[42]=o,e[43]=g,e[44]=S,e[45]=s,e[46]=r,e[47]=n,e[48]=$):$=e[48],e[49]!==C||e[50]!==$?(N=h.jsxs(h.Fragment,{children:[C,$]}),e[49]=C,e[50]=$,e[51]=N):N=e[51],N},yR=K.lazy(()=>Lc(()=>import("./index-by9J7LvV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url).then(t=>({default:t.VegaLite}))),xR=t=>{const e=X.c(50),{table:n,column:o,preview:r,onAddColumnChart:s,sqlTableContext:i}=t,{theme:a}=po();let l,c;if(e[0]!==o||e[1]!==r||e[2]!==i||e[3]!==n.name||e[4]!==n.source||e[5]!==n.source_type?(l=()=>{r||UV({source:n.source,tableName:n.name,columnName:o.name,sourceType:n.source_type,fullyQualifiedTableName:i?`${i.database}.${i.schema}.${n.name}`:n.name})},e[0]=o,e[1]=r,e[2]=i,e[3]=n.name,e[4]=n.source,e[5]=n.source_type,e[6]=l):l=e[6],$4(l),n.source_type==="connection"){const j=o.name,E=o.external_type;let I,T,M,R;return e[7]!==o.name||e[8]!==s||e[9]!==i||e[10]!==n?(I=fn.stopPropagation(()=>{s(Vc(n,o.name,i))}),e[7]=o.name,e[8]=s,e[9]=i,e[10]=n,e[11]=I):I=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(T=h.jsx(oi,{className:"h-3 w-3 mr-1"}),e[12]=T):T=e[12],e[13]!==I?(M=h.jsxs(Ae,{variant:"outline",size:"xs",onClick:I,children:[T," Add SQL cell"]}),e[13]=I,e[14]=M):M=e[14],e[15]!==o.external_type||e[16]!==o.name||e[17]!==M?(R=h.jsxs("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[j," (",E,")",M]}),e[15]=o.external_type,e[16]=o.name,e[17]=M,e[18]=R):R=e[18],R}if(n.source_type==="catalog"){let j;return e[19]!==o.external_type||e[20]!==o.name?(j=h.jsxs("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[o.name," (",o.external_type,")"]}),e[19]=o.external_type,e[20]=o.name,e[21]=j):j=e[21],j}if(!r){let j;return e[22]===Symbol.for("react.memo_cache_sentinel")?(j=h.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading..."}),e[22]=j):j=e[22],j}e[23]!==r.error||e[24]!==r.missing_packages?(c=r.error&&h.jsxs("div",{className:"text-xs text-muted-foreground p-2 border border-muted rounded flex items-center",children:[h.jsx("span",{children:r.error}),r.missing_packages&&h.jsx(cR,{packages:r.missing_packages})]}),e[23]=r.error,e[24]=r.missing_packages,e[25]=c):c=e[25];const d=c;let u;e[26]!==r.stats?(u=r.stats&&h.jsx("div",{className:"gap-x-16 gap-y-1 grid grid-cols-2-fit border rounded p-2 empty:hidden",children:Object.entries(r.stats).map(vR)}),e[26]=r.stats,e[27]=u):u=e[27];const f=u,m=kR;let _;e[28]!==r.chart_spec||e[29]!==a?(_=r.chart_spec&&h.jsx(yR,{spec:m(JSON.parse(r.chart_spec)),width:"container",height:100,actions:!1,theme:a==="dark"?"dark":"vox"}),e[28]=r.chart_spec,e[29]=a,e[30]=_):_=e[30];const g=_;let p;e[31]!==s||e[32]!==r.chart_code||e[33]!==n.source_type?(p=r.chart_code&&n.source_type==="local"&&h.jsx(Oe,{content:"Add chart to notebook",delayDuration:400,children:h.jsx(Ae,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-1",onClick:fn.stopPropagation(()=>s(r.chart_code||"")),children:h.jsx(oi,{className:"h-3 w-3"})})}),e[31]=s,e[32]=r.chart_code,e[33]=n.source_type,e[34]=p):p=e[34];const b=p;let x;e[35]!==o||e[36]!==s||e[37]!==i||e[38]!==n?(x=n.source_type==="duckdb"&&h.jsx(Oe,{content:"Add SQL cell",delayDuration:400,children:h.jsx(Ae,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-1",onClick:fn.stopPropagation(()=>{s(Vc(n,o.name,i))}),children:h.jsx(oi,{className:"h-3 w-3"})})}),e[35]=o,e[36]=s,e[37]=i,e[38]=n,e[39]=x):x=e[39];const y=x;let v;e[40]!==r.chart_max_rows_errors?(v=r.chart_max_rows_errors&&h.jsx("span",{className:"text-xs text-muted-foreground",children:"Too many rows to render the chart."}),e[40]=r.chart_max_rows_errors,e[41]=v):v=e[41];const S=v;if(!(d||f||g||S)){let j;return e[42]===Symbol.for("react.memo_cache_sentinel")?(j=h.jsx("span",{className:"text-xs text-muted-foreground",children:"No data"}),e[42]=j):j=e[42],j}let k;return e[43]!==b||e[44]!==y||e[45]!==g||e[46]!==S||e[47]!==d||e[48]!==f?(k=h.jsxs("div",{className:"flex flex-col gap-2 relative",children:[d,b,y,S,g,f]}),e[43]=b,e[44]=y,e[45]=g,e[46]=S,e[47]=d,e[48]=f,e[49]=k):k=e[49],k};function wR(t){const{tooltipContent:e,content:n}=t;return h.jsx(Oe,{content:e,delayDuration:100,children:h.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}function vR(t){const[e,n]=t;return n==null?null:h.jsxs("div",{className:"flex items-center gap-1 group",children:[h.jsx(ep,{className:"h-3 w-3 invisible group-hover:visible",value:String(n)}),h.jsx("span",{className:"text-xs min-w-[60px] uppercase",children:e}),h.jsx("span",{className:"text-xs font-bold text-muted-foreground tracking-wide",children:zV(n)})]},e)}function kR(t){return{...t,config:{...t.config,background:"transparent"}}}const SR=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(hR,{}),t[0]=e):e=t[0],e},CR=t=>{const e=X.c(4),{isOpen:n,children:o}=t,[r,s]=K.useState(!1);let i,a;return e[0]!==r||e[1]!==n?(i=()=>{n&&!r&&s(!0)},a=[n,r],e[0]=r,e[1]=n,e[2]=i,e[3]=a):(i=e[2],a=e[3]),K.useEffect(i,a),r?o:null},mf=VV("marimo:scratchpadHistory:v1",[]),NR=Ut(!1),jR=Ut(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(mf),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(mf,r)}),ER={hide_code:!1,disabled:!1},IR=()=>{const t=X.c(69),e=vc(),[n]=Ds(),{theme:o}=po(),r=A.useRef(null),s=zs(),{createNewCell:i,updateCellCode:a}=Lt(),l=e.cellRuntime[pr],c=l==null?void 0:l.output,d=l==null?void 0:l.status,u=l==null?void 0:l.consoleOutputs,f=e.cellData[pr],m=(f==null?void 0:f.code)??"",_=Gt(jR),[g,p]=hn(NR),b=$e(mf);let x;t[0]!==_||t[1]!==m?(x=()=>{nS({code:m}),_(m)},t[0]=_,t[1]=m,t[2]=x):x=t[2];const y=Qe(x);let v;t[3]!==m||t[4]!==i||t[5]!==s?(v=()=>{m.trim()&&i({code:m,before:!1,cellId:s??"__end__"})},t[3]=m,t[4]=i,t[5]=s,t[6]=v):v=t[6];const S=Qe(v);let k;t[7]!==a?(k=()=>{a({cellId:pr,code:"",formattingChange:!1}),nS({code:""});const ce=r.current;ce&&ce.dispatch({changes:{from:0,to:ce.state.doc.length,insert:""}})},t[7]=a,t[8]=k):k=t[8];const j=Qe(k);let E;t[9]!==p||t[10]!==a?(E=ce=>{p(!1),a({cellId:pr,code:ce,formattingChange:!1});const Ee=r.current;Ee&&Ee.dispatch({changes:{from:0,to:Ee.state.doc.length,insert:ce}})},t[9]=p,t[10]=a,t[11]=E):E=t[11];const I=Qe(E),[T,M]=A.useState();let R;t[12]!==m||t[13]!==u||t[14]!==y||t[15]!==T||t[16]!==c||t[17]!==o||t[18]!==n?(R=()=>h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[40%]",children:h.jsx(Uu,{theme:o,allowFocus:!1,showPlaceholder:!1,id:pr,code:m,config:ER,status:"idle",serializedEditorState:null,runCell:y,userConfig:n,editorViewRef:r,setEditorView:ce=>{r.current=ce},hidden:!1,temporarilyShowCode:En.NOOP,languageAdapter:T,setLanguageAdapter:M})}),h.jsx("div",{className:"flex-1 overflow-auto flex-shrink-0",children:h.jsx(Fc,{allowExpand:!1,output:c,className:"output-area",cellId:pr,stale:!1,loading:!1})}),h.jsx("div",{className:"overflow-auto flex-shrink-0 max-h-[35%]",children:h.jsx(rp,{consoleOutputs:u,className:"overflow-auto",stale:!1,cellName:$V,onSubmitDebugger:En.NOOP,cellId:pr,debuggerActive:!1})})]}),t[12]=m,t[13]=u,t[14]=y,t[15]=T,t[16]=c,t[17]=o,t[18]=n,t[19]=R):R=t[19];const B=R;let O;t[20]!==I||t[21]!==b||t[22]!==g||t[23]!==o?(O=()=>g?h.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:h.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:b.map((ce,Ee)=>h.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>I(ce),children:h.jsx(ba,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ce.trim(),editable:!1,readOnly:!0})},Ee))})}):null,t[20]=I,t[21]=b,t[22]=g,t[23]=o,t[24]=O):O=t[24];const z=O;let F,V,L,C,$,N,H,Y,Z,q,re;t[25]===Symbol.for("react.memo_cache_sentinel")?(F=Fs.create(pr),V=h.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[25]=F,t[26]=V):(F=t[25],V=t[26]),t[27]===Symbol.for("react.memo_cache_sentinel")?(L=mn("cell.run"),t[27]=L):L=t[27],t[28]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(ei,{color:"var(--grass-11)",size:16}),t[28]=C):C=t[28],t[29]!==y||t[30]!==g?($=h.jsx(Oe,{content:L,children:h.jsx(Ae,{"data-testid":"scratchpad-run-button",onClick:y,disabled:g,variant:"text",size:"xs",children:C})}),t[29]=y,t[30]=g,t[31]=$):$=t[31],t[32]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx(yp,{size:16}),t[32]=N):N=t[32],t[33]!==j||t[34]!==g?(H=h.jsx(Oe,{content:"Clear code and outputs",children:h.jsx(Ae,{disabled:g,size:"xs",variant:"text",onClick:j,children:N})}),t[33]=j,t[34]=g,t[35]=H):H=t[35],t[36]===Symbol.for("react.memo_cache_sentinel")?(Y=h.jsx(ni,{size:16}),t[36]=Y):Y=t[36],t[37]!==S||t[38]!==g?(Z=h.jsx(ii,{children:h.jsx(Oe,{content:"Insert code",children:h.jsx(Ae,{disabled:g,size:"xs",variant:"text",onClick:S,children:Y})})}),t[37]=S,t[38]=g,t[39]=Z):Z=t[39],t[40]!==d?(q=(d==="running"||d==="queued")&&h.jsx(eo,{className:"inline",size:"small"}),t[40]=d,t[41]=q):q=t[41],t[42]===Symbol.for("react.memo_cache_sentinel")?(re=h.jsx("div",{className:"flex-1"}),t[42]=re):re=t[42];const ne=g&&"bg-[var(--sky-3)] rounded-none";let oe,G;t[43]!==ne?(oe=Me(ne),t[43]=ne,t[44]=oe):oe=t[44],t[45]!==g||t[46]!==p?(G=()=>p(!g),t[45]=g,t[46]=p,t[47]=G):G=t[47];const Q=b.length===0;let le,fe,de,he,se,ye,je;return t[48]===Symbol.for("react.memo_cache_sentinel")?(le=h.jsx(Np,{size:16}),t[48]=le):le=t[48],t[49]!==oe||t[50]!==G||t[51]!==Q?(fe=h.jsx(Oe,{content:"Toggle history",children:h.jsx(Ae,{size:"xs",variant:"text",className:oe,onClick:G,disabled:Q,children:le})}),t[49]=oe,t[50]=G,t[51]=Q,t[52]=fe):fe=t[52],t[53]!==$||t[54]!==H||t[55]!==Z||t[56]!==q||t[57]!==fe?(de=h.jsxs("div",{className:"flex items-center flex-shrink-0",children:[$,H,Z,q,re,fe]}),t[53]=$,t[54]=H,t[55]=Z,t[56]=q,t[57]=fe,t[58]=de):de=t[58],t[59]!==B?(he=B(),t[59]=B,t[60]=he):he=t[60],t[61]!==z?(se=z(),t[61]=z,t[62]=se):se=t[62],t[63]!==he||t[64]!==se?(ye=h.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[he,se]}),t[63]=he,t[64]=se,t[65]=ye):ye=t[65],t[66]!==de||t[67]!==ye?(je=h.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:F,children:[V,de,ye]}),t[66]=de,t[67]=ye,t[68]=je):je=t[68],je},AR=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(IR,{}),t[0]=e):e=t[0],e},TR=()=>{const t=X.c(16),[e]=Ds(),n=e.package_management.manager;let o;t[0]!==n?(o=[n],t[0]=n,t[1]=o):o=t[1];const{data:r,loading:s,error:i,reload:a}=Xn(RR,o);if(s&&!r){let m;return t[2]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(eo,{size:"medium",centered:!0}),t[2]=m):m=t[2],m}if(i){let m;return t[3]!==i?(m=h.jsx(Zs,{error:i}),t[3]=i,t[4]=m):m=t[4],m}let l;t[5]!==(r==null?void 0:r.packages)?(l=(r==null?void 0:r.packages)||[],t[5]=r==null?void 0:r.packages,t[6]=l):l=t[6];const c=l;let d,u,f;return t[7]!==n||t[8]!==a?(d=h.jsx(MR,{packageManager:n,onSuccess:a}),t[7]=n,t[8]=a,t[9]=d):d=t[9],t[10]!==c||t[11]!==a?(u=h.jsx(OR,{packages:c,onSuccess:a}),t[10]=c,t[11]=a,t[12]=u):u=t[12],t[13]!==d||t[14]!==u?(f=h.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d,u]}),t[13]=d,t[14]=u,t[15]=f):f=t[15],f},MR=({onSuccess:t,packageManager:e})=>{const[n,o]=K.useState(""),[r,s]=K.useState(!1),{handleClick:i}=xa(),a=$e(ff),l=Gt(ff);K.useEffect(()=>{a&&(o(a),l(null))},[a,l]);const c=async()=>{try{s(!0);const d=await WV({package:n});d.success?(t(),lt({title:"Package added",description:h.jsxs("span",{children:["The package ",h.jsx(jc,{className:"inline",children:n})," and its dependencies has been added to your environment."]})})):lt({title:"Failed to add package",description:d.error,variant:"danger"})}finally{o(""),s(!1)}};return h.jsxs("div",{className:"flex items-center w-full border-b",children:[h.jsx(Y4,{placeholder:`Install packages with ${e}...`,id:t_,icon:r?h.jsx(eo,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):h.jsx(Oe,{content:"Change package manager",children:h.jsx(ya,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),rootClassName:"flex-1 border-none",value:n,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),c())},onChange:d=>o(d.target.value)}),h.jsx(Oe,{delayDuration:300,side:"left",align:"start",content:h.jsxs("div",{className:"text-sm flex flex-col w-full max-w-[360px]",children:["Packages are installed using the package manager specified in your user configuration. Depending on your package manager, you can install packages with various formats:",h.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"})," A package name; this will install the latest version.",h.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"})," ","A package with a specific version or version range.",h.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Git:"})," A Git repository",h.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"URL:"})," A remote wheel or source distribution.",h.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"font-bold tracking-wide",children:"Path:"})," A local wheel, source distribution, or project directory.",h.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:h.jsx(Wm,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),h.jsx("button",{type:"button",className:Me("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",n&&"bg-accent text-accent-foreground","disabled:cursor-not-allowed disabled:opacity-50"),onClick:c,disabled:!n,children:"Add"})]})},OR=t=>{const e=X.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(An,{title:"No packages",description:"No packages are installed in this environment.",icon:h.jsx(ya,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(Xm,{children:h.jsxs(Xs,{children:[h.jsx(Dr,{children:"Name"}),h.jsx(Dr,{children:"Version"}),h.jsx(Dr,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>h.jsxs(Xs,{className:"group",onClick:async()=>{await xn(`${l.name}==${l.version}`),lt({title:"Copied to clipboard"})},children:[h.jsx(Rr,{children:l.name}),h.jsx(Rr,{children:l.version}),h.jsx(Rr,{children:h.jsx(DR,{packageName:l.name,onSuccess:n})})]},l.name),e[5]=n,e[6]=a):a=e[6],s=o.map(a),e[2]=n,e[3]=o,e[4]=s}else s=e[4];return e[7]!==s?(i=h.jsxs(Km,{className:"overflow-auto flex-1",children:[r,h.jsx(Zm,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},DR=({packageName:t,onSuccess:e})=>{const[n,o]=K.useState(!1);return n?h.jsx(eo,{size:"small",className:"float-right mr-2 h-4 w-4 shrink-0 opacity-50"}):h.jsx("button",{type:"button",className:Me("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible"),onClick:fn.stopPropagation(async()=>{try{o(!0);const r=await qV({package:t});r.success?(e(),lt({title:"Package removed",description:h.jsxs("span",{children:["The package ",h.jsx(jc,{className:"inline",children:t})," has been removed from your environment."]})})):lt({title:"Failed to add package",description:r.error,variant:"danger"})}finally{o(!1)}}),children:"Remove"})};function RR(){return HV()}var pf="ScrollArea",[H2,Z$]=y4(pf),[PR,Fn]=H2(pf),W2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:o="hover",dir:r,scrollHideDelay:s=600,...i}=t,[a,l]=A.useState(null),[c,d]=A.useState(null),[u,f]=A.useState(null),[m,_]=A.useState(null),[g,p]=A.useState(null),[b,x]=A.useState(0),[y,v]=A.useState(0),[S,k]=A.useState(!1),[j,E]=A.useState(!1),I=Qs(e,M=>l(M)),T=GV(r);return h.jsx(PR,{scope:n,type:o,dir:T,scrollHideDelay:s,scrollArea:a,viewport:c,onViewportChange:d,content:u,onContentChange:f,scrollbarX:m,onScrollbarXChange:_,scrollbarXEnabled:S,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:p,scrollbarYEnabled:j,onScrollbarYEnabledChange:E,onCornerWidthChange:x,onCornerHeightChange:v,children:h.jsx(qs.div,{dir:T,...i,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":y+"px",...t.style}})})});W2.displayName=pf;var q2="ScrollAreaViewport",G2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:o,nonce:r,...s}=t,i=Fn(q2,n),a=A.useRef(null),l=Qs(e,a,i.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(qs.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t.style},children:h.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});G2.displayName=q2;var lo="ScrollAreaScrollbar",gf=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(lo,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=r,a=t.orientation==="horizontal";return A.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),r.type==="hover"?h.jsx(LR,{...o,ref:e,forceMount:n}):r.type==="scroll"?h.jsx(FR,{...o,ref:e,forceMount:n}):r.type==="auto"?h.jsx(Y2,{...o,ref:e,forceMount:n}):r.type==="always"?h.jsx(_f,{...o,ref:e}):null});gf.displayName=lo;var LR=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(lo,t.__scopeScrollArea),[s,i]=A.useState(!1);return A.useEffect(()=>{const a=r.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),i(!0)},d=()=>{l=window.setTimeout(()=>i(!1),r.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[r.scrollArea,r.scrollHideDelay]),h.jsx($c,{present:n||s,children:h.jsx(Y2,{"data-state":s?"visible":"hidden",...o,ref:e})})}),FR=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=Fn(lo,t.__scopeScrollArea),s=t.orientation==="horizontal",i=Hl(()=>l("SCROLL_END"),100),[a,l]=function(c,d){return A.useReducer((u,f)=>d[u][f]??u,c)}("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return A.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,r.scrollHideDelay,l]),A.useEffect(()=>{const c=r.viewport,d=s?"scrollLeft":"scrollTop";if(c){let u=c[d];const f=()=>{const m=c[d];u!==m&&(l("SCROLL"),i()),u=m};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[r.viewport,s,l,i]),h.jsx($c,{present:n||a!=="hidden",children:h.jsx(_f,{"data-state":a==="hidden"?"hidden":"visible",...o,ref:e,onPointerEnter:Hn(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Hn(t.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Y2=A.forwardRef((t,e)=>{const n=Fn(lo,t.__scopeScrollArea),{forceMount:o,...r}=t,[s,i]=A.useState(!1),a=t.orientation==="horizontal",l=Hl(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?c:d)}},10);return gs(n.viewport,l),gs(n.content,l),h.jsx($c,{present:o||s,children:h.jsx(_f,{"data-state":s?"visible":"hidden",...r,ref:e})})}),_f=A.forwardRef((t,e)=>{const{orientation:n="vertical",...o}=t,r=Fn(lo,t.__scopeScrollArea),s=A.useRef(null),i=A.useRef(0),[a,l]=A.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Q2(a.viewport,a.content),d={...o,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>s.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function u(f,m){return function(_,g,p,b="ltr"){const x=$l(p),y=x/2,v=g||y,S=x-v,k=p.scrollbar.paddingStart+v,j=p.scrollbar.size-p.scrollbar.paddingEnd-S,E=p.content-p.viewport,I=b==="ltr"?[0,E]:[-1*E,0];return tk([k,j],I)(_)}(f,i.current,a,m)}return n==="horizontal"?h.jsx(zR,{...d,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const f=ek(r.viewport.scrollLeft,a,r.dir);s.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:f=>{r.viewport&&(r.viewport.scrollLeft=f)},onDragScroll:f=>{r.viewport&&(r.viewport.scrollLeft=u(f,r.dir))}}):n==="vertical"?h.jsx(BR,{...d,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const f=ek(r.viewport.scrollTop,a);s.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:f=>{r.viewport&&(r.viewport.scrollTop=f)},onDragScroll:f=>{r.viewport&&(r.viewport.scrollTop=u(f))}}):null}),zR=A.forwardRef((t,e)=>{const{sizes:n,onSizesChange:o,...r}=t,s=Fn(lo,t.__scopeScrollArea),[i,a]=A.useState(),l=A.useRef(null),c=Qs(e,l,s.onScrollbarXChange);return A.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(K2,{"data-orientation":"horizontal",...r,ref:c,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":$l(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,u)=>{if(s.viewport){const f=s.viewport.scrollLeft+d.deltaX;t.onWheelScroll(f),nk(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Vl(i.paddingLeft),paddingEnd:Vl(i.paddingRight)}})}})}),BR=A.forwardRef((t,e)=>{const{sizes:n,onSizesChange:o,...r}=t,s=Fn(lo,t.__scopeScrollArea),[i,a]=A.useState(),l=A.useRef(null),c=Qs(e,l,s.onScrollbarYChange);return A.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx(K2,{"data-orientation":"vertical",...r,ref:c,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":$l(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,u)=>{if(s.viewport){const f=s.viewport.scrollTop+d.deltaY;t.onWheelScroll(f),nk(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Vl(i.paddingTop),paddingEnd:Vl(i.paddingBottom)}})}})}),[UR,J2]=H2(lo),K2=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:r,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:u,...f}=t,m=Fn(lo,n),[_,g]=A.useState(null),p=Qs(e,I=>g(I)),b=A.useRef(null),x=A.useRef(""),y=m.viewport,v=o.content-o.viewport,S=hr(d),k=hr(l),j=Hl(u,10);function E(I){if(b.current){const T=I.clientX-b.current.left,M=I.clientY-b.current.top;c({x:T,y:M})}}return A.useEffect(()=>{const I=T=>{const M=T.target;(_==null?void 0:_.contains(M))&&S(T,v)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[y,_,v,S]),A.useEffect(k,[o,k]),gs(_,j),gs(m.content,j),h.jsx(UR,{scope:n,scrollbar:_,hasThumb:r,onThumbChange:hr(s),onThumbPointerUp:hr(i),onThumbPositionChange:k,onThumbPointerDown:hr(a),children:h.jsx(qs.div,{...f,ref:p,style:{position:"absolute",...f.style},onPointerDown:Hn(t.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),b.current=_.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),E(I))}),onPointerMove:Hn(t.onPointerMove,E),onPointerUp:Hn(t.onPointerUp,I=>{const T=I.target;T.hasPointerCapture(I.pointerId)&&T.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=x.current,m.viewport&&(m.viewport.style.scrollBehavior=""),b.current=null})})})}),Ul="ScrollAreaThumb",X2=A.forwardRef((t,e)=>{const{forceMount:n,...o}=t,r=J2(Ul,t.__scopeScrollArea);return h.jsx($c,{present:n||r.hasThumb,children:h.jsx(VR,{ref:e,...o})})}),VR=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:o,...r}=t,s=Fn(Ul,n),i=J2(Ul,n),{onThumbPositionChange:a}=i,l=Qs(e,u=>i.onThumbChange(u)),c=A.useRef(void 0),d=Hl(()=>{c.current&&(c.current(),c.current=void 0)},100);return A.useEffect(()=>{const u=s.viewport;if(u){const f=()=>{if(d(),!c.current){const m=HR(u,a);c.current=m,a()}};return a(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[s.viewport,d,a]),h.jsx(qs.div,{"data-state":i.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:Hn(t.onPointerDownCapture,u=>{const f=u.target.getBoundingClientRect(),m=u.clientX-f.left,_=u.clientY-f.top;i.onThumbPointerDown({x:m,y:_})}),onPointerUp:Hn(t.onPointerUp,i.onThumbPointerUp)})});X2.displayName=Ul;var bf="ScrollAreaCorner",Z2=A.forwardRef((t,e)=>{const n=Fn(bf,t.__scopeScrollArea),o=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&o?h.jsx($R,{...t,ref:e}):null});Z2.displayName=bf;var $R=A.forwardRef((t,e)=>{const{__scopeScrollArea:n,...o}=t,r=Fn(bf,n),[s,i]=A.useState(0),[a,l]=A.useState(0),c=!!(s&&a);return gs(r.scrollbarX,()=>{var u;const d=((u=r.scrollbarX)==null?void 0:u.offsetHeight)||0;r.onCornerHeightChange(d),l(d)}),gs(r.scrollbarY,()=>{var u;const d=((u=r.scrollbarY)==null?void 0:u.offsetWidth)||0;r.onCornerWidthChange(d),i(d)}),c?h.jsx(qs.div,{...o,ref:e,style:{width:s,height:a,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Vl(t){return t?parseInt(t,10):0}function Q2(t,e){const n=t/e;return isNaN(n)?0:n}function $l(t){const e=Q2(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=(t.scrollbar.size-n)*e;return Math.max(o,18)}function ek(t,e,n="ltr"){const o=$l(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,i=e.content-e.viewport,a=s-o,l=JV(t,n==="ltr"?[0,i]:[-1*i,0]);return tk([0,i],[0,a])(l)}function tk(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const o=(e[1]-e[0])/(t[1]-t[0]);return e[0]+o*(n-t[0])}}function nk(t,e){return t>0&&t<e}var HR=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},o=0;return function r(){const s={left:t.scrollLeft,top:t.scrollTop},i=n.left!==s.left,a=n.top!==s.top;(i||a)&&e(),n=s,o=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(o)};function Hl(t,e){const n=hr(t),o=A.useRef(0);return A.useEffect(()=>()=>window.clearTimeout(o.current),[]),A.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(n,e)},[n,e])}function gs(t,e){const n=hr(e);YV(()=>{let o=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(t),()=>{window.cancelAnimationFrame(o),r.unobserve(t)}}},[t,n])}var ok=W2,WR=G2,qR=Z2;const rk=A.forwardRef((t,e)=>{const n=X.c(15);let o,r,s,i,a,l,c,d;return n[0]!==t?({className:r,children:o,...s}=t,n[0]=t,n[1]=o,n[2]=r,n[3]=s):(o=n[1],r=n[2],s=n[3]),n[4]!==r?(i=Me("relative overflow-hidden",r),n[4]=r,n[5]=i):i=n[5],n[6]!==o?(a=h.jsx(WR,{className:"h-full w-full rounded-[inherit]",children:o}),n[6]=o,n[7]=a):a=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(sk,{}),c=h.jsx(qR,{}),n[8]=l,n[9]=c):(l=n[8],c=n[9]),n[10]!==s||n[11]!==e||n[12]!==i||n[13]!==a?(d=h.jsxs(ok,{ref:e,className:i,...s,children:[a,l,c]}),n[10]=s,n[11]=e,n[12]=i,n[13]=a,n[14]=d):d=n[14],d});rk.displayName=ok.displayName;const sk=A.forwardRef((t,e)=>{const n=X.c(14);let o,r,s;n[0]!==t?({className:o,orientation:s,...r}=t,n[0]=t,n[1]=o,n[2]=r,n[3]=s):(o=n[1],r=n[2],s=n[3]);const i=s===void 0?"vertical":s,a=i==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",l=i==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]";let c,d,u;return n[4]!==o||n[5]!==a||n[6]!==l?(c=Me("flex touch-none select-none transition-colors",a,l,o),n[4]=o,n[5]=a,n[6]=l,n[7]=c):c=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(X2,{className:"relative flex-1 rounded-full bg-border"}),n[8]=d):d=n[8],n[9]!==i||n[10]!==r||n[11]!==e||n[12]!==c?(u=h.jsx(gf,{ref:e,orientation:i,className:c,...r,children:d}),n[9]=i,n[10]=r,n[11]=e,n[12]=c,n[13]=u):u=n[13],u});sk.displayName=gf.displayName;const GR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,YR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JR={};function ik(t,e){return(JR.jsx?YR:GR).test(t)}const KR=/[ \t\n\f\r]/g;function ak(t){return t.replace(KR,"")===""}class qi{constructor(e,n,o){this.property=e,this.normal=n,o&&(this.space=o)}}function lk(t,e){const n={},o={};let r=-1;for(;++r<t.length;)Object.assign(n,t[r].property),Object.assign(o,t[r].normal);return new qi(n,o,e)}function yf(t){return t.toLowerCase()}qi.prototype.property={},qi.prototype.normal={},qi.prototype.space=null;class zn{constructor(e,n){this.property=e,this.attribute=n}}zn.prototype.space=null,zn.prototype.boolean=!1,zn.prototype.booleanish=!1,zn.prototype.overloadedBoolean=!1,zn.prototype.number=!1,zn.prototype.commaSeparated=!1,zn.prototype.spaceSeparated=!1,zn.prototype.commaOrSpaceSeparated=!1,zn.prototype.mustUseProperty=!1,zn.prototype.defined=!1;let XR=0;const tt=jr(),Rt=jr(),ck=jr(),xe=jr(),_t=jr(),_s=jr(),kn=jr();function jr(){return 2**++XR}const xf=Object.freeze(Object.defineProperty({__proto__:null,boolean:tt,booleanish:Rt,commaOrSpaceSeparated:kn,commaSeparated:_s,number:xe,overloadedBoolean:ck,spaceSeparated:_t},Symbol.toStringTag,{value:"Module"})),wf=Object.keys(xf);class vf extends zn{constructor(e,n,o,r){let s=-1;if(super(e,n),dk(this,"space",r),typeof o=="number")for(;++s<wf.length;){const i=wf[s];dk(this,wf[s],(o&xf[i])===xf[i])}}}function dk(t,e,n){n&&(t[e]=n)}vf.prototype.defined=!0;const ZR={}.hasOwnProperty;function bs(t){const e={},n={};let o;for(o in t.properties)if(ZR.call(t.properties,o)){const r=t.properties[o],s=new vf(o,t.transform(t.attributes||{},o),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(o)&&(s.mustUseProperty=!0),e[o]=s,n[yf(o)]=o,n[yf(s.attribute)]=o}return new qi(e,n,t.space)}const uk=bs({space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),hk=bs({space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function fk(t,e){return e in t?t[e]:e}function mk(t,e){return fk(t,e.toLowerCase())}const pk=bs({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:mk,properties:{xmlns:null,xmlnsXLink:null}}),gk=bs({transform:(t,e)=>e==="role"?e:"aria-"+e.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Rt,ariaAutoComplete:null,ariaBusy:Rt,ariaChecked:Rt,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:_t,ariaCurrent:null,ariaDescribedBy:_t,ariaDetails:null,ariaDisabled:Rt,ariaDropEffect:_t,ariaErrorMessage:null,ariaExpanded:Rt,ariaFlowTo:_t,ariaGrabbed:Rt,ariaHasPopup:null,ariaHidden:Rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_t,ariaLevel:xe,ariaLive:null,ariaModal:Rt,ariaMultiLine:Rt,ariaMultiSelectable:Rt,ariaOrientation:null,ariaOwns:_t,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:Rt,ariaReadOnly:Rt,ariaRelevant:null,ariaRequired:Rt,ariaRoleDescription:_t,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:Rt,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null}}),QR=bs({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:mk,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_s,acceptCharset:_t,accessKey:_t,action:null,allow:null,allowFullScreen:tt,allowPaymentRequest:tt,allowUserMedia:tt,alt:null,as:null,async:tt,autoCapitalize:null,autoComplete:_t,autoFocus:tt,autoPlay:tt,blocking:_t,capture:null,charSet:null,checked:tt,cite:null,className:_t,cols:xe,colSpan:null,content:null,contentEditable:Rt,controls:tt,controlsList:_t,coords:xe|_s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tt,defer:tt,dir:null,dirName:null,disabled:tt,download:ck,draggable:Rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tt,formTarget:null,headers:_t,height:xe,hidden:tt,high:xe,href:null,hrefLang:null,htmlFor:_t,httpEquiv:_t,id:null,imageSizes:null,imageSrcSet:null,inert:tt,inputMode:null,integrity:null,is:null,isMap:tt,itemId:null,itemProp:_t,itemRef:_t,itemScope:tt,itemType:_t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tt,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:tt,muted:tt,name:null,nonce:null,noModule:tt,noValidate:tt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:tt,optimum:xe,pattern:null,ping:_t,placeholder:null,playsInline:tt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tt,referrerPolicy:null,rel:_t,required:tt,reversed:tt,rows:xe,rowSpan:xe,sandbox:_t,scope:null,scoped:tt,seamless:tt,selected:tt,shadowRootClonable:tt,shadowRootDelegatesFocus:tt,shadowRootMode:null,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:Rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:tt,useMap:null,value:Rt,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_t,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tt,declare:tt,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:tt,noHref:tt,noShade:tt,noWrap:tt,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:Rt,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:tt,disableRemotePlayback:tt,prefix:null,property:null,results:xe,security:null,unselectable:null}}),eP=bs({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:fk,properties:{about:kn,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:_t,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:tt,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_s,g2:_s,glyphName:_s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kn,rev:kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kn,requiredFeatures:kn,requiredFonts:kn,requiredFormats:kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kn,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),tP=/^data[-\w.:]+$/i,_k=/-[a-z]/g,nP=/[A-Z]/g;function oP(t){return"-"+t.toLowerCase()}function rP(t){return t.charAt(1).toUpperCase()}const sP={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},iP=lk([hk,uk,pk,gk,QR],"html"),kf=lk([hk,uk,pk,gk,eP],"svg"),bk=oS(KV()),aP=bk.default||bk,yk=xk("end"),Sf=xk("start");function xk(t){return function(e){const n=e&&e.position&&e.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Gi(t){return t&&typeof t=="object"?"position"in t||"type"in t?wk(t.position):"start"in t||"end"in t?wk(t):"line"in t||"column"in t?Cf(t):"":""}function Cf(t){return vk(t&&t.line)+":"+vk(t&&t.column)}function wk(t){return Cf(t&&t.start)+"-"+Cf(t&&t.end)}function vk(t){return t&&typeof t=="number"?t:1}class on extends Error{constructor(e,n,o){super(),typeof n=="string"&&(o=n,n=void 0);let r="",s={},i=!1;if(n&&(s="line"in n&&"column"in n||"start"in n&&"end"in n?{place:n}:"type"in n?{ancestors:[n],place:n.position}:{...n}),typeof e=="string"?r=e:!s.cause&&e&&(i=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof o=="string"){const l=o.indexOf(":");l===-1?s.ruleId=o:(s.source=o.slice(0,l),s.ruleId=o.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=a?a.line:void 0,this.name=Gi(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=i&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}on.prototype.file="",on.prototype.name="",on.prototype.reason="",on.prototype.message="",on.prototype.stack="",on.prototype.column=void 0,on.prototype.line=void 0,on.prototype.ancestors=void 0,on.prototype.cause=void 0,on.prototype.fatal=void 0,on.prototype.place=void 0,on.prototype.ruleId=void 0,on.prototype.source=void 0;const Nf={}.hasOwnProperty,lP=new Map,cP=/[A-Z]/g,dP=/-([a-z])/g,uP=new Set(["table","tbody","thead","tfoot","tr"]),hP=new Set(["td","th"]),kk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function fP(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let o;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=function(i,a){return l;function l(c,d,u,f){const m=Array.isArray(u.children),_=Sf(c);return a(d,u,f,m,{columnNumber:_?_.column-1:void 0,fileName:i,lineNumber:_?_.line:void 0},void 0)}}(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=function(i,a,l){return c;function c(d,u,f,m){const _=Array.isArray(f.children)?l:a;return m?_(u,f,m):_(u,f)}}(0,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:o,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?kf:iP,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=Sk(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function Sk(t,e,n){return e.type==="element"?function(o,r,s){const i=o.schema;let a=i;r.tagName.toLowerCase()==="svg"&&i.space==="html"&&(a=kf,o.schema=a),o.ancestors.push(r);const l=Nk(o,r.tagName,!1),c=function(u,f){const m={};let _,g;for(g in f.properties)if(g!=="children"&&Nf.call(f.properties,g)){const p=mP(u,g,f.properties[g]);if(p){const[b,x]=p;u.tableCellAlignToStyle&&b==="align"&&typeof x=="string"&&hP.has(f.tagName)?_=x:m[b]=x}}return _&&((m.style||(m.style={}))[u.stylePropertyNameCase==="css"?"text-align":"textAlign"]=_),m}(o,r);let d=Ef(o,r);return uP.has(r.tagName)&&(d=d.filter(function(u){return typeof u!="string"||!(typeof(f=u)=="object"?f.type==="text"&&ak(f.value):ak(f));var f})),Ck(o,c,l,r),jf(c,d),o.ancestors.pop(),o.schema=i,o.create(r,l,c,s)}(t,e,n):e.type==="mdxFlowExpression"||e.type==="mdxTextExpression"?function(o,r){if(r.data&&r.data.estree&&o.evaluater){const s=r.data.estree.body[0];return s.type,o.evaluater.evaluateExpression(s.expression)}Yi(o,r.position)}(t,e):e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement"?function(o,r,s){const i=o.schema;let a=i;r.name==="svg"&&i.space==="html"&&(a=kf,o.schema=a),o.ancestors.push(r);const l=r.name===null?o.Fragment:Nk(o,r.name,!0),c=function(u,f){const m={};for(const _ of f.attributes)if(_.type==="mdxJsxExpressionAttribute")if(_.data&&_.data.estree&&u.evaluater){const g=_.data.estree.body[0];g.type;const p=g.expression;p.type;const b=p.properties[0];b.type,Object.assign(m,u.evaluater.evaluateExpression(b.argument))}else Yi(u,f.position);else{const g=_.name;let p;if(_.value&&typeof _.value=="object")if(_.value.data&&_.value.data.estree&&u.evaluater){const b=_.value.data.estree.body[0];b.type,p=u.evaluater.evaluateExpression(b.expression)}else Yi(u,f.position);else p=_.value===null||_.value;m[g]=p}return m}(o,r),d=Ef(o,r);return Ck(o,c,l,r),jf(c,d),o.ancestors.pop(),o.schema=i,o.create(r,l,c,s)}(t,e,n):e.type==="mdxjsEsm"?function(o,r){if(r.data&&r.data.estree&&o.evaluater)return o.evaluater.evaluateProgram(r.data.estree);Yi(o,r.position)}(t,e):e.type==="root"?function(o,r,s){const i={};return jf(i,Ef(o,r)),o.create(r,o.Fragment,i,s)}(t,e,n):e.type==="text"?function(o,r){return r.value}(0,e):void 0}function Ck(t,e,n,o){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=o)}function jf(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function Ef(t,e){const n=[];let o=-1;const r=t.passKeys?new Map:lP;for(;++o<e.children.length;){const s=e.children[o];let i;if(t.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=r.get(l)||0;i=l+"-"+c,r.set(l,c+1)}}const a=Sk(t,s,i);a!==void 0&&n.push(a)}return n}function mP(t,e,n){const o=function(r,s){const i=yf(s);let a=s,l=zn;if(i in r.normal)return r.property[r.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&tP.test(s)){if(s.charAt(4)==="-"){const c=s.slice(5).replace(_k,rP);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=s.slice(4);if(!_k.test(c)){let d=c.replace(nP,oP);d.charAt(0)!=="-"&&(d="-"+d),s="data"+d}}l=vf}return new l(a,s)}(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=o.commaSeparated?function(r){const s={};return(r[r.length-1]===""?[...r,""]:r).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}(n):n.join(" ").trim()),o.property==="style"){let r=typeof n=="object"?n:function(s,i){const a={};try{aP(i,l)}catch(c){if(!s.ignoreInvalidStyle){const d=c,u=new on("Cannot parse `style` attribute",{ancestors:s.ancestors,cause:d,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=s.filePath||void 0,u.url=kk+"#cannot-parse-style-attribute",u}}return a;function l(c,d){let u=c;u.slice(0,2)!=="--"&&(u.slice(0,4)==="-ms-"&&(u="ms-"+u.slice(4)),u=u.replace(dP,gP)),a[u]=d}}(t,String(n));return t.stylePropertyNameCase==="css"&&(r=function(s){const i={};let a;for(a in s)Nf.call(s,a)&&(i[pP(a)]=s[a]);return i}(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&o.space?sP[o.property]||o.property:o.attribute,n]}}function Nk(t,e,n){let o;if(n)if(e.includes(".")){const r=e.split(".");let s,i=-1;for(;++i<r.length;){const a=ik(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}o=s}else o=ik(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};else o={type:"Literal",value:e};if(o.type==="Literal"){const r=o.value;return Nf.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(o);Yi(t)}function Yi(t,e){const n=new on("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=kk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pP(t){let e=t.replace(cP,_P);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function gP(t,e){return e.toUpperCase()}function _P(t){return"-"+t.toLowerCase()}const If={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Wl={};function jk(t,e,n){if(function(o){return!!(o&&typeof o=="object")}(t)){if("value"in t)return t.type!=="html"||n?t.value:"";if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Ek(t.children,e,n)}return Array.isArray(t)?Ek(t,e,n):""}function Ek(t,e,n){const o=[];let r=-1;for(;++r<t.length;)o[r]=jk(t[r],e,n);return o.join("")}const Ik=document.createElement("i");function Af(t){const e="&"+t+";";Ik.innerHTML=e;const n=Ik.textContent;return(n.charCodeAt(n.length-1)!==59||t==="semi")&&n!==e&&n}function co(t,e,n,o){const r=t.length;let s,i=0;if(e=e<0?-e>r?0:r+e:e>r?r:e,n=n>0?n:0,o.length<1e4)s=Array.from(o),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);i<o.length;)s=o.slice(i,i+1e4),s.unshift(e,0),t.splice(...s),i+=1e4,e+=1e4}function Bn(t,e){return t.length>0?(co(t,t.length,0,e),t):e}const Ak={}.hasOwnProperty;function bP(t,e){let n;for(n in e){const o=(Ak.call(t,n)?t[n]:void 0)||(t[n]={}),r=e[n];let s;if(r)for(s in r){Ak.call(o,s)||(o[s]=[]);const i=r[s];yP(o[s],Array.isArray(i)?i:i?[i]:[])}}}function yP(t,e){let n=-1;const o=[];for(;++n<e.length;)(e[n].add==="after"?t:o).push(e[n]);co(t,0,0,o)}function Tk(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||(65535&n)==65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function ys(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const uo=sr(/[A-Za-z]/),Sn=sr(/[\dA-Za-z]/),xP=sr(/[#-'*+\--9=?A-Z^-~]/);function Tf(t){return t!==null&&(t<32||t===127)}const Mf=sr(/\d/),wP=sr(/[\dA-Fa-f]/),vP=sr(/[!-/:-@[-`{-~]/);function Ke(t){return t!==null&&t<-2}function bn(t){return t!==null&&(t<0||t===32)}function ht(t){return t===-2||t===-1||t===32}const kP=sr(new RegExp("\\p{P}|\\p{S}","u")),SP=sr(/\s/);function sr(t){return function(e){return e!==null&&e>-1&&t.test(String.fromCharCode(e))}}function xs(t){const e=[];let n=-1,o=0,r=0;for(;++n<t.length;){const s=t.charCodeAt(n);let i="";if(s===37&&Sn(t.charCodeAt(n+1))&&Sn(t.charCodeAt(n+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(i=String.fromCharCode(s));else if(s>55295&&s<57344){const a=t.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(i=String.fromCharCode(s,a),r=1):i="\uFFFD"}else i=String.fromCharCode(s);i&&(e.push(t.slice(o,n),encodeURIComponent(i)),o=n+r+1,i=""),r&&(n+=r,r=0)}return e.join("")+t.slice(o)}function bt(t,e,n,o){const r=o?o-1:Number.POSITIVE_INFINITY;let s=0;return function(a){return ht(a)?(t.enter(n),i(a)):e(a)};function i(a){return ht(a)&&s++<r?(t.consume(a),i):(t.exit(n),e(a))}}const CP={tokenize:function(t){const e=t.attempt(this.parser.constructs.contentInitial,function(s){return s===null?void t.consume(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),bt(t,e,"linePrefix"))},function(s){return t.enter("paragraph"),o(s)});let n;return e;function o(s){const i=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=i),n=i,r(s)}function r(s){return s===null?(t.exit("chunkText"),t.exit("paragraph"),void t.consume(s)):Ke(s)?(t.consume(s),t.exit("chunkText"),o):(t.consume(s),r)}}},NP={tokenize:function(t){const e=this,n=[];let o,r,s,i=0;return a;function a(y){if(i<n.length){const v=n[i];return e.containerState=v[1],t.attempt(v[0].continuation,l,c)(y)}return c(y)}function l(y){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,o&&x();const v=e.events.length;let S,k=v;for(;k--;)if(e.events[k][0]==="exit"&&e.events[k][1].type==="chunkFlow"){S=e.events[k][1].end;break}b(i);let j=v;for(;j<e.events.length;)e.events[j][1].end={...S},j++;return co(e.events,k+1,0,e.events.slice(v)),e.events.length=j,c(y)}return a(y)}function c(y){if(i===n.length){if(!o)return f(y);if(o.currentConstruct&&o.currentConstruct.concrete)return _(y);e.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Mk,d,u)(y)}function d(y){return o&&x(),b(i),f(y)}function u(y){return e.parser.lazy[e.now().line]=i!==n.length,s=e.now().offset,_(y)}function f(y){return e.containerState={},t.attempt(Mk,m,_)(y)}function m(y){return i++,n.push([e.currentConstruct,e.containerState]),f(y)}function _(y){return y===null?(o&&x(),b(0),void t.consume(y)):(o=o||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:r}),g(y))}function g(y){return y===null?(p(t.exit("chunkFlow"),!0),b(0),void t.consume(y)):Ke(y)?(t.consume(y),p(t.exit("chunkFlow")),i=0,e.interrupt=void 0,a):(t.consume(y),g)}function p(y,v){const S=e.sliceStream(y);if(v&&S.push(null),y.previous=r,r&&(r.next=y),r=y,o.defineSkip(y.start),o.write(S),e.parser.lazy[y.start.line]){let k=o.events.length;for(;k--;)if(o.events[k][1].start.offset<s&&(!o.events[k][1].end||o.events[k][1].end.offset>s))return;const j=e.events.length;let E,I,T=j;for(;T--;)if(e.events[T][0]==="exit"&&e.events[T][1].type==="chunkFlow"){if(E){I=e.events[T][1].end;break}E=!0}for(b(i),k=j;k<e.events.length;)e.events[k][1].end={...I},k++;co(e.events,T+1,0,e.events.slice(j)),e.events.length=k}}function b(y){let v=n.length;for(;v-- >y;){const S=n[v];e.containerState=S[1],S[0].exit.call(e,t)}n.length=y}function x(){o.write([null]),r=void 0,o=void 0,e.containerState._closeFlow=void 0}}},Mk={tokenize:function(t,e,n){return bt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function Ok(t){return t===null||bn(t)||SP(t)?1:kP(t)?2:void 0}function Of(t,e,n){const o=[];let r=-1;for(;++r<t.length;){const s=t[r].resolveAll;s&&!o.includes(s)&&(e=s(e,n),o.push(s))}return e}const Df={name:"attention",resolveAll:function(t,e){let n,o,r,s,i,a,l,c,d=-1;for(;++d<t.length;)if(t[d][0]==="enter"&&t[d][1].type==="attentionSequence"&&t[d][1]._close){for(n=d;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[d][1]).charCodeAt(0)){if((t[n][1]._close||t[d][1]._open)&&(t[d][1].end.offset-t[d][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[d][1].end.offset-t[d][1].start.offset)%3))continue;a=t[n][1].end.offset-t[n][1].start.offset>1&&t[d][1].end.offset-t[d][1].start.offset>1?2:1;const u={...t[n][1].end},f={...t[d][1].start};Dk(u,-a),Dk(f,a),s={type:a>1?"strongSequence":"emphasisSequence",start:u,end:{...t[n][1].end}},i={type:a>1?"strongSequence":"emphasisSequence",start:{...t[d][1].start},end:f},r={type:a>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[d][1].start}},o={type:a>1?"strong":"emphasis",start:{...s.start},end:{...i.end}},t[n][1].end={...s.start},t[d][1].start={...i.end},l=[],t[n][1].end.offset-t[n][1].start.offset&&(l=Bn(l,[["enter",t[n][1],e],["exit",t[n][1],e]])),l=Bn(l,[["enter",o,e],["enter",s,e],["exit",s,e],["enter",r,e]]),l=Bn(l,Of(e.parser.constructs.insideSpan.null,t.slice(n+1,d),e)),l=Bn(l,[["exit",r,e],["enter",i,e],["exit",i,e],["exit",o,e]]),t[d][1].end.offset-t[d][1].start.offset?(c=2,l=Bn(l,[["enter",t[d][1],e],["exit",t[d][1],e]])):c=0,co(t,n-1,d-n+3,l),d=n+l.length-c-2;break}}for(d=-1;++d<t.length;)t[d][1].type==="attentionSequence"&&(t[d][1].type="data");return t},tokenize:function(t,e){const n=this.parser.constructs.attentionMarkers.null,o=this.previous,r=Ok(o);let s;return function(a){return s=a,t.enter("attentionSequence"),i(a)};function i(a){if(a===s)return t.consume(a),i;const l=t.exit("attentionSequence"),c=Ok(a),d=!c||c===2&&r||n.includes(a),u=!r||r===2&&c||n.includes(o);return l._open=!!(s===42?d:d&&(r||!u)),l._close=!!(s===42?u:u&&(c||!d)),e(a)}}};function Dk(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const jP={name:"autolink",tokenize:function(t,e,n){let o=0;return function(f){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),r};function r(f){return uo(f)?(t.consume(f),s):f===64?n(f):l(f)}function s(f){return f===43||f===45||f===46||Sn(f)?(o=1,i(f)):l(f)}function i(f){return f===58?(t.consume(f),o=0,a):(f===43||f===45||f===46||Sn(f))&&o++<32?(t.consume(f),i):(o=0,l(f))}function a(f){return f===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):f===null||f===32||f===60||Tf(f)?n(f):(t.consume(f),a)}function l(f){return f===64?(t.consume(f),c):xP(f)?(t.consume(f),l):n(f)}function c(f){return Sn(f)?d(f):n(f)}function d(f){return f===46?(t.consume(f),o=0,c):f===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):u(f)}function u(f){if((f===45||Sn(f))&&o++<63){const m=f===45?u:d;return t.consume(f),m}return n(f)}}},ql={partial:!0,tokenize:function(t,e,n){return function(r){return ht(r)?bt(t,o,"linePrefix")(r):o(r)};function o(r){return r===null||Ke(r)?e(r):n(r)}}},Rk={continuation:{tokenize:function(t,e,n){const o=this;return function(s){return ht(s)?bt(t,r,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):r(s)};function r(s){return t.attempt(Rk,e,n)(s)}}},exit:function(t){t.exit("blockQuote")},name:"blockQuote",tokenize:function(t,e,n){const o=this;return function(s){if(s===62){const i=o.containerState;return i.open||(t.enter("blockQuote",{_container:!0}),i.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),r}return n(s)};function r(s){return ht(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}},Pk={name:"characterEscape",tokenize:function(t,e,n){return function(r){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(r),t.exit("escapeMarker"),o};function o(r){return vP(r)?(t.enter("characterEscapeValue"),t.consume(r),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(r)}}},Lk={name:"characterReference",tokenize:function(t,e,n){const o=this;let r,s,i=0;return function(d){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),a};function a(d){return d===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(d),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),r=31,s=Sn,c(d))}function l(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),r=6,s=wP,c):(t.enter("characterReferenceValue"),r=7,s=Mf,c(d))}function c(d){if(d===59&&i){const u=t.exit("characterReferenceValue");return s!==Sn||Af(o.sliceSerialize(u))?(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e):n(d)}return s(d)&&i++<r?(t.consume(d),c):n(d)}}},Fk={partial:!0,tokenize:function(t,e,n){const o=this;return function(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),r)};function r(s){return o.parser.lazy[o.now().line]?n(s):e(s)}}},zk={concrete:!0,name:"codeFenced",tokenize:function(t,e,n){const o=this,r={partial:!0,tokenize:function(y,v,S){let k=0;return j;function j(R){return y.enter("lineEnding"),y.consume(R),y.exit("lineEnding"),E}function E(R){return y.enter("codeFencedFence"),ht(R)?bt(y,I,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):I(R)}function I(R){return R===s?(y.enter("codeFencedFenceSequence"),T(R)):S(R)}function T(R){return R===s?(k++,y.consume(R),T):k>=a?(y.exit("codeFencedFenceSequence"),ht(R)?bt(y,M,"whitespace")(R):M(R)):S(R)}function M(R){return R===null||Ke(R)?(y.exit("codeFencedFence"),v(R)):S(R)}}};let s,i=0,a=0;return function(y){return function(v){const S=o.events[o.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,s=v,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),l(v)}(y)};function l(y){return y===s?(a++,t.consume(y),l):a<3?n(y):(t.exit("codeFencedFenceSequence"),ht(y)?bt(t,c,"whitespace")(y):c(y))}function c(y){return y===null||Ke(y)?(t.exit("codeFencedFence"),o.interrupt?e(y):t.check(Fk,m,x)(y)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===null||Ke(y)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),c(y)):ht(y)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),bt(t,u,"whitespace")(y)):y===96&&y===s?n(y):(t.consume(y),d)}function u(y){return y===null||Ke(y)?c(y):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===null||Ke(y)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),c(y)):y===96&&y===s?n(y):(t.consume(y),f)}function m(y){return t.attempt(r,x,_)(y)}function _(y){return t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),g}function g(y){return i>0&&ht(y)?bt(t,p,"linePrefix",i+1)(y):p(y)}function p(y){return y===null||Ke(y)?t.check(Fk,m,x)(y):(t.enter("codeFlowValue"),b(y))}function b(y){return y===null||Ke(y)?(t.exit("codeFlowValue"),p(y)):(t.consume(y),b)}function x(y){return t.exit("codeFenced"),e(y)}}},Rf={name:"codeIndented",tokenize:function(t,e,n){const o=this;return function(l){return t.enter("codeIndented"),bt(t,r,"linePrefix",5)(l)};function r(l){const c=o.events[o.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?a(l):Ke(l)?t.attempt(EP,s,a)(l):(t.enter("codeFlowValue"),i(l))}function i(l){return l===null||Ke(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),i)}function a(l){return t.exit("codeIndented"),e(l)}}},EP={partial:!0,tokenize:function(t,e,n){const o=this;return r;function r(i){return o.parser.lazy[o.now().line]?n(i):Ke(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r):bt(t,s,"linePrefix",5)(i)}function s(i){const a=o.events[o.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(i):Ke(i)?r(i):n(i)}}},IP={name:"codeText",previous:function(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"},resolve:function(t){let e,n,o=t.length-4,r=3;if(!(t[r][1].type!=="lineEnding"&&t[r][1].type!=="space"||t[o][1].type!=="lineEnding"&&t[o][1].type!=="space")){for(e=r;++e<o;)if(t[e][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[o][1].type="codeTextPadding",r+=2,o-=2;break}}for(e=r-1,o++;++e<=o;)n===void 0?e!==o&&t[e][1].type!=="lineEnding"&&(n=e):e!==o&&t[e][1].type!=="lineEnding"||(t[n][1].type="codeTextData",e!==n+2&&(t[n][1].end=t[e-1][1].end,t.splice(n+2,e-n-2),o-=e-n-2,e=n+2),n=void 0);return t},tokenize:function(t,e,n){let o,r,s=0;return function(d){return t.enter("codeText"),t.enter("codeTextSequence"),i(d)};function i(d){return d===96?(t.consume(d),s++,i):(t.exit("codeTextSequence"),a(d))}function a(d){return d===null?n(d):d===32?(t.enter("space"),t.consume(d),t.exit("space"),a):d===96?(r=t.enter("codeTextSequence"),o=0,c(d)):Ke(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),a):(t.enter("codeTextData"),l(d))}function l(d){return d===null||d===32||d===96||Ke(d)?(t.exit("codeTextData"),a(d)):(t.consume(d),l)}function c(d){return d===96?(t.consume(d),o++,c):o===s?(t.exit("codeTextSequence"),t.exit("codeText"),e(d)):(r.type="codeTextData",l(d))}}};class AP{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const o=n??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(e,o):e>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(e,n,o){const r=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return o&&Ji(this.left,o),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Ji(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ji(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Ji(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Ji(this.left,n.reverse())}}}function Ji(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Bk(t){const e={};let n,o,r,s,i,a,l,c=-1;const d=new AP(t);for(;++c<d.length;){for(;c in e;)c=e[c];if(n=d.get(c),c&&n[1].type==="chunkFlow"&&d.get(c-1)[1].type==="listItemPrefix"&&(a=n[1]._tokenizer.events,r=0,r<a.length&&a[r][1].type==="lineEndingBlank"&&(r+=2),r<a.length&&a[r][1].type==="content"))for(;++r<a.length&&a[r][1].type!=="content";)a[r][1].type==="chunkText"&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,TP(d,c)),c=e[c],l=!0);else if(n[1]._container){for(r=c,o=void 0;r--&&(s=d.get(r),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(o&&(d.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=r);o&&(n[1].end={...d.get(o)[1].start},i=d.slice(o,c),i.unshift(n),d.splice(o,c-o+1,i))}}return co(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function TP(t,e){const n=t.get(e)[1],o=t.get(e)[2];let r=e-1;const s=[],i=n._tokenizer||o.parser[n.contentType](n.start),a=i.events,l=[],c={};let d,u,f=-1,m=n,_=0,g=0;const p=[g];for(;m;){for(;t.get(++r)[1]!==m;);s.push(r),m._tokenizer||(d=o.sliceStream(m),m.next||d.push(null),u&&i.defineSkip(m.start),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(d),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),u=m,m=m.next}for(m=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(g=f+1,p.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(i.events=[],m?(m._tokenizer=void 0,m.previous=void 0):p.pop(),f=p.length;f--;){const b=a.slice(p[f],p[f+1]),x=s.pop();l.push([x,x+b.length-1]),t.splice(x,2,b)}for(l.reverse(),f=-1;++f<l.length;)c[_+l[f][0]]=_+l[f][1],_+=l[f][1]-l[f][0]-1;return c}const MP={resolve:function(t){return Bk(t),t},tokenize:function(t,e){let n;return function(i){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),o(i)};function o(i){return i===null?r(i):Ke(i)?t.check(OP,s,r)(i):(t.consume(i),o)}function r(i){return t.exit("chunkContent"),t.exit("content"),e(i)}function s(i){return t.consume(i),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}},OP={partial:!0,tokenize:function(t,e,n){const o=this;return function(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),bt(t,r,"linePrefix")};function r(s){if(s===null||Ke(s))return n(s);const i=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?e(s):t.interrupt(o.parser.constructs.flow,n,e)(s)}}};function Uk(t,e,n,o,r,s,i,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return function(p){return p===60?(t.enter(o),t.enter(r),t.enter(s),t.consume(p),t.exit(s),u):p===null||p===32||p===41||Tf(p)?n(p):(t.enter(o),t.enter(i),t.enter(a),t.enter("chunkString",{contentType:"string"}),_(p))};function u(p){return p===62?(t.enter(s),t.consume(p),t.exit(s),t.exit(r),t.exit(o),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===62?(t.exit("chunkString"),t.exit(a),u(p)):p===null||p===60||Ke(p)?n(p):(t.consume(p),p===92?m:f)}function m(p){return p===60||p===62||p===92?(t.consume(p),f):f(p)}function _(p){return d||p!==null&&p!==41&&!bn(p)?d<c&&p===40?(t.consume(p),d++,_):p===41?(t.consume(p),d--,_):p===null||p===32||p===40||Tf(p)?n(p):(t.consume(p),p===92?g:_):(t.exit("chunkString"),t.exit(a),t.exit(i),t.exit(o),e(p))}function g(p){return p===40||p===41||p===92?(t.consume(p),_):_(p)}}function Vk(t,e,n,o,r,s){const i=this;let a,l=0;return function(f){return t.enter(o),t.enter(r),t.consume(f),t.exit(r),t.enter(s),c};function c(f){return l>999||f===null||f===91||f===93&&!a||f===94&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?n(f):f===93?(t.exit(s),t.enter(r),t.consume(f),t.exit(r),t.exit(o),e):Ke(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||Ke(f)||l++>999?(t.exit("chunkString"),c(f)):(t.consume(f),a||(a=!ht(f)),f===92?u:d)}function u(f){return f===91||f===92||f===93?(t.consume(f),l++,d):d(f)}}function $k(t,e,n,o,r,s){let i;return function(u){return u===34||u===39||u===40?(t.enter(o),t.enter(r),t.consume(u),t.exit(r),i=u===40?41:u,a):n(u)};function a(u){return u===i?(t.enter(r),t.consume(u),t.exit(r),t.exit(o),e):(t.enter(s),l(u))}function l(u){return u===i?(t.exit(s),a(i)):u===null?n(u):Ke(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),bt(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(u))}function c(u){return u===i||u===null||Ke(u)?(t.exit("chunkString"),l(u)):(t.consume(u),u===92?d:c)}function d(u){return u===i||u===92?(t.consume(u),c):c(u)}}function Ki(t,e){let n;return function o(r){return Ke(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,o):ht(r)?bt(t,o,n?"linePrefix":"lineSuffix")(r):e(r)}}const DP={name:"definition",tokenize:function(t,e,n){const o=this;let r;return function(u){return t.enter("definition"),function(f){return Vk.call(o,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}(u)};function s(u){return r=ys(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),u===58?(t.enter("definitionMarker"),t.consume(u),t.exit("definitionMarker"),i):n(u)}function i(u){return bn(u)?Ki(t,a)(u):a(u)}function a(u){return Uk(t,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(u)}function l(u){return t.attempt(RP,c,c)(u)}function c(u){return ht(u)?bt(t,d,"whitespace")(u):d(u)}function d(u){return u===null||Ke(u)?(t.exit("definition"),o.parser.defined.push(r),e(u)):n(u)}}},RP={partial:!0,tokenize:function(t,e,n){return function(i){return bn(i)?Ki(t,o)(i):n(i)};function o(i){return $k(t,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function r(i){return ht(i)?bt(t,s,"whitespace")(i):s(i)}function s(i){return i===null||Ke(i)?e(i):n(i)}}},PP={name:"hardBreakEscape",tokenize:function(t,e,n){return function(r){return t.enter("hardBreakEscape"),t.consume(r),o};function o(r){return Ke(r)?(t.exit("hardBreakEscape"),e(r)):n(r)}}},LP={name:"headingAtx",resolve:function(t,e){let n,o,r=t.length-2,s=3;return t[s][1].type==="whitespace"&&(s+=2),r-2>s&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&t[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(n={type:"atxHeadingText",start:t[s][1].start,end:t[r][1].end},o={type:"chunkText",start:t[s][1].start,end:t[r][1].end,contentType:"text"},co(t,s,r-s+1,[["enter",n,e],["enter",o,e],["exit",o,e],["exit",n,e]])),t},tokenize:function(t,e,n){let o=0;return function(l){return t.enter("atxHeading"),function(c){return t.enter("atxHeadingSequence"),r(c)}(l)};function r(l){return l===35&&o++<6?(t.consume(l),r):l===null||bn(l)?(t.exit("atxHeadingSequence"),s(l)):n(l)}function s(l){return l===35?(t.enter("atxHeadingSequence"),i(l)):l===null||Ke(l)?(t.exit("atxHeading"),e(l)):ht(l)?bt(t,s,"whitespace")(l):(t.enter("atxHeadingText"),a(l))}function i(l){return l===35?(t.consume(l),i):(t.exit("atxHeadingSequence"),s(l))}function a(l){return l===null||l===35||bn(l)?(t.exit("atxHeadingText"),s(l)):(t.consume(l),a)}}},FP=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Hk=["pre","script","style","textarea"],zP={concrete:!0,name:"htmlFlow",resolveTo:function(t){let e=t.length;for(;e--&&(t[e][0]!=="enter"||t[e][1].type!=="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t},tokenize:function(t,e,n){const o=this;let r,s,i,a,l;return function(N){return function(H){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(H),c}(N)};function c(N){return N===33?(t.consume(N),d):N===47?(t.consume(N),s=!0,m):N===63?(t.consume(N),r=3,o.interrupt?e:L):uo(N)?(t.consume(N),i=String.fromCharCode(N),_):n(N)}function d(N){return N===45?(t.consume(N),r=2,u):N===91?(t.consume(N),r=5,a=0,f):uo(N)?(t.consume(N),r=4,o.interrupt?e:L):n(N)}function u(N){return N===45?(t.consume(N),o.interrupt?e:L):n(N)}function f(N){return N==="CDATA[".charCodeAt(a++)?(t.consume(N),a===6?o.interrupt?e:T:f):n(N)}function m(N){return uo(N)?(t.consume(N),i=String.fromCharCode(N),_):n(N)}function _(N){if(N===null||N===47||N===62||bn(N)){const H=N===47,Y=i.toLowerCase();return H||s||!Hk.includes(Y)?FP.includes(i.toLowerCase())?(r=6,H?(t.consume(N),g):o.interrupt?e(N):T(N)):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(N):s?p(N):b(N)):(r=1,o.interrupt?e(N):T(N))}return N===45||Sn(N)?(t.consume(N),i+=String.fromCharCode(N),_):n(N)}function g(N){return N===62?(t.consume(N),o.interrupt?e:T):n(N)}function p(N){return ht(N)?(t.consume(N),p):E(N)}function b(N){return N===47?(t.consume(N),E):N===58||N===95||uo(N)?(t.consume(N),x):ht(N)?(t.consume(N),b):E(N)}function x(N){return N===45||N===46||N===58||N===95||Sn(N)?(t.consume(N),x):y(N)}function y(N){return N===61?(t.consume(N),v):ht(N)?(t.consume(N),y):b(N)}function v(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),l=N,S):ht(N)?(t.consume(N),v):k(N)}function S(N){return N===l?(t.consume(N),l=null,j):N===null||Ke(N)?n(N):(t.consume(N),S)}function k(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||bn(N)?y(N):(t.consume(N),k)}function j(N){return N===47||N===62||ht(N)?b(N):n(N)}function E(N){return N===62?(t.consume(N),I):n(N)}function I(N){return N===null||Ke(N)?T(N):ht(N)?(t.consume(N),I):n(N)}function T(N){return N===45&&r===2?(t.consume(N),O):N===60&&r===1?(t.consume(N),z):N===62&&r===4?(t.consume(N),C):N===63&&r===3?(t.consume(N),L):N===93&&r===5?(t.consume(N),V):!Ke(N)||r!==6&&r!==7?N===null||Ke(N)?(t.exit("htmlFlowData"),M(N)):(t.consume(N),T):(t.exit("htmlFlowData"),t.check(BP,$,M)(N))}function M(N){return t.check(UP,R,$)(N)}function R(N){return t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),B}function B(N){return N===null||Ke(N)?M(N):(t.enter("htmlFlowData"),T(N))}function O(N){return N===45?(t.consume(N),L):T(N)}function z(N){return N===47?(t.consume(N),i="",F):T(N)}function F(N){if(N===62){const H=i.toLowerCase();return Hk.includes(H)?(t.consume(N),C):T(N)}return uo(N)&&i.length<8?(t.consume(N),i+=String.fromCharCode(N),F):T(N)}function V(N){return N===93?(t.consume(N),L):T(N)}function L(N){return N===62?(t.consume(N),C):N===45&&r===2?(t.consume(N),L):T(N)}function C(N){return N===null||Ke(N)?(t.exit("htmlFlowData"),$(N)):(t.consume(N),C)}function $(N){return t.exit("htmlFlow"),e(N)}}},BP={partial:!0,tokenize:function(t,e,n){return function(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(ql,e,n)}}},UP={partial:!0,tokenize:function(t,e,n){const o=this;return function(s){return Ke(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),r):n(s)};function r(s){return o.parser.lazy[o.now().line]?n(s):e(s)}}},VP={name:"htmlText",tokenize:function(t,e,n){const o=this;let r,s,i;return function(C){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(C),a};function a(C){return C===33?(t.consume(C),l):C===47?(t.consume(C),v):C===63?(t.consume(C),x):uo(C)?(t.consume(C),j):n(C)}function l(C){return C===45?(t.consume(C),c):C===91?(t.consume(C),s=0,m):uo(C)?(t.consume(C),b):n(C)}function c(C){return C===45?(t.consume(C),f):n(C)}function d(C){return C===null?n(C):C===45?(t.consume(C),u):Ke(C)?(i=d,F(C)):(t.consume(C),d)}function u(C){return C===45?(t.consume(C),f):d(C)}function f(C){return C===62?z(C):C===45?u(C):d(C)}function m(C){return C==="CDATA[".charCodeAt(s++)?(t.consume(C),s===6?_:m):n(C)}function _(C){return C===null?n(C):C===93?(t.consume(C),g):Ke(C)?(i=_,F(C)):(t.consume(C),_)}function g(C){return C===93?(t.consume(C),p):_(C)}function p(C){return C===62?z(C):C===93?(t.consume(C),p):_(C)}function b(C){return C===null||C===62?z(C):Ke(C)?(i=b,F(C)):(t.consume(C),b)}function x(C){return C===null?n(C):C===63?(t.consume(C),y):Ke(C)?(i=x,F(C)):(t.consume(C),x)}function y(C){return C===62?z(C):x(C)}function v(C){return uo(C)?(t.consume(C),S):n(C)}function S(C){return C===45||Sn(C)?(t.consume(C),S):k(C)}function k(C){return Ke(C)?(i=k,F(C)):ht(C)?(t.consume(C),k):z(C)}function j(C){return C===45||Sn(C)?(t.consume(C),j):C===47||C===62||bn(C)?E(C):n(C)}function E(C){return C===47?(t.consume(C),z):C===58||C===95||uo(C)?(t.consume(C),I):Ke(C)?(i=E,F(C)):ht(C)?(t.consume(C),E):z(C)}function I(C){return C===45||C===46||C===58||C===95||Sn(C)?(t.consume(C),I):T(C)}function T(C){return C===61?(t.consume(C),M):Ke(C)?(i=T,F(C)):ht(C)?(t.consume(C),T):E(C)}function M(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(t.consume(C),r=C,R):Ke(C)?(i=M,F(C)):ht(C)?(t.consume(C),M):(t.consume(C),B)}function R(C){return C===r?(t.consume(C),r=void 0,O):C===null?n(C):Ke(C)?(i=R,F(C)):(t.consume(C),R)}function B(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||bn(C)?E(C):(t.consume(C),B)}function O(C){return C===47||C===62||bn(C)?E(C):n(C)}function z(C){return C===62?(t.consume(C),t.exit("htmlTextData"),t.exit("htmlText"),e):n(C)}function F(C){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),V}function V(C){return ht(C)?bt(t,L,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):L(C)}function L(C){return t.enter("htmlTextData"),i(C)}}},Pf={name:"labelEnd",resolveAll:function(t){let e=-1;const n=[];for(;++e<t.length;){const o=t[e][1];if(n.push(t[e]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const r=o.type==="labelImage"?4:2;o.type="data",e+=r}}return t.length!==n.length&&co(t,0,t.length,n),t},resolveTo:function(t,e){let n,o,r,s,i=t.length,a=0;for(;i--;)if(n=t[i][1],o){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;t[i][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(r){if(t[i][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(o=i,n.type!=="labelLink")){a=2;break}}else n.type==="labelEnd"&&(r=i);const l={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},c={type:"label",start:{...t[o][1].start},end:{...t[r][1].end}},d={type:"labelText",start:{...t[o+a+2][1].end},end:{...t[r-2][1].start}};return s=[["enter",l,e],["enter",c,e]],s=Bn(s,t.slice(o+1,o+a+3)),s=Bn(s,[["enter",d,e]]),s=Bn(s,Of(e.parser.constructs.insideSpan.null,t.slice(o+a+4,r-3),e)),s=Bn(s,[["exit",d,e],t[r-2],t[r-1],["exit",c,e]]),s=Bn(s,t.slice(r+1)),s=Bn(s,[["exit",l,e]]),co(t,o,t.length,s),t},tokenize:function(t,e,n){const o=this;let r,s,i=o.events.length;for(;i--;)if((o.events[i][1].type==="labelImage"||o.events[i][1].type==="labelLink")&&!o.events[i][1]._balanced){r=o.events[i][1];break}return function(u){return r?r._inactive?d(u):(s=o.parser.defined.includes(ys(o.sliceSerialize({start:r.end,end:o.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelEnd"),a):n(u)};function a(u){return u===40?t.attempt($P,c,s?c:d)(u):u===91?t.attempt(HP,c,s?l:d)(u):s?c(u):d(u)}function l(u){return t.attempt(WP,c,d)(u)}function c(u){return e(u)}function d(u){return r._balanced=!0,n(u)}}},$P={tokenize:function(t,e,n){return function(d){return t.enter("resource"),t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),o};function o(d){return bn(d)?Ki(t,r)(d):r(d)}function r(d){return d===41?c(d):Uk(t,s,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return bn(d)?Ki(t,a)(d):c(d)}function i(d){return n(d)}function a(d){return d===34||d===39||d===40?$k(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function l(d){return bn(d)?Ki(t,c)(d):c(d)}function c(d){return d===41?(t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),t.exit("resource"),e):n(d)}}},HP={tokenize:function(t,e,n){const o=this;return function(i){return Vk.call(o,t,r,s,"reference","referenceMarker","referenceString")(i)};function r(i){return o.parser.defined.includes(ys(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?e(i):n(i)}function s(i){return n(i)}}},WP={tokenize:function(t,e,n){return function(r){return t.enter("reference"),t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),o};function o(r){return r===93?(t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),t.exit("reference"),e):n(r)}}},qP={name:"labelStartImage",resolveAll:Pf.resolveAll,tokenize:function(t,e,n){const o=this;return function(i){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(i),t.exit("labelImageMarker"),r};function r(i){return i===91?(t.enter("labelMarker"),t.consume(i),t.exit("labelMarker"),t.exit("labelImage"),s):n(i)}function s(i){return i===94&&"_hiddenFootnoteSupport"in o.parser.constructs?n(i):e(i)}}},GP={name:"labelStartLink",resolveAll:Pf.resolveAll,tokenize:function(t,e,n){const o=this;return function(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),r};function r(s){return s===94&&"_hiddenFootnoteSupport"in o.parser.constructs?n(s):e(s)}}},Lf={name:"lineEnding",tokenize:function(t,e){return function(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),bt(t,e,"linePrefix")}}},Gl={name:"thematicBreak",tokenize:function(t,e,n){let o,r=0;return function(a){return t.enter("thematicBreak"),function(l){return o=l,s(l)}(a)};function s(a){return a===o?(t.enter("thematicBreakSequence"),i(a)):r>=3&&(a===null||Ke(a))?(t.exit("thematicBreak"),e(a)):n(a)}function i(a){return a===o?(t.consume(a),r++,i):(t.exit("thematicBreakSequence"),ht(a)?bt(t,s,"whitespace")(a):s(a))}}},yn={continuation:{tokenize:function(t,e,n){const o=this;return o.containerState._closeFlow=void 0,t.check(ql,r,s);function r(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,bt(t,e,"listItemIndent",o.containerState.size+1)(a)}function s(a){return o.containerState.furtherBlankLines||!ht(a)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,i(a)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,t.attempt(JP,e,i)(a))}function i(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,bt(t,t.attempt(yn,e,n),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(t){t.exit(this.containerState.type)},name:"list",tokenize:function(t,e,n){const o=this,r=o.events[o.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,i=0;return function(f){const m=o.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!o.containerState.marker||f===o.containerState.marker:Mf(f)){if(o.containerState.type||(o.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(Gl,n,l)(f):l(f);if(!o.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),a(f)}return n(f)};function a(f){return Mf(f)&&++i<10?(t.consume(f),a):(!o.interrupt||i<2)&&(o.containerState.marker?f===o.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),l(f)):n(f)}function l(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||f,t.check(ql,o.interrupt?n:c,t.attempt(YP,u,d))}function c(f){return o.containerState.initialBlankLine=!0,s++,u(f)}function d(f){return ht(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),u):n(f)}function u(f){return o.containerState.size=s+o.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}},YP={partial:!0,tokenize:function(t,e,n){const o=this;return bt(t,function(r){const s=o.events[o.events.length-1];return!ht(r)&&s&&s[1].type==="listItemPrefixWhitespace"?e(r):n(r)},"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},JP={partial:!0,tokenize:function(t,e,n){const o=this;return bt(t,function(r){const s=o.events[o.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===o.containerState.size?e(r):n(r)},"listItemIndent",o.containerState.size+1)}},Wk={name:"setextUnderline",resolveTo:function(t,e){let n,o,r,s=t.length;for(;s--;)if(t[s][0]==="enter"){if(t[s][1].type==="content"){n=s;break}t[s][1].type==="paragraph"&&(o=s)}else t[s][1].type==="content"&&t.splice(s,1),r||t[s][1].type!=="definition"||(r=s);const i={type:"setextHeading",start:{...t[o][1].start},end:{...t[t.length-1][1].end}};return t[o][1].type="setextHeadingText",r?(t.splice(o,0,["enter",i,e]),t.splice(r+1,0,["exit",t[n][1],e]),t[n][1].end={...t[r][1].end}):t[n][1]=i,t.push(["exit",i,e]),t},tokenize:function(t,e,n){const o=this;let r;return function(a){let l,c=o.events.length;for(;c--;)if(o.events[c][1].type!=="lineEnding"&&o.events[c][1].type!=="linePrefix"&&o.events[c][1].type!=="content"){l=o.events[c][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||l)?(t.enter("setextHeadingLine"),r=a,function(d){return t.enter("setextHeadingLineSequence"),s(d)}(a)):n(a)};function s(a){return a===r?(t.consume(a),s):(t.exit("setextHeadingLineSequence"),ht(a)?bt(t,i,"lineSuffix")(a):i(a))}function i(a){return a===null||Ke(a)?(t.exit("setextHeadingLine"),e(a)):n(a)}}},KP={tokenize:function(t){const e=this,n=t.attempt(ql,function(r){return r===null?void t.consume(r):(t.enter("lineEndingBlank"),t.consume(r),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n)},t.attempt(this.parser.constructs.flowInitial,o,bt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(MP,o)),"linePrefix")));return n;function o(r){if(r!==null)return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),e.currentConstruct=void 0,n;t.consume(r)}}},XP={resolveAll:Gk()},ZP=qk("string"),QP=qk("text");function qk(t){return{resolveAll:Gk(t==="text"?eL:void 0),tokenize:function(e){const n=this,o=this.parser.constructs[t],r=e.attempt(o,s,i);return s;function s(c){return l(c)?r(c):i(c)}function i(c){if(c!==null)return e.enter("data"),e.consume(c),a;e.consume(c)}function a(c){return l(c)?(e.exit("data"),r(c)):(e.consume(c),a)}function l(c){if(c===null)return!0;const d=o[c];let u=-1;if(d)for(;++u<d.length;){const f=d[u];if(!f.previous||f.previous.call(n,n.previous))return!0}return!1}}}}function Gk(t){return function(e,n){let o,r=-1;for(;++r<=e.length;)o===void 0?e[r]&&e[r][1].type==="data"&&(o=r,r++):e[r]&&e[r][1].type==="data"||(r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),r=o+2),o=void 0);return t?t(e,n):e}}function eL(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const o=t[n-1][1],r=e.sliceStream(o);let s,i=r.length,a=-1,l=0;for(;i--;){const c=r[i];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(c===-2)s=!0,l++;else if(c!==-1){i++;break}}if(l){const c={type:n===t.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:o.start._bufferIndex+a,_index:o.start._index+i,line:o.end.line,column:o.end.column-l,offset:o.end.offset-l},end:{...o.end}};o.end={...c.start},o.start.offset===o.end.offset?Object.assign(o,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}const tL={42:yn,43:yn,45:yn,48:yn,49:yn,50:yn,51:yn,52:yn,53:yn,54:yn,55:yn,56:yn,57:yn,62:Rk},nL={91:DP},oL={[-2]:Rf,[-1]:Rf,32:Rf},rL={35:LP,42:Gl,45:[Wk,Gl],60:zP,61:Wk,95:Gl,96:zk,126:zk},sL={38:Lk,92:Pk},iL={[-5]:Lf,[-4]:Lf,[-3]:Lf,33:qP,38:Lk,42:Df,60:[jP,VP],91:GP,92:[PP,Pk],93:Pf,95:Df,96:IP},aL={null:[Df,XP]},lL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:nL,disable:{null:[]},document:tL,flow:rL,flowInitial:oL,insideSpan:aL,string:sL,text:iL},Symbol.toStringTag,{value:"Module"}));function cL(t,e,n){let o={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},s=[];let i=[],a=[];const l={attempt:p(function(y,v){b(y,v.from)}),check:p(g),consume:function(y){Ke(y)?(o.line++,o.column=1,o.offset+=y===-3?2:1,x()):y!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===i[o._index].length&&(o._bufferIndex=-1,o._index++)),c.previous=y},enter:function(y,v){const S=v||{};return S.type=y,S.start=f(),c.events.push(["enter",S,c]),a.push(S),S},exit:function(y){const v=a.pop();return v.end=f(),c.events.push(["exit",v,c]),v},interrupt:p(g,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(y){r[y.line]=y.column,x()},events:[],now:f,parser:t,previous:null,sliceSerialize:function(y,v){return function(S,k){let j=-1;const E=[];let I;for(;++j<S.length;){const T=S[j];let M;if(typeof T=="string")M=T;else switch(T){case-5:M="\r";break;case-4:M=`
|
120
120
|
`;break;case-3:M=`\r
|
121
121
|
`;break;case-2:M=k?" ":" ";break;case-1:if(!k&&I)continue;M=" ";break;default:M=String.fromCharCode(T)}I=T===-2,E.push(M)}return E.join("")}(u(y),v)},sliceStream:u,write:function(y){return i=Bn(i,y),m(),i[i.length-1]!==null?[]:(b(e,0),c.events=Of(s,c.events,c),c.events)}};let d=e.tokenize.call(c,l);return e.resolveAll&&s.push(e),c;function u(y){return function(v,S){const k=S.start._index,j=S.start._bufferIndex,E=S.end._index,I=S.end._bufferIndex;let T;if(k===E)T=[v[k].slice(j,I)];else{if(T=v.slice(k,E),j>-1){const M=T[0];typeof M=="string"?T[0]=M.slice(j):T.shift()}I>0&&T.push(v[E].slice(0,I))}return T}(i,y)}function f(){const{_bufferIndex:y,_index:v,line:S,column:k,offset:j}=o;return{_bufferIndex:y,_index:v,line:S,column:k,offset:j}}function m(){let y;for(;o._index<i.length;){const v=i[o._index];if(typeof v=="string")for(y=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===y&&o._bufferIndex<v.length;)_(v.charCodeAt(o._bufferIndex));else _(v)}}function _(y){d=d(y)}function g(y,v){v.restore()}function p(y,v){return function(S,k,j){let E,I,T,M;return Array.isArray(S)?R(S):"tokenize"in S?R([S]):function(F){return V;function V(L){const C=L!==null&&F[L],$=L!==null&&F.null;return R([...Array.isArray(C)?C:C?[C]:[],...Array.isArray($)?$:$?[$]:[]])(L)}}(S);function R(F){return E=F,I=0,F.length===0?j:B(F[I])}function B(F){return function(V){return M=function(){const L=f(),C=c.previous,$=c.currentConstruct,N=c.events.length,H=Array.from(a);return{from:N,restore:Y};function Y(){o=L,c.previous=C,c.currentConstruct=$,c.events.length=N,a=H,x()}}(),T=F,F.partial||(c.currentConstruct=F),F.name&&c.parser.constructs.disable.null.includes(F.name)?z():F.tokenize.call(v?Object.assign(Object.create(c),v):c,l,O,z)(V)}}function O(F){return y(T,M),k}function z(F){return M.restore(),++I<E.length?B(E[I]):j}}}function b(y,v){y.resolveAll&&!s.includes(y)&&s.push(y),y.resolve&&co(c.events,v,c.events.length-v,y.resolve(c.events.slice(v),c)),y.resolveTo&&(c.events=y.resolveTo(c.events,c))}function x(){o.line in r&&o.column<2&&(o.column=r[o.line],o.offset+=r[o.line]-1)}}function dL(t){const e=function(r){const s={};let i=-1;for(;++i<r.length;)bP(s,r[i]);return s}([lL,...(t||{}).extensions||[]]),n={constructs:e,content:o(CP),defined:[],document:o(NP),flow:o(KP),lazy:{},string:o(ZP),text:o(QP)};return n;function o(r){return function(s){return cL(n,r,s)}}}const Yk=/[\0\t\n\r]/g,uL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hL(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),r=o===120||o===88;return Tk(n.slice(r?2:1),r?16:10)}return Af(n)||t}const Jk={}.hasOwnProperty;function fL(t,e,n){return typeof e!="string"&&(n=e,e=void 0),function(o){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Fe),autolinkProtocol:R,autolinkEmail:R,atxHeading:l(ce),blockQuote:l(de),characterEscape:R,characterReference:R,codeFenced:l(he),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(he,c),codeText:l(se,c),codeTextData:R,data:R,codeFlowValue:R,definition:l(ye),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(je),hardBreakEscape:l(Ee),hardBreakTrailing:l(Ee),htmlFlow:l(_e,c),htmlFlowData:R,htmlText:l(_e,c),htmlTextData:R,image:l(De),label:c,link:l(Fe),listItem:l(Xe),listItemValue:g,listOrdered:l(He,_),listUnordered:l(He),paragraph:l(Le),reference:re,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(ce),strong:l(et),thematicBreak:l(it)},exit:{atxHeading:u(),atxHeadingSequence:E,autolink:u(),autolinkEmail:fe,autolinkProtocol:le,blockQuote:u(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:G,characterReference:Q,codeFenced:u(y),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:b,codeFlowValue:B,codeIndented:u(v),codeText:u(L),codeTextData:B,data:B,definition:u(),definitionDestinationString:j,definitionLabelString:S,definitionTitleString:k,emphasis:u(),hardBreakEscape:u(z),hardBreakTrailing:u(z),htmlFlow:u(F),htmlFlowData:B,htmlText:u(V),htmlTextData:B,image:u($),label:H,labelText:N,lineEnding:O,link:u(C),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ne,resourceDestinationString:Y,resourceTitleString:Z,resource:q,setextHeading:u(M),setextHeadingLineSequence:T,setextHeadingText:I,strong:u(),thematicBreak:u()}};Kk(r,(o||{}).mdastExtensions||[]);const s={};return i;function i(te){let ke={type:"root",children:[]};const Ie={stack:[ke],tokenStack:[],config:r,enter:d,exit:f,buffer:c,resume:m,data:s},ze=[];let J=-1;for(;++J<te.length;)(te[J][1].type==="listOrdered"||te[J][1].type==="listUnordered")&&(te[J][0]==="enter"?ze.push(J):J=a(te,ze.pop(),J));for(J=-1;++J<te.length;){const pe=r[te[J][0]];Jk.call(pe,te[J][1].type)&&pe[te[J][1].type].call(Object.assign({sliceSerialize:te[J][2].sliceSerialize},Ie),te[J][1])}if(Ie.tokenStack.length>0){const pe=Ie.tokenStack[Ie.tokenStack.length-1];(pe[1]||Xk).call(Ie,void 0,pe[0])}for(ke.position={start:ir(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:ir(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<r.transforms.length;)ke=r.transforms[J](ke)||ke;return ke}function a(te,ke,Ie){let ze,J,pe,ge,ue=ke-1,Se=-1,we=!1;for(;++ue<=Ie;){const Ue=te[ue];switch(Ue[1].type){case"listUnordered":case"listOrdered":case"blockQuote":Ue[0]==="enter"?Se++:Se--,ge=void 0;break;case"lineEndingBlank":Ue[0]==="enter"&&(!ze||ge||Se||pe||(pe=ue),ge=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ge=void 0}if(!Se&&Ue[0]==="enter"&&Ue[1].type==="listItemPrefix"||Se===-1&&Ue[0]==="exit"&&(Ue[1].type==="listUnordered"||Ue[1].type==="listOrdered")){if(ze){let Ze=ue;for(J=void 0;Ze--;){const ae=te[Ze];if(ae[1].type==="lineEnding"||ae[1].type==="lineEndingBlank"){if(ae[0]==="exit")continue;J&&(te[J][1].type="lineEndingBlank",we=!0),ae[1].type="lineEnding",J=Ze}else if(ae[1].type!=="linePrefix"&&ae[1].type!=="blockQuotePrefix"&&ae[1].type!=="blockQuotePrefixWhitespace"&&ae[1].type!=="blockQuoteMarker"&&ae[1].type!=="listItemIndent")break}pe&&(!J||pe<J)&&(ze._spread=!0),ze.end=Object.assign({},J?te[J][1].start:Ue[1].end),te.splice(J||ue,0,["exit",ze,Ue[2]]),ue++,Ie++}if(Ue[1].type==="listItemPrefix"){const Ze={type:"listItem",_spread:!1,start:Object.assign({},Ue[1].start),end:void 0};ze=Ze,te.splice(ue,0,["enter",Ze,Ue[2]]),ue++,Ie++,pe=void 0,ge=!0}}}return te[ke][1]._spread=we,Ie}function l(te,ke){return Ie;function Ie(ze){d.call(this,te(ze),ze),ke&&ke.call(this,ze)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(te,ke,Ie){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([ke,Ie||void 0]),te.position={start:ir(ke.start),end:void 0}}function u(te){return ke;function ke(Ie){te&&te.call(this,Ie),f.call(this,Ie)}}function f(te,ke){const Ie=this.stack.pop(),ze=this.tokenStack.pop();if(!ze)throw new Error("Cannot close `"+te.type+"` ("+Gi({start:te.start,end:te.end})+"): it\u2019s not open");ze[0].type!==te.type&&(ke?ke.call(this,te,ze[0]):(ze[1]||Xk).call(this,te,ze[0])),Ie.position.end=ir(te.end)}function m(){return function(te){return jk(te,typeof Wl.includeImageAlt!="boolean"||Wl.includeImageAlt,typeof Wl.includeHtml!="boolean"||Wl.includeHtml)}(this.stack.pop())}function _(){this.data.expectingFirstListItemValue=!0}function g(te){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0)}function p(){const te=this.resume();this.stack[this.stack.length-1].lang=te}function b(){const te=this.resume();this.stack[this.stack.length-1].meta=te}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const te=this.resume();this.stack[this.stack.length-1].value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const te=this.resume();this.stack[this.stack.length-1].value=te.replace(/(\r?\n|\r)$/g,"")}function S(te){const ke=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=ke,Ie.identifier=ys(this.sliceSerialize(te)).toLowerCase()}function k(){const te=this.resume();this.stack[this.stack.length-1].title=te}function j(){const te=this.resume();this.stack[this.stack.length-1].url=te}function E(te){const ke=this.stack[this.stack.length-1];if(!ke.depth){const Ie=this.sliceSerialize(te).length;ke.depth=Ie}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function T(te){this.stack[this.stack.length-1].depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function R(te){const ke=this.stack[this.stack.length-1].children;let Ie=ke[ke.length-1];Ie&&Ie.type==="text"||(Ie=nt(),Ie.position={start:ir(te.start),end:void 0},ke.push(Ie)),this.stack.push(Ie)}function B(te){const ke=this.stack.pop();ke.value+=this.sliceSerialize(te),ke.position.end=ir(te.end)}function O(te){const ke=this.stack[this.stack.length-1];if(this.data.atHardBreak)return ke.children[ke.children.length-1].position.end=ir(te.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(ke.type)&&(R.call(this,te),B.call(this,te))}function z(){this.data.atHardBreak=!0}function F(){const te=this.resume();this.stack[this.stack.length-1].value=te}function V(){const te=this.resume();this.stack[this.stack.length-1].value=te}function L(){const te=this.resume();this.stack[this.stack.length-1].value=te}function C(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=ke,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function $(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=ke,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function N(te){const ke=this.sliceSerialize(te),Ie=this.stack[this.stack.length-2];Ie.label=function(ze){return ze.replace(uL,hL)}(ke),Ie.identifier=ys(ke).toLowerCase()}function H(){const te=this.stack[this.stack.length-1],ke=this.resume(),Ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ie.type==="link"){const ze=te.children;Ie.children=ze}else Ie.alt=ke}function Y(){const te=this.resume();this.stack[this.stack.length-1].url=te}function Z(){const te=this.resume();this.stack[this.stack.length-1].title=te}function q(){this.data.inReference=void 0}function re(){this.data.referenceType="collapsed"}function ne(te){const ke=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=ke,Ie.identifier=ys(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function oe(te){this.data.characterReferenceType=te.type}function G(te){const ke=this.sliceSerialize(te),Ie=this.data.characterReferenceType;let ze;Ie?(ze=Tk(ke,Ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ze=Af(ke),this.stack[this.stack.length-1].value+=ze}function Q(te){this.stack.pop().position.end=ir(te.end)}function le(te){B.call(this,te),this.stack[this.stack.length-1].url=this.sliceSerialize(te)}function fe(te){B.call(this,te),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(te)}function de(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function je(){return{type:"emphasis",children:[]}}function ce(){return{type:"heading",depth:0,children:[]}}function Ee(){return{type:"break"}}function _e(){return{type:"html",value:""}}function De(){return{type:"image",title:null,url:"",alt:null}}function Fe(){return{type:"link",title:null,url:"",children:[]}}function He(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Xe(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Le(){return{type:"paragraph",children:[]}}function et(){return{type:"strong",children:[]}}function nt(){return{type:"text",value:""}}function it(){return{type:"thematicBreak"}}}(n)(function(o){for(;!Bk(o););return o}(dL(n).document().write(function(){let o,r=1,s="",i=!0;return function(a,l,c){const d=[];let u,f,m,_,g;for(a=s+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,s="",i&&(a.charCodeAt(0)===65279&&m++,i=void 0);m<a.length;){if(Yk.lastIndex=m,u=Yk.exec(a),_=u&&u.index!==void 0?u.index:a.length,g=a.charCodeAt(_),!u){s=a.slice(m);break}if(g===10&&m===_&&o)d.push(-3),o=void 0;else switch(o&&(d.push(-5),o=void 0),m<_&&(d.push(a.slice(m,_)),r+=_-m),g){case 0:d.push(65533),r++;break;case 9:for(f=4*Math.ceil(r/4),d.push(-2);r++<f;)d.push(-1);break;case 10:d.push(-4),r=1;break;default:o=!0,r=1}m=_+1}return c&&(o&&d.push(-5),s&&d.push(s),d.push(null)),d}}()(t,e,!0))))}function ir(t){return{line:t.line,column:t.column,offset:t.offset}}function Kk(t,e){let n=-1;for(;++n<e.length;){const o=e[n];Array.isArray(o)?Kk(t,o):mL(t,o)}}function mL(t,e){let n;for(n in e)if(Jk.call(e,n))switch(n){case"canContainEols":{const o=e[n];o&&t[n].push(...o);break}case"transforms":{const o=e[n];o&&t[n].push(...o);break}case"enter":case"exit":{const o=e[n];o&&Object.assign(t[n],o);break}}}function Xk(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Gi({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Gi({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Gi({start:e.start,end:e.end})+") is still open")}function pL(t){const e=this;e.parser=function(n){return fL(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Zk(t,e){const n=e.referenceType;let o="]";if(n==="collapsed"?o+="[]":n==="full"&&(o+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+o}];const r=t.all(e),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const i=r[r.length-1];return i&&i.type==="text"?i.value+=o:r.push({type:"text",value:o}),r}function Qk(t){const e=t.spread;return e??t.children.length>1}function gL(t){const e=String(t),n=/\r?\n|\r/g;let o=n.exec(e),r=0;const s=[];for(;o;)s.push(e3(e.slice(r,o.index),r>0,!0),o[0]),r=o.index+o[0].length,o=n.exec(e);return s.push(e3(e.slice(r),r>0,!1)),s.join("")}function e3(t,e,n){let o=0,r=t.length;if(e){let s=t.codePointAt(o);for(;s===9||s===32;)o++,s=t.codePointAt(o)}if(n){let s=t.codePointAt(r-1);for(;s===9||s===32;)r--,s=t.codePointAt(r-1)}return r>o?t.slice(o,r):""}const _L={blockquote:function(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)},break:function(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
122
122
|
`}]},code:function(t,e){const n=e.value?e.value+`
|
@@ -132,4 +132,4 @@ ${t.stack}`:o}function ro(t,e){return t>>>=0,Zr().subarray(t/1,t/1+e)}function K
|
|
132
132
|
subprocess.run("${T}")`}:{language:"python",code:`_${I} = """
|
133
133
|
${T}
|
134
134
|
"""`}:{language:"python",code:T}}(o,l);o==="sql"&&Ho(a,s,i),s({code:E.code,before:!1,cellId:i??"__end__"})},e[3]=a,e[4]=s,e[5]=o,e[6]=i,e[7]=l,e[8]=f):f=e[8];const m=f;let _;e[9]!==l?(_=async()=>{await xn(l)},e[9]=l,e[10]=_):_=e[10];const g=_,p=r==="dark"?"dark":"light",b=o&&$L.has(o)?o:void 0;let x,y,v,S,k,j;return e[11]!==p||e[12]!==b||e[13]!==l?(x=h.jsx(ba,{theme:p,language:b,className:"cm border rounded overflow-hidden",extensions:VL,value:l,onChange:c}),e[11]=p,e[12]=b,e[13]=l,e[14]=x):x=e[14],e[15]!==g?(y=h.jsx(WL,{size:"xs",variant:"outline",onClick:g,children:"Copy"}),e[15]=g,e[16]=y):y=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(v=h.jsx(ni,{className:"ml-2 h-4 w-4"}),e[17]=v):v=e[17],e[18]!==m?(S=h.jsxs(Ae,{size:"xs",variant:"outline",onClick:m,children:["Add to Notebook",v]}),e[18]=m,e[19]=S):S=e[19],e[20]!==S||e[21]!==y?(k=h.jsxs("div",{className:"flex justify-end mt-2 space-x-2",children:[y,S]}),e[20]=S,e[21]=y,e[22]=k):k=e[22],e[23]!==k||e[24]!==x?(j=h.jsxs("div",{className:"relative",children:[x,k]}),e[23]=k,e[24]=x,e[25]=j):j=e[25],j},WL=t=>{const e=X.c(12);let n,o;e[0]!==t?({onClick:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);const[r,s]=A.useState(!1);let i,a,l;e[3]!==r?(i=()=>{r&&setTimeout(()=>s(!1),1e3)},a=[r],e[3]=r,e[4]=i,e[5]=a):(i=e[4],a=e[5]),A.useEffect(i,a),e[6]!==n?(l=u=>{n==null||n(u),s(!0)},e[6]=n,e[7]=l):l=e[7];const c=r?"Copied":"Copy";let d;return e[8]!==o||e[9]!==l||e[10]!==c?(d=h.jsx(Ae,{...o,onClick:l,children:c}),e[8]=o,e[9]=l,e[10]=c,e[11]=d):d=e[11],d},qL={code:({children:t,className:e})=>{const n=e==null?void 0:e.replace("language-","");return n&&typeof t=="string"?h.jsxs("div",{children:[h.jsx("div",{className:"text-xs text-muted-foreground pl-1",children:n}),h.jsx(HL,{code:t.trim(),language:n})]}):h.jsx("code",{className:e,children:t})}},b3=A.memo(t=>{const e=X.c(2),{content:n}=t;let o;return e[0]!==n?(o=h.jsx(BL,{components:qL,className:"prose dark:prose-invert max-w-none prose-pre:pl-0",children:n}),e[0]=n,e[1]=o):o=e[1],o},(t,e)=>t.content===e.content);b3.displayName="MemoizedMarkdownBlock";const y3=A.memo(({content:t})=>{const e=A.useMemo(()=>{return n=t,XV.lexer(n).map(o=>o.raw);var n},[t]);return h.jsx(h.Fragment,{children:e.map((n,o)=>h.jsx(b3,{content:n},`markdown-block-${o}`))})});y3.displayName="MarkdownRenderer";const Kf=(t,e,n,o)=>e?{...t,chats:t.chats.map(r=>r.id===e?{...r,messages:[...r.messages,{role:n,content:o,timestamp:Date.now()}],updatedAt:Date.now()}:r)}:t,GL=t=>{var v;const e=X.c(29),{onNewChat:n,activeChatId:o,setActiveChat:r,chats:s,setMessages:i}=t,a=$e(V4),{handleClick:l}=xa(),c=((v=a==null?void 0:a.open_ai)==null?void 0:v.model)||"gpt-4-turbo";let d,u,f,m,_,g,p,b,x,y;if(e[0]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(Or,{className:"h-4 w-4"}),e[0]=d):d=e[0],e[1]!==n?(u=h.jsx(Oe,{content:"New chat",children:h.jsx(Ae,{variant:"text",size:"icon",onClick:n,children:d})}),e[1]=n,e[2]=u):u=e[2],e[3]!==l?(f=()=>l("ai"),e[3]=l,e[4]=f):f=e[4],e[5]!==c||e[6]!==f?(m=h.jsx(Ae,{variant:"text",size:"xs",className:"hover:bg-foreground/10 py-2",onClick:f,children:c}),e[5]=c,e[6]=f,e[7]=m):m=e[7],e[8]!==u||e[9]!==m?(_=h.jsxs("div",{className:"flex items-center gap-2",children:[u,m]}),e[8]=u,e[9]=m,e[10]=_):_=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx(Oe,{content:"Previous chats",children:h.jsx(Js,{asChild:!0,children:h.jsx(Ae,{variant:"text",size:"icon",children:h.jsx(e$,{className:"h-4 w-4"})})})}),e[11]=g):g=e[11],e[12]!==s.length?(p=s.length===0&&h.jsx(An,{title:"No chats yet",description:"Start a new chat to get started",icon:h.jsx(ym,{})}),e[12]=s.length,e[13]=p):p=e[13],e[14]!==o||e[15]!==s||e[16]!==r||e[17]!==i){let S;e[19]!==o||e[20]!==r||e[21]!==i?(S=k=>h.jsxs("div",{className:Me("p-3 rounded-md cursor-pointer hover:bg-accent",k.id===o&&"bg-accent"),onClick:()=>{r(k.id),i(k.messages.map(KL))},children:[h.jsx("div",{className:"font-medium",children:k.title}),h.jsx("div",{className:"text-sm text-muted-foreground",children:t$(k.updatedAt)})]},k.id),e[19]=o,e[20]=r,e[21]=i,e[22]=S):S=e[22],b=s.map(S),e[14]=o,e[15]=s,e[16]=r,e[17]=i,e[18]=b}else b=e[18];return e[23]!==p||e[24]!==b?(x=h.jsxs(Mr,{children:[g,h.jsx($s,{className:"w-[520px] p-0",align:"start",side:"right",children:h.jsx(rk,{className:"h-[500px] p-4",children:h.jsxs("div",{className:"space-y-4",children:[p,b]})})})]}),e[23]=p,e[24]=b,e[25]=x):x=e[25],e[26]!==_||e[27]!==x?(y=h.jsxs("div",{className:"flex border-b px-2 py-1 justify-between flex-shrink-0 items-center",children:[_,x]}),e[26]=_,e[27]=x,e[28]=y):y=e[28],y},x3=A.memo(t=>{const e=X.c(14),{message:n,index:o,theme:r,onEdit:s,setChatState:i,chatState:a}=t,l=n.role==="user"?"justify-end":"justify-start";let c,d,u;return e[0]!==l?(c=Me("flex group relative",l),e[0]=l,e[1]=c):c=e[1],e[2]!==a||e[3]!==o||e[4]!==n.content||e[5]!==n.id||e[6]!==n.role||e[7]!==s||e[8]!==i||e[9]!==r?(d=n.role==="user"?h.jsx("div",{className:"w-[95%] bg-background border p-1 rounded-sm",children:h.jsx(Rc,{value:n.content,theme:r,placeholder:"Type your message...",onChange:XL,onSubmit:(f,m)=>{m.trim()&&(s(o,m),a.activeChatId&&i(_=>Kf(_,a.activeChatId,"user",m)))},onClose:ZL},n.id)}):h.jsxs("div",{className:"w-[95%]",children:[h.jsx("div",{className:"absolute right-1 top-1 opacity-0 group-hover:opacity-100 transition-opacity",children:h.jsx(ep,{className:"h-3 w-3",value:n.content})}),h.jsx(y3,{content:n.content})]}),e[2]=a,e[3]=o,e[4]=n.content,e[5]=n.id,e[6]=n.role,e[7]=s,e[8]=i,e[9]=r,e[10]=d):d=e[10],e[11]!==c||e[12]!==d?(u=h.jsx("div",{className:c,children:d}),e[11]=c,e[12]=d,e[13]=u):u=e[13],u});x3.displayName="ChatMessage";const w3=A.memo(t=>{var c,d;const e=X.c(8),{input:n,setInput:o,onSubmit:r,theme:s,inputRef:i}=t;let a,l;return e[0]!==((c=i.current)==null?void 0:c.editor)?(a=()=>{var u,f;return(f=(u=i.current)==null?void 0:u.editor)==null?void 0:f.blur()},e[0]=(d=i.current)==null?void 0:d.editor,e[1]=a):a=e[1],e[2]!==n||e[3]!==r||e[4]!==o||e[5]!==a||e[6]!==s?(l=h.jsx("div",{className:"px-2 py-3 border-t relative flex-shrink-0 min-h-[80px]",children:h.jsx(Rc,{value:n,onChange:o,onSubmit:r,onClose:a,theme:s,placeholder:"Type your message..."})}),e[2]=n,e[3]=r,e[4]=o,e[5]=a,e[6]=s,e[7]=l):l=e[7],l});w3.displayName="ChatInput";const YL=()=>{const t=X.c(6),e=$e(ic),{handleClick:n}=xa();if(!e){let r,s,i;return t[0]!==n?(r=h.jsx(Ae,{variant:"outline",size:"sm",onClick:()=>n("ai"),children:"Edit AI settings"}),t[0]=n,t[1]=r):r=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(ym,{}),t[2]=s):s=t[2],t[3]!==r?(i=h.jsx(An,{title:"Chat with AI",description:"AI is currently disabled. Add your API key to enable.",action:r,icon:s}),t[3]=r,t[4]=i):i=t[4],i}let o;return t[5]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(JL,{}),t[5]=o):o=t[5],o},JL=()=>{const t=X.c(74),[e,n]=hn(ld),[o,r]=hn(LS),[s,i]=A.useState(""),a=A.useRef(null),l=A.useRef(null),c=A.useRef(null),{theme:d}=po();let u,f,m;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=Mm("api/ai/chat").toString(),f=Nc.headers(),t[0]=u,t[1]=f):(u=t[0],f=t[1]),t[2]!==e.activeChatId||t[3]!==n?(m={keepLastMessageOnError:!0,experimental_throttle:100,api:u,headers:f,experimental_prepareRequestBody:eF,streamProtocol:"text",onFinish:he=>{e.activeChatId?n(se=>Kf(se,se.activeChatId,"assistant",he.content)):Qt.warn("No active chat")},onError:tF,onResponse:nF},t[2]=e.activeChatId,t[3]=n,t[4]=m):m=t[4];const{messages:_,input:g,setInput:p,setMessages:b,append:x,handleSubmit:y,error:v,status:S,reload:k,stop:j}=ZV(m),E=S==="submitted"||S==="streaming";let I;t[5]!==x||t[6]!==n||t[7]!==p||t[8]!==b?(I=he=>{const se={id:QV(),title:`${he.slice(0,30)}...`,messages:[{role:"user",content:he,timestamp:Date.now()}],createdAt:Date.now(),updatedAt:Date.now()};n(ye=>({chats:[...ye.chats,se],activeChatId:se.id})),b([]),p(""),x({role:"user",content:he})},t[5]=x,t[6]=n,t[7]=p,t[8]=b,t[9]=I):I=t[9];const T=I;let M;t[10]!==r||t[11]!==p||t[12]!==b?(M=()=>{r(null),b([]),p(""),i("")},t[10]=r,t[11]=p,t[12]=b,t[13]=M):M=t[13];const R=M;let B;t[14]!==x||t[15]!==b?(B=(he,se)=>{b(ye=>ye.slice(0,he)),x({role:"user",content:se})},t[14]=x,t[15]=b,t[16]=B):B=t[16];const O=B;let z;t[17]!==e.activeChatId||t[18]!==y||t[19]!==n?(z=(he,se)=>{se.trim()&&(y(he),e.activeChatId&&n(ye=>Kf(ye,e.activeChatId,"user",se)))},t[17]=e.activeChatId,t[18]=y,t[19]=n,t[20]=z):z=t[20];const F=z;let V;t[21]!==k?(V=()=>{k()},t[21]=k,t[22]=V):V=t[22];const L=V;let C;t[23]!==T||t[24]!==s?(C=()=>{s.trim()&&T(s.trim())},t[23]=T,t[24]=s,t[25]=C):C=t[25];const $=C;let N;t[26]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{var he,se;return(se=(he=a.current)==null?void 0:he.editor)==null?void 0:se.blur()},t[26]=N):N=t[26];const H=N,Y=o==null?void 0:o.id;let Z,q,re,ne,oe,G,Q,le,fe,de;if(t[27]!==e.chats||t[28]!==R||t[29]!==r||t[30]!==b||t[31]!==Y?(Z=h.jsx(Hm,{children:h.jsx(GL,{onNewChat:R,activeChatId:Y,setActiveChat:r,chats:e.chats,setMessages:b})}),t[27]=e.chats,t[28]=R,t[29]=r,t[30]=b,t[31]=Y,t[32]=Z):Z=t[32],t[33]!==$||t[34]!==_||t[35]!==s||t[36]!==d?(q=(!_||_.length===0)&&h.jsx("div",{className:"flex rounded-md border px-1 bg-background",children:h.jsx(Rc,{value:s,placeholder:"Ask anything, @ to include context about tables or dataframes",theme:d,onClose:H,onChange:i,onSubmit:$},"new-thread-input")}),t[33]=$,t[34]=_,t[35]=s,t[36]=d,t[37]=q):q=t[37],t[38]!==e||t[39]!==O||t[40]!==_||t[41]!==n||t[42]!==d){let he;t[44]!==e||t[45]!==O||t[46]!==n||t[47]!==d?(he=(se,ye)=>h.jsx(x3,{message:se,index:ye,theme:d,onEdit:O,setChatState:n,chatState:e},ye),t[44]=e,t[45]=O,t[46]=n,t[47]=d,t[48]=he):he=t[48],re=_.map(he),t[38]=e,t[39]=O,t[40]=_,t[41]=n,t[42]=d,t[43]=re}else re=t[43];return t[49]!==E?(ne=E&&h.jsx("div",{className:"flex justify-center py-4",children:h.jsx(Pc,{className:"h-4 w-4 animate-spin"})}),t[49]=E,t[50]=ne):ne=t[50],t[51]!==v||t[52]!==L?(oe=v&&h.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[h.jsx(Zs,{error:v}),h.jsx(Ae,{variant:"outline",size:"sm",onClick:L,children:"Retry"})]}),t[51]=v,t[52]=L,t[53]=oe):oe=t[53],t[54]===Symbol.for("react.memo_cache_sentinel")?(G=h.jsx("div",{ref:c}),t[54]=G):G=t[54],t[55]!==q||t[56]!==re||t[57]!==ne||t[58]!==oe?(Q=h.jsxs("div",{className:"flex-1 px-3 bg-[var(--slate-1)] gap-4 py-3 flex flex-col overflow-y-auto",children:[q,re,ne,oe,G]}),t[55]=q,t[56]=re,t[57]=ne,t[58]=oe,t[59]=Q):Q=t[59],t[60]!==E||t[61]!==j?(le=E&&h.jsx("div",{className:"w-full flex justify-center items-center z-20 border-t",children:h.jsx(Ae,{variant:"linkDestructive",size:"sm",onClick:j,children:"Stop"})}),t[60]=E,t[61]=j,t[62]=le):le=t[62],t[63]!==F||t[64]!==g||t[65]!==_||t[66]!==p||t[67]!==d?(fe=_&&_.length>0&&h.jsx(w3,{input:g,setInput:p,onSubmit:F,theme:d,inputRef:l}),t[63]=F,t[64]=g,t[65]=_,t[66]=p,t[67]=d,t[68]=fe):fe=t[68],t[69]!==Z||t[70]!==Q||t[71]!==le||t[72]!==fe?(de=h.jsxs("div",{className:"flex flex-col h-[calc(100%-53px)]",children:[Z,Q,le,fe]}),t[69]=Z,t[70]=Q,t[71]=le,t[72]=fe,t[73]=de):de=t[73],de};function KL(t){const{role:e,content:n,timestamp:o}=t;return{role:e,content:n,id:o.toString()}}function XL(){}function ZL(){}function QL(t){return t.content}function eF(t){return{...t,...C4({input:t.messages.map(QL).join(`
|
135
|
-
`)}),includeOtherCode:Sc("")}}function tF(t){Qt.error("An error occurred:",t)}function nF(t){Qt.debug("Received HTTP response from server:",t)}const oF=K.lazy(()=>Lc(()=>import("./tracing-Fv2F91hb.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([16,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,15,118,119,120,121,122,123,124]),import.meta.url).then(t=>({default:t.Tracing}))),rF=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(K.Suspense,{fallback:h.jsx(sF,{}),children:h.jsx(oF,{})}),t[0]=e):e=t[0],e},sF=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:h.jsx(eo,{})}),t[0]=e):e=t[0],e},iF=()=>{const t=X.c(25),{openModal:e,closeModal:n}=Un();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,loading:s,error:i,reload:a}=Xn(lF,o);let l;t[1]!==r?(l=r===void 0?[]:r,t[1]=r,t[2]=l):l=t[2];const c=l;let d;t[3]!==c?(d=c.filter(cF).map(dF),t[3]=c,t[4]=d):d=t[4];const u=d;if(s&&c.length===0){let y;return t[5]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(eo,{size:"medium",centered:!0}),t[5]=y):y=t[5],y}if(i){let y;return t[6]!==i?(y=h.jsx(Zs,{error:i}),t[6]=i,t[7]=y):y=t[7],y}if(c.length===0){let y;return t[8]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(An,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:h.jsx(Zc,{})}),t[8]=y):y=t[8],y}let f,m,_,g,p,b,x;return t[9]!==n||t[10]!==e||t[11]!==u||t[12]!==a?(f=()=>e(h.jsx(Ag,{providerNames:u,onSuccess:()=>{a(),n()},onClose:n})),t[9]=n,t[10]=e,t[11]=u,t[12]=a,t[13]=f):f=t[13],t[14]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(Or,{className:"h-4 w-4"}),t[14]=m):m=t[14],t[15]!==f?(_=h.jsx("div",{className:"flex justify-end h-8 border-b",children:h.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:f,children:m})}),t[15]=f,t[16]=_):_=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx(Xm,{children:h.jsxs(Xs,{children:[h.jsx(Dr,{children:"Environment Variable"}),h.jsx(Dr,{children:"Source"}),h.jsx(Dr,{})]})}),t[17]=g):g=t[17],t[18]!==c?(p=c.map(uF),t[18]=c,t[19]=p):p=t[19],t[20]!==p?(b=h.jsxs(Km,{className:"overflow-auto flex-1 mb-16",children:[g,h.jsx(Zm,{children:p})]}),t[20]=p,t[21]=b):b=t[21],t[22]!==_||t[23]!==b?(x=h.jsxs("div",{className:"flex flex-col h-full",children:[_,b]}),t[22]=_,t[23]=b,t[24]=x):x=t[24],x},aF=t=>{const e=X.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=K.useState(!1);let a;e[0]!==r?(a=()=>{r(),i(!0),setTimeout(()=>i(!1),1e3)},e[0]=r,e[1]=a):a=e[1];const l=a;let c,d;return e[2]!==s?(c=s?h.jsx(_c,{className:"w-3 h-3 text-green-700 rounded"}):h.jsx(Ls,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=c):c=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==c?(d=h.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:c}),e[4]=o,e[5]=n,e[6]=l,e[7]=c,e[8]=d):d=e[8],d};async function lF(){return Ig((await _S.request({})).secrets)}function cF(t){return t.provider!=="env"}function dF(t){return t.name}function uF(t){return t.keys.map(e=>h.jsxs(Xs,{className:"group",children:[h.jsx(Rr,{children:e}),h.jsx(Rr,{children:t.provider!=="env"&&h.jsx(W4,{variant:"outline",className:"select-none",children:t.name})}),h.jsx(Rr,{children:h.jsx(aF,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await xn(`os.environ["${e}"]`),lt({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:Me("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const hF=K.lazy(()=>Lc(()=>import("./terminal-CgyaavGX.js"),__vite__mapDeps([125,2,3,126]),import.meta.url)),fF=t=>{const e=X.c(120),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=gc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=Bs(),l=K.useRef(null),c=K.useRef(null);let d,u,f,m,_;e[0]!==o?(d=()=>{if(!l.current)return;const ue=l.current.isCollapsed();o&&ue&&l.current.expand(),o||ue||l.current.collapse(),requestAnimationFrame(pF)},u=[o],e[0]=o,e[1]=d,e[2]=u):(d=e[1],u=e[2]),A.useEffect(d,u),e[3]!==r?(f=()=>{if(!c.current)return;const ue=c.current.isCollapsed();r&&ue&&c.current.expand(),r||ue||c.current.collapse(),requestAnimationFrame(_F)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),A.useEffect(f,m),e[6]!==n?(_=h.jsx(Hc,{id:"app",className:"relative h-full",children:h.jsx(A.Suspense,{children:n})},"app"),e[6]=n,e[7]=_):_=e[7];const g=_,p=o?"resize-handle":"resize-handle-collapsed";let b,x;e[8]!==p?(b=Me("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(x=h.jsx(rS,{onDragging:sS,className:b}),e[10]=b,e[11]=x):x=e[11];const y=x,v=r?"resize-handle":"resize-handle-collapsed";let S,k;e[12]!==v?(S=Me("border-border no-print z-20",v,"horizontal"),e[12]=v,e[13]=S):S=e[13],e[14]!==S?(k=h.jsx(rS,{onDragging:sS,className:S}),e[14]=S,e[15]=k):k=e[15];const j=k;let E,I,T,M,R,B,O,z,F,V,L,C,$,N,H,Y,Z,q,re,ne,oe;e[16]!==s?(E=h.jsx("div",{className:"text-sm text-[var(--slate-11)] uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=E):E=e[17],e[18]!==i?(I=()=>i(!1),e[18]=i,e[19]=I):I=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(T=h.jsx(Qn,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==I?(M=h.jsx(Ae,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:I,children:T}),e[21]=I,e[22]=M):M=e[22],e[23]!==E||e[24]!==M?(R=h.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[E,M]}),e[23]=E,e[24]=M,e[25]=R):R=e[25],e[26]!==s?(B=s==="files"&&h.jsx(QD,{}),e[26]=s,e[27]=B):B=e[27],e[28]!==s?(O=s==="errors"&&h.jsx(Lx,{}),e[28]=s,e[29]=O):O=e[29],e[30]!==s?(z=s==="variables"&&h.jsx(A2,{}),e[30]=s,e[31]=z):z=e[31],e[32]!==s?(F=s==="dependencies"&&h.jsx(ND,{}),e[32]=s,e[33]=F):F=e[33],e[34]!==s?(V=s==="packages"&&h.jsx(TR,{}),e[34]=s,e[35]=V):V=e[35],e[36]!==s?(L=s==="outline"&&h.jsx(QM,{}),e[36]=s,e[37]=L):L=e[37],e[38]!==s?(C=s==="datasources"&&h.jsx(SR,{}),e[38]=s,e[39]=C):C=e[39],e[40]!==s?($=s==="documentation"&&h.jsx(TD,{}),e[40]=s,e[41]=$):$=e[41],e[42]!==s?(N=s==="snippets"&&h.jsx(rR,{}),e[42]=s,e[43]=N):N=e[43],e[44]!==s?(H=s==="scratchpad"&&h.jsx(AR,{}),e[44]=s,e[45]=H):H=e[45],e[46]!==s?(Y=s==="chat"&&h.jsx(YL,{}),e[46]=s,e[47]=Y):Y=e[47],e[48]!==s?(Z=s==="logs"&&h.jsx(T2,{}),e[48]=s,e[49]=Z):Z=e[49],e[50]!==s?(q=s==="tracing"&&h.jsx(rF,{}),e[50]=s,e[51]=q):q=e[51],e[52]!==s?(re=s==="secrets"&&h.jsx(iF,{}),e[52]=s,e[53]=re):re=e[53],e[54]!==B||e[55]!==O||e[56]!==z||e[57]!==F||e[58]!==V||e[59]!==L||e[60]!==C||e[61]!==$||e[62]!==N||e[63]!==H||e[64]!==Y||e[65]!==Z||e[66]!==q||e[67]!==re?(ne=h.jsx(A.Suspense,{children:h.jsxs(Bc,{children:[B,O,z,F,V,L,C,$,N,H,Y,Z,q,re]})}),e[54]=B,e[55]=O,e[56]=z,e[57]=F,e[58]=V,e[59]=L,e[60]=C,e[61]=$,e[62]=N,e[63]=H,e[64]=Y,e[65]=Z,e[66]=q,e[67]=re,e[68]=ne):ne=e[68],e[69]!==R||e[70]!==ne?(oe=h.jsx(wc,{children:h.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[R,ne]})}),e[69]=R,e[70]=ne,e[71]=oe):oe=e[71];const G=oe,Q=o&&"border-r border-l border-[var(--slate-7)]";let le,fe,de,he,se,ye;e[72]!==Q?(le=Me("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",Q),e[72]=Q,e[73]=le):le=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(fe=(ue,Se)=>{var we;Se===0&&ue===10&&((we=l.current)==null||we.resize(30))},e[74]=fe):fe=e[74],e[75]!==i?(de=()=>i(!1),he=()=>i(!0),e[75]=i,e[76]=de,e[77]=he):(de=e[76],he=e[77]),e[78]!==G||e[79]!==y?(se=h.jsxs("span",{className:"flex flex-row h-full",children:[G," ",y]}),e[78]=G,e[79]=y,e[80]=se):se=e[80],e[81]!==le||e[82]!==de||e[83]!==he||e[84]!==se?(ye=h.jsx(Hc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:le,minSize:10,defaultSize:0,maxSize:75,onResize:fe,onCollapse:de,onExpand:he,children:se},"helper"),e[81]=le,e[82]=de,e[83]=he,e[84]=se,e[85]=ye):ye=e[85];const je=ye,ce=r&&"border-[var(--slate-7)]";let Ee,_e,De,Fe,He,Xe,Le,et;e[86]!==ce?(Ee=Me("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",ce),e[86]=ce,e[87]=Ee):Ee=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(_e=(ue,Se)=>{var we;Se===0&&ue===10&&((we=c.current)==null||we.resize(30))},e[88]=_e):_e=e[88],e[89]!==a?(De=()=>a(!1),Fe=()=>a(!0),e[89]=a,e[90]=De,e[91]=Fe):(De=e[90],Fe=e[91]),e[92]!==a?(He=()=>a(!1),e[92]=a,e[93]=He):He=e[93],e[94]!==r||e[95]!==He?(Xe=h.jsx(hF,{visible:r,onClose:He}),e[94]=r,e[95]=He,e[96]=Xe):Xe=e[96],e[97]!==r||e[98]!==Xe?(Le=h.jsx(CR,{isOpen:r,children:Xe}),e[97]=r,e[98]=Xe,e[99]=Le):Le=e[99],e[100]!==Ee||e[101]!==De||e[102]!==Fe||e[103]!==Le||e[104]!==j?(et=h.jsxs(Hc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:Ee,minSize:10,defaultSize:0,maxSize:75,onResize:_e,onCollapse:De,onExpand:Fe,children:[j,Le]},"terminal"),e[100]=Ee,e[101]=De,e[102]=Fe,e[103]=Le,e[104]=j,e[105]=et):et=e[105];const nt=et;let it,te,ke,Ie,ze,J,pe,ge;return e[106]===Symbol.for("react.memo_cache_sentinel")?(it={getItem:ue=>Wu||(Wu??null),setItem(ue,Se){Wu=Se||null}},e[106]=it):it=e[106],e[107]===Symbol.for("react.memo_cache_sentinel")?(te=h.jsx(Bc,{children:h.jsx(GM,{})}),e[107]=te):te=e[107],e[108]!==nt?(ke=h.jsx(Dx,{capability:"terminal",children:nt}),e[108]=nt,e[109]=ke):ke=e[109],e[110]!==g||e[111]!==ke?(Ie=h.jsx(Hc,{children:h.jsxs(iS,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,ke]})}),e[110]=g,e[111]=ke,e[112]=Ie):Ie=e[112],e[113]===Symbol.for("react.memo_cache_sentinel")?(ze=h.jsx(n$,{}),e[113]=ze):ze=e[113],e[114]!==je||e[115]!==Ie?(J=h.jsxs(iS,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:it,children:[te,je,Ie,ze]}),e[114]=je,e[115]=Ie,e[116]=J):J=e[116],e[117]===Symbol.for("react.memo_cache_sentinel")?(pe=h.jsx(wc,{children:h.jsx(Bc,{children:h.jsx(VM,{})})}),e[117]=pe):pe=e[117],e[118]!==J?(ge=h.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden absolute inset-0 print:relative",children:[J,pe]}),e[118]=J,e[119]=ge):ge=e[119],ge};function mF(){window.dispatchEvent(new Event("resize"))}function pF(){requestAnimationFrame(mF)}function gF(){window.dispatchEvent(new Event("resize"))}function _F(){requestAnimationFrame(gF)}let v3;v3=new URL(window.location.href).searchParams.get(o$.showChrome)==="false",SS=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=X.c(10);if(v3){let s,i,a;return e[0]!==t?(s=h.jsx(Ox,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(ag,{}),e[2]=i):i=e[2],e[3]!==s?(a=h.jsxs(h.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=h.jsx(Ox,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(ag,{}),e[7]=o):o=e[7],e[8]!==n?(r=h.jsxs(fF,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{ap as C,qc as E,An as P,K$ as __tla,lp as a,SS as e,va as f,cp as u};
|
135
|
+
`)}),includeOtherCode:Sc("")}}function tF(t){Qt.error("An error occurred:",t)}function nF(t){Qt.debug("Received HTTP response from server:",t)}const oF=K.lazy(()=>Lc(()=>import("./tracing-CJpPOtw8.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([16,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,15,118,119,120,121,122,123,124]),import.meta.url).then(t=>({default:t.Tracing}))),rF=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(K.Suspense,{fallback:h.jsx(sF,{}),children:h.jsx(oF,{})}),t[0]=e):e=t[0],e},sF=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:h.jsx(eo,{})}),t[0]=e):e=t[0],e},iF=()=>{const t=X.c(25),{openModal:e,closeModal:n}=Un();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,loading:s,error:i,reload:a}=Xn(lF,o);let l;t[1]!==r?(l=r===void 0?[]:r,t[1]=r,t[2]=l):l=t[2];const c=l;let d;t[3]!==c?(d=c.filter(cF).map(dF),t[3]=c,t[4]=d):d=t[4];const u=d;if(s&&c.length===0){let y;return t[5]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(eo,{size:"medium",centered:!0}),t[5]=y):y=t[5],y}if(i){let y;return t[6]!==i?(y=h.jsx(Zs,{error:i}),t[6]=i,t[7]=y):y=t[7],y}if(c.length===0){let y;return t[8]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(An,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:h.jsx(Zc,{})}),t[8]=y):y=t[8],y}let f,m,_,g,p,b,x;return t[9]!==n||t[10]!==e||t[11]!==u||t[12]!==a?(f=()=>e(h.jsx(Ag,{providerNames:u,onSuccess:()=>{a(),n()},onClose:n})),t[9]=n,t[10]=e,t[11]=u,t[12]=a,t[13]=f):f=t[13],t[14]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(Or,{className:"h-4 w-4"}),t[14]=m):m=t[14],t[15]!==f?(_=h.jsx("div",{className:"flex justify-end h-8 border-b",children:h.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:f,children:m})}),t[15]=f,t[16]=_):_=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx(Xm,{children:h.jsxs(Xs,{children:[h.jsx(Dr,{children:"Environment Variable"}),h.jsx(Dr,{children:"Source"}),h.jsx(Dr,{})]})}),t[17]=g):g=t[17],t[18]!==c?(p=c.map(uF),t[18]=c,t[19]=p):p=t[19],t[20]!==p?(b=h.jsxs(Km,{className:"overflow-auto flex-1 mb-16",children:[g,h.jsx(Zm,{children:p})]}),t[20]=p,t[21]=b):b=t[21],t[22]!==_||t[23]!==b?(x=h.jsxs("div",{className:"flex flex-col h-full",children:[_,b]}),t[22]=_,t[23]=b,t[24]=x):x=t[24],x},aF=t=>{const e=X.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=K.useState(!1);let a;e[0]!==r?(a=()=>{r(),i(!0),setTimeout(()=>i(!1),1e3)},e[0]=r,e[1]=a):a=e[1];const l=a;let c,d;return e[2]!==s?(c=s?h.jsx(_c,{className:"w-3 h-3 text-green-700 rounded"}):h.jsx(Ls,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=c):c=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==c?(d=h.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:c}),e[4]=o,e[5]=n,e[6]=l,e[7]=c,e[8]=d):d=e[8],d};async function lF(){return Ig((await _S.request({})).secrets)}function cF(t){return t.provider!=="env"}function dF(t){return t.name}function uF(t){return t.keys.map(e=>h.jsxs(Xs,{className:"group",children:[h.jsx(Rr,{children:e}),h.jsx(Rr,{children:t.provider!=="env"&&h.jsx(W4,{variant:"outline",className:"select-none",children:t.name})}),h.jsx(Rr,{children:h.jsx(aF,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await xn(`os.environ["${e}"]`),lt({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:Me("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const hF=K.lazy(()=>Lc(()=>import("./terminal-DC1Y_3lM.js"),__vite__mapDeps([125,2,3,126]),import.meta.url)),fF=t=>{const e=X.c(120),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=gc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=Bs(),l=K.useRef(null),c=K.useRef(null);let d,u,f,m,_;e[0]!==o?(d=()=>{if(!l.current)return;const ue=l.current.isCollapsed();o&&ue&&l.current.expand(),o||ue||l.current.collapse(),requestAnimationFrame(pF)},u=[o],e[0]=o,e[1]=d,e[2]=u):(d=e[1],u=e[2]),A.useEffect(d,u),e[3]!==r?(f=()=>{if(!c.current)return;const ue=c.current.isCollapsed();r&&ue&&c.current.expand(),r||ue||c.current.collapse(),requestAnimationFrame(_F)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),A.useEffect(f,m),e[6]!==n?(_=h.jsx(Hc,{id:"app",className:"relative h-full",children:h.jsx(A.Suspense,{children:n})},"app"),e[6]=n,e[7]=_):_=e[7];const g=_,p=o?"resize-handle":"resize-handle-collapsed";let b,x;e[8]!==p?(b=Me("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(x=h.jsx(rS,{onDragging:sS,className:b}),e[10]=b,e[11]=x):x=e[11];const y=x,v=r?"resize-handle":"resize-handle-collapsed";let S,k;e[12]!==v?(S=Me("border-border no-print z-20",v,"horizontal"),e[12]=v,e[13]=S):S=e[13],e[14]!==S?(k=h.jsx(rS,{onDragging:sS,className:S}),e[14]=S,e[15]=k):k=e[15];const j=k;let E,I,T,M,R,B,O,z,F,V,L,C,$,N,H,Y,Z,q,re,ne,oe;e[16]!==s?(E=h.jsx("div",{className:"text-sm text-[var(--slate-11)] uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=E):E=e[17],e[18]!==i?(I=()=>i(!1),e[18]=i,e[19]=I):I=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(T=h.jsx(Qn,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==I?(M=h.jsx(Ae,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:I,children:T}),e[21]=I,e[22]=M):M=e[22],e[23]!==E||e[24]!==M?(R=h.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[E,M]}),e[23]=E,e[24]=M,e[25]=R):R=e[25],e[26]!==s?(B=s==="files"&&h.jsx(QD,{}),e[26]=s,e[27]=B):B=e[27],e[28]!==s?(O=s==="errors"&&h.jsx(Lx,{}),e[28]=s,e[29]=O):O=e[29],e[30]!==s?(z=s==="variables"&&h.jsx(A2,{}),e[30]=s,e[31]=z):z=e[31],e[32]!==s?(F=s==="dependencies"&&h.jsx(ND,{}),e[32]=s,e[33]=F):F=e[33],e[34]!==s?(V=s==="packages"&&h.jsx(TR,{}),e[34]=s,e[35]=V):V=e[35],e[36]!==s?(L=s==="outline"&&h.jsx(QM,{}),e[36]=s,e[37]=L):L=e[37],e[38]!==s?(C=s==="datasources"&&h.jsx(SR,{}),e[38]=s,e[39]=C):C=e[39],e[40]!==s?($=s==="documentation"&&h.jsx(TD,{}),e[40]=s,e[41]=$):$=e[41],e[42]!==s?(N=s==="snippets"&&h.jsx(rR,{}),e[42]=s,e[43]=N):N=e[43],e[44]!==s?(H=s==="scratchpad"&&h.jsx(AR,{}),e[44]=s,e[45]=H):H=e[45],e[46]!==s?(Y=s==="chat"&&h.jsx(YL,{}),e[46]=s,e[47]=Y):Y=e[47],e[48]!==s?(Z=s==="logs"&&h.jsx(T2,{}),e[48]=s,e[49]=Z):Z=e[49],e[50]!==s?(q=s==="tracing"&&h.jsx(rF,{}),e[50]=s,e[51]=q):q=e[51],e[52]!==s?(re=s==="secrets"&&h.jsx(iF,{}),e[52]=s,e[53]=re):re=e[53],e[54]!==B||e[55]!==O||e[56]!==z||e[57]!==F||e[58]!==V||e[59]!==L||e[60]!==C||e[61]!==$||e[62]!==N||e[63]!==H||e[64]!==Y||e[65]!==Z||e[66]!==q||e[67]!==re?(ne=h.jsx(A.Suspense,{children:h.jsxs(Bc,{children:[B,O,z,F,V,L,C,$,N,H,Y,Z,q,re]})}),e[54]=B,e[55]=O,e[56]=z,e[57]=F,e[58]=V,e[59]=L,e[60]=C,e[61]=$,e[62]=N,e[63]=H,e[64]=Y,e[65]=Z,e[66]=q,e[67]=re,e[68]=ne):ne=e[68],e[69]!==R||e[70]!==ne?(oe=h.jsx(wc,{children:h.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[R,ne]})}),e[69]=R,e[70]=ne,e[71]=oe):oe=e[71];const G=oe,Q=o&&"border-r border-l border-[var(--slate-7)]";let le,fe,de,he,se,ye;e[72]!==Q?(le=Me("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",Q),e[72]=Q,e[73]=le):le=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(fe=(ue,Se)=>{var we;Se===0&&ue===10&&((we=l.current)==null||we.resize(30))},e[74]=fe):fe=e[74],e[75]!==i?(de=()=>i(!1),he=()=>i(!0),e[75]=i,e[76]=de,e[77]=he):(de=e[76],he=e[77]),e[78]!==G||e[79]!==y?(se=h.jsxs("span",{className:"flex flex-row h-full",children:[G," ",y]}),e[78]=G,e[79]=y,e[80]=se):se=e[80],e[81]!==le||e[82]!==de||e[83]!==he||e[84]!==se?(ye=h.jsx(Hc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:le,minSize:10,defaultSize:0,maxSize:75,onResize:fe,onCollapse:de,onExpand:he,children:se},"helper"),e[81]=le,e[82]=de,e[83]=he,e[84]=se,e[85]=ye):ye=e[85];const je=ye,ce=r&&"border-[var(--slate-7)]";let Ee,_e,De,Fe,He,Xe,Le,et;e[86]!==ce?(Ee=Me("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",ce),e[86]=ce,e[87]=Ee):Ee=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(_e=(ue,Se)=>{var we;Se===0&&ue===10&&((we=c.current)==null||we.resize(30))},e[88]=_e):_e=e[88],e[89]!==a?(De=()=>a(!1),Fe=()=>a(!0),e[89]=a,e[90]=De,e[91]=Fe):(De=e[90],Fe=e[91]),e[92]!==a?(He=()=>a(!1),e[92]=a,e[93]=He):He=e[93],e[94]!==r||e[95]!==He?(Xe=h.jsx(hF,{visible:r,onClose:He}),e[94]=r,e[95]=He,e[96]=Xe):Xe=e[96],e[97]!==r||e[98]!==Xe?(Le=h.jsx(CR,{isOpen:r,children:Xe}),e[97]=r,e[98]=Xe,e[99]=Le):Le=e[99],e[100]!==Ee||e[101]!==De||e[102]!==Fe||e[103]!==Le||e[104]!==j?(et=h.jsxs(Hc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:Ee,minSize:10,defaultSize:0,maxSize:75,onResize:_e,onCollapse:De,onExpand:Fe,children:[j,Le]},"terminal"),e[100]=Ee,e[101]=De,e[102]=Fe,e[103]=Le,e[104]=j,e[105]=et):et=e[105];const nt=et;let it,te,ke,Ie,ze,J,pe,ge;return e[106]===Symbol.for("react.memo_cache_sentinel")?(it={getItem:ue=>Wu||(Wu??null),setItem(ue,Se){Wu=Se||null}},e[106]=it):it=e[106],e[107]===Symbol.for("react.memo_cache_sentinel")?(te=h.jsx(Bc,{children:h.jsx(GM,{})}),e[107]=te):te=e[107],e[108]!==nt?(ke=h.jsx(Dx,{capability:"terminal",children:nt}),e[108]=nt,e[109]=ke):ke=e[109],e[110]!==g||e[111]!==ke?(Ie=h.jsx(Hc,{children:h.jsxs(iS,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,ke]})}),e[110]=g,e[111]=ke,e[112]=Ie):Ie=e[112],e[113]===Symbol.for("react.memo_cache_sentinel")?(ze=h.jsx(n$,{}),e[113]=ze):ze=e[113],e[114]!==je||e[115]!==Ie?(J=h.jsxs(iS,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:it,children:[te,je,Ie,ze]}),e[114]=je,e[115]=Ie,e[116]=J):J=e[116],e[117]===Symbol.for("react.memo_cache_sentinel")?(pe=h.jsx(wc,{children:h.jsx(Bc,{children:h.jsx(VM,{})})}),e[117]=pe):pe=e[117],e[118]!==J?(ge=h.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden absolute inset-0 print:relative",children:[J,pe]}),e[118]=J,e[119]=ge):ge=e[119],ge};function mF(){window.dispatchEvent(new Event("resize"))}function pF(){requestAnimationFrame(mF)}function gF(){window.dispatchEvent(new Event("resize"))}function _F(){requestAnimationFrame(gF)}let v3;v3=new URL(window.location.href).searchParams.get(o$.showChrome)==="false",SS=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=X.c(10);if(v3){let s,i,a;return e[0]!==t?(s=h.jsx(Ox,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(ag,{}),e[2]=i):i=e[2],e[3]!==s?(a=h.jsxs(h.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=h.jsx(Ox,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(ag,{}),e[7]=o):o=e[7],e[8]!==n?(r=h.jsxs(fF,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{ap as C,qc as E,An as P,K$ as __tla,lp as a,SS as e,va as f,cp as u};
|