@marimo-team/frontend 0.12.1-dev0 → 0.12.1-dev10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-CVsKT6S3.js → ConnectedDataExplorerComponent-CJruiifD.js} +1 -1
- package/dist/assets/{VegaLite-BasL8bOR.js → VegaLite-BE8iaI6d.js} +1 -1
- package/dist/assets/{_baseEach-BxidLc34.js → _baseEach-CHGr95h3.js} +1 -1
- package/dist/assets/_baseMap-CJD4EB23.js +1 -0
- package/dist/assets/{_baseUniq-DRGCPgTu.js → _baseUniq-DBsNFMLI.js} +1 -1
- package/dist/assets/{any-language-editor-ydZB5vW5.js → any-language-editor-C44KD8Jd.js} +1 -1
- package/dist/assets/{architectureDiagram-UYN6MBPD-3uNJsVbm.js → architectureDiagram-UYN6MBPD-BgbOosfX.js} +1 -1
- package/dist/assets/{blockDiagram-ZHA2E4KO-C7O1SDY_.js → blockDiagram-ZHA2E4KO-9FMsNisX.js} +1 -1
- package/dist/assets/{c4Diagram-6F5ED5ID-Ct9ADwNZ.js → c4Diagram-6F5ED5ID-Bbqvpa8H.js} +1 -1
- package/dist/assets/channel-Cr4w4fr-.js +1 -0
- package/dist/assets/{chunk-5HRBRIJM-DCljQIR4.js → chunk-5HRBRIJM-X4M2qmib.js} +1 -1
- package/dist/assets/{chunk-7U56Z5CX-D5wHboSV.js → chunk-7U56Z5CX-C5qQ_O2_.js} +1 -1
- package/dist/assets/{chunk-ASOPGD6M-CYxRhcjL.js → chunk-ASOPGD6M-DewGTxkr.js} +1 -1
- package/dist/assets/{chunk-KFBOBJHC-BlSJa9lw.js → chunk-KFBOBJHC-DOfnAPal.js} +1 -1
- package/dist/assets/{chunk-T2TOU4HS-Bt7XCx8N.js → chunk-T2TOU4HS-DrSTkPX7.js} +1 -1
- package/dist/assets/{chunk-TMUBEWPD-g5OGnScM.js → chunk-TMUBEWPD-D_YLueZ5.js} +1 -1
- package/dist/assets/classDiagram-LNE6IOMH-D--jW1ZB.js +1 -0
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-D--jW1ZB.js +1 -0
- package/dist/assets/clone-D6AulMZy.js +1 -0
- package/dist/assets/{compile-DFYK5xVw.js → compile-Cb-2V0aD.js} +1 -1
- package/dist/assets/{dagre-4EVJKHTY-t_u27lJo.js → dagre-4EVJKHTY-DiF_5n5x.js} +1 -1
- package/dist/assets/{data-editor-C4L34dFt.js → data-editor-CGJ9_7_q.js} +1 -1
- package/dist/assets/{diagram-QW4FP2JN-OlMq8jDO.js → diagram-QW4FP2JN-fVKWzjDQ.js} +1 -1
- package/dist/assets/edit-page-DX4QoMwC.js +8 -0
- package/dist/assets/{erDiagram-6RL3IURR-DRupzzpa.js → erDiagram-6RL3IURR-tkYxbOwJ.js} +1 -1
- package/dist/assets/{flowDiagram-7ASYPVHJ-IbYmgWIO.js → flowDiagram-7ASYPVHJ-wCWrRB02.js} +1 -1
- package/dist/assets/{ganttDiagram-NTVNEXSI-DNXi3Qyf.js → ganttDiagram-NTVNEXSI-CipIDMvM.js} +1 -1
- package/dist/assets/{gitGraph-YCYPL57B-C8bY-sRH.js → gitGraph-YCYPL57B-B2gBFbEc.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NRZ2UAAF-BLuPI92O.js → gitGraphDiagram-NRZ2UAAF-CzfIrjrb.js} +1 -1
- package/dist/assets/{graph-DARHf5FF.js → graph-4-Vg1Aiz.js} +1 -1
- package/dist/assets/{home-page-3jSiUOSU.js → home-page-DHrqvZ5M.js} +1 -1
- package/dist/assets/{index-VBBdVXwI.js → index-BEGeiwsG.js} +1 -1
- package/dist/assets/{index-_8Ks4m3w.js → index-BH9A8KuI.js} +1 -1
- package/dist/assets/{index-CKynd3sK.js → index-BiPdUed2.js} +1 -1
- package/dist/assets/{index-DnH16fnI.js → index-CHAfPpeC.js} +1 -1
- package/dist/assets/{index-DpDaX05Y.js → index-CO1xz3xH.js} +1 -1
- package/dist/assets/{index-B_DpqRlz.js → index-CWohOS_e.js} +1 -1
- package/dist/assets/{index-CH5ughaP.js → index-CYjr_k0H.js} +1 -1
- package/dist/assets/{index-Clh1UGp_.js → index-CZQNf_us.js} +1 -1
- package/dist/assets/{index-CpFE_Q0n.js → index-CkAdNdK9.js} +1 -1
- package/dist/assets/{index-CN_BgDyp.js → index-DKriXlXA.js} +1 -1
- package/dist/assets/{index-z8lXQvfi.js → index-DRtvMp6Z.js} +1 -1
- package/dist/assets/{index-4PVLKZcw.js → index-Ddv63gQw.js} +1 -1
- package/dist/assets/{index-BoTcJdZC.js → index-DoaFBt3g.js} +1 -1
- package/dist/assets/{index-BrP1xDjh.js → index-DuktNpRm.js} +1 -1
- package/dist/assets/{index-DSWQoYBB.js → index-DwShl_Rl.js} +1 -1
- package/dist/assets/{index-BO2M1ddO.js → index-DxHC9_BU.js} +1 -1
- package/dist/assets/index-M-fa6gqH.js +80 -0
- package/dist/assets/{infoDiagram-A4XQUW5V-BlD21afJ.js → infoDiagram-A4XQUW5V-Cq17uMjs.js} +1 -1
- package/dist/assets/{journeyDiagram-G5WM74LC-CwF3jfPt.js → journeyDiagram-G5WM74LC-CTXVfGIj.js} +1 -1
- package/dist/assets/{kanban-definition-QRCXZQQD-XxKBZY6u.js → kanban-definition-QRCXZQQD-ELngktM2.js} +1 -1
- package/dist/assets/{layout-2W-wT2Ws.js → layout-CGBTZO_E.js} +1 -1
- package/dist/assets/{linear-DQcn4dud.js → linear-BbegsqX1.js} +1 -1
- package/dist/assets/{mermaid-CYElsmZp.js → mermaid-NCa4Btby.js} +3 -3
- package/dist/assets/{min--mjCwyM_.js → min-CABlFD1H.js} +1 -1
- package/dist/assets/{mindmap-definition-GWI6TPTV-C7lB29b2.js → mindmap-definition-GWI6TPTV-DLlhxG7q.js} +1 -1
- package/dist/assets/{pieDiagram-YF2LJOPJ-DdOMBTyF.js → pieDiagram-YF2LJOPJ-BPY4ab3U.js} +1 -1
- package/dist/assets/{quadrantDiagram-OS5C2QUG-9roG1Ayx.js → quadrantDiagram-OS5C2QUG-DNcT7n4n.js} +1 -1
- package/dist/assets/{react-plotly-Cpel_TqV.js → react-plotly-D49PuaDp.js} +1 -1
- package/dist/assets/{requirementDiagram-MIRIMTAZ-CVtz6B2A.js → requirementDiagram-MIRIMTAZ-BiwgQpI6.js} +1 -1
- package/dist/assets/{run-page-D1w26f6w.js → run-page-_t2pqoib.js} +1 -1
- package/dist/assets/{sankeyDiagram-Y46BX6SQ-dCiYKdXN.js → sankeyDiagram-Y46BX6SQ-Yek58mqV.js} +1 -1
- package/dist/assets/{sequenceDiagram-G6AWOVSC-C5tloD74.js → sequenceDiagram-G6AWOVSC-CS1ohKZS.js} +1 -1
- package/dist/assets/{slides-component-CM2e6T2v.js → slides-component-BhUqdm2K.js} +1 -1
- package/dist/assets/{sortBy-BIWls_3f.js → sortBy-DeAoOjrt.js} +1 -1
- package/dist/assets/{stateDiagram-MAYHULR4-B-C3z4bX.js → stateDiagram-MAYHULR4-C25IIyJY.js} +1 -1
- package/dist/assets/stateDiagram-v2-4JROLMXI-Du1ne-Iw.js +1 -0
- package/dist/assets/{terminal-dTGgzk51.js → terminal-B5M_jESV.js} +1 -1
- package/dist/assets/{time-BVKBupAc.js → time-Cg9ECQUX.js} +1 -1
- package/dist/assets/{timeline-definition-U7ZMHBDA-CS6loX7O.js → timeline-definition-U7ZMHBDA-bNrrM9Xd.js} +1 -1
- package/dist/assets/{tree-ClIq_Gew.js → tree-DXPs25GO.js} +2 -2
- package/dist/assets/{useMarimoWebSocket-DZ1JodWi.js → useMarimoWebSocket-UUW24I6P.js} +4 -4
- package/dist/assets/{vega-component-B5iZxWjK.js → vega-component-DBMPlOJo.js} +1 -1
- package/dist/assets/{xychartDiagram-6QU3TZC5-YmRCS7TZ.js → xychartDiagram-6QU3TZC5-vQAUXteB.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-Cu7qHcLU.js +0 -1
- package/dist/assets/channel-LBzfy5Qe.js +0 -1
- package/dist/assets/classDiagram-LNE6IOMH-DBtiwBb5.js +0 -1
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-DBtiwBb5.js +0 -1
- package/dist/assets/clone-CrIDEQt7.js +0 -1
- package/dist/assets/edit-page-DZbg6XM8.js +0 -8
- package/dist/assets/index-B-iFJyXq.js +0 -80
- package/dist/assets/stateDiagram-v2-4JROLMXI-C8w2_aHm.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{bM as e,au as t,a$ as n,dX as r,R as i,G as o,
|
|
1
|
+
import{bM as e,au as t,a$ as n,dX as r,R as i,G as o,eY as s,O as a,bh as l,a7 as c,bt as u,di as d,aB as h,eZ as f,J as p,cp as g,ab as m,e_ as v,dN as y,es as x,e$ as b,b1 as j,f0 as w,f1 as I,av as S,f2 as O,f3 as k,f4 as C,f5 as N,f6 as D,bT as E,f7 as T,a3 as _,bn as P,bl as A,bC as M,Z as R,df as L,eb as F,a4 as H,a2 as z,f8 as U,f9 as B,fa as q,fb as V,fc as W,fd as G,fe as K,ff as Y,fg as $,fh as X,fi as Z,dt as Q,eC as J,fj as ee,fk as te,fl as ne,fm as re,at as ie,K as oe,fn as se,b0 as ae,fo as le,aw as ce,dB as ue,fp as de,fq as he,bA as fe,fr as pe,fs as ge,ft as me,X as ve,fu as ye,fv as xe,_ as be,$ as je,a0 as we,ap as Ie,fw as Se,fx as Oe,fy as ke,fz as Ce,bi as Ne,fA as De,fB as Ee,fC as Te,ar as _e,fD as Pe,fE as Ae,fF as Me,fG as Re,fH as Le,fI as Fe,fJ as He,fK as ze,fL as Ue,fM as Be,fN as qe,fO as Ve,fP as We,fQ as Ge,fR as Ke,fS as Ye,fT as $e,fU as Xe,fV as Ze,fW as Qe,bB as Je,fX as et,fY as tt,dc as nt,eX as rt,fZ as it,bP as ot,f_ as st,f$ as at,eq as lt,g0 as ct,g1 as ut,g2 as dt,g3 as ht,Y as ft,g4 as pt,g5 as gt,g6 as mt,g7 as vt,g8 as yt}from"./index-M-fa6gqH.js";import{e as xt}from"./index-BH9A8KuI.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license lucide-react v0.476.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
const bt=n("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"}]]),jt=n("BookMarked",[["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"}]]),wt=n("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"}]]),It=n("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"}]]),St=n("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Ot=n("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]),kt=n("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]),Ct=n("FlaskConical",[["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"}]]),Nt=n("FolderCog",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v3.3",key:"1k8050"}],["path",{d:"m21.7 19.4-.9-.3",key:"1qgwi9"}],["path",{d:"m15.2 16.9-.9-.3",key:"1t7mvx"}],["path",{d:"m16.6 21.7.3-.9",key:"1j67ps"}],["path",{d:"m19.1 15.2.3-.9",key:"18r7jp"}],["path",{d:"m19.6 21.7-.4-1",key:"z2vh2"}],["path",{d:"m16.8 15.3-.4-1",key:"1ei7r6"}],["path",{d:"m14.3 19.6 1-.4",key:"11sv9r"}],["path",{d:"m20.7 16.8 1-.4",key:"19m87a"}]]),Dt=n("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"}]]),Et=n("Grid3x3",[["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"}]]),Tt=n("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"}]]),_t=n("MessagesSquare",[["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"}]]),Pt=n("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"}]]),At=n("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"}]]),Mt=n("PowerOff",[["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"}]]),Rt=n("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 Lt(e,t){return(Lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Ft(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}const Ht=r("flex items-center justify-center m-0 leading-none font-medium border border-foreground/10 shadow-xsSolid 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"},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"}}),zt=r("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-none text-[hsl(0, 0%, 43.5%)] bg-transparent hover:bg-background focus:bg-background"),Ut=i.forwardRef(((e,t)=>{const n=o.c(15);let r,i,l,c,u,d,h;return n[0]!==e?(({color:i,shape:c,size:u,className:r,...l}=e),n[0]=e,n[1]=r,n[2]=i,n[3]=l,n[4]=c,n[5]=u):(r=n[1],i=n[2],l=n[3],c=n[4],u=n[5]),n[6]!==r||n[7]!==i||n[8]!==c||n[9]!==u?(d=s(Ht({color:i,shape:c,size:u}),r),n[6]=r,n[7]=i,n[8]=c,n[9]=u,n[10]=d):d=n[10],n[11]!==l||n[12]!==t||n[13]!==d?(h=a.jsx("button",{ref:t,className:d,...l,children:l.children}),n[11]=l,n[12]=t,n[13]=d,n[14]=h):h=n[14],h}));Ut.displayName="Button";i.forwardRef(((e,t)=>{const n=o.c(9);let r,i,l,c;return n[0]!==e?(({className:r,...i}=e),n[0]=e,n[1]=r,n[2]=i):(r=n[1],i=n[2]),n[3]!==r?(l=s(zt(),r),n[3]=r,n[4]=l):l=n[4],n[5]!==i||n[6]!==t||n[7]!==l?(c=a.jsx("input",{ref:t,className:l,...i}),n[5]=i,n[6]=t,n[7]=l,n[8]=c):c=n[8],c})).displayName="Input";const Bt=e=>{const t=o.c(7),{openConfirm:n,closeModal:r}=l(),i=qt;if(c())return null;let s,f,p;return t[0]!==r||t[1]!==n||t[2]!==e.description?(s=t=>{t.stopPropagation(),n({title:"Shutdown",description:e.description,variant:"destructive",confirmAction:a.jsx(u,{onClick:e=>{i(),r()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},t[0]=r,t[1]=n,t[2]=e.description,t[3]=s):s=t[3],t[4]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(d,{strokeWidth:1}),t[4]=f):f=t[4],t[5]!==s?(p=a.jsx(h,{content:"Shutdown",children:a.jsx(Ut,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:"red",className:"h-[27px] w-[27px]",onClick:s,children:f})}),t[5]=s,t[6]=p):p=t[6],p};function Vt(){window.close()}function qt(){f(),setTimeout(Vt,200)}function Wt(e,t){const n=o.c(11),{delayMs:r,whenVisible:i,disabled:s}=t,a=void 0!==s&&s,l=p.useRef();let c,u,d,h,f;return n[0]!==e?(c=()=>{l.current=e},u=[e],n[0]=e,n[1]=c,n[2]=u):(c=n[1],u=n[2]),p.useEffect(c,u),n[3]!==r||n[4]!==a||n[5]!==i?(d=()=>{if(null===r||a)return;const e=setInterval((()=>{var e;i&&"visible"!==document.visibilityState||null==(e=l.current)||e.call(l)}),r);return()=>clearInterval(e)},h=[r,i,a],n[3]=r,n[4]=a,n[5]=i,n[6]=d,n[7]=h):(d=n[6],h=n[7]),p.useEffect(d,h),n[8]!==a||n[9]!==i?(f=()=>{var e;"visible"===document.visibilityState&&i&&!a&&(null==(e=l.current)||e.call(l))},n[8]=a,n[9]=i,n[10]=f):f=n[10],g(document,"visibilitychange",f),null}const Gt=e=>{const t=o.c(2),{children:n}=e;let r;return t[0]!==n?(r=a.jsx("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:n}),t[0]=n,t[1]=r):r=t[1],r},Kt=e=>{const t=o.c(10);let n,r,i,s,l;return t[0]!==e?(({children:n,className:r,...i}=e),t[0]=e,t[1]=n,t[2]=r,t[3]=i):(n=t[1],r=t[2],i=t[3]),t[4]!==r?(s=m("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",r),t[4]=r,t[5]=s):s=t[5],t[6]!==n||t[7]!==i||t[8]!==s?(l=a.jsx("div",{...i,className:s,children:n}),t[6]=n,t[7]=i,t[8]=s,t[9]=l):l=t[9],l},Yt=e=>{const t=o.c(2),{children:n}=e;let r;return t[0]!==n?(r=a.jsx("p",{className:"text-sm text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1],r},$t="marimo:copilot:signedIn",Xt=j($t,null,void 0,{getOnInit:!0}),Zt=x(null),Qt=x(null);function Jt(){const e="true"===localStorage.getItem($t),t=v();return e&&"github"===t.completion.copilot}class en extends I{constructor(...n){super(...n),this.documentVersion=0,this.getCompletionInternal=async(e,t)=>await this._request("getCompletions",{doc:{...e.doc,version:t}}),this.throttledGetCompletionInternal=function(n,r,i){var o=!0,s=!0;if("function"!=typeof n)throw new TypeError("Expected a function");return e(i)&&(o="leading"in i?!!i.leading:o,s="trailing"in i?!!i.trailing:s),t(n,r,{leading:o,maxWait:r,trailing:s})}(this.getCompletionInternal,200)}async _request(e,t){try{return await this.request(e,t)}catch(n){throw S.error("CopilotLanguageServerClient#request: Error",n),n}}isDisabled(){return!Jt()}async textDocumentDidOpen(e){return this.isDisabled()?e:super.textDocumentDidOpen(e)}async textDocumentCompletion(e){return[]}async textDocumentDidChange(e){return this.isDisabled()?e:super.textDocumentDidChange({...e,contentChanges:[{text:k(e.contentChanges[0].text)}],textDocument:O.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){S.log("Copilot#signInInitiate: Starting sign-in flow");try{const e=await this._request("signInInitiate",{});return S.log("Copilot#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw S.warn("Copilot#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){S.log("Copilot#signInConfirm: Confirming sign-in");try{const t=await this._request("signInConfirm",e);return S.log("Copilot#signInConfirm: Sign-in confirmed successfully"),t}catch(t){throw S.warn("Copilot#signInConfirm: Failed to confirm sign-in",t),t}}async signedIn(){try{const{status:e}=await this._request("checkStatus",{});return S.log("Copilot#signedIn: Status check completed",{status:e}),"SignedIn"===e||"AlreadySignedIn"===e||"OK"===e}catch(e){throw S.warn("Copilot#signedIn: Failed to check sign-in status",e),e}}acceptCompletion(e){return this._request("notifyAccepted",e)}rejectCompletions(e){return this._request("notifyRejected",e)}async getCompletion(e){if(this.isDisabled())return{completions:[]};const t=this.documentVersion;if(e.doc.version=t,0===t)return{completions:[]};var n;n=t,y.set(Qt,n);const r=await this.throttledGetCompletionInternal(e,t);var i;return i=t,y.get(Qt)===i&&y.set(Qt,null),t!==this.documentVersion?{completions:[]}:r||{completions:[]}}}var tn=C();async function nn(e){return new Promise(((t,n)=>{const r=new WebSocket(e);r.onopen=()=>{r.close(),t(e)},r.onerror=t=>{r.close(),n(new Error(`Failed to connect to ${e}: ${t.type}`))}}))}const rn="/__marimo_copilot__.py",on="copilot",sn=`file://${rn}`,an=D((()=>new ln));class ln extends tn.Transport{constructor(){super(),this.delegate=void 0,this.WS_URL=E("lsp/copilot"),this.delegate=void 0}async tryConnect(e=3,t=1e3){for(let r=1;r<=e;r++)try{return this.delegate||(this.delegate=new T.WebSocketTransport(this.WS_URL)),await this.delegate.connect(),void S.log("Copilot#connect: Connected successfully")}catch(n){if(S.warn(`Copilot#connect: Connection attempt ${r}/${e} failed`,n),r===e)throw this.delegate=void 0,_({variant:"danger",title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Please check settings and try again."}),n;await new Promise((e=>setTimeout(e,t)))}}async connect(){return await b(w,(e=>"github"===e.completion.copilot)),await async function(e,t=5){for(let n=0;n<t;n++)try{return await nn(e)}catch{await new Promise((e=>setTimeout(e,1e3*(n+1))))}throw new Error(`Failed to connect to ${e}`)}(this.WS_URL,3),this.tryConnect()}close(){var e;null==(e=this.delegate)||e.close(),this.delegate=void 0}async sendData(e,t){var n;return t=Math.min(t??5e3,5e3),null==(n=this.delegate)?void 0:n.sendData(e,t)}}const cn=D((()=>new en({rootUri:sn,workspaceFolders:null,transport:an()})));function un(){return N({documentUri:sn,client:cn(),languageId:on,hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1})}const dn=x(!1);function hn(){const e=o.c(5),t=P(Hn),n=P(dn);let r;e[0]!==t||e[1]!==n?(r=e=>{t(e),n(!0)},e[0]=t,e[1]=n,e[2]=r):r=e[2];const i=r;let s;return e[3]!==i?(s={handleClick:i},e[3]=i,e[4]=s):s=e[4],s}const fn=p.memo((()=>{const[e,t]=A(Xt),[n,r]=A(Zt),{handleClick:i}=hn(),[o,s]=p.useState(),[l,c]=p.useState(!1),u=async e=>{e.preventDefault(),c(!0);try{const e=cn(),{verificationUri:n,status:i,userCode:o}=await e.signInInitiate();"OK"===i||"AlreadySignedIn"===i?t(!0):(r("signingIn"),s({url:n,code:o}))}finally{c(!1)}},h=async e=>{if(e.preventDefault(),!o)return;const n=cn();try{c(!0),S.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");const{status:e}=await n.signInConfirm({userCode:o.code});"OK"===e||"AlreadySignedIn"===e?(S.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),t(!0),r("signedIn")):(S.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:e}),r("signInFailed"))}catch(s){if(S.warn("Copilot#tryFinishSignIn: Initial sign-in confirmation failed, attempting retries"),s instanceof Error&&(s.message.includes("ECONNREFUSED")||s.message.includes("WebSocket")||s.message.includes("network")))return S.error("Copilot#tryFinishSignIn: Connection error during sign-in",s),r("connectionError"),void _({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:a.jsx(R,{onClick:u,children:"Retry"})});for(let e=0;e<3;e++)try{await new Promise((e=>setTimeout(e,1e3)));if(await n.signedIn())return S.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),t(!0),void r("signedIn")}catch(l){if(S.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:e+1,maxRetries:3}),l instanceof Error&&(l.message.includes("ECONNREFUSED")||l.message.includes("WebSocket")||l.message.includes("network")))return r("connectionError"),void _({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please check settings and try again.",variant:"danger",action:a.jsx(R,{variant:"link",onClick:()=>i("ai"),children:"Settings"})})}S.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),r("signInFailed")}finally{c(!1)}},f=async e=>{e.preventDefault();const n=cn();t(!1),r("signedOut"),await n.signOut()};return(()=>{switch(n??(e?"signedIn":"connecting")){case"connecting":return a.jsx(M,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return a.jsx(R,{onClick:u,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return a.jsxs("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[a.jsx("li",{children:a.jsxs("div",{className:"flex items-center",children:["Copy this code:",a.jsx("strong",{className:"ml-2",children:null==o?void 0:o.code}),a.jsx(H,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{o&&(await z(o.code),_({description:"Copied to clipboard"}))}})]})}),a.jsxs("li",{children:["Enter the code at this link:",a.jsx("a",{href:null==o?void 0:o.url,target:"_blank",rel:"noreferrer",className:U({variant:"link",size:"xs"}),children:null==o?void 0:o.url})]}),a.jsxs("li",{children:["Click here when done:",a.jsxs(R,{size:"xs",onClick:h,className:"ml-1",children:[l&&a.jsx(F,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),l?a.jsx(F,{className:"h-3 w-3 mr-1 animate-spin"}):a.jsx(R,{onClick:u,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return a.jsxs("div",{className:"flex items-center gap-5",children:[a.jsxs(M,{className:"font-normal flex items-center",children:[a.jsx("div",{className:"inline-flex items-center justify-center bg-[var(--grass-7)] rounded-full p-1 mr-2",children:a.jsx(L,{className:"h-3 w-3 text-white"})}),"Connected"]}),a.jsx(R,{onClick:f,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs(M,{className:"font-normal flex",children:[a.jsx(d,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),a.jsx("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),a.jsx(R,{onClick:u,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs(M,{className:"font-normal flex",children:[a.jsx(d,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),a.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",a.jsx("a",{className:"hyperlink",href:"https://docs.marimo.io/getting_started/index.html#github-copilot",target:"_blank",rel:"noreferrer",children:"docs"}),"."]})]})}})()}));var pn;fn.displayName="CopilotConfig";const gn=D((()=>{$.defineAction("goToDefinition",(e=>{const t=e.cm6;return X(t)})),$.mapCommand("gd","action","goToDefinition",{},{context:"normal"})}));class mn{constructor(){this.instances=new Set,this.isBroadcasting=!1}addInstance(e){this.instances.add(e);const t=Z(e);t?t.on("vim-mode-change",(t=>{var n;this.isBroadcasting||(Q("mode"in t,'Expected event to have a "mode" property'),this.isBroadcasting=!0,n=()=>{this.broadcastModeChange(e,t.mode,t.subMode),this.isBroadcasting=!1},"scheduler"in window?window.scheduler.postTask(n,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(n):setTimeout(n,0))})):S.warn("Expected CodeMirror instance to have CodeMirror instance state")}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,t,n){Q("exitInsertMode"in $,"Vim does not have an exitInsertMode method"),Q("exitVisualMode"in $,"Vim does not have an exitVisualMode method");for(const r of this.instances)if(r!==e){const e=Z(r);if(!e){S.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}const n=e.setSelections.bind(e);e.setSelections=()=>[];const i=e.state.vim;if(!i){S.warn("Expected CodeMirror instance to have Vim state");continue}switch(t){case"normal":i.insertMode&&$.exitInsertMode(e,!0),i.visualMode&&$.exitVisualMode(e,!0);break;case"insert":i.insertMode||$.handleKey(e,"i","")}e.setSelections=n}}}pn=mn,mn.INSTANCES=new pn;const vn=["default","vim"];function yn(e){switch(e.preset){case"default":return[B.of(re),ee.low(B.of([{key:"Escape",preventDefault:!0,run:e=>(e.contentDOM.blur(),!0)}]))];case"vim":return[B.of(xn()),B.of([{key:"Enter",run:e=>{var t;const n=Z(e);return!!(null==(t=null==n?void 0:n.state.vim)?void 0:t.insertMode)&&ne(e)}}]),ee.high(bn("d",(e=>""===e.state.doc.toString()),(e=>{if(""===e.state.doc.toString()){return e.state.facet(G).deleteCell(),!0}return!1}))),te({status:!1}),ee.high((gn(),[B.of([{key:"j",run:e=>{if(q(e,!0)&&W(e)){const t=e.state.facet(G),n=e.state.facet(K);return t.moveToNextCell({cellId:n,before:!1,noCreate:!0}),!0}return!1}}]),B.of([{key:"k",run:e=>{if(Y(e)&&W(e)){const t=e.state.facet(G),n=e.state.facet(K);return t.moveToNextCell({cellId:n,before:!0,noCreate:!0}),!0}return!1}}]),V.define((e=>(requestAnimationFrame((()=>{mn.INSTANCES.addInstance(e)})),{destroy(){mn.INSTANCES.removeInstance(e)}})))]))];default:return J(e.preset),[]}}const xn=D((()=>{const e=new Set(["Enter","Ctrl-v"]);return re.filter((t=>!e.has(t.key||t.mac||t.linux||t.win||"")))}));function bn(e,t,n){let r="",i=0;return B.of([{any:(o,s)=>{const a=s.key,l=s.timeStamp;if(a!==e||!t(o))return r="",i=0,!1;if(r===e&&l-i<500){if(n(o))return r="",i=0,!0}return r=a,i=l,!1}}])}function jn(){return["compact","medium","full","columns"]}const wn=x({});function In(){return oe(wn)}function Sn(e,t){const n=o.c(13),{registerAction:r,unregisterAction:i}=function(){const e=P(wn);return{registerAction:ie(((t,n)=>{e((e=>({...e,[t]:n})))})),unregisterAction:ie((t=>{e((e=>{const{[t]:n,...r}=e;return r}))}))}}(),s=oe(se),a=t===ae.NOOP;let l;n[0]!==t?(l=e=>t(e),n[0]=t,n[1]=l):l=n[1];const c=ie(l);let u;n[2]!==t||n[3]!==s||n[4]!==e?(u=n=>{const r=s.getHotkey(e).key;if(le(r)(n)){!1!==t(n)&&(n.preventDefault(),n.stopPropagation())}},n[2]=t,n[3]=s,n[4]=e,n[5]=u):u=n[5];const d=ie(u);let h,f;g(document,"keydown",d),n[6]!==a||n[7]!==c||n[8]!==r||n[9]!==e||n[10]!==i?(h=()=>{if(!a)return r(e,c),()=>i(e)},f=[c,e,a,r,i],n[6]=a,n[7]=c,n[8]=r,n[9]=e,n[10]=i,n[11]=h,n[12]=f):(h=n[11],f=n[12]),p.useEffect(h,f)}function On(e,t){const n=o.c(3),r=oe(se);let i;n[0]!==t||n[1]!==r?(i=e=>{for(const[n,i]of ce.entries(t)){if(void 0===i)continue;const t=r.getHotkey(n).key;if(le(t)(e)){S.debug("Satisfied",t,e);!1!==i(e)&&(e.preventDefault(),e.stopPropagation())}}},n[0]=t,n[1]=r,n[2]=i):i=n[2],g(e,"keydown",i)}function kn(e,t){const n=o.c(2);let r;n[0]!==t?(r=e=>{for(const[n,r]of ce.entries(t))if(le(n)(e)){S.debug("Satisfied",n,e);!1!==r(e)&&(e.preventDefault(),e.stopPropagation())}},n[0]=t,n[1]=r):r=n[1],g(e,"keydown",r)}const Cn=x(!1),Nn=()=>{const e=o.c(78),[t,n]=A(Cn),[r,i]=p.useState(null);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[l,c]=p.useState(s),[u,h]=ue(),f=oe(se);let g,m;e[1]!==n?(g=()=>n(Dn),e[1]=n,e[2]=g):g=e[2],Sn("global.showHelp",g),e[3]!==u||e[4]!==h?(m=async e=>{const t={...u};h(e),await de({config:e}).catch((e=>{throw h(t),e}))},e[3]=u,e[4]=h,e[5]=m):m=e[5];const v=m;let y;e[6]!==u||e[7]!==r||e[8]!==v?(y=async e=>{if(!r)return;const t=e.join("-"),n={...u,keymap:{...u.keymap,overrides:{...u.keymap.overrides,[r]:t}}};i(null),c([]),await v(n)},e[6]=u,e[7]=r,e[8]=v,e[9]=y):y=e[9];const x=y;let b;e[10]!==u||e[11]!==r||e[12]!==v?(b=async()=>{if(!r)return;const e={...u,keymap:{...u.keymap,overrides:{...u.keymap.overrides}}};delete e.keymap.overrides[r],i(null),c([]),await v(e)},e[10]=u,e[11]=r,e[12]=v,e[13]=b):b=e[13];const j=b;let w;e[14]!==u||e[15]!==v?(w=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;const e={...u,keymap:{...u.keymap,overrides:{}}};i(null),c([]),await v(e)},e[14]=u,e[15]=v,e[16]=w):w=e[16];const I=w;if(!t)return null;let S;e[17]!==r||e[18]!==x||e[19]!==j||e[20]!==f||e[21]!==l?(S=e=>{const t=f.getHotkey(e);if(r===e){const n=he(e);return a.jsxs("div",{children:[a.jsx(fe,{defaultValue:l.join("+"),placeholder:t.name,onKeyDown:e=>{e.preventDefault();const t=[];if("Meta"===e.key||"Control"===e.key||"Alt"===e.key||"Shift"===e.key)return;if(e.metaKey&&t.push(pe()?"Cmd":"Meta"),e.ctrlKey&&t.push("Ctrl"),e.altKey&&t.push("Alt"),e.shiftKey&&t.push("Shift"),"-"===e.key)return;if("Escape"===e.key&&0===t.length)return i(null),void c([]);let n=e.key.toLowerCase();" "===e.key&&(n="Space"),t.push(n),x(t)},autoFocus:!0,endAdornment:a.jsx(R,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{i(null),c([])},children:a.jsx(d,{className:"w-4 h-4"})})}),a.jsxs("div",{className:"flex items-center justify-between w-full",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),n.key!==t.key&&a.jsxs("span",{className:"text-xs cursor-pointer text-primary",onClick:j,children:["Reset to default:"," ",a.jsx("span",{className:"font-mono",children:n.key})]})]})]},e)}return a.jsxs("div",{className:"grid grid-cols-[auto,2fr,3fr] gap-2 items-center",children:[f.isEditable(e)?a.jsx(ge,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{c([]),i(e)}}):a.jsx("div",{className:"w-3 h-3"}),a.jsx(me,{className:"justify-end",shortcut:t.key}),a.jsx("span",{children:t.name.toLowerCase()})]},e)},e[17]=r,e[18]=x,e[19]=j,e[20]=f,e[21]=l,e[22]=S):S=e[22];const O=S;let k,C,N,D,E,T,_,P,M,L,F,H,z,U,B,V,q,W,G,K,Y,$,X,Z;if(e[23]!==f||e[24]!==t||e[25]!==O||e[26]!==n){const r=f.getHotkeyGroups(),i=e=>{const t=r[e];return a.jsxs("div",{className:"mb-[40px] gap-2 flex flex-col",children:[a.jsx("h3",{className:"text-lg font-medium",children:e}),t.map((e=>O(e)))]})};N=ve,z=t,e[44]!==n?(U=e=>n(e),e[44]=n,e[45]=U):U=e[45],C=ye,F="sm:items-center sm:top-0",e[46]===Symbol.for("react.memo_cache_sentinel")?(H=a.jsx(xe,{}),e[46]=H):H=e[46],k=be,P=!1,M="max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",e[47]===Symbol.for("react.memo_cache_sentinel")?(L=a.jsx(je,{children:a.jsx(we,{children:"Shortcuts"})}),e[47]=L):L=e[47],T="flex flex-row gap-3",_=a.jsxs("div",{className:"w-1/2",children:[i("Editing"),i("Markdown")]}),B="w-1/2",V=i("Navigation"),q=i("Running Cells"),D=i("Creation and Ordering"),E=i("Other"),e[23]=f,e[24]=t,e[25]=O,e[26]=n,e[27]=k,e[28]=C,e[29]=N,e[30]=D,e[31]=E,e[32]=T,e[33]=_,e[34]=P,e[35]=M,e[36]=L,e[37]=F,e[38]=H,e[39]=z,e[40]=U,e[41]=B,e[42]=V,e[43]=q}else k=e[27],C=e[28],N=e[29],D=e[30],E=e[31],T=e[32],_=e[33],P=e[34],M=e[35],L=e[36],F=e[37],H=e[38],z=e[39],U=e[40],B=e[41],V=e[42],q=e[43];return e[48]===Symbol.for("react.memo_cache_sentinel")?(W=a.jsx("span",{className:"text-destructive",children:"Reset all to default"}),e[48]=W):W=e[48],e[49]!==I?(G=a.jsx(R,{className:"mt-4 hover:bg-destructive/10 hover:border-destructive",variant:"outline",size:"xs",onClick:I,tabIndex:-1,children:W}),e[49]=I,e[50]=G):G=e[50],e[51]!==D||e[52]!==E||e[53]!==G||e[54]!==B||e[55]!==V||e[56]!==q?(K=a.jsxs("div",{className:B,children:[V,q,D,E,G]}),e[51]=D,e[52]=E,e[53]=G,e[54]=B,e[55]=V,e[56]=q,e[57]=K):K=e[57],e[58]!==T||e[59]!==_||e[60]!==K?(Y=a.jsxs("div",{className:T,children:[_,K]}),e[58]=T,e[59]=_,e[60]=K,e[61]=Y):Y=e[61],e[62]!==k||e[63]!==P||e[64]!==M||e[65]!==L||e[66]!==Y?($=a.jsxs(k,{usePortal:P,className:M,children:[L,Y]}),e[62]=k,e[63]=P,e[64]=M,e[65]=L,e[66]=Y,e[67]=$):$=e[67],e[68]!==C||e[69]!==F||e[70]!==H||e[71]!==$?(X=a.jsxs(C,{className:F,children:[H,$]}),e[68]=C,e[69]=F,e[70]=H,e[71]=$,e[72]=X):X=e[72],e[73]!==N||e[74]!==z||e[75]!==U||e[76]!==X?(Z=a.jsx(N,{open:z,onOpenChange:U,children:X}),e[73]=N,e[74]=z,e[75]=U,e[76]=X,e[77]=Z):Z=e[77],Z};function Dn(e){return!e}const En=["claude-3-7-sonnet-20250219","claude-3-5-sonnet-20241022","claude-3-opus","claude-3.5-haiku","claude-3.5-sonnet","deepseek-v3","gemini-2.0-flash-exp","gemini-2.0-flash-thinking-exp","gemini-exp-1206","gpt-3.5-turbo","gpt-4","gpt-4-turbo-2024-04-09","gpt-4o","gpt-4o-mini","o1","o1-mini","o1-preview"],Tn=[{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:[c()?{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"}];Te("lsp")&&Tn.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol"});const _n=()=>{const e=o.c(32),[t]=ue(),n=t.package_management.manager;let r;e[0]!==n?(r=[n],e[0]=n,e[1]=r):r=e[1];const{data:i,loading:s,error:l,reload:c}=Ie(An,r);if(s&&!i){let t;return e[2]===Symbol.for("react.memo_cache_sentinel")?(t=a.jsx(Ne,{size:"medium",centered:!0}),e[2]=t):t=e[2],t}if(l){let t;return e[3]!==l?(t=a.jsx(_e,{error:l}),e[3]=l,e[4]=t):t=e[4],t}let u;e[5]!==(null==i?void 0:i.packages)?(u=(null==i?void 0:i.packages)||[],e[5]=null==i?void 0:i.packages,e[6]=u):u=e[6];const d=u;let h,f,p,g,m,v,y,x,b,j;if(e[7]!==d||e[8]!==n||e[9]!==c){const t=new Set(d.map(Mn));m="flex-1 flex flex-col overflow-hidden gap-2",e[17]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Kt,{children:"Optional Features"}),e[17]=v):v=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",a.jsx("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),e[18]=y):y=e[18],f=Pe,e[19]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(Ae,{children:a.jsxs(Se,{children:[a.jsx(Me,{children:"Dependency"}),a.jsx(Me,{children:"Feature"}),a.jsx(Me,{children:"Status"}),a.jsx(Me,{})]})}),e[19]=g):g=e[19],h=Re,p=Tn.map((e=>{const r=e.packagesRequired.every((e=>t.has(e.name.split("[")[0]))),i=e.packagesRequired.map(Rn).join(", ");return a.jsxs(Se,{className:"text-sm",children:[a.jsx(Oe,{children:e.description}),a.jsx(Oe,{className:"font-mono text-xs",children:i}),a.jsx(Oe,{children:r?a.jsxs("div",{className:"flex items-center",children:[a.jsx(St,{className:"h-4 w-4 text-[var(--grass-10)] mr-2"}),a.jsx("span",{children:"Installed"})]}):a.jsxs("div",{className:"flex items-center",children:[a.jsx(ke,{className:"h-4 w-4 text-[var(--red-10)] mr-2"}),a.jsx(Pn,{packageSpecs:[...e.packagesRequired,...e.additionalPackageInstalls],packageManager:n,onSuccess:c})]})})]},e.id)})),e[7]=d,e[8]=n,e[9]=c,e[10]=h,e[11]=f,e[12]=p,e[13]=g,e[14]=m,e[15]=v,e[16]=y}else h=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=e[16];return e[20]!==h||e[21]!==p?(x=a.jsx(h,{children:p}),e[20]=h,e[21]=p,e[22]=x):x=e[22],e[23]!==f||e[24]!==g||e[25]!==x?(b=a.jsxs(f,{children:[g,x]}),e[23]=f,e[24]=g,e[25]=x,e[26]=b):b=e[26],e[27]!==m||e[28]!==v||e[29]!==y||e[30]!==b?(j=a.jsxs("div",{className:m,children:[v,y,b]}),e[27]=m,e[28]=v,e[29]=y,e[30]=b,e[31]=j):j=e[31],j},Pn=({packageSpecs:e,packageManager:t,onSuccess:n})=>{const[r,o]=i.useState(!1);return a.jsxs(R,{size:"xs",variant:"outline",className:m("text-xs",r&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{o(!0);const t=e.map((e=>e.minVersion?`${e.name}>=${e.minVersion}`:e.name)).join(" "),r=await De({package:t});r.success?(n(),_({title:"Package installed",description:a.jsxs("span",{children:["The packages"," ",a.jsx(Ee,{className:"inline",children:e.map((e=>e.name)).join(", ")})," ","have been added to your environment."]})})):_({title:"Failed to install package",description:r.error,variant:"danger"})}finally{o(!1)}},disabled:r,children:[r?a.jsx(Ne,{size:"small",className:"mr-2 h-3 w-3"}):a.jsx(wt,{className:"mr-2 h-3 w-3"}),"Install with ",t]})};function An(){return Ce()}function Mn(e){return e.name}function Rn(e){return e.name}const Ln="flex flex-row items-center space-x-1 space-y-0",Fn=[{id:"editor",label:"Editor",Icon:ge,className:"bg-[var(--blue-4)]"},{id:"display",label:"Display",Icon:Pt,className:"bg-[var(--grass-4)]"},{id:"packageManagement",label:"Package Management",Icon:At,className:"bg-[var(--red-4)]"},{id:"runtime",label:"Runtime",Icon:kt,className:"bg-[var(--amber-4)]"},{id:"ai",label:"AI",Icon:It,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Nt,className:"bg-[var(--orange-4)]"},{id:"labs",label:"Labs",Icon:Ct,className:"bg-[var(--slate-4)]"}],Hn=x(Fn[0].id),zn=()=>{const e=o.c(41),[t,n]=Le(),r=p.useRef(null),i=P(Cn),[s,l]=A(Hn);let u,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=Fe(He),e[0]=u):u=e[0],e[1]!==t?(d={resolver:u,defaultValues:t},e[1]=t,e[2]=d):d=e[2];const h=ze(d);let f;e[3]!==n?(f=async e=>{await de({config:e}).then((()=>{n(e)}))},e[3]=n,e[4]=f):f=e[4];const g=f;let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=c(),e[5]=m):m=e[5];const v=m;let y;e[6]!==t||e[7]!==h?(y=()=>{const e=h.getValues("completion.copilot");return!1===e?null:"codeium"===e?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-sm text-muted-secondary",children:["To get a Codeium API key, follow"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#codeium-copilot",target:"_blank",rel:"noreferrer",children:"these instructions"}),"."]}),a.jsx(We,{control:h.control,name:"completion.codeium_api_key",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"API Key"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"codeium-api-key-input",className:"m-0 inline-flex",placeholder:"key",...n,value:n.value||""})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.codeium_api_key"})]})}})]}):"github"===e?a.jsx(fn,{}):"custom"===e?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-sm text-muted-secondary",children:"Configure your custom AI completion provider with the following settings."}),a.jsx(We,{control:h.control,name:"completion.model",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Model"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"custom-model-input",className:"m-0 inline-flex",placeholder:"Qwen2.5-Coder-7B",...n,value:n.value||""})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.model"})]})}}),a.jsx(We,{control:h.control,name:"completion.base_url",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Base URL"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"custom-base-url-input",className:"m-0 inline-flex",placeholder:"http://localhost:11434/v1",...n,value:n.value||""})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.base_url"})]})}}),a.jsx(We,{control:h.control,name:"completion.api_key",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"API Key"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"custom-api-key-input",className:"m-0 inline-flex",placeholder:"key",...n,value:n.value||""})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.api_key"})]})}})]}):void 0},e[6]=t,e[7]=h,e[8]=y):y=e[8];const x=y;let b;e[9]!==s||e[10]!==t||e[11]!==h||e[12]!==g||e[13]!==x||e[14]!==l||e[15]!==i?(b=()=>{switch(s){case"editor":return a.jsxs(a.Fragment,{children:[a.jsxs(Un,{title:"Autosave",children:[a.jsx(We,{control:h.control,name:"save.autosave",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Autosave enabled"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"autosave-checkbox",checked:"after_delay"===n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(e?"after_delay":"off")}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"save.autosave"})]})}}),a.jsx(We,{control:h.control,name:"save.autosave_delay",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Autosave delay (seconds)"}),a.jsx(Ye,{children:a.jsx(nt,{"data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:"after_delay"!==h.getValues("save.autosave"),...n,value:n.value/1e3,minValue:1,onChange:e=>{n.onChange(1e3*e),Number.isNaN(e)||g(h.getValues())}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"save.autosave_delay"})]})}})]}),a.jsxs(Un,{title:"Formatting",children:[a.jsx(We,{control:h.control,name:"save.format_on_save",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Format on save"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"format-on-save-checkbox",checked:n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(e)}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"save.format_on_save"})]})}}),a.jsx(We,{control:h.control,name:"formatting.line_length",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Line length"}),a.jsx(Ye,{children:a.jsx(nt,{"data-testid":"line-length-input",className:"m-0 w-24",...n,value:n.value,minValue:1,maxValue:1e3,onChange:e=>{n.onChange(e),Number.isNaN(e)||g(h.getValues())}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"formatting.line_length"})]}),a.jsx(Ze,{children:"Maximum line length when formatting code."})]})}})]}),a.jsx(Un,{title:"Autocomplete",children:a.jsx(We,{control:h.control,name:"completion.activate_on_typing",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Autocomplete"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"autocomplete-checkbox",checked:n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(Boolean(e))}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.activate_on_typing"})]}),a.jsx(Ze,{children:"When unchecked, code completion is still available through a hotkey."}),a.jsx("div",{children:a.jsx(R,{variant:"link",className:"mb-0 px-0",type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),l("ai")},children:"Edit AI autocomplete"})})]})}})}),Te("lsp")&&a.jsxs(Un,{title:"Language Servers",children:[a.jsx(We,{control:h.control,name:"language_servers.pylsp.enabled",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsxs(Ke,{children:[a.jsx(rt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",a.jsx("a",{href:"https://github.com/python-lsp/python-lsp-server",target:"_blank",className:"text-link hover:underline",rel:"noreferrer",children:"pylsp"}),")"]}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"pylsp-checkbox",checked:n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(Boolean(e))}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"language_servers.pylsp.enabled"})]})}}),a.jsxs(Ze,{children:["See the"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/language_server/",target:"_blank",rel:"noreferrer",children:"docs"})," ","for more information about language server support."]}),a.jsx(We,{control:h.control,name:"diagnostics.enabled",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsxs(Ke,{children:[a.jsx(rt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"diagnostics-checkbox",checked:n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(Boolean(e))}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"diagnostics.enabled"})]})}})]}),a.jsx(Un,{title:"Keymap",children:a.jsx(We,{control:h.control,name:"keymap.preset",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Keymap"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"keymap-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:vn.map(Vn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"keymap.preset"})]}),a.jsx("div",{children:a.jsx(R,{variant:"link",className:"mb-0 px-0",type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),i(!0)},children:"Edit Keyboard Shortcuts"})})]})}})})]});case"display":return a.jsxs(a.Fragment,{children:[a.jsxs(Un,{title:"Display",children:[a.jsx(We,{control:h.control,name:"display.default_width",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Default width"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"user-config-width-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(qn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"display.default_width"})]}),a.jsx(Ze,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),a.jsx(We,{control:h.control,name:"display.theme",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Theme"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"theme-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:tt.map(Wn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"display.theme"})]}),a.jsx(Ze,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),a.jsx(We,{control:h.control,name:"display.code_editor_font_size",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Code editor font size (px)"}),a.jsx(Ye,{children:a.jsx("span",{className:"inline-flex mr-2",children:a.jsx(nt,{"data-testid":"code-editor-font-size-input",className:"m-0 w-24",...n,value:n.value,minValue:8,maxValue:32,onChange:e=>{n.onChange(e),g(h.getValues())}})})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"display.code_editor_font_size"})]})}})]}),a.jsxs(Un,{title:"Outputs",children:[a.jsx(We,{control:h.control,name:"display.cell_output",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Cell output area"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"cell-output-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["above","below"].map(Gn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"display.cell_output"})]}),a.jsx(Ze,{children:"Where to display cell's output."})]})}}),a.jsx(We,{control:h.control,name:"display.dataframes",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Dataframe viewer"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"display-dataframes-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(Kn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"display.dataframes"})]}),a.jsx(Ze,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}})]})]});case"packageManagement":return a.jsx(Un,{title:"Package Management",children:a.jsx(We,{control:h.control,disabled:v,name:"package_management.manager",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Manager"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"package-manager-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:et.map(Yn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"package_management.manager"})]}),a.jsxs(Ze,{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"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/package_management.html",target:"_blank",rel:"noreferrer",children:"docs"}),".",a.jsx("br",{}),a.jsx("br",{}),"Running marimo in a"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/package_management.html#running-marimo-in-a-sandbox-environment-uv-only",target:"_blank",rel:"noreferrer",children:"sandboxed environment"})," ","is only supported by ",a.jsx(Ee,{className:"inline",children:"uv"})]})]})}})});case"runtime":return a.jsxs(Un,{title:"Runtime configuration",children:[a.jsx(We,{control:h.control,name:"runtime.auto_instantiate",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Autorun on startup"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"auto-instantiate-checkbox",disabled:n.disabled,checked:n.value,onCheckedChange:n.onChange})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"runtime.auto_instantiate"})]}),a.jsx(Ze,{children:"Whether to automatically run all cells on startup."})]})}}),a.jsx(We,{control:h.control,name:"runtime.on_cell_change",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"On cell change"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"on-cell-change-select",onChange:e=>n.onChange(e.target.value),value:n.value,className:"inline-flex mr-2",children:["lazy","autorun"].map($n)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"runtime.on_cell_change"})]}),a.jsx(Ze,{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.'})]})}}),a.jsx(We,{control:h.control,name:"runtime.auto_reload",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"On module change"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"auto-reload-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:v,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(Xn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"runtime.auto_reload"})]}),a.jsx(Ze,{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.'})]})}}),a.jsxs(Ze,{children:["Learn more in the"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",target:"_blank",rel:"noreferrer",children:"docs"}),"."]})]});case"ai":return a.jsxs(a.Fragment,{children:[a.jsxs(Un,{title:"AI Code Completion",children:[a.jsx("p",{className:"text-sm text-muted-secondary",children:"You may use GitHub Copilot, Codeium, or a custom provider (e.g. Ollama) for AI code completion."}),a.jsx(We,{control:h.control,name:"completion.copilot",render:e=>{const{field:n}=e;return a.jsx("div",{className:"flex flex-col space-y-1",children:a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Provider"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"copilot-select",onChange:e=>{"none"===e.target.value?n.onChange(!1):n.onChange(e.target.value)},value:!0===n.value?"github":!1===n.value?"none":n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["none","github","codeium","custom"].map(Zn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.copilot"})]})})}}),x()]}),a.jsxs(Un,{title:"AI Keys",children:[a.jsx(We,{control:h.control,name:"ai.open_ai.api_key",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"OpenAI API Key"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"ai-openai-api-key-input",className:"m-0 inline-flex",placeholder:"sk-proj...",...n,onChange:e=>{const t=e.target.value;t.includes("*")||n.onChange(t)}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.open_ai.api_key"})]}),a.jsxs(Ze,{children:["Your OpenAI API key from"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://platform.openai.com/account/api-keys",target:"_blank",rel:"noreferrer",children:"platform.openai.com"}),"."]})]})}}),a.jsx(We,{control:h.control,name:"ai.anthropic.api_key",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Anthropic API Key"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"ai-anthropic-api-key-input",className:"m-0 inline-flex",placeholder:"sk-ant...",...n,onChange:e=>{const t=e.target.value;t.includes("*")||n.onChange(t)}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.anthropic.api_key"})]}),a.jsxs(Ze,{children:["Your Anthropic API key from"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://console.anthropic.com/settings/keys",target:"_blank",rel:"noreferrer",children:"console.anthropic.com"}),"."]})]})}}),a.jsx(We,{control:h.control,name:"ai.google.api_key",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Google AI API Key"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"ai-google-api-key-input",className:"m-0 inline-flex",placeholder:"AI...",...n,onChange:e=>{const t=e.target.value;t.includes("*")||n.onChange(t)}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.google.api_key"})]}),a.jsxs(Ze,{children:["Your Google AI API key from"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://aistudio.google.com/app/apikey",target:"_blank",rel:"noreferrer",children:"aistudio.google.com"}),"."]})]})}})]}),a.jsxs(Un,{title:"AI Assist",children:[a.jsxs("p",{className:"text-sm text-muted-secondary",children:["Add an API key to ",a.jsx(Ee,{className:"inline",children:"marimo.toml"})," to activate marimo's AI assistant; see"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/ai_completion.html",target:"_blank",rel:"noreferrer",children:"docs"})," ","for more info."]}),a.jsx(We,{control:h.control,disabled:v,name:"ai.open_ai.base_url",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Base URL"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"ai-base-url-input",className:"m-0 inline-flex",placeholder:"https://api.openai.com/v1",...n})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.open_ai.base_url"})]}),a.jsx(Ze,{children:"This URL can be any OpenAI-compatible API endpoint."})]})}}),a.jsx(We,{control:h.control,disabled:v,name:"ai.open_ai.model",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Model"}),a.jsx(Ye,{children:a.jsx(fe,{list:"ai-model-datalist","data-testid":"ai-model-input",className:"m-0 inline-flex",placeholder:"gpt-4-turbo",...n})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.open_ai.model"})]}),a.jsx("datalist",{id:"ai-model-datalist",children:En.map(Qn)}),a.jsx(Ze,{children:'If the model starts with "claude-", we will use your Anthropic API key. If the model starts with "gemini-", we will use your Google AI API key. Otherwise, we will use your OpenAI API key.'})]})}}),a.jsx(We,{control:h.control,name:"ai.rules",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col",children:[a.jsxs(Ge,{children:[a.jsx(Ke,{children:"Custom Rules"}),a.jsx(Ye,{children:a.jsx(Qe,{"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",...n,value:n.value})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.rules"})]}),a.jsx(Ze,{children:"Custom rules to include in all AI completion prompts."})]})}})]})]});case"optionalDeps":return a.jsx(_n,{});case"labs":return a.jsxs(Un,{title:"Experimental Features",children:[a.jsx("p",{className:"text-sm text-muted-secondary mb-4",children:"⚠️ These features are experimental and may require restarting your notebook to take effect."}),a.jsx(We,{control:h.control,name:"experimental.lsp",render:Jn}),a.jsx(We,{control:h.control,name:"experimental.inline_ai_tooltip",render:er}),a.jsx(We,{control:h.control,name:"experimental.reactive_tests",render:tr}),a.jsx(We,{control:h.control,name:"experimental.toplevel_defs",render:nr})]})}},e[9]=s,e[10]=t,e[11]=h,e[12]=g,e[13]=x,e[14]=l,e[15]=i,e[16]=b):b=e[16];const j=b;let w,I,S;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(Ee,{className:"inline",children:"marimo.toml"}),I=a.jsx("br",{}),e[17]=w,e[18]=I):(w=e[17],I=e[18]),e[19]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsxs("p",{className:"text-muted-secondary",children:["User configuration is stored in ",w,I,"Run ",a.jsx(Ee,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),e[19]=S):S=e[19];const O=S;let k,C,N,D,E,T,_,M,L;return e[20]!==h||e[21]!==g?(k=h.handleSubmit(g),e[20]=h,e[21]=g,e[22]=k):k=e[22],e[23]!==l?(C=e=>l(e),e[23]=l,e[24]=C):C=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(N=Fn.map(rr),e[25]=N):N=e[25],e[26]===Symbol.for("react.memo_cache_sentinel")?(D=a.jsxs(Ue,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[N,a.jsx("div",{className:"p-2 text-xs text-muted-foreground self-start",children:a.jsxs("span",{children:["Version: ",Be()]})}),a.jsx("div",{className:"flex-1"}),!c()&&O]}),e[26]=D):D=e[26],e[27]!==s||e[28]!==C?(E=a.jsx(it,{value:s,onValueChange:C,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:D}),e[27]=s,e[28]=C,e[29]=E):E=e[29],e[30]!==j?(T=j(),e[30]=j,e[31]=T):T=e[31],e[32]!==T?(_=a.jsx("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:T}),e[32]=T,e[33]=_):_=e[33],e[34]!==E||e[35]!==_||e[36]!==k?(M=a.jsxs("form",{ref:r,onChange:k,className:"flex text-pretty overflow-hidden",children:[E,_]}),e[34]=E,e[35]=_,e[36]=k,e[37]=M):M=e[37],e[38]!==h||e[39]!==M?(L=a.jsx(Ve,{...h,children:M}),e[38]=h,e[39]=M,e[40]=L):L=e[40],L},Un=e=>{const t=o.c(5),{title:n,children:r}=e;let i,s;return t[0]!==n?(i=a.jsx(Kt,{children:n}),t[0]=n,t[1]=i):i=t[1],t[2]!==r||t[3]!==i?(s=a.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[i,r]}),t[2]=r,t[3]=i,t[4]=s):s=t[4],s},Bn=e=>{const t=o.c(24),{userConfig:n,name:r}=e;let i;t[0]!==r||t[1]!==n?(i=ot(n,r),t[0]=r,t[1]=n,t[2]=i):i=t[2];const s=i,l=oe(st);let c;t[3]!==r||t[4]!==l?(c=ot(l,r),t[3]=r,t[4]=l,t[5]=c):c=t[5];const u=c;if(null==u)return null;if(s===u)return null;let d,f,p,g;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsxs("span",{children:["This setting is overridden by"," ",a.jsx(Ee,{className:"inline",children:"pyproject.toml"}),"."]}),f=a.jsx("br",{}),t[6]=d,t[7]=f):(d=t[6],f=t[7]),t[8]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsxs("span",{children:["Edit the ",a.jsx(Ee,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),g=a.jsx("br",{}),t[8]=p,t[9]=g):(p=t[8],g=t[9]);const m=String(s);let v,y;t[10]!==m?(v=a.jsxs("span",{children:["User value: ",a.jsx("strong",{children:m})]}),t[10]=m,t[11]=v):v=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx("br",{}),t[12]=y):y=t[12];const x=String(u);let b,j,w;t[13]!==x?(b=a.jsxs("span",{children:["Project value: ",a.jsx("strong",{children:x})]}),t[13]=x,t[14]=b):b=t[14],t[15]!==b||t[16]!==v?(j=a.jsxs(a.Fragment,{children:[d,f,p,g,v,y,b]}),t[15]=b,t[16]=v,t[17]=j):j=t[17],t[18]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(Nt,{className:"w-3 h-3"}),t[18]=w):w=t[18];const I=String(u);let S,O;return t[19]!==I?(S=a.jsxs("span",{className:"text-[var(--amber-12)] text-xs flex items-center gap-1 border rounded px-2 py-1 bg-[var(--amber-2)] border-[var(--amber-6)] ml-1",children:[w,"Overridden by pyproject.toml [",I,"]"]}),t[19]=I,t[20]=S):S=t[20],t[21]!==j||t[22]!==S?(O=a.jsx(h,{content:j,children:S}),t[21]=j,t[22]=S,t[23]=O):O=t[23],O};function Vn(e){return a.jsx("option",{value:e,children:e},e)}function qn(e){return a.jsx("option",{value:e,children:e},e)}function Wn(e){return a.jsx("option",{value:e,children:e},e)}function Gn(e){return a.jsx("option",{value:e,children:e},e)}function Kn(e){return a.jsx("option",{value:e,children:e},e)}function Yn(e){return a.jsx("option",{value:e,children:e},e)}function $n(e){return a.jsx("option",{value:e,children:e},e)}function Xn(e){return a.jsx("option",{value:e,children:e},e)}function Zn(e){return a.jsx("option",{value:e,children:e},e)}function Qn(e){return a.jsx("option",{value:e,children:e},e)}function Jn(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"LSP (Language Server Protocol)"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"inline-ai-checkbox",checked:!0===t.value,onCheckedChange:t.onChange})})]}),a.jsxs(Ze,{children:["Enable experimental LSP support. You will need to have",a.jsx(Ee,{className:"inline",children:"marimo[lsp]"})," installed in your environment to use this. See"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/language_server/",target:"_blank",rel:"noreferrer",children:"docs"})," ","for more info."]})]})}function er(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"AI Edit Tooltip"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"inline-ai-checkbox",checked:!0===t.value,onCheckedChange:t.onChange})})]}),a.jsx(Ze,{children:'Enable experimental "Edit with AI" tooltip when selecting code.'})]})}function tr(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Autorun Unit Tests"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"reactive-test-checkbox",checked:!0===t.value,onCheckedChange:t.onChange})})]}),a.jsx(Ze,{children:"Enable experimental reactive pytest tests in notebook. When a cell contains only test functions and classes, marimo will automatically run relevant tests."})," "]})}function nr(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Library Save Format"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"toplevel-defs-checkbox",checked:!0===t.value,onCheckedChange:t.onChange})})]}),a.jsx(Ze,{children:"Enable saving in an experimental file format for marimo. This will expose functions that are defined in their own cell for function reuse and import by other programs."})," "]})}function rr(e){return a.jsx(qe,{value:e.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:a.jsxs("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[a.jsx("span",{className:m(e.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground flex-shrink-0"),children:a.jsx(e.Icon,{className:"w-4 h-4"})}),a.jsx("span",{className:"truncate",children:e.label})]})},e.id)}const ir=()=>{const e=o.c(27),[t,n]=at();let r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Fe(lt),e[0]=r):r=e[0],e[1]!==t?(i={resolver:r,defaultValues:t},e[1]=t,e[2]=i):i=e[2];const s=ze(i);let l;e[3]!==n?(l=async e=>{await dt({config:e}).then((()=>{n(e)})).catch((()=>{n(e)}))},e[3]=n,e[4]=l):l=e[4];const c=l;let u,d,h,f,g,m,v,y,x,b;return e[5]!==t.width?(u=[t.width],e[5]=t.width,e[6]=u):u=e[6],p.useEffect(or,u),e[7]!==s||e[8]!==c?(d=s.handleSubmit(c),e[7]=s,e[8]=c,e[9]=d):d=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(h=a.jsxs("div",{children:[a.jsx(Gt,{children:"Application Config"}),a.jsx(Yt,{children:"Settings applied to this notebook"})]}),e[10]=h):h=e[10],e[11]!==s.control?(g=a.jsx(We,{control:s.control,name:"width",render:ar}),m=a.jsx(We,{control:s.control,name:"app_title",render:lr}),v=a.jsx(We,{control:s.control,name:"css_file",render:cr}),y=a.jsx(We,{control:s.control,name:"html_head_file",render:ur}),f=a.jsx(We,{control:s.control,name:"auto_download",render:dr}),e[11]=s.control,e[12]=f,e[13]=g,e[14]=m,e[15]=v,e[16]=y):(f=e[12],g=e[13],m=e[14],v=e[15],y=e[16]),e[17]!==f||e[18]!==d||e[19]!==g||e[20]!==m||e[21]!==v||e[22]!==y?(x=a.jsxs("form",{onChange:d,className:"flex flex-col gap-4",children:[h,g,m,v,y,f]}),e[17]=f,e[18]=d,e[19]=g,e[20]=m,e[21]=v,e[22]=y,e[23]=x):x=e[23],e[24]!==s||e[25]!==x?(b=a.jsx(Ve,{...s,children:x}),e[24]=s,e[25]=x,e[26]=b):b=e[26],b};function or(){window.dispatchEvent(new Event("resize"))}function sr(e){return a.jsx("option",{value:e,children:e},e)}function ar(e){const{field:t}=e;return a.jsxs(Ge,{className:"flex flex-row items-center space-x-1 space-y-0",children:[a.jsx(Ke,{children:"Width"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"app-width-select",onChange:e=>t.onChange(e.target.value),value:t.value,disabled:t.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(sr)})}),a.jsx($e,{})]})}function lr(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:"flex flex-row items-center space-x-1 space-y-0",children:[a.jsx(Ke,{children:"App title"}),a.jsx(Ye,{children:a.jsx(fe,{...t,value:t.value??"",onChange:e=>{t.onChange(e.target.value),ct.safeParse(e.target.value).success&&(document.title=e.target.value)}})}),a.jsx($e,{})]}),a.jsx(Ze,{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 cr(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:"flex flex-row items-center space-x-1 space-y-0",children:[a.jsx(Ke,{className:"flex-shrink-0",children:"Custom CSS"}),a.jsx(Ye,{children:a.jsx(fe,{...t,value:t.value??"",placeholder:"custom.css",onChange:e=>{t.onChange(e.target.value),ct.safeParse(e.target.value).success&&(document.title=e.target.value)}})}),a.jsx($e,{})]}),a.jsx(Ze,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function ur(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:"flex flex-row items-center space-x-1 space-y-0",children:[a.jsx(Ke,{className:"flex-shrink-0",children:"HTML Head"}),a.jsx(Ye,{children:a.jsx(fe,{...t,value:t.value??"",placeholder:"head.html",onChange:e=>{t.onChange(e.target.value)}})}),a.jsx($e,{})]}),a.jsxs(Ze,{children:["A filepath to an HTML file to be injected into the"," ",a.jsx(Ee,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function dr(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsx("div",{className:"text-base font-bold text-muted-foreground",children:"Auto-download"}),a.jsxs(Ge,{className:"flex flex-col gap-2",children:[a.jsx(Ye,{children:a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Je,{id:"html-checkbox",checked:t.value.includes("html"),onCheckedChange:()=>{t.onChange(ut(t.value,"html"))}}),a.jsx(Ke,{htmlFor:"html-checkbox",children:"HTML"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Je,{id:"ipynb-checkbox",checked:t.value.includes("ipynb"),onCheckedChange:()=>{t.onChange(ut(t.value,"ipynb"))}}),a.jsx(Ke,{htmlFor:"ipynb-checkbox",children:"IPYNB"})]})]})}),a.jsx($e,{})]}),a.jsxs(Ze,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",a.jsx(Ee,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}const hr=e=>{const t=o.c(20),{showAppConfig:n}=e,r=void 0===n||n,[i,s]=A(dn);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx(Ut,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",color:"hint-green",children:a.jsx(h,{content:"Settings",children:a.jsx(ht,{strokeWidth:1.8})})}),t[0]=l):l=t[0];const c=l;let u;t[1]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(be,{className:"w-[80vw] h-[70vh] overflow-hidden sm:max-w-5xl top-[15vh] p-0",children:a.jsx(zn,{})}),t[1]=u):u=t[1];const d=u;if(!r){let e,n;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(ft,{children:c}),t[2]=e):e=t[2],t[3]!==s||t[4]!==i?(n=a.jsxs(ve,{open:i,onOpenChange:s,children:[e,d]}),t[3]=s,t[4]=i,t[5]=n):n=t[5],n}let f,p,g,m,v,y,x,b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(pt,{asChild:!0,children:c}),t[6]=f):f=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(ir,{}),g=a.jsx("div",{className:"h-px bg-border my-2"}),t[7]=p,t[8]=g):(p=t[7],g=t[8]),t[9]!==s?(m=()=>s(!0),t[9]=s,t[10]=m):m=t[10],t[11]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(ht,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),t[11]=v):v=t[11],t[12]!==m?(y=a.jsxs(gt,{children:[f,a.jsxs(mt,{className:"w-80 overflow-auto",align:"end",side:"bottom",onFocusOutside:fr,children:[p,g,a.jsxs(R,{onClick:m,variant:"link",className:"px-0",children:[v,"User settings"]})]})]}),t[12]=m,t[13]=y):y=t[13],t[14]!==s||t[15]!==i?(x=a.jsx(ve,{open:i,onOpenChange:s,children:d}),t[14]=s,t[15]=i,t[16]=x):x=t[16],t[17]!==x||t[18]!==y?(b=a.jsxs(a.Fragment,{children:[y,x]}),t[17]=x,t[18]=y,t[19]=b):b=t[19],b};function fr(e){return e.preventDefault()}const pr=e=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 448 512",...e,children:a.jsx("path",{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"})}),gr=e=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 640 512",fill:"currentColor",...e,children:a.jsx("path",{d:"M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"})}),mr=p.createContext(null);function vr(){const e=p.useContext(mr);if(null===e)throw new Error("No Tree Api Provided");return e}const yr=p.createContext(null);const xr=p.createContext(null);const br=p.createContext(0);function jr(){p.useContext(br)}function wr(e,t,n){return Math.max(Math.min(e,n),t)}function Ir(e){return e&&e.isLeaf}function Sr(e){return e&&e.isInternal&&!e.isOpen}function Or(e){var t;return e&&e.isOpen&&!(null===(t=e.children)||void 0===t?void 0:t.length)}const kr=(e,t)=>{let n=e;for(;n;){if(n.id===t.id)return!0;n=n.parent}return!1},Cr=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex((t=>t.id===e.id))};function Nr(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let n of e.children){const e=Nr(n,t);if(e)return e}return null}function Dr(e,t){if(t(e),e.children)for(let n of e.children)Dr(n,t)}function Er(e){const t=Ar(e);let n;for(let r=0;r<t.length;++r){if(t[r]===e){n=_r(t,r);break}}null==n||n.focus()}function Tr(e){const t=Ar(e);let n;for(let r=0;r<t.length;++r){if(t[r]===e){n=Pr(t,r);break}}null==n||n.focus()}function _r(e,t){return t+1<e.length?e[t+1]:e[0]}function Pr(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Ar(e){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((t=>t===e||!e.contains(t)))}function Mr(e,t){return"boolean"==typeof t?t:"string"==typeof t?e[t]:t(e)}function Rr(e){return null===e?null:Lr(e)}function Lr(e){return"string"==typeof e?e:e.id}function Fr(e,...t){if(e)return e(...t)}function Hr(e){return new Promise(((t,n)=>{let r=0;!function i(){r+=1,100===r&&n(),e()?t():setTimeout(i,10)}()}))}function zr(e){var t,n;const r=e.focusedNode;return r?r.isOpen?0:r.parent?r.childIndex+1:0:null!==(n=null===(t=e.root.children)||void 0===t?void 0:t.length)&&void 0!==n?n:0}function Ur(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const Br=Object.freeze(Object.defineProperty({__proto__:null,access:Mr,bound:wr,dfs:Nr,focusNextElement:Er,focusPrevElement:Tr,getInsertIndex:zr,getInsertParentId:Ur,identify:Lr,identifyNull:Rr,indexOf:Cr,isClosed:Sr,isDescendant:kr,isItem:Ir,isOpenWithEmptyChildren:Or,mergeRefs:function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}},noop:function(){},safeRun:Fr,waitFor:Hr,walk:Dr},Symbol.toStringTag,{value:"Module"})),Vr={display:"flex",alignItems:"center",zIndex:1},qr={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},Wr={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Gr=i.memo((function({top:e,left:t,indent:n}){const r={position:"absolute",pointerEvents:"none",top:e-2+"px",left:t+"px",right:n+"px"};return a.jsxs("div",{style:Object.assign(Object.assign({},Vr),r),children:[a.jsx("div",{style:Object.assign({},Wr)}),a.jsx("div",{style:Object.assign({},qr)})]})}));function Kr({node:e,attrs:t,innerRef:n,children:r}){return a.jsx("div",Object.assign({},t,{ref:n,onFocus:e=>e.stopPropagation(),onClick:e.handleClick,children:r}))}function Yr(e){return a.jsxs("div",{ref:e.dragHandle,style:e.style,children:[a.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?a.jsx(Xr,Object.assign({},e)):a.jsx($r,Object.assign({},e))]})}function $r(e){return a.jsx(a.Fragment,{children:a.jsx("span",{children:e.node.data.name})})}function Xr({node:e}){const t=p.useRef();return p.useEffect((()=>{var e,n;null===(e=t.current)||void 0===e||e.focus(),null===(n=t.current)||void 0===n||n.select()}),[]),a.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:n=>{var r;"Escape"===n.key&&e.reset(),"Enter"===n.key&&e.submit((null===(r=t.current)||void 0===r?void 0:r.value)||"")}})}function Zr(e){return{type:"EDIT",id:e}}function Qr(e){return{type:"FOCUS",id:e}}class Jr{constructor(e){this.handleClick=e=>{e.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():e.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===ei}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&&!(null===(e=this.prev)||void 0===e?void 0:e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(null===(e=this.next)||void 0===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 null===this.rowIndex?null:this.tree.at(this.rowIndex+1)}get prev(){return null===this.rowIndex?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var e,t;const n=this.childIndex;return null!==(t=null===(e=this.parent)||void 0===e?void 0:e.children[n+1])&&void 0!==t?t:null}isAncestorOf(e){if(!e)return!1;let t=e;for(;t;){if(t.id===this.id)return!0;t=t.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 Jr(Object.assign({},this))}edit(){return this.tree.edit(this)}}const ei="__REACT_ARBORIST_INTERNAL_ROOT__";function ti(e){var t;function n(t,r,i){const o=e.accessId(t),s=new Jr({tree:e,data:t,level:r,parent:i,id:o,children:null,isDraggable:e.isDraggable(t),rowIndex:null}),a=e.accessChildren(t);return a&&(s.children=a.map((e=>n(e,r+1,s)))),s}const r=new Jr({tree:e,id:ei,data:{id:ei},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=null!==(t=e.props.data)&&void 0!==t?t:[];return r.children=i.map((e=>n(e,0,r))),r}const ni={open:(e,t)=>({type:"VISIBILITY_OPEN",id:e,filtered:t}),close:(e,t)=>({type:"VISIBILITY_CLOSE",id:e,filtered:t}),toggle:(e,t)=>({type:"VISIBILITY_TOGGLE",id:e,filtered:t}),clear:e=>({type:"VISIBILITY_CLEAR",filtered:e})};function ri(e={},t){if("VISIBILITY_OPEN"===t.type)return Object.assign(Object.assign({},e),{[t.id]:!0});if("VISIBILITY_CLOSE"===t.type)return Object.assign(Object.assign({},e),{[t.id]:!1});if("VISIBILITY_TOGGLE"===t.type){const n=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!n})}return"VISIBILITY_CLEAR"===t.type?{}:e}const ii=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:null!==(t=null==e?void 0:e.initialOpenState)&&void 0!==t?t:{}},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}}},oi=e=>({type:"SELECTION_ONLY",id:Lr(e)}),si=e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(Lr)}),ai=e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(Lr)}),li=e=>Object.assign({type:"SELECTION_SET"},e),ci=e=>({type:"SELECTION_MOST_RECENT",id:null===e?null:Lr(e)}),ui=e=>({type:"SELECTION_ANCHOR",id:null===e?null:Lr(e)});const di={cursor:e=>({type:"DND_CURSOR",cursor:e}),dragStart:(e,t)=>({type:"DND_DRAG_START",id:e,dragIds:t}),dragEnd:()=>({type:"DND_DRAG_END"}),hovering:(e,t)=>({type:"DND_HOVERING",parentId:e,index:t})};const hi={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},fi=e=>{if(!e)return{display:"none"};const{x:t,y:n}=e;return{transform:`translate(${t}px, ${n}px)`}},pi=e=>{if(!e)return{display:"none"};const{x:t,y:n}=e;return{transform:`translate(${t+10}px, ${n+10}px)`}};function gi({offset:e,mouse:t,id:n,dragIds:r,isDragging:i}){return a.jsxs(mi,{isDragging:i,children:[a.jsx(vi,{offset:e,children:a.jsx(xi,{id:n,dragIds:r})}),a.jsx(yi,{mouse:t,count:r.length})]})}const mi=p.memo((function(e){return e.isDragging?a.jsx("div",{style:hi,children:e.children}):null}));function vi(e){return a.jsx("div",{className:"row preview",style:fi(e.offset),children:e.children})}function yi(e){const{count:t,mouse:n}=e;return t>1?a.jsx("div",{className:"selected-count",style:pi(n),children:t}):null}const xi=p.memo((function(e){const t=vr(),n=t.get(e.id);return n?a.jsx(t.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*t.indent,opacity:.2,background:"transparent"},tree:t}):null}));var bi=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function ji(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],i=t[n],!(r===i||bi(r)&&bi(i)))return!1;var r,i;return!0}function wi(e,t){var n;void 0===t&&(t=ji);var r,i=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&n===this&&t(s,i)||(r=e.apply(this,s),o=!0,n=this,i=s),r}}var Ii="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function Si(e){cancelAnimationFrame(e.id)}var Oi=-1;function ki(e){if(void 0===e&&(e=!1),-1===Oi||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Oi=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Oi}var Ci=null;function Ni(e){if(void 0===e&&(e=!1),null===Ci||e){var t=document.createElement("div"),n=t.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",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Ci="positive-descending":(t.scrollLeft=1,Ci=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),Ci}return Ci}var Di=function(e,t){return e};function Ei(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,o=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,l=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return(t=function(e){var t,d;function h(t){var r;return(r=e.call(this,t)||this)._instanceProps=l(r.props,Ft(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:Ft(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=wi((function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})})),r._callOnScroll=void 0,r._callOnScroll=wi((function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})})),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,o=r.props,s=o.direction,a=o.itemSize,l=o.layout,u=r._getItemStyleCache(c&&a,c&&l,c&&s);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),h=i(r.props,e,r._instanceProps),f="horizontal"===s||"horizontal"===l,p="rtl"===s,g=f?d:0;u[e]=t={position:"absolute",left:p?void 0:g,right:p?g:void 0,top:f?0:d,height:f?"100%":h,width:f?h:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=wi((function(e,t,n){return{}})),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;r.setState((function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,s=i;if("rtl"===t)switch(Ni()){case"negative":s=-i;break;case"positive-descending":s=o-n-i}return s=Math.max(0,Math.min(s,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<s?"forward":"backward",scrollOffset:s,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;r.setState((function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n,i;null!==r._resetIsScrollingTimeoutId&&Si(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=(e=r._resetIsScrolling,t=150,n=Ii(),i={id:requestAnimationFrame((function r(){Ii()-n>=t?e.call(null):i.id=requestAnimationFrame(r)}))})},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1,null)}))},r}d=e,(t=h).prototype=Object.create(d.prototype),t.prototype.constructor=t,Lt(t,d),h.getDerivedStateFromProps=function(e,t){return Ti(e,t),u(e),null};var f=h.prototype;return f.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},f.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,s=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var a=0;if(this._outerRef){var l=this._outerRef;a="vertical"===i?l.scrollWidth>l.clientWidth?ki():0:l.scrollHeight>l.clientHeight?ki():0}this.scrollTo(o(this.props,e,t,s,this._instanceProps,a))},f.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},f.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(Ni()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var s=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-s-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},f.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&Si(this._resetIsScrollingTimeoutId)},f.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,o=e.height,s=e.innerRef,a=e.innerElementType,l=e.innerTagName,c=e.itemCount,u=e.itemData,d=e.itemKey,h=void 0===d?Di:d,f=e.layout,g=e.outerElementType,m=e.outerTagName,v=e.style,y=e.useIsScrolling,x=e.width,b=this.state.isScrolling,j="horizontal"===i||"horizontal"===f,w=j?this._onScrollHorizontal:this._onScrollVertical,I=this._getRangeToRender(),S=I[0],O=I[1],k=[];if(c>0)for(var C=S;C<=O;C++)k.push(p.createElement(t,{data:u,key:h(C,u),index:C,isScrolling:y?b:void 0,style:this._getItemStyle(C)}));var N=r(this.props,this._instanceProps);return p.createElement(g||m||"div",{className:n,onScroll:w,ref:this._outerRefSetter,style:vt({position:"relative",height:o,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},v)},p.createElement(a||l||"div",{children:k,ref:s,style:{height:j?"100%":N,pointerEvents:b?"none":void 0,width:j?N:"100%"}}))},f._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,s=o.scrollDirection,a=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(s,a,l)}},f._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,l=r.scrollOffset;if(0===t)return[0,0,0,0];var c=s(this.props,l,this._instanceProps),u=a(this.props,c,l,this._instanceProps),d=i&&"backward"!==o?1:Math.max(1,n),h=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+h)),c,u]},h}(p.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Ti=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},_i=Ei({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var s=e.direction,a=e.height,l=e.itemCount,c=e.itemSize,u=e.layout,d=e.width,h="horizontal"===s||"horizontal"===u?d:a,f=Math.max(0,l*c-h),p=Math.min(f,t*c),g=Math.max(0,t*c-h+c+o);switch("smart"===n&&(n=r>=g-h&&r<=p+h?"auto":"center"),n){case"start":return p;case"end":return g;case"center":var m=Math.round(g+(p-g)/2);return m<Math.ceil(h/2)?0:m>f+Math.floor(h/2)?f:m;default:return r>=g&&r<=p?r:r<g?g:p}},getStartIndexForOffset:function(e,t){var n=e.itemCount,r=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,i=e.height,o=e.itemCount,s=e.itemSize,a=e.layout,l=e.width,c=t*s,u="horizontal"===r||"horizontal"===a?l:i,d=Math.ceil((u+n-c)/s);return Math.max(0,Math.min(o-1,t+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function Pi(){var e,t;const n=vr(),r=function(){const e=p.useContext(xr);if(null===e)throw new Error("Provide a DnDContext");return e}().cursor;if(!r||"line"!==r.type)return null;const i=n.indent,o=n.rowHeight*r.index+(null!==(t=null!==(e=n.props.padding)&&void 0!==e?e:n.props.paddingTop)&&void 0!==t?t:0),s=i*r.level,l=n.renderCursor;return a.jsx(l,{top:o,left:s,indent:i})}const Ai=p.forwardRef((function(e,t){const{children:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["children"]),i=vr();return a.jsxs("div",Object.assign({ref:t},r,{onClick:e=>{e.currentTarget===e.target&&i.deselectAll()},children:[a.jsx(Mi,{}),n]}))})),Mi=()=>{const e=vr();return a.jsx("div",{style:{height:e.visibleNodes.length*e.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:a.jsx(Pi,{})})};const Ri=p.forwardRef((function(e,t){var n,r,i,o,{style:s}=e,l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["style"]);const c=vr(),u=null!==(r=null!==(n=c.props.padding)&&void 0!==n?n:c.props.paddingTop)&&void 0!==r?r:0,d=null!==(o=null!==(i=c.props.padding)&&void 0!==i?i:c.props.paddingBottom)&&void 0!==o?o:0;return a.jsx("div",Object.assign({ref:t,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+u+d}px`})},l))}));var Li,Fi,Hi=p.createContext({dragDropManager:void 0});function zi(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(!e){var o;if(void 0===t)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;(o=new Error(t.replace(/%s/g,(function(){return r[s++]})))).name="Invariant Violation"}throw o.framesToPop=1,o}}(Fi=Li||(Li={})).SOURCE="SOURCE",Fi.TARGET="TARGET";var Ui="dnd-core/INIT_COORDS",Bi="dnd-core/BEGIN_DRAG",Vi="dnd-core/PUBLISH_DRAG_SOURCE",qi="dnd-core/HOVER",Wi="dnd-core/DROP",Gi="dnd-core/END_DRAG";function Ki(e,t){return{type:Ui,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Yi(e){return(Yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $i(e){return"object"===Yi(e)}var Xi={type:Ui,payload:{clientOffset:null,sourceClientOffset:null}};function Zi(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},r=n.publishSource,i=void 0===r||r,o=n.clientOffset,s=n.getSourceClientOffset,a=e.getMonitor(),l=e.getRegistry();e.dispatch(Ki(o)),function(e,t,n){zi(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){zi(n.getSource(e),"Expected sourceIds to be registered.")}))}(t,a,l);var c=function(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,a);if(null!==c){var u=null;if(o){if(!s)throw new Error("getSourceClientOffset must be defined");!function(e){zi("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(s),u=s(c)}e.dispatch(Ki(o,u));var d=l.getSource(c).beginDrag(a,c);if(null!=d){!function(e){zi($i(e),"Item must be an object.")}(d),l.pinSource(c);var h=l.getSourceType(c);return{type:Bi,payload:{itemType:h,item:d,sourceId:c,clientOffset:o||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}else e.dispatch(Xi)}}function Qi(e){return function(){if(e.getMonitor().isDragging())return{type:Vi}}}function Ji(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function eo(e){return function(t){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset;!function(e){zi(Array.isArray(e),"Expected targetIds to be an array.")}(t);var r=t.slice(0),i=e.getMonitor(),o=e.getRegistry();return function(e,t,n){zi(t.isDragging(),"Cannot call hover while not dragging."),zi(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r<e.length;r++){var i=e[r];zi(e.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array."),zi(n.getTarget(i),"Expected targetIds to be registered.")}}(r,i,o),function(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r];Ji(t.getTargetType(i),n)||e.splice(r,1)}}(r,o,i.getItemType()),function(e,t,n){e.forEach((function(e){n.getTarget(e).hover(t,e)}))}(r,i,o),{type:qi,payload:{targetIds:r,clientOffset:n||null}}}}function to(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function no(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?to(Object(n),!0).forEach((function(t){ro(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):to(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ro(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function io(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.getMonitor(),r=e.getRegistry();!function(e){zi(e.isDragging(),"Cannot call drop while not dragging."),zi(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n);var i=function(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n);i.forEach((function(i,o){var s=function(e,t,n,r){var i=n.getTarget(e),o=i?i.drop(r,e):void 0;(function(e){zi(void 0===e||$i(e),"Drop result must either be an object or undefined.")})(o),void 0===o&&(o=0===t?{}:r.getDropResult());return o}(i,o,r,n),a={type:Wi,payload:{dropResult:no(no({},t),s)}};e.dispatch(a)}))}}function oo(e){return function(){var t=e.getMonitor(),n=e.getRegistry();!function(e){zi(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var r=t.getSourceId();null!=r&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource());return{type:Gi}}}function so(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function ao(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lo=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ao(this,"store",void 0),ao(this,"monitor",void 0),ao(this,"backend",void 0),ao(this,"isSetUp",!1),ao(this,"handleRefCountChange",(function(){var e=r.store.getState().refCount>0;r.backend&&(e&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!e&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))})),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}return so(e,[{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,t=this.store.dispatch;var n=function(e){return{beginDrag:Zi(e),publishDragSource:Qi(e),hover:eo(e),drop:io(e),endDrag:oo(e)}}(this);return Object.keys(n).reduce((function(r,i){var o,s=n[i];return r[i]=(o=s,function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var s=o.apply(e,r);void 0!==s&&t(s)}),r}),{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}]),e}();function co(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var uo="function"==typeof Symbol&&Symbol.observable||"@@observable",ho=function(){return Math.random().toString(36).substring(7).split("").join(".")},fo={INIT:"@@redux/INIT"+ho(),REPLACE:"@@redux/REPLACE"+ho()};function po(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(co(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(co(1));return n(po)(e,t)}if("function"!=typeof e)throw new Error(co(2));var i=e,o=t,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(co(3));return o}function d(e){if("function"!=typeof e)throw new Error(co(4));if(l)throw new Error(co(5));var t=!0;return c(),a.push(e),function(){if(t){if(l)throw new Error(co(6));t=!1,c();var n=a.indexOf(e);a.splice(n,1),s=null}}}function h(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(co(7));if(void 0===e.type)throw new Error(co(8));if(l)throw new Error(co(9));try{l=!0,o=i(o,e)}finally{l=!1}for(var t=s=a,n=0;n<t.length;n++){(0,t[n])()}return e}return h({type:fo.INIT}),(r={dispatch:h,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(co(10));i=e,h({type:fo.REPLACE})}})[uo]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(co(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[uo]=function(){return this},e},r}var go=function(e,t){return e===t};function mo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mo(Object(n),!0).forEach((function(t){yo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xo={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function bo(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xo,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Ui:case Bi:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case qi:return e=n.clientOffset,t=i.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?n:vo(vo({},n),{},{clientOffset:i.clientOffset});case Gi:case Wi:return xo;default:return n}}var jo="dnd-core/ADD_SOURCE",wo="dnd-core/ADD_TARGET",Io="dnd-core/REMOVE_SOURCE",So="dnd-core/REMOVE_TARGET";function Oo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ko(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oo(Object(n),!0).forEach((function(t){Co(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Co(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var No={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Do(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:No,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Bi:return ko(ko({},n),{},{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case Vi:return ko(ko({},n),{},{isSourcePublic:!0});case qi:return ko(ko({},n),{},{targetIds:i.targetIds});case So:return-1===n.targetIds.indexOf(i.targetId)?n:ko(ko({},n),{},{targetIds:(e=n.targetIds,t=i.targetId,e.filter((function(e){return e!==t})))});case Wi:return ko(ko({},n),{},{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case Gi:return ko(ko({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function Eo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case jo:case wo:return e+1;case Io:case So:return e-1;default:return e}}var To=[],_o=[];function Po(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case qi:break;case jo:case wo:case So:case Io:return To;default:return _o}var t=e.payload,n=t.targetIds,r=void 0===n?[]:n,i=t.prevTargetIds,o=void 0===i?[]:i,s=function(e,t){var n=new Map,r=function(e){n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);var i=[];return n.forEach((function(e,t){1===e&&i.push(t)})),i}(r,o),a=s.length>0||!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:go;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(r,o);if(!a)return To;var l=o[o.length-1],c=r[r.length-1];return l!==c&&(l&&s.push(l),c&&s.push(c)),s}function Ao(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}function Mo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ro(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mo(Object(n),!0).forEach((function(t){Lo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fo(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Po(r.dirtyHandlerIds,{type:i.type,payload:Ro(Ro({},i.payload),{},{prevTargetIds:(e=r,t="dragOperation.targetIds",n=[],t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:n||null}),e))})}),dragOffset:bo(r.dragOffset,i),refCount:Eo(r.refCount,i),dragOperation:Do(r.dragOperation,i),stateId:Ao(r.stateId)}}function Ho(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zo(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Uo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}To.__IS_NONE__=!0,_o.__IS_ALL__=!0;var Bo=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Uo(this,"store",void 0),Uo(this,"registry",void 0),this.store=t,this.registry=n}return zo(e,[{key:"subscribeToStateChange",value:function(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0}).handlerIds;zi("function"==typeof e,"listener must be a function."),zi(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");var r=this.store.getState().stateId;return this.store.subscribe((function(){var i=t.store.getState(),o=i.stateId;try{var s=o===r||o===r+1&&!function(e,t){return e!==To&&(e===_o||void 0===t||(n=e,t.filter((function(e){return n.indexOf(e)>-1}))).length>0);var n}(i.dirtyHandlerIds,n);s||e()}finally{r=o}}))}},{key:"subscribeToOffsetChange",value:function(e){var t=this;zi("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset;return this.store.subscribe((function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return zi(t,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return zi(t,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&(Ji(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e))}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return zi(t,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}},{key:"isOverTarget",value:function(e){if(!e)return!1;var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();if(r&&!Ji(n,r))return!1;var i=this.getTargetIds();if(!i.length)return!1;var o=i.indexOf(e);return t?o===i.length-1:o>-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 Boolean(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,r=e.clientOffset,i=e.initialClientOffset,o=e.initialSourceClientOffset,r&&i&&o?Ho((n=o,{x:(t=r).x+n.x,y:t.y+n.y}),i):null;var e,t,n,r,i,o}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,t=e.clientOffset,n=e.initialClientOffset,t&&n?Ho(t,n):null;var e,t,n}}]),e}(),Vo=0;function qo(e){return(qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wo(e,t){t&&Array.isArray(e)?e.forEach((function(e){return Wo(e,!1)})):zi("string"==typeof e||"symbol"===qo(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const Go="undefined"!=typeof global?global:self,Ko=Go.MutationObserver||Go.WebKitMutationObserver;function Yo(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}const $o="function"==typeof Ko?function(e){let t=1;const n=new Ko(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:Yo;class Xo{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const Zo=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=$o(this.flush),this.requestErrorThrow=Yo((()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()}))}},Qo=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new Xo(this.onError,(e=>t[t.length]=e));return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(Zo.registerPendingError);function Jo(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function es(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ts(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ns(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ns(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ns(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rs(e){var t=(Vo++).toString();switch(e){case Li.SOURCE:return"S".concat(t);case Li.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function is(e){switch(e[0]){case"S":return Li.SOURCE;case"T":return Li.TARGET;default:zi(!1,"Cannot parse handler ID: ".concat(e))}}function os(e,t){var n=e.entries(),r=!1;do{var i=n.next(),o=i.done;if(ts(i.value,2)[1]===t)return!0;r=!!o}while(!r);return!1}var ss=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),es(this,"types",new Map),es(this,"dragSources",new Map),es(this,"dropTargets",new Map),es(this,"pinnedSourceId",null),es(this,"pinnedSource",null),es(this,"store",void 0),this.store=t}return Jo(e,[{key:"addSource",value:function(e,t){Wo(e),function(e){zi("function"==typeof e.canDrag,"Expected canDrag to be a function."),zi("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),zi("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);var n=this.addHandler(Li.SOURCE,e,t);return this.store.dispatch(function(e){return{type:jo,payload:{sourceId:e}}}(n)),n}},{key:"addTarget",value:function(e,t){Wo(e,!0),function(e){zi("function"==typeof e.canDrop,"Expected canDrop to be a function."),zi("function"==typeof e.hover,"Expected hover to be a function."),zi("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);var n=this.addHandler(Li.TARGET,e,t);return this.store.dispatch(function(e){return{type:wo,payload:{targetId:e}}}(n)),n}},{key:"containsHandler",value:function(e){return os(this.dragSources,e)||os(this.dropTargets,e)}},{key:"getSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return zi(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return zi(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return zi(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return zi(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return is(e)===Li.SOURCE}},{key:"isTargetId",value:function(e){return is(e)===Li.TARGET}},{key:"removeSource",value:function(e){var t,n=this;zi(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:Io,payload:{sourceId:e}}}(e)),t=function(){n.dragSources.delete(e),n.types.delete(e)},Zo.enqueueTask(Qo.create(t))}},{key:"removeTarget",value:function(e){zi(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:So,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);zi(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){zi(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,n){var r=rs(e);return this.types.set(r,t),e===Li.SOURCE?this.dragSources.set(r,n):e===Li.TARGET&&this.dropTargets.set(r,n),r}}]),e}();function as(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(e){var t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return po(Fo,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(arguments.length>3&&void 0!==arguments[3]&&arguments[3]),i=new Bo(r,new ss(r)),o=new lo(r,i),s=e(o,t,n);return o.receiveBackend(s),o}var ls=["children"];function cs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return us(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return us(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function us(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ds(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var hs=0,fs=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),ps=p.memo((function(e){var t=e.children,n=function(e){if("manager"in e){return[{dragDropManager:e.manager},!1]}var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gs(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t;i[fs]||(i[fs]={dragDropManager:as(e,t,n,r)});return i[fs]}(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}(ds(e,ls)),r=cs(n,2),i=r[0],o=r[1];return p.useEffect((function(){if(o){var e=gs();return++hs,function(){0==--hs&&(e[fs]=null)}}}),[]),a.jsx(Hi.Provider,Object.assign({value:i},{children:t}),void 0)}));function gs(){return"undefined"!=typeof global?global:window}function ms(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function vs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ys=!1,xs=!1,bs=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),vs(this,"internalMonitor",void 0),vs(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return ms(e,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){zi(!ys,"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 ys=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{ys=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;zi(!xs,"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 xs=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{xs=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{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()}}]),e}();function js(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function ws(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Is=!1,Ss=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ws(this,"internalMonitor",void 0),ws(this,"targetId",null),this.internalMonitor=t.getMonitor()}return js(e,[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;zi(!Is,"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 Is=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Is=!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()}}]),e}();function Os(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!p.isValidElement(t)){var r=t;return e(r,n),r}var i=t;return function(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}(i),function(e,t){var n=e.ref;return zi("string"!=typeof n,"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"),n?p.cloneElement(e,{ref:function(e){Cs(n,e),Cs(t,e)}}):p.cloneElement(e,{ref:t})}(i,n?function(t){return e(t,n)}:e)}}function ks(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var i=Os(r);t[n]=function(){return i}}})),t}function Cs(e,t){"function"==typeof e?e(t):e.current=t}function Ns(e){return(Ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ds(e){return null!==e&&"object"===Ns(e)&&Object.prototype.hasOwnProperty.call(e,"current")}function Es(e,t,n,r){var i=void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l<o.length;l++){var c=o[l];if(!a(c))return!1;var u=e[c],d=t[c];if(!1===(i=void 0)||void 0===i&&u!==d)return!1}return!0}function Ts(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function _s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ps=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_s(this,"hooks",ks({dragSource:function(e,t){n.clearDragSource(),n.dragSourceOptions=t||null,Ds(e)?n.dragSourceRef=e:n.dragSourceNode=e,n.reconnectDragSource()},dragPreview:function(e,t){n.clearDragPreview(),n.dragPreviewOptions=t||null,Ds(e)?n.dragPreviewRef=e:n.dragPreviewNode=e,n.reconnectDragPreview()}})),_s(this,"handlerId",null),_s(this,"dragSourceRef",null),_s(this,"dragSourceNode",void 0),_s(this,"dragSourceOptionsInternal",null),_s(this,"dragSourceUnsubscribe",void 0),_s(this,"dragPreviewRef",null),_s(this,"dragPreviewNode",void 0),_s(this,"dragPreviewOptionsInternal",null),_s(this,"dragPreviewUnsubscribe",void 0),_s(this,"lastConnectedHandlerId",null),_s(this,"lastConnectedDragSource",null),_s(this,"lastConnectedDragSourceOptions",null),_s(this,"lastConnectedDragPreview",null),_s(this,"lastConnectedDragPreviewOptions",null),_s(this,"backend",void 0),this.backend=t}return Ts(e,[{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,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();t&&this.disconnectDragSource(),this.handlerId&&(e?t&&(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,t=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();t&&this.disconnectDragPreview(),this.handlerId&&(e?t&&(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!Es(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Es(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}}]),e}();function As(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Ms(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rs=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ms(this,"hooks",ks({dropTarget:function(e,t){n.clearDropTarget(),n.dropTargetOptions=t,Ds(e)?n.dropTargetRef=e:n.dropTargetNode=e,n.reconnect()}})),Ms(this,"handlerId",null),Ms(this,"dropTargetRef",null),Ms(this,"dropTargetNode",void 0),Ms(this,"dropTargetOptionsInternal",null),Ms(this,"unsubscribeDropTarget",void 0),Ms(this,"lastConnectedHandlerId",null),Ms(this,"lastConnectedDropTarget",null),Ms(this,"lastConnectedDropTargetOptions",null),Ms(this,"backend",void 0),this.backend=t}return As(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{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!Es(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}}]),e}();var Ls="undefined"!=typeof window?p.useLayoutEffect:p.useEffect;function Fs(e){return(Fs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hs(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function zs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Us=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),zs(this,"spec",void 0),zs(this,"monitor",void 0),zs(this,"connector",void 0),this.spec=t,this.monitor=n,this.connector=r}return Hs(e,[{key:"beginDrag",value:function(){var e,t=this.spec,n=this.monitor;return null!==(e="object"===Fs(t.item)?t.item:"function"==typeof t.item?t.item(n):{})&&void 0!==e?e:null}},{key:"canDrag",value:function(){var e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)}},{key:"isDragging",value:function(e,t){var n=this.spec,r=this.monitor,i=n.isDragging;return i?i(r):t===e.getSourceId()}},{key:"endDrag",value:function(){var e=this.spec,t=this.monitor,n=this.connector,r=e.end;r&&r(t.getItem(),t),n.reconnect()}}]),e}();function Bs(){var e=p.useContext(Hi).dragDropManager;return zi(null!=e,"Expected drag drop context"),e}function Vs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ws(e,t,n){var r=Bs(),i=function(e,t,n){var r=p.useMemo((function(){return new Us(e,t,n)}),[t,n]);return p.useEffect((function(){r.spec=e}),[e]),r}(e,t,n),o=function(e){return p.useMemo((function(){var t=e.type;return zi(null!=t,"spec.type must be defined"),t}),[e])}(e);Ls((function(){if(null!=o){var e=function(e,t,n){var r=n.getRegistry(),i=r.addSource(e,t);return[i,function(){return r.removeSource(i)}]}(o,i,r),s=Vs(e,2),a=s[0],l=s[1];return t.receiveHandlerId(a),n.receiveHandlerId(a),l}}),[r,t,n,i,o])}function Gs(e){return function(e){if(Array.isArray(e))return Ks(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ks(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ks(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ks(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ys(e,t){var n=Gs(t||[]);return null==t&&"function"!=typeof e&&n.push(e),p.useMemo((function(){return"function"==typeof e?e():e}),n)}function $s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zs(e,t,n){var r=$s(p.useState((function(){return t(e)})),2),i=r[0],o=r[1],s=p.useCallback((function(){var r=t(e);xt(i,r)||(o(r),n&&n())}),[i,e,n]);return Ls(s),[i,s]}function Qs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Js(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Js(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Js(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ea(e,t,n){return function(e,t,n){var r=Qs(Zs(e,t,n),2),i=r[0],o=r[1];return Ls((function(){var t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(o,{handlerIds:[t]})}),[e,o]),i}(t,e||function(){return{}},(function(){return n.reconnect()}))}function ta(e){return p.useMemo((function(){return e.hooks.dragSource()}),[e])}function na(e){return p.useMemo((function(){return e.hooks.dragPreview()}),[e])}function ra(e,t){var n=Ys(e,t);zi(!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=Bs(),p.useMemo((function(){return new bs(r)}),[r])),o=function(e,t){var n=Bs(),r=p.useMemo((function(){return new Ps(n.getBackend())}),[n]);return Ls((function(){return r.dragSourceOptions=e||null,r.reconnect(),function(){return r.disconnectDragSource()}}),[r,e]),Ls((function(){return r.dragPreviewOptions=t||null,r.reconnect(),function(){return r.disconnectDragPreview()}}),[r,t]),r}(n.options,n.previewOptions);return Ws(n,i,o),[ea(n.collect,i,o),ta(o),na(o)]}function ia(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function oa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sa=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),oa(this,"spec",void 0),oa(this,"monitor",void 0),this.spec=t,this.monitor=n}return ia(e,[{key:"canDrop",value:function(){var e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}},{key:"hover",value:function(){var e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}},{key:"drop",value:function(){var e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}}]),e}();function aa(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return la(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return la(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function la(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ca(e,t,n){var r=Bs(),i=function(e,t){var n=p.useMemo((function(){return new sa(e,t)}),[t]);return p.useEffect((function(){n.spec=e}),[e]),n}(e,t),o=function(e){var t=e.accept;return p.useMemo((function(){return zi(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t]}),[t])}(e);Ls((function(){var e=function(e,t,n){var r=n.getRegistry(),i=r.addTarget(e,t);return[i,function(){return r.removeTarget(i)}]}(o,i,r),s=aa(e,2),a=s[0],l=s[1];return t.receiveHandlerId(a),n.receiveHandlerId(a),l}),[r,t,i,n,o.map((function(e){return e.toString()})).join("|")])}function ua(e){return p.useMemo((function(){return e.hooks.dropTarget()}),[e])}function da(e,t){var n,r=Ys(e,t),i=(n=Bs(),p.useMemo((function(){return new Ss(n)}),[n])),o=function(e){var t=Bs(),n=p.useMemo((function(){return new Rs(t.getBackend())}),[t]);return Ls((function(){return n.dropTargetOptions=e||null,n.reconnect(),function(){return n.disconnectDropTarget()}}),[e]),n}(r.options);return ca(r,i,o),[ea(r.collect,i,o),ua(o)]}function ha(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fa(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pa(e){var t=null;return function(){return null==t&&(t=e()),t}}function ga(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function ma(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var va=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ma(this,"entered",[]),ma(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return ga(e,[{key:"enter",value:function(e){var t=this,n=this.entered.length;return this.entered=function(e,t){var n=new Set,r=function(e){return n.add(e)};e.forEach(r),t.forEach(r);var i=[];return n.forEach((function(e){return i.push(e)})),i}(this.entered.filter((function(n){return t.isNodeInDocument(n)&&(!n.contains||n.contains(e))})),[e]),0===n&&this.entered.length>0}},{key:"leave",value:function(e){var t,n,r=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),n=e,t.filter((function(e){return e!==n}))),r>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}]),e}(),ya=pa((function(){return/firefox/i.test(navigator.userAgent)})),xa=pa((function(){return Boolean(window.safari)}));function ba(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function ja(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wa=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ja(this,"xs",void 0),ja(this,"ys",void 0),ja(this,"c1s",void 0),ja(this,"c2s",void 0),ja(this,"c3s",void 0);for(var r=t.length,i=[],o=0;o<r;o++)i.push(o);i.sort((function(e,n){return t[e]<t[n]?-1:1}));for(var s,a,l=[],c=[],u=0;u<r-1;u++)s=t[u+1]-t[u],a=n[u+1]-n[u],l.push(s),c.push(a/s);for(var d=[c[0]],h=0;h<l.length-1;h++){var f=c[h],p=c[h+1];if(f*p<=0)d.push(0);else{s=l[h];var g=l[h+1],m=s+g;d.push(3*m/((m+g)/f+(m+s)/p))}}d.push(c[c.length-1]);for(var v,y=[],x=[],b=0;b<d.length-1;b++){v=c[b];var j=d[b],w=1/l[b],I=j+d[b+1]-v-v;y.push((v-j-I)*w),x.push(I*w*w)}this.xs=t,this.ys=n,this.c1s=d,this.c2s=y,this.c3s=x}return ba(e,[{key:"interpolate",value:function(e){var t=this.xs,n=this.ys,r=this.c1s,i=this.c2s,o=this.c3s,s=t.length-1;if(e===t[s])return n[s];for(var a,l=0,c=o.length-1;l<=c;){var u=t[a=Math.floor(.5*(l+c))];if(u<e)l=a+1;else{if(!(u>e))return n[a];c=a-1}}var d=e-t[s=Math.max(0,c)],h=d*d;return n[s]+r[s]*d+i[s]*h+o[s]*d*h}}]),e}();function Ia(e){var t=1===e.nodeType?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function Sa(e){return{x:e.clientX,y:e.clientY}}function Oa(e,t,n,r,i){var o,s,a,l="IMG"===(o=t).nodeName&&(ya()||!(null!==(s=document.documentElement)&&void 0!==s&&s.contains(o))),c=Ia(l?e:t),u={x:n.x-c.x,y:n.y-c.y},d=e.offsetWidth,h=e.offsetHeight,f=r.anchorX,p=r.anchorY,g=function(e,t,n,r){var i=e?t.width:n,o=e?t.height:r;return xa()&&e&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}(l,t,d,h),m=g.dragPreviewWidth,v=g.dragPreviewHeight,y=i.offsetX,x=i.offsetY,b=0===x||x;return{x:0===y||y?y:new wa([0,.5,1],[u.x,u.x/d*m,u.x+m-d]).interpolate(f),y:b?x:(a=new wa([0,.5,1],[u.y,u.y/h*v,u.y+v-h]).interpolate(p),xa()&&l&&(a+=(window.devicePixelRatio-1)*v),a)}}var ka="__NATIVE_FILE__",Ca="__NATIVE_URL__",Na="__NATIVE_TEXT__",Da="__NATIVE_HTML__";const Ea=Object.freeze(Object.defineProperty({__proto__:null,FILE:ka,HTML:Da,TEXT:Na,URL:Ca},Symbol.toStringTag,{value:"Module"}));function Ta(e,t,n){var r=t.reduce((function(t,n){return t||e.getData(n)}),"");return null!=r?r:n}var _a;function Pa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Aa=(Pa(_a={},ka,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),Pa(_a,Da,{exposeProperties:{html:function(e,t){return Ta(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),Pa(_a,Ca,{exposeProperties:{urls:function(e,t){return Ta(e,t,"").split("\n")},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),Pa(_a,Na,{exposeProperties:{text:function(e,t){return Ta(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),_a);function Ma(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var La=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ra(this,"item",void 0),Ra(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return Ma(e,[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach((function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})}))}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var n={};Object.keys(this.config.exposeProperties).forEach((function(r){n[r]={value:t.config.exposeProperties[r](e,t.config.matchesTypes),configurable:!0,enumerable:!0}})),Object.defineProperties(this.item,n)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}]),e}();function Fa(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(Aa).filter((function(e){return Aa[e].matchesTypes.some((function(e){return t.indexOf(e)>-1}))}))[0]||null}function Ha(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function za(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ua=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),za(this,"ownerDocument",null),za(this,"globalContext",void 0),za(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=n}return Ha(e,[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}},{key:"document",get:function(){var e;return null!==(e=this.globalContext)&&void 0!==e&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}}]),e}();function Ba(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Va(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(n),!0).forEach((function(t){Wa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ba(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qa(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Wa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ga,Ka=function(){function e(t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Wa(this,"options",void 0),Wa(this,"actions",void 0),Wa(this,"monitor",void 0),Wa(this,"registry",void 0),Wa(this,"enterLeaveCounter",void 0),Wa(this,"sourcePreviewNodes",new Map),Wa(this,"sourcePreviewNodeOptions",new Map),Wa(this,"sourceNodes",new Map),Wa(this,"sourceNodeOptions",new Map),Wa(this,"dragStartSourceIds",null),Wa(this,"dropTargetIds",[]),Wa(this,"dragEnterTargetIds",[]),Wa(this,"currentNativeSource",null),Wa(this,"currentNativeHandle",null),Wa(this,"currentDragSourceNode",null),Wa(this,"altKeyPressed",!1),Wa(this,"mouseMoveTimeoutTimer",null),Wa(this,"asyncEndDragFrameId",null),Wa(this,"dragOverTargetIds",null),Wa(this,"lastClientOffset",null),Wa(this,"hoverRafId",null),Wa(this,"getSourceClientOffset",(function(e){var t=i.sourceNodes.get(e);return t&&Ia(t)||null})),Wa(this,"endDragNativeItem",(function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)})),Wa(this,"isNodeInDocument",(function(e){return Boolean(e&&i.document&&i.document.body&&i.document.body.contains(e))})),Wa(this,"endDragIfSourceWasRemovedFromDOM",(function(){var e=i.currentDragSourceNode;null==e||i.isNodeInDocument(e)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()})),Wa(this,"handleTopDragStartCapture",(function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]})),Wa(this,"handleTopDragStart",(function(e){if(!e.defaultPrevented){var t=i.dragStartSourceIds;i.dragStartSourceIds=null;var n=Sa(e);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:n});var r=e.dataTransfer,o=Fa(r);if(i.monitor.isDragging()){if(r&&"function"==typeof r.setDragImage){var s=i.monitor.getSourceId(),a=i.sourceNodes.get(s),l=i.sourcePreviewNodes.get(s)||a;if(l){var c=i.getCurrentSourcePreviewNodeOptions(),u=Oa(a,l,n,{anchorX:c.anchorX,anchorY:c.anchorY},{offsetX:c.offsetX,offsetY:c.offsetY});r.setDragImage(l,u.x,u.y)}}try{null==r||r.setData("application/json",{})}catch(d){}i.setCurrentDragSourceNode(e.target),i.getCurrentSourcePreviewNodeOptions().captureDraggingState?i.actions.publishDragSource():setTimeout((function(){return i.actions.publishDragSource()}),0)}else if(o)i.beginDragNativeItem(o);else{if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}}})),Wa(this,"handleTopDragEndCapture",(function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()})),Wa(this,"handleTopDragEnterCapture",(function(e){if(i.dragEnterTargetIds=[],i.enterLeaveCounter.enter(e.target)&&!i.monitor.isDragging()){var t=e.dataTransfer,n=Fa(t);n&&i.beginDragNativeItem(n,t)}})),Wa(this,"handleTopDragEnter",(function(e){var t=i.dragEnterTargetIds;(i.dragEnterTargetIds=[],i.monitor.isDragging())&&(i.altKeyPressed=e.altKey,t.length>0&&i.actions.hover(t,{clientOffset:Sa(e)}),t.some((function(e){return i.monitor.canDropOnTarget(e)}))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=i.getCurrentDropEffect())))})),Wa(this,"handleTopDragOverCapture",(function(){i.dragOverTargetIds=[]})),Wa(this,"handleTopDragOver",(function(e){var t=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));i.altKeyPressed=e.altKey,i.lastClientOffset=Sa(e),null===i.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(i.hoverRafId=requestAnimationFrame((function(){i.monitor.isDragging()&&i.actions.hover(t||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null}))),(t||[]).some((function(e){return i.monitor.canDropOnTarget(e)}))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))})),Wa(this,"handleTopDragLeaveCapture",(function(e){i.isDraggingNativeItem()&&e.preventDefault(),i.enterLeaveCounter.leave(e.target)&&i.isDraggingNativeItem()&&setTimeout((function(){return i.endDragNativeItem()}),0)})),Wa(this,"handleTopDropCapture",(function(e){var t;(i.dropTargetIds=[],i.isDraggingNativeItem())?(e.preventDefault(),null===(t=i.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Fa(e.dataTransfer)&&e.preventDefault();i.enterLeaveCounter.reset()})),Wa(this,"handleTopDrop",(function(e){var t=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(t,{clientOffset:Sa(e)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()})),Wa(this,"handleSelectStart",(function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))})),this.options=new Ua(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new va(this.isNodeInDocument)}return qa(e,[{key:"profile",value:function(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.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(void 0!==e){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,t=this.rootElement;void 0!==t&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(e=this.window)||void 0===e||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,t,n){var r=this;return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),function(){r.sourcePreviewNodes.delete(e),r.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,t,n){var r=this;this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);var i=function(t){return r.handleDragStart(t,e)},o=function(e){return r.handleSelectStart(e)};return t.setAttribute("draggable","true"),t.addEventListener("dragstart",i),t.addEventListener("selectstart",o),function(){r.sourceNodes.delete(e),r.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",i),t.removeEventListener("selectstart",o),t.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},i=function(t){return n.handleDragOver(t,e)},o=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",i),t.addEventListener("drop",o),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",i),t.removeEventListener("drop",o)}}},{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(),t=this.sourceNodeOptions.get(e);return Va({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Va({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(Ea).some((function(t){return Ea[t]===e}))}},{key:"beginDragNativeItem",value:function(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){var n=new La(Aa[e]);return n.loadDataTransfer(t),n}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var t=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;this.mouseMoveTimeoutTimer=setTimeout((function(){var e;return null===(e=t.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",t.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){var e;if(this.currentDragSourceNode=null,this.rootElement)null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0);return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleDragOver",value:function(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}}]),e}();var Ya=function(e,t,n){return new Ka(e,t,n)};function $a(e){const t=vr(),n=t.selectedIds,[r,i,o]=ra((()=>({canDrag:()=>e.isDraggable,type:"NODE",item:()=>{const r=t.isSelected(e.id)?Array.from(n):[e.id];return t.dispatch(di.dragStart(e.id,r)),{id:e.id,dragIds:r}},end:()=>{t.hideCursor(),t.dispatch(di.dragEnd())}})),[n,e]);return p.useEffect((()=>{o((Ga||((Ga=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Ga))}),[o]),i}function Xa(e,t){return{parentId:e||null,index:t}}function Za(e,t){return{type:"line",index:e,level:t}}function Qa(e,t){var n;let r=e;for(;r.parent&&r.level>t;)r=r.parent;return{parentId:(null===(n=r.parent)||void 0===n?void 0:n.id)||null,index:Cr(r)+1}}function Ja(e){var t;const n=function(e,t){const n=e.getBoundingClientRect(),r=t.x-Math.round(n.x),i=t.y-Math.round(n.y),o=n.height,s=i<o/2,a=!s,l=o/4,c=i>l&&i<o-l;return{x:r,inTopHalf:s,inBottomHalf:a,inMiddle:c,atTop:!c&&s,atBottom:!c&&a}}(e.element,e.offset),r=e.indent,i=Math.round(Math.max(0,n.x-r)/r),{node:o,nextNode:s,prevNode:a}=e,[l,c]=function(e,t,n,r){return e?e.isInternal?r.atTop?[t,e]:r.inMiddle?[e,e]:[e,n]:r.inTopHalf?[t,e]:[e,n]:[t,null]}(o,a,s,n);if(o&&o.isInternal&&n.inMiddle)return{drop:Xa(o.id,null),cursor:(u=o.id,{type:"highlight",id:u})};var u;if(!l)return{drop:Xa(null===(t=null==c?void 0:c.parent)||void 0===t?void 0:t.id,0),cursor:Za(0,0)};if(Ir(l)){const e=wr(i,(null==c?void 0:c.level)||0,l.level);return{drop:Qa(l,e),cursor:Za(l.rowIndex+1,e)}}if(Sr(l)){const e=wr(i,(null==c?void 0:c.level)||0,l.level);return{drop:Qa(l,e),cursor:Za(l.rowIndex+1,e)}}if(Or(l)){const e=wr(i,0,l.level+1);return e>l.level?{drop:Xa(l.id,0),cursor:Za(l.rowIndex+1,e)}:{drop:Qa(l,e),cursor:Za(l.rowIndex+1,e)}}return{drop:Xa(null==l?void 0:l.id,0),cursor:Za(l.rowIndex+1,l.level+1)}}const el=i.memo((function({index:e,style:t}){jr(),function(){const e=p.useContext(yr);if(null===e)throw new Error("Provide a NodesContext")}();const n=vr(),r=function(e){const t=vr(),n=t.at(e);if(!n)throw new Error(`Could not find node for index: ${e}`);return p.useMemo((()=>{const r=n.clone();return t.visibleNodes[e]=r,r}),[...Object.values(n.state),n])}(e),i=p.useRef(null),o=$a(r),s=function(e,t){const n=vr(),[r,i]=da((()=>({accept:"NODE",canDrop:()=>n.canDrop(),hover:(r,i)=>{const o=i.getClientOffset();if(!e.current||!o)return;const{cursor:s,drop:a}=Ja({element:e.current,offset:o,indent:n.indent,node:t,prevNode:t.prev,nextNode:t.next});a&&n.dispatch(di.hovering(a.parentId,a.index)),i.canDrop()?s&&n.showCursor(s):n.hideCursor()},drop:(e,t)=>{if(!t.canDrop())return null;let{parentId:r,index:i,dragIds:o}=n.state.dnd;Fr(n.props.onMove,{dragIds:o,parentId:r===ei?null:r,index:null===i?0:i,dragNodes:n.dragNodes,parentNode:n.get(r)}),n.open(r)}})),[t,e.current,n.props]);return i}(i,r),l=p.useCallback((e=>{i.current=e,s(e)}),[s]),c=n.indent*r.level,u=p.useMemo((()=>({paddingLeft:c})),[c]),d=p.useMemo((()=>{var e,r;return Object.assign(Object.assign({},t),{top:parseFloat(t.top)+(null!==(r=null!==(e=n.props.padding)&&void 0!==e?e:n.props.paddingTop)&&void 0!==r?r:0)})}),[t,n.props.padding,n.props.paddingTop]),h={role:"treeitem","aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:d,tabIndex:-1,className:n.props.rowClassName};p.useEffect((()=>{var e;!r.isEditing&&r.isFocused&&(null===(e=i.current)||void 0===e||e.focus({preventScroll:!0}))}),[r.isEditing,r.isFocused,i.current]);const f=n.renderNode,g=n.renderRow;return a.jsx(g,{node:r,innerRef:l,attrs:h,children:a.jsx(f,{node:r,tree:n,style:u,dragHandle:o})})}));let tl="",nl=null;function rl(){jr();const e=vr();return a.jsx("div",{role:"tree",style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var n;if(e.isEditing)return;if("Backspace"===t.key){if(!e.props.onDelete)return;const t=Array.from(e.selectedIds);if(t.length>1){let n=e.mostRecentNode;for(;n&&n.isSelected;)n=n.nextSibling;n||(n=e.lastNode),e.focus(n,{scroll:!1}),e.delete(Array.from(t))}else{const t=e.focusedNode;if(t){const n=t.nextSibling,r=t.parent;e.focus(n||r,{scroll:!1}),e.delete(t)}}return}if("Tab"===t.key&&!t.shiftKey)return t.preventDefault(),void Er(t.currentTarget);if("Tab"===t.key&&t.shiftKey)return t.preventDefault(),void Tr(t.currentTarget);if("ArrowDown"===t.key){t.preventDefault();const n=e.nextNode;if(t.metaKey)return e.select(e.focusedNode),void e.activate(e.focusedNode);if(!t.shiftKey||e.props.disableMultiSelection)return void e.focus(n);{if(!n)return;const t=e.focusedNode;return void(t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.firstNode))}}if("ArrowUp"===t.key){t.preventDefault();const n=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection)return void e.focus(n);{if(!n)return;const t=e.focusedNode;return void(t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.lastNode))}}if("ArrowRight"===t.key){const t=e.focusedNode;if(!t)return;return void(t.isInternal&&t.isOpen?e.focus(e.nextNode):t.isInternal&&e.open(t.id))}if("ArrowLeft"===t.key){const t=e.focusedNode;if(!t||t.isRoot)return;return void(t.isInternal&&t.isOpen?e.close(t.id):(null===(n=t.parent)||void 0===n?void 0:n.isRoot)||e.focus(t.parent))}if("a"===t.key&&t.metaKey&&!e.props.disableMultiSelection)return t.preventDefault(),void e.selectAll();if("a"===t.key&&!t.metaKey&&e.props.onCreate)return void e.createLeaf();if("A"===t.key&&!t.metaKey){if(!e.props.onCreate)return;return void e.createInternal()}if("Home"===t.key)return t.preventDefault(),void e.focus(e.firstNode);if("End"===t.key)return t.preventDefault(),void e.focus(e.lastNode);if("Enter"===t.key){const t=e.focusedNode;if(!t)return;if(!t.isEditable||!e.props.onRename)return;return void setTimeout((()=>{t&&e.edit(t)}))}if(" "===t.key){t.preventDefault();const n=e.focusedNode;if(!n)return;return void(n.isLeaf?(n.select(),n.activate()):n.toggle())}if("*"===t.key){const t=e.focusedNode;if(!t)return;return void e.openSiblings(t)}if("PageUp"===t.key)return t.preventDefault(),void e.pageUp();"PageDown"===t.key&&(t.preventDefault(),e.pageDown()),clearTimeout(nl),tl+=t.key,nl=setTimeout((()=>{tl=""}),600);const r=e.visibleNodes.find((e=>{const t=e.data.name;return"string"==typeof t&&t.toLowerCase().startsWith(tl)}));r&&e.focus(r.id)},children:a.jsx(_i,{className:e.props.className,outerRef:e.listEl,itemCount:e.visibleNodes.length,height:e.height,width:e.width,itemSize:e.rowHeight,overscanCount:e.overscanCount,itemKey:t=>{var n;return(null===(n=e.visibleNodes[t])||void 0===n?void 0:n.id)||t},outerElementType:Ai,innerElementType:Ri,onScroll:e.props.onScroll,onItemsRendered:e.onItemsRendered.bind(e),ref:e.list,children:el})})}function il(e){return e.isFiltered?function(e,t){const n={},r=[];function i(e){if(!e.isRoot&&t(e)){n[e.id]=!0;let t=e.parent;for(;t;)n[t.id]=!0,t=t.parent}if(e.children)for(let t of e.children)i(t)}function o(e){var t;e.level>=0&&n[e.id]&&r.push(e),e.isOpen&&(null===(t=e.children)||void 0===t||t.forEach(o))}return i(e),o(e),r.forEach(ol),r}(e.root,e.isMatch.bind(e)):function(e){const t=[];function n(e){var r;e.level>=0&&t.push(e),e.isOpen&&(null===(r=e.children)||void 0===r||r.forEach(n))}return n(e),t.forEach(ol),t}(e.root)}function ol(e,t){e.rowIndex=t}const sl=e=>e.reduce(((e,t,n)=>(e[t.id]=n,e)),{});var al=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(t){o(t)}}function a(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const{safeRun:ll,identify:cl,identifyNull:ul}=Br;class dl{constructor(e,t,n,r){this.store=e,this.props=t,this.list=n,this.listEl=r,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=ti(this),this.visibleNodes=il(this),this.idToIndex=sl(this.visibleNodes)}update(e){this.props=e,this.root=ti(this),this.visibleNodes=il(this),this.idToIndex=sl(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 null!==(e=this.props.width)&&void 0!==e?e:300}get height(){var e;return null!==(e=this.props.height)&&void 0!==e?e:500}get indent(){var e;return null!==(e=this.props.indent)&&void 0!==e?e:24}get rowHeight(){var e;return null!==(e=this.props.rowHeight)&&void 0!==e?e:24}get overscanCount(){var e;return null!==(e=this.props.overscanCount)&&void 0!==e?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const t=null!==(e=this.props.searchMatch)&&void 0!==e?e:(e,t)=>JSON.stringify(Object.values(e.data)).toLocaleLowerCase().includes(t.toLocaleLowerCase());return e=>t(e,this.searchTerm)}accessChildren(e){var t;return null!==(t=Mr(e,this.props.childrenAccessor||"children"))&&void 0!==t?t:null}accessId(e){const t=Mr(e,this.props.idAccessor||"id");if(!t)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return t}get firstNode(){var e;return null!==(e=this.visibleNodes[0])&&void 0!==e?e:null}get lastNode(){var e;return null!==(e=this.visibleNodes[this.visibleNodes.length-1])&&void 0!==e?e:null}get focusedNode(){var e;return null!==(e=this.get(this.state.nodes.focus.id))&&void 0!==e?e:null}get mostRecentNode(){var e;return null!==(e=this.get(this.state.nodes.selection.mostRecent))&&void 0!==e?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return null===e?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return null===e?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,t){var n;if(null===e||null===t)return[];const r=null!==(n=this.indexOf(e))&&void 0!==n?n:0,i=this.indexOf(t);if(null===i)return[];const o=Math.min(r,i),s=Math.max(r,i);return this.visibleNodes.slice(o,s+1)}indexOf(e){const t=Rr(e);return t?this.idToIndex[t]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return al(this,arguments,void 0,(function*(e={}){var t,n;const r=void 0===e.parentId?Ur(this):e.parentId,i=null!==(t=e.index)&&void 0!==t?t:zr(this),o=null!==(n=e.type)&&void 0!==n?n:"leaf",s=yield ll(this.props.onCreate,{type:o,parentId:r,index:i,parentNode:this.get(r)});s&&(this.focus(s),setTimeout((()=>{this.edit(s).then((()=>{this.select(s),this.activate(s)}))})))}))}delete(e){return al(this,void 0,void 0,(function*(){if(!e)return;const t=(Array.isArray(e)?e:[e]).map(cl),n=t.map((e=>this.get(e))).filter((e=>!!e));yield ll(this.props.onDelete,{nodes:n,ids:t})}))}edit(e){const t=cl(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(t),this.dispatch(Zr(t)),new Promise((e=>{dl.editPromise=e}))}submit(e,t){return al(this,void 0,void 0,(function*(){if(!e)return;const n=cl(e);yield ll(this.props.onRename,{id:n,name:t,node:this.get(n)}),this.dispatch(Zr(null)),this.resolveEdit({cancelled:!1,value:t}),setTimeout((()=>this.onFocus()))}))}reset(){this.dispatch(Zr(null)),this.resolveEdit({cancelled:!0}),setTimeout((()=>this.onFocus()))}activate(e){const t=this.get(ul(e));t&&ll(this.props.onActivate,t)}resolveEdit(e){const t=dl.editPromise;t&&t(e),dl.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let t of Array.from(this.selectedIds)){const n=this.get(t);n&&e.push(n)}return e}focus(e,t={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(Qr(cl(e))),!1!==t.scroll&&this.scrollTo(e),this.focusedNode&&ll(this.props.onFocus,this.focusedNode)))}pageUp(){var e,t;const n=this.visibleStartIndex,r=this.visibleStopIndex-n;let i=null!==(t=null===(e=this.focusedNode)||void 0===e?void 0:e.rowIndex)&&void 0!==t?t:0;i=i>n?n:Math.max(n-r,0),this.focus(this.at(i))}pageDown(){var e,t;const n=this.visibleStartIndex,r=this.visibleStopIndex,i=r-n;let o=null!==(t=null===(e=this.focusedNode)||void 0===e?void 0:e.rowIndex)&&void 0!==t?t:0;o=o<r?r:Math.min(o+i,this.visibleNodes.length-1),this.focus(this.at(o))}select(e,t={}){if(!e)return;const n=!1!==t.focus,r=cl(e);n&&this.dispatch(Qr(r)),this.dispatch(oi(r)),this.dispatch(ui(r)),this.dispatch(ci(r)),this.scrollTo(r,t.align),this.focusedNode&&n&&ll(this.props.onFocus,this.focusedNode),ll(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const t=cl(e);this.dispatch(ai(t)),ll(this.props.onSelect,this.selectedNodes)}selectMulti(e){const t=this.get(ul(e));t&&(this.dispatch(Qr(t.id)),this.dispatch(si(t.id)),this.dispatch(ui(t.id)),this.dispatch(ci(t.id)),this.scrollTo(t),this.focusedNode&&ll(this.props.onFocus,this.focusedNode),ll(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const t=cl(e),{anchor:n,mostRecent:r}=this.state.nodes.selection;this.dispatch(Qr(t)),this.dispatch(ai(this.nodesBetween(n,r))),this.dispatch(si(this.nodesBetween(n,ul(t)))),this.dispatch(ci(t)),this.scrollTo(t),this.focusedNode&&ll(this.props.onFocus,this.focusedNode),ll(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),ll(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(Qr(null===(e=this.lastNode)||void 0===e?void 0:e.id)),this.focusedNode&&ll(this.props.onFocus,this.focusedNode),ll(this.props.onSelect,this.selectedNodes)}setSelection(e){var t;const n=new Set(null===(t=e.ids)||void 0===t?void 0:t.map(cl)),r=ul(e.anchor),i=ul(e.mostRecent);this.dispatch(li({ids:n,anchor:r,mostRecent:i})),ll(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;return"highlight"===e.type?e.id:null}get cursorOverFolder(){return"highlight"===this.state.dnd.cursor.type}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 t=null!==(e=this.get(this.state.dnd.parentId))&&void 0!==e?e:this.root,n=this.dragNodes,r=this.props.disableDrop;for(const i of n){if(!i)return!1;if(!t)return!1;if(i.isInternal&&kr(t,i))return!1}return"function"==typeof r?!r({parentNode:t,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):"string"==typeof r?!t.data[r]:"boolean"!=typeof r||!r}hideCursor(){this.dispatch(di.cursor({type:"none"}))}showCursor(e){this.dispatch(di.cursor(e))}open(e){const t=ul(e);t&&(this.isOpen(t)||(this.dispatch(ni.open(t,this.isFiltered)),ll(this.props.onToggle,t)))}close(e){const t=ul(e);t&&this.isOpen(t)&&(this.dispatch(ni.close(t,this.isFiltered)),ll(this.props.onToggle,t))}toggle(e){const t=ul(e);if(t)return this.isOpen(t)?this.close(t):this.open(t)}openParents(e){const t=ul(e);if(!t)return;const n=Nr(this.root,t);let r=null==n?void 0:n.parent;for(;r;)this.open(r.id),r=r.parent}openSiblings(e){const t=e.parent;if(t){if(t.children){const n=e.isOpen;for(let e of t.children)e.isInternal&&(n?this.close(e.id):this.open(e.id));this.scrollTo(this.focusedNode)}}else this.toggle(e.id)}openAll(){Dr(this.root,(e=>{e.isInternal&&e.open()}))}closeAll(){Dr(this.root,(e=>{e.isInternal&&e.close()}))}scrollTo(e,t="smart"){if(!e)return;const n=cl(e);return this.openParents(n),Hr((()=>n in this.idToIndex)).then((()=>{var e;const r=this.idToIndex[n];void 0!==r&&(null===(e=this.list.current)||void 0===e||e.scrollToItem(r,t))})).catch((()=>{}))}get isEditing(){return null!==this.state.nodes.edit.id}get isFiltered(){var e;return!!(null===(e=this.props.searchTerm)||void 0===e?void 0:e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return 0===this.state.nodes.selection.ids.size}get hasOneSelection(){return 1===this.state.nodes.selection.ids.size}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return!!e&&this.state.nodes.selection.ids.has(e)}isOpen(e){var t,n,r;if(!e)return!1;if(e===ei)return!0;const i=null===(t=this.props.openByDefault)||void 0===t||t;return this.isFiltered?null===(n=this.state.nodes.open.filtered[e])||void 0===n||n:null!==(r=this.state.nodes.open.unfiltered[e])&&void 0!==r?r:i}isEditable(e){return!Mr(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!Mr(e,this.props.disableDrag||(()=>!1))}isDragging(e){const t=ul(e);return!!t&&this.state.nodes.drag.id===t}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const t=ul(e);if(!t)return!1;const{destinationParentId:n,destinationIndex:r}=this.state.nodes.drag;return t===n&&null===r}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(Qr(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||rl}get renderRow(){return this.props.renderRow||Kr}get renderNode(){return this.props.children||Yr}get renderDragPreview(){return this.props.renderDragPreview||gi}get renderCursor(){return this.props.renderCursor||Gr}}function hl(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var fl=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),pl=()=>Math.random().toString(36).substring(7).split("").join("."),gl={INIT:`@@redux/INIT${pl()}`,REPLACE:`@@redux/REPLACE${pl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${pl()}`};function ml(e,t,n){if("function"!=typeof e)throw new Error(hl(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(hl(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(hl(1));return n(ml)(e,t)}let r=e,i=t,o=new Map,s=o,a=0,l=!1;function c(){s===o&&(s=new Map,o.forEach(((e,t)=>{s.set(t,e)})))}function u(){if(l)throw new Error(hl(3));return i}function d(e){if("function"!=typeof e)throw new Error(hl(4));if(l)throw new Error(hl(5));let t=!0;c();const n=a++;return s.set(n,e),function(){if(t){if(l)throw new Error(hl(6));t=!1,c(),s.delete(n),o=null}}}function h(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw new Error(hl(7));if(void 0===e.type)throw new Error(hl(8));if("string"!=typeof e.type)throw new Error(hl(17));if(l)throw new Error(hl(9));try{l=!0,i=r(i,e)}finally{l=!1}return(o=s).forEach((e=>{e()})),e}h({type:gl.INIT});return{dispatch:h,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(hl(10));r=e,h({type:gl.REPLACE})},[fl]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(hl(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[fl](){return this}}}}}function vl(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const r=t[s];"function"==typeof e[r]&&(n[r]=e[r])}const r=Object.keys(n);let i;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:gl.INIT}))throw new Error(hl(12));if(void 0===n(void 0,{type:gl.PROBE_UNKNOWN_ACTION()}))throw new Error(hl(13))}))}(n)}catch(o){i=o}return function(e={},t){if(i)throw i;let o=!1;const s={};for(let i=0;i<r.length;i++){const a=r[i],l=n[a],c=e[a],u=l(c,t);if(void 0===u)throw t&&t.type,new Error(hl(14));s[a]=u,o=o||u!==c}return o=o||r.length!==Object.keys(e).length,o?s:e}}const yl=vl({nodes:vl({focus:function(e={id:null,treeFocused:!1},t){return"FOCUS"===t.type?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):"TREE_BLUR"===t.type?Object.assign(Object.assign({},e),{treeFocused:!1}):e},edit:function(e={id:null},t){return"EDIT"===t.type?Object.assign(Object.assign({},e),{id:t.id}):e},open:function(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:ri(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:ri(e.unfiltered,t)}):e},selection:function(e=ii().nodes.selection,t){const n=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return 0===t.ids.length?e:(t.ids.forEach((e=>n.add(e))),Object.assign(Object.assign({},e),{ids:new Set(n)}));case"SELECTION_REMOVE":return 0===t.ids.length?e:(t.ids.forEach((e=>n.delete(e))),Object.assign(Object.assign({},e),{ids:new Set(n)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}},drag:function(e=ii().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}}),dnd:function(e=ii().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return ii().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}}),xl=ii();function bl({treeProps:e,imperativeHandle:t,children:n}){const r=p.useRef(null),i=p.useRef(null),o=p.useRef(ml(yl,ii(e))),s=yt.useSyncExternalStore(o.current.subscribe,o.current.getState,(()=>xl)),l=p.useMemo((()=>new dl(o.current,e,r,i)),[]),c=p.useRef(0);return p.useMemo((()=>{c.current+=1,l.update(e)}),[...Object.values(e),s.nodes.open]),p.useImperativeHandle(t,(()=>l)),p.useEffect((()=>{l.props.selection?l.select(l.props.selection,{focus:!1}):l.deselectAll()}),[l.props.selection]),p.useEffect((()=>{l.props.searchTerm||o.current.dispatch(ni.clear(!0))}),[l.props.searchTerm]),a.jsx(mr.Provider,{value:l,children:a.jsx(br.Provider,{value:c.current,children:a.jsx(yr.Provider,{value:s.nodes,children:a.jsx(xr.Provider,{value:s.dnd,children:a.jsx(ps,Object.assign({backend:Ya,options:{rootElement:l.props.dndRootElement||void 0}},e.dndManager&&{manager:e.dndManager},{children:n}))})})})})}function jl(e){return function(){const e=vr(),[,t]=da((()=>({accept:"NODE",canDrop:(t,n)=>!!n.isOver({shallow:!0})&&e.canDrop(),hover:(t,n)=>{if(!n.isOver({shallow:!0}))return;const r=n.getClientOffset();if(!e.listEl.current||!r)return;const{cursor:i,drop:o}=Ja({element:e.listEl.current,offset:r,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});o&&e.dispatch(di.hovering(o.parentId,o.index)),n.canDrop()?i&&e.showCursor(i):e.hideCursor()}})),[e]);t(e.listEl)}(),e.children}function wl(){const e=vr().props.renderContainer||rl;return a.jsx(a.Fragment,{children:a.jsx(e,{})})}function Il(){const e=vr(),{offset:t,mouse:n,item:r,isDragging:i}=(o=e=>({offset:e.getSourceClientOffset(),mouse:e.getClientOffset(),item:e.getItem(),isDragging:e.isDragging()}),s=Bs().getMonitor(),l=ha(Zs(s,o),2),c=l[0],u=l[1],p.useEffect((function(){return s.subscribeToOffsetChange(u)})),p.useEffect((function(){return s.subscribeToStateChange(u)})),c);var o,s,l,c,u;const d=e.props.renderDragPreview||gi;return a.jsx(d,{offset:t,mouse:n,id:(null==r?void 0:r.id)||null,dragIds:(null==r?void 0:r.dragIds)||[],isDragging:i})}class Sl{constructor(e){this.root=function(e){const t=new kl({id:"ROOT"},null);return t.children=e.map((e=>Ol(e,t))),t}(e)}get data(){var e,t;return null!==(t=null===(e=this.root.children)||void 0===e?void 0:e.map((e=>e.data)))&&void 0!==t?t:[]}create(e){const t=e.parentId?this.find(e.parentId):this.root;if(!t)return null;t.addChild(e.data,e.index)}move(e){const t=this.find(e.id),n=e.parentId?this.find(e.parentId):this.root;t&&n&&(n.addChild(t.data,e.index),t.drop())}update(e){const t=this.find(e.id);t&&t.update(e.changes)}drop(e){const t=this.find(e.id);t&&t.drop()}find(e,t=this.root){if(!t)return null;if(t.id===e)return t;if(t.children){for(let n of t.children){const t=this.find(e,n);if(t)return t}return null}return null}}function Ol(e,t){const n=new kl(e,t);return e.children&&(n.children=e.children.map((e=>Ol(e,n)))),n}class kl{constructor(e,t){this.data=e,this.parent=t,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,t){var n,r;const i=Ol(e,this);this.children=null!==(n=this.children)&&void 0!==n?n:[],this.children.splice(t,0,i),this.data.children=null!==(r=this.data.children)&&void 0!==r?r:[],this.data.children.splice(t,0,e)}removeChild(e){var t,n;null===(t=this.children)||void 0===t||t.splice(e,1),null===(n=this.data.children)||void 0===n||n.splice(e,1)}update(e){if(this.hasParent()){const t=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),t),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let Cl=0;function Nl(e){if(e.initialData&&e.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw new Error("React Arborist Tree => You passed the initialData prop along with a data handler.\nUse the data prop if you want to provide your own handlers.");if(e.initialData){const[t,n]=function(e){const[t,n]=p.useState(e),r=p.useMemo((()=>new Sl(t)),[t]);return[t,{onMove:e=>{for(const t of e.dragIds)r.move({id:t,parentId:e.parentId,index:e.index});n(r.data)},onRename:({name:e,id:t})=>{r.update({id:t,changes:{name:e}}),n(r.data)},onCreate:({parentId:e,index:t,type:i})=>{const o={id:"simple-tree-id-"+Cl++,name:""};return"internal"===i&&(o.children=[]),r.create({parentId:e,index:t,data:o}),n(r.data),o},onDelete:e=>{e.ids.forEach((e=>r.drop({id:e}))),n(r.data)}}]}(e.initialData);return Object.assign(Object.assign(Object.assign({},e),n),{data:t})}return e}const Dl=p.forwardRef((function(e,t){const n=Nl(e);return a.jsxs(bl,{treeProps:n,imperativeHandle:t,children:[a.jsx(jl,{children:a.jsx(wl,{})}),a.jsx(Il,{})]})}));export{bt as A,jt as B,hr as C,Et as G,Nn as K,Tt as L,gr as M,Mt as P,Bt as S,Dl as T,Rt as Y,Dt as a,_t as b,Ot as c,pr as d,In as e,wt as f,jn as g,Ut as h,Sn as i,un as j,Cn as k,Jt as l,cn as m,on as n,rn as o,yn as p,On as q,kn as r,dn as s,hn as t,Wt as u,Xt as v,Qt as w,Zt as x,kt as y,Sl as z};
|
|
8
|
+
const bt=n("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"}]]),jt=n("BookMarked",[["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"}]]),wt=n("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"}]]),It=n("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"}]]),St=n("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Ot=n("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]),kt=n("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]),Ct=n("FlaskConical",[["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"}]]),Nt=n("FolderCog",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v3.3",key:"1k8050"}],["path",{d:"m21.7 19.4-.9-.3",key:"1qgwi9"}],["path",{d:"m15.2 16.9-.9-.3",key:"1t7mvx"}],["path",{d:"m16.6 21.7.3-.9",key:"1j67ps"}],["path",{d:"m19.1 15.2.3-.9",key:"18r7jp"}],["path",{d:"m19.6 21.7-.4-1",key:"z2vh2"}],["path",{d:"m16.8 15.3-.4-1",key:"1ei7r6"}],["path",{d:"m14.3 19.6 1-.4",key:"11sv9r"}],["path",{d:"m20.7 16.8 1-.4",key:"19m87a"}]]),Dt=n("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"}]]),Et=n("Grid3x3",[["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"}]]),Tt=n("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"}]]),_t=n("MessagesSquare",[["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"}]]),Pt=n("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"}]]),At=n("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"}]]),Mt=n("PowerOff",[["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"}]]),Rt=n("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 Lt(e,t){return(Lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Ft(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}const Ht=r("flex items-center justify-center m-0 leading-none font-medium border border-foreground/10 shadow-xsSolid 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"},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"}}),zt=r("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-none text-[hsl(0, 0%, 43.5%)] bg-transparent hover:bg-background focus:bg-background"),Ut=i.forwardRef(((e,t)=>{const n=o.c(15);let r,i,l,c,u,d,h;return n[0]!==e?(({color:i,shape:c,size:u,className:r,...l}=e),n[0]=e,n[1]=r,n[2]=i,n[3]=l,n[4]=c,n[5]=u):(r=n[1],i=n[2],l=n[3],c=n[4],u=n[5]),n[6]!==r||n[7]!==i||n[8]!==c||n[9]!==u?(d=s(Ht({color:i,shape:c,size:u}),r),n[6]=r,n[7]=i,n[8]=c,n[9]=u,n[10]=d):d=n[10],n[11]!==l||n[12]!==t||n[13]!==d?(h=a.jsx("button",{ref:t,className:d,...l,children:l.children}),n[11]=l,n[12]=t,n[13]=d,n[14]=h):h=n[14],h}));Ut.displayName="Button";i.forwardRef(((e,t)=>{const n=o.c(9);let r,i,l,c;return n[0]!==e?(({className:r,...i}=e),n[0]=e,n[1]=r,n[2]=i):(r=n[1],i=n[2]),n[3]!==r?(l=s(zt(),r),n[3]=r,n[4]=l):l=n[4],n[5]!==i||n[6]!==t||n[7]!==l?(c=a.jsx("input",{ref:t,className:l,...i}),n[5]=i,n[6]=t,n[7]=l,n[8]=c):c=n[8],c})).displayName="Input";const Bt=e=>{const t=o.c(7),{openConfirm:n,closeModal:r}=l(),i=Vt;if(c())return null;let s,f,p;return t[0]!==r||t[1]!==n||t[2]!==e.description?(s=t=>{t.stopPropagation(),n({title:"Shutdown",description:e.description,variant:"destructive",confirmAction:a.jsx(u,{onClick:e=>{i(),r()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},t[0]=r,t[1]=n,t[2]=e.description,t[3]=s):s=t[3],t[4]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(d,{strokeWidth:1}),t[4]=f):f=t[4],t[5]!==s?(p=a.jsx(h,{content:"Shutdown",children:a.jsx(Ut,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:"red",className:"h-[27px] w-[27px]",onClick:s,children:f})}),t[5]=s,t[6]=p):p=t[6],p};function qt(){window.close()}function Vt(){f(),setTimeout(qt,200)}function Wt(e,t){const n=o.c(11),{delayMs:r,whenVisible:i,disabled:s}=t,a=void 0!==s&&s,l=p.useRef();let c,u,d,h,f;return n[0]!==e?(c=()=>{l.current=e},u=[e],n[0]=e,n[1]=c,n[2]=u):(c=n[1],u=n[2]),p.useEffect(c,u),n[3]!==r||n[4]!==a||n[5]!==i?(d=()=>{if(null===r||a)return;const e=setInterval((()=>{var e;i&&"visible"!==document.visibilityState||null==(e=l.current)||e.call(l)}),r);return()=>clearInterval(e)},h=[r,i,a],n[3]=r,n[4]=a,n[5]=i,n[6]=d,n[7]=h):(d=n[6],h=n[7]),p.useEffect(d,h),n[8]!==a||n[9]!==i?(f=()=>{var e;"visible"===document.visibilityState&&i&&!a&&(null==(e=l.current)||e.call(l))},n[8]=a,n[9]=i,n[10]=f):f=n[10],g(document,"visibilitychange",f),null}const Gt=e=>{const t=o.c(2),{children:n}=e;let r;return t[0]!==n?(r=a.jsx("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:n}),t[0]=n,t[1]=r):r=t[1],r},Kt=e=>{const t=o.c(10);let n,r,i,s,l;return t[0]!==e?(({children:n,className:r,...i}=e),t[0]=e,t[1]=n,t[2]=r,t[3]=i):(n=t[1],r=t[2],i=t[3]),t[4]!==r?(s=m("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",r),t[4]=r,t[5]=s):s=t[5],t[6]!==n||t[7]!==i||t[8]!==s?(l=a.jsx("div",{...i,className:s,children:n}),t[6]=n,t[7]=i,t[8]=s,t[9]=l):l=t[9],l},Yt=e=>{const t=o.c(2),{children:n}=e;let r;return t[0]!==n?(r=a.jsx("p",{className:"text-sm text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1],r},$t="marimo:copilot:signedIn",Xt=j($t,null,void 0,{getOnInit:!0}),Zt=x(null),Qt=x(null);function Jt(){const e="true"===localStorage.getItem($t),t=v();return e&&"github"===t.completion.copilot}class en extends I{constructor(...n){super(...n),this.documentVersion=0,this.getCompletionInternal=async(e,t)=>await this._request("getCompletions",{doc:{...e.doc,version:t}}),this.throttledGetCompletionInternal=function(n,r,i){var o=!0,s=!0;if("function"!=typeof n)throw new TypeError("Expected a function");return e(i)&&(o="leading"in i?!!i.leading:o,s="trailing"in i?!!i.trailing:s),t(n,r,{leading:o,maxWait:r,trailing:s})}(this.getCompletionInternal,200)}async _request(e,t){try{return await this.request(e,t)}catch(n){throw S.error("CopilotLanguageServerClient#request: Error",n),n}}isDisabled(){return!Jt()}async textDocumentDidOpen(e){return this.isDisabled()?e:super.textDocumentDidOpen(e)}async textDocumentCompletion(e){return[]}async textDocumentDidChange(e){return this.isDisabled()?e:super.textDocumentDidChange({...e,contentChanges:[{text:k(e.contentChanges[0].text)}],textDocument:O.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){S.log("Copilot#signInInitiate: Starting sign-in flow");try{const e=await this._request("signInInitiate",{});return S.log("Copilot#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw S.warn("Copilot#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){S.log("Copilot#signInConfirm: Confirming sign-in");try{const t=await this._request("signInConfirm",e);return S.log("Copilot#signInConfirm: Sign-in confirmed successfully"),t}catch(t){throw S.warn("Copilot#signInConfirm: Failed to confirm sign-in",t),t}}async signedIn(){try{const{status:e}=await this._request("checkStatus",{});return S.log("Copilot#signedIn: Status check completed",{status:e}),"SignedIn"===e||"AlreadySignedIn"===e||"OK"===e}catch(e){throw S.warn("Copilot#signedIn: Failed to check sign-in status",e),e}}acceptCompletion(e){return this._request("notifyAccepted",e)}rejectCompletions(e){return this._request("notifyRejected",e)}async getCompletion(e){if(this.isDisabled())return{completions:[]};const t=this.documentVersion;if(e.doc.version=t,0===t)return{completions:[]};var n;n=t,y.set(Qt,n);const r=await this.throttledGetCompletionInternal(e,t);var i;return i=t,y.get(Qt)===i&&y.set(Qt,null),t!==this.documentVersion?{completions:[]}:r||{completions:[]}}}var tn=C();async function nn(e){return new Promise(((t,n)=>{const r=new WebSocket(e);r.onopen=()=>{r.close(),t(e)},r.onerror=t=>{r.close(),n(new Error(`Failed to connect to ${e}: ${t.type}`))}}))}const rn="/__marimo_copilot__.py",on="copilot",sn=`file://${rn}`,an=D((()=>new ln));class ln extends tn.Transport{constructor(){super(),this.delegate=void 0,this.WS_URL=E("lsp/copilot"),this.delegate=void 0}async tryConnect(e=3,t=1e3){for(let r=1;r<=e;r++)try{return this.delegate||(this.delegate=new T.WebSocketTransport(this.WS_URL)),await this.delegate.connect(),void S.log("Copilot#connect: Connected successfully")}catch(n){if(S.warn(`Copilot#connect: Connection attempt ${r}/${e} failed`,n),r===e)throw this.delegate=void 0,_({variant:"danger",title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Please check settings and try again."}),n;await new Promise((e=>setTimeout(e,t)))}}async connect(){return await b(w,(e=>"github"===e.completion.copilot)),await async function(e,t=5){for(let n=0;n<t;n++)try{return await nn(e)}catch{await new Promise((e=>setTimeout(e,1e3*(n+1))))}throw new Error(`Failed to connect to ${e}`)}(this.WS_URL,3),this.tryConnect()}close(){var e;null==(e=this.delegate)||e.close(),this.delegate=void 0}async sendData(e,t){var n;return t=Math.min(t??5e3,5e3),null==(n=this.delegate)?void 0:n.sendData(e,t)}}const cn=D((()=>new en({rootUri:sn,workspaceFolders:null,transport:an()})));function un(){return N({documentUri:sn,client:cn(),languageId:on,hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1})}const dn=x(!1);function hn(){const e=o.c(5),t=P(Hn),n=P(dn);let r;e[0]!==t||e[1]!==n?(r=e=>{t(e),n(!0)},e[0]=t,e[1]=n,e[2]=r):r=e[2];const i=r;let s;return e[3]!==i?(s={handleClick:i},e[3]=i,e[4]=s):s=e[4],s}const fn=p.memo((()=>{const[e,t]=A(Xt),[n,r]=A(Zt),{handleClick:i}=hn(),[o,s]=p.useState(),[l,c]=p.useState(!1),u=async e=>{e.preventDefault(),c(!0);try{const e=cn(),{verificationUri:n,status:i,userCode:o}=await e.signInInitiate();"OK"===i||"AlreadySignedIn"===i?t(!0):(r("signingIn"),s({url:n,code:o}))}finally{c(!1)}},h=async e=>{if(e.preventDefault(),!o)return;const n=cn();try{c(!0),S.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");const{status:e}=await n.signInConfirm({userCode:o.code});"OK"===e||"AlreadySignedIn"===e?(S.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),t(!0),r("signedIn")):(S.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:e}),r("signInFailed"))}catch(s){if(S.warn("Copilot#tryFinishSignIn: Initial sign-in confirmation failed, attempting retries"),s instanceof Error&&(s.message.includes("ECONNREFUSED")||s.message.includes("WebSocket")||s.message.includes("network")))return S.error("Copilot#tryFinishSignIn: Connection error during sign-in",s),r("connectionError"),void _({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:a.jsx(R,{onClick:u,children:"Retry"})});for(let e=0;e<3;e++)try{await new Promise((e=>setTimeout(e,1e3)));if(await n.signedIn())return S.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),t(!0),void r("signedIn")}catch(l){if(S.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:e+1,maxRetries:3}),l instanceof Error&&(l.message.includes("ECONNREFUSED")||l.message.includes("WebSocket")||l.message.includes("network")))return r("connectionError"),void _({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please check settings and try again.",variant:"danger",action:a.jsx(R,{variant:"link",onClick:()=>i("ai"),children:"Settings"})})}S.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),r("signInFailed")}finally{c(!1)}},f=async e=>{e.preventDefault();const n=cn();t(!1),r("signedOut"),await n.signOut()};return(()=>{switch(n??(e?"signedIn":"connecting")){case"connecting":return a.jsx(M,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return a.jsx(R,{onClick:u,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return a.jsxs("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[a.jsx("li",{children:a.jsxs("div",{className:"flex items-center",children:["Copy this code:",a.jsx("strong",{className:"ml-2",children:null==o?void 0:o.code}),a.jsx(H,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{o&&(await z(o.code),_({description:"Copied to clipboard"}))}})]})}),a.jsxs("li",{children:["Enter the code at this link:",a.jsx("a",{href:null==o?void 0:o.url,target:"_blank",rel:"noreferrer",className:U({variant:"link",size:"xs"}),children:null==o?void 0:o.url})]}),a.jsxs("li",{children:["Click here when done:",a.jsxs(R,{size:"xs",onClick:h,className:"ml-1",children:[l&&a.jsx(F,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),l?a.jsx(F,{className:"h-3 w-3 mr-1 animate-spin"}):a.jsx(R,{onClick:u,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return a.jsxs("div",{className:"flex items-center gap-5",children:[a.jsxs(M,{className:"font-normal flex items-center",children:[a.jsx("div",{className:"inline-flex items-center justify-center bg-[var(--grass-7)] rounded-full p-1 mr-2",children:a.jsx(L,{className:"h-3 w-3 text-white"})}),"Connected"]}),a.jsx(R,{onClick:f,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs(M,{className:"font-normal flex",children:[a.jsx(d,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),a.jsx("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),a.jsx(R,{onClick:u,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs(M,{className:"font-normal flex",children:[a.jsx(d,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),a.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",a.jsx("a",{className:"hyperlink",href:"https://docs.marimo.io/getting_started/index.html#github-copilot",target:"_blank",rel:"noreferrer",children:"docs"}),"."]})]})}})()}));var pn;fn.displayName="CopilotConfig";const gn=D((()=>{$.defineAction("goToDefinition",(e=>{const t=e.cm6;return X(t)})),$.mapCommand("gd","action","goToDefinition",{},{context:"normal"})}));class mn{constructor(){this.instances=new Set,this.isBroadcasting=!1}addInstance(e){this.instances.add(e);const t=Z(e);t?t.on("vim-mode-change",(t=>{var n;this.isBroadcasting||(Q("mode"in t,'Expected event to have a "mode" property'),this.isBroadcasting=!0,n=()=>{this.broadcastModeChange(e,t.mode,t.subMode),this.isBroadcasting=!1},"scheduler"in window?window.scheduler.postTask(n,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(n):setTimeout(n,0))})):S.warn("Expected CodeMirror instance to have CodeMirror instance state")}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,t,n){Q("exitInsertMode"in $,"Vim does not have an exitInsertMode method"),Q("exitVisualMode"in $,"Vim does not have an exitVisualMode method");for(const r of this.instances)if(r!==e){const e=Z(r);if(!e){S.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}const n=e.setSelections.bind(e);e.setSelections=()=>[];const i=e.state.vim;if(!i){S.warn("Expected CodeMirror instance to have Vim state");continue}switch(t){case"normal":i.insertMode&&$.exitInsertMode(e,!0),i.visualMode&&$.exitVisualMode(e,!0);break;case"insert":i.insertMode||$.handleKey(e,"i","")}e.setSelections=n}}}pn=mn,mn.INSTANCES=new pn;const vn=["default","vim"];function yn(e){switch(e.preset){case"default":return[B.of(re),ee.low(B.of([{key:"Escape",preventDefault:!0,run:e=>(e.contentDOM.blur(),!0)}]))];case"vim":return[B.of(xn()),B.of([{key:"Enter",run:e=>{var t;const n=Z(e);return!!(null==(t=null==n?void 0:n.state.vim)?void 0:t.insertMode)&&ne(e)}}]),ee.high(bn("d",(e=>""===e.state.doc.toString()),(e=>{if(""===e.state.doc.toString()){return e.state.facet(G).deleteCell(),!0}return!1}))),te({status:!1}),ee.high((gn(),[B.of([{key:"j",run:e=>{if(V(e,!0)&&W(e)){const t=e.state.facet(G),n=e.state.facet(K);return t.moveToNextCell({cellId:n,before:!1,noCreate:!0}),!0}return!1}}]),B.of([{key:"k",run:e=>{if(Y(e)&&W(e)){const t=e.state.facet(G),n=e.state.facet(K);return t.moveToNextCell({cellId:n,before:!0,noCreate:!0}),!0}return!1}}]),q.define((e=>(requestAnimationFrame((()=>{mn.INSTANCES.addInstance(e)})),{destroy(){mn.INSTANCES.removeInstance(e)}})))]))];default:return J(e.preset),[]}}const xn=D((()=>{const e=new Set(["Enter","Ctrl-v"]);return re.filter((t=>!e.has(t.key||t.mac||t.linux||t.win||"")))}));function bn(e,t,n){let r="",i=0;return B.of([{any:(o,s)=>{const a=s.key,l=s.timeStamp;if(a!==e||!t(o))return r="",i=0,!1;if(r===e&&l-i<500){if(n(o))return r="",i=0,!0}return r=a,i=l,!1}}])}function jn(){return["compact","medium","full","columns"]}const wn=x({});function In(){return oe(wn)}function Sn(e,t){const n=o.c(13),{registerAction:r,unregisterAction:i}=function(){const e=P(wn);return{registerAction:ie(((t,n)=>{e((e=>({...e,[t]:n})))})),unregisterAction:ie((t=>{e((e=>{const{[t]:n,...r}=e;return r}))}))}}(),s=oe(se),a=t===ae.NOOP;let l;n[0]!==t?(l=e=>t(e),n[0]=t,n[1]=l):l=n[1];const c=ie(l);let u;n[2]!==t||n[3]!==s||n[4]!==e?(u=n=>{const r=s.getHotkey(e).key;if(le(r)(n)){!1!==t(n)&&(n.preventDefault(),n.stopPropagation())}},n[2]=t,n[3]=s,n[4]=e,n[5]=u):u=n[5];const d=ie(u);let h,f;g(document,"keydown",d),n[6]!==a||n[7]!==c||n[8]!==r||n[9]!==e||n[10]!==i?(h=()=>{if(!a)return r(e,c),()=>i(e)},f=[c,e,a,r,i],n[6]=a,n[7]=c,n[8]=r,n[9]=e,n[10]=i,n[11]=h,n[12]=f):(h=n[11],f=n[12]),p.useEffect(h,f)}function On(e,t){const n=o.c(3),r=oe(se);let i;n[0]!==t||n[1]!==r?(i=e=>{for(const[n,i]of ce.entries(t)){if(void 0===i)continue;const t=r.getHotkey(n).key;if(le(t)(e)){S.debug("Satisfied",t,e);!1!==i(e)&&(e.preventDefault(),e.stopPropagation())}}},n[0]=t,n[1]=r,n[2]=i):i=n[2],g(e,"keydown",i)}function kn(e,t){const n=o.c(2);let r;n[0]!==t?(r=e=>{for(const[n,r]of ce.entries(t))if(le(n)(e)){S.debug("Satisfied",n,e);!1!==r(e)&&(e.preventDefault(),e.stopPropagation())}},n[0]=t,n[1]=r):r=n[1],g(e,"keydown",r)}const Cn=x(!1),Nn=()=>{const e=o.c(78),[t,n]=A(Cn),[r,i]=p.useState(null);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[l,c]=p.useState(s),[u,h]=ue(),f=oe(se);let g,m;e[1]!==n?(g=()=>n(Dn),e[1]=n,e[2]=g):g=e[2],Sn("global.showHelp",g),e[3]!==u||e[4]!==h?(m=async e=>{const t={...u};h(e),await de({config:e}).catch((e=>{throw h(t),e}))},e[3]=u,e[4]=h,e[5]=m):m=e[5];const v=m;let y;e[6]!==u||e[7]!==r||e[8]!==v?(y=async e=>{if(!r)return;const t=e.join("-"),n={...u,keymap:{...u.keymap,overrides:{...u.keymap.overrides,[r]:t}}};i(null),c([]),await v(n)},e[6]=u,e[7]=r,e[8]=v,e[9]=y):y=e[9];const x=y;let b;e[10]!==u||e[11]!==r||e[12]!==v?(b=async()=>{if(!r)return;const e={...u,keymap:{...u.keymap,overrides:{...u.keymap.overrides}}};delete e.keymap.overrides[r],i(null),c([]),await v(e)},e[10]=u,e[11]=r,e[12]=v,e[13]=b):b=e[13];const j=b;let w;e[14]!==u||e[15]!==v?(w=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;const e={...u,keymap:{...u.keymap,overrides:{}}};i(null),c([]),await v(e)},e[14]=u,e[15]=v,e[16]=w):w=e[16];const I=w;if(!t)return null;let S;e[17]!==r||e[18]!==x||e[19]!==j||e[20]!==f||e[21]!==l?(S=e=>{const t=f.getHotkey(e);if(r===e){const n=he(e);return a.jsxs("div",{children:[a.jsx(fe,{defaultValue:l.join("+"),placeholder:t.name,onKeyDown:e=>{e.preventDefault();const t=[];if("Meta"===e.key||"Control"===e.key||"Alt"===e.key||"Shift"===e.key)return;if(e.metaKey&&t.push(pe()?"Cmd":"Meta"),e.ctrlKey&&t.push("Ctrl"),e.altKey&&t.push("Alt"),e.shiftKey&&t.push("Shift"),"-"===e.key)return;if("Escape"===e.key&&0===t.length)return i(null),void c([]);let n=e.key.toLowerCase();" "===e.key&&(n="Space"),t.push(n),x(t)},autoFocus:!0,endAdornment:a.jsx(R,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{i(null),c([])},children:a.jsx(d,{className:"w-4 h-4"})})}),a.jsxs("div",{className:"flex items-center justify-between w-full",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),n.key!==t.key&&a.jsxs("span",{className:"text-xs cursor-pointer text-primary",onClick:j,children:["Reset to default:"," ",a.jsx("span",{className:"font-mono",children:n.key})]})]})]},e)}return a.jsxs("div",{className:"grid grid-cols-[auto,2fr,3fr] gap-2 items-center",children:[f.isEditable(e)?a.jsx(ge,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{c([]),i(e)}}):a.jsx("div",{className:"w-3 h-3"}),a.jsx(me,{className:"justify-end",shortcut:t.key}),a.jsx("span",{children:t.name.toLowerCase()})]},e)},e[17]=r,e[18]=x,e[19]=j,e[20]=f,e[21]=l,e[22]=S):S=e[22];const O=S;let k,C,N,D,E,T,_,P,M,L,F,H,z,U,B,q,V,W,G,K,Y,$,X,Z;if(e[23]!==f||e[24]!==t||e[25]!==O||e[26]!==n){const r=f.getHotkeyGroups(),i=e=>{const t=r[e];return a.jsxs("div",{className:"mb-[40px] gap-2 flex flex-col",children:[a.jsx("h3",{className:"text-lg font-medium",children:e}),t.map((e=>O(e)))]})};N=ve,z=t,e[44]!==n?(U=e=>n(e),e[44]=n,e[45]=U):U=e[45],C=ye,F="sm:items-center sm:top-0",e[46]===Symbol.for("react.memo_cache_sentinel")?(H=a.jsx(xe,{}),e[46]=H):H=e[46],k=be,P=!1,M="max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",e[47]===Symbol.for("react.memo_cache_sentinel")?(L=a.jsx(je,{children:a.jsx(we,{children:"Shortcuts"})}),e[47]=L):L=e[47],T="flex flex-row gap-3",_=a.jsxs("div",{className:"w-1/2",children:[i("Editing"),i("Markdown")]}),B="w-1/2",q=i("Navigation"),V=i("Running Cells"),D=i("Creation and Ordering"),E=i("Other"),e[23]=f,e[24]=t,e[25]=O,e[26]=n,e[27]=k,e[28]=C,e[29]=N,e[30]=D,e[31]=E,e[32]=T,e[33]=_,e[34]=P,e[35]=M,e[36]=L,e[37]=F,e[38]=H,e[39]=z,e[40]=U,e[41]=B,e[42]=q,e[43]=V}else k=e[27],C=e[28],N=e[29],D=e[30],E=e[31],T=e[32],_=e[33],P=e[34],M=e[35],L=e[36],F=e[37],H=e[38],z=e[39],U=e[40],B=e[41],q=e[42],V=e[43];return e[48]===Symbol.for("react.memo_cache_sentinel")?(W=a.jsx("span",{className:"text-destructive",children:"Reset all to default"}),e[48]=W):W=e[48],e[49]!==I?(G=a.jsx(R,{className:"mt-4 hover:bg-destructive/10 hover:border-destructive",variant:"outline",size:"xs",onClick:I,tabIndex:-1,children:W}),e[49]=I,e[50]=G):G=e[50],e[51]!==D||e[52]!==E||e[53]!==G||e[54]!==B||e[55]!==q||e[56]!==V?(K=a.jsxs("div",{className:B,children:[q,V,D,E,G]}),e[51]=D,e[52]=E,e[53]=G,e[54]=B,e[55]=q,e[56]=V,e[57]=K):K=e[57],e[58]!==T||e[59]!==_||e[60]!==K?(Y=a.jsxs("div",{className:T,children:[_,K]}),e[58]=T,e[59]=_,e[60]=K,e[61]=Y):Y=e[61],e[62]!==k||e[63]!==P||e[64]!==M||e[65]!==L||e[66]!==Y?($=a.jsxs(k,{usePortal:P,className:M,children:[L,Y]}),e[62]=k,e[63]=P,e[64]=M,e[65]=L,e[66]=Y,e[67]=$):$=e[67],e[68]!==C||e[69]!==F||e[70]!==H||e[71]!==$?(X=a.jsxs(C,{className:F,children:[H,$]}),e[68]=C,e[69]=F,e[70]=H,e[71]=$,e[72]=X):X=e[72],e[73]!==N||e[74]!==z||e[75]!==U||e[76]!==X?(Z=a.jsx(N,{open:z,onOpenChange:U,children:X}),e[73]=N,e[74]=z,e[75]=U,e[76]=X,e[77]=Z):Z=e[77],Z};function Dn(e){return!e}const En=["claude-3-7-sonnet-20250219","claude-3-5-sonnet-20241022","claude-3-opus","claude-3.5-haiku","claude-3.5-sonnet","deepseek-v3","gemini-2.0-flash-exp","gemini-2.0-flash-thinking-exp","gemini-exp-1206","gpt-3.5-turbo","gpt-4","gpt-4-turbo-2024-04-09","gpt-4o","gpt-4o-mini","o1","o1-mini","o1-preview"],Tn=[{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:[c()?{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"}];Te("lsp")&&Tn.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol"});const _n=()=>{const e=o.c(32),[t]=ue(),n=t.package_management.manager;let r;e[0]!==n?(r=[n],e[0]=n,e[1]=r):r=e[1];const{data:i,loading:s,error:l,reload:c}=Ie(An,r);if(s&&!i){let t;return e[2]===Symbol.for("react.memo_cache_sentinel")?(t=a.jsx(Ne,{size:"medium",centered:!0}),e[2]=t):t=e[2],t}if(l){let t;return e[3]!==l?(t=a.jsx(_e,{error:l}),e[3]=l,e[4]=t):t=e[4],t}let u;e[5]!==(null==i?void 0:i.packages)?(u=(null==i?void 0:i.packages)||[],e[5]=null==i?void 0:i.packages,e[6]=u):u=e[6];const d=u;let h,f,p,g,m,v,y,x,b,j;if(e[7]!==d||e[8]!==n||e[9]!==c){const t=new Set(d.map(Mn));m="flex-1 flex flex-col overflow-hidden gap-2",e[17]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Kt,{children:"Optional Features"}),e[17]=v):v=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",a.jsx("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),e[18]=y):y=e[18],f=Pe,e[19]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(Ae,{children:a.jsxs(Se,{children:[a.jsx(Me,{children:"Dependency"}),a.jsx(Me,{children:"Feature"}),a.jsx(Me,{children:"Status"}),a.jsx(Me,{})]})}),e[19]=g):g=e[19],h=Re,p=Tn.map((e=>{const r=e.packagesRequired.every((e=>t.has(e.name.split("[")[0]))),i=e.packagesRequired.map(Rn).join(", ");return a.jsxs(Se,{className:"text-sm",children:[a.jsx(Oe,{children:e.description}),a.jsx(Oe,{className:"font-mono text-xs",children:i}),a.jsx(Oe,{children:r?a.jsxs("div",{className:"flex items-center",children:[a.jsx(St,{className:"h-4 w-4 text-[var(--grass-10)] mr-2"}),a.jsx("span",{children:"Installed"})]}):a.jsxs("div",{className:"flex items-center",children:[a.jsx(ke,{className:"h-4 w-4 text-[var(--red-10)] mr-2"}),a.jsx(Pn,{packageSpecs:[...e.packagesRequired,...e.additionalPackageInstalls],packageManager:n,onSuccess:c})]})})]},e.id)})),e[7]=d,e[8]=n,e[9]=c,e[10]=h,e[11]=f,e[12]=p,e[13]=g,e[14]=m,e[15]=v,e[16]=y}else h=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=e[16];return e[20]!==h||e[21]!==p?(x=a.jsx(h,{children:p}),e[20]=h,e[21]=p,e[22]=x):x=e[22],e[23]!==f||e[24]!==g||e[25]!==x?(b=a.jsxs(f,{children:[g,x]}),e[23]=f,e[24]=g,e[25]=x,e[26]=b):b=e[26],e[27]!==m||e[28]!==v||e[29]!==y||e[30]!==b?(j=a.jsxs("div",{className:m,children:[v,y,b]}),e[27]=m,e[28]=v,e[29]=y,e[30]=b,e[31]=j):j=e[31],j},Pn=({packageSpecs:e,packageManager:t,onSuccess:n})=>{const[r,o]=i.useState(!1);return a.jsxs(R,{size:"xs",variant:"outline",className:m("text-xs",r&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{o(!0);const t=e.map((e=>e.minVersion?`${e.name}>=${e.minVersion}`:e.name)).join(" "),r=await De({package:t});r.success?(n(),_({title:"Package installed",description:a.jsxs("span",{children:["The packages"," ",a.jsx(Ee,{className:"inline",children:e.map((e=>e.name)).join(", ")})," ","have been added to your environment."]})})):_({title:"Failed to install package",description:r.error,variant:"danger"})}finally{o(!1)}},disabled:r,children:[r?a.jsx(Ne,{size:"small",className:"mr-2 h-3 w-3"}):a.jsx(wt,{className:"mr-2 h-3 w-3"}),"Install with ",t]})};function An(){return Ce()}function Mn(e){return e.name}function Rn(e){return e.name}const Ln="flex flex-row items-center space-x-1 space-y-0",Fn=[{id:"editor",label:"Editor",Icon:ge,className:"bg-[var(--blue-4)]"},{id:"display",label:"Display",Icon:Pt,className:"bg-[var(--grass-4)]"},{id:"packageManagement",label:"Package Management",Icon:At,className:"bg-[var(--red-4)]"},{id:"runtime",label:"Runtime",Icon:kt,className:"bg-[var(--amber-4)]"},{id:"ai",label:"AI",Icon:It,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Nt,className:"bg-[var(--orange-4)]"},{id:"labs",label:"Labs",Icon:Ct,className:"bg-[var(--slate-4)]"}],Hn=x(Fn[0].id),zn=()=>{const e=o.c(41),[t,n]=Le(),r=p.useRef(null),i=P(Cn),[s,l]=A(Hn);let u,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=Fe(He),e[0]=u):u=e[0],e[1]!==t?(d={resolver:u,defaultValues:t},e[1]=t,e[2]=d):d=e[2];const h=ze(d);let f;e[3]!==n?(f=async e=>{await de({config:e}).then((()=>{n(e)}))},e[3]=n,e[4]=f):f=e[4];const g=f;let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=c(),e[5]=m):m=e[5];const v=m;let y;e[6]!==t||e[7]!==h?(y=()=>{const e=h.getValues("completion.copilot");return!1===e?null:"codeium"===e?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-sm text-muted-secondary",children:["To get a Codeium API key, follow"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#codeium-copilot",target:"_blank",rel:"noreferrer",children:"these instructions"}),"."]}),a.jsx(We,{control:h.control,name:"completion.codeium_api_key",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"API Key"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"codeium-api-key-input",className:"m-0 inline-flex",placeholder:"key",...n,value:n.value||""})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.codeium_api_key"})]})}})]}):"github"===e?a.jsx(fn,{}):"custom"===e?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-sm text-muted-secondary",children:"Configure your custom AI completion provider with the following settings."}),a.jsx(We,{control:h.control,name:"completion.model",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Model"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"custom-model-input",className:"m-0 inline-flex",placeholder:"Qwen2.5-Coder-7B",...n,value:n.value||""})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.model"})]})}}),a.jsx(We,{control:h.control,name:"completion.base_url",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Base URL"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"custom-base-url-input",className:"m-0 inline-flex",placeholder:"http://localhost:11434/v1",...n,value:n.value||""})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.base_url"})]})}}),a.jsx(We,{control:h.control,name:"completion.api_key",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"API Key"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"custom-api-key-input",className:"m-0 inline-flex",placeholder:"key",...n,value:n.value||""})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.api_key"})]})}})]}):void 0},e[6]=t,e[7]=h,e[8]=y):y=e[8];const x=y;let b;e[9]!==s||e[10]!==t||e[11]!==h||e[12]!==g||e[13]!==x||e[14]!==l||e[15]!==i?(b=()=>{switch(s){case"editor":return a.jsxs(a.Fragment,{children:[a.jsxs(Un,{title:"Autosave",children:[a.jsx(We,{control:h.control,name:"save.autosave",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Autosave enabled"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"autosave-checkbox",checked:"after_delay"===n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(e?"after_delay":"off")}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"save.autosave"})]})}}),a.jsx(We,{control:h.control,name:"save.autosave_delay",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Autosave delay (seconds)"}),a.jsx(Ye,{children:a.jsx(nt,{"data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:"after_delay"!==h.getValues("save.autosave"),...n,value:n.value/1e3,minValue:1,onChange:e=>{n.onChange(1e3*e),Number.isNaN(e)||g(h.getValues())}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"save.autosave_delay"})]})}})]}),a.jsxs(Un,{title:"Formatting",children:[a.jsx(We,{control:h.control,name:"save.format_on_save",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Format on save"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"format-on-save-checkbox",checked:n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(e)}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"save.format_on_save"})]})}}),a.jsx(We,{control:h.control,name:"formatting.line_length",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Line length"}),a.jsx(Ye,{children:a.jsx(nt,{"data-testid":"line-length-input",className:"m-0 w-24",...n,value:n.value,minValue:1,maxValue:1e3,onChange:e=>{n.onChange(e),Number.isNaN(e)||g(h.getValues())}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"formatting.line_length"})]}),a.jsx(Ze,{children:"Maximum line length when formatting code."})]})}})]}),a.jsx(Un,{title:"Autocomplete",children:a.jsx(We,{control:h.control,name:"completion.activate_on_typing",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Autocomplete"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"autocomplete-checkbox",checked:n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(Boolean(e))}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.activate_on_typing"})]}),a.jsx(Ze,{children:"When unchecked, code completion is still available through a hotkey."}),a.jsx("div",{children:a.jsx(R,{variant:"link",className:"mb-0 px-0",type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),l("ai")},children:"Edit AI autocomplete"})})]})}})}),Te("lsp")&&a.jsxs(Un,{title:"Language Servers",children:[a.jsx(We,{control:h.control,name:"language_servers.pylsp.enabled",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsxs(Ke,{children:[a.jsx(rt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",a.jsx("a",{href:"https://github.com/python-lsp/python-lsp-server",target:"_blank",className:"text-link hover:underline",rel:"noreferrer",children:"pylsp"}),")"]}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"pylsp-checkbox",checked:n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(Boolean(e))}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"language_servers.pylsp.enabled"})]})}}),a.jsxs(Ze,{children:["See the"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/language_server/",target:"_blank",rel:"noreferrer",children:"docs"})," ","for more information about language server support."]}),a.jsx(We,{control:h.control,name:"diagnostics.enabled",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsxs(Ke,{children:[a.jsx(rt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"diagnostics-checkbox",checked:n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(Boolean(e))}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"diagnostics.enabled"})]})}})]}),a.jsx(Un,{title:"Keymap",children:a.jsx(We,{control:h.control,name:"keymap.preset",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Keymap"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"keymap-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:vn.map(qn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"keymap.preset"})]}),a.jsx("div",{children:a.jsx(R,{variant:"link",className:"mb-0 px-0",type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),i(!0)},children:"Edit Keyboard Shortcuts"})})]})}})})]});case"display":return a.jsxs(a.Fragment,{children:[a.jsxs(Un,{title:"Display",children:[a.jsx(We,{control:h.control,name:"display.default_width",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Default width"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"user-config-width-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(Vn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"display.default_width"})]}),a.jsx(Ze,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),a.jsx(We,{control:h.control,name:"display.theme",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Theme"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"theme-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:tt.map(Wn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"display.theme"})]}),a.jsx(Ze,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),a.jsx(We,{control:h.control,name:"display.code_editor_font_size",render:e=>{const{field:n}=e;return a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Code editor font size (px)"}),a.jsx(Ye,{children:a.jsx("span",{className:"inline-flex mr-2",children:a.jsx(nt,{"data-testid":"code-editor-font-size-input",className:"m-0 w-24",...n,value:n.value,minValue:8,maxValue:32,onChange:e=>{n.onChange(e),g(h.getValues())}})})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"display.code_editor_font_size"})]})}})]}),a.jsxs(Un,{title:"Outputs",children:[a.jsx(We,{control:h.control,name:"display.cell_output",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Cell output area"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"cell-output-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["above","below"].map(Gn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"display.cell_output"})]}),a.jsx(Ze,{children:"Where to display cell's output."})]})}}),a.jsx(We,{control:h.control,name:"display.dataframes",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Dataframe viewer"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"display-dataframes-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(Kn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"display.dataframes"})]}),a.jsx(Ze,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}})]})]});case"packageManagement":return a.jsx(Un,{title:"Package Management",children:a.jsx(We,{control:h.control,disabled:v,name:"package_management.manager",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Manager"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"package-manager-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:et.map(Yn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"package_management.manager"})]}),a.jsxs(Ze,{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"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/package_management.html",target:"_blank",rel:"noreferrer",children:"docs"}),".",a.jsx("br",{}),a.jsx("br",{}),"Running marimo in a"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/package_management.html#running-marimo-in-a-sandbox-environment-uv-only",target:"_blank",rel:"noreferrer",children:"sandboxed environment"})," ","is only supported by ",a.jsx(Ee,{className:"inline",children:"uv"})]})]})}})});case"runtime":return a.jsxs(Un,{title:"Runtime configuration",children:[a.jsx(We,{control:h.control,name:"runtime.auto_instantiate",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Autorun on startup"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"auto-instantiate-checkbox",disabled:n.disabled,checked:n.value,onCheckedChange:n.onChange})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"runtime.auto_instantiate"})]}),a.jsx(Ze,{children:"Whether to automatically run all cells on startup."})]})}}),a.jsx(We,{control:h.control,name:"runtime.on_cell_change",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"On cell change"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"on-cell-change-select",onChange:e=>n.onChange(e.target.value),value:n.value,className:"inline-flex mr-2",children:["lazy","autorun"].map($n)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"runtime.on_cell_change"})]}),a.jsx(Ze,{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.'})]})}}),a.jsx(We,{control:h.control,name:"runtime.auto_reload",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"On module change"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"auto-reload-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:v,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(Xn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"runtime.auto_reload"})]}),a.jsx(Ze,{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.'})]})}}),a.jsxs(Ze,{children:["Learn more in the"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",target:"_blank",rel:"noreferrer",children:"docs"}),"."]})]});case"ai":return a.jsxs(a.Fragment,{children:[a.jsxs(Un,{title:"AI Code Completion",children:[a.jsx("p",{className:"text-sm text-muted-secondary",children:"You may use GitHub Copilot, Codeium, or a custom provider (e.g. Ollama) for AI code completion."}),a.jsx(We,{control:h.control,name:"completion.copilot",render:e=>{const{field:n}=e;return a.jsx("div",{className:"flex flex-col space-y-1",children:a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Provider"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"copilot-select",onChange:e=>{"none"===e.target.value?n.onChange(!1):n.onChange(e.target.value)},value:!0===n.value?"github":!1===n.value?"none":n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["none","github","codeium","custom"].map(Zn)})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"completion.copilot"})]})})}}),x()]}),a.jsxs(Un,{title:"AI Keys",children:[a.jsx(We,{control:h.control,name:"ai.open_ai.api_key",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"OpenAI API Key"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"ai-openai-api-key-input",className:"m-0 inline-flex",placeholder:"sk-proj...",...n,onChange:e=>{const t=e.target.value;t.includes("*")||n.onChange(t)}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.open_ai.api_key"})]}),a.jsxs(Ze,{children:["Your OpenAI API key from"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://platform.openai.com/account/api-keys",target:"_blank",rel:"noreferrer",children:"platform.openai.com"}),"."]})]})}}),a.jsx(We,{control:h.control,name:"ai.anthropic.api_key",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Anthropic API Key"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"ai-anthropic-api-key-input",className:"m-0 inline-flex",placeholder:"sk-ant...",...n,onChange:e=>{const t=e.target.value;t.includes("*")||n.onChange(t)}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.anthropic.api_key"})]}),a.jsxs(Ze,{children:["Your Anthropic API key from"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://console.anthropic.com/settings/keys",target:"_blank",rel:"noreferrer",children:"console.anthropic.com"}),"."]})]})}}),a.jsx(We,{control:h.control,name:"ai.google.api_key",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Google AI API Key"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"ai-google-api-key-input",className:"m-0 inline-flex",placeholder:"AI...",...n,onChange:e=>{const t=e.target.value;t.includes("*")||n.onChange(t)}})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.google.api_key"})]}),a.jsxs(Ze,{children:["Your Google AI API key from"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://aistudio.google.com/app/apikey",target:"_blank",rel:"noreferrer",children:"aistudio.google.com"}),"."]})]})}})]}),a.jsxs(Un,{title:"AI Assist",children:[a.jsxs("p",{className:"text-sm text-muted-secondary",children:["Add an API key to ",a.jsx(Ee,{className:"inline",children:"marimo.toml"})," to activate marimo's AI assistant; see"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/ai_completion.html",target:"_blank",rel:"noreferrer",children:"docs"})," ","for more info."]}),a.jsx(We,{control:h.control,disabled:v,name:"ai.open_ai.base_url",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Base URL"}),a.jsx(Ye,{children:a.jsx(fe,{"data-testid":"ai-base-url-input",className:"m-0 inline-flex",placeholder:"https://api.openai.com/v1",...n})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.open_ai.base_url"})]}),a.jsx(Ze,{children:"This URL can be any OpenAI-compatible API endpoint."})]})}}),a.jsx(We,{control:h.control,disabled:v,name:"ai.open_ai.model",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{children:"Model"}),a.jsx(Ye,{children:a.jsx(fe,{list:"ai-model-datalist","data-testid":"ai-model-input",className:"m-0 inline-flex",placeholder:"gpt-4-turbo",...n})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.open_ai.model"})]}),a.jsx("datalist",{id:"ai-model-datalist",children:En.map(Qn)}),a.jsx(Ze,{children:'If the model starts with "claude-", we will use your Anthropic API key. If the model starts with "gemini-", we will use your Google AI API key. Otherwise, we will use your OpenAI API key.'})]})}}),a.jsx(We,{control:h.control,name:"ai.rules",render:e=>{const{field:n}=e;return a.jsxs("div",{className:"flex flex-col",children:[a.jsxs(Ge,{children:[a.jsx(Ke,{children:"Custom Rules"}),a.jsx(Ye,{children:a.jsx(Qe,{"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",...n,value:n.value})}),a.jsx($e,{}),a.jsx(Bn,{userConfig:t,name:"ai.rules"})]}),a.jsx(Ze,{children:"Custom rules to include in all AI completion prompts."})]})}})]})]});case"optionalDeps":return a.jsx(_n,{});case"labs":return a.jsxs(Un,{title:"Experimental Features",children:[a.jsx("p",{className:"text-sm text-muted-secondary mb-4",children:"⚠️ These features are experimental and may require restarting your notebook to take effect."}),a.jsx(We,{control:h.control,name:"experimental.lsp",render:Jn}),a.jsx(We,{control:h.control,name:"experimental.inline_ai_tooltip",render:er}),a.jsx(We,{control:h.control,name:"experimental.reactive_tests",render:tr}),a.jsx(We,{control:h.control,name:"experimental.toplevel_defs",render:nr})]})}},e[9]=s,e[10]=t,e[11]=h,e[12]=g,e[13]=x,e[14]=l,e[15]=i,e[16]=b):b=e[16];const j=b;let w,I,S;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(Ee,{className:"inline",children:"marimo.toml"}),I=a.jsx("br",{}),e[17]=w,e[18]=I):(w=e[17],I=e[18]),e[19]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsxs("p",{className:"text-muted-secondary",children:["User configuration is stored in ",w,I,"Run ",a.jsx(Ee,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),e[19]=S):S=e[19];const O=S;let k,C,N,D,E,T,_,M,L;return e[20]!==h||e[21]!==g?(k=h.handleSubmit(g),e[20]=h,e[21]=g,e[22]=k):k=e[22],e[23]!==l?(C=e=>l(e),e[23]=l,e[24]=C):C=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(N=Fn.map(rr),e[25]=N):N=e[25],e[26]===Symbol.for("react.memo_cache_sentinel")?(D=a.jsxs(Ue,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[N,a.jsx("div",{className:"p-2 text-xs text-muted-foreground self-start",children:a.jsxs("span",{children:["Version: ",Be()]})}),a.jsx("div",{className:"flex-1"}),!c()&&O]}),e[26]=D):D=e[26],e[27]!==s||e[28]!==C?(E=a.jsx(it,{value:s,onValueChange:C,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:D}),e[27]=s,e[28]=C,e[29]=E):E=e[29],e[30]!==j?(T=j(),e[30]=j,e[31]=T):T=e[31],e[32]!==T?(_=a.jsx("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:T}),e[32]=T,e[33]=_):_=e[33],e[34]!==E||e[35]!==_||e[36]!==k?(M=a.jsxs("form",{ref:r,onChange:k,className:"flex text-pretty overflow-hidden",children:[E,_]}),e[34]=E,e[35]=_,e[36]=k,e[37]=M):M=e[37],e[38]!==h||e[39]!==M?(L=a.jsx(qe,{...h,children:M}),e[38]=h,e[39]=M,e[40]=L):L=e[40],L},Un=e=>{const t=o.c(5),{title:n,children:r}=e;let i,s;return t[0]!==n?(i=a.jsx(Kt,{children:n}),t[0]=n,t[1]=i):i=t[1],t[2]!==r||t[3]!==i?(s=a.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[i,r]}),t[2]=r,t[3]=i,t[4]=s):s=t[4],s},Bn=e=>{const t=o.c(24),{userConfig:n,name:r}=e;let i;t[0]!==r||t[1]!==n?(i=ot(n,r),t[0]=r,t[1]=n,t[2]=i):i=t[2];const s=i,l=oe(st);let c;t[3]!==r||t[4]!==l?(c=ot(l,r),t[3]=r,t[4]=l,t[5]=c):c=t[5];const u=c;if(null==u)return null;if(s===u)return null;let d,f,p,g;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsxs("span",{children:["This setting is overridden by"," ",a.jsx(Ee,{className:"inline",children:"pyproject.toml"}),"."]}),f=a.jsx("br",{}),t[6]=d,t[7]=f):(d=t[6],f=t[7]),t[8]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsxs("span",{children:["Edit the ",a.jsx(Ee,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),g=a.jsx("br",{}),t[8]=p,t[9]=g):(p=t[8],g=t[9]);const m=String(s);let v,y;t[10]!==m?(v=a.jsxs("span",{children:["User value: ",a.jsx("strong",{children:m})]}),t[10]=m,t[11]=v):v=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx("br",{}),t[12]=y):y=t[12];const x=String(u);let b,j,w;t[13]!==x?(b=a.jsxs("span",{children:["Project value: ",a.jsx("strong",{children:x})]}),t[13]=x,t[14]=b):b=t[14],t[15]!==b||t[16]!==v?(j=a.jsxs(a.Fragment,{children:[d,f,p,g,v,y,b]}),t[15]=b,t[16]=v,t[17]=j):j=t[17],t[18]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(Nt,{className:"w-3 h-3"}),t[18]=w):w=t[18];const I=String(u);let S,O;return t[19]!==I?(S=a.jsxs("span",{className:"text-[var(--amber-12)] text-xs flex items-center gap-1 border rounded px-2 py-1 bg-[var(--amber-2)] border-[var(--amber-6)] ml-1",children:[w,"Overridden by pyproject.toml [",I,"]"]}),t[19]=I,t[20]=S):S=t[20],t[21]!==j||t[22]!==S?(O=a.jsx(h,{content:j,children:S}),t[21]=j,t[22]=S,t[23]=O):O=t[23],O};function qn(e){return a.jsx("option",{value:e,children:e},e)}function Vn(e){return a.jsx("option",{value:e,children:e},e)}function Wn(e){return a.jsx("option",{value:e,children:e},e)}function Gn(e){return a.jsx("option",{value:e,children:e},e)}function Kn(e){return a.jsx("option",{value:e,children:e},e)}function Yn(e){return a.jsx("option",{value:e,children:e},e)}function $n(e){return a.jsx("option",{value:e,children:e},e)}function Xn(e){return a.jsx("option",{value:e,children:e},e)}function Zn(e){return a.jsx("option",{value:e,children:e},e)}function Qn(e){return a.jsx("option",{value:e,children:e},e)}function Jn(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"LSP (Language Server Protocol)"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"inline-ai-checkbox",checked:!0===t.value,onCheckedChange:t.onChange})})]}),a.jsxs(Ze,{children:["Enable experimental LSP support. You will need to have",a.jsx(Ee,{className:"inline",children:"marimo[lsp]"})," installed in your environment to use this. See"," ",a.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/language_server/",target:"_blank",rel:"noreferrer",children:"docs"})," ","for more info."]})]})}function er(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"AI Edit Tooltip"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"inline-ai-checkbox",checked:!0===t.value,onCheckedChange:t.onChange})})]}),a.jsx(Ze,{children:'Enable experimental "Edit with AI" tooltip when selecting code.'})]})}function tr(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Autorun Unit Tests"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"reactive-test-checkbox",checked:!0===t.value,onCheckedChange:t.onChange})})]}),a.jsx(Ze,{children:"Enable experimental reactive pytest tests in notebook. When a cell contains only test functions and classes, marimo will automatically run relevant tests."})," "]})}function nr(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:Ln,children:[a.jsx(Ke,{className:"font-normal",children:"Library Save Format"}),a.jsx(Ye,{children:a.jsx(Je,{"data-testid":"toplevel-defs-checkbox",checked:!0===t.value,onCheckedChange:t.onChange})})]}),a.jsx(Ze,{children:"Enable saving in an experimental file format for marimo. This will expose functions that are defined in their own cell for function reuse and import by other programs."})," "]})}function rr(e){return a.jsx(Ve,{value:e.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:a.jsxs("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[a.jsx("span",{className:m(e.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground flex-shrink-0"),children:a.jsx(e.Icon,{className:"w-4 h-4"})}),a.jsx("span",{className:"truncate",children:e.label})]})},e.id)}const ir=()=>{const e=o.c(27),[t,n]=at();let r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Fe(lt),e[0]=r):r=e[0],e[1]!==t?(i={resolver:r,defaultValues:t},e[1]=t,e[2]=i):i=e[2];const s=ze(i);let l;e[3]!==n?(l=async e=>{await dt({config:e}).then((()=>{n(e)})).catch((()=>{n(e)}))},e[3]=n,e[4]=l):l=e[4];const c=l;let u,d,h,f,g,m,v,y,x,b;return e[5]!==t.width?(u=[t.width],e[5]=t.width,e[6]=u):u=e[6],p.useEffect(or,u),e[7]!==s||e[8]!==c?(d=s.handleSubmit(c),e[7]=s,e[8]=c,e[9]=d):d=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(h=a.jsxs("div",{children:[a.jsx(Gt,{children:"Application Config"}),a.jsx(Yt,{children:"Settings applied to this notebook"})]}),e[10]=h):h=e[10],e[11]!==s.control?(g=a.jsx(We,{control:s.control,name:"width",render:ar}),m=a.jsx(We,{control:s.control,name:"app_title",render:lr}),v=a.jsx(We,{control:s.control,name:"css_file",render:cr}),y=a.jsx(We,{control:s.control,name:"html_head_file",render:ur}),f=a.jsx(We,{control:s.control,name:"auto_download",render:dr}),e[11]=s.control,e[12]=f,e[13]=g,e[14]=m,e[15]=v,e[16]=y):(f=e[12],g=e[13],m=e[14],v=e[15],y=e[16]),e[17]!==f||e[18]!==d||e[19]!==g||e[20]!==m||e[21]!==v||e[22]!==y?(x=a.jsxs("form",{onChange:d,className:"flex flex-col gap-4",children:[h,g,m,v,y,f]}),e[17]=f,e[18]=d,e[19]=g,e[20]=m,e[21]=v,e[22]=y,e[23]=x):x=e[23],e[24]!==s||e[25]!==x?(b=a.jsx(qe,{...s,children:x}),e[24]=s,e[25]=x,e[26]=b):b=e[26],b};function or(){window.dispatchEvent(new Event("resize"))}function sr(e){return a.jsx("option",{value:e,children:e},e)}function ar(e){const{field:t}=e;return a.jsxs(Ge,{className:"flex flex-row items-center space-x-1 space-y-0",children:[a.jsx(Ke,{children:"Width"}),a.jsx(Ye,{children:a.jsx(Xe,{"data-testid":"app-width-select",onChange:e=>t.onChange(e.target.value),value:t.value,disabled:t.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(sr)})}),a.jsx($e,{})]})}function lr(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:"flex flex-row items-center space-x-1 space-y-0",children:[a.jsx(Ke,{children:"App title"}),a.jsx(Ye,{children:a.jsx(fe,{...t,value:t.value??"",onChange:e=>{t.onChange(e.target.value),ct.safeParse(e.target.value).success&&(document.title=e.target.value)}})}),a.jsx($e,{})]}),a.jsx(Ze,{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 cr(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:"flex flex-row items-center space-x-1 space-y-0",children:[a.jsx(Ke,{className:"flex-shrink-0",children:"Custom CSS"}),a.jsx(Ye,{children:a.jsx(fe,{...t,value:t.value??"",placeholder:"custom.css",onChange:e=>{t.onChange(e.target.value),ct.safeParse(e.target.value).success&&(document.title=e.target.value)}})}),a.jsx($e,{})]}),a.jsx(Ze,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function ur(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsxs(Ge,{className:"flex flex-row items-center space-x-1 space-y-0",children:[a.jsx(Ke,{className:"flex-shrink-0",children:"HTML Head"}),a.jsx(Ye,{children:a.jsx(fe,{...t,value:t.value??"",placeholder:"head.html",onChange:e=>{t.onChange(e.target.value)}})}),a.jsx($e,{})]}),a.jsxs(Ze,{children:["A filepath to an HTML file to be injected into the"," ",a.jsx(Ee,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function dr(e){const{field:t}=e;return a.jsxs("div",{className:"flex flex-col gap-y-1",children:[a.jsx("div",{className:"text-base font-bold text-muted-foreground",children:"Auto-download"}),a.jsxs(Ge,{className:"flex flex-col gap-2",children:[a.jsx(Ye,{children:a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Je,{id:"html-checkbox",checked:t.value.includes("html"),onCheckedChange:()=>{t.onChange(ut(t.value,"html"))}}),a.jsx(Ke,{htmlFor:"html-checkbox",children:"HTML"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Je,{id:"ipynb-checkbox",checked:t.value.includes("ipynb"),onCheckedChange:()=>{t.onChange(ut(t.value,"ipynb"))}}),a.jsx(Ke,{htmlFor:"ipynb-checkbox",children:"IPYNB"})]})]})}),a.jsx($e,{})]}),a.jsxs(Ze,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",a.jsx(Ee,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}const hr=e=>{const t=o.c(20),{showAppConfig:n}=e,r=void 0===n||n,[i,s]=A(dn);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx(Ut,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",color:"hint-green",children:a.jsx(h,{content:"Settings",children:a.jsx(ht,{strokeWidth:1.8})})}),t[0]=l):l=t[0];const c=l;let u;t[1]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(be,{className:"w-[80vw] h-[70vh] overflow-hidden sm:max-w-5xl top-[15vh] p-0",children:a.jsx(zn,{})}),t[1]=u):u=t[1];const d=u;if(!r){let e,n;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(ft,{children:c}),t[2]=e):e=t[2],t[3]!==s||t[4]!==i?(n=a.jsxs(ve,{open:i,onOpenChange:s,children:[e,d]}),t[3]=s,t[4]=i,t[5]=n):n=t[5],n}let f,p,g,m,v,y,x,b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(pt,{asChild:!0,children:c}),t[6]=f):f=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(ir,{}),g=a.jsx("div",{className:"h-px bg-border my-2"}),t[7]=p,t[8]=g):(p=t[7],g=t[8]),t[9]!==s?(m=()=>s(!0),t[9]=s,t[10]=m):m=t[10],t[11]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(ht,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),t[11]=v):v=t[11],t[12]!==m?(y=a.jsxs(gt,{children:[f,a.jsxs(mt,{className:"w-80 overflow-auto",align:"end",side:"bottom",onFocusOutside:fr,children:[p,g,a.jsxs(R,{onClick:m,variant:"link",className:"px-0",children:[v,"User settings"]})]})]}),t[12]=m,t[13]=y):y=t[13],t[14]!==s||t[15]!==i?(x=a.jsx(ve,{open:i,onOpenChange:s,children:d}),t[14]=s,t[15]=i,t[16]=x):x=t[16],t[17]!==x||t[18]!==y?(b=a.jsxs(a.Fragment,{children:[y,x]}),t[17]=x,t[18]=y,t[19]=b):b=t[19],b};function fr(e){return e.preventDefault()}const pr=e=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 448 512",...e,children:a.jsx("path",{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"})}),gr=e=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 640 512",fill:"currentColor",...e,children:a.jsx("path",{d:"M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"})}),mr=p.createContext(null);function vr(){const e=p.useContext(mr);if(null===e)throw new Error("No Tree Api Provided");return e}const yr=p.createContext(null);const xr=p.createContext(null);const br=p.createContext(0);function jr(){p.useContext(br)}function wr(e,t,n){return Math.max(Math.min(e,n),t)}function Ir(e){return e&&e.isLeaf}function Sr(e){return e&&e.isInternal&&!e.isOpen}function Or(e){var t;return e&&e.isOpen&&!(null===(t=e.children)||void 0===t?void 0:t.length)}const kr=(e,t)=>{let n=e;for(;n;){if(n.id===t.id)return!0;n=n.parent}return!1},Cr=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex((t=>t.id===e.id))};function Nr(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let n of e.children){const e=Nr(n,t);if(e)return e}return null}function Dr(e,t){if(t(e),e.children)for(let n of e.children)Dr(n,t)}function Er(e){const t=Ar(e);let n;for(let r=0;r<t.length;++r){if(t[r]===e){n=_r(t,r);break}}null==n||n.focus()}function Tr(e){const t=Ar(e);let n;for(let r=0;r<t.length;++r){if(t[r]===e){n=Pr(t,r);break}}null==n||n.focus()}function _r(e,t){return t+1<e.length?e[t+1]:e[0]}function Pr(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Ar(e){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((t=>t===e||!e.contains(t)))}function Mr(e,t){return"boolean"==typeof t?t:"string"==typeof t?e[t]:t(e)}function Rr(e){return null===e?null:Lr(e)}function Lr(e){return"string"==typeof e?e:e.id}function Fr(e,...t){if(e)return e(...t)}function Hr(e){return new Promise(((t,n)=>{let r=0;!function i(){r+=1,100===r&&n(),e()?t():setTimeout(i,10)}()}))}function zr(e){var t,n;const r=e.focusedNode;return r?r.isOpen?0:r.parent?r.childIndex+1:0:null!==(n=null===(t=e.root.children)||void 0===t?void 0:t.length)&&void 0!==n?n:0}function Ur(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const Br=Object.freeze(Object.defineProperty({__proto__:null,access:Mr,bound:wr,dfs:Nr,focusNextElement:Er,focusPrevElement:Tr,getInsertIndex:zr,getInsertParentId:Ur,identify:Lr,identifyNull:Rr,indexOf:Cr,isClosed:Sr,isDescendant:kr,isItem:Ir,isOpenWithEmptyChildren:Or,mergeRefs:function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}},noop:function(){},safeRun:Fr,waitFor:Hr,walk:Dr},Symbol.toStringTag,{value:"Module"})),qr={display:"flex",alignItems:"center",zIndex:1},Vr={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},Wr={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Gr=i.memo((function({top:e,left:t,indent:n}){const r={position:"absolute",pointerEvents:"none",top:e-2+"px",left:t+"px",right:n+"px"};return a.jsxs("div",{style:Object.assign(Object.assign({},qr),r),children:[a.jsx("div",{style:Object.assign({},Wr)}),a.jsx("div",{style:Object.assign({},Vr)})]})}));function Kr({node:e,attrs:t,innerRef:n,children:r}){return a.jsx("div",Object.assign({},t,{ref:n,onFocus:e=>e.stopPropagation(),onClick:e.handleClick,children:r}))}function Yr(e){return a.jsxs("div",{ref:e.dragHandle,style:e.style,children:[a.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?a.jsx(Xr,Object.assign({},e)):a.jsx($r,Object.assign({},e))]})}function $r(e){return a.jsx(a.Fragment,{children:a.jsx("span",{children:e.node.data.name})})}function Xr({node:e}){const t=p.useRef();return p.useEffect((()=>{var e,n;null===(e=t.current)||void 0===e||e.focus(),null===(n=t.current)||void 0===n||n.select()}),[]),a.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:n=>{var r;"Escape"===n.key&&e.reset(),"Enter"===n.key&&e.submit((null===(r=t.current)||void 0===r?void 0:r.value)||"")}})}function Zr(e){return{type:"EDIT",id:e}}function Qr(e){return{type:"FOCUS",id:e}}class Jr{constructor(e){this.handleClick=e=>{e.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():e.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===ei}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&&!(null===(e=this.prev)||void 0===e?void 0:e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(null===(e=this.next)||void 0===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 null===this.rowIndex?null:this.tree.at(this.rowIndex+1)}get prev(){return null===this.rowIndex?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var e,t;const n=this.childIndex;return null!==(t=null===(e=this.parent)||void 0===e?void 0:e.children[n+1])&&void 0!==t?t:null}isAncestorOf(e){if(!e)return!1;let t=e;for(;t;){if(t.id===this.id)return!0;t=t.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 Jr(Object.assign({},this))}edit(){return this.tree.edit(this)}}const ei="__REACT_ARBORIST_INTERNAL_ROOT__";function ti(e){var t;function n(t,r,i){const o=e.accessId(t),s=new Jr({tree:e,data:t,level:r,parent:i,id:o,children:null,isDraggable:e.isDraggable(t),rowIndex:null}),a=e.accessChildren(t);return a&&(s.children=a.map((e=>n(e,r+1,s)))),s}const r=new Jr({tree:e,id:ei,data:{id:ei},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=null!==(t=e.props.data)&&void 0!==t?t:[];return r.children=i.map((e=>n(e,0,r))),r}const ni={open:(e,t)=>({type:"VISIBILITY_OPEN",id:e,filtered:t}),close:(e,t)=>({type:"VISIBILITY_CLOSE",id:e,filtered:t}),toggle:(e,t)=>({type:"VISIBILITY_TOGGLE",id:e,filtered:t}),clear:e=>({type:"VISIBILITY_CLEAR",filtered:e})};function ri(e={},t){if("VISIBILITY_OPEN"===t.type)return Object.assign(Object.assign({},e),{[t.id]:!0});if("VISIBILITY_CLOSE"===t.type)return Object.assign(Object.assign({},e),{[t.id]:!1});if("VISIBILITY_TOGGLE"===t.type){const n=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!n})}return"VISIBILITY_CLEAR"===t.type?{}:e}const ii=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:null!==(t=null==e?void 0:e.initialOpenState)&&void 0!==t?t:{}},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}}},oi=e=>({type:"SELECTION_ONLY",id:Lr(e)}),si=e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(Lr)}),ai=e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(Lr)}),li=e=>Object.assign({type:"SELECTION_SET"},e),ci=e=>({type:"SELECTION_MOST_RECENT",id:null===e?null:Lr(e)}),ui=e=>({type:"SELECTION_ANCHOR",id:null===e?null:Lr(e)});const di={cursor:e=>({type:"DND_CURSOR",cursor:e}),dragStart:(e,t)=>({type:"DND_DRAG_START",id:e,dragIds:t}),dragEnd:()=>({type:"DND_DRAG_END"}),hovering:(e,t)=>({type:"DND_HOVERING",parentId:e,index:t})};const hi={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},fi=e=>{if(!e)return{display:"none"};const{x:t,y:n}=e;return{transform:`translate(${t}px, ${n}px)`}},pi=e=>{if(!e)return{display:"none"};const{x:t,y:n}=e;return{transform:`translate(${t+10}px, ${n+10}px)`}};function gi({offset:e,mouse:t,id:n,dragIds:r,isDragging:i}){return a.jsxs(mi,{isDragging:i,children:[a.jsx(vi,{offset:e,children:a.jsx(xi,{id:n,dragIds:r})}),a.jsx(yi,{mouse:t,count:r.length})]})}const mi=p.memo((function(e){return e.isDragging?a.jsx("div",{style:hi,children:e.children}):null}));function vi(e){return a.jsx("div",{className:"row preview",style:fi(e.offset),children:e.children})}function yi(e){const{count:t,mouse:n}=e;return t>1?a.jsx("div",{className:"selected-count",style:pi(n),children:t}):null}const xi=p.memo((function(e){const t=vr(),n=t.get(e.id);return n?a.jsx(t.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*t.indent,opacity:.2,background:"transparent"},tree:t}):null}));var bi=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function ji(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],i=t[n],!(r===i||bi(r)&&bi(i)))return!1;var r,i;return!0}function wi(e,t){var n;void 0===t&&(t=ji);var r,i=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&n===this&&t(s,i)||(r=e.apply(this,s),o=!0,n=this,i=s),r}}var Ii="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function Si(e){cancelAnimationFrame(e.id)}var Oi=-1;function ki(e){if(void 0===e&&(e=!1),-1===Oi||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Oi=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Oi}var Ci=null;function Ni(e){if(void 0===e&&(e=!1),null===Ci||e){var t=document.createElement("div"),n=t.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",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Ci="positive-descending":(t.scrollLeft=1,Ci=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),Ci}return Ci}var Di=function(e,t){return e};function Ei(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,o=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,l=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return(t=function(e){var t,d;function h(t){var r;return(r=e.call(this,t)||this)._instanceProps=l(r.props,Ft(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:Ft(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=wi((function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})})),r._callOnScroll=void 0,r._callOnScroll=wi((function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})})),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,o=r.props,s=o.direction,a=o.itemSize,l=o.layout,u=r._getItemStyleCache(c&&a,c&&l,c&&s);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),h=i(r.props,e,r._instanceProps),f="horizontal"===s||"horizontal"===l,p="rtl"===s,g=f?d:0;u[e]=t={position:"absolute",left:p?void 0:g,right:p?g:void 0,top:f?0:d,height:f?"100%":h,width:f?h:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=wi((function(e,t,n){return{}})),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;r.setState((function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,s=i;if("rtl"===t)switch(Ni()){case"negative":s=-i;break;case"positive-descending":s=o-n-i}return s=Math.max(0,Math.min(s,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<s?"forward":"backward",scrollOffset:s,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;r.setState((function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n,i;null!==r._resetIsScrollingTimeoutId&&Si(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=(e=r._resetIsScrolling,t=150,n=Ii(),i={id:requestAnimationFrame((function r(){Ii()-n>=t?e.call(null):i.id=requestAnimationFrame(r)}))})},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1,null)}))},r}d=e,(t=h).prototype=Object.create(d.prototype),t.prototype.constructor=t,Lt(t,d),h.getDerivedStateFromProps=function(e,t){return Ti(e,t),u(e),null};var f=h.prototype;return f.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},f.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,s=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var a=0;if(this._outerRef){var l=this._outerRef;a="vertical"===i?l.scrollWidth>l.clientWidth?ki():0:l.scrollHeight>l.clientHeight?ki():0}this.scrollTo(o(this.props,e,t,s,this._instanceProps,a))},f.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},f.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(Ni()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var s=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-s-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},f.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&Si(this._resetIsScrollingTimeoutId)},f.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,o=e.height,s=e.innerRef,a=e.innerElementType,l=e.innerTagName,c=e.itemCount,u=e.itemData,d=e.itemKey,h=void 0===d?Di:d,f=e.layout,g=e.outerElementType,m=e.outerTagName,v=e.style,y=e.useIsScrolling,x=e.width,b=this.state.isScrolling,j="horizontal"===i||"horizontal"===f,w=j?this._onScrollHorizontal:this._onScrollVertical,I=this._getRangeToRender(),S=I[0],O=I[1],k=[];if(c>0)for(var C=S;C<=O;C++)k.push(p.createElement(t,{data:u,key:h(C,u),index:C,isScrolling:y?b:void 0,style:this._getItemStyle(C)}));var N=r(this.props,this._instanceProps);return p.createElement(g||m||"div",{className:n,onScroll:w,ref:this._outerRefSetter,style:vt({position:"relative",height:o,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},v)},p.createElement(a||l||"div",{children:k,ref:s,style:{height:j?"100%":N,pointerEvents:b?"none":void 0,width:j?N:"100%"}}))},f._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,s=o.scrollDirection,a=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(s,a,l)}},f._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,l=r.scrollOffset;if(0===t)return[0,0,0,0];var c=s(this.props,l,this._instanceProps),u=a(this.props,c,l,this._instanceProps),d=i&&"backward"!==o?1:Math.max(1,n),h=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+h)),c,u]},h}(p.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Ti=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},_i=Ei({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var s=e.direction,a=e.height,l=e.itemCount,c=e.itemSize,u=e.layout,d=e.width,h="horizontal"===s||"horizontal"===u?d:a,f=Math.max(0,l*c-h),p=Math.min(f,t*c),g=Math.max(0,t*c-h+c+o);switch("smart"===n&&(n=r>=g-h&&r<=p+h?"auto":"center"),n){case"start":return p;case"end":return g;case"center":var m=Math.round(g+(p-g)/2);return m<Math.ceil(h/2)?0:m>f+Math.floor(h/2)?f:m;default:return r>=g&&r<=p?r:r<g?g:p}},getStartIndexForOffset:function(e,t){var n=e.itemCount,r=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,i=e.height,o=e.itemCount,s=e.itemSize,a=e.layout,l=e.width,c=t*s,u="horizontal"===r||"horizontal"===a?l:i,d=Math.ceil((u+n-c)/s);return Math.max(0,Math.min(o-1,t+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function Pi(){var e,t;const n=vr(),r=function(){const e=p.useContext(xr);if(null===e)throw new Error("Provide a DnDContext");return e}().cursor;if(!r||"line"!==r.type)return null;const i=n.indent,o=n.rowHeight*r.index+(null!==(t=null!==(e=n.props.padding)&&void 0!==e?e:n.props.paddingTop)&&void 0!==t?t:0),s=i*r.level,l=n.renderCursor;return a.jsx(l,{top:o,left:s,indent:i})}const Ai=p.forwardRef((function(e,t){const{children:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["children"]),i=vr();return a.jsxs("div",Object.assign({ref:t},r,{onClick:e=>{e.currentTarget===e.target&&i.deselectAll()},children:[a.jsx(Mi,{}),n]}))})),Mi=()=>{const e=vr();return a.jsx("div",{style:{height:e.visibleNodes.length*e.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:a.jsx(Pi,{})})};const Ri=p.forwardRef((function(e,t){var n,r,i,o,{style:s}=e,l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["style"]);const c=vr(),u=null!==(r=null!==(n=c.props.padding)&&void 0!==n?n:c.props.paddingTop)&&void 0!==r?r:0,d=null!==(o=null!==(i=c.props.padding)&&void 0!==i?i:c.props.paddingBottom)&&void 0!==o?o:0;return a.jsx("div",Object.assign({ref:t,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+u+d}px`})},l))}));var Li,Fi,Hi=p.createContext({dragDropManager:void 0});function zi(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(!e){var o;if(void 0===t)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;(o=new Error(t.replace(/%s/g,(function(){return r[s++]})))).name="Invariant Violation"}throw o.framesToPop=1,o}}(Fi=Li||(Li={})).SOURCE="SOURCE",Fi.TARGET="TARGET";var Ui="dnd-core/INIT_COORDS",Bi="dnd-core/BEGIN_DRAG",qi="dnd-core/PUBLISH_DRAG_SOURCE",Vi="dnd-core/HOVER",Wi="dnd-core/DROP",Gi="dnd-core/END_DRAG";function Ki(e,t){return{type:Ui,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Yi(e){return(Yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $i(e){return"object"===Yi(e)}var Xi={type:Ui,payload:{clientOffset:null,sourceClientOffset:null}};function Zi(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},r=n.publishSource,i=void 0===r||r,o=n.clientOffset,s=n.getSourceClientOffset,a=e.getMonitor(),l=e.getRegistry();e.dispatch(Ki(o)),function(e,t,n){zi(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){zi(n.getSource(e),"Expected sourceIds to be registered.")}))}(t,a,l);var c=function(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,a);if(null!==c){var u=null;if(o){if(!s)throw new Error("getSourceClientOffset must be defined");!function(e){zi("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(s),u=s(c)}e.dispatch(Ki(o,u));var d=l.getSource(c).beginDrag(a,c);if(null!=d){!function(e){zi($i(e),"Item must be an object.")}(d),l.pinSource(c);var h=l.getSourceType(c);return{type:Bi,payload:{itemType:h,item:d,sourceId:c,clientOffset:o||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}else e.dispatch(Xi)}}function Qi(e){return function(){if(e.getMonitor().isDragging())return{type:qi}}}function Ji(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function eo(e){return function(t){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset;!function(e){zi(Array.isArray(e),"Expected targetIds to be an array.")}(t);var r=t.slice(0),i=e.getMonitor(),o=e.getRegistry();return function(e,t,n){zi(t.isDragging(),"Cannot call hover while not dragging."),zi(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r<e.length;r++){var i=e[r];zi(e.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array."),zi(n.getTarget(i),"Expected targetIds to be registered.")}}(r,i,o),function(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r];Ji(t.getTargetType(i),n)||e.splice(r,1)}}(r,o,i.getItemType()),function(e,t,n){e.forEach((function(e){n.getTarget(e).hover(t,e)}))}(r,i,o),{type:Vi,payload:{targetIds:r,clientOffset:n||null}}}}function to(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function no(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?to(Object(n),!0).forEach((function(t){ro(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):to(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ro(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function io(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.getMonitor(),r=e.getRegistry();!function(e){zi(e.isDragging(),"Cannot call drop while not dragging."),zi(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n);var i=function(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n);i.forEach((function(i,o){var s=function(e,t,n,r){var i=n.getTarget(e),o=i?i.drop(r,e):void 0;(function(e){zi(void 0===e||$i(e),"Drop result must either be an object or undefined.")})(o),void 0===o&&(o=0===t?{}:r.getDropResult());return o}(i,o,r,n),a={type:Wi,payload:{dropResult:no(no({},t),s)}};e.dispatch(a)}))}}function oo(e){return function(){var t=e.getMonitor(),n=e.getRegistry();!function(e){zi(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var r=t.getSourceId();null!=r&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource());return{type:Gi}}}function so(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function ao(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lo=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ao(this,"store",void 0),ao(this,"monitor",void 0),ao(this,"backend",void 0),ao(this,"isSetUp",!1),ao(this,"handleRefCountChange",(function(){var e=r.store.getState().refCount>0;r.backend&&(e&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!e&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))})),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}return so(e,[{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,t=this.store.dispatch;var n=function(e){return{beginDrag:Zi(e),publishDragSource:Qi(e),hover:eo(e),drop:io(e),endDrag:oo(e)}}(this);return Object.keys(n).reduce((function(r,i){var o,s=n[i];return r[i]=(o=s,function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var s=o.apply(e,r);void 0!==s&&t(s)}),r}),{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}]),e}();function co(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var uo="function"==typeof Symbol&&Symbol.observable||"@@observable",ho=function(){return Math.random().toString(36).substring(7).split("").join(".")},fo={INIT:"@@redux/INIT"+ho(),REPLACE:"@@redux/REPLACE"+ho()};function po(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(co(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(co(1));return n(po)(e,t)}if("function"!=typeof e)throw new Error(co(2));var i=e,o=t,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(co(3));return o}function d(e){if("function"!=typeof e)throw new Error(co(4));if(l)throw new Error(co(5));var t=!0;return c(),a.push(e),function(){if(t){if(l)throw new Error(co(6));t=!1,c();var n=a.indexOf(e);a.splice(n,1),s=null}}}function h(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(co(7));if(void 0===e.type)throw new Error(co(8));if(l)throw new Error(co(9));try{l=!0,o=i(o,e)}finally{l=!1}for(var t=s=a,n=0;n<t.length;n++){(0,t[n])()}return e}return h({type:fo.INIT}),(r={dispatch:h,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(co(10));i=e,h({type:fo.REPLACE})}})[uo]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(co(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[uo]=function(){return this},e},r}var go=function(e,t){return e===t};function mo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mo(Object(n),!0).forEach((function(t){yo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xo={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function bo(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xo,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Ui:case Bi:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case Vi:return e=n.clientOffset,t=i.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?n:vo(vo({},n),{},{clientOffset:i.clientOffset});case Gi:case Wi:return xo;default:return n}}var jo="dnd-core/ADD_SOURCE",wo="dnd-core/ADD_TARGET",Io="dnd-core/REMOVE_SOURCE",So="dnd-core/REMOVE_TARGET";function Oo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ko(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oo(Object(n),!0).forEach((function(t){Co(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Co(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var No={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Do(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:No,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Bi:return ko(ko({},n),{},{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case qi:return ko(ko({},n),{},{isSourcePublic:!0});case Vi:return ko(ko({},n),{},{targetIds:i.targetIds});case So:return-1===n.targetIds.indexOf(i.targetId)?n:ko(ko({},n),{},{targetIds:(e=n.targetIds,t=i.targetId,e.filter((function(e){return e!==t})))});case Wi:return ko(ko({},n),{},{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case Gi:return ko(ko({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function Eo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case jo:case wo:return e+1;case Io:case So:return e-1;default:return e}}var To=[],_o=[];function Po(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Vi:break;case jo:case wo:case So:case Io:return To;default:return _o}var t=e.payload,n=t.targetIds,r=void 0===n?[]:n,i=t.prevTargetIds,o=void 0===i?[]:i,s=function(e,t){var n=new Map,r=function(e){n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);var i=[];return n.forEach((function(e,t){1===e&&i.push(t)})),i}(r,o),a=s.length>0||!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:go;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(r,o);if(!a)return To;var l=o[o.length-1],c=r[r.length-1];return l!==c&&(l&&s.push(l),c&&s.push(c)),s}function Ao(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}function Mo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ro(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mo(Object(n),!0).forEach((function(t){Lo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fo(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Po(r.dirtyHandlerIds,{type:i.type,payload:Ro(Ro({},i.payload),{},{prevTargetIds:(e=r,t="dragOperation.targetIds",n=[],t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:n||null}),e))})}),dragOffset:bo(r.dragOffset,i),refCount:Eo(r.refCount,i),dragOperation:Do(r.dragOperation,i),stateId:Ao(r.stateId)}}function Ho(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zo(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Uo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}To.__IS_NONE__=!0,_o.__IS_ALL__=!0;var Bo=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Uo(this,"store",void 0),Uo(this,"registry",void 0),this.store=t,this.registry=n}return zo(e,[{key:"subscribeToStateChange",value:function(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0}).handlerIds;zi("function"==typeof e,"listener must be a function."),zi(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");var r=this.store.getState().stateId;return this.store.subscribe((function(){var i=t.store.getState(),o=i.stateId;try{var s=o===r||o===r+1&&!function(e,t){return e!==To&&(e===_o||void 0===t||(n=e,t.filter((function(e){return n.indexOf(e)>-1}))).length>0);var n}(i.dirtyHandlerIds,n);s||e()}finally{r=o}}))}},{key:"subscribeToOffsetChange",value:function(e){var t=this;zi("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset;return this.store.subscribe((function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return zi(t,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return zi(t,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&(Ji(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e))}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return zi(t,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}},{key:"isOverTarget",value:function(e){if(!e)return!1;var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();if(r&&!Ji(n,r))return!1;var i=this.getTargetIds();if(!i.length)return!1;var o=i.indexOf(e);return t?o===i.length-1:o>-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 Boolean(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,r=e.clientOffset,i=e.initialClientOffset,o=e.initialSourceClientOffset,r&&i&&o?Ho((n=o,{x:(t=r).x+n.x,y:t.y+n.y}),i):null;var e,t,n,r,i,o}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,t=e.clientOffset,n=e.initialClientOffset,t&&n?Ho(t,n):null;var e,t,n}}]),e}(),qo=0;function Vo(e){return(Vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wo(e,t){t&&Array.isArray(e)?e.forEach((function(e){return Wo(e,!1)})):zi("string"==typeof e||"symbol"===Vo(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const Go="undefined"!=typeof global?global:self,Ko=Go.MutationObserver||Go.WebKitMutationObserver;function Yo(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}const $o="function"==typeof Ko?function(e){let t=1;const n=new Ko(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:Yo;class Xo{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const Zo=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=$o(this.flush),this.requestErrorThrow=Yo((()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()}))}},Qo=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new Xo(this.onError,(e=>t[t.length]=e));return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(Zo.registerPendingError);function Jo(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function es(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ts(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ns(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ns(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ns(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rs(e){var t=(qo++).toString();switch(e){case Li.SOURCE:return"S".concat(t);case Li.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function is(e){switch(e[0]){case"S":return Li.SOURCE;case"T":return Li.TARGET;default:zi(!1,"Cannot parse handler ID: ".concat(e))}}function os(e,t){var n=e.entries(),r=!1;do{var i=n.next(),o=i.done;if(ts(i.value,2)[1]===t)return!0;r=!!o}while(!r);return!1}var ss=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),es(this,"types",new Map),es(this,"dragSources",new Map),es(this,"dropTargets",new Map),es(this,"pinnedSourceId",null),es(this,"pinnedSource",null),es(this,"store",void 0),this.store=t}return Jo(e,[{key:"addSource",value:function(e,t){Wo(e),function(e){zi("function"==typeof e.canDrag,"Expected canDrag to be a function."),zi("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),zi("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);var n=this.addHandler(Li.SOURCE,e,t);return this.store.dispatch(function(e){return{type:jo,payload:{sourceId:e}}}(n)),n}},{key:"addTarget",value:function(e,t){Wo(e,!0),function(e){zi("function"==typeof e.canDrop,"Expected canDrop to be a function."),zi("function"==typeof e.hover,"Expected hover to be a function."),zi("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);var n=this.addHandler(Li.TARGET,e,t);return this.store.dispatch(function(e){return{type:wo,payload:{targetId:e}}}(n)),n}},{key:"containsHandler",value:function(e){return os(this.dragSources,e)||os(this.dropTargets,e)}},{key:"getSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return zi(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return zi(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return zi(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return zi(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return is(e)===Li.SOURCE}},{key:"isTargetId",value:function(e){return is(e)===Li.TARGET}},{key:"removeSource",value:function(e){var t,n=this;zi(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:Io,payload:{sourceId:e}}}(e)),t=function(){n.dragSources.delete(e),n.types.delete(e)},Zo.enqueueTask(Qo.create(t))}},{key:"removeTarget",value:function(e){zi(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:So,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);zi(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){zi(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,n){var r=rs(e);return this.types.set(r,t),e===Li.SOURCE?this.dragSources.set(r,n):e===Li.TARGET&&this.dropTargets.set(r,n),r}}]),e}();function as(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(e){var t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return po(Fo,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(arguments.length>3&&void 0!==arguments[3]&&arguments[3]),i=new Bo(r,new ss(r)),o=new lo(r,i),s=e(o,t,n);return o.receiveBackend(s),o}var ls=["children"];function cs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return us(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return us(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function us(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ds(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var hs=0,fs=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),ps=p.memo((function(e){var t=e.children,n=function(e){if("manager"in e){return[{dragDropManager:e.manager},!1]}var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gs(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t;i[fs]||(i[fs]={dragDropManager:as(e,t,n,r)});return i[fs]}(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}(ds(e,ls)),r=cs(n,2),i=r[0],o=r[1];return p.useEffect((function(){if(o){var e=gs();return++hs,function(){0==--hs&&(e[fs]=null)}}}),[]),a.jsx(Hi.Provider,Object.assign({value:i},{children:t}),void 0)}));function gs(){return"undefined"!=typeof global?global:window}function ms(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function vs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ys=!1,xs=!1,bs=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),vs(this,"internalMonitor",void 0),vs(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return ms(e,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){zi(!ys,"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 ys=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{ys=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;zi(!xs,"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 xs=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{xs=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{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()}}]),e}();function js(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function ws(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Is=!1,Ss=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ws(this,"internalMonitor",void 0),ws(this,"targetId",null),this.internalMonitor=t.getMonitor()}return js(e,[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;zi(!Is,"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 Is=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Is=!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()}}]),e}();function Os(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!p.isValidElement(t)){var r=t;return e(r,n),r}var i=t;return function(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}(i),function(e,t){var n=e.ref;return zi("string"!=typeof n,"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"),n?p.cloneElement(e,{ref:function(e){Cs(n,e),Cs(t,e)}}):p.cloneElement(e,{ref:t})}(i,n?function(t){return e(t,n)}:e)}}function ks(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var i=Os(r);t[n]=function(){return i}}})),t}function Cs(e,t){"function"==typeof e?e(t):e.current=t}function Ns(e){return(Ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ds(e){return null!==e&&"object"===Ns(e)&&Object.prototype.hasOwnProperty.call(e,"current")}function Es(e,t,n,r){var i=void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l<o.length;l++){var c=o[l];if(!a(c))return!1;var u=e[c],d=t[c];if(!1===(i=void 0)||void 0===i&&u!==d)return!1}return!0}function Ts(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function _s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ps=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_s(this,"hooks",ks({dragSource:function(e,t){n.clearDragSource(),n.dragSourceOptions=t||null,Ds(e)?n.dragSourceRef=e:n.dragSourceNode=e,n.reconnectDragSource()},dragPreview:function(e,t){n.clearDragPreview(),n.dragPreviewOptions=t||null,Ds(e)?n.dragPreviewRef=e:n.dragPreviewNode=e,n.reconnectDragPreview()}})),_s(this,"handlerId",null),_s(this,"dragSourceRef",null),_s(this,"dragSourceNode",void 0),_s(this,"dragSourceOptionsInternal",null),_s(this,"dragSourceUnsubscribe",void 0),_s(this,"dragPreviewRef",null),_s(this,"dragPreviewNode",void 0),_s(this,"dragPreviewOptionsInternal",null),_s(this,"dragPreviewUnsubscribe",void 0),_s(this,"lastConnectedHandlerId",null),_s(this,"lastConnectedDragSource",null),_s(this,"lastConnectedDragSourceOptions",null),_s(this,"lastConnectedDragPreview",null),_s(this,"lastConnectedDragPreviewOptions",null),_s(this,"backend",void 0),this.backend=t}return Ts(e,[{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,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();t&&this.disconnectDragSource(),this.handlerId&&(e?t&&(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,t=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();t&&this.disconnectDragPreview(),this.handlerId&&(e?t&&(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!Es(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Es(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}}]),e}();function As(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Ms(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rs=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ms(this,"hooks",ks({dropTarget:function(e,t){n.clearDropTarget(),n.dropTargetOptions=t,Ds(e)?n.dropTargetRef=e:n.dropTargetNode=e,n.reconnect()}})),Ms(this,"handlerId",null),Ms(this,"dropTargetRef",null),Ms(this,"dropTargetNode",void 0),Ms(this,"dropTargetOptionsInternal",null),Ms(this,"unsubscribeDropTarget",void 0),Ms(this,"lastConnectedHandlerId",null),Ms(this,"lastConnectedDropTarget",null),Ms(this,"lastConnectedDropTargetOptions",null),Ms(this,"backend",void 0),this.backend=t}return As(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{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!Es(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}}]),e}();var Ls="undefined"!=typeof window?p.useLayoutEffect:p.useEffect;function Fs(e){return(Fs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hs(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function zs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Us=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),zs(this,"spec",void 0),zs(this,"monitor",void 0),zs(this,"connector",void 0),this.spec=t,this.monitor=n,this.connector=r}return Hs(e,[{key:"beginDrag",value:function(){var e,t=this.spec,n=this.monitor;return null!==(e="object"===Fs(t.item)?t.item:"function"==typeof t.item?t.item(n):{})&&void 0!==e?e:null}},{key:"canDrag",value:function(){var e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)}},{key:"isDragging",value:function(e,t){var n=this.spec,r=this.monitor,i=n.isDragging;return i?i(r):t===e.getSourceId()}},{key:"endDrag",value:function(){var e=this.spec,t=this.monitor,n=this.connector,r=e.end;r&&r(t.getItem(),t),n.reconnect()}}]),e}();function Bs(){var e=p.useContext(Hi).dragDropManager;return zi(null!=e,"Expected drag drop context"),e}function qs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ws(e,t,n){var r=Bs(),i=function(e,t,n){var r=p.useMemo((function(){return new Us(e,t,n)}),[t,n]);return p.useEffect((function(){r.spec=e}),[e]),r}(e,t,n),o=function(e){return p.useMemo((function(){var t=e.type;return zi(null!=t,"spec.type must be defined"),t}),[e])}(e);Ls((function(){if(null!=o){var e=function(e,t,n){var r=n.getRegistry(),i=r.addSource(e,t);return[i,function(){return r.removeSource(i)}]}(o,i,r),s=qs(e,2),a=s[0],l=s[1];return t.receiveHandlerId(a),n.receiveHandlerId(a),l}}),[r,t,n,i,o])}function Gs(e){return function(e){if(Array.isArray(e))return Ks(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ks(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ks(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ks(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ys(e,t){var n=Gs(t||[]);return null==t&&"function"!=typeof e&&n.push(e),p.useMemo((function(){return"function"==typeof e?e():e}),n)}function $s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zs(e,t,n){var r=$s(p.useState((function(){return t(e)})),2),i=r[0],o=r[1],s=p.useCallback((function(){var r=t(e);xt(i,r)||(o(r),n&&n())}),[i,e,n]);return Ls(s),[i,s]}function Qs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Js(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Js(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Js(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ea(e,t,n){return function(e,t,n){var r=Qs(Zs(e,t,n),2),i=r[0],o=r[1];return Ls((function(){var t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(o,{handlerIds:[t]})}),[e,o]),i}(t,e||function(){return{}},(function(){return n.reconnect()}))}function ta(e){return p.useMemo((function(){return e.hooks.dragSource()}),[e])}function na(e){return p.useMemo((function(){return e.hooks.dragPreview()}),[e])}function ra(e,t){var n=Ys(e,t);zi(!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=Bs(),p.useMemo((function(){return new bs(r)}),[r])),o=function(e,t){var n=Bs(),r=p.useMemo((function(){return new Ps(n.getBackend())}),[n]);return Ls((function(){return r.dragSourceOptions=e||null,r.reconnect(),function(){return r.disconnectDragSource()}}),[r,e]),Ls((function(){return r.dragPreviewOptions=t||null,r.reconnect(),function(){return r.disconnectDragPreview()}}),[r,t]),r}(n.options,n.previewOptions);return Ws(n,i,o),[ea(n.collect,i,o),ta(o),na(o)]}function ia(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function oa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sa=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),oa(this,"spec",void 0),oa(this,"monitor",void 0),this.spec=t,this.monitor=n}return ia(e,[{key:"canDrop",value:function(){var e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}},{key:"hover",value:function(){var e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}},{key:"drop",value:function(){var e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}}]),e}();function aa(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return la(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return la(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function la(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ca(e,t,n){var r=Bs(),i=function(e,t){var n=p.useMemo((function(){return new sa(e,t)}),[t]);return p.useEffect((function(){n.spec=e}),[e]),n}(e,t),o=function(e){var t=e.accept;return p.useMemo((function(){return zi(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t]}),[t])}(e);Ls((function(){var e=function(e,t,n){var r=n.getRegistry(),i=r.addTarget(e,t);return[i,function(){return r.removeTarget(i)}]}(o,i,r),s=aa(e,2),a=s[0],l=s[1];return t.receiveHandlerId(a),n.receiveHandlerId(a),l}),[r,t,i,n,o.map((function(e){return e.toString()})).join("|")])}function ua(e){return p.useMemo((function(){return e.hooks.dropTarget()}),[e])}function da(e,t){var n,r=Ys(e,t),i=(n=Bs(),p.useMemo((function(){return new Ss(n)}),[n])),o=function(e){var t=Bs(),n=p.useMemo((function(){return new Rs(t.getBackend())}),[t]);return Ls((function(){return n.dropTargetOptions=e||null,n.reconnect(),function(){return n.disconnectDropTarget()}}),[e]),n}(r.options);return ca(r,i,o),[ea(r.collect,i,o),ua(o)]}function ha(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(l){a=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fa(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pa(e){var t=null;return function(){return null==t&&(t=e()),t}}function ga(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function ma(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var va=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ma(this,"entered",[]),ma(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return ga(e,[{key:"enter",value:function(e){var t=this,n=this.entered.length;return this.entered=function(e,t){var n=new Set,r=function(e){return n.add(e)};e.forEach(r),t.forEach(r);var i=[];return n.forEach((function(e){return i.push(e)})),i}(this.entered.filter((function(n){return t.isNodeInDocument(n)&&(!n.contains||n.contains(e))})),[e]),0===n&&this.entered.length>0}},{key:"leave",value:function(e){var t,n,r=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),n=e,t.filter((function(e){return e!==n}))),r>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}]),e}(),ya=pa((function(){return/firefox/i.test(navigator.userAgent)})),xa=pa((function(){return Boolean(window.safari)}));function ba(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function ja(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wa=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ja(this,"xs",void 0),ja(this,"ys",void 0),ja(this,"c1s",void 0),ja(this,"c2s",void 0),ja(this,"c3s",void 0);for(var r=t.length,i=[],o=0;o<r;o++)i.push(o);i.sort((function(e,n){return t[e]<t[n]?-1:1}));for(var s,a,l=[],c=[],u=0;u<r-1;u++)s=t[u+1]-t[u],a=n[u+1]-n[u],l.push(s),c.push(a/s);for(var d=[c[0]],h=0;h<l.length-1;h++){var f=c[h],p=c[h+1];if(f*p<=0)d.push(0);else{s=l[h];var g=l[h+1],m=s+g;d.push(3*m/((m+g)/f+(m+s)/p))}}d.push(c[c.length-1]);for(var v,y=[],x=[],b=0;b<d.length-1;b++){v=c[b];var j=d[b],w=1/l[b],I=j+d[b+1]-v-v;y.push((v-j-I)*w),x.push(I*w*w)}this.xs=t,this.ys=n,this.c1s=d,this.c2s=y,this.c3s=x}return ba(e,[{key:"interpolate",value:function(e){var t=this.xs,n=this.ys,r=this.c1s,i=this.c2s,o=this.c3s,s=t.length-1;if(e===t[s])return n[s];for(var a,l=0,c=o.length-1;l<=c;){var u=t[a=Math.floor(.5*(l+c))];if(u<e)l=a+1;else{if(!(u>e))return n[a];c=a-1}}var d=e-t[s=Math.max(0,c)],h=d*d;return n[s]+r[s]*d+i[s]*h+o[s]*d*h}}]),e}();function Ia(e){var t=1===e.nodeType?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function Sa(e){return{x:e.clientX,y:e.clientY}}function Oa(e,t,n,r,i){var o,s,a,l="IMG"===(o=t).nodeName&&(ya()||!(null!==(s=document.documentElement)&&void 0!==s&&s.contains(o))),c=Ia(l?e:t),u={x:n.x-c.x,y:n.y-c.y},d=e.offsetWidth,h=e.offsetHeight,f=r.anchorX,p=r.anchorY,g=function(e,t,n,r){var i=e?t.width:n,o=e?t.height:r;return xa()&&e&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}(l,t,d,h),m=g.dragPreviewWidth,v=g.dragPreviewHeight,y=i.offsetX,x=i.offsetY,b=0===x||x;return{x:0===y||y?y:new wa([0,.5,1],[u.x,u.x/d*m,u.x+m-d]).interpolate(f),y:b?x:(a=new wa([0,.5,1],[u.y,u.y/h*v,u.y+v-h]).interpolate(p),xa()&&l&&(a+=(window.devicePixelRatio-1)*v),a)}}var ka="__NATIVE_FILE__",Ca="__NATIVE_URL__",Na="__NATIVE_TEXT__",Da="__NATIVE_HTML__";const Ea=Object.freeze(Object.defineProperty({__proto__:null,FILE:ka,HTML:Da,TEXT:Na,URL:Ca},Symbol.toStringTag,{value:"Module"}));function Ta(e,t,n){var r=t.reduce((function(t,n){return t||e.getData(n)}),"");return null!=r?r:n}var _a;function Pa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Aa=(Pa(_a={},ka,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),Pa(_a,Da,{exposeProperties:{html:function(e,t){return Ta(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),Pa(_a,Ca,{exposeProperties:{urls:function(e,t){return Ta(e,t,"").split("\n")},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),Pa(_a,Na,{exposeProperties:{text:function(e,t){return Ta(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),_a);function Ma(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var La=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ra(this,"item",void 0),Ra(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return Ma(e,[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach((function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})}))}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var n={};Object.keys(this.config.exposeProperties).forEach((function(r){n[r]={value:t.config.exposeProperties[r](e,t.config.matchesTypes),configurable:!0,enumerable:!0}})),Object.defineProperties(this.item,n)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}]),e}();function Fa(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(Aa).filter((function(e){return Aa[e].matchesTypes.some((function(e){return t.indexOf(e)>-1}))}))[0]||null}function Ha(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function za(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ua=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),za(this,"ownerDocument",null),za(this,"globalContext",void 0),za(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=n}return Ha(e,[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}},{key:"document",get:function(){var e;return null!==(e=this.globalContext)&&void 0!==e&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}}]),e}();function Ba(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(n),!0).forEach((function(t){Wa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ba(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Va(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Wa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ga,Ka=function(){function e(t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Wa(this,"options",void 0),Wa(this,"actions",void 0),Wa(this,"monitor",void 0),Wa(this,"registry",void 0),Wa(this,"enterLeaveCounter",void 0),Wa(this,"sourcePreviewNodes",new Map),Wa(this,"sourcePreviewNodeOptions",new Map),Wa(this,"sourceNodes",new Map),Wa(this,"sourceNodeOptions",new Map),Wa(this,"dragStartSourceIds",null),Wa(this,"dropTargetIds",[]),Wa(this,"dragEnterTargetIds",[]),Wa(this,"currentNativeSource",null),Wa(this,"currentNativeHandle",null),Wa(this,"currentDragSourceNode",null),Wa(this,"altKeyPressed",!1),Wa(this,"mouseMoveTimeoutTimer",null),Wa(this,"asyncEndDragFrameId",null),Wa(this,"dragOverTargetIds",null),Wa(this,"lastClientOffset",null),Wa(this,"hoverRafId",null),Wa(this,"getSourceClientOffset",(function(e){var t=i.sourceNodes.get(e);return t&&Ia(t)||null})),Wa(this,"endDragNativeItem",(function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)})),Wa(this,"isNodeInDocument",(function(e){return Boolean(e&&i.document&&i.document.body&&i.document.body.contains(e))})),Wa(this,"endDragIfSourceWasRemovedFromDOM",(function(){var e=i.currentDragSourceNode;null==e||i.isNodeInDocument(e)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()})),Wa(this,"handleTopDragStartCapture",(function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]})),Wa(this,"handleTopDragStart",(function(e){if(!e.defaultPrevented){var t=i.dragStartSourceIds;i.dragStartSourceIds=null;var n=Sa(e);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:n});var r=e.dataTransfer,o=Fa(r);if(i.monitor.isDragging()){if(r&&"function"==typeof r.setDragImage){var s=i.monitor.getSourceId(),a=i.sourceNodes.get(s),l=i.sourcePreviewNodes.get(s)||a;if(l){var c=i.getCurrentSourcePreviewNodeOptions(),u=Oa(a,l,n,{anchorX:c.anchorX,anchorY:c.anchorY},{offsetX:c.offsetX,offsetY:c.offsetY});r.setDragImage(l,u.x,u.y)}}try{null==r||r.setData("application/json",{})}catch(d){}i.setCurrentDragSourceNode(e.target),i.getCurrentSourcePreviewNodeOptions().captureDraggingState?i.actions.publishDragSource():setTimeout((function(){return i.actions.publishDragSource()}),0)}else if(o)i.beginDragNativeItem(o);else{if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}}})),Wa(this,"handleTopDragEndCapture",(function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()})),Wa(this,"handleTopDragEnterCapture",(function(e){if(i.dragEnterTargetIds=[],i.enterLeaveCounter.enter(e.target)&&!i.monitor.isDragging()){var t=e.dataTransfer,n=Fa(t);n&&i.beginDragNativeItem(n,t)}})),Wa(this,"handleTopDragEnter",(function(e){var t=i.dragEnterTargetIds;(i.dragEnterTargetIds=[],i.monitor.isDragging())&&(i.altKeyPressed=e.altKey,t.length>0&&i.actions.hover(t,{clientOffset:Sa(e)}),t.some((function(e){return i.monitor.canDropOnTarget(e)}))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=i.getCurrentDropEffect())))})),Wa(this,"handleTopDragOverCapture",(function(){i.dragOverTargetIds=[]})),Wa(this,"handleTopDragOver",(function(e){var t=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));i.altKeyPressed=e.altKey,i.lastClientOffset=Sa(e),null===i.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(i.hoverRafId=requestAnimationFrame((function(){i.monitor.isDragging()&&i.actions.hover(t||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null}))),(t||[]).some((function(e){return i.monitor.canDropOnTarget(e)}))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))})),Wa(this,"handleTopDragLeaveCapture",(function(e){i.isDraggingNativeItem()&&e.preventDefault(),i.enterLeaveCounter.leave(e.target)&&i.isDraggingNativeItem()&&setTimeout((function(){return i.endDragNativeItem()}),0)})),Wa(this,"handleTopDropCapture",(function(e){var t;(i.dropTargetIds=[],i.isDraggingNativeItem())?(e.preventDefault(),null===(t=i.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Fa(e.dataTransfer)&&e.preventDefault();i.enterLeaveCounter.reset()})),Wa(this,"handleTopDrop",(function(e){var t=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(t,{clientOffset:Sa(e)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()})),Wa(this,"handleSelectStart",(function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))})),this.options=new Ua(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new va(this.isNodeInDocument)}return Va(e,[{key:"profile",value:function(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.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(void 0!==e){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,t=this.rootElement;void 0!==t&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(e=this.window)||void 0===e||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,t,n){var r=this;return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),function(){r.sourcePreviewNodes.delete(e),r.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,t,n){var r=this;this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);var i=function(t){return r.handleDragStart(t,e)},o=function(e){return r.handleSelectStart(e)};return t.setAttribute("draggable","true"),t.addEventListener("dragstart",i),t.addEventListener("selectstart",o),function(){r.sourceNodes.delete(e),r.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",i),t.removeEventListener("selectstart",o),t.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},i=function(t){return n.handleDragOver(t,e)},o=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",i),t.addEventListener("drop",o),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",i),t.removeEventListener("drop",o)}}},{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(),t=this.sourceNodeOptions.get(e);return qa({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return qa({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(Ea).some((function(t){return Ea[t]===e}))}},{key:"beginDragNativeItem",value:function(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){var n=new La(Aa[e]);return n.loadDataTransfer(t),n}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var t=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;this.mouseMoveTimeoutTimer=setTimeout((function(){var e;return null===(e=t.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",t.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){var e;if(this.currentDragSourceNode=null,this.rootElement)null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0);return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleDragOver",value:function(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}}]),e}();var Ya=function(e,t,n){return new Ka(e,t,n)};function $a(e){const t=vr(),n=t.selectedIds,[r,i,o]=ra((()=>({canDrag:()=>e.isDraggable,type:"NODE",item:()=>{const r=t.isSelected(e.id)?Array.from(n):[e.id];return t.dispatch(di.dragStart(e.id,r)),{id:e.id,dragIds:r}},end:()=>{t.hideCursor(),t.dispatch(di.dragEnd())}})),[n,e]);return p.useEffect((()=>{o((Ga||((Ga=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Ga))}),[o]),i}function Xa(e,t){return{parentId:e||null,index:t}}function Za(e,t){return{type:"line",index:e,level:t}}function Qa(e,t){var n;let r=e;for(;r.parent&&r.level>t;)r=r.parent;return{parentId:(null===(n=r.parent)||void 0===n?void 0:n.id)||null,index:Cr(r)+1}}function Ja(e){var t;const n=function(e,t){const n=e.getBoundingClientRect(),r=t.x-Math.round(n.x),i=t.y-Math.round(n.y),o=n.height,s=i<o/2,a=!s,l=o/4,c=i>l&&i<o-l;return{x:r,inTopHalf:s,inBottomHalf:a,inMiddle:c,atTop:!c&&s,atBottom:!c&&a}}(e.element,e.offset),r=e.indent,i=Math.round(Math.max(0,n.x-r)/r),{node:o,nextNode:s,prevNode:a}=e,[l,c]=function(e,t,n,r){return e?e.isInternal?r.atTop?[t,e]:r.inMiddle?[e,e]:[e,n]:r.inTopHalf?[t,e]:[e,n]:[t,null]}(o,a,s,n);if(o&&o.isInternal&&n.inMiddle)return{drop:Xa(o.id,null),cursor:(u=o.id,{type:"highlight",id:u})};var u;if(!l)return{drop:Xa(null===(t=null==c?void 0:c.parent)||void 0===t?void 0:t.id,0),cursor:Za(0,0)};if(Ir(l)){const e=wr(i,(null==c?void 0:c.level)||0,l.level);return{drop:Qa(l,e),cursor:Za(l.rowIndex+1,e)}}if(Sr(l)){const e=wr(i,(null==c?void 0:c.level)||0,l.level);return{drop:Qa(l,e),cursor:Za(l.rowIndex+1,e)}}if(Or(l)){const e=wr(i,0,l.level+1);return e>l.level?{drop:Xa(l.id,0),cursor:Za(l.rowIndex+1,e)}:{drop:Qa(l,e),cursor:Za(l.rowIndex+1,e)}}return{drop:Xa(null==l?void 0:l.id,0),cursor:Za(l.rowIndex+1,l.level+1)}}const el=i.memo((function({index:e,style:t}){jr(),function(){const e=p.useContext(yr);if(null===e)throw new Error("Provide a NodesContext")}();const n=vr(),r=function(e){const t=vr(),n=t.at(e);if(!n)throw new Error(`Could not find node for index: ${e}`);return p.useMemo((()=>{const r=n.clone();return t.visibleNodes[e]=r,r}),[...Object.values(n.state),n])}(e),i=p.useRef(null),o=$a(r),s=function(e,t){const n=vr(),[r,i]=da((()=>({accept:"NODE",canDrop:()=>n.canDrop(),hover:(r,i)=>{const o=i.getClientOffset();if(!e.current||!o)return;const{cursor:s,drop:a}=Ja({element:e.current,offset:o,indent:n.indent,node:t,prevNode:t.prev,nextNode:t.next});a&&n.dispatch(di.hovering(a.parentId,a.index)),i.canDrop()?s&&n.showCursor(s):n.hideCursor()},drop:(e,t)=>{if(!t.canDrop())return null;let{parentId:r,index:i,dragIds:o}=n.state.dnd;Fr(n.props.onMove,{dragIds:o,parentId:r===ei?null:r,index:null===i?0:i,dragNodes:n.dragNodes,parentNode:n.get(r)}),n.open(r)}})),[t,e.current,n.props]);return i}(i,r),l=p.useCallback((e=>{i.current=e,s(e)}),[s]),c=n.indent*r.level,u=p.useMemo((()=>({paddingLeft:c})),[c]),d=p.useMemo((()=>{var e,r;return Object.assign(Object.assign({},t),{top:parseFloat(t.top)+(null!==(r=null!==(e=n.props.padding)&&void 0!==e?e:n.props.paddingTop)&&void 0!==r?r:0)})}),[t,n.props.padding,n.props.paddingTop]),h={role:"treeitem","aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:d,tabIndex:-1,className:n.props.rowClassName};p.useEffect((()=>{var e;!r.isEditing&&r.isFocused&&(null===(e=i.current)||void 0===e||e.focus({preventScroll:!0}))}),[r.isEditing,r.isFocused,i.current]);const f=n.renderNode,g=n.renderRow;return a.jsx(g,{node:r,innerRef:l,attrs:h,children:a.jsx(f,{node:r,tree:n,style:u,dragHandle:o})})}));let tl="",nl=null;function rl(){jr();const e=vr();return a.jsx("div",{role:"tree",style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var n;if(e.isEditing)return;if("Backspace"===t.key){if(!e.props.onDelete)return;const t=Array.from(e.selectedIds);if(t.length>1){let n=e.mostRecentNode;for(;n&&n.isSelected;)n=n.nextSibling;n||(n=e.lastNode),e.focus(n,{scroll:!1}),e.delete(Array.from(t))}else{const t=e.focusedNode;if(t){const n=t.nextSibling,r=t.parent;e.focus(n||r,{scroll:!1}),e.delete(t)}}return}if("Tab"===t.key&&!t.shiftKey)return t.preventDefault(),void Er(t.currentTarget);if("Tab"===t.key&&t.shiftKey)return t.preventDefault(),void Tr(t.currentTarget);if("ArrowDown"===t.key){t.preventDefault();const n=e.nextNode;if(t.metaKey)return e.select(e.focusedNode),void e.activate(e.focusedNode);if(!t.shiftKey||e.props.disableMultiSelection)return void e.focus(n);{if(!n)return;const t=e.focusedNode;return void(t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.firstNode))}}if("ArrowUp"===t.key){t.preventDefault();const n=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection)return void e.focus(n);{if(!n)return;const t=e.focusedNode;return void(t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.lastNode))}}if("ArrowRight"===t.key){const t=e.focusedNode;if(!t)return;return void(t.isInternal&&t.isOpen?e.focus(e.nextNode):t.isInternal&&e.open(t.id))}if("ArrowLeft"===t.key){const t=e.focusedNode;if(!t||t.isRoot)return;return void(t.isInternal&&t.isOpen?e.close(t.id):(null===(n=t.parent)||void 0===n?void 0:n.isRoot)||e.focus(t.parent))}if("a"===t.key&&t.metaKey&&!e.props.disableMultiSelection)return t.preventDefault(),void e.selectAll();if("a"===t.key&&!t.metaKey&&e.props.onCreate)return void e.createLeaf();if("A"===t.key&&!t.metaKey){if(!e.props.onCreate)return;return void e.createInternal()}if("Home"===t.key)return t.preventDefault(),void e.focus(e.firstNode);if("End"===t.key)return t.preventDefault(),void e.focus(e.lastNode);if("Enter"===t.key){const t=e.focusedNode;if(!t)return;if(!t.isEditable||!e.props.onRename)return;return void setTimeout((()=>{t&&e.edit(t)}))}if(" "===t.key){t.preventDefault();const n=e.focusedNode;if(!n)return;return void(n.isLeaf?(n.select(),n.activate()):n.toggle())}if("*"===t.key){const t=e.focusedNode;if(!t)return;return void e.openSiblings(t)}if("PageUp"===t.key)return t.preventDefault(),void e.pageUp();"PageDown"===t.key&&(t.preventDefault(),e.pageDown()),clearTimeout(nl),tl+=t.key,nl=setTimeout((()=>{tl=""}),600);const r=e.visibleNodes.find((e=>{const t=e.data.name;return"string"==typeof t&&t.toLowerCase().startsWith(tl)}));r&&e.focus(r.id)},children:a.jsx(_i,{className:e.props.className,outerRef:e.listEl,itemCount:e.visibleNodes.length,height:e.height,width:e.width,itemSize:e.rowHeight,overscanCount:e.overscanCount,itemKey:t=>{var n;return(null===(n=e.visibleNodes[t])||void 0===n?void 0:n.id)||t},outerElementType:Ai,innerElementType:Ri,onScroll:e.props.onScroll,onItemsRendered:e.onItemsRendered.bind(e),ref:e.list,children:el})})}function il(e){return e.isFiltered?function(e,t){const n={},r=[];function i(e){if(!e.isRoot&&t(e)){n[e.id]=!0;let t=e.parent;for(;t;)n[t.id]=!0,t=t.parent}if(e.children)for(let t of e.children)i(t)}function o(e){var t;e.level>=0&&n[e.id]&&r.push(e),e.isOpen&&(null===(t=e.children)||void 0===t||t.forEach(o))}return i(e),o(e),r.forEach(ol),r}(e.root,e.isMatch.bind(e)):function(e){const t=[];function n(e){var r;e.level>=0&&t.push(e),e.isOpen&&(null===(r=e.children)||void 0===r||r.forEach(n))}return n(e),t.forEach(ol),t}(e.root)}function ol(e,t){e.rowIndex=t}const sl=e=>e.reduce(((e,t,n)=>(e[t.id]=n,e)),{});var al=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(t){o(t)}}function a(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const{safeRun:ll,identify:cl,identifyNull:ul}=Br;class dl{constructor(e,t,n,r){this.store=e,this.props=t,this.list=n,this.listEl=r,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=ti(this),this.visibleNodes=il(this),this.idToIndex=sl(this.visibleNodes)}update(e){this.props=e,this.root=ti(this),this.visibleNodes=il(this),this.idToIndex=sl(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 null!==(e=this.props.width)&&void 0!==e?e:300}get height(){var e;return null!==(e=this.props.height)&&void 0!==e?e:500}get indent(){var e;return null!==(e=this.props.indent)&&void 0!==e?e:24}get rowHeight(){var e;return null!==(e=this.props.rowHeight)&&void 0!==e?e:24}get overscanCount(){var e;return null!==(e=this.props.overscanCount)&&void 0!==e?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const t=null!==(e=this.props.searchMatch)&&void 0!==e?e:(e,t)=>JSON.stringify(Object.values(e.data)).toLocaleLowerCase().includes(t.toLocaleLowerCase());return e=>t(e,this.searchTerm)}accessChildren(e){var t;return null!==(t=Mr(e,this.props.childrenAccessor||"children"))&&void 0!==t?t:null}accessId(e){const t=Mr(e,this.props.idAccessor||"id");if(!t)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return t}get firstNode(){var e;return null!==(e=this.visibleNodes[0])&&void 0!==e?e:null}get lastNode(){var e;return null!==(e=this.visibleNodes[this.visibleNodes.length-1])&&void 0!==e?e:null}get focusedNode(){var e;return null!==(e=this.get(this.state.nodes.focus.id))&&void 0!==e?e:null}get mostRecentNode(){var e;return null!==(e=this.get(this.state.nodes.selection.mostRecent))&&void 0!==e?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return null===e?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return null===e?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,t){var n;if(null===e||null===t)return[];const r=null!==(n=this.indexOf(e))&&void 0!==n?n:0,i=this.indexOf(t);if(null===i)return[];const o=Math.min(r,i),s=Math.max(r,i);return this.visibleNodes.slice(o,s+1)}indexOf(e){const t=Rr(e);return t?this.idToIndex[t]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return al(this,arguments,void 0,(function*(e={}){var t,n;const r=void 0===e.parentId?Ur(this):e.parentId,i=null!==(t=e.index)&&void 0!==t?t:zr(this),o=null!==(n=e.type)&&void 0!==n?n:"leaf",s=yield ll(this.props.onCreate,{type:o,parentId:r,index:i,parentNode:this.get(r)});s&&(this.focus(s),setTimeout((()=>{this.edit(s).then((()=>{this.select(s),this.activate(s)}))})))}))}delete(e){return al(this,void 0,void 0,(function*(){if(!e)return;const t=(Array.isArray(e)?e:[e]).map(cl),n=t.map((e=>this.get(e))).filter((e=>!!e));yield ll(this.props.onDelete,{nodes:n,ids:t})}))}edit(e){const t=cl(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(t),this.dispatch(Zr(t)),new Promise((e=>{dl.editPromise=e}))}submit(e,t){return al(this,void 0,void 0,(function*(){if(!e)return;const n=cl(e);yield ll(this.props.onRename,{id:n,name:t,node:this.get(n)}),this.dispatch(Zr(null)),this.resolveEdit({cancelled:!1,value:t}),setTimeout((()=>this.onFocus()))}))}reset(){this.dispatch(Zr(null)),this.resolveEdit({cancelled:!0}),setTimeout((()=>this.onFocus()))}activate(e){const t=this.get(ul(e));t&&ll(this.props.onActivate,t)}resolveEdit(e){const t=dl.editPromise;t&&t(e),dl.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let t of Array.from(this.selectedIds)){const n=this.get(t);n&&e.push(n)}return e}focus(e,t={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(Qr(cl(e))),!1!==t.scroll&&this.scrollTo(e),this.focusedNode&&ll(this.props.onFocus,this.focusedNode)))}pageUp(){var e,t;const n=this.visibleStartIndex,r=this.visibleStopIndex-n;let i=null!==(t=null===(e=this.focusedNode)||void 0===e?void 0:e.rowIndex)&&void 0!==t?t:0;i=i>n?n:Math.max(n-r,0),this.focus(this.at(i))}pageDown(){var e,t;const n=this.visibleStartIndex,r=this.visibleStopIndex,i=r-n;let o=null!==(t=null===(e=this.focusedNode)||void 0===e?void 0:e.rowIndex)&&void 0!==t?t:0;o=o<r?r:Math.min(o+i,this.visibleNodes.length-1),this.focus(this.at(o))}select(e,t={}){if(!e)return;const n=!1!==t.focus,r=cl(e);n&&this.dispatch(Qr(r)),this.dispatch(oi(r)),this.dispatch(ui(r)),this.dispatch(ci(r)),this.scrollTo(r,t.align),this.focusedNode&&n&&ll(this.props.onFocus,this.focusedNode),ll(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const t=cl(e);this.dispatch(ai(t)),ll(this.props.onSelect,this.selectedNodes)}selectMulti(e){const t=this.get(ul(e));t&&(this.dispatch(Qr(t.id)),this.dispatch(si(t.id)),this.dispatch(ui(t.id)),this.dispatch(ci(t.id)),this.scrollTo(t),this.focusedNode&&ll(this.props.onFocus,this.focusedNode),ll(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const t=cl(e),{anchor:n,mostRecent:r}=this.state.nodes.selection;this.dispatch(Qr(t)),this.dispatch(ai(this.nodesBetween(n,r))),this.dispatch(si(this.nodesBetween(n,ul(t)))),this.dispatch(ci(t)),this.scrollTo(t),this.focusedNode&&ll(this.props.onFocus,this.focusedNode),ll(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),ll(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(Qr(null===(e=this.lastNode)||void 0===e?void 0:e.id)),this.focusedNode&&ll(this.props.onFocus,this.focusedNode),ll(this.props.onSelect,this.selectedNodes)}setSelection(e){var t;const n=new Set(null===(t=e.ids)||void 0===t?void 0:t.map(cl)),r=ul(e.anchor),i=ul(e.mostRecent);this.dispatch(li({ids:n,anchor:r,mostRecent:i})),ll(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;return"highlight"===e.type?e.id:null}get cursorOverFolder(){return"highlight"===this.state.dnd.cursor.type}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 t=null!==(e=this.get(this.state.dnd.parentId))&&void 0!==e?e:this.root,n=this.dragNodes,r=this.props.disableDrop;for(const i of n){if(!i)return!1;if(!t)return!1;if(i.isInternal&&kr(t,i))return!1}return"function"==typeof r?!r({parentNode:t,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):"string"==typeof r?!t.data[r]:"boolean"!=typeof r||!r}hideCursor(){this.dispatch(di.cursor({type:"none"}))}showCursor(e){this.dispatch(di.cursor(e))}open(e){const t=ul(e);t&&(this.isOpen(t)||(this.dispatch(ni.open(t,this.isFiltered)),ll(this.props.onToggle,t)))}close(e){const t=ul(e);t&&this.isOpen(t)&&(this.dispatch(ni.close(t,this.isFiltered)),ll(this.props.onToggle,t))}toggle(e){const t=ul(e);if(t)return this.isOpen(t)?this.close(t):this.open(t)}openParents(e){const t=ul(e);if(!t)return;const n=Nr(this.root,t);let r=null==n?void 0:n.parent;for(;r;)this.open(r.id),r=r.parent}openSiblings(e){const t=e.parent;if(t){if(t.children){const n=e.isOpen;for(let e of t.children)e.isInternal&&(n?this.close(e.id):this.open(e.id));this.scrollTo(this.focusedNode)}}else this.toggle(e.id)}openAll(){Dr(this.root,(e=>{e.isInternal&&e.open()}))}closeAll(){Dr(this.root,(e=>{e.isInternal&&e.close()}))}scrollTo(e,t="smart"){if(!e)return;const n=cl(e);return this.openParents(n),Hr((()=>n in this.idToIndex)).then((()=>{var e;const r=this.idToIndex[n];void 0!==r&&(null===(e=this.list.current)||void 0===e||e.scrollToItem(r,t))})).catch((()=>{}))}get isEditing(){return null!==this.state.nodes.edit.id}get isFiltered(){var e;return!!(null===(e=this.props.searchTerm)||void 0===e?void 0:e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return 0===this.state.nodes.selection.ids.size}get hasOneSelection(){return 1===this.state.nodes.selection.ids.size}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return!!e&&this.state.nodes.selection.ids.has(e)}isOpen(e){var t,n,r;if(!e)return!1;if(e===ei)return!0;const i=null===(t=this.props.openByDefault)||void 0===t||t;return this.isFiltered?null===(n=this.state.nodes.open.filtered[e])||void 0===n||n:null!==(r=this.state.nodes.open.unfiltered[e])&&void 0!==r?r:i}isEditable(e){return!Mr(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!Mr(e,this.props.disableDrag||(()=>!1))}isDragging(e){const t=ul(e);return!!t&&this.state.nodes.drag.id===t}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const t=ul(e);if(!t)return!1;const{destinationParentId:n,destinationIndex:r}=this.state.nodes.drag;return t===n&&null===r}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(Qr(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||rl}get renderRow(){return this.props.renderRow||Kr}get renderNode(){return this.props.children||Yr}get renderDragPreview(){return this.props.renderDragPreview||gi}get renderCursor(){return this.props.renderCursor||Gr}}function hl(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var fl=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),pl=()=>Math.random().toString(36).substring(7).split("").join("."),gl={INIT:`@@redux/INIT${pl()}`,REPLACE:`@@redux/REPLACE${pl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${pl()}`};function ml(e,t,n){if("function"!=typeof e)throw new Error(hl(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(hl(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(hl(1));return n(ml)(e,t)}let r=e,i=t,o=new Map,s=o,a=0,l=!1;function c(){s===o&&(s=new Map,o.forEach(((e,t)=>{s.set(t,e)})))}function u(){if(l)throw new Error(hl(3));return i}function d(e){if("function"!=typeof e)throw new Error(hl(4));if(l)throw new Error(hl(5));let t=!0;c();const n=a++;return s.set(n,e),function(){if(t){if(l)throw new Error(hl(6));t=!1,c(),s.delete(n),o=null}}}function h(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw new Error(hl(7));if(void 0===e.type)throw new Error(hl(8));if("string"!=typeof e.type)throw new Error(hl(17));if(l)throw new Error(hl(9));try{l=!0,i=r(i,e)}finally{l=!1}return(o=s).forEach((e=>{e()})),e}h({type:gl.INIT});return{dispatch:h,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(hl(10));r=e,h({type:gl.REPLACE})},[fl]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(hl(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[fl](){return this}}}}}function vl(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const r=t[s];"function"==typeof e[r]&&(n[r]=e[r])}const r=Object.keys(n);let i;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:gl.INIT}))throw new Error(hl(12));if(void 0===n(void 0,{type:gl.PROBE_UNKNOWN_ACTION()}))throw new Error(hl(13))}))}(n)}catch(o){i=o}return function(e={},t){if(i)throw i;let o=!1;const s={};for(let i=0;i<r.length;i++){const a=r[i],l=n[a],c=e[a],u=l(c,t);if(void 0===u)throw t&&t.type,new Error(hl(14));s[a]=u,o=o||u!==c}return o=o||r.length!==Object.keys(e).length,o?s:e}}const yl=vl({nodes:vl({focus:function(e={id:null,treeFocused:!1},t){return"FOCUS"===t.type?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):"TREE_BLUR"===t.type?Object.assign(Object.assign({},e),{treeFocused:!1}):e},edit:function(e={id:null},t){return"EDIT"===t.type?Object.assign(Object.assign({},e),{id:t.id}):e},open:function(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:ri(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:ri(e.unfiltered,t)}):e},selection:function(e=ii().nodes.selection,t){const n=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return 0===t.ids.length?e:(t.ids.forEach((e=>n.add(e))),Object.assign(Object.assign({},e),{ids:new Set(n)}));case"SELECTION_REMOVE":return 0===t.ids.length?e:(t.ids.forEach((e=>n.delete(e))),Object.assign(Object.assign({},e),{ids:new Set(n)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}},drag:function(e=ii().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}}),dnd:function(e=ii().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return ii().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}}),xl=ii();function bl({treeProps:e,imperativeHandle:t,children:n}){const r=p.useRef(null),i=p.useRef(null),o=p.useRef(ml(yl,ii(e))),s=yt.useSyncExternalStore(o.current.subscribe,o.current.getState,(()=>xl)),l=p.useMemo((()=>new dl(o.current,e,r,i)),[]),c=p.useRef(0);return p.useMemo((()=>{c.current+=1,l.update(e)}),[...Object.values(e),s.nodes.open]),p.useImperativeHandle(t,(()=>l)),p.useEffect((()=>{l.props.selection?l.select(l.props.selection,{focus:!1}):l.deselectAll()}),[l.props.selection]),p.useEffect((()=>{l.props.searchTerm||o.current.dispatch(ni.clear(!0))}),[l.props.searchTerm]),a.jsx(mr.Provider,{value:l,children:a.jsx(br.Provider,{value:c.current,children:a.jsx(yr.Provider,{value:s.nodes,children:a.jsx(xr.Provider,{value:s.dnd,children:a.jsx(ps,Object.assign({backend:Ya,options:{rootElement:l.props.dndRootElement||void 0}},e.dndManager&&{manager:e.dndManager},{children:n}))})})})})}function jl(e){return function(){const e=vr(),[,t]=da((()=>({accept:"NODE",canDrop:(t,n)=>!!n.isOver({shallow:!0})&&e.canDrop(),hover:(t,n)=>{if(!n.isOver({shallow:!0}))return;const r=n.getClientOffset();if(!e.listEl.current||!r)return;const{cursor:i,drop:o}=Ja({element:e.listEl.current,offset:r,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});o&&e.dispatch(di.hovering(o.parentId,o.index)),n.canDrop()?i&&e.showCursor(i):e.hideCursor()}})),[e]);t(e.listEl)}(),e.children}function wl(){const e=vr().props.renderContainer||rl;return a.jsx(a.Fragment,{children:a.jsx(e,{})})}function Il(){const e=vr(),{offset:t,mouse:n,item:r,isDragging:i}=(o=e=>({offset:e.getSourceClientOffset(),mouse:e.getClientOffset(),item:e.getItem(),isDragging:e.isDragging()}),s=Bs().getMonitor(),l=ha(Zs(s,o),2),c=l[0],u=l[1],p.useEffect((function(){return s.subscribeToOffsetChange(u)})),p.useEffect((function(){return s.subscribeToStateChange(u)})),c);var o,s,l,c,u;const d=e.props.renderDragPreview||gi;return a.jsx(d,{offset:t,mouse:n,id:(null==r?void 0:r.id)||null,dragIds:(null==r?void 0:r.dragIds)||[],isDragging:i})}class Sl{constructor(e){this.root=function(e){const t=new kl({id:"ROOT"},null);return t.children=e.map((e=>Ol(e,t))),t}(e)}get data(){var e,t;return null!==(t=null===(e=this.root.children)||void 0===e?void 0:e.map((e=>e.data)))&&void 0!==t?t:[]}create(e){const t=e.parentId?this.find(e.parentId):this.root;if(!t)return null;t.addChild(e.data,e.index)}move(e){const t=this.find(e.id),n=e.parentId?this.find(e.parentId):this.root;t&&n&&(n.addChild(t.data,e.index),t.drop())}update(e){const t=this.find(e.id);t&&t.update(e.changes)}drop(e){const t=this.find(e.id);t&&t.drop()}find(e,t=this.root){if(!t)return null;if(t.id===e)return t;if(t.children){for(let n of t.children){const t=this.find(e,n);if(t)return t}return null}return null}}function Ol(e,t){const n=new kl(e,t);return e.children&&(n.children=e.children.map((e=>Ol(e,n)))),n}class kl{constructor(e,t){this.data=e,this.parent=t,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,t){var n,r;const i=Ol(e,this);this.children=null!==(n=this.children)&&void 0!==n?n:[],this.children.splice(t,0,i),this.data.children=null!==(r=this.data.children)&&void 0!==r?r:[],this.data.children.splice(t,0,e)}removeChild(e){var t,n;null===(t=this.children)||void 0===t||t.splice(e,1),null===(n=this.data.children)||void 0===n||n.splice(e,1)}update(e){if(this.hasParent()){const t=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),t),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let Cl=0;function Nl(e){if(e.initialData&&e.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw new Error("React Arborist Tree => You passed the initialData prop along with a data handler.\nUse the data prop if you want to provide your own handlers.");if(e.initialData){const[t,n]=function(e){const[t,n]=p.useState(e),r=p.useMemo((()=>new Sl(t)),[t]);return[t,{onMove:e=>{for(const t of e.dragIds)r.move({id:t,parentId:e.parentId,index:e.index});n(r.data)},onRename:({name:e,id:t})=>{r.update({id:t,changes:{name:e}}),n(r.data)},onCreate:({parentId:e,index:t,type:i})=>{const o={id:"simple-tree-id-"+Cl++,name:""};return"internal"===i&&(o.children=[]),r.create({parentId:e,index:t,data:o}),n(r.data),o},onDelete:e=>{e.ids.forEach((e=>r.drop({id:e}))),n(r.data)}}]}(e.initialData);return Object.assign(Object.assign(Object.assign({},e),n),{data:t})}return e}const Dl=p.forwardRef((function(e,t){const n=Nl(e);return a.jsxs(bl,{treeProps:n,imperativeHandle:t,children:[a.jsx(jl,{children:a.jsx(wl,{})}),a.jsx(Il,{})]})}));export{bt as A,jt as B,hr as C,Et as G,Nn as K,Tt as L,gr as M,Mt as P,Bt as S,Dl as T,Rt as Y,Dt as a,_t as b,Ot as c,pr as d,In as e,wt as f,jn as g,Ut as h,Sn as i,un as j,Cn as k,Jt as l,cn as m,on as n,rn as o,yn as p,On as q,kn as r,dn as s,hn as t,Wt as u,Xt as v,Qt as w,Zt as x,kt as y,Sl as z};
|