@marimo-team/frontend 0.13.16-dev3 → 0.13.16-dev4

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.
Files changed (92) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-DWw5HrpK.js → ConnectedDataExplorerComponent-C_Y4gfUH.js} +1 -1
  2. package/dist/assets/{VegaLite-DQF0dCp9.js → VegaLite-CfGh1w7z.js} +1 -1
  3. package/dist/assets/{_baseEach-DZnw98xJ.js → _baseEach-hCwc9om5.js} +1 -1
  4. package/dist/assets/_baseMap-CtFNvgLg.js +1 -0
  5. package/dist/assets/{_baseUniq-BeL4yI_C.js → _baseUniq-v4KJ5vey.js} +1 -1
  6. package/dist/assets/{_createAggregator-BiJopwTx.js → _createAggregator-req8lhr0.js} +1 -1
  7. package/dist/assets/{any-language-editor-Cytb1JBx.js → any-language-editor-B-EsniQr.js} +1 -1
  8. package/dist/assets/{architectureDiagram-IEHRJDOE-CEm92KIu.js → architectureDiagram-IEHRJDOE-BTcJtMzP.js} +1 -1
  9. package/dist/assets/{blockDiagram-JOT3LUYC-Cd84cMWg.js → blockDiagram-JOT3LUYC-Co1g2KDu.js} +1 -1
  10. package/dist/assets/{c4Diagram-VJAJSXHY-DIp1B9pW.js → c4Diagram-VJAJSXHY-CaSzBvTx.js} +1 -1
  11. package/dist/assets/channel-66tgCV2A.js +1 -0
  12. package/dist/assets/{chunk-4BMEZGHF-iq76ZZSq.js → chunk-4BMEZGHF-DuXq_wQh.js} +1 -1
  13. package/dist/assets/{chunk-A2AXSNBT-DIah1jnp.js → chunk-A2AXSNBT-CFIG4iLD.js} +1 -1
  14. package/dist/assets/{chunk-AEK57VVT-js-yFSuK.js → chunk-AEK57VVT-CXgDS_N6.js} +1 -1
  15. package/dist/assets/{chunk-D6G4REZN-CrOOOKFC.js → chunk-D6G4REZN-D_aZqMHq.js} +1 -1
  16. package/dist/assets/{chunk-RZ5BOZE2-BZ1Y_NLY.js → chunk-RZ5BOZE2-CeZJ_LbX.js} +1 -1
  17. package/dist/assets/{chunk-XZIHB7SX-Cv27a9rA.js → chunk-XZIHB7SX-C59JDfTh.js} +1 -1
  18. package/dist/assets/{circle-play-CBT0h2Bf.js → circle-play-CnD5S_x3.js} +1 -1
  19. package/dist/assets/classDiagram-GIVACNV2-c9fcOAEl.js +1 -0
  20. package/dist/assets/classDiagram-v2-COTLJTTW-c9fcOAEl.js +1 -0
  21. package/dist/assets/clone-Cq9LiRAa.js +1 -0
  22. package/dist/assets/{compile-B-esCvkh.js → compile-DVDiDcvu.js} +1 -1
  23. package/dist/assets/{dagre-OKDRZEBW-BgIR31Kf.js → dagre-OKDRZEBW-D5jGa6wT.js} +1 -1
  24. package/dist/assets/{data-editor-DIL0hsnD.js → data-editor-eegr2qV2.js} +1 -1
  25. package/dist/assets/{diagram-SSKATNLV-BTae9F9D.js → diagram-SSKATNLV-BFdbBVrz.js} +1 -1
  26. package/dist/assets/{diagram-VNBRO52H-DaKGXRHY.js → diagram-VNBRO52H-0Ms7LmZH.js} +1 -1
  27. package/dist/assets/{edit-page-BzgmYA8W.js → edit-page-N9F0sErF.js} +4 -4
  28. package/dist/assets/{erDiagram-Q7BY3M3F-DJH3GMDo.js → erDiagram-Q7BY3M3F-DnDjaJmk.js} +1 -1
  29. package/dist/assets/{flowDiagram-4HSFHLVR-X4XSzSrB.js → flowDiagram-4HSFHLVR-nk2wq6rr.js} +1 -1
  30. package/dist/assets/{ganttDiagram-APWFNJXF-ijkiBm02.js → ganttDiagram-APWFNJXF-6gchohB_.js} +1 -1
  31. package/dist/assets/{gitGraphDiagram-7IBYFJ6S-DlTkkl7a.js → gitGraphDiagram-7IBYFJ6S-CWDjO99l.js} +1 -1
  32. package/dist/assets/{graph-D2gQdcF2.js → graph-D2cRV1Eh.js} +1 -1
  33. package/dist/assets/{home-page-UJwqcUp6.js → home-page-B6sgErG6.js} +1 -1
  34. package/dist/assets/{index-B1lxteJ0.js → index-1WtEyVnk.js} +1 -1
  35. package/dist/assets/{index-CsQ2vXKH.js → index-B1QCtNfg.js} +1 -1
  36. package/dist/assets/{index-DAabIEUv.js → index-B7_1PeMA.js} +1 -1
  37. package/dist/assets/{index-CihC-Etn.js → index-BGv1u0eK.js} +1 -1
  38. package/dist/assets/{index-CJnTlWax.js → index-BX4Yd6CG.js} +1 -1
  39. package/dist/assets/{index-aOeZ4sKT.js → index-BbU4AtgR.js} +1 -1
  40. package/dist/assets/{index-D-EfLEBF.js → index-BbiKTJum.js} +1 -1
  41. package/dist/assets/{index-Dk4b6r5E.js → index-Bkq-90iA.js} +1 -1
  42. package/dist/assets/{index-C9CCF1lR.js → index-BzJowQBe.js} +1 -1
  43. package/dist/assets/{index-mlKDukly.js → index-C6X2v9UT.js} +1 -1
  44. package/dist/assets/{index-BZKjqi3r.js → index-CA-6WRMT.js} +1 -1
  45. package/dist/assets/{index-DQNCHp_5.js → index-CLkaAtk6.js} +1 -1
  46. package/dist/assets/{index-N_uNoEn2.js → index-CXvoh1fc.js} +154 -154
  47. package/dist/assets/{index-DvJI59rP.js → index-C_VBfK3y.js} +1 -1
  48. package/dist/assets/{index-BJdruJmQ.js → index-D-MGQnNw.js} +1 -1
  49. package/dist/assets/{index-BEltJtn7.js → index-DNPRc17J.js} +1 -1
  50. package/dist/assets/{index-PaP1ZTQa.js → index-EKB5Zxih.js} +1 -1
  51. package/dist/assets/{index-B6cMk5cp.js → index-LvHvZHCH.js} +1 -1
  52. package/dist/assets/{index-CR82mIPS.js → index-QElEVOzu.js} +1 -1
  53. package/dist/assets/infoDiagram-PH2N3AL5-BI6pR0b5.js +2 -0
  54. package/dist/assets/{journeyDiagram-U35MCT3I-BPndSHMT.js → journeyDiagram-U35MCT3I-CJLMORlX.js} +1 -1
  55. package/dist/assets/{kanban-definition-NDS4AKOZ-Dx1tSdsP.js → kanban-definition-NDS4AKOZ-DR2D-Qcr.js} +1 -1
  56. package/dist/assets/{layout-C2l53K9-.js → layout-BrNXuGiv.js} +1 -1
  57. package/dist/assets/{linear-BKReQv_P.js → linear-LmJfuVpu.js} +1 -1
  58. package/dist/assets/{mermaid-BZG3PGNh.js → mermaid-BGnvxQTM.js} +4 -4
  59. package/dist/assets/{min-CX7bXx8c.js → min-BgtX4ZuN.js} +1 -1
  60. package/dist/assets/{mindmap-definition-ALO5MXBD-TzI7KJ8u.js → mindmap-definition-ALO5MXBD-DhkuCMuf.js} +1 -1
  61. package/dist/assets/panels-agg0huzu.js +27 -0
  62. package/dist/assets/{pieDiagram-IB7DONF6-mOqP-8P2.js → pieDiagram-IB7DONF6-C08Nlq4t.js} +1 -1
  63. package/dist/assets/{quadrantDiagram-7GDLP6J5-5sWKsCrr.js → quadrantDiagram-7GDLP6J5-C2GMS7-i.js} +1 -1
  64. package/dist/assets/{radar-MK3ICKWK-CcjpTC18.js → radar-MK3ICKWK-wa1mGfsI.js} +1 -1
  65. package/dist/assets/{react-plotly-CL9VWj5Y.js → react-plotly-C2Y6zGXe.js} +1 -1
  66. package/dist/assets/{requirementDiagram-KVF5MWMF-CXgbfMJm.js → requirementDiagram-KVF5MWMF-DIJJOnWO.js} +1 -1
  67. package/dist/assets/run-page-UXhztZm1.js +1 -0
  68. package/dist/assets/{sankeyDiagram-QLVOVGJD-cpSgE4uN.js → sankeyDiagram-QLVOVGJD-BZQc0HjX.js} +1 -1
  69. package/dist/assets/{sequenceDiagram-X6HHIX6F-DpEGxC3L.js → sequenceDiagram-X6HHIX6F-lrKPWoRr.js} +1 -1
  70. package/dist/assets/{slides-component-BRworxzA.js → slides-component-Ck4sJmjq.js} +1 -1
  71. package/dist/assets/{sortBy-BZjG3Fi6.js → sortBy-C-YqZY3k.js} +1 -1
  72. package/dist/assets/{stateDiagram-DGXRK772-NHaBCmfD.js → stateDiagram-DGXRK772-MQtt9elY.js} +1 -1
  73. package/dist/assets/stateDiagram-v2-YXO3MK2T-D15fQvLw.js +1 -0
  74. package/dist/assets/{terminal-eWB6WB3W.js → terminal-N29-zV72.js} +1 -1
  75. package/dist/assets/{time-DxsctV_v.js → time-CkM-eyrz.js} +1 -1
  76. package/dist/assets/{timeline-definition-BDJGKUSR-DykVoAVx.js → timeline-definition-BDJGKUSR-85EGTV_n.js} +1 -1
  77. package/dist/assets/{tracing-FlSPUWbu.js → tracing-kkBKxC29.js} +2 -2
  78. package/dist/assets/tree-LtRNOn34.js +17 -0
  79. package/dist/assets/{vega-component-DvOXdw5B.js → vega-component-BsAl_EDO.js} +1 -1
  80. package/dist/assets/{xychartDiagram-VJFVF3MP-CRIoR8fd.js → xychartDiagram-VJFVF3MP-DVWtR95w.js} +1 -1
  81. package/dist/index.html +4 -6
  82. package/package.json +1 -1
  83. package/dist/assets/_baseMap-d_kriWOv.js +0 -1
  84. package/dist/assets/channel-DrEOrUbz.js +0 -1
  85. package/dist/assets/classDiagram-GIVACNV2-DBAZCcjC.js +0 -1
  86. package/dist/assets/classDiagram-v2-COTLJTTW-DBAZCcjC.js +0 -1
  87. package/dist/assets/clone-DMOaccow.js +0 -1
  88. package/dist/assets/infoDiagram-PH2N3AL5-NUML0fqV.js +0 -2
  89. package/dist/assets/panels-CdMlQGOr.js +0 -27
  90. package/dist/assets/run-page-BeMmoALx.js +0 -1
  91. package/dist/assets/stateDiagram-v2-YXO3MK2T-D2MYdNX1.js +0 -1
  92. package/dist/assets/tree-m3OfO51a.js +0 -17
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-FlSPUWbu.js","./index-N_uNoEn2.js","./index-BqXWXM9d.css","./compile-B-esCvkh.js","./time-DxsctV_v.js","./timer-DFzT7np-.js","./linear-BKReQv_P.js","./init-DLRA0X12.js","./range-CtcPcB_L.js","./zoom-COrs4lFh.js","./ordinal-DDUp3AbE.js","./colors-bszWmPJw.js","./arc-Cuwikxov.js","./step-BwsUM5iJ.js","./panels-CdMlQGOr.js","./index-B1lxteJ0.js","./index-DAabIEUv.js","./index-C9CCF1lR.js","./index-Dk4b6r5E.js","./index-BJdruJmQ.js","./index-aOeZ4sKT.js","./index-CsQ2vXKH.js","./index-B6cMk5cp.js","./index-PaP1ZTQa.js","./index-BZKjqi3r.js","./index-DvJI59rP.js","./index-D-EfLEBF.js","./index-BEltJtn7.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","./panels-DcAzAz16.css","./tree-m3OfO51a.js","./index-DQNCHp_5.js","./tree-C1rhMrxo.css","./circle-play-CBT0h2Bf.js","./_createAggregator-BiJopwTx.js","./_baseEach-DZnw98xJ.js","./transform-Cyp0GDF-.js","./sortBy-BZjG3Fi6.js","./_baseMap-d_kriWOv.js","./terminal-eWB6WB3W.js","./terminal-WqMRJt5Z.css"])))=>i.map(i=>d[i]);
2
- var fF=Object.defineProperty;var g3=Ft=>{throw TypeError(Ft)};var mF=(Ft,jt,mn)=>jt in Ft?fF(Ft,jt,{enumerable:!0,configurable:!0,writable:!0,value:mn}):Ft[jt]=mn;var ee=(Ft,jt,mn)=>mF(Ft,typeof jt!="symbol"?jt+"":jt,mn),pF=(Ft,jt,mn)=>jt.has(Ft)||g3("Cannot "+mn);var _3=(Ft,jt,mn)=>(pF(Ft,jt,"read from private field"),mn?mn.call(Ft):jt.get(Ft)),b3=(Ft,jt,mn)=>jt.has(Ft)?g3("Cannot add the same private member more than once"):jt instanceof WeakSet?jt.add(Ft):jt.set(Ft,mn);import{u as Pe,S as A,i7 as gF,i8 as _F,i9 as y3,ia as bF,ib as yF,ic as xF,R as K,id as wF,ie as Er,ig as vF,ih as qf,ii as x3,ij as kF,ik as SF,il as w3,im as tc,d as X,ac as Bn,io as Gf,j as h,ds as Yf,dt as v3,du as CF,dw as Jf,dy as Kf,f6 as nc,ip as Xf,dq as Zf,dr as Qf,dv as em,iq as NF,ir as k3,ef as S3,bo as Qe,Q as Lt,is as jF,dU as fo,it as C3,iu as N3,iv as tm,iw as j3,ix as EF,L as Zt,am as qt,cC as nm,a2 as De,iy as IF,eg as ut,iz as E3,iA as AF,a8 as lt,iB as oc,T as $e,a_ as Un,ao as Qt,iC as rc,iD as Ts,e4 as Ms,iE as TF,iF as Xi,iG as MF,ed as OF,iH as I3,iI as A3,dM as DF,av as om,iJ as ar,iK as Ir,aJ as sc,aL as lr,iL as RF,iM as ic,iN as T3,at as Zi,eC as M3,au as ac,iO as PF,a7 as yn,iP as rm,iQ as Ar,a3 as cr,a4 as Os,a5 as dr,bg as Tr,ai as Lo,e5 as Ds,gl as O3,fN as Rs,go as LF,b2 as hn,iR as FF,iS as zF,fL as sm,aI as lc,iT as im,iU as BF,iV as D3,iW as am,iX as UF,iY as VF,iZ as mo,i_ as R3,fR as lm,i$ as Qi,j0 as cc,d$ as $F,Z as Kn,a6 as Ps,be as ur,j1 as ea,bs as Vn,a9 as Ls,as as Oe,f2 as po,b7 as P3,en,j2 as HF,eP as WF,dz as dc,j3 as cm,aN as dm,j4 as qF,em as um,ea as Fs,j5 as GF,j6 as hm,bj as $n,j7 as YF,dS as Re,j8 as Je,j9 as fm,ja as Mt,jb as L3,jc as JF,fs as mm,aE as jn,aT as Xn,g9 as F3,ga as z3,gb as KF,gf as XF,gc as B3,aj as Te,dL as ZF,aG as uc,aR as hc,aH as fc,aO as sn,ee as Fo,jd as QF,gd as U3,je as ez,g2 as V3,g4 as $3,jf as zs,jg as H3,jh as tz,ji as nz,a1 as oz,a0 as rz,e9 as ta,jj as mc,jk as na,jl as pc,jm as sz,jn as iz,jo as W3,jp as fn,fQ as q3,dN as gc,ba as az,jq as lz,ab as pm,aK as cz,jr as dz,gp as G3,b6 as _c,js as gm,aa as oa,e0 as Y3,jt as uz,$ as hz,g6 as fz,ju as mz,jv as pz,jw as gz,jx as _z,jy as bz,jz as yz,dn as zo,jA as bc,jB as Bs,o as Bo,n as st,fv as Zn,jC as En,jD as dt,jE as Us,jF as Ut,fM as Gt,jG as _m,dR as go,jH as xz,jI as wz,b4 as J3,b5 as K3,jJ as X3,jK as vz,gs as Vs,jL as yc,b1 as xc,gr as Mr,ek as bm,jM as Z3,jN as ra,eh as ym,jO as kz,jP as Sz,jQ as Cz,jR as Nz,jS as Q3,jT as jz,jU as e4,jV as t4,jW as Ez,jX as n4,jY as o4,ei as wc,jZ as Iz,bp as Az,j_ as Tz,fu as Hn,j$ as Mz,k0 as Oz,k1 as $s,k2 as vc,k3 as Hs,fF as Uo,k4 as xm,k5 as sa,k6 as ia,k7 as aa,k8 as Dz,fl as kc,k9 as wm,ka as r4,kb as Sc,eO as Cc,fm as Rz,r as Pz,kc as Lz,kd as Fz,ke as s4,t as D,kf as zz,kg as Bz,kh as vm,fY as la,ki as i4,fy as Uz,aQ as km,kj as a4,kk as Vz,kl as $z,km as Hz,kn as Wz,ko as qz,kp as Gz,kq as Yz,kr as Jz,ks as Kz,kt as Xz,ku as Zz,kv as Qz,kw as eB,kx as tB,ky as nB,kz as oB,kA as rB,kB as sB,kC as iB,kD as aB,kE as ca,kF as lB,kG as cB,kH as dB,kI as uB,kJ as hB,kK as fB,kL as l4,kM as mB,kN as pB,kO as gB,kP as c4,kQ as _B,kR as bB,kS as d4,kT as yB,kU as Ws,kV as Wn,kW as xB,kX as wB,kY as vB,kZ as kB,k_ as SB,k$ as CB,l0 as NB,l1 as jB,l2 as EB,l3 as IB,l4 as hr,l5 as AB,l6 as TB,l7 as MB,l8 as OB,eo as DB,l9 as RB,la as u4,es as PB,lb as Nc,lc as LB,ld as FB,le as zB,lf as BB,ak as Or,lg as jc,er as UB,lh as Sm,li as Ec,lj as da,lk as ua,ll as Ic,lm as fr,ln as h4,lo as Vo,lp as qs,lq as Cm,lr as ha,ls as Gs,lt as Nm,lu as jm,lv as f4,lw as Ac,lx as VB,ag as fa,ly as ma,lz as $B,eN as Tc,lA as HB,lB as Em,lC as WB,lD as qB,lE as Mc,lF as GB,lG as YB,lH as m4,lI as Im,gq as Ys,lJ as JB,lK as KB,lL as XB,lM as ZB,fD as QB,bd as eU,gt as Nt,lN as pa,lO as Js,lP as tU,lQ as nU,lR as Am,lS as oU,lT as rU,b3 as p4,lU as sU,lV as iU,lW as Oc,lX as g4,eH as Tm,bf as _4,an as Mm,lY as b4,lZ as aU,l_ as lU,l$ as Om,m0 as Dm,m1 as cU,m2 as y4,m3 as x4,m4 as ga,e2 as dU,fp as uU,f4 as hU,W as w4,fr as fU,m5 as v4,m6 as mU,m7 as pU,m8 as k4,m9 as gU,ma as _U,mb as S4,mc as C4,md as bU,bh as N4,me as yU,mf as Rm,e8 as xU,mg as $o,dJ as j4,mh as E4,ec as I4,ff as Pm,mi as Lm,mj as A4,bu as Fm,dK as Dc,mk as T4,ml as wU,mm as vU,mn as kU,bc as Rc,mo as SU,f8 as zm,g3 as CU,g7 as NU,ge as Bm,gh as jU,mp as EU,mq as Um,mr as IU,ms as AU,mt as TU,mu as MU,mv as OU,mw as DU,mx as RU,my as PU,U as LU,mz as Pc,V as FU,mA as M4,mB as zU,f3 as BU,mC as O4,a$ as Qn,fj as UU,dB as VU,mD as $U,mE as D4,mF as HU,eM as WU,mG as qU,mH as GU,e3 as YU,mI as JU,mJ as KU,aq as Lc,mK as XU,ar as mr,dE as R4,mL as Vm,mM as ZU,el as P4,mN as QU,mO as L4,mP as eV,mQ as tV,mR as nV,mS as oV,mT as rV,mU as sV,mV as F4,f$ as $m,fZ as Hm,fU as Ks,f_ as Dr,mW as z4,g0 as Wm,fV as Rr,dV as iV,mX as qm,mY as aV,ap as lV,mZ as cV,fE as B4,E as Xs,m_ as dV,m$ as uV,n0 as hV,n1 as fV,n2 as _a,n3 as mV,n4 as pV,n5 as gV,n6 as _V,n7 as bV,n8 as U4,n9 as yV,ft as xV,na as wV,nb as vV,nc as kV,nd as SV,gg as CV,ne as NV,nf as V4,ng as jV,nh as EV,ni as $4,nj as H4,nk as W4,f1 as q4,nl as IV,nm as AV,nn as G4,no as Y4,np as Gm,nq as J4,nr as TV,ns as K4,nt as MV,nu as OV,nv as X4,nw as DV,nx as RV,ny as PV,C as Z4,nz as LV,nA as FV,nB as zV,aF as BV,nC as pr,nD as Q4,dT as UV,fW as VV,nE as eS,fX as tS,nF as $V,nG as Zs,nH as HV,nI as Fc,nJ as WV,nK as qV,y as nS,nL as GV,dh as YV,nM as JV,eU as KV,b0 as XV,aZ as ZV,ad as zc,nN as oS,nO as rS,af as sS,ae as QV,e7 as e$,__tla as t$}from"./index-N_uNoEn2.js";import{G as n$,L as iS,g as o$,b as ba,A as r$,s as s$,k as i$,B as aS,a as a$,M as l$,Y as c$,c as xn,u as Bc,C as d$,S as u$,K as h$,d as f$,i as m$,e as lS,f as p$,h as g$,j as _$,l as ya,P as Ym,m as cS,n as b$,o as y$,p as Jm,T as x$}from"./tree-m3OfO51a.js";import{d as dS,e as uS,L as hS,f as Qs,I as Km,g as w$,h as fS,N as mS,V as pS,S as gS,F as _S,i as bS,M as v$,l as yS,j as k$,E as xS,k as S$,m as Xm,n as C$,o as N$,p as j$,q as E$,s as I$,t as A$,v as T$,w as M$,x as O$,u as D$,C as R$,R as wS,a as P$,A as L$,y as F$,z as z$,O as B$,T as U$,B as V$,D as $$,c as H$,P as W$,__tla as q$}from"./panels-CdMlQGOr.js";import{c as G$}from"./_createAggregator-BiJopwTx.js";import{s as eo,i as gr,T as Zm,a as Qm}from"./transform-Cyp0GDF-.js";import{g as vS}from"./timer-DFzT7np-.js";import{i as Y$}from"./zoom-COrs4lFh.js";import{s as xa}from"./sortBy-BZjG3Fi6.js";let ep,Uc,In,tp,kS,wa,np,J$=Promise.all([(()=>{try{return t$}catch{}})(),(()=>{try{return q$}catch{}})()]).then(async()=>{var Zl,p3;var Ft=G$(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let jt,mn,op,Vc,ei,ti,rp,sp,ip,ap,va,$c,lp,ka,cp,Hc,dp,up,Wc,hp,fp,mp,Sa,pp,qc,gp,_p,bp,yp,xp,wp,Gc,vp,Yc,kp,Sp,Cp,Np,jp,Ca,Ep,Ip,Jc,Ap,Tp,Mp,Kc,Op,Dp,Rp,Na,Xc,Zc,Pp,Lp,Fp,zp,Bp,Up,Vp,$p,Hp,Qc,ed,Wp,qp,Gp,ja,_r,br;jt=Pe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),mn=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"}]]),op=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"}]]),Vc=Pe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),ei=Pe("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),ti=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"}]]),rp=Pe("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),sp=Pe("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),tp=Pe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ip=Pe("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),ap=Pe("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),va=Pe("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),$c=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"}]]),lp=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"}]]),ka=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"}]]),cp=Pe("code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),Hc=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"}]]),dp=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"}]]),up=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"}]]),Wc=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"}]]),hp=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"}]]),fp=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"}]]),mp=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"}]]),Sa=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"}]]),pp=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"}]]),qc=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"}]]),gp=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"}]]),_p=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"}]]),bp=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"}]]),yp=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"}]]),xp=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"}]]),wp=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"}]]),Gc=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"}]]),vp=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"}]]),Yc=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"}]]),kp=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"}]]),Sp=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"}]]),Cp=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"}]]),Np=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"}]]),jp=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"}]]),Ca=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"}]]),Ep=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"}]]),Ip=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"}]]),Jc=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"}]]),Ap=Pe("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Tp=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"}]]),Mp=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"}]]),Kc=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"}]]),Op=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"}]]),Dp=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"}]]),Rp=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"}]]),Na=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"}]]),Xc=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"}]]),Zc=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"}]]),Pp=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"}]]),Lp=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"}]]),Fp=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"}]]),zp=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"}]]),Bp=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"}]]),Up=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"}]]),Vp=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"}]]),$p=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"}]]),Hp=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"}]]),Qc=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"}]]),ed=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"}]]),Wp=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"}]]),Gp=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"}]]),ja=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 SS=A.createContext({}),CS=A.forwardRef(function(t,e){[t,e]=yF(t,e,SS);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,u]=A.useState(!1);gF(()=>{var p;u(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=_F(),m=f==="rtl"&&c==="horizontal";let _=bF(i);const g=A.useRef(null);return{toolbarProps:{...y3(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=xF({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=y3(t);return delete r.id,K.createElement("div",{...wF(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)});function Ea(t,e){const n=+Er(t)-+Er(e);return n<0?-1:n>0?1:n}function NS(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 jS(t,e,n){const[o,r,s]=qf(n==null?void 0:n.in,t,t,e),i=Ea(r,s),a=Math.abs(function(d,u,f){const[m,_]=qf(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=Ea(r,s)===-i;NS(o)&&a===1&&Ea(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function ES(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 IS(t,e){return function(n,o,r){const s=kF(),i=(r==null?void 0:r.locale)??s.locale??SF,a=Ea(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]=qf(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),u=ES(d,c),f=(x3(d)-x3(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<w3){const g=Math.round(m/60);return i.formatDistance("aboutXHours",g,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<tc){const g=Math.round(m/w3);return i.formatDistance("xDays",g,l)}if(m<2*tc)return _=Math.round(m/tc),i.formatDistance("aboutXMonths",_,l);if(_=jS(d,c),_<12){const g=Math.round(m/tc);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 vF(n,Date.now())}(t),e)}const AS=()=>{const t=X.c(7),{selectedLayout:e}=dS(),{setLayoutView:n}=uS();if(Bn()&&!Gf("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(Zf,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:h.jsx(Qf,{placeholder:"Select a view"})}),t[2]=r):r=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(Yf,{children:h.jsxs(v3,{children:[h.jsx(CF,{children:"View as"}),hS.map(MS)]})}),t[3]=s):s=t[3],t[4]!==e||t[5]!==o?(i=h.jsxs(em,{"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 TS(t){const e=Yp(t);return h.jsx(e,{className:"h-4 w-4"})}function Yp(t){switch(t){case"vertical":return kp;case"grid":return n$;case"slides":return Kc;default:return nc(t),Xf}}function Jp(t){return Kf(t)}function MS(t){return h.jsx(Jf,{value:t,children:h.jsxs("div",{className:"flex items-center gap-1.5 leading-5",children:[TS(t),h.jsx("span",{children:Jp(t)})]})},t)}function OS(){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 NF(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 Kp(t){return t.dropdown!==void 0}function Ia(t,e=""){return t.flatMap(n=>n.label?Kp(n)?Ia(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const ni=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 td(t){const e=X.c(3),n=nd();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 Xp(){const t=X.c(2),e=nd();let n;return t[0]!==e?(n=()=>e(C3(fo())),t[0]=e,t[1]=n):n=t[1],Qe(n)}function nd(){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}=fo(),i=[];for(const l of o){const c=r[l],d=(a=c.current)==null?void 0:a.editorView;let u;d?(N3(d)!=="markdown"&&tm(d),u=j3(d)):u=s[l].code,i.push(u),e({cellId:l})}await EF({cellIds:o,codes:i}).catch(DS)},t[0]=e,t[1]=n):n=t[1],Qe(n)}function DS(t){Zt.error(t)}const Aa=qt(null),RS=qt(!1),od=qt({chats:[],activeChatId:null}),PS=qt(t=>{const e=t(od);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(od,o=>({...o,activeChatId:n}))}),rd=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],nm(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(IF,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=h.jsxs(De,{"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 sd(){const t=X.c(3),{deleteCell:e,undoDeleteCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{if(ut.get(E3))return;const{cellId:s}=r;e({cellId:s}),AF({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(rd,{"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 Zp(){const t=X.c(3),{splitCell:e,undoSplitCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=oc(r.cellId);if(!s)return;const i=j3(s);e(r);const{dismiss:a}=lt({title:"Cell split",action:h.jsx(rd,{"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 id(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=Zp(),f=td(n==null?void 0:n.cellId),m=!$e(E3),_=sd(),{openModal:g}=Un(),p=Qt(Aa),b=$e(rc),x=$e(Ts),y=$e(Ms),v=$e(TF);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:E,name:j,hasOutput:I,hasConsoleOutput:T,status:M}=n;let L;e[1]!==S||e[2]!==k.disabled||e[3]!==r?(L=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]=L):L=e[4];const B=L;let O;e[5]!==S||e[6]!==k.hide_code||e[7]!==E||e[8]!==r?(O=async()=>{const N={hide_code:!k.hide_code};await Ar({configs:{[S]:N}}),r({cellId:S,config:N});const H=E();H&&(N.hide_code?H.contentDOM.blur():H.focus())},e[5]=S,e[6]=k.hide_code,e[7]=E,e[8]=r,e[9]=O):O=e[9];const z=O;let F,V,P,C,$;return e[10]===Symbol.for("react.memo_cache_sentinel")?(F=h.jsx(Hp,{size:13,strokeWidth:1.5}),e[10]=F):F=e[10],e[11]!==S||e[12]!==j||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(mS,{placeholder:"cell name",value:j,onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),N.stopPropagation(),g(null))},onChange:N=>s({cellId:S,name:N})})]})]}))},e[11]=S,e[12]=j,e[13]=g,e[14]=s,e[15]=V):V=e[15],e[16]!==S||e[17]!==s?(P=N=>s({cellId:S,name:N}),e[16]=S,e[17]=s,e[18]=P):P=e[18],e[19]!==j||e[20]!==P?(C=h.jsx(mS,{placeholder:"cell name",value:j,onChange:P}),e[19]=j,e[20]=P,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]!==E||e[34]!==T||e[35]!==I||e[36]!==i||e[37]!==j||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:BS,handleHeadless:V,rightElement:C},{icon:h.jsx(Qs,{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(Xi,{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(Xc,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>u({cellId:S})},{icon:h.jsx(Km,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!I,handle:()=>function(N){const H=document.getElementById(k3.create(N));H&&(H.classList.add("printing-output"),S3(H,"result.png").finally(()=>{H.classList.remove("printing-output")}))}(S)},{icon:h.jsx(OF,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const N=E();N&&MF({[S]:N})}},{icon:k.hide_code?h.jsx(I3,{size:13,strokeWidth:1.5}):h.jsx(A3,{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(DF,{"data-testid":"cell-disable-switch",checked:!k.disabled,size:"sm",onCheckedChange:B}),handle:B},{icon:h.jsx(om,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(I||T),handle:()=>{d({cellId:S})}}],[{icon:h.jsx(sc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const N=E();N&&(ar(x,o),Ir(N,"markdown",{keepCodeAsIs:!1}))}},{icon:h.jsx(lr,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const N=E();N&&(ar(x,o),Ir(N,"sql",{keepCodeAsIs:!1}))}},{icon:h.jsx(ic,{}),label:"Toggle as Python",handle:()=>{const N=E();N&&(ar(x,o),RF(N,"python",{force:!0}))}}],[{icon:h.jsxs(ni,{children:[h.jsx(va,{size:13,strokeWidth:1.5}),h.jsx(T3,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:S,before:!0})},{icon:h.jsxs(ni,{children:[h.jsx(va,{size:13,strokeWidth:1.5}),h.jsx(Zi,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:S,before:!1})},{icon:h.jsx(T3,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:S,before:!0})},{icon:h.jsx(Zi,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:S,before:!1})},{icon:h.jsx(M3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:S,direction:"left"}),hidden:v!=="columns"},{icon:h.jsx(ac,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:S,direction:"right"}),hidden:v!=="columns"},{icon:h.jsx(sp,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:S})},{icon:h.jsx(rp,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:S})},{icon:h.jsx(PF,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:v!=="columns",handle:()=>c({cellId:S})}],[{icon:h.jsx(iS,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!fS(j),tooltip:fS(j)?void 0:"Only named cells can be linked to",handle:async()=>{await yn(w$(j)),lt({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:h.jsx(rm,{size:13,strokeWidth:1.5}),handle:()=>{_({cellId:S})}}]].map(FS).filter(LS),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]=E,e[34]=T,e[35]=I,e[36]=i,e[37]=j,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 LS(t){return t.length>0}function FS(t){return t.filter(zS)}function zS(t){return!t.hidden}function BS(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function US(t){return!t.hidden}const ad=qt(!1),Qp=()=>{const t=X.c(37),[e,n]=hn(ad),o=FF(),r=$e(zF),s=$e(sm);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=id(i).flat();a=Ia(a);const l=function(){const P=X.c(45),{theme:C}=Lo(),[$,N]=Ds(),[H,Y]=O3();let Q;P[0]!==N?(Q=async ce=>{await Rs({config:ce}).then(()=>{N(ce)})},P[0]=N,P[1]=Q):Q=P[1];const q=Q;let re;P[2]!==Y?(re=async ce=>{await LF({config:ce}).then(()=>{Y(ce)})},P[2]=Y,P[3]=re):re=P[3];const ne=re;let oe;if(P[4]!==H||P[5]!==$||P[6]!==ne||P[7]!==q||P[8]!==C){let ce,fe,de;P[10]!==H?(ce=et=>et!==H.width,P[10]=H,P[11]=ce):ce=P[11],P[12]!==H||P[13]!==ne?(fe=et=>({label:`App config > Set width=${et}`,handle:()=>{ne({...H,width:et})}}),P[12]=H,P[13]=ne,P[14]=fe):fe=P[14],P[15]!==$||P[16]!==q||P[17]!==C?(de={label:"Config > Toggle dark mode",handle:()=>{q({...$,display:{...$.display,theme:C==="dark"?"light":"dark"}})}},P[15]=$,P[16]=q,P[17]=C,P[18]=de):de=P[18];const _e=$.keymap.preset==="vim";let ie,we;P[19]!==$||P[20]!==q?(ie=()=>{q({...$,keymap:{...$.keymap,preset:"vim"}})},P[19]=$,P[20]=q,P[21]=ie):ie=P[21],P[22]!==_e||P[23]!==ie?(we={label:"Config > Switch keymap to VIM",hidden:_e,handle:ie},P[22]=_e,P[23]=ie,P[24]=we):we=P[24];const ve=$.keymap.preset==="default";let ae,ge,he;P[25]!==$||P[26]!==q?(ae=()=>{q({...$,keymap:{...$.keymap,preset:"default"}})},P[25]=$,P[26]=q,P[27]=ae):ae=P[27],P[28]!==ae||P[29]!==ve?(ge={label:"Config > Switch keymap to default (current: VIM)",hidden:ve,handle:ae},P[28]=ae,P[29]=ve,P[30]=ge):ge=P[30],P[31]!==$||P[32]!==q?(he=()=>{q({...$,completion:{...$.completion,copilot:!1}})},P[31]=$,P[32]=q,P[33]=he):he=P[33];const je=$.completion.copilot!=="github";let Fe,He;P[34]!==he||P[35]!==je?(Fe={label:"Config > Disable GitHub Copilot",handle:he,hidden:je},P[34]=he,P[35]=je,P[36]=Fe):Fe=P[36],P[37]!==$||P[38]!==q?(He=()=>{q({...$,completion:{...$.completion,copilot:"github"}})},P[37]=$,P[38]=q,P[39]=He):He=P[39];const Xe=$.completion.copilot==="github";let Le;P[40]!==He||P[41]!==Xe?(Le={label:"Config > Enable GitHub Copilot",handle:He,hidden:Xe},P[40]=He,P[41]=Xe,P[42]=Le):Le=P[42],oe=[...o$().filter(ce).map(fe),de,we,ge,Fe,Le],P[4]=H,P[5]=$,P[6]=ne,P[7]=q,P[8]=C,P[9]=oe}else oe=P[9];const G=oe;let Z;return P[43]!==G?(Z=G.filter(US),P[43]=G,P[44]=Z):Z=P[44],Z}();let c=Eg();c=[...Ia(c),...Ia(l)];const d=c.filter(VS),u=lc.keyBy(d,$S),{recentCommands:f,addRecentCommand:m}=OS();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=P=>{VF(s.getHotkey("global.commandPalette").key)(P)&&(P.preventDefault(),n(HS))},t[4]=s,t[5]=n,t[6]=p):p=t[6],nm(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(P,C)=>{const $=o[P];if(!$)return null;const N=s.getHotkey(P);return h.jsxs(mo,{disabled:C.disabled,onSelect:()=>{m(P),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(R3,{children:h.jsx(lm,{shortcut:N.key})})]},P)},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=(P,C,$,N)=>{const H=$===void 0?{}:$;return h.jsxs(mo,{disabled:H.disabled,onSelect:()=>{m(P),n(!1),requestAnimationFrame(()=>{C()})},value:P,children:[h.jsxs("span",{children:[P,H.tooltip&&h.jsxs("span",{className:"ml-2",children:["(",H.tooltip,")"]})]}),N&&h.jsx(R3,{children:h.jsx(lm,{shortcut:s.getHotkey(N).key})})]},P)},t[12]=m,t[13]=s,t[14]=n,t[15]=y):y=t[15];const v=y,S=UF;let k;t[16]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(Qi,{placeholder:"Type to search..."}),t[16]=k):k=t[16];const E=am;let j;t[17]===Symbol.for("react.memo_cache_sentinel")?(j=h.jsx(cc,{children:"No results found."}),t[17]=j):j=t[17];const I=f.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(im,{heading:"Recently Used",children:f.map(P=>{const C=u[P];return BF(P)?x(P,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip}):C&&!Kp(C)?v(C.label,C.handleHeadless||C.handle,{disabled:C.disabled,tooltip:C.tooltip}):null})}),h.jsx(D3,{})]}),T=im,M=s.iterate().map(P=>{if(g.has(P))return null;const C=u[P];return x(P,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip})}),L=d.map(P=>g.has(P.label)?null:v(P.label,P.handleHeadless||P.handle,{disabled:P.disabled,tooltip:P.tooltip}));let B;t[18]!==g||t[19]!==v?(B=P=>g.has(P.label)?null:v(`Cell > ${P.label}`,P.handleHeadless||P.handle,{disabled:P.disabled,tooltip:P.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]!==L||t[23]!==O||t[24]!==M?(z=h.jsxs(T,{heading:"Commands",children:[M,L,O]}),t[21]=T,t[22]=L,t[23]=O,t[24]=M,t[25]=z):z=t[25],t[26]!==E||t[27]!==z||t[28]!==j||t[29]!==I?(F=h.jsxs(E,{children:[j,I,z]}),t[26]=E,t[27]=z,t[28]=j,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 VS(t){return!t.hotkey}function $S(t){return t.label}function HS(t){return!t}const Ta="https://static.marimo.app",WS=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=`${Ta}/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 $F({download:!1,includeCode:!0,files:pS.INSTANCE.filenames()}),S=lt({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ta}/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:Ta,target:"_blank",children:Ta}),"."]})]}),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(qS,{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(De,{"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(De,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await yn(a)},children:"Create"}),e[15]=a,e[16]=p):p=e[16],e[17]!==p||e[18]!==g?(b=h.jsxs(ea,{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},qS=t=>{const e=X.c(8),[n,o]=K.useState(!1);let r;e[0]!==t.text?(r=Vn.stopPropagation(async c=>{c.preventDefault(),await yn(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(De,{"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 eg(){const t=X.c(3),{openConfirm:e}=Un(),n=Qt(po);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(P3,{onClick:async()=>{n({state:en.CLOSING}),await HF(),WF()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=n,t[2]=o):o=t[2],o}const ld=[{type:"files",Icon:gp,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:dc,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:lr,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:Ca,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:ba,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:Zc,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:cm,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:Qc,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:dm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:r$,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Fp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:wp,tooltip:"Secrets",hidden:Bn(),position:"sidebar"},{type:"scratchpad",Icon:qF,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:om,tooltip:"View errors",position:"footer"}];function tg(){const t=X.c(2),e=Qt(um);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:GF(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 Re.string().optional().describe(Je.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function ng(){return Re.string().optional().describe(Je.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Ma(){return Re.string().optional().describe(Je.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function og(){return Re.string().optional().describe(Je.of({label:"URI",optionRegex:".*uri.*"}))}function Lr(){return Re.string().nonempty().describe(Je.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function Ho(){return Re.string().describe(Je.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Fr(){return Re.string().nonempty().describe(Je.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function zr(t){const e=Re.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 rg(){return Re.boolean().default(!1).describe(Je.of({label:"Read Only"}))}const sg=Re.object({type:Re.literal("postgres"),host:Lr(),port:zr(5432).optional(),database:Ho(),username:Fr(),password:Pr(),ssl:Re.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),ig=Re.object({type:Re.literal("mysql"),host:Lr(),port:zr(3306),database:Ho(),username:Fr(),password:Pr(),ssl:Re.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),ag=Re.object({type:Re.literal("sqlite"),database:Ho().describe(Je.of({label:"Database Path"}))}).describe(Je.of({direction:"two-columns"})),lg=Re.object({type:Re.literal("duckdb"),database:Ho().describe(Je.of({label:"Database Path"})),read_only:rg()}).describe(Je.of({direction:"two-columns"})),cg=Re.object({type:Re.literal("motherduck"),database:Ho().default("my_db").describe(Je.of({label:"Database Name"})),token:ng()}).describe(Je.of({direction:"two-columns"})),dg=Re.object({type:Re.literal("snowflake"),account:Re.string().nonempty().describe(Je.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:Re.string().optional().describe(Je.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:Ho(),schema:Re.string().optional().describe(Je.of({label:"Schema",optionRegex:".*snowflake.*"})),username:Fr(),password:Pr(),role:Re.string().optional().describe(Je.of({label:"Role"}))}).describe(Je.of({direction:"two-columns"})),ug=Re.object({type:Re.literal("bigquery"),project:Re.string().nonempty().describe(Je.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:Re.string().nonempty().describe(Je.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:Re.string().describe(Je.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(Je.of({direction:"two-columns"})),hg=Re.object({type:Re.literal("clickhouse_connect"),host:Lr(),port:zr(8123).optional(),username:Fr(),password:Pr(),secure:Re.boolean().default(!1).describe(Je.of({label:"Use HTTPs"}))}).describe(Je.of({direction:"two-columns"})),fg=Re.object({type:Re.literal("timeplus"),host:Lr().default("localhost"),port:zr(8123).optional(),username:Fr().default("default"),password:Pr().default("")}).describe(Je.of({direction:"two-columns"})),mg=Re.object({type:Re.literal("chdb"),database:Ho().describe(Je.of({label:"Database Path"})),read_only:rg()}).describe(Je.of({direction:"two-columns"})),pg=Re.object({type:Re.literal("trino"),host:Lr(),port:zr(8080),database:Ho(),schema:Re.string().describe(Je.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:Fr(),password:Pr(),async_support:Re.boolean().default(!1).describe(Je.of({label:"Async Support"}))}).describe(Je.of({direction:"two-columns"})),gg=Re.object({type:Re.literal("iceberg"),name:Re.string().describe(Je.of({label:"Catalog Name"})),catalog:Re.discriminatedUnion("type",[Re.object({type:Re.literal("REST"),warehouse:Ma(),uri:Re.string().optional().describe(Je.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:ng()}),Re.object({type:Re.literal("SQL"),warehouse:Ma(),uri:Re.string().optional().describe(Je.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),Re.object({type:Re.literal("Hive"),warehouse:Ma(),uri:og()}),Re.object({type:Re.literal("Glue"),warehouse:Ma(),uri:og()}),Re.object({type:Re.literal("DynamoDB"),"dynamodb.profile-name":Re.string().optional().describe(Je.of({label:"Profile Name"})),"dynamodb.region":Re.string().optional().describe(Je.of({label:"Region"})),"dynamodb.access-key-id":Re.string().optional().describe(Je.of({label:"Access Key ID"})),"dynamodb.secret-access-key":Re.string().optional().describe(Je.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":Re.string().optional().describe(Je.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(Je.of({special:"tabs"}))}),_g=Re.object({type:Re.literal("datafusion"),sessionContext:Re.boolean().optional().describe(Je.of({label:"Use Session Context"}))}),bg=Re.object({type:Re.literal("pyspark"),host:Lr().optional(),port:zr().optional()}),GS=Re.discriminatedUnion("type",[sg,ig,ag,lg,cg,dg,ug,hg,fg,mg,pg,gg,_g,bg]),cd="env:";function Oa(t){return typeof t=="string"&&t.startsWith(cd)}function dd(t){return`${cd}${t}`}const yg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck"};class pn{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 YS{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),Oa(n)){const r=n.replace(cd,""),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 Oa(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=["./tracing-kkBKxC29.js","./index-CXvoh1fc.js","./index-BqXWXM9d.css","./compile-DVDiDcvu.js","./time-CkM-eyrz.js","./timer-DFzT7np-.js","./linear-LmJfuVpu.js","./init-DLRA0X12.js","./range-CtcPcB_L.js","./zoom-COrs4lFh.js","./ordinal-DDUp3AbE.js","./colors-bszWmPJw.js","./arc-Cuwikxov.js","./step-BwsUM5iJ.js","./panels-agg0huzu.js","./index-1WtEyVnk.js","./index-B7_1PeMA.js","./index-BzJowQBe.js","./index-Bkq-90iA.js","./index-D-MGQnNw.js","./index-BbU4AtgR.js","./index-B1QCtNfg.js","./index-LvHvZHCH.js","./index-EKB5Zxih.js","./index-CA-6WRMT.js","./index-C_VBfK3y.js","./index-BbiKTJum.js","./index-DNPRc17J.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","./panels-DcAzAz16.css","./tree-LtRNOn34.js","./index-CLkaAtk6.js","./tree-C1rhMrxo.css","./circle-play-CnD5S_x3.js","./_createAggregator-req8lhr0.js","./_baseEach-hCwc9om5.js","./transform-Cyp0GDF-.js","./sortBy-C-YqZY3k.js","./_baseMap-CtFNvgLg.js","./terminal-N29-zV72.js","./terminal-WqMRJt5Z.css"])))=>i.map(i=>d[i]);
2
+ var fF=Object.defineProperty;var g3=Ft=>{throw TypeError(Ft)};var mF=(Ft,jt,mn)=>jt in Ft?fF(Ft,jt,{enumerable:!0,configurable:!0,writable:!0,value:mn}):Ft[jt]=mn;var ee=(Ft,jt,mn)=>mF(Ft,typeof jt!="symbol"?jt+"":jt,mn),pF=(Ft,jt,mn)=>jt.has(Ft)||g3("Cannot "+mn);var _3=(Ft,jt,mn)=>(pF(Ft,jt,"read from private field"),mn?mn.call(Ft):jt.get(Ft)),b3=(Ft,jt,mn)=>jt.has(Ft)?g3("Cannot add the same private member more than once"):jt instanceof WeakSet?jt.add(Ft):jt.set(Ft,mn);import{u as Pe,S as A,i7 as gF,i8 as _F,i9 as y3,ia as bF,ib as yF,ic as xF,R as K,id as wF,ie as Er,ig as vF,ih as qf,ii as x3,ij as kF,ik as SF,il as w3,im as tc,d as X,ac as Bn,io as Gf,j as h,ds as Yf,dt as v3,du as CF,dw as Jf,dy as Kf,f6 as nc,ip as Xf,dq as Zf,dr as Qf,dv as em,iq as NF,ir as k3,ef as S3,bo as Qe,Q as Lt,is as jF,dU as fo,it as C3,iu as N3,iv as tm,iw as j3,ix as EF,L as Zt,am as qt,cC as nm,a2 as De,iy as IF,eg as ut,iz as E3,iA as AF,a8 as lt,iB as oc,T as $e,a_ as Un,ao as Qt,iC as rc,iD as Ts,e4 as Ms,iE as TF,iF as Xi,iG as MF,ed as OF,iH as I3,iI as A3,dM as DF,av as om,iJ as ar,iK as Ir,aJ as sc,aL as lr,iL as RF,iM as ic,iN as T3,at as Zi,eC as M3,au as ac,iO as PF,a7 as yn,iP as rm,iQ as Ar,a3 as cr,a4 as Os,a5 as dr,bg as Tr,ai as Lo,e5 as Ds,gl as O3,fN as Rs,go as LF,b2 as hn,iR as FF,iS as zF,fL as sm,aI as lc,iT as im,iU as BF,iV as D3,iW as am,iX as UF,iY as VF,iZ as mo,i_ as R3,fR as lm,i$ as Qi,j0 as cc,d$ as $F,Z as Kn,a6 as Ps,be as ur,j1 as ea,bs as Vn,a9 as Ls,as as Oe,f2 as po,b7 as P3,en,j2 as HF,eP as WF,dz as dc,j3 as cm,aN as dm,j4 as qF,em as um,ea as Fs,j5 as GF,j6 as hm,bj as $n,j7 as YF,dS as Re,j8 as Je,j9 as fm,ja as Mt,jb as L3,jc as JF,fs as mm,aE as jn,aT as Xn,g8 as F3,g9 as z3,ga as KF,ge as XF,gb as B3,aj as Te,dL as ZF,aG as uc,aR as hc,aH as fc,aO as sn,ee as Fo,jd as QF,gc as U3,je as ez,g3 as V3,g5 as $3,jf as zs,jg as H3,jh as tz,ji as nz,a1 as oz,a0 as rz,e9 as ta,_ as mc,jj as na,jk as pc,jl as sz,jm as iz,jn as W3,jo as fn,fQ as q3,dN as gc,ba as az,jp as lz,ab as pm,aK as cz,jq as dz,gp as G3,b6 as _c,jr as gm,aa as oa,e0 as Y3,js as uz,$ as hz,jt as fz,ju as mz,jv as pz,jw as gz,jx as _z,jy as bz,jz as yz,dn as zo,jA as bc,jB as Bs,o as Bo,n as st,fv as Zn,jC as En,jD as dt,jE as Us,jF as Ut,fM as Gt,jG as _m,dR as go,jH as xz,jI as wz,b4 as J3,b5 as K3,jJ as X3,jK as vz,gs as Vs,jL as yc,b1 as xc,gr as Mr,ek as bm,jM as Z3,jN as ra,eh as ym,jO as kz,jP as Sz,jQ as Cz,jR as Nz,jS as Q3,jT as jz,jU as e4,jV as t4,jW as Ez,jX as n4,jY as o4,ei as wc,jZ as Iz,bp as Az,j_ as Tz,fu as Hn,j$ as Mz,k0 as Oz,k1 as $s,k2 as vc,k3 as Hs,fF as Uo,k4 as xm,k5 as sa,k6 as ia,k7 as aa,k8 as Dz,fl as kc,k9 as wm,ka as r4,kb as Sc,eO as Cc,fm as Rz,r as Pz,kc as Lz,kd as Fz,ke as s4,t as D,kf as zz,kg as Bz,kh as vm,fY as la,ki as i4,fy as Uz,aQ as km,kj as a4,kk as Vz,kl as $z,km as Hz,kn as Wz,ko as qz,kp as Gz,kq as Yz,kr as Jz,ks as Kz,kt as Xz,ku as Zz,kv as Qz,kw as eB,kx as tB,ky as nB,kz as oB,kA as rB,kB as sB,kC as iB,kD as aB,kE as ca,kF as lB,kG as cB,kH as dB,kI as uB,kJ as hB,kK as fB,kL as l4,kM as mB,kN as pB,kO as gB,kP as c4,kQ as _B,kR as bB,kS as d4,kT as yB,kU as Ws,kV as Wn,kW as xB,kX as wB,kY as vB,kZ as kB,k_ as SB,k$ as CB,l0 as NB,l1 as jB,l2 as EB,l3 as IB,l4 as hr,l5 as AB,l6 as TB,l7 as MB,l8 as OB,eo as DB,l9 as RB,la as u4,es as PB,lb as Nc,lc as LB,ld as FB,le as zB,lf as BB,ak as Or,lg as jc,er as UB,lh as Sm,li as Ec,lj as da,lk as ua,ll as Ic,lm as fr,ln as h4,lo as Vo,lp as qs,lq as Cm,lr as ha,ls as Gs,lt as Nm,lu as jm,lv as f4,lw as Ac,lx as VB,ag as fa,ly as ma,lz as $B,eN as Tc,lA as HB,lB as Em,lC as WB,lD as qB,lE as Mc,lF as GB,lG as YB,lH as m4,lI as Im,gq as Ys,lJ as JB,lK as KB,lL as XB,lM as ZB,fD as QB,bd as eU,gt as Nt,lN as pa,lO as Js,lP as tU,lQ as nU,lR as Am,lS as oU,lT as rU,b3 as p4,lU as sU,lV as iU,lW as Oc,lX as g4,eH as Tm,bf as _4,an as Mm,lY as b4,lZ as aU,l_ as lU,l$ as Om,m0 as Dm,m1 as cU,m2 as y4,m3 as x4,m4 as ga,fp as dU,f4 as uU,W as w4,fr as hU,e2 as fU,m5 as v4,m6 as mU,m7 as pU,m8 as k4,m9 as gU,ma as _U,mb as S4,mc as C4,md as bU,bh as N4,me as yU,mf as Rm,e8 as xU,mg as $o,dJ as j4,mh as E4,ec as I4,ff as Pm,mi as Lm,mj as A4,bu as Fm,dK as Dc,mk as T4,ml as wU,mm as vU,mn as kU,bc as Rc,mo as SU,f8 as zm,g4 as CU,g6 as NU,gd as Bm,gg as jU,mp as EU,mq as Um,mr as IU,ms as AU,mt as TU,mu as MU,mv as OU,mw as DU,mx as RU,my as PU,U as LU,mz as Pc,V as FU,mA as M4,mB as zU,f3 as BU,mC as O4,a$ as Qn,fj as UU,dB as VU,mD as $U,mE as D4,mF as HU,eM as WU,mG as qU,mH as GU,e3 as YU,mI as JU,mJ as KU,aq as Lc,mK as XU,ar as mr,dE as R4,mL as Vm,mM as ZU,el as P4,mN as QU,mO as L4,mP as eV,mQ as tV,mR as nV,mS as oV,mT as rV,mU as sV,mV as F4,f$ as $m,fZ as Hm,fU as Ks,f_ as Dr,mW as z4,g0 as Wm,fV as Rr,dV as iV,mX as qm,mY as aV,ap as lV,mZ as cV,fE as B4,E as Xs,m_ as dV,m$ as uV,n0 as hV,n1 as fV,n2 as _a,n3 as mV,n4 as pV,n5 as gV,n6 as _V,n7 as bV,n8 as U4,n9 as yV,ft as xV,na as wV,nb as vV,nc as kV,nd as SV,gf as CV,ne as NV,nf as V4,ng as jV,nh as EV,ni as $4,nj as H4,nk as W4,f1 as q4,nl as IV,nm as AV,nn as G4,no as Y4,np as Gm,nq as J4,nr as TV,ns as K4,nt as MV,nu as OV,nv as X4,nw as DV,nx as RV,ny as PV,C as Z4,nz as LV,nA as FV,nB as zV,aF as BV,nC as pr,nD as Q4,dT as UV,fW as VV,nE as eS,fX as tS,nF as $V,nG as Zs,nH as HV,nI as Fc,nJ as WV,nK as qV,y as nS,nL as GV,dh as YV,nM as JV,eU as KV,b0 as XV,aZ as ZV,ad as zc,nN as oS,nO as rS,af as sS,ae as QV,e7 as e$,__tla as t$}from"./index-CXvoh1fc.js";import{G as n$,L as iS,g as o$,b as ba,A as r$,s as s$,k as i$,B as aS,a as a$,M as l$,Y as c$,c as xn,u as Bc,C as d$,S as u$,K as h$,d as f$,i as m$,e as lS,f as p$,h as g$,j as _$,l as ya,P as Ym,m as cS,n as b$,o as y$,p as Jm,T as x$}from"./tree-LtRNOn34.js";import{d as dS,e as uS,L as hS,f as Qs,I as Km,g as w$,h as fS,N as mS,V as pS,S as gS,F as _S,i as bS,M as v$,l as yS,j as k$,E as xS,k as S$,m as Xm,n as C$,o as N$,p as j$,q as E$,s as I$,t as A$,v as T$,w as M$,x as O$,u as D$,C as R$,R as wS,a as P$,A as L$,y as F$,z as z$,O as B$,T as U$,B as V$,D as $$,c as H$,P as W$,__tla as q$}from"./panels-agg0huzu.js";import{c as G$}from"./_createAggregator-req8lhr0.js";import{s as eo,i as gr,T as Zm,a as Qm}from"./transform-Cyp0GDF-.js";import{g as vS}from"./timer-DFzT7np-.js";import{i as Y$}from"./zoom-COrs4lFh.js";import{s as xa}from"./sortBy-C-YqZY3k.js";let ep,Uc,In,tp,kS,wa,np,J$=Promise.all([(()=>{try{return t$}catch{}})(),(()=>{try{return q$}catch{}})()]).then(async()=>{var Zl,p3;var Ft=G$(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let jt,mn,op,Vc,ei,ti,rp,sp,ip,ap,va,$c,lp,ka,cp,Hc,dp,up,Wc,hp,fp,mp,Sa,pp,qc,gp,_p,bp,yp,xp,wp,Gc,vp,Yc,kp,Sp,Cp,Np,jp,Ca,Ep,Ip,Jc,Ap,Tp,Mp,Kc,Op,Dp,Rp,Na,Xc,Zc,Pp,Lp,Fp,zp,Bp,Up,Vp,$p,Hp,Qc,ed,Wp,qp,Gp,ja,_r,br;jt=Pe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),mn=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"}]]),op=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"}]]),Vc=Pe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),ei=Pe("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),ti=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"}]]),rp=Pe("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),sp=Pe("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),tp=Pe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ip=Pe("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),ap=Pe("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),va=Pe("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),$c=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"}]]),lp=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"}]]),ka=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"}]]),cp=Pe("code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),Hc=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"}]]),dp=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"}]]),up=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"}]]),Wc=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"}]]),hp=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"}]]),fp=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"}]]),mp=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"}]]),Sa=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"}]]),pp=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"}]]),qc=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"}]]),gp=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"}]]),_p=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"}]]),bp=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"}]]),yp=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"}]]),xp=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"}]]),wp=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"}]]),Gc=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"}]]),vp=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"}]]),Yc=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"}]]),kp=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"}]]),Sp=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"}]]),Cp=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"}]]),Np=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"}]]),jp=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"}]]),Ca=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"}]]),Ep=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"}]]),Ip=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"}]]),Jc=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"}]]),Ap=Pe("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Tp=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"}]]),Mp=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"}]]),Kc=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"}]]),Op=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"}]]),Dp=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"}]]),Rp=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"}]]),Na=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"}]]),Xc=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"}]]),Zc=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"}]]),Pp=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"}]]),Lp=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"}]]),Fp=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"}]]),zp=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"}]]),Bp=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"}]]),Up=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"}]]),Vp=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"}]]),$p=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"}]]),Hp=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"}]]),Qc=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"}]]),ed=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"}]]),Wp=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"}]]),Gp=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"}]]),ja=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 SS=A.createContext({}),CS=A.forwardRef(function(t,e){[t,e]=yF(t,e,SS);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,u]=A.useState(!1);gF(()=>{var p;u(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=_F(),m=f==="rtl"&&c==="horizontal";let _=bF(i);const g=A.useRef(null);return{toolbarProps:{...y3(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=xF({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=y3(t);return delete r.id,K.createElement("div",{...wF(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)});function Ea(t,e){const n=+Er(t)-+Er(e);return n<0?-1:n>0?1:n}function NS(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 jS(t,e,n){const[o,r,s]=qf(n==null?void 0:n.in,t,t,e),i=Ea(r,s),a=Math.abs(function(d,u,f){const[m,_]=qf(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=Ea(r,s)===-i;NS(o)&&a===1&&Ea(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function ES(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 IS(t,e){return function(n,o,r){const s=kF(),i=(r==null?void 0:r.locale)??s.locale??SF,a=Ea(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]=qf(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),u=ES(d,c),f=(x3(d)-x3(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<w3){const g=Math.round(m/60);return i.formatDistance("aboutXHours",g,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<tc){const g=Math.round(m/w3);return i.formatDistance("xDays",g,l)}if(m<2*tc)return _=Math.round(m/tc),i.formatDistance("aboutXMonths",_,l);if(_=jS(d,c),_<12){const g=Math.round(m/tc);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 vF(n,Date.now())}(t),e)}const AS=()=>{const t=X.c(7),{selectedLayout:e}=dS(),{setLayoutView:n}=uS();if(Bn()&&!Gf("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(Zf,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:h.jsx(Qf,{placeholder:"Select a view"})}),t[2]=r):r=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(Yf,{children:h.jsxs(v3,{children:[h.jsx(CF,{children:"View as"}),hS.map(MS)]})}),t[3]=s):s=t[3],t[4]!==e||t[5]!==o?(i=h.jsxs(em,{"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 TS(t){const e=Yp(t);return h.jsx(e,{className:"h-4 w-4"})}function Yp(t){switch(t){case"vertical":return kp;case"grid":return n$;case"slides":return Kc;default:return nc(t),Xf}}function Jp(t){return Kf(t)}function MS(t){return h.jsx(Jf,{value:t,children:h.jsxs("div",{className:"flex items-center gap-1.5 leading-5",children:[TS(t),h.jsx("span",{children:Jp(t)})]})},t)}function OS(){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 NF(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 Kp(t){return t.dropdown!==void 0}function Ia(t,e=""){return t.flatMap(n=>n.label?Kp(n)?Ia(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const ni=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 td(t){const e=X.c(3),n=nd();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 Xp(){const t=X.c(2),e=nd();let n;return t[0]!==e?(n=()=>e(C3(fo())),t[0]=e,t[1]=n):n=t[1],Qe(n)}function nd(){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}=fo(),i=[];for(const l of o){const c=r[l],d=(a=c.current)==null?void 0:a.editorView;let u;d?(N3(d)!=="markdown"&&tm(d),u=j3(d)):u=s[l].code,i.push(u),e({cellId:l})}await EF({cellIds:o,codes:i}).catch(DS)},t[0]=e,t[1]=n):n=t[1],Qe(n)}function DS(t){Zt.error(t)}const Aa=qt(null),RS=qt(!1),od=qt({chats:[],activeChatId:null}),PS=qt(t=>{const e=t(od);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(od,o=>({...o,activeChatId:n}))}),rd=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],nm(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=h.jsx(IF,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=h.jsxs(De,{"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 sd(){const t=X.c(3),{deleteCell:e,undoDeleteCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{if(ut.get(E3))return;const{cellId:s}=r;e({cellId:s}),AF({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(rd,{"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 Zp(){const t=X.c(3),{splitCell:e,undoSplitCell:n}=Lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=oc(r.cellId);if(!s)return;const i=j3(s);e(r);const{dismiss:a}=lt({title:"Cell split",action:h.jsx(rd,{"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 id(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=Zp(),f=td(n==null?void 0:n.cellId),m=!$e(E3),_=sd(),{openModal:g}=Un(),p=Qt(Aa),b=$e(rc),x=$e(Ts),y=$e(Ms),v=$e(TF);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:E,name:j,hasOutput:I,hasConsoleOutput:T,status:M}=n;let L;e[1]!==S||e[2]!==k.disabled||e[3]!==r?(L=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]=L):L=e[4];const B=L;let O;e[5]!==S||e[6]!==k.hide_code||e[7]!==E||e[8]!==r?(O=async()=>{const N={hide_code:!k.hide_code};await Ar({configs:{[S]:N}}),r({cellId:S,config:N});const H=E();H&&(N.hide_code?H.contentDOM.blur():H.focus())},e[5]=S,e[6]=k.hide_code,e[7]=E,e[8]=r,e[9]=O):O=e[9];const z=O;let F,V,P,C,$;return e[10]===Symbol.for("react.memo_cache_sentinel")?(F=h.jsx(Hp,{size:13,strokeWidth:1.5}),e[10]=F):F=e[10],e[11]!==S||e[12]!==j||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(mS,{placeholder:"cell name",value:j,onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),N.stopPropagation(),g(null))},onChange:N=>s({cellId:S,name:N})})]})]}))},e[11]=S,e[12]=j,e[13]=g,e[14]=s,e[15]=V):V=e[15],e[16]!==S||e[17]!==s?(P=N=>s({cellId:S,name:N}),e[16]=S,e[17]=s,e[18]=P):P=e[18],e[19]!==j||e[20]!==P?(C=h.jsx(mS,{placeholder:"cell name",value:j,onChange:P}),e[19]=j,e[20]=P,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]!==E||e[34]!==T||e[35]!==I||e[36]!==i||e[37]!==j||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:BS,handleHeadless:V,rightElement:C},{icon:h.jsx(Qs,{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(Xi,{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(Xc,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>u({cellId:S})},{icon:h.jsx(Km,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!I,handle:()=>function(N){const H=document.getElementById(k3.create(N));H&&(H.classList.add("printing-output"),S3(H,"result.png").finally(()=>{H.classList.remove("printing-output")}))}(S)},{icon:h.jsx(OF,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const N=E();N&&MF({[S]:N})}},{icon:k.hide_code?h.jsx(I3,{size:13,strokeWidth:1.5}):h.jsx(A3,{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(DF,{"data-testid":"cell-disable-switch",checked:!k.disabled,size:"sm",onCheckedChange:B}),handle:B},{icon:h.jsx(om,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(I||T),handle:()=>{d({cellId:S})}}],[{icon:h.jsx(sc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const N=E();N&&(ar(x,o),Ir(N,"markdown",{keepCodeAsIs:!1}))}},{icon:h.jsx(lr,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const N=E();N&&(ar(x,o),Ir(N,"sql",{keepCodeAsIs:!1}))}},{icon:h.jsx(ic,{}),label:"Toggle as Python",handle:()=>{const N=E();N&&(ar(x,o),RF(N,"python",{force:!0}))}}],[{icon:h.jsxs(ni,{children:[h.jsx(va,{size:13,strokeWidth:1.5}),h.jsx(T3,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:S,before:!0})},{icon:h.jsxs(ni,{children:[h.jsx(va,{size:13,strokeWidth:1.5}),h.jsx(Zi,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:S,before:!1})},{icon:h.jsx(T3,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:S,before:!0})},{icon:h.jsx(Zi,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:S,before:!1})},{icon:h.jsx(M3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:S,direction:"left"}),hidden:v!=="columns"},{icon:h.jsx(ac,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:S,direction:"right"}),hidden:v!=="columns"},{icon:h.jsx(sp,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:S})},{icon:h.jsx(rp,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:S})},{icon:h.jsx(PF,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:v!=="columns",handle:()=>c({cellId:S})}],[{icon:h.jsx(iS,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!fS(j),tooltip:fS(j)?void 0:"Only named cells can be linked to",handle:async()=>{await yn(w$(j)),lt({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:h.jsx(rm,{size:13,strokeWidth:1.5}),handle:()=>{_({cellId:S})}}]].map(FS).filter(LS),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]=E,e[34]=T,e[35]=I,e[36]=i,e[37]=j,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 LS(t){return t.length>0}function FS(t){return t.filter(zS)}function zS(t){return!t.hidden}function BS(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function US(t){return!t.hidden}const ad=qt(!1),Qp=()=>{const t=X.c(37),[e,n]=hn(ad),o=FF(),r=$e(zF),s=$e(sm);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=id(i).flat();a=Ia(a);const l=function(){const P=X.c(45),{theme:C}=Lo(),[$,N]=Ds(),[H,Y]=O3();let Q;P[0]!==N?(Q=async ce=>{await Rs({config:ce}).then(()=>{N(ce)})},P[0]=N,P[1]=Q):Q=P[1];const q=Q;let re;P[2]!==Y?(re=async ce=>{await LF({config:ce}).then(()=>{Y(ce)})},P[2]=Y,P[3]=re):re=P[3];const ne=re;let oe;if(P[4]!==H||P[5]!==$||P[6]!==ne||P[7]!==q||P[8]!==C){let ce,fe,de;P[10]!==H?(ce=et=>et!==H.width,P[10]=H,P[11]=ce):ce=P[11],P[12]!==H||P[13]!==ne?(fe=et=>({label:`App config > Set width=${et}`,handle:()=>{ne({...H,width:et})}}),P[12]=H,P[13]=ne,P[14]=fe):fe=P[14],P[15]!==$||P[16]!==q||P[17]!==C?(de={label:"Config > Toggle dark mode",handle:()=>{q({...$,display:{...$.display,theme:C==="dark"?"light":"dark"}})}},P[15]=$,P[16]=q,P[17]=C,P[18]=de):de=P[18];const _e=$.keymap.preset==="vim";let ie,we;P[19]!==$||P[20]!==q?(ie=()=>{q({...$,keymap:{...$.keymap,preset:"vim"}})},P[19]=$,P[20]=q,P[21]=ie):ie=P[21],P[22]!==_e||P[23]!==ie?(we={label:"Config > Switch keymap to VIM",hidden:_e,handle:ie},P[22]=_e,P[23]=ie,P[24]=we):we=P[24];const ve=$.keymap.preset==="default";let ae,ge,he;P[25]!==$||P[26]!==q?(ae=()=>{q({...$,keymap:{...$.keymap,preset:"default"}})},P[25]=$,P[26]=q,P[27]=ae):ae=P[27],P[28]!==ae||P[29]!==ve?(ge={label:"Config > Switch keymap to default (current: VIM)",hidden:ve,handle:ae},P[28]=ae,P[29]=ve,P[30]=ge):ge=P[30],P[31]!==$||P[32]!==q?(he=()=>{q({...$,completion:{...$.completion,copilot:!1}})},P[31]=$,P[32]=q,P[33]=he):he=P[33];const je=$.completion.copilot!=="github";let Fe,He;P[34]!==he||P[35]!==je?(Fe={label:"Config > Disable GitHub Copilot",handle:he,hidden:je},P[34]=he,P[35]=je,P[36]=Fe):Fe=P[36],P[37]!==$||P[38]!==q?(He=()=>{q({...$,completion:{...$.completion,copilot:"github"}})},P[37]=$,P[38]=q,P[39]=He):He=P[39];const Xe=$.completion.copilot==="github";let Le;P[40]!==He||P[41]!==Xe?(Le={label:"Config > Enable GitHub Copilot",handle:He,hidden:Xe},P[40]=He,P[41]=Xe,P[42]=Le):Le=P[42],oe=[...o$().filter(ce).map(fe),de,we,ge,Fe,Le],P[4]=H,P[5]=$,P[6]=ne,P[7]=q,P[8]=C,P[9]=oe}else oe=P[9];const G=oe;let Z;return P[43]!==G?(Z=G.filter(US),P[43]=G,P[44]=Z):Z=P[44],Z}();let c=Eg();c=[...Ia(c),...Ia(l)];const d=c.filter(VS),u=lc.keyBy(d,$S),{recentCommands:f,addRecentCommand:m}=OS();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=P=>{VF(s.getHotkey("global.commandPalette").key)(P)&&(P.preventDefault(),n(HS))},t[4]=s,t[5]=n,t[6]=p):p=t[6],nm(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(P,C)=>{const $=o[P];if(!$)return null;const N=s.getHotkey(P);return h.jsxs(mo,{disabled:C.disabled,onSelect:()=>{m(P),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(R3,{children:h.jsx(lm,{shortcut:N.key})})]},P)},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=(P,C,$,N)=>{const H=$===void 0?{}:$;return h.jsxs(mo,{disabled:H.disabled,onSelect:()=>{m(P),n(!1),requestAnimationFrame(()=>{C()})},value:P,children:[h.jsxs("span",{children:[P,H.tooltip&&h.jsxs("span",{className:"ml-2",children:["(",H.tooltip,")"]})]}),N&&h.jsx(R3,{children:h.jsx(lm,{shortcut:s.getHotkey(N).key})})]},P)},t[12]=m,t[13]=s,t[14]=n,t[15]=y):y=t[15];const v=y,S=UF;let k;t[16]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(Qi,{placeholder:"Type to search..."}),t[16]=k):k=t[16];const E=am;let j;t[17]===Symbol.for("react.memo_cache_sentinel")?(j=h.jsx(cc,{children:"No results found."}),t[17]=j):j=t[17];const I=f.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(im,{heading:"Recently Used",children:f.map(P=>{const C=u[P];return BF(P)?x(P,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip}):C&&!Kp(C)?v(C.label,C.handleHeadless||C.handle,{disabled:C.disabled,tooltip:C.tooltip}):null})}),h.jsx(D3,{})]}),T=im,M=s.iterate().map(P=>{if(g.has(P))return null;const C=u[P];return x(P,{disabled:C==null?void 0:C.disabled,tooltip:C==null?void 0:C.tooltip})}),L=d.map(P=>g.has(P.label)?null:v(P.label,P.handleHeadless||P.handle,{disabled:P.disabled,tooltip:P.tooltip}));let B;t[18]!==g||t[19]!==v?(B=P=>g.has(P.label)?null:v(`Cell > ${P.label}`,P.handleHeadless||P.handle,{disabled:P.disabled,tooltip:P.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]!==L||t[23]!==O||t[24]!==M?(z=h.jsxs(T,{heading:"Commands",children:[M,L,O]}),t[21]=T,t[22]=L,t[23]=O,t[24]=M,t[25]=z):z=t[25],t[26]!==E||t[27]!==z||t[28]!==j||t[29]!==I?(F=h.jsxs(E,{children:[j,I,z]}),t[26]=E,t[27]=z,t[28]=j,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 VS(t){return!t.hotkey}function $S(t){return t.label}function HS(t){return!t}const Ta="https://static.marimo.app",WS=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=`${Ta}/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 $F({download:!1,includeCode:!0,files:pS.INSTANCE.filenames()}),S=lt({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ta}/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:Ta,target:"_blank",children:Ta}),"."]})]}),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(qS,{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(De,{"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(De,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await yn(a)},children:"Create"}),e[15]=a,e[16]=p):p=e[16],e[17]!==p||e[18]!==g?(b=h.jsxs(ea,{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},qS=t=>{const e=X.c(8),[n,o]=K.useState(!1);let r;e[0]!==t.text?(r=Vn.stopPropagation(async c=>{c.preventDefault(),await yn(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(De,{"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 eg(){const t=X.c(3),{openConfirm:e}=Un(),n=Qt(po);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(P3,{onClick:async()=>{n({state:en.CLOSING}),await HF(),WF()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=n,t[2]=o):o=t[2],o}const ld=[{type:"files",Icon:gp,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:dc,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:lr,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:Ca,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:ba,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:Zc,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:cm,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:Qc,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:dm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:r$,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Fp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:wp,tooltip:"Secrets",hidden:Bn(),position:"sidebar"},{type:"scratchpad",Icon:qF,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:om,tooltip:"View errors",position:"footer"}];function tg(){const t=X.c(2),e=Qt(um);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:GF(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 Re.string().optional().describe(Je.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function ng(){return Re.string().optional().describe(Je.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Ma(){return Re.string().optional().describe(Je.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function og(){return Re.string().optional().describe(Je.of({label:"URI",optionRegex:".*uri.*"}))}function Lr(){return Re.string().nonempty().describe(Je.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function Ho(){return Re.string().describe(Je.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Fr(){return Re.string().nonempty().describe(Je.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function zr(t){const e=Re.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 rg(){return Re.boolean().default(!1).describe(Je.of({label:"Read Only"}))}const sg=Re.object({type:Re.literal("postgres"),host:Lr(),port:zr(5432).optional(),database:Ho(),username:Fr(),password:Pr(),ssl:Re.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),ig=Re.object({type:Re.literal("mysql"),host:Lr(),port:zr(3306),database:Ho(),username:Fr(),password:Pr(),ssl:Re.boolean().default(!1).describe(Je.of({label:"Use SSL"}))}).describe(Je.of({direction:"two-columns"})),ag=Re.object({type:Re.literal("sqlite"),database:Ho().describe(Je.of({label:"Database Path"}))}).describe(Je.of({direction:"two-columns"})),lg=Re.object({type:Re.literal("duckdb"),database:Ho().describe(Je.of({label:"Database Path"})),read_only:rg()}).describe(Je.of({direction:"two-columns"})),cg=Re.object({type:Re.literal("motherduck"),database:Ho().default("my_db").describe(Je.of({label:"Database Name"})),token:ng()}).describe(Je.of({direction:"two-columns"})),dg=Re.object({type:Re.literal("snowflake"),account:Re.string().nonempty().describe(Je.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:Re.string().optional().describe(Je.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:Ho(),schema:Re.string().optional().describe(Je.of({label:"Schema",optionRegex:".*snowflake.*"})),username:Fr(),password:Pr(),role:Re.string().optional().describe(Je.of({label:"Role"}))}).describe(Je.of({direction:"two-columns"})),ug=Re.object({type:Re.literal("bigquery"),project:Re.string().nonempty().describe(Je.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:Re.string().nonempty().describe(Je.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:Re.string().describe(Je.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(Je.of({direction:"two-columns"})),hg=Re.object({type:Re.literal("clickhouse_connect"),host:Lr(),port:zr(8123).optional(),username:Fr(),password:Pr(),secure:Re.boolean().default(!1).describe(Je.of({label:"Use HTTPs"}))}).describe(Je.of({direction:"two-columns"})),fg=Re.object({type:Re.literal("timeplus"),host:Lr().default("localhost"),port:zr(8123).optional(),username:Fr().default("default"),password:Pr().default("")}).describe(Je.of({direction:"two-columns"})),mg=Re.object({type:Re.literal("chdb"),database:Ho().describe(Je.of({label:"Database Path"})),read_only:rg()}).describe(Je.of({direction:"two-columns"})),pg=Re.object({type:Re.literal("trino"),host:Lr(),port:zr(8080),database:Ho(),schema:Re.string().describe(Je.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:Fr(),password:Pr(),async_support:Re.boolean().default(!1).describe(Je.of({label:"Async Support"}))}).describe(Je.of({direction:"two-columns"})),gg=Re.object({type:Re.literal("iceberg"),name:Re.string().describe(Je.of({label:"Catalog Name"})),catalog:Re.discriminatedUnion("type",[Re.object({type:Re.literal("REST"),warehouse:Ma(),uri:Re.string().optional().describe(Je.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:ng()}),Re.object({type:Re.literal("SQL"),warehouse:Ma(),uri:Re.string().optional().describe(Je.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),Re.object({type:Re.literal("Hive"),warehouse:Ma(),uri:og()}),Re.object({type:Re.literal("Glue"),warehouse:Ma(),uri:og()}),Re.object({type:Re.literal("DynamoDB"),"dynamodb.profile-name":Re.string().optional().describe(Je.of({label:"Profile Name"})),"dynamodb.region":Re.string().optional().describe(Je.of({label:"Region"})),"dynamodb.access-key-id":Re.string().optional().describe(Je.of({label:"Access Key ID"})),"dynamodb.secret-access-key":Re.string().optional().describe(Je.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":Re.string().optional().describe(Je.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(Je.of({special:"tabs"}))}),_g=Re.object({type:Re.literal("datafusion"),sessionContext:Re.boolean().optional().describe(Je.of({label:"Use Session Context"}))}),bg=Re.object({type:Re.literal("pyspark"),host:Lr().optional(),port:zr().optional()}),GS=Re.discriminatedUnion("type",[sg,ig,ag,lg,cg,dg,ug,hg,fg,mg,pg,gg,_g,bg]),cd="env:";function Oa(t){return typeof t=="string"&&t.startsWith(cd)}function dd(t){return`${cd}${t}`}const yg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck"};class pn{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 YS{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),Oa(n)){const r=n.replace(cd,""),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 Oa(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 JS extends pn{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})
@@ -109,7 +109,7 @@ ${f.codeAfter}
109
109
  Press space again to drop the item in its new position, or press escape to cancel.
110
110
  `},pE={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function gE(t){let{announcements:e=pE,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=mE}=t;const{announce:s,announcement:i}=function(){const[u,f]=A.useState("");return{announce:A.useCallback(m=>{m!=null&&f(m)},[]),announcement:u}}(),a=da("DndLiveRegion"),[l,c]=A.useState(!1);if(A.useEffect(()=>{c(!0)},[]),function(u){const f=A.useContext(A_);A.useEffect(()=>{if(!f)throw new Error("useDndMonitor must be used within a children of <DndContext>");return f(u)},[u,f])}(A.useMemo(()=>({onDragStart(u){let{active:f}=u;s(e.onDragStart({active:f}))},onDragMove(u){let{active:f,over:m}=u;e.onDragMove&&s(e.onDragMove({active:f,over:m}))},onDragOver(u){let{active:f,over:m}=u;s(e.onDragOver({active:f,over:m}))},onDragEnd(u){let{active:f,over:m}=u;s(e.onDragEnd({active:f,over:m}))},onDragCancel(u){let{active:f,over:m}=u;s(e.onDragCancel({active:f,over:m}))}}),[s,e])),!l)return null;const d=K.createElement(K.Fragment,null,K.createElement(hE,{id:o,value:r.draggable}),K.createElement(fE,{id:a,announcement:i}));return n?fa.createPortal(d,n):d}var zt;function rl(){}function T_(t,e){return A.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(zt||(zt={}));const qn=Object.freeze({x:0,y:0});function Kd(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Xd(t,e){let{data:{value:n}}=t,{data:{value:o}}=e;return n-o}function _E(t,e){let{data:{value:n}}=t,{data:{value:o}}=e;return o-n}function Zd(t){let{left:e,top:n,height:o,width:r}=t;return[{x:e,y:n},{x:e+r,y:n},{x:e,y:n+o},{x:e+r,y:n+o}]}function Qd(t,e){if(!t||t.length===0)return null;const[n]=t;return e?n[e]:n}function M_(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+.5*t.width,y:n+.5*t.height}}const eu=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:o}=t;const r=M_(e,e.left,e.top),s=[];for(const i of o){const{id:a}=i,l=n.get(a);if(l){const c=Kd(M_(l),r);s.push({id:a,data:{droppableContainer:i,value:c}})}}return s.sort(Xd)};function bE(t,e){const n=Math.max(e.top,t.top),o=Math.max(e.left,t.left),r=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),i=r-o,a=s-n;if(o<r&&n<s){const l=e.width*e.height,c=t.width*t.height,d=i*a;return Number((d/(l+c-d)).toFixed(4))}return 0}const O_=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:o}=t;const r=[];for(const s of o){const{id:i}=s,a=n.get(i);if(a){const l=bE(a,e);l>0&&r.push({id:i,data:{droppableContainer:s,value:l}})}}return r.sort(_E)};function yE(t,e){const{top:n,left:o,bottom:r,right:s}=e;return n<=t.y&&t.y<=r&&o<=t.x&&t.x<=s}function D_(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:qn}function xE(t){return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((s,i)=>({...s,top:s.top+t*i.y,bottom:s.bottom+t*i.y,left:s.left+t*i.x,right:s.right+t*i.x}),{...e})}}const wE=xE(1),vE={ignoreTransform:!1};function Gr(t,e){e===void 0&&(e=vE);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:c,transformOrigin:d}=Vo(t).getComputedStyle(t);c&&(n=function(u,f,m){const _=function(E){if(E.startsWith("matrix3d(")){const j=E.slice(9,-1).split(/, /);return{x:+j[12],y:+j[13],scaleX:+j[0],scaleY:+j[5]}}if(E.startsWith("matrix(")){const j=E.slice(7,-1).split(/, /);return{x:+j[4],y:+j[5],scaleX:+j[0],scaleY:+j[3]}}return null}(f);if(!_)return u;const{scaleX:g,scaleY:p,x:b,y:x}=_,y=u.left-b-(1-g)*parseFloat(m),v=u.top-x-(1-p)*parseFloat(m.slice(m.indexOf(" ")+1)),S=g?u.width/g:u.width,k=p?u.height/p:u.height;return{width:S,height:k,top:v,right:y+S,bottom:v+k,left:y}}(n,c,d))}const{top:o,left:r,width:s,height:i,bottom:a,right:l}=n;return{top:o,left:r,width:s,height:i,bottom:a,right:l}}function R_(t){return Gr(t,{ignoreTransform:!0})}function sl(t,e){const n=[];return t?function o(r){if(e!=null&&n.length>=e||!r)return n;if(f4(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Ac(r)||VB(r)||n.includes(r))return n;const s=Vo(t).getComputedStyle(r);return r!==t&&function(i,a){a===void 0&&(a=Vo(i).getComputedStyle(i));const l=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(c=>{const d=a[c];return typeof d=="string"&&l.test(d)})}(r,s)&&n.push(r),function(i,a){return a===void 0&&(a=Vo(i).getComputedStyle(i)),a.position==="fixed"}(r,s)?n:o(r.parentNode)}(t):n}function P_(t){const[e]=sl(t,1);return e??null}function tu(t){return jm&&t?Em(t)?t:WB(t)?f4(t)||t===qs(t).scrollingElement?window:Ac(t)?t:null:null:null}function L_(t){return Em(t)?t.scrollX:t.scrollLeft}function F_(t){return Em(t)?t.scrollY:t.scrollTop}function nu(t){return{x:L_(t),y:F_(t)}}var $t;function z_(t){return!(!jm||!t)&&t===document.scrollingElement}function B_(t){const e={x:0,y:0},n=z_(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},o={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height};return{isTop:t.scrollTop<=e.y,isLeft:t.scrollLeft<=e.x,isBottom:t.scrollTop>=o.y,isRight:t.scrollLeft>=o.x,maxScroll:o,minScroll:e}}(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})($t||($t={}));const kE={x:.2,y:.2};function SE(t,e,n,o,r){let{top:s,left:i,right:a,bottom:l}=n;o===void 0&&(o=10),r===void 0&&(r=kE);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=B_(t),m={x:0,y:0},_={x:0,y:0},g=e.height*r.y,p=e.width*r.x;return!c&&s<=e.top+g?(m.y=$t.Backward,_.y=o*Math.abs((e.top+g-s)/g)):!d&&l>=e.bottom-g&&(m.y=$t.Forward,_.y=o*Math.abs((e.bottom-g-l)/g)),!f&&a>=e.right-p?(m.x=$t.Forward,_.x=o*Math.abs((e.right-p-a)/p)):!u&&i<=e.left+p&&(m.x=$t.Backward,_.x=o*Math.abs((e.left+p-i)/p)),{direction:m,speed:_}}function CE(t){if(t===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:e,left:n,right:o,bottom:r}=t.getBoundingClientRect();return{top:e,left:n,right:o,bottom:r,width:t.clientWidth,height:t.clientHeight}}function U_(t){return t.reduce((e,n)=>Gs(e,nu(n)),qn)}const NE=[["x",["left","right"],function(t){return t.reduce((e,n)=>e+L_(n),0)}],["y",["top","bottom"],function(t){return t.reduce((e,n)=>e+F_(n),0)}]];class ou{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=sl(n),r=U_(o);this.rect={...e},this.width=e.width,this.height=e.height;for(const[s,i,a]of NE)for(const l of i)Object.defineProperty(this,l,{get:()=>{const c=a(o),d=r[s]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class wi{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=e}add(e,n,o){var r;(r=this.target)==null||r.addEventListener(e,n,o),this.listeners.push([e,n,o])}}function ru(t,e){const n=Math.abs(t.x),o=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+o**2)>e:"x"in e&&"y"in e?n>e.x&&o>e.y:"x"in e?n>e.x:"y"in e&&o>e.y}var Tn,ct;function V_(t){t.preventDefault()}function jE(t){t.stopPropagation()}(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Tn||(Tn={})),function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"}(ct||(ct={}));const $_={start:[ct.Space,ct.Enter],cancel:[ct.Esc],end:[ct.Space,ct.Enter,ct.Tab]},EE=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case ct.Right:return{...n,x:n.x+25};case ct.Left:return{...n,x:n.x-25};case ct.Down:return{...n,y:n.y+25};case ct.Up:return{...n,y:n.y-25}}};class su{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new wi(qs(n)),this.windowListeners=new wi(Vo(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Tn.Resize,this.handleCancel),this.windowListeners.add(Tn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Tn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,o=e.node.current;o&&function(r,s){if(s===void 0&&(s=Gr),!r)return;const{top:i,left:a,bottom:l,right:c}=s(r);P_(r)&&(l<=0||c<=0||i>=window.innerHeight||a>=window.innerWidth)&&r.scrollIntoView({block:"center",inline:"center"})}(o),n(qn)}handleKeyDown(e){if(Cm(e)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:s=$_,coordinateGetter:i=EE,scrollBehavior:a="smooth"}=r,{code:l}=e;if(s.end.includes(l))return void this.handleEnd(e);if(s.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=o.current,d=c?{x:c.left,y:c.top}:qn;this.referenceCoordinates||(this.referenceCoordinates=d);const u=i(e,{active:n,context:o.current,currentCoordinates:d});if(u){const f=ha(u,d),m={x:0,y:0},{scrollableAncestors:_}=o.current;for(const g of _){const p=e.code,{isTop:b,isRight:x,isLeft:y,isBottom:v,maxScroll:S,minScroll:k}=B_(g),E=CE(g),j={x:Math.min(p===ct.Right?E.right-E.width/2:E.right,Math.max(p===ct.Right?E.left:E.left+E.width/2,u.x)),y:Math.min(p===ct.Down?E.bottom-E.height/2:E.bottom,Math.max(p===ct.Down?E.top:E.top+E.height/2,u.y))},I=p===ct.Right&&!x||p===ct.Left&&!y,T=p===ct.Down&&!v||p===ct.Up&&!b;if(I&&j.x!==u.x){const M=g.scrollLeft+f.x,L=p===ct.Right&&M<=S.x||p===ct.Left&&M>=k.x;if(L&&!f.y)return void g.scrollTo({left:M,behavior:a});m.x=L?g.scrollLeft-M:p===ct.Right?g.scrollLeft-S.x:g.scrollLeft-k.x,m.x&&g.scrollBy({left:-m.x,behavior:a});break}if(T&&j.y!==u.y){const M=g.scrollTop+f.y,L=p===ct.Down&&M<=S.y||p===ct.Up&&M>=k.y;if(L&&!f.x)return void g.scrollTo({top:M,behavior:a});m.y=L?g.scrollTop-M:p===ct.Down?g.scrollTop-S.y:g.scrollTop-k.y,m.y&&g.scrollBy({top:-m.y,behavior:a});break}}this.handleMove(e,Gs(ha(u,this.referenceCoordinates),m))}}}handleMove(e,n){const{onMove:o}=this.props;e.preventDefault(),o(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function H_(t){return!!(t&&"distance"in t)}function W_(t){return!!(t&&"delay"in t)}su.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:o=$_,onActivation:r}=e,{active:s}=n;const{code:i}=t.nativeEvent;if(o.start.includes(i)){const a=s.activatorNode.current;return(!a||t.target===a)&&(t.preventDefault(),r==null||r({event:t.nativeEvent}),!0)}return!1}}];class iu{constructor(e,n,o){var r;o===void 0&&(o=function(a){const{EventTarget:l}=Vo(a);return a instanceof l?a:qs(a)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:s}=e,{target:i}=s;this.props=e,this.events=n,this.document=qs(i),this.documentListeners=new wi(this.document),this.listeners=new wi(o),this.windowListeners=new wi(Vo(i)),this.initialCoordinates=(r=Nm(s))!=null?r:qn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Tn.Resize,this.handleCancel),this.windowListeners.add(Tn.DragStart,V_),this.windowListeners.add(Tn.VisibilityChange,this.handleCancel),this.windowListeners.add(Tn.ContextMenu,V_),this.documentListeners.add(Tn.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(W_(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(H_(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:o,onPending:r}=this.props;r(o,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Tn.Click,jE,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Tn.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:o,initialCoordinates:r,props:s}=this,{onMove:i,options:{activationConstraint:a}}=s;if(!r)return;const l=(n=Nm(e))!=null?n:qn,c=ha(r,l);if(!o&&a){if(H_(a)){if(a.tolerance!=null&&ru(c,a.tolerance))return this.handleCancel();if(ru(c,a.distance))return this.handleStart()}return W_(a)&&ru(c,a.tolerance)?this.handleCancel():void this.handlePending(a,c)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===ct.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const IE={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class au extends iu{constructor(e){const{event:n}=e,o=qs(n.target);super(e,IE,o)}}au.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:o}=e;return!(!n.isPrimary||n.button!==0)&&(o==null||o({event:n}),!0)}}];const AE={move:{name:"mousemove"},end:{name:"mouseup"}};var lu;(function(t){t[t.RightClick=2]="RightClick"})(lu||(lu={})),(class extends iu{constructor(t){super(t,AE,qs(t.event.target))}}).activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:o}=e;return n.button!==lu.RightClick&&(o==null||o({event:n}),!0)}}];const cu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var vi,il;function TE(t){let{acceleration:e,activator:n=vi.Pointer,canScroll:o,draggingRect:r,enabled:s,interval:i=5,order:a=il.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:f}=t;const m=function(k){let{delta:E,disabled:j}=k;const I=Tc(E);return ma(T=>{if(j||!I||!T)return ME;const M={x:Math.sign(E.x-I.x),y:Math.sign(E.y-I.y)};return{x:{[$t.Backward]:T.x[$t.Backward]||M.x===-1,[$t.Forward]:T.x[$t.Forward]||M.x===1},y:{[$t.Backward]:T.y[$t.Backward]||M.y===-1,[$t.Forward]:T.y[$t.Forward]||M.y===1}}},[j,E,I])}({delta:u,disabled:!s}),[_,g]=$B(),p=A.useRef({x:0,y:0}),b=A.useRef({x:0,y:0}),x=A.useMemo(()=>{switch(n){case vi.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case vi.DraggableRect:return r}},[n,r,l]),y=A.useRef(null),v=A.useCallback(()=>{const k=y.current;if(!k)return;const E=p.current.x*b.current.x,j=p.current.y*b.current.y;k.scrollBy(E,j)},[]),S=A.useMemo(()=>a===il.TreeOrder?[...c].reverse():c,[a,c]);A.useEffect(()=>{if(s&&c.length&&x){for(const k of S){if((o==null?void 0:o(k))===!1)continue;const E=c.indexOf(k),j=d[E];if(!j)continue;const{direction:I,speed:T}=SE(k,j,x,e,f);for(const M of["x","y"])m[M][I[M]]||(T[M]=0,I[M]=0);if(T.x>0||T.y>0)return g(),y.current=k,_(v,i),p.current=T,void(b.current=I)}p.current={x:0,y:0},b.current={x:0,y:0},g()}else g()},[e,v,o,g,s,i,JSON.stringify(x),JSON.stringify(m),_,c,S,d,JSON.stringify(f)])}(class extends iu{constructor(t){super(t,cu)}static setup(){return window.addEventListener(cu.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(cu.move.name,t)};function t(){}}}).activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:o}=e;const{touches:r}=n;return!(r.length>1)&&(o==null||o({event:n}),!0)}}],function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"}(vi||(vi={})),function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"}(il||(il={}));const ME={x:{[$t.Backward]:!1,[$t.Forward]:!1},y:{[$t.Backward]:!1,[$t.Forward]:!1}};var ki,du;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ki||(ki={})),function(t){t.Optimized="optimized"}(du||(du={}));const q_=new Map;function G_(t,e){return ma(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function al(t){let{callback:e,disabled:n}=t;const o=h4(e),r=A.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:s}=window;return new s(o)},[n]);return A.useEffect(()=>()=>r==null?void 0:r.disconnect(),[r]),r}function OE(t){return new ou(Gr(t),t)}function Y_(t,e,n){e===void 0&&(e=OE);const[o,r]=A.useState(null);function s(){r(l=>{if(!t)return null;var c;if(t.isConnected===!1)return(c=l??n)!=null?c:null;const d=e(t);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const i=function(l){let{callback:c,disabled:d}=l;const u=h4(c),f=A.useMemo(()=>{if(d||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:m}=window;return new m(u)},[u,d]);return A.useEffect(()=>()=>f==null?void 0:f.disconnect(),[f]),f}({callback(l){if(t)for(const c of l){const{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(t)){s();break}}}}),a=al({callback:s});return fr(()=>{s(),t?(a==null||a.observe(t),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),i==null||i.disconnect())},[t]),o}const J_=[];function K_(t,e){e===void 0&&(e=[]);const n=A.useRef(null);return A.useEffect(()=>{n.current=null},e),A.useEffect(()=>{const o=t!==qn;o&&!n.current&&(n.current=t),!o&&n.current&&(n.current=null)},[t]),n.current?ha(t,n.current):qn}function X_(t){return A.useMemo(()=>t?function(e){const n=e.innerWidth,o=e.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}(t):null,[t])}const Z_=[];function DE(t){let{measure:e}=t;const[n,o]=A.useState(null),r=A.useCallback(c=>{for(const{target:d}of c)if(Ac(d)){o(u=>{const f=e(d);return u?{...u,width:f.width,height:f.height}:f});break}},[e]),s=al({callback:r}),i=A.useCallback(c=>{const d=function(u){if(!u)return null;if(u.children.length>1)return u;const f=u.children[0];return Ac(f)?f:u}(c);s==null||s.disconnect(),d&&(s==null||s.observe(d)),o(d?e(d):null)},[e,s]),[a,l]=Ic(i);return A.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const RE=[{sensor:au,options:{}},{sensor:su,options:{}}],PE={current:{}},ll={draggable:{measure:R_},droppable:{measure:R_,strategy:ki.WhileDragging,frequency:du.Optimized},dragOverlay:{measure:Gr}};class Si extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,o;return(n=(o=this.get(e))==null?void 0:o.node.current)!=null?n:void 0}}const LE={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Si,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:rl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ll,measureDroppableContainers:rl,windowRect:null,measuringScheduled:!1},FE={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:rl,draggableNodes:new Map,over:null,measureDroppableContainers:rl},cl=A.createContext(FE),Q_=A.createContext(LE);function zE(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Si}}}function BE(t,e){switch(e.type){case zt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case zt.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case zt.DragEnd:case zt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case zt.RegisterDroppable:{const{element:n}=e,{id:o}=n,r=new Si(t.droppable.containers);return r.set(o,n),{...t,droppable:{...t.droppable,containers:r}}}case zt.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=e,s=t.droppable.containers.get(n);if(!s||o!==s.key)return t;const i=new Si(t.droppable.containers);return i.set(n,{...s,disabled:r}),{...t,droppable:{...t.droppable,containers:i}}}case zt.UnregisterDroppable:{const{id:n,key:o}=e,r=t.droppable.containers.get(n);if(!r||o!==r.key)return t;const s=new Si(t.droppable.containers);return s.delete(n),{...t,droppable:{...t.droppable,containers:s}}}default:return t}}function UE(t){let{disabled:e}=t;const{active:n,activatorEvent:o,draggableNodes:r}=A.useContext(cl),s=Tc(o),i=Tc(n==null?void 0:n.id);return A.useEffect(()=>{if(!e&&!o&&s&&i!=null){if(!Cm(s)||document.activeElement===s.target)return;const a=r.get(i);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const u=HB(d);if(u){u.focus();break}}})}},[o,e,r,i,s]),null}const e0=A.createContext({...qn,scaleX:1,scaleY:1});var Yo;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Yo||(Yo={}));const VE=A.memo(function(t){var e,n,o,r;let{id:s,accessibility:i,autoScroll:a=!0,children:l,sensors:c=RE,collisionDetection:d=O_,measuring:u,modifiers:f,...m}=t;const _=A.useReducer(BE,void 0,zE),[g,p]=_,[b,x]=function(){const[le]=A.useState(()=>new Set),Ee=A.useCallback(Ie=>(le.add(Ie),()=>le.delete(Ie)),[le]);return[A.useCallback(Ie=>{let{type:Be,event:We}=Ie;le.forEach(Me=>{var Ge;return(Ge=Me[Be])==null?void 0:Ge.call(Me,We)})},[le]),Ee]}(),[y,v]=A.useState(Yo.Uninitialized),S=y===Yo.Initialized,{draggable:{active:k,nodes:E,translate:j},droppable:{containers:I}}=g,T=k!=null?E.get(k):null,M=A.useRef({initial:null,translated:null}),L=A.useMemo(()=>{var le;return k!=null?{id:k,data:(le=T==null?void 0:T.data)!=null?le:PE,rect:M}:null},[k,T]),B=A.useRef(null),[O,z]=A.useState(null),[F,V]=A.useState(null),P=ua(m,Object.values(m)),C=da("DndDescribedBy",s),$=A.useMemo(()=>I.getEnabled(),[I]),N=(H=u,A.useMemo(()=>({draggable:{...ll.draggable,...H==null?void 0:H.draggable},droppable:{...ll.droppable,...H==null?void 0:H.droppable},dragOverlay:{...ll.dragOverlay,...H==null?void 0:H.dragOverlay}}),[H==null?void 0:H.draggable,H==null?void 0:H.droppable,H==null?void 0:H.dragOverlay]));var H;const{droppableRects:Y,measureDroppableContainers:Q,measuringScheduled:q}=function(le,Ee){let{dragging:Ie,dependencies:Be,config:We}=Ee;const[Me,Ge]=A.useState(null),{frequency:ot,measure:Ye,strategy:rt}=We,pt=A.useRef(le),yt=function(){switch(rt){case ki.Always:return!1;case ki.BeforeDragging:return Ie;default:return!Ie}}(),Tt=ua(yt),xt=A.useCallback(function(un){un===void 0&&(un=[]),Tt.current||Ge(rn=>rn===null?un:rn.concat(un.filter(Xt=>!rn.includes(Xt))))},[Tt]),Bt=A.useRef(null),Sn=ma(un=>{if(yt&&!Ie)return q_;if(!un||un===q_||pt.current!==le||Me!=null){const rn=new Map;for(let Xt of le){if(!Xt)continue;if(Me&&Me.length>0&&!Me.includes(Xt.id)&&Xt.rect.current){rn.set(Xt.id,Xt.rect.current);continue}const Jn=Xt.node.current,ho=Jn?new ou(Ye(Jn),Jn):null;Xt.rect.current=ho,ho&&rn.set(Xt.id,ho)}return rn}return un},[le,Me,Ie,yt,Ye]);return A.useEffect(()=>{pt.current=le},[le]),A.useEffect(()=>{yt||xt()},[Ie,yt]),A.useEffect(()=>{Me&&Me.length>0&&Ge(null)},[JSON.stringify(Me)]),A.useEffect(()=>{yt||typeof ot!="number"||Bt.current!==null||(Bt.current=setTimeout(()=>{xt(),Bt.current=null},ot))},[ot,yt,xt,...Be]),{droppableRects:Sn,measureDroppableContainers:xt,measuringScheduled:Me!=null}}($,{dragging:S,dependencies:[j.x,j.y],config:N.droppable}),re=function(le,Ee){const Ie=Ee!=null?le.get(Ee):void 0,Be=Ie?Ie.node.current:null;return ma(We=>{var Me;return Ee==null?null:(Me=Be??We)!=null?Me:null},[Be,Ee])}(E,k),ne=A.useMemo(()=>F?Nm(F):null,[F]),oe=function(){const le=(O==null?void 0:O.autoScrollEnabled)===!1,Ee=typeof a=="object"?a.enabled===!1:a===!1,Ie=S&&!le&&!Ee;return typeof a=="object"?{...a,enabled:Ie}:{enabled:Ie}}(),G=function(le,Ee){return G_(le,Ee)}(re,N.draggable.measure);(function(le){let{activeNode:Ee,measure:Ie,initialRect:Be,config:We=!0}=le;const Me=A.useRef(!1),{x:Ge,y:ot}=typeof We=="boolean"?{x:We,y:We}:We;fr(()=>{if(!Ge&&!ot||!Ee)return void(Me.current=!1);if(Me.current||!Be)return;const Ye=Ee==null?void 0:Ee.node.current;if(!Ye||Ye.isConnected===!1)return;const rt=D_(Ie(Ye),Be);if(Ge||(rt.x=0),ot||(rt.y=0),Me.current=!0,Math.abs(rt.x)>0||Math.abs(rt.y)>0){const pt=P_(Ye);pt&&pt.scrollBy({top:rt.y,left:rt.x})}},[Ee,Ge,ot,Be,Ie])})({activeNode:k!=null?E.get(k):null,config:oe.layoutShiftCompensation,initialRect:G,measure:N.draggable.measure});const Z=Y_(re,N.draggable.measure,G),ce=Y_(re?re.parentElement:null),fe=A.useRef({activatorEvent:null,active:null,activeNode:re,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),de=I.getNodeFor((e=fe.current.over)==null?void 0:e.id),_e=DE({measure:N.dragOverlay.measure}),ie=(n=_e.nodeRef.current)!=null?n:re,we=S?(o=_e.rect)!=null?o:Z:null,ve=!!(_e.nodeRef.current&&_e.rect),ae=D_(ge=ve?null:Z,G_(ge));var ge;const he=X_(ie?Vo(ie):null),je=function(le){const Ee=A.useRef(le),Ie=ma(Be=>le?Be&&Be!==J_&&le&&Ee.current&&le.parentNode===Ee.current.parentNode?Be:sl(le):J_,[le]);return A.useEffect(()=>{Ee.current=le},[le]),Ie}(S?de??re:null),Fe=function(le,Ee){Ee===void 0&&(Ee=Gr);const[Ie]=le,Be=X_(Ie?Vo(Ie):null),[We,Me]=A.useState(Z_);function Ge(){Me(()=>le.length?le.map(Ye=>z_(Ye)?Be:new ou(Ee(Ye),Ye)):Z_)}const ot=al({callback:Ge});return fr(()=>{ot==null||ot.disconnect(),Ge(),le.forEach(Ye=>ot==null?void 0:ot.observe(Ye))},[le]),We}(je),He=function(le,Ee){let{transform:Ie,...Be}=Ee;return le!=null&&le.length?le.reduce((We,Me)=>Me({transform:We,...Be}),Ie):Ie}(f,{transform:{x:j.x-ae.x,y:j.y-ae.y,scaleX:1,scaleY:1},activatorEvent:F,active:L,activeNodeRect:Z,containerNodeRect:ce,draggingNodeRect:we,over:fe.current.over,overlayNodeRect:_e.rect,scrollableAncestors:je,scrollableAncestorRects:Fe,windowRect:he}),Xe=ne?Gs(ne,j):null,Le=function(le){const[Ee,Ie]=A.useState(null),Be=A.useRef(le),We=A.useCallback(Me=>{const Ge=tu(Me.target);Ge&&Ie(ot=>ot?(ot.set(Ge,nu(Ge)),new Map(ot)):null)},[]);return A.useEffect(()=>{const Me=Be.current;if(le!==Me){Ge(Me);const ot=le.map(Ye=>{const rt=tu(Ye);return rt?(rt.addEventListener("scroll",We,{passive:!0}),[rt,nu(rt)]):null}).filter(Ye=>Ye!=null);Ie(ot.length?new Map(ot):null),Be.current=le}return()=>{Ge(le),Ge(Me)};function Ge(ot){ot.forEach(Ye=>{const rt=tu(Ye);rt==null||rt.removeEventListener("scroll",We)})}},[We,le]),A.useMemo(()=>le.length?Ee?Array.from(Ee.values()).reduce((Me,Ge)=>Gs(Me,Ge),qn):U_(le):qn,[le,Ee])}(je),et=K_(Le),nt=K_(Le,[Z]),it=Gs(He,et),te=we?wE(we,He):null,Ce=L&&te?d({active:L,collisionRect:te,droppableRects:Y,droppableContainers:$,pointerCoordinates:Xe}):null,Ae=Qd(Ce,"id"),[ze,J]=A.useState(null),pe=function(le,Ee,Ie){return{...le,scaleX:Ee&&Ie?Ee.width/Ie.width:1,scaleY:Ee&&Ie?Ee.height/Ie.height:1}}(ve?He:Gs(He,nt),(r=ze==null?void 0:ze.rect)!=null?r:null,Z),be=A.useRef(null),ue=A.useCallback((le,Ee)=>{let{sensor:Ie,options:Be}=Ee;if(B.current==null)return;const We=E.get(B.current);if(!We)return;const Me=le.nativeEvent,Ge=new Ie({active:B.current,activeNode:We,event:Me,options:Be,context:fe,onAbort(Ye){if(!E.get(Ye))return;const{onDragAbort:rt}=P.current,pt={id:Ye};rt==null||rt(pt),b({type:"onDragAbort",event:pt})},onPending(Ye,rt,pt,yt){if(!E.get(Ye))return;const{onDragPending:Tt}=P.current,xt={id:Ye,constraint:rt,initialCoordinates:pt,offset:yt};Tt==null||Tt(xt),b({type:"onDragPending",event:xt})},onStart(Ye){const rt=B.current;if(rt==null)return;const pt=E.get(rt);if(!pt)return;const{onDragStart:yt}=P.current,Tt={activatorEvent:Me,active:{id:rt,data:pt.data,rect:M}};fa.unstable_batchedUpdates(()=>{yt==null||yt(Tt),v(Yo.Initializing),p({type:zt.DragStart,initialCoordinates:Ye,active:rt}),b({type:"onDragStart",event:Tt}),z(be.current),V(Me)})},onMove(Ye){p({type:zt.DragMove,coordinates:Ye})},onEnd:ot(zt.DragEnd),onCancel:ot(zt.DragCancel)});function ot(Ye){return async function(){const{active:rt,collisions:pt,over:yt,scrollAdjustedTranslate:Tt}=fe.current;let xt=null;if(rt&&Tt){const{cancelDrop:Bt}=P.current;xt={activatorEvent:Me,active:rt,collisions:pt,delta:Tt,over:yt},Ye===zt.DragEnd&&typeof Bt=="function"&&await Promise.resolve(Bt(xt))&&(Ye=zt.DragCancel)}B.current=null,fa.unstable_batchedUpdates(()=>{p({type:Ye}),v(Yo.Uninitialized),J(null),z(null),V(null),be.current=null;const Bt=Ye===zt.DragEnd?"onDragEnd":"onDragCancel";if(xt){const Sn=P.current[Bt];Sn==null||Sn(xt),b({type:Bt,event:xt})}})}}be.current=Ge},[E]),Ne=A.useCallback((le,Ee)=>(Ie,Be)=>{const We=Ie.nativeEvent,Me=E.get(Be);if(B.current!==null||!Me||We.dndKit||We.defaultPrevented)return;const Ge={active:Me};le(Ie,Ee.options,Ge)===!0&&(We.dndKit={capturedBy:Ee.sensor},B.current=Be,ue(Ie,Ee))},[E,ue]),ke=function(le,Ee){return A.useMemo(()=>le.reduce((Ie,Be)=>{const{sensor:We}=Be;return[...Ie,...We.activators.map(Me=>({eventName:Me.eventName,handler:Ee(Me.handler,Be)}))]},[]),[le,Ee])}(c,Ne);(function(le){A.useEffect(()=>{if(!jm)return;const Ee=le.map(Ie=>{let{sensor:Be}=Ie;return Be.setup==null?void 0:Be.setup()});return()=>{for(const Ie of Ee)Ie==null||Ie()}},le.map(Ee=>{let{sensor:Ie}=Ee;return Ie}))})(c),fr(()=>{Z&&y===Yo.Initializing&&v(Yo.Initialized)},[Z,y]),A.useEffect(()=>{const{onDragMove:le}=P.current,{active:Ee,activatorEvent:Ie,collisions:Be,over:We}=fe.current;if(!Ee||!Ie)return;const Me={active:Ee,activatorEvent:Ie,collisions:Be,delta:{x:it.x,y:it.y},over:We};fa.unstable_batchedUpdates(()=>{le==null||le(Me),b({type:"onDragMove",event:Me})})},[it.x,it.y]),A.useEffect(()=>{const{active:le,activatorEvent:Ee,collisions:Ie,droppableContainers:Be,scrollAdjustedTranslate:We}=fe.current;if(!le||B.current==null||!Ee||!We)return;const{onDragOver:Me}=P.current,Ge=Be.get(Ae),ot=Ge&&Ge.rect.current?{id:Ge.id,rect:Ge.rect.current,data:Ge.data,disabled:Ge.disabled}:null,Ye={active:le,activatorEvent:Ee,collisions:Ie,delta:{x:We.x,y:We.y},over:ot};fa.unstable_batchedUpdates(()=>{J(ot),Me==null||Me(Ye),b({type:"onDragOver",event:Ye})})},[Ae]),fr(()=>{fe.current={activatorEvent:F,active:L,activeNode:re,collisionRect:te,collisions:Ce,droppableRects:Y,draggableNodes:E,draggingNode:ie,draggingNodeRect:we,droppableContainers:I,over:ze,scrollableAncestors:je,scrollAdjustedTranslate:it},M.current={initial:we,translated:te}},[L,re,Ce,te,E,ie,we,Y,I,ze,je,it]),TE({...oe,delta:j,draggingRect:te,pointerCoordinates:Xe,scrollableAncestors:je,scrollableAncestorRects:Fe});const Ue=A.useMemo(()=>({active:L,activeNode:re,activeNodeRect:Z,activatorEvent:F,collisions:Ce,containerNodeRect:ce,dragOverlay:_e,draggableNodes:E,droppableContainers:I,droppableRects:Y,over:ze,measureDroppableContainers:Q,scrollableAncestors:je,scrollableAncestorRects:Fe,measuringConfiguration:N,measuringScheduled:q,windowRect:he}),[L,re,Z,F,Ce,ce,_e,E,I,Y,ze,Q,je,Fe,N,q,he]),Ze=A.useMemo(()=>({activatorEvent:F,activators:ke,active:L,activeNodeRect:Z,ariaDescribedById:{draggable:C},dispatch:p,draggableNodes:E,over:ze,measureDroppableContainers:Q}),[F,ke,L,Z,p,C,E,ze,Q]);return K.createElement(A_.Provider,{value:x},K.createElement(cl.Provider,{value:Ze},K.createElement(Q_.Provider,{value:Ue},K.createElement(e0.Provider,{value:pe},l)),K.createElement(UE,{disabled:(i==null?void 0:i.restoreFocus)===!1})),K.createElement(gE,{...i,hiddenTextDescribedById:C}))}),$E=A.createContext(null),t0="button";function HE(t){let{id:e,data:n,disabled:o=!1,attributes:r}=t;const s=da("Draggable"),{activators:i,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:f}=A.useContext(cl),{role:m=t0,roleDescription:_="draggable",tabIndex:g=0}=r??{},p=(l==null?void 0:l.id)===e,b=A.useContext(p?e0:$E),[x,y]=Ic(),[v,S]=Ic(),k=function(j,I){return A.useMemo(()=>j.reduce((T,M)=>{let{eventName:L,handler:B}=M;return T[L]=O=>{B(O,I)},T},{}),[j,I])}(i,e),E=ua(n);return fr(()=>(u.set(e,{id:e,key:s,node:x,activatorNode:v,data:E}),()=>{const j=u.get(e);j&&j.key===s&&u.delete(e)}),[u,e]),{active:l,activatorEvent:a,activeNodeRect:c,attributes:A.useMemo(()=>({role:m,tabIndex:g,"aria-disabled":o,"aria-pressed":!(!p||m!==t0)||void 0,"aria-roledescription":_,"aria-describedby":d.draggable}),[o,m,g,p,_,d.draggable]),isDragging:p,listeners:o?void 0:k,node:x,over:f,setNodeRef:y,setActivatorNodeRef:S,transform:b}}const WE={timeout:25};function n0(t,e,n){const o=t.slice();return o.splice(n<0?o.length+n:n,0,o.splice(e,1)[0]),o}function qE(t,e){return t.reduce((n,o,r)=>{const s=e.get(o);return s&&(n[r]=s),n},Array(t.length))}function dl(t){return t!==null&&t>=0}const ul={scaleX:1,scaleY:1},GE=t=>{var e;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:s,index:i}=t;const a=(e=n[r])!=null?e:o;if(!a)return null;const l=function(c,d,u){const f=c[d],m=c[d-1],_=c[d+1];return!f||!m&&!_?0:u<d?m?f.left-(m.left+m.width):_.left-(f.left+f.width):_?_.left-(f.left+f.width):f.left-(m.left+m.width)}(n,i,r);if(i===r){const c=n[s];return c?{x:r<s?c.left+c.width-(a.left+a.width):c.left-a.left,y:0,...ul}:null}return i>r&&i<=s?{x:-a.width-l,y:0,...ul}:i<r&&i>=s?{x:a.width+l,y:0,...ul}:{x:0,y:0,...ul}},o0=t=>{let{rects:e,activeIndex:n,overIndex:o,index:r}=t;const s=n0(e,o,n),i=e[r],a=s[r];return a&&i?{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}:null},hl={scaleX:1,scaleY:1},YE=t=>{var e;let{activeIndex:n,activeNodeRect:o,index:r,rects:s,overIndex:i}=t;const a=(e=s[n])!=null?e:o;if(!a)return null;if(r===n){const c=s[i];return c?{x:0,y:n<i?c.top+c.height-(a.top+a.height):c.top-a.top,...hl}:null}const l=function(c,d,u){const f=c[d],m=c[d-1],_=c[d+1];return f?u<d?m?f.top-(m.top+m.height):_?_.top-(f.top+f.height):0:_?_.top-(f.top+f.height):m?f.top-(m.top+m.height):0:0}(s,r,n);return r>n&&r<=i?{x:0,y:-a.height-l,...hl}:r<n&&r>=i?{x:0,y:a.height+l,...hl}:{x:0,y:0,...hl}},r0="Sortable",s0=K.createContext({activeIndex:-1,containerId:r0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:o0,disabled:{draggable:!1,droppable:!1}});function i0(t){let{children:e,id:n,items:o,strategy:r=o0,disabled:s=!1}=t;const{active:i,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=A.useContext(Q_),u=da(r0,n),f=a.rect!==null,m=A.useMemo(()=>o.map(k=>typeof k=="object"&&"id"in k?k.id:k),[o]),_=i!=null,g=i?m.indexOf(i.id):-1,p=c?m.indexOf(c.id):-1,b=A.useRef(m),x=!function(k,E){if(k===E)return!0;if(k.length!==E.length)return!1;for(let j=0;j<k.length;j++)if(k[j]!==E[j])return!1;return!0}(m,b.current),y=p!==-1&&g===-1||x,v=function(k){return typeof k=="boolean"?{draggable:k,droppable:k}:k}(s);fr(()=>{x&&_&&d(m)},[x,m,_,d]),A.useEffect(()=>{b.current=m},[m]);const S=A.useMemo(()=>({activeIndex:g,containerId:u,disabled:v,disableTransforms:y,items:m,overIndex:p,useDragOverlay:f,sortedRects:qE(m,l),strategy:r}),[g,u,v.draggable,v.droppable,y,m,p,l,f,r]);return K.createElement(s0.Provider,{value:S},e)}const JE=t=>{let{id:e,items:n,activeIndex:o,overIndex:r}=t;return n0(n,o,r).indexOf(e)},KE=t=>{let{containerId:e,isSorting:n,wasDragging:o,index:r,items:s,newIndex:i,previousItems:a,previousContainerId:l,transition:c}=t;return!(!c||!o)&&(a===s||r!==i)&&(!!n||i!==r&&e===l)},XE={duration:200,easing:"ease"},a0="transform",ZE=Mc.Transition.toString({property:a0,duration:0,easing:"linear"}),QE={roleDescription:"sortable"};function l0(t){let{animateLayoutChanges:e=KE,attributes:n,disabled:o,data:r,getNewIndex:s=JE,id:i,strategy:a,resizeObserverConfig:l,transition:c=XE}=t;const{items:d,containerId:u,activeIndex:f,disabled:m,disableTransforms:_,sortedRects:g,overIndex:p,useDragOverlay:b,strategy:x}=A.useContext(s0),y=function(de,_e){var ie,we;return typeof de=="boolean"?{draggable:de,droppable:!1}:{draggable:(ie=de==null?void 0:de.draggable)!=null?ie:_e.draggable,droppable:(we=de==null?void 0:de.droppable)!=null?we:_e.droppable}}(o,m),v=d.indexOf(i),S=A.useMemo(()=>({sortable:{containerId:u,index:v,items:d},...r}),[u,r,v,d]),k=A.useMemo(()=>d.slice(d.indexOf(i)),[d,i]),{rect:E,node:j,isOver:I,setNodeRef:T}=function(de){let{data:_e,disabled:ie=!1,id:we,resizeObserverConfig:ve}=de;const ae=da("Droppable"),{active:ge,dispatch:he,over:je,measureDroppableContainers:Fe}=A.useContext(cl),He=A.useRef({disabled:ie}),Xe=A.useRef(!1),Le=A.useRef(null),et=A.useRef(null),{disabled:nt,updateMeasurementsFor:it,timeout:te}={...WE,...ve},Ce=ua(it??we),Ae=al({callback:A.useCallback(()=>{Xe.current?(et.current!=null&&clearTimeout(et.current),et.current=setTimeout(()=>{Fe(Array.isArray(Ce.current)?Ce.current:[Ce.current]),et.current=null},te)):Xe.current=!0},[te]),disabled:nt||!ge}),ze=A.useCallback((ue,Ne)=>{Ae&&(Ne&&(Ae.unobserve(Ne),Xe.current=!1),ue&&Ae.observe(ue))},[Ae]),[J,pe]=Ic(ze),be=ua(_e);return A.useEffect(()=>{Ae&&J.current&&(Ae.disconnect(),Xe.current=!1,Ae.observe(J.current))},[J,Ae]),A.useEffect(()=>(he({type:zt.RegisterDroppable,element:{id:we,key:ae,disabled:ie,node:J,rect:Le,data:be}}),()=>he({type:zt.UnregisterDroppable,key:ae,id:we})),[we]),A.useEffect(()=>{ie!==He.current.disabled&&(he({type:zt.SetDroppableDisabled,id:we,key:ae,disabled:ie}),He.current.disabled=ie)},[we,ae,ie,he]),{active:ge,rect:Le,isOver:(je==null?void 0:je.id)===we,node:J,over:je,setNodeRef:pe}}({id:i,data:S,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...l}}),{active:M,activatorEvent:L,activeNodeRect:B,attributes:O,setNodeRef:z,listeners:F,isDragging:V,over:P,setActivatorNodeRef:C,transform:$}=HE({id:i,data:S,attributes:{...QE,...n},disabled:y.draggable}),N=qB(T,z),H=!!M,Y=H&&!_&&dl(f)&&dl(p),Q=!b&&V,q=Q&&Y?$:null,re=Y?q??(a??x)({rects:g,activeNodeRect:B,activeIndex:f,overIndex:p,index:v}):null,ne=dl(f)&&dl(p)?s({id:i,items:d,activeIndex:f,overIndex:p}):v,oe=M==null?void 0:M.id,G=A.useRef({activeId:oe,items:d,newIndex:ne,containerId:u}),Z=d!==G.current.items,ce=e({active:M,containerId:u,isDragging:V,isSorting:H,id:i,index:v,items:d,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:c,wasDragging:G.current.activeId!=null}),fe=function(de){let{disabled:_e,index:ie,node:we,rect:ve}=de;const[ae,ge]=A.useState(null),he=A.useRef(ie);return fr(()=>{if(!_e&&ie!==he.current&&we.current){const je=ve.current;if(je){const Fe=Gr(we.current,{ignoreTransform:!0}),He={x:je.left-Fe.left,y:je.top-Fe.top,scaleX:je.width/Fe.width,scaleY:je.height/Fe.height};(He.x||He.y)&&ge(He)}}ie!==he.current&&(he.current=ie)},[_e,ie,we,ve]),A.useEffect(()=>{ae&&ge(null)},[ae]),ae}({disabled:!ce,index:v,node:j,rect:E});return A.useEffect(()=>{H&&G.current.newIndex!==ne&&(G.current.newIndex=ne),u!==G.current.containerId&&(G.current.containerId=u),d!==G.current.items&&(G.current.items=d)},[H,ne,u,d]),A.useEffect(()=>{if(oe===G.current.activeId)return;if(oe!=null&&G.current.activeId==null)return void(G.current.activeId=oe);const de=setTimeout(()=>{G.current.activeId=oe},50);return()=>clearTimeout(de)},[oe]),{active:M,activeIndex:f,attributes:O,data:S,rect:E,index:v,newIndex:ne,items:d,isOver:I,isSorting:H,isDragging:V,listeners:F,node:j,overIndex:p,over:P,setNodeRef:N,setActivatorNodeRef:C,setDroppableNodeRef:T,setDraggableNodeRef:z,transform:fe??re,transition:function(){if(fe||Z&&G.current.newIndex===v)return ZE;if(!(Q&&!Cm(L)||!c)&&(H||ce))return Mc.Transition.toString({...c,property:a0})}()}}function fl(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const e5=[ct.Down,ct.Right,ct.Up,ct.Left],t5=(t,e)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:s,over:i,scrollableAncestors:a}}=e;if(e5.includes(t.code)){if(t.preventDefault(),!n||!o)return;const l=[];s.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const f=r.get(u.id);if(f)switch(t.code){case ct.Down:o.top<f.top&&l.push(u);break;case ct.Up:o.top>f.top&&l.push(u);break;case ct.Left:o.left>f.left&&l.push(u);break;case ct.Right:o.left<f.left&&l.push(u)}});const c=(u=>{let{collisionRect:f,droppableRects:m,droppableContainers:_}=u;const g=Zd(f),p=[];for(const b of _){const{id:x}=b,y=m.get(x);if(y){const v=Zd(y),S=g.reduce((E,j,I)=>E+Kd(v[I],j),0),k=Number((S/4).toFixed(4));p.push({id:x,data:{droppableContainer:b,value:k}})}}return p.sort(Xd)})({collisionRect:o,droppableRects:r,droppableContainers:l});let d=Qd(c,"id");if(d===(i==null?void 0:i.id)&&c.length>1&&(d=c[1].id),d!=null){const u=s.get(n.id),f=s.get(d),m=f?r.get(f.id):null,_=f==null?void 0:f.node.current;if(_&&m&&u&&f){const g=sl(_).some((v,S)=>a[S]!==v),p=c0(u,f),b=function(v,S){return!fl(v)||!fl(S)||!c0(v,S)?!1:v.data.current.sortable.index<S.data.current.sortable.index}(u,f),x=g||!p?{x:0,y:0}:{x:b?o.width-m.width:0,y:b?o.height-m.height:0},y={x:m.left,y:m.top};return x.x&&x.y?y:ha(y,x)}}}};function c0(t,e){return!(!fl(t)||!fl(e))&&t.data.current.sortable.containerId===e.data.current.sortable.containerId}function ml(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}const d0=K.createContext(null),u0=A.memo(()=>A.useContext(d0));u0.displayName="DragHandle";const h0=K.forwardRef((t,e)=>{const n=X.c(21);let o,r,s,i,a;n[0]!==t?({cellId:r,canMoveX: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=r.toString(),n[4]=r,n[5]=i):i=n[5],n[6]!==i?(a={id:i},n[6]=i,n[7]=a):a=n[7];const{attributes:l,listeners:c,setNodeRef:d,transform:u,transition:f,isDragging:m}=l0(a);let _;n[8]!==u?(_=function(x){return!x||x.x===0&&x.y===0&&x.scaleX===1&&x.scaleY===1}(u)?null:u,n[8]=u,n[9]=_):_=n[9];const g=_,p=g==null?void 0:f;let b;return n[10]!==l||n[11]!==o||n[12]!==r||n[13]!==m||n[14]!==c||n[15]!==s||n[16]!==e||n[17]!==d||n[18]!==g||n[19]!==p?(b=h.jsx(f0,{ref:e,cellId:r,canMoveX:o,...s,attributes:l,listeners:c,setNodeRef:d,transform:g,transition:p,isDragging:m}),n[10]=l,n[11]=o,n[12]=r,n[13]=m,n[14]=c,n[15]=s,n[16]=e,n[17]=d,n[18]=g,n[19]=p,n[20]=b):b=n[20],b});h0.displayName="SortableCell";const f0=K.forwardRef((t,e)=>{const n=X.c(37);let o,r,s,i,a,l,c,d,u,f;if(n[0]!==t){const{cellId:I,canMoveX:T,children:M,attributes:L,listeners:B,setNodeRef:O,transform:z,transition:F,isDragging:V,...P}=t;r=T,s=M,o=L,a=B,c=O,d=z,u=F,i=V,l=P,n[0]=t,n[1]=o,n[2]=r,n[3]=s,n[4]=i,n[5]=a,n[6]=l,n[7]=c,n[8]=d,n[9]=u}else o=n[1],r=n[2],s=n[3],i=n[4],a=n[5],l=n[6],c=n[7],d=n[8],u=n[9];n[10]!==r||n[11]!==d?(f=d?Mc.Transform.toString({x:r?d.x:0,y:d.y,scaleX:1,scaleY:1}):void 0,n[10]=r,n[11]=d,n[12]=f):f=n[12];const m=i?2:void 0;let _;n[13]!==f||n[14]!==m||n[15]!==u?(_={transform:f,transition:u,zIndex:m,position:"relative"},n[13]=f,n[14]=m,n[15]=u,n[16]=_):_=n[16];const g=_;let p,b;n[17]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(_p,{strokeWidth:1,size:20}),n[17]=p):p=n[17],n[18]!==o||n[19]!==a?(b=h.jsx("div",{...o,...a,onMouseDown:Vn.preventFocus,"data-testid":"drag-button",className:"py-[1px] cursor-grab opacity-50 hover:opacity-100 hover-action hover:bg-muted rounded border border-transparent hover:border-border active:bg-accent",children:p}),n[18]=o,n[19]=a,n[20]=b):b=n[20];const x=b,y=!!d;let v;n[21]!==e||n[22]!==c?(v=I=>{ml(e,c)(I)},n[21]=e,n[22]=c,n[23]=v):v=n[23];const S=y&&"is-moving";let k,E,j;return n[24]!==l.className||n[25]!==S?(k=Te(l.className,S,"outline-offset-4 outline-primary/40 rounded-lg"),n[24]=l.className,n[25]=S,n[26]=k):k=n[26],n[27]!==s||n[28]!==x?(E=h.jsx(d0.Provider,{value:x,children:s}),n[27]=s,n[28]=x,n[29]=E):E=n[29],n[30]!==i||n[31]!==l||n[32]!==g||n[33]!==v||n[34]!==k||n[35]!==E?(j=h.jsx("div",{tabIndex:-1,ref:v,...l,"data-is-dragging":i,className:k,style:g,children:E}),n[30]=i,n[31]=l,n[32]=g,n[33]=v,n[34]=k,n[35]=E,n[36]=j):j=n[36],j});f0.displayName="SortableCellInternal";const m0=K.memo(K.forwardRef((t,e)=>{const n=X.c(34);let o,r,s;n[0]!==t?({children:o,showTooltip: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||s,[a,l]=A.useState(!1);let c;n[4]!==r?(c={cell:r},n[4]=r,n[5]=c):c=n[5];const d=id(c),u=YB();let f,m,_,g,p,b;if(n[6]===Symbol.for("react.memo_cache_sentinel")?(f=()=>({toggle:()=>l(n5)}),n[6]=f):f=n[6],A.useImperativeHandle(e,f),n[7]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(Qi,{placeholder:"Search actions...",className:"h-6 m-1"}),n[7]=m):m=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx(cc,{children:"No results"}),n[8]=_):_=n[8],n[9]!==d){let j;n[11]!==d.length?(j=(I,T)=>h.jsxs(A.Fragment,{children:[h.jsx(im,{children:I.map(M=>{let L=h.jsxs("div",{className:"flex items-center flex-1",children:[M.icon&&h.jsx("div",{className:"mr-2 w-5 text-muted-foreground",children:M.icon}),h.jsx("div",{className:"flex-1",children:M.label}),h.jsxs("div",{className:"flex-shrink-0 text-sm",children:[M.hotkey&&m4(M.hotkey),M.rightElement]})]});return M.tooltip&&(L=h.jsx(Oe,{content:M.tooltip,delayDuration:100,children:L})),h.jsx(mo,{className:Te(M.disabled&&"!opacity-50"),onSelect:()=>{M.disableClick||M.disabled||(M.handle(),l(!1))},variant:M.variant,children:L},M.label)})},T),T<d.length-1&&h.jsx(D3,{})]},T),n[11]=d.length,n[12]=j):j=n[12],g=d.map(j),n[9]=d,n[10]=g}else g=n[10];n[13]!==g?(p=h.jsxs(yc,{children:[m,h.jsxs(Im,{children:[_,g]})]}),n[13]=g,n[14]=p):p=n[14],n[15]!==u||n[16]!==p?(b=h.jsx(Vs,{className:"w-[300px] p-0 pt-1 overflow-auto",scrollable:!0,...u,children:p}),n[15]=u,n[16]=p,n[17]=b):b=n[17];const x=b;if(!i){let j,I;return n[18]!==o?(j=h.jsx(Ys,{asChild:!0,children:o}),n[18]=o,n[19]=j):j=n[19],n[20]!==x||n[21]!==a||n[22]!==j?(I=h.jsxs(Mr,{open:a,onOpenChange:l,children:[j,x]}),n[20]=x,n[21]=a,n[22]=j,n[23]=I):I=n[23],I}let y;n[24]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(JB,{tabIndex:-1,children:fn("cell.cellActions")}),n[24]=y):y=n[24];const v=!a&&y;let S,k,E;return n[25]!==o?(S=h.jsx(KB,{children:h.jsx(Ys,{className:"flex",children:o})}),n[25]=o,n[26]=S):S=n[26],n[27]!==v||n[28]!==S?(k=h.jsxs(XB,{delayDuration:200,disableHoverableContent:!0,children:[v,S]}),n[27]=v,n[28]=S,n[29]=k):k=n[29],n[30]!==x||n[31]!==a||n[32]!==k?(E=h.jsxs(Mr,{open:a,onOpenChange:l,children:[k,x]}),n[30]=x,n[31]=a,n[32]=k,n[33]=E):E=n[33],E})),p0=K.memo(t=>{const e=X.c(5),{children:n,cellId:o}=t;let r,s;e[0]!==o?(s=GB(o),e[0]=o,e[1]=s):s=e[1],r=s;const i=$e(r);if(!i)return null;let a;return e[2]!==n||e[3]!==i?(a=h.jsx(m0,{showTooltip:!1,...i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a});function n5(t){return!t}p0.displayName="ConnectionCellActionsDropdown";const g0=t=>{const e=X.c(32);let n,o,r;e[0]!==t?({children:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]),e[3]!==o?(r={cell:o},e[3]=o,e[4]=r):r=e[4];const s=id(r),[i,a]=K.useState(),l=!!i;let c,d,u,f,m,_,g,p,b,x;if(e[5]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(Ls,{size:13,strokeWidth:1.5}),e[5]=c):c=e[5],e[6]!==o?(d=async()=>{var S;if((S=window.getSelection())==null?void 0:S.toString())return void document.execCommand("copy");const v=document.getElementById(k3.create(o.cellId));v?await yn(v.textContent??""):Zt.warn("cell-context-menu: output not found")},e[6]=o,e[7]=d):d=e[7],e[8]!==s||e[9]!==n||e[10]!==i||e[11]!==o||e[12]!==l||e[13]!==d){const y=[{label:"Copy",hidden:l,icon:c,handle:d},{label:"Cut",hidden:!!i,icon:h.jsx(Xc,{size:13,strokeWidth:1.5}),handle:o5},{label:"Paste",hidden:!!i,icon:h.jsx(lp,{size:13,strokeWidth:1.5}),handle:async()=>{const{getEditorView:k}=o,E=k();if(E)try{const j=await navigator.clipboard.readText();if(j){const{from:I,to:T}=E.state.selection.main,M=E.state.update({changes:{from:I,to:T,insert:j}});E.dispatch(M)}}catch(j){const I=j;Zt.error("Failed to paste from clipboard",I),ZB({command:"paste"})}}},{label:"Copy image",hidden:!i,icon:h.jsx($c,{size:13,strokeWidth:1.5}),handle:async()=>{if(i){const k=await fetch(i.src),E=await k.blob(),j=new ClipboardItem({[E.type]:E});await navigator.clipboard.write([j]).then(r5).catch(s5)}}},{icon:h.jsx(Km,{size:13,strokeWidth:1.5}),label:"Download image",hidden:!i,handle:()=>{if(i){const k=document.createElement("a");k.download="image.png",k.href=i.src,k.click()}}},{label:"Go to Definition",icon:h.jsx(eU,{size:13,strokeWidth:1.5}),handle:()=>{const{getEditorView:k}=o,E=k();E&&QB(E)}}],v=[y,...s];let S;f=x_,e[20]===Symbol.for("react.memo_cache_sentinel")?(S=k=>{k.target instanceof HTMLImageElement?a(k.target):a(void 0)},e[20]=S):S=e[20],e[21]!==n?(p=h.jsx(w_,{onContextMenu:S,asChild:!0,children:n}),e[21]=n,e[22]=p):p=e[22],u=Jd,m="w-[300px]",_=!0,g=v.map((k,E)=>h.jsxs(A.Fragment,{children:[k.map(i5),E<v.length-1&&h.jsx(k_,{})]},E)),e[8]=s,e[9]=n,e[10]=i,e[11]=o,e[12]=l,e[13]=d,e[14]=u,e[15]=f,e[16]=m,e[17]=_,e[18]=g,e[19]=p}else u=e[14],f=e[15],m=e[16],_=e[17],g=e[18],p=e[19];return e[23]!==u||e[24]!==m||e[25]!==_||e[26]!==g?(b=h.jsx(u,{className:m,scrollable:_,children:g}),e[23]=u,e[24]=m,e[25]=_,e[26]=g,e[27]=b):b=e[27],e[28]!==f||e[29]!==p||e[30]!==b?(x=h.jsxs(f,{children:[p,b]}),e[28]=f,e[29]=p,e[30]=b,e[31]=x):x=e[31],x};function o5(){document.execCommand("cut")}function r5(){lt({title:"Copied image to clipboard"})}function s5(t){lt({title:"Failed to copy image to clipboard. Try downloading instead.",description:t.message}),Zt.error("Failed to copy image to clipboard",t)}function i5(t){if(t.hidden)return null;let e=h.jsxs("div",{className:"flex items-center flex-1",children:[t.icon&&h.jsx("div",{className:"mr-2 w-5 text-muted-foreground",children:t.icon}),h.jsx("div",{className:"flex-1",children:t.label}),h.jsxs("div",{className:"flex-shrink-0 text-sm",children:[t.hotkey&&m4(t.hotkey),t.rightElement]})]});return t.tooltip&&(e=h.jsx(Oe,{delayDuration:100,content:t.tooltip,children:e})),h.jsx(yi,{className:t.disabled?"!opacity-50":"",onSelect:n=>{t.disableClick||t.disabled||t.handle(n)},variant:t.variant,children:e},t.label)}const a5=t=>{const e=X.c(24),{editorView:n,code:o,currentLanguageAdapter:r,onAfterToggle:s}=t;let i,a;e[0]!==o?(a=new ta().isSupported(o)||o.trim()==="",e[0]=o,e[1]=a):a=e[1],i=a;const l=i;let c,d;e[2]!==o?(d=new jc().isSupported(o)||o.trim()==="",e[2]=o,e[3]=d):d=e[3],c=d;const u=c&&r==="python";let f,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=h.jsx(lr,{color:"var(--sky-11)",strokeWidth:2.5,className:"w-4 h-4"}),e[4]=f):f=e[4],e[5]!==r||e[6]!==n||e[7]!==s||e[8]!==u?(m=h.jsx(uu,{editorView:n,currentLanguageAdapter:r,canSwitchToLanguage:u,icon:f,toType:"sql",displayName:"SQL",onAfterToggle:s}),e[5]=r,e[6]=n,e[7]=s,e[8]=u,e[9]=m):m=e[9];const _=l&&r==="python";let g,p,b,x,y;return e[10]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx(sc,{fill:"var(--sky-11)",color:"black",className:"w-4 h-4"}),e[10]=g):g=e[10],e[11]!==r||e[12]!==n||e[13]!==s||e[14]!==_?(p=h.jsx(uu,{editorView:n,currentLanguageAdapter:r,canSwitchToLanguage:_,icon:g,toType:"markdown",displayName:"Markdown",onAfterToggle:s}),e[11]=r,e[12]=n,e[13]=s,e[14]=_,e[15]=p):p=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(ic,{fill:"var(--sky-11)",color:"black",className:"w-4 h-4"}),e[16]=b):b=e[16],e[17]!==r||e[18]!==n?(x=h.jsx(uu,{editorView:n,currentLanguageAdapter:r,canSwitchToLanguage:!0,icon:b,toType:"python",displayName:"Python",onAfterToggle:jn.NOOP}),e[17]=r,e[18]=n,e[19]=x):x=e[19],e[20]!==p||e[21]!==x||e[22]!==m?(y=h.jsxs("div",{className:"absolute right-3 top-2 z-20 flex hover-action gap-1",children:[m,p,x]}),e[20]=p,e[21]=x,e[22]=m,e[23]=y):y=e[23],y},uu=t=>{const e=X.c(10),{editorView:n,currentLanguageAdapter:o,canSwitchToLanguage:r,icon:s,toType:i,displayName:a,onAfterToggle:l}=t;let c;e[0]!==n||e[1]!==l||e[2]!==i?(c=()=>{n&&(Ir(n,i),l())},e[0]=n,e[1]=l,e[2]=i,e[3]=c):c=e[3];const d=c;if(!r||o===i)return null;const u=`View as ${a}`;let f,m;return e[4]!==d||e[5]!==s?(f=h.jsx(De,{"data-testid":"language-toggle-button",variant:"text",size:"xs",className:"opacity-80 px-1",onClick:d,children:s}),e[4]=d,e[5]=s,e[6]=f):f=e[6],e[7]!==u||e[8]!==f?(m=h.jsx(Oe,{content:u,children:f}),e[7]=u,e[8]=f,e[9]=m):m=e[9],m};var _0={modified:{doc:""},original:{doc:""}},b0=A.createContext(_0);function l5(t,e){return Nt({},t,e,{modified:Nt({},t.modified,e.modified),original:Nt({},t.original,e.original)})}var hu=()=>A.useContext(b0),c5=t=>{var{children:e,theme:n}=t,[o,r]=A.useReducer(l5,Nt({},_0,{theme:n}));return A.useEffect(()=>r({theme:n}),[n]),h.jsx(b0.Provider,{value:Nt({},o,{dispatch:r}),children:e})},d5=["extensions","value","selection","onChange"],y0=t=>{var{extensions:e=[],value:n,selection:o,onChange:r}=t,s=pa(t,d5),{theme:i,dispatch:a}=hu(),l=Js(Nt({},s,{theme:i}));return A.useEffect(()=>a({original:{doc:n,selection:o,extensions:[...l,...e]},originalExtension:{onChange:r,option:s,extension:[e]}}),[t]),null};y0.displayName="CodeMirrorMerge.Original";var u5=["extensions","value","selection","onChange"],x0=t=>{var{extensions:e=[],value:n,selection:o,onChange:r}=t,s=pa(t,u5),{theme:i,dispatch:a}=hu(),l=Js(Nt({},s,{theme:i}));return A.useEffect(()=>{a({modified:{doc:n,selection:o,extensions:[...l,...e]},modifiedExtension:{onChange:r,option:s,extension:[e]}})},[t]),null};x0.displayName="CodeMirrorMerge.Modified";class It{constructor(e,n,o,r){this.fromA=e,this.toA=n,this.fromB=o,this.toB=r}offset(e,n){return new It(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function kr(t,e,n,o,r,s){if(t==o)return[];let i=pu(t,e,n,o,r,s),a=gu(t,e+i,n,o,r+i,s),l=(n-=a)-(e+=i),c=(s-=a)-(r+=i);if(!l||!c)return[new It(e,n,r,s)];if(l>c){let u=t.slice(e,n).indexOf(o.slice(r,s));if(u>-1)return[new It(e,e+u,r,r),new It(e+u+c,n,s,s)]}else if(c>l){let u=o.slice(r,s).indexOf(t.slice(e,n));if(u>-1)return[new It(e,e,r,r+u),new It(n,n,r+u+l,s)]}if(l==1||c==1)return[new It(e,n,r,s)];let d=k0(t,e,n,o,r,s);if(d){let[u,f,m]=d;return kr(t,e,u,o,r,f).concat(kr(t,u+m,n,o,f+m,s))}return function(u,f,m,_,g,p){let b=m-f,x=p-g;if(Ci<1e9&&Math.min(b,x)>16*Ci)return Math.min(b,x)>64*Ci?[new It(f,m,g,p)]:S0(u,f,m,_,g,p);let y=Math.ceil((b+x)/2);fu.reset(y),mu.reset(y);let v=(j,I)=>u.charCodeAt(f+j)==_.charCodeAt(g+I),S=(j,I)=>u.charCodeAt(m-j-1)==_.charCodeAt(p-I-1),k=(b-x)%2!=0?mu:null,E=k?null:fu;for(let j=0;j<y;j++){if(j>Ci)return S0(u,f,m,_,g,p);let I=fu.advance(j,b,x,y,k,!1,v)||mu.advance(j,b,x,y,E,!0,S);if(I)return h5(u,f,m,f+I[0],_,g,p,g+I[1])}return[new It(f,m,g,p)]}(t,e,n,o,r,s)}let Ci=1e9;class w0{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,o,r,s,i,a){for(let l=-e+this.start;l<=e-this.end;l+=2){let c=r+l,d=l==-e||l!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,u=d-l;for(;d<n&&u<o&&a(d,u);)d++,u++;if(this.vec[c]=d,d>n)this.end+=2;else if(u>o)this.start+=2;else if(s){let f=r+(n-o)-l;if(f>=0&&f<this.len&&s.vec[f]!=-1){if(i){let m=s.vec[f];if(m>=n-d)return[m,r+m-f]}else if(d>=n-s.vec[f])return[d,u]}}}return null}}const fu=new w0,mu=new w0;function h5(t,e,n,o,r,s,i,a){let l=!1;return Yr(t,o)||++o!=n||(l=!0),Yr(r,a)||++a!=i||(l=!0),l?[new It(e,n,s,i)]:kr(t,e,o,r,s,a).concat(kr(t,o,n,r,a,i))}function v0(t,e){let n=1,o=Math.min(t,e);for(;n<o;)n<<=1;return n}function pu(t,e,n,o,r,s){if(e==n||e==s||t.charCodeAt(e)!=o.charCodeAt(r))return 0;let i=v0(n-e,s-r);for(let a=e,l=r;;){let c=a+i,d=l+i;if(c>n||d>s||t.slice(a,c)!=o.slice(l,d)){if(i==1)return a-e-(Yr(t,a)?0:1);i>>=1}else{if(c==n||d==s)return c-e;a=c,l=d}}}function gu(t,e,n,o,r,s){if(e==n||r==s||t.charCodeAt(n-1)!=o.charCodeAt(s-1))return 0;let i=v0(n-e,s-r);for(let a=n,l=s;;){let c=a-i,d=l-i;if(c<e||d<r||t.slice(c,a)!=o.slice(d,l)){if(i==1)return n-a-(Yr(t,a)?0:1);i>>=1}else{if(c==e||d==r)return n-c;a=c,l=d}}}function _u(t,e,n,o,r,s,i,a){let l=o.slice(r,s),c=null;for(;;){if(c||i<a)return c;for(let d=e+i;;){Yr(t,d)||d++;let u=d+i;if(Yr(t,u)||(u+=u==d+1?1:-1),u>=n)break;let f=t.slice(d,u),m=-1;for(;(m=l.indexOf(f,m+1))!=-1;){let _=pu(t,u,n,o,r+m+f.length,s),g=gu(t,e,d,o,r,r+m),p=f.length+_+g;(!c||c[2]<p)&&(c=[d-g,r+m-g,p])}d=u}if(a<0)return c;i>>=1}}function k0(t,e,n,o,r,s){let i=n-e,a=s-r;if(i<a){let l=k0(o,r,s,t,e,n);return l&&[l[1],l[0],l[2]]}return i<4||2*a<i?null:_u(t,e,n,o,r,s,Math.floor(i/4),-1)}function S0(t,e,n,o,r,s){let i,a=n-e,l=s-r;if(a<l){let f=_u(o,r,s,t,e,n,Math.floor(a/6),50);i=f&&[f[1],f[0],f[2]]}else i=_u(t,e,n,o,r,s,Math.floor(l/6),50);if(!i)return[new It(e,n,r,s)];let[c,d,u]=i;return kr(t,e,c,o,r,d).concat(kr(t,c+u,n,o,d+u,s))}function C0(t,e){for(let n=1;n<t.length;n++){let o=t[n-1],r=t[n];o.toA>r.fromA-e&&o.toB>r.fromB-e&&(t[n-1]=new It(o.fromA,r.toA,o.fromB,r.toB),t.splice(n--,1))}}let Sr;try{Sr=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function N0(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function j0(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?N0(n)?1:0:Sr?T0(n)&&e!=t.length-1?Sr.test(t.slice(e,e+2))?2:0:Sr.test(String.fromCharCode(n))?1:0:0}function E0(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?N0(n)?1:0:Sr?M0(n)&&e!=1?Sr.test(t.slice(e-2,e))?2:0:Sr.test(String.fromCharCode(n))?1:0:0}function I0(t,e,n){if(e==t.length||!E0(t,e))return e;for(let o=e,r=e+n;;){let s=j0(t,o);if(!s)return o;if(o+=s,o>r)return e}}function A0(t,e,n){if(!e||!j0(t,e))return e;for(let o=e,r=e-n;;){let s=E0(t,o);if(!s)return o;if(o-=s,o<r)return e}}function f5(t,e,n){for(let o=e,r=e-n;;){let s=o?t.charCodeAt(o-1):10;if(s==10)return o;if(o--,o<r||s!=32&&s!=9)return e}}const T0=t=>t>=55296&&t<=56319,M0=t=>t>=56320&&t<=57343;function Yr(t,e){return!e||e==t.length||!T0(t.charCodeAt(e-1))||!M0(t.charCodeAt(e))}function m5(t,e,n){var o;return Ci=((o=n==null?void 0:n.scanLimit)!==null&&o!==void 0?o:1e9)>>1,function(r,s,i){for(;;){C0(i,1);let a=!1;for(let l=0;l<i.length;l++){let c,d,u=i[l];(c=pu(r,u.fromA,u.toA,s,u.fromB,u.toB))&&(u=i[l]=new It(u.fromA+c,u.toA,u.fromB+c,u.toB)),(d=gu(r,u.fromA,u.toA,s,u.fromB,u.toB))&&(u=i[l]=new It(u.fromA,u.toA-d,u.fromB,u.toB-d));let f=u.toA-u.fromA,m=u.toB-u.fromB;if(f&&m)continue;let _=u.fromA-(l?i[l-1].toA:0),g=(l<i.length-1?i[l+1].fromA:r.length)-u.toA;if(!_||!g)continue;let p=f?r.slice(u.fromA,u.toA):s.slice(u.fromB,u.toB);_<=p.length&&r.slice(u.fromA-_,u.fromA)==p.slice(p.length-_)?(i[l]=new It(u.fromA-_,u.toA-_,u.fromB-_,u.toB-_),a=!0):g<=p.length&&r.slice(u.toA,u.toA+g)==p.slice(0,g)&&(i[l]=new It(u.fromA+g,u.toA+g,u.fromB+g,u.toB+g),a=!0)}if(!a)break}return i}(t,e,kr(t,0,t.length,e,0,e.length))}function O0(t,e,n){return function(o,r,s){for(let i=0,a=0;a<o.length;a++){let l=o[a],c=l.toA-l.fromA,d=l.toB-l.fromB;if(c&&d||c>3||d>3){let u=a==o.length-1?r.length:o[a+1].fromA,f=l.fromA-i,m=u-l.toA,_=A0(r,l.fromA,Math.min(f,5)),g=I0(r,l.toA,Math.min(m,5)),p=l.fromA-_,b=g-l.toA;if(!c||!d){let x,y,v=Math.max(c,d),[S,k,E]=c?[r,l.fromA,l.toA]:[s,l.fromB,l.toB];p&&b?(v>p&&r.slice(_,l.fromA)==S.slice(E-p,E)?(l=o[a]=new It(_,_+c,l.fromB-p,l.toB-p),_=l.fromA,g=I0(r,l.toA,Math.min(u-l.toA,5))):v>b&&r.slice(l.toA,g)==S.slice(k,k+b)&&(l=o[a]=new It(g-c,g,l.fromB+b,l.toB+b),g=l.toA,_=A0(r,l.fromA,Math.min(l.fromA-i,5))),p=l.fromA-_,b=g-l.toA):p||b||!(y=l.fromA-(x=f5(r,l.fromA,f)))||r.slice(x,l.fromA)!=S.slice(E-y,E)||(l=o[a]=new It(x,x+c,l.fromB-y,l.toB-y))}(p||b)&&(l=o[a]=new It(l.fromA-p,l.toA+b,l.fromB-p,l.toB+b)),i=l.toA}}return C0(o,3),o}(m5(t,e,n),t,e)}const no=$s.define({combine:t=>t[0]}),bu=Ut.define(),Jr=En.define({create:t=>null,update(t,e){for(let n of e.effects)n.is(bu)&&(t=n.value);return t}});class Kr{constructor(e,n,o,r,s){this.changes=e,this.fromA=n,this.toA=o,this.fromB=r,this.toB=s}offset(e,n){return e||n?new Kr(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,o){return P0(O0(e.toString(),n.toString(),o),e,n,0,0)}static updateA(e,n,o,r,s){return z0(F0(e,r,!0,o.length),e,n,o,s)}static updateB(e,n,o,r,s){return z0(F0(e,r,!1,n.length),e,n,o,s)}}function D0(t,e,n,o){let r=n.lineAt(t),s=o.lineAt(e);return r.to==t&&s.to==e&&t<n.length&&e<o.length?[t+1,e+1]:[r.from,s.from]}function R0(t,e,n,o){let r=n.lineAt(t),s=o.lineAt(e);return r.from==t&&s.from==e?[t,e]:[r.to+1,s.to+1]}function P0(t,e,n,o,r){let s=[];for(let i=0;i<t.length;i++){let a=t[i],[l,c]=D0(a.fromA+o,a.fromB+r,e,n),[d,u]=R0(a.toA+o,a.toB+r,e,n),f=[a.offset(-l+o,-c+r)];for(;i<t.length-1;){let m=t[i+1],[_,g]=D0(m.fromA+o,m.fromB+r,e,n);if(_>d+1&&g>u+1)break;f.push(m.offset(-l+o,-c+r)),[d,u]=R0(m.toA+o,m.toB+r,e,n),i++}s.push(new Kr(f,l,Math.max(l,d),c,Math.max(c,u)))}return s}const pl=1e3;function L0(t,e,n,o){let r=0,s=t.length;for(;;){if(r==s){let d=0,u=0;r&&({toA:d,toB:u}=t[r-1]);let f=e-(n?d:u);return[d+f,u+f]}let i=r+s>>1,a=t[i],[l,c]=n?[a.fromA,a.toA]:[a.fromB,a.toB];if(l>e)s=i;else{if(!(c<=e))return o?[a.fromA,a.fromB]:[a.toA,a.toB];r=i+1}}}function F0(t,e,n,o){let r=[];return e.iterChangedRanges((s,i,a,l)=>{let c=0,d=n?e.length:o,u=0,f=n?o:e.length;s>pl&&([c,u]=L0(t,s-pl,n,!0)),i<e.length-pl&&([d,f]=L0(t,i+pl,n,!1));let m,_=l-a-(i-s),[g,p]=n?[_,0]:[0,_];r.length&&(m=r[r.length-1]).toA>=c?r[r.length-1]={fromA:m.fromA,fromB:m.fromB,toA:d,toB:f,diffA:m.diffA+g,diffB:m.diffB+p}:r.push({fromA:c,toA:d,fromB:u,toB:f,diffA:g,diffB:p})}),r}function z0(t,e,n,o,r){if(!t.length)return e;let s=0,i=0,a=0,l=[];for(let c of t){let d=c.fromA+i,u=c.toA+i+c.diffA,f=c.fromB+a,m=c.toB+a+c.diffB;for(;s<e.length;){let _=e[s];if(_.toA+i<=d&&_.toB+a<=f)l.push(_.offset(i,a));else if(_.fromA+i>u)break;s++}for(let _ of P0(O0(n.sliceString(d,u),o.sliceString(f,m),r),n,o,d,f))l.push(_);for(i+=c.diffA,a+=c.diffB;s<e.length;){let _=e[s];if(_.fromA>u+i&&_.fromB>m+a)break;s++}}for(;s<e.length;)l.push(e[s++].offset(i,a));return l}const B0=Zn.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=$0(t))}update(t){var e,n;(t.docChanged||t.viewportChanged||(e=t.startState,n=t.state,e.field(Jr,!1)!=n.field(Jr,!1))||function(o,r){return o.facet(no)!=r.facet(no)}(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=$0(t.view))}},{decorations:t=>t.deco}),gl=Uo.low(nU({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(B0))===null||e===void 0?void 0:e.gutter)||Am.empty}})),U0=dt.line({class:"cm-changedLine"}),p5=dt.mark({class:"cm-changedText"}),g5=dt.mark({tagName:"ins",class:"cm-insertedLine"}),_5=dt.mark({tagName:"del",class:"cm-deletedLine"}),V0=new class extends oU{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function b5(t,e,n,o,r,s){let i=n?t.fromA:t.fromB,a=n?t.toA:t.toB,l=0;if(i!=a){r.add(i,i,U0),r.add(i,a,n?_5:g5),s&&s.add(i,i,V0);for(let c=e.iterRange(i,a-1),d=i;!c.next().done;){if(c.lineBreak){d++,r.add(d,d,U0),s&&s.add(d,d,V0);continue}let u=d+c.value.length;if(o)for(;l<t.changes.length;){let f=t.changes[l],m=i+(n?f.fromA:f.fromB),_=i+(n?f.toA:f.toB),g=Math.max(d,m),p=Math.min(u,_);if(g<p&&r.add(g,p,p5),!(_<u))break;l++}d=u}}}function $0(t){let e=t.state.field(Jr),{side:n,highlightChanges:o,markGutter:r}=t.state.facet(no),s=n=="a",i=new Us,a=r?new Us:null,{from:l,to:c}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=c)break;(s?d.toA:d.toB)>l&&b5(d,t.state.doc,s,o,i,a)}return{deco:i.finish(),gutter:a&&a.finish()}}class _l extends Hs{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const bl=Ut.define({map:(t,e)=>t.map(e)}),Ni=En.define({create:()=>dt.none,update:(t,e)=>{for(let n of e.effects)if(n.is(bl))return n.value;return t.map(e.changes)},provide:t=>st.decorations.from(t)}),yu=.01,xu=Ut.define({map:(t,e)=>e.mapPos(t)});class y5 extends Hs{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent="\u299A "+e.state.phrase("$ unchanged lines",this.lines)+" \u299A",n.addEventListener("click",o=>{let r=e.posAtDOM(o.target);e.dispatch({effects:xu.of(r)});let{side:s,sibling:i}=e.state.facet(no);i&&i().dispatch({effects:xu.of(x5(r,e.state.field(Jr),s=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}}function x5(t,e,n){let o=0,r=0;for(let s=0;;s++){let i=s<e.length?e[s]:null;if(!i||(n?i.fromA:i.fromB)>=t)return r+(t-o);[o,r]=n?[i.toA,i.toB]:[i.toB,i.toA]}}const w5=En.define({create:t=>dt.none,update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(xu)&&(t=t.update({filter:o=>o!=n.value}));return t},provide:t=>st.decorations.from(t)});function H0({margin:t=3,minSize:e=4}){return w5.init(n=>function(o,r,s){let i=new Us,a=o.facet(no).side=="a",l=o.field(Jr),c=1;for(let d=0;;d++){let u=d<l.length?l[d]:null,f=d?c+r:1,m=u?o.doc.lineAt(a?u.fromA:u.fromB).number-1-r:o.doc.lines,_=m-f+1;if(_>=s&&i.add(o.doc.line(f).from,o.doc.line(m).to,dt.replace({widget:new y5(_),block:!0})),!u)break;c=o.doc.lineAt(Math.min(o.doc.length,a?u.toA:u.toB)).number}return i.finish()}(n,t,e))}const v5=st.styleModule.of(new tU({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),k5=st.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb2266, #22bb2266) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff8866, #88ff8866) bottom/100% 2px no-repeat"},".cm-insertedLine, .cm-deletedLine":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer"},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"}}),W0=new wm,yl=new wm;class q0{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig;let n=[Uo.low(B0),k5,v5,Ni,st.updateListener.of(u=>{this.measuring<0&&(u.heightChanged||u.viewportChanged)&&!u.transactions.some(f=>f.effects.some(m=>m.is(bl)))&&this.measure()})],o=[no.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&o.push(gl);let r=ca.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],st.editorAttributes.of({class:"cm-merge-a"}),yl.of(o),n]}),s=[no.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&s.push(gl);let i=ca.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],st.editorAttributes.of({class:"cm-merge-b"}),yl.of(s),n]});this.chunks=Kr.build(r.doc,i.doc,this.diffConf);let a=[Jr.init(()=>this.chunks),W0.of(e.collapseUnchanged?H0(e.collapseUnchanged):[])];r=r.update({effects:Ut.appendConfig.of(a)}).state,i=i.update({effects:Ut.appendConfig.of(a)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let l=e.orientation||"a-b",c=document.createElement("div");c.className="cm-mergeViewEditor";let d=document.createElement("div");d.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?c:d),this.editorDOM.appendChild(l=="a-b"?d:c),this.a=new st({state:r,parent:c,root:e.root,dispatchTransactions:u=>this.dispatch(u,this.a)}),this.b=new st({state:i,parent:d,root:e.root,dispatchTransactions:u=>this.dispatch(u,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(o=>o.docChanged)){let o=e[e.length-1],r=e.reduce((i,a)=>i.compose(a.changes),ia.empty(e[0].startState.doc.length));this.chunks=n==this.a?Kr.updateA(this.chunks,o.newDoc,this.b.state.doc,r,this.diffConf):Kr.updateB(this.chunks,this.a.state.doc,o.newDoc,r,this.diffConf),n.update([...e,o.state.update({effects:bu.of(this.chunks)})]);let s=n==this.a?this.b:this.a;s.update([s.state.update({effects:bu.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let s=e.orientation!="b-a";if(s!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let i=this.a.dom.parentNode,a=this.b.dom.parentNode;i.remove(),a.remove(),this.editorDOM.insertBefore(s?i:a,this.editorDOM.firstChild),this.editorDOM.appendChild(s?a:i),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let s=!!this.revertDOM,i=this.revertToA,a=this.renderRevert;"revertControls"in e&&(s=!!e.revertControls,i=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(a=e.renderRevertControl),this.setupRevertControls(s,i,a)}let n="highlightChanges"in e,o="gutter"in e,r="collapseUnchanged"in e;if(n||o||r){let s=[],i=[];if(n||o){let a=this.a.state.facet(no),l=o?e.gutter!==!1:a.markGutter,c=n?e.highlightChanges!==!1:a.highlightChanges;s.push(yl.reconfigure([no.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:l}),l?gl:[]])),i.push(yl.reconfigure([no.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:l}),l?gl:[]]))}if(r){let a=W0.reconfigure(e.collapseUnchanged?H0(e.collapseUnchanged):[]);s.push(a),i.push(a)}this.a.dispatch({effects:s}),this.b.dispatch({effects:i})}this.scheduleMeasure()}setupRevertControls(e,n,o){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=o,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",r=>this.revertClicked(r)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){(function(e,n,o){let r=new Us,s=new Us,i=e.state.field(Ni).iter(),a=n.state.field(Ni).iter(),l=0,c=0,d=0,u=0;for(let g=0;;g++){let p=g<o.length?o[g]:null;if(l<(p?p.fromA:e.state.doc.length)){let b=e.lineBlockAt(l).top+d-(n.lineBlockAt(c).top+u);b<-.01?(d-=b,r.add(l,l,dt.widget({widget:new _l(-b),block:!0,side:-1}))):b>yu&&(u+=b,s.add(c,c,dt.widget({widget:new _l(b),block:!0,side:-1})))}if(!p)break;for(l=p.toA,c=p.toB;i.value&&i.from<l;)d-=i.value.spec.widget.height,i.next();for(;a.value&&a.from<c;)u-=a.value.spec.widget.height,a.next()}for(;i.value;)d-=i.value.spec.widget.height,i.next();for(;a.value;)u-=a.value.spec.widget.height,a.next();let f=e.contentHeight+d-(n.contentHeight+u);f<yu?r.add(e.state.doc.length,e.state.doc.length,dt.widget({widget:new _l(-f),block:!0,side:1})):f>yu&&s.add(n.state.doc.length,n.state.doc.length,dt.widget({widget:new _l(f),block:!0,side:1}));let m=r.finish(),_=s.finish();Am.eq([m],[e.state.field(Ni)])||e.dispatch({effects:bl.of(m)}),Am.eq([_],[n.state.field(Ni)])||n.dispatch({effects:bl.of(_)})})(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,o=this.a.viewport,r=this.b.viewport;for(let s=0;s<this.chunks.length;s++){let i=this.chunks[s];if(i.fromA>o.to||i.fromB>r.to)break;if(i.fromA<o.from||i.fromB<r.from)continue;let a=this.a.lineBlockAt(i.fromA).top+"px";for(;n&&+n.dataset.chunk<s;)n=G0(n);n&&n.dataset.chunk==String(s)?(n.style.top!=a&&(n.style.top=a),n=n.nextSibling):e.insertBefore(this.renderRevertButton(a,s),n)}for(;n;)n=G0(n)}renderRevertButton(e,n){let o;if(this.renderRevert)o=this.renderRevert();else{o=document.createElement("button");let r=this.a.state.phrase("Revert this chunk");o.setAttribute("aria-label",r),o.setAttribute("title",r),o.textContent=this.revertToLeft?"\u21DC":"\u21DD"}return o.style.top=e,o.setAttribute("data-chunk",String(n)),o}revertClicked(e){let n,o=e.target;for(;o&&o.parentNode!=this.revertDOM;)o=o.parentNode;if(o&&(n=this.chunks[o.dataset.chunk])){let[r,s,i,a,l,c]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],d=r.state.sliceDoc(i,Math.max(i,a-1));i!=a&&c<=s.state.doc.length&&(d+=r.state.lineBreak),s.dispatch({changes:{from:l,to:Math.min(s.state.doc.length,c),insert:d},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function G0(t){let e=t.nextSibling;return t.remove(),e}var S5=["className","children","orientation","revertControls","highlightChanges","gutter","collapseUnchanged","destroyRerender","renderRevertControl","diffConfig"],C5=["modified","modifiedExtension","original","originalExtension","theme","dispatch"],Y0=K.forwardRef((t,e)=>{var{className:n,children:o,orientation:r,revertControls:s,highlightChanges:i,gutter:a,collapseUnchanged:l,destroyRerender:c=!0,renderRevertControl:d,diffConfig:u}=t,f=pa(t,S5),m=hu(),{modified:_,modifiedExtension:g,original:p,originalExtension:b,theme:x,dispatch:y}=m,v=pa(m,C5),S=A.useRef(null),k=A.useRef(),E={orientation:r,revertControls:s,highlightChanges:i,gutter:a,collapseUnchanged:l,renderRevertControl:d,diffConfig:u};A.useImperativeHandle(e,()=>({container:S.current,view:k.current,modified:_,original:p,config:Nt({a:p,b:_,parent:S.current},E)}),[S,k,_,p,E]);var j=st.updateListener.of(T=>{if(T.docChanged&&typeof(b==null?void 0:b.onChange)=="function"){var M=T.state.doc.toString();b==null||b.onChange(M,T)}}),I=st.updateListener.of(T=>{if(T.docChanged&&typeof(g==null?void 0:g.onChange)=="function"){var M=T.state.doc.toString();g==null||g.onChange(M,T)}});return A.useEffect(()=>{!k.current&&S.current&&b&&g&&(k.current=new q0(Nt({a:Nt({},p,{extensions:[...(b==null?void 0:b.extension)||[],...Js(Nt({},b==null?void 0:b.option,{theme:x})),j]}),b:Nt({},_,{extensions:[...(g==null?void 0:g.extension)||[],...Js(Nt({},g==null?void 0:g.option,{theme:x})),I]}),parent:S.current},E)),y({view:k.current}))},[k,S,b,g]),A.useEffect(()=>{if(p&&p.doc&&k.current){var T,M,L=(T=k.current)==null?void 0:T.a.state.doc.toString();L!==p.doc&&((M=k.current)==null||M.a.dispatch({changes:{from:0,to:L.length,insert:p.doc||""}}))}if(_&&_.doc&&k.current){var B,O,z=(B=k.current)==null?void 0:B.b.state.doc.toString();z!==_.doc&&((O=k.current)==null||O.b.dispatch({changes:{from:0,to:z.length,insert:_.doc||""}}))}if(c&&k.current){var F=k.current.a.state.selection.ranges[0].from,V=k.current.b.state.selection.ranges[0].from;k.current.destroy(),k.current=new q0(Nt({a:Nt({},p,{extensions:[...(b==null?void 0:b.extension)||[],...Js(Nt({},b==null?void 0:b.option,{theme:x}))]}),b:Nt({},_,{extensions:[...(g==null?void 0:g.extension)||[],...Js(Nt({},g==null?void 0:g.option,{theme:x}))]}),parent:S.current},E)),F&&(k.current.a.focus(),k.current.a.dispatch({selection:{anchor:F,head:F}})),V&&(k.current.b.focus(),k.current.b.dispatch({selection:{anchor:V,head:V}}))}},[k,x,S.current,p,_,b,g,c]),A.useEffect(()=>()=>k.current&&k.current.destroy(),[]),A.useEffect(()=>{if(k.current){var T={};v.orientation!==r&&(T.orientation=r),v.revertControls!==s&&(T.revertControls=s),v.highlightChanges!==i&&(T.highlightChanges=i),v.gutter!==a&&(T.gutter=a),v.collapseUnchanged!==l&&(T.collapseUnchanged=l),v.renderRevertControl!==d&&(T.collapseUnchanged=l),Object.keys(T).length&&y&&k.current&&(k.current.reconfigure(Nt({},T)),y(Nt({},T)))}},[y,k,r,s,i,a,l,d]),h.jsx("div",Nt({ref:S,className:"cm-merge-theme"+(n?" "+n:"")},f,{children:o}))});Y0.displayName="CodeMirrorMerge.Internal";var N5=["theme"],Xr=K.forwardRef((t,e)=>{var{theme:n}=t,o=pa(t,N5);return h.jsx(c5,{theme:n,children:h.jsx(Y0,Nt({},o,{ref:e}))})});Xr.Original=y0,Xr.Modified=x0,Xr.displayName="CodeMirrorMerge";const j5=Xr.Original,E5=Xr.Modified,J0=[sU(),st.lineWrapping],I5=t=>{const e=X.c(42),{className:n,onChange:o,initialPrompt:r,currentLanguageAdapter:s,currentCode:i,declineChange:a,acceptChange:l,enabled:c,children:d}=t;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={},e[0]=u):u=e[0];const[f,m]=A.useState(u),[_,g]=hn(RS),{completion:p,input:b,stop:x,isLoading:y,setCompletion:v,setInput:S,handleSubmit:k}=rU({api:km("api/ai/completion").toString(),headers:Cc.headers(),initialInput:r,streamProtocol:"text",experimental_throttle:100,body:{...f,includeOtherCode:_?kc(i):"",code:i,language:s},onError:A5,onFinish:(Y,Q)=>{E(Q.trimEnd())}}),E=v,j=K.useRef(null);let I,T,M,L;e[1]!==c?(I=()=>{const Y=j.current;c&&Y&&(requestAnimationFrame(()=>{var Q;(Q=Y.view)==null||Q.focus()}),iU(j.current.view))},T=[c],e[1]=c,e[2]=I,e[3]=T):(I=e[2],T=e[3]),A.useEffect(I,T),e[4]!==c||e[5]!==r||e[6]!==S?(M=()=>{c&&S(r||"")},L=[c,r,S],e[4]=c,e[5]=r,e[6]=S,e[7]=M,e[8]=L):(M=e[7],L=e[8]),A.useEffect(M,L);const{theme:B}=Lo();let O;e[9]!==n?(O=Te("flex flex-col w-full rounded-[inherit]",n),e[9]=n,e[10]=O):O=e[10];const z=c&&"max-h-[400px] min-h-11 visible",F=!c&&"max-h-0 min-h-0 invisible";let V,P,C,$;e[11]!==z||e[12]!==F?(V=Te("flex items-center gap-2 border-b px-3 transition-all rounded-[inherit] rounded-b-none duration-300",z,F),e[11]=z,e[12]=F,e[13]=V):V=e[13],e[14]!==l||e[15]!==p||e[16]!==a||e[17]!==c||e[18]!==k||e[19]!==_||e[20]!==b||e[21]!==y||e[22]!==E||e[23]!==g||e[24]!==S||e[25]!==x||e[26]!==B?(P=c&&h.jsxs(h.Fragment,{children:[h.jsx(Xi,{className:"text-[var(--blue-10)] flex-shrink-0",size:16}),h.jsx(Oc,{inputRef:j,theme:B,onClose:()=>{a(),E("")},value:b,onChange:Y=>{S(Y),m(g4({input:Y}))},onSubmit:()=>{y||k()}}),y&&h.jsxs(De,{"data-testid":"stop-completion-button",variant:"text",size:"xs",className:"mb-0",onClick:x,children:[h.jsx(Tm,{className:"animate-spin mr-1",size:14}),"Stop"]}),!y&&p&&h.jsx(De,{"data-testid":"accept-completion-button",variant:"text",size:"xs",className:"mb-0",disabled:y,onClick:()=>{l(p),E("")},children:h.jsx("span",{className:"text-[var(--grass-11)] opacity-100",children:"Accept"})}),h.jsx("div",{className:"h-full w-px bg-border mx-2"}),h.jsx(Oe,{content:"Include code from other cells",children:h.jsxs("div",{className:"flex flex-row items-start gap-1 overflow-hidden",children:[h.jsx(_4,{"data-testid":"include-other-cells-checkbox",id:"include-other-cells",checked:_,onCheckedChange:Y=>g(!!Y)}),h.jsx(Tr,{htmlFor:"include-other-cells",className:"text-muted-foreground text-xs whitespace-nowrap ellipsis",children:"Include all code"})]})}),h.jsx(De,{"data-testid":"decline-completion-button",variant:"text",size:"icon",disabled:y,onClick:()=>{x(),a(),E("")},children:h.jsx(go,{className:"text-[var(--red-10)]",size:16})})]}),e[14]=l,e[15]=p,e[16]=a,e[17]=c,e[18]=k,e[19]=_,e[20]=b,e[21]=y,e[22]=E,e[23]=g,e[24]=S,e[25]=x,e[26]=B,e[27]=P):P=e[27],e[28]!==V||e[29]!==P?(C=h.jsx("div",{className:V,children:P}),e[28]=V,e[29]=P,e[30]=C):C=e[30],e[31]!==p||e[32]!==i||e[33]!==c||e[34]!==o||e[35]!==B?($=p&&c&&h.jsxs(Xr,{className:"cm",theme:B,children:[h.jsx(j5,{onChange:o,value:i,extensions:J0}),h.jsx(E5,{value:p,editable:!1,readOnly:!0,extensions:J0})]}),e[31]=p,e[32]=i,e[33]=c,e[34]=o,e[35]=B,e[36]=$):$=e[36];const N=(!p||!c)&&d;let H;return e[37]!==C||e[38]!==$||e[39]!==N||e[40]!==O?(H=h.jsxs("div",{className:O,children:[C,$,N]}),e[37]=C,e[38]=$,e[39]=N,e[40]=O,e[41]=H):H=e[41],H};function A5(t){lt({title:"Completion failed",description:p4(t)})}const T5=""+new URL("loro_wasm_bg-DHBNbovs.wasm",import.meta.url).href;let w;function wu(t){w=t}const kt=new Array(128).fill(void 0);function ye(t){return kt[t]}kt.push(void 0,null,!0,!1);let qe=0,xl=null;function Zr(){return xl!==null&&xl.byteLength!==0||(xl=new Uint8Array(w.memory.buffer)),xl}let wl=new(typeof TextEncoder>"u"?(0,module.require)("util").TextEncoder:TextEncoder)("utf-8");const M5=typeof wl.encodeInto=="function"?function(t,e){return wl.encodeInto(t,e)}:function(t,e){const n=wl.encode(t);return e.set(n),{read:t.length,written:n.length}};function ft(t,e,n){if(n===void 0){const a=wl.encode(t),l=e(a.length,1)>>>0;return Zr().subarray(l,l+a.length).set(a),qe=a.length,l}let o=t.length,r=e(o,1)>>>0;const s=Zr();let i=0;for(;i<o;i++){const a=t.charCodeAt(i);if(a>127)break;s[r+i]=a}if(i!==o){i!==0&&(t=t.slice(i)),r=n(r,o,o=i+3*t.length,1)>>>0;const a=Zr().subarray(r+i,r+o);i+=M5(t,a).written,r=n(r,o,i,1)>>>0}return qe=i,r}let Qr=null;function R(){return(Qr===null||Qr.buffer.detached===!0||Qr.buffer.detached===void 0&&Qr.buffer!==w.memory.buffer)&&(Qr=new DataView(w.memory.buffer)),Qr}let ji=kt.length;function se(t){ji===kt.length&&kt.push(kt.length+1);const e=ji;return ji=kt[e],kt[e]=t,e}function Jt(t,e){try{return t.apply(this,e)}catch(n){w.__wbindgen_export_2(se(n))}}let K0=new(typeof TextDecoder>"u"?(0,module.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});function At(t,e){return t>>>=0,K0.decode(Zr().subarray(t,t+e))}function W(t){const e=ye(t);return function(n){n<132||(kt[n]=ji,ji=n)}(t),e}function Mn(t){return t==null}K0.decode();const X0=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>{w.__wbindgen_export_4.get(t.dtor)(t.a,t.b)});function Z0(t,e,n,o){const r={a:t,b:e,cnt:1,dtor:n},s=(...i)=>{r.cnt++;const a=r.a;r.a=0;try{return o(a,r.b,...i)}finally{--r.cnt==0?(w.__wbindgen_export_4.get(r.dtor)(a,r.b),X0.unregister(r)):r.a=a}};return s.original=r,X0.register(s,r,r),s}function vu(t){const e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){const r=t.description;return r==null?"Symbol":`Symbol(${r})`}if(e=="function"){const r=t.name;return typeof r=="string"&&r.length>0?`Function(${r})`:"Function"}if(Array.isArray(t)){const r=t.length;let s="[";r>0&&(s+=vu(t[0]));for(let i=1;i<r;i++)s+=", "+vu(t[i]);return s+="]",s}const n=/\[object ([^\]]+)\]/.exec(toString.call(t));let o;if(!(n&&n.length>1))return toString.call(t);if(o=n[1],o=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message}
111
111
  ${t.stack}`:o}function oo(t,e){return t>>>=0,Zr().subarray(t/1,t/1+e)}function Jo(t,e){const n=e(1*t.length,1)>>>0;return Zr().set(t,n/1),qe=t.length,n}function On(t,e){t>>>=0;const n=R(),o=[];for(let r=t;r<t+4*e;r+=4)o.push(W(n.getUint32(r,!0)));return o}function wn(t,e){const n=e(4*t.length,4)>>>0,o=R();for(let r=0;r<t.length;r++)o.setUint32(n+4*r,se(t[r]),!0);return qe=t.length,n}let Kt=128;function gn(t){if(Kt==1)throw new Error("out of js stack");return kt[--Kt]=t,Kt}function es(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`)}function O5(t,e,n){w.__wbindgen_export_5(t,e,se(n))}function D5(t,e){w.__wbindgen_export_6(t,e)}const Q0=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_awarenesswasm_free(t>>>0,1));class eb{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Q0.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_awarenesswasm_free(e,0)}constructor(e,n){const o=w.awarenesswasm_new(se(e),n);return this.__wbg_ptr=o>>>0,Q0.register(this,this.__wbg_ptr,this),this}encode(e){try{const s=w.__wbindgen_add_to_stack_pointer(-16);w.awarenesswasm_encode(s,this.__wbg_ptr,se(e));var n=R().getInt32(s+0,!0),o=R().getInt32(s+4,!0),r=oo(n,o).slice();return w.__wbindgen_export_3(n,1*o,1),r}finally{w.__wbindgen_add_to_stack_pointer(16)}}encodeAll(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.awarenesswasm_encodeAll(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=oo(e,n).slice();return w.__wbindgen_export_3(e,1*n,1),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}apply(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=Jo(e,w.__wbindgen_export_0),i=qe;w.awarenesswasm_apply(r,this.__wbg_ptr,s,i);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}setLocalState(e){w.awarenesswasm_setLocalState(this.__wbg_ptr,se(e))}peer(){return W(w.awarenesswasm_peer(this.__wbg_ptr))}getAllStates(){return W(w.awarenesswasm_getAllStates(this.__wbg_ptr))}getState(e){return W(w.awarenesswasm_getState(this.__wbg_ptr,se(e)))}getTimestamp(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.awarenesswasm_getTimestamp(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getFloat64(r+8,!0);return n===0?void 0:o}finally{w.__wbindgen_add_to_stack_pointer(16)}}removeOutdated(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.awarenesswasm_removeOutdated(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=On(e,n).slice();return w.__wbindgen_export_3(e,4*n,4),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}length(){return w.awarenesswasm_length(this.__wbg_ptr)}isEmpty(){return w.awarenesswasm_isEmpty(this.__wbg_ptr)!==0}peers(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.awarenesswasm_peers(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=On(e,n).slice();return w.__wbindgen_export_3(e,4*n,4),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}}const tb=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_changemodifier_free(t>>>0,1));class ts{static __wrap(e){e>>>=0;const n=Object.create(ts.prototype);return n.__wbg_ptr=e,tb.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,tb.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_changemodifier_free(e,0)}setMessage(e){const n=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),o=qe,r=w.changemodifier_setMessage(this.__wbg_ptr,n,o);return ts.__wrap(r)}setTimestamp(e){const n=w.changemodifier_setTimestamp(this.__wbg_ptr,e);return ts.__wrap(n)}}const nb=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_cursor_free(t>>>0,1));class Gn{static __wrap(e){e>>>=0;const n=Object.create(Gn.prototype);return n.__wbg_ptr=e,nb.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,nb.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_cursor_free(e,0)}containerId(){return W(w.cursor_containerId(this.__wbg_ptr))}pos(){return W(w.cursor_pos(this.__wbg_ptr))}side(){return W(w.cursor_side(this.__wbg_ptr))}encode(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.cursor_encode(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=oo(e,n).slice();return w.__wbindgen_export_3(e,1*n,1),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}static decode(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=Jo(e,w.__wbindgen_export_0),i=qe;w.cursor_decode(r,s,i);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return Gn.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}kind(){return W(w.cursor_kind(this.__wbg_ptr))}}const ob=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_ephemeralstorewasm_free(t>>>0,1)),ku=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_lorocounter_free(t>>>0,1));class Ei{static __wrap(e){e>>>=0;const n=Object.create(Ei.prototype);return n.__wbg_ptr=e,ku.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ku.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_lorocounter_free(e,0)}constructor(){const e=w.lorocounter_new();return this.__wbg_ptr=e>>>0,ku.register(this,this.__wbg_ptr,this),this}kind(){return W(w.lorocounter_kind(this.__wbg_ptr))}get id(){return W(w.lorocounter_id(this.__wbg_ptr))}increment(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorocounter_increment(o,this.__wbg_ptr,e);var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}decrement(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorocounter_decrement(o,this.__wbg_ptr,e);var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}get value(){return w.lorocounter_value(this.__wbg_ptr)}subscribe(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorocounter_subscribe(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}parent(){return W(w.lorocounter_parent(this.__wbg_ptr))}isAttached(){return w.lorocounter_isAttached(this.__wbg_ptr)!==0}getAttached(){return W(w.lorocounter_getAttached(this.__wbg_ptr))}getShallowValue(){return w.lorocounter_getShallowValue(this.__wbg_ptr)}}const Su=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_lorodoc_free(t>>>0,1));class bo{static __wrap(e){e>>>=0;const n=Object.create(bo.prototype);return n.__wbg_ptr=e,Su.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Su.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_lorodoc_free(e,0)}constructor(){const e=w.lorodoc_new();return this.__wbg_ptr=e>>>0,Su.register(this,this.__wbg_ptr,this),this}setDetachedEditing(e){w.lorodoc_setDetachedEditing(this.__wbg_ptr,e)}isDetachedEditingEnabled(){return w.lorodoc_isDetachedEditingEnabled(this.__wbg_ptr)!==0}setRecordTimestamp(e){w.lorodoc_setRecordTimestamp(this.__wbg_ptr,e)}setChangeMergeInterval(e){w.lorodoc_setChangeMergeInterval(this.__wbg_ptr,e)}configTextStyle(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_configTextStyle(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}configDefaultTextStyle(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_configDefaultTextStyle(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}static fromSnapshot(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=Jo(e,w.__wbindgen_export_0),i=qe;w.lorodoc_fromSnapshot(r,s,i);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return bo.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}attach(){w.lorodoc_attach(this.__wbg_ptr)}isDetached(){return w.lorodoc_isDetached(this.__wbg_ptr)!==0}detach(){w.lorodoc_detach(this.__wbg_ptr)}fork(){const e=w.lorodoc_fork(this.__wbg_ptr);return bo.__wrap(e)}forkAt(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=wn(e,w.__wbindgen_export_0),i=qe;w.lorodoc_forkAt(r,this.__wbg_ptr,s,i);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return bo.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}checkoutToLatest(){try{const n=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_checkoutToLatest(n,this.__wbg_ptr);var e=R().getInt32(n+0,!0);if(R().getInt32(n+4,!0))throw W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}travelChangeAncestors(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=wn(e,w.__wbindgen_export_0),i=qe;w.lorodoc_travelChangeAncestors(r,this.__wbg_ptr,s,i,se(n));var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}findIdSpansBetween(e,n){try{const s=w.__wbindgen_add_to_stack_pointer(-16),i=wn(e,w.__wbindgen_export_0),a=qe,l=wn(n,w.__wbindgen_export_0),c=qe;w.lorodoc_findIdSpansBetween(s,this.__wbg_ptr,i,a,l,c);var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);if(R().getInt32(s+8,!0))throw W(r);return W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}checkout(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16),r=wn(e,w.__wbindgen_export_0),s=qe;w.lorodoc_checkout(o,this.__wbg_ptr,r,s);var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}get peerId(){const e=w.lorodoc_peerId(this.__wbg_ptr);return BigInt.asUintN(64,e)}get peerIdStr(){return W(w.lorodoc_peerIdStr(this.__wbg_ptr))}setPeerId(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_setPeerId(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}commit(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_commit(o,this.__wbg_ptr,Mn(e)?0:se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getPendingTxnLength(){return w.lorodoc_getPendingTxnLength(this.__wbg_ptr)>>>0}getText(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getText(r,this.__wbg_ptr,gn(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return Xo.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16),kt[Kt++]=void 0}}getMap(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getMap(r,this.__wbg_ptr,gn(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return Ko.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16),kt[Kt++]=void 0}}getList(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getList(r,this.__wbg_ptr,gn(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return Ii.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16),kt[Kt++]=void 0}}getMovableList(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getMovableList(r,this.__wbg_ptr,gn(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return Ai.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16),kt[Kt++]=void 0}}getCounter(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getCounter(r,this.__wbg_ptr,gn(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return Ei.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16),kt[Kt++]=void 0}}getTree(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getTree(r,this.__wbg_ptr,gn(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return Ti.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16),kt[Kt++]=void 0}}hasContainer(e){return w.lorodoc_hasContainer(this.__wbg_ptr,se(e))!==0}getContainerById(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getContainerById(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}setNextCommitMessage(e){const n=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),o=qe;w.lorodoc_setNextCommitMessage(this.__wbg_ptr,n,o)}setNextCommitOrigin(e){const n=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),o=qe;w.lorodoc_setNextCommitOrigin(this.__wbg_ptr,n,o)}setNextCommitTimestamp(e){w.lorodoc_setNextCommitTimestamp(this.__wbg_ptr,e)}setNextCommitOptions(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_setNextCommitOptions(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}clearNextCommitOptions(){w.lorodoc_clearNextCommitOptions(this.__wbg_ptr)}getDeepValueWithID(){return W(w.lorodoc_getDeepValueWithID(this.__wbg_ptr))}getPathToContainer(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getPathToContainer(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}JSONPath(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),i=qe;w.lorodoc_JSONPath(r,this.__wbg_ptr,s,i);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}version(){const e=w.lorodoc_version(this.__wbg_ptr);return Dn.__wrap(e)}shallowSinceVV(){const e=w.lorodoc_shallowSinceVV(this.__wbg_ptr);return Dn.__wrap(e)}isShallow(){return w.lorodoc_isShallow(this.__wbg_ptr)!==0}shallowSinceFrontiers(){return W(w.lorodoc_shallowSinceFrontiers(this.__wbg_ptr))}oplogVersion(){const e=w.lorodoc_oplogVersion(this.__wbg_ptr);return Dn.__wrap(e)}frontiers(){return W(w.lorodoc_frontiers(this.__wbg_ptr))}oplogFrontiers(){return W(w.lorodoc_oplogFrontiers(this.__wbg_ptr))}cmpWithFrontiers(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=wn(e,w.__wbindgen_export_0),i=qe;w.lorodoc_cmpWithFrontiers(r,this.__wbg_ptr,s,i);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return n}finally{w.__wbindgen_add_to_stack_pointer(16)}}cmpFrontiers(e,n){try{const s=w.__wbindgen_add_to_stack_pointer(-16),i=wn(e,w.__wbindgen_export_0),a=qe,l=wn(n,w.__wbindgen_export_0),c=qe;w.lorodoc_cmpFrontiers(s,this.__wbg_ptr,i,a,l,c);var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);if(R().getInt32(s+8,!0))throw W(r);return W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}exportSnapshot(){try{const s=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_exportSnapshot(s,this.__wbg_ptr);var e=R().getInt32(s+0,!0),n=R().getInt32(s+4,!0),o=R().getInt32(s+8,!0);if(R().getInt32(s+12,!0))throw W(o);var r=oo(e,n).slice();return w.__wbindgen_export_3(e,1*n,1),r}finally{w.__wbindgen_add_to_stack_pointer(16)}}exportFrom(e){try{const i=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_exportFrom(i,this.__wbg_ptr,se(e));var n=R().getInt32(i+0,!0),o=R().getInt32(i+4,!0),r=R().getInt32(i+8,!0);if(R().getInt32(i+12,!0))throw W(r);var s=oo(n,o).slice();return w.__wbindgen_export_3(n,1*o,1),s}finally{w.__wbindgen_add_to_stack_pointer(16)}}export(e){try{const i=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_export(i,this.__wbg_ptr,se(e));var n=R().getInt32(i+0,!0),o=R().getInt32(i+4,!0),r=R().getInt32(i+8,!0);if(R().getInt32(i+12,!0))throw W(r);var s=oo(n,o).slice();return w.__wbindgen_export_3(n,1*o,1),s}finally{w.__wbindgen_add_to_stack_pointer(16)}}exportJsonUpdates(e,n,o){try{const i=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_exportJsonUpdates(i,this.__wbg_ptr,se(e),se(n),Mn(o)?16777215:o?1:0);var r=R().getInt32(i+0,!0),s=R().getInt32(i+4,!0);if(R().getInt32(i+8,!0))throw W(s);return W(r)}finally{w.__wbindgen_add_to_stack_pointer(16)}}exportJsonInIdSpan(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_exportJsonInIdSpan(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}importJsonUpdates(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_importJsonUpdates(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}import(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=Jo(e,w.__wbindgen_export_0),i=qe;w.lorodoc_import(r,this.__wbg_ptr,s,i);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}importUpdateBatch(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_importBatch(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}importBatch(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_importBatch(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getShallowValue(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getShallowValue(o,this.__wbg_ptr);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}toJSON(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_toJSON(o,this.__wbg_ptr);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}subscribe(e){return W(w.lorodoc_subscribe(this.__wbg_ptr,se(e)))}subscribeLocalUpdates(e){return W(w.lorodoc_subscribeLocalUpdates(this.__wbg_ptr,se(e)))}debugHistory(){w.lorodoc_debugHistory(this.__wbg_ptr)}changeCount(){return w.lorodoc_changeCount(this.__wbg_ptr)>>>0}opCount(){return w.lorodoc_opCount(this.__wbg_ptr)>>>0}getAllChanges(){return W(w.lorodoc_getAllChanges(this.__wbg_ptr))}getChangeAt(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getChangeAt(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getChangeAtLamport(e,n){try{const s=w.__wbindgen_add_to_stack_pointer(-16),i=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),a=qe;w.lorodoc_getChangeAtLamport(s,this.__wbg_ptr,i,a,n);var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);if(R().getInt32(s+8,!0))throw W(r);return W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getOpsInChange(e){try{const i=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getOpsInChange(i,this.__wbg_ptr,se(e));var n=R().getInt32(i+0,!0),o=R().getInt32(i+4,!0),r=R().getInt32(i+8,!0);if(R().getInt32(i+12,!0))throw W(r);var s=On(n,o).slice();return w.__wbindgen_export_3(n,4*o,4),s}finally{w.__wbindgen_add_to_stack_pointer(16)}}frontiersToVV(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=wn(e,w.__wbindgen_export_0),i=qe;w.lorodoc_frontiersToVV(r,this.__wbg_ptr,s,i);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return Dn.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}vvToFrontiers(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);es(e,Dn),w.lorodoc_vvToFrontiers(r,this.__wbg_ptr,e.__wbg_ptr);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getByPath(e){const n=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),o=qe;return W(w.lorodoc_getByPath(this.__wbg_ptr,n,o))}getCursorPos(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);es(e,Gn),w.lorodoc_getCursorPos(r,this.__wbg_ptr,e.__wbg_ptr);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getChangedContainersIn(e,n){try{const a=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getChangedContainersIn(a,this.__wbg_ptr,se(e),n);var o=R().getInt32(a+0,!0),r=R().getInt32(a+4,!0),s=R().getInt32(a+8,!0);if(R().getInt32(a+12,!0))throw W(s);var i=On(o,r).slice();return w.__wbindgen_export_3(o,4*r,4),i}finally{w.__wbindgen_add_to_stack_pointer(16)}}revertTo(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16),r=wn(e,w.__wbindgen_export_0),s=qe;w.lorodoc_revertTo(o,this.__wbg_ptr,r,s);var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}applyDiff(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_applyDiff(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}diff(e,n,o){try{const i=w.__wbindgen_add_to_stack_pointer(-16),a=wn(e,w.__wbindgen_export_0),l=qe,c=wn(n,w.__wbindgen_export_0),d=qe;w.lorodoc_diff(i,this.__wbg_ptr,a,l,c,d,Mn(o)?16777215:o?1:0);var r=R().getInt32(i+0,!0),s=R().getInt32(i+4,!0);if(R().getInt32(i+8,!0))throw W(s);return W(r)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getUncommittedOpsAsJson(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_getUncommittedOpsAsJson(o,this.__wbg_ptr);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}subscribeFirstCommitFromPeer(e){return W(w.lorodoc_subscribeFirstCommitFromPeer(this.__wbg_ptr,se(e)))}subscribePreCommit(e){return W(w.lorodoc_subscribePreCommit(this.__wbg_ptr,se(e)))}deleteRootContainer(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_deleteRootContainer(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}setHideEmptyRootContainers(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorodoc_setHideEmptyRootContainers(o,this.__wbg_ptr,e);var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}}const Cu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_lorolist_free(t>>>0,1));class Ii{static __wrap(e){e>>>=0;const n=Object.create(Ii.prototype);return n.__wbg_ptr=e,Cu.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Cu.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_lorolist_free(e,0)}constructor(){const e=w.lorolist_new();return this.__wbg_ptr=e>>>0,Cu.register(this,this.__wbg_ptr,this),this}kind(){return W(w.lorolist_kind(this.__wbg_ptr))}insert(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorolist_insert(r,this.__wbg_ptr,e,se(n));var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}delete(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorolist_delete(r,this.__wbg_ptr,e,n);var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}get(e){return W(w.lorolist_get(this.__wbg_ptr,e))}get id(){return W(w.lorolist_id(this.__wbg_ptr))}toArray(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorolist_toArray(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=On(e,n).slice();return w.__wbindgen_export_3(e,4*n,4),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}toJSON(){return W(w.lorolist_toJSON(this.__wbg_ptr))}insertContainer(e,n){try{const s=w.__wbindgen_add_to_stack_pointer(-16);w.lorolist_insertContainer(s,this.__wbg_ptr,e,se(n));var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);if(R().getInt32(s+8,!0))throw W(r);return W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}pushContainer(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorolist_pushContainer(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}subscribe(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorolist_subscribe(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}get length(){return w.lorolist_length(this.__wbg_ptr)>>>0}parent(){return W(w.lorolist_parent(this.__wbg_ptr))}isAttached(){return w.lorolist_isAttached(this.__wbg_ptr)!==0}getAttached(){return W(w.lorolist_getAttached(this.__wbg_ptr))}getCursor(e,n){const o=w.lorolist_getCursor(this.__wbg_ptr,e,se(n));return o===0?void 0:Gn.__wrap(o)}push(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorolist_push(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}pop(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorolist_pop(o,this.__wbg_ptr);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}clear(){try{const n=w.__wbindgen_add_to_stack_pointer(-16);w.lorolist_clear(n,this.__wbg_ptr);var e=R().getInt32(n+0,!0);if(R().getInt32(n+4,!0))throw W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getIdAt(e){return W(w.lorolist_getIdAt(this.__wbg_ptr,e))}isDeleted(){return w.lorolist_isDeleted(this.__wbg_ptr)!==0}getShallowValue(){return W(w.lorolist_getShallowValue(this.__wbg_ptr))}}const Nu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_loromap_free(t>>>0,1));class Ko{static __wrap(e){e>>>=0;const n=Object.create(Ko.prototype);return n.__wbg_ptr=e,Nu.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Nu.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_loromap_free(e,0)}constructor(){const e=w.loromap_new();return this.__wbg_ptr=e>>>0,Nu.register(this,this.__wbg_ptr,this),this}kind(){return W(w.loromap_kind(this.__wbg_ptr))}set(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),i=qe;w.loromap_set(r,this.__wbg_ptr,s,i,se(n));var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}delete(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16),r=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),s=qe;w.loromap_delete(o,this.__wbg_ptr,r,s);var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}get(e){const n=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),o=qe;return W(w.loromap_get(this.__wbg_ptr,n,o))}getOrCreateContainer(e,n){try{const s=w.__wbindgen_add_to_stack_pointer(-16),i=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),a=qe;w.loromap_getOrCreateContainer(s,this.__wbg_ptr,i,a,se(n));var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);if(R().getInt32(s+8,!0))throw W(r);return W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}keys(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.loromap_keys(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=On(e,n).slice();return w.__wbindgen_export_3(e,4*n,4),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}values(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.loromap_values(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=On(e,n).slice();return w.__wbindgen_export_3(e,4*n,4),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}entries(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.loromap_entries(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=On(e,n).slice();return w.__wbindgen_export_3(e,4*n,4),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}get id(){return W(w.loromap_id(this.__wbg_ptr))}toJSON(){return W(w.loromap_toJSON(this.__wbg_ptr))}setContainer(e,n){try{const s=w.__wbindgen_add_to_stack_pointer(-16),i=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),a=qe;w.loromap_setContainer(s,this.__wbg_ptr,i,a,se(n));var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);if(R().getInt32(s+8,!0))throw W(r);return W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}subscribe(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.loromap_subscribe(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}get size(){return w.loromap_size(this.__wbg_ptr)>>>0}parent(){return W(w.loromap_parent(this.__wbg_ptr))}isAttached(){return w.loromap_isAttached(this.__wbg_ptr)!==0}getAttached(){return W(w.loromap_getAttached(this.__wbg_ptr))}clear(){try{const n=w.__wbindgen_add_to_stack_pointer(-16);w.loromap_clear(n,this.__wbg_ptr);var e=R().getInt32(n+0,!0);if(R().getInt32(n+4,!0))throw W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getLastEditor(e){const n=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),o=qe;return W(w.loromap_getLastEditor(this.__wbg_ptr,n,o))}isDeleted(){return w.loromap_isDeleted(this.__wbg_ptr)!==0}getShallowValue(){return W(w.loromap_getShallowValue(this.__wbg_ptr))}}const ju=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_loromovablelist_free(t>>>0,1));class Ai{static __wrap(e){e>>>=0;const n=Object.create(Ai.prototype);return n.__wbg_ptr=e,ju.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ju.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_loromovablelist_free(e,0)}constructor(){const e=w.loromovablelist_new();return this.__wbg_ptr=e>>>0,ju.register(this,this.__wbg_ptr,this),this}kind(){return W(w.loromovablelist_kind(this.__wbg_ptr))}insert(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_insert(r,this.__wbg_ptr,e,se(n));var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}delete(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_delete(r,this.__wbg_ptr,e,n);var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}get(e){return W(w.loromovablelist_get(this.__wbg_ptr,e))}get id(){return W(w.loromovablelist_id(this.__wbg_ptr))}toArray(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_toArray(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=On(e,n).slice();return w.__wbindgen_export_3(e,4*n,4),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}toJSON(){return W(w.loromovablelist_toJSON(this.__wbg_ptr))}insertContainer(e,n){try{const s=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_insertContainer(s,this.__wbg_ptr,e,se(n));var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);if(R().getInt32(s+8,!0))throw W(r);return W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}pushContainer(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_pushContainer(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}subscribe(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_subscribe(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}get length(){return w.loromovablelist_length(this.__wbg_ptr)>>>0}parent(){return W(w.loromovablelist_parent(this.__wbg_ptr))}isAttached(){return w.loromovablelist_isAttached(this.__wbg_ptr)!==0}getAttached(){return W(w.loromovablelist_getAttached(this.__wbg_ptr))}getCursor(e,n){const o=w.loromovablelist_getCursor(this.__wbg_ptr,e,se(n));return o===0?void 0:Gn.__wrap(o)}move(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_move(r,this.__wbg_ptr,e,n);var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}set(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_set(r,this.__wbg_ptr,e,se(n));var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}setContainer(e,n){try{const s=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_setContainer(s,this.__wbg_ptr,e,se(n));var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);if(R().getInt32(s+8,!0))throw W(r);return W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}push(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_push(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}pop(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_pop(o,this.__wbg_ptr);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}clear(){try{const n=w.__wbindgen_add_to_stack_pointer(-16);w.loromovablelist_clear(n,this.__wbg_ptr);var e=R().getInt32(n+0,!0);if(R().getInt32(n+4,!0))throw W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getCreatorAt(e){return W(w.loromovablelist_getCreatorAt(this.__wbg_ptr,e))}getLastMoverAt(e){return W(w.loromovablelist_getLastMoverAt(this.__wbg_ptr,e))}getLastEditorAt(e){return W(w.loromovablelist_getLastEditorAt(this.__wbg_ptr,e))}isDeleted(){return w.loromovablelist_isDeleted(this.__wbg_ptr)!==0}getShallowValue(){return W(w.loromovablelist_getShallowValue(this.__wbg_ptr))}}const Eu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_lorotext_free(t>>>0,1));class Xo{static __wrap(e){e>>>=0;const n=Object.create(Xo.prototype);return n.__wbg_ptr=e,Eu.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Eu.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_lorotext_free(e,0)}constructor(){const e=w.lorotext_new();return this.__wbg_ptr=e>>>0,Eu.register(this,this.__wbg_ptr,this),this}kind(){return W(w.lorotext_kind(this.__wbg_ptr))}iter(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorotext_iter(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}update(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),i=qe;w.lorotext_update(r,this.__wbg_ptr,s,i,se(n));var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}updateByLine(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),i=qe;w.lorotext_updateByLine(r,this.__wbg_ptr,s,i,se(n));var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}insert(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=ft(n,w.__wbindgen_export_0,w.__wbindgen_export_1),i=qe;w.lorotext_insert(r,this.__wbg_ptr,e,s,i);var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}slice(e,n){let o,r;try{const u=w.__wbindgen_add_to_stack_pointer(-16);w.lorotext_slice(u,this.__wbg_ptr,e,n);var s=R().getInt32(u+0,!0),i=R().getInt32(u+4,!0),a=R().getInt32(u+8,!0),l=R().getInt32(u+12,!0),c=s,d=i;if(l)throw c=0,d=0,W(a);return o=c,r=d,At(c,d)}finally{w.__wbindgen_add_to_stack_pointer(16),w.__wbindgen_export_3(o,r,1)}}charAt(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorotext_charAt(r,this.__wbg_ptr,e);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return String.fromCodePoint(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}splice(e,n,o){let r,s;try{const f=w.__wbindgen_add_to_stack_pointer(-16),m=ft(o,w.__wbindgen_export_0,w.__wbindgen_export_1),_=qe;w.lorotext_splice(f,this.__wbg_ptr,e,n,m,_);var i=R().getInt32(f+0,!0),a=R().getInt32(f+4,!0),l=R().getInt32(f+8,!0),c=R().getInt32(f+12,!0),d=i,u=a;if(c)throw d=0,u=0,W(l);return r=d,s=u,At(d,u)}finally{w.__wbindgen_add_to_stack_pointer(16),w.__wbindgen_export_3(r,s,1)}}insertUtf8(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=ft(n,w.__wbindgen_export_0,w.__wbindgen_export_1),i=qe;w.lorotext_insertUtf8(r,this.__wbg_ptr,e,s,i);var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}delete(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorotext_delete(r,this.__wbg_ptr,e,n);var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}deleteUtf8(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorotext_deleteUtf8(r,this.__wbg_ptr,e,n);var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}mark(e,n,o){try{const s=w.__wbindgen_add_to_stack_pointer(-16),i=ft(n,w.__wbindgen_export_0,w.__wbindgen_export_1),a=qe;w.lorotext_mark(s,this.__wbg_ptr,se(e),i,a,se(o));var r=R().getInt32(s+0,!0);if(R().getInt32(s+4,!0))throw W(r)}finally{w.__wbindgen_add_to_stack_pointer(16)}}unmark(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=ft(n,w.__wbindgen_export_0,w.__wbindgen_export_1),i=qe;w.lorotext_unmark(r,this.__wbg_ptr,se(e),s,i);var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16)}}toString(){let e,n;try{const s=w.__wbindgen_add_to_stack_pointer(-16);w.lorotext_toString(s,this.__wbg_ptr);var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);return e=o,n=r,At(o,r)}finally{w.__wbindgen_add_to_stack_pointer(16),w.__wbindgen_export_3(e,n,1)}}toDelta(){return W(w.lorotext_toDelta(this.__wbg_ptr))}get id(){return W(w.lorotext_id(this.__wbg_ptr))}get length(){return w.lorotext_length(this.__wbg_ptr)>>>0}subscribe(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorotext_subscribe(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}applyDelta(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorotext_applyDelta(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}parent(){return W(w.lorotext_parent(this.__wbg_ptr))}isAttached(){return w.lorotext_isAttached(this.__wbg_ptr)!==0}getAttached(){return W(w.lorotext_getAttached(this.__wbg_ptr))}getCursor(e,n){const o=w.lorotext_getCursor(this.__wbg_ptr,e,se(n));return o===0?void 0:Gn.__wrap(o)}push(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16),r=ft(e,w.__wbindgen_export_0,w.__wbindgen_export_1),s=qe;w.lorotext_push(o,this.__wbg_ptr,r,s);var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getEditorOf(e){return W(w.lorotext_getEditorOf(this.__wbg_ptr,e))}isDeleted(){return w.lorotext_isDeleted(this.__wbg_ptr)!==0}getShallowValue(){let e,n;try{const s=w.__wbindgen_add_to_stack_pointer(-16);w.lorotext_getShallowValue(s,this.__wbg_ptr);var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);return e=o,n=r,At(o,r)}finally{w.__wbindgen_add_to_stack_pointer(16),w.__wbindgen_export_3(e,n,1)}}toJSON(){return W(w.lorotext_toJSON(this.__wbg_ptr))}}const Iu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_lorotree_free(t>>>0,1));class Ti{static __wrap(e){e>>>=0;const n=Object.create(Ti.prototype);return n.__wbg_ptr=e,Iu.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Iu.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_lorotree_free(e,0)}constructor(){const e=w.lorotree_new();return this.__wbg_ptr=e>>>0,Iu.register(this,this.__wbg_ptr,this),this}kind(){return W(w.lorotree_kind(this.__wbg_ptr))}createNode(e,n){try{const s=w.__wbindgen_add_to_stack_pointer(-16);w.lorotree_createNode(s,this.__wbg_ptr,gn(e),Mn(n)?4294967297:n>>>0);var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);if(R().getInt32(s+8,!0))throw W(r);return ro.__wrap(o)}finally{w.__wbindgen_add_to_stack_pointer(16),kt[Kt++]=void 0}}move(e,n,o){try{const s=w.__wbindgen_add_to_stack_pointer(-16);w.lorotree_move(s,this.__wbg_ptr,gn(e),gn(n),Mn(o)?4294967297:o>>>0);var r=R().getInt32(s+0,!0);if(R().getInt32(s+4,!0))throw W(r)}finally{w.__wbindgen_add_to_stack_pointer(16),kt[Kt++]=void 0,kt[Kt++]=void 0}}delete(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorotree_delete(o,this.__wbg_ptr,gn(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16),kt[Kt++]=void 0}}getNodeByID(e){try{const n=w.lorotree_getNodeByID(this.__wbg_ptr,gn(e));return n===0?void 0:ro.__wrap(n)}finally{kt[Kt++]=void 0}}get id(){return W(w.lorotree_id(this.__wbg_ptr))}has(e){try{return w.lorotree_has(this.__wbg_ptr,gn(e))!==0}finally{kt[Kt++]=void 0}}isNodeDeleted(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorotree_isNodeDeleted(r,this.__wbg_ptr,gn(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return n!==0}finally{w.__wbindgen_add_to_stack_pointer(16),kt[Kt++]=void 0}}toArray(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorotree_toArray(o,this.__wbg_ptr);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}getNodes(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorotree_getNodes(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}toJSON(){return W(w.lorotree_toJSON(this.__wbg_ptr))}nodes(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorotree_nodes(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=On(e,n).slice();return w.__wbindgen_export_3(e,4*n,4),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}roots(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorotree_roots(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=On(e,n).slice();return w.__wbindgen_export_3(e,4*n,4),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}subscribe(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorotree_subscribe(r,this.__wbg_ptr,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}parent(){return W(w.lorotree_parent(this.__wbg_ptr))}isAttached(){return w.lorotree_isAttached(this.__wbg_ptr)!==0}getAttached(){return W(w.lorotree_getAttached(this.__wbg_ptr))}enableFractionalIndex(e){w.lorotree_enableFractionalIndex(this.__wbg_ptr,e)}disableFractionalIndex(){w.lorotree_disableFractionalIndex(this.__wbg_ptr)}isFractionalIndexEnabled(){return w.lorotree_isFractionalIndexEnabled(this.__wbg_ptr)!==0}isDeleted(){return w.lorotree_isDeleted(this.__wbg_ptr)!==0}getShallowValue(){return W(w.lorotree_getShallowValue(this.__wbg_ptr))}}const rb=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_lorotreenode_free(t>>>0,1));class ro{static __wrap(e){e>>>=0;const n=Object.create(ro.prototype);return n.__wbg_ptr=e,rb.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,rb.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_lorotreenode_free(e,0)}__getClassname(){let e,n;try{const s=w.__wbindgen_add_to_stack_pointer(-16);w.lorotreenode___getClassname(s,this.__wbg_ptr);var o=R().getInt32(s+0,!0),r=R().getInt32(s+4,!0);return e=o,n=r,At(o,r)}finally{w.__wbindgen_add_to_stack_pointer(16),w.__wbindgen_export_3(e,n,1)}}get id(){return W(w.lorotreenode_id(this.__wbg_ptr))}createNode(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorotreenode_createNode(r,this.__wbg_ptr,Mn(e)?4294967297:e>>>0);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return ro.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}move(e,n){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.lorotreenode_move(r,this.__wbg_ptr,gn(e),Mn(n)?4294967297:n>>>0);var o=R().getInt32(r+0,!0);if(R().getInt32(r+4,!0))throw W(o)}finally{w.__wbindgen_add_to_stack_pointer(16),kt[Kt++]=void 0}}moveAfter(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);es(e,ro),w.lorotreenode_moveAfter(o,this.__wbg_ptr,e.__wbg_ptr);var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}moveBefore(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);es(e,ro),w.lorotreenode_moveBefore(o,this.__wbg_ptr,e.__wbg_ptr);var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}index(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorotreenode_index(o,this.__wbg_ptr);var e=R().getFloat64(o+0,!0),n=R().getInt32(o+8,!0);if(R().getInt32(o+12,!0))throw W(n);return e===4294967297?void 0:e}finally{w.__wbindgen_add_to_stack_pointer(16)}}fractionalIndex(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorotreenode_fractionalIndex(o,this.__wbg_ptr);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}get data(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorotreenode_data(o,this.__wbg_ptr);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return Ko.__wrap(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}toJSON(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorotreenode_toJSON(o,this.__wbg_ptr);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}parent(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorotreenode_parent(o,this.__wbg_ptr);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return e===0?void 0:ro.__wrap(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}}children(){return W(w.lorotreenode_children(this.__wbg_ptr))}isDeleted(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.lorotreenode_isDeleted(o,this.__wbg_ptr);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return e!==0}finally{w.__wbindgen_add_to_stack_pointer(16)}}getLastMoveId(){return W(w.lorotreenode_getLastMoveId(this.__wbg_ptr))}creationId(){return W(w.lorotreenode_creationId(this.__wbg_ptr))}creator(){return W(w.lorotreenode_creator(this.__wbg_ptr))}}const sb=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_undomanager_free(t>>>0,1)),Au=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>w.__wbg_versionvector_free(t>>>0,1));class Dn{static __wrap(e){e>>>=0;const n=Object.create(Dn.prototype);return n.__wbg_ptr=e,Au.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Au.unregister(this),e}free(){const e=this.__destroy_into_raw();w.__wbg_versionvector_free(e,0)}constructor(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.versionvector_new(r,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return this.__wbg_ptr=n>>>0,Au.register(this,this.__wbg_ptr,this),this}finally{w.__wbindgen_add_to_stack_pointer(16)}}static parseJSON(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.versionvector_parseJSON(r,se(e));var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return Dn.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}toJSON(){return W(w.versionvector_toJSON(this.__wbg_ptr))}encode(){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.versionvector_encode(r,this.__wbg_ptr);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=oo(e,n).slice();return w.__wbindgen_export_3(e,1*n,1),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}static decode(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=Jo(e,w.__wbindgen_export_0),i=qe;w.versionvector_decode(r,s,i);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return Dn.__wrap(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}get(e){try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.versionvector_get(r,this.__wbg_ptr,se(e));var n=R().getFloat64(r+0,!0),o=R().getInt32(r+8,!0);if(R().getInt32(r+12,!0))throw W(o);return n===4294967297?void 0:n}finally{w.__wbindgen_add_to_stack_pointer(16)}}compare(e){es(e,Dn);const n=w.versionvector_compare(this.__wbg_ptr,e.__wbg_ptr);return n===4294967297?void 0:n}setEnd(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.versionvector_setEnd(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}setLast(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.versionvector_setLast(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}remove(e){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.versionvector_remove(o,this.__wbg_ptr,se(e));var n=R().getInt32(o+0,!0);if(R().getInt32(o+4,!0))throw W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}}length(){return w.versionvector_length(this.__wbg_ptr)>>>0}}function ib(t,e){const n=ft(String(ye(e)),w.__wbindgen_export_0,w.__wbindgen_export_1),o=qe;R().setInt32(t+4,o,!0),R().setInt32(t+0,n,!0)}function ab(){return Jt(function(t,e,n){return se(Reflect.apply(ye(t),ye(e),ye(n)))},arguments)}function lb(t){return se(ye(t).buffer)}function cb(){return Jt(function(t,e){return se(ye(t).call(ye(e)))},arguments)}function db(){return Jt(function(t,e,n){return se(ye(t).call(ye(e),ye(n)))},arguments)}function ub(){return Jt(function(t,e,n,o,r){return se(ye(t).call(ye(e),ye(n),ye(o),ye(r)))},arguments)}function hb(){return Jt(function(t,e,n,o){return se(ye(t).call(ye(e),ye(n),ye(o)))},arguments)}function fb(t){return se(ts.__wrap(t))}function mb(t){return se(ye(t).crypto)}function pb(t){return se(Gn.__wrap(t))}function gb(t){return ye(t).done}function _b(t){return se(ye(t).entries())}function bb(t){return se(Object.entries(ye(t)))}function yb(t,e){let n,o;try{n=t,o=e,console.error(At(t,e))}finally{w.__wbindgen_export_3(n,o,1)}}function xb(t,e){console.error(At(t,e))}function wb(t){return se(Array.from(ye(t)))}function vb(){return Jt(function(t,e){ye(t).getRandomValues(ye(e))},arguments)}function kb(t,e){return se(ye(t)[e>>>0])}function Sb(){return Jt(function(t,e){return se(Reflect.get(ye(t),ye(e)))},arguments)}function Cb(t,e){return ye(t)[e>>>0]}function Nb(t,e){return se(ye(t)[ye(e)])}function jb(){return Jt(function(){return se(globalThis.globalThis)},arguments)}function Eb(){return Jt(function(){return se(global.global)},arguments)}function Ib(t){let e;try{e=ye(t)instanceof ArrayBuffer}catch{e=!1}return e}function Ab(t){let e;try{e=ye(t)instanceof Map}catch{e=!1}return e}function Tb(t){let e;try{e=ye(t)instanceof Object}catch{e=!1}return e}function Mb(t){let e;try{e=ye(t)instanceof Uint8Array}catch{e=!1}return e}function Ob(t){return Array.isArray(ye(t))}function Db(t){return Number.isSafeInteger(ye(t))}function Rb(){return se(Symbol.iterator)}function Pb(t){return ye(t).length}function Lb(t){return ye(t).length}function Fb(t,e,n,o,r,s,i,a){let l,c;try{l=t,c=e,console.log(At(t,e),At(n,o),At(r,s),At(i,a))}finally{w.__wbindgen_export_3(l,c,1)}}function zb(t,e){console.log(At(t,e))}function Bb(t,e){let n,o;try{n=t,o=e,console.log(At(t,e))}finally{w.__wbindgen_export_3(n,o,1)}}function Ub(t){return se(Ei.__wrap(t))}function Vb(t){return se(Ii.__wrap(t))}function $b(t){return se(Ko.__wrap(t))}function Hb(t){return se(Ai.__wrap(t))}function Wb(t){return se(Xo.__wrap(t))}function qb(t){return se(Ti.__wrap(t))}function Gb(t){return se(ro.__wrap(t))}function Yb(t,e){performance.mark(At(t,e))}function Jb(){return Jt(function(t,e,n,o){let r,s,i,a;try{r=t,s=e,i=n,a=o,performance.measure(At(t,e),At(n,o))}finally{w.__wbindgen_export_3(r,s,1),w.__wbindgen_export_3(i,a,1)}},arguments)}function Kb(t){return se(ye(t).msCrypto)}function Xb(){return se(new Map)}function Zb(t){return se(new Uint8Array(ye(t)))}function Qb(){return se(new Object)}function ey(){return se(new Error)}function ty(){return se(new Array)}function ny(t,e){return se(new Function(At(t,e)))}function oy(t,e,n){return se(new Uint8Array(ye(t),e>>>0,n>>>0))}function ry(t){return se(new Uint8Array(t>>>0))}function sy(t){return se(new Array(t>>>0))}function iy(t){return se(ye(t).next)}function ay(){return Jt(function(t){return se(ye(t).next())},arguments)}function ly(t){return se(ye(t).node)}function cy(){return Date.now()}function dy(){return Jt(function(t){return se(Reflect.ownKeys(ye(t)))},arguments)}function uy(t){return se(ye(t).process)}function hy(t,e){return ye(t).push(ye(e))}function fy(){return Jt(function(t,e){ye(t).randomFillSync(W(e))},arguments)}function my(){return Jt(function(){return se(module.require)},arguments)}function py(t){return se(Promise.resolve(ye(t)))}function gy(){return Jt(function(){return se(self.self)},arguments)}function _y(){return Jt(function(t,e,n){return Reflect.set(ye(t),ye(e),ye(n))},arguments)}function by(t,e,n){return se(ye(t).set(ye(e),ye(n)))}function yy(t,e,n){ye(t)[W(e)]=W(n)}function xy(t,e,n){ye(t).set(ye(e),n>>>0)}function wy(t,e,n){ye(t)[e>>>0]=W(n)}function vy(t,e,n){ye(t)[e>>>0]=n}function ky(t,e){const n=ft(ye(e).stack,w.__wbindgen_export_0,w.__wbindgen_export_1),o=qe;R().setInt32(t+4,o,!0),R().setInt32(t+0,n,!0)}function Sy(t,e,n){return se(ye(t).subarray(e>>>0,n>>>0))}function Cy(t,e){return se(ye(t).then(ye(e)))}function Ny(t){return se(ye(t).value)}function jy(t){return se(ye(t).versions)}function Ey(t){return se(Dn.__wrap(t))}function Iy(){return Jt(function(){return se(window.window)},arguments)}function Ay(t){return+ye(t)}function Ty(t){return se(t)}function My(t){return se(BigInt.asUintN(64,t))}function Oy(t,e){const n=ye(e),o=typeof n=="bigint"?n:void 0;R().setBigInt64(t+8,Mn(o)?BigInt(0):o,!0),R().setInt32(t+0,!Mn(o),!0)}function Dy(t){const e=ye(t);return typeof e=="boolean"?e?1:0:2}function Ry(t){const e=W(t).original;return e.cnt--==1?(e.a=0,!0):!1}function Py(t,e,n){return se(Z0(t,e,10,O5))}function Ly(t,e,n){return se(Z0(t,e,8,D5))}function Fy(t,e){const n=ft(vu(ye(e)),w.__wbindgen_export_0,w.__wbindgen_export_1),o=qe;R().setInt32(t+4,o,!0),R().setInt32(t+0,n,!0)}function zy(t,e){return se(new Error(At(t,e)))}function By(t,e){return ye(t)in ye(e)}function Uy(t){return Array.isArray(ye(t))}function Vy(t){return typeof ye(t)=="bigint"}function $y(t){return!ye(t)}function Hy(t){return typeof ye(t)=="function"}function Wy(t){return ye(t)===null}function qy(t){const e=ye(t);return typeof e=="object"&&e!==null}function Gy(t){return typeof ye(t)=="string"}function Yy(t){return ye(t)===void 0}function Jy(t,e){return ye(t)===ye(e)}function Ky(t,e){return ye(t)==ye(e)}function Xy(){return se(w.memory)}function Zy(t,e){const n=ye(e),o=typeof n=="number"?n:void 0;R().setFloat64(t+8,Mn(o)?0:o,!0),R().setInt32(t+0,!Mn(o),!0)}function Qy(t){return se(t)}function ex(t){return se(ye(t))}function tx(t){W(t)}function nx(t){throw W(t)}function ox(t,e){const n=ye(e),o=typeof n=="string"?n:void 0;var r=Mn(o)?0:ft(o,w.__wbindgen_export_0,w.__wbindgen_export_1),s=qe;R().setInt32(t+4,s,!0),R().setInt32(t+0,r,!0)}function rx(t,e){return se(At(t,e))}function sx(t,e){throw new Error(At(t,e))}function ix(t){return se(typeof ye(t))}const R5=Object.freeze(Object.defineProperty({__proto__:null,AwarenessWasm:eb,ChangeModifier:ts,Cursor:Gn,EphemeralStoreWasm:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ob.unregister(this),t}free(){const t=this.__destroy_into_raw();w.__wbg_ephemeralstorewasm_free(t,0)}constructor(t){const e=w.ephemeralstorewasm_new(t);return this.__wbg_ptr=e>>>0,ob.register(this,this.__wbg_ptr,this),this}set(t,e){const n=ft(t,w.__wbindgen_export_0,w.__wbindgen_export_1),o=qe;w.ephemeralstorewasm_set(this.__wbg_ptr,n,o,se(e))}delete(t){const e=ft(t,w.__wbindgen_export_0,w.__wbindgen_export_1),n=qe;w.ephemeralstorewasm_delete(this.__wbg_ptr,e,n)}get(t){const e=ft(t,w.__wbindgen_export_0,w.__wbindgen_export_1),n=qe;return W(w.ephemeralstorewasm_get(this.__wbg_ptr,e,n))}getAllStates(){return W(w.ephemeralstorewasm_getAllStates(this.__wbg_ptr))}subscribeLocalUpdates(t){return W(w.ephemeralstorewasm_subscribeLocalUpdates(this.__wbg_ptr,se(t)))}subscribe(t){return W(w.ephemeralstorewasm_subscribe(this.__wbg_ptr,se(t)))}encode(t){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=ft(t,w.__wbindgen_export_0,w.__wbindgen_export_1),i=qe;w.ephemeralstorewasm_encode(r,this.__wbg_ptr,s,i);var e=R().getInt32(r+0,!0),n=R().getInt32(r+4,!0),o=oo(e,n).slice();return w.__wbindgen_export_3(e,1*n,1),o}finally{w.__wbindgen_add_to_stack_pointer(16)}}encodeAll(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.ephemeralstorewasm_encodeAll(o,this.__wbg_ptr);var t=R().getInt32(o+0,!0),e=R().getInt32(o+4,!0),n=oo(t,e).slice();return w.__wbindgen_export_3(t,1*e,1),n}finally{w.__wbindgen_add_to_stack_pointer(16)}}apply(t){const e=Jo(t,w.__wbindgen_export_0),n=qe;w.ephemeralstorewasm_apply(this.__wbg_ptr,e,n)}removeOutdated(){w.ephemeralstorewasm_removeOutdated(this.__wbg_ptr)}isEmpty(){return w.ephemeralstorewasm_isEmpty(this.__wbg_ptr)!==0}keys(){try{const o=w.__wbindgen_add_to_stack_pointer(-16);w.ephemeralstorewasm_keys(o,this.__wbg_ptr);var t=R().getInt32(o+0,!0),e=R().getInt32(o+4,!0),n=On(t,e).slice();return w.__wbindgen_export_3(t,4*e,4),n}finally{w.__wbindgen_add_to_stack_pointer(16)}}},LORO_VERSION:function(){let t,e;try{const r=w.__wbindgen_add_to_stack_pointer(-16);w.LORO_VERSION(r);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);return t=n,e=o,At(n,o)}finally{w.__wbindgen_add_to_stack_pointer(16),w.__wbindgen_export_3(t,e,1)}},LoroCounter:Ei,LoroDoc:bo,LoroList:Ii,LoroMap:Ko,LoroMovableList:Ai,LoroText:Xo,LoroTree:Ti,LoroTreeNode:ro,UndoManager:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,sb.unregister(this),t}free(){const t=this.__destroy_into_raw();w.__wbg_undomanager_free(t,0)}constructor(t,e){es(t,bo);const n=w.undomanager_new(t.__wbg_ptr,se(e));return this.__wbg_ptr=n>>>0,sb.register(this,this.__wbg_ptr,this),this}undo(){try{const n=w.__wbindgen_add_to_stack_pointer(-16);w.undomanager_undo(n,this.__wbg_ptr);var t=R().getInt32(n+0,!0),e=R().getInt32(n+4,!0);if(R().getInt32(n+8,!0))throw W(e);return t!==0}finally{w.__wbindgen_add_to_stack_pointer(16)}}redo(){try{const n=w.__wbindgen_add_to_stack_pointer(-16);w.undomanager_redo(n,this.__wbg_ptr);var t=R().getInt32(n+0,!0),e=R().getInt32(n+4,!0);if(R().getInt32(n+8,!0))throw W(e);return t!==0}finally{w.__wbindgen_add_to_stack_pointer(16)}}canUndo(){return w.undomanager_canUndo(this.__wbg_ptr)!==0}canRedo(){return w.undomanager_canRedo(this.__wbg_ptr)!==0}setMaxUndoSteps(t){w.undomanager_setMaxUndoSteps(this.__wbg_ptr,t)}setMergeInterval(t){w.undomanager_setMergeInterval(this.__wbg_ptr,t)}addExcludeOriginPrefix(t){const e=ft(t,w.__wbindgen_export_0,w.__wbindgen_export_1),n=qe;w.undomanager_addExcludeOriginPrefix(this.__wbg_ptr,e,n)}setOnPush(t){w.undomanager_setOnPush(this.__wbg_ptr,se(t))}setOnPop(t){w.undomanager_setOnPop(this.__wbg_ptr,se(t))}clear(){w.undomanager_clear(this.__wbg_ptr)}},VersionVector:Dn,__wbg_String_8f0eb39a4a4c2f66:ib,__wbg_apply_9bb7fe8fff013a3f:ab,__wbg_buffer_ef9774282e5dab94:lb,__wbg_call_0ad083564791763a:cb,__wbg_call_a34b6b4765f27be0:db,__wbg_call_d00953b926be4879:ub,__wbg_call_efe5a4db7065d1a2:hb,__wbg_changemodifier_new:fb,__wbg_crypto_ed58b8e10a292839:mb,__wbg_cursor_new:pb,__wbg_done_f4c254830a095eaf:gb,__wbg_entries_4dce6361e3ba6fbc:_b,__wbg_entries_83beb641792ccb9c:bb,__wbg_error_7534b8e9a36f1ab4:yb,__wbg_error_9912f7d6d7835a4b:xb,__wbg_from_3aa0fcaa8eef0104:wb,__wbg_getRandomValues_bcb4912f16000dc4:vb,__wbg_get_0c3cc364764a0b98:kb,__wbg_get_b996a12be035ef4f:Sb,__wbg_getindex_a471648b3037c750:Cb,__wbg_getwithrefkey_1dc361bd10053bfe:Nb,__wbg_globalThis_6b4d52a0b6aaeaea:jb,__wbg_global_49324ce12193de77:Eb,__wbg_instanceof_ArrayBuffer_ff40e55b5978e215:Ib,__wbg_instanceof_Map_0f3f3653f757ced1:Ab,__wbg_instanceof_Object_9108547bac1f91b1:Tb,__wbg_instanceof_Uint8Array_db97368f94b1373f:Mb,__wbg_isArray_8738f1062fa88586:Ob,__wbg_isSafeInteger_a1b3e0811faecf2f:Db,__wbg_iterator_c0c688f37fa815e6:Rb,__wbg_length_12246a78d2f65d3a:Pb,__wbg_length_c24da17096edfe57:Lb,__wbg_log_0cc1b7768397bcfe:Fb,__wbg_log_0fd6c49475c7bece:zb,__wbg_log_cb9e190acc5753fb:Bb,__wbg_lorocounter_new:Ub,__wbg_lorolist_new:Vb,__wbg_loromap_new:$b,__wbg_loromovablelist_new:Hb,__wbg_lorotext_new:Wb,__wbg_lorotree_new:qb,__wbg_lorotreenode_new:Gb,__wbg_mark_7438147ce31e9d4b:Yb,__wbg_measure_fb7825c11612c823:Jb,__wbg_msCrypto_0a36e2ec3a343d26:Kb,__wbg_new_518e2184725aa711:Xb,__wbg_new_59845962d1127937:Zb,__wbg_new_67abf4a77618ee3e:Qb,__wbg_new_8a6f238a6ece86ea:ey,__wbg_new_e2d07398d7689006:ty,__wbg_newnoargs_a136448eeb7d48ac:ny,__wbg_newwithbyteoffsetandlength_84908302a4c137cf:oy,__wbg_newwithlength_4c216eaaf23f2f9a:ry,__wbg_newwithlength_88b49de1eb24d63e:sy,__wbg_next_928df8c15fc0c9b0:iy,__wbg_next_9dc0926f351c7090:ay,__wbg_node_02999533c4ea02e3:ly,__wbg_now_3e8577e703add0ba:cy,__wbg_ownKeys_b16312a839a4152c:dy,__wbg_process_5c1d670bc53614b8:uy,__wbg_push_e7d7247e69dad3ee:hy,__wbg_randomFillSync_ab2cfe79ebbf2740:fy,__wbg_require_79b1e9274cde3c87:my,__wbg_resolve_267ff08e7e1d2ce4:py,__wbg_self_cca3ca60d61220f4:gy,__wbg_set_1b50d2de855a9d50:_y,__wbg_set_393f510a6b7e9da5:by,__wbg_set_3f1d0b984ed272ed:yy,__wbg_set_5deee49b10b2b780:xy,__wbg_set_93ba9407b5476ec6:wy,__wbg_set_wasm:wu,__wbg_setindex_e0b7b31bfc87ba3f:vy,__wbg_stack_0ed75d68575b0f3c:ky,__wbg_subarray_2dc34705c0dc7cdb:Sy,__wbg_then_84907e7a6730461e:Cy,__wbg_value_51f8a88d4a1805fb:Ny,__wbg_versions_c71aa1626a93e0a1:jy,__wbg_versionvector_new:Ey,__wbg_window_2aba046d3fc4ad7c:Iy,__wbindgen_as_number:Ay,__wbindgen_bigint_from_i64:Ty,__wbindgen_bigint_from_u64:My,__wbindgen_bigint_get_as_i64:Oy,__wbindgen_boolean_get:Dy,__wbindgen_cb_drop:Ry,__wbindgen_closure_wrapper483:Py,__wbindgen_closure_wrapper486:Ly,__wbindgen_debug_string:Fy,__wbindgen_error_new:zy,__wbindgen_in:By,__wbindgen_is_array:Uy,__wbindgen_is_bigint:Vy,__wbindgen_is_falsy:$y,__wbindgen_is_function:Hy,__wbindgen_is_null:Wy,__wbindgen_is_object:qy,__wbindgen_is_string:Gy,__wbindgen_is_undefined:Yy,__wbindgen_jsval_eq:Jy,__wbindgen_jsval_loose_eq:Ky,__wbindgen_memory:Xy,__wbindgen_number_get:Zy,__wbindgen_number_new:Qy,__wbindgen_object_clone_ref:ex,__wbindgen_object_drop_ref:tx,__wbindgen_rethrow:nx,__wbindgen_string_get:ox,__wbindgen_string_new:rx,__wbindgen_throw:sx,__wbindgen_typeof:ix,decodeFrontiers:function(t){try{const o=w.__wbindgen_add_to_stack_pointer(-16),r=Jo(t,w.__wbindgen_export_0),s=qe;w.decodeFrontiers(o,r,s);var e=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(R().getInt32(o+8,!0))throw W(n);return W(e)}finally{w.__wbindgen_add_to_stack_pointer(16)}},decodeImportBlobMeta:function(t,e){try{const r=w.__wbindgen_add_to_stack_pointer(-16),s=Jo(t,w.__wbindgen_export_0),i=qe;w.decodeImportBlobMeta(r,s,i,e);var n=R().getInt32(r+0,!0),o=R().getInt32(r+4,!0);if(R().getInt32(r+8,!0))throw W(o);return W(n)}finally{w.__wbindgen_add_to_stack_pointer(16)}},encodeFrontiers:function(t){try{const s=w.__wbindgen_add_to_stack_pointer(-16),i=wn(t,w.__wbindgen_export_0),a=qe;w.encodeFrontiers(s,i,a);var e=R().getInt32(s+0,!0),n=R().getInt32(s+4,!0),o=R().getInt32(s+8,!0);if(R().getInt32(s+12,!0))throw W(o);var r=oo(e,n).slice();return w.__wbindgen_export_3(e,1*n,1),r}finally{w.__wbindgen_add_to_stack_pointer(16)}},run:function(){w.run()},setDebug:function(){w.setDebug()}},Symbol.toStringTag,{value:"Module"}));URL=globalThis.URL;const U=await(async(t={},e)=>{let n;if(e.startsWith("data:")){const o=e.replace(/^data:.*?base64,/,"");let r;if(typeof Buffer=="function"&&typeof Buffer.from=="function")r=Buffer.from(o,"base64");else{if(typeof atob!="function")throw new Error("Cannot decode base64-encoded data URL");{const s=atob(o);r=new Uint8Array(s.length);for(let i=0;i<s.length;i++)r[i]=s.charCodeAt(i)}}n=await WebAssembly.instantiate(r,t)}else{const o=await fetch(e),r=o.headers.get("Content-Type")||"";if("instantiateStreaming"in WebAssembly&&r.startsWith("application/wasm"))n=await WebAssembly.instantiateStreaming(o,t);else{const s=await o.arrayBuffer();n=await WebAssembly.instantiate(s,t)}}return n.instance.exports})({"./loro_wasm_bg.js":{__wbindgen_object_drop_ref:tx,__wbg_lorotree_new:qb,__wbg_lorocounter_new:Ub,__wbg_loromovablelist_new:Hb,__wbg_lorotreenode_new:Gb,__wbg_cursor_new:pb,__wbg_lorolist_new:Vb,__wbg_lorotext_new:Wb,__wbg_loromap_new:$b,__wbg_versionvector_new:Ey,__wbg_changemodifier_new:fb,__wbindgen_is_function:Hy,__wbindgen_string_new:rx,__wbindgen_boolean_get:Dy,__wbindgen_error_new:zy,__wbindgen_object_clone_ref:ex,__wbindgen_string_get:ox,__wbindgen_is_undefined:Yy,__wbindgen_in:By,__wbindgen_is_bigint:Vy,__wbindgen_number_get:Zy,__wbindgen_bigint_from_i64:Ty,__wbindgen_jsval_eq:Jy,__wbindgen_is_object:qy,__wbindgen_bigint_from_u64:My,__wbindgen_cb_drop:Ry,__wbindgen_as_number:Ay,__wbindgen_is_string:Gy,__wbindgen_is_null:Wy,__wbindgen_number_new:Qy,__wbindgen_is_array:Uy,__wbindgen_typeof:ix,__wbg_error_9912f7d6d7835a4b:xb,__wbg_log_0fd6c49475c7bece:zb,__wbindgen_is_falsy:$y,__wbindgen_jsval_loose_eq:Ky,__wbg_String_8f0eb39a4a4c2f66:ib,__wbg_getwithrefkey_1dc361bd10053bfe:Nb,__wbg_set_3f1d0b984ed272ed:yy,__wbg_log_cb9e190acc5753fb:Bb,__wbg_log_0cc1b7768397bcfe:Fb,__wbg_mark_7438147ce31e9d4b:Yb,__wbg_measure_fb7825c11612c823:Jb,__wbg_new_8a6f238a6ece86ea:ey,__wbg_stack_0ed75d68575b0f3c:ky,__wbg_error_7534b8e9a36f1ab4:yb,__wbg_now_3e8577e703add0ba:cy,__wbg_crypto_ed58b8e10a292839:mb,__wbg_process_5c1d670bc53614b8:uy,__wbg_versions_c71aa1626a93e0a1:jy,__wbg_node_02999533c4ea02e3:ly,__wbg_require_79b1e9274cde3c87:my,__wbg_msCrypto_0a36e2ec3a343d26:Kb,__wbg_randomFillSync_ab2cfe79ebbf2740:fy,__wbg_getRandomValues_bcb4912f16000dc4:vb,__wbg_self_cca3ca60d61220f4:gy,__wbg_window_2aba046d3fc4ad7c:Iy,__wbg_globalThis_6b4d52a0b6aaeaea:jb,__wbg_global_49324ce12193de77:Eb,__wbg_newnoargs_a136448eeb7d48ac:ny,__wbg_call_0ad083564791763a:cb,__wbg_get_0c3cc364764a0b98:kb,__wbg_length_12246a78d2f65d3a:Pb,__wbg_new_e2d07398d7689006:ty,__wbg_new_518e2184725aa711:Xb,__wbg_next_928df8c15fc0c9b0:iy,__wbg_next_9dc0926f351c7090:ay,__wbg_done_f4c254830a095eaf:gb,__wbg_value_51f8a88d4a1805fb:Ny,__wbg_iterator_c0c688f37fa815e6:Rb,__wbg_get_b996a12be035ef4f:Sb,__wbg_new_67abf4a77618ee3e:Qb,__wbg_newwithlength_88b49de1eb24d63e:sy,__wbg_set_93ba9407b5476ec6:wy,__wbg_from_3aa0fcaa8eef0104:wb,__wbg_isArray_8738f1062fa88586:Ob,__wbg_push_e7d7247e69dad3ee:hy,__wbg_instanceof_ArrayBuffer_ff40e55b5978e215:Ib,__wbg_call_a34b6b4765f27be0:db,__wbg_call_efe5a4db7065d1a2:hb,__wbg_call_d00953b926be4879:ub,__wbg_instanceof_Map_0f3f3653f757ced1:Ab,__wbg_set_393f510a6b7e9da5:by,__wbg_entries_4dce6361e3ba6fbc:_b,__wbg_isSafeInteger_a1b3e0811faecf2f:Db,__wbg_instanceof_Object_9108547bac1f91b1:Tb,__wbg_entries_83beb641792ccb9c:bb,__wbg_apply_9bb7fe8fff013a3f:ab,__wbg_ownKeys_b16312a839a4152c:dy,__wbg_set_1b50d2de855a9d50:_y,__wbg_buffer_ef9774282e5dab94:lb,__wbg_resolve_267ff08e7e1d2ce4:py,__wbg_then_84907e7a6730461e:Cy,__wbg_newwithbyteoffsetandlength_84908302a4c137cf:oy,__wbg_new_59845962d1127937:Zb,__wbg_set_5deee49b10b2b780:xy,__wbg_length_c24da17096edfe57:Lb,__wbg_instanceof_Uint8Array_db97368f94b1373f:Mb,__wbg_newwithlength_4c216eaaf23f2f9a:ry,__wbg_subarray_2dc34705c0dc7cdb:Sy,__wbg_getindex_a471648b3037c750:Cb,__wbg_setindex_e0b7b31bfc87ba3f:vy,__wbindgen_bigint_get_as_i64:Oy,__wbindgen_debug_string:Fy,__wbindgen_throw:sx,__wbindgen_rethrow:nx,__wbindgen_memory:Xy,__wbindgen_closure_wrapper483:Py,__wbindgen_closure_wrapper486:Ly}},T5),P5=U.memory,L5=U.__wbg_lorocounter_free,F5=U.lorocounter_new,z5=U.lorocounter_kind,B5=U.lorocounter_id,U5=U.lorocounter_increment,V5=U.lorocounter_decrement,$5=U.lorocounter_value,H5=U.lorocounter_subscribe,W5=U.lorocounter_parent,q5=U.lorocounter_isAttached,G5=U.lorocounter_getAttached,Y5=U.lorocounter_getShallowValue,J5=U.__wbg_awarenesswasm_free,K5=U.awarenesswasm_new,X5=U.awarenesswasm_encode,Z5=U.awarenesswasm_encodeAll,Q5=U.awarenesswasm_apply,e6=U.awarenesswasm_setLocalState,t6=U.awarenesswasm_peer,n6=U.awarenesswasm_getAllStates,o6=U.awarenesswasm_getState,r6=U.awarenesswasm_getTimestamp,s6=U.awarenesswasm_removeOutdated,i6=U.awarenesswasm_length,a6=U.awarenesswasm_isEmpty,l6=U.awarenesswasm_peers,c6=U.__wbg_ephemeralstorewasm_free,d6=U.ephemeralstorewasm_new,u6=U.ephemeralstorewasm_set,h6=U.ephemeralstorewasm_delete,f6=U.ephemeralstorewasm_get,m6=U.ephemeralstorewasm_getAllStates,p6=U.ephemeralstorewasm_subscribeLocalUpdates,g6=U.ephemeralstorewasm_subscribe,_6=U.ephemeralstorewasm_encode,b6=U.ephemeralstorewasm_encodeAll,y6=U.ephemeralstorewasm_apply,x6=U.ephemeralstorewasm_removeOutdated,w6=U.ephemeralstorewasm_isEmpty,v6=U.ephemeralstorewasm_keys,k6=U.LORO_VERSION,S6=U.run,C6=U.encodeFrontiers,N6=U.decodeFrontiers,j6=U.setDebug,E6=U.__wbg_lorodoc_free,I6=U.lorodoc_new,A6=U.lorodoc_setDetachedEditing,T6=U.lorodoc_isDetachedEditingEnabled,M6=U.lorodoc_setRecordTimestamp,O6=U.lorodoc_setChangeMergeInterval,D6=U.lorodoc_configTextStyle,R6=U.lorodoc_configDefaultTextStyle,P6=U.lorodoc_fromSnapshot,L6=U.lorodoc_attach,F6=U.lorodoc_isDetached,z6=U.lorodoc_detach,B6=U.lorodoc_fork,U6=U.lorodoc_forkAt,V6=U.lorodoc_checkoutToLatest,$6=U.lorodoc_travelChangeAncestors,H6=U.lorodoc_findIdSpansBetween,W6=U.lorodoc_checkout,q6=U.lorodoc_peerId,G6=U.lorodoc_peerIdStr,Y6=U.lorodoc_setPeerId,J6=U.lorodoc_commit,K6=U.lorodoc_getPendingTxnLength,X6=U.lorodoc_getText,Z6=U.lorodoc_getMap,Q6=U.lorodoc_getList,eI=U.lorodoc_getMovableList,tI=U.lorodoc_getCounter,nI=U.lorodoc_getTree,oI=U.lorodoc_hasContainer,rI=U.lorodoc_getContainerById,sI=U.lorodoc_setNextCommitMessage,iI=U.lorodoc_setNextCommitOrigin,aI=U.lorodoc_setNextCommitTimestamp,lI=U.lorodoc_setNextCommitOptions,cI=U.lorodoc_clearNextCommitOptions,dI=U.lorodoc_getDeepValueWithID,uI=U.lorodoc_getPathToContainer,hI=U.lorodoc_JSONPath,fI=U.lorodoc_version,mI=U.lorodoc_shallowSinceVV,pI=U.lorodoc_isShallow,gI=U.lorodoc_shallowSinceFrontiers,_I=U.lorodoc_oplogVersion,bI=U.lorodoc_frontiers,yI=U.lorodoc_oplogFrontiers,xI=U.lorodoc_cmpWithFrontiers,wI=U.lorodoc_cmpFrontiers,vI=U.lorodoc_exportSnapshot,kI=U.lorodoc_exportFrom,SI=U.lorodoc_export,CI=U.lorodoc_exportJsonUpdates,NI=U.lorodoc_exportJsonInIdSpan,jI=U.lorodoc_importJsonUpdates,EI=U.lorodoc_import,II=U.lorodoc_importBatch,AI=U.lorodoc_getShallowValue,TI=U.lorodoc_toJSON,MI=U.lorodoc_subscribe,OI=U.lorodoc_subscribeLocalUpdates,DI=U.lorodoc_debugHistory,RI=U.lorodoc_changeCount,PI=U.lorodoc_opCount,LI=U.lorodoc_getAllChanges,FI=U.lorodoc_getChangeAt,zI=U.lorodoc_getChangeAtLamport,BI=U.lorodoc_getOpsInChange,UI=U.lorodoc_frontiersToVV,VI=U.lorodoc_vvToFrontiers,$I=U.lorodoc_getByPath,HI=U.lorodoc_getCursorPos,WI=U.lorodoc_getChangedContainersIn,qI=U.lorodoc_revertTo,GI=U.lorodoc_applyDiff,YI=U.lorodoc_diff,JI=U.lorodoc_getUncommittedOpsAsJson,KI=U.lorodoc_subscribeFirstCommitFromPeer,XI=U.lorodoc_subscribePreCommit,ZI=U.lorodoc_deleteRootContainer,QI=U.lorodoc_setHideEmptyRootContainers,e8=U.__wbg_lorotext_free,t8=U.lorotext_new,n8=U.lorotext_kind,o8=U.lorotext_iter,r8=U.lorotext_update,s8=U.lorotext_updateByLine,i8=U.lorotext_insert,a8=U.lorotext_slice,l8=U.lorotext_charAt,c8=U.lorotext_splice,d8=U.lorotext_insertUtf8,u8=U.lorotext_delete,h8=U.lorotext_deleteUtf8,f8=U.lorotext_mark,m8=U.lorotext_unmark,p8=U.lorotext_toString,g8=U.lorotext_toDelta,_8=U.lorotext_id,b8=U.lorotext_length,y8=U.lorotext_subscribe,x8=U.lorotext_applyDelta,w8=U.lorotext_parent,v8=U.lorotext_isAttached,k8=U.lorotext_getAttached,S8=U.lorotext_getCursor,C8=U.lorotext_push,N8=U.lorotext_getEditorOf,j8=U.lorotext_isDeleted,E8=U.lorotext_getShallowValue,I8=U.lorotext_toJSON,A8=U.__wbg_loromap_free,T8=U.loromap_new,M8=U.loromap_kind,O8=U.loromap_set,D8=U.loromap_delete,R8=U.loromap_get,P8=U.loromap_getOrCreateContainer,L8=U.loromap_keys,F8=U.loromap_values,z8=U.loromap_entries,B8=U.loromap_id,U8=U.loromap_toJSON,V8=U.loromap_setContainer,$8=U.loromap_subscribe,H8=U.loromap_size,W8=U.loromap_parent,q8=U.loromap_isAttached,G8=U.loromap_getAttached,Y8=U.loromap_clear,J8=U.loromap_getLastEditor,K8=U.loromap_isDeleted,X8=U.loromap_getShallowValue,Z8=U.__wbg_lorolist_free,Q8=U.lorolist_new,eA=U.lorolist_kind,tA=U.lorolist_insert,nA=U.lorolist_delete,oA=U.lorolist_get,rA=U.lorolist_id,sA=U.lorolist_toArray,iA=U.lorolist_toJSON,aA=U.lorolist_insertContainer,lA=U.lorolist_pushContainer,cA=U.lorolist_subscribe,dA=U.lorolist_length,uA=U.lorolist_parent,hA=U.lorolist_isAttached,fA=U.lorolist_getAttached,mA=U.lorolist_getCursor,pA=U.lorolist_push,gA=U.lorolist_pop,_A=U.lorolist_clear,bA=U.lorolist_getIdAt,yA=U.lorolist_isDeleted,xA=U.lorolist_getShallowValue,wA=U.loromovablelist_new,vA=U.loromovablelist_kind,kA=U.loromovablelist_insert,SA=U.loromovablelist_delete,CA=U.loromovablelist_get,NA=U.loromovablelist_id,jA=U.loromovablelist_toArray,EA=U.loromovablelist_toJSON,IA=U.loromovablelist_insertContainer,AA=U.loromovablelist_pushContainer,TA=U.loromovablelist_subscribe,MA=U.loromovablelist_length,OA=U.loromovablelist_parent,DA=U.loromovablelist_isAttached,RA=U.loromovablelist_getAttached,PA=U.loromovablelist_getCursor,LA=U.loromovablelist_move,FA=U.loromovablelist_set,zA=U.loromovablelist_setContainer,BA=U.loromovablelist_push,UA=U.loromovablelist_pop,VA=U.loromovablelist_clear,$A=U.loromovablelist_getCreatorAt,HA=U.loromovablelist_getLastMoverAt,WA=U.loromovablelist_getLastEditorAt,qA=U.loromovablelist_isDeleted,GA=U.loromovablelist_getShallowValue,YA=U.__wbg_lorotree_free,JA=U.lorotreenode___getClassname,KA=U.__wbg_lorotreenode_free,XA=U.lorotreenode_id,ZA=U.lorotreenode_createNode,QA=U.lorotreenode_move,eT=U.lorotreenode_moveAfter,tT=U.lorotreenode_moveBefore,nT=U.lorotreenode_index,oT=U.lorotreenode_fractionalIndex,rT=U.lorotreenode_data,sT=U.lorotreenode_toJSON,iT=U.lorotreenode_parent,aT=U.lorotreenode_children,lT=U.lorotreenode_isDeleted,cT=U.lorotreenode_getLastMoveId,dT=U.lorotreenode_creationId,uT=U.lorotreenode_creator,hT=U.lorotree_new,fT=U.lorotree_kind,mT=U.lorotree_createNode,pT=U.lorotree_move,gT=U.lorotree_delete,_T=U.lorotree_getNodeByID,bT=U.lorotree_id,yT=U.lorotree_has,xT=U.lorotree_isNodeDeleted,wT=U.lorotree_toArray,vT=U.lorotree_getNodes,kT=U.lorotree_toJSON,ST=U.lorotree_nodes,CT=U.lorotree_roots,NT=U.lorotree_subscribe,jT=U.lorotree_parent,ET=U.lorotree_isAttached,IT=U.lorotree_getAttached,AT=U.lorotree_enableFractionalIndex,TT=U.lorotree_disableFractionalIndex,MT=U.lorotree_isFractionalIndexEnabled,OT=U.lorotree_isDeleted,DT=U.lorotree_getShallowValue,RT=U.__wbg_cursor_free,PT=U.cursor_containerId,LT=U.cursor_pos,FT=U.cursor_side,zT=U.cursor_encode,BT=U.cursor_decode,UT=U.cursor_kind,VT=U.__wbg_undomanager_free,$T=U.undomanager_new,HT=U.undomanager_undo,WT=U.undomanager_redo,qT=U.undomanager_canUndo,GT=U.undomanager_canRedo,YT=U.undomanager_setMaxUndoSteps,JT=U.undomanager_setMergeInterval,KT=U.undomanager_addExcludeOriginPrefix,XT=U.undomanager_setOnPush,ZT=U.undomanager_setOnPop,QT=U.undomanager_clear,e7=U.__wbg_versionvector_free,t7=U.versionvector_new,n7=U.versionvector_parseJSON,o7=U.versionvector_toJSON,r7=U.versionvector_encode,s7=U.versionvector_decode,i7=U.versionvector_get,a7=U.versionvector_compare,l7=U.versionvector_setEnd,c7=U.versionvector_setLast,d7=U.versionvector_remove,u7=U.versionvector_length,h7=U.decodeImportBlobMeta,f7=U.__wbg_changemodifier_free,m7=U.changemodifier_setMessage,p7=U.changemodifier_setTimestamp,g7=U.lorodoc_importUpdateBatch,_7=U.__wbg_loromovablelist_free,b7=U.__wbindgen_export_0,y7=U.__wbindgen_export_1,x7=U.__wbindgen_export_2,w7=U.__wbindgen_export_3,v7=U.__wbindgen_export_4,k7=U.__wbindgen_add_to_stack_pointer,S7=U.__wbindgen_export_5,C7=U.__wbindgen_export_6,Tu=U.__wbindgen_start,ax=Object.freeze(Object.defineProperty({__proto__:null,LORO_VERSION:k6,__wbg_awarenesswasm_free:J5,__wbg_changemodifier_free:f7,__wbg_cursor_free:RT,__wbg_ephemeralstorewasm_free:c6,__wbg_lorocounter_free:L5,__wbg_lorodoc_free:E6,__wbg_lorolist_free:Z8,__wbg_loromap_free:A8,__wbg_loromovablelist_free:_7,__wbg_lorotext_free:e8,__wbg_lorotree_free:YA,__wbg_lorotreenode_free:KA,__wbg_undomanager_free:VT,__wbg_versionvector_free:e7,__wbindgen_add_to_stack_pointer:k7,__wbindgen_export_0:b7,__wbindgen_export_1:y7,__wbindgen_export_2:x7,__wbindgen_export_3:w7,__wbindgen_export_4:v7,__wbindgen_export_5:S7,__wbindgen_export_6:C7,__wbindgen_start:Tu,awarenesswasm_apply:Q5,awarenesswasm_encode:X5,awarenesswasm_encodeAll:Z5,awarenesswasm_getAllStates:n6,awarenesswasm_getState:o6,awarenesswasm_getTimestamp:r6,awarenesswasm_isEmpty:a6,awarenesswasm_length:i6,awarenesswasm_new:K5,awarenesswasm_peer:t6,awarenesswasm_peers:l6,awarenesswasm_removeOutdated:s6,awarenesswasm_setLocalState:e6,changemodifier_setMessage:m7,changemodifier_setTimestamp:p7,cursor_containerId:PT,cursor_decode:BT,cursor_encode:zT,cursor_kind:UT,cursor_pos:LT,cursor_side:FT,decodeFrontiers:N6,decodeImportBlobMeta:h7,encodeFrontiers:C6,ephemeralstorewasm_apply:y6,ephemeralstorewasm_delete:h6,ephemeralstorewasm_encode:_6,ephemeralstorewasm_encodeAll:b6,ephemeralstorewasm_get:f6,ephemeralstorewasm_getAllStates:m6,ephemeralstorewasm_isEmpty:w6,ephemeralstorewasm_keys:v6,ephemeralstorewasm_new:d6,ephemeralstorewasm_removeOutdated:x6,ephemeralstorewasm_set:u6,ephemeralstorewasm_subscribe:g6,ephemeralstorewasm_subscribeLocalUpdates:p6,lorocounter_decrement:V5,lorocounter_getAttached:G5,lorocounter_getShallowValue:Y5,lorocounter_id:B5,lorocounter_increment:U5,lorocounter_isAttached:q5,lorocounter_kind:z5,lorocounter_new:F5,lorocounter_parent:W5,lorocounter_subscribe:H5,lorocounter_value:$5,lorodoc_JSONPath:hI,lorodoc_applyDiff:GI,lorodoc_attach:L6,lorodoc_changeCount:RI,lorodoc_checkout:W6,lorodoc_checkoutToLatest:V6,lorodoc_clearNextCommitOptions:cI,lorodoc_cmpFrontiers:wI,lorodoc_cmpWithFrontiers:xI,lorodoc_commit:J6,lorodoc_configDefaultTextStyle:R6,lorodoc_configTextStyle:D6,lorodoc_debugHistory:DI,lorodoc_deleteRootContainer:ZI,lorodoc_detach:z6,lorodoc_diff:YI,lorodoc_export:SI,lorodoc_exportFrom:kI,lorodoc_exportJsonInIdSpan:NI,lorodoc_exportJsonUpdates:CI,lorodoc_exportSnapshot:vI,lorodoc_findIdSpansBetween:H6,lorodoc_fork:B6,lorodoc_forkAt:U6,lorodoc_fromSnapshot:P6,lorodoc_frontiers:bI,lorodoc_frontiersToVV:UI,lorodoc_getAllChanges:LI,lorodoc_getByPath:$I,lorodoc_getChangeAt:FI,lorodoc_getChangeAtLamport:zI,lorodoc_getChangedContainersIn:WI,lorodoc_getContainerById:rI,lorodoc_getCounter:tI,lorodoc_getCursorPos:HI,lorodoc_getDeepValueWithID:dI,lorodoc_getList:Q6,lorodoc_getMap:Z6,lorodoc_getMovableList:eI,lorodoc_getOpsInChange:BI,lorodoc_getPathToContainer:uI,lorodoc_getPendingTxnLength:K6,lorodoc_getShallowValue:AI,lorodoc_getText:X6,lorodoc_getTree:nI,lorodoc_getUncommittedOpsAsJson:JI,lorodoc_hasContainer:oI,lorodoc_import:EI,lorodoc_importBatch:II,lorodoc_importJsonUpdates:jI,lorodoc_importUpdateBatch:g7,lorodoc_isDetached:F6,lorodoc_isDetachedEditingEnabled:T6,lorodoc_isShallow:pI,lorodoc_new:I6,lorodoc_opCount:PI,lorodoc_oplogFrontiers:yI,lorodoc_oplogVersion:_I,lorodoc_peerId:q6,lorodoc_peerIdStr:G6,lorodoc_revertTo:qI,lorodoc_setChangeMergeInterval:O6,lorodoc_setDetachedEditing:A6,lorodoc_setHideEmptyRootContainers:QI,lorodoc_setNextCommitMessage:sI,lorodoc_setNextCommitOptions:lI,lorodoc_setNextCommitOrigin:iI,lorodoc_setNextCommitTimestamp:aI,lorodoc_setPeerId:Y6,lorodoc_setRecordTimestamp:M6,lorodoc_shallowSinceFrontiers:gI,lorodoc_shallowSinceVV:mI,lorodoc_subscribe:MI,lorodoc_subscribeFirstCommitFromPeer:KI,lorodoc_subscribeLocalUpdates:OI,lorodoc_subscribePreCommit:XI,lorodoc_toJSON:TI,lorodoc_travelChangeAncestors:$6,lorodoc_version:fI,lorodoc_vvToFrontiers:VI,lorolist_clear:_A,lorolist_delete:nA,lorolist_get:oA,lorolist_getAttached:fA,lorolist_getCursor:mA,lorolist_getIdAt:bA,lorolist_getShallowValue:xA,lorolist_id:rA,lorolist_insert:tA,lorolist_insertContainer:aA,lorolist_isAttached:hA,lorolist_isDeleted:yA,lorolist_kind:eA,lorolist_length:dA,lorolist_new:Q8,lorolist_parent:uA,lorolist_pop:gA,lorolist_push:pA,lorolist_pushContainer:lA,lorolist_subscribe:cA,lorolist_toArray:sA,lorolist_toJSON:iA,loromap_clear:Y8,loromap_delete:D8,loromap_entries:z8,loromap_get:R8,loromap_getAttached:G8,loromap_getLastEditor:J8,loromap_getOrCreateContainer:P8,loromap_getShallowValue:X8,loromap_id:B8,loromap_isAttached:q8,loromap_isDeleted:K8,loromap_keys:L8,loromap_kind:M8,loromap_new:T8,loromap_parent:W8,loromap_set:O8,loromap_setContainer:V8,loromap_size:H8,loromap_subscribe:$8,loromap_toJSON:U8,loromap_values:F8,loromovablelist_clear:VA,loromovablelist_delete:SA,loromovablelist_get:CA,loromovablelist_getAttached:RA,loromovablelist_getCreatorAt:$A,loromovablelist_getCursor:PA,loromovablelist_getLastEditorAt:WA,loromovablelist_getLastMoverAt:HA,loromovablelist_getShallowValue:GA,loromovablelist_id:NA,loromovablelist_insert:kA,loromovablelist_insertContainer:IA,loromovablelist_isAttached:DA,loromovablelist_isDeleted:qA,loromovablelist_kind:vA,loromovablelist_length:MA,loromovablelist_move:LA,loromovablelist_new:wA,loromovablelist_parent:OA,loromovablelist_pop:UA,loromovablelist_push:BA,loromovablelist_pushContainer:AA,loromovablelist_set:FA,loromovablelist_setContainer:zA,loromovablelist_subscribe:TA,loromovablelist_toArray:jA,loromovablelist_toJSON:EA,lorotext_applyDelta:x8,lorotext_charAt:l8,lorotext_delete:u8,lorotext_deleteUtf8:h8,lorotext_getAttached:k8,lorotext_getCursor:S8,lorotext_getEditorOf:N8,lorotext_getShallowValue:E8,lorotext_id:_8,lorotext_insert:i8,lorotext_insertUtf8:d8,lorotext_isAttached:v8,lorotext_isDeleted:j8,lorotext_iter:o8,lorotext_kind:n8,lorotext_length:b8,lorotext_mark:f8,lorotext_new:t8,lorotext_parent:w8,lorotext_push:C8,lorotext_slice:a8,lorotext_splice:c8,lorotext_subscribe:y8,lorotext_toDelta:g8,lorotext_toJSON:I8,lorotext_toString:p8,lorotext_unmark:m8,lorotext_update:r8,lorotext_updateByLine:s8,lorotree_createNode:mT,lorotree_delete:gT,lorotree_disableFractionalIndex:TT,lorotree_enableFractionalIndex:AT,lorotree_getAttached:IT,lorotree_getNodeByID:_T,lorotree_getNodes:vT,lorotree_getShallowValue:DT,lorotree_has:yT,lorotree_id:bT,lorotree_isAttached:ET,lorotree_isDeleted:OT,lorotree_isFractionalIndexEnabled:MT,lorotree_isNodeDeleted:xT,lorotree_kind:fT,lorotree_move:pT,lorotree_new:hT,lorotree_nodes:ST,lorotree_parent:jT,lorotree_roots:CT,lorotree_subscribe:NT,lorotree_toArray:wT,lorotree_toJSON:kT,lorotreenode___getClassname:JA,lorotreenode_children:aT,lorotreenode_createNode:ZA,lorotreenode_creationId:dT,lorotreenode_creator:uT,lorotreenode_data:rT,lorotreenode_fractionalIndex:oT,lorotreenode_getLastMoveId:cT,lorotreenode_id:XA,lorotreenode_index:nT,lorotreenode_isDeleted:lT,lorotreenode_move:QA,lorotreenode_moveAfter:eT,lorotreenode_moveBefore:tT,lorotreenode_parent:iT,lorotreenode_toJSON:sT,memory:P5,run:S6,setDebug:j6,undomanager_addExcludeOriginPrefix:KT,undomanager_canRedo:GT,undomanager_canUndo:qT,undomanager_clear:QT,undomanager_new:$T,undomanager_redo:WT,undomanager_setMaxUndoSteps:YT,undomanager_setMergeInterval:JT,undomanager_setOnPop:ZT,undomanager_setOnPush:XT,undomanager_undo:HT,versionvector_compare:a7,versionvector_decode:s7,versionvector_encode:r7,versionvector_get:i7,versionvector_length:u7,versionvector_new:t7,versionvector_parseJSON:n7,versionvector_remove:d7,versionvector_setEnd:l7,versionvector_setLast:c7,versionvector_toJSON:o7},Symbol.toStringTag,{value:"Module"}));if(Tu)wu(ax),Tu();else{const t=await Mm(()=>Promise.resolve().then(()=>ax),void 0,import.meta.url);wu(new WebAssembly.Instance(t.default,{"./loro_wasm_bg.js":R5}).exports)}const N7=["Map","Text","List","Tree","MovableList","Counter"];function lx(t){if(typeof t!="object"||t==null)return!1;const e=Object.getPrototypeOf(t);return e!=null&&typeof e=="object"&&typeof e.kind=="function"&&N7.includes(t.kind())}bo.prototype.toJsonWithReplacer=function(t){const e=new Set,n=this,o=(i,a)=>{if(typeof a=="string"&&a.startsWith("cid:")&&!e.has(a)){e.add(a);const c=n.getContainerById(a);if(c==null)throw new Error(`ContainerID not found: ${a}`);const d=t(i,c);if(d===c){const u=c.getShallowValue();return typeof u=="object"?r(u):u}if(lx(d))throw new Error("Using new container is not allowed in toJsonWithReplacer");return typeof d=="object"&&d!=null?r(d):d}if(typeof a=="object"&&a!=null)return r(a);const l=t(i,a);if(lx(l))throw new Error("Using new container is not allowed in toJsonWithReplacer");return l},r=i=>{if(Array.isArray(i))return i.map((l,c)=>o(c,l)).filter(l=>l!==void 0);const a={};for(const[l,c]of Object.entries(i)){const d=o(l,c);d!==void 0&&(a[l]=d)}return a},s=n.getShallowValue();return r(s)};const j7=(t,e,n)=>Zn.define(o=>new E7(o,t,e,n)),ns=xm.define();class E7{constructor(e,n,o,r){this.view=e,this.doc=n,this.docPath=o,this.getTextFromDoc=r,this.sub=void 0,this.isInitDispatch=!1,this.onRemoteUpdate=s=>{if(s.by!=="local")if(s.by!=="checkout"){if(s.by==="import"){const i=[];let a=0;for(const{diff:l,path:c}of s.events){if(c.join("/")!==this.docPath.join("/")||l.type!=="text")continue;const d=l.diff;for(const u of d)u.insert?i.push({from:a,to:a,insert:u.insert}):u.delete?(i.push({from:a,to:a+u.delete}),a+=u.delete):u.retain!=null&&(a+=u.retain);i.length>0&&this.view.dispatch({changes:i,annotations:[ns.of(this)]})}}}else this.view.dispatch({changes:[{from:0,to:this.view.state.doc.length,insert:this.getTextFromDoc(this.doc).toString()}],annotations:[ns.of(this)]})},this.sub=n.subscribe(this.onRemoteUpdate),Promise.resolve().then(()=>{this.isInitDispatch=!0;const s=this.view.state.doc.toString(),i=this.getTextFromDoc(this.doc);s!==i.toString()&&e.dispatch({changes:[{from:0,to:this.view.state.doc.length,insert:i.toString()}]})})}update(e){if(this.isInitDispatch)return void(this.isInitDispatch=!1);if(!e.docChanged||e.transactions.length>0&&(e.transactions[0].annotation(ns)===this||e.transactions[0].annotation(ns)==="undo"))return;let n=0;e.changes.iterChanges((o,r,s,i,a)=>{const l=a.sliceString(0,a.length,`
112
- `);o!==r&&this.getTextFromDoc(this.doc).delete(o+n,r-o),l.length>0&&this.getTextFromDoc(this.doc).insert(o+n,l),n+=l.length-(r-o)}),this.doc.commit()}destroy(){var e;(e=this.sub)==null||e.call(this),this.sub=void 0}}const I7=st.baseTheme({".loro-cursor":{position:"absolute",width:"2px",display:"inline-block",height:"1.2em"},".loro-cursor::before":{position:"absolute",top:"1.3em",left:"0",content:"var(--rtc-name)",padding:"2px 6px",fontSize:"12px",borderRadius:"3px",whiteSpace:"nowrap",userSelect:"none",backgroundColor:"inherit",opacity:"0.7"},".loro-selection":{opacity:"0.5"}}),Mi=Ut.define(),Mu=En.define({create:()=>({remoteCursors:new Map,isCheckout:!1}),update(t,e){for(const n of e.effects)if(n.is(Mi))switch(n.value.type){case"update":{const{peer:o,user:r,cursor:s}=n.value;t.remoteCursors.set(o,{uid:o,cursor:s,user:r});break}case"delete":t.remoteCursors.delete(n.value.peer);break;case"checkout":t.isCheckout=n.value.checkout}return t}}),cx=t=>{const e=t.transactions.flatMap(n=>n.effects).filter(n=>n.is(Mi));return t.docChanged||t.viewportChanged||e.length>0};class vl{constructor(e,n,o,r,s){this.left=e,this.top=n,this.height=o,this.name=r,this.colorClassName=s}draw(){const e=document.createElement("div");return this.adjust(e),e}update(e){return this.adjust(e),!0}adjust(e){e.style.left=`${this.left}px`,e.style.top=`${this.top}px`,e.style.height=`${this.height}px`,e.className=`loro-cursor ${this.colorClassName}`,e.style.setProperty("--rtc-name",`"${this.name}"`)}eq(e){return this.left===e.left&&this.top===e.top&&this.height===e.height&&this.name===e.name}static createCursor(e,n,o,r){const s=vl.calculateAbsoluteCursorPosition(n,e);if(!s)return[];const i=e.scrollDOM.getBoundingClientRect(),a=(e.textDirection===lU.LTR?i.left:i.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,l=i.top-e.scrollDOM.scrollTop;return[new vl(s.left-a,s.top-l,s.bottom-s.top,o,r)]}static calculateAbsoluteCursorPosition(e,n){const o=Math.max(0,Math.min(n.state.doc.length,e.anchor));return n.coordsAtPos(o,e.assoc||1)}}const A7=(t,e,n,o)=>{const r=[],{updated:s,added:i}=n;for(const a of[...s,...i]){const l=dx(t,e,a,o);l&&r.push(l)}return r},dx=(t,e,n,o)=>{const r=e.getAllStates()[n];if(!r||n===t.peerIdStr||r.scopeId!==o)return;if(r.type==="delete")return Mi.of({type:"delete",peer:r.uid,scopeId:r.scopeId});const s=Gn.decode(r.cursor.anchor),i=t.getCursorPos(s).offset;let a=i;if(r.cursor.head){const l=Gn.decode(r.cursor.head);a=t.getCursorPos(l).offset}return Mi.of({type:"update",peer:r.uid,scopeId:r.scopeId,cursor:{anchor:i,head:a},user:r.user})};class T7{constructor(e,n,o,r,s,i,a){this.view=e,this.doc=n,this.user=o,this.awareness=r,this.getTextFromDoc=s,this.scopeId=i,this.getUserId=a,this.sub=void 0,this.sub=this.doc.subscribe(l=>{if(l.by==="local"){const c=[];for(const d of this.awareness.peers()){const u=dx(this.doc,this.awareness,d,this.scopeId);u&&c.push(u)}this.view.dispatch({effects:c})}else l.by==="checkout"&&this.view.dispatch({effects:[Mi.of({type:"checkout",checkout:this.doc.isDetached()})]})})}update(e){if(!e.selectionSet&&!e.focusChanged&&!e.docChanged)return;const n=e.state.selection.main;if(this.view.hasFocus&&!this.doc.isDetached()){const o=O7(this.doc,this.getTextFromDoc,n.anchor,n.head);this.awareness.setLocalState({type:"update",uid:this.getUserId?this.getUserId():this.doc.peerIdStr,scopeId:this.scopeId,cursor:o,user:this.user})}else this.awareness.setLocalState({type:"delete",uid:this.getUserId?this.getUserId():this.doc.peerIdStr,scopeId:this.scopeId})}destroy(){var e;(e=this.sub)==null||e.call(this),this.awareness.setLocalState({type:"delete",uid:this.getUserId?this.getUserId():this.doc.peerIdStr,scopeId:this.scopeId})}}class M7{constructor(e,n,o,r){this.view=e,this.doc=n,this.awareness=o,this.scopeId=r,this._awarenessListener=void 0;const s=async(i,a)=>{a!=="local"&&this.view.dispatch({effects:A7(this.doc,this.awareness,i,this.scopeId)})};this._awarenessListener=s,this.awareness.addListener(s)}destroy(){this._awarenessListener&&this.awareness.removeListener(this._awarenessListener)}}const O7=(t,e,n,o)=>{var i,a;n===o&&(o=void 0);const r=(i=e(t).getCursor(n))==null?void 0:i.encode();if(!r)throw new Error("cursor head not found");let s;return o!==void 0&&(s=(a=e(t).getCursor(o))==null?void 0:a.encode()),{anchor:r,head:s}},kl=["bg-[var(--amber-6)]","bg-[var(--blue-6)]","bg-[var(--crimson-6)]","bg-[var(--cyan-6)]","bg-[var(--grass-6)]","bg-[var(--gray-6)]","bg-[var(--green-6)]","bg-[var(--lime-6)]","bg-[var(--orange-6)]","bg-[var(--purple-6)]","bg-[var(--red-6)]","bg-[var(--sage-6)]","bg-[var(--sky-6)]","bg-[var(--slate-6)]"],cn=Zt.get("rtc"),ux=cn.get("awareness").disabled(),Ou="awareness:",os=qt(void 0),Ht=new bo,Sl=new class{constructor(t,e=3e4){this.listeners=new Set,this.inner=new eb(t,e),this.peer=t,this.timeout=e}apply(t,e="remote"){const{updated:n,added:o}=this.inner.apply(t);this.listeners.forEach(r=>{r({updated:n,added:o,removed:[]},e)}),this.startTimerIfNotEmpty()}setLocalState(t){const e=this.inner.getState(this.peer)==null;this.inner.setLocalState(t),e?this.listeners.forEach(n=>{n({updated:[],added:[this.inner.peer()],removed:[]},"local")}):this.listeners.forEach(n=>{n({updated:[this.inner.peer()],added:[],removed:[]},"local")}),this.startTimerIfNotEmpty()}getLocalState(){return this.inner.getState(this.peer)}getAllStates(){return this.inner.getAllStates()}encode(t){return this.inner.encode(t)}encodeAll(){return this.inner.encodeAll()}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}peers(){return this.inner.peers()}destroy(){clearInterval(this.timer),this.listeners.clear()}startTimerIfNotEmpty(){this.inner.isEmpty()||this.timer!=null||(this.timer=setInterval(()=>{const t=this.inner.removeOutdated();t.length>0&&this.listeners.forEach(e=>{e({updated:[],added:[],removed:t},"timeout")}),this.inner.isEmpty()&&(clearInterval(this.timer),this.timer=void 0)},this.timeout/2))}}(Ht.peerIdStr),Du=uU(()=>{cn.debug("creating websocket");const t=hU(w4()).replace("/ws","/ws_sync"),e=new S$(t,void 0,{maxRetries:10,debug:!1,startClosed:!0,connectionTimeout:1e4});return Promise.resolve().then(async()=>{await fU(),e.reconnect()}),e.addEventListener("message",async n=>{const o=n.data,r=await o.arrayBuffer(),s=new Uint8Array(r);if(function(i,a){return new TextDecoder().decode(i.slice(0,a.length))===a}(s,Ou)){const i=function(a,l){return a.slice(l.length)}(s,Ou);return Sl.apply(i),void ux.debug("applied awareness update")}Ht.import(s),cn.debug("imported doc change. new doc:",Ht.toJSON()),ut.get(os)!==Ht&&ut.set(os,Ht)}),e.addEventListener("open",()=>{cn.debug("websocket open")}),e.addEventListener("close",n=>{cn.warn("websocket close",n),ut.get(os)===Ht&&ut.set(os,void 0)}),e});function Ru(t,e,n=""){if(Bn())return{extension:[],code:n};const o=Ht.getByPath(`codes/${t}`)!==void 0,r=Ht.getMap("codes").getOrCreateContainer(t,new Xo);o||(cn.log("initializing code for new cell",n),r.insert(0,n));const s={get name(){return ut.get(v4)||"Anonymous"},get colorClassName(){return(i=>{if(typeof i=="string"){let a=0;for(let l=0;l<i.length;l++)a=(a<<5)-a+i.charCodeAt(l),a=Math.trunc(a);return kl[Math.abs(a)%kl.length]}return kl[i%kl.length]})(this.name)}};return{code:n.toString(),extension:[D7(t),R7(t),P7(Ht,Sl,s,()=>r,t),j7(Ht,["codes",t],()=>r)]}}function D7(t){const e=(o,r)=>{const s=o.state.field(Sc).type,i=r.toString();i&&i!==s&&(cn.debug(`[incoming] setting language type: ${s} -> ${i}`),Ir(o,i,{keepCodeAsIs:!0}))},n=(o,r)=>{const s=o.state.field(Dm),i=r.toJSON();ra(s,i)||o.dispatch({effects:[y4.of(i)],annotations:[ns.of(!0)]})};return Zn.define(o=>{let r;return Promise.resolve().then(()=>{const s=Ht.getByPath(`languages/${t}`);if(!s)return void cn.error("no language container found for cell",t);zo(s instanceof Xo,"language type is not a LoroText");const i=Ht.getByPath(`language_metadata/${t}`);i?(zo(i instanceof Ko,"language metadata is not a LoroMap"),e(o,s),n(o,i),r=Ht.subscribe(a=>{if(a.origin==="local")return;const l=a.events.some(d=>d.target===s.id),c=a.events.some(d=>d.target===i.id);l&&e(o,s),c&&n(o,i)})):cn.error("no language metadata container found for cell",t)}),{destroy(){r()}}})}function R7(t){const e=Ht.getMap("languages").getOrCreateContainer(t,new Xo),n=Ht.getMap("language_metadata").getOrCreateContainer(t,new Ko);return st.updateListener.of(o=>{const r=e.toString()!=="";if(!o.docChanged&&r)return;if(!r){const i=Om(o.state).type;Ir(o.view,i),cn.debug("no initial language, setting default to",i),e.delete(0,e.length),e.insert(0,i),cn.debug("no initial language metadata, setting default to",o.state.field(Dm));const a=o.state.field(Dm);for(const l of Object.keys(a))n.set(l,a[l]);return void Ht.commit()}let s=!1;for(const i of o.transactions)if(!i.annotation(ns)){for(const a of i.effects)if(a.is(cU)&&e.toString()!==a.value.type&&(cn.debug(`[outgoing] language change: ${e} -> ${a.value.type}`),e.delete(0,e.length),e.insert(0,a.value.type),s=!0),a.is(y4)||a.is(x4)){const l=a.value;a.is(x4)?(cn.debug("[outgoing] setting language metadata: ",l),n.clear()):cn.debug("[outgoing] updating language metadata: ",l);for(const c of Object.keys(l))n.set(c,l[c]);s=!0}}s&&Ht.commit()})}function P7(t,e,n,o,r,s){const i=`loro:cell:${r}`;return[Mu,b4({above:!0,class:"loro-cursor-layer",update:cx,markers:a=>{const{remoteCursors:l,isCheckout:c}=a.state.field(Mu);return c?[]:[...l.values()].flatMap(d=>{var f,m;const u=Bo.cursor(d.cursor.anchor);return vl.createCursor(a,u,((f=d.user)==null?void 0:f.name)||"unknown",((m=d.user)==null?void 0:m.colorClassName)||"")})}}),b4({above:!1,class:"loro-selection-layer",update:cx,markers:a=>{const{remoteCursors:l,isCheckout:c}=a.state.field(Mu);return c?[]:[...l.entries()].filter(([,d])=>d.cursor.head!==void 0&&d.cursor.anchor!==d.cursor.head).flatMap(([,d])=>{var f;const u=Bo.range(d.cursor.anchor,d.cursor.head);return aU.forRange(a,`loro-selection ${((f=d.user)==null?void 0:f.colorClassName)||""}`,u)})}}),Zn.define(a=>new T7(a,t,n,e,o,i,s)),Zn.define(a=>new M7(a,t,e,i)),I7]}ga()&&dU==="edit"&&Du(),Ht.subscribeLocalUpdates(t=>{cn.debug("local update, sending to server"),Du().send(t)}),Sl.addListener((t,e)=>{const n=[...t.added,...t.removed,...t.updated];e==="local"&&(ux.debug("awareness changes",n),Du().send(function(o,r){const s=new TextEncoder().encode(o);return new Uint8Array([...s,...r])}(Ou,Sl.encode(n))))});const hx=({theme:t,showPlaceholder:e,allowFocus:n,id:o,config:r,code:s,status:i,serializedEditorState:a,setEditorView:l,runCell:c,userConfig:d,editorViewRef:u,editorViewParentRef:f,hidden:m,hasOutput:_,temporarilyShowCode:g,languageAdapter:p,setLanguageAdapter:b,showLanguageToggles:x=!0})=>{var re;const[y,v]=hn(Aa),S=mU(),k=sd(),{saveOrNameNotebook:E}=Pg(),j=i==="running"||i==="queued",I=Lt(),T=Zp(),M=p==="markdown",L=Qe(()=>!j&&(k({cellId:o}),!0)),B=Qe(()=>!j&&(c(),!0)),O=Qe(()=>{const ne=!r.hide_code;return Ar({configs:{[o]:{hide_code:ne}}}),I.updateCellConfig({cellId:o,config:{hide_code:ne}}),ne}),z=$e(Ts),F=Qe(()=>{ar(z,I.createNewCell)}),V=pU(d),P=A.useMemo(()=>{const ne=tE({cellId:o,showPlaceholder:e,enableAI:V,cellActions:{...I,afterToggleMarkdown:F,onRun:B,deleteCell:L,saveNotebook:E,createManyBelow:oe=>{for(const G of[...oe].reverse())I.createNewCell({code:G,before:!1,cellId:o,skipIfCodeExists:!0})},splitCell:T,toggleHideCode:O,aiCellCompletion:()=>{let oe=!1;return v(G=>(G==null?void 0:G.cellId)===o?(oe=!0,null):{cellId:o}),oe}},completionConfig:d.completion,keymapConfig:d.keymap,lspConfig:d.language_servers,theme:t,hotkeys:new k4(d.keymap.overrides??{}),diagnosticsConfig:d.diagnostics});return ne.push(Zn.define(oe=>{const G=oe.state.field(Sc);return b(G.type),{update(Z){const ce=Z.state.field(Sc);b(ce.type)}}}),st.updateListener.of(oe=>{oe.selectionSet&&oe.state.selection.ranges.some(G=>G.from!==G.to)&&g({focus:!1})})),ne},[o,d.keymap,d.completion,d.language_servers,d.diagnostics,V,t,e,I,T,O,L,B,v,F,b,g,E]),C=ga(),$=Qe(()=>{if(C){const oe=Ru(o,0,s);P.push(oe.extension),s=oe.code}const ne=new st({state:ca.create({doc:s,extensions:P})});l(ne),C||Ir(ne,Om(ne.state).type)}),N=Qe(()=>{if(zo(u.current!==null,"Editor view is not initialized"),C){const ne=Ru(o);P.push(ne.extension)}u.current.dispatch({effects:[Ut.reconfigure.of([P]),gU(u.current,d.completion,new k4(d.keymap.overrides??{}),{...d.language_servers,diagnostics:d.diagnostics})]})}),H=Qe(()=>{if(zo(a,"Editor view is not initialized"),C){const oe=Ru(o,0,s);P.push(oe.extension),s=oe.code}const ne=new st({state:ca.fromJSON(a,{doc:s,extensions:P},{history:_U})});C||Ir(ne,Om(ne.state).type),l(ne),I.clearSerializedEditorState({cellId:o})});A.useEffect(()=>{a===null?u.current===null?$():N():H(),u.current!==null&&f&&f.current!==null&&f.current.replaceChildren(u.current.dom)},[$,N,H,u,f,a,P]);const Y=(u.current===null||a!==null)&&!ga();A.useEffect(()=>{const ne=ut.get(bm).scrollKey!==null;Y&&n&&!ne&&requestAnimationFrame(()=>{var oe,G;(oe=u.current)==null||oe.focus(),(G=u.current)==null||G.dom.scrollIntoView({behavior:"smooth",block:"nearest"})})},[Y,n,u]),A.useEffect(()=>{const ne=u.current;return()=>{ne==null||ne.destroy()}},[u]);const Q=m&&!M||m&&M&&!_;let q="";return M&&m&&_?q="h-0 overflow-hidden":m&&(q="opacity-20 h-8 overflow-hidden"),h.jsx(I5,{enabled:(y==null?void 0:y.cellId)===o,initialPrompt:y==null?void 0:y.initialPrompt,currentCode:((re=u.current)==null?void 0:re.state.doc.toString())??s,currentLanguageAdapter:p,declineChange:Qe(()=>{var ne;v(null),(ne=u.current)==null||ne.focus()}),onChange:Qe(ne=>{var oe;(oe=u.current)==null||oe.dispatch({changes:{from:0,to:u.current.state.doc.length,insert:ne}})}),acceptChange:Qe(ne=>{var oe,G;(oe=u.current)==null||oe.dispatch({changes:{from:0,to:u.current.state.doc.length,insert:ne}}),(G=u.current)==null||G.focus(),v(null)}),children:h.jsxs("div",{className:"relative w-full",onFocus:()=>S(o),children:[Q&&h.jsx(S4,{tooltip:"Edit code",className:"absolute inset-0 z-10",onClick:g}),h.jsx(fx,{className:q,editorView:u.current,ref:f}),!m&&x&&h.jsx("div",{className:"absolute top-1 right-5",children:h.jsx(a5,{code:s,editorView:u.current,currentLanguageAdapter:p,onAfterToggle:F})})]})})},fx=K.forwardRef((t,e)=>{const n=X.c(10),{className:o,editorView:r}=t,s=A.useRef(null);let i,a,l,c,d;return n[0]!==r?(i=()=>{r!==null&&s.current!==null&&s.current.children.length===0&&s.current.append(r.dom)},a=[r,s],n[0]=r,n[1]=i,n[2]=a):(i=n[1],a=n[2]),A.useEffect(i,a),n[3]!==o?(l=Te("cm mathjax_ignore",o),n[3]=o,n[4]=l):l=n[4],n[5]!==e?(c=u=>{e?ml(e,s)(u):ml(s)(u)},n[5]=e,n[6]=c):c=n[6],n[7]!==l||n[8]!==c?(d=h.jsx("div",{className:l,ref:c,"data-testid":"cell-editor"}),n[7]=l,n[8]=c,n[9]=d):d=n[9],d});fx.displayName="CellCodeMirrorEditor";const Pu=ga()?function(t){const e=n=>{const o=X.c(5),r=$e(po),[s,i]=hn(os);if(r.state===en.CONNECTING||s===void 0){let l,c;return o[0]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx("span",{children:"Waiting for real-time collaboration connection..."}),o[0]=l):l=o[0],o[1]!==i?(c=h.jsx("div",{className:"flex h-full w-full items-baseline p-4",children:h.jsxs(C4,{milliseconds:1e3,fallback:null,children:[l,h.jsx(De,{variant:"link",onClick:()=>{i("disabled")},children:"Turn off real-time collaboration"})]})}),o[1]=i,o[2]=c):c=o[2],c}let a;return o[3]!==n?(a=h.jsx(t,{...n}),o[3]=n,o[4]=a):a=o[4],a};return e.displayName=`WithWaitUntilConnected(${t.displayName})`,e}(A.memo(hx)):A.memo(hx),L7=t=>{const e=X.c(10);let n,o,r,s;return e[0]!==t.left?(n=h.jsx("div",{className:"flex-1 flex item-center gap-2",children:t.left}),e[0]=t.left,e[1]=n):n=e[1],e[2]!==t.center?(o=h.jsx("div",{className:"flex-1 flex item-center gap-2 justify-center",children:t.center}),e[2]=t.center,e[3]=o):o=e[3],e[4]!==t.right?(r=h.jsx("div",{className:"flex-1 flex item-center gap-2 justify-end",children:t.right}),e[4]=t.right,e[5]=r):r=e[5],e[6]!==n||e[7]!==o||e[8]!==r?(s=h.jsxs("div",{className:"flex items-center gap-2 w-full px-3",children:[n,o,r]}),e[6]=n,e[7]=o,e[8]=r,e[9]=s):s=e[9],s},F7=t=>{const e=X.c(8);if(!t.canCollapse&&!t.isCollapsed)return null;const n=t.isCollapsed?"Expand":"Collapse";let o,r,s;return e[0]!==t.isCollapsed?(o=h.jsx("span",{children:h.jsx(z7,{isCollapsed:t.isCollapsed})}),e[0]=t.isCollapsed,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(r=h.jsx(Oe,{content:n,children:o}),e[2]=n,e[3]=o,e[4]=r):r=e[4],e[5]!==t.onClick||e[6]!==r?(s=h.jsx(De,{variant:"text",size:"icon",onClick:t.onClick,children:r}),e[5]=t.onClick,e[6]=r,e[7]=s):s=e[7],s},z7=t=>{const e=X.c(2),{isCollapsed:n}=t;let o;return e[0]!==n?(o=n?h.jsx(ac,{className:"w-5 h-5 flex-shrink-0"}):h.jsx(Zi,{className:"w-5 h-5 flex-shrink-0"}),e[0]=n,e[1]=o):o=e[1],o},mx=A.memo(t=>{const e=X.c(24),{onClick:n,count:o,cellId:r}=t,s=wc();let i;e[0]!==r||e[1]!==s?(i=bU(s,r),e[0]=r,e[1]=s,e[2]=i):i=e[2];const a=i;let l,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=Te("flex items-center justify-between w-[calc(100%-2rem)] h-9 bg-muted rounded-b mx-4 opacity-80 hover:opacity-100 cursor-pointer"),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(yU,{className:"w-4 h-4 flex-shrink-0"}),e[4]=c):c=e[4];const d=o===1?"cell":"cells";let u,f,m,_,g,p,b;return e[5]!==o||e[6]!==d?(u=h.jsxs(h.Fragment,{children:[c,h.jsxs("span",{className:"text-sm text-gray-500",children:[o," ",d," collapsed"]})]}),e[5]=o,e[6]=d,e[7]=u):u=e[7],e[8]!==a.errored?(f=a.errored&&h.jsx(Oe,{content:"Has errors",delayDuration:100,children:h.jsx(Ep,{className:"w-4 h-4 flex-shrink-0 text-destructive"})}),e[8]=a.errored,e[9]=f):f=e[9],e[10]!==a.stale?(m=a.stale&&h.jsx(Oe,{content:"Has stale cells",delayDuration:100,children:h.jsx(N4,{className:"w-4 h-4 flex-shrink-0 text-[var(--yellow-11)]"})}),e[10]=a.stale,e[11]=m):m=e[11],e[12]!==a.runningOrQueued?(_=a.runningOrQueued&&h.jsx(Oe,{content:"Running",delayDuration:100,children:h.jsx(Tm,{className:"w-4 h-4 flex-shrink-0 animate-spin"})}),e[12]=a.runningOrQueued,e[13]=_):_=e[13],e[14]!==f||e[15]!==m||e[16]!==_?(g=h.jsxs(h.Fragment,{children:[f,m,_]}),e[14]=f,e[15]=m,e[16]=_,e[17]=g):g=e[17],e[18]!==u||e[19]!==g?(p=h.jsx(L7,{center:u,right:g}),e[18]=u,e[19]=g,e[20]=p):p=e[20],e[21]!==n||e[22]!==p?(b=h.jsx("div",{onClick:n,className:l,children:p}),e[21]=n,e[22]=p,e[23]=b):b=e[23],b});mx.displayName="CollapsedCellBanner";const B7=t=>{const e=X.c(6),{appClosed:n,status:o}=t,r=Og(o==="running");let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=fn("global.interrupt"),e[0]=s):s=e[0];const i=n||!r,a=r?Rm:jn.NOOP,l=r?"stale":"disabled";let c,d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(Xf,{strokeWidth:1.5}),e[1]=c):c=e[1],e[2]!==i||e[3]!==a||e[4]!==l?(d=h.jsx(xi,{tooltip:s,disabled:i,onClick:a,variant:l,"data-testid":"run-button",children:c}),e[2]=i,e[3]=a,e[4]=l,e[5]=d):d=e[5],d},U7={width:void 0,height:void 0};function px(t,e,n){return t[e]?Array.isArray(t[e])?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}function gx(t,e){const n=X.c(9);let o;n[0]!==t.current||n[1]!==e?(o=l=>{t.current===null||t.current.contains(l.relatedTarget)||e.current===null||tm(e.current)},n[0]=t.current,n[1]=e,n[2]=o):o=n[2];const r=Qe(o);let s;n[3]!==t.current||n[4]!==e?(s=l=>{if(t.current===document.activeElement&&e.current!==null&&sa(e.current.state)==="active"){for(const c of a4)if(l.key===c.key&&c.run){c.run(e.current),l.preventDefault(),l.stopPropagation();break}e.current.focus()}},n[3]=t.current,n[4]=e,n[5]=s):s=n[5];const i=Qe(s);let a;return n[6]!==r||n[7]!==i?(a={closeCompletionHandler:r,resumeCompletionHandler:i},n[6]=r,n[7]=i,n[8]=a):a=n[8],a}function _x(t,e,n,o,r,s,i,a,l){const c=X.c(51);let d,u,f,m,_,g,p,b,x,y,v,S,k,E,j,I;c[0]!==o||c[1]!==e||c[2]!==n?(d=()=>{n(),o.moveToNextCell({cellId:e,before:!1})},u=()=>{n(),o.moveToNextCell({cellId:e,before:!0})},c[0]=o,c[1]=e,c[2]=n,c[3]=d,c[4]=u):(d=c[3],u=c[4]),c[5]!==o||c[6]!==e?(f=()=>o.createNewCell({cellId:e,before:!0}),m=()=>o.createNewCell({cellId:e,before:!1}),_=()=>o.moveCell({cellId:e,before:!0}),g=()=>o.moveCell({cellId:e,before:!1}),c[5]=o,c[6]=e,c[7]=f,c[8]=m,c[9]=_,c[10]=g):(f=c[7],m=c[8],_=c[9],g=c[10]),c[11]!==o||c[12]!==r||c[13]!==e?(p=()=>r?o.moveCell({cellId:e,direction:"left"}):void 0,b=()=>r?o.moveCell({cellId:e,direction:"right"}):void 0,c[11]=o,c[12]=r,c[13]=e,c[14]=p,c[15]=b):(p=c[14],b=c[15]),c[16]!==o||c[17]!==s||c[18]!==e||c[19]!==(t==null?void 0:t.current)||c[20]!==i?(x=()=>{var M,L,B;const T=!s.hide_code;Ar({configs:{[e]:{hide_code:T}}}),o.updateCellConfig({cellId:e,config:{hide_code:T}}),T?((M=i.current)==null||M.contentDOM.blur(),(L=t==null?void 0:t.current)==null||L.focus()):(B=i.current)==null||B.focus()},c[16]=o,c[17]=s,c[18]=e,c[19]=t==null?void 0:t.current,c[20]=i,c[21]=x):x=c[21],c[22]!==o||c[23]!==e?(k=()=>o.moveToNextCell({cellId:e,before:!1,noCreate:!0}),y=()=>o.moveToNextCell({cellId:e,before:!0,noCreate:!0}),v=()=>o.sendToBottom({cellId:e}),S=()=>o.sendToTop({cellId:e}),c[22]=o,c[23]=e,c[24]=y,c[25]=v,c[26]=S,c[27]=k):(y=c[24],v=c[25],S=c[26],k=c[27]),c[28]!==e||c[29]!==i||c[30]!==a?(E=()=>{let T;T=!1,a(M=>(M==null?void 0:M.cellId)===e?(T=!0,null):{cellId:e}),T&&J1(i).focus()},c[28]=e,c[29]=i,c[30]=a,c[31]=E):E=c[31],c[32]!==l?(j=()=>{var T;(T=l.current)==null||T.toggle()},c[32]=l,c[33]=j):j=c[33],c[34]!==n||c[35]!==d||c[36]!==u||c[37]!==y||c[38]!==v||c[39]!==S||c[40]!==E||c[41]!==j||c[42]!==f||c[43]!==m||c[44]!==_||c[45]!==g||c[46]!==p||c[47]!==b||c[48]!==x||c[49]!==k?(I={"cell.run":n,"cell.runAndNewBelow":d,"cell.runAndNewAbove":u,"cell.createAbove":f,"cell.createBelow":m,"cell.moveUp":_,"cell.moveDown":g,"cell.moveLeft":p,"cell.moveRight":b,"cell.hideCode":x,"cell.focusDown":k,"cell.focusUp":y,"cell.sendToBottom":v,"cell.sendToTop":S,"cell.aiCompletion":E,"cell.cellActions":j},c[34]=n,c[35]=d,c[36]=u,c[37]=y,c[38]=v,c[39]=S,c[40]=E,c[41]=j,c[42]=f,c[43]=m,c[44]=_,c[45]=g,c[46]=p,c[47]=b,c[48]=x,c[49]=k,c[50]=I):I=c[50],vU(t,I)}function bx(t,e,n,o,r,s){const i=X.c(16);let a,l,c,d,u;i[0]!==n||i[1]!==e?(a=f=>(!f||!Vn.fromInput(f))&&(n.moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0),l=f=>(!f||!Vn.fromInput(f))&&(n.moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0),i[0]=n,i[1]=e,i[2]=a,i[3]=l):(a=i[2],l=i[3]),i[4]!==o?(c=()=>(o(),!1),i[4]=o,i[5]=c):c=i[5],i[6]!==n||i[7]!==e||i[8]!==s||i[9]!==r.keymap.preset?(d=r.keymap.preset!=="vim"||s?{}:{j:f=>(!f||!Vn.fromInput(f))&&(n.moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0),k:f=>(!f||!Vn.fromInput(f))&&(n.moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},i[6]=n,i[7]=e,i[8]=s,i[9]=r.keymap.preset,i[10]=d):d=i[10],i[11]!==a||i[12]!==l||i[13]!==c||i[14]!==d?(u={ArrowDown:a,ArrowUp:l,Enter:c,...d},i[11]=a,i[12]=l,i[13]=c,i[14]=d,i[15]=u):u=i[15],kU(t,u)}const yx=A.forwardRef((t,e)=>{const n=X.c(14),{id:o,output:r,interrupted:s,errored:i,stopped:a,name:l,outputStale:c,outputLoading:d}=t;let u;n[0]===Symbol.for("react.memo_cache_sentinel")?(u=Pm("marimo-cell","hover-actions-parent z-10",{published:!0}),n[0]=u):u=n[0];const f=u;let m;n[1]!==o?(m=Fs.create(o),n[1]=o,n[2]=m):m=n[2];const _=m,g=I4(r==null?void 0:r.mimetype);if(i||s||a||g)return null;let p,b;return n[3]!==o||n[4]!==r||n[5]!==d||n[6]!==c?(p=h.jsx(Dc,{allowExpand:!1,forceExpand:!0,output:r,className:"output-area",cellId:o,stale:c,loading:d}),n[3]=o,n[4]=r,n[5]=d,n[6]=c,n[7]=p):p=n[7],n[8]!==_||n[9]!==o||n[10]!==l||n[11]!==e||n[12]!==p?(b=h.jsx("div",{tabIndex:-1,id:_,ref:e,className:f,"data-cell-id":o,"data-cell-name":l,children:p}),n[8]=_,n[9]=o,n[10]=l,n[11]=e,n[12]=p,n[13]=b):b=n[13],b});yx.displayName="ReadonlyCellComponent";const V7=({theme:t,showPlaceholder:e,allowFocus:n,id:o,code:r,output:s,consoleOutputs:i,status:a,runStartTimestamp:l,lastRunStartTimestamp:c,runElapsedTimeMs:d,edited:u,interrupted:f,errored:m,stopped:_,staleInputs:g,serializedEditorState:p,serialization:b,debuggerActive:x,appClosed:y,canDelete:v,actions:S,deleteCell:k,userConfig:E,outline:j,isCollapsed:I,collapseCount:T,config:M,canMoveX:L,name:B,editorView:O,setEditorView:z,outputStale:F})=>{const V=A.useRef(null),P=A.useRef(null),C=A.useRef(null),$=A.useRef(null),N=Qt(Aa),H=td(o),[Y,Q]=A.useState(),q=M.disabled||a==="disabled-transitively",re=A4({executionTime:d,status:a,errored:m,interrupted:f,stopped:_}),ne=u||f||g&&!q,oe=j4(a),G=(a==="queued"||u||g)&&!f,Z=A.useCallback(()=>O.current,[O]),{closeCompletionHandler:ce,resumeCompletionHandler:fe}=gx(V,O),{isCellCodeShown:de,isMarkdown:_e,isMarkdownCodeHidden:ie,temporarilyShowCode:we,showHiddenMarkdownCode:ve}=function(pe,be,ue,Ne){const ke=X.c(13),[Ue,Ze]=A.useState(!1),le=!pe.hide_code||Ue,Ee=be==="markdown",Ie=Ee&&!le;let Be;ke[0]!==ue||ke[1]!==Ne||ke[2]!==le?(Be=Ye=>{var Tt,xt;if(le)return;const rt=(Ye==null?void 0:Ye.focus)??!0;Ze(!0),rt&&((Tt=ue.current)==null||Tt.focus());const pt=(xt=Ne.current)==null?void 0:xt.parentElement;if(!pt)return void Zt.error("Cell: No parent element found for editor view");const yt=()=>{requestAnimationFrame(()=>{var Bt;pt.contains(document.activeElement)||(Ze(!1),(Bt=ue.current)==null||Bt.dom.blur(),pt.removeEventListener("focusout",yt))})};pt.addEventListener("focusout",yt)},ke[0]=ue,ke[1]=Ne,ke[2]=le,ke[3]=Be):Be=ke[3];const We=Qe(Be);let Me;ke[4]!==Ie||ke[5]!==We?(Me=()=>{Ie&&We({focus:!0})},ke[4]=Ie,ke[5]=We,ke[6]=Me):Me=ke[6];const Ge=Qe(Me);let ot;return ke[7]!==le||ke[8]!==Ee||ke[9]!==Ie||ke[10]!==Ge||ke[11]!==We?(ot={isCellCodeShown:le,isMarkdown:Ee,isMarkdownCodeHidden:Ie,temporarilyShowCode:We,showHiddenMarkdownCode:Ge},ke[7]=le,ke[8]=Ee,ke[9]=Ie,ke[10]=Ge,ke[11]=We,ke[12]=ot):ot=ke[12],ot}(M,Y,O,C);_x(V,o,H,S,L,M,O,N,P),bx(V,o,S,ve,E,de);const ae=wU(j),ge=!E4(s),he=i.length>0,je=E.display.cell_output,Fe=ge&&je==="above",He=ge&&je==="below",[Xe,Le]=A.useState(!1),[et,nt]=A.useState(!1);(function(pe){const{ref:be,box:ue="content-box",skip:Ne}=pe,ke=A.useRef({...U7}),Ue=A.useRef(void 0);Ue.current=pe.onResize,A.useEffect(()=>{if(!be.current||Ne||typeof window>"u"||!("ResizeObserver"in window))return;const Ze=new ResizeObserver(([le])=>{const Ee=ue==="border-box"?"borderBoxSize":ue==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",Ie=px(le,Ee,"inlineSize"),Be=px(le,Ee,"blockSize");if(ke.current.width!==Ie||ke.current.height!==Be){const We={width:Ie,height:Be};ke.current.width=Ie,ke.current.height=Be,Ue.current&&Ue.current(We)}});return Ze.observe(be.current,{box:ue}),()=>{Ze.disconnect()}},[ue,be,Ne])})({ref:$,skip:!_e,onResize:pe=>{const be=pe.height&&pe.height<68,ue=ie&&(be||je==="below");Le(ue),ae&&ue?nt(!0):et&&nt(!1)}});const it=pe=>h.jsx(S4,{tooltip:"Edit markdown",className:Te("z-20 relative",pe),onClick:we}),te=ge&&h.jsxs("div",{className:"relative",onDoubleClick:ve,children:[h.jsx("div",{className:"absolute top-5 -left-8 z-10 print:hidden",children:h.jsx(F7,{isCollapsed:I,onClick:()=>{I?S.expandCell({cellId:o}):S.collapseCell({cellId:o})},canCollapse:ae})}),ie&&He&&it("top-3"),h.jsx(Dc,{allowExpand:!0,forceExpand:ie,output:s,className:"output-area",cellId:o,stale:F,loading:oe}),ie&&Fe&&it("bottom-3")]}),Ce=Pm("marimo-cell","hover-actions-parent z-10",{interactive:!0,"needs-run":ne,"has-error":m,stopped:_,disabled:M.disabled,stale:a==="disabled-transitively",borderless:ie&&ge}),Ae=Fs.create(o),ze=Qe(pe=>{N({cellId:o,initialPrompt:pe.prompt})}),J=!(!b||b.toLowerCase()!=="valid");return h.jsx(Lm,{children:h.jsx(g0,{cellId:o,config:M,status:a,getEditorView:Z,hasOutput:ge,hasConsoleOutput:he,name:B,children:h.jsxs(h0,{tabIndex:-1,ref:V,"data-status":a,onBlur:ce,onKeyDown:fe,cellId:o,canMoveX:L,title:M.disabled?"This cell is disabled":a==="disabled-transitively"?"This cell has a disabled ancestor":void 0,children:[h.jsxs("div",{className:Ce,id:Ae,ref:$,"data-cell-id":o,"data-cell-name":B,children:[je==="above"&&te,h.jsxs("div",{className:Te("tray"),"data-hidden":ie,children:[h.jsx("div",{className:"absolute right-2 -top-4 z-10",children:h.jsx(wx,{edited:u,appClosed:y,status:a,cellConfig:M,needsRun:ne,hasOutput:ge,hasConsoleOutput:he,cellActionDropdownRef:P,cellId:o,name:B,getEditorView:Z,onRun:H})}),h.jsx($7,{cellId:o,className:Te(ie&&Fe&&"-top-7",ie&&He&&"-bottom-8",ie&&et&&"-left-[3.8rem]"),appClosed:y,actions:S}),h.jsx(Pu,{theme:t,showPlaceholder:e,allowFocus:n,id:o,code:r,config:M,status:a,serializedEditorState:p,runCell:H,setEditorView:z,userConfig:E,editorViewRef:O,editorViewParentRef:C,hidden:!de,hasOutput:ge,temporarilyShowCode:we,languageAdapter:Y,setLanguageAdapter:Q}),h.jsx(xx,{className:Te(ie&&je==="below"&&"top-14"),edited:u,status:a,isCellStatusInline:Xe,uninstantiated:re,disabled:M.disabled,runElapsedTimeMs:d,runStartTimestamp:l,lastRunStartTimestamp:c,staleInputs:g,interrupted:f}),h.jsx("div",{className:"shoulder-bottom hover-action",children:v&&de&&h.jsx(C_,{appClosed:y,status:a,onClick:()=>{oe||y||k({cellId:o})}})})]}),je==="below"&&te,b&&h.jsxs("a",{href:"https://links.marimo.app/reusable-definitions",target:"_blank",className:"hover:underline py-1 px-2 flex items-center justify-end gap-2 last:rounded-b",children:[J&&h.jsx("span",{className:"text-muted-foreground text-xs font-bold",children:"reusable"}),h.jsx(Oe,{content:h.jsx("span",{className:"max-w-16 text-xs",children:J?"This function or class can be imported into other Python notebooks or modules.":h.jsxs(h.Fragment,{children:["This definition can't be reused in other Python modules:",h.jsx("br",{}),h.jsx("br",{}),h.jsx("pre",{children:b}),h.jsx("br",{}),"Click this icon to learn more."]})}),children:J&&h.jsx(dc,{size:16,strokeWidth:1.5,className:"rounded-lg text-muted-foreground"})||h.jsx(Fm,{size:16,strokeWidth:1.5,className:"rounded-lg text-muted-foreground"})})]}),h.jsx(Xm,{consoleOutputs:i,stale:G,cellName:b?"_":B,onRefactorWithAI:ze,onClear:()=>{S.clearCellConsoleOutput({cellId:o})},onSubmitDebugger:(pe,be)=>{S.setStdinResponse({cellId:o,response:pe,outputIndex:be}),T4({text:pe})},cellId:o,debuggerActive:x})]}),I&&h.jsx(mx,{onClick:()=>S.expandCell({cellId:o}),count:T,cellId:o})]})})})},xx=t=>{const e=X.c(19),{className:n,disabled:o,edited:r,interrupted:s,isCellStatusInline:i,lastRunStartTimestamp:a,runElapsedTimeMs:l,runStartTimestamp:c,staleInputs:d,status:u,uninstantiated:f}=t,m=o!==void 0&&o;let _;e[0]!==m||e[1]!==r||e[2]!==s||e[3]!==a||e[4]!==l||e[5]!==c||e[6]!==d||e[7]!==u||e[8]!==f?(_=h.jsx(E_,{status:u,staleInputs:d,interrupted:s,editing:!0,edited:r,disabled:m,elapsedTime:l,runStartTimestamp:c,uninstantiated:f,lastRunStartTimestamp:a}),e[0]=m,e[1]=r,e[2]=s,e[3]=a,e[4]=l,e[5]=c,e[6]=d,e[7]=u,e[8]=f,e[9]=_):_=e[9];const g=_;let p;e[10]!==n?(p=Te("shoulder-right z-20",n),e[10]=n,e[11]=p):p=e[11];const b=!i&&g;let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=h.jsx(u0,{}),e[12]=x):x=e[12];const y=i&&g;let v,S;return e[13]!==y?(v=h.jsxs("div",{className:"flex gap-2 items-end",children:[x,y]}),e[13]=y,e[14]=v):v=e[14],e[15]!==p||e[16]!==b||e[17]!==v?(S=h.jsxs("div",{className:p,children:[b,v]}),e[15]=p,e[16]=b,e[17]=v,e[18]=S):S=e[18],S},$7=t=>{const e=X.c(21),{className:n,appClosed:o,actions:r,cellId:s}=t;let i;e[0]!==r||e[1]!==s?(i=y=>{const v=y===void 0?{}:y;return r.createNewCell({cellId:s,before:!1,...v})},e[0]=r,e[1]=s,e[2]=i):i=e[2];const a=Qe(i);let l;e[3]!==r||e[4]!==s?(l=y=>{const v=y===void 0?{}:y;return r.createNewCell({cellId:s,before:!0,...v})},e[3]=r,e[4]=s,e[5]=l):l=e[5];const c=Qe(l);let d,u;e[6]!==n?(d=Te("absolute flex flex-col gap-[2px] justify-center h-full left-[-34px] z-20",n),e[6]=n,e[7]=d):d=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(u=fn("cell.createAbove"),e[8]=u):u=e[8];const f=o?void 0:c;let m,_,g;e[9]!==o||e[10]!==f?(m=h.jsx(S_,{tooltipContent:u,appClosed:o,onClick:f}),e[9]=o,e[10]=f,e[11]=m):m=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx("div",{className:"flex-1"}),e[12]=_):_=e[12],e[13]===Symbol.for("react.memo_cache_sentinel")?(g=fn("cell.createBelow"),e[13]=g):g=e[13];const p=o?void 0:a;let b,x;return e[14]!==o||e[15]!==p?(b=h.jsx(S_,{tooltipContent:g,appClosed:o,onClick:p}),e[14]=o,e[15]=p,e[16]=b):b=e[16],e[17]!==d||e[18]!==m||e[19]!==b?(x=h.jsxs("div",{className:d,children:[m,_,b]}),e[17]=d,e[18]=m,e[19]=b,e[20]=x):x=e[20],x},wx=t=>{const e=X.c(27),{edited:n,appClosed:o,status:r,cellConfig:s,needsRun:i,hasOutput:a,hasConsoleOutput:l,onRun:c,cellActionDropdownRef:d,cellId:u,getEditorView:f,name:m,includeCellActions:_}=t,g=_===void 0||_,p=!i&&"hover-action";let b;e[0]!==p?(b=Te(p),e[0]=p,e[1]=b):b=e[1];const x=o?jn.NOOP:c;let y,v,S,k;return e[2]!==o||e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==r||e[7]!==x?(y=h.jsx(cE,{edited:n,onClick:x,appClosed:o,status:r,config:s,needsRun:i}),e[2]=o,e[3]=s,e[4]=n,e[5]=i,e[6]=r,e[7]=x,e[8]=y):y=e[8],e[9]!==o||e[10]!==r?(v=h.jsx(B7,{status:r,appClosed:o}),e[9]=o,e[10]=r,e[11]=v):v=e[11],e[12]!==d||e[13]!==s||e[14]!==u||e[15]!==f||e[16]!==l||e[17]!==a||e[18]!==g||e[19]!==m||e[20]!==r?(S=g&&h.jsx(m0,{ref:d,cellId:u,status:r,getEditorView:f,name:m,config:s,hasOutput:a,hasConsoleOutput:l,children:h.jsx(xi,{variant:"green",tooltip:null,"data-testid":"cell-actions-button",children:h.jsx(xS,{strokeWidth:1.5})})}),e[12]=d,e[13]=s,e[14]=u,e[15]=f,e[16]=l,e[17]=a,e[18]=g,e[19]=m,e[20]=r,e[21]=S):S=e[21],e[22]!==b||e[23]!==y||e[24]!==v||e[25]!==S?(k=h.jsxs(lE,{className:b,children:[y,v,S]}),e[22]=b,e[23]=y,e[24]=v,e[25]=S,e[26]=k):k=e[26],k},H7=({theme:t,showPlaceholder:e,allowFocus:n,id:o,code:r,output:s,consoleOutputs:i,status:a,runStartTimestamp:l,lastRunStartTimestamp:c,runElapsedTimeMs:d,edited:u,interrupted:f,errored:m,stopped:_,staleInputs:g,serializedEditorState:p,debuggerActive:b,appClosed:x,canDelete:y,actions:v,deleteCell:S,userConfig:k,config:E,canMoveX:j,name:I,editorView:T,setEditorView:M})=>{const L=A.useRef(null),B=A.useRef(null),O=A.useRef(null),z=Qt(Aa),F=td(o),V=E.disabled||a==="disabled-transitively",P=A4({executionTime:d,status:a,errored:m,interrupted:f,stopped:_}),C=u||f||g&&!V,$=a==="running"||a==="queued",N=(a==="queued"||u||g)&&!f,H=A.useCallback(()=>T.current,[T]),{closeCompletionHandler:Y,resumeCompletionHandler:Q}=gx(L,T);_x(L,o,F,v,j,E,T,z,B),bx(L,o,v,jn.NOOP,k,!0);const q=!E4(s),re=i.length>0,ne=I4(s==null?void 0:s.mimetype),oe=Pm("marimo-cell","hover-actions-parent z-10 border shadow-sm","!border-[var(--blue-5)] !rounded-sm",{"needs-run":C,"has-error":m,stopped:_}),G=Fs.create(o),Z=Qe(ce=>{z({cellId:o,initialPrompt:ce.prompt})});return h.jsx(Lm,{children:h.jsx(g0,{cellId:o,config:E,status:a,getEditorView:H,hasOutput:q,hasConsoleOutput:re,name:I,children:h.jsxs("div",{className:oe,"data-status":a,id:G,ref:L,onBlur:Y,onKeyDown:Q,title:E.disabled?"This cell is disabled":a==="disabled-transitively"?"This cell has a disabled ancestor":void 0,"data-cell-id":o,"data-cell-name":I,"data-setup-cell":!0,children:[h.jsxs("div",{className:Te("tray"),"data-hidden":!1,children:[h.jsx("div",{className:"absolute right-2 -top-4 z-10",children:h.jsx(wx,{edited:u,appClosed:x,status:a,cellConfig:E,needsRun:C,hasOutput:q,hasConsoleOutput:re,cellActionDropdownRef:B,cellId:o,name:I,getEditorView:H,onRun:F,includeCellActions:!1})}),h.jsx(Pu,{theme:t,showPlaceholder:e,allowFocus:n,id:o,code:r,config:E,status:a,serializedEditorState:p,runCell:F,setEditorView:M,userConfig:k,editorViewRef:T,editorViewParentRef:O,hidden:!1,hasOutput:q,temporarilyShowCode:jn.NOOP,languageAdapter:"python",setLanguageAdapter:jn.NOOP,showLanguageToggles:!1}),h.jsx(xx,{edited:u,status:a,isCellStatusInline:!1,uninstantiated:P,disabled:E.disabled,runElapsedTimeMs:d,runStartTimestamp:l,lastRunStartTimestamp:c,staleInputs:g,interrupted:f}),h.jsx("div",{className:"shoulder-bottom hover-action",children:y&&h.jsx(C_,{appClosed:x,status:a,onClick:()=>{$||x||S({cellId:o})}})})]}),h.jsxs("div",{className:"py-1 px-2 flex justify-end gap-2 last:rounded-b",children:[h.jsx("span",{className:"text-muted-foreground text-xs font-bold",children:"setup cell"}),h.jsx(Oe,{content:h.jsxs("span",{className:"max-w-16",children:["This ",h.jsx("b",{children:"setup cell"})," is guaranteed to run before all other cells. Include ",h.jsx("br",{}),"initialization or imports and constants required by top-level functions."]}),children:h.jsx(Fm,{size:16,strokeWidth:1.5,className:"rounded-lg text-muted-foreground"})})]}),ne&&h.jsx(Dc,{allowExpand:!0,forceExpand:!0,output:s,className:"output-area",cellId:o,stale:!1,loading:$}),h.jsx(Xm,{consoleOutputs:i,stale:N,cellName:"_",onRefactorWithAI:Z,onClear:()=>{v.clearCellConsoleOutput({cellId:o})},onSubmitDebugger:(ce,fe)=>{v.setStdinResponse({cellId:o,response:ce,outputIndex:fe}),T4({text:ce})},cellId:o,debuggerActive:b})]})})})},vx=A.memo(A.forwardRef((t,e)=>{const{status:n,output:o,runStartTimestamp:r,interrupted:s,staleInputs:i,edited:a,id:l,mode:c}=t;Zt.debug("Rendering Cell",l);const d=A.useRef(null);A.useImperativeHandle(e,()=>({get editorView(){return J1(d)},get editorViewOrNull(){return d.current}}),[d]);const u=xU({status:n,output:o,runStartTimestamp:r,interrupted:s,staleInputs:i},a),f=j4(n);return l===$o?h.jsx(H7,{...t,editorView:d,setEditorView:m=>{d.current=m},outputStale:u}):c==="edit"?h.jsx(V7,{...t,editorView:d,setEditorView:m=>{d.current=m},outputStale:u}):h.jsx(yx,{...t,outputStale:u,outputLoading:f})})),W7=t=>{const e=X.c(10),{width:n}=t,{banners:o}=C$(),{removeBanner:r}=N$();if(o.length===0)return null;const s=n==="columns"&&"sticky left-12 w-full max-w-[80vw]";let i,a,l;if(e[0]!==s?(i=Te("flex flex-col gap-4 mb-5 print:hidden",s),e[0]=s,e[1]=i):i=e[1],e[2]!==o||e[3]!==r){let c;e[5]!==r?(c=d=>h.jsxs(Rc,{kind:d.variant||"info",className:"flex flex-col rounded p-3",children:[h.jsxs("div",{className:"flex justify-between",children:[h.jsxs("span",{className:"font-bold text-lg flex items-center mb-2",children:[h.jsx(SU,{className:"w-5 h-5 inline-block mr-2"}),d.title]}),h.jsx(De,{"data-testid":"remove-banner-button",variant:"text",size:"icon",onClick:()=>r(d.id),children:h.jsx(go,{className:"w-5 h-5"})})]}),h.jsxs("div",{className:"flex justify-between items-end",children:[h.jsx("span",{children:zm({html:d.description})}),d.action==="restart"&&h.jsx(q7,{})]})]},d.id),e[5]=r,e[6]=c):c=e[6],a=o.map(c),e[2]=o,e[3]=r,e[4]=a}else a=e[4];return e[7]!==i||e[8]!==a?(l=h.jsx("div",{className:i,children:a}),e[7]=i,e[8]=a,e[9]=l):l=e[9],l},q7=()=>{const t=X.c(3),e=eg();let n,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n=h.jsx(Dp,{className:"w-3 h-3 mr-2"}),t[0]=n):n=t[0],t[1]!==e?(o=h.jsxs(De,{"data-testid":"restart-session-button",variant:"link",size:"xs",onClick:e,children:[n,"Restart"]}),t[1]=e,t[2]=o):o=t[2],o},G7=(t,e)=>function(n,o){const r=/^(\d+)\.(\d+)\.(\d+)(?:-([\w.-]+))?(?:\+([\w.-]+))?$/,s=i=>{const a=i.match(r);if(!a)return null;const[,l,c,d,u]=a;return{major:Number.parseInt(l,10),minor:Number.parseInt(c,10),patch:Number.parseInt(d,10),preRelease:u||""}};try{const i=s(n),a=s(o);return i&&a?i.major!==a.major?i.major-a.major:i.minor!==a.minor?i.minor-a.minor:i.patch!==a.patch?i.patch-a.patch:i.preRelease===""&&a.preRelease!==""?1:i.preRelease!==""&&a.preRelease===""?-1:i.preRelease.localeCompare(a.preRelease):n.localeCompare(o,void 0,{numeric:!0,sensitivity:"base"})}catch{return n.localeCompare(o,void 0,{numeric:!0,sensitivity:"base"})}}(e,t),Y7=()=>{const t=X.c(66),{packageAlert:e}=j$(),{clearPackageAlert:n}=E$(),[o]=Ds();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={},t[0]=r):r=t[0];const[s,i]=A.useState(r);if(e===null)return null;const a=o.package_management.manager!=="pixi";if(I$(e)){let l,c,d,u,f,m,_,g,p,b;if(t[1]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsxs("span",{className:"font-bold text-lg flex items-center mb-2",children:[h.jsx(Jc,{className:"w-5 h-5 inline-block mr-2"}),"Missing packages"]}),t[1]=l):l=t[1],t[2]!==n||t[3]!==e.id?(c=()=>n(e.id),t[2]=n,t[3]=e.id,t[4]=c):c=t[4],t[5]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(go,{className:"w-5 h-5"}),t[5]=d):d=t[5],t[6]!==c?(u=h.jsxs("div",{className:"flex justify-between",children:[l,h.jsx(De,{variant:"text","data-testid":"remove-banner-button",size:"icon",onClick:c,children:d})]}),t[6]=c,t[7]=u):u=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(f=h.jsx("p",{children:"The following packages were not found:"}),t[8]=f):f=t[8],t[9]!==s||t[10]!==a||t[11]!==e.packages){let x;t[13]!==s||t[14]!==a?(x=(y,v)=>h.jsxs("li",{className:"flex items-center gap-1 font-mono text-sm",children:[h.jsx(ba,{size:"1rem"}),y,a&&h.jsx(Z7,{value:s[y]??"latest",onChange:S=>i(k=>({...k,[y]:S})),packageName:y})]},v),t[13]=s,t[14]=a,t[15]=x):x=t[15],m=e.packages.map(x),t[9]=s,t[10]=a,t[11]=e.packages,t[12]=m}else m=t[12];return t[16]!==m?(_=h.jsxs("div",{children:[f,h.jsx("ul",{className:"list-disc ml-4 mt-1",children:m})]}),t[16]=m,t[17]=_):_=t[17],t[18]!==n||t[19]!==s||t[20]!==e.id||t[21]!==e.isolated||t[22]!==e.packages||t[23]!==o.package_management.manager?(g=h.jsx("div",{className:"ml-auto flex flex-row items-baseline",children:e.isolated?h.jsxs(h.Fragment,{children:[h.jsx(K7,{manager:o.package_management.manager,packages:e.packages,versions:s,clearPackageAlert:()=>n(e.id)}),!Bn()&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"px-2 text-sm",children:"with"})," ",h.jsx(X7,{})]})]}):h.jsxs("p",{children:["If you set up a"," ",h.jsx(mm,{href:"https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments",children:"virtual environment"}),", marimo can install these packages for you."]})}),t[18]=n,t[19]=s,t[20]=e.id,t[21]=e.isolated,t[22]=e.packages,t[23]=o.package_management.manager,t[24]=g):g=t[24],t[25]!==_||t[26]!==g?(p=h.jsxs("div",{className:"flex flex-col gap-4 justify-between items-start text-muted-foreground text-base",children:[_,g]}),t[25]=_,t[26]=g,t[27]=p):p=t[27],t[28]!==u||t[29]!==p?(b=h.jsx("div",{className:"flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-[200] opacity-95",children:h.jsxs(Rc,{kind:"danger",className:"flex flex-col rounded py-3 px-5 animate-in slide-in-from-left",children:[u,p]})}),t[28]=u,t[29]=p,t[30]=b):b=t[30],b}if(A$(e)){let l;t[31]!==e.packages?(l=function(M){const L=new Set(Object.values(M)),B=L.has("queued")||L.has("installing")?"installing":L.has("failed")?"failed":"installed";return B==="installing"?{status:"installing",title:"Installing packages",titleIcon:h.jsx(ka,{className:"w-5 h-5 inline-block mr-2"}),description:"Installing packages:"}:B==="installed"?{status:"installed",title:"All packages installed!",titleIcon:h.jsx(Ip,{className:"w-5 h-5 inline-block mr-2"}),description:"Installed packages:"}:{status:"failed",title:"Some packages failed to install",titleIcon:h.jsx(Jc,{className:"w-5 h-5 inline-block mr-2"}),description:"See terminal for error logs."}}(e.packages),t[31]=e.packages,t[32]=l):l=t[32];const{status:c,title:d,titleIcon:u,description:f}=l;c==="installed"&&setTimeout(()=>n(e.id),1e4);const m=c==="failed"?"danger":"info";let _,g,p,b,x;t[33]!==d||t[34]!==u?(_=h.jsxs("span",{className:"font-bold text-lg flex items-center mb-2",children:[u,d]}),t[33]=d,t[34]=u,t[35]=_):_=t[35],t[36]!==n||t[37]!==e.id?(g=()=>n(e.id),t[36]=n,t[37]=e.id,t[38]=g):g=t[38],t[39]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(go,{className:"w-5 h-5"}),t[39]=p):p=t[39],t[40]!==g?(b=h.jsx(De,{variant:"text","data-testid":"remove-banner-button",size:"icon",onClick:g,children:p}),t[40]=g,t[41]=b):b=t[41],t[42]!==_||t[43]!==b?(x=h.jsxs("div",{className:"flex justify-between",children:[_,b]}),t[42]=_,t[43]=b,t[44]=x):x=t[44];const y=c==="installed"&&"text-accent-foreground";let v,S,k,E,j,I,T;if(t[45]!==y?(v=Te("flex flex-col gap-4 justify-between items-start text-muted-foreground text-base",y),t[45]=y,t[46]=v):v=t[46],t[47]!==f?(S=h.jsx("p",{children:f}),t[47]=f,t[48]=S):S=t[48],t[49]!==e.packages||t[50]!==c){let M;t[52]!==c?(M=(L,B)=>{const[O,z]=L;return h.jsxs("li",{className:Te("flex items-center gap-1 font-mono text-sm",z==="installing"&&"font-semibold",z==="failed"&&"text-destructive",z==="installed"&&"text-accent-foreground",z==="installed"&&c==="failed"&&"text-muted-foreground"),children:[h.jsx(J7,{status:z}),O]},B)},t[52]=c,t[53]=M):M=t[53],k=Object.entries(e.packages).map(M),t[49]=e.packages,t[50]=c,t[51]=k}else k=t[51];return t[54]!==k?(E=h.jsx("ul",{className:"list-disc ml-4 mt-1",children:k}),t[54]=k,t[55]=E):E=t[55],t[56]!==S||t[57]!==E?(j=h.jsxs("div",{children:[S,E]}),t[56]=S,t[57]=E,t[58]=j):j=t[58],t[59]!==j||t[60]!==v?(I=h.jsx("div",{className:v,children:j}),t[59]=j,t[60]=v,t[61]=I):I=t[61],t[62]!==I||t[63]!==m||t[64]!==x?(T=h.jsx("div",{className:"flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-[200] opacity-95",children:h.jsxs(Rc,{kind:m,className:"flex flex-col rounded pt-3 pb-4 px-5",children:[x,I]})}),t[62]=I,t[63]=m,t[64]=x,t[65]=T):T=t[65],T}return nc(e),null},J7=t=>{const e=X.c(4),{status:n}=t;switch(n){case"queued":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(ba,{size:"1rem"}),e[0]=o):o=e[0],o}case"installing":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(ka,{size:"1rem"}),e[1]=o):o=e[1],o}case"installed":{let o;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(gc,{size:"1rem"}),e[2]=o):o=e[2],o}case"failed":{let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(go,{size:"1rem"}),e[3]=o):o=e[3],o}default:return nc(n),null}},K7=t=>{const e=X.c(9),{manager:n,packages:o,versions:r,clearPackageAlert:s}=t;let i,a,l,c;return e[0]!==s||e[1]!==n||e[2]!==o||e[3]!==r?(i=async()=>{s();const d={...r};for(const u of o)d[u]=d[u]??"";await EU({manager:n,versions:d}).catch(Q7)},e[0]=s,e[1]=n,e[2]=o,e[3]=r,e[4]=i):i=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(ka,{className:"w-4 h-4 mr-2"}),l=h.jsx("span",{className:"font-semibold",children:"Install"}),e[5]=a,e[6]=l):(a=e[5],l=e[6]),e[7]!==i?(c=h.jsxs(De,{variant:"outline","data-testid":"install-packages-button",size:"sm",onClick:i,children:[a,l]}),e[7]=i,e[8]=c):c=e[8],c},X7=()=>{const t=X.c(16),[e,n]=Ds();let o,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=V3(CU),t[0]=o):o=t[0],t[1]!==e?(r={resolver:o,defaultValues:e},t[1]=e,t[2]=r):r=t[2];const s=$3(r);let i;t[3]!==n?(i=async f=>{await Rs({config:f}).then(()=>{n(f)})},t[3]=n,t[4]=i):i=t[4];const a=i;let l,c,d,u;return t[5]!==s||t[6]!==a?(l=s.handleSubmit(a),t[5]=s,t[6]=a,t[7]=l):l=t[7],t[8]!==s.control?(c=h.jsx("div",{className:"flex flex-col gap-3",children:h.jsx(F3,{control:s.control,name:"package_management.manager",render:tM})}),t[8]=s.control,t[9]=c):c=t[9],t[10]!==l||t[11]!==c?(d=h.jsx("form",{onChange:l,className:"flex flex-col gap-5",children:c}),t[10]=l,t[11]=c,t[12]=d):d=t[12],t[13]!==s||t[14]!==d?(u=h.jsx(NU,{...s,children:d}),t[13]=s,t[14]=d,t[15]=u):u=t[15],u},Z7=t=>{const e=X.c(21),{value:n,onChange:o,packageName:r}=t;let s,i;e[0]!==r?(s=async()=>{const g=await fetch(`https://pypi.org/pypi/${function(b){return b.replaceAll(/\[.*]/g,"").trim()}(r)}/json`,{method:"GET",signal:AbortSignal.timeout(5e3)}),p=await g.json();return["latest",...Object.keys(p.releases).sort(G7).slice(0,100)]},i=[r],e[0]=r,e[1]=s,e[2]=i):(s=e[1],i=e[2]);const{data:a,loading:l,error:c}=Xn(s,i);let d;e[3]!==a?(d=a===void 0?[]:a,e[3]=a,e[4]=d):d=e[4];const u=d;if(c){let g,p,b;return e[5]!==o?(g=x=>o(x.target.value),e[5]=o,e[6]=g):g=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx("option",{value:"latest",children:"latest"}),e[7]=p):p=e[7],e[8]!==g||e[9]!==n?(b=h.jsx(Oe,{content:"Failed to fetch package versions",children:h.jsx(Bm,{value:n,onChange:g,disabled:!0,className:"inline-flex ml-2",children:p})}),e[8]=g,e[9]=n,e[10]=b):b=e[10],b}let f,m,_;return e[11]!==o?(f=g=>o(g.target.value),e[11]=o,e[12]=f):f=e[12],e[13]!==u||e[14]!==l?(m=l?h.jsx("option",{value:"latest",children:"latest"}):u.map(nM),e[13]=u,e[14]=l,e[15]=m):m=e[15],e[16]!==l||e[17]!==f||e[18]!==m||e[19]!==n?(_=h.jsx(Bm,{value:n,onChange:f,disabled:l,className:"inline-flex ml-2",children:m}),e[16]=l,e[17]=f,e[18]=m,e[19]=n,e[20]=_):_=e[20],_};function Q7(t){Zt.error(t)}function eM(t){return h.jsx("option",{value:t,children:t},t)}function tM(t){const{field:e}=t;return h.jsxs(z3,{children:[h.jsx(B3,{children:h.jsx(Bm,{"data-testid":"install-package-manager-select",onChange:n=>e.onChange(n.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:jU.map(eM)})}),h.jsx(U3,{})]})}function nM(t){return h.jsx("option",{value:t,children:t},t)}const oM=t=>{let{transform:e}=t;return{...e,x:0}},rM={threshold:{x:0,y:.1}},sM=K.memo(t=>{const e=X.c(23),{children:n,multiColumn:o}=t,{dropCellOverCell:r,dropCellOverColumn:s,moveColumn:i,compactColumns:a}=Lt(),[l,c]=A.useState(null),[d,u]=A.useState(null),[f]=O3();let m;e:{if(f.width==="columns"){m=Um.EMPTY;break e}let O;e[0]===Symbol.for("react.memo_cache_sentinel")?(O=[oM],e[0]=O):O=e[0],m=O}const _=m;let g,p;e[1]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:8}},e[1]=g):g=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(p={coordinateGetter:t5},e[2]=p):p=e[2];const b=function(){for(var O=arguments.length,z=new Array(O),F=0;F<O;F++)z[F]=arguments[F];return A.useMemo(()=>[...z].filter(V=>V!=null),[...z])}(T_(au,g),T_(su,p));let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=O=>{c(O.active.id);const z=fo();u(z.cellIds)},e[3]=x):x=e[3];const y=Qe(x);let v;e[4]!==d?(v=()=>{c(null),u(null)},e[4]=d,e[5]=v):v=e[5];const S=Qe(v);let k;e[6]!==l?(k=O=>{const z=O.droppableContainers.filter(iM);if(l&&rs(l))return eu({...O,droppableContainers:z});const F=(N=>{let{droppableContainers:H,droppableRects:Y,pointerCoordinates:Q}=N;if(!Q)return[];const q=[];for(const re of H){const{id:ne}=re,oe=Y.get(ne);if(oe&&yE(Q,oe)){const G=Zd(oe).reduce((ce,fe)=>ce+Kd(Q,fe),0),Z=Number((G/4).toFixed(4));q.push({id:ne,data:{droppableContainer:re,value:Z}})}}return q.sort(Xd)})({...O,droppableContainers:z}),V=Qd(F.length>0?F:O_({...O,droppableContainers:z}),"id");if(!V)return[];zo(rs(V),`Expected column id. Got: ${V}`);const P=fo().cellIds.get(V);if(zo(P,`Expected column. Got: ${V}`),P&&P.topLevelIds.length===0)return[{id:V}];const C=new Set(P.topLevelIds),$=eu({...O,droppableContainers:O.droppableContainers.filter(N=>N.id!==V&&C.has(N.id))});if($.length>0){const N=$[0].id;return zo(Lu(N),`Expected cell id. Got: ${N}`),[{id:N}]}return[]},e[6]=l,e[7]=k):k=e[7];const E=k;let j;e[8]!==r||e[9]!==s||e[10]!==i?(j=O=>{const{active:z,over:F}=O,V=F==null?void 0:F.id;if(V!=null&&z.id!==V){if(Lu(z.id)){if(rs(V))return void s({cellId:z.id,columnId:V});if(Lu(V))return void r({cellId:z.id,overCellId:V})}rs(z.id)&&rs(V)&&i({column:z.id,overColumn:V})}},e[8]=r,e[9]=s,e[10]=i,e[11]=j):j=e[11];const I=Qe(j);let T;e[12]!==a?(T=O=>{const{active:z,over:F}=O;F!==null&&z.id!==F.id&&a()},e[12]=a,e[13]=T):T=e[13];const M=Qe(T),L=o?E:eu;let B;return e[14]!==n||e[15]!==S||e[16]!==M||e[17]!==I||e[18]!==y||e[19]!==_||e[20]!==b||e[21]!==L?(B=h.jsx(VE,{autoScroll:rM,sensors:b,collisionDetection:L,modifiers:_,onDragEnd:M,onDragStart:y,onDragCancel:S,onDragOver:I,children:n}),e[14]=n,e[15]=S,e[16]=M,e[17]=I,e[18]=y,e[19]=_,e[20]=b,e[21]=L,e[22]=B):B=e[22],B});function Lu(t){return typeof t=="string"&&!t.startsWith("tree_")}function rs(t){return typeof t=="string"&&t.startsWith("tree_")}function iM(t){return rs(t.id)}const kx=K.forwardRef((t,e)=>{const n=X.c(62);let o,r,s,i,a,l;n[0]!==t?({columnId:i,canDelete:o,canMoveLeft:r,canMoveRight:s,...a}=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]),n[6]!==i?(l={id:i},n[6]=i,n[7]=l):l=n[7];const{attributes:c,listeners:d,setNodeRef:u,transform:f,transition:m,isDragging:_,isOver:g}=l0(l);let p;n[8]!==f?(p=f?Mc.Transform.toString({x:f.x,y:0,scaleX:1,scaleY:1}):void 0,n[8]=f,n[9]=p):p=n[9];const b=_?2:void 0;let x;n[10]!==p||n[11]!==b||n[12]!==m?(x={transform:p,transition:m,zIndex:b,position:"relative","--gutter-width":"50px"},n[10]=p,n[11]=b,n[12]=m,n[13]=x):x=n[13];const y=x,{deleteColumn:v,moveColumn:S,addColumn:k}=Lt();let E;n[14]===Symbol.for("react.memo_cache_sentinel")?(E=Te("h-full hover:bg-muted rounded-none"),n[14]=E):E=n[14];const j=E,I=lM;let T;n[15]!==i||n[16]!==S?(T=()=>S({column:i,overColumn:"_left_"}),n[15]=i,n[16]=S,n[17]=T):T=n[17];const M=!r;let L,B,O;n[18]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx(M3,{className:"size-4"}),n[18]=L):L=n[18],n[19]!==T||n[20]!==M?(B=h.jsx(Oe,{content:"Move column left",side:"top",delayDuration:300,children:h.jsx(De,{variant:"text",size:"sm",className:j,onClick:T,disabled:M,children:L})}),n[19]=T,n[20]=M,n[21]=B):B=n[21],n[22]!==i||n[23]!==S?(O=()=>S({column:i,overColumn:"_right_"}),n[22]=i,n[23]=S,n[24]=O):O=n[24];const z=!s;let F,V,P,C,$,N,H,Y;n[25]===Symbol.for("react.memo_cache_sentinel")?(F=h.jsx(ac,{className:"size-4"}),n[25]=F):F=n[25],n[26]!==O||n[27]!==z?(V=h.jsx(Oe,{content:"Move column right",side:"top",delayDuration:300,children:h.jsx(De,{variant:"text",size:"sm",className:j,onClick:O,disabled:z,children:F})}),n[26]=O,n[27]=z,n[28]=V):V=n[28],n[29]!==c||n[30]!==d?(P=h.jsx("div",{className:"flex gap-2 h-full flex-grow active:bg-accent cursor-grab",...c,...d,"data-testid":"column-drag-button"}),n[29]=c,n[30]=d,n[31]=P):P=n[31],n[32]!==o||n[33]!==i||n[34]!==v?(C=o&&h.jsx(Oe,{content:"Delete column",side:"top",delayDuration:300,children:h.jsx(De,{variant:"text",size:"sm",className:"opacity-0 group-hover:opacity-70 group-hover:hover:opacity-100 text-destructive h-full hover:bg-destructive/20 rounded-none",onClick:()=>v({columnId:i}),children:h.jsx(go,{className:"size-4"})})}),n[32]=o,n[33]=i,n[34]=v,n[35]=C):C=n[35],n[36]!==k||n[37]!==i?($=()=>{k({columnId:i}),requestAnimationFrame(I)},n[36]=k,n[37]=i,n[38]=$):$=n[38],n[39]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx(Or,{className:"size-4"}),n[39]=N):N=n[39],n[40]!==$?(H=h.jsx(Oe,{content:"Add column",side:"top",delayDuration:300,children:h.jsx(De,{variant:"text",size:"sm",className:j,onClick:$,children:N})}),n[40]=$,n[41]=H):H=n[41],n[42]!==V||n[43]!==P||n[44]!==C||n[45]!==H||n[46]!==B?(Y=h.jsxs("div",{className:"h-6 group flex items-center rounded-t-lg border hover:border-border border-[var(--slate-3)] overflow-hidden bg-[var(--slate-1)]",children:[B,V,P,C,H]}),n[42]=V,n[43]=P,n[44]=C,n[45]=H,n[46]=B,n[47]=Y):Y=n[47];const Q=Y;let q;n[48]!==e||n[49]!==u?(q=ce=>{ml(e,u)(ce)},n[48]=e,n[49]=u,n[50]=q):q=n[50];const re=_?"":a.className,ne=_?"z-20":"z-1 hover:z-10 focus-within:z-10",oe=g&&"bg-accent/20";let G,Z;return n[51]!==re||n[52]!==ne||n[53]!==oe?(G=Te(re,ne,oe),n[51]=re,n[52]=ne,n[53]=oe,n[54]=G):G=n[54],n[55]!==Q||n[56]!==_||n[57]!==a||n[58]!==y||n[59]!==q||n[60]!==G?(Z=h.jsxs("div",{tabIndex:-1,ref:q,...a,style:y,"data-is-dragging":_,className:G,children:[Q,a.children]}),n[55]=Q,n[56]=_,n[57]=a,n[58]=y,n[59]=q,n[60]=G,n[61]=Z):Z=n[61],Z});kx.displayName="SortableColumn";const aM=A.memo(kx);function lM(){const t=document.getElementById("App");t&&t.scrollTo({left:t.scrollLeft+1e3,behavior:"smooth"})}const{getColumnWidth:cM,saveColumnWidth:dM}=IU,Sx=A.memo(t=>{const e=X.c(14),n=A.useRef(null);let o;e[0]!==t.children||e[1]!==t.index||e[2]!==t.width?(o=t.width==="columns"?h.jsx(uM,{startingWidth:cM(t.index),onResize:i=>{dM(t.index,i)},children:t.children}):h.jsx("div",{className:"flex flex-col gap-5",children:t.children}),e[0]=t.children,e[1]=t.index,e[2]=t.width,e[3]=o):o=e[3];const r=o;if(t.width==="columns"){let i;return e[4]!==r||e[5]!==t.canDelete||e[6]!==t.canMoveLeft||e[7]!==t.canMoveRight||e[8]!==t.columnId||e[9]!==t.footer?(i=h.jsxs(aM,{tabIndex:-1,ref:n,canDelete:t.canDelete,columnId:t.columnId,canMoveLeft:t.canMoveLeft,canMoveRight:t.canMoveRight,className:"group/column",children:[r,t.footer]}),e[4]=r,e[5]=t.canDelete,e[6]=t.canMoveLeft,e[7]=t.canMoveRight,e[8]=t.columnId,e[9]=t.footer,e[10]=i):i=e[10],i}let s;return e[11]!==r||e[12]!==t.footer?(s=h.jsxs(h.Fragment,{children:[r,t.footer]}),e[11]=r,e[12]=t.footer,e[13]=s):s=e[13],s});Sx.displayName="Column";const uM=t=>{const e=X.c(15),{startingWidth:n,onResize:o,children:r}=t;let s;e[0]!==o||e[1]!==n?(s={startingWidth:n,onResize:o},e[0]=o,e[1]=n,e[2]=s):s=e[2];const{resizableDivRef:i,handleRefs:a,style:l}=AU(s),c=hM;let d,u,f,m;return e[3]!==a.left?(d=c(a.left),e[3]=a.left,e[4]=d):d=e[4],e[5]!==r||e[6]!==i||e[7]!==l?(u=h.jsx("div",{ref:i,className:"flex flex-col gap-5 box-content min-h-[100px] px-11 py-6 min-w-[500px] z-1",style:l,children:r}),e[5]=r,e[6]=i,e[7]=l,e[8]=u):u=e[8],e[9]!==a.right?(f=c(a.right),e[9]=a.right,e[10]=f):f=e[10],e[11]!==d||e[12]!==u||e[13]!==f?(m=h.jsxs("div",{className:"flex flex-row",children:[d,u,f]}),e[11]=d,e[12]=u,e[13]=f,e[14]=m):m=e[14],m};function hM(t){return h.jsx("div",{ref:t,className:`w-[3px] cursor-col-resize transition-colors duration-200 z-[100]
112
+ `);o!==r&&this.getTextFromDoc(this.doc).delete(o+n,r-o),l.length>0&&this.getTextFromDoc(this.doc).insert(o+n,l),n+=l.length-(r-o)}),this.doc.commit()}destroy(){var e;(e=this.sub)==null||e.call(this),this.sub=void 0}}const I7=st.baseTheme({".loro-cursor":{position:"absolute",width:"2px",display:"inline-block",height:"1.2em"},".loro-cursor::before":{position:"absolute",top:"1.3em",left:"0",content:"var(--rtc-name)",padding:"2px 6px",fontSize:"12px",borderRadius:"3px",whiteSpace:"nowrap",userSelect:"none",backgroundColor:"inherit",opacity:"0.7"},".loro-selection":{opacity:"0.5"}}),Mi=Ut.define(),Mu=En.define({create:()=>({remoteCursors:new Map,isCheckout:!1}),update(t,e){for(const n of e.effects)if(n.is(Mi))switch(n.value.type){case"update":{const{peer:o,user:r,cursor:s}=n.value;t.remoteCursors.set(o,{uid:o,cursor:s,user:r});break}case"delete":t.remoteCursors.delete(n.value.peer);break;case"checkout":t.isCheckout=n.value.checkout}return t}}),cx=t=>{const e=t.transactions.flatMap(n=>n.effects).filter(n=>n.is(Mi));return t.docChanged||t.viewportChanged||e.length>0};class vl{constructor(e,n,o,r,s){this.left=e,this.top=n,this.height=o,this.name=r,this.colorClassName=s}draw(){const e=document.createElement("div");return this.adjust(e),e}update(e){return this.adjust(e),!0}adjust(e){e.style.left=`${this.left}px`,e.style.top=`${this.top}px`,e.style.height=`${this.height}px`,e.className=`loro-cursor ${this.colorClassName}`,e.style.setProperty("--rtc-name",`"${this.name}"`)}eq(e){return this.left===e.left&&this.top===e.top&&this.height===e.height&&this.name===e.name}static createCursor(e,n,o,r){const s=vl.calculateAbsoluteCursorPosition(n,e);if(!s)return[];const i=e.scrollDOM.getBoundingClientRect(),a=(e.textDirection===lU.LTR?i.left:i.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,l=i.top-e.scrollDOM.scrollTop;return[new vl(s.left-a,s.top-l,s.bottom-s.top,o,r)]}static calculateAbsoluteCursorPosition(e,n){const o=Math.max(0,Math.min(n.state.doc.length,e.anchor));return n.coordsAtPos(o,e.assoc||1)}}const A7=(t,e,n,o)=>{const r=[],{updated:s,added:i}=n;for(const a of[...s,...i]){const l=dx(t,e,a,o);l&&r.push(l)}return r},dx=(t,e,n,o)=>{const r=e.getAllStates()[n];if(!r||n===t.peerIdStr||r.scopeId!==o)return;if(r.type==="delete")return Mi.of({type:"delete",peer:r.uid,scopeId:r.scopeId});const s=Gn.decode(r.cursor.anchor),i=t.getCursorPos(s).offset;let a=i;if(r.cursor.head){const l=Gn.decode(r.cursor.head);a=t.getCursorPos(l).offset}return Mi.of({type:"update",peer:r.uid,scopeId:r.scopeId,cursor:{anchor:i,head:a},user:r.user})};class T7{constructor(e,n,o,r,s,i,a){this.view=e,this.doc=n,this.user=o,this.awareness=r,this.getTextFromDoc=s,this.scopeId=i,this.getUserId=a,this.sub=void 0,this.sub=this.doc.subscribe(l=>{if(l.by==="local"){const c=[];for(const d of this.awareness.peers()){const u=dx(this.doc,this.awareness,d,this.scopeId);u&&c.push(u)}this.view.dispatch({effects:c})}else l.by==="checkout"&&this.view.dispatch({effects:[Mi.of({type:"checkout",checkout:this.doc.isDetached()})]})})}update(e){if(!e.selectionSet&&!e.focusChanged&&!e.docChanged)return;const n=e.state.selection.main;if(this.view.hasFocus&&!this.doc.isDetached()){const o=O7(this.doc,this.getTextFromDoc,n.anchor,n.head);this.awareness.setLocalState({type:"update",uid:this.getUserId?this.getUserId():this.doc.peerIdStr,scopeId:this.scopeId,cursor:o,user:this.user})}else this.awareness.setLocalState({type:"delete",uid:this.getUserId?this.getUserId():this.doc.peerIdStr,scopeId:this.scopeId})}destroy(){var e;(e=this.sub)==null||e.call(this),this.awareness.setLocalState({type:"delete",uid:this.getUserId?this.getUserId():this.doc.peerIdStr,scopeId:this.scopeId})}}class M7{constructor(e,n,o,r){this.view=e,this.doc=n,this.awareness=o,this.scopeId=r,this._awarenessListener=void 0;const s=async(i,a)=>{a!=="local"&&this.view.dispatch({effects:A7(this.doc,this.awareness,i,this.scopeId)})};this._awarenessListener=s,this.awareness.addListener(s)}destroy(){this._awarenessListener&&this.awareness.removeListener(this._awarenessListener)}}const O7=(t,e,n,o)=>{var i,a;n===o&&(o=void 0);const r=(i=e(t).getCursor(n))==null?void 0:i.encode();if(!r)throw new Error("cursor head not found");let s;return o!==void 0&&(s=(a=e(t).getCursor(o))==null?void 0:a.encode()),{anchor:r,head:s}},kl=["bg-[var(--amber-6)]","bg-[var(--blue-6)]","bg-[var(--crimson-6)]","bg-[var(--cyan-6)]","bg-[var(--grass-6)]","bg-[var(--gray-6)]","bg-[var(--green-6)]","bg-[var(--lime-6)]","bg-[var(--orange-6)]","bg-[var(--purple-6)]","bg-[var(--red-6)]","bg-[var(--sage-6)]","bg-[var(--sky-6)]","bg-[var(--slate-6)]"],cn=Zt.get("rtc"),ux=cn.get("awareness").disabled(),Ou="awareness:",os=qt(void 0),Ht=new bo,Sl=new class{constructor(t,e=3e4){this.listeners=new Set,this.inner=new eb(t,e),this.peer=t,this.timeout=e}apply(t,e="remote"){const{updated:n,added:o}=this.inner.apply(t);this.listeners.forEach(r=>{r({updated:n,added:o,removed:[]},e)}),this.startTimerIfNotEmpty()}setLocalState(t){const e=this.inner.getState(this.peer)==null;this.inner.setLocalState(t),e?this.listeners.forEach(n=>{n({updated:[],added:[this.inner.peer()],removed:[]},"local")}):this.listeners.forEach(n=>{n({updated:[this.inner.peer()],added:[],removed:[]},"local")}),this.startTimerIfNotEmpty()}getLocalState(){return this.inner.getState(this.peer)}getAllStates(){return this.inner.getAllStates()}encode(t){return this.inner.encode(t)}encodeAll(){return this.inner.encodeAll()}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}peers(){return this.inner.peers()}destroy(){clearInterval(this.timer),this.listeners.clear()}startTimerIfNotEmpty(){this.inner.isEmpty()||this.timer!=null||(this.timer=setInterval(()=>{const t=this.inner.removeOutdated();t.length>0&&this.listeners.forEach(e=>{e({updated:[],added:[],removed:t},"timeout")}),this.inner.isEmpty()&&(clearInterval(this.timer),this.timer=void 0)},this.timeout/2))}}(Ht.peerIdStr),Du=dU(()=>{cn.debug("creating websocket");const t=uU(w4()).replace("/ws","/ws_sync"),e=new S$(t,void 0,{maxRetries:10,debug:!1,startClosed:!0,connectionTimeout:1e4});return Promise.resolve().then(async()=>{await hU(),fU()==="edit"&&e.reconnect()}),e.addEventListener("message",async n=>{const o=n.data,r=await o.arrayBuffer(),s=new Uint8Array(r);if(function(i,a){return new TextDecoder().decode(i.slice(0,a.length))===a}(s,Ou)){const i=function(a,l){return a.slice(l.length)}(s,Ou);return Sl.apply(i),void ux.debug("applied awareness update")}Ht.import(s),cn.debug("imported doc change. new doc:",Ht.toJSON()),ut.get(os)!==Ht&&ut.set(os,Ht)}),e.addEventListener("open",()=>{cn.debug("websocket open")}),e.addEventListener("close",n=>{cn.warn("websocket close",n),ut.get(os)===Ht&&ut.set(os,void 0)}),e});function Ru(t,e,n=""){if(Bn())return{extension:[],code:n};const o=Ht.getByPath(`codes/${t}`)!==void 0,r=Ht.getMap("codes").getOrCreateContainer(t,new Xo);o||(cn.log("initializing code for new cell",n),r.insert(0,n));const s={get name(){return ut.get(v4)||"Anonymous"},get colorClassName(){return(i=>{if(typeof i=="string"){let a=0;for(let l=0;l<i.length;l++)a=(a<<5)-a+i.charCodeAt(l),a=Math.trunc(a);return kl[Math.abs(a)%kl.length]}return kl[i%kl.length]})(this.name)}};return{code:n.toString(),extension:[D7(t),R7(t),P7(Ht,Sl,s,()=>r,t),j7(Ht,["codes",t],()=>r)]}}function D7(t){const e=(o,r)=>{const s=o.state.field(Sc).type,i=r.toString();i&&i!==s&&(cn.debug(`[incoming] setting language type: ${s} -> ${i}`),Ir(o,i,{keepCodeAsIs:!0}))},n=(o,r)=>{const s=o.state.field(Dm),i=r.toJSON();ra(s,i)||o.dispatch({effects:[y4.of(i)],annotations:[ns.of(!0)]})};return Zn.define(o=>{let r;return Promise.resolve().then(()=>{const s=Ht.getByPath(`languages/${t}`);if(!s)return void cn.error("no language container found for cell",t);zo(s instanceof Xo,"language type is not a LoroText");const i=Ht.getByPath(`language_metadata/${t}`);i?(zo(i instanceof Ko,"language metadata is not a LoroMap"),e(o,s),n(o,i),r=Ht.subscribe(a=>{if(a.origin==="local")return;const l=a.events.some(d=>d.target===s.id),c=a.events.some(d=>d.target===i.id);l&&e(o,s),c&&n(o,i)})):cn.error("no language metadata container found for cell",t)}),{destroy(){r()}}})}function R7(t){const e=Ht.getMap("languages").getOrCreateContainer(t,new Xo),n=Ht.getMap("language_metadata").getOrCreateContainer(t,new Ko);return st.updateListener.of(o=>{const r=e.toString()!=="";if(!o.docChanged&&r)return;if(!r){const i=Om(o.state).type;Ir(o.view,i),cn.debug("no initial language, setting default to",i),e.delete(0,e.length),e.insert(0,i),cn.debug("no initial language metadata, setting default to",o.state.field(Dm));const a=o.state.field(Dm);for(const l of Object.keys(a))n.set(l,a[l]);return void Ht.commit()}let s=!1;for(const i of o.transactions)if(!i.annotation(ns)){for(const a of i.effects)if(a.is(cU)&&e.toString()!==a.value.type&&(cn.debug(`[outgoing] language change: ${e} -> ${a.value.type}`),e.delete(0,e.length),e.insert(0,a.value.type),s=!0),a.is(y4)||a.is(x4)){const l=a.value;a.is(x4)?(cn.debug("[outgoing] setting language metadata: ",l),n.clear()):cn.debug("[outgoing] updating language metadata: ",l);for(const c of Object.keys(l))n.set(c,l[c]);s=!0}}s&&Ht.commit()})}function P7(t,e,n,o,r,s){const i=`loro:cell:${r}`;return[Mu,b4({above:!0,class:"loro-cursor-layer",update:cx,markers:a=>{const{remoteCursors:l,isCheckout:c}=a.state.field(Mu);return c?[]:[...l.values()].flatMap(d=>{var f,m;const u=Bo.cursor(d.cursor.anchor);return vl.createCursor(a,u,((f=d.user)==null?void 0:f.name)||"unknown",((m=d.user)==null?void 0:m.colorClassName)||"")})}}),b4({above:!1,class:"loro-selection-layer",update:cx,markers:a=>{const{remoteCursors:l,isCheckout:c}=a.state.field(Mu);return c?[]:[...l.entries()].filter(([,d])=>d.cursor.head!==void 0&&d.cursor.anchor!==d.cursor.head).flatMap(([,d])=>{var f;const u=Bo.range(d.cursor.anchor,d.cursor.head);return aU.forRange(a,`loro-selection ${((f=d.user)==null?void 0:f.colorClassName)||""}`,u)})}}),Zn.define(a=>new T7(a,t,n,e,o,i,s)),Zn.define(a=>new M7(a,t,e,i)),I7]}ga()&&Du(),Ht.subscribeLocalUpdates(t=>{cn.debug("local update, sending to server"),Du().send(t)}),Sl.addListener((t,e)=>{const n=[...t.added,...t.removed,...t.updated];e==="local"&&(ux.debug("awareness changes",n),Du().send(function(o,r){const s=new TextEncoder().encode(o);return new Uint8Array([...s,...r])}(Ou,Sl.encode(n))))});const hx=({theme:t,showPlaceholder:e,allowFocus:n,id:o,config:r,code:s,status:i,serializedEditorState:a,setEditorView:l,runCell:c,userConfig:d,editorViewRef:u,editorViewParentRef:f,hidden:m,hasOutput:_,temporarilyShowCode:g,languageAdapter:p,setLanguageAdapter:b,showLanguageToggles:x=!0})=>{var re;const[y,v]=hn(Aa),S=mU(),k=sd(),{saveOrNameNotebook:E}=Pg(),j=i==="running"||i==="queued",I=Lt(),T=Zp(),M=p==="markdown",L=Qe(()=>!j&&(k({cellId:o}),!0)),B=Qe(()=>!j&&(c(),!0)),O=Qe(()=>{const ne=!r.hide_code;return Ar({configs:{[o]:{hide_code:ne}}}),I.updateCellConfig({cellId:o,config:{hide_code:ne}}),ne}),z=$e(Ts),F=Qe(()=>{ar(z,I.createNewCell)}),V=pU(d),P=A.useMemo(()=>{const ne=tE({cellId:o,showPlaceholder:e,enableAI:V,cellActions:{...I,afterToggleMarkdown:F,onRun:B,deleteCell:L,saveNotebook:E,createManyBelow:oe=>{for(const G of[...oe].reverse())I.createNewCell({code:G,before:!1,cellId:o,skipIfCodeExists:!0})},splitCell:T,toggleHideCode:O,aiCellCompletion:()=>{let oe=!1;return v(G=>(G==null?void 0:G.cellId)===o?(oe=!0,null):{cellId:o}),oe}},completionConfig:d.completion,keymapConfig:d.keymap,lspConfig:d.language_servers,theme:t,hotkeys:new k4(d.keymap.overrides??{}),diagnosticsConfig:d.diagnostics});return ne.push(Zn.define(oe=>{const G=oe.state.field(Sc);return b(G.type),{update(Z){const ce=Z.state.field(Sc);b(ce.type)}}}),st.updateListener.of(oe=>{oe.selectionSet&&oe.state.selection.ranges.some(G=>G.from!==G.to)&&g({focus:!1})})),ne},[o,d.keymap,d.completion,d.language_servers,d.diagnostics,V,t,e,I,T,O,L,B,v,F,b,g,E]),C=ga(),$=Qe(()=>{if(C){const oe=Ru(o,0,s);P.push(oe.extension),s=oe.code}const ne=new st({state:ca.create({doc:s,extensions:P})});l(ne),C||Ir(ne,Om(ne.state).type)}),N=Qe(()=>{if(zo(u.current!==null,"Editor view is not initialized"),C){const ne=Ru(o);P.push(ne.extension)}u.current.dispatch({effects:[Ut.reconfigure.of([P]),gU(u.current,d.completion,new k4(d.keymap.overrides??{}),{...d.language_servers,diagnostics:d.diagnostics})]})}),H=Qe(()=>{if(zo(a,"Editor view is not initialized"),C){const oe=Ru(o,0,s);P.push(oe.extension),s=oe.code}const ne=new st({state:ca.fromJSON(a,{doc:s,extensions:P},{history:_U})});C||Ir(ne,Om(ne.state).type),l(ne),I.clearSerializedEditorState({cellId:o})});A.useEffect(()=>{a===null?u.current===null?$():N():H(),u.current!==null&&f&&f.current!==null&&f.current.replaceChildren(u.current.dom)},[$,N,H,u,f,a,P]);const Y=(u.current===null||a!==null)&&!ga();A.useEffect(()=>{const ne=ut.get(bm).scrollKey!==null;Y&&n&&!ne&&requestAnimationFrame(()=>{var oe,G;(oe=u.current)==null||oe.focus(),(G=u.current)==null||G.dom.scrollIntoView({behavior:"smooth",block:"nearest"})})},[Y,n,u]),A.useEffect(()=>{const ne=u.current;return()=>{ne==null||ne.destroy()}},[u]);const Q=m&&!M||m&&M&&!_;let q="";return M&&m&&_?q="h-0 overflow-hidden":m&&(q="opacity-20 h-8 overflow-hidden"),h.jsx(I5,{enabled:(y==null?void 0:y.cellId)===o,initialPrompt:y==null?void 0:y.initialPrompt,currentCode:((re=u.current)==null?void 0:re.state.doc.toString())??s,currentLanguageAdapter:p,declineChange:Qe(()=>{var ne;v(null),(ne=u.current)==null||ne.focus()}),onChange:Qe(ne=>{var oe;(oe=u.current)==null||oe.dispatch({changes:{from:0,to:u.current.state.doc.length,insert:ne}})}),acceptChange:Qe(ne=>{var oe,G;(oe=u.current)==null||oe.dispatch({changes:{from:0,to:u.current.state.doc.length,insert:ne}}),(G=u.current)==null||G.focus(),v(null)}),children:h.jsxs("div",{className:"relative w-full",onFocus:()=>S(o),children:[Q&&h.jsx(S4,{tooltip:"Edit code",className:"absolute inset-0 z-10",onClick:g}),h.jsx(fx,{className:q,editorView:u.current,ref:f}),!m&&x&&h.jsx("div",{className:"absolute top-1 right-5",children:h.jsx(a5,{code:s,editorView:u.current,currentLanguageAdapter:p,onAfterToggle:F})})]})})},fx=K.forwardRef((t,e)=>{const n=X.c(10),{className:o,editorView:r}=t,s=A.useRef(null);let i,a,l,c,d;return n[0]!==r?(i=()=>{r!==null&&s.current!==null&&s.current.children.length===0&&s.current.append(r.dom)},a=[r,s],n[0]=r,n[1]=i,n[2]=a):(i=n[1],a=n[2]),A.useEffect(i,a),n[3]!==o?(l=Te("cm mathjax_ignore",o),n[3]=o,n[4]=l):l=n[4],n[5]!==e?(c=u=>{e?ml(e,s)(u):ml(s)(u)},n[5]=e,n[6]=c):c=n[6],n[7]!==l||n[8]!==c?(d=h.jsx("div",{className:l,ref:c,"data-testid":"cell-editor"}),n[7]=l,n[8]=c,n[9]=d):d=n[9],d});fx.displayName="CellCodeMirrorEditor";const Pu=ga()?function(t){const e=n=>{const o=X.c(5),r=$e(po),[s,i]=hn(os);if(r.state===en.CONNECTING||s===void 0){let l,c;return o[0]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx("span",{children:"Waiting for real-time collaboration connection..."}),o[0]=l):l=o[0],o[1]!==i?(c=h.jsx("div",{className:"flex h-full w-full items-baseline p-4",children:h.jsxs(C4,{milliseconds:1e3,fallback:null,children:[l,h.jsx(De,{variant:"link",onClick:()=>{i("disabled")},children:"Turn off real-time collaboration"})]})}),o[1]=i,o[2]=c):c=o[2],c}let a;return o[3]!==n?(a=h.jsx(t,{...n}),o[3]=n,o[4]=a):a=o[4],a};return e.displayName=`WithWaitUntilConnected(${t.displayName})`,e}(A.memo(hx)):A.memo(hx),L7=t=>{const e=X.c(10);let n,o,r,s;return e[0]!==t.left?(n=h.jsx("div",{className:"flex-1 flex item-center gap-2",children:t.left}),e[0]=t.left,e[1]=n):n=e[1],e[2]!==t.center?(o=h.jsx("div",{className:"flex-1 flex item-center gap-2 justify-center",children:t.center}),e[2]=t.center,e[3]=o):o=e[3],e[4]!==t.right?(r=h.jsx("div",{className:"flex-1 flex item-center gap-2 justify-end",children:t.right}),e[4]=t.right,e[5]=r):r=e[5],e[6]!==n||e[7]!==o||e[8]!==r?(s=h.jsxs("div",{className:"flex items-center gap-2 w-full px-3",children:[n,o,r]}),e[6]=n,e[7]=o,e[8]=r,e[9]=s):s=e[9],s},F7=t=>{const e=X.c(8);if(!t.canCollapse&&!t.isCollapsed)return null;const n=t.isCollapsed?"Expand":"Collapse";let o,r,s;return e[0]!==t.isCollapsed?(o=h.jsx("span",{children:h.jsx(z7,{isCollapsed:t.isCollapsed})}),e[0]=t.isCollapsed,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(r=h.jsx(Oe,{content:n,children:o}),e[2]=n,e[3]=o,e[4]=r):r=e[4],e[5]!==t.onClick||e[6]!==r?(s=h.jsx(De,{variant:"text",size:"icon",onClick:t.onClick,children:r}),e[5]=t.onClick,e[6]=r,e[7]=s):s=e[7],s},z7=t=>{const e=X.c(2),{isCollapsed:n}=t;let o;return e[0]!==n?(o=n?h.jsx(ac,{className:"w-5 h-5 flex-shrink-0"}):h.jsx(Zi,{className:"w-5 h-5 flex-shrink-0"}),e[0]=n,e[1]=o):o=e[1],o},mx=A.memo(t=>{const e=X.c(24),{onClick:n,count:o,cellId:r}=t,s=wc();let i;e[0]!==r||e[1]!==s?(i=bU(s,r),e[0]=r,e[1]=s,e[2]=i):i=e[2];const a=i;let l,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=Te("flex items-center justify-between w-[calc(100%-2rem)] h-9 bg-muted rounded-b mx-4 opacity-80 hover:opacity-100 cursor-pointer"),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(yU,{className:"w-4 h-4 flex-shrink-0"}),e[4]=c):c=e[4];const d=o===1?"cell":"cells";let u,f,m,_,g,p,b;return e[5]!==o||e[6]!==d?(u=h.jsxs(h.Fragment,{children:[c,h.jsxs("span",{className:"text-sm text-gray-500",children:[o," ",d," collapsed"]})]}),e[5]=o,e[6]=d,e[7]=u):u=e[7],e[8]!==a.errored?(f=a.errored&&h.jsx(Oe,{content:"Has errors",delayDuration:100,children:h.jsx(Ep,{className:"w-4 h-4 flex-shrink-0 text-destructive"})}),e[8]=a.errored,e[9]=f):f=e[9],e[10]!==a.stale?(m=a.stale&&h.jsx(Oe,{content:"Has stale cells",delayDuration:100,children:h.jsx(N4,{className:"w-4 h-4 flex-shrink-0 text-[var(--yellow-11)]"})}),e[10]=a.stale,e[11]=m):m=e[11],e[12]!==a.runningOrQueued?(_=a.runningOrQueued&&h.jsx(Oe,{content:"Running",delayDuration:100,children:h.jsx(Tm,{className:"w-4 h-4 flex-shrink-0 animate-spin"})}),e[12]=a.runningOrQueued,e[13]=_):_=e[13],e[14]!==f||e[15]!==m||e[16]!==_?(g=h.jsxs(h.Fragment,{children:[f,m,_]}),e[14]=f,e[15]=m,e[16]=_,e[17]=g):g=e[17],e[18]!==u||e[19]!==g?(p=h.jsx(L7,{center:u,right:g}),e[18]=u,e[19]=g,e[20]=p):p=e[20],e[21]!==n||e[22]!==p?(b=h.jsx("div",{onClick:n,className:l,children:p}),e[21]=n,e[22]=p,e[23]=b):b=e[23],b});mx.displayName="CollapsedCellBanner";const B7=t=>{const e=X.c(6),{appClosed:n,status:o}=t,r=Og(o==="running");let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=fn("global.interrupt"),e[0]=s):s=e[0];const i=n||!r,a=r?Rm:jn.NOOP,l=r?"stale":"disabled";let c,d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(Xf,{strokeWidth:1.5}),e[1]=c):c=e[1],e[2]!==i||e[3]!==a||e[4]!==l?(d=h.jsx(xi,{tooltip:s,disabled:i,onClick:a,variant:l,"data-testid":"run-button",children:c}),e[2]=i,e[3]=a,e[4]=l,e[5]=d):d=e[5],d},U7={width:void 0,height:void 0};function px(t,e,n){return t[e]?Array.isArray(t[e])?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}function gx(t,e){const n=X.c(9);let o;n[0]!==t.current||n[1]!==e?(o=l=>{t.current===null||t.current.contains(l.relatedTarget)||e.current===null||tm(e.current)},n[0]=t.current,n[1]=e,n[2]=o):o=n[2];const r=Qe(o);let s;n[3]!==t.current||n[4]!==e?(s=l=>{if(t.current===document.activeElement&&e.current!==null&&sa(e.current.state)==="active"){for(const c of a4)if(l.key===c.key&&c.run){c.run(e.current),l.preventDefault(),l.stopPropagation();break}e.current.focus()}},n[3]=t.current,n[4]=e,n[5]=s):s=n[5];const i=Qe(s);let a;return n[6]!==r||n[7]!==i?(a={closeCompletionHandler:r,resumeCompletionHandler:i},n[6]=r,n[7]=i,n[8]=a):a=n[8],a}function _x(t,e,n,o,r,s,i,a,l){const c=X.c(51);let d,u,f,m,_,g,p,b,x,y,v,S,k,E,j,I;c[0]!==o||c[1]!==e||c[2]!==n?(d=()=>{n(),o.moveToNextCell({cellId:e,before:!1})},u=()=>{n(),o.moveToNextCell({cellId:e,before:!0})},c[0]=o,c[1]=e,c[2]=n,c[3]=d,c[4]=u):(d=c[3],u=c[4]),c[5]!==o||c[6]!==e?(f=()=>o.createNewCell({cellId:e,before:!0}),m=()=>o.createNewCell({cellId:e,before:!1}),_=()=>o.moveCell({cellId:e,before:!0}),g=()=>o.moveCell({cellId:e,before:!1}),c[5]=o,c[6]=e,c[7]=f,c[8]=m,c[9]=_,c[10]=g):(f=c[7],m=c[8],_=c[9],g=c[10]),c[11]!==o||c[12]!==r||c[13]!==e?(p=()=>r?o.moveCell({cellId:e,direction:"left"}):void 0,b=()=>r?o.moveCell({cellId:e,direction:"right"}):void 0,c[11]=o,c[12]=r,c[13]=e,c[14]=p,c[15]=b):(p=c[14],b=c[15]),c[16]!==o||c[17]!==s||c[18]!==e||c[19]!==(t==null?void 0:t.current)||c[20]!==i?(x=()=>{var M,L,B;const T=!s.hide_code;Ar({configs:{[e]:{hide_code:T}}}),o.updateCellConfig({cellId:e,config:{hide_code:T}}),T?((M=i.current)==null||M.contentDOM.blur(),(L=t==null?void 0:t.current)==null||L.focus()):(B=i.current)==null||B.focus()},c[16]=o,c[17]=s,c[18]=e,c[19]=t==null?void 0:t.current,c[20]=i,c[21]=x):x=c[21],c[22]!==o||c[23]!==e?(k=()=>o.moveToNextCell({cellId:e,before:!1,noCreate:!0}),y=()=>o.moveToNextCell({cellId:e,before:!0,noCreate:!0}),v=()=>o.sendToBottom({cellId:e}),S=()=>o.sendToTop({cellId:e}),c[22]=o,c[23]=e,c[24]=y,c[25]=v,c[26]=S,c[27]=k):(y=c[24],v=c[25],S=c[26],k=c[27]),c[28]!==e||c[29]!==i||c[30]!==a?(E=()=>{let T;T=!1,a(M=>(M==null?void 0:M.cellId)===e?(T=!0,null):{cellId:e}),T&&J1(i).focus()},c[28]=e,c[29]=i,c[30]=a,c[31]=E):E=c[31],c[32]!==l?(j=()=>{var T;(T=l.current)==null||T.toggle()},c[32]=l,c[33]=j):j=c[33],c[34]!==n||c[35]!==d||c[36]!==u||c[37]!==y||c[38]!==v||c[39]!==S||c[40]!==E||c[41]!==j||c[42]!==f||c[43]!==m||c[44]!==_||c[45]!==g||c[46]!==p||c[47]!==b||c[48]!==x||c[49]!==k?(I={"cell.run":n,"cell.runAndNewBelow":d,"cell.runAndNewAbove":u,"cell.createAbove":f,"cell.createBelow":m,"cell.moveUp":_,"cell.moveDown":g,"cell.moveLeft":p,"cell.moveRight":b,"cell.hideCode":x,"cell.focusDown":k,"cell.focusUp":y,"cell.sendToBottom":v,"cell.sendToTop":S,"cell.aiCompletion":E,"cell.cellActions":j},c[34]=n,c[35]=d,c[36]=u,c[37]=y,c[38]=v,c[39]=S,c[40]=E,c[41]=j,c[42]=f,c[43]=m,c[44]=_,c[45]=g,c[46]=p,c[47]=b,c[48]=x,c[49]=k,c[50]=I):I=c[50],vU(t,I)}function bx(t,e,n,o,r,s){const i=X.c(16);let a,l,c,d,u;i[0]!==n||i[1]!==e?(a=f=>(!f||!Vn.fromInput(f))&&(n.moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0),l=f=>(!f||!Vn.fromInput(f))&&(n.moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0),i[0]=n,i[1]=e,i[2]=a,i[3]=l):(a=i[2],l=i[3]),i[4]!==o?(c=()=>(o(),!1),i[4]=o,i[5]=c):c=i[5],i[6]!==n||i[7]!==e||i[8]!==s||i[9]!==r.keymap.preset?(d=r.keymap.preset!=="vim"||s?{}:{j:f=>(!f||!Vn.fromInput(f))&&(n.moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0),k:f=>(!f||!Vn.fromInput(f))&&(n.moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},i[6]=n,i[7]=e,i[8]=s,i[9]=r.keymap.preset,i[10]=d):d=i[10],i[11]!==a||i[12]!==l||i[13]!==c||i[14]!==d?(u={ArrowDown:a,ArrowUp:l,Enter:c,...d},i[11]=a,i[12]=l,i[13]=c,i[14]=d,i[15]=u):u=i[15],kU(t,u)}const yx=A.forwardRef((t,e)=>{const n=X.c(14),{id:o,output:r,interrupted:s,errored:i,stopped:a,name:l,outputStale:c,outputLoading:d}=t;let u;n[0]===Symbol.for("react.memo_cache_sentinel")?(u=Pm("marimo-cell","hover-actions-parent z-10",{published:!0}),n[0]=u):u=n[0];const f=u;let m;n[1]!==o?(m=Fs.create(o),n[1]=o,n[2]=m):m=n[2];const _=m,g=I4(r==null?void 0:r.mimetype);if(i||s||a||g)return null;let p,b;return n[3]!==o||n[4]!==r||n[5]!==d||n[6]!==c?(p=h.jsx(Dc,{allowExpand:!1,forceExpand:!0,output:r,className:"output-area",cellId:o,stale:c,loading:d}),n[3]=o,n[4]=r,n[5]=d,n[6]=c,n[7]=p):p=n[7],n[8]!==_||n[9]!==o||n[10]!==l||n[11]!==e||n[12]!==p?(b=h.jsx("div",{tabIndex:-1,id:_,ref:e,className:f,"data-cell-id":o,"data-cell-name":l,children:p}),n[8]=_,n[9]=o,n[10]=l,n[11]=e,n[12]=p,n[13]=b):b=n[13],b});yx.displayName="ReadonlyCellComponent";const V7=({theme:t,showPlaceholder:e,allowFocus:n,id:o,code:r,output:s,consoleOutputs:i,status:a,runStartTimestamp:l,lastRunStartTimestamp:c,runElapsedTimeMs:d,edited:u,interrupted:f,errored:m,stopped:_,staleInputs:g,serializedEditorState:p,serialization:b,debuggerActive:x,appClosed:y,canDelete:v,actions:S,deleteCell:k,userConfig:E,outline:j,isCollapsed:I,collapseCount:T,config:M,canMoveX:L,name:B,editorView:O,setEditorView:z,outputStale:F})=>{const V=A.useRef(null),P=A.useRef(null),C=A.useRef(null),$=A.useRef(null),N=Qt(Aa),H=td(o),[Y,Q]=A.useState(),q=M.disabled||a==="disabled-transitively",re=A4({executionTime:d,status:a,errored:m,interrupted:f,stopped:_}),ne=u||f||g&&!q,oe=j4(a),G=(a==="queued"||u||g)&&!f,Z=A.useCallback(()=>O.current,[O]),{closeCompletionHandler:ce,resumeCompletionHandler:fe}=gx(V,O),{isCellCodeShown:de,isMarkdown:_e,isMarkdownCodeHidden:ie,temporarilyShowCode:we,showHiddenMarkdownCode:ve}=function(pe,be,ue,Ne){const ke=X.c(13),[Ue,Ze]=A.useState(!1),le=!pe.hide_code||Ue,Ee=be==="markdown",Ie=Ee&&!le;let Be;ke[0]!==ue||ke[1]!==Ne||ke[2]!==le?(Be=Ye=>{var Tt,xt;if(le)return;const rt=(Ye==null?void 0:Ye.focus)??!0;Ze(!0),rt&&((Tt=ue.current)==null||Tt.focus());const pt=(xt=Ne.current)==null?void 0:xt.parentElement;if(!pt)return void Zt.error("Cell: No parent element found for editor view");const yt=()=>{requestAnimationFrame(()=>{var Bt;pt.contains(document.activeElement)||(Ze(!1),(Bt=ue.current)==null||Bt.dom.blur(),pt.removeEventListener("focusout",yt))})};pt.addEventListener("focusout",yt)},ke[0]=ue,ke[1]=Ne,ke[2]=le,ke[3]=Be):Be=ke[3];const We=Qe(Be);let Me;ke[4]!==Ie||ke[5]!==We?(Me=()=>{Ie&&We({focus:!0})},ke[4]=Ie,ke[5]=We,ke[6]=Me):Me=ke[6];const Ge=Qe(Me);let ot;return ke[7]!==le||ke[8]!==Ee||ke[9]!==Ie||ke[10]!==Ge||ke[11]!==We?(ot={isCellCodeShown:le,isMarkdown:Ee,isMarkdownCodeHidden:Ie,temporarilyShowCode:We,showHiddenMarkdownCode:Ge},ke[7]=le,ke[8]=Ee,ke[9]=Ie,ke[10]=Ge,ke[11]=We,ke[12]=ot):ot=ke[12],ot}(M,Y,O,C);_x(V,o,H,S,L,M,O,N,P),bx(V,o,S,ve,E,de);const ae=wU(j),ge=!E4(s),he=i.length>0,je=E.display.cell_output,Fe=ge&&je==="above",He=ge&&je==="below",[Xe,Le]=A.useState(!1),[et,nt]=A.useState(!1);(function(pe){const{ref:be,box:ue="content-box",skip:Ne}=pe,ke=A.useRef({...U7}),Ue=A.useRef(void 0);Ue.current=pe.onResize,A.useEffect(()=>{if(!be.current||Ne||typeof window>"u"||!("ResizeObserver"in window))return;const Ze=new ResizeObserver(([le])=>{const Ee=ue==="border-box"?"borderBoxSize":ue==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",Ie=px(le,Ee,"inlineSize"),Be=px(le,Ee,"blockSize");if(ke.current.width!==Ie||ke.current.height!==Be){const We={width:Ie,height:Be};ke.current.width=Ie,ke.current.height=Be,Ue.current&&Ue.current(We)}});return Ze.observe(be.current,{box:ue}),()=>{Ze.disconnect()}},[ue,be,Ne])})({ref:$,skip:!_e,onResize:pe=>{const be=pe.height&&pe.height<68,ue=ie&&(be||je==="below");Le(ue),ae&&ue?nt(!0):et&&nt(!1)}});const it=pe=>h.jsx(S4,{tooltip:"Edit markdown",className:Te("z-20 relative",pe),onClick:we}),te=ge&&h.jsxs("div",{className:"relative",onDoubleClick:ve,children:[h.jsx("div",{className:"absolute top-5 -left-8 z-10 print:hidden",children:h.jsx(F7,{isCollapsed:I,onClick:()=>{I?S.expandCell({cellId:o}):S.collapseCell({cellId:o})},canCollapse:ae})}),ie&&He&&it("top-3"),h.jsx(Dc,{allowExpand:!0,forceExpand:ie,output:s,className:"output-area",cellId:o,stale:F,loading:oe}),ie&&Fe&&it("bottom-3")]}),Ce=Pm("marimo-cell","hover-actions-parent z-10",{interactive:!0,"needs-run":ne,"has-error":m,stopped:_,disabled:M.disabled,stale:a==="disabled-transitively",borderless:ie&&ge}),Ae=Fs.create(o),ze=Qe(pe=>{N({cellId:o,initialPrompt:pe.prompt})}),J=!(!b||b.toLowerCase()!=="valid");return h.jsx(Lm,{children:h.jsx(g0,{cellId:o,config:M,status:a,getEditorView:Z,hasOutput:ge,hasConsoleOutput:he,name:B,children:h.jsxs(h0,{tabIndex:-1,ref:V,"data-status":a,onBlur:ce,onKeyDown:fe,cellId:o,canMoveX:L,title:M.disabled?"This cell is disabled":a==="disabled-transitively"?"This cell has a disabled ancestor":void 0,children:[h.jsxs("div",{className:Ce,id:Ae,ref:$,"data-cell-id":o,"data-cell-name":B,children:[je==="above"&&te,h.jsxs("div",{className:Te("tray"),"data-hidden":ie,children:[h.jsx("div",{className:"absolute right-2 -top-4 z-10",children:h.jsx(wx,{edited:u,appClosed:y,status:a,cellConfig:M,needsRun:ne,hasOutput:ge,hasConsoleOutput:he,cellActionDropdownRef:P,cellId:o,name:B,getEditorView:Z,onRun:H})}),h.jsx($7,{cellId:o,className:Te(ie&&Fe&&"-top-7",ie&&He&&"-bottom-8",ie&&et&&"-left-[3.8rem]"),appClosed:y,actions:S}),h.jsx(Pu,{theme:t,showPlaceholder:e,allowFocus:n,id:o,code:r,config:M,status:a,serializedEditorState:p,runCell:H,setEditorView:z,userConfig:E,editorViewRef:O,editorViewParentRef:C,hidden:!de,hasOutput:ge,temporarilyShowCode:we,languageAdapter:Y,setLanguageAdapter:Q}),h.jsx(xx,{className:Te(ie&&je==="below"&&"top-14"),edited:u,status:a,isCellStatusInline:Xe,uninstantiated:re,disabled:M.disabled,runElapsedTimeMs:d,runStartTimestamp:l,lastRunStartTimestamp:c,staleInputs:g,interrupted:f}),h.jsx("div",{className:"shoulder-bottom hover-action",children:v&&de&&h.jsx(C_,{appClosed:y,status:a,onClick:()=>{oe||y||k({cellId:o})}})})]}),je==="below"&&te,b&&h.jsxs("a",{href:"https://links.marimo.app/reusable-definitions",target:"_blank",className:"hover:underline py-1 px-2 flex items-center justify-end gap-2 last:rounded-b",children:[J&&h.jsx("span",{className:"text-muted-foreground text-xs font-bold",children:"reusable"}),h.jsx(Oe,{content:h.jsx("span",{className:"max-w-16 text-xs",children:J?"This function or class can be imported into other Python notebooks or modules.":h.jsxs(h.Fragment,{children:["This definition can't be reused in other Python modules:",h.jsx("br",{}),h.jsx("br",{}),h.jsx("pre",{children:b}),h.jsx("br",{}),"Click this icon to learn more."]})}),children:J&&h.jsx(dc,{size:16,strokeWidth:1.5,className:"rounded-lg text-muted-foreground"})||h.jsx(Fm,{size:16,strokeWidth:1.5,className:"rounded-lg text-muted-foreground"})})]}),h.jsx(Xm,{consoleOutputs:i,stale:G,cellName:b?"_":B,onRefactorWithAI:ze,onClear:()=>{S.clearCellConsoleOutput({cellId:o})},onSubmitDebugger:(pe,be)=>{S.setStdinResponse({cellId:o,response:pe,outputIndex:be}),T4({text:pe})},cellId:o,debuggerActive:x})]}),I&&h.jsx(mx,{onClick:()=>S.expandCell({cellId:o}),count:T,cellId:o})]})})})},xx=t=>{const e=X.c(19),{className:n,disabled:o,edited:r,interrupted:s,isCellStatusInline:i,lastRunStartTimestamp:a,runElapsedTimeMs:l,runStartTimestamp:c,staleInputs:d,status:u,uninstantiated:f}=t,m=o!==void 0&&o;let _;e[0]!==m||e[1]!==r||e[2]!==s||e[3]!==a||e[4]!==l||e[5]!==c||e[6]!==d||e[7]!==u||e[8]!==f?(_=h.jsx(E_,{status:u,staleInputs:d,interrupted:s,editing:!0,edited:r,disabled:m,elapsedTime:l,runStartTimestamp:c,uninstantiated:f,lastRunStartTimestamp:a}),e[0]=m,e[1]=r,e[2]=s,e[3]=a,e[4]=l,e[5]=c,e[6]=d,e[7]=u,e[8]=f,e[9]=_):_=e[9];const g=_;let p;e[10]!==n?(p=Te("shoulder-right z-20",n),e[10]=n,e[11]=p):p=e[11];const b=!i&&g;let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=h.jsx(u0,{}),e[12]=x):x=e[12];const y=i&&g;let v,S;return e[13]!==y?(v=h.jsxs("div",{className:"flex gap-2 items-end",children:[x,y]}),e[13]=y,e[14]=v):v=e[14],e[15]!==p||e[16]!==b||e[17]!==v?(S=h.jsxs("div",{className:p,children:[b,v]}),e[15]=p,e[16]=b,e[17]=v,e[18]=S):S=e[18],S},$7=t=>{const e=X.c(21),{className:n,appClosed:o,actions:r,cellId:s}=t;let i;e[0]!==r||e[1]!==s?(i=y=>{const v=y===void 0?{}:y;return r.createNewCell({cellId:s,before:!1,...v})},e[0]=r,e[1]=s,e[2]=i):i=e[2];const a=Qe(i);let l;e[3]!==r||e[4]!==s?(l=y=>{const v=y===void 0?{}:y;return r.createNewCell({cellId:s,before:!0,...v})},e[3]=r,e[4]=s,e[5]=l):l=e[5];const c=Qe(l);let d,u;e[6]!==n?(d=Te("absolute flex flex-col gap-[2px] justify-center h-full left-[-34px] z-20",n),e[6]=n,e[7]=d):d=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(u=fn("cell.createAbove"),e[8]=u):u=e[8];const f=o?void 0:c;let m,_,g;e[9]!==o||e[10]!==f?(m=h.jsx(S_,{tooltipContent:u,appClosed:o,onClick:f}),e[9]=o,e[10]=f,e[11]=m):m=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx("div",{className:"flex-1"}),e[12]=_):_=e[12],e[13]===Symbol.for("react.memo_cache_sentinel")?(g=fn("cell.createBelow"),e[13]=g):g=e[13];const p=o?void 0:a;let b,x;return e[14]!==o||e[15]!==p?(b=h.jsx(S_,{tooltipContent:g,appClosed:o,onClick:p}),e[14]=o,e[15]=p,e[16]=b):b=e[16],e[17]!==d||e[18]!==m||e[19]!==b?(x=h.jsxs("div",{className:d,children:[m,_,b]}),e[17]=d,e[18]=m,e[19]=b,e[20]=x):x=e[20],x},wx=t=>{const e=X.c(27),{edited:n,appClosed:o,status:r,cellConfig:s,needsRun:i,hasOutput:a,hasConsoleOutput:l,onRun:c,cellActionDropdownRef:d,cellId:u,getEditorView:f,name:m,includeCellActions:_}=t,g=_===void 0||_,p=!i&&"hover-action";let b;e[0]!==p?(b=Te(p),e[0]=p,e[1]=b):b=e[1];const x=o?jn.NOOP:c;let y,v,S,k;return e[2]!==o||e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==r||e[7]!==x?(y=h.jsx(cE,{edited:n,onClick:x,appClosed:o,status:r,config:s,needsRun:i}),e[2]=o,e[3]=s,e[4]=n,e[5]=i,e[6]=r,e[7]=x,e[8]=y):y=e[8],e[9]!==o||e[10]!==r?(v=h.jsx(B7,{status:r,appClosed:o}),e[9]=o,e[10]=r,e[11]=v):v=e[11],e[12]!==d||e[13]!==s||e[14]!==u||e[15]!==f||e[16]!==l||e[17]!==a||e[18]!==g||e[19]!==m||e[20]!==r?(S=g&&h.jsx(m0,{ref:d,cellId:u,status:r,getEditorView:f,name:m,config:s,hasOutput:a,hasConsoleOutput:l,children:h.jsx(xi,{variant:"green",tooltip:null,"data-testid":"cell-actions-button",children:h.jsx(xS,{strokeWidth:1.5})})}),e[12]=d,e[13]=s,e[14]=u,e[15]=f,e[16]=l,e[17]=a,e[18]=g,e[19]=m,e[20]=r,e[21]=S):S=e[21],e[22]!==b||e[23]!==y||e[24]!==v||e[25]!==S?(k=h.jsxs(lE,{className:b,children:[y,v,S]}),e[22]=b,e[23]=y,e[24]=v,e[25]=S,e[26]=k):k=e[26],k},H7=({theme:t,showPlaceholder:e,allowFocus:n,id:o,code:r,output:s,consoleOutputs:i,status:a,runStartTimestamp:l,lastRunStartTimestamp:c,runElapsedTimeMs:d,edited:u,interrupted:f,errored:m,stopped:_,staleInputs:g,serializedEditorState:p,debuggerActive:b,appClosed:x,canDelete:y,actions:v,deleteCell:S,userConfig:k,config:E,canMoveX:j,name:I,editorView:T,setEditorView:M})=>{const L=A.useRef(null),B=A.useRef(null),O=A.useRef(null),z=Qt(Aa),F=td(o),V=E.disabled||a==="disabled-transitively",P=A4({executionTime:d,status:a,errored:m,interrupted:f,stopped:_}),C=u||f||g&&!V,$=a==="running"||a==="queued",N=(a==="queued"||u||g)&&!f,H=A.useCallback(()=>T.current,[T]),{closeCompletionHandler:Y,resumeCompletionHandler:Q}=gx(L,T);_x(L,o,F,v,j,E,T,z,B),bx(L,o,v,jn.NOOP,k,!0);const q=!E4(s),re=i.length>0,ne=I4(s==null?void 0:s.mimetype),oe=Pm("marimo-cell","hover-actions-parent z-10 border shadow-sm","!border-[var(--blue-5)] !rounded-sm",{"needs-run":C,"has-error":m,stopped:_}),G=Fs.create(o),Z=Qe(ce=>{z({cellId:o,initialPrompt:ce.prompt})});return h.jsx(Lm,{children:h.jsx(g0,{cellId:o,config:E,status:a,getEditorView:H,hasOutput:q,hasConsoleOutput:re,name:I,children:h.jsxs("div",{className:oe,"data-status":a,id:G,ref:L,onBlur:Y,onKeyDown:Q,title:E.disabled?"This cell is disabled":a==="disabled-transitively"?"This cell has a disabled ancestor":void 0,"data-cell-id":o,"data-cell-name":I,"data-setup-cell":!0,children:[h.jsxs("div",{className:Te("tray"),"data-hidden":!1,children:[h.jsx("div",{className:"absolute right-2 -top-4 z-10",children:h.jsx(wx,{edited:u,appClosed:x,status:a,cellConfig:E,needsRun:C,hasOutput:q,hasConsoleOutput:re,cellActionDropdownRef:B,cellId:o,name:I,getEditorView:H,onRun:F,includeCellActions:!1})}),h.jsx(Pu,{theme:t,showPlaceholder:e,allowFocus:n,id:o,code:r,config:E,status:a,serializedEditorState:p,runCell:F,setEditorView:M,userConfig:k,editorViewRef:T,editorViewParentRef:O,hidden:!1,hasOutput:q,temporarilyShowCode:jn.NOOP,languageAdapter:"python",setLanguageAdapter:jn.NOOP,showLanguageToggles:!1}),h.jsx(xx,{edited:u,status:a,isCellStatusInline:!1,uninstantiated:P,disabled:E.disabled,runElapsedTimeMs:d,runStartTimestamp:l,lastRunStartTimestamp:c,staleInputs:g,interrupted:f}),h.jsx("div",{className:"shoulder-bottom hover-action",children:y&&h.jsx(C_,{appClosed:x,status:a,onClick:()=>{$||x||S({cellId:o})}})})]}),h.jsxs("div",{className:"py-1 px-2 flex justify-end gap-2 last:rounded-b",children:[h.jsx("span",{className:"text-muted-foreground text-xs font-bold",children:"setup cell"}),h.jsx(Oe,{content:h.jsxs("span",{className:"max-w-16",children:["This ",h.jsx("b",{children:"setup cell"})," is guaranteed to run before all other cells. Include ",h.jsx("br",{}),"initialization or imports and constants required by top-level functions."]}),children:h.jsx(Fm,{size:16,strokeWidth:1.5,className:"rounded-lg text-muted-foreground"})})]}),ne&&h.jsx(Dc,{allowExpand:!0,forceExpand:!0,output:s,className:"output-area",cellId:o,stale:!1,loading:$}),h.jsx(Xm,{consoleOutputs:i,stale:N,cellName:"_",onRefactorWithAI:Z,onClear:()=>{v.clearCellConsoleOutput({cellId:o})},onSubmitDebugger:(ce,fe)=>{v.setStdinResponse({cellId:o,response:ce,outputIndex:fe}),T4({text:ce})},cellId:o,debuggerActive:b})]})})})},vx=A.memo(A.forwardRef((t,e)=>{const{status:n,output:o,runStartTimestamp:r,interrupted:s,staleInputs:i,edited:a,id:l,mode:c}=t;Zt.debug("Rendering Cell",l);const d=A.useRef(null);A.useImperativeHandle(e,()=>({get editorView(){return J1(d)},get editorViewOrNull(){return d.current}}),[d]);const u=xU({status:n,output:o,runStartTimestamp:r,interrupted:s,staleInputs:i},a),f=j4(n);return l===$o?h.jsx(H7,{...t,editorView:d,setEditorView:m=>{d.current=m},outputStale:u}):c==="edit"?h.jsx(V7,{...t,editorView:d,setEditorView:m=>{d.current=m},outputStale:u}):h.jsx(yx,{...t,outputStale:u,outputLoading:f})})),W7=t=>{const e=X.c(10),{width:n}=t,{banners:o}=C$(),{removeBanner:r}=N$();if(o.length===0)return null;const s=n==="columns"&&"sticky left-12 w-full max-w-[80vw]";let i,a,l;if(e[0]!==s?(i=Te("flex flex-col gap-4 mb-5 print:hidden",s),e[0]=s,e[1]=i):i=e[1],e[2]!==o||e[3]!==r){let c;e[5]!==r?(c=d=>h.jsxs(Rc,{kind:d.variant||"info",className:"flex flex-col rounded p-3",children:[h.jsxs("div",{className:"flex justify-between",children:[h.jsxs("span",{className:"font-bold text-lg flex items-center mb-2",children:[h.jsx(SU,{className:"w-5 h-5 inline-block mr-2"}),d.title]}),h.jsx(De,{"data-testid":"remove-banner-button",variant:"text",size:"icon",onClick:()=>r(d.id),children:h.jsx(go,{className:"w-5 h-5"})})]}),h.jsxs("div",{className:"flex justify-between items-end",children:[h.jsx("span",{children:zm({html:d.description})}),d.action==="restart"&&h.jsx(q7,{})]})]},d.id),e[5]=r,e[6]=c):c=e[6],a=o.map(c),e[2]=o,e[3]=r,e[4]=a}else a=e[4];return e[7]!==i||e[8]!==a?(l=h.jsx("div",{className:i,children:a}),e[7]=i,e[8]=a,e[9]=l):l=e[9],l},q7=()=>{const t=X.c(3),e=eg();let n,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n=h.jsx(Dp,{className:"w-3 h-3 mr-2"}),t[0]=n):n=t[0],t[1]!==e?(o=h.jsxs(De,{"data-testid":"restart-session-button",variant:"link",size:"xs",onClick:e,children:[n,"Restart"]}),t[1]=e,t[2]=o):o=t[2],o},G7=(t,e)=>function(n,o){const r=/^(\d+)\.(\d+)\.(\d+)(?:-([\w.-]+))?(?:\+([\w.-]+))?$/,s=i=>{const a=i.match(r);if(!a)return null;const[,l,c,d,u]=a;return{major:Number.parseInt(l,10),minor:Number.parseInt(c,10),patch:Number.parseInt(d,10),preRelease:u||""}};try{const i=s(n),a=s(o);return i&&a?i.major!==a.major?i.major-a.major:i.minor!==a.minor?i.minor-a.minor:i.patch!==a.patch?i.patch-a.patch:i.preRelease===""&&a.preRelease!==""?1:i.preRelease!==""&&a.preRelease===""?-1:i.preRelease.localeCompare(a.preRelease):n.localeCompare(o,void 0,{numeric:!0,sensitivity:"base"})}catch{return n.localeCompare(o,void 0,{numeric:!0,sensitivity:"base"})}}(e,t),Y7=()=>{const t=X.c(66),{packageAlert:e}=j$(),{clearPackageAlert:n}=E$(),[o]=Ds();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={},t[0]=r):r=t[0];const[s,i]=A.useState(r);if(e===null)return null;const a=o.package_management.manager!=="pixi";if(I$(e)){let l,c,d,u,f,m,_,g,p,b;if(t[1]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsxs("span",{className:"font-bold text-lg flex items-center mb-2",children:[h.jsx(Jc,{className:"w-5 h-5 inline-block mr-2"}),"Missing packages"]}),t[1]=l):l=t[1],t[2]!==n||t[3]!==e.id?(c=()=>n(e.id),t[2]=n,t[3]=e.id,t[4]=c):c=t[4],t[5]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(go,{className:"w-5 h-5"}),t[5]=d):d=t[5],t[6]!==c?(u=h.jsxs("div",{className:"flex justify-between",children:[l,h.jsx(De,{variant:"text","data-testid":"remove-banner-button",size:"icon",onClick:c,children:d})]}),t[6]=c,t[7]=u):u=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(f=h.jsx("p",{children:"The following packages were not found:"}),t[8]=f):f=t[8],t[9]!==s||t[10]!==a||t[11]!==e.packages){let x;t[13]!==s||t[14]!==a?(x=(y,v)=>h.jsxs("li",{className:"flex items-center gap-1 font-mono text-sm",children:[h.jsx(ba,{size:"1rem"}),y,a&&h.jsx(Z7,{value:s[y]??"latest",onChange:S=>i(k=>({...k,[y]:S})),packageName:y})]},v),t[13]=s,t[14]=a,t[15]=x):x=t[15],m=e.packages.map(x),t[9]=s,t[10]=a,t[11]=e.packages,t[12]=m}else m=t[12];return t[16]!==m?(_=h.jsxs("div",{children:[f,h.jsx("ul",{className:"list-disc ml-4 mt-1",children:m})]}),t[16]=m,t[17]=_):_=t[17],t[18]!==n||t[19]!==s||t[20]!==e.id||t[21]!==e.isolated||t[22]!==e.packages||t[23]!==o.package_management.manager?(g=h.jsx("div",{className:"ml-auto flex flex-row items-baseline",children:e.isolated?h.jsxs(h.Fragment,{children:[h.jsx(K7,{manager:o.package_management.manager,packages:e.packages,versions:s,clearPackageAlert:()=>n(e.id)}),!Bn()&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"px-2 text-sm",children:"with"})," ",h.jsx(X7,{})]})]}):h.jsxs("p",{children:["If you set up a"," ",h.jsx(mm,{href:"https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments",children:"virtual environment"}),", marimo can install these packages for you."]})}),t[18]=n,t[19]=s,t[20]=e.id,t[21]=e.isolated,t[22]=e.packages,t[23]=o.package_management.manager,t[24]=g):g=t[24],t[25]!==_||t[26]!==g?(p=h.jsxs("div",{className:"flex flex-col gap-4 justify-between items-start text-muted-foreground text-base",children:[_,g]}),t[25]=_,t[26]=g,t[27]=p):p=t[27],t[28]!==u||t[29]!==p?(b=h.jsx("div",{className:"flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-[200] opacity-95",children:h.jsxs(Rc,{kind:"danger",className:"flex flex-col rounded py-3 px-5 animate-in slide-in-from-left",children:[u,p]})}),t[28]=u,t[29]=p,t[30]=b):b=t[30],b}if(A$(e)){let l;t[31]!==e.packages?(l=function(M){const L=new Set(Object.values(M)),B=L.has("queued")||L.has("installing")?"installing":L.has("failed")?"failed":"installed";return B==="installing"?{status:"installing",title:"Installing packages",titleIcon:h.jsx(ka,{className:"w-5 h-5 inline-block mr-2"}),description:"Installing packages:"}:B==="installed"?{status:"installed",title:"All packages installed!",titleIcon:h.jsx(Ip,{className:"w-5 h-5 inline-block mr-2"}),description:"Installed packages:"}:{status:"failed",title:"Some packages failed to install",titleIcon:h.jsx(Jc,{className:"w-5 h-5 inline-block mr-2"}),description:"See terminal for error logs."}}(e.packages),t[31]=e.packages,t[32]=l):l=t[32];const{status:c,title:d,titleIcon:u,description:f}=l;c==="installed"&&setTimeout(()=>n(e.id),1e4);const m=c==="failed"?"danger":"info";let _,g,p,b,x;t[33]!==d||t[34]!==u?(_=h.jsxs("span",{className:"font-bold text-lg flex items-center mb-2",children:[u,d]}),t[33]=d,t[34]=u,t[35]=_):_=t[35],t[36]!==n||t[37]!==e.id?(g=()=>n(e.id),t[36]=n,t[37]=e.id,t[38]=g):g=t[38],t[39]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx(go,{className:"w-5 h-5"}),t[39]=p):p=t[39],t[40]!==g?(b=h.jsx(De,{variant:"text","data-testid":"remove-banner-button",size:"icon",onClick:g,children:p}),t[40]=g,t[41]=b):b=t[41],t[42]!==_||t[43]!==b?(x=h.jsxs("div",{className:"flex justify-between",children:[_,b]}),t[42]=_,t[43]=b,t[44]=x):x=t[44];const y=c==="installed"&&"text-accent-foreground";let v,S,k,E,j,I,T;if(t[45]!==y?(v=Te("flex flex-col gap-4 justify-between items-start text-muted-foreground text-base",y),t[45]=y,t[46]=v):v=t[46],t[47]!==f?(S=h.jsx("p",{children:f}),t[47]=f,t[48]=S):S=t[48],t[49]!==e.packages||t[50]!==c){let M;t[52]!==c?(M=(L,B)=>{const[O,z]=L;return h.jsxs("li",{className:Te("flex items-center gap-1 font-mono text-sm",z==="installing"&&"font-semibold",z==="failed"&&"text-destructive",z==="installed"&&"text-accent-foreground",z==="installed"&&c==="failed"&&"text-muted-foreground"),children:[h.jsx(J7,{status:z}),O]},B)},t[52]=c,t[53]=M):M=t[53],k=Object.entries(e.packages).map(M),t[49]=e.packages,t[50]=c,t[51]=k}else k=t[51];return t[54]!==k?(E=h.jsx("ul",{className:"list-disc ml-4 mt-1",children:k}),t[54]=k,t[55]=E):E=t[55],t[56]!==S||t[57]!==E?(j=h.jsxs("div",{children:[S,E]}),t[56]=S,t[57]=E,t[58]=j):j=t[58],t[59]!==j||t[60]!==v?(I=h.jsx("div",{className:v,children:j}),t[59]=j,t[60]=v,t[61]=I):I=t[61],t[62]!==I||t[63]!==m||t[64]!==x?(T=h.jsx("div",{className:"flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-[200] opacity-95",children:h.jsxs(Rc,{kind:m,className:"flex flex-col rounded pt-3 pb-4 px-5",children:[x,I]})}),t[62]=I,t[63]=m,t[64]=x,t[65]=T):T=t[65],T}return nc(e),null},J7=t=>{const e=X.c(4),{status:n}=t;switch(n){case"queued":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(ba,{size:"1rem"}),e[0]=o):o=e[0],o}case"installing":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(ka,{size:"1rem"}),e[1]=o):o=e[1],o}case"installed":{let o;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(gc,{size:"1rem"}),e[2]=o):o=e[2],o}case"failed":{let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(go,{size:"1rem"}),e[3]=o):o=e[3],o}default:return nc(n),null}},K7=t=>{const e=X.c(9),{manager:n,packages:o,versions:r,clearPackageAlert:s}=t;let i,a,l,c;return e[0]!==s||e[1]!==n||e[2]!==o||e[3]!==r?(i=async()=>{s();const d={...r};for(const u of o)d[u]=d[u]??"";await EU({manager:n,versions:d}).catch(Q7)},e[0]=s,e[1]=n,e[2]=o,e[3]=r,e[4]=i):i=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(ka,{className:"w-4 h-4 mr-2"}),l=h.jsx("span",{className:"font-semibold",children:"Install"}),e[5]=a,e[6]=l):(a=e[5],l=e[6]),e[7]!==i?(c=h.jsxs(De,{variant:"outline","data-testid":"install-packages-button",size:"sm",onClick:i,children:[a,l]}),e[7]=i,e[8]=c):c=e[8],c},X7=()=>{const t=X.c(16),[e,n]=Ds();let o,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=V3(CU),t[0]=o):o=t[0],t[1]!==e?(r={resolver:o,defaultValues:e},t[1]=e,t[2]=r):r=t[2];const s=$3(r);let i;t[3]!==n?(i=async f=>{await Rs({config:f}).then(()=>{n(f)})},t[3]=n,t[4]=i):i=t[4];const a=i;let l,c,d,u;return t[5]!==s||t[6]!==a?(l=s.handleSubmit(a),t[5]=s,t[6]=a,t[7]=l):l=t[7],t[8]!==s.control?(c=h.jsx("div",{className:"flex flex-col gap-3",children:h.jsx(F3,{control:s.control,name:"package_management.manager",render:tM})}),t[8]=s.control,t[9]=c):c=t[9],t[10]!==l||t[11]!==c?(d=h.jsx("form",{onChange:l,className:"flex flex-col gap-5",children:c}),t[10]=l,t[11]=c,t[12]=d):d=t[12],t[13]!==s||t[14]!==d?(u=h.jsx(NU,{...s,children:d}),t[13]=s,t[14]=d,t[15]=u):u=t[15],u},Z7=t=>{const e=X.c(21),{value:n,onChange:o,packageName:r}=t;let s,i;e[0]!==r?(s=async()=>{const g=await fetch(`https://pypi.org/pypi/${function(b){return b.replaceAll(/\[.*]/g,"").trim()}(r)}/json`,{method:"GET",signal:AbortSignal.timeout(5e3)}),p=await g.json();return["latest",...Object.keys(p.releases).sort(G7).slice(0,100)]},i=[r],e[0]=r,e[1]=s,e[2]=i):(s=e[1],i=e[2]);const{data:a,loading:l,error:c}=Xn(s,i);let d;e[3]!==a?(d=a===void 0?[]:a,e[3]=a,e[4]=d):d=e[4];const u=d;if(c){let g,p,b;return e[5]!==o?(g=x=>o(x.target.value),e[5]=o,e[6]=g):g=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx("option",{value:"latest",children:"latest"}),e[7]=p):p=e[7],e[8]!==g||e[9]!==n?(b=h.jsx(Oe,{content:"Failed to fetch package versions",children:h.jsx(Bm,{value:n,onChange:g,disabled:!0,className:"inline-flex ml-2",children:p})}),e[8]=g,e[9]=n,e[10]=b):b=e[10],b}let f,m,_;return e[11]!==o?(f=g=>o(g.target.value),e[11]=o,e[12]=f):f=e[12],e[13]!==u||e[14]!==l?(m=l?h.jsx("option",{value:"latest",children:"latest"}):u.map(nM),e[13]=u,e[14]=l,e[15]=m):m=e[15],e[16]!==l||e[17]!==f||e[18]!==m||e[19]!==n?(_=h.jsx(Bm,{value:n,onChange:f,disabled:l,className:"inline-flex ml-2",children:m}),e[16]=l,e[17]=f,e[18]=m,e[19]=n,e[20]=_):_=e[20],_};function Q7(t){Zt.error(t)}function eM(t){return h.jsx("option",{value:t,children:t},t)}function tM(t){const{field:e}=t;return h.jsxs(z3,{children:[h.jsx(B3,{children:h.jsx(Bm,{"data-testid":"install-package-manager-select",onChange:n=>e.onChange(n.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:jU.map(eM)})}),h.jsx(U3,{})]})}function nM(t){return h.jsx("option",{value:t,children:t},t)}const oM=t=>{let{transform:e}=t;return{...e,x:0}},rM={threshold:{x:0,y:.1}},sM=K.memo(t=>{const e=X.c(23),{children:n,multiColumn:o}=t,{dropCellOverCell:r,dropCellOverColumn:s,moveColumn:i,compactColumns:a}=Lt(),[l,c]=A.useState(null),[d,u]=A.useState(null),[f]=O3();let m;e:{if(f.width==="columns"){m=Um.EMPTY;break e}let O;e[0]===Symbol.for("react.memo_cache_sentinel")?(O=[oM],e[0]=O):O=e[0],m=O}const _=m;let g,p;e[1]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:8}},e[1]=g):g=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(p={coordinateGetter:t5},e[2]=p):p=e[2];const b=function(){for(var O=arguments.length,z=new Array(O),F=0;F<O;F++)z[F]=arguments[F];return A.useMemo(()=>[...z].filter(V=>V!=null),[...z])}(T_(au,g),T_(su,p));let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=O=>{c(O.active.id);const z=fo();u(z.cellIds)},e[3]=x):x=e[3];const y=Qe(x);let v;e[4]!==d?(v=()=>{c(null),u(null)},e[4]=d,e[5]=v):v=e[5];const S=Qe(v);let k;e[6]!==l?(k=O=>{const z=O.droppableContainers.filter(iM);if(l&&rs(l))return eu({...O,droppableContainers:z});const F=(N=>{let{droppableContainers:H,droppableRects:Y,pointerCoordinates:Q}=N;if(!Q)return[];const q=[];for(const re of H){const{id:ne}=re,oe=Y.get(ne);if(oe&&yE(Q,oe)){const G=Zd(oe).reduce((ce,fe)=>ce+Kd(Q,fe),0),Z=Number((G/4).toFixed(4));q.push({id:ne,data:{droppableContainer:re,value:Z}})}}return q.sort(Xd)})({...O,droppableContainers:z}),V=Qd(F.length>0?F:O_({...O,droppableContainers:z}),"id");if(!V)return[];zo(rs(V),`Expected column id. Got: ${V}`);const P=fo().cellIds.get(V);if(zo(P,`Expected column. Got: ${V}`),P&&P.topLevelIds.length===0)return[{id:V}];const C=new Set(P.topLevelIds),$=eu({...O,droppableContainers:O.droppableContainers.filter(N=>N.id!==V&&C.has(N.id))});if($.length>0){const N=$[0].id;return zo(Lu(N),`Expected cell id. Got: ${N}`),[{id:N}]}return[]},e[6]=l,e[7]=k):k=e[7];const E=k;let j;e[8]!==r||e[9]!==s||e[10]!==i?(j=O=>{const{active:z,over:F}=O,V=F==null?void 0:F.id;if(V!=null&&z.id!==V){if(Lu(z.id)){if(rs(V))return void s({cellId:z.id,columnId:V});if(Lu(V))return void r({cellId:z.id,overCellId:V})}rs(z.id)&&rs(V)&&i({column:z.id,overColumn:V})}},e[8]=r,e[9]=s,e[10]=i,e[11]=j):j=e[11];const I=Qe(j);let T;e[12]!==a?(T=O=>{const{active:z,over:F}=O;F!==null&&z.id!==F.id&&a()},e[12]=a,e[13]=T):T=e[13];const M=Qe(T),L=o?E:eu;let B;return e[14]!==n||e[15]!==S||e[16]!==M||e[17]!==I||e[18]!==y||e[19]!==_||e[20]!==b||e[21]!==L?(B=h.jsx(VE,{autoScroll:rM,sensors:b,collisionDetection:L,modifiers:_,onDragEnd:M,onDragStart:y,onDragCancel:S,onDragOver:I,children:n}),e[14]=n,e[15]=S,e[16]=M,e[17]=I,e[18]=y,e[19]=_,e[20]=b,e[21]=L,e[22]=B):B=e[22],B});function Lu(t){return typeof t=="string"&&!t.startsWith("tree_")}function rs(t){return typeof t=="string"&&t.startsWith("tree_")}function iM(t){return rs(t.id)}const kx=K.forwardRef((t,e)=>{const n=X.c(62);let o,r,s,i,a,l;n[0]!==t?({columnId:i,canDelete:o,canMoveLeft:r,canMoveRight:s,...a}=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]),n[6]!==i?(l={id:i},n[6]=i,n[7]=l):l=n[7];const{attributes:c,listeners:d,setNodeRef:u,transform:f,transition:m,isDragging:_,isOver:g}=l0(l);let p;n[8]!==f?(p=f?Mc.Transform.toString({x:f.x,y:0,scaleX:1,scaleY:1}):void 0,n[8]=f,n[9]=p):p=n[9];const b=_?2:void 0;let x;n[10]!==p||n[11]!==b||n[12]!==m?(x={transform:p,transition:m,zIndex:b,position:"relative","--gutter-width":"50px"},n[10]=p,n[11]=b,n[12]=m,n[13]=x):x=n[13];const y=x,{deleteColumn:v,moveColumn:S,addColumn:k}=Lt();let E;n[14]===Symbol.for("react.memo_cache_sentinel")?(E=Te("h-full hover:bg-muted rounded-none"),n[14]=E):E=n[14];const j=E,I=lM;let T;n[15]!==i||n[16]!==S?(T=()=>S({column:i,overColumn:"_left_"}),n[15]=i,n[16]=S,n[17]=T):T=n[17];const M=!r;let L,B,O;n[18]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx(M3,{className:"size-4"}),n[18]=L):L=n[18],n[19]!==T||n[20]!==M?(B=h.jsx(Oe,{content:"Move column left",side:"top",delayDuration:300,children:h.jsx(De,{variant:"text",size:"sm",className:j,onClick:T,disabled:M,children:L})}),n[19]=T,n[20]=M,n[21]=B):B=n[21],n[22]!==i||n[23]!==S?(O=()=>S({column:i,overColumn:"_right_"}),n[22]=i,n[23]=S,n[24]=O):O=n[24];const z=!s;let F,V,P,C,$,N,H,Y;n[25]===Symbol.for("react.memo_cache_sentinel")?(F=h.jsx(ac,{className:"size-4"}),n[25]=F):F=n[25],n[26]!==O||n[27]!==z?(V=h.jsx(Oe,{content:"Move column right",side:"top",delayDuration:300,children:h.jsx(De,{variant:"text",size:"sm",className:j,onClick:O,disabled:z,children:F})}),n[26]=O,n[27]=z,n[28]=V):V=n[28],n[29]!==c||n[30]!==d?(P=h.jsx("div",{className:"flex gap-2 h-full flex-grow active:bg-accent cursor-grab",...c,...d,"data-testid":"column-drag-button"}),n[29]=c,n[30]=d,n[31]=P):P=n[31],n[32]!==o||n[33]!==i||n[34]!==v?(C=o&&h.jsx(Oe,{content:"Delete column",side:"top",delayDuration:300,children:h.jsx(De,{variant:"text",size:"sm",className:"opacity-0 group-hover:opacity-70 group-hover:hover:opacity-100 text-destructive h-full hover:bg-destructive/20 rounded-none",onClick:()=>v({columnId:i}),children:h.jsx(go,{className:"size-4"})})}),n[32]=o,n[33]=i,n[34]=v,n[35]=C):C=n[35],n[36]!==k||n[37]!==i?($=()=>{k({columnId:i}),requestAnimationFrame(I)},n[36]=k,n[37]=i,n[38]=$):$=n[38],n[39]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx(Or,{className:"size-4"}),n[39]=N):N=n[39],n[40]!==$?(H=h.jsx(Oe,{content:"Add column",side:"top",delayDuration:300,children:h.jsx(De,{variant:"text",size:"sm",className:j,onClick:$,children:N})}),n[40]=$,n[41]=H):H=n[41],n[42]!==V||n[43]!==P||n[44]!==C||n[45]!==H||n[46]!==B?(Y=h.jsxs("div",{className:"h-6 group flex items-center rounded-t-lg border hover:border-border border-[var(--slate-3)] overflow-hidden bg-[var(--slate-1)]",children:[B,V,P,C,H]}),n[42]=V,n[43]=P,n[44]=C,n[45]=H,n[46]=B,n[47]=Y):Y=n[47];const Q=Y;let q;n[48]!==e||n[49]!==u?(q=ce=>{ml(e,u)(ce)},n[48]=e,n[49]=u,n[50]=q):q=n[50];const re=_?"":a.className,ne=_?"z-20":"z-1 hover:z-10 focus-within:z-10",oe=g&&"bg-accent/20";let G,Z;return n[51]!==re||n[52]!==ne||n[53]!==oe?(G=Te(re,ne,oe),n[51]=re,n[52]=ne,n[53]=oe,n[54]=G):G=n[54],n[55]!==Q||n[56]!==_||n[57]!==a||n[58]!==y||n[59]!==q||n[60]!==G?(Z=h.jsxs("div",{tabIndex:-1,ref:q,...a,style:y,"data-is-dragging":_,className:G,children:[Q,a.children]}),n[55]=Q,n[56]=_,n[57]=a,n[58]=y,n[59]=q,n[60]=G,n[61]=Z):Z=n[61],Z});kx.displayName="SortableColumn";const aM=A.memo(kx);function lM(){const t=document.getElementById("App");t&&t.scrollTo({left:t.scrollLeft+1e3,behavior:"smooth"})}const{getColumnWidth:cM,saveColumnWidth:dM}=IU,Sx=A.memo(t=>{const e=X.c(14),n=A.useRef(null);let o;e[0]!==t.children||e[1]!==t.index||e[2]!==t.width?(o=t.width==="columns"?h.jsx(uM,{startingWidth:cM(t.index),onResize:i=>{dM(t.index,i)},children:t.children}):h.jsx("div",{className:"flex flex-col gap-5",children:t.children}),e[0]=t.children,e[1]=t.index,e[2]=t.width,e[3]=o):o=e[3];const r=o;if(t.width==="columns"){let i;return e[4]!==r||e[5]!==t.canDelete||e[6]!==t.canMoveLeft||e[7]!==t.canMoveRight||e[8]!==t.columnId||e[9]!==t.footer?(i=h.jsxs(aM,{tabIndex:-1,ref:n,canDelete:t.canDelete,columnId:t.columnId,canMoveLeft:t.canMoveLeft,canMoveRight:t.canMoveRight,className:"group/column",children:[r,t.footer]}),e[4]=r,e[5]=t.canDelete,e[6]=t.canMoveLeft,e[7]=t.canMoveRight,e[8]=t.columnId,e[9]=t.footer,e[10]=i):i=e[10],i}let s;return e[11]!==r||e[12]!==t.footer?(s=h.jsxs(h.Fragment,{children:[r,t.footer]}),e[11]=r,e[12]=t.footer,e[13]=s):s=e[13],s});Sx.displayName="Column";const uM=t=>{const e=X.c(15),{startingWidth:n,onResize:o,children:r}=t;let s;e[0]!==o||e[1]!==n?(s={startingWidth:n,onResize:o},e[0]=o,e[1]=n,e[2]=s):s=e[2];const{resizableDivRef:i,handleRefs:a,style:l}=AU(s),c=hM;let d,u,f,m;return e[3]!==a.left?(d=c(a.left),e[3]=a.left,e[4]=d):d=e[4],e[5]!==r||e[6]!==i||e[7]!==l?(u=h.jsx("div",{ref:i,className:"flex flex-col gap-5 box-content min-h-[100px] px-11 py-6 min-w-[500px] z-1",style:l,children:r}),e[5]=r,e[6]=i,e[7]=l,e[8]=u):u=e[8],e[9]!==a.right?(f=c(a.right),e[9]=a.right,e[10]=f):f=e[10],e[11]!==d||e[12]!==u||e[13]!==f?(m=h.jsxs("div",{className:"flex flex-row",children:[d,u,f]}),e[11]=d,e[12]=u,e[13]=f,e[14]=m):m=e[14],m};function hM(t){return h.jsx("div",{ref:t,className:`w-[3px] cursor-col-resize transition-colors duration-200 z-[100]
113
113
  relative before:content-[''] before:absolute before:inset-y-0 before:-left-[3px]
114
114
  before:right-[-3px] before:w-[9px] before:z-[-1]
115
115
  hover/column:bg-[var(--slate-3)] dark:hover/column:bg-[var(--slate-5)]
@@ -132,4 +132,4 @@ ${t.stack}`:o}function oo(t,e){return t>>>=0,Zr().subarray(t/1,t/1+e)}function J
132
132
  subprocess.run("${T}")`}:{language:"python",code:`_${I} = """
133
133
  ${T}
134
134
  """`}:{language:"python",code:T}}(o,l);o==="sql"&&ar(a,s,i),s({code:j.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 yn(l)},e[9]=l,e[10]=_):_=e[10];const g=_,p=r==="dark"?"dark":"light",b=o&&FL.has(o)?o:void 0;let x,y,v,S,k,E;return e[11]!==p||e[12]!==b||e[13]!==l?(x=h.jsx(_a,{theme:p,language:b,className:"cm border rounded overflow-hidden",extensions:LL,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(BL,{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(ti,{className:"ml-2 h-4 w-4"}),e[17]=v):v=e[17],e[18]!==m?(S=h.jsxs(De,{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?(E=h.jsxs("div",{className:"relative",children:[x,k]}),e[23]=k,e[24]=x,e[25]=E):E=e[25],E},BL=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(De,{...o,onClick:l,children:c}),e[8]=o,e[9]=l,e[10]=c,e[11]=d):d=e[11],d},UL={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(zL,{code:t.trim(),language:n})]}):h.jsx("code",{className:e,children:t})}},d3=A.memo(t=>{const e=X.c(2),{content:n}=t;let o;return e[0]!==n?(o=h.jsx(RL,{components:UL,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);d3.displayName="MemoizedMarkdownBlock";const u3=A.memo(({content:t})=>{const e=A.useMemo(()=>{return n=t,YV.lexer(n).map(o=>o.raw);var n},[t]);return h.jsx(h.Fragment,{children:e.map((n,o)=>h.jsx(d3,{content:n},`markdown-block-${o}`))})});u3.displayName="MarkdownRenderer";const Vf=(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)}:(Zt.warn("No active chat"),t),VL=t=>{var v;const e=X.c(29),{onNewChat:n,activeChatId:o,setActiveChat:r,chats:s,setMessages:i}=t,a=$e(O4),{handleClick:l}=ya(),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(De,{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(De,{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(Ys,{asChild:!0,children:h.jsx(De,{variant:"text",size:"icon",children:h.jsx(XV,{className:"h-4 w-4"})})})}),e[11]=g):g=e[11],e[12]!==s.length?(p=s.length===0&&h.jsx(In,{title:"No chats yet",description:"Start a new chat to get started",icon:h.jsx(cm,{})}),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:Te("p-3 rounded-md cursor-pointer hover:bg-accent",k.id===o&&"bg-accent"),onClick:()=>{r(k.id),i(k.messages.map(WL))},children:[h.jsx("div",{className:"font-medium",children:k.title}),h.jsx("div",{className:"text-sm text-muted-foreground",children:ZV(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(Vs,{className:"w-[520px] p-0",align:"start",side:"right",children:h.jsx(K2,{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},h3=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=Te("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(Oc,{value:n.content,theme:r,placeholder:"Type your message...",onChange:qL,onSubmit:(f,m)=>{m.trim()&&(s(o,m),a.activeChatId&&i(_=>Vf(_,a.activeChatId,"user",m)))},onClose:GL},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(Z4,{className:"h-3 w-3",value:n.content})}),h.jsx(u3,{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});h3.displayName="ChatMessage";const f3=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(Oc,{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});f3.displayName="ChatInput";const $L=()=>{const t=X.c(6),e=$e(rc),{handleClick:n}=ya();if(!e){let r,s,i;return t[0]!==n?(r=h.jsx(De,{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(cm,{}),t[2]=s):s=t[2],t[3]!==r?(i=h.jsx(In,{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(HL,{}),t[5]=o):o=t[5],o},HL=()=>{const t=X.c(79),[e,n]=hn(od),[o,r]=hn(PS),[s,i]=A.useState(""),a=A.useRef(null),l=A.useRef(null),c=A.useRef(null),d=A.useRef(null),{theme:u}=Lo(),f=e.activeChatId||void 0;let m,_,g,p;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=km("api/ai/chat").toString(),_=Cc.headers(),t[0]=m,t[1]=_):(m=t[0],_=t[1]),t[2]!==n?(g=ge=>{n(he=>Vf(he,he.activeChatId,"assistant",ge.content))},t[2]=n,t[3]=g):g=t[3],t[4]!==f||t[5]!==g?(p={id:f,keepLastMessageOnError:!0,experimental_throttle:100,api:m,headers:_,experimental_prepareRequestBody:JL,streamProtocol:"text",onFinish:g,onError:KL,onResponse:XL},t[4]=f,t[5]=g,t[6]=p):p=t[6];const{messages:b,input:x,setInput:y,setMessages:v,append:S,handleSubmit:k,error:E,status:j,reload:I,stop:T}=JV(p),M=j==="submitted"||j==="streaming";let L,B,O;t[7]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{requestAnimationFrame(()=>{if(c.current){const ge=c.current;ge.scrollTop=ge.scrollHeight}})},t[7]=L):L=t[7],t[8]!==e.activeChatId?(B=[e.activeChatId],t[8]=e.activeChatId,t[9]=B):B=t[9],A.useEffect(L,B),t[10]!==S||t[11]!==n||t[12]!==y||t[13]!==v?(O=ge=>{const he={id:KV(),title:`${ge.slice(0,30)}...`,messages:[{role:"user",content:ge,timestamp:Date.now()}],createdAt:Date.now(),updatedAt:Date.now()};n(je=>({chats:[...je.chats,he],activeChatId:he.id})),v([]),y(""),S({role:"user",content:ge})},t[10]=S,t[11]=n,t[12]=y,t[13]=v,t[14]=O):O=t[14];const z=O;let F;t[15]!==r||t[16]!==y||t[17]!==v?(F=()=>{r(null),v([]),y(""),i("")},t[15]=r,t[16]=y,t[17]=v,t[18]=F):F=t[18];const V=F;let P;t[19]!==S||t[20]!==v?(P=(ge,he)=>{v(je=>je.slice(0,ge)),S({role:"user",content:he})},t[19]=S,t[20]=v,t[21]=P):P=t[21];const C=P;let $;t[22]!==e.activeChatId||t[23]!==k||t[24]!==n?($=(ge,he)=>{he.trim()&&(k(ge),e.activeChatId&&n(je=>Vf(je,e.activeChatId,"user",he)))},t[22]=e.activeChatId,t[23]=k,t[24]=n,t[25]=$):$=t[25];const N=$;let H;t[26]!==I?(H=()=>{I()},t[26]=I,t[27]=H):H=t[27];const Y=H;let Q;t[28]!==z||t[29]!==s?(Q=()=>{s.trim()&&z(s.trim())},t[28]=z,t[29]=s,t[30]=Q):Q=t[30];const q=Q;let re;t[31]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{var ge,he;return(he=(ge=a.current)==null?void 0:ge.editor)==null?void 0:he.blur()},t[31]=re):re=t[31];const ne=re,oe=o==null?void 0:o.id;let G,Z,ce,fe,de,_e,ie,we,ve,ae;if(t[32]!==e.chats||t[33]!==V||t[34]!==r||t[35]!==v||t[36]!==oe?(G=h.jsx(Lm,{children:h.jsx(VL,{onNewChat:V,activeChatId:oe,setActiveChat:r,chats:e.chats,setMessages:v})}),t[32]=e.chats,t[33]=V,t[34]=r,t[35]=v,t[36]=oe,t[37]=G):G=t[37],t[38]!==q||t[39]!==b||t[40]!==s||t[41]!==u?(Z=(!b||b.length===0)&&h.jsx("div",{className:"flex rounded-md border px-1 bg-background",children:h.jsx(Oc,{value:s,placeholder:"Ask anything, @ to include context about tables or dataframes",theme:u,onClose:ne,onChange:i,onSubmit:q},"new-thread-input")}),t[38]=q,t[39]=b,t[40]=s,t[41]=u,t[42]=Z):Z=t[42],t[43]!==e||t[44]!==C||t[45]!==b||t[46]!==n||t[47]!==u){let ge;t[49]!==e||t[50]!==C||t[51]!==n||t[52]!==u?(ge=(he,je)=>h.jsx(h3,{message:he,index:je,theme:u,onEdit:C,setChatState:n,chatState:e},je),t[49]=e,t[50]=C,t[51]=n,t[52]=u,t[53]=ge):ge=t[53],ce=b.map(ge),t[43]=e,t[44]=C,t[45]=b,t[46]=n,t[47]=u,t[48]=ce}else ce=t[48];return t[54]!==M?(fe=M&&h.jsx("div",{className:"flex justify-center py-4",children:h.jsx(Tm,{className:"h-4 w-4 animate-spin"})}),t[54]=M,t[55]=fe):fe=t[55],t[56]!==E||t[57]!==Y?(de=E&&h.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[h.jsx(Xs,{error:E}),h.jsx(De,{variant:"outline",size:"sm",onClick:Y,children:"Retry"})]}),t[56]=E,t[57]=Y,t[58]=de):de=t[58],t[59]===Symbol.for("react.memo_cache_sentinel")?(_e=h.jsx("div",{ref:d}),t[59]=_e):_e=t[59],t[60]!==Z||t[61]!==ce||t[62]!==fe||t[63]!==de?(ie=h.jsxs("div",{className:"flex-1 px-3 bg-[var(--slate-1)] gap-4 py-3 flex flex-col overflow-y-auto",ref:c,children:[Z,ce,fe,de,_e]}),t[60]=Z,t[61]=ce,t[62]=fe,t[63]=de,t[64]=ie):ie=t[64],t[65]!==M||t[66]!==T?(we=M&&h.jsx("div",{className:"w-full flex justify-center items-center z-20 border-t",children:h.jsx(De,{variant:"linkDestructive",size:"sm",onClick:T,children:"Stop"})}),t[65]=M,t[66]=T,t[67]=we):we=t[67],t[68]!==N||t[69]!==x||t[70]!==b||t[71]!==y||t[72]!==u?(ve=b&&b.length>0&&h.jsx(f3,{input:x,setInput:y,onSubmit:N,theme:u,inputRef:l}),t[68]=N,t[69]=x,t[70]=b,t[71]=y,t[72]=u,t[73]=ve):ve=t[73],t[74]!==G||t[75]!==ie||t[76]!==we||t[77]!==ve?(ae=h.jsxs("div",{className:"flex flex-col h-[calc(100%-53px)]",children:[G,ie,we,ve]}),t[74]=G,t[75]=ie,t[76]=we,t[77]=ve,t[78]=ae):ae=t[78],ae};function WL(t){const{role:e,content:n,timestamp:o}=t;return{role:e,content:n,id:o.toString()}}function qL(){}function GL(){}function YL(t){return t.content}function JL(t){return{...t,...g4({input:t.messages.map(YL).join(`
135
- `)}),includeOtherCode:kc("")}}function KL(t){Zt.error("An error occurred:",t)}function XL(t){Zt.debug("Received HTTP response from server:",t)}const ZL=K.lazy(()=>Mm(()=>import("./tracing-FlSPUWbu.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,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,118,119,120,121,122]),import.meta.url).then(t=>({default:t.Tracing}))),QL=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(K.Suspense,{fallback:h.jsx(eF,{}),children:h.jsx(ZL,{})}),t[0]=e):e=t[0],e},eF=()=>{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(Qn,{})}),t[0]=e):e=t[0],e},tF=()=>{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(oF,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(rF).map(sF),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(Qn,{size:"medium",centered:!0}),t[5]=y):y=t[5],y}if(i){let y;return t[6]!==i?(y=h.jsx(Xs,{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(In,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:h.jsx(Gc,{})}),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(vg,{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(Hm,{children:h.jsxs(Ks,{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(iF),t[18]=c,t[19]=p):p=t[19],t[20]!==p?(b=h.jsxs($m,{className:"overflow-auto flex-1 mb-16",children:[g,h.jsx(Wm,{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},nF=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(gc,{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 oF(){return wg((await gS.request({})).secrets)}function rF(t){return t.provider!=="env"}function sF(t){return t.name}function iF(t){return t.keys.map(e=>h.jsxs(Ks,{className:"group",children:[h.jsx(Rr,{children:e}),h.jsx(Rr,{children:t.provider!=="env"&&h.jsx(R4,{variant:"outline",className:"select-none",children:t.name})}),h.jsx(Rr,{children:h.jsx(nF,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await yn(`os.environ["${e}"]`),lt({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:Te("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const aF=K.lazy(()=>Mm(()=>import("./terminal-eWB6WB3W.js"),__vite__mapDeps([123,1,2,124]),import.meta.url)),lF=t=>{const e=X.c(120),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=pc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=na(),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(dF)},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(hF)},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(zc,{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=Te("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(x=h.jsx(oS,{onDragging:rS,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=Te("border-border no-print z-20",v,"horizontal"),e[12]=v,e[13]=S):S=e[13],e[14]!==S?(k=h.jsx(oS,{onDragging:rS,className:S}),e[14]=S,e[15]=k):k=e[15];const E=k;let j,I,T,M,L,B,O,z,F,V,P,C,$,N,H,Y,Q,q,re,ne,oe;e[16]!==s?(j=h.jsx("div",{className:"text-sm text-[var(--slate-11)] uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=j):j=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(go,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==I?(M=h.jsx(De,{"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]!==j||e[24]!==M?(L=h.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[j,M]}),e[23]=j,e[24]=M,e[25]=L):L=e[25],e[26]!==s?(B=s==="files"&&h.jsx(ZD,{}),e[26]=s,e[27]=B):B=e[27],e[28]!==s?(O=s==="errors"&&h.jsx(Ix,{}),e[28]=s,e[29]=O):O=e[29],e[30]!==s?(z=s==="variables"&&h.jsx(v2,{}),e[30]=s,e[31]=z):z=e[31],e[32]!==s?(F=s==="dependencies"&&h.jsx(CD,{}),e[32]=s,e[33]=F):F=e[33],e[34]!==s?(V=s==="packages"&&h.jsx(CR,{}),e[34]=s,e[35]=V):V=e[35],e[36]!==s?(P=s==="outline"&&h.jsx(ZM,{}),e[36]=s,e[37]=P):P=e[37],e[38]!==s?(C=s==="datasources"&&h.jsx(bR,{}),e[38]=s,e[39]=C):C=e[39],e[40]!==s?($=s==="documentation"&&h.jsx(AD,{}),e[40]=s,e[41]=$):$=e[41],e[42]!==s?(N=s==="snippets"&&h.jsx(oR,{}),e[42]=s,e[43]=N):N=e[43],e[44]!==s?(H=s==="scratchpad"&&h.jsx(SR,{}),e[44]=s,e[45]=H):H=e[45],e[46]!==s?(Y=s==="chat"&&h.jsx($L,{}),e[46]=s,e[47]=Y):Y=e[47],e[48]!==s?(Q=s==="logs"&&h.jsx(k2,{}),e[48]=s,e[49]=Q):Q=e[49],e[50]!==s?(q=s==="tracing"&&h.jsx(QL,{}),e[50]=s,e[51]=q):q=e[51],e[52]!==s?(re=s==="secrets"&&h.jsx(tF,{}),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]!==P||e[60]!==C||e[61]!==$||e[62]!==N||e[63]!==H||e[64]!==Y||e[65]!==Q||e[66]!==q||e[67]!==re?(ne=h.jsx(A.Suspense,{children:h.jsxs(Pc,{children:[B,O,z,F,V,P,C,$,N,H,Y,Q,q,re]})}),e[54]=B,e[55]=O,e[56]=z,e[57]=F,e[58]=V,e[59]=P,e[60]=C,e[61]=$,e[62]=N,e[63]=H,e[64]=Y,e[65]=Q,e[66]=q,e[67]=re,e[68]=ne):ne=e[68],e[69]!==L||e[70]!==ne?(oe=h.jsx(xc,{children:h.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[L,ne]})}),e[69]=L,e[70]=ne,e[71]=oe):oe=e[71];const G=oe,Z=o&&"border-r border-l border-[var(--slate-7)]";let ce,fe,de,_e,ie,we;e[72]!==Z?(ce=Te("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",Z),e[72]=Z,e[73]=ce):ce=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(fe=(ue,Ne)=>{var ke;Ne===0&&ue===10&&((ke=l.current)==null||ke.resize(30))},e[74]=fe):fe=e[74],e[75]!==i?(de=()=>i(!1),_e=()=>i(!0),e[75]=i,e[76]=de,e[77]=_e):(de=e[76],_e=e[77]),e[78]!==G||e[79]!==y?(ie=h.jsxs("span",{className:"flex flex-row h-full",children:[G," ",y]}),e[78]=G,e[79]=y,e[80]=ie):ie=e[80],e[81]!==ce||e[82]!==de||e[83]!==_e||e[84]!==ie?(we=h.jsx(zc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:ce,minSize:10,defaultSize:0,maxSize:75,onResize:fe,onCollapse:de,onExpand:_e,children:ie},"helper"),e[81]=ce,e[82]=de,e[83]=_e,e[84]=ie,e[85]=we):we=e[85];const ve=we,ae=r&&"border-[var(--slate-7)]";let ge,he,je,Fe,He,Xe,Le,et;e[86]!==ae?(ge=Te("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",ae),e[86]=ae,e[87]=ge):ge=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(he=(ue,Ne)=>{var ke;Ne===0&&ue===10&&((ke=c.current)==null||ke.resize(30))},e[88]=he):he=e[88],e[89]!==a?(je=()=>a(!1),Fe=()=>a(!0),e[89]=a,e[90]=je,e[91]=Fe):(je=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(aF,{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(yR,{isOpen:r,children:Xe}),e[97]=r,e[98]=Xe,e[99]=Le):Le=e[99],e[100]!==ge||e[101]!==je||e[102]!==Fe||e[103]!==Le||e[104]!==E?(et=h.jsxs(zc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:ge,minSize:10,defaultSize:0,maxSize:75,onResize:he,onCollapse:je,onExpand:Fe,children:[E,Le]},"terminal"),e[100]=ge,e[101]=je,e[102]=Fe,e[103]=Le,e[104]=E,e[105]=et):et=e[105];const nt=et;let it,te,Ce,Ae,ze,J,pe,be;return e[106]===Symbol.for("react.memo_cache_sentinel")?(it=H$(),e[106]=it):it=e[106],e[107]===Symbol.for("react.memo_cache_sentinel")?(te=h.jsx(Pc,{children:h.jsx(qM,{})}),e[107]=te):te=e[107],e[108]!==nt?(Ce=h.jsx(Nx,{capability:"terminal",children:nt}),e[108]=nt,e[109]=Ce):Ce=e[109],e[110]!==g||e[111]!==Ce?(Ae=h.jsx(zc,{children:h.jsxs(sS,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,Ce]})}),e[110]=g,e[111]=Ce,e[112]=Ae):Ae=e[112],e[113]===Symbol.for("react.memo_cache_sentinel")?(ze=h.jsx(QV,{}),e[113]=ze):ze=e[113],e[114]!==ve||e[115]!==Ae?(J=h.jsxs(sS,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:it,children:[te,ve,Ae,ze]}),e[114]=ve,e[115]=Ae,e[116]=J):J=e[116],e[117]===Symbol.for("react.memo_cache_sentinel")?(pe=h.jsx(xc,{children:h.jsx(Pc,{children:h.jsx(UM,{})})}),e[117]=pe):pe=e[117],e[118]!==J?(be=h.jsxs(W$,{children:[J,pe]}),e[118]=J,e[119]=be):be=e[119],be};function cF(){window.dispatchEvent(new Event("resize"))}function dF(){requestAnimationFrame(cF)}function uF(){window.dispatchEvent(new Event("resize"))}function hF(){requestAnimationFrame(uF)}let m3;m3=new URL(window.location.href).searchParams.get(e$.showChrome)==="false",kS=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=X.c(10);if(m3){let s,i,a;return e[0]!==t?(s=h.jsx(Cx,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(Qp,{}),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(Cx,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(Qp,{}),e[7]=o):o=e[7],e[8]!==n?(r=h.jsxs(lF,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{ep as C,Uc as E,In as P,J$ as __tla,tp as a,kS as e,wa as f,np as u};
135
+ `)}),includeOtherCode:kc("")}}function KL(t){Zt.error("An error occurred:",t)}function XL(t){Zt.debug("Received HTTP response from server:",t)}const ZL=K.lazy(()=>Mm(()=>import("./tracing-kkBKxC29.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,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,118,119,120,121,122]),import.meta.url).then(t=>({default:t.Tracing}))),QL=()=>{const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(K.Suspense,{fallback:h.jsx(eF,{}),children:h.jsx(ZL,{})}),t[0]=e):e=t[0],e},eF=()=>{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(Qn,{})}),t[0]=e):e=t[0],e},tF=()=>{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(oF,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(rF).map(sF),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(Qn,{size:"medium",centered:!0}),t[5]=y):y=t[5],y}if(i){let y;return t[6]!==i?(y=h.jsx(Xs,{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(In,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:h.jsx(Gc,{})}),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(vg,{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(Hm,{children:h.jsxs(Ks,{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(iF),t[18]=c,t[19]=p):p=t[19],t[20]!==p?(b=h.jsxs($m,{className:"overflow-auto flex-1 mb-16",children:[g,h.jsx(Wm,{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},nF=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(gc,{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 oF(){return wg((await gS.request({})).secrets)}function rF(t){return t.provider!=="env"}function sF(t){return t.name}function iF(t){return t.keys.map(e=>h.jsxs(Ks,{className:"group",children:[h.jsx(Rr,{children:e}),h.jsx(Rr,{children:t.provider!=="env"&&h.jsx(R4,{variant:"outline",className:"select-none",children:t.name})}),h.jsx(Rr,{children:h.jsx(nF,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await yn(`os.environ["${e}"]`),lt({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:Te("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const aF=K.lazy(()=>Mm(()=>import("./terminal-N29-zV72.js"),__vite__mapDeps([123,1,2,124]),import.meta.url)),lF=t=>{const e=X.c(120),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=pc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=na(),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(dF)},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(hF)},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(zc,{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=Te("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(x=h.jsx(oS,{onDragging:rS,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=Te("border-border no-print z-20",v,"horizontal"),e[12]=v,e[13]=S):S=e[13],e[14]!==S?(k=h.jsx(oS,{onDragging:rS,className:S}),e[14]=S,e[15]=k):k=e[15];const E=k;let j,I,T,M,L,B,O,z,F,V,P,C,$,N,H,Y,Q,q,re,ne,oe;e[16]!==s?(j=h.jsx("div",{className:"text-sm text-[var(--slate-11)] uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=j):j=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(go,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==I?(M=h.jsx(De,{"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]!==j||e[24]!==M?(L=h.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[j,M]}),e[23]=j,e[24]=M,e[25]=L):L=e[25],e[26]!==s?(B=s==="files"&&h.jsx(ZD,{}),e[26]=s,e[27]=B):B=e[27],e[28]!==s?(O=s==="errors"&&h.jsx(Ix,{}),e[28]=s,e[29]=O):O=e[29],e[30]!==s?(z=s==="variables"&&h.jsx(v2,{}),e[30]=s,e[31]=z):z=e[31],e[32]!==s?(F=s==="dependencies"&&h.jsx(CD,{}),e[32]=s,e[33]=F):F=e[33],e[34]!==s?(V=s==="packages"&&h.jsx(CR,{}),e[34]=s,e[35]=V):V=e[35],e[36]!==s?(P=s==="outline"&&h.jsx(ZM,{}),e[36]=s,e[37]=P):P=e[37],e[38]!==s?(C=s==="datasources"&&h.jsx(bR,{}),e[38]=s,e[39]=C):C=e[39],e[40]!==s?($=s==="documentation"&&h.jsx(AD,{}),e[40]=s,e[41]=$):$=e[41],e[42]!==s?(N=s==="snippets"&&h.jsx(oR,{}),e[42]=s,e[43]=N):N=e[43],e[44]!==s?(H=s==="scratchpad"&&h.jsx(SR,{}),e[44]=s,e[45]=H):H=e[45],e[46]!==s?(Y=s==="chat"&&h.jsx($L,{}),e[46]=s,e[47]=Y):Y=e[47],e[48]!==s?(Q=s==="logs"&&h.jsx(k2,{}),e[48]=s,e[49]=Q):Q=e[49],e[50]!==s?(q=s==="tracing"&&h.jsx(QL,{}),e[50]=s,e[51]=q):q=e[51],e[52]!==s?(re=s==="secrets"&&h.jsx(tF,{}),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]!==P||e[60]!==C||e[61]!==$||e[62]!==N||e[63]!==H||e[64]!==Y||e[65]!==Q||e[66]!==q||e[67]!==re?(ne=h.jsx(A.Suspense,{children:h.jsxs(Pc,{children:[B,O,z,F,V,P,C,$,N,H,Y,Q,q,re]})}),e[54]=B,e[55]=O,e[56]=z,e[57]=F,e[58]=V,e[59]=P,e[60]=C,e[61]=$,e[62]=N,e[63]=H,e[64]=Y,e[65]=Q,e[66]=q,e[67]=re,e[68]=ne):ne=e[68],e[69]!==L||e[70]!==ne?(oe=h.jsx(xc,{children:h.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[L,ne]})}),e[69]=L,e[70]=ne,e[71]=oe):oe=e[71];const G=oe,Z=o&&"border-r border-l border-[var(--slate-7)]";let ce,fe,de,_e,ie,we;e[72]!==Z?(ce=Te("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",Z),e[72]=Z,e[73]=ce):ce=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(fe=(ue,Ne)=>{var ke;Ne===0&&ue===10&&((ke=l.current)==null||ke.resize(30))},e[74]=fe):fe=e[74],e[75]!==i?(de=()=>i(!1),_e=()=>i(!0),e[75]=i,e[76]=de,e[77]=_e):(de=e[76],_e=e[77]),e[78]!==G||e[79]!==y?(ie=h.jsxs("span",{className:"flex flex-row h-full",children:[G," ",y]}),e[78]=G,e[79]=y,e[80]=ie):ie=e[80],e[81]!==ce||e[82]!==de||e[83]!==_e||e[84]!==ie?(we=h.jsx(zc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:ce,minSize:10,defaultSize:0,maxSize:75,onResize:fe,onCollapse:de,onExpand:_e,children:ie},"helper"),e[81]=ce,e[82]=de,e[83]=_e,e[84]=ie,e[85]=we):we=e[85];const ve=we,ae=r&&"border-[var(--slate-7)]";let ge,he,je,Fe,He,Xe,Le,et;e[86]!==ae?(ge=Te("dark:bg-[var(--slate-1)] no-print print:hidden hide-on-fullscreen",ae),e[86]=ae,e[87]=ge):ge=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(he=(ue,Ne)=>{var ke;Ne===0&&ue===10&&((ke=c.current)==null||ke.resize(30))},e[88]=he):he=e[88],e[89]!==a?(je=()=>a(!1),Fe=()=>a(!0),e[89]=a,e[90]=je,e[91]=Fe):(je=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(aF,{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(yR,{isOpen:r,children:Xe}),e[97]=r,e[98]=Xe,e[99]=Le):Le=e[99],e[100]!==ge||e[101]!==je||e[102]!==Fe||e[103]!==Le||e[104]!==E?(et=h.jsxs(zc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:ge,minSize:10,defaultSize:0,maxSize:75,onResize:he,onCollapse:je,onExpand:Fe,children:[E,Le]},"terminal"),e[100]=ge,e[101]=je,e[102]=Fe,e[103]=Le,e[104]=E,e[105]=et):et=e[105];const nt=et;let it,te,Ce,Ae,ze,J,pe,be;return e[106]===Symbol.for("react.memo_cache_sentinel")?(it=H$(),e[106]=it):it=e[106],e[107]===Symbol.for("react.memo_cache_sentinel")?(te=h.jsx(Pc,{children:h.jsx(qM,{})}),e[107]=te):te=e[107],e[108]!==nt?(Ce=h.jsx(Nx,{capability:"terminal",children:nt}),e[108]=nt,e[109]=Ce):Ce=e[109],e[110]!==g||e[111]!==Ce?(Ae=h.jsx(zc,{children:h.jsxs(sS,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[g,Ce]})}),e[110]=g,e[111]=Ce,e[112]=Ae):Ae=e[112],e[113]===Symbol.for("react.memo_cache_sentinel")?(ze=h.jsx(QV,{}),e[113]=ze):ze=e[113],e[114]!==ve||e[115]!==Ae?(J=h.jsxs(sS,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:it,children:[te,ve,Ae,ze]}),e[114]=ve,e[115]=Ae,e[116]=J):J=e[116],e[117]===Symbol.for("react.memo_cache_sentinel")?(pe=h.jsx(xc,{children:h.jsx(Pc,{children:h.jsx(UM,{})})}),e[117]=pe):pe=e[117],e[118]!==J?(be=h.jsxs(W$,{children:[J,pe]}),e[118]=J,e[119]=be):be=e[119],be};function cF(){window.dispatchEvent(new Event("resize"))}function dF(){requestAnimationFrame(cF)}function uF(){window.dispatchEvent(new Event("resize"))}function hF(){requestAnimationFrame(uF)}let m3;m3=new URL(window.location.href).searchParams.get(e$.showChrome)==="false",kS=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=X.c(10);if(m3){let s,i,a;return e[0]!==t?(s=h.jsx(Cx,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(Qp,{}),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(Cx,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=h.jsx(Qp,{}),e[7]=o):o=e[7],e[8]!==n?(r=h.jsxs(lF,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{ep as C,Uc as E,In as P,J$ as __tla,tp as a,kS as e,wa as f,np as u};