@marimo-team/frontend 0.14.18-dev25 → 0.14.18-dev27

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 (105) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-uUW_oa-n.js → ConnectedDataExplorerComponent-kV89hegS.js} +1 -1
  2. package/dist/assets/{ImageComparisonComponent-D3rn2HCY.js → ImageComparisonComponent-CCBT9pik.js} +1 -1
  3. package/dist/assets/{VegaLite-C81SYXSH.js → VegaLite-FoO-nmDF.js} +1 -1
  4. package/dist/assets/{_baseEach-CCKARmjk.js → _baseEach-BtPNr9PU.js} +1 -1
  5. package/dist/assets/_baseMap-Bx7gBfad.js +1 -0
  6. package/dist/assets/{_baseUniq-Ct6AJG4k.js → _baseUniq-BLQswvX5.js} +1 -1
  7. package/dist/assets/{_createAggregator-D9sUI_I2.js → _createAggregator-DjaN3Ndt.js} +1 -1
  8. package/dist/assets/{any-language-editor-D48TLVli.js → any-language-editor-g32_9cET.js} +1 -1
  9. package/dist/assets/{architectureDiagram-SUXI7LT5-DsHbpG7-.js → architectureDiagram-SUXI7LT5-C1FIdnR-.js} +1 -1
  10. package/dist/assets/{blockDiagram-6J76NXCF-miF3EQqD.js → blockDiagram-6J76NXCF-HyHHhbpS.js} +1 -1
  11. package/dist/assets/{c4Diagram-6F6E4RAY-DDyzKT7I.js → c4Diagram-6F6E4RAY-C4V1bSE7.js} +1 -1
  12. package/dist/assets/channel-ClPZuylT.js +1 -0
  13. package/dist/assets/{chunk-353BL4L5-C3r6f9qX.js → chunk-353BL4L5-BvWoFLoD.js} +1 -1
  14. package/dist/assets/{chunk-67H74DCK-Bejh7gMt.js → chunk-67H74DCK-CQxTlpPD.js} +1 -1
  15. package/dist/assets/{chunk-AACKK3MU-sMVfID3D.js → chunk-AACKK3MU-1SBO6ypc.js} +1 -1
  16. package/dist/assets/{chunk-BFAMUDN2-CPrzh58T.js → chunk-BFAMUDN2-Dtwm2Z3D.js} +1 -1
  17. package/dist/assets/{chunk-E2GYISFI-CpRIm91o.js → chunk-E2GYISFI-BgLYUu0E.js} +1 -1
  18. package/dist/assets/{chunk-OW32GOEJ--NsOOyke.js → chunk-OW32GOEJ-jpV888KO.js} +1 -1
  19. package/dist/assets/{chunk-SKB7J2MH-VEIhIqAb.js → chunk-SKB7J2MH-uQaRxI7q.js} +1 -1
  20. package/dist/assets/{chunk-SZ463SBG-D5dyDk77.js → chunk-SZ463SBG-1nKNGw5S.js} +1 -1
  21. package/dist/assets/{circle-play-CG2MKDA7.js → circle-play-ln4YSzur.js} +1 -1
  22. package/dist/assets/classDiagram-M3E45YP4-DrSJwLTe.js +1 -0
  23. package/dist/assets/classDiagram-v2-YAWTLIQI-DrSJwLTe.js +1 -0
  24. package/dist/assets/clone-bCrdm5nu.js +1 -0
  25. package/dist/assets/{compile-DP96rHJE.js → compile-CUHAUIGX.js} +1 -1
  26. package/dist/assets/{dagre-JOIXM2OF-0pjdswA-.js → dagre-JOIXM2OF-BsekNXc2.js} +1 -1
  27. package/dist/assets/{data-grid-overlay-editor-Brdcr4Cg.js → data-grid-overlay-editor-CbLpxNH2.js} +1 -1
  28. package/dist/assets/{diagram-5UYTHUR4-DaSfveJw.js → diagram-5UYTHUR4-BoQSxLct.js} +1 -1
  29. package/dist/assets/{diagram-VMROVX33-DbPgVdVv.js → diagram-VMROVX33-BlQs1oGq.js} +1 -1
  30. package/dist/assets/{diagram-ZTM2IBQH-AI1tyxQl.js → diagram-ZTM2IBQH-BLTVC_oB.js} +1 -1
  31. package/dist/assets/{edit-page-DVUbxAiV.js → edit-page-CKuvoCUs.js} +4 -4
  32. package/dist/assets/{erDiagram-3M52JZNH-B-bvH0zO.js → erDiagram-3M52JZNH-DuJKG4Gf.js} +1 -1
  33. package/dist/assets/{flowDiagram-KYDEHFYC-00godu9K.js → flowDiagram-KYDEHFYC-DEy3MkMb.js} +1 -1
  34. package/dist/assets/{ganttDiagram-EK5VF46D-BQ1iBKwi.js → ganttDiagram-EK5VF46D-C6Lur_08.js} +1 -1
  35. package/dist/assets/{gitGraphDiagram-GW3U2K7C-D5Tz2vMb.js → gitGraphDiagram-GW3U2K7C-R9ILoxeN.js} +1 -1
  36. package/dist/assets/{glide-data-editor-DlFhFA5K.js → glide-data-editor-Bbfoi1Gx.js} +4 -4
  37. package/dist/assets/{graph-DILKkkuJ.js → graph-IyATW7Ls.js} +1 -1
  38. package/dist/assets/{home-page-DfUEt5SZ.js → home-page-H9Py-FLg.js} +1 -1
  39. package/dist/assets/{index-Bje05tll.js → index-7dYaveQG.js} +1 -1
  40. package/dist/assets/{index-Wo8BkCCL.js → index-BERYPFL1.js} +1 -1
  41. package/dist/assets/{index-GN_ls_Ca.js → index-BMTo1kmZ.js} +1 -1
  42. package/dist/assets/{index-De0Y6uVY.js → index-BOOKcrkr.js} +1 -1
  43. package/dist/assets/{index-zgsv7Wc7.js → index-BkKnv7OZ.js} +1 -1
  44. package/dist/assets/{index-CTY2I0Yv.js → index-BuC1PbVD.js} +1 -1
  45. package/dist/assets/{index-B-0VrQJs.js → index-BuiYi25-.js} +13 -13
  46. package/dist/assets/{index-CXwIwO75.js → index-CU4PVlXT.js} +1 -1
  47. package/dist/assets/{index-Zqgca8xb.js → index-CUIPUIK9.js} +1 -1
  48. package/dist/assets/{index-DKAkPOzF.js → index-CUb_KVnK.js} +1 -1
  49. package/dist/assets/{index-Dy9b9CBe.js → index-C_joixHv.js} +1 -1
  50. package/dist/assets/{index-DjWXyjjL.js → index-CmKaZns3.js} +1 -1
  51. package/dist/assets/{index-roXogAjj.js → index-DB6hYznU.js} +1 -1
  52. package/dist/assets/{index-Bm5qdklD.js → index-DQWhXpqD.js} +1 -1
  53. package/dist/assets/{index-CmJl_54o.js → index-DSkvxN6G.js} +1 -1
  54. package/dist/assets/{index-BUdpsSTm.js → index-Dlo4pRcD.js} +1 -1
  55. package/dist/assets/{index-3u3F_pc_.js → index-NvSa6WXE.js} +1 -1
  56. package/dist/assets/{index-BjFS2OOX.js → index-ODIo4Rny.js} +1 -1
  57. package/dist/assets/{index-DMPtgxYL.js → index-brfAOFcq.js} +1 -1
  58. package/dist/assets/infoDiagram-LHK5PUON-pVniElLT.js +2 -0
  59. package/dist/assets/{journeyDiagram-EWQZEKCU-seuSICJD.js → journeyDiagram-EWQZEKCU-COlVsWT6.js} +1 -1
  60. package/dist/assets/{kanban-definition-ZSS6B67P-BFjlBPnQ.js → kanban-definition-ZSS6B67P-CH-Y8xC4.js} +1 -1
  61. package/dist/assets/{layout-Da1rMK06.js → layout-DF0eeXRM.js} +1 -1
  62. package/dist/assets/{linear-Cf4m4pdY.js → linear-BjNl7qfj.js} +1 -1
  63. package/dist/assets/links-C3JblEio.js +18 -0
  64. package/dist/assets/{mermaid-upQivttk.js → mermaid-CkIWo3KZ.js} +4 -4
  65. package/dist/assets/{min-CSxPTKuA.js → min-BhHIVgiw.js} +1 -1
  66. package/dist/assets/{mindmap-definition-6CBA2TL7-BqjV1n_A.js → mindmap-definition-6CBA2TL7-DvXI-sDy.js} +1 -1
  67. package/dist/assets/{number-overlay-editor-7iSsv6oT.js → number-overlay-editor-BrJwlgom.js} +1 -1
  68. package/dist/assets/{pieDiagram-NIOCPIFQ-CQ5LrDZz.js → pieDiagram-NIOCPIFQ-DmRtvckw.js} +1 -1
  69. package/dist/assets/{quadrantDiagram-2OG54O6I-7PMNuAjn.js → quadrantDiagram-2OG54O6I-B-myavfQ.js} +1 -1
  70. package/dist/assets/{react-plotly-v2f3cnH0.js → react-plotly-CbD0E3gn.js} +1 -1
  71. package/dist/assets/{requirementDiagram-QOLK2EJ7-rs-_sls-.js → requirementDiagram-QOLK2EJ7-B0iBUYVd.js} +1 -1
  72. package/dist/assets/{run-page-oQHKY6wX.js → run-page-CfCr8ZaZ.js} +1 -1
  73. package/dist/assets/{sankeyDiagram-4UZDY2LN-DeKeOc4P.js → sankeyDiagram-4UZDY2LN-BOABhaGp.js} +1 -1
  74. package/dist/assets/{sequenceDiagram-SKLFT4DO-DpBetwFn.js → sequenceDiagram-SKLFT4DO-CVm9Rc2n.js} +1 -1
  75. package/dist/assets/{slides-component-B8jVQNPd.js → slides-component-Dhxcg3GE.js} +1 -1
  76. package/dist/assets/{sortBy-Chg88WWD.js → sortBy-DboPkNKn.js} +1 -1
  77. package/dist/assets/{stateDiagram-MI5ZYTHO-C4Mfh1a2.js → stateDiagram-MI5ZYTHO-B0D_2l-g.js} +1 -1
  78. package/dist/assets/stateDiagram-v2-5AN5P6BG-D02K8lMX.js +1 -0
  79. package/dist/assets/{storage-MSc_Sfm1.js → storage-BG0-GvyP.js} +3 -3
  80. package/dist/assets/{terminal-9jZQ3IDc.js → terminal-BArxXaJ7.js} +1 -1
  81. package/dist/assets/{time-D8GAmv2E.js → time-jUzTrC3Y.js} +1 -1
  82. package/dist/assets/{timeline-definition-MYPXXCX6-BEQaSzX_.js → timeline-definition-MYPXXCX6-DGqL1AI5.js} +1 -1
  83. package/dist/assets/{tracing-2DOPh4d7.js → tracing-Bpc-dmnr.js} +2 -2
  84. package/dist/assets/{trash-yfzCnI7m.js → trash-XFZSbevE.js} +1 -1
  85. package/dist/assets/{treemap-75Q7IDZK-0Nh4W7l5.js → treemap-75Q7IDZK-DZ-dAoS7.js} +1 -1
  86. package/dist/assets/{vega-component-Bj1KedcS.js → vega-component-BHuC7Ytz.js} +1 -1
  87. package/dist/assets/{xychartDiagram-H2YORKM3-CbP3FZsC.js → xychartDiagram-H2YORKM3-CqwhMSJ2.js} +1 -1
  88. package/dist/index.html +1 -1
  89. package/package.json +1 -1
  90. package/src/components/ai/ai-model-dropdown.tsx +1 -9
  91. package/src/components/ai/ai-provider-icon.tsx +2 -0
  92. package/src/components/app-config/ai-config.tsx +83 -12
  93. package/src/components/slides/slides.css +0 -1
  94. package/src/core/ai/ids/__tests__/ids.test.ts +8 -0
  95. package/src/core/ai/ids/ids.ts +1 -0
  96. package/src/core/cells/cells.ts +1 -1
  97. package/src/plugins/layout/carousel/CarouselPlugin.tsx +0 -2
  98. package/dist/assets/_baseMap-DHFHd42n.js +0 -1
  99. package/dist/assets/channel-Dp-bN8Tn.js +0 -1
  100. package/dist/assets/classDiagram-M3E45YP4-CbrErnga.js +0 -1
  101. package/dist/assets/classDiagram-v2-YAWTLIQI-CbrErnga.js +0 -1
  102. package/dist/assets/clone-Bwreh4_E.js +0 -1
  103. package/dist/assets/infoDiagram-LHK5PUON-Jii4Xmvn.js +0 -2
  104. package/dist/assets/links-C2UZ92jn.js +0 -18
  105. package/dist/assets/stateDiagram-v2-5AN5P6BG-Bbw2B1Vc.js +0 -1
@@ -0,0 +1,18 @@
1
+ import{cd as Ds,aO as Ts,c as oe,U as S,b as Xe,j as s,fs as Es,ft as _s,a as H,cA as Ps,ar as Ze,fu as Ms,T as Ge,fv as Fn,f9 as As,fw as Bn,fx as P,fy as Hn,fz as M,fA as T,fB as A,fC as me,fD as L,bn as Me,fE as Gn,fF as F,fG as re,ac as Ue,fH as de,bo as ie,fI as pt,e3 as Un,fJ as qn,fK as Rs,fL as Ae,fM as Ne,fN as Vn,fO as Ls,fP as Wn,fQ as gt,fR as $n,fS as zs,fT as mt,L as ne,fU as ae,fV as Fs,dQ as vt,fW as Kn,eJ as Bs,ds as Gt,fi as Hs,fX as Ut,fY as Gs,fZ as Us,f_ as Yn,f$ as Qn,g0 as qs,al as Je,bd as et,eR as qt,V as xt,g1 as Vs,g2 as Ws,g3 as Xn,g4 as Zn,g5 as $s,a6 as xe,eu as yt,g6 as Jn,a4 as Vt,g7 as Ks,g8 as Ys,a7 as er,a8 as Qs,a9 as tr,g9 as Xs,ga as Zs,gb as Js,b4 as eo,gc as to,gd as no,ge as ro,gf as io,gg as so,gh as oo,cl as ao,bp as bt,er as lo,dM as nr,ad as co,ab as uo,gi as ho,b2 as fo,b1 as po,eZ as jt,gj as go,au as mo,a$ as vo,a_ as rr,aU as xo,gk as yo,gl as bo,gm as jo,gn as wo,bl as wt,cg as ir,go as ko,gp as sr,at as qe,gq as or,gr as Wt,gs as ar,gt as lr,ag as Le,gu as So,gv as Io,gw as cr,gx as Co,gy as Oo,aS as No,gz as Do,gA as To,gB as Eo,aJ as _o,gC as dr,gD as $t,aw as Po,_ as ur,E as Mo,gE as Ao,gF as kt,gG as Ro,gH as Lo,ao as Kt,fg as zo,gI as Fo,gJ as Bo,gK as Ho,gL as Go,ep as tt,dC as St,gM as Uo,gN as hr,gO as qo,a5 as Vo,gP as Wo,gQ as $o,gR as Ko,b9 as Yo,bi as Qo,b7 as Xo}from"./index-BuiYi25-.js";import{e as Zo}from"./index-BuC1PbVD.js";/**
2
+ * @license lucide-react v0.525.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Jo=oe("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),ea=oe("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),ta=oe("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),fr=oe("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),na=oe("brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]),pr=oe("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),gr=oe("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),ra=oe("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]),mr=oe("folder-cog",[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]]),ia=oe("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),sa=oe("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),oa=oe("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),aa=oe("messages-square",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]),la=oe("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),ca=oe("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),da=oe("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),ua=oe("youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);function Yt(t,e){return Yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Yt(t,e)}function vr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}const xr=S.createContext(null);function ve(){const t=S.useContext(xr);if(t===null)throw new Error("No Tree Api Provided");return t}const yr=S.createContext(null),br=S.createContext(null),jr=S.createContext(0);function wr(){S.useContext(jr)}function It(t,e,n){return Math.max(Math.min(t,n),e)}function kr(t){return t&&t.isLeaf}function Sr(t){return t&&t.isInternal&&!t.isOpen}function Ir(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const Cr=(t,e)=>{let n=t;for(;n;){if(n.id===e.id)return!0;n=n.parent}return!1},Or=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function Qt(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let n of t.children){const r=Qt(n,e);if(r)return r}return null}function Ct(t,e){if(e(t),t.children)for(let n of t.children)Ct(n,e)}function Nr(t){const e=Tr(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=ha(e,r);break}n==null||n.focus()}function Dr(t){const e=Tr(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=fa(e,r);break}n==null||n.focus()}function ha(t,e){return e+1<t.length?t[e+1]:t[0]}function fa(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function Tr(t){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(e=>e===t||!t.contains(e))}function nt(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function Er(t){return t===null?null:ze(t)}function ze(t){return typeof t=="string"?t:t.id}function _r(t,...e){if(t)return t(...e)}function Pr(t){return new Promise((e,n)=>{let r=0;(function i(){r+=1,r===100&&n(),t()?e():setTimeout(i,10)})()})}function Mr(t){var e,n;const r=t.focusedNode;return r?r.isOpen?0:r.parent?r.childIndex+1:0:(n=(e=t.root.children)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0}function Ar(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const pa=Object.freeze(Object.defineProperty({__proto__:null,access:nt,bound:It,dfs:Qt,focusNextElement:Nr,focusPrevElement:Dr,getInsertIndex:Mr,getInsertParentId:Ar,identify:ze,identifyNull:Er,indexOf:Or,isClosed:Sr,isDescendant:Cr,isItem:kr,isOpenWithEmptyChildren:Ir,mergeRefs:function(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}},noop:function(){},safeRun:_r,waitFor:Pr,walk:Ct},Symbol.toStringTag,{value:"Module"})),ga={display:"flex",alignItems:"center",zIndex:1},ma={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},va={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},xa=Xe.memo(function({top:t,left:e,indent:n}){const r={position:"absolute",pointerEvents:"none",top:t-2+"px",left:e+"px",right:n+"px"};return s.jsxs("div",{style:Object.assign(Object.assign({},ga),r),children:[s.jsx("div",{style:Object.assign({},va)}),s.jsx("div",{style:Object.assign({},ma)})]})});function ya({node:t,attrs:e,innerRef:n,children:r}){return s.jsx("div",Object.assign({},e,{ref:n,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:r}))}function ba(t){return s.jsxs("div",{ref:t.dragHandle,style:t.style,children:[s.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"\u{1F333}":t.node.isOpen?"\u{1F5C1}":"\u{1F5C0}"})," ",t.node.isEditing?s.jsx(wa,Object.assign({},t)):s.jsx(ja,Object.assign({},t))]})}function ja(t){return s.jsx(s.Fragment,{children:s.jsx("span",{children:t.node.data.name})})}function wa({node:t}){const e=S.useRef();return S.useEffect(()=>{var n,r;(n=e.current)===null||n===void 0||n.focus(),(r=e.current)===null||r===void 0||r.select()},[]),s.jsx("input",{ref:e,defaultValue:t.data.name,onBlur:()=>t.reset(),onKeyDown:n=>{var r;n.key==="Escape"&&t.reset(),n.key==="Enter"&&t.submit(((r=e.current)===null||r===void 0?void 0:r.value)||"")}})}function Xt(t){return{type:"EDIT",id:t}}function Ve(t){return{type:"FOCUS",id:t}}class Ht{constructor(e){this.handleClick=n=>{n.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():n.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex}get isRoot(){return this.id===rt}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return!this.isLeaf&&this.tree.isOpen(this.id)}get isClosed(){return!this.isLeaf&&!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var e;return this.isSelected&&!(!((e=this.prev)===null||e===void 0)&&e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(!((e=this.next)===null||e===void 0)&&e.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(e=>e.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var e,n;const r=this.childIndex;return(n=(e=this.parent)===null||e===void 0?void 0:e.children[r+1])!==null&&n!==void 0?n:null}isAncestorOf(e){if(!e)return!1;let n=e;for(;n;){if(n.id===this.id)return!0;n=n.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new Ht(Object.assign({},this))}edit(){return this.tree.edit(this)}}const rt="__REACT_ARBORIST_INTERNAL_ROOT__";function Rr(t){var e;function n(o,a,l){const c=t.accessId(o),d=new Ht({tree:t,data:o,level:a,parent:l,id:c,children:null,isDraggable:t.isDraggable(o),rowIndex:null}),u=t.accessChildren(o);return u&&(d.children=u.map(g=>n(g,a+1,d))),d}const r=new Ht({tree:t,id:rt,data:{id:rt},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=(e=t.props.data)!==null&&e!==void 0?e:[];return r.children=i.map(o=>n(o,0,r)),r}const Zt={open:(t,e)=>({type:"VISIBILITY_OPEN",id:t,filtered:e}),close:(t,e)=>({type:"VISIBILITY_CLOSE",id:t,filtered:e}),toggle:(t,e)=>({type:"VISIBILITY_TOGGLE",id:t,filtered:e}),clear:t=>({type:"VISIBILITY_CLEAR",filtered:t})};function Lr(t={},e){if(e.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},t),{[e.id]:!0});if(e.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},t),{[e.id]:!1});if(e.type==="VISIBILITY_TOGGLE"){const n=t[e.id];return Object.assign(Object.assign({},t),{[e.id]:!n})}return e.type==="VISIBILITY_CLEAR"?{}:t}const We=t=>{var e;return{nodes:{open:{filtered:{},unfiltered:(e=t==null?void 0:t.initialOpenState)!==null&&e!==void 0?e:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},ka=t=>({type:"SELECTION_ONLY",id:ze(t)}),zr=t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(ze)}),Fr=t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(ze)}),Sa=t=>Object.assign({type:"SELECTION_SET"},t),Jt=t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:ze(t)}),Br=t=>({type:"SELECTION_ANCHOR",id:t===null?null:ze(t)}),$e={cursor:t=>({type:"DND_CURSOR",cursor:t}),dragStart:(t,e)=>({type:"DND_DRAG_START",id:t,dragIds:e}),dragEnd:()=>({type:"DND_DRAG_END"}),hovering:(t,e)=>({type:"DND_HOVERING",parentId:t,index:e})},Ia={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},Ca=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e}px, ${n}px)`}},Oa=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e+10}px, ${n+10}px)`}};function Hr({offset:t,mouse:e,id:n,dragIds:r,isDragging:i}){return s.jsxs(Na,{isDragging:i,children:[s.jsx(Da,{offset:t,children:s.jsx(Ea,{id:n,dragIds:r})}),s.jsx(Ta,{mouse:e,count:r.length})]})}const Na=S.memo(function(t){return t.isDragging?s.jsx("div",{style:Ia,children:t.children}):null});function Da(t){return s.jsx("div",{className:"row preview",style:Ca(t.offset),children:t.children})}function Ta(t){const{count:e,mouse:n}=t;return e>1?s.jsx("div",{className:"selected-count",style:Oa(n),children:e}):null}const Ea=S.memo(function(t){const e=ve(),n=e.get(t.id);return n?s.jsx(e.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*e.indent,opacity:.2,background:"transparent"},tree:e}):null});var Gr=Number.isNaN||function(t){return typeof t=="number"&&t!=t};function _a(t,e){return t===e||!(!Gr(t)||!Gr(e))}function Pa(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!_a(t[n],e[n]))return!1;return!0}function en(t,e){var n;e===void 0&&(e=Pa);var r,i=[],o=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return o&&n===this&&e(a,i)||(r=t.apply(this,a),o=!0,n=this,i=a),r}}var Ur=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function qr(t){cancelAnimationFrame(t.id)}var tn=-1;function Vr(t){if(t===void 0&&(t=!1),tn===-1||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(e),tn=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return tn}var it=null;function Wr(t){if(t===void 0&&(t=!1),it===null||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",e.appendChild(r),document.body.appendChild(e),e.scrollLeft>0?it="positive-descending":(e.scrollLeft=1,it=e.scrollLeft===0?"negative":"positive-ascending"),document.body.removeChild(e),it}return it}var Ma=function(t,e){return t};function Aa(t){var e,n=t.getItemOffset,r=t.getEstimatedTotalSize,i=t.getItemSize,o=t.getOffsetForIndexAndAlignment,a=t.getStartIndexForOffset,l=t.getStopIndexForStartIndex,c=t.initInstanceProps,d=t.shouldResetStyleCacheOnItemSizeChange,u=t.validateProps;return e=function(g){function f(h){var p;return(p=g.call(this,h)||this)._instanceProps=c(p.props,vr(p)),p._outerRef=void 0,p._resetIsScrollingTimeoutId=null,p.state={instance:vr(p),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof p.props.initialScrollOffset=="number"?p.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},p._callOnItemsRendered=void 0,p._callOnItemsRendered=en(function(v,x,b,j){return p.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:x,visibleStartIndex:b,visibleStopIndex:j})}),p._callOnScroll=void 0,p._callOnScroll=en(function(v,x,b){return p.props.onScroll({scrollDirection:v,scrollOffset:x,scrollUpdateWasRequested:b})}),p._getItemStyle=void 0,p._getItemStyle=function(v){var x,b=p.props,j=b.direction,C=b.itemSize,w=b.layout,O=p._getItemStyleCache(d&&C,d&&w,d&&j);if(O.hasOwnProperty(v))x=O[v];else{var N=n(p.props,v,p._instanceProps),_=i(p.props,v,p._instanceProps),D=j==="horizontal"||w==="horizontal",R=j==="rtl",G=D?N:0;O[v]=x={position:"absolute",left:R?void 0:G,right:R?G:void 0,top:D?0:N,height:D?"100%":_,width:D?_:"100%"}}return x},p._getItemStyleCache=void 0,p._getItemStyleCache=en(function(v,x,b){return{}}),p._onScrollHorizontal=function(v){var x=v.currentTarget,b=x.clientWidth,j=x.scrollLeft,C=x.scrollWidth;p.setState(function(w){if(w.scrollOffset===j)return null;var O=p.props.direction,N=j;if(O==="rtl")switch(Wr()){case"negative":N=-j;break;case"positive-descending":N=C-b-j}return N=Math.max(0,Math.min(N,C-b)),{isScrolling:!0,scrollDirection:w.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._onScrollVertical=function(v){var x=v.currentTarget,b=x.clientHeight,j=x.scrollHeight,C=x.scrollTop;p.setState(function(w){if(w.scrollOffset===C)return null;var O=Math.max(0,Math.min(C,j-b));return{isScrolling:!0,scrollDirection:w.scrollOffset<O?"forward":"backward",scrollOffset:O,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._outerRefSetter=function(v){var x=p.props.outerRef;p._outerRef=v,typeof x=="function"?x(v):x!=null&&typeof x=="object"&&x.hasOwnProperty("current")&&(x.current=v)},p._resetIsScrollingDebounced=function(){var v,x,b,j;p._resetIsScrollingTimeoutId!==null&&qr(p._resetIsScrollingTimeoutId),p._resetIsScrollingTimeoutId=(v=p._resetIsScrolling,x=150,b=Ur(),j={id:requestAnimationFrame(function C(){Ur()-b>=x?v.call(null):j.id=requestAnimationFrame(C)})})},p._resetIsScrolling=function(){p._resetIsScrollingTimeoutId=null,p.setState({isScrolling:!1},function(){p._getItemStyleCache(-1,null)})},p}(function(h,p){h.prototype=Object.create(p.prototype),h.prototype.constructor=h,Yt(h,p)})(f,g),f.getDerivedStateFromProps=function(h,p){return Ra(h,p),u(h),null};var m=f.prototype;return m.scrollTo=function(h){h=Math.max(0,h),this.setState(function(p){return p.scrollOffset===h?null:{scrollDirection:p.scrollOffset<h?"forward":"backward",scrollOffset:h,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(h,p){p===void 0&&(p="auto");var v=this.props,x=v.itemCount,b=v.layout,j=this.state.scrollOffset;h=Math.max(0,Math.min(h,x-1));var C=0;if(this._outerRef){var w=this._outerRef;C=b==="vertical"?w.scrollWidth>w.clientWidth?Vr():0:w.scrollHeight>w.clientHeight?Vr():0}this.scrollTo(o(this.props,h,p,j,this._instanceProps,C))},m.componentDidMount=function(){var h=this.props,p=h.direction,v=h.initialScrollOffset,x=h.layout;if(typeof v=="number"&&this._outerRef!=null){var b=this._outerRef;p==="horizontal"||x==="horizontal"?b.scrollLeft=v:b.scrollTop=v}this._callPropsCallbacks()},m.componentDidUpdate=function(){var h=this.props,p=h.direction,v=h.layout,x=this.state,b=x.scrollOffset;if(x.scrollUpdateWasRequested&&this._outerRef!=null){var j=this._outerRef;if(p==="horizontal"||v==="horizontal")if(p==="rtl")switch(Wr()){case"negative":j.scrollLeft=-b;break;case"positive-ascending":j.scrollLeft=b;break;default:var C=j.clientWidth,w=j.scrollWidth;j.scrollLeft=w-C-b}else j.scrollLeft=b;else j.scrollTop=b}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&qr(this._resetIsScrollingTimeoutId)},m.render=function(){var h=this.props,p=h.children,v=h.className,x=h.direction,b=h.height,j=h.innerRef,C=h.innerElementType,w=h.innerTagName,O=h.itemCount,N=h.itemData,_=h.itemKey,D=_===void 0?Ma:_,R=h.layout,G=h.outerElementType,Y=h.outerTagName,$=h.style,Q=h.useIsScrolling,X=h.width,U=this.state.isScrolling,V=x==="horizontal"||R==="horizontal",K=V?this._onScrollHorizontal:this._onScrollVertical,q=this._getRangeToRender(),J=q[0],k=q[1],y=[];if(O>0)for(var I=J;I<=k;I++)y.push(S.createElement(p,{data:N,key:D(I,N),index:I,isScrolling:Q?U:void 0,style:this._getItemStyle(I)}));var le=r(this.props,this._instanceProps);return S.createElement(G||Y||"div",{className:v,onScroll:K,ref:this._outerRefSetter,style:Es({position:"relative",height:b,width:X,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:x},$)},S.createElement(C||w||"div",{children:y,ref:j,style:{height:V?"100%":le,pointerEvents:U?"none":void 0,width:V?le:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"&&this.props.itemCount>0){var h=this._getRangeToRender(),p=h[0],v=h[1],x=h[2],b=h[3];this._callOnItemsRendered(p,v,x,b)}if(typeof this.props.onScroll=="function"){var j=this.state,C=j.scrollDirection,w=j.scrollOffset,O=j.scrollUpdateWasRequested;this._callOnScroll(C,w,O)}},m._getRangeToRender=function(){var h=this.props,p=h.itemCount,v=h.overscanCount,x=this.state,b=x.isScrolling,j=x.scrollDirection,C=x.scrollOffset;if(p===0)return[0,0,0,0];var w=a(this.props,C,this._instanceProps),O=l(this.props,w,C,this._instanceProps),N=b&&j!=="backward"?1:Math.max(1,v),_=b&&j!=="forward"?1:Math.max(1,v);return[Math.max(0,w-N),Math.max(0,Math.min(p-1,O+_)),w,O]},f}(S.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Ra=function(t,e){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,e.instance},La=Aa({getItemOffset:function(t,e){return e*t.itemSize},getItemSize:function(t,e){return t.itemSize},getEstimatedTotalSize:function(t){var e=t.itemCount;return t.itemSize*e},getOffsetForIndexAndAlignment:function(t,e,n,r,i,o){var a=t.direction,l=t.height,c=t.itemCount,d=t.itemSize,u=t.layout,g=t.width,f=a==="horizontal"||u==="horizontal"?g:l,m=Math.max(0,c*d-f),h=Math.min(m,e*d),p=Math.max(0,e*d-f+d+o);switch(n==="smart"&&(n=r>=p-f&&r<=h+f?"auto":"center"),n){case"start":return h;case"end":return p;case"center":var v=Math.round(p+(h-p)/2);return v<Math.ceil(f/2)?0:v>m+Math.floor(f/2)?m:v;default:return r>=p&&r<=h?r:r<p?p:h}},getStartIndexForOffset:function(t,e){var n=t.itemCount,r=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(e/r)))},getStopIndexForStartIndex:function(t,e,n){var r=t.direction,i=t.height,o=t.itemCount,a=t.itemSize,l=t.layout,c=t.width,d=e*a,u=r==="horizontal"||l==="horizontal"?c:i,g=Math.ceil((u+n-d)/a);return Math.max(0,Math.min(o-1,e+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function za(){var t,e;const n=ve(),r=function(){const c=S.useContext(br);if(c===null)throw new Error("Provide a DnDContext");return c}().cursor;if(!r||r.type!=="line")return null;const i=n.indent,o=n.rowHeight*r.index+((e=(t=n.props.padding)!==null&&t!==void 0?t:n.props.paddingTop)!==null&&e!==void 0?e:0),a=i*r.level,l=n.renderCursor;return s.jsx(l,{top:o,left:a,indent:i})}var Fa=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Ba=S.forwardRef(function(t,e){const{children:n}=t,r=Fa(t,["children"]),i=ve();return s.jsxs("div",Object.assign({ref:e},r,{onClick:o=>{o.currentTarget===o.target&&i.deselectAll()},children:[s.jsx(Ha,{}),n]}))}),Ha=()=>{const t=ve();return s.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:s.jsx(za,{})})};var Ga=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Ua=S.forwardRef(function(t,e){var n,r,i,o,{style:a}=t,l=Ga(t,["style"]);const c=ve(),d=(r=(n=c.props.padding)!==null&&n!==void 0?n:c.props.paddingTop)!==null&&r!==void 0?r:0,u=(o=(i=c.props.padding)!==null&&i!==void 0?i:c.props.paddingBottom)!==null&&o!==void 0?o:0;return s.jsx("div",Object.assign({ref:e,style:Object.assign(Object.assign({},a),{height:`${parseFloat(a.height)+d+u}px`})},l))});var ye,$r=S.createContext({dragDropManager:void 0});function E(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(!t){var o;if(e===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(o=new Error(e.replace(/%s/g,function(){return r[a++]}))).name="Invariant Violation"}throw o.framesToPop=1,o}}(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(ye||(ye={}));var nn="dnd-core/INIT_COORDS",rn="dnd-core/BEGIN_DRAG",Kr="dnd-core/PUBLISH_DRAG_SOURCE",Ot="dnd-core/HOVER",sn="dnd-core/DROP",on="dnd-core/END_DRAG";function Yr(t,e){return{type:nn,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function an(t){return an=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},an(t)}function Qr(t){return an(t)==="object"}var qa={type:nn,payload:{clientOffset:null,sourceClientOffset:null}};function Va(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},r=n.publishSource,i=r===void 0||r,o=n.clientOffset,a=n.getSourceClientOffset,l=t.getMonitor(),c=t.getRegistry();t.dispatch(Yr(o)),function(m,h,p){E(!h.isDragging(),"Cannot call beginDrag while dragging."),m.forEach(function(v){E(p.getSource(v),"Expected sourceIds to be registered.")})}(e,l,c);var d=function(m,h){for(var p=null,v=m.length-1;v>=0;v--)if(h.canDragSource(m[v])){p=m[v];break}return p}(e,l);if(d!==null){var u=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");(function(m){E(typeof m=="function","When clientOffset is provided, getSourceClientOffset must be a function.")})(a),u=a(d)}t.dispatch(Yr(o,u));var g=c.getSource(d).beginDrag(l,d);if(g!=null){(function(m){E(Qr(m),"Item must be an object.")})(g),c.pinSource(d);var f=c.getSourceType(d);return{type:rn,payload:{itemType:f,item:g,sourceId:d,clientOffset:o||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}else t.dispatch(qa)}}function Wa(t){return function(){if(t.getMonitor().isDragging())return{type:Kr}}}function ln(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(n){return n===e}):t===e}function $a(t){return function(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).clientOffset;(function(a){E(Array.isArray(a),"Expected targetIds to be an array.")})(e);var r=e.slice(0),i=t.getMonitor(),o=t.getRegistry();return function(a,l,c){E(l.isDragging(),"Cannot call hover while not dragging."),E(!l.didDrop(),"Cannot call hover after drop.");for(var d=0;d<a.length;d++){var u=a[d];E(a.lastIndexOf(u)===d,"Expected targetIds to be unique in the passed array."),E(c.getTarget(u),"Expected targetIds to be registered.")}}(r,i,o),function(a,l,c){for(var d=a.length-1;d>=0;d--){var u=a[d];ln(l.getTargetType(u),c)||a.splice(d,1)}}(r,o,i.getItemType()),function(a,l,c){a.forEach(function(d){c.getTarget(d).hover(l,d)})}(r,i,o),{type:Ot,payload:{targetIds:r,clientOffset:n||null}}}}function Xr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Zr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Xr(Object(n),!0).forEach(function(r){Ka(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ka(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ya(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.getMonitor(),r=t.getRegistry();(function(o){E(o.isDragging(),"Cannot call drop while not dragging."),E(!o.didDrop(),"Cannot call drop twice during one drag operation.")})(n);var i=function(o){var a=o.getTargetIds().filter(o.canDropOnTarget,o);return a.reverse(),a}(n);i.forEach(function(o,a){var l=function(d,u,g,f){var m=g.getTarget(d),h=m?m.drop(f,d):void 0;return function(p){E(p===void 0||Qr(p),"Drop result must either be an object or undefined.")}(h),h===void 0&&(h=u===0?{}:f.getDropResult()),h}(o,a,r,n),c={type:sn,payload:{dropResult:Zr(Zr({},e),l)}};t.dispatch(c)})}}function Qa(t){return function(){var e=t.getMonitor(),n=t.getRegistry();(function(i){E(i.isDragging(),"Cannot call endDrag while not dragging.")})(e);var r=e.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(e,r),n.unpinSource()),{type:on}}}function Xa(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function st(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Za=function(){function t(e,n){var r=this;(function(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")})(this,t),st(this,"store",void 0),st(this,"monitor",void 0),st(this,"backend",void 0),st(this,"isSetUp",!1),st(this,"handleRefCountChange",function(){var i=r.store.getState().refCount>0;r.backend&&(i&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!i&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}return Xa(t,[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,n=this.store.dispatch,r=function(i){return{beginDrag:Va(i),publishDragSource:Wa(i),hover:$a(i),drop:Ya(i),endDrag:Qa(i)}}(this);return Object.keys(r).reduce(function(i,o){var a,l=r[o];return i[o]=(a=l,function(){for(var c=arguments.length,d=new Array(c),u=0;u<c;u++)d[u]=arguments[u];var g=a.apply(e,d);g!==void 0&&n(g)}),i},{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}]),t}();function be(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Jr=typeof Symbol=="function"&&Symbol.observable||"@@observable",ei=function(){return Math.random().toString(36).substring(7).split("").join(".")},ti={INIT:"@@redux/INIT"+ei(),REPLACE:"@@redux/REPLACE"+ei()};function ni(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(be(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(be(1));return n(ni)(t,e)}if(typeof t!="function")throw new Error(be(2));var i=t,o=e,a=[],l=a,c=!1;function d(){l===a&&(l=a.slice())}function u(){if(c)throw new Error(be(3));return o}function g(m){if(typeof m!="function")throw new Error(be(4));if(c)throw new Error(be(5));var h=!0;return d(),l.push(m),function(){if(h){if(c)throw new Error(be(6));h=!1,d();var p=l.indexOf(m);l.splice(p,1),a=null}}}function f(m){if(!function(v){if(typeof v!="object"||v===null)return!1;for(var x=v;Object.getPrototypeOf(x)!==null;)x=Object.getPrototypeOf(x);return Object.getPrototypeOf(v)===x}(m))throw new Error(be(7));if(m.type===void 0)throw new Error(be(8));if(c)throw new Error(be(9));try{c=!0,o=i(o,m)}finally{c=!1}for(var h=a=l,p=0;p<h.length;p++)(0,h[p])();return m}return f({type:ti.INIT}),(r={dispatch:f,subscribe:g,getState:u,replaceReducer:function(m){if(typeof m!="function")throw new Error(be(10));i=m,f({type:ti.REPLACE})}})[Jr]=function(){var m,h=g;return(m={subscribe:function(p){if(typeof p!="object"||p===null)throw new Error(be(11));function v(){p.next&&p.next(u())}return v(),{unsubscribe:h(v)}}})[Jr]=function(){return this},m},r}var Ja=function(t,e){return t===e};function ri(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ii(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ri(Object(n),!0).forEach(function(r){el(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ri(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function el(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var si={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function tl(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:si,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case nn:case rn:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case Ot:return t=n.clientOffset,e=i.clientOffset,!t&&!e||t&&e&&t.x===e.x&&t.y===e.y?n:ii(ii({},n),{},{clientOffset:i.clientOffset});case on:case sn:return si;default:return n}}var cn="dnd-core/ADD_SOURCE",dn="dnd-core/ADD_TARGET",un="dnd-core/REMOVE_SOURCE",Nt="dnd-core/REMOVE_TARGET";function oi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function je(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?oi(Object(n),!0).forEach(function(r){nl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oi(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function nl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var rl={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function il(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rl,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case rn:return je(je({},n),{},{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case Kr:return je(je({},n),{},{isSourcePublic:!0});case Ot:return je(je({},n),{},{targetIds:i.targetIds});case Nt:return n.targetIds.indexOf(i.targetId)===-1?n:je(je({},n),{},{targetIds:(t=n.targetIds,e=i.targetId,t.filter(function(o){return o!==e}))});case sn:return je(je({},n),{},{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case on:return je(je({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function sl(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case cn:case dn:return t+1;case un:case Nt:return t-1;default:return t}}var Dt=[],hn=[];function ol(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ot:break;case cn:case dn:case Nt:case un:return Dt;default:return hn}var e=t.payload,n=e.targetIds,r=n===void 0?[]:n,i=e.prevTargetIds,o=i===void 0?[]:i,a=function(u,g){var f=new Map,m=function(p){f.set(p,f.has(p)?f.get(p)+1:1)};u.forEach(m),g.forEach(m);var h=[];return f.forEach(function(p,v){p===1&&h.push(v)}),h}(r,o),l=a.length>0||!function(u,g){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ja;if(u.length!==g.length)return!1;for(var m=0;m<u.length;++m)if(!f(u[m],g[m]))return!1;return!0}(r,o);if(!l)return Dt;var c=o[o.length-1],d=r[r.length-1];return c!==d&&(c&&a.push(c),d&&a.push(d)),a}function al(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:0)+1}function ai(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function li(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ai(Object(n),!0).forEach(function(r){ll(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ai(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ll(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cl(){var t,e,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:ol(r.dirtyHandlerIds,{type:i.type,payload:li(li({},i.payload),{},{prevTargetIds:(t=r,e="dragOperation.targetIds",n=[],e.split(".").reduce(function(o,a){return o&&o[a]?o[a]:n||null},t))})}),dragOffset:tl(r.dragOffset,i),refCount:sl(r.refCount,i),dragOperation:il(r.dragOperation,i),stateId:al(r.stateId)}}function ci(t,e){return{x:t.x-e.x,y:t.y-e.y}}function dl(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function di(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Dt.__IS_NONE__=!0,hn.__IS_ALL__=!0;var ul=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),di(this,"store",void 0),di(this,"registry",void 0),this.store=e,this.registry=n}return dl(t,[{key:"subscribeToStateChange",value:function(e){var n=this,r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0}).handlerIds;E(typeof e=="function","listener must be a function."),E(r===void 0||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");var i=this.store.getState().stateId;return this.store.subscribe(function(){var o=n.store.getState(),a=o.stateId;try{var l=a===i||a===i+1&&!function(c,d){if(c===Dt)return!1;if(c===hn||d===void 0)return!0;var u,g=(u=c,d.filter(function(f){return u.indexOf(f)>-1}));return g.length>0}(o.dirtyHandlerIds,r);l||e()}finally{i=a}})}},{key:"subscribeToOffsetChange",value:function(e){var n=this;E(typeof e=="function","listener must be a function.");var r=this.store.getState().dragOffset;return this.store.subscribe(function(){var i=n.store.getState().dragOffset;i!==r&&(r=i,e())})}},{key:"canDragSource",value:function(e){if(!e)return!1;var n=this.registry.getSource(e);return E(n,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&n.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var n=this.registry.getTarget(e);return E(n,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&ln(this.registry.getTargetType(e),this.getItemType())&&n.canDrop(this,e)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var n=this.registry.getSource(e,!0);return E(n,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&n.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!ln(r,i))return!1;var o=this.getTargetIds();if(!o.length)return!1;var a=o.indexOf(e);return n?a===o.length-1:a>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return e=this.store.getState().dragOffset,i=e.clientOffset,o=e.initialClientOffset,a=e.initialSourceClientOffset,i&&o&&a?ci((r=a,{x:(n=i).x+r.x,y:n.y+r.y}),o):null;var e,n,r,i,o,a}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,n=e.clientOffset,r=e.initialClientOffset,n&&r?ci(n,r):null;var e,n,r}}]),t}(),hl=0;function fn(t){return fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fn(t)}function pn(t,e){e&&Array.isArray(t)?t.forEach(function(n){return pn(n,!1)}):E(typeof t=="string"||fn(t)==="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const ui=typeof global<"u"?global:self,hi=ui.MutationObserver||ui.WebKitMutationObserver;function fi(t){return function(){const e=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(e),clearInterval(n),t()}}}const fl=typeof hi=="function"?function(t){let e=1;const n=new hi(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}:fi;class pl{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}const pi=new class{enqueueTask(t){const{queue:e,requestFlush:n}=this;e.length||(n(),this.flushing=!0),e[e.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const e=this.index;if(this.index++,t[e].call(),this.index>this.capacity){for(let n=0,r=t.length-this.index;n<r;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=fl(this.flush),this.requestErrorThrow=fi(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},gl=new class{create(t){const e=this.freeTasks,n=e.length?e.pop():new pl(this.onError,r=>e[e.length]=r);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}(pi.registerPendingError);function ml(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Ke(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vl(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return gi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return gi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function gi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function xl(t){var e=(hl++).toString();switch(t){case ye.SOURCE:return"S".concat(e);case ye.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function mi(t){switch(t[0]){case"S":return ye.SOURCE;case"T":return ye.TARGET;default:E(!1,"Cannot parse handler ID: ".concat(t))}}function vi(t,e){var n=t.entries(),r=!1;do{var i=n.next(),o=i.done;if(vl(i.value,2)[1]===e)return!0;r=!!o}while(!r);return!1}var yl=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Ke(this,"types",new Map),Ke(this,"dragSources",new Map),Ke(this,"dropTargets",new Map),Ke(this,"pinnedSourceId",null),Ke(this,"pinnedSource",null),Ke(this,"store",void 0),this.store=e}return ml(t,[{key:"addSource",value:function(e,n){pn(e),function(i){E(typeof i.canDrag=="function","Expected canDrag to be a function."),E(typeof i.beginDrag=="function","Expected beginDrag to be a function."),E(typeof i.endDrag=="function","Expected endDrag to be a function.")}(n);var r=this.addHandler(ye.SOURCE,e,n);return this.store.dispatch(function(i){return{type:cn,payload:{sourceId:i}}}(r)),r}},{key:"addTarget",value:function(e,n){pn(e,!0),function(i){E(typeof i.canDrop=="function","Expected canDrop to be a function."),E(typeof i.hover=="function","Expected hover to be a function."),E(typeof i.drop=="function","Expected beginDrag to be a function.")}(n);var r=this.addHandler(ye.TARGET,e,n);return this.store.dispatch(function(i){return{type:dn,payload:{targetId:i}}}(r)),r}},{key:"containsHandler",value:function(e){return vi(this.dragSources,e)||vi(this.dropTargets,e)}},{key:"getSource",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return E(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return E(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return E(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return E(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return mi(e)===ye.SOURCE}},{key:"isTargetId",value:function(e){return mi(e)===ye.TARGET}},{key:"removeSource",value:function(e){var n,r=this;E(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(i){return{type:un,payload:{sourceId:i}}}(e)),n=function(){r.dragSources.delete(e),r.types.delete(e)},pi.enqueueTask(gl.create(n))}},{key:"removeTarget",value:function(e){E(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(n){return{type:Nt,payload:{targetId:n}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var n=this.getSource(e);E(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}},{key:"unpinSource",value:function(){E(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,n,r){var i=xl(e);return this.types.set(i,n),e===ye.SOURCE?this.dragSources.set(i,r):e===ye.TARGET&&this.dropTargets.set(i,r),i}}]),t}();function bl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=function(l){var c=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return ni(cl,l&&c&&c({name:"dnd-core",instanceId:"dnd-core"}))}(arguments.length>3&&arguments[3]!==void 0&&arguments[3]),i=new ul(r,new yl(r)),o=new Za(r,i),a=t(o,e,n);return o.receiveBackend(a),o}var jl=["children"];function wl(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return xi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return xi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function xi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function kl(t,e){if(t==null)return{};var n,r,i=function(a,l){if(a==null)return{};var c,d,u={},g=Object.keys(a);for(d=0;d<g.length;d++)c=g[d],l.indexOf(c)>=0||(u[c]=a[c]);return u}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var yi=0,Tt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Sl=S.memo(function(t){var e=t.children,n=function(a){if("manager"in a)return[{dragDropManager:a.manager},!1];var l=function(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bi(),g=arguments.length>2?arguments[2]:void 0,f=arguments.length>3?arguments[3]:void 0,m=u;return m[Tt]||(m[Tt]={dragDropManager:bl(d,u,g,f)}),m[Tt]}(a.backend,a.context,a.options,a.debugMode),c=!a.context;return[l,c]}(kl(t,jl)),r=wl(n,2),i=r[0],o=r[1];return S.useEffect(function(){if(o){var a=bi();return++yi,function(){--yi===0&&(a[Tt]=null)}}},[]),s.jsx($r.Provider,Object.assign({value:i},{children:e}),void 0)});function bi(){return typeof global<"u"?global:window}function Il(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function ji(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var gn=!1,mn=!1,Cl=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),ji(this,"internalMonitor",void 0),ji(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return Il(t,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){E(!gn,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return gn=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{gn=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;E(!mn,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return mn=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{mn=!1}}},{key:"subscribeToStateChange",value:function(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,n){return this.internalMonitor.isOverTarget(e,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t}();function Ol(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function wi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var vn=!1,Nl=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),wi(this,"internalMonitor",void 0),wi(this,"targetId",null),this.internalMonitor=e.getMonitor()}return Ol(t,[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;E(!vn,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return vn=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{vn=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t}();function Dl(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!S.isValidElement(e)){var r=e;return t(r,n),r}var i=e;(function(a){if(typeof a.type!="string"){var l=a.type.displayName||a.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(l," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}})(i);var o=n?function(a){return t(a,n)}:t;return function(a,l){var c=a.ref;return E(typeof c!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),c?S.cloneElement(a,{ref:function(d){Si(c,d),Si(l,d)}}):S.cloneElement(a,{ref:l})}(i,o)}}function ki(t){var e={};return Object.keys(t).forEach(function(n){var r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{var i=Dl(r);e[n]=function(){return i}}}),e}function Si(t,e){typeof t=="function"?t(e):t.current=e}function xn(t){return xn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xn(t)}function yn(t){return t!==null&&xn(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function bn(t,e,n,r){var i=void 0;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(e),c=0;c<o.length;c++){var d=o[c];if(!l(d))return!1;var u=t[d],g=e[d];if((i=void 0)===!1||i===void 0&&u!==g)return!1}return!0}function Tl(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function ue(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var El=function(){function t(e){var n=this;(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),ue(this,"hooks",ki({dragSource:function(r,i){n.clearDragSource(),n.dragSourceOptions=i||null,yn(r)?n.dragSourceRef=r:n.dragSourceNode=r,n.reconnectDragSource()},dragPreview:function(r,i){n.clearDragPreview(),n.dragPreviewOptions=i||null,yn(r)?n.dragPreviewRef=r:n.dragPreviewNode=r,n.reconnectDragPreview()}})),ue(this,"handlerId",null),ue(this,"dragSourceRef",null),ue(this,"dragSourceNode",void 0),ue(this,"dragSourceOptionsInternal",null),ue(this,"dragSourceUnsubscribe",void 0),ue(this,"dragPreviewRef",null),ue(this,"dragPreviewNode",void 0),ue(this,"dragPreviewOptionsInternal",null),ue(this,"dragPreviewUnsubscribe",void 0),ue(this,"lastConnectedHandlerId",null),ue(this,"lastConnectedDragSource",null),ue(this,"lastConnectedDragSourceOptions",null),ue(this,"lastConnectedDragPreview",null),ue(this,"lastConnectedDragPreviewOptions",null),ue(this,"backend",void 0),this.backend=e}return Tl(t,[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();n&&this.disconnectDragSource(),this.handlerId&&(e?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();n&&this.disconnectDragPreview(),this.handlerId&&(e?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!bn(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!bn(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),t}();function _l(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function De(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Pl=function(){function t(e){var n=this;(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),De(this,"hooks",ki({dropTarget:function(r,i){n.clearDropTarget(),n.dropTargetOptions=i,yn(r)?n.dropTargetRef=r:n.dropTargetNode=r,n.reconnect()}})),De(this,"handlerId",null),De(this,"dropTargetRef",null),De(this,"dropTargetNode",void 0),De(this,"dropTargetOptionsInternal",null),De(this,"unsubscribeDropTarget",void 0),De(this,"lastConnectedHandlerId",null),De(this,"lastConnectedDropTarget",null),De(this,"lastConnectedDropTargetOptions",null),De(this,"backend",void 0),this.backend=e}return _l(t,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var n=this.dropTarget;this.handlerId&&(n?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions)):this.lastConnectedDropTarget=n)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!bn(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),t}(),Fe=typeof window<"u"?S.useLayoutEffect:S.useEffect;function jn(t){return jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jn(t)}function Ml(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function wn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Al=function(){function t(e,n,r){(function(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")})(this,t),wn(this,"spec",void 0),wn(this,"monitor",void 0),wn(this,"connector",void 0),this.spec=e,this.monitor=n,this.connector=r}return Ml(t,[{key:"beginDrag",value:function(){var e,n=this.spec,r=this.monitor;return(e=jn(n.item)==="object"?n.item:typeof n.item=="function"?n.item(r):{})!==null&&e!==void 0?e:null}},{key:"canDrag",value:function(){var e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag!="function"||e.canDrag(n)}},{key:"isDragging",value:function(e,n){var r=this.spec,i=this.monitor,o=r.isDragging;return o?o(i):n===e.getSourceId()}},{key:"endDrag",value:function(){var e=this.spec,n=this.monitor,r=this.connector,i=e.end;i&&i(n.getItem(),n),r.reconnect()}}]),t}();function Be(){var t=S.useContext($r).dragDropManager;return E(t!=null,"Expected drag drop context"),t}function Rl(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Ii(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ii(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ii(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ll(t,e,n){var r=Be(),i=function(a,l,c){var d=S.useMemo(function(){return new Al(a,l,c)},[l,c]);return S.useEffect(function(){d.spec=a},[a]),d}(t,e,n),o=function(a){return S.useMemo(function(){var l=a.type;return E(l!=null,"spec.type must be defined"),l},[a])}(t);Fe(function(){if(o!=null){var a=function(u,g,f){var m=f.getRegistry(),h=m.addSource(u,g);return[h,function(){return m.removeSource(h)}]}(o,i,r),l=Rl(a,2),c=l[0],d=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),d}},[r,e,n,i,o])}function zl(t){return function(e){if(Array.isArray(e))return kn(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,n){if(e){if(typeof e=="string")return kn(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kn(e,n)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function kn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ci(t,e){var n=zl(e||[]);return e==null&&typeof t!="function"&&n.push(t),S.useMemo(function(){return typeof t=="function"?t():t},n)}function Fl(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Oi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Oi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Oi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ni(t,e,n){var r=Fl(S.useState(function(){return e(t)}),2),i=r[0],o=r[1],a=S.useCallback(function(){var l=e(t);Zo(i,l)||(o(l),n&&n())},[i,t,n]);return Fe(a),[i,a]}function Bl(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Di(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Di(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Di(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ti(t,e,n){return function(r,i,o){var a=Bl(Ni(r,i,o),2),l=a[0],c=a[1];return Fe(function(){var d=r.getHandlerId();if(d!=null)return r.subscribeToStateChange(c,{handlerIds:[d]})},[r,c]),l}(e,t||function(){return{}},function(){return n.reconnect()})}function Hl(t){return S.useMemo(function(){return t.hooks.dragSource()},[t])}function Gl(t){return S.useMemo(function(){return t.hooks.dragPreview()},[t])}function Ul(t,e){var n=Ci(t,e);E(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var r,i=(r=Be(),S.useMemo(function(){return new Cl(r)},[r])),o=function(a,l){var c=Be(),d=S.useMemo(function(){return new El(c.getBackend())},[c]);return Fe(function(){return d.dragSourceOptions=a||null,d.reconnect(),function(){return d.disconnectDragSource()}},[d,a]),Fe(function(){return d.dragPreviewOptions=l||null,d.reconnect(),function(){return d.disconnectDragPreview()}},[d,l]),d}(n.options,n.previewOptions);return Ll(n,i,o),[Ti(n.collect,i,o),Hl(o),Gl(o)]}function ql(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Ei(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Vl=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),Ei(this,"spec",void 0),Ei(this,"monitor",void 0),this.spec=e,this.monitor=n}return ql(t,[{key:"canDrop",value:function(){var e=this.spec,n=this.monitor;return!e.canDrop||e.canDrop(n.getItem(),n)}},{key:"hover",value:function(){var e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}},{key:"drop",value:function(){var e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}}]),t}();function Wl(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return _i(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _i(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
13
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function _i(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $l(t,e,n){var r=Be(),i=function(a,l){var c=S.useMemo(function(){return new Vl(a,l)},[l]);return S.useEffect(function(){c.spec=a},[a]),c}(t,e),o=function(a){var l=a.accept;return S.useMemo(function(){return E(a.accept!=null,"accept must be defined"),Array.isArray(l)?l:[l]},[l])}(t);Fe(function(){var a=function(u,g,f){var m=f.getRegistry(),h=m.addTarget(u,g);return[h,function(){return m.removeTarget(h)}]}(o,i,r),l=Wl(a,2),c=l[0],d=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),d},[r,e,i,n,o.map(function(a){return a.toString()}).join("|")])}function Kl(t){return S.useMemo(function(){return t.hooks.dropTarget()},[t])}function Pi(t,e){var n,r=Ci(t,e),i=(n=Be(),S.useMemo(function(){return new Nl(n)},[n])),o=function(a){var l=Be(),c=S.useMemo(function(){return new Pl(l.getBackend())},[l]);return Fe(function(){return c.dropTargetOptions=a||null,c.reconnect(),function(){return c.disconnectDropTarget()}},[a]),c}(r.options);return $l(r,i,o),[Ti(r.collect,i,o),Kl(o)]}function Yl(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Mi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Mi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Mi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ai(t){var e=null;return function(){return e==null&&(e=t()),e}}function Ql(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Ri(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Xl=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Ri(this,"entered",[]),Ri(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return Ql(t,[{key:"enter",value:function(e){var n=this,r=this.entered.length;return this.entered=function(i,o){var a=new Set,l=function(d){return a.add(d)};i.forEach(l),o.forEach(l);var c=[];return a.forEach(function(d){return c.push(d)}),c}(this.entered.filter(function(i){return n.isNodeInDocument(i)&&(!i.contains||i.contains(e))}),[e]),r===0&&this.entered.length>0}},{key:"leave",value:function(e){var n,r,i=this.entered.length;return this.entered=(n=this.entered.filter(this.isNodeInDocument),r=e,n.filter(function(o){return o!==r})),i>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t}(),Zl=Ai(function(){return/firefox/i.test(navigator.userAgent)}),Li=Ai(function(){return!!window.safari});function Jl(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function ot(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var zi=function(){function t(e,n){(function(_,D){if(!(_ instanceof D))throw new TypeError("Cannot call a class as a function")})(this,t),ot(this,"xs",void 0),ot(this,"ys",void 0),ot(this,"c1s",void 0),ot(this,"c2s",void 0),ot(this,"c3s",void 0);for(var r=e.length,i=[],o=0;o<r;o++)i.push(o);i.sort(function(_,D){return e[_]<e[D]?-1:1});for(var a,l,c=[],d=[],u=0;u<r-1;u++)a=e[u+1]-e[u],l=n[u+1]-n[u],c.push(a),d.push(l/a);for(var g=[d[0]],f=0;f<c.length-1;f++){var m=d[f],h=d[f+1];if(m*h<=0)g.push(0);else{a=c[f];var p=c[f+1],v=a+p;g.push(3*v/((v+p)/m+(v+a)/h))}}g.push(d[d.length-1]);for(var x,b=[],j=[],C=0;C<g.length-1;C++){x=d[C];var w=g[C],O=1/c[C],N=w+g[C+1]-x-x;b.push((x-w-N)*O),j.push(N*O*O)}this.xs=e,this.ys=n,this.c1s=g,this.c2s=b,this.c3s=j}return Jl(t,[{key:"interpolate",value:function(e){var n=this.xs,r=this.ys,i=this.c1s,o=this.c2s,a=this.c3s,l=n.length-1;if(e===n[l])return r[l];for(var c,d=0,u=a.length-1;d<=u;){var g=n[c=Math.floor(.5*(d+u))];if(g<e)d=c+1;else{if(!(g>e))return r[c];u=c-1}}var f=e-n[l=Math.max(0,u)],m=f*f;return r[l]+i[l]*f+o[l]*m+a[l]*f*m}}]),t}();function Fi(t){var e=t.nodeType===1?t:t.parentElement;if(!e)return null;var n=e.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function Et(t){return{x:t.clientX,y:t.clientY}}function ec(t,e,n,r,i){var o,a,l,c=(o=e).nodeName==="IMG"&&(Zl()||!((a=document.documentElement)!==null&&a!==void 0&&a.contains(o))),d=Fi(c?t:e),u={x:n.x-d.x,y:n.y-d.y},g=t.offsetWidth,f=t.offsetHeight,m=r.anchorX,h=r.anchorY,p=function(w,O,N,_){var D=w?O.width:N,R=w?O.height:_;return Li()&&w&&(R/=window.devicePixelRatio,D/=window.devicePixelRatio),{dragPreviewWidth:D,dragPreviewHeight:R}}(c,e,g,f),v=p.dragPreviewWidth,x=p.dragPreviewHeight,b=i.offsetX,j=i.offsetY,C=j===0||j;return{x:b===0||b?b:new zi([0,.5,1],[u.x,u.x/g*v,u.x+v-g]).interpolate(m),y:C?j:(l=new zi([0,.5,1],[u.y,u.y/f*x,u.y+x-f]).interpolate(h),Li()&&c&&(l+=(window.devicePixelRatio-1)*x),l)}}var Bi="__NATIVE_FILE__",Hi="__NATIVE_URL__",Gi="__NATIVE_TEXT__",Ui="__NATIVE_HTML__";const qi=Object.freeze(Object.defineProperty({__proto__:null,FILE:Bi,HTML:Ui,TEXT:Gi,URL:Hi},Symbol.toStringTag,{value:"Module"}));function Sn(t,e,n){var r=e.reduce(function(i,o){return i||t.getData(o)},"");return r??n}var at;function _t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var In=(_t(at={},Bi,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),_t(at,Ui,{exposeProperties:{html:function(t,e){return Sn(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),_t(at,Hi,{exposeProperties:{urls:function(t,e){return Sn(t,e,"").split(`
15
+ `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),_t(at,Gi,{exposeProperties:{text:function(t,e){return Sn(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),at);function tc(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Vi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var nc=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Vi(this,"item",void 0),Vi(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return tc(t,[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(e.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(e){var n=this;if(e){var r={};Object.keys(this.config.exposeProperties).forEach(function(i){r[i]={value:n.config.exposeProperties[i](e,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,r)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,n){return n===e.getSourceId()}},{key:"endDrag",value:function(){}}]),t}();function Cn(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(In).filter(function(n){return In[n].matchesTypes.some(function(r){return e.indexOf(r)>-1})})[0]||null}function rc(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function On(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ic=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),On(this,"ownerDocument",null),On(this,"globalContext",void 0),On(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=n}return rc(t,[{key:"window",get:function(){return this.globalContext?this.globalContext:typeof window<"u"?window:void 0}},{key:"document",get:function(){var e;return(e=this.globalContext)!==null&&e!==void 0&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}}]),t}();function Wi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function $i(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Wi(Object(n),!0).forEach(function(r){z(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wi(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function sc(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function z(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Nn,oc=function(){function t(e,n,r){var i=this;(function(o,a){if(!(o instanceof a))throw new TypeError("Cannot call a class as a function")})(this,t),z(this,"options",void 0),z(this,"actions",void 0),z(this,"monitor",void 0),z(this,"registry",void 0),z(this,"enterLeaveCounter",void 0),z(this,"sourcePreviewNodes",new Map),z(this,"sourcePreviewNodeOptions",new Map),z(this,"sourceNodes",new Map),z(this,"sourceNodeOptions",new Map),z(this,"dragStartSourceIds",null),z(this,"dropTargetIds",[]),z(this,"dragEnterTargetIds",[]),z(this,"currentNativeSource",null),z(this,"currentNativeHandle",null),z(this,"currentDragSourceNode",null),z(this,"altKeyPressed",!1),z(this,"mouseMoveTimeoutTimer",null),z(this,"asyncEndDragFrameId",null),z(this,"dragOverTargetIds",null),z(this,"lastClientOffset",null),z(this,"hoverRafId",null),z(this,"getSourceClientOffset",function(o){var a=i.sourceNodes.get(o);return a&&Fi(a)||null}),z(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),z(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),z(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),z(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),z(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var l=Et(o);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:l});var c=o.dataTransfer,d=Cn(c);if(i.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var u=i.monitor.getSourceId(),g=i.sourceNodes.get(u),f=i.sourcePreviewNodes.get(u)||g;if(f){var m=i.getCurrentSourcePreviewNodeOptions(),h=ec(g,f,l,{anchorX:m.anchorX,anchorY:m.anchorY},{offsetX:m.offsetX,offsetY:m.offsetY});c.setDragImage(f,h.x,h.y)}}try{c==null||c.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(o.target),i.getCurrentSourcePreviewNodeOptions().captureDraggingState?i.actions.publishDragSource():setTimeout(function(){return i.actions.publishDragSource()},0)}else if(d)i.beginDragNativeItem(d);else{if(c&&!c.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),z(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),z(this,"handleTopDragEnterCapture",function(o){if(i.dragEnterTargetIds=[],i.enterLeaveCounter.enter(o.target)&&!i.monitor.isDragging()){var a=o.dataTransfer,l=Cn(a);l&&i.beginDragNativeItem(l,a)}}),z(this,"handleTopDragEnter",function(o){var a=i.dragEnterTargetIds;i.dragEnterTargetIds=[],i.monitor.isDragging()&&(i.altKeyPressed=o.altKey,a.length>0&&i.actions.hover(a,{clientOffset:Et(o)}),a.some(function(l){return i.monitor.canDropOnTarget(l)})&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())))}),z(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),z(this,"handleTopDragOver",function(o){var a=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging())return o.preventDefault(),void(o.dataTransfer&&(o.dataTransfer.dropEffect="none"));i.altKeyPressed=o.altKey,i.lastClientOffset=Et(o),i.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(i.hoverRafId=requestAnimationFrame(function(){i.monitor.isDragging()&&i.actions.hover(a||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null})),(a||[]).some(function(l){return i.monitor.canDropOnTarget(l)})?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),z(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault(),i.enterLeaveCounter.leave(o.target)&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),z(this,"handleTopDropCapture",function(o){var a;i.dropTargetIds=[],i.isDraggingNativeItem()?(o.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)):Cn(o.dataTransfer)&&o.preventDefault(),i.enterLeaveCounter.reset()}),z(this,"handleTopDrop",function(o){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:Et(o)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),z(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new ic(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Xl(this.isNodeInDocument)}return sc(t,[{key:"profile",value:function(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,n=this.rootElement;n!==void 0&&(n.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&((e=this.window)===null||e===void 0||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,n,r){var i=this;return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),function(){i.sourcePreviewNodes.delete(e),i.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,n,r){var i=this;this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);var o=function(l){return i.handleDragStart(l,e)},a=function(l){return i.handleSelectStart(l)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",a),function(){i.sourceNodes.delete(e),i.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",o),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,n){var r=this,i=function(l){return r.handleDragEnter(l,e)},o=function(l){return r.handleDragOver(l,e)},a=function(l){return r.handleDrop(l,e)};return n.addEventListener("dragenter",i),n.addEventListener("dragover",o),n.addEventListener("drop",a),function(){n.removeEventListener("dragenter",i),n.removeEventListener("dragover",o),n.removeEventListener("drop",a)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return $i({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return $i({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(qi).some(function(n){return qi[n]===e})}},{key:"beginDragNativeItem",value:function(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(r,i){var o=new nc(In[r]);return o.loadDataTransfer(i),o}(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(function(){var r;return(r=n.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){var e;return this.currentDragSourceNode=null,this.rootElement&&((e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(e,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(e,n){this.dropTargetIds.unshift(n)}}]),t}(),ac=function(t,e,n){return new oc(t,e,n)};function lc(t){const e=ve(),n=e.selectedIds,[r,i,o]=Ul(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(n):[t.id];return e.dispatch($e.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch($e.dragEnd())}}),[n,t]);return S.useEffect(()=>{o((Nn||((Nn=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Nn))},[o]),i}function Pt(t,e){return{parentId:t||null,index:e}}function Ye(t,e){return{type:"line",index:t,level:e}}function Dn(t,e){var n;let r=t;for(;r.parent&&r.level>e;)r=r.parent;return{parentId:((n=r.parent)===null||n===void 0?void 0:n.id)||null,index:Or(r)+1}}function Ki(t){var e;const n=function(g,f){const m=g.getBoundingClientRect(),h=f.x-Math.round(m.x),p=f.y-Math.round(m.y),v=m.height,x=p<v/2,b=!x,j=v/4,C=p>j&&p<v-j;return{x:h,inTopHalf:x,inBottomHalf:b,inMiddle:C,atTop:!C&&x,atBottom:!C&&b}}(t.element,t.offset),r=t.indent,i=Math.round(Math.max(0,n.x-r)/r),{node:o,nextNode:a,prevNode:l}=t,[c,d]=function(g,f,m,h){return g?g.isInternal?h.atTop?[f,g]:h.inMiddle?[g,g]:[g,m]:h.inTopHalf?[f,g]:[g,m]:[f,null]}(o,l,a,n);if(o&&o.isInternal&&n.inMiddle)return{drop:Pt(o.id,null),cursor:(u=o.id,{type:"highlight",id:u})};var u;if(!c)return{drop:Pt((e=d==null?void 0:d.parent)===null||e===void 0?void 0:e.id,0),cursor:Ye(0,0)};if(kr(c)){const g=It(i,(d==null?void 0:d.level)||0,c.level);return{drop:Dn(c,g),cursor:Ye(c.rowIndex+1,g)}}if(Sr(c)){const g=It(i,(d==null?void 0:d.level)||0,c.level);return{drop:Dn(c,g),cursor:Ye(c.rowIndex+1,g)}}if(Ir(c)){const g=It(i,0,c.level+1);return g>c.level?{drop:Pt(c.id,0),cursor:Ye(c.rowIndex+1,g)}:{drop:Dn(c,g),cursor:Ye(c.rowIndex+1,g)}}return{drop:Pt(c==null?void 0:c.id,0),cursor:Ye(c.rowIndex+1,c.level+1)}}const cc=Xe.memo(function({index:t,style:e}){wr(),function(){if(S.useContext(yr)===null)throw new Error("Provide a NodesContext")}();const n=ve(),r=function(h){const p=ve(),v=p.at(h);if(!v)throw new Error(`Could not find node for index: ${h}`);return S.useMemo(()=>{const x=v.clone();return p.visibleNodes[h]=x,x},[...Object.values(v.state),v])}(t),i=S.useRef(null),o=lc(r),a=function(h,p){const v=ve(),[x,b]=Pi(()=>({accept:"NODE",canDrop:()=>v.canDrop(),hover:(j,C)=>{const w=C.getClientOffset();if(!h.current||!w)return;const{cursor:O,drop:N}=Ki({element:h.current,offset:w,indent:v.indent,node:p,prevNode:p.prev,nextNode:p.next});N&&v.dispatch($e.hovering(N.parentId,N.index)),C.canDrop()?O&&v.showCursor(O):v.hideCursor()},drop:(j,C)=>{if(!C.canDrop())return null;let{parentId:w,index:O,dragIds:N}=v.state.dnd;_r(v.props.onMove,{dragIds:N,parentId:w===rt?null:w,index:O===null?0:O,dragNodes:v.dragNodes,parentNode:v.get(w)}),v.open(w)}}),[p,h.current,v.props]);return b}(i,r),l=S.useCallback(h=>{i.current=h,a(h)},[a]),c=n.indent*r.level,d=S.useMemo(()=>({paddingLeft:c}),[c]),u=S.useMemo(()=>{var h,p;return Object.assign(Object.assign({},e),{top:parseFloat(e.top)+((p=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&p!==void 0?p:0)})},[e,n.props.padding,n.props.paddingTop]),g={role:"treeitem","aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:u,tabIndex:-1,className:n.props.rowClassName};S.useEffect(()=>{var h;!r.isEditing&&r.isFocused&&((h=i.current)===null||h===void 0||h.focus({preventScroll:!0}))},[r.isEditing,r.isFocused,i.current]);const f=n.renderNode,m=n.renderRow;return s.jsx(m,{node:r,innerRef:l,attrs:g,children:s.jsx(f,{node:r,tree:n,style:d,dragHandle:o})})});let Tn="",Yi=null;function Qi(){wr();const t=ve();return s.jsx("div",{role:"tree",style:{height:t.height,width:t.width,minHeight:0,minWidth:0},onContextMenu:t.props.onContextMenu,onClick:t.props.onClick,tabIndex:0,onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||t.onFocus()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.onBlur()},onKeyDown:e=>{var n;if(t.isEditing)return;if(e.key==="Backspace"){if(!t.props.onDelete)return;const i=Array.from(t.selectedIds);if(i.length>1){let o=t.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=t.lastNode),t.focus(o,{scroll:!1}),t.delete(Array.from(i))}else{const o=t.focusedNode;if(o){const a=o.nextSibling,l=o.parent;t.focus(a||l,{scroll:!1}),t.delete(o)}}return}if(e.key==="Tab"&&!e.shiftKey)return e.preventDefault(),void Nr(e.currentTarget);if(e.key==="Tab"&&e.shiftKey)return e.preventDefault(),void Dr(e.currentTarget);if(e.key==="ArrowDown"){e.preventDefault();const i=t.nextNode;if(e.metaKey)return t.select(t.focusedNode),void t.activate(t.focusedNode);if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(i);{if(!i)return;const o=t.focusedNode;return void(o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.firstNode))}}if(e.key==="ArrowUp"){e.preventDefault();const i=t.prevNode;if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(i);{if(!i)return;const o=t.focusedNode;return void(o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.lastNode))}}if(e.key==="ArrowRight"){const i=t.focusedNode;return i?void(i.isInternal&&i.isOpen?t.focus(t.nextNode):i.isInternal&&t.open(i.id)):void 0}if(e.key==="ArrowLeft"){const i=t.focusedNode;return!i||i.isRoot?void 0:void(i.isInternal&&i.isOpen?t.close(i.id):((n=i.parent)===null||n===void 0?void 0:n.isRoot)||t.focus(i.parent))}if(e.key==="a"&&e.metaKey&&!t.props.disableMultiSelection)return e.preventDefault(),void t.selectAll();if(e.key==="a"&&!e.metaKey&&t.props.onCreate)return void t.createLeaf();if(e.key==="A"&&!e.metaKey)return t.props.onCreate?void t.createInternal():void 0;if(e.key==="Home")return e.preventDefault(),void t.focus(t.firstNode);if(e.key==="End")return e.preventDefault(),void t.focus(t.lastNode);if(e.key==="Enter"){const i=t.focusedNode;return!i||!i.isEditable||!t.props.onRename?void 0:void setTimeout(()=>{i&&t.edit(i)})}if(e.key===" "){e.preventDefault();const i=t.focusedNode;return i?void(i.isLeaf?(i.select(),i.activate()):i.toggle()):void 0}if(e.key==="*"){const i=t.focusedNode;return i?void t.openSiblings(i):void 0}if(e.key==="PageUp")return e.preventDefault(),void t.pageUp();e.key==="PageDown"&&(e.preventDefault(),t.pageDown()),clearTimeout(Yi),Tn+=e.key,Yi=setTimeout(()=>{Tn=""},600);const r=t.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"&&o.toLowerCase().startsWith(Tn)});r&&t.focus(r.id)},children:s.jsx(La,{className:t.props.className,outerRef:t.listEl,itemCount:t.visibleNodes.length,height:t.height,width:t.width,itemSize:t.rowHeight,overscanCount:t.overscanCount,itemKey:e=>{var n;return((n=t.visibleNodes[e])===null||n===void 0?void 0:n.id)||e},outerElementType:Ba,innerElementType:Ua,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:cc})})}function Xi(t){return t.isFiltered?function(e,n){const r={},i=[];function o(l){if(!l.isRoot&&n(l)){r[l.id]=!0;let c=l.parent;for(;c;)r[c.id]=!0,c=c.parent}if(l.children)for(let c of l.children)o(c)}function a(l){var c;l.level>=0&&r[l.id]&&i.push(l),l.isOpen&&((c=l.children)===null||c===void 0||c.forEach(a))}return o(e),a(e),i.forEach(Zi),i}(t.root,t.isMatch.bind(t)):function(e){const n=[];function r(i){var o;i.level>=0&&n.push(i),i.isOpen&&((o=i.children)===null||o===void 0||o.forEach(r))}return r(e),n.forEach(Zi),n}(t.root)}function Zi(t,e){t.rowIndex=e}const Ji=t=>t.reduce((e,n,r)=>(e[n.id]=r,e),{});var En=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(d){try{c(r.next(d))}catch(u){o(u)}}function l(d){try{c(r.throw(d))}catch(u){o(u)}}function c(d){var u;d.done?i(d.value):(u=d.value,u instanceof n?u:new n(function(g){g(u)})).then(a,l)}c((r=r.apply(t,e||[])).next())})};const{safeRun:se,identify:Pe,identifyNull:Ie}=pa;class ht{constructor(e,n,r,i){this.store=e,this.props=n,this.list=r,this.listEl=i,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=Rr(this),this.visibleNodes=Xi(this),this.idToIndex=Ji(this.visibleNodes)}update(e){this.props=e,this.root=Rr(this),this.visibleNodes=Xi(this),this.idToIndex=Ji(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return(e=this.props.width)!==null&&e!==void 0?e:300}get height(){var e;return(e=this.props.height)!==null&&e!==void 0?e:500}get indent(){var e;return(e=this.props.indent)!==null&&e!==void 0?e:24}get rowHeight(){var e;return(e=this.props.rowHeight)!==null&&e!==void 0?e:24}get overscanCount(){var e;return(e=this.props.overscanCount)!==null&&e!==void 0?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const n=(e=this.props.searchMatch)!==null&&e!==void 0?e:(r,i)=>JSON.stringify(Object.values(r.data)).toLocaleLowerCase().includes(i.toLocaleLowerCase());return r=>n(r,this.searchTerm)}accessChildren(e){var n;return(n=nt(e,this.props.childrenAccessor||"children"))!==null&&n!==void 0?n:null}accessId(e){const n=nt(e,this.props.idAccessor||"id");if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}get firstNode(){var e;return(e=this.visibleNodes[0])!==null&&e!==void 0?e:null}get lastNode(){var e;return(e=this.visibleNodes[this.visibleNodes.length-1])!==null&&e!==void 0?e:null}get focusedNode(){var e;return(e=this.get(this.state.nodes.focus.id))!==null&&e!==void 0?e:null}get mostRecentNode(){var e;return(e=this.get(this.state.nodes.selection.mostRecent))!==null&&e!==void 0?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,n){var r;if(e===null||n===null)return[];const i=(r=this.indexOf(e))!==null&&r!==void 0?r:0,o=this.indexOf(n);if(o===null)return[];const a=Math.min(i,o),l=Math.max(i,o);return this.visibleNodes.slice(a,l+1)}indexOf(e){const n=Er(e);return n?this.idToIndex[n]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return En(this,arguments,void 0,function*(e={}){var n,r;const i=e.parentId===void 0?Ar(this):e.parentId,o=(n=e.index)!==null&&n!==void 0?n:Mr(this),a=(r=e.type)!==null&&r!==void 0?r:"leaf",l=yield se(this.props.onCreate,{type:a,parentId:i,index:o,parentNode:this.get(i)});l&&(this.focus(l),setTimeout(()=>{this.edit(l).then(()=>{this.select(l),this.activate(l)})}))})}delete(e){return En(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(Pe),r=n.map(i=>this.get(i)).filter(i=>!!i);yield se(this.props.onDelete,{nodes:r,ids:n})})}edit(e){const n=Pe(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(Xt(n)),new Promise(r=>{ht.editPromise=r})}submit(e,n){return En(this,void 0,void 0,function*(){if(!e)return;const r=Pe(e);yield se(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(Xt(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Xt(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const n=this.get(Ie(e));n&&se(this.props.onActivate,n)}resolveEdit(e){const n=ht.editPromise;n&&n(e),ht.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let n of Array.from(this.selectedIds)){const r=this.get(n);r&&e.push(r)}return e}focus(e,n={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(Ve(Pe(e))),n.scroll!==!1&&this.scrollTo(e),this.focusedNode&&se(this.props.onFocus,this.focusedNode)))}pageUp(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex-r;let o=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;o=o>r?r:Math.max(r-i,0),this.focus(this.at(o))}pageDown(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex,o=i-r;let a=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;a=a<i?i:Math.min(a+o,this.visibleNodes.length-1),this.focus(this.at(a))}select(e,n={}){if(!e)return;const r=n.focus!==!1,i=Pe(e);r&&this.dispatch(Ve(i)),this.dispatch(ka(i)),this.dispatch(Br(i)),this.dispatch(Jt(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&se(this.props.onFocus,this.focusedNode),se(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const n=Pe(e);this.dispatch(Fr(n)),se(this.props.onSelect,this.selectedNodes)}selectMulti(e){const n=this.get(Ie(e));n&&(this.dispatch(Ve(n.id)),this.dispatch(zr(n.id)),this.dispatch(Br(n.id)),this.dispatch(Jt(n.id)),this.scrollTo(n),this.focusedNode&&se(this.props.onFocus,this.focusedNode),se(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const n=Pe(e),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(Ve(n)),this.dispatch(Fr(this.nodesBetween(r,i))),this.dispatch(zr(this.nodesBetween(r,Ie(n)))),this.dispatch(Jt(n)),this.scrollTo(n),this.focusedNode&&se(this.props.onFocus,this.focusedNode),se(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),se(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(Ve((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&se(this.props.onFocus,this.focusedNode),se(this.props.onSelect,this.selectedNodes)}setSelection(e){var n;const r=new Set((n=e.ids)===null||n===void 0?void 0:n.map(Pe)),i=Ie(e.anchor),o=Ie(e.mostRecent);this.dispatch(Sa({ids:r,anchor:i,mostRecent:o})),se(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;return e.type==="highlight"?e.id:null}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var e;if(this.isFiltered)return!1;const n=(e=this.get(this.state.dnd.parentId))!==null&&e!==void 0?e:this.root,r=this.dragNodes,i=this.props.disableDrop;for(const o of r)if(!o||!n||o.isInternal&&Cr(n,o))return!1;return typeof i=="function"?!i({parentNode:n,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof i=="string"?!n.data[i]:typeof i!="boolean"||!i}hideCursor(){this.dispatch($e.cursor({type:"none"}))}showCursor(e){this.dispatch($e.cursor(e))}open(e){const n=Ie(e);n&&(this.isOpen(n)||(this.dispatch(Zt.open(n,this.isFiltered)),se(this.props.onToggle,n)))}close(e){const n=Ie(e);n&&this.isOpen(n)&&(this.dispatch(Zt.close(n,this.isFiltered)),se(this.props.onToggle,n))}toggle(e){const n=Ie(e);if(n)return this.isOpen(n)?this.close(n):this.open(n)}openParents(e){const n=Ie(e);if(!n)return;const r=Qt(this.root,n);let i=r==null?void 0:r.parent;for(;i;)this.open(i.id),i=i.parent}openSiblings(e){const n=e.parent;if(n){if(n.children){const r=e.isOpen;for(let i of n.children)i.isInternal&&(r?this.close(i.id):this.open(i.id));this.scrollTo(this.focusedNode)}}else this.toggle(e.id)}openAll(){Ct(this.root,e=>{e.isInternal&&e.open()})}closeAll(){Ct(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,n="smart"){if(!e)return;const r=Pe(e);return this.openParents(r),Pr(()=>r in this.idToIndex).then(()=>{var i;const o=this.idToIndex[r];o!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(o,n))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var e;return!!(!((e=this.props.searchTerm)===null||e===void 0)&&e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return!!e&&this.state.nodes.selection.ids.has(e)}isOpen(e){var n,r,i;if(!e)return!1;if(e===rt)return!0;const o=(n=this.props.openByDefault)===null||n===void 0||n;return this.isFiltered?(r=this.state.nodes.open.filtered[e])===null||r===void 0||r:(i=this.state.nodes.open.unfiltered[e])!==null&&i!==void 0?i:o}isEditable(e){return!nt(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!nt(e,this.props.disableDrag||(()=>!1))}isDragging(e){const n=Ie(e);return!!n&&this.state.nodes.drag.id===n}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const n=Ie(e);if(!n)return!1;const{destinationParentId:r,destinationIndex:i}=this.state.nodes.drag;return n===r&&i===null}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(Ve(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Qi}get renderRow(){return this.props.renderRow||ya}get renderNode(){return this.props.children||ba}get renderDragPreview(){return this.props.renderDragPreview||Hr}get renderCursor(){return this.props.renderCursor||xa}}function he(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var es=typeof Symbol=="function"&&Symbol.observable||"@@observable",_n=()=>Math.random().toString(36).substring(7).split("").join("."),Mt={INIT:`@@redux/INIT${_n()}`,REPLACE:`@@redux/REPLACE${_n()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${_n()}`};function ts(t,e,n){if(typeof t!="function")throw new Error(he(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(he(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(he(1));return n(ts)(t,e)}let r=t,i=e,o=new Map,a=o,l=0,c=!1;function d(){a===o&&(a=new Map,o.forEach((m,h)=>{a.set(h,m)}))}function u(){if(c)throw new Error(he(3));return i}function g(m){if(typeof m!="function")throw new Error(he(4));if(c)throw new Error(he(5));let h=!0;d();const p=l++;return a.set(p,m),function(){if(h){if(c)throw new Error(he(6));h=!1,d(),a.delete(p),o=null}}}function f(m){if(!function(h){if(typeof h!="object"||h===null)return!1;let p=h;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(h)===p||Object.getPrototypeOf(h)===null}(m))throw new Error(he(7));if(m.type===void 0)throw new Error(he(8));if(typeof m.type!="string")throw new Error(he(17));if(c)throw new Error(he(9));try{c=!0,i=r(i,m)}finally{c=!1}return(o=a).forEach(h=>{h()}),m}return f({type:Mt.INIT}),{dispatch:f,subscribe:g,getState:u,replaceReducer:function(m){if(typeof m!="function")throw new Error(he(10));r=m,f({type:Mt.REPLACE})},[es]:function(){const m=g;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(he(11));function p(){const v=h;v.next&&v.next(u())}return p(),{unsubscribe:m(p)}},[es](){return this}}}}}function ns(t){const e=Object.keys(t),n={};for(let o=0;o<e.length;o++){const a=e[o];typeof t[a]=="function"&&(n[a]=t[a])}const r=Object.keys(n);let i;try{(function(o){Object.keys(o).forEach(a=>{const l=o[a];if(l(void 0,{type:Mt.INIT})===void 0)throw new Error(he(12));if(l(void 0,{type:Mt.PROBE_UNKNOWN_ACTION()})===void 0)throw new Error(he(13))})})(n)}catch(o){i=o}return function(o={},a){if(i)throw i;let l=!1;const c={};for(let d=0;d<r.length;d++){const u=r[d],g=n[u],f=o[u],m=g(f,a);if(m===void 0)throw a&&a.type,new Error(he(14));c[u]=m,l=l||m!==f}return l=l||r.length!==Object.keys(o).length,l?c:o}}const dc=ns({nodes:ns({focus:function(t={id:null,treeFocused:!1},e){return e.type==="FOCUS"?Object.assign(Object.assign({},t),{id:e.id,treeFocused:!0}):e.type==="TREE_BLUR"?Object.assign(Object.assign({},t),{treeFocused:!1}):t},edit:function(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t},open:function(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:Lr(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:Lr(t.unfiltered,e)}):t},selection:function(t=We().nodes.selection,e){const n=t.ids;switch(e.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},t),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},t),{ids:new Set([e.id])});case"SELECTION_ADD":return e.ids.length===0?t:(e.ids.forEach(r=>n.add(r)),Object.assign(Object.assign({},t),{ids:new Set(n)}));case"SELECTION_REMOVE":return e.ids.length===0?t:(e.ids.forEach(r=>n.delete(r)),Object.assign(Object.assign({},t),{ids:new Set(n)}));case"SELECTION_SET":return Object.assign(Object.assign({},t),{ids:e.ids,mostRecent:e.mostRecent,anchor:e.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},t),{mostRecent:e.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},t),{anchor:e.id});default:return t}},drag:function(t=We().nodes.drag,e){switch(e.type){case"DND_DRAG_START":return Object.assign(Object.assign({},t),{id:e.id,selectedIds:e.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},t),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return e.parentId!==t.destinationParentId||e.index!=t.destinationIndex?Object.assign(Object.assign({},t),{destinationParentId:e.parentId,destinationIndex:e.index}):t;default:return t}}}),dnd:function(t=We().dnd,e){switch(e.type){case"DND_CURSOR":return Object.assign(Object.assign({},t),{cursor:e.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},t),{dragId:e.id,dragIds:e.dragIds});case"DND_DRAG_END":return We().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}}),uc=We();function hc({treeProps:t,imperativeHandle:e,children:n}){const r=S.useRef(null),i=S.useRef(null),o=S.useRef(ts(dc,We(t))),a=_s.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>uc),l=S.useMemo(()=>new ht(o.current,t,r,i),[]),c=S.useRef(0);return S.useMemo(()=>{c.current+=1,l.update(t)},[...Object.values(t),a.nodes.open]),S.useImperativeHandle(e,()=>l),S.useEffect(()=>{l.props.selection?l.select(l.props.selection,{focus:!1}):l.deselectAll()},[l.props.selection]),S.useEffect(()=>{l.props.searchTerm||o.current.dispatch(Zt.clear(!0))},[l.props.searchTerm]),s.jsx(xr.Provider,{value:l,children:s.jsx(jr.Provider,{value:c.current,children:s.jsx(yr.Provider,{value:a.nodes,children:s.jsx(br.Provider,{value:a.dnd,children:s.jsx(Sl,Object.assign({backend:ac,options:{rootElement:l.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:n}))})})})})}function fc(t){return function(){const e=ve(),[,n]=Pi(()=>({accept:"NODE",canDrop:(r,i)=>!!i.isOver({shallow:!0})&&e.canDrop(),hover:(r,i)=>{if(!i.isOver({shallow:!0}))return;const o=i.getClientOffset();if(!e.listEl.current||!o)return;const{cursor:a,drop:l}=Ki({element:e.listEl.current,offset:o,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});l&&e.dispatch($e.hovering(l.parentId,l.index)),i.canDrop()?a&&e.showCursor(a):e.hideCursor()}}),[e]);n(e.listEl)}(),t.children}function pc(){const t=ve().props.renderContainer||Qi;return s.jsx(s.Fragment,{children:s.jsx(t,{})})}function gc(){const t=ve(),{offset:e,mouse:n,item:r,isDragging:i}=(o=g=>({offset:g.getSourceClientOffset(),mouse:g.getClientOffset(),item:g.getItem(),isDragging:g.isDragging()}),a=Be().getMonitor(),l=Yl(Ni(a,o),2),c=l[0],d=l[1],S.useEffect(function(){return a.subscribeToOffsetChange(d)}),S.useEffect(function(){return a.subscribeToStateChange(d)}),c);var o,a,l,c,d;const u=t.props.renderDragPreview||Hr;return s.jsx(u,{offset:e,mouse:n,id:(r==null?void 0:r.id)||null,dragIds:(r==null?void 0:r.dragIds)||[],isDragging:i})}class rs{constructor(e){this.root=function(n){const r=new is({id:"ROOT"},null);return r.children=n.map(i=>Pn(i,r)),r}(e)}get data(){var e,n;return(n=(e=this.root.children)===null||e===void 0?void 0:e.map(r=>r.data))!==null&&n!==void 0?n:[]}create(e){const n=e.parentId?this.find(e.parentId):this.root;if(!n)return null;n.addChild(e.data,e.index)}move(e){const n=this.find(e.id),r=e.parentId?this.find(e.parentId):this.root;n&&r&&(r.addChild(n.data,e.index),n.drop())}update(e){const n=this.find(e.id);n&&n.update(e.changes)}drop(e){const n=this.find(e.id);n&&n.drop()}find(e,n=this.root){if(!n)return null;if(n.id===e)return n;if(n.children){for(let r of n.children){const i=this.find(e,r);if(i)return i}return null}return null}}function Pn(t,e){const n=new is(t,e);return t.children&&(n.children=t.children.map(r=>Pn(r,n))),n}class is{constructor(e,n){this.data=e,this.parent=n,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,n){var r,i;const o=Pn(e,this);this.children=(r=this.children)!==null&&r!==void 0?r:[],this.children.splice(n,0,o),this.data.children=(i=this.data.children)!==null&&i!==void 0?i:[],this.data.children.splice(n,0,e)}removeChild(e){var n,r;(n=this.children)===null||n===void 0||n.splice(e,1),(r=this.data.children)===null||r===void 0||r.splice(e,1)}update(e){if(this.hasParent()){const n=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),n),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let mc=0;function vc(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
16
+ Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,n]=function(r){const[i,o]=S.useState(r),a=S.useMemo(()=>new rs(i),[i]);return[i,{onMove:c=>{for(const d of c.dragIds)a.move({id:d,parentId:c.parentId,index:c.index});o(a.data)},onRename:({name:c,id:d})=>{a.update({id:d,changes:{name:c}}),o(a.data)},onCreate:({parentId:c,index:d,type:u})=>{const g={id:"simple-tree-id-"+mc++,name:""};return u==="internal"&&(g.children=[]),a.create({parentId:c,index:d,data:g}),o(a.data),g},onDelete:c=>{c.ids.forEach(d=>a.drop({id:d})),o(a.data)}}]}(t.initialData);return Object.assign(Object.assign(Object.assign({},t),n),{data:e})}return t}const xc=S.forwardRef(function(t,e){const n=vc(t);return s.jsxs(hc,{treeProps:n,imperativeHandle:e,children:[s.jsx(fc,{children:s.jsx(pc,{})}),s.jsx(gc,{})]})});function yc(t,e){const n=H.c(11),{delayMs:r,whenVisible:i,disabled:o}=e,a=o!==void 0&&o,l=S.useRef(void 0);let c,d,u,g,f;return n[0]!==t?(c=()=>{l.current=t},d=[t],n[0]=t,n[1]=c,n[2]=d):(c=n[1],d=n[2]),S.useEffect(c,d),n[3]!==r||n[4]!==a||n[5]!==i?(u=()=>{if(r===null||a)return;const m=setInterval(()=>{var h;i&&document.visibilityState!=="visible"||((h=l.current)==null||h.call(l))},r);return()=>clearInterval(m)},g=[r,i,a],n[3]=r,n[4]=a,n[5]=i,n[6]=u,n[7]=g):(u=n[6],g=n[7]),S.useEffect(u,g),n[8]!==a||n[9]!==i?(f=()=>{var m;document.visibilityState==="visible"&&i&&!a&&((m=l.current)==null||m.call(l))},n[8]=a,n[9]=i,n[10]=f):f=n[10],Ps(document,"visibilitychange",f),null}function bc(){return["compact","medium","full","columns"]}const jc=t=>{const e=H.c(2),{children:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:n}),e[0]=n,e[1]=r):r=e[1],r},At=t=>{const e=H.c(10);let n,r,i,o,a;return e[0]!==t?({children:n,className:r,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]),e[4]!==r?(o=Ze("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",r),e[4]=r,e[5]=o):o=e[5],e[6]!==n||e[7]!==i||e[8]!==o?(a=s.jsx("div",{...i,className:o,children:n}),e[6]=n,e[7]=i,e[8]=o,e[9]=a):a=e[9],a},wc=t=>{const e=H.c(2),{children:n}=t;let r;return e[0]!==n?(r=s.jsx("p",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r},ss=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],kc=()=>{const t=H.c(31),[e,n]=Ms(),{saveAppConfig:r}=Ge();let i,o;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Fn(As),t[0]=i):i=t[0],t[1]!==e?(o={resolver:i,defaultValues:e},t[1]=e,t[2]=o):o=t[2];const a=Bn(o);let l;t[3]!==r||t[4]!==n?(l=async j=>{await r({config:j}).then(()=>{n(j)}).catch(()=>{n(j)})},t[3]=r,t[4]=n,t[5]=l):l=t[5];const c=l;let d,u,g,f,m,h,p,v,x,b;return t[6]!==e.width?(d=[e.width],t[6]=e.width,t[7]=d):d=t[7],S.useEffect(Sc,d),t[8]!==a||t[9]!==c?(u=a.handleSubmit(c),t[8]=a,t[9]=c,t[10]=u):u=t[10],t[11]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{children:[s.jsx(jc,{children:"Notebook Settings"}),s.jsx(wc,{children:"Configure how your notebook or application looks and behaves."})]}),t[11]=g):g=t[11],t[12]!==a.control?(f=s.jsxs(Rt,{title:"Display",children:[s.jsx(P,{control:a.control,name:"width",render:Cc}),s.jsx(P,{control:a.control,name:"app_title",render:Oc})]}),t[12]=a.control,t[13]=f):f=t[13],t[14]!==a.control?(m=s.jsxs(Rt,{title:"Custom Files",children:[s.jsx(P,{control:a.control,name:"css_file",render:Nc}),s.jsx(P,{control:a.control,name:"html_head_file",render:Dc})]}),t[14]=a.control,t[15]=m):m=t[15],t[16]!==a.control?(h=s.jsx(Rt,{title:"Data",children:s.jsx(P,{control:a.control,name:"sql_output",render:Ec})}),t[16]=a.control,t[17]=h):h=t[17],t[18]!==a.control?(p=s.jsx(Rt,{title:"Exporting outputs",children:s.jsx(P,{control:a.control,name:"auto_download",render:_c})}),t[18]=a.control,t[19]=p):p=t[19],t[20]!==f||t[21]!==m||t[22]!==h||t[23]!==p?(v=s.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[f,m,h,p]}),t[20]=f,t[21]=m,t[22]=h,t[23]=p,t[24]=v):v=t[24],t[25]!==v||t[26]!==u?(x=s.jsxs("form",{onChange:u,className:"flex flex-col gap-6",children:[g,v]}),t[25]=v,t[26]=u,t[27]=x):x=t[27],t[28]!==a||t[29]!==x?(b=s.jsx(Hn,{...a,children:x}),t[28]=a,t[29]=x,t[30]=b):b=t[30],b},Rt=t=>{const e=H.c(5),{title:n,children:r}=t;let i,o;return e[0]!==n?(i=s.jsx("h3",{className:"text-base font-semibold mb-1",children:n}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-y-2",children:[i,r]}),e[2]=r,e[3]=i,e[4]=o):o=e[4],o};function Sc(){window.dispatchEvent(new Event("resize"))}function Ic(t){return s.jsx("option",{value:t,children:t},t)}function Cc(t){const{field:e}=t;return s.jsxs(M,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(T,{children:"Width"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"app-width-select",onChange:n=>e.onChange(n.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(Ic)})}),s.jsx(L,{})]})}function Oc(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(T,{children:"App title"}),s.jsx(A,{children:s.jsx(Me,{...e,value:e.value??"",onChange:n=>{e.onChange(n.target.value),Gn.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),s.jsx(L,{})]}),s.jsx(F,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function Nc(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(T,{className:"shrink-0",children:"Custom CSS"}),s.jsx(A,{children:s.jsx(Me,{...e,value:e.value??"",placeholder:"custom.css",onChange:n=>{e.onChange(n.target.value),Gn.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),s.jsx(L,{})]}),s.jsx(F,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Dc(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(T,{className:"shrink-0",children:"HTML Head"}),s.jsx(A,{children:s.jsx(Me,{...e,value:e.value??"",placeholder:"head.html",onChange:n=>{e.onChange(n.target.value)}})}),s.jsx(L,{})]}),s.jsxs(F,{children:["A filepath to an HTML file to be injected into the"," ",s.jsx(re,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function Tc(t){return s.jsx("option",{value:t.value,children:t.label},t.value)}function Ec(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(T,{children:"SQL Output Type"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"sql-output-select",onChange:n=>{e.onChange(n.target.value),Ue({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:ss.map(Tc)})}),s.jsx(L,{})]}),s.jsxs(F,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",s.jsx(re,{className:"inline",children:"native"}),". See the"," ",s.jsx(de,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}function _c(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:"flex flex-col gap-2",children:[s.jsx(A,{children:s.jsxs("div",{className:"flex gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ie,{id:"html-checkbox",checked:e.value.includes("html"),onCheckedChange:()=>{e.onChange(pt(e.value,"html"))}}),s.jsx(T,{htmlFor:"html-checkbox",children:"HTML"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ie,{id:"ipynb-checkbox",checked:e.value.includes("ipynb"),onCheckedChange:()=>{e.onChange(pt(e.value,"ipynb"))}}),s.jsx(T,{htmlFor:"ipynb-checkbox",children:"IPYNB"})]})]})}),s.jsx(L,{})]}),s.jsxs(F,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",s.jsx(re,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}const Pc=Un("flex items-center justify-center m-0 leading-none font-medium border border-foreground/10 shadow-xs-solid hover:cursor-pointer active:shadow-none dark:border-border text-sm",{variants:{color:{gray:"mo-button gray",white:"mo-button white",green:"mo-button green",red:"mo-button red",yellow:"mo-button yellow","hint-green":"mo-button hint-green",disabled:"mo-button disabled active:shadow-xs-solid"},shape:{rectangle:"rounded",circle:"rounded-full"},size:{small:"",medium:""}},compoundVariants:[{size:"small",shape:"circle",class:"h-[24px] w-[24px] px-[5.5px] py-[5.5px]"},{size:"medium",shape:"circle",class:"px-2 py-2"},{size:"small",shape:"rectangle",class:"px-1 py-1 h-[24px] w-[24px]"},{size:"medium",shape:"rectangle",class:"px-3 py-2"}],defaultVariants:{color:"gray",size:"medium",shape:"rectangle"}}),Mc=Un("font-mono w-full flex-1 inline-flex items-center justify-center rounded px-2.5 text-foreground/60 h-[36px] hover:shadow-md hover:cursor-pointer focus:shadow-md focus:outline-hidden text-[hsl(0, 0%, 43.5%)] bg-transparent hover:bg-background focus:bg-background"),Lt=Xe.forwardRef((t,e)=>{const n=H.c(15);let r,i,o,a,l,c,d;return n[0]!==t?({color:i,shape:a,size:l,className:r,...o}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=o,n[4]=a,n[5]=l):(r=n[1],i=n[2],o=n[3],a=n[4],l=n[5]),n[6]!==r||n[7]!==i||n[8]!==a||n[9]!==l?(c=qn(Pc({color:i,shape:a,size:l}),r),n[6]=r,n[7]=i,n[8]=a,n[9]=l,n[10]=c):c=n[10],n[11]!==o||n[12]!==e||n[13]!==c?(d=s.jsx("button",{ref:e,className:c,...o,children:o.children}),n[11]=o,n[12]=e,n[13]=c,n[14]=d):d=n[14],d});Lt.displayName="Button",Xe.forwardRef((t,e)=>{const n=H.c(9);let r,i,o,a;return n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]),n[3]!==r?(o=qn(Mc(),r),n[3]=r,n[4]=o):o=n[4],n[5]!==i||n[6]!==e||n[7]!==o?(a=s.jsx("input",{ref:e,className:o,...i}),n[5]=i,n[6]=e,n[7]=o,n[8]=a):a=n[8],a}).displayName="Input";let zt=null;class Ac{constructor(e){this.view=void 0,this.abortController=new AbortController,this.view=e.view,this.view.dom.addEventListener("focus",()=>{zt=new WeakRef(this.view)},{signal:this.abortController.signal,capture:!0}),this.update()}update(){const e=this.view.dom.querySelector(".cm-vimCursorLayer");if(e instanceof HTMLElement)if(Rs())e.style.display="none";else{const n=(zt==null?void 0:zt.deref())===this.view;e.style.display=n?"":"none"}}destroy(){this.abortController.abort()}}const os={map:{args:["lhs","rhs"]},nmap:{mode:"normal",args:["lhs","rhs"]},vmap:{mode:"visual",args:["lhs","rhs"]},imap:{mode:"insert",args:["lhs","rhs"]},noremap:{args:["lhs","rhs"]},nnoremap:{mode:"normal",args:["lhs","rhs"]},vnoremap:{mode:"visual",args:["lhs","rhs"]},inoremap:{mode:"insert",args:["lhs","rhs"]},unmap:{args:["lhs"]},nunmap:{mode:"normal",args:["lhs"]},vunmap:{mode:"visual",args:["lhs"]},iunmap:{mode:"insert",args:["lhs"]},mapclear:{},nmapclear:{mode:"normal"},vmapclear:{mode:"visual"},imapclear:{mode:"insert"}};function Rc(t,e){const n=t.split(/\s+/),r=n[0];let i=0;if(r in os){const o=os[r],a={};for(const c of o.args||[]){if(i+=1,!(i<n.length))return void(e&&e(`Not enough arguments for "${r}" command: "${t}"`));a[c]=n[i]}const l={name:r};return"args"in o&&(l.args=a),"mode"in o&&(l.mode=o.mode),l}e&&e(`Unknown vimrc command: "${t}"`)}var as;const Lc=Ae(()=>{ae.defineAction("goToDefinition",t=>{const e=t.cm6;return Fs(e)}),ae.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),ae.defineEx("write","w",t=>{const e=t.cm6;e&&e.state.facet(gt).saveNotebook()})}),zc=Ae(async()=>{var n;const t=vt.get(Kn),e=(n=t.keymap)==null?void 0:n.vimrc;if(e)try{ne.log(`Loading vimrc from ${e}`);const r=(await Bs().sendFileDetails({path:e})).contents;if(!r)return void ne.error(`Failed to load vimrc from ${e}`);const i=function(o,a){const l=[];for(const c of o.split(`
17
+ `)){if(c.startsWith('"')||c.trim()==="")continue;const d=Rc(c,a);d&&l.push(d)}return l}(r,ne.warn);(function(o){function a(u){u.args&&u.args.lhs&&u.args.rhs?u.mode?ae.map(u.args.lhs,u.args.rhs,u.mode):ae.map(u.args.lhs,u.args.rhs):ne.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function l(u){u.args&&u.args.lhs&&u.args.rhs?u.mode?ae.noremap(u.args.lhs,u.args.rhs,u.mode):ae.noremap(u.args.lhs,u.args.rhs):ne.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function c(u){u.args&&u.args.lhs?u.mode?ae.unmap(u.args.lhs,u.mode):ae.unmap(u.args.lhs):ne.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function d(u){u.mode?ae.mapclear(u.mode):ae.mapclear()}for(const u of o)"map|nmap|vmap|imap".split("|").includes(u.name)?a(u):"noremap|nnoremap|vnoremap|inoremap".split("|").includes(u.name)?l(u):"unmap|nunmap|vunmap|iunmap".split("|").includes(u.name)?c(u):"mapclear|nmapclear|vmapclear|imapclear".split("|").includes(u.name)?d(u):ne.warn(`Could not execute vimrc command "${u.name}: unknown command"`)})(i)}catch(r){ne.error("Failed to load vimrc:",r)}});class Ft{constructor(){this.instances=new Set,this.isBroadcasting=!1}addInstance(e){this.instances.add(e);const n=mt(e);n?n.on("vim-mode-change",r=>{var i;this.isBroadcasting||(Gt("mode"in r,'Expected event to have a "mode" property'),this.isBroadcasting=!0,i=()=>{this.broadcastModeChange(e,r.mode,r.subMode),this.isBroadcasting=!1},"scheduler"in window?window.scheduler.postTask(i,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,0))}):ne.warn("Expected CodeMirror instance to have CodeMirror instance state")}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,n,r){Gt("exitInsertMode"in ae,"Vim does not have an exitInsertMode method"),Gt("exitVisualMode"in ae,"Vim does not have an exitVisualMode method");for(const i of this.instances)if(i!==e){const o=mt(i);if(!o){ne.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}const a=o.setSelections.bind(o);if(o.setSelections=()=>[],!ls(o)){ne.warn("Expected CodeMirror instance to have Vim state");continue}const l=o.state.vim;switch(n){case"normal":l.insertMode&&ae.exitInsertMode(o,!0),l.visualMode&&ae.exitVisualMode(o,!0);break;case"insert":l.insertMode||ae.handleKey(o,"i","")}o.setSelections=a}}}function ls(t){return t.state.vim!==void 0}as=Ft,Ft.INSTANCES=new as;const Fc=["default","vim"];function Bc(t,e){switch(t.preset){case"default":return[Ne.of(cs()),Ne.of(ds(e)),Ut.low(Ne.of([{key:"Escape",preventDefault:!0,run:n=>(n.contentDOM.blur(),!0)}]))];case"vim":return[Ne.of(Gc()),Ne.of(ds(e)),Ne.of([{key:"Enter",run:n=>{var i;const r=mt(n);return!!((i=r==null?void 0:r.state.vim)!=null&&i.insertMode)&&Us(n)}}]),Ut.high(Uc("d",n=>n.state.doc.toString()==="",n=>n.state.doc.toString()===""?(n.state.facet(gt).deleteCell(),!0):!1)),Gs({status:!1}),Ut.high((Lc(),zc(),[Ne.of([{key:"j",run:n=>{if(Ls(n,!0)&&Wn(n)){const r=n.state.facet(gt),i=n.state.facet($n);return r.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),Ne.of([{key:"k",run:n=>{if(zs(n)&&Wn(n)){const r=n.state.facet(gt),i=n.state.facet($n);return r.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),Ne.of([{linux:"Ctrl-[",win:"Ctrl-[",run:n=>{const r=mt(n);return r?ls(r)?!!r.state.vim.insertMode&&(ae.exitInsertMode(r,!0),!0):(ne.warn("Expected CodeMirror instance to have Vim state"),!1):(ne.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),Vn.define(n=>(requestAnimationFrame(()=>{Ft.INSTANCES.addInstance(n)}),{destroy(){Ft.INSTANCES.removeInstance(n)}})),Vn.define(n=>new Ac({view:n}))]))];default:return Hs(t.preset),[]}}const Hc=new Set([Yn,Qn]),cs=Ae(()=>qs.filter(t=>!Hc.has(t.run))),ds=t=>[{key:t.getHotkey("cell.toggleComment").key,run:Yn},{key:t.getHotkey("cell.toggleBlockComment").key,run:Qn}],Gc=Ae(()=>{const t=new Set(["Enter","Ctrl-v"]);return cs().filter(e=>!t.has(e.key||e.mac||e.linux||e.win||""))});function Uc(t,e,n){let r="",i=0;return Ne.of([{any:(o,a)=>{const l=a.key,c=a.timeStamp;return l!==t||!e(o)?(r="",i=0,!1):r===t&&c-i<500&&n(o)?(r="",i=0,!0):(r=l,i=c,!1)}}])}const Mn=Je(!1),qc=()=>{const t=H.c(82),[e,n]=et(Mn),[r,i]=S.useState(null);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const[a,l]=S.useState(o),[c,d]=qt(),u=xt(Vs),{saveUserConfig:g}=Ge();let f,m;t[1]!==n?(f=()=>n(Vc),t[1]=n,t[2]=f):f=t[2],Ws("global.showHelp",f),t[3]!==c||t[4]!==g||t[5]!==d?(m=async ge=>{const ee={...c};d(ge),await g({config:ge}).catch(Z=>{throw d(ee),Z})},t[3]=c,t[4]=g,t[5]=d,t[6]=m):m=t[6];const h=m;let p;t[7]!==c||t[8]!==r||t[9]!==h?(p=async ge=>{if(!r)return;const ee=ge.join("-"),Z={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides,[r]:ee}}};i(null),l([]),await h(Z)},t[7]=c,t[8]=r,t[9]=h,t[10]=p):p=t[10];const v=p;let x,b,j;if(t[11]!==c||t[12]!==r||t[13]!==v||t[14]!==u||t[15]!==e||t[16]!==a||t[17]!==h){j=Symbol.for("react.early_return_sentinel");{const ge=async()=>{if(!r)return;const Z={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides}}};delete Z.keymap.overrides[r],i(null),l([]),await h(Z)};let ee;t[21]!==c||t[22]!==h?(ee=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;const Z={...c,keymap:{...c.keymap,overrides:{}}};i(null),l([]),await h(Z)},t[21]=c,t[22]=h,t[23]=ee):ee=t[23],x=ee,e?b=Z=>{const ce=u.getHotkey(Z);if(r===Z){const Oe=$s(Z);return s.jsxs("div",{children:[s.jsx(Me,{defaultValue:a.join("+"),placeholder:ce.name,onKeyDown:te=>{te.preventDefault();const _e=[];if(te.key==="Meta"||te.key==="Control"||te.key==="Alt"||te.key==="Shift"||(te.metaKey&&_e.push(Zn()?"Cmd":"Meta"),te.ctrlKey&&_e.push("Ctrl"),te.altKey&&_e.push("Alt"),te.shiftKey&&_e.push("Shift"),te.key==="-"))return;if(te.key==="Escape"&&_e.length===0)return i(null),void l([]);let zn=te.key.toLowerCase();te.key===" "&&(zn="Space"),_e.push(zn),v(_e)},autoFocus:!0,endAdornment:s.jsx(xe,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{i(null),l([])},children:s.jsx(yt,{className:"w-4 h-4"})})}),s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),Oe.key!==ce.key&&s.jsxs("span",{className:"text-xs cursor-pointer text-primary",onClick:ge,children:["Reset to default:"," ",s.jsx("span",{className:"font-mono",children:Oe.key})]})]})]},Z)}return s.jsxs("div",{className:"grid grid-cols-[auto_2fr_3fr] gap-2 items-center",children:[u.isEditable(Z)?s.jsx(Jn,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{l([]),i(Z)}}):s.jsx("div",{className:"w-3 h-3"}),s.jsx(Xn,{className:"justify-end",shortcut:ce.key}),s.jsx("span",{children:ce.name.toLowerCase()})]},Z)}:j=null}t[11]=c,t[12]=r,t[13]=v,t[14]=u,t[15]=e,t[16]=a,t[17]=h,t[18]=x,t[19]=b,t[20]=j}else x=t[18],b=t[19],j=t[20];if(j!==Symbol.for("react.early_return_sentinel"))return j;const C=b;let w,O,N,_,D,R,G,Y,$,Q,X,U,V,K,q,J,k,y,I,le,fe,pe,Ce,ke,Se;if(t[24]!==c.keymap.preset||t[25]!==u||t[26]!==e||t[27]!==C||t[28]!==n){const ge=u.getHotkeyGroups(),ee=(ce,Oe)=>{const te=ge[ce];return s.jsxs("div",{className:"mb-[40px] gap-2 flex flex-col",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium",children:ce}),Oe]}),te.map(C)]})},Z=ce=>ee(ce,s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",c.keymap.preset==="vim"?s.jsxs(s.Fragment,{children:[s.jsx(Xn,{shortcut:Zn()?"Cmd":"Ctrl"}),s.jsx(re,{children:"Esc"})]}):s.jsx(re,{children:"Esc"})," ","in a cell to enter command mode"]}));N=Vt,V=e,t[47]!==n?(K=ce=>n(ce),t[47]=n,t[48]=K):K=t[48],O=Ks,X="sm:items-center sm:top-0",t[49]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ys,{}),t[49]=U):U=t[49],w=er,Y=!1,$="max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",t[50]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(Qs,{children:s.jsx(tr,{children:"Shortcuts"})}),t[50]=Q):Q=t[50],R="flex flex-row gap-3",G=s.jsxs("div",{className:"w-1/2",children:[ee("Editing"),ee("Markdown")]}),q="w-1/2",J=ee("Navigation"),k=ee("Running Cells"),y=ee("Creation and Ordering"),_=Z("Command"),D=ee("Other"),t[24]=c.keymap.preset,t[25]=u,t[26]=e,t[27]=C,t[28]=n,t[29]=w,t[30]=O,t[31]=N,t[32]=_,t[33]=D,t[34]=R,t[35]=G,t[36]=Y,t[37]=$,t[38]=Q,t[39]=X,t[40]=U,t[41]=V,t[42]=K,t[43]=q,t[44]=J,t[45]=k,t[46]=y}else w=t[29],O=t[30],N=t[31],_=t[32],D=t[33],R=t[34],G=t[35],Y=t[36],$=t[37],Q=t[38],X=t[39],U=t[40],V=t[41],K=t[42],q=t[43],J=t[44],k=t[45],y=t[46];return t[51]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("span",{className:"text-destructive",children:"Reset all to default"}),t[51]=I):I=t[51],t[52]!==x?(le=s.jsx(xe,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:x,tabIndex:-1,children:I}),t[52]=x,t[53]=le):le=t[53],t[54]!==_||t[55]!==D||t[56]!==le||t[57]!==q||t[58]!==J||t[59]!==k||t[60]!==y?(fe=s.jsxs("div",{className:q,children:[J,k,y,_,D,le]}),t[54]=_,t[55]=D,t[56]=le,t[57]=q,t[58]=J,t[59]=k,t[60]=y,t[61]=fe):fe=t[61],t[62]!==R||t[63]!==G||t[64]!==fe?(pe=s.jsxs("div",{className:R,children:[G,fe]}),t[62]=R,t[63]=G,t[64]=fe,t[65]=pe):pe=t[65],t[66]!==w||t[67]!==Y||t[68]!==$||t[69]!==Q||t[70]!==pe?(Ce=s.jsxs(w,{usePortal:Y,className:$,children:[Q,pe]}),t[66]=w,t[67]=Y,t[68]=$,t[69]=Q,t[70]=pe,t[71]=Ce):Ce=t[71],t[72]!==O||t[73]!==X||t[74]!==U||t[75]!==Ce?(ke=s.jsxs(O,{className:X,children:[U,Ce]}),t[72]=O,t[73]=X,t[74]=U,t[75]=Ce,t[76]=ke):ke=t[76],t[77]!==N||t[78]!==V||t[79]!==K||t[80]!==ke?(Se=s.jsx(N,{open:V,onOpenChange:K,children:ke}),t[77]=N,t[78]=V,t[79]=K,t[80]=ke,t[81]=Se):Se=t[81],Se};function Vc(t){return!t}var Wc=Xs();const us="marimo:copilot:signedIn",hs=eo(us,null,void 0,{getOnInit:!0}),fs=Je(null),Bt=Je(null);function ps(){const t=localStorage.getItem(us)==="true",e=Zs();return t&&e.completion.copilot==="github"}const we=ne.get("@github/copilot-language-server");class $c extends to{constructor(...e){super(...e),this.documentVersion=0,this.hasOpenedDocument=!1,this.getCompletionInternal=async(n,r)=>await this._request("textDocument/inlineCompletion",{...n,textDocument:{...n.textDocument,version:r}}),this.throttledGetCompletionInternal=function(n,r,i){var o=!0,a=!0;if(typeof n!="function")throw new TypeError("Expected a function");return Ds(i)&&(o="leading"in i?!!i.leading:o,a="trailing"in i?!!i.trailing:a),Ts(n,r,{leading:o,maxWait:r,trailing:a})}(this.getCompletionInternal,200)}async _request(e,n){try{return await this.request(e,n)}catch(r){throw we.error("#request: Error",r),r}}async notify(e,n){return we.debug("#notify",e,n),super.notify(e,n)}getInitializationOptions(){const e={name:"marimo",version:"0.1.0"};return{...super.getInitializationOptions(),workspaceFolders:[],capabilities:{workspace:{workspaceFolders:!1}},initializationOptions:{editorInfo:e,editorPluginInfo:e}}}isDisabled(){return!ps()}async textDocumentDidOpen(e){return this.isDisabled()?e:(this.hasOpenedDocument=!0,super.textDocumentDidOpen(e))}async textDocumentCompletion(e){return[]}async textDocumentDidChange(e){if(this.isDisabled())return e;this.hasOpenedDocument||await this.textDocumentDidOpen({textDocument:{uri:e.textDocument.uri,languageId:"python",version:e.textDocument.version,text:e.contentChanges[0].text}});const n=e.contentChanges;n.length!==1&&we.warn("#textDocumentDidChange: Multiple changes detected. This is not supported.",n);const r=n[0];"range"in r&&we.warn("#textDocumentDidChange: Copilot doesn't support range changes.",r);const i=no(r.text);return super.textDocumentDidChange({...e,contentChanges:[{text:i}],textDocument:ro.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){we.log("#signInInitiate: Starting sign-in flow");try{const e=await this._request("signIn",{});return we.log("#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw we.warn("#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){we.log("#signInConfirm: Confirming sign-in");try{const n=await this._request("signInConfirm",e);return we.log("#signInConfirm: Sign-in confirmed successfully"),n}catch(n){throw we.warn("#signInConfirm: Failed to confirm sign-in",n),n}}async signedIn(){try{const{status:e}=await this._request("checkStatus",{});return we.log("#checkStatus: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw we.warn("#signedIn: Failed to check sign-in status",e),e}}async getCompletion(e){if(this.isDisabled())return null;const n=this.documentVersion;if(e.textDocument.version=n,n===0)return null;var r;r=n,vt.set(Bt,r);const i=await this.throttledGetCompletionInternal(e,n);var o;return o=n,vt.get(Bt)===o&&vt.set(Bt,null),n!==this.documentVersion?null:i??null}}const gs="/__marimo_copilot__.py",ms=`file://${gs}`,Kc=Ae(()=>new Yc);class Yc extends Wc.Transport{constructor(){super(),this.delegate=void 0,this.delegate=void 0}getWsUrl(){return so().getLSPURL("copilot").toString()}async tryConnect(e=3,n=1e3){for(let r=1;r<=e;r++)try{return this.delegate||(this.delegate=new oo.WebSocketTransport(this.getWsUrl())),await this.delegate.connect(),void ne.log("Copilot#connect: Connected successfully")}catch(i){if(ne.warn(`Copilot#connect: Connection attempt ${r}/${e} failed`,i),r===e)throw this.delegate=void 0,Ue({variant:"danger",title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Please check settings and try again."}),i;await new Promise(o=>setTimeout(o,n))}}async connect(){return await Js(Kn,e=>e.completion.copilot==="github"),await ao(),this.tryConnect()}close(){var e;(e=this.delegate)==null||e.close(),this.delegate=void 0}async sendData(e,n){var r;return n=Math.min(n??5e3,5e3),(r=this.delegate)==null?void 0:r.sendData(e,n)}}const lt=Ae(()=>new $c({rootUri:ms,workspaceFolders:null,transport:Kc()}));function Qc(){return io({documentUri:ms,client:lt(),languageId:"copilot",hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const vs=S.memo(()=>{const[t,e]=et(hs),[n,r]=et(fs),[i,o]=S.useState(),[a,l]=S.useState(!1),c=async g=>{g.preventDefault(),l(!0);try{const{verificationUri:f,status:m,userCode:h}=await async function(){return await lt().signInInitiate()}();bs(m)?e(!0):(r("signingIn"),o({url:f,code:h}))}finally{l(!1)}},d=async g=>{if(g.preventDefault(),i){l(!0);try{const f=await async function(m){const h=lt();try{ne.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");const{status:p}=await h.signInConfirm({userCode:m});return bs(p)?(ne.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(ne.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:p}),{success:!1})}catch(p){return ys(p)?(ne.error("Copilot#tryFinishSignIn: Connection error during sign-in",p),{success:!1,error:"connection"}):await async function(v){for(let x=0;x<xs;x++)try{if(await new Promise(b=>setTimeout(b,Xc)),await v.signedIn())return ne.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(b){if(ne.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:x+1,maxRetries:xs}),ys(b))return{success:!1,error:"connection"}}return ne.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}(h)}}(i.code);f.success?(e(!0),r("signedIn")):f.error==="connection"?(r("connectionError"),Ue({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:s.jsx(xe,{onClick:c,children:"Retry"})})):r("signInFailed")}finally{l(!1)}}},u=async g=>{g.preventDefault(),await async function(){await lt().signOut()}(),e(!1),r("signedOut")};return(()=>{switch(n??(t?"signedIn":"connecting")){case"connecting":return s.jsx(bt,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return s.jsx(xe,{onClick:c,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return s.jsxs("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[s.jsx("li",{children:s.jsxs("div",{className:"flex items-center",children:["Copy this code:",s.jsx("strong",{className:"ml-2",children:i==null?void 0:i.code}),s.jsx(co,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{i&&(await uo(i.code),Ue({description:"Copied to clipboard"}))}})]})}),s.jsxs("li",{children:["Enter the code at this link:",s.jsx("a",{href:i==null?void 0:i.url,target:"_blank",rel:"noreferrer",className:ho({variant:"link",size:"xs"}),children:i==null?void 0:i.url})]}),s.jsxs("li",{children:["Click here when done:",s.jsxs(xe,{size:"xs",onClick:d,className:"ml-1",children:[a&&s.jsx(nr,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),a?s.jsx(nr,{className:"h-3 w-3 mr-1 animate-spin"}):s.jsx(xe,{onClick:c,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return s.jsxs("div",{className:"flex items-center gap-5",children:[s.jsxs(bt,{className:"font-normal flex items-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2",children:s.jsx(lo,{className:"h-3 w-3 text-white"})}),"Connected"]}),s.jsx(xe,{onClick:u,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(bt,{className:"font-normal flex",children:[s.jsx(yt,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),s.jsx("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),s.jsx(xe,{onClick:c,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(bt,{className:"font-normal flex",children:[s.jsx(yt,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),s.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",s.jsx(de,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});vs.displayName="CopilotConfig";const xs=5,Xc=3e3;function ys(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function bs(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}const Zc=["openai","anthropic","google","ollama","bedrock","deepseek","azure","github"];class Ee{constructor(e,n){this.providerId=void 0,this.shortModelId=void 0,this.providerId=e,this.shortModelId=n}get id(){return`${this.providerId}/${this.shortModelId}`}static parse(e){if(!e.includes("/")){const i=function(o){return o.startsWith("gpt")||o.startsWith("o3")||o.startsWith("o1")?"openai":o.startsWith("claude")?"anthropic":o.startsWith("gemini")||o.startsWith("google")?"google":o.startsWith("deepseek")?"deepseek":"ollama"}(e);return new Ee(i,e)}const[n,...r]=e.split("/");return new Ee(n,r.join("/"))}}function js(t){return Zc.includes(t)}const Jc=JSON.parse(`[{"name":"Claude 3.5 Haiku","model":"claude-3-5-haiku-latest","description":"Fast and efficient model with excellent performance for everyday tasks","providers":["anthropic"],"roles":["chat","edit"],"thinking":false},{"name":"Claude 3.5 Sonnet","model":"claude-3-5-sonnet-latest","description":"Balanced model with strong performance across reasoning, math, and coding","providers":["anthropic"],"roles":["chat","edit"],"thinking":false},{"name":"Claude 3.7 Sonnet","model":"claude-3-7-sonnet-latest","description":"Enhanced Sonnet model with improved capabilities","providers":["anthropic"],"roles":["chat","edit"],"thinking":false},{"name":"Claude 4 Sonnet","model":"claude-sonnet-4-20250514","description":"Next-generation Sonnet model with advanced reasoning and multimodal capabilities","providers":["anthropic"],"roles":["chat","edit"],"thinking":true},{"name":"Claude 4 Opus","model":"claude-opus-4-20250514","description":"Most capable model with superior performance on complex tasks and reasoning","providers":["anthropic"],"roles":["chat","edit"],"thinking":true},{"name":"Claude 4.1 Opus","model":"claude-opus-4-1-20250805","description":"Latest Opus model with enhanced capabilities and performance improvements","providers":["anthropic"],"roles":["chat","edit"],"thinking":true},{"name":"Gemini 1.5 Flash","model":"gemini-1.5-flash","description":"Fast and efficient model optimized for speed and everyday tasks","providers":["google"],"roles":["chat","edit"],"thinking":false},{"name":"Gemini 1.5 Flash 8B","model":"gemini-1.5-flash-8b","description":"Lightweight version of Gemini 1.5 Flash with 8 billion parameters","providers":["google"],"roles":["chat","edit"],"thinking":false},{"name":"Gemini 1.5 Pro","model":"gemini-1.5-pro","description":"Advanced model with superior reasoning capabilities and large context window","providers":["google"],"roles":["chat","edit"],"thinking":false},{"name":"Gemini 2.0 Flash","model":"gemini-2.0-flash","description":"Next-generation Flash model with improved performance and capabilities","providers":["google"],"roles":["chat","edit"],"thinking":false},{"name":"Gemini 2.0 Flash Experimental","model":"gemini-2.0-flash-exp","description":"Experimental version of Gemini 2.0 Flash with cutting-edge features","providers":["google"],"roles":["chat","edit"],"thinking":false},{"name":"Gemini 2.0 Flash Lite","model":"gemini-2.0-flash-lite","description":"Lightweight version of Gemini 2.0 Flash optimized for efficiency","providers":["google"],"roles":["chat","edit"],"thinking":false},{"name":"Gemini 2.0 Flash Thinking","model":"gemini-2.0-flash-thinking-exp-01-21","description":"Specialized reasoning model with enhanced thinking capabilities","providers":["google"],"roles":["chat"],"thinking":true},{"name":"Gemini 2.5 Flash Preview","model":"gemini-2.5-flash-preview","description":"Preview of the upcoming Gemini 2.5 Flash model","providers":["google"],"roles":["chat","edit"],"thinking":false},{"name":"Gemini 2.5 Pro","model":"gemini-2.5-pro","description":"Most capable Gemini model with advanced reasoning and large context support","providers":["google"],"roles":["chat","edit"],"thinking":false},{"name":"Gemini 2.5 Pro Experimental","model":"gemini-2.5-pro-exp","description":"Experimental version of Gemini 2.5 Pro with latest improvements","providers":["google"],"roles":["chat","edit"],"thinking":false},{"name":"GPT-4.1","model":"gpt-4.1","description":"Fast, highly intelligent model with largest context window (1 million tokens)","providers":["openai"],"roles":["chat","edit"],"thinking":false},{"name":"GPT-4.1 Mini","model":"gpt-4.1-mini","description":"Balanced for intelligence, speed, and cost","providers":["openai"],"roles":["chat","edit"],"thinking":false},{"name":"GPT-4o","model":"gpt-4o","description":"Fast, intelligent, flexible GPT model with multimodal capabilities","providers":["openai"],"roles":["chat","edit"],"thinking":false},{"name":"GPT-4o Mini","model":"gpt-4o-mini","description":"Fast, affordable small model for focused tasks","providers":["openai","github"],"roles":["chat","edit"],"thinking":false},{"name":"GPT-5","model":"gpt-5","description":"The best model for coding and agentic tasks across domains","providers":["openai"],"roles":["chat","edit"],"thinking":false},{"name":"GPT-5 Mini","model":"gpt-5-mini","description":"A faster, cost-efficient version of GPT-5 for well-defined tasks","providers":["openai"],"roles":["chat","edit"],"thinking":false},{"name":"GPT-5 Nano","model":"gpt-5-nano","description":"Fastest, most cost-efficient version of GPT-5","providers":["openai"],"roles":["chat","edit"],"thinking":false},{"name":"o3","model":"o3","description":"Our most powerful reasoning model with chain-of-thought capabilities","providers":["openai"],"roles":["chat","edit"],"thinking":true},{"name":"o3 Mini","model":"o3-mini","description":"A small model alternative to o3 for reasoning tasks","providers":["openai"],"roles":["chat","edit"],"thinking":true},{"name":"o3 Pro","model":"o3-pro","description":"Version of o3 designed to think longer and provide most reliable responses","providers":["openai"],"roles":["chat","edit"],"thinking":true},{"name":"o4 Mini","model":"o4-mini","description":"Faster, more affordable reasoning model optimized for math, coding, and visual tasks","providers":["openai"],"roles":["chat","edit"],"thinking":true},{"name":"GPT-3.5-turbo","model":"gpt-3.5-turbo","description":"Fast and efficient model with excellent performance for everyday tasks","providers":["github"],"roles":["chat","edit"],"thinking":false},{"name":"Claude 3.5 Haiku (Bedrock)","model":"anthropic.claude-3-5-haiku-20241022-v1:0","description":"Fast and efficient model with excellent performance for everyday tasks","providers":["bedrock"],"roles":["chat","edit"],"thinking":false},{"name":"Claude 3.5 Sonnet v2 (Bedrock)","model":"anthropic.claude-3-5-sonnet-20241022-v2:0","description":"Balanced model with strong performance across reasoning, math, and coding","providers":["bedrock"],"roles":["chat","edit"],"thinking":false},{"name":"Claude 3.7 Sonnet (Bedrock)","model":"anthropic.claude-3-7-sonnet-20250219-v1:0","description":"Enhanced Sonnet model with improved capabilities","providers":["bedrock"],"roles":["chat","edit"],"thinking":false},{"name":"Llama 3.3 70B Instruct","model":"meta.llama3-3-70b-instruct-v1:0","description":"Large language model optimized for instruction following and chat","providers":["bedrock"],"roles":["chat","edit"],"thinking":false},{"name":"Cohere Embed Multilingual v3","model":"cohere.embed-multilingual-v3","description":"Multilingual text embedding model for semantic search and similarity","providers":["bedrock"],"roles":["embed"],"thinking":false},{"name":"Cohere Rerank 3.5","model":"cohere.rerank-v3-5:0","description":"Advanced reranking model for improving search result relevance","providers":["bedrock"],"roles":["rerank"],"thinking":false},{"name":"Llama 3.1 8B","model":"llama3.1:8b","description":"Meta's efficient 8B parameter model with excellent chat and coding capabilities","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Llama 3.1 70B","model":"llama3.1:70b","description":"Large-scale Meta model with superior reasoning and complex task performance","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Llama 3.3 70B","model":"llama3.3:70b","description":"Latest Llama model with enhanced capabilities and performance improvements","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Mistral 7B","model":"mistral:7b","description":"Efficient 7B parameter model with strong performance for general tasks","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Mixtral 8x7B","model":"mixtral:8x7b","description":"Mixture of experts model with 8x7B parameters for enhanced performance","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Mixtral 8x22B","model":"mixtral:8x22b","description":"Large mixture of experts model with superior reasoning capabilities","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Gemma 2 9B","model":"gemma2:9b","description":"Google's efficient 9B parameter model optimized for performance and safety","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Gemma 2 27B","model":"gemma2:27b","description":"Larger Gemma model with enhanced capabilities for complex tasks","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Qwen 2.5 7B","model":"qwen2.5:7b","description":"Alibaba's multilingual model with strong performance across diverse tasks","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Qwen 2.5 14B","model":"qwen2.5:14b","description":"Mid-size Qwen model balancing performance and efficiency","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Qwen 2.5 32B","model":"qwen2.5:32b","description":"Large Qwen model with excellent reasoning and multilingual capabilities","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Qwen 2.5 72B","model":"qwen2.5:72b","description":"Flagship Qwen model with top-tier performance for complex reasoning tasks","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"DeepSeek R1 8B","model":"deepseek-r1:8b","description":"Efficient reasoning model with strong analytical capabilities","providers":["ollama"],"roles":["chat","edit"],"thinking":true},{"name":"DeepSeek R1 32B","model":"deepseek-r1:32b","description":"Advanced reasoning model with enhanced problem-solving abilities","providers":["ollama"],"roles":["chat","edit"],"thinking":true},{"name":"DeepSeek R1 70B","model":"deepseek-r1:70b","description":"Flagship reasoning model with superior analytical and thinking capabilities","providers":["ollama"],"roles":["chat","edit"],"thinking":true},{"name":"CodeLlama 34B","model":"codellama:34b","description":"Meta's specialized code generation model with strong programming capabilities","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"DeepSeek Coder 33B","model":"deepseek-coder:33b","description":"Specialized coding model with excellent programming and software development skills","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Qwen 2.5 Coder 7B","model":"qwen2.5-coder:7b","description":"Code-optimized version of Qwen 2.5 for programming tasks","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"Phi-4 14B","model":"phi4:14b","description":"Microsoft's compact yet capable model optimized for reasoning tasks","providers":["ollama"],"roles":["chat","edit"],"thinking":false},{"name":"TinyLlama 1.1B","model":"tinyllama:1.1b","description":"Ultra-lightweight model for resource-constrained environments","providers":["ollama"],"roles":["chat"],"thinking":false}]`),ed=[{name:"OpenAI",id:"openai",description:"OpenAI's API for GPT models, including GPT-3.5 and GPT-4.",url:"https://platform.openai.com/"},{name:"Amazon Bedrock",id:"bedrock",description:"Amazon Bedrock provides access to foundation models from Amazon and leading AI startups via a unified API.",url:"https://aws.amazon.com/bedrock/"},{name:"Azure",id:"azure",description:"Azure provides access to models via the Azure cloud.",url:"https://azure.microsoft.com/en-us/products/ai-services/"},{name:"Anthropic",id:"anthropic",description:"Anthropic's Claude models for conversational and completion tasks.",url:"https://www.anthropic.com/"},{name:"Google AI",id:"google",description:"Google's Vertex AI and PaLM APIs for generative and conversational models.",url:"https://cloud.google.com/vertex-ai/docs/generative-ai/learn/overview"},{name:"Ollama",id:"ollama",description:"Ollama is a lightweight, open-source model server for running and sharing LLMs.",url:"https://ollama.ai/"},{name:"GitHub",id:"github",description:"GitHub's API for GPT models with GitHub-hosted models.",url:"https://github.com/features/copilot"}];class td{constructor(){this.map=new Map}get(e){return this.map.get(e)??[]}set(e,n){this.map.set(e,n)}add(e,n){this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n])}has(e){return this.map.has(e)}delete(e){return this.map.delete(e)}clear(){this.map.clear()}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}forEach(e){this.map.forEach(e)}flatValues(){const e=[];for(const n of this.map.values())e.push(...n);return e}get size(){return this.map.size}}const nd=Ae(()=>{const t=new Map;for(const e of Jc){const n=e.model,r={...e,roles:e.roles.map(i=>i),providers:e.providers,custom:!1};for(const i of r.providers){const o=`${i}/${n}`;t.set(o,r)}}return t}),rd=Ae(()=>{const t=new Map;for(const e of ed)t.set(e.id,e);return t});class ft{constructor(e,n){this.modelsByProviderMap=new td,this.modelsMap=void 0,this.customModels=void 0,this.displayedModels=void 0,this.customModels=new Set(e),this.displayedModels=new Set(n),this.modelsMap=new Map,this.buildMaps()}static getProviderInfo(e){return rd().get(e)}static create(e){const{customModels:n=[],displayedModels:r=[]}=e;return new ft(n.map(i=>Ee.parse(i).id),r.map(i=>Ee.parse(i).id))}buildMaps(){const e=this.displayedModels,n=e.size>0,r=nd();let i=new Map;if(n){for(const o of e)if(r.has(o)){const a=r.get(o);a&&i.set(o,a)}}else i=new Map(r);for(const o of this.customModels){if(n&&!e.has(o)||i.has(o))continue;const a=Ee.parse(o),l={name:a.id,model:a.shortModelId,description:"Custom model",providers:[a.providerId],roles:[],thinking:!1,custom:!0};i.set(o,l)}for(const[o,a]of i.entries()){const l=Ee.parse(o);this.modelsByProviderMap.add(l.providerId,a)}this.modelsMap=i}getDisplayedModels(){return this.displayedModels}getCustomModels(){return this.customModels}getModelsByProvider(e){return this.modelsByProviderMap.get(e)||[]}getGroupedModelsByProvider(){return this.modelsByProviderMap}getModelsMap(){return this.modelsMap}getModel(e){return this.modelsMap.get(e)}}const ws={openai:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.2819%209.8211a5.9847%205.9847%200%200%200-.5157-4.9108%206.0462%206.0462%200%200%200-6.5098-2.9A6.0651%206.0651%200%200%200%204.9807%204.1818a5.9847%205.9847%200%200%200-3.9977%202.9%206.0462%206.0462%200%200%200%20.7427%207.0966%205.98%205.98%200%200%200%20.511%204.9107%206.051%206.051%200%200%200%206.5146%202.9001A5.9847%205.9847%200%200%200%2013.2599%2024a6.0557%206.0557%200%200%200%205.7718-4.2058%205.9894%205.9894%200%200%200%203.9977-2.9001%206.0557%206.0557%200%200%200-.7475-7.0729zm-9.022%2012.6081a4.4755%204.4755%200%200%201-2.8764-1.0408l.1419-.0804%204.7783-2.7582a.7948.7948%200%200%200%20.3927-.6813v-6.7369l2.02%201.1686a.071.071%200%200%201%20.038.052v5.5826a4.504%204.504%200%200%201-4.4945%204.4944zm-9.6607-4.1254a4.4708%204.4708%200%200%201-.5346-3.0137l.142.0852%204.783%202.7582a.7712.7712%200%200%200%20.7806%200l5.8428-3.3685v2.3324a.0804.0804%200%200%201-.0332.0615L9.74%2019.9502a4.4992%204.4992%200%200%201-6.1408-1.6464zM2.3408%207.8956a4.485%204.485%200%200%201%202.3655-1.9728V11.6a.7664.7664%200%200%200%20.3879.6765l5.8144%203.3543-2.0201%201.1685a.0757.0757%200%200%201-.071%200l-4.8303-2.7865A4.504%204.504%200%200%201%202.3408%207.872zm16.5963%203.8558L13.1038%208.364%2015.1192%207.2a.0757.0757%200%200%201%20.071%200l4.8303%202.7913a4.4944%204.4944%200%200%201-.6765%208.1042v-5.6772a.79.79%200%200%200-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759%200%200%200-.7854%200L9.409%209.2297V6.8974a.0662.0662%200%200%201%20.0284-.0615l4.8303-2.7866a4.4992%204.4992%200%200%201%206.6802%204.66zM8.3065%2012.863l-2.02-1.1638a.0804.0804%200%200%201-.038-.0567V6.0742a4.4992%204.4992%200%200%201%207.3757-3.4537l-.142.0805L8.704%205.459a.7948.7948%200%200%200-.3927.6813zm1.0976-2.3654l2.602-1.4998%202.6069%201.4998v2.9994l-2.5974%201.4997-2.6067-1.4997Z'/%3e%3c/svg%3e",anthropic:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAnthropic%3c/title%3e%3cpath%20d='M17.3041%203.541h-3.6718l6.696%2016.918H24Zm-10.6082%200L0%2020.459h3.7442l1.3693-3.5527h7.0052l1.3693%203.5528h3.7442L10.5363%203.5409Zm-.3712%2010.2232%202.2914-5.9456%202.2914%205.9456Z'/%3e%3c/svg%3e",google:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20Gemini%3c/title%3e%3cpath%20d='M11.04%2019.32Q12%2021.51%2012%2024q0-2.49.93-4.68.96-2.19%202.58-3.81t3.81-2.55Q21.51%2012%2024%2012q-2.49%200-4.68-.93a12.3%2012.3%200%200%201-3.81-2.58%2012.3%2012.3%200%200%201-2.58-3.81Q12%202.49%2012%200q0%202.49-.96%204.68-.93%202.19-2.55%203.81a12.3%2012.3%200%200%201-3.81%202.58Q2.49%2012%200%2012q2.49%200%204.68.96%202.19.93%203.81%202.55t2.55%203.81'/%3e%3c/svg%3e",ollama:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOllama%3c/title%3e%3cpath%20d='M16.361%2010.26a.894.894%200%200%200-.558.47l-.072.148.001.207c0%20.193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86%200%200%200%20.517-.436.752.752%200%200%200%20.08-.498c-.064-.453-.33-.782-.724-.897a1.06%201.06%200%200%200-.466%200zm-9.203.005c-.305.096-.533.32-.65.639a1.187%201.187%200%200%200-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894%200%200%200-.565-.472%201.02%201.02%200%200%200-.474.007Zm4.184%202c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365%200%200%200-.175-.48.394.394%200%200%200-.181-.033c-.126%200-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396%200%200%200-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589%201.226-1.787%202.114-.04.176-.045.234-.045.53%200%20.294.005.357.043.524.264%201.16%201.332%202.017%202.714%202.173.3.033%201.596.033%201.896%200%201.11-.125%202.064-.727%202.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523%200-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873%206.873%200%200%200-.855-.031zm.645.937a3.283%203.283%200%200%201%201.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115%203.115%200%200%201-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46%201.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653%201.653%200%200%200-.683.298C5.617.74%205.173%201.666%204.985%202.819c-.07.436-.119%201.04-.119%201.503%200%20.544.064%201.24.155%201.721.02.107.031.202.023.208a8.12%208.12%200%200%201-.187.152%205.324%205.324%200%200%200-.949%201.02%205.49%205.49%200%200%200-.94%202.339%206.625%206.625%200%200%200-.023%201.357c.091.78.325%201.438.727%202.04l.13.195-.037.064c-.269.452-.498%201.105-.605%201.732-.084.496-.095.629-.095%201.294%200%20.67.009.803.088%201.266.095.555.288%201.143.503%201.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405%207.405%200%200%200-.548%201.873c-.062.417-.071.552-.071.991%200%20.56.031.832.148%201.279L3.42%2024h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915%200%200%200-.194-.25%201.74%201.74%200%200%201-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787%200%200%200%20.223-.531c0-.195-.07-.355-.224-.522a3.136%203.136%200%200%201-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814%201.353-1.336%202.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467%201.352-.561.17-.035.25-.04.569-.04.319%200%20.398.005.569.04a4.07%204.07%200%200%201%201.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016%201.144.23%202.14%201.173%202.581%202.437.385%201.108.276%202.267-.296%203.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001%201.053.493.539.801%201.866.708%203.036-.062.772-.26%201.463-.533%201.854a2.096%202.096%200%200%201-.224.258.916.916%200%200%200-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498%201.295.253%201.008.231%202.01-.059%202.581a.845.845%200%200%200-.044.098c0%20.006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016%200-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378%200-1.628-.083-.645-.182-1.082-.348-1.525a6.083%206.083%200%200%200-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625%206.625%200%200%200-.024-1.358%205.512%205.512%200%200%200-.939-2.339%205.325%205.325%200%200%200-.95-1.02%208.097%208.097%200%200%201-.186-.152.692.692%200%200%201%20.023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8%201.205-2.116%203.01a6.805%206.805%200%200%200-.097.726c0%20.036-.007.066-.015.066a.96.96%200%200%201-.149-.078A4.857%204.857%200%200%200%2012%203.03c-.832%200-1.687.243-2.456.698a.958.958%200%200%201-.148.078c-.008%200-.015-.03-.015-.066a6.71%206.71%200%200%200-.097-.725C8.997%201.392%208.337.319%207.46.048a2.096%202.096%200%200%200-.585-.041Zm.293%201.402c.248.197.523.759.682%201.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102%201.24l.002.475-.12.175-.118.178h-.278c-.324%200-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438%208.438%200%200%201%20.016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36%202.028.212%203.145-.019.14-.024.151-.057.144l-.238-.06a3.693%203.693%200%200%200-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z'/%3e%3c/svg%3e",azure:"data:image/svg+xml,%3csvg%20width='150'%20height='150'%20viewBox='0%200%2096%2096'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='e399c19f-b68f-429d-b176-18c2117ff73c'%20x1='-1032.172'%20x2='-1059.213'%20y1='145.312'%20y2='65.426'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23114a8b'/%3e%3cstop%20offset='1'%20stop-color='%230669bc'/%3e%3c/linearGradient%3e%3clinearGradient%20id='ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15'%20x1='-1023.725'%20x2='-1029.98'%20y1='108.083'%20y2='105.968'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-opacity='.3'/%3e%3cstop%20offset='.071'%20stop-opacity='.2'/%3e%3cstop%20offset='.321'%20stop-opacity='.1'/%3e%3cstop%20offset='.623'%20stop-opacity='.05'/%3e%3cstop%20offset='1'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='a7fee970-a784-4bb1-af8d-63d18e5f7db9'%20x1='-1027.165'%20x2='-997.482'%20y1='147.642'%20y2='68.561'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%233ccbf4'/%3e%3cstop%20offset='1'%20stop-color='%232892df'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20fill='url(%23e399c19f-b68f-429d-b176-18c2117ff73c)'%20d='M33.338%206.544h26.038l-27.03%2080.087a4.152%204.152%200%200%201-3.933%202.824H8.149a4.145%204.145%200%200%201-3.928-5.47L29.404%209.368a4.152%204.152%200%200%201%203.934-2.825z'/%3e%3cpath%20fill='%230078d4'%20d='M71.175%2060.261h-41.29a1.911%201.911%200%200%200-1.305%203.309l26.532%2024.764a4.171%204.171%200%200%200%202.846%201.121h23.38z'/%3e%3cpath%20fill='url(%23ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15)'%20d='M33.338%206.544a4.118%204.118%200%200%200-3.943%202.879L4.252%2083.917a4.14%204.14%200%200%200%203.908%205.538h20.787a4.443%204.443%200%200%200%203.41-2.9l5.014-14.777%2017.91%2016.705a4.237%204.237%200%200%200%202.666.972H81.24L71.024%2060.261l-29.781.007L59.47%206.544z'/%3e%3cpath%20fill='url(%23a7fee970-a784-4bb1-af8d-63d18e5f7db9)'%20d='M66.595%209.364a4.145%204.145%200%200%200-3.928-2.82H33.648a4.146%204.146%200%200%201%203.928%202.82l25.184%2074.62a4.146%204.146%200%200%201-3.928%205.472h29.02a4.146%204.146%200%200%200%203.927-5.472z'/%3e%3c/svg%3e",bedrock:"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20y='0'%20x='0'%20id='Layer_1'%20version='1.1'%20viewBox='0%200%20300.67%20179.8'%3e%3cstyle%20id='style1855'%20type='text/css'%3e.st1{fill-rule:evenodd;clip-rule:evenodd;fill:%23f90}%3c/style%3e%3cg%20transform='translate(-1.668%20-1.1)'%20id='g1865'%3e%3cpath%20id='path1857'%20d='M86.4%2066.4c0%203.7.4%206.7%201.1%208.9.8%202.2%201.8%204.6%203.2%207.2.5.8.7%201.6.7%202.3%200%201-.6%202-1.9%203L83.2%2092c-.9.6-1.8.9-2.6.9-1%200-2-.5-3-1.4-1.4-1.5-2.6-3.1-3.6-4.7-1-1.7-2-3.6-3.1-5.9-7.8%209.2-17.6%2013.8-29.4%2013.8-8.4%200-15.1-2.4-20-7.2-4.9-4.8-7.4-11.2-7.4-19.2%200-8.5%203-15.4%209.1-20.6%206.1-5.2%2014.2-7.8%2024.5-7.8%203.4%200%206.9.3%2010.6.8%203.7.5%207.5%201.3%2011.5%202.2v-7.3c0-7.6-1.6-12.9-4.7-16-3.2-3.1-8.6-4.6-16.3-4.6-3.5%200-7.1.4-10.8%201.3-3.7.9-7.3%202-10.8%203.4-1.6.7-2.8%201.1-3.5%201.3-.7.2-1.2.3-1.6.3-1.4%200-2.1-1-2.1-3.1v-4.9c0-1.6.2-2.8.7-3.5.5-.7%201.4-1.4%202.8-2.1%203.5-1.8%207.7-3.3%2012.6-4.5C41%201.9%2046.2%201.3%2051.7%201.3c11.9%200%2020.6%202.7%2026.2%208.1%205.5%205.4%208.3%2013.6%208.3%2024.6v32.4zM45.8%2081.6c3.3%200%206.7-.6%2010.3-1.8%203.6-1.2%206.8-3.4%209.5-6.4%201.6-1.9%202.8-4%203.4-6.4.6-2.4%201-5.3%201-8.7v-4.2c-2.9-.7-6-1.3-9.2-1.7-3.2-.4-6.3-.6-9.4-.6-6.7%200-11.6%201.3-14.9%204-3.3%202.7-4.9%206.5-4.9%2011.5%200%204.7%201.2%208.2%203.7%2010.6%202.4%202.5%205.9%203.7%2010.5%203.7zm80.3%2010.8c-1.8%200-3-.3-3.8-1-.8-.6-1.5-2-2.1-3.9L96.7%2010.2c-.6-2-.9-3.3-.9-4%200-1.6.8-2.5%202.4-2.5h9.8c1.9%200%203.2.3%203.9%201%20.8.6%201.4%202%202%203.9l16.8%2066.2%2015.6-66.2c.5-2%201.1-3.3%201.9-3.9.8-.6%202.2-1%204-1h8c1.9%200%203.2.3%204%201%20.8.6%201.5%202%201.9%203.9l15.8%2067%2017.3-67c.6-2%201.3-3.3%202-3.9.8-.6%202.1-1%203.9-1h9.3c1.6%200%202.5.8%202.5%202.5%200%20.5-.1%201-.2%201.6-.1.6-.3%201.4-.7%202.5l-24.1%2077.3c-.6%202-1.3%203.3-2.1%203.9-.8.6-2.1%201-3.8%201h-8.6c-1.9%200-3.2-.3-4-1-.8-.7-1.5-2-1.9-4L156%2023l-15.4%2064.4c-.5%202-1.1%203.3-1.9%204-.8.7-2.2%201-4%201zm128.5%202.7c-5.2%200-10.4-.6-15.4-1.8-5-1.2-8.9-2.5-11.5-4-1.6-.9-2.7-1.9-3.1-2.8-.4-.9-.6-1.9-.6-2.8v-5.1c0-2.1.8-3.1%202.3-3.1.6%200%201.2.1%201.8.3.6.2%201.5.6%202.5%201%203.4%201.5%207.1%202.7%2011%203.5%204%20.8%207.9%201.2%2011.9%201.2%206.3%200%2011.2-1.1%2014.6-3.3%203.4-2.2%205.2-5.4%205.2-9.5%200-2.8-.9-5.1-2.7-7-1.8-1.9-5.2-3.6-10.1-5.2L246%2052c-7.3-2.3-12.7-5.7-16-10.2-3.3-4.4-5-9.3-5-14.5%200-4.2.9-7.9%202.7-11.1%201.8-3.2%204.2-6%207.2-8.2%203-2.3%206.4-4%2010.4-5.2%204-1.2%208.2-1.7%2012.6-1.7%202.2%200%204.5.1%206.7.4%202.3.3%204.4.7%206.5%201.1%202%20.5%203.9%201%205.7%201.6%201.8.6%203.2%201.2%204.2%201.8%201.4.8%202.4%201.6%203%202.5.6.8.9%201.9.9%203.3v4.7c0%202.1-.8%203.2-2.3%203.2-.8%200-2.1-.4-3.8-1.2-5.7-2.6-12.1-3.9-19.2-3.9-5.7%200-10.2.9-13.3%202.8-3.1%201.9-4.7%204.8-4.7%208.9%200%202.8%201%205.2%203%207.1%202%201.9%205.7%203.8%2011%205.5l14.2%204.5c7.2%202.3%2012.4%205.5%2015.5%209.6%203.1%204.1%204.6%208.8%204.6%2014%200%204.3-.9%208.2-2.6%2011.6-1.8%203.4-4.2%206.4-7.3%208.8-3.1%202.5-6.8%204.3-11.1%205.6-4.5%201.4-9.2%202.1-14.3%202.1z'%20fill='%23252f3e'/%3e%3cg%20id='g1863'%3e%3cpath%20id='path1859'%20d='M273.5%20143.7c-32.9%2024.3-80.7%2037.2-121.8%2037.2-57.6%200-109.5-21.3-148.7-56.7-3.1-2.8-.3-6.6%203.4-4.4%2042.4%2024.6%2094.7%2039.5%20148.8%2039.5%2036.5%200%2076.6-7.6%20113.5-23.2%205.5-2.5%2010.2%203.6%204.8%207.6z'%20class='st1'/%3e%3cpath%20id='path1861'%20d='M287.2%20128.1c-4.2-5.4-27.8-2.6-38.5-1.3-3.2.4-3.7-2.4-.8-4.5%2018.8-13.2%2049.7-9.4%2053.3-5%203.6%204.5-1%2035.4-18.6%2050.2-2.7%202.3-5.3%201.1-4.1-1.9%204-9.9%2012.9-32.2%208.7-37.5z'%20class='st1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",deepseek:"data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDeepSeek%3c/title%3e%3cpath%20d='M23.748%204.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434%201.202-.422%201.84.027%201.436.633%202.58%201.838%203.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526%205.526%200%2001-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365%2011.365%200%2000-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055%203.055%200%2001-.465.137%209.597%209.597%200%2000-2.883-.102c-1.885.21-3.39%201.102-4.497%202.623C.082%208.606-.231%2010.684.152%2012.85c.403%202.284%201.569%204.175%203.36%205.653%201.858%201.533%203.997%202.284%206.438%202.14%201.482-.085%203.133-.284%204.994-1.86.47.234.962.327%201.78.397.63.059%201.236-.03%201.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926%201.096-1.296%202.746-2.642%203.392-7.003.05-.347.007-.565%200-.845-.004-.17.035-.237.23-.256a4.173%204.173%200%20001.545-.475c1.396-.763%201.96-2.015%202.093-3.517.02-.23-.004-.467-.247-.588zM11.581%2018c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696%204.696%200%20011.529-.039c2.132.312%203.946%201.265%205.468%202.774.868.86%201.525%201.887%202.202%202.891.72%201.066%201.494%202.082%202.48%202.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306%200%2001.415-.287.302.302%200%2001.2.288.306.306%200%2001-.31.307.303.303%200%2001-.304-.308zm3.11%201.596c-.2.081-.399.151-.59.16a1.245%201.245%200%2001-.798-.254c-.274-.23-.47-.358-.552-.758a1.73%201.73%200%2001.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559%200%2001-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136%201.146.016.352.144.618.408%201.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'%3e%3c/path%3e%3c/svg%3e",github:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%3c/title%3e%3cpath%20d='M12%20.297c-6.63%200-12%205.373-12%2012%200%205.303%203.438%209.8%208.205%2011.385.6.113.82-.258.82-.577%200-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422%2018.07%203.633%2017.7%203.633%2017.7c-1.087-.744.084-.729.084-.729%201.205.084%201.838%201.236%201.838%201.236%201.07%201.835%202.809%201.305%203.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93%200-1.31.465-2.38%201.235-3.22-.135-.303-.54-1.523.105-3.176%200%200%201.005-.322%203.3%201.23.96-.267%201.98-.399%203-.405%201.02.006%202.04.138%203%20.405%202.28-1.552%203.285-1.23%203.285-1.23.645%201.653.24%202.873.12%203.176.765.84%201.23%201.91%201.23%203.22%200%204.61-2.805%205.625-5.475%205.92.42.36.81%201.096.81%202.22%200%201.606-.015%202.896-.015%203.286%200%20.315.21.69.825.57C20.565%2022.092%2024%2017.592%2024%2012.297c0-6.627-5.373-12-12-12'/%3e%3c/svg%3e"},ct=t=>{const e=H.c(15);let n,r,i;e[0]!==t?({provider:r,className:i,...n}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const o=i===void 0?"":i;if(r==="openai-compatible"||!(r in ws)){let d,u;return e[4]!==o?(d=Ze("h-4 w-4",o),e[4]=o,e[5]=d):d=e[5],e[6]!==d?(u=s.jsx(ta,{className:d}),e[6]=d,e[7]=u):u=e[7],u}const a=ws[r];let l,c;return e[8]!==o?(l=Ze("h-4 w-4 grayscale dark:invert",o),e[8]=o,e[9]=l):l=e[9],e[10]!==a||e[11]!==n||e[12]!==r||e[13]!==l?(c=s.jsx("img",{src:a,alt:r,className:l,...n}),e[10]=a,e[11]=n,e[12]=r,e[13]=l,e[14]=c):c=e[14],c},ks=t=>{var K;const e=H.c(24),{value:n,placeholder:r,onSelect:i,triggerClassName:o,customDropdownContent:a,iconSize:l,showAddCustomModelDocs:c,forRole:d}=t,u=l===void 0?"medium":l,g=c!==void 0&&c,f=n?Ee.parse(n):void 0,[m]=qt(),h=(K=m.ai)==null?void 0:K.models,p=m.completion.copilot==="custom"?h==null?void 0:h.autocomplete_model:void 0,v=ft.create({customModels:[...(h==null?void 0:h.custom_models)??[],h==null?void 0:h.chat_model,p,h==null?void 0:h.edit_model].filter(Boolean),displayedModels:h==null?void 0:h.displayed_models}),x=v.getGroupedModelsByProvider(),b=d==="autocomplete"?h==null?void 0:h.autocomplete_model:d==="chat"?h==null?void 0:h.chat_model:d==="edit"?h==null?void 0:h.edit_model:void 0,j=u==="medium"?"h-4 w-4":"h-3 w-3",C=po,w=`flex items-center justify-between px-2 py-0.5 border rounded-md
18
+ hover:bg-accent hover:text-accent-foreground ${o}`,O=f?s.jsxs(s.Fragment,{children:[s.jsx(ct,{provider:f.providerId,className:j}),s.jsx("span",{className:"truncate",children:js(f.providerId)?f.shortModelId:f.id})]}):s.jsx("span",{className:"text-muted-foreground truncate",children:r});let N;e[0]!==O?(N=s.jsx("div",{className:"flex items-center gap-2",children:O}),e[0]=O,e[1]=N):N=e[1];const _=`${j} ml-1`;let D,R;e[2]!==_?(D=s.jsx(mo,{className:_}),e[2]=_,e[3]=D):D=e[3],e[4]!==w||e[5]!==N||e[6]!==D?(R=s.jsxs(vo,{className:w,children:[N,D]}),e[4]=w,e[5]=N,e[6]=D,e[7]=R):R=e[7];const G=fo,Y=b&&d&&((q,J)=>{const k=v.getModel(q.id);return s.jsxs("div",{className:"flex items-center gap-2 w-full px-2 py-1",children:[s.jsx(ct,{provider:q.providerId,className:j}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:(k==null?void 0:k.name)||q.shortModelId}),s.jsx("span",{className:"text-xs text-muted-foreground",children:q.id})]}),s.jsx("div",{className:"ml-auto flex gap-1",children:s.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded font-medium ${sd(J)}`,children:J},J)})]})})(Ee.parse(b),d);let $;e[8]!==b||e[9]!==d?($=b&&d&&s.jsx(jt,{}),e[8]=b,e[9]=d,e[10]=$):$=e[10];const Q=[...x.entries()].map(q=>{const[J,k]=q;return s.jsx(id,{provider:J,onSelect:i,models:k,iconSizeClass:j},J)});let X,U,V;return e[11]!==g?(X=g&&s.jsxs(s.Fragment,{children:[s.jsx(jt,{}),s.jsx(rr,{className:"flex items-center gap-2",children:s.jsxs("a",{className:"flex items-center gap-1",href:"https://docs.marimo.io/guides/editor_features/ai_completion/?h=models#other-ai-providers",target:"_blank",rel:"noreferrer",children:[s.jsx(xo,{className:"h-3 w-3"}),s.jsx("span",{children:"How to add a custom model"})]})})]}),e[11]=g,e[12]=X):X=e[12],e[13]!==G||e[14]!==a||e[15]!==Y||e[16]!==$||e[17]!==Q||e[18]!==X?(U=s.jsxs(G,{className:"w-[300px]",children:[Y,$,Q,a,X]}),e[13]=G,e[14]=a,e[15]=Y,e[16]=$,e[17]=Q,e[18]=X,e[19]=U):U=e[19],e[20]!==C||e[21]!==U||e[22]!==R?(V=s.jsxs(C,{children:[R,U]}),e[20]=C,e[21]=U,e[22]=R,e[23]=V):V=e[23],V},id=t=>{const e=H.c(29),{provider:n,onSelect:r,models:i,customModelIcon:o,iconSizeClass:a}=t,l=js(n)?n:"openai-compatible";let c;e[0]!==n?(c=ft.getProviderInfo(n),e[0]=n,e[1]=c):c=e[1];const d=c;if(i.length===0)return null;let u,g,f,m,h,p,v;if(e[2]!==l||e[3]!==a?(u=s.jsx(ct,{provider:l,className:a}),e[2]=l,e[3]=a,e[4]=u):u=e[4],e[5]!==n?(g=function(x){const b=ft.getProviderInfo(x);return b?b.name:go(x)}(n),e[5]=n,e[6]=g):g=e[6],e[7]!==u||e[8]!==g?(f=s.jsx(yo,{children:s.jsxs("p",{className:"flex items-center gap-2",children:[u,g]})}),e[7]=u,e[8]=g,e[9]=f):f=e[9],e[10]!==d?(m=d&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-sm text-muted-foreground p-2 max-w-[300px]",children:[d.description,s.jsx("br",{})]}),s.jsxs("p",{className:"text-sm text-muted-foreground p-2 pt-0",children:["You can find more information about this provider"," ",s.jsx("a",{href:d.url,target:"_blank",className:"underline",rel:"noreferrer",children:"here"}),"."]}),s.jsx(jt,{})]}),e[10]=d,e[11]=m):m=e[11],e[12]!==o||e[13]!==l||e[14]!==i||e[15]!==r||e[16]!==n){let x;e[18]!==o||e[19]!==l||e[20]!==r||e[21]!==n?(x=b=>{const j=`${n}/${b.model}`;return s.jsxs(rr,{className:"flex items-center gap-2",onSelect:C=>{r(j)},children:[s.jsx(ct,{provider:l,className:"h-4 w-4"}),s.jsxs("div",{className:"pl-1 flex flex-col",children:[s.jsx("span",{children:b.name}),s.jsx("span",{className:"text-xs text-muted-foreground",children:b.model})]}),b.custom&&o]},j)},e[18]=o,e[19]=l,e[20]=r,e[21]=n,e[22]=x):x=e[22],h=i.map(x),e[12]=o,e[13]=l,e[14]=i,e[15]=r,e[16]=n,e[17]=h}else h=e[17];return e[23]!==m||e[24]!==h?(p=s.jsx(bo,{children:s.jsxs(jo,{className:"max-h-[40vh] overflow-y-auto",alignOffset:-90,children:[m,h]})}),e[23]=m,e[24]=h,e[25]=p):p=e[25],e[26]!==f||e[27]!==p?(v=s.jsxs(wo,{children:[f,p]}),e[26]=f,e[27]=p,e[28]=v):v=e[28],v};function sd(t){switch(t){case"chat":return"bg-[var(--purple-3)] text-[var(--purple-11)]";case"autocomplete":return"bg-[var(--green-3)] text-[var(--green-11)]";case"edit":return"bg-[var(--blue-3)] text-[var(--blue-11)]"}return"bg-[var(--mauve-3)] text-[var(--mauve-11)]"}const od=["us-east-1","us-east-2","us-west-2","eu-central-1","ap-northeast-1","ap-southeast-1"],Ss=t=>{const e=H.c(12),{value:n,includeSuggestion:r}=t,i=r===void 0||r;if(!n||n.includes("/"))return null;let o;e[0]!==n?(o=Ee.parse(n),e[0]=n,e[1]=o):o=e[1];const a=o.id;let l,c,d,u,g;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("code",{className:"font-bold",children:"provider/model"}),e[2]=l):l=e[2],e[3]!==n?(c=s.jsxs("span",{children:["Model id should be in the form"," ",l,". ",n," is missing a provider."]}),e[3]=n,e[4]=c):c=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("br",{}),e[5]=d):d=e[5],e[6]!==i||e[7]!==a?(u=i&&a&&s.jsxs("span",{children:["Did you mean ",s.jsx("code",{className:"font-bold",children:a}),"?"]}),e[6]=i,e[7]=a,e[8]=u):u=e[8],e[9]!==c||e[10]!==u?(g=s.jsxs(wt,{kind:"danger",className:"mt-1",children:[c,d,u]}),e[9]=c,e[10]=u,e[11]=g):g=e[11],g};function Is(t,e){const n=H.c(10);let r;n[0]!==e||n[1]!==t?(r=ir(t,e),n[0]=e,n[1]=t,n[2]=r):r=n[2];const i=r,o=xt(ko);let a;n[3]!==e||n[4]!==o?(a=ir(o,e),n[3]=e,n[4]=o,n[5]=a):a=n[5];const l=a,c=l!=null&&i!==l;let d;return n[6]!==i||n[7]!==c||n[8]!==l?(d={isOverridden:c,currentValue:i,overriddenValue:l},n[6]=i,n[7]=c,n[8]=l,n[9]=d):d=n[9],d}const ad=t=>{const e=H.c(3),{name:n,children:r}=t,[i]=sr(),{isOverridden:o}=Is(i,n);let a;return e[0]!==r||e[1]!==o?(a=o?s.jsx(qe,{delayDuration:200,content:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("p",{children:["This setting is overridden by the"," ",s.jsx(re,{className:"inline mx-px",children:"pyproject.toml"})," config."]}),s.jsxs("p",{children:["To change it, edit the project config"," ",s.jsx(re,{className:"inline mx-px",children:"pyproject.toml"}),"directly."]})]}),children:s.jsx("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:r})}):r,e[0]=r,e[1]=o,e[2]=a):a=e[2],a},B=t=>{const e=H.c(18),{userConfig:n,name:r}=t,{isOverridden:i,currentValue:o,overriddenValue:a}=Is(n,r);if(!i)return null;let l,c,d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("span",{children:["This setting is overridden by"," ",s.jsx(re,{className:"inline",children:"pyproject.toml"}),"."]}),c=s.jsx("br",{}),e[0]=l,e[1]=c):(l=e[0],c=e[1]),e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs("span",{children:["Edit the ",s.jsx(re,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),u=s.jsx("br",{}),e[2]=d,e[3]=u):(d=e[2],u=e[3]);const g=String(o);let f,m;e[4]!==g?(f=s.jsxs("span",{children:["User value: ",s.jsx("strong",{children:g})]}),e[4]=g,e[5]=f):f=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("br",{}),e[6]=m):m=e[6];const h=String(a);let p,v,x;e[7]!==h?(p=s.jsxs("span",{children:["Project value: ",s.jsx("strong",{children:h})]}),e[7]=h,e[8]=p):p=e[8],e[9]!==f||e[10]!==p?(v=s.jsxs(s.Fragment,{children:[l,c,d,u,f,m,p]}),e[9]=f,e[10]=p,e[11]=v):v=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(mr,{className:"w-3 h-3"}),e[12]=x):x=e[12];const b=String(a);let j,C;return e[13]!==b?(j=s.jsxs("span",{className:"text-(--amber-12) text-xs flex items-center gap-1 border rounded px-2 py-1 bg-(--amber-2) border-(--amber-6) ml-1",children:[x,"Overridden by pyproject.toml [",b,"]"]}),e[13]=b,e[14]=j):j=e[14],e[15]!==v||e[16]!==j?(C=s.jsx(qe,{content:v,children:j}),e[15]=v,e[16]=j,e[17]=C):C=e[17],C},Qe="flex flex-row items-center space-x-1 space-y-0",ld=t=>{const e=H.c(5),{provider:n,children:r}=t;let i,o;return e[0]!==n?(i=n&&s.jsx(ct,{provider:n,className:"mr-2"}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(o=s.jsxs("div",{className:"flex items-center text-base font-semibold",children:[i,r]}),e[2]=r,e[3]=i,e[4]=o):o=e[4],o},He=t=>{const e=H.c(10),{form:n,config:r,name:i,placeholder:o,testId:a,description:l}=t;let c,d;return e[0]!==r||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==a?(c=u=>{const{field:g}=u;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:Qe,children:[s.jsx(T,{children:"API Key"}),s.jsx(A,{children:s.jsx(Me,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:o,...g,value:dt(g.value),onChange:f=>{const m=f.target.value;m.includes("*")||g.onChange(m)}})}),s.jsx(L,{}),s.jsx(B,{userConfig:r,name:i})]}),l&&s.jsx(F,{children:l})]})},e[0]=r,e[1]=l,e[2]=i,e[3]=o,e[4]=a,e[5]=c):c=e[5],e[6]!==n.control||e[7]!==i||e[8]!==c?(d=s.jsx(P,{control:n.control,name:i,render:c}),e[6]=n.control,e[7]=i,e[8]=c,e[9]=d):d=e[9],d};function dt(t){if(t!=null)return typeof t=="string"?t:String(t)}const ut=t=>{const e=H.c(12),{form:n,config:r,name:i,placeholder:o,testId:a,description:l,disabled:c,defaultValue:d}=t,u=c!==void 0&&c;let g,f;return e[0]!==r||e[1]!==d||e[2]!==l||e[3]!==i||e[4]!==o||e[5]!==a?(g=m=>{const{field:h}=m;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:Qe,children:[s.jsx(T,{children:"Base URL"}),s.jsx(A,{children:s.jsx(Me,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:o,defaultValue:d,...h,value:dt(h.value)})}),s.jsx(L,{}),s.jsx(B,{userConfig:r,name:i})]}),l&&s.jsx(F,{children:l})]})},e[0]=r,e[1]=d,e[2]=l,e[3]=i,e[4]=o,e[5]=a,e[6]=g):g=e[6],e[7]!==u||e[8]!==n.control||e[9]!==i||e[10]!==g?(f=s.jsx(P,{control:n.control,name:i,disabled:u,render:g}),e[7]=u,e[8]=n.control,e[9]=i,e[10]=g,e[11]=f):f=e[11],f},An=t=>{const e=H.c(14),{form:n,config:r,name:i,placeholder:o,testId:a,description:l,disabled:c,label:d,onSubmit:u}=t,g=c!==void 0&&c;let f,m;return e[0]!==r||e[1]!==l||e[2]!==n||e[3]!==d||e[4]!==i||e[5]!==u||e[6]!==o||e[7]!==a?(f=h=>{const{field:p}=h,v=dt(p.value),x=b=>{p.onChange(b),u(n.getValues())};return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:Qe,children:[s.jsx(T,{children:d}),s.jsx(A,{children:s.jsx(ks,{value:v,placeholder:o,onSelect:x,triggerClassName:"text-sm",customDropdownContent:s.jsxs(s.Fragment,{children:[s.jsx(jt,{}),s.jsxs("p",{className:"px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1",children:["Enter a custom model",s.jsx(qe,{content:"Models should include the provider prefix, e.g. 'openai/gpt-4o'",children:s.jsx(Oo,{className:"h-3 w-3"})})]}),s.jsxs("div",{className:"px-2 py-1",children:[s.jsx(Me,{"data-testid":a,className:"w-full border-border shadow-none focus-visible:shadow-xs",placeholder:o,...p,value:dt(p.value),onKeyDown:No.stopPropagation()}),v&&s.jsx(Ss,{value:v,includeSuggestion:!1})]})]})})}),s.jsx(L,{})]}),s.jsx(B,{userConfig:r,name:i}),s.jsx(Ss,{value:v}),l&&s.jsx(F,{children:l})]})},e[0]=r,e[1]=l,e[2]=n,e[3]=d,e[4]=i,e[5]=u,e[6]=o,e[7]=a,e[8]=f):f=e[8],e[9]!==g||e[10]!==n.control||e[11]!==i||e[12]!==f?(m=s.jsx(P,{control:n.control,name:i,disabled:g,render:f}),e[9]=g,e[10]=n.control,e[11]=i,e[12]=f,e[13]=m):m=e[13],m},cd=t=>{const e=H.c(10),{form:n,config:r,name:i,options:o,testId:a,disabled:l}=t,c=l!==void 0&&l;let d,u;return e[0]!==r||e[1]!==i||e[2]!==o||e[3]!==a?(d=g=>{const{field:f}=g;return s.jsx("div",{className:"flex flex-col space-y-1",children:s.jsxs(M,{className:Qe,children:[s.jsx(T,{children:"Provider"}),s.jsx(A,{children:s.jsx(me,{"data-testid":a,onChange:m=>{m.target.value==="none"?f.onChange(!1):f.onChange(m.target.value)},value:dt(f.value===!0?"github":f.value===!1?"none":f.value),disabled:f.disabled,className:"inline-flex mr-2",children:o.map(pd)})}),s.jsx(L,{}),s.jsx(B,{userConfig:r,name:i})]})})},e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=d):d=e[4],e[5]!==c||e[6]!==n.control||e[7]!==i||e[8]!==d?(u=s.jsx(P,{control:n.control,name:i,disabled:c,render:d}),e[5]=c,e[6]=n.control,e[7]=i,e[8]=d,e[9]=u):u=e[9],u},Rn=t=>{const e=H.c(2),{children:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"flex flex-col gap-4 pb-4",children:n}),e[0]=n,e[1]=r):r=e[1],r},dd=t=>{const e=H.c(13),{form:n,config:r,onSubmit:i}=t;let o,a,l,c,d,u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(At,{children:"Code Completion"}),a=s.jsx("p",{className:"text-sm text-muted-secondary",children:"Choose GitHub Copilot, Codeium, or a custom provider (such as Ollama) to enable AI-powered code completion."}),e[0]=o,e[1]=a):(o=e[0],a=e[1]),e[2]===Symbol.for("react.memo_cache_sentinel")?(l=["none","github","codeium","custom"],e[2]=l):l=e[2],e[3]!==r||e[4]!==n?(c=s.jsx(cd,{form:n,config:r,name:"completion.copilot",options:l,testId:"copilot-select"}),e[3]=r,e[4]=n,e[5]=c):c=e[5],e[6]!==r||e[7]!==n||e[8]!==i?(d=(({form:g,config:f,onSubmit:m})=>{const h=g.getValues("completion.copilot");return h===!1?null:h==="codeium"?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",s.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),s.jsx(He,{form:g,config:f,name:"completion.codeium_api_key",placeholder:"key",testId:"codeium-api-key-input"})]}):h==="github"?s.jsx(vs,{}):h==="custom"?s.jsx(An,{label:"Autocomplete Model",form:g,config:f,name:"ai.models.autocomplete_model",placeholder:"ollama/qwen2.5-coder:1.5b",testId:"custom-model-input",description:"Model to use for code completion when using a custom provider.",onSubmit:m}):void 0})({form:n,config:r,onSubmit:i}),e[6]=r,e[7]=n,e[8]=i,e[9]=d):d=e[9],e[10]!==c||e[11]!==d?(u=s.jsxs(Rn,{children:[o,a,c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12],u},Re=t=>{const e=H.c(15),{title:n,triggerClassName:r,provider:i,children:o,isConfigured:a}=t;let l,c,d,u,g;return e[0]!==a?(l=a&&s.jsx("span",{className:"ml-2 px-1 rounded bg-muted text-xs font-medium border",children:"Configured"}),e[0]=a,e[1]=l):l=e[1],e[2]!==i||e[3]!==l||e[4]!==n?(c=s.jsxs(ld,{provider:i,children:[n,l]}),e[2]=i,e[3]=l,e[4]=n,e[5]=c):c=e[5],e[6]!==c||e[7]!==r?(d=s.jsx(Do,{className:r,children:c}),e[6]=c,e[7]=r,e[8]=d):d=e[8],e[9]!==o?(u=s.jsx(To,{wrapperClassName:"flex flex-col gap-4",children:o}),e[9]=o,e[10]=u):u=e[10],e[11]!==i||e[12]!==d||e[13]!==u?(g=s.jsxs(Eo,{value:i,children:[d,u]}),e[11]=i,e[12]=d,e[13]=u,e[14]=g):g=e[14],g},ud=t=>{const e=H.c(88),{form:n,config:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Le(),e[0]=i):i=e[0];const o=i;let a;e[1]!==n?(a=Oe=>!!n.getValues(Oe),e[1]=n,e[2]=a):a=e[2];const l=a;let c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(re,{className:"inline",children:"marimo.toml"}),e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs("p",{className:"text-sm text-muted-secondary",children:["Add your API keys below or to ",c," ","to set up a provider for the Code Completion and Assistant features; see"," ",s.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/ai_completion/#connecting-to-an-llm",children:"docs"})," ","for more info."]}),e[4]=d):d=e[4];const u=l("ai.open_ai.api_key");let g,f,m,h;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs(s.Fragment,{children:["Your OpenAI API key from"," ",s.jsx(de,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]}),e[5]=g):g=e[5],e[6]!==r||e[7]!==n?(f=s.jsx(He,{form:n,config:r,name:"ai.open_ai.api_key",placeholder:"sk-proj...",testId:"ai-openai-api-key-input",description:g}),m=s.jsx(ut,{form:n,config:r,name:"ai.open_ai.base_url",placeholder:"https://api.openai.com/v1",testId:"ai-base-url-input",disabled:o}),e[6]=r,e[7]=n,e[8]=f,e[9]=m):(f=e[8],m=e[9]),e[10]!==u||e[11]!==f||e[12]!==m?(h=s.jsxs(Re,{title:"OpenAI",provider:"openai",triggerClassName:"pt-0",isConfigured:u,children:[f,m]}),e[10]=u,e[11]=f,e[12]=m,e[13]=h):h=e[13];const p=l("ai.anthropic.api_key");let v,x,b;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs(s.Fragment,{children:["Your Anthropic API key from"," ",s.jsx(de,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]}),e[14]=v):v=e[14],e[15]!==r||e[16]!==n?(x=s.jsx(He,{form:n,config:r,name:"ai.anthropic.api_key",placeholder:"sk-ant...",testId:"ai-anthropic-api-key-input",description:v}),e[15]=r,e[16]=n,e[17]=x):x=e[17],e[18]!==p||e[19]!==x?(b=s.jsx(Re,{title:"Anthropic",provider:"anthropic",isConfigured:p,children:x}),e[18]=p,e[19]=x,e[20]=b):b=e[20];const j=l("ai.google.api_key");let C,w,O;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsxs(s.Fragment,{children:["Your Google AI API key from"," ",s.jsx(de,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]}),e[21]=C):C=e[21],e[22]!==r||e[23]!==n?(w=s.jsx(He,{form:n,config:r,name:"ai.google.api_key",placeholder:"AI...",testId:"ai-google-api-key-input",description:C}),e[22]=r,e[23]=n,e[24]=w):w=e[24],e[25]!==j||e[26]!==w?(O=s.jsx(Re,{title:"Google",provider:"google",isConfigured:j,children:w}),e[25]=j,e[26]=w,e[27]=O):O=e[27];const N=l("ai.ollama.base_url");let _,D;e[28]!==r||e[29]!==n?(_=s.jsx(ut,{form:n,config:r,name:"ai.ollama.base_url",placeholder:"http://localhost:11434/v1",defaultValue:"http://localhost:11434/v1",testId:"ollama-base-url-input"}),e[28]=r,e[29]=n,e[30]=_):_=e[30],e[31]!==N||e[32]!==_?(D=s.jsx(Re,{title:"Ollama",provider:"ollama",isConfigured:N,children:_}),e[31]=N,e[32]=_,e[33]=D):D=e[33];const R=l("ai.github.api_key");let G,Y,$,Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsxs(s.Fragment,{children:["Your GitHub API token from"," ",s.jsx(re,{className:"inline",children:"gh auth token"}),"."]}),e[34]=G):G=e[34],e[35]!==r||e[36]!==n?(Y=s.jsx(He,{form:n,config:r,name:"ai.github.api_key",placeholder:"ghp_...",testId:"ai-github-api-key-input",description:G}),$=s.jsx(ut,{form:n,config:r,name:"ai.github.base_url",placeholder:"https://api.githubcopilot.com/",testId:"ai-github-base-url-input"}),e[35]=r,e[36]=n,e[37]=Y,e[38]=$):(Y=e[37],$=e[38]),e[39]!==R||e[40]!==Y||e[41]!==$?(Q=s.jsxs(Re,{title:"GitHub",provider:"github",isConfigured:R,children:[Y,$]}),e[39]=R,e[40]=Y,e[41]=$,e[42]=Q):Q=e[42];const X=l("ai.azure.api_key")&&l("ai.azure.base_url");let U,V,K,q;e[43]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsxs(s.Fragment,{children:["Your Azure API key from"," ",s.jsx(de,{href:"https://portal.azure.com/",children:"portal.azure.com"}),"."]}),e[43]=U):U=e[43],e[44]!==r||e[45]!==n?(V=s.jsx(He,{form:n,config:r,name:"ai.azure.api_key",placeholder:"sk-proj...",testId:"ai-azure-api-key-input",description:U}),K=s.jsx(ut,{form:n,config:r,name:"ai.azure.base_url",placeholder:"https://<your-resource-name>.openai.azure.com",testId:"ai-azure-base-url-input"}),e[44]=r,e[45]=n,e[46]=V,e[47]=K):(V=e[46],K=e[47]),e[48]!==X||e[49]!==V||e[50]!==K?(q=s.jsxs(Re,{title:"Azure",provider:"azure",isConfigured:X,children:[V,K]}),e[48]=X,e[49]=V,e[50]=K,e[51]=q):q=e[51];const J=l("ai.bedrock.region_name");let k,y,I,le,fe,pe;e[52]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsxs("p",{className:"text-sm text-muted-secondary mb-2",children:["To use AWS Bedrock, you need to configure AWS credentials and region. See the"," ",s.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),e[52]=k):k=e[52],e[53]!==r?(y=Oe=>{const{field:te}=Oe;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:Qe,children:[s.jsx(T,{children:"AWS Region"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"bedrock-region-select",onChange:_e=>te.onChange(_e.target.value),value:typeof te.value=="string"?te.value:"us-east-1",disabled:te.disabled,className:"inline-flex mr-2",children:od.map(gd)})}),s.jsx(L,{}),s.jsx(B,{userConfig:r,name:"ai.bedrock.region_name"})]}),s.jsx(F,{children:"The AWS region where Bedrock service is available."})]})},e[53]=r,e[54]=y):y=e[54],e[55]!==n.control||e[56]!==y?(I=s.jsx(P,{control:n.control,disabled:o,name:"ai.bedrock.region_name",render:y}),e[55]=n.control,e[56]=y,e[57]=I):I=e[57],e[58]!==r?(le=Oe=>{const{field:te}=Oe;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:Qe,children:[s.jsx(T,{children:"AWS Profile Name (Optional)"}),s.jsx(A,{children:s.jsx(Me,{"data-testid":"bedrock-profile-input",rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:"default",...te,value:te.value||""})}),s.jsx(L,{}),s.jsx(B,{userConfig:r,name:"ai.bedrock.profile_name"})]}),s.jsx(F,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})},e[58]=r,e[59]=le):le=e[59],e[60]!==n.control||e[61]!==le?(fe=s.jsx(P,{control:n.control,disabled:o,name:"ai.bedrock.profile_name",render:le}),e[60]=n.control,e[61]=le,e[62]=fe):fe=e[62],e[63]!==J||e[64]!==I||e[65]!==fe?(pe=s.jsxs(Re,{title:"AWS Bedrock",provider:"bedrock",isConfigured:J,children:[k,I,fe]}),e[63]=J,e[64]=I,e[65]=fe,e[66]=pe):pe=e[66];const Ce=l("ai.open_ai_compatible.api_key")&&l("ai.open_ai_compatible.base_url");let ke,Se,ge,ee,Z,ce;return e[67]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(s.Fragment,{children:"API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc)."}),e[67]=ke):ke=e[67],e[68]!==r||e[69]!==n?(Se=s.jsx(He,{form:n,config:r,name:"ai.open_ai_compatible.api_key",placeholder:"sk-...",testId:"ai-openai-compatible-api-key-input",description:ke}),e[68]=r,e[69]=n,e[70]=Se):Se=e[70],e[71]===Symbol.for("react.memo_cache_sentinel")?(ge=s.jsx(s.Fragment,{children:"Base URL for your OpenAI-compatible provider."}),e[71]=ge):ge=e[71],e[72]!==r||e[73]!==n?(ee=s.jsx(ut,{form:n,config:r,name:"ai.open_ai_compatible.base_url",placeholder:"https://api.together.xyz/v1",testId:"ai-openai-compatible-base-url-input",description:ge}),e[72]=r,e[73]=n,e[74]=ee):ee=e[74],e[75]!==Ce||e[76]!==Se||e[77]!==ee?(Z=s.jsxs(Re,{title:"OpenAI-Compatible",provider:"openai-compatible",isConfigured:Ce,children:[Se,ee]}),e[75]=Ce,e[76]=Se,e[77]=ee,e[78]=Z):Z=e[78],e[79]!==b||e[80]!==O||e[81]!==D||e[82]!==Q||e[83]!==q||e[84]!==pe||e[85]!==Z||e[86]!==h?(ce=s.jsxs(Rn,{children:[d,s.jsxs(So,{type:"multiple",children:[h,b,O,D,Q,q,pe,Z]})]}),e[79]=b,e[80]=O,e[81]=D,e[82]=Q,e[83]=q,e[84]=pe,e[85]=Z,e[86]=h,e[87]=ce):ce=e[87],ce},hd=t=>{const e=H.c(23),{form:n,config:r,onSubmit:i}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Le(),e[0]=o):o=e[0];const a=o;let l,c,d,u,g,f,m,h,p,v;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(At,{children:"AI Assistant"}),c=s.jsx(Io,{}),e[1]=l,e[2]=c):(l=e[1],c=e[2]),e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("span",{children:"Model to use for chat conversations in the Chat panel."}),e[3]=d):d=e[3],e[4]!==r||e[5]!==n||e[6]!==i?(u=s.jsx(An,{label:"Chat Model",form:n,config:r,name:"ai.models.chat_model",placeholder:cr,testId:"ai-chat-model-input",disabled:a,description:d,onSubmit:i}),e[4]=r,e[5]=n,e[6]=i,e[7]=u):u=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("span",{children:["Model to use for code editing with the"," ",s.jsx(re,{className:"inline",children:"Generate with AI"})," button."]}),e[8]=g):g=e[8],e[9]!==r||e[10]!==n||e[11]!==i?(f=s.jsx(An,{label:"Edit Model",form:n,config:r,name:"ai.models.edit_model",placeholder:cr,testId:"ai-edit-model-input",disabled:a,description:g,onSubmit:i}),e[9]=r,e[10]=n,e[11]=i,e[12]=f):f=e[12],e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("ul",{className:"bg-muted p-2 rounded-md list-disc space-y-1 pl-6",children:[s.jsx("li",{className:"text-xs text-muted-secondary",children:'Models should include the provider name and model name separated by a slash. For example, "anthropic/claude-3-5-sonnet-latest" or "google/gemini-2.0-flash-exp"'}),s.jsx("li",{className:"text-xs text-muted-secondary",children:"Depending on the provider, we will use the respective API key and additional configuration."})]}),e[13]=m):m=e[13],e[14]!==r?(h=x=>{const{field:b}=x;return s.jsxs("div",{className:"flex flex-col",children:[s.jsxs(M,{children:[s.jsx(T,{children:"Custom Rules"}),s.jsx(A,{children:s.jsx(Co,{"data-testid":"ai-rules-input",className:"m-0 inline-flex w-full h-32 p-2 text-sm",placeholder:"e.g. Always use type hints; prefer polars over pandas",...b,value:b.value})}),s.jsx(L,{}),s.jsx(B,{userConfig:r,name:"ai.rules"})]}),s.jsx(F,{children:"Custom rules to include in all AI completion prompts."})]})},e[14]=r,e[15]=h):h=e[15],e[16]!==n.control||e[17]!==h?(p=s.jsx(P,{control:n.control,name:"ai.rules",render:h}),e[16]=n.control,e[17]=h,e[18]=p):p=e[18],e[19]!==p||e[20]!==u||e[21]!==f?(v=s.jsxs(Rn,{children:[l,c,u,f,m,p]}),e[19]=p,e[20]=u,e[21]=f,e[22]=v):v=e[22],v},fd=t=>{const e=H.c(12),{form:n,config:r,onSubmit:i}=t;let o,a,l,c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(or,{className:"mb-2",children:[s.jsx(Wt,{value:"ai-features",children:"AI Features"}),s.jsx(Wt,{value:"ai-providers",children:"AI Providers"})]}),e[0]=o):o=e[0],e[1]!==r||e[2]!==n||e[3]!==i?(a=s.jsxs(ar,{value:"ai-features",children:[s.jsx(dd,{form:n,config:r,onSubmit:i}),s.jsx(hd,{form:n,config:r,onSubmit:i})]}),e[1]=r,e[2]=n,e[3]=i,e[4]=a):a=e[4],e[5]!==r||e[6]!==n||e[7]!==i?(l=s.jsx(ar,{value:"ai-providers",children:s.jsx(ud,{form:n,config:r,onSubmit:i})}),e[5]=r,e[6]=n,e[7]=i,e[8]=l):l=e[8],e[9]!==a||e[10]!==l?(c=s.jsxs(lr,{defaultValue:"ai-features",children:[o,a,l]}),e[9]=a,e[10]=l,e[11]=c):c=e[11],c};function pd(t){return s.jsx("option",{value:t,children:t},t)}function gd(t){return s.jsx("option",{value:t,children:t},t)}const Cs=[{id:"sql",packagesRequired:[{name:"duckdb"},{name:"sqlglot"}],additionalPackageInstalls:[{name:"polars[pyarrow]"}],description:"SQL cells"},{id:"charts",packagesRequired:[{name:"altair"}],additionalPackageInstalls:[],description:"Charts in datasource viewer"},{id:"fast-charts",packagesRequired:[{name:"vegafusion"},{name:"vl-convert-python"}],additionalPackageInstalls:[],description:"Fast server-side charts"},{id:"formatting",packagesRequired:[Le()?{name:"black"}:{name:"ruff"}],additionalPackageInstalls:[],description:"Formatting"},{id:"ai",packagesRequired:[{name:"openai"}],additionalPackageInstalls:[],description:"AI features"},{id:"ipy-export",packagesRequired:[{name:"nbformat"}],additionalPackageInstalls:[],description:"Export as IPYNB"},{id:"testing",packagesRequired:[{name:"pytest"}],additionalPackageInstalls:[],description:"Autorun unit tests"}];Le()||Cs.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const md=()=>{const t=H.c(23),[e]=qt(),n=e.package_management.manager,{getPackageList:r}=Ge();let i,o;t[0]!==r?(i=()=>r(),t[0]=r,t[1]=i):i=t[1],t[2]!==n?(o=[n],t[2]=n,t[3]=o):o=t[3];const{data:a,error:l,refetch:c,isPending:d}=_o(i,o);if(d){let w;return t[4]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(ur,{size:"medium",centered:!0}),t[4]=w):w=t[4],w}if(l){let w;return t[5]!==l?(w=s.jsx(Mo,{error:l}),t[5]=l,t[6]=w):w=t[6],w}let u;t[7]!==(a==null?void 0:a.packages)?(u=(a==null?void 0:a.packages)||[],t[7]=a==null?void 0:a.packages,t[8]=u):u=t[8];const g=u;let f;t[9]!==g?(f=new Set(g.map(xd)),t[9]=g,t[10]=f):f=t[10];const m=f;let h,p,v,x,b,j,C;return t[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(At,{children:"Optional Features"}),t[11]=h):h=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",s.jsx("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[12]=p):p=t[12],t[13]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ao,{children:s.jsxs(dr,{children:[s.jsx(kt,{children:"Dependency"}),s.jsx(kt,{children:"Feature"}),s.jsx(kt,{children:"Status"}),s.jsx(kt,{})]})}),t[13]=v):v=t[13],t[14]!==m||t[15]!==n||t[16]!==c?(x=Cs.map(w=>{const O=w.packagesRequired.every(_=>m.has(_.name.split("[")[0])),N=w.packagesRequired.map(yd).join(", ");return s.jsxs(dr,{className:"text-sm",children:[s.jsx($t,{children:w.description}),s.jsx($t,{className:"font-mono text-xs",children:N}),s.jsx($t,{children:O?s.jsxs("div",{className:"flex items-center",children:[s.jsx(pr,{className:"h-4 w-4 text-(--grass-10) mr-2"}),s.jsx("span",{children:"Installed"})]}):s.jsxs("div",{className:"flex items-center",children:[s.jsx(Po,{className:"h-4 w-4 text-(--red-10) mr-2"}),s.jsx(vd,{packageSpecs:[...w.packagesRequired,...w.additionalPackageInstalls],packageManager:n,onSuccess:c})]})})]},w.id)}),t[14]=m,t[15]=n,t[16]=c,t[17]=x):x=t[17],t[18]!==x?(b=s.jsxs(Ro,{children:[v,s.jsx(Lo,{children:x})]}),t[18]=x,t[19]=b):b=t[19],t[20]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[20]=j):j=t[20],t[21]!==b?(C=s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[h,p,b,j]}),t[21]=b,t[22]=C):C=t[22],C},vd=({packageSpecs:t,packageManager:e,onSuccess:n})=>{const[r,i]=Xe.useState(!1),{addPackage:o}=Ge();return s.jsxs(xe,{size:"xs",variant:"outline",className:Ze("text-xs",r&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{i(!0);const a=t.map(c=>c.minVersion?`${c.name}>=${c.minVersion}`:c.name).join(" "),l=await o({package:a});l.success?(n(),Ue({title:"Package installed",description:s.jsxs("span",{children:["The packages"," ",s.jsx(re,{className:"inline",children:t.map(c=>c.name).join(", ")})," ","have been added to your environment."]})})):Ue({title:"Failed to install package",description:l.error,variant:"danger"})}finally{i(!1)}},disabled:r,children:[r?s.jsx(ur,{size:"small",className:"mr-2 h-3 w-3"}):s.jsx(fr,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function xd(t){return t.name}function yd(t){return t.name}const W="flex flex-row items-center space-x-1 space-y-0",Os=[{id:"editor",label:"Editor",Icon:Jn,className:"bg-(--blue-4)"},{id:"display",label:"Display",Icon:la,className:"bg-(--grass-4)"},{id:"packageManagement",label:"Package Management",Icon:ca,className:"bg-(--red-4)"},{id:"runtime",label:"Runtime",Icon:gr,className:"bg-(--amber-4)"},{id:"ai",label:"AI",Icon:na,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:mr,className:"bg-(--orange-4)"},{id:"labs",label:"Labs",Icon:ra,className:"bg-(--slate-4)"}],Ns=Je(Os[0].id),bd=()=>{const t=H.c(47),[e,n]=sr(),r=S.useRef(null),i=Kt(Mn),[o,a]=et(Ns),l=xt(zo),c=xt(Fo),{saveUserConfig:d}=Ge();let u,g;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=Fn(Bo),t[0]=u):u=t[0],t[1]!==e?(g={resolver:u,defaultValues:e},t[1]=e,t[2]=g):g=t[2];const f=Bn(g);let m;t[3]!==d||t[4]!==n?(m=async k=>{await d({config:k}).then(()=>{n(k)})},t[3]=d,t[4]=n,t[5]=m):m=t[5];const h=m;let p;t[6]===Symbol.for("react.memo_cache_sentinel")?(p=Le(),t[6]=p):p=t[6];const v=p,x=S.useId(),b=S.useId();let j;t[7]!==o||t[8]!==l||t[9]!==e||t[10]!==f||t[11]!==x||t[12]!==b||t[13]!==h||t[14]!==a||t[15]!==i?(j=()=>{switch(o){case"editor":return s.jsxs(s.Fragment,{children:[s.jsxs(Te,{title:"Autosave",children:[s.jsx(P,{control:f.control,name:"save.autosave",render:k=>{const{field:y}=k;return s.jsxs(M,{className:W,children:[s.jsx(T,{className:"font-normal",children:"Autosave enabled"}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"autosave-checkbox",checked:y.value==="after_delay",disabled:y.disabled,onCheckedChange:I=>{y.onChange(I?"after_delay":"off")}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"save.autosave"})]})}}),s.jsx(P,{control:f.control,name:"save.autosave_delay",render:k=>{const{field:y}=k;return s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Autosave delay (seconds)"}),s.jsx(A,{children:s.jsx(tt,{"aria-label":"Autosave delay","data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:f.getValues("save.autosave")!=="after_delay",...y,value:y.value/1e3,minValue:1,onChange:I=>{y.onChange(1e3*I),Number.isNaN(I)||h(f.getValues())}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"save.autosave_delay"})]})}}),s.jsx(P,{control:f.control,name:"runtime.default_auto_download",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Save cell outputs as"}),s.jsx(A,{children:s.jsxs("div",{className:"flex gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ie,{id:x,checked:Array.isArray(y.value)&&y.value.includes("html"),onCheckedChange:()=>{const I=Array.isArray(y.value)?y.value:[];y.onChange(pt(I,"html"))}}),s.jsx(T,{htmlFor:x,children:"HTML"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ie,{id:b,checked:Array.isArray(y.value)&&y.value.includes("ipynb"),onCheckedChange:()=>{const I=Array.isArray(y.value)?y.value:[];y.onChange(pt(I,"ipynb"))}}),s.jsx(T,{htmlFor:b,children:"IPYNB"})]})]})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"runtime.default_auto_download"})]}),s.jsxs(F,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",s.jsx(re,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}})]}),s.jsxs(Te,{title:"Formatting",children:[s.jsx(P,{control:f.control,name:"save.format_on_save",render:k=>{const{field:y}=k;return s.jsxs(M,{className:W,children:[s.jsx(T,{className:"font-normal",children:"Format on save"}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"format-on-save-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:I=>{y.onChange(I)}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"save.format_on_save"})]})}}),s.jsx(P,{control:f.control,name:"formatting.line_length",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Line length"}),s.jsx(A,{children:s.jsx(tt,{"aria-label":"Line length","data-testid":"line-length-input",className:"m-0 w-24",...y,value:y.value,minValue:1,maxValue:1e3,onChange:I=>{y.onChange(I),Number.isNaN(I)||h(f.getValues())}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"formatting.line_length"})]}),s.jsx(F,{children:"Maximum line length when formatting code."})]})}})]}),s.jsx(Te,{title:"Autocomplete",children:s.jsx(P,{control:f.control,name:"completion.activate_on_typing",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{className:"font-normal",children:"Autocomplete"}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"autocomplete-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:I=>{y.onChange(!!I)}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"completion.activate_on_typing"})]}),s.jsx(F,{children:"When unchecked, code completion is still available through a hotkey."}),s.jsx("div",{children:s.jsx(xe,{variant:"link",className:"mb-0 px-0",type:"button",onClick:I=>{I.preventDefault(),I.stopPropagation(),a("ai")},children:"Edit AI autocomplete"})})]})}})}),s.jsxs(Te,{title:"Language Servers",children:[s.jsxs(F,{children:["See the"," ",s.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),s.jsxs(F,{children:[s.jsx("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),s.jsx(P,{control:f.control,name:"language_servers.pylsp.enabled",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(M,{className:W,children:[s.jsxs(T,{children:[s.jsx(St,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",s.jsx(de,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"pylsp-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:I=>{y.onChange(!!I)}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"language_servers.pylsp.enabled"})]}),y.value&&!l.pylsp&&s.jsxs(wt,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",s.jsx(re,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}}),s.jsx(P,{control:f.control,name:"language_servers.basedpyright.enabled",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(M,{className:W,children:[s.jsxs(T,{children:[s.jsx(St,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",s.jsx(de,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"basedpyright-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:I=>{y.onChange(!!I)}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"language_servers.basedpyright.enabled"})]}),y.value&&!l.basedpyright&&s.jsxs(wt,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",s.jsx(re,{className:"inline",children:"basedpyright"})," in your environment."]})]})}}),s.jsx(P,{control:f.control,name:"language_servers.ty.enabled",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(M,{className:W,children:[s.jsxs(T,{children:[s.jsx(St,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",s.jsx(de,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"ty-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:I=>{y.onChange(!!I)}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"language_servers.ty.enabled"})]}),y.value&&!l.ty&&s.jsxs(wt,{kind:"danger",children:["ty is not available in your current environment. Please install ",s.jsx(re,{className:"inline",children:"ty"})," in your environment."]})]})}}),s.jsx(P,{control:f.control,name:"diagnostics.enabled",render:k=>{const{field:y}=k;return s.jsxs(M,{className:W,children:[s.jsxs(T,{children:[s.jsx(St,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"diagnostics-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:I=>{y.onChange(!!I)}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"diagnostics.enabled"})]})}})]}),s.jsxs(Te,{title:"Keymap",children:[s.jsx(P,{control:f.control,name:"keymap.preset",render:k=>{const{field:y}=k;return s.jsx("div",{className:"flex flex-col space-y-1",children:s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Keymap"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"keymap-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:Fc.map(jd)})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"keymap.preset"})]})})}}),s.jsx(P,{control:f.control,name:"keymap.destructive_delete",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{className:"font-normal",children:"Destructive delete"}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"destructive-delete-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:I=>{y.onChange(!!I)}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"keymap.destructive_delete"})]}),s.jsxs(F,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",s.jsx(qe,{content:s.jsxs("div",{className:"max-w-xs",children:[s.jsx("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:s.jsx(Uo,{className:"w-3 h-3 text-(--amber-11)"})})]}),s.jsx("div",{children:s.jsx(xe,{variant:"link",className:"mb-0 px-0",type:"button",onClick:I=>{I.preventDefault(),I.stopPropagation(),i(!0)},children:"Edit Keyboard Shortcuts"})})]})}})]})]});case"display":return s.jsxs(s.Fragment,{children:[s.jsxs(Te,{title:"Display",children:[s.jsx(P,{control:f.control,name:"display.default_width",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Default width"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"user-config-width-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(wd)})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"display.default_width"})]}),s.jsx(F,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),s.jsx(P,{control:f.control,name:"display.theme",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Theme"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"theme-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:Go.map(kd)})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"display.theme"})]}),s.jsx(F,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),s.jsx(P,{control:f.control,name:"display.code_editor_font_size",render:k=>{const{field:y}=k;return s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Code editor font size (px)"}),s.jsx(A,{children:s.jsx("span",{className:"inline-flex mr-2",children:s.jsx(tt,{"aria-label":"Code editor font size","data-testid":"code-editor-font-size-input",className:"m-0 w-24",...y,value:y.value,minValue:8,maxValue:32,onChange:I=>{y.onChange(I),h(f.getValues())}})})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"display.code_editor_font_size"})]})}}),s.jsx(P,{control:f.control,name:"display.reference_highlighting",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Reference highlighting"}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"reference-highlighting-checkbox",checked:y.value,onCheckedChange:y.onChange})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"display.reference_highlighting"})]}),s.jsx(F,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})}})]}),s.jsxs(Te,{title:"Outputs",children:[s.jsx(P,{control:f.control,name:"display.cell_output",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Cell output area"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"cell-output-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:["above","below"].map(Sd)})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"display.cell_output"})]}),s.jsx(F,{children:"Where to display cell's output."})]})}}),s.jsx(P,{control:f.control,name:"display.dataframes",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Dataframe viewer"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"display-dataframes-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(Id)})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"display.dataframes"})]}),s.jsx(F,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}}),s.jsx(P,{control:f.control,name:"display.default_table_page_size",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Default table page size"}),s.jsx(A,{children:s.jsx(tt,{"aria-label":"Default table page size","data-testid":"default-table-page-size-input",className:"m-0 w-24",...y,value:y.value,minValue:1,step:1,onChange:I=>{y.onChange(I),Number.isNaN(I)||h(f.getValues())}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"display.default_table_page_size"})]}),s.jsx(F,{children:"The default number of rows displayed in dataframes and SQL results."})]})}}),s.jsx(P,{control:f.control,name:"display.default_table_max_columns",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Default table max columns"}),s.jsx(A,{children:s.jsx(tt,{"aria-label":"Default table max columns","data-testid":"default-table-max-columns-input",className:"m-0 w-24",...y,value:y.value,minValue:1,step:1,onChange:I=>{y.onChange(I),Number.isNaN(I)||h(f.getValues())}})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"display.default_table_max_columns"})]}),s.jsx(F,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})}})]})]});case"packageManagement":return s.jsx(Te,{title:"Package Management",children:s.jsx(P,{control:f.control,disabled:v,name:"package_management.manager",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Manager"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"package-manager-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:Ho.map(Cd)})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"package_management.manager"})]}),s.jsxs(F,{children:["When marimo comes across a module that is not installed, you will be prompted to install it using your preferred package manager. Learn more in the"," ",s.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",s.jsx("br",{}),s.jsx("br",{}),"Running marimo in a"," ",s.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/package_management.html#running-marimo-in-a-sandbox-environment-uv-only",children:"sandboxed environment"})," ","is only supported by ",s.jsx(re,{className:"inline",children:"uv"})]})]})}})});case"runtime":return s.jsxs(Te,{title:"Runtime configuration",children:[s.jsx(P,{control:f.control,name:"runtime.auto_instantiate",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{className:"font-normal",children:"Autorun on startup"}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"auto-instantiate-checkbox",disabled:y.disabled,checked:y.value,onCheckedChange:y.onChange})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"runtime.auto_instantiate"})]}),s.jsx(F,{children:"Whether to automatically run all cells on startup."})]})}}),s.jsx(P,{control:f.control,name:"runtime.on_cell_change",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{className:"font-normal",children:"On cell change"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"on-cell-change-select",onChange:I=>y.onChange(I.target.value),value:y.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(Od)})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"runtime.on_cell_change"})]}),s.jsx(F,{children:`Whether marimo should automatically run cells or just mark them as stale. If "autorun", marimo will automatically run affected cells when a cell is run or a UI element is interacted with; if "lazy", marimo will mark affected cells as stale but won't re-run them.`})]})}}),s.jsx(P,{control:f.control,name:"runtime.auto_reload",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{className:"font-normal",children:"On module change"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"auto-reload-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:v,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(Nd)})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"runtime.auto_reload"})]}),s.jsx(F,{children:'Whether marimo should automatically reload modules before executing cells. If "lazy", marimo will mark cells affected by module modifications as stale; if "autorun", affected cells will be automatically re-run.'})]})}}),s.jsx(P,{control:f.control,name:"runtime.default_sql_output",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{children:"Default SQL output"}),s.jsx(A,{children:s.jsx(me,{"data-testid":"user-config-sql-output-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:ss.map(Dd)})}),s.jsx(L,{}),s.jsx(B,{userConfig:e,name:"runtime.default_sql_output"})]}),s.jsx(F,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})}}),s.jsx(P,{control:f.control,name:"runtime.reactive_tests",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{className:"font-normal",children:"Autorun Unit Tests"}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"reactive-test-checkbox",checked:y.value,onCheckedChange:y.onChange})})]}),s.jsx(B,{userConfig:e,name:"runtime.reactive_tests"}),s.jsx(L,{}),s.jsx(F,{children:"Enable reactive pytest tests in notebook. When a cell contains only test functions (test_*) and classes (Test_*), marimo will automatically run them with pytest (requires notebook restart)."})," "]})}}),s.jsxs(F,{children:["Learn more in the"," ",s.jsx(de,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return s.jsx(fd,{form:f,config:e,onSubmit:h});case"optionalDeps":return s.jsx(md,{});case"labs":return s.jsxs(Te,{title:"Experimental Features",children:[s.jsx("p",{className:"text-sm text-muted-secondary mb-4",children:"\u26A0\uFE0F These features are experimental and may require restarting your notebook to take effect."}),s.jsx(P,{control:f.control,name:"experimental.inline_ai_tooltip",render:Td}),s.jsx(P,{control:f.control,name:"experimental.rtc_v2",render:Ed}),s.jsx(P,{control:f.control,name:"experimental.performant_table_charts",render:k=>{const{field:y}=k;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{className:"font-normal",children:"Performant Table Charts"}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"performant-table-charts-checkbox",checked:y.value===!0,onCheckedChange:y.onChange})})]}),s.jsx(B,{userConfig:e,name:"experimental.performant_table_charts"}),s.jsx(F,{children:"Enable experimental table charts which are computed on the backend."})]})}})]})}},t[7]=o,t[8]=l,t[9]=e,t[10]=f,t[11]=x,t[12]=b,t[13]=h,t[14]=a,t[15]=i,t[16]=j):j=t[16];const C=j;let w,O,N;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(re,{className:"inline",children:"marimo.toml"}),O=s.jsx("br",{}),t[17]=w,t[18]=O):(w=t[17],O=t[18]),t[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs("p",{className:"text-muted-secondary",children:["User configuration is stored in ",w,O,"Run ",s.jsx(re,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),t[19]=N):N=t[19];const _=N;let D,R,G,Y,$,Q,X,U,V,K,q,J;return t[20]!==f||t[21]!==h?(D=f.handleSubmit(h),t[20]=f,t[21]=h,t[22]=D):D=t[22],t[23]!==a?(R=k=>a(k),t[23]=a,t[24]=R):R=t[24],t[25]===Symbol.for("react.memo_cache_sentinel")?(G=Os.map(_d),t[25]=G):G=t[25],t[26]!==c?(Y=s.jsx("div",{className:"p-2 text-xs text-muted-foreground self-start",children:s.jsxs("span",{children:["Version: ",c]})}),t[26]=c,t[27]=Y):Y=t[27],t[28]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("div",{className:"flex-1"}),Q=!Le()&&_,t[28]=$,t[29]=Q):($=t[28],Q=t[29]),t[30]!==Y?(X=s.jsxs(or,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[G,Y,$,Q]}),t[30]=Y,t[31]=X):X=t[31],t[32]!==o||t[33]!==X||t[34]!==R?(U=s.jsx(lr,{value:o,onValueChange:R,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:X}),t[32]=o,t[33]=X,t[34]=R,t[35]=U):U=t[35],t[36]!==C?(V=C(),t[36]=C,t[37]=V):V=t[37],t[38]!==V?(K=s.jsx("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:V}),t[38]=V,t[39]=K):K=t[39],t[40]!==U||t[41]!==K||t[42]!==D?(q=s.jsxs("form",{ref:r,onChange:D,className:"flex text-pretty overflow-hidden",children:[U,K]}),t[40]=U,t[41]=K,t[42]=D,t[43]=q):q=t[43],t[44]!==f||t[45]!==q?(J=s.jsx(Hn,{...f,children:q}),t[44]=f,t[45]=q,t[46]=J):J=t[46],J},Te=t=>{const e=H.c(5),{title:n,children:r}=t;let i,o;return e[0]!==n?(i=s.jsx(At,{children:n}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[i,r]}),e[2]=r,e[3]=i,e[4]=o):o=e[4],o};function jd(t){return s.jsx("option",{value:t,children:t},t)}function wd(t){return s.jsx("option",{value:t,children:t},t)}function kd(t){return s.jsx("option",{value:t,children:t},t)}function Sd(t){return s.jsx("option",{value:t,children:t},t)}function Id(t){return s.jsx("option",{value:t,children:t},t)}function Cd(t){return s.jsx("option",{value:t,children:t},t)}function Od(t){return s.jsx("option",{value:t,children:t},t)}function Nd(t){return s.jsx("option",{value:t,children:t},t)}function Dd(t){return s.jsx("option",{value:t.value,children:t.label},t.value)}function Td(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{className:"font-normal",children:"AI Edit Tooltip"}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),s.jsx(F,{children:'Enable experimental "Edit with AI" tooltip when selecting code.'})]})}function Ed(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(M,{className:W,children:[s.jsx(T,{className:"font-normal",children:"Real-Time Collaboration"}),s.jsx(A,{children:s.jsx(ie,{"data-testid":"rtc-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),s.jsx(F,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}function _d(t){return s.jsx(Wt,{value:t.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:s.jsxs("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[s.jsx("span",{className:Ze(t.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0"),children:s.jsx(t.Icon,{className:"w-4 h-4"})}),s.jsx("span",{className:"truncate",children:t.label})]})},t.id)}const Ln=Je(!1);function Pd(){const t=H.c(5),e=Kt(Ns),n=Kt(Ln);let r;t[0]!==e||t[1]!==n?(r=a=>{e(a),n(!0)},t[0]=e,t[1]=n,t[2]=r):r=t[2];const i=r;let o;return t[3]!==i?(o={handleClick:i},t[3]=i,t[4]=o):o=t[4],o}const Md=t=>{const e=H.c(32),{showAppConfig:n,disabled:r,tooltip:i}=t,o=n===void 0||n,a=r!==void 0&&r,l=i===void 0?"Settings":i,[c,d]=et(Ln),u=a?"disabled":"hint-green";let g,f,m;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(hr,{strokeWidth:1.8}),e[0]=g):g=e[0],e[1]!==l?(f=s.jsx(qe,{content:l,children:g}),e[1]=l,e[2]=f):f=e[2],e[3]!==a||e[4]!==u||e[5]!==f?(m=s.jsx(Lt,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:a,color:u,children:f}),e[3]=a,e[4]=u,e[5]=f,e[6]=m):m=e[6];const h=m;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs(er,{className:"w-[80vw] h-[70vh] overflow-hidden sm:max-w-5xl top-[15vh] p-0",children:[s.jsx(qo,{children:s.jsx(tr,{children:"User settings"})}),s.jsx(bd,{})]}),e[7]=p):p=e[7];const v=p;if(!o){let R,G;return e[8]!==h?(R=s.jsx(Vo,{children:h}),e[8]=h,e[9]=R):R=e[9],e[10]!==d||e[11]!==c||e[12]!==R?(G=s.jsxs(Vt,{open:c,onOpenChange:d,children:[R,v]}),e[10]=d,e[11]=c,e[12]=R,e[13]=G):G=e[13],G}let x,b,j,C,w,O,N,_,D;return e[14]!==h?(x=s.jsx(Wo,{asChild:!0,children:h}),e[14]=h,e[15]=x):x=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(kc,{}),j=s.jsx("div",{className:"h-px bg-border my-2"}),e[16]=b,e[17]=j):(b=e[16],j=e[17]),e[18]!==d?(C=()=>d(!0),e[18]=d,e[19]=C):C=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(hr,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=w):w=e[20],e[21]!==C?(O=s.jsxs($o,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Ad,children:[b,j,s.jsxs(xe,{onClick:C,variant:"link",className:"px-0",children:[w,"User settings"]})]}),e[21]=C,e[22]=O):O=e[22],e[23]!==O||e[24]!==x?(N=s.jsxs(Ko,{children:[x,O]}),e[23]=O,e[24]=x,e[25]=N):N=e[25],e[26]!==d||e[27]!==c?(_=s.jsx(Vt,{open:c,onOpenChange:d,children:v}),e[26]=d,e[27]=c,e[28]=_):_=e[28],e[29]!==N||e[30]!==_?(D=s.jsxs(s.Fragment,{children:[N,_]}),e[29]=N,e[30]=_,e[31]=D):D=e[31],D};function Ad(t){return t.preventDefault()}const Rd=t=>{const e=H.c(15),{description:n,disabled:r,tooltip:i}=t,o=r!==void 0&&r,a=i===void 0?"Shutdown":i,{openConfirm:l,closeModal:c}=Yo(),{sendShutdown:d}=Ge();let u;e[0]!==d?(u=()=>{d(),setTimeout(Ld,200)},e[0]=d,e[1]=u):u=e[1];const g=u;if(Le())return null;const f=o?"disabled":"red";let m,h,p,v;return e[2]!==c||e[3]!==n||e[4]!==g||e[5]!==l?(m=x=>{x.stopPropagation(),l({title:"Shutdown",description:n,variant:"destructive",confirmAction:s.jsx(Qo,{onClick:()=>{g(),c()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=c,e[3]=n,e[4]=g,e[5]=l,e[6]=m):m=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(yt,{strokeWidth:1}),e[7]=h):h=e[7],e[8]!==o||e[9]!==f||e[10]!==m?(p=s.jsx(Lt,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:f,className:"h-[27px] w-[27px]",disabled:o,onClick:m,children:h}),e[8]=o,e[9]=f,e[10]=m,e[11]=p):p=e[11],e[12]!==p||e[13]!==a?(v=s.jsx(qe,{content:a,children:p}),e[12]=p,e[13]=a,e[14]=v):v=e[14],v};function Ld(){window.close()}function zd(t){window.open(Xo(`?file=${t}`).toString(),"_blank")}export{Jo as A,ea as B,Md as C,ad as D,sa as G,qc as K,oa as L,aa as M,da as P,Rd as S,xc as T,ua as Y,ia as a,fr as b,Lt as c,Qc as d,lt as e,gs as f,bc as g,Bc as h,ps as i,Pd as j,Mn as k,hs as l,Bt as m,fs as n,zd as o,gr as p,pr as q,ks as r,Ln as s,rs as t,yc as u};