@decocms/mesh 2.128.2 → 2.128.3
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/client/assets/{AlertCircle-Ci70K_EZ.js → AlertCircle-DQQcPtgD.js} +1 -1
- package/dist/client/assets/{AlertOctagon-CqLqdISi.js → AlertOctagon-hF9xAZsV.js} +1 -1
- package/dist/client/assets/{ArrowDown-BB4lqZfQ.js → ArrowDown-Cf0RNEZQ.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DOvB9XQA.js → ArrowLeft-D7lFQljS.js} +1 -1
- package/dist/client/assets/{ArrowUp-ByjI1wop.js → ArrowUp-CKXiX_Ao.js} +1 -1
- package/dist/client/assets/{Check-Dnxirgog.js → Check-B_1XgGXq.js} +1 -1
- package/dist/client/assets/{CheckCircle-DNKireMY.js → CheckCircle-teFEREuu.js} +1 -1
- package/dist/client/assets/{CheckDone01-BQB-AnYZ.js → CheckDone01-BlB1S8hb.js} +1 -1
- package/dist/client/assets/{CheckVerified02-I-XS300S.js → CheckVerified02-C72zve8A.js} +1 -1
- package/dist/client/assets/{ChevronDown-DlCNAUXg.js → ChevronDown-BCXsTPO0.js} +1 -1
- package/dist/client/assets/{ChevronRight-BjXZnVl8.js → ChevronRight-Dv5Kd3sh.js} +1 -1
- package/dist/client/assets/{Clock-CuTVdxgk.js → Clock-B4Ctq7dH.js} +1 -1
- package/dist/client/assets/{Code01-D62OImsE.js → Code01-gdNPPDL2.js} +1 -1
- package/dist/client/assets/{Container-NYiiZyd6.js → Container-JCSa3G3B.js} +1 -1
- package/dist/client/assets/{Copy01--WUANgtG.js → Copy01-B1lCFyqr.js} +1 -1
- package/dist/client/assets/{Dataflow03-r1iydeQd.js → Dataflow03-CmiJ_a2x.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-CIJOriRT.js → DotsHorizontal-DYVOSQNI.js} +1 -1
- package/dist/client/assets/{DotsVertical-CdVqSSOc.js → DotsVertical-Dv4tBZU-.js} +1 -1
- package/dist/client/assets/{Download01-CB8jg-CL.js → Download01-DIwP2P7D.js} +1 -1
- package/dist/client/assets/{Edit01-DK-8NMEI.js → Edit01-DDXcCS4H.js} +1 -1
- package/dist/client/assets/{Eye-broatAu7.js → Eye-BZHp_wD7.js} +1 -1
- package/dist/client/assets/{File02-D0NaH0bX.js → File02-D8nm9j-J.js} +1 -1
- package/dist/client/assets/{File06-WXzmRYLt.js → File06-D-_j0iW5.js} +1 -1
- package/dist/client/assets/{FilterLines-frJ-GsBz.js → FilterLines-BP-6W-PZ.js} +1 -1
- package/dist/client/assets/{Globe01-VgVHGjyC.js → Globe01-BUQmYqse.js} +1 -1
- package/dist/client/assets/{Globe02-C0qeWKnK.js → Globe02-CitacpSB.js} +1 -1
- package/dist/client/assets/{Grid01-Dyv_Ip5i.js → Grid01-9bvbF-2s.js} +1 -1
- package/dist/client/assets/{Hash02-oBjA0qJC.js → Hash02-B1Ogol6o.js} +1 -1
- package/dist/client/assets/{Home02-DX25irYw.js → Home02-BQf2Bq1d.js} +1 -1
- package/dist/client/assets/{Image01-Dv4Xx4Vn.js → Image01-DQT9mrMs.js} +1 -1
- package/dist/client/assets/{Inbox01-Bh1zeW2m.js → Inbox01-jnM9oRqF.js} +1 -1
- package/dist/client/assets/{InfoCircle-C7uLV_XX.js → InfoCircle-CGMOojOv.js} +1 -1
- package/dist/client/assets/{Key01-DVkykkuH.js → Key01-xmVowZ8K.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D9NBeY0S.js → LinkExternal01-D9XuFg7K.js} +1 -1
- package/dist/client/assets/{List-C9ntvlpP.js → List-klt4Ktng.js} +1 -1
- package/dist/client/assets/{Loading01-D2eBBNoh.js → Loading01-fS4L07xH.js} +1 -1
- package/dist/client/assets/{Lock01-ep_v0VnB.js → Lock01-BKSJ7A3p.js} +1 -1
- package/dist/client/assets/{Play-DfNy_KGK.js → Play-xVtvzzCw.js} +1 -1
- package/dist/client/assets/{Plus-CoFNXdPs.js → Plus-J6pIe2uV.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-J5wqqeG_.js → RefreshCcw01-CL_G5oMs.js} +1 -1
- package/dist/client/assets/{Rows03-D7jJRDVm.js → Rows03-cUxIL8D0.js} +1 -1
- package/dist/client/assets/{Save01-DCBihulA.js → Save01-CdMTv6PL.js} +1 -1
- package/dist/client/assets/{SearchMd-WqvhRztL.js → SearchMd-CifRamFZ.js} +1 -1
- package/dist/client/assets/{Settings01-CF0yl6Tz.js → Settings01-B28HDbDZ.js} +1 -1
- package/dist/client/assets/{Shield01-BVTU_rBf.js → Shield01-BrHq9skT.js} +1 -1
- package/dist/client/assets/{Terminal-BWI5ji_M.js → Terminal-BPUAzvCO.js} +1 -1
- package/dist/client/assets/{Tool01-uNfJ4BgB.js → Tool01-6ldn8KE7.js} +1 -1
- package/dist/client/assets/{Trash01-Bilx6R4T.js → Trash01-BGRjTxek.js} +1 -1
- package/dist/client/assets/{Upload01-yL5uy1IO.js → Upload01-Z7XprHF7.js} +1 -1
- package/dist/client/assets/{Users03-ELQ8CczK.js → Users03-DkrzV9ZI.js} +1 -1
- package/dist/client/assets/{X-DlPknjOM.js → X-BY3es49B.js} +1 -1
- package/dist/client/assets/{XCircle-aBox2-uz.js → XCircle-DZ1yCOQ6.js} +1 -1
- package/dist/client/assets/{XClose-Baiitjul.js → XClose-Cc-gaidr.js} +1 -1
- package/dist/client/assets/agent-connections-preview-pDe7P7Ta.js +1 -0
- package/dist/client/assets/agent-detail-2TyklQZz.js +2 -0
- package/dist/client/assets/agents-DKPHVEr-.js +1 -0
- package/dist/client/assets/alert-dialog-Dcn63g6g.js +7 -0
- package/dist/client/assets/{auth-catchall-DmQOOeQy.js → auth-catchall-Dho6OcVz.js} +1 -1
- package/dist/client/assets/avatar-PHdbjFDw.js +1 -0
- package/dist/client/assets/badge-SF6wUW5L.js +1 -0
- package/dist/client/assets/{binder--zY5y66H.js → binder-D_h2ibfT.js} +1 -1
- package/dist/client/assets/breadcrumb-C0g6Pt2_.js +1 -0
- package/dist/client/assets/card-BdxqmIDs.js +1 -0
- package/dist/client/assets/chart-BUZSWI3B.js +15 -0
- package/dist/client/assets/checkbox-LKkMIiIW.js +1 -0
- package/dist/client/assets/{circle-alert-B7z6aEqV.js → circle-alert-tYCIieku.js} +1 -1
- package/dist/client/assets/{collection-detail-Nf6HLmBW.js → collection-detail-ByuFgV2Y.js} +4 -4
- package/dist/client/assets/collection-search-qyutGH6l.js +1 -0
- package/dist/client/assets/collection-tab-BbAfStP-.js +1 -0
- package/dist/client/assets/collection-table-wrapper-C9APekgb.js +1 -0
- package/dist/client/assets/collection-tabs-h2vOc-_S.js +1 -0
- package/dist/client/assets/command-FPE9wf0f.js +1 -0
- package/dist/client/assets/connect-CX8KQP6_.js +1 -0
- package/dist/client/assets/connection-card-ZsVFtnK9.js +1 -0
- package/dist/client/assets/connection-detail-pqk6mgg9.js +1 -0
- package/dist/client/assets/connections-BohwKULL.js +1 -0
- package/dist/client/assets/{constants-V7-3C38y.js → constants-CYyFC-Sp.js} +1 -1
- package/dist/client/assets/constants-DllrcpiP.js +1 -0
- package/dist/client/assets/{context-BBfuJWes.js → context-DCvH3r3j.js} +4 -4
- package/dist/client/assets/create-organization-dialog-BCgnCEPh.js +1 -0
- package/dist/client/assets/create-project-dialog-CrEm4IvG.js +1 -0
- package/dist/client/assets/dialog-DjBLF9Xz.js +1 -0
- package/dist/client/assets/dropdown-menu-dMkqHp7f.js +1 -0
- package/dist/client/assets/dynamic-plugin-layout-DnTEhExp.js +1 -0
- package/dist/client/assets/editable-thread-title-CGN0Mgzr.js +16 -0
- package/dist/client/assets/empty-state-B6tWKHPM.js +1 -0
- package/dist/client/assets/env-vars-editor-D0A2SEWh.js +1 -0
- package/dist/client/assets/{extract-connection-data-DyTSTIQR.js → extract-connection-data-Bc1UBsWZ.js} +1 -1
- package/dist/client/assets/file-browser-BAUqIo1x.js +2 -0
- package/dist/client/assets/form-DKDTPBJL.js +1 -0
- package/dist/client/assets/grid-view-DBeJ-u7v.js +1 -0
- package/dist/client/assets/home-o-8rSFPM.js +1 -0
- package/dist/client/assets/{index-kTXXfvC-.js → index-Bf_CY3qu.js} +1 -1
- package/dist/client/assets/index-BoZYckTW.js +1 -0
- package/dist/client/assets/{index-CI36RmtE.js → index-Cr71gOj3.js} +1 -1
- package/dist/client/assets/index-CxnWkZZb.js +1 -0
- package/dist/client/assets/index-DCxyPrpA.js +1 -0
- package/dist/client/assets/{index-uOrjFt6t.js → index-DL3qqjep.js} +36 -36
- package/dist/client/assets/{index-CW4zTmBX.js → index-DXe5aLcB.js} +1 -1
- package/dist/client/assets/{index-DTB_8xm9.js → index-EAWMJGj2.js} +11 -11
- package/dist/client/assets/{index-BpUpHsNU.js → index-nz17Zavj.js} +2 -2
- package/dist/client/assets/{infiniteQueryObserver-DS9VDnBa.js → infiniteQueryObserver-QkJ406yX.js} +1 -1
- package/dist/client/assets/input-pcdA_rWs.js +1 -0
- package/dist/client/assets/integration-icon-CDKf5lkP.js +1 -0
- package/dist/client/assets/label-Cs0rMyA0.js +1 -0
- package/dist/client/assets/layout-BM96F8A6.js +1 -0
- package/dist/client/assets/{localstorage-keys-r_mW6Lq0.js → localstorage-keys-DuRbtKex.js} +1 -1
- package/dist/client/assets/login-UlwWZHgc.js +1 -0
- package/dist/client/assets/{markdown-BD6zDSJc.js → markdown-CN9uWcE5.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CDj0bpnF.js → mcp-oauth-1reN8tHJ.js} +1 -1
- package/dist/client/assets/mcp-server-card-BvqzVqbR.js +1 -0
- package/dist/client/assets/mcp-server-detail-44WaE8j1.js +2 -0
- package/dist/client/assets/members-Dlu0JdHg.js +3 -0
- package/dist/client/assets/{monitoring-FEHIw1jG.js → monitoring-BkGKM_nf.js} +3 -3
- package/dist/client/assets/monitoring-dashboard-edit-Bh6jLPJ-.js +1 -0
- package/dist/client/assets/{monitoring-dashboard-view-eE4UAi9y.js → monitoring-dashboard-view-BR_gx-ah.js} +2 -2
- package/dist/client/assets/{oauth-callback-AmREHdz2.js → oauth-callback-My1FCnBz.js} +1 -1
- package/dist/client/assets/page-CTS2P4X2.js +1 -0
- package/dist/client/assets/page-CrdufU7i.js +1 -0
- package/dist/client/assets/{plugin-empty-state-OjZLLHuW.js → plugin-empty-state-BL9scDTN.js} +1 -1
- package/dist/client/assets/plugin-empty-state-CM6Dryag.js +1 -0
- package/dist/client/assets/plugin-header-C1mnXf_l.js +1 -0
- package/dist/client/assets/{plugin-header-DqYSY5WD.js → plugin-header-UsujlRy8.js} +1 -1
- package/dist/client/assets/popover-DVJVvDk4.js +1 -0
- package/dist/client/assets/project-layout-ChFI6quF.js +1 -0
- package/dist/client/assets/projects-list-tpjdpWOF.js +1 -0
- package/dist/client/assets/ranking-layout-CrYiPhgR.js +1 -0
- package/dist/client/assets/{readme-viewer-DAvIfvua.js → readme-viewer-B2f4puJD.js} +1 -1
- package/dist/client/assets/{registry-layout-BcVc2nNS.js → registry-layout-C0R7NUsH.js} +2 -2
- package/dist/client/assets/{registry-utils-CwZm8daW.js → registry-utils-D-aIeu5g.js} +1 -1
- package/dist/client/assets/reports-layout-DXj87viG.js +3 -0
- package/dist/client/assets/reset-password-BlWYJ3vA.js +1 -0
- package/dist/client/assets/resizable-BejyKOGo.js +1 -0
- package/dist/client/assets/save-actions-DT09KS_7.js +1 -0
- package/dist/client/assets/{scroll-area-BbTrJsHn.js → scroll-area-pgllOsbM.js} +2 -2
- package/dist/client/assets/select-Dz5z65Jw.js +1 -0
- package/dist/client/assets/shell-layout-BeWeSxb6.js +3 -0
- package/dist/client/assets/skeleton-tlo_AcXS.js +1 -0
- package/dist/client/assets/spinner-DL1kXbn_.js +1 -0
- package/dist/client/assets/{store-invite-CBtJIAbW.js → store-invite-KhqhYrJe.js} +1 -1
- package/dist/client/assets/switch-D5s4GvE7.js +1 -0
- package/dist/client/assets/table-JlnXtC1o.js +1 -0
- package/dist/client/assets/tabs-BMRmFudX.js +1 -0
- package/dist/client/assets/tasks-BdJ0UZyL.js +1 -0
- package/dist/client/assets/textarea-_RA9G-2H.js +1 -0
- package/dist/client/assets/{time-range-picker-jCfxVj6J.js → time-range-picker-Z6Jl1sx4.js} +4 -4
- package/dist/client/assets/toggle-group-X_GdAmsv.js +1 -0
- package/dist/client/assets/tools-list-RgSwLK9F.js +1 -0
- package/dist/client/assets/tooltip--eNCFRSk.js +1 -0
- package/dist/client/assets/{topbar-portal-CjBmYjs5.js → topbar-portal-D3cWepwE.js} +1 -1
- package/dist/client/assets/{types-jYkZj_oN.js → types-Dz8v8wA9.js} +1 -1
- package/dist/client/assets/use-binding-DWmbEHQx.js +1 -0
- package/dist/client/assets/{use-connection-DqGqpr6W.js → use-connection-CKm1ISVV.js} +1 -1
- package/dist/client/assets/{use-copy-CvA2en_g.js → use-copy-DvH_rwny.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DJv6y6EJ.js → use-create-virtual-mcp-Cl3FIypU.js} +1 -1
- package/dist/client/assets/use-deco-chat-open-BifT_Q7T.js +1 -0
- package/dist/client/assets/{use-install-from-registry-iT6pKCDG.js → use-install-from-registry-DxwNEXQz.js} +1 -1
- package/dist/client/assets/use-list-state-5G9UAtpG.js +1 -0
- package/dist/client/assets/{use-llm-CDYsARAu.js → use-llm-CZ5h-I5e.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-B9LoAxha.js → use-mcp-prompts-C-kJi0NP.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DuTyW4Xm.js → use-mcp-tools-Du7LOEev.js} +1 -1
- package/dist/client/assets/{use-members-ByAHJbqb.js → use-members-JNLhgbe4.js} +1 -1
- package/dist/client/assets/{use-mobile-DA9mzCuy.js → use-mobile-BVeJwtRE.js} +1 -1
- package/dist/client/assets/{use-project-Cr1TKfdV.js → use-project-BznKdNgg.js} +1 -1
- package/dist/client/assets/{use-settings-modal-DVxljFTz.js → use-settings-modal-DikSOkid.js} +1 -1
- package/dist/client/assets/{use-view-mode-DJ9lvNoA.js → use-view-mode-BUENrs7s.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-B7YffSTv.js → use-virtual-mcp-DQ9c7C3W.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-XciTiRf0.js +1 -0
- package/dist/client/assets/{useMutation-BYvhr9Wj.js → useMutation-UrnS9vWD.js} +1 -1
- package/dist/client/assets/useQuery-J1yQO0sX.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BcyK5gD4.js +1 -0
- package/dist/client/assets/workflow-Bed30GUE.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +168 -168
- package/dist/server/server.js +169 -169
- package/package.json +1 -1
- package/dist/client/assets/AlertTriangle-D2guHjVq.js +0 -1
- package/dist/client/assets/RefreshCw01-CyeiQkso.js +0 -1
- package/dist/client/assets/agent-connections-preview-Dn72V1xG.js +0 -1
- package/dist/client/assets/agent-detail-Dy29kukR.js +0 -2
- package/dist/client/assets/agents-KAvJ30x5.js +0 -1
- package/dist/client/assets/alert-dialog-DrmsJmsN.js +0 -7
- package/dist/client/assets/avatar-DjSt5kfT.js +0 -1
- package/dist/client/assets/badge-Dj7JdmaJ.js +0 -1
- package/dist/client/assets/breadcrumb-DmYstfbP.js +0 -1
- package/dist/client/assets/button-D10odSSz.js +0 -1
- package/dist/client/assets/card-9y5GtFsZ.js +0 -1
- package/dist/client/assets/chart-Bp3LQrS9.js +0 -15
- package/dist/client/assets/checkbox-D2YWMWVu.js +0 -1
- package/dist/client/assets/collection-search-BAmI-gVt.js +0 -1
- package/dist/client/assets/collection-tab-CQQXE46p.js +0 -1
- package/dist/client/assets/collection-table-wrapper-fcFg8ybt.js +0 -1
- package/dist/client/assets/collection-tabs-D2IJ4sD1.js +0 -1
- package/dist/client/assets/command-BMl6YeZX.js +0 -1
- package/dist/client/assets/connect-ezzuoZk1.js +0 -1
- package/dist/client/assets/connection-card-BPNLF3Zq.js +0 -1
- package/dist/client/assets/connection-detail-B931e97h.js +0 -1
- package/dist/client/assets/connections-Du--7tHh.js +0 -1
- package/dist/client/assets/constants-wwWYqq9s.js +0 -1
- package/dist/client/assets/create-organization-dialog-3HZ9Fapi.js +0 -1
- package/dist/client/assets/create-project-dialog-D87AirfP.js +0 -1
- package/dist/client/assets/dialog-bLBl7se3.js +0 -1
- package/dist/client/assets/dropdown-menu-D6LMimH3.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-Dl6SpfCc.js +0 -1
- package/dist/client/assets/editable-thread-title-C5iprBiE.js +0 -16
- package/dist/client/assets/empty-state-CPu-zZBv.js +0 -1
- package/dist/client/assets/env-vars-editor-DflzxmJb.js +0 -1
- package/dist/client/assets/error-boundary-apRp8Xmr.js +0 -1
- package/dist/client/assets/file-browser-D4rvNQn-.js +0 -2
- package/dist/client/assets/form-CSWi3me2.js +0 -1
- package/dist/client/assets/grid-view-CIKn_gai.js +0 -1
- package/dist/client/assets/home-urEawFOR.js +0 -1
- package/dist/client/assets/index-BsrQAmtK.js +0 -1
- package/dist/client/assets/index-CX1TvU3T.js +0 -1
- package/dist/client/assets/index-h05RWZry.js +0 -1
- package/dist/client/assets/input-C8Cn3OQt.js +0 -1
- package/dist/client/assets/integration-icon-CHvqhFEd.js +0 -1
- package/dist/client/assets/label-D84F6EwM.js +0 -1
- package/dist/client/assets/layout-14xmCS52.js +0 -1
- package/dist/client/assets/login-D-_vmeEI.js +0 -1
- package/dist/client/assets/mcp-server-card-B4JV-Q1h.js +0 -1
- package/dist/client/assets/mcp-server-detail-CsXpfhbo.js +0 -2
- package/dist/client/assets/members-B0_Xg_uw.js +0 -3
- package/dist/client/assets/monitoring-dashboard-edit-D9Ku98yT.js +0 -1
- package/dist/client/assets/page-383FaDV2.js +0 -1
- package/dist/client/assets/page-thqQ0ll8.js +0 -1
- package/dist/client/assets/plugin-empty-state-Bi8TKl0X.js +0 -1
- package/dist/client/assets/plugin-header-NOGbkpim.js +0 -1
- package/dist/client/assets/popover-B_SzRtKR.js +0 -1
- package/dist/client/assets/project-layout-DxcVceRu.js +0 -1
- package/dist/client/assets/projects-list-FULLceFc.js +0 -1
- package/dist/client/assets/ranking-layout-B_B3SLxi.js +0 -1
- package/dist/client/assets/reports-layout-Cb_9di8U.js +0 -3
- package/dist/client/assets/reset-password-tNDIWT24.js +0 -1
- package/dist/client/assets/resizable-BvPyhOvU.js +0 -1
- package/dist/client/assets/save-actions-DTbCJcwB.js +0 -1
- package/dist/client/assets/select-BZB4uvGm.js +0 -1
- package/dist/client/assets/shell-layout-BHmLkMzR.js +0 -3
- package/dist/client/assets/skeleton-B9aXeb5e.js +0 -1
- package/dist/client/assets/spinner-BeYA_hqO.js +0 -1
- package/dist/client/assets/switch-CkEMQ9Z5.js +0 -1
- package/dist/client/assets/table-D_a-Z4Fv.js +0 -1
- package/dist/client/assets/tabs-Cqye-vZ-.js +0 -1
- package/dist/client/assets/tasks-DbmObaDD.js +0 -1
- package/dist/client/assets/textarea-CLWsfk4l.js +0 -1
- package/dist/client/assets/toggle-group-BUoI214e.js +0 -1
- package/dist/client/assets/tools-list-jE6c8Z18.js +0 -1
- package/dist/client/assets/tooltip-CooOHv4u.js +0 -1
- package/dist/client/assets/use-binding-9lQePXv2.js +0 -1
- package/dist/client/assets/use-deco-chat-open-DeWcxP9f.js +0 -1
- package/dist/client/assets/use-list-state-0IvPs7yX.js +0 -1
- package/dist/client/assets/useInfiniteQuery-D4-rTdBB.js +0 -1
- package/dist/client/assets/useQuery-Vrc6Li_H.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D3F1c8oY.js +0 -1
- package/dist/client/assets/workflow-CsBV4dNN.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as L,j as s,b_ as ke,c as _,t as Re,u as qe,a as Ue,b as We,m as Xe,b$ as He,c0 as Ke}from"./index-uOrjFt6t.js";import{c as Le}from"./binder--zY5y66H.js";import{u as xe}from"./useQuery-Vrc6Li_H.js";import{h as Ge}from"./use-connection-DqGqpr6W.js";import{a as Qe,u as Ze,j as Te}from"./constants-V7-3C38y.js";import{u as Ie,P as Je}from"./topbar-portal-CjBmYjs5.js";import{B as A,c as F}from"./button-D10odSSz.js";import{i as Z}from"./Loading01-D2eBBNoh.js";import{t as Ye}from"./Settings01-CF0yl6Tz.js";import{D as et,a as tt,b as st,c as nt,d as lt,e as it}from"./dialog-bLBl7se3.js";import{D as ot,a as rt,b as at,c as ct}from"./dropdown-menu-D6LMimH3.js";import{I as ue}from"./input-C8Cn3OQt.js";import{S as De}from"./switch-CkEMQ9Z5.js";import{i as dt}from"./DotsVertical-CdVqSSOc.js";import{s as mt}from"./Plus-CoFNXdPs.js";import{i as ut}from"./SearchMd-WqvhRztL.js";import{i as Se}from"./AlertCircle-Ci70K_EZ.js";import{i as we}from"./ArrowLeft-DOvB9XQA.js";import{s as xt}from"./Clock-CuTVdxgk.js";import{b as $e,c as z,a as ft,T as P,e as pt,d as gt}from"./table-D_a-Z4Fv.js";import{M as ht}from"./markdown-BD6zDSJc.js";import{n as jt}from"./ArrowDown-BB4lqZfQ.js";import{i as bt}from"./ArrowUp-ByjI1wop.js";import{i as Nt}from"./CheckVerified02-I-XS300S.js";import{i as ze}from"./File02-D0NaH0bX.js";import{s as yt}from"./Hash02-oBjA0qJC.js";import{s as Pe,i as vt}from"./Rows03-D7jJRDVm.js";import{u as Ct}from"./useMutation-BYvhr9Wj.js";import{i as wt}from"./CheckCircle-DNKireMY.js";import{i as kt}from"./InfoCircle-C7uLV_XX.js";import{i as It}from"./XCircle-aBox2-uz.js";import{t as St}from"./ChevronDown-DlCNAUXg.js";import"./X-DlPknjOM.js";import"./Check-Dnxirgog.js";import"./ChevronRight-BjXZnVl8.js";const Ae=({size:t=24,color:e="currentColor",...i})=>L.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},L.createElement("path",{d:"M21 10H3m13-8v4M8 2v4m2.5 8 1.5-1v5m-1.25 0h2.5M7.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 19.72 21 18.88 21 17.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 4 17.88 4 16.2 4H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 6.28 3 7.12 3 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 22 6.12 22 7.8 22Z"}));Ae.displayName="CalendarDate";const Oe=({size:t=24,color:e="currentColor",...i})=>L.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},L.createElement("path",{d:"m22 17-7.869-7.869c-.396-.396-.594-.594-.822-.668a1 1 0 0 0-.618 0c-.228.074-.426.272-.822.668L9.13 11.87c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668L2 7m20 10h-7m7 0v-7"}));Oe.displayName="TrendDown01";const Me=({size:t=24,color:e="currentColor",...i})=>L.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},L.createElement("path",{d:"m22 7-7.869 7.869c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668L9.13 12.13c-.396-.396-.594-.594-.822-.668a1 1 0 0 0-.618 0c-.228.074-.426.272-.822.668L2 17M22 7h-7m7 0v7"}));Me.displayName="TrendUp01";const M={collectionsList:t=>["collection-reorder-ranking","collections","list",t],reportsList:(t,e)=>["collection-reorder-ranking","reports","list",t,e],report:(t,e)=>["collection-reorder-ranking","reports","detail",t,e],pluginConfig:(t,e)=>["project-plugin-config",t,e]};function Tt({collections:t,onSelectCollection:e,onAddCollection:i,onDeleteCollection:o,onToggleCollection:l}){const[n,r]=L.useState(!1),[a,c]=L.useState(""),[d,g]=L.useState(""),[m,p]=L.useState(""),[h,j]=L.useState(!1),[I,y]=L.useState(null),[v,C]=L.useState(null),[N,k]=L.useState(""),S=t.filter(f=>!N.trim()||f.title.toLowerCase().includes(N.toLowerCase())||f.farmCollectionId.includes(N)),R=()=>{c(""),g(""),p("")},T=f=>{r(f),f||R()},x=async()=>{const f=a.trim(),b=d.trim();if(!(!f||!b)){j(!0);try{await i({title:f,farmCollectionId:b,decoCollectionId:m.trim()||void 0}),T(!1)}finally{j(!1)}}},D=async(f,b)=>{y(f.id);try{await l(f,b)}finally{y(null)}},E=async f=>{C(f.id);try{await o(f)}finally{C(null)}};return s.jsxs("div",{className:"flex flex-col h-full bg-background",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-5 border-b border-border",children:[s.jsx("h1",{className:"text-xl font-semibold text-foreground",children:"PLP Optimizations"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(ut,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(ue,{value:N,onChange:f=>k(f.target.value),placeholder:"Search for a PLP...",className:"pl-9 w-56 h-9 text-sm"})]}),s.jsxs(A,{size:"sm",className:"bg-black text-white hover:bg-black/80 font-medium border-none",onClick:()=>r(!0),children:[s.jsx(mt,{size:14,className:"mr-1"}),"New collection"]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:t.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[s.jsx(ke,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Nenhuma collection ainda"}),s.jsx("p",{className:"text-muted-foreground max-w-sm",children:"Adicione sua primeira collection para começar a visualizar os reports de ranking."})]}):s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left text-xs font-medium text-muted-foreground uppercase tracking-wide px-6 py-3 w-full",children:"Name"}),s.jsx("th",{className:"text-left text-xs font-medium text-muted-foreground uppercase tracking-wide px-4 py-3 whitespace-nowrap",children:"Farm ID"}),s.jsx("th",{className:"text-left text-xs font-medium text-muted-foreground uppercase tracking-wide px-4 py-3 whitespace-nowrap",children:"Deco ID"}),s.jsx("th",{className:"text-left text-xs font-medium text-muted-foreground uppercase tracking-wide px-4 py-3 whitespace-nowrap",children:"Status"}),s.jsx("th",{className:"px-4 py-3 w-10"})]})}),s.jsxs("tbody",{children:[S.map(f=>s.jsxs("tr",{className:"border-b border-border hover:bg-muted/40 transition-colors group",children:[s.jsx("td",{className:"px-6 py-4 cursor-pointer",onClick:()=>e(f),children:s.jsx("span",{className:"font-medium text-foreground hover:underline",children:f.title})}),s.jsx("td",{className:"px-4 py-4",children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded",children:f.farmCollectionId})}),s.jsx("td",{className:"px-4 py-4",children:f.decoCollectionId?s.jsx("span",{className:"font-mono text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded",children:f.decoCollectionId}):s.jsx("span",{className:"text-xs text-muted-foreground/50",children:"—"})}),s.jsx("td",{className:"px-4 py-4",children:s.jsx(De,{className:"cursor-pointer",checked:f.isEnabled,disabled:I===f.id,onCheckedChange:b=>{D(f,b)},onClick:b=>b.stopPropagation()})}),s.jsx("td",{className:"px-4 py-4",children:s.jsxs(ot,{children:[s.jsx(rt,{asChild:!0,children:s.jsx("button",{type:"button",className:"cursor-pointer opacity-0 group-hover:opacity-100 inline-flex items-center justify-center size-7 rounded hover:bg-muted transition-opacity",onClick:b=>b.stopPropagation(),children:s.jsx(dt,{size:16,className:"text-muted-foreground"})})}),s.jsx(at,{align:"end",children:s.jsx(ct,{className:"text-destructive focus:text-destructive",disabled:v===f.id,onSelect:()=>{E(f)},children:v===f.id?"Removendo...":"Remover collection"})})]})})]},f.id)),S.length===0&&s.jsx("tr",{children:s.jsxs("td",{colSpan:5,className:"px-6 py-12 text-center text-muted-foreground text-sm",children:["Nenhuma collection encontrada para “",N,"”"]})})]})]})}),s.jsx(et,{open:n,onOpenChange:T,children:s.jsxs(tt,{className:"sm:max-w-md",children:[s.jsxs(st,{children:[s.jsx(nt,{children:"New collection"}),s.jsx(lt,{children:"Configure o nome e os IDs da collection."})]}),s.jsxs("div",{className:"grid gap-3",children:[s.jsx(ue,{value:a,onChange:f=>c(f.target.value),placeholder:"Nome da collection (ex: Vestidos)"}),s.jsx(ue,{value:d,onChange:f=>g(f.target.value),placeholder:"Farm Collection ID (ex: 1031)"}),s.jsx(ue,{value:m,onChange:f=>p(f.target.value),placeholder:"Deco Collection ID (ex: 2247)"})]}),s.jsxs(it,{children:[s.jsx(A,{variant:"outline",onClick:()=>T(!1),disabled:h,children:"Cancelar"}),s.jsx(A,{onClick:()=>{x()},disabled:h||!a.trim()||!d.trim()||!m.trim(),children:h?"Salvando...":"Criar collection"})]})]})})]})}function Et(t){const e=_.c(10),{connectionId:i,toolCaller:o}=Ie();let l;e[0]!==t||e[1]!==i?(l=M.reportsList(i,t),e[0]=t,e[1]=i,e[2]=l):l=e[2];let n;e[3]!==t||e[4]!==o?(n=async()=>(await o("report_list",{collectionId:t,limit:200})).items??[],e[3]=t,e[4]=o,e[5]=n):n=e[5];const r=!!t;let a;return e[6]!==l||e[7]!==n||e[8]!==r?(a={queryKey:l,queryFn:n,enabled:r,staleTime:6e4},e[6]=l,e[7]=n,e[8]=r,e[9]=a):a=e[9],xe(a)}function _t(t){const e=_.c(10),{connectionId:i,toolCaller:o}=Ie();let l;e[0]!==i||e[1]!==t?(l=M.report(i,t),e[0]=i,e[1]=t,e[2]=l):l=e[2];let n;e[3]!==t||e[4]!==o?(n=async()=>{const c=await o("report_get",{id:t});if(!c.item)throw new Error("Report not found");return c.item},e[3]=t,e[4]=o,e[5]=n):n=e[5];const r=!!t;let a;return e[6]!==l||e[7]!==n||e[8]!==r?(a={queryKey:l,queryFn:n,enabled:r,staleTime:6e4},e[6]=l,e[7]=n,e[8]=r,e[9]=a):a=e[9],xe(a)}function Rt(t,e){if(t.length===0)return{ok:!1,error:"Nao ha itens na sugestao para aplicar."};const i=[...t].sort((l,n)=>l.position-n.position),o=[];for(const l of i){const n=l,r=n.productId??n.product_id??n.ProductId??n.id,a=r!=null?String(r):null;if(!a)return{ok:!1,error:`Product ID ausente no item #${l.position} (${l.label}).`};o.push(a)}return{ok:!0,collectionId:String(e),productIds:o,productCount:o.length}}const Fe=L.createContext(null);function Lt(t){const e=_.c(3),{value:i,children:o}=t;let l;return e[0]!==o||e[1]!==i?(l=s.jsx(Fe.Provider,{value:i,children:o}),e[0]=o,e[1]=i,e[2]=l):l=e[2],l}function Dt(){const t=L.useContext(Fe);if(!t)throw new Error("useVtexConnectionContext must be used within VtexConnectionProvider");return t}const $t={passing:"bg-emerald-500",warning:"bg-amber-500",failing:"bg-red-500",info:"bg-blue-500"},Ee=["#A595FF","#FFC116","#DE3A6E"];function fe(t){const e=_.c(7),{icon:i,title:o}=t;let l;e[0]!==i?(l=s.jsx(i,{size:16,className:"opacity-75 shrink-0 text-foreground"}),e[0]=i,e[1]=l):l=e[1];let n;e[2]!==o?(n=s.jsx("span",{className:"text-base text-foreground opacity-75",children:o}),e[2]=o,e[3]=n):n=e[3];let r;return e[4]!==l||e[5]!==n?(r=s.jsxs("div",{className:"flex gap-2 items-center",children:[l,n]}),e[4]=l,e[5]=n,e[6]=r):r=e[6],r}function zt(t){const e=_.c(15),{metric:i}=t;let o;e[0]!==i.unit?(o=i.unit&&s.jsx("span",{className:"text-base text-muted-foreground ml-1",children:i.unit}),e[0]=i.unit,e[1]=o):o=e[1];let l;e[2]!==i.value||e[3]!==o?(l=s.jsxs("div",{className:"text-2xl leading-8 text-foreground font-normal tabular-nums",children:[i.value,o]}),e[2]=i.value,e[3]=o,e[4]=l):l=e[4];let n;e[5]!==i.status?(n=i.status&&s.jsx("span",{className:F("inline-block size-2 rounded-full shrink-0",$t[i.status]??"bg-muted-foreground")}),e[5]=i.status,e[6]=n):n=e[6];let r;e[7]!==i.label?(r=s.jsx("span",{className:"text-sm text-foreground",children:i.label}),e[7]=i.label,e[8]=r):r=e[8];let a;e[9]!==n||e[10]!==r?(a=s.jsxs("div",{className:"flex gap-1.5 items-center",children:[n,r]}),e[9]=n,e[10]=r,e[11]=a):a=e[11];let c;return e[12]!==l||e[13]!==a?(c=s.jsxs("div",{className:"flex flex-col gap-3 items-start justify-end border border-border rounded-lg p-5 flex-1",children:[l,a]}),e[12]=l,e[13]=a,e[14]=c):c=e[14],c}function Pt(t){const e=_.c(9),{title:i,items:o}=t;let l;e[0]!==i?(l=i&&s.jsx(fe,{icon:Pe,title:i}),e[0]=i,e[1]=l):l=e[1];let n;e[2]!==o?(n=o.map(At),e[2]=o,e[3]=n):n=e[3];let r;e[4]!==n?(r=s.jsx("div",{className:"flex gap-4 items-stretch",children:n}),e[4]=n,e[5]=r):r=e[5];let a;return e[6]!==l||e[7]!==r?(a=s.jsxs("div",{className:"space-y-4",children:[l,r]}),e[6]=l,e[7]=r,e[8]=a):a=e[8],a}function At(t,e){return s.jsx(zt,{metric:t},`${t.label}-${e}`)}function Ot(t){const e=_.c(11),{title:i,items:o}=t;let l;e[0]!==i?(l=i&&s.jsx(fe,{icon:Nt,title:i}),e[0]=i,e[1]=l):l=e[1];let n;if(e[2]!==o){let c;e[4]!==o.length?(c=(d,g)=>s.jsxs("div",{className:"flex gap-4 items-stretch",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center w-4 shrink-0",children:[s.jsx("div",{className:"h-full w-px bg-border"}),s.jsx("div",{className:"w-2 h-4 rounded-full flex",style:{backgroundColor:Ee[g%Ee.length]}}),s.jsx("div",{className:F("h-full w-px bg-border",g===o.length-1&&"invisible")})]}),s.jsxs("div",{className:"flex flex-col gap-2 items-start py-3 pb-4 min-w-0",children:[s.jsx("span",{className:"text-sm font-medium text-foreground leading-none",children:d.label}),d.description&&s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:d.description})]})]},`${d.label}-${g}`),e[4]=o.length,e[5]=c):c=e[5],n=o.map(c),e[2]=o,e[3]=n}else n=e[3];let r;e[6]!==n?(r=s.jsx("div",{className:"flex flex-col",children:n}),e[6]=n,e[7]=r):r=e[7];let a;return e[8]!==l||e[9]!==r?(a=s.jsxs("div",{className:"space-y-4",children:[l,r]}),e[8]=l,e[9]=r,e[10]=a):a=e[10],a}function Mt(t){const e=_.c(3),{content:i}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(fe,{icon:ze,title:"Notas"}),e[0]=o):o=e[0];let l;return e[1]!==i?(l=s.jsxs("div",{className:"space-y-4",children:[o,s.jsx(ht,{children:i})]}),e[1]=i,e[2]=l):l=e[2],l}function Ft(t){const e=_.c(11),{delta:i}=t;if(i===0){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("span",{className:"inline-flex items-center justify-center",children:s.jsx(vt,{size:16,className:"text-muted-foreground"})}),e[0]=d):d=e[0],d}const o=i>0,l=o?"text-emerald-600":"text-destructive";let n;e[1]!==l?(n=F("inline-flex items-center gap-0.5 text-sm font-medium",l),e[1]=l,e[2]=n):n=e[2];let r;e[3]!==o?(r=o?s.jsx(bt,{size:16}):s.jsx(jt,{size:16}),e[3]=o,e[4]=r):r=e[4];let a;e[5]!==i?(a=Math.abs(i),e[5]=i,e[6]=a):a=e[6];let c;return e[7]!==n||e[8]!==r||e[9]!==a?(c=s.jsxs("span",{className:n,children:[r,a]}),e[7]=n,e[8]=r,e[9]=a,e[10]=c):c=e[10],c}function Vt(t){const e=_.c(5),{rows:i}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ft,{className:"sticky top-0 bg-background z-10",children:s.jsxs($e,{children:[s.jsx(P,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"#"}),s.jsx(P,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"DELTA"}),s.jsx(P,{className:"font-mono text-xs uppercase text-muted-foreground",children:"PRODUTO"}),s.jsx(P,{className:"font-mono text-xs uppercase text-muted-foreground",children:"SESSÕES"}),s.jsx(P,{className:"font-mono text-xs uppercase text-muted-foreground",children:"SELECT RATE"}),s.jsx(P,{className:"font-mono text-xs uppercase text-muted-foreground",children:"ADD TO CART"}),s.jsx(P,{className:"font-mono text-xs uppercase text-muted-foreground",children:"PURCHASE RATE"}),s.jsx(P,{className:"font-mono text-xs uppercase text-muted-foreground",children:"DISPONIB."})]})}),e[0]=o):o=e[0];let l;e[1]!==i?(l=i.map(Bt),e[1]=i,e[2]=l):l=e[2];let n;return e[3]!==l?(n=s.jsx("div",{className:"border border-border rounded-lg overflow-auto max-h-[820px]",children:s.jsxs(pt,{children:[o,s.jsx(gt,{children:l})]})}),e[3]=l,e[4]=n):n=e[4],n}function Bt(t,e){return s.jsxs($e,{children:[s.jsx(z,{children:s.jsxs("div",{className:"flex items-center gap-1 opacity-50",children:[s.jsx(yt,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground tabular-nums",children:t.position})]})}),s.jsx(z,{children:t.delta!==void 0?s.jsx(Ft,{delta:t.delta}):"—"}),s.jsx(z,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.image&&s.jsx("img",{src:t.image,alt:"",className:"h-12 w-8 object-cover rounded-sm shrink-0 bg-muted"}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate max-w-48",children:t.label})]})}),s.jsx(z,{className:"text-sm tabular-nums",children:t.sessions?.toLocaleString()??"—"}),s.jsx(z,{className:"text-sm tabular-nums",children:t.valueSelectRate??(t.selectRate!=null?`${(t.selectRate*100).toFixed(2)}%`:"—")}),s.jsx(z,{className:"text-sm tabular-nums",children:t.addToCartRate!=null?`${(t.addToCartRate*100).toFixed(2)}%`:"—"}),s.jsx(z,{className:"text-sm tabular-nums",children:t.purchaseRate!=null?`${(t.purchaseRate*100).toFixed(3)}%`:"—"}),s.jsx(z,{className:"text-sm tabular-nums",children:t.valueAvailability??"—"})]},e)}function qt(t){const e=_.c(40),{title:i,rows:o,decoCollectionId:l}=t,{connection:n}=Ie(),{connection:r,toolCaller:a}=Dt();let c;e[0]!==l||e[1]!==o?(c=l?Rt(o,l):{ok:!1,error:"decoCollectionId não disponível para esta collection."},e[0]=l,e[1]=o,e[2]=c):c=e[2];const d=c;let g;e[3]!==r?.tools?(g=r?.tools?.some(Wt)??!1,e[3]=r?.tools,e[4]=g):g=e[4];const m=g,p=!r||!a,h=p?"Configure uma conexão VTEX para aplicar a sugestão.":m?d.ok?null:d.error:"A conexão VTEX selecionada não possui a tool VTEX_REORDER_COLLECTION.";let j;e[5]!==d||e[6]!==m||e[7]!==p||e[8]!==o||e[9]!==a?(j=async()=>{if(console.log("[Farmrio Reorder] Ranked list recebido para apply:",o),p||!a)throw new Error("Configure uma conexão VTEX para aplicar a sugestão.");if(!m)throw new Error("A conexão VTEX selecionada não possui a tool VTEX_REORDER_COLLECTION.");if(!d.ok)throw new Error(d.error);return console.log("[Farmrio Reorder] Payload enviado para VTEX_REORDER_COLLECTION:",{collectionId:d.collectionId,productIds:d.productIds,productCount:d.productCount}),a("VTEX_REORDER_COLLECTION",{collectionId:d.collectionId,productIds:d.productIds})},e[5]=d,e[6]=m,e[7]=p,e[8]=o,e[9]=a,e[10]=j):j=e[10];let I;e[11]!==d||e[12]!==o?(I=()=>{const b=d.ok?d.productCount:o.length;Re.success(`Sugestão aplicada com sucesso (${b} produtos).`)},e[11]=d,e[12]=o,e[13]=I):I=e[13];let y;e[14]!==j||e[15]!==I?(y={mutationFn:j,onSuccess:I,onError:Ut},e[14]=j,e[15]=I,e[16]=y):y=e[16];const v=Ct(y);let C;e[17]!==i?(C=i&&s.jsx(fe,{icon:Pe,title:i}),e[17]=i,e[18]=C):C=e[18];let N;e[19]!==v?(N=()=>v.mutate(),e[19]=v,e[20]=N):N=e[20];const k=v.isPending||!!h,S=h??void 0;let R;e[21]!==v.isPending?(R=v.isPending?s.jsx(Z,{size:14,className:"animate-spin"}):null,e[21]=v.isPending,e[22]=R):R=e[22];let T;e[23]!==R||e[24]!==N||e[25]!==k||e[26]!==S?(T=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(A,{type:"button",size:"sm",onClick:N,disabled:k,title:S,children:[R,"Apply Suggestion"]})}),e[23]=R,e[24]=N,e[25]=k,e[26]=S,e[27]=T):T=e[27];let x;e[28]!==T||e[29]!==C?(x=s.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[C,T]}),e[28]=T,e[29]=C,e[30]=x):x=e[30];let D;e[31]!==h||e[32]!==n?(D=h?s.jsx("p",{className:"text-xs text-muted-foreground",children:h}):s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Report via: ",n.title]}),e[31]=h,e[32]=n,e[33]=D):D=e[33];let E;e[34]!==o?(E=s.jsx(Vt,{rows:o}),e[34]=o,e[35]=E):E=e[35];let f;return e[36]!==x||e[37]!==D||e[38]!==E?(f=s.jsxs("div",{className:"space-y-4",children:[x,D,E]}),e[36]=x,e[37]=D,e[38]=E,e[39]=f):f=e[39],f}function Ut(t){const e=t instanceof Error?t.message:"Falha ao aplicar sugestão.";Re.error(e)}function Wt(t){return t.name==="VTEX_REORDER_COLLECTION"}function Xt(t){const e=_.c(18),{section:i,decoCollectionId:o}=t;switch(i.type){case"metrics":{let l;e[0]!==i.metricItems?(l=i.metricItems??[],e[0]=i.metricItems,e[1]=l):l=e[1];let n;return e[2]!==i.title||e[3]!==l?(n=s.jsx(Pt,{title:i.title,items:l}),e[2]=i.title,e[3]=l,e[4]=n):n=e[4],n}case"criteria":{let l;e[5]!==i.criteriaItems?(l=i.criteriaItems??[],e[5]=i.criteriaItems,e[6]=l):l=e[6];let n;return e[7]!==i.title||e[8]!==l?(n=s.jsx(Ot,{title:i.title,items:l}),e[7]=i.title,e[8]=l,e[9]=n):n=e[9],n}case"note":{let l;return e[10]!==i.content?(l=i.content?s.jsx(Mt,{content:i.content}):null,e[10]=i.content,e[11]=l):l=e[11],l}case"ranked-list":{let l;e[12]!==i.rankedItems?(l=i.rankedItems??[],e[12]=i.rankedItems,e[13]=l):l=e[13];let n;return e[14]!==o||e[15]!==i.title||e[16]!==l?(n=s.jsx(qt,{title:i.title,rows:l,decoCollectionId:o}),e[14]=o,e[15]=i.title,e[16]=l,e[17]=n):n=e[17],n}default:return null}}const _e={passing:{label:"Passing",color:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-400 border-emerald-500/25",icon:wt},warning:{label:"Warning",color:"bg-amber-500/15 text-amber-700 dark:text-amber-400 border-amber-500/25",icon:Se},failing:{label:"Failing",color:"bg-red-500/15 text-red-700 dark:text-red-400 border-red-500/25",icon:It},info:{label:"Info",color:"bg-blue-500/15 text-blue-700 dark:text-blue-400 border-blue-500/25",icon:kt}};function Ht(t){const e=_.c(10),{status:i,size:o}=t,l=o===void 0?"default":o,n=_e[i]??_e.info,r=n.icon,a=l==="sm",c=a?"px-2 py-0.5":"px-2.5 py-1";let d;e[0]!==n.color||e[1]!==c?(d=F("inline-flex items-center gap-1 rounded-full border text-xs font-medium",c,n.color),e[0]=n.color,e[1]=c,e[2]=d):d=e[2];const g=a?12:14;let m;e[3]!==r||e[4]!==g?(m=s.jsx(r,{size:g}),e[3]=r,e[4]=g,e[5]=m):m=e[5];let p;return e[6]!==n.label||e[7]!==d||e[8]!==m?(p=s.jsxs("span",{className:d,children:[m,n.label]}),e[6]=n.label,e[7]=d,e[8]=m,e[9]=p):p=e[9],p}function Kt(t){return new Date(t).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function Gt(t){const e=_.c(68),{reportId:i,collection:o,onBack:l}=t,{data:n,isLoading:r,error:a}=_t(i);if(r){let j;return e[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Carregando report..."})]}),e[0]=j):j=e[0],j}if(a||!n){let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Se,{size:48,className:"text-destructive mb-4"}),e[1]=j):j=e[1];const I=a?"Erro ao carregar report":"Report não encontrado";let y;e[2]!==I?(y=s.jsx("h3",{className:"text-lg font-medium mb-2",children:I}),e[2]=I,e[3]=y):y=e[3];const v=a?.message??"O report solicitado não foi encontrado.";let C;e[4]!==v?(C=s.jsx("p",{className:"text-muted-foreground text-center mb-4",children:v}),e[4]=v,e[5]=C):C=e[5];let N;e[6]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(we,{size:14,className:"mr-1"}),e[6]=N):N=e[6];let k;e[7]!==l?(k=s.jsxs(A,{variant:"outline",onClick:l,children:[N,"Voltar aos reports"]}),e[7]=l,e[8]=k):k=e[8];let S;return e[9]!==y||e[10]!==C||e[11]!==k?(S=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[j,y,C,k]}),e[9]=y,e[10]=C,e[11]=k,e[12]=S):S=e[12],S}let c,d,g,m;if(e[13]!==o||e[14]!==l||e[15]!==n.category||e[16]!==n.sections||e[17]!==n.source||e[18]!==n.status||e[19]!==n.summary||e[20]!==n.title||e[21]!==n.updatedAt){const j=[...n.sections??[]].sort(Qt);g="flex flex-col h-full overflow-y-auto py-6 px-64";let I;e[26]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(we,{size:14,className:"mr-1"}),e[26]=I):I=e[26];let y;e[27]!==l?(y=s.jsxs(A,{variant:"ghost",size:"sm",onClick:l,className:"self-start -ml-2 mb-2 text-muted-foreground hover:text-foreground",children:[I,"Voltar"]}),e[27]=l,e[28]=y):y=e[28];let v;e[29]!==n.title?(v=s.jsx("h1",{className:"text-xl font-semibold leading-tight",children:n.title}),e[29]=n.title,e[30]=v):v=e[30];let C;e[31]!==n.summary?(C=s.jsx("p",{className:"text-sm text-muted-foreground",children:n.summary}),e[31]=n.summary,e[32]=C):C=e[32];let N;e[33]!==v||e[34]!==C?(N=s.jsxs("div",{className:"space-y-1 min-w-0",children:[v,C]}),e[33]=v,e[34]=C,e[35]=N):N=e[35];let k;e[36]!==n.status?(k=n.status&&s.jsx(Ht,{status:n.status}),e[36]=n.status,e[37]=k):k=e[37];let S;e[38]!==k||e[39]!==N?(S=s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[N,k]}),e[38]=k,e[39]=N,e[40]=S):S=e[40];let R;e[41]!==n.category?(R=n.category&&s.jsx("span",{className:"capitalize",children:n.category}),e[41]=n.category,e[42]=R):R=e[42];let T;e[43]!==n.source?(T=n.source&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-border",children:"|"}),s.jsx("span",{children:n.source})]}),e[43]=n.source,e[44]=T):T=e[44];let x;e[45]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("span",{className:"text-border",children:"|"}),e[45]=x):x=e[45];let D;e[46]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(xt,{size:12}),e[46]=D):D=e[46];let E;e[47]!==n.updatedAt?(E=Kt(n.updatedAt),e[47]=n.updatedAt,e[48]=E):E=e[48];let f;e[49]!==E?(f=s.jsxs("span",{className:"inline-flex items-center gap-1",children:[D,E]}),e[49]=E,e[50]=f):f=e[50];let b;e[51]!==R||e[52]!==T||e[53]!==f?(b=s.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[R,T,x,f]}),e[51]=R,e[52]=T,e[53]=f,e[54]=b):b=e[54],e[55]!==S||e[56]!==b||e[57]!==y?(m=s.jsxs("div",{className:"border-b border-border py-4 space-y-3",children:[y,S,b]}),e[55]=S,e[56]=b,e[57]=y,e[58]=m):m=e[58],c="flex-1 py-6 space-y-8";let w;e[59]!==o?(w=(V,B)=>s.jsx(Xt,{section:V,decoCollectionId:o.decoCollectionId},V.id??B),e[59]=o,e[60]=w):w=e[60],d=j.map(w),e[13]=o,e[14]=l,e[15]=n.category,e[16]=n.sections,e[17]=n.source,e[18]=n.status,e[19]=n.summary,e[20]=n.title,e[21]=n.updatedAt,e[22]=c,e[23]=d,e[24]=g,e[25]=m}else c=e[22],d=e[23],g=e[24],m=e[25];let p;e[61]!==c||e[62]!==d?(p=s.jsx("div",{className:c,children:d}),e[61]=c,e[62]=d,e[63]=p):p=e[63];let h;return e[64]!==g||e[65]!==m||e[66]!==p?(h=s.jsxs("div",{className:g,children:[m,p]}),e[64]=g,e[65]=m,e[66]=p,e[67]=h):h=e[67],h}function Qt(t,e){return(t.position??0)-(e.position??0)}function Zt(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(ke,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No report source connected"}),s.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an MCP server that provides reports to view collection reorder ranking insights."})]}),t[0]=e):e=t[0],e}function Jt(t){return new Date(t).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Ve(t,e){if(!t)return null;const i=t.find(l=>l.toLowerCase().startsWith(`${e}:`));if(!i)return null;const o=parseInt(i.split(":")[1]??"",10);return Number.isNaN(o)?null:o}function Be(t,e){const i=t.match(e);if(!i||!i[1])return null;const o=parseInt(i[1],10);return Number.isNaN(o)?null:o}function Yt(t){const e=Ve(t.tags,"products");if(e!==null)return String(e);const i=Be(t.summary,/(\d+)\s*products?/i);return i!==null?String(i):"-"}function es(t){const e=Ve(t.tags,"moves");if(e!==null)return String(e);const i=Be(t.summary,/(\d+)\s*moves?/i);return i!==null?String(i):"-"}function ts(t){return t&&t.toLowerCase().includes("week")?"Weekly":"Daily"}function ss(t){const e=_.c(8),{category:i}=t;let o;e[0]!==i?(o=ts(i),e[0]=i,e[1]=o):o=e[1];const l=o,r=l==="Weekly"?"bg-purple-50 text-purple-700 border-purple-200":"bg-sky-50 text-sky-700 border-sky-200";let a;e[2]!==r?(a=F("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border",r),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ae,{size:11}),e[4]=c):c=e[4];let d;return e[5]!==l||e[6]!==a?(d=s.jsxs("span",{className:a,children:[c,l]}),e[5]=l,e[6]=a,e[7]=d):d=e[7],d}function ns(t){const e=_.c(9),{status:i}=t;if(!i){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("span",{className:"text-muted-foreground",children:"-"}),e[0]=c):c=e[0],c}let o,l,n;if(e[1]!==i){const c={passing:"text-emerald-700",applied:"text-emerald-700",warning:"text-amber-700",failing:"text-red-600",info:"text-blue-600"};let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d={passing:"Applied",applied:"Applied",warning:"Warning",failing:"Failed",info:"Info"},e[5]=d):d=e[5],o=d,l=i.toLowerCase(),n=F("text-sm font-medium",c[l]??"text-foreground"),e[1]=i,e[2]=o,e[3]=l,e[4]=n}else o=e[2],l=e[3],n=e[4];const r=o[l]??i;let a;return e[6]!==n||e[7]!==r?(a=s.jsx("span",{className:n,children:r}),e[6]=n,e[7]=r,e[8]=a):a=e[8],a}function ls(t){const e=_.c(11),{variant:i}=t,o=i===void 0?"up":i;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={up:"M0,32 C10,28 20,24 30,20 S50,14 60,10 S80,6 90,4 S110,2 120,0",down:"M0,4 C10,8 20,12 30,16 S50,22 60,26 S80,30 90,32 S110,34 120,36",flat:"M0,20 C20,18 40,22 60,20 S80,18 100,20 S110,20 120,20"},e[0]=l):l=e[0];const n=l;let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={up:{stroke:"#6366f1",fill:"rgba(99,102,241,0.12)"},down:{stroke:"#f59e0b",fill:"rgba(245,158,11,0.12)"},flat:{stroke:"#94a3b8",fill:"rgba(148,163,184,0.08)"}},e[1]=r):r=e[1];const a=r,{stroke:c,fill:d}=a[o],g=n[o],m=`${g} L120,40 L0,40 Z`;let p;e[2]!==m||e[3]!==d?(p=s.jsx("path",{d:m,fill:d}),e[2]=m,e[3]=d,e[4]=p):p=e[4];let h;e[5]!==g||e[6]!==c?(h=s.jsx("path",{d:g,stroke:c,strokeWidth:"1.5",fill:"none"}),e[5]=g,e[6]=c,e[7]=h):h=e[7];let j;return e[8]!==p||e[9]!==h?(j=s.jsxs("svg",{width:120,height:40,viewBox:"0 0 120 40",className:"opacity-80",children:[p,h]}),e[8]=p,e[9]=h,e[10]=j):j=e[10],j}function is(t){const e=_.c(18),{label:i,value:o,delta:l,trending:n,sparkVariant:r}=t;let a;e[0]!==i?(a=s.jsx("div",{className:"flex items-center gap-1.5",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:i})}),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==o?(c=s.jsx("span",{className:"text-2xl font-semibold text-foreground leading-none",children:o}),e[2]=o,e[3]=c):c=e[3];let d;e[4]!==l||e[5]!==n?(d=l&&s.jsxs("div",{className:F("flex items-center gap-1 text-xs font-medium",n==="up"?"text-emerald-600":"text-amber-600"),children:[n==="up"?s.jsx(Me,{size:12}):s.jsx(Oe,{size:12}),l]}),e[4]=l,e[5]=n,e[6]=d):d=e[6];let g;e[7]!==c||e[8]!==d?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[c,d]}),e[7]=c,e[8]=d,e[9]=g):g=e[9];let m;e[10]!==r?(m=s.jsx(ls,{variant:r}),e[10]=r,e[11]=m):m=e[11];let p;e[12]!==g||e[13]!==m?(p=s.jsxs("div",{className:"flex items-end justify-between gap-2",children:[g,m]}),e[12]=g,e[13]=m,e[14]=p):p=e[14];let h;return e[15]!==a||e[16]!==p?(h=s.jsxs("div",{className:"p-5 flex flex-col gap-2 min-w-0",children:[a,p]}),e[15]=a,e[16]=p,e[17]=h):h=e[17],h}const os=[{label:"Sessions",value:"-",delta:null,trending:null,sparkVariant:"flat"},{label:"Engagement",value:"-",delta:null,trending:null,sparkVariant:"flat"},{label:"Add Cart",value:"-",delta:null,trending:null,sparkVariant:"flat"},{label:"Revenue",value:"-",delta:null,trending:null,sparkVariant:"flat"}];function rs({collection:t,onBack:e,onSelectReport:i,onToggleCollection:o}){const{data:l=[],isLoading:n,error:r}=Et(t.id),[a,c]=L.useState(!1),d=async m=>{if(o){c(!0);try{await o(t,m)}finally{c(!1)}}},g=[...l].sort((m,p)=>new Date(p.updatedAt).getTime()-new Date(m.updatedAt).getTime());return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border shrink-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:e,className:"inline-flex items-center justify-center size-7 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",children:s.jsx(we,{size:15})}),s.jsx("span",{className:"text-muted-foreground text-base select-none",children:"/"}),s.jsx("span",{className:"text-base font-semibold text-foreground",children:t.title}),s.jsx(De,{checked:t.isEnabled,disabled:a||!o,onCheckedChange:m=>{d(m)},className:"ml-1 cursor-pointer"})]}),s.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors rounded px-2 py-1 hover:bg-muted",children:[s.jsxs("span",{children:[new Date(Date.now()-744*60*60*1e3).toLocaleDateString("en-US",{day:"2-digit",month:"long",year:"numeric"})," ","-"," ",new Date().toLocaleDateString("en-US",{day:"2-digit",month:"long",year:"numeric"})]}),s.jsx(St,{size:14})]})]}),s.jsx("div",{className:"grid grid-cols-4 border-b border-border divide-x divide-border shrink-0",children:os.map(m=>s.jsx(is,{...m},m.label))}),s.jsxs("div",{className:"flex items-center gap-4 px-5 py-3 border-b border-border shrink-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"size-4 rounded border border-border flex items-center justify-center shrink-0",children:s.jsx("div",{className:"size-2 rounded-sm bg-foreground"})}),s.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:"A/B TEST"})]}),s.jsxs("div",{className:"flex-1 flex items-center gap-3",children:[s.jsx("span",{className:"text-xs font-medium text-foreground whitespace-nowrap",children:"AI 50%"}),s.jsxs("div",{className:"flex-1 h-3.5 flex rounded-full overflow-hidden",children:[s.jsx("div",{className:"flex-1 bg-indigo-500"}),s.jsx("div",{className:"flex-1 bg-amber-400"})]}),s.jsx("span",{className:"text-xs font-medium text-foreground whitespace-nowrap",children:"50% MANUAL"})]}),s.jsx(A,{size:"sm",variant:"outline",className:"shrink-0 h-8 text-xs",children:"Compare A/B"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:n?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(Z,{size:28,className:"animate-spin text-muted-foreground mb-3"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading runs..."})]}):r?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(Se,{size:40,className:"text-destructive mb-3"}),s.jsx("h3",{className:"text-base font-medium mb-1",children:"Error loading runs"}),s.jsx("p",{className:"text-muted-foreground text-center text-sm",children:r.message})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[s.jsx(ke,{size:40,className:"text-muted-foreground mb-3"}),s.jsx("h3",{className:"text-base font-medium mb-1",children:"No runs yet"}),s.jsx("p",{className:"text-muted-foreground max-w-sm text-sm",children:"Runs will appear here once the MCP generates rankings for this collection."})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-5 pt-5 pb-3",children:s.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Runs"})}),s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left text-xs font-medium text-muted-foreground uppercase tracking-wide px-5 py-2.5 w-14",children:"#"}),s.jsx("th",{className:"text-left text-xs font-medium text-muted-foreground uppercase tracking-wide px-4 py-2.5",children:"Run Date"}),s.jsx("th",{className:"text-left text-xs font-medium text-muted-foreground uppercase tracking-wide px-4 py-2.5",children:"Type"}),s.jsx("th",{className:"text-left text-xs font-medium text-muted-foreground uppercase tracking-wide px-4 py-2.5",children:"Products"}),s.jsx("th",{className:"text-left text-xs font-medium text-muted-foreground uppercase tracking-wide px-4 py-2.5",children:"Moves"}),s.jsx("th",{className:"text-left text-xs font-medium text-muted-foreground uppercase tracking-wide px-4 py-2.5",children:"Status"}),s.jsx("th",{className:"w-8"})]})}),s.jsx("tbody",{children:g.map(m=>{const p=Yt(m),h=es(m),j=!!m.summary;return s.jsxs("tr",{className:"border-b border-border hover:bg-muted/40 transition-colors cursor-pointer group",onClick:()=>i(m.id),children:[s.jsxs("td",{className:"px-5 py-4 text-sm text-muted-foreground font-mono",children:["#",m.id]}),s.jsx("td",{className:"px-4 py-4 text-sm text-foreground whitespace-nowrap",children:Jt(m.updatedAt)}),s.jsx("td",{className:"px-4 py-4",children:s.jsx(ss,{category:m.category})}),s.jsx("td",{className:"px-4 py-4 text-sm text-foreground tabular-nums",children:p}),s.jsx("td",{className:"px-4 py-4 text-sm text-foreground tabular-nums",children:h}),s.jsx("td",{className:"px-4 py-4",children:s.jsx(ns,{status:m.status})}),s.jsx("td",{className:"px-3 py-4",children:j&&s.jsx(ze,{size:14,className:"text-muted-foreground/50 opacity-0 group-hover:opacity-100 transition-opacity"})})]},m.id)})})]})]})})]})}function as(t){return t?t.filter(e=>Le(e,He)):[]}function Xs(){const t=_.c(100),{org:e,project:i}=qe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const l=Ue(o),n=We(),r=Xe(),a=Ge(),c=l.collectionId??null,d=l.reportId??null;let g;t[1]!==n?(g=u=>{n({search:u?{collectionId:u}:{},replace:!0})},t[1]=n,t[2]=g):g=t[2];const m=g;let p;t[3]!==c||t[4]!==n?(p=u=>{c&&n({search:u?{collectionId:c,reportId:String(u)}:{collectionId:c},replace:!0})},t[3]=c,t[4]=n,t[5]=p):p=t[5];const h=p;let j;t[6]!==e.id?(j={connectionId:Qe,orgId:e.id},t[6]=e.id,t[7]=j):j=t[7];const I=Ze(j);let y;t[8]!==i.id?(y=M.pluginConfig(i.id??"","collection-reorder-ranking"),t[8]=i.id,t[9]=y):y=t[9];let v;t[10]!==i.id||t[11]!==I?(v=async()=>{const u=await I.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:i.id,pluginId:"collection-reorder-ranking"}});return u.structuredContent??u},t[10]=i.id,t[11]=I,t[12]=v):v=t[12];const C=!!i.id;let N;t[13]!==y||t[14]!==v||t[15]!==C?(N={queryKey:y,queryFn:v,enabled:C},t[13]=y,t[14]=v,t[15]=C,t[16]=N):N=t[16];const{data:k,isLoading:S}=xe(N),R=as(a),T=k?.config?.connectionId,x=T?R.find(u=>u.id===T):null,D=k?.config?.settings&&typeof k.config.settings=="object"?k.config.settings:null,E=typeof D?.vtexConnectionId=="string"?D.vtexConnectionId:null;let f;t[17]!==a||t[18]!==E?(f=E?a?.find(u=>u.id===E&&Le(u,Ke))??null:null,t[17]=a,t[18]=E,t[19]=f):f=t[19];const b=f,w=Te({connectionId:x?.id,orgId:e.id}),V=b?.id;let B;t[20]!==e.id||t[21]!==V?(B={connectionId:V,orgId:e.id},t[20]=e.id,t[21]=V,t[22]=B):B=t[22];const J=Te(B),pe=M.collectionsList(x?.id??"");let q;t[23]!==w?(q=async()=>{const u=await w.callTool({name:"collection_list",arguments:{isEnabled:!0,limit:200}});return(u.structuredContent??u).items??[]},t[23]=w,t[24]=q):q=t[24];const ge=!!w&&!!x;let Y;t[25]!==pe||t[26]!==q||t[27]!==ge?(Y={queryKey:pe,queryFn:q,enabled:ge},t[25]=pe,t[26]=q,t[27]=ge,t[28]=Y):Y=t[28];const{data:he,isLoading:ee}=xe(Y);let te;t[29]!==he?(te=he??[],t[29]=he,t[30]=te):te=t[30];const U=te;let se;t[31]!==c||t[32]!==U?(se=c?U.find(u=>String(u.id)===c)??null:null,t[31]=c,t[32]=U,t[33]=se):se=t[33];const O=se;let ne;t[34]!==e.id||t[35]!==e.name||t[36]!==e.slug?(ne={id:e.id,slug:e.slug,name:e.name},t[34]=e.id,t[35]=e.name,t[36]=e.slug,t[37]=ne):ne=t[37];const je=ne;let le;t[38]!==w||t[39]!==x?.id||t[40]!==r?(le=async u=>{if(!w)throw new Error("MCP client not available");await w.callTool({name:"collection_create",arguments:{title:u.title,farmCollectionId:u.farmCollectionId,decoCollectionId:u.decoCollectionId}}),await r.invalidateQueries({queryKey:M.collectionsList(x?.id??"")})},t[38]=w,t[39]=x?.id,t[40]=r,t[41]=le):le=t[41];const be=le;let ie;t[42]!==c||t[43]!==w||t[44]!==x?.id||t[45]!==r||t[46]!==m?(ie=async u=>{if(c===String(u.id)&&m(null),!w)throw new Error("MCP client not available");await w.callTool({name:"collection_update",arguments:{id:u.id,farmCollectionId:u.farmCollectionId,isEnabled:!1}}),await r.invalidateQueries({queryKey:M.collectionsList(x?.id??"")})},t[42]=c,t[43]=w,t[44]=x?.id,t[45]=r,t[46]=m,t[47]=ie):ie=t[47];const Ne=ie;let oe;t[48]!==w||t[49]!==x?.id||t[50]!==r?(oe=async(u,$)=>{if(!w)throw new Error("MCP client not available");await w.callTool({name:"collection_update",arguments:{id:u.id,farmCollectionId:u.farmCollectionId,isEnabled:$}}),await r.invalidateQueries({queryKey:M.collectionsList(x?.id??"")})},t[48]=w,t[49]=x?.id,t[50]=r,t[51]=oe):oe=t[51];const re=oe;if(S){let u;return t[52]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),t[52]=u):u=t[52],u}if(R.length===0){let u;return t[53]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Zt,{}),t[53]=u):u=t[53],u}if(!x){let u;return t[54]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx(Ye,{size:48,className:"text-muted-foreground mb-2"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a Farmrio reorder connection to be configured. Go to project settings to select which integration to use."})]})}),t[54]=u):u=t[54],u}if(c&&!O&&!ee){let u;t[55]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Collection Not Found"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"The selected collection was not found."})]}),t[55]=u):u=t[55];let $;return t[56]!==m?($=s.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[u,s.jsx(A,{variant:"outline",onClick:()=>m(null),children:"Back to collections"})]}),t[56]=m,t[57]=$):$=t[57],$}let W;t[58]!==x.app_id||t[59]!==x.app_name||t[60]!==x.description||t[61]!==x.icon||t[62]!==x.id||t[63]!==x.metadata||t[64]!==x.title||t[65]!==x.tools?(W={id:x.id,title:x.title,icon:x.icon,description:x.description,app_name:x.app_name,app_id:x.app_id,tools:x.tools,metadata:x.metadata},t[58]=x.app_id,t[59]=x.app_name,t[60]=x.description,t[61]=x.icon,t[62]=x.id,t[63]=x.metadata,t[64]=x.title,t[65]=x.tools,t[66]=W):W=t[66];let ae;t[67]!==w?(ae=(u,$)=>w?w.callTool({name:u,arguments:$}).then(ds):Promise.reject(new Error("MCP client is not available")),t[67]=w,t[68]=ae):ae=t[68];const ye=ae;let ce;t[69]!==x.id||t[70]!==je||t[71]!==W||t[72]!==ye?(ce={connectionId:x.id,connection:W,toolCaller:ye,org:je,session:null},t[69]=x.id,t[70]=je,t[71]=W,t[72]=ye,t[73]=ce):ce=t[73];const ve=ce;let X;t[74]!==b?(X=b?{id:b.id,title:b.title,icon:b.icon,description:b.description,app_name:b.app_name,app_id:b.app_id,tools:b.tools,metadata:b.metadata}:null,t[74]=b,t[75]=X):X=t[75];let H;t[76]!==J?(H=J?(u,$)=>J.callTool({name:u,arguments:$}).then(cs):null,t[76]=J,t[77]=H):H=t[77];let de;t[78]!==X||t[79]!==H?(de={connection:X,toolCaller:H},t[78]=X,t[79]=H,t[80]=de):de=t[80];const Ce=de;let K;t[81]!==c||t[82]!==U||t[83]!==be||t[84]!==Ne||t[85]!==re||t[86]!==ee||t[87]!==d||t[88]!==O||t[89]!==m||t[90]!==h?(K=ee&&!c?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading collections..."})]}):c?d&&O?s.jsx(Gt,{reportId:Number(d),collection:O,onBack:()=>h(null)}):O?s.jsx(rs,{collection:O,onBack:()=>m(null),onSelectReport:u=>h(u),onToggleCollection:re}):null:s.jsx(Tt,{collections:U,onSelectCollection:u=>m(String(u.id)),onAddCollection:be,onDeleteCollection:Ne,onToggleCollection:re}),t[81]=c,t[82]=U,t[83]=be,t[84]=Ne,t[85]=re,t[86]=ee,t[87]=d,t[88]=O,t[89]=m,t[90]=h,t[91]=K):K=t[91];let G;t[92]!==K?(G=s.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:s.jsx("div",{className:"flex-1 overflow-hidden",children:K})}),t[92]=K,t[93]=G):G=t[93];let Q;t[94]!==G||t[95]!==Ce?(Q=s.jsx(Lt,{value:Ce,children:G}),t[94]=G,t[95]=Ce,t[96]=Q):Q=t[96];let me;return t[97]!==ve||t[98]!==Q?(me=s.jsx(Je,{value:ve,children:Q}),t[97]=ve,t[98]=Q,t[99]=me):me=t[99],me}function cs(t){return t.structuredContent??t}function ds(t){return t.structuredContent??t}export{Xs as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as Y,c as I,j as s,bX as oe,m as Re,bY as Fe,t as fe,u as Be,a as Ue,b as qe,bZ as Ge}from"./index-uOrjFt6t.js";import{c as Ve}from"./binder--zY5y66H.js";import{u as ye}from"./useQuery-Vrc6Li_H.js";import{h as He}from"./use-connection-DqGqpr6W.js";import{a as Ke,u as Qe,j as We}from"./constants-V7-3C38y.js";import{u as xe,P as Ye}from"./topbar-portal-CjBmYjs5.js";import{i as ce}from"./Loading01-D2eBBNoh.js";import{t as Ze}from"./Settings01-CF0yl6Tz.js";import{i as Je}from"./Check-Dnxirgog.js";import{t as Pe}from"./ChevronDown-DlCNAUXg.js";import{c as H,B as pe}from"./button-D10odSSz.js";import{i as Ne}from"./AlertCircle-Ci70K_EZ.js";import{i as _e}from"./ArrowLeft-DOvB9XQA.js";import{n as de}from"./CheckDone01-BQB-AnYZ.js";import{s as Ie}from"./Clock-CuTVdxgk.js";import{a as Xe}from"./Copy01--WUANgtG.js";import{n as Ee}from"./Inbox01-Bh1zeW2m.js";import{i as et}from"./CheckCircle-DNKireMY.js";import{i as tt}from"./InfoCircle-C7uLV_XX.js";import{i as st}from"./XCircle-aBox2-uz.js";import{u as Me}from"./useMutation-BYvhr9Wj.js";import{T as se,b as ne,c as le,a as ge,d as je,e as be}from"./table-D_a-Z4Fv.js";import{M as lt}from"./markdown-BD6zDSJc.js";import{n as nt}from"./ArrowDown-BB4lqZfQ.js";import{i as it}from"./ArrowUp-ByjI1wop.js";import{i as ot}from"./CheckVerified02-I-XS300S.js";import{i as Se}from"./ChevronRight-BjXZnVl8.js";import{i as rt}from"./File02-D0NaH0bX.js";import{s as at}from"./Hash02-oBjA0qJC.js";import{s as ve,i as ct}from"./Rows03-D7jJRDVm.js";import{B as dt}from"./badge-Dj7JdmaJ.js";import{b as mt,c as ut,d as ft,a as xt,C as pt}from"./card-9y5GtFsZ.js";import{c as $e,d as me,a as Ce,b as we,S as ke}from"./select-BZB4uvGm.js";import"./index-kTXXfvC-.js";const Ae=({size:t=24,color:e="currentColor",...l})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},Y.createElement("path",{d:"M12 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));Ae.displayName="Columns02";const re={reportsList:(t,e,l)=>["reports","list",t,{category:e,status:l}],report:(t,e)=>["reports","detail",t,e],pluginConfig:(t,e)=>["project-plugin-config",t,e]};function ht(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(oe,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No report source connected"}),s.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an MCP server that provides reports to view automated insights, performance audits, security scans, and more."})]}),t[0]=e):e=t[0],e}function gt(t){const e=I.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:a}=t,[i,r]=Y.useState(!1),o=Y.useRef(null);let d;if(e[0]!==l||e[1]!==n){let m;e[3]!==n?(m=S=>S.id===n,e[3]=n,e[4]=m):m=e[4],d=l.find(m),e[0]=l,e[1]=n,e[2]=d}else d=e[2];const c=d;let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=m=>{o.current?.contains(m.relatedTarget)||r(!1)},e[5]=u):u=e[5];const f=u;if(l.length===1){let m;e[6]!==c?(m=c?.icon?s.jsx("img",{src:c.icon,alt:"",className:"size-4 rounded"}):s.jsx(oe,{size:16}),e[6]=c,e[7]=m):m=e[7];const S=c?.title||"Reports";let _;e[8]!==S?(_=s.jsx("span",{children:S}),e[8]=S,e[9]=_):_=e[9];let $;return e[10]!==m||e[11]!==_?($=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[m,_]}),e[10]=m,e[11]=_,e[12]=$):$=e[12],$}let p;e[13]!==i?(p=()=>r(!i),e[13]=i,e[14]=p):p=e[14];let x;e[15]!==c?(x=c?.icon?s.jsx("img",{src:c.icon,alt:"",className:"size-4 rounded"}):s.jsx(oe,{size:16}),e[15]=c,e[16]=x):x=e[16];const h=c?.title||"Select source";let g;e[17]!==h?(g=s.jsx("span",{children:h}),e[17]=h,e[18]=g):g=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Pe,{size:14}),e[19]=b):b=e[19];let N;e[20]!==p||e[21]!==x||e[22]!==g?(N=s.jsxs("button",{type:"button",onClick:p,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[x,g,b]}),e[20]=p,e[21]=x,e[22]=g,e[23]=N):N=e[23];let y;e[24]!==l||e[25]!==i||e[26]!==a||e[27]!==n?(y=i&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(m=>s.jsxs("button",{type:"button",onClick:()=>{a(m.id),r(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[m.icon?s.jsx("img",{src:m.icon,alt:"",className:"size-4 rounded"}):s.jsx(oe,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:m.title}),m.id===n&&s.jsx(Je,{size:14,className:"text-primary"})]},m.id))}),e[24]=l,e[25]=i,e[26]=a,e[27]=n,e[28]=y):y=e[28];let v;return e[29]!==N||e[30]!==y?(v=s.jsxs("div",{className:"relative",ref:o,onBlur:f,children:[N,y]}),e[29]=N,e[30]=y,e[31]=v):v=e[31],v}function jt(t){const e=I.c(2);let l;return e[0]!==t?(l=s.jsx(gt,{...t}),e[0]=t,e[1]=l):l=e[1],l}const ue={passing:{label:"Passing",color:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-400 border-emerald-500/25",icon:et},warning:{label:"Warning",color:"bg-amber-500/15 text-amber-700 dark:text-amber-400 border-amber-500/25",icon:Ne},failing:{label:"Failing",color:"bg-red-500/15 text-red-700 dark:text-red-400 border-red-500/25",icon:st},info:{label:"Info",color:"bg-blue-500/15 text-blue-700 dark:text-blue-400 border-blue-500/25",icon:tt}};function De(t){const e=I.c(10),{status:l,size:n}=t,a=n===void 0?"default":n,i=ue[l]??ue.info,r=i.icon,o=a==="sm",d=o?"px-2 py-0.5":"px-2.5 py-1";let c;e[0]!==i.color||e[1]!==d?(c=H("inline-flex items-center gap-1 rounded-full border text-xs font-medium",d,i.color),e[0]=i.color,e[1]=d,e[2]=c):c=e[2];const u=o?12:14;let f;e[3]!==r||e[4]!==u?(f=s.jsx(r,{size:u}),e[3]=r,e[4]=u,e[5]=f):f=e[5];let p;return e[6]!==i.label||e[7]!==c||e[8]!==f?(p=s.jsxs("span",{className:c,children:[f,i.label]}),e[6]=i.label,e[7]=c,e[8]=f,e[9]=p):p=e[9],p}function ze(t){const e=I.c(11),{connectionId:l,toolCaller:n}=xe();let a;e[0]!==l||e[1]!==t?.category||e[2]!==t?.status?(a=re.reportsList(l,t?.category,t?.status),e[0]=l,e[1]=t?.category,e[2]=t?.status,e[3]=a):a=e[3];let i;e[4]!==t?.category||e[5]!==t?.status||e[6]!==n?(i=async()=>await n("REPORTS_LIST",{category:t?.category,status:t?.status}),e[4]=t?.category,e[5]=t?.status,e[6]=n,e[7]=i):i=e[7];let r;return e[8]!==a||e[9]!==i?(r={queryKey:a,queryFn:i,staleTime:6e4},e[8]=a,e[9]=i,e[10]=r):r=e[10],ye(r)}function bt(t){const e=I.c(10),{connectionId:l,toolCaller:n}=xe();let a;e[0]!==l||e[1]!==t?(a=re.report(l,t),e[0]=l,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==n?(i=async()=>await n("REPORTS_GET",{id:t}),e[3]=t,e[4]=n,e[5]=i):i=e[5];const r=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==r?(o={queryKey:a,queryFn:i,enabled:r,staleTime:6e4},e[6]=a,e[7]=i,e[8]=r,e[9]=o):o=e[9],ye(o)}const yt={passing:"bg-emerald-500",warning:"bg-amber-500",failing:"bg-red-500",info:"bg-blue-500"},Te=["#A595FF","#FFC116","#DE3A6E"];function ae(t){const e=I.c(7),{icon:l,title:n}=t;let a;e[0]!==l?(a=s.jsx(l,{size:16,className:"opacity-75 shrink-0 text-foreground"}),e[0]=l,e[1]=a):a=e[1];let i;e[2]!==n?(i=s.jsx("span",{className:"text-base text-foreground opacity-75",children:n}),e[2]=n,e[3]=i):i=e[3];let r;return e[4]!==a||e[5]!==i?(r=s.jsxs("div",{className:"flex gap-2 items-center",children:[a,i]}),e[4]=a,e[5]=i,e[6]=r):r=e[6],r}function Nt(t){const e=I.c(2),{content:l}=t;let n;return e[0]!==l?(n=s.jsx(lt,{children:l}),e[0]=l,e[1]=n):n=e[1],n}function vt(t){const e=I.c(15),{metric:l}=t;let n;e[0]!==l.unit?(n=l.unit&&s.jsx("span",{className:"text-base text-muted-foreground ml-1",children:l.unit}),e[0]=l.unit,e[1]=n):n=e[1];let a;e[2]!==l.value||e[3]!==n?(a=s.jsxs("div",{className:"text-2xl leading-8 text-foreground font-normal tabular-nums",children:[l.value,n]}),e[2]=l.value,e[3]=n,e[4]=a):a=e[4];let i;e[5]!==l.status?(i=l.status&&s.jsx("span",{className:H("inline-block size-2 rounded-full shrink-0",yt[l.status])}),e[5]=l.status,e[6]=i):i=e[6];let r;e[7]!==l.label?(r=s.jsx("span",{className:"text-sm text-foreground",children:l.label}),e[7]=l.label,e[8]=r):r=e[8];let o;e[9]!==i||e[10]!==r?(o=s.jsxs("div",{className:"flex gap-1.5 items-center",children:[i,r]}),e[9]=i,e[10]=r,e[11]=o):o=e[11];let d;return e[12]!==a||e[13]!==o?(d=s.jsxs("div",{className:"flex flex-col gap-3 items-start justify-end border border-border rounded-lg p-5 flex-1",children:[a,o]}),e[12]=a,e[13]=o,e[14]=d):d=e[14],d}function Le(t){const e=I.c(12),{title:l,items:n,stacked:a}=t,i=a===void 0?!1:a;let r;e[0]!==l?(r=l&&s.jsx(ae,{icon:ve,title:l}),e[0]=l,e[1]=r):r=e[1];const o=i?"flex-col items-stretch":"items-stretch";let d;e[2]!==o?(d=H("flex gap-4",o),e[2]=o,e[3]=d):d=e[3];let c;e[4]!==n?(c=n.map(_t),e[4]=n,e[5]=c):c=e[5];let u;e[6]!==d||e[7]!==c?(u=s.jsx("div",{className:d,children:c}),e[6]=d,e[7]=c,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==u?(f=s.jsxs("div",{className:"space-y-4",children:[r,u]}),e[9]=r,e[10]=u,e[11]=f):f=e[11],f}function _t(t,e){return s.jsx(vt,{metric:t},`${t.label}-${e}`)}function St(t){const e=I.c(16),{title:l,columns:n,rows:a}=t;let i;e[0]!==l?(i=l&&s.jsx(ae,{icon:ve,title:l}),e[0]=l,e[1]=i):i=e[1];let r;e[2]!==n?(r=n.map(wt),e[2]=n,e[3]=r):r=e[3];let o;e[4]!==r?(o=s.jsx(ge,{children:s.jsx(ne,{children:r})}),e[4]=r,e[5]=o):o=e[5];let d;e[6]!==a?(d=a.map($t),e[6]=a,e[7]=d):d=e[7];let c;e[8]!==d?(c=s.jsx(je,{children:d}),e[8]=d,e[9]=c):c=e[9];let u;e[10]!==o||e[11]!==c?(u=s.jsx("div",{className:"rounded-lg border overflow-hidden",children:s.jsxs(be,{children:[o,c]})}),e[10]=o,e[11]=c,e[12]=u):u=e[12];let f;return e[13]!==i||e[14]!==u?(f=s.jsxs("div",{className:"space-y-4",children:[i,u]}),e[13]=i,e[14]=u,e[15]=f):f=e[15],f}function $t(t,e){return s.jsx(ne,{children:t.map(Ct)},e)}function Ct(t,e){return s.jsx(le,{className:"text-sm",children:t??s.jsx("span",{className:"text-muted-foreground",children:"—"})},e)}function wt(t){return s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:t},t)}function Oe(t){const e=I.c(11),{title:l,items:n}=t;let a;e[0]!==l?(a=l&&s.jsx(ae,{icon:ot,title:l}),e[0]=l,e[1]=a):a=e[1];let i;if(e[2]!==n){let d;e[4]!==n.length?(d=(c,u)=>s.jsxs("div",{className:"flex gap-4 items-stretch",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center w-4 shrink-0",children:[s.jsx("div",{className:"h-full w-px bg-border"}),s.jsx("div",{className:"w-2 h-4 rounded-full flex",style:{backgroundColor:Te[u%Te.length]}}),s.jsx("div",{className:H("h-full w-px bg-border",u===n.length-1&&"invisible")})]}),s.jsxs("div",{className:"flex flex-col gap-2 items-start py-3 pb-4 min-w-0",children:[s.jsx("span",{className:"text-sm font-medium text-foreground leading-none",children:c.label}),c.description&&s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:c.description})]})]},`${c.label}-${u}`),e[4]=n.length,e[5]=d):d=e[5],i=n.map(d),e[2]=n,e[3]=i}else i=e[3];let r;e[6]!==i?(r=s.jsx("div",{className:"flex flex-col",children:i}),e[6]=i,e[7]=r):r=e[7];let o;return e[8]!==a||e[9]!==r?(o=s.jsxs("div",{className:"space-y-4",children:[a,r]}),e[8]=a,e[9]=r,e[10]=o):o=e[10],o}function kt(t){const e=I.c(3),{content:l}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ae,{icon:rt,title:"Notas"}),e[0]=n):n=e[0];let a;return e[1]!==l?(a=s.jsxs("div",{className:"space-y-4",children:[n,s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:l})]}),e[1]=l,e[2]=a):a=e[2],a}function zt(t){const e=I.c(11),{delta:l}=t;if(l===0){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("span",{className:"inline-flex items-center justify-center",children:s.jsx(ct,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0],c}const n=l>0,a=n?"text-emerald-600":"text-destructive";let i;e[1]!==a?(i=H("inline-flex items-center gap-0.5 text-sm font-medium",a),e[1]=a,e[2]=i):i=e[2];let r;e[3]!==n?(r=n?s.jsx(it,{size:16}):s.jsx(nt,{size:16}),e[3]=n,e[4]=r):r=e[4];let o;e[5]!==l?(o=Math.abs(l),e[5]=l,e[6]=o):o=e[6];let d;return e[7]!==i||e[8]!==r||e[9]!==o?(d=s.jsxs("span",{className:i,children:[r,o]}),e[7]=i,e[8]=r,e[9]=o,e[10]=d):d=e[10],d}function Tt(t){if(t.length===0)return[];const e=[...t];for(let l=e.length-1;l>0;l--){const n=Math.max(0,Math.min(e.length-1,l+(l%3===0?-2:l%2===0?1:-1)));[e[l],e[n]]=[e[n],e[l]]}return e.map((l,n)=>({...l,position:n+1,delta:0,reference_position:void 0}))}function he(t){const e=I.c(14),{rows:l,label:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];const[i,r]=Y.useState(a);let o;e[1]!==n?(o=n&&s.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground opacity-60 tracking-wide px-1",children:n}),e[1]=n,e[2]=o):o=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ge,{className:"sticky top-0 bg-background z-10",children:s.jsxs(ne,{children:[s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"#"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"DELTA"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:"PRODUTO"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:"SCORE"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:"GRADE"}),s.jsx(se,{className:"w-10"})]})}),e[3]=d):d=e[3];let c;if(e[4]!==i||e[5]!==l){let p;e[7]!==i?(p=(x,h)=>{const g=i[h]??!1,b=x.note&&typeof x.note=="object"?x.note:null,N=typeof x.note=="string"?!!x.note:b!==null&&Object.keys(b).length>0,y=x.reference_position!==void 0?x.reference_position-x.position:x.delta??0;return s.jsxs(Y.Fragment,{children:[s.jsxs(ne,{children:[s.jsx(le,{children:s.jsxs("div",{className:"flex items-center gap-1 opacity-50",children:[s.jsx(at,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground tabular-nums",children:x.position})]})}),s.jsx(le,{children:s.jsx(zt,{delta:y})}),s.jsx(le,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[x.image&&s.jsx("img",{src:x.image,alt:"",className:"h-12 w-8 object-cover rounded-sm shrink-0 bg-muted"}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:x.label})]})}),x.values.map(It),s.jsx(le,{children:N?s.jsx("button",{type:"button",onClick:()=>r(v=>({...v,[h]:!v[h]})),className:"flex items-center justify-center size-6 text-muted-foreground hover:text-foreground transition-colors",children:g?s.jsx(Pe,{size:16}):s.jsx(Se,{size:16})}):s.jsx(Se,{size:16,className:"text-muted-foreground opacity-30"})})]}),N&&g&&s.jsx(ne,{className:"bg-muted/25",children:s.jsx(le,{colSpan:6,children:typeof x.note=="string"?s.jsxs("div",{className:"pl-8 pb-2 flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase opacity-50 tracking-wide",children:"MUDANÇA"}),s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:x.note})]}):s.jsx("div",{className:"py-2 px-4",children:s.jsxs(be,{children:[s.jsx(ge,{children:s.jsx(ne,{children:Object.keys(b??{}).map(Pt)})}),s.jsx(je,{children:s.jsx(ne,{children:Object.values(b??{}).map(Rt)})})]})})})},`note-${h}`)]},h)},e[7]=i,e[8]=p):p=e[8],c=l.map(p),e[4]=i,e[5]=l,e[6]=c}else c=e[6];let u;e[9]!==c?(u=s.jsx("div",{className:"border border-border rounded-lg overflow-auto max-h-[520px]",children:s.jsxs(be,{children:[d,s.jsx(je,{children:c})]})}),e[9]=c,e[10]=u):u=e[10];let f;return e[11]!==o||e[12]!==u?(f=s.jsxs("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[o,u]}),e[11]=o,e[12]=u,e[13]=f):f=e[13],f}function Rt(t,e){return s.jsx(le,{className:"text-sm tabular-nums",children:t??"—"},e)}function Pt(t){return s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:t},t)}function It(t,e){const n=e===1&&typeof t=="string"&&t.endsWith("%")?`${parseFloat(t)-10}%`:t;return s.jsx(le,{className:"text-sm tabular-nums",children:n},e)}function Et(t){const e=I.c(20),{title:l,rows:n}=t,[a,i]=Y.useState(!1);let r;e[0]!==n?(r=Tt(n),e[0]=n,e[1]=r):r=e[1];const o=r;let d;e[2]!==l?(d=l&&s.jsx(ae,{icon:ve,title:l}),e[2]=l,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=()=>i(Mt),e[4]=c):c=e[4];const u=a?"bg-primary text-primary-foreground border-primary":"bg-transparent text-muted-foreground border-border hover:text-foreground hover:border-foreground/30";let f;e[5]!==u?(f=H("inline-flex items-center gap-1.5 text-xs font-medium px-2.5 py-1.5 rounded-md border transition-colors",u),e[5]=u,e[6]=f):f=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ae,{size:14}),e[7]=p):p=e[7];let x;e[8]!==f?(x=s.jsxs("button",{type:"button",onClick:c,className:f,children:[p,"Comparar ordenação anterior"]}),e[8]=f,e[9]=x):x=e[9];let h;e[10]!==d||e[11]!==x?(h=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d,x]}),e[10]=d,e[11]=x,e[12]=h):h=e[12];let g;e[13]!==o||e[14]!==n||e[15]!==a?(g=a?s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx(he,{rows:n,label:"Ordenação Proposta"}),s.jsx(he,{rows:o,label:"Ordenação Atual"})]}):s.jsx(he,{rows:n}),e[13]=o,e[14]=n,e[15]=a,e[16]=g):g=e[16];let b;return e[17]!==h||e[18]!==g?(b=s.jsxs("div",{className:"space-y-4",children:[h,g]}),e[17]=h,e[18]=g,e[19]=b):b=e[19],b}function Mt(t){return!t}function At(t){const e=I.c(17),{section:l}=t;switch(l.type){case"markdown":{let n;return e[0]!==l.content?(n=s.jsx(Nt,{content:l.content}),e[0]=l.content,e[1]=n):n=e[1],n}case"metrics":{let n;return e[2]!==l.items||e[3]!==l.title?(n=s.jsx(Le,{title:l.title,items:l.items}),e[2]=l.items,e[3]=l.title,e[4]=n):n=e[4],n}case"table":{let n;return e[5]!==l.columns||e[6]!==l.rows||e[7]!==l.title?(n=s.jsx(St,{title:l.title,columns:l.columns,rows:l.rows}),e[5]=l.columns,e[6]=l.rows,e[7]=l.title,e[8]=n):n=e[8],n}case"criteria":{let n;return e[9]!==l.items||e[10]!==l.title?(n=s.jsx(Oe,{title:l.title,items:l.items}),e[9]=l.items,e[10]=l.title,e[11]=n):n=e[11],n}case"note":{let n;return e[12]!==l.content?(n=s.jsx(kt,{content:l.content}),e[12]=l.content,e[13]=n):n=e[13],n}case"ranked-list":{let n;return e[14]!==l.rows||e[15]!==l.title?(n=s.jsx(Et,{title:l.title,rows:l.rows}),e[14]=l.rows,e[15]=l.title,e[16]=n):n=e[16],n}default:return null}}function Dt(t){return new Date(t).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function Lt(t){const e=[];e.push(`# ${t.title}`),e.push(""),e.push(`> ${t.summary}`),e.push("");const l=[`**Status:** ${t.status}`,`**Category:** ${t.category}`];t.source&&l.push(`**Source:** ${t.source}`),l.push(`**Updated:** ${t.updatedAt}`),t.tags?.length&&l.push(`**Tags:** ${t.tags.join(", ")}`),e.push(l.join(`
|
|
2
|
-
`)),e.push("");for(const n of t.sections)switch(n.type){case"markdown":e.push(n.content),e.push("");break;case"metrics":{n.title&&(e.push(`## ${n.title}`),e.push(""));const a=["Metric","Value","Previous","Status"],i=n.items.some(r=>r.unit);e.push(`| ${a.join(" | ")} |`),e.push(`| ${a.map(()=>"---").join(" | ")} |`);for(const r of n.items){const o=r.unit==="%"&&typeof r.value=="number"?r.value-10:r.value,d=r.unit==="%"&&typeof r.previousValue=="number"?r.previousValue-10:r.previousValue,c=i&&r.unit?`${o} ${r.unit}`:`${o}`,u=d!=null?i&&r.unit?`${d} ${r.unit}`:`${d}`:"—",f=r.status??"—";e.push(`| ${r.label} | ${c} | ${u} | ${f} |`)}e.push("");break}case"table":{n.title&&(e.push(`## ${n.title}`),e.push("")),e.push(`| ${n.columns.join(" | ")} |`),e.push(`| ${n.columns.map(()=>"---").join(" | ")} |`);for(const a of n.rows)e.push(`| ${a.map(i=>i==null?"—":`${i}`).join(" | ")} |`);e.push("");break}case"criteria":{n.title&&(e.push(`## ${n.title}`),e.push(""));for(const a of n.items){const i=a.description?`: ${a.description}`:"";e.push(`- **${a.label}**${i}`)}e.push("");break}case"note":{e.push(`> ${n.content}`),e.push("");break}case"ranked-list":{n.title&&(e.push(`## ${n.title}`),e.push(""));const a=["#","Item"];e.push(`| ${a.join(" | ")} |`),e.push(`| ${a.map(()=>"---").join(" | ")} |`);for(const i of n.rows){const r=i.reference_position!==void 0?i.reference_position-i.position:i.delta??0,o=r!==0?` (${r>0?"+":""}${r})`:"",d=`${i.position}${o}`,c=i.values.map(u=>`${u}`).join(" | ");e.push(`| ${d} | ${i.label} | ${c} |`)}e.push("");break}}return e.join(`
|
|
3
|
-
`).trim()}function Ot(t){const e=I.c(86),{reportId:l,onBack:n}=t,{connectionId:a,toolCaller:i}=xe(),r=Re(),{data:o,isLoading:d,error:c}=bt(l),u=o?.lifecycleStatus==="dismissed";let f;e[0]!==u||e[1]!==l||e[2]!==i?(f=async()=>i("REPORTS_UPDATE_STATUS",{reportId:l,lifecycleStatus:u?"read":"dismissed"}),e[0]=u,e[1]=l,e[2]=i,e[3]=f):f=e[3];let p;e[4]!==a||e[5]!==u||e[6]!==n||e[7]!==r?(p=()=>{fe.success(u?"Report restored to inbox":"Report marked as done"),r.invalidateQueries({queryKey:re.reportsList(a)}),n()},e[4]=a,e[5]=u,e[6]=n,e[7]=r,e[8]=p):p=e[8];let x;e[9]!==f||e[10]!==p?(x={mutationFn:f,onSuccess:p,onError:Ut},e[9]=f,e[10]=p,e[11]=x):x=e[11];const h=Me(x);if(d){let L;return e[12]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(ce,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading report..."})]}),e[12]=L):L=e[12],L}if(c||!o){let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Ne,{size:48,className:"text-destructive mb-4"}),e[13]=L):L=e[13];const Q=c?"Error loading report":"Report not found";let U;e[14]!==Q?(U=s.jsx("h3",{className:"text-lg font-medium mb-2",children:Q}),e[14]=Q,e[15]=U):U=e[15];const W=c?.message??"The requested report could not be found.";let X;e[16]!==W?(X=s.jsx("p",{className:"text-muted-foreground text-center mb-4",children:W}),e[16]=W,e[17]=X):X=e[17];let ee;e[18]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(_e,{size:14,className:"mr-1"}),e[18]=ee):ee=e[18];let q;e[19]!==n?(q=s.jsxs(pe,{variant:"outline",onClick:n,children:[ee,"Back to reports"]}),e[19]=n,e[20]=q):q=e[20];let Z;return e[21]!==q||e[22]!==U||e[23]!==X?(Z=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[L,U,X,q]}),e[21]=q,e[22]=U,e[23]=X,e[24]=Z):Z=e[24],Z}let g;e[25]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(_e,{size:14}),e[25]=g):g=e[25];let b;e[26]!==n?(b=s.jsxs("button",{type:"button",onClick:n,className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[g,"Reports"]}),e[26]=n,e[27]=b):b=e[27];let N;e[28]!==o?(N=()=>{const L=Lt(o);navigator.clipboard.writeText(L).then(Bt)},e[28]=o,e[29]=N):N=e[29];let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Xe,{size:14}),e[30]=y):y=e[30];let v;e[31]!==N?(v=s.jsxs(pe,{variant:"outline",size:"sm",className:"gap-1.5",onClick:N,children:[y,"Copy as Markdown"]}),e[31]=N,e[32]=v):v=e[32];let m;e[33]!==h?(m=()=>h.mutate(),e[33]=h,e[34]=m):m=e[34];let S;e[35]!==u||e[36]!==h.isPending?(S=h.isPending?s.jsx(ce,{size:14,className:"animate-spin"}):u?s.jsx(Ee,{size:14}):s.jsx(de,{size:14}),e[35]=u,e[36]=h.isPending,e[37]=S):S=e[37];const _=u?"Move to inbox":"Mark as done";let $;e[38]!==h.isPending||e[39]!==S||e[40]!==_||e[41]!==m?($=s.jsxs(pe,{variant:"outline",size:"sm",className:"gap-1.5",onClick:m,disabled:h.isPending,children:[S,_]}),e[38]=h.isPending,e[39]=S,e[40]=_,e[41]=m,e[42]=$):$=e[42];let C;e[43]!==$||e[44]!==v?(C=s.jsxs("div",{className:"flex items-center gap-2",children:[v,$]}),e[43]=$,e[44]=v,e[45]=C):C=e[45];let z;e[46]!==C||e[47]!==b?(z=s.jsxs("div",{className:"flex items-center justify-between",children:[b,C]}),e[46]=C,e[47]=b,e[48]=z):z=e[48];let w;e[49]!==o.title?(w=s.jsx("h1",{className:"text-xl font-semibold leading-tight",children:o.title}),e[49]=o.title,e[50]=w):w=e[50];let T;e[51]!==o.summary?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:o.summary}),e[51]=o.summary,e[52]=T):T=e[52];let E;e[53]!==w||e[54]!==T?(E=s.jsxs("div",{className:"space-y-1 min-w-0",children:[w,T]}),e[53]=w,e[54]=T,e[55]=E):E=e[55];let M;e[56]!==o.status?(M=s.jsx(De,{status:o.status}),e[56]=o.status,e[57]=M):M=e[57];let R;e[58]!==E||e[59]!==M?(R=s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[E,M]}),e[58]=E,e[59]=M,e[60]=R):R=e[60];let k;e[61]!==o.category?(k=s.jsx("span",{className:"capitalize",children:o.category}),e[61]=o.category,e[62]=k):k=e[62];let P;e[63]!==o.source?(P=o.source&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-border",children:"|"}),s.jsx("span",{children:o.source})]}),e[63]=o.source,e[64]=P):P=e[64];let A;e[65]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("span",{className:"text-border",children:"|"}),e[65]=A):A=e[65];let O;e[66]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ie,{size:12}),e[66]=O):O=e[66];let D;e[67]!==o.updatedAt?(D=Dt(o.updatedAt),e[67]=o.updatedAt,e[68]=D):D=e[68];let j;e[69]!==D?(j=s.jsxs("span",{className:"inline-flex items-center gap-1",children:[O,D]}),e[69]=D,e[70]=j):j=e[70];let F;e[71]!==k||e[72]!==P||e[73]!==j?(F=s.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[k,P,A,j]}),e[71]=k,e[72]=P,e[73]=j,e[74]=F):F=e[74];let K;e[75]!==z||e[76]!==R||e[77]!==F?(K=s.jsxs("div",{className:"border-b border-border px-6 py-4 space-y-3",children:[z,R,F]}),e[75]=z,e[76]=R,e[77]=F,e[78]=K):K=e[78];let B;e[79]!==o.sections?(B=Fe(o.sections??[]).map(Ft),e[79]=o.sections,e[80]=B):B=e[80];let G;e[81]!==B?(G=s.jsx("div",{className:"flex-1 px-6 py-6 space-y-8",children:B}),e[81]=B,e[82]=G):G=e[82];let J;return e[83]!==K||e[84]!==G?(J=s.jsxs("div",{className:"flex flex-col h-full overflow-y-auto pb-6",children:[K,G]}),e[83]=K,e[84]=G,e[85]=J):J=e[85],J}function Ft(t){return t.type==="side-by-side"?s.jsxs("div",{className:"flex gap-6 items-start w-full",children:[s.jsx("div",{className:"w-full",children:s.jsx(Oe,{title:t.left.title,items:t.left.items})}),s.jsx("div",{className:"w-full",children:s.jsx(Le,{title:t.right.title,items:t.right.items,stacked:!0})})]},`${t.leftIdx}-${t.rightIdx}`):s.jsx(At,{section:t.section},t.idx)}function Bt(){fe.success("Copied report as Markdown")}function Ut(t){fe.error(`Failed to update report: ${t.message}`)}function qt(t){const e=Date.now()-new Date(t).getTime(),l=Math.floor(e/6e4);if(l<1)return"just now";if(l<60)return`${l}m ago`;const n=Math.floor(l/60);if(n<24)return`${n}h ago`;const a=Math.floor(n/24);return a<30?`${a}d ago`:new Date(t).toLocaleDateString()}function Gt(t){const e=I.c(57),{report:l,isDoneTab:n,onSelect:a,onDismiss:i}=t,r=!l.lifecycleStatus||l.lifecycleStatus==="unread",o=n?"opacity-60":"hover:shadow-md";let d;e[0]!==o?(d=H("group relative cursor-pointer transition-shadow",o),e[0]=o,e[1]=d):d=e[1];let c;e[2]!==a||e[3]!==l.id?(c=()=>a(l.id),e[2]=a,e[3]=l.id,e[4]=c):c=e[4];let u;e[5]!==r?(u=r&&s.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 rounded-l-xl bg-primary"}),e[5]=r,e[6]=u):u=e[6];const f=r&&"font-bold";let p;e[7]!==f?(p=H("text-sm leading-snug line-clamp-2",f),e[7]=f,e[8]=p):p=e[8];let x;e[9]!==l.title||e[10]!==p?(x=s.jsx(mt,{className:p,children:l.title}),e[9]=l.title,e[10]=p,e[11]=x):x=e[11];let h;e[12]!==l.status?(h=s.jsx(De,{status:l.status,size:"sm"}),e[12]=l.status,e[13]=h):h=e[13];const g=n?"Restore to inbox":"Mark as done",b=n?"text-muted-foreground hover:text-foreground hover:bg-accent":"text-muted-foreground/0 group-hover:text-muted-foreground hover:!text-emerald-600 hover:bg-emerald-500/10";let N;e[14]!==b?(N=H("rounded-md p-1 transition-colors",b),e[14]=b,e[15]=N):N=e[15];let y;e[16]!==n||e[17]!==i||e[18]!==l.id?(y=A=>{A.stopPropagation(),i(l.id,!n)},e[16]=n,e[17]=i,e[18]=l.id,e[19]=y):y=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(de,{size:14}),e[20]=v):v=e[20];let m;e[21]!==N||e[22]!==y||e[23]!==g?(m=s.jsx("button",{type:"button",title:g,className:N,onClick:y,children:v}),e[21]=N,e[22]=y,e[23]=g,e[24]=m):m=e[24];let S;e[25]!==m||e[26]!==h?(S=s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[h,m]}),e[25]=m,e[26]=h,e[27]=S):S=e[27];let _;e[28]!==S||e[29]!==x?(_=s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[x,S]}),e[28]=S,e[29]=x,e[30]=_):_=e[30];let $;e[31]!==l.summary?($=s.jsx(ut,{className:"mt-1 line-clamp-2 text-xs",children:l.summary}),e[31]=l.summary,e[32]=$):$=e[32];let C;e[33]!==_||e[34]!==$?(C=s.jsxs(ft,{className:"pb-2 pt-5 px-5",children:[_,$]}),e[33]=_,e[34]=$,e[35]=C):C=e[35];let z;e[36]!==l.category?(z=s.jsx("span",{className:"inline-flex items-center gap-1 capitalize",children:l.category}),e[36]=l.category,e[37]=z):z=e[37];let w;e[38]!==l.source?(w=l.source&&s.jsx("span",{className:"inline-flex items-center gap-1 text-muted-foreground/70",children:l.source}),e[38]=l.source,e[39]=w):w=e[39];let T;e[40]!==z||e[41]!==w?(T=s.jsxs("div",{className:"flex items-center gap-3",children:[z,w]}),e[40]=z,e[41]=w,e[42]=T):T=e[42];let E;e[43]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(Ie,{size:12}),e[43]=E):E=e[43];let M;e[44]!==l.updatedAt?(M=qt(l.updatedAt),e[44]=l.updatedAt,e[45]=M):M=e[45];let R;e[46]!==M?(R=s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs("span",{className:"inline-flex items-center gap-1",children:[E,M]})}),e[46]=M,e[47]=R):R=e[47];let k;e[48]!==T||e[49]!==R?(k=s.jsx(xt,{className:"px-5 pb-5",children:s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[T,R]})}),e[48]=T,e[49]=R,e[50]=k):k=e[50];let P;return e[51]!==C||e[52]!==d||e[53]!==k||e[54]!==c||e[55]!==u?(P=s.jsxs(pt,{className:d,onClick:c,children:[u,C,k]}),e[51]=C,e[52]=d,e[53]=k,e[54]=c,e[55]=u,e[56]=P):P=e[56],P}function Vt(t){const e=I.c(24),{category:l,status:n,categories:a,onCategoryChange:i,onStatusChange:r}=t,o=l??"__all__";let d;e[0]!==i?(d=_=>i(_==="__all__"?void 0:_),e[0]=i,e[1]=d):d=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ce,{size:"sm",children:s.jsx(we,{placeholder:"All categories"})}),e[2]=c):c=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(me,{value:"__all__",children:"All categories"}),e[3]=u):u=e[3];let f;e[4]!==a?(f=a.map(Kt),e[4]=a,e[5]=f):f=e[5];let p;e[6]!==f?(p=s.jsxs($e,{children:[u,f]}),e[6]=f,e[7]=p):p=e[7];let x;e[8]!==o||e[9]!==d||e[10]!==p?(x=s.jsxs(ke,{value:o,onValueChange:d,children:[c,p]}),e[8]=o,e[9]=d,e[10]=p,e[11]=x):x=e[11];const h=n??"__all__";let g;e[12]!==r?(g=_=>r(_==="__all__"?void 0:_),e[12]=r,e[13]=g):g=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ce,{size:"sm",children:s.jsx(we,{placeholder:"All statuses"})}),e[14]=b):b=e[14];let N,y;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(me,{value:"__all__",children:"All statuses"}),y=Object.keys(ue),e[15]=N,e[16]=y):(N=e[15],y=e[16]);let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs($e,{children:[N,y.map(Ht)]}),e[17]=v):v=e[17];let m;e[18]!==h||e[19]!==g?(m=s.jsxs(ke,{value:h,onValueChange:g,children:[b,v]}),e[18]=h,e[19]=g,e[20]=m):m=e[20];let S;return e[21]!==m||e[22]!==x?(S=s.jsxs("div",{className:"flex items-center gap-2",children:[x,m]}),e[21]=m,e[22]=x,e[23]=S):S=e[23],S}function Ht(t){return s.jsx(me,{value:t,children:ue[t].label},t)}function Kt(t){return s.jsx(me,{value:t,children:s.jsx("span",{className:"capitalize",children:t})},t)}function Qt(t){const e=I.c(51),{onSelectReport:l}=t,[n,a]=Y.useState("inbox"),[i,r]=Y.useState(),[o,d]=Y.useState(),{connectionId:c,toolCaller:u}=xe(),f=Re();let p;e[0]!==i||e[1]!==o?(p={category:i,status:o},e[0]=i,e[1]=o,e[2]=p):p=e[2];const{data:x,isLoading:h,error:g}=ze(p),b=x?.reports??[],N=b.filter(Xt),y=b.filter(Jt),v=n==="inbox"?N:y,m=N.filter(Zt).length,{data:S}=ze();let _;e[3]!==S?.reports?(_=[...new Set((S?.reports??[]).map(Yt))].sort(),e[3]=S?.reports,e[4]=_):_=e[4];const $=_;let C;e[5]!==u?(C=async V=>{const{reportId:te,lifecycleStatus:ie}=V;return u("REPORTS_UPDATE_STATUS",{reportId:te,lifecycleStatus:ie})},e[5]=u,e[6]=C):C=e[6];let z;e[7]!==c||e[8]!==f?(z=()=>{f.invalidateQueries({queryKey:re.reportsList(c)})},e[7]=c,e[8]=f,e[9]=z):z=e[9];let w;e[10]!==C||e[11]!==z?(w={mutationFn:C,onSuccess:z,onError:Wt},e[10]=C,e[11]=z,e[12]=w):w=e[12];const T=Me(w);let E;e[13]!==T?(E=(V,te)=>{T.mutate({reportId:V,lifecycleStatus:te?"dismissed":"read"})},e[13]=T,e[14]=E):E=e[14];const M=E;if(g){let V,te;e[15]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Ne,{size:48,className:"text-destructive mb-4"}),te=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading reports"}),e[15]=V,e[16]=te):(V=e[15],te=e[16]);let ie;return e[17]!==g.message?(ie=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[V,te,s.jsx("p",{className:"text-muted-foreground text-center",children:g.message})]}),e[17]=g.message,e[18]=ie):ie=e[18],ie}const R="flex flex-col h-full";let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=()=>a("inbox"),e[19]=k):k=e[19];const P=n==="inbox"?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent/50";let A;e[20]!==P?(A=H("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",P),e[20]=P,e[21]=A):A=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ee,{size:14}),e[22]=O):O=e[22];let D;e[23]!==h||e[24]!==m?(D=!h&&m>0&&s.jsx(dt,{variant:"default",className:"text-[10px] px-1.5 py-0 h-4",children:m}),e[23]=h,e[24]=m,e[25]=D):D=e[25];let j;e[26]!==A||e[27]!==D?(j=s.jsxs("button",{type:"button",onClick:k,className:A,children:[O,"Inbox",D]}),e[26]=A,e[27]=D,e[28]=j):j=e[28];let F;e[29]===Symbol.for("react.memo_cache_sentinel")?(F=()=>a("done"),e[29]=F):F=e[29];const K=n==="done"?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent/50";let B;e[30]!==K?(B=H("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",K),e[30]=K,e[31]=B):B=e[31];let G;e[32]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(de,{size:14}),e[32]=G):G=e[32];const J=!h&&y.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:y.length});let L;e[33]!==B||e[34]!==J?(L=s.jsxs("button",{type:"button",onClick:F,className:B,children:[G,"Done",J]}),e[33]=B,e[34]=J,e[35]=L):L=e[35];let Q;e[36]!==j||e[37]!==L?(Q=s.jsxs("div",{className:"flex items-center gap-1",children:[j,L]}),e[36]=j,e[37]=L,e[38]=Q):Q=e[38];let U;e[39]!==$||e[40]!==i||e[41]!==o?(U=s.jsx(Vt,{category:i,status:o,categories:$,onCategoryChange:r,onStatusChange:d}),e[39]=$,e[40]=i,e[41]=o,e[42]=U):U=e[42];let W;e[43]!==Q||e[44]!==U?(W=s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border",children:[Q,U]}),e[43]=Q,e[44]=U,e[45]=W):W=e[45];const X="flex-1 overflow-y-auto p-6",ee=h?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(ce,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading reports..."})]}):v.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center h-full text-center",children:n==="done"?s.jsxs(s.Fragment,{children:[s.jsx(de,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No dismissed reports"}),s.jsx("p",{className:"text-muted-foreground max-w-sm",children:"Reports you mark as done will appear here."})]}):s.jsxs(s.Fragment,{children:[s.jsx(oe,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:i||o?"No reports match filters":"Inbox is empty"}),s.jsx("p",{className:"text-muted-foreground max-w-sm",children:i||o?"Try adjusting your filters.":"Reports will appear here once the connected MCP server provides them."})]})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:v.map(V=>s.jsx(Gt,{report:V,isDoneTab:n==="done",onSelect:l,onDismiss:M},V.id))});let q;e[46]!==ee?(q=s.jsx("div",{className:X,children:ee}),e[46]=ee,e[47]=q):q=e[47];let Z;return e[48]!==W||e[49]!==q?(Z=s.jsxs("div",{className:R,children:[W,q]}),e[48]=W,e[49]=q,e[50]=Z):Z=e[50],Z}function Wt(t){fe.error(`Failed to update report: ${t.message}`)}function Yt(t){return t.category}function Zt(t){return!t.lifecycleStatus||t.lifecycleStatus==="unread"}function Jt(t){return t.lifecycleStatus==="dismissed"}function Xt(t){return t.lifecycleStatus!=="dismissed"}function es(t){return t?t.filter(e=>Ve(e,Ge)):[]}function Ds(){const t=I.c(58),{org:e,project:l}=Be();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const a=Ue(n),i=qe(),r=He(),o=a.reportId??null;let d;t[1]!==i?(d=j=>{i({search:j?{reportId:j}:{},replace:!0})},t[1]=i,t[2]=d):d=t[2];const c=d;let u;t[3]!==e.id?(u={connectionId:Ke,orgId:e.id},t[3]=e.id,t[4]=u):u=t[4];const f=Qe(u);let p;t[5]!==l.id?(p=re.pluginConfig(l.id??"","reports"),t[5]=l.id,t[6]=p):p=t[6];let x;t[7]!==l.id||t[8]!==f?(x=async()=>{const j=await f.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:"reports"}});return j.structuredContent??j},t[7]=l.id,t[8]=f,t[9]=x):x=t[9];const h=!!l.id;let g;t[10]!==p||t[11]!==x||t[12]!==h?(g={queryKey:p,queryFn:x,enabled:h},t[10]=p,t[11]=x,t[12]=h,t[13]=g):g=t[13];const{data:b,isLoading:N}=ye(g);let y,v;if(t[14]!==r||t[15]!==b?.config?.connectionId){v=es(r);const j=b?.config?.connectionId;y=j?v.find(F=>F.id===j):null,t[14]=r,t[15]=b?.config?.connectionId,t[16]=y,t[17]=v}else y=t[16],v=t[17];const m=y,S=m?.id;let _;t[18]!==e.id||t[19]!==S?(_={connectionId:S,orgId:e.id},t[18]=e.id,t[19]=S,t[20]=_):_=t[20];const $=We(_);let C;t[21]!==e.id||t[22]!==e.name||t[23]!==e.slug?(C={id:e.id,slug:e.slug,name:e.name},t[21]=e.id,t[22]=e.name,t[23]=e.slug,t[24]=C):C=t[24];const z=C;if(N){let j;return t[25]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(ce,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),t[25]=j):j=t[25],j}if(v.length===0){let j;return t[26]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(ht,{}),t[26]=j):j=t[26],j}if(!m){let j;return t[27]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx(Ze,{size:48,className:"text-muted-foreground mb-2"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]})}),t[27]=j):j=t[27],j}let w;t[28]!==m.app_id||t[29]!==m.app_name||t[30]!==m.description||t[31]!==m.icon||t[32]!==m.id||t[33]!==m.metadata||t[34]!==m.title||t[35]!==m.tools?(w={id:m.id,title:m.title,icon:m.icon,description:m.description,app_name:m.app_name,app_id:m.app_id,tools:m.tools,metadata:m.metadata},t[28]=m.app_id,t[29]=m.app_name,t[30]=m.description,t[31]=m.icon,t[32]=m.id,t[33]=m.metadata,t[34]=m.title,t[35]=m.tools,t[36]=w):w=t[36];let T;t[37]!==$?(T=(j,F)=>$?$.callTool({name:j,arguments:F}).then(ss):Promise.reject(new Error("MCP client is not available")),t[37]=$,t[38]=T):T=t[38];const E=T;let M;t[39]!==m.id||t[40]!==z||t[41]!==w||t[42]!==E?(M={connectionId:m.id,connection:w,toolCaller:E,org:z,session:null},t[39]=m.id,t[40]=z,t[41]=w,t[42]=E,t[43]=M):M=t[43];const R=M;let k;t[44]!==R.connection?(k=[R.connection],t[44]=R.connection,t[45]=k):k=t[45];let P;t[46]!==m.id||t[47]!==k?(P=s.jsx("div",{className:"flex items-center px-6 py-3 border-b border-border",children:s.jsx(jt,{connections:k,selectedConnectionId:m.id,onConnectionChange:ts})}),t[46]=m.id,t[47]=k,t[48]=P):P=t[48];let A;t[49]!==o||t[50]!==c?(A=s.jsx("div",{className:"flex-1 overflow-hidden",children:o?s.jsx(Ot,{reportId:o,onBack:()=>c(null)}):s.jsx(Qt,{onSelectReport:c})}),t[49]=o,t[50]=c,t[51]=A):A=t[51];let O;t[52]!==P||t[53]!==A?(O=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[P,A]}),t[52]=P,t[53]=A,t[54]=O):O=t[54];let D;return t[55]!==R||t[56]!==O?(D=s.jsx(Ye,{value:R,children:O}),t[55]=R,t[56]=O,t[57]=D):D=t[57],D}function ts(){}function ss(t){return t.structuredContent??t}export{Ds as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as q,a as Y,b as A,r as B,j as s,d as G}from"./index-uOrjFt6t.js";import{u as K}from"./useMutation-BYvhr9Wj.js";import{B as z}from"./button-D10odSSz.js";import{I as L}from"./input-C8Cn3OQt.js";function Q(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=K(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let f;e[22]!==a||e[23]!==t?(f=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=f):f=e[24];let p;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(p=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=p):p=e[34];let g;e[35]!==a||e[36]!==t?(g=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=g):g=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==f||e[42]!==p||e[43]!==g?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,f,p,g]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=f,e[42]=p,e[43]=g,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await G.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{Q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as f,b4 as Pn,c as He,j as he}from"./index-uOrjFt6t.js";import{c as Je}from"./button-D10odSSz.js";const Ye=({size:n=24,color:e="currentColor",...t})=>f.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},f.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));Ye.displayName="DotsGrid";const Ee=f.createContext(null);Ee.displayName="PanelGroupContext";const A={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},_e=10,ne=f.useLayoutEffect,Fe=Pn.useId,wn=typeof Fe=="function"?Fe:()=>null;let En=0;function Ge(n=null){const e=wn(),t=f.useRef(n||e||null);return t.current===null&&(t.current=""+En++),n??t.current}function Qe({children:n,className:e="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:a,minSize:s,onCollapse:h,onExpand:w,onResize:p,order:u,style:v,tagName:z="div",...C}){const E=f.useContext(Ee);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:S,expandPanel:L,getPanelSize:N,getPanelStyle:D,groupId:V,isPanelCollapsed:R,reevaluatePanelConstraints:P,registerPanel:F,resizePanel:q,unregisterPanel:W}=E,G=Ge(l),M=f.useRef({callbacks:{onCollapse:h,onExpand:w,onResize:p},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:a,minSize:s},id:G,idIsFromProps:l!==void 0,order:u});f.useRef({didLogMissingDefaultSizeWarning:!1}),ne(()=>{const{callbacks:_,constraints:H}=M.current,B={...H};M.current.id=G,M.current.idIsFromProps=l!==void 0,M.current.order=u,_.onCollapse=h,_.onExpand=w,_.onResize=p,H.collapsedSize=t,H.collapsible=r,H.defaultSize=i,H.maxSize=a,H.minSize=s,(B.collapsedSize!==H.collapsedSize||B.collapsible!==H.collapsible||B.maxSize!==H.maxSize||B.minSize!==H.minSize)&&P(M.current,B)}),ne(()=>{const _=M.current;return F(_),()=>{W(_)}},[u,G,F,W]),f.useImperativeHandle(o,()=>({collapse:()=>{S(M.current)},expand:_=>{L(M.current,_)},getId(){return G},getSize(){return N(M.current)},isCollapsed(){return R(M.current)},isExpanded(){return!R(M.current)},resize:_=>{q(M.current,_)}}),[S,L,N,R,G,q]);const Y=D(M.current,i);return f.createElement(z,{...C,children:n,className:e,id:G,style:{...Y,...v},[A.groupId]:V,[A.panel]:"",[A.panelCollapsible]:r||void 0,[A.panelId]:G,[A.panelSize]:parseFloat(""+Y.flexGrow).toFixed(1)})}const en=f.forwardRef((n,e)=>f.createElement(Qe,{...n,forwardedRef:e}));Qe.displayName="Panel";en.displayName="forwardRef(Panel)";let De=null,Se=-1,J=null;function Cn(n,e){if(e){const t=(e&ln)!==0,r=(e&an)!==0,i=(e&sn)!==0,o=(e&un)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function In(){J!==null&&(document.head.removeChild(J),De=null,J=null,Se=-1)}function ke(n,e){var t,r;const i=Cn(n,e);if(De!==i){if(De=i,J===null&&(J=document.createElement("style"),document.head.appendChild(J)),Se>=0){var o;(o=J.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=J.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function nn(n){return n.type==="keydown"}function tn(n){return n.type.startsWith("pointer")}function rn(n){return n.type.startsWith("mouse")}function Ce(n){if(tn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(rn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Rn(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ln(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function kn(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:Ve(n),b:Ve(e)};let r;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),r=n;x(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ue(Ke(t.a)),b:Ue(Ke(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let a=o.length;for(;a--;){const s=o[a];if(s===l.a)return 1;if(s===l.b)return-1}}return Math.sign(i.a-i.b)}const An=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Mn(n){var e;const t=getComputedStyle((e=on(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Nn(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Mn(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||An.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ke(n){let e=n.length;for(;e--;){const t=n[e];if(x(t,"Missing node"),Nn(t))return t}return null}function Ue(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Ve(n){const e=[];for(;n;)e.push(n),n=on(n);return e}function on(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const ln=1,an=2,sn=4,un=8,$n=Rn()==="coarse";let U=[],ae=!1,ee=new Map,Ie=new Map;const ze=new Set;function Dn(n,e,t,r,i){var o;const{ownerDocument:l}=e,a={direction:t,element:e,hitAreaMargins:r,setResizeHandlerState:i},s=(o=ee.get(l))!==null&&o!==void 0?o:0;return ee.set(l,s+1),ze.add(a),Pe(),function(){var w;Ie.delete(n),ze.delete(a);const p=(w=ee.get(l))!==null&&w!==void 0?w:1;if(ee.set(l,p-1),Pe(),p===1&&ee.delete(l),U.includes(a)){const u=U.indexOf(a);u>=0&&U.splice(u,1),Te(),i("up",!0,null)}}}function Hn(n){const{target:e}=n,{x:t,y:r}=Ce(n);ae=!0,Be({target:e,x:t,y:r}),Pe(),U.length>0&&(we("down",n),n.preventDefault(),cn(e)||n.stopImmediatePropagation())}function Ae(n){const{x:e,y:t}=Ce(n);if(ae&&n.buttons===0&&(ae=!1,we("up",n)),!ae){const{target:r}=n;Be({target:r,x:e,y:t})}we("move",n),Te(),U.length>0&&n.preventDefault()}function Me(n){const{target:e}=n,{x:t,y:r}=Ce(n);Ie.clear(),ae=!1,U.length>0&&(n.preventDefault(),cn(e)||n.stopImmediatePropagation()),we("up",n),Be({target:e,x:t,y:r}),Te(),Pe()}function cn(n){let e=n;for(;e;){if(e.hasAttribute(A.resizeHandle))return!0;e=e.parentElement}return!1}function Be({target:n,x:e,y:t}){U.splice(0);let r=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(r=n),ze.forEach(i=>{const{element:o,hitAreaMargins:l}=i,a=o.getBoundingClientRect(),{bottom:s,left:h,right:w,top:p}=a,u=$n?l.coarse:l.fine;if(e>=h-u&&e<=w+u&&t>=p-u&&t<=s+u){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&kn(r,o)>0){let z=r,C=!1;for(;z&&!z.contains(o);){if(Ln(z.getBoundingClientRect(),a)){C=!0;break}z=z.parentElement}if(C)return}U.push(i)}})}function Ne(n,e){Ie.set(n,e)}function Te(){let n=!1,e=!1;U.forEach(r=>{const{direction:i}=r;i==="horizontal"?n=!0:e=!0});let t=0;Ie.forEach(r=>{t|=r}),n&&e?ke("intersection",t):n?ke("horizontal",t):e?ke("vertical",t):In()}let $e=new AbortController;function Pe(){$e.abort(),$e=new AbortController;const n={capture:!0,signal:$e.signal};ze.size&&(ae?(U.length>0&&ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("contextmenu",Me,n),r.addEventListener("pointerleave",Ae,n),r.addEventListener("pointermove",Ae,n))}),window.addEventListener("pointerup",Me,n),window.addEventListener("pointercancel",Me,n)):ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("pointerdown",Hn,n),r.addEventListener("pointermove",Ae,n))}))}function we(n,e){ze.forEach(t=>{const{setResizeHandlerState:r}=t,i=U.includes(t);r(n,i,e)})}function _n(){const[n,e]=f.useState(0);return f.useCallback(()=>e(t=>t+1),[])}function x(n,e){if(!n)throw console.error(e),Error(e)}function te(n,e,t=_e){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function X(n,e,t=_e){return te(n,e,t)===0}function j(n,e,t){return te(n,e,t)===0}function Gn(n,e,t){if(n.length!==e.length)return!1;for(let r=0;r<n.length;r++){const i=n[r],o=e[r];if(!j(i,o,t))return!1}return!0}function le({panelConstraints:n,panelIndex:e,size:t}){const r=n[e];x(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:a=0}=r;if(te(t,a)<0)if(o){const s=(i+a)/2;te(t,s)<0?t=i:t=a}else t=a;return t=Math.min(l,t),t=parseFloat(t.toFixed(_e)),t}function ge({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(j(n,0))return e;const l=[...e],[a,s]=r;x(a!=null,"Invalid first pivot index"),x(s!=null,"Invalid second pivot index");let h=0;if(o==="keyboard"){{const p=n<0?s:a,u=t[p];x(u,`Panel constraints not found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,v)){const S=C-E;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}{const p=n<0?a:s,u=t[p];x(u,`No panel constraints found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,C)){const S=E-v;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}}{const p=n<0?1:-1;let u=n<0?s:a,v=0;for(;;){const C=e[u];x(C!=null,`Previous layout not found for panel index ${u}`);const S=le({panelConstraints:t,panelIndex:u,size:100})-C;if(v+=S,u+=p,u<0||u>=t.length)break}const z=Math.min(Math.abs(n),Math.abs(v));n=n<0?0-z:z}{let u=n<0?a:s;for(;u>=0&&u<t.length;){const v=Math.abs(n)-Math.abs(h),z=e[u];x(z!=null,`Previous layout not found for panel index ${u}`);const C=z-v,E=le({panelConstraints:t,panelIndex:u,size:C});if(!j(z,E)&&(h+=z-E,l[u]=E,h.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?u--:u++}}if(Gn(i,l))return i;{const p=n<0?s:a,u=e[p];x(u!=null,`Previous layout not found for panel index ${p}`);const v=u+h,z=le({panelConstraints:t,panelIndex:p,size:v});if(l[p]=z,!j(z,v)){let C=v-z,S=n<0?s:a;for(;S>=0&&S<t.length;){const L=l[S];x(L!=null,`Previous layout not found for panel index ${S}`);const N=L+C,D=le({panelConstraints:t,panelIndex:S,size:N});if(j(L,D)||(C-=D-L,l[S]=D),j(C,0))break;n>0?S--:S++}}}const w=l.reduce((p,u)=>u+p,0);return j(w,100)?l:i}function Bn({layout:n,panelsArray:e,pivotIndices:t}){let r=0,i=100,o=0,l=0;const a=t[0];x(a!=null,"No pivot index found"),e.forEach((p,u)=>{const{constraints:v}=p,{maxSize:z=100,minSize:C=0}=v;u===a?(r=C,i=z):(o+=C,l+=z)});const s=Math.min(i,100-o),h=Math.max(r,100-l),w=n[a];return{valueMax:s,valueMin:h,valueNow:w}}function ye(n,e=document){return Array.from(e.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${n}"]`))}function fn(n,e,t=document){const i=ye(n,t).findIndex(o=>o.getAttribute(A.resizeHandleId)===e);return i??null}function dn(n,e,t){const r=fn(n,e,t);return r!=null?[r,r+1]:[-1,-1]}function pn(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return r||null}function Re(n,e=document){const t=e.querySelector(`[${A.resizeHandleId}="${n}"]`);return t||null}function Tn(n,e,t,r=document){var i,o,l,a;const s=Re(e,r),h=ye(n,r),w=s?h.indexOf(s):-1,p=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,u=(l=(a=t[w+1])===null||a===void 0?void 0:a.id)!==null&&l!==void 0?l:null;return[p,u]}function Wn({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){f.useRef({didWarnAboutMissingResizeHandle:!1}),ne(()=>{if(!o)return;const a=ye(t,o);for(let s=0;s<i.length-1;s++){const{valueMax:h,valueMin:w,valueNow:p}=Bn({layout:r,panelsArray:i,pivotIndices:[s,s+1]}),u=a[s];if(u!=null){const v=i[s];x(v,`No panel data found for index "${s}"`),u.setAttribute("aria-controls",v.id),u.setAttribute("aria-valuemax",""+Math.round(h)),u.setAttribute("aria-valuemin",""+Math.round(w)),u.setAttribute("aria-valuenow",p!=null?""+Math.round(p):"")}}return()=>{a.forEach((s,h)=>{s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")})}},[t,r,i,o]),f.useEffect(()=>{if(!o)return;const a=e.current;x(a,"Eager values not found");const{panelDataArray:s}=a,h=pn(t,o);x(h!=null,`No group found for id "${t}"`);const w=ye(t,o);x(w,`No resize handles found for group id "${t}"`);const p=w.map(u=>{const v=u.getAttribute(A.resizeHandleId);x(v,"Resize handle element has no handle id attribute");const[z,C]=Tn(t,v,s,o);if(z==null||C==null)return()=>{};const E=S=>{if(!S.defaultPrevented)switch(S.key){case"Enter":{S.preventDefault();const L=s.findIndex(N=>N.id===z);if(L>=0){const N=s[L];x(N,`No panel data found for index ${L}`);const D=r[L],{collapsedSize:V=0,collapsible:R,minSize:P=0}=N.constraints;if(D!=null&&R){const F=ge({delta:j(D,V)?P-V:V-D,initialLayout:r,panelConstraints:s.map(q=>q.constraints),pivotIndices:dn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==F&&l(F)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,n,e,t,r,i,l])}function Ze(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function gn(n,e){const t=n==="horizontal",{x:r,y:i}=Ce(e);return t?r:i}function jn(n,e,t,r,i){const o=t==="horizontal",l=Re(e,i);x(l,`No resize handle element found for id "${e}"`);const a=l.getAttribute(A.groupId);x(a,"Resize handle element has no group id attribute");let{initialCursorPosition:s}=r;const h=gn(t,n),w=pn(a,i);x(w,`No group element found for id "${a}"`);const p=w.getBoundingClientRect(),u=o?p.width:p.height;return(h-s)/u*100}function Fn(n,e,t,r,i,o){if(nn(n)){const l=t==="horizontal";let a=0;n.shiftKey?a=100:i!=null?a=i:a=10;let s=0;switch(n.key){case"ArrowDown":s=l?0:a;break;case"ArrowLeft":s=l?-a:0;break;case"ArrowRight":s=l?a:0;break;case"ArrowUp":s=l?0:-a;break;case"End":s=100;break;case"Home":s=-100;break}return s}else return r==null?0:jn(n,e,t,r,o)}function Kn({panelDataArray:n}){const e=Array(n.length),t=n.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;a!=null&&(r++,e[o]=a,i-=a)}for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;if(a!=null)continue;const s=n.length-r,h=i/s;r++,e[o]=h,i-=h}return e}function oe(n,e,t){e.forEach((r,i)=>{const o=n[i];x(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:a,id:s}=o,{collapsedSize:h=0,collapsible:w}=a,p=t[s];if(p==null||r!==p){t[s]=r;const{onCollapse:u,onExpand:v,onResize:z}=l;z&&z(r,p),w&&(u||v)&&(v&&(p==null||X(p,h))&&!X(r,h)&&v(),u&&(p==null||!X(p,h))&&X(r,h)&&u())}})}function be(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function Un({defaultSize:n,dragState:e,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let a;return l==null?a=n!=null?n.toPrecision(o):"1":r.length===1?a="1":a=l.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Vn(n,e=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...i)},e)}}function Oe(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function mn(n){return`react-resizable-panels:${n}`}function hn(n){return n.map(e=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=e;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function zn(n,e){try{const t=mn(n),r=e.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Zn(n,e,t){var r,i;const o=(r=zn(n,t))!==null&&r!==void 0?r:{},l=hn(e);return(i=o[l])!==null&&i!==void 0?i:null}function On(n,e,t,r,i){var o;const l=mn(n),a=hn(e),s=(o=zn(n,i))!==null&&o!==void 0?o:{};s[a]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(s))}catch(h){console.error(h)}}function qe({layout:n,panelConstraints:e}){const t=[...n],r=t.reduce((o,l)=>o+l,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!j(r,100)&&t.length>0)for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=100/r*l;t[o]=a}let i=0;for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=le({panelConstraints:e,panelIndex:o,size:l});l!=a&&(i+=l-a,t[o]=a)}if(!j(i,0))for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=l+i,s=le({panelConstraints:e,panelIndex:o,size:a});if(l!==s&&(i-=s-l,t[o]=s,j(i,0)))break}return t}const qn=100,me={getItem:n=>(Oe(me),me.getItem(n)),setItem:(n,e)=>{Oe(me),me.setItem(n,e)}},Xe={};function yn({autoSaveId:n=null,children:e,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:a=null,storage:s=me,style:h,tagName:w="div",...p}){const u=Ge(o),v=f.useRef(null),[z,C]=f.useState(null),[E,S]=f.useState([]),L=_n(),N=f.useRef({}),D=f.useRef(new Map),V=f.useRef(0),R=f.useRef({autoSaveId:n,direction:r,dragState:z,id:u,keyboardResizeBy:a,onLayout:l,storage:s}),P=f.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});f.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),f.useImperativeHandle(i,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:c}=P.current;return c},setLayout:c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current,d=qe({layout:c,panelConstraints:g.map(y=>y.constraints)});Ze(b,d)||(S(d),P.current.layout=d,m&&m(d),oe(g,d,N.current))}}),[]),ne(()=>{R.current.autoSaveId=n,R.current.direction=r,R.current.dragState=z,R.current.id=u,R.current.onLayout=l,R.current.storage=s}),Wn({committedValuesRef:R,eagerValuesRef:P,groupId:u,layout:E,panelDataArray:P.current.panelDataArray,setLayout:S,panelGroupElement:v.current}),f.useEffect(()=>{const{panelDataArray:c}=P.current;if(n){if(E.length===0||E.length!==c.length)return;let m=Xe[n];m==null&&(m=Vn(On,qn),Xe[n]=m);const b=[...c],g=new Map(D.current);m(n,b,g,E,s)}},[n,E,s]),f.useEffect(()=>{});const F=f.useCallback(c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(Z=>Z.constraints),{collapsedSize:y=0,panelSize:I,pivotIndices:$}=Q(g,c,b);if(x(I!=null,`Panel size not found for panel "${c.id}"`),!X(I,y)){D.current.set(c.id,I);const O=ie(g,c)===g.length-1?I-y:y-I,k=ge({delta:O,initialLayout:b,panelConstraints:d,pivotIndices:$,prevLayout:b,trigger:"imperative-api"});be(b,k)||(S(k),P.current.layout=k,m&&m(k),oe(g,k,N.current))}}},[]),q=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current;if(c.constraints.collapsible){const y=d.map(K=>K.constraints),{collapsedSize:I=0,panelSize:$=0,minSize:Z=0,pivotIndices:O}=Q(d,c,g),k=m??Z;if(X($,I)){const K=D.current.get(c.id),de=K!=null&&K>=k?K:k,Le=ie(d,c)===d.length-1?$-de:de-$,T=ge({delta:Le,initialLayout:g,panelConstraints:y,pivotIndices:O,prevLayout:g,trigger:"imperative-api"});be(g,T)||(S(T),P.current.layout=T,b&&b(T),oe(d,T,N.current))}}},[]),W=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{panelSize:g}=Q(b,c,m);return x(g!=null,`Panel size not found for panel "${c.id}"`),g},[]),G=f.useCallback((c,m)=>{const{panelDataArray:b}=P.current,g=ie(b,c);return Un({defaultSize:m,dragState:z,layout:E,panelData:b,panelIndex:g})},[z,E]),M=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),d===!0&&X(y,g)},[]),Y=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),!d||te(y,g)>0},[]),_=f.useCallback(c=>{const{panelDataArray:m}=P.current;m.push(c),m.sort((b,g)=>{const d=b.order,y=g.order;return d==null&&y==null?0:d==null?-1:y==null?1:d-y}),P.current.panelDataArrayChanged=!0,L()},[L]);ne(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:c,onLayout:m,storage:b}=R.current,{layout:g,panelDataArray:d}=P.current;let y=null;if(c){const $=Zn(c,d,b);$&&(D.current=new Map(Object.entries($.expandToSizes)),y=$.layout)}y==null&&(y=Kn({panelDataArray:d}));const I=qe({layout:y,panelConstraints:d.map($=>$.constraints)});Ze(g,I)||(S(I),P.current.layout=I,m&&m(I),oe(d,I,N.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const H=f.useCallback(c=>{let m=!1;const b=v.current;return b&&window.getComputedStyle(b,null).getPropertyValue("direction")==="rtl"&&(m=!0),function(d){d.preventDefault();const y=v.current;if(!y)return()=>null;const{direction:I,dragState:$,id:Z,keyboardResizeBy:O,onLayout:k}=R.current,{layout:K,panelDataArray:de}=P.current,{initialLayout:ve}=$??{},Le=dn(Z,c,y);let T=Fn(d,c,I,$,O,y);const We=I==="horizontal";We&&m&&(T=-T);const bn=de.map(Sn=>Sn.constraints),pe=ge({delta:T,initialLayout:ve??K,panelConstraints:bn,pivotIndices:Le,prevLayout:K,trigger:nn(d)?"keyboard":"mouse-or-touch"}),je=!be(K,pe);(tn(d)||rn(d))&&V.current!=T&&(V.current=T,!je&&T!==0?We?Ne(c,T<0?ln:an):Ne(c,T<0?sn:un):Ne(c,0)),je&&(S(pe),P.current.layout=pe,k&&k(pe),oe(de,pe,N.current))}},[]),B=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current,y=d.map(K=>K.constraints),{panelSize:I,pivotIndices:$}=Q(d,c,g);x(I!=null,`Panel size not found for panel "${c.id}"`);const O=ie(d,c)===d.length-1?I-m:m-I,k=ge({delta:O,initialLayout:g,panelConstraints:y,pivotIndices:$,prevLayout:g,trigger:"imperative-api"});be(g,k)||(S(k),P.current.layout=k,b&&b(k),oe(d,k,N.current))},[]),se=f.useCallback((c,m)=>{const{layout:b,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:I=0,collapsible:$,maxSize:Z=100,minSize:O=0}=c.constraints,{panelSize:k}=Q(g,c,b);k!=null&&(y&&$&&X(k,d)?X(d,I)||B(c,I):k<O?B(c,O):k>Z&&B(c,Z))},[B]),ue=f.useCallback((c,m)=>{const{direction:b}=R.current,{layout:g}=P.current;if(!v.current)return;const d=Re(c,v.current);x(d,`Drag handle element not found for id "${c}"`);const y=gn(b,m);C({dragHandleId:c,dragHandleRect:d.getBoundingClientRect(),initialCursorPosition:y,initialLayout:g})},[]),ce=f.useCallback(()=>{C(null)},[]),xe=f.useCallback(c=>{const{panelDataArray:m}=P.current,b=ie(m,c);b>=0&&(m.splice(b,1),delete N.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:F,direction:r,dragState:z,expandPanel:q,getPanelSize:W,getPanelStyle:G,groupId:u,isPanelCollapsed:M,isPanelExpanded:Y,reevaluatePanelConstraints:se,registerPanel:_,registerResizeHandle:H,resizePanel:B,startDragging:ue,stopDragging:ce,unregisterPanel:xe,panelGroupElement:v.current}),[F,z,r,q,W,G,u,M,Y,se,_,H,B,ue,ce,xe]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return f.createElement(Ee.Provider,{value:re},f.createElement(w,{...p,children:e,className:t,id:o,ref:v,style:{...fe,...h},[A.group]:"",[A.groupDirection]:r,[A.groupId]:u}))}const xn=f.forwardRef((n,e)=>f.createElement(yn,{...n,forwardedRef:e}));yn.displayName="PanelGroup";xn.displayName="forwardRef(PanelGroup)";function ie(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Q(n,e,t){const r=ie(n,e),o=r===n.length-1?[r-1,r]:[r,r+1],l=t[r];return{...e.constraints,panelSize:l,pivotIndices:o}}function Xn({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:r}){f.useEffect(()=>{if(n||t==null||r==null)return;const i=Re(e,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const a=i.getAttribute(A.groupId);x(a,`No group element found for id "${a}"`);const s=ye(a,r),h=fn(a,e,r);x(h!==null,`No resize element found for id "${e}"`);const w=l.shiftKey?h>0?h-1:s.length-1:h+1<s.length?h+1:0;s[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,n,e,t])}function vn({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:a,onFocus:s,onPointerDown:h,onPointerUp:w,style:p={},tabIndex:u=0,tagName:v="div",...z}){var C,E;const S=f.useRef(null),L=f.useRef({onClick:l,onDragging:a,onPointerDown:h,onPointerUp:w});f.useEffect(()=>{L.current.onClick=l,L.current.onDragging=a,L.current.onPointerDown=h,L.current.onPointerUp=w});const N=f.useContext(Ee);if(N===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:V,registerResizeHandle:R,startDragging:P,stopDragging:F,panelGroupElement:q}=N,W=Ge(i),[G,M]=f.useState("inactive"),[Y,_]=f.useState(!1),[H,B]=f.useState(null),se=f.useRef({state:G});ne(()=>{se.current.state=G}),f.useEffect(()=>{if(t)B(null);else{const re=R(W);B(()=>re)}},[t,W,R]);const ue=(C=r?.coarse)!==null&&C!==void 0?C:15,ce=(E=r?.fine)!==null&&E!==void 0?E:5;f.useEffect(()=>{if(t||H==null)return;const re=S.current;x(re,"Element ref not attached");let fe=!1;return Dn(W,re,D,{coarse:ue,fine:ce},(m,b,g)=>{if(!b){M("inactive");return}switch(m){case"down":{M("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(W,g);const{onDragging:d,onPointerDown:y}=L.current;d?.(!0),y?.();break}case"move":{const{state:d}=se.current;fe=!0,d!=="drag"&&M("hover"),x(g,'Expected event to be defined for "move" action'),H(g);break}case"up":{M("hover"),F();const{onClick:d,onDragging:y,onPointerUp:I}=L.current;y?.(!1),I?.(),fe||d?.();break}}})},[ue,D,t,ce,R,W,H,P,F]),Xn({disabled:t,handleId:W,resizeHandler:H,panelGroupElement:q});const xe={touchAction:"none",userSelect:"none"};return f.createElement(v,{...z,children:n,className:e,id:i,onBlur:()=>{_(!1),o?.()},onFocus:()=>{_(!0),s?.()},ref:S,role:"separator",style:{...xe,...p},tabIndex:u,[A.groupDirection]:D,[A.groupId]:V,[A.resizeHandle]:"",[A.resizeHandleActive]:G==="drag"?"pointer":Y?"keyboard":void 0,[A.resizeHandleEnabled]:!t,[A.resizeHandleId]:W,[A.resizeHandleState]:G})}vn.displayName="PanelResizeHandle";function Qn(n){const e=He.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;e[3]!==t?(i=Je("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[3]=t,e[4]=i):i=e[4];let o;return e[5]!==r||e[6]!==i?(o=he.jsx(xn,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function et(n){const e=He.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let r;return e[2]!==t?(r=he.jsx(en,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=r):r=e[3],r}function nt(n){const e=He.c(12);let t,r,i;e[0]!==n?({withHandle:i,className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i):(t=e[1],r=e[2],i=e[3]);let o;e[4]!==t?(o=Je("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),e[4]=t,e[5]=o):o=e[5];let l;e[6]!==i?(l=i&&he.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:he.jsx(Ye,{className:"size-2.5"})}),e[6]=i,e[7]=l):l=e[7];let a;return e[8]!==r||e[9]!==o||e[10]!==l?(a=he.jsx(vn,{"data-slot":"resizable-handle",className:o,...r,children:l}),e[8]=r,e[9]=o,e[10]=l,e[11]=a):a=e[11],a}export{nt as R,et as a,Qn as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as p,j as s}from"./index-uOrjFt6t.js";import{B as v}from"./button-D10odSSz.js";import{i as j,a as S}from"./Save01-DCBihulA.js";import{i as z}from"./Loading01-D2eBBNoh.js";function y(x){const e=p.c(15),{onSave:c,onUndo:d,isDirty:b,isSaving:i,saveLabel:f,undoLabel:u}=x,n=f===void 0?"Save":f,o=u===void 0?"Undo":u;if(!b)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(j,{size:14}),e[0]=r):r=e[0];let t;e[1]!==i||e[2]!==d||e[3]!==o?(t=s.jsxs(v,{variant:"outline",size:"sm",onClick:d,disabled:i,"aria-label":o,children:[r,o]}),e[1]=i,e[2]=d,e[3]=o,e[4]=t):t=e[4];let a;e[5]!==i?(a=i?s.jsx(z,{size:14,className:"animate-spin"}):s.jsx(S,{size:14}),e[5]=i,e[6]=a):a=e[6];let l;e[7]!==i||e[8]!==c||e[9]!==n||e[10]!==a?(l=s.jsxs(v,{variant:"default",size:"sm",onClick:c,disabled:i,"aria-label":n,children:[a,n]}),e[7]=i,e[8]=c,e[9]=n,e[10]=a,e[11]=l):l=e[11];let m;return e[12]!==t||e[13]!==l?(m=s.jsxs(s.Fragment,{children:[t,l]}),e[12]=t,e[13]=l,e[14]=m):m=e[14],m}export{y as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,E as k,bJ as $,j as d,D as j,z as rt,B as Ne,aF as st,ax as be,aG as lt,G as P,aH as at,Z as _e,aI as Ee,bK as it,Q as ct,bL as dt,aJ as ut,aM as pt,aK as ft,aN as mt,aO as ht,M as vt,aL as gt,aP as xt,aQ as St,c as ee}from"./index-uOrjFt6t.js";import{V as wt}from"./index-kTXXfvC-.js";import{i as Ct}from"./Check-Dnxirgog.js";import{t as Re}from"./ChevronDown-DlCNAUXg.js";import{c as oe}from"./button-D10odSSz.js";function Pe(n,[e,t]){return Math.min(t,Math.max(e,n))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=it(J),[ne]=vt(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Nt,Pt]=ne(J),je=n=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=n,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[F,M]=c.useState(!1),re=rt(u),[_,O]=Ne({prop:o,defaultProp:r??!1,onChange:i,caller:J}),[U,q]=Ne({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(st,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Nt,{scope:n.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:o=!1,...r}=n,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(lt,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...r,ref:a,onClick:P(r.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:P(r.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(r.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,children:i,placeholder:s="",...l}=n,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var _t="SelectIcon",ke=c.forwardRef((n,e)=>{const{__scopeSelect:t,children:o,...r}=n;return d.jsx(j.span,{"aria-hidden":!0,...r,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=n=>d.jsx(at,{asChild:!0,...n});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((n,e)=>{const t=G(Q,n.__scopeSelect),[o,r]=c.useState();if($(()=>{r(new DocumentFragment)},[]),!t.open){const i=o;return i?_e.createPortal(d.jsx(Ve,{scope:n.__scopeSelect,children:d.jsx(de.Slot,{scope:n.__scopeSelect,children:d.jsx("div",{children:n.children})})}),i):null}return d.jsx(He,{...n,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=gt("SelectContent.RemoveScroll"),He=c.forwardRef((n,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=n,m=G(Q,t),[x,F]=c.useState(null),[M,re]=c.useState(null),_=k(e,f=>F(f)),[O,U]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=c.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===y&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(ft,{as:jt,allowPinchZoom:!0,children:d.jsx(mt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=y.indexOf(I);y=y.slice(N+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:o,...r}=n,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,_=>h(_)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const _=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,Z=_.left-N,X=_.width+Z,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,Z=window.innerWidth-_.right-N,X=_.width+Z,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,Z=Math.max(ie,se+(I?he:0)+N+D),X=T+Z;l.style.height=X+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const Z=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=Z+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[F,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...r,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((n,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=A,...i}=n,s=pe(t);return d.jsx(xt,{...s,...i,ref:e,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Fe=c.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:o,...r}=n,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:P(r.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=be();return d.jsx(Dt,{scope:t,id:r,children:d.jsx(j.div,{role:"group","aria-labelledby":r,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=kt(We,t);return d.jsx(j.div,{id:r.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((n,e)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:i,...s}=n,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,r)),p=be(),v=c.useRef("touch"),C=()=>{r||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:r,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:S,onFocus:P(s.onFocus,()=>w(!0)),onBlur:P(s.onBlur,()=>w(!1)),onClick:P(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:P(s.onPointerMove,m=>{v.current=m.pointerType,r?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:P(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,...i}=n,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Pt(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Ze=c.forwardRef((n,e)=>{const t=Y(Ce,n.__scopeSelect),o=Te(Ce,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Xe=c.forwardRef((n,e)=>{const t=Y(ye,n.__scopeSelect),o=Te(ye,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Xe.displayName=ye;var Je=c.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=n,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:P(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:P(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:P(r.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(St,{...r,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:n,value:e,...t},o)=>{const r=c.useRef(null),i=k(o,r),s=ct(e);return c.useEffect(()=>{const l=r.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...wt,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ut;function et(n){return n===""||n===void 0}function tt(n){const e=dt(n),t=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,i]}function ot(n,e,t){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Wt(n,Math.max(i,0));r.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==t?a:void 0}function Wt(n,e){return n.map((t,o)=>n[(e+o)%n.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Zt=Be,Xt=Fe,Jt=$e,Qt=Ge,eo=qe,to=Ze,oo=Xe;const nt=({size:n=24,color:e="currentColor",...t})=>c.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},c.createElement("path",{d:"m18 15-6-6-6 6"}));nt.displayName="ChevronUp";function uo(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(n){const e=ee.c(13);let t,o,r,i;e[0]!==n?({className:o,size:i,children:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-7 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...r,children:[t,a]}),e[8]=t,e[9]=r,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(n){const e=ee.c(25);let t,o,r,i,s;e[0]!==n?({className:o,children:t,position:i,hideScrollButtons:s,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i,e[5]=s):(t=e[1],o=e[2],r=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Xt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==r||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Zt,{"data-slot":"select-content",className:h,position:l,...r,children:[g,S,p]})}),e[18]=l,e[19]=r,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(n){const e=ee.c(16);let t,o,r,i;e[0]!==n?({className:o,children:t,hideCheck:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(Ct,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==r||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...r,children:[a,u]}),e[11]=r,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(nt,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}function ro(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,Pe as e,nt as n};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as T,c as E,j as s,u as fe,b as Ie,bU as Ce,L as $e,c1 as dt,c2 as mt,O as K,_ as ut,e as Pe,d as ae,t as le,c3 as ft,b5 as pt,m as xt,A as ht,S as Ue,f as gt,h as jt,N as bt,n as yt,K as Nt,aC as Fe,P as vt}from"./index-uOrjFt6t.js";import{C as X}from"./index-DTB_8xm9.js";import{I as St}from"./integration-icon-CHvqhFEd.js";import{P as de,u as He,d as ie,e as ne,f as Ae,g as ge,h as je,i as kt,j as Ct,k as _t,l as We,m as wt,n as $t,o as zt,p as It}from"./index-CX1TvU3T.js";import{u as Oe,C as Pt,b as At,c as Ot}from"./use-deco-chat-open-DeWcxP9f.js";import{c as B,B as Se}from"./button-D10odSSz.js";import{d as Tt,u as Mt}from"./constants-V7-3C38y.js";import{E as Et,i as Dt,a as Lt}from"./editable-thread-title-C5iprBiE.js";import{s as xe}from"./Plus-CoFNXdPs.js";import{t as Te}from"./Users03-ELQ8CczK.js";import{i as De}from"./X-DlPknjOM.js";import{E as Be}from"./error-boundary-apRp8Xmr.js";import{b as Rt,i as Ut}from"./context-BBfuJWes.js";import{C as Ge}from"./create-project-dialog-D87AirfP.js";import{u as _e,S as Z}from"./skeleton-B9aXeb5e.js";import{t as qe,u as Ke,i as Ft}from"./use-settings-modal-DVxljFTz.js";import{n as Le}from"./CheckDone01-BQB-AnYZ.js";import{n as Ht}from"./Container-NYiiZyd6.js";import{e as Wt}from"./Dataflow03-r1iydeQd.js";import{a as Bt}from"./Home02-DX25irYw.js";import{t as ke}from"./Settings01-CF0yl6Tz.js";import{a as Ve,u as Ye}from"./use-project-Cr1TKfdV.js";import{t as Qe}from"./ChevronDown-DlCNAUXg.js";import{a as Gt,b as qt,T as Kt}from"./tooltip-CooOHv4u.js";import{A as me}from"./avatar-DjSt5kfT.js";import{c as Y,g as he,d as Vt,e as Yt,f as Qt,b as Ze,D as Je,a as Xe}from"./dropdown-menu-D6LMimH3.js";import{i as ue}from"./Check-Dnxirgog.js";import{C as Zt}from"./create-organization-dialog-3HZ9Fapi.js";import{a as Jt}from"./Copy01--WUANgtG.js";import{i as Xt}from"./File06-WXzmRYLt.js";import{i as es}from"./Globe01-VgVHGjyC.js";import{n as pe}from"./LinkExternal01-D9NBeY0S.js";import{i as ts}from"./Shield01-BVTU_rBf.js";import{a as ss,P as rs,b as ns}from"./popover-B_SzRtKR.js";import{n as Re}from"./Inbox01-Bh1zeW2m.js";import{s as is}from"./XClose-Baiitjul.js";import{h as os}from"./use-connection-DqGqpr6W.js";import{b as ls}from"./use-mcp-tools-DuTyW4Xm.js";import{i as as}from"./deco-constants-BmtTfZbQ.js";import{i as cs}from"./ChevronRight-BjXZnVl8.js";import{u as Me,L as Ee}from"./localstorage-keys-r_mW6Lq0.js";import{R as ds,a as et,b as ms}from"./resizable-BvPyhOvU.js";import"./spinner-BeYA_hqO.js";import"./use-mcp-prompts-B9LoAxha.js";import"./useQuery-Vrc6Li_H.js";import"./dialog-bLBl7se3.js";import"./form-CSWi3me2.js";import"./label-D84F6EwM.js";import"./input-C8Cn3OQt.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-ByjI1wop.js";import"./Edit01-DK-8NMEI.js";import"./XCircle-aBox2-uz.js";import"./AlertCircle-Ci70K_EZ.js";import"./AlertTriangle-D2guHjVq.js";import"./tabs-Cqye-vZ-.js";import"./ArrowLeft-DOvB9XQA.js";import"./use-copy-CvA2en_g.js";import"./badge-Dj7JdmaJ.js";import"./Code01-D62OImsE.js";import"./use-virtual-mcp-B7YffSTv.js";import"./SearchMd-WqvhRztL.js";import"./use-create-virtual-mcp-DJv6y6EJ.js";import"./marked.esm-BaswSlok.js";import"./markdown-BD6zDSJc.js";import"./types-jYkZj_oN.js";import"./Eye-broatAu7.js";import"./Globe02-C0qeWKnK.js";import"./RefreshCw01-CyeiQkso.js";import"./select-BZB4uvGm.js";import"./index-kTXXfvC-.js";import"./collection-search-BAmI-gVt.js";import"./Loading01-D2eBBNoh.js";import"./generate-id-Dyweu44Y.js";import"./Clock-CuTVdxgk.js";import"./Trash01-Bilx6R4T.js";import"./use-mobile-DA9mzCuy.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-CDYsARAu.js";import"./use-binding-9lQePXv2.js";import"./binder--zY5y66H.js";import"./Grid01-Dyv_Ip5i.js";import"./Image01-Dv4Xx4Vn.js";import"./RefreshCcw01-J5wqqeG_.js";import"./useSuspenseInfiniteQuery-D3F1c8oY.js";import"./infiniteQueryObserver-DS9VDnBa.js";import"./useMutation-BYvhr9Wj.js";import"./textarea-CLWsfk4l.js";import"./alert-dialog-DrmsJmsN.js";const tt=({size:t=24,color:e="currentColor",...r})=>T.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},T.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));tt.displayName="BarChart10";const st=({size:t=24,color:e="currentColor",...r})=>T.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},T.createElement("path",{d:"M8 14s1.5 2 4 2 4-2 4-2m-1-5h.01M9 9h.01M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-6.5-3a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-6 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z"}));st.displayName="FaceSmile";const rt=({size:t=24,color:e="currentColor",...r})=>T.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},T.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));rt.displayName="LogOut01";const nt=({size:t=24,color:e="currentColor",...r})=>T.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},T.createElement("path",{d:"M8 9.5h4M8 13h7m-3 8a9 9 0 1 0-8.342-5.616c.081.2.122.3.14.381a.907.907 0 0 1 .024.219c0 .083-.015.173-.045.353l-.593 3.558c-.062.373-.093.56-.035.694a.5.5 0 0 0 .262.262c.135.058.321.027.694-.035l3.558-.593c.18-.03.27-.045.353-.045.081 0 .14.006.219.024.08.018.18.059.38.14A8.973 8.973 0 0 0 12 21Z"}));nt.displayName="MessageTextCircle02";function us(){const t=E.c(65),{org:e}=fe(),[,r]=Oe(),{selectedVirtualMcp:o,modelsConnections:i,isChatEmpty:l,activeThreadId:n,createThread:a,switchToThread:d,threads:c}=Rt();let m;if(t[0]!==n||t[1]!==c){let W;t[3]!==n?(W=G=>G.id===n,t[3]=n,t[4]=W):W=t[4],m=c.find(W),t[0]=n,t[1]=c,t[2]=m}else m=t[2];const f=m,[u,N]=T.useState(!1),[x,h]=T.useTransition();let j;t[5]!==e.id?(j=Tt(e.id),t[5]=e.id,t[6]=j):j=t[6];const p=o??j;let b;t[7]!==a?(b=()=>{h(()=>{a()})},t[7]=a,t[8]=b):b=t[8];const v=b;if(i.length===0){let W;t[9]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(de.Header.Left,{className:"gap-2"}),t[9]=W):W=t[9];let G;t[10]!==r?(G=()=>r(!1),t[10]=r,t[11]=G):G=t[11];let _;t[12]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(De,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[12]=_):_=t[12];let q;t[13]!==G?(q=s.jsxs(de.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[W,s.jsx(de.Header.Right,{className:"gap-1",children:s.jsx("button",{type:"button",onClick:G,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:_})})]}),t[13]=G,t[14]=q):q=t[14];let re;t[15]!==e?(re=s.jsx(X.Main,{className:"flex flex-col items-center",children:s.jsx(X.EmptyState,{children:s.jsx(X.NoLlmBindingEmptyState,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",org:e})})}),t[15]=e,t[16]=re):re=t[16];let ce;return t[17]!==q||t[18]!==re?(ce=s.jsxs(X,{className:"animate-in fade-in-0 duration-200",children:[q,re]}),t[17]=q,t[18]=re,t[19]=ce):ce=t[19],ce}const g=u?"duration-300 opacity-0 -translate-x-4 pointer-events-none":x?"duration-150 opacity-0 pointer-events-none":"duration-300 opacity-100 translate-x-0";let S;t[20]!==g?(S=B("absolute inset-0 flex flex-col transition-[opacity,transform] ease-[var(--ease-out-quart)]",g),t[20]=g,t[21]=S):S=t[21];let y;t[22]!==f||t[23]!==l?(y=!l&&f?.title&&s.jsx(Et,{threadId:f.id,text:f.title,className:"text-sm font-medium text-foreground"}),t[22]=f,t[23]=l,t[24]=y):y=t[24];let $;t[25]!==y?($=s.jsx(de.Header.Left,{className:"gap-2",children:y}),t[25]=y,t[26]=$):$=t[26];let z;t[27]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(xe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[27]=z):z=t[27];let C;t[28]!==v||t[29]!==x?(C=s.jsx("button",{type:"button",onClick:v,disabled:x,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"New chat",children:z}),t[28]=v,t[29]=x,t[30]=C):C=t[30];let w;t[31]===Symbol.for("react.memo_cache_sentinel")?(w=()=>N(!0),t[31]=w):w=t[31];let L;t[32]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("button",{type:"button",onClick:w,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Chat history",children:s.jsx(Dt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t[32]=L):L=t[32];let O;t[33]!==r?(O=()=>r(!1),t[33]=r,t[34]=O):O=t[34];let F;t[35]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(De,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[35]=F):F=t[35];let M;t[36]!==O?(M=s.jsx("button",{type:"button",onClick:O,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:F}),t[36]=O,t[37]=M):M=t[37];let R;t[38]!==M||t[39]!==C?(R=s.jsxs(de.Header.Right,{className:"gap-1",children:[C,L,M]}),t[38]=M,t[39]=C,t[40]=R):R=t[40];let P;t[41]!==R||t[42]!==$?(P=s.jsxs(de.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[$,R]}),t[41]=R,t[42]=$,t[43]=P):P=t[43];let D;t[44]!==p||t[45]!==l?(D=s.jsx(X.Main,{children:l?s.jsx(X.EmptyState,{children:s.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[s.jsx(St,{icon:p.icon,name:p.title,size:"lg",fallbackIcon:s.jsx(Te,{size:32}),className:"size-[60px]! rounded-[18px]!"}),s.jsx("h3",{className:"text-xl font-medium text-foreground",children:p.title}),s.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:p.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),s.jsx(X.IceBreakers,{})]})}):s.jsx(X.Messages,{})}),t[44]=p,t[45]=l,t[46]=D):D=t[46];let A;t[47]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(X.Footer,{children:s.jsx(X.Input,{})}),t[47]=A):A=t[47];let U;t[48]!==P||t[49]!==D||t[50]!==S?(U=s.jsxs("div",{className:S,children:[P,D,A]}),t[48]=P,t[49]=D,t[50]=S,t[51]=U):U=t[51];const ee=u?"opacity-100 translate-x-0":"opacity-0 translate-x-4 pointer-events-none";let te;t[52]!==ee?(te=B("absolute inset-0 flex flex-col transition-[opacity,transform] duration-300 ease-[var(--ease-out-quart)]",ee),t[52]=ee,t[53]=te):te=t[53];let se;t[54]===Symbol.for("react.memo_cache_sentinel")?(se=()=>N(!1),t[54]=se):se=t[54];let V;t[55]!==n||t[56]!==d||t[57]!==c?(V=s.jsx(Lt,{threads:c,activeThreadId:n,onThreadSelect:d,onClose:se}),t[55]=n,t[56]=d,t[57]=c,t[58]=V):V=t[58];let H;t[59]!==te||t[60]!==V?(H=s.jsx("div",{className:te,children:V}),t[59]=te,t[60]=V,t[61]=H):H=t[61];let Q;return t[62]!==U||t[63]!==H?(Q=s.jsxs(X,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[U,H]}),t[62]=U,t[63]=H,t[64]=Q):Q=t[64],Q}function fs(){const t=E.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X.Skeleton,{}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Be,{fallback:e,children:s.jsx(T.Suspense,{fallback:s.jsx(X.Skeleton,{}),children:s.jsx(us,{})})}),t[1]=r):r=t[1],r}function ps(){const t=E.c(54),[e]=_e(),{locator:r,org:o}=fe(),i=Ie(),l=Ce(),{org:n,project:a}=$e.parse(r),d=$e.isOrgAdminProject(r),{data:c}=Ve(o.id,a);let m;t[0]!==c?.enabledPlugins?(m=c?.enabledPlugins??[],t[0]=c?.enabledPlugins,t[1]=m):m=t[1];const f=m;let u;t[2]!==f?(u=I=>f.includes(I.pluginId),t[2]=f,t[3]=u):u=t[3];const N=dt.filter(u),x=l.location.pathname,h=`/${n}/${a}`,j=x===h||x===`${h}/`;let k;t[4]!==h||t[5]!==x?(k=I=>x.startsWith(`${h}/${I}`),t[4]=h,t[5]=x,t[6]=k):k=t[6];const p=k;let b;t[7]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Bt,{}),t[7]=b):b=t[7];const v={key:"home",label:"Home",icon:b,isActive:j,onClick:()=>{j?window.dispatchEvent(new CustomEvent("reset-home-view")):i({to:"/$org/$project",params:{org:n,project:a}})}};let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Le,{}),t[8]=g):g=t[8];const S={key:"tasks",label:"Tasks",icon:g,isActive:p("tasks"),onClick:()=>i({to:"/$org/$project/tasks",params:{org:n,project:K}})};let y;t[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ht,{}),t[9]=y):y=t[9];const $={key:"mcps",label:"Connections",icon:y,isActive:p("mcps"),onClick:()=>i({to:"/$org/$project/mcps",params:{org:n,project:K}})};let z;t[10]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(ut,{}),t[10]=z):z=t[10];const C={key:"projects",label:"Projects",icon:z,isActive:p("projects"),onClick:()=>i({to:"/$org/$project/projects",params:{org:n,project:K}})};let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(qe,{}),t[11]=w):w=t[11];const L={key:"store",label:"Store",icon:w,isActive:p("store"),onClick:()=>i({to:"/$org/$project/store",params:{org:n,project:K}})};let O;t[12]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Te,{}),t[12]=O):O=t[12];const F={key:"agents",label:"Agents",icon:O,isActive:p("agents"),onClick:()=>i({to:"/$org/$project/agents",params:{org:n,project:K}})};let M;t[13]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(tt,{}),t[13]=M):M=t[13];const R={key:"monitoring",label:"Monitor",icon:M,isActive:p("monitoring"),onClick:()=>i({to:"/$org/$project/monitoring",params:{org:n,project:K}})};let P;t[14]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(st,{}),t[14]=P):P=t[14];const D={key:"members",label:"Members",icon:P,isActive:p("members"),onClick:()=>i({to:"/$org/$project/members",params:{org:n,project:K}})},A=N.map(I=>({key:I.pluginId,label:I.label,icon:I.icon,isActive:p(I.pluginId),onClick:()=>i({to:"/$org/$project/$pluginId",params:{org:n,project:a,pluginId:I.pluginId}})}));let U;t[15]!==f?(U=I=>f.includes(I.pluginId),t[15]=f,t[16]=U):U=t[16];const te=mt.filter(U).map(I=>({type:"group",group:{id:`${I.pluginId}-${I.id}`,label:I.label,items:I.items.map((J,oe)=>({key:`${I.pluginId}-${I.id}-${oe}`,label:J.label,icon:J.icon,isActive:p(I.pluginId),onClick:()=>i({to:"/$org/$project/$pluginId",params:{org:n,project:a,pluginId:I.pluginId}})})),defaultExpanded:I.defaultExpanded??!0}}));if(d){let I;t[17]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ke,{}),t[17]=I):I=t[17];let J;t[18]!==p?(J=p("settings"),t[18]=p,t[19]=J):J=t[19];let oe;t[20]!==i||t[21]!==n?(oe=()=>i({to:"/$org/$project/settings",params:{org:n,project:K}}),t[20]=i,t[21]=n,t[22]=oe):oe=t[22];let Ne;t[23]!==J||t[24]!==oe?(Ne={key:"settings",label:"Settings",icon:I,isActive:J,onClick:oe},t[23]=J,t[24]=oe,t[25]=Ne):Ne=t[25];const ct=Ne,we=[{type:"items",items:[v,...e.experimental_tasks?[S]:[],...e.experimental_projects?[C]:[]]},{type:"group",group:{id:"build",label:"Build",items:[F,$,L],defaultExpanded:!0}},{type:"group",group:{id:"manage",label:"Manage",items:[R,D,ct],defaultExpanded:!0}}];if(A.length>0){let ve;t[26]!==A?(ve={type:"items",items:A},t[26]=A,t[27]=ve):ve=t[27],we.push(ve)}return te.length>0&&we.push(...te),we}let se;t[28]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsx(Le,{}),t[28]=se):se=t[28];let V;t[29]!==p?(V=p("tasks"),t[29]=p,t[30]=V):V=t[30];let H;t[31]!==i||t[32]!==n||t[33]!==a?(H=()=>i({to:"/$org/$project/tasks",params:{org:n,project:a}}),t[31]=i,t[32]=n,t[33]=a,t[34]=H):H=t[34];let Q;t[35]!==V||t[36]!==H?(Q={key:"tasks",label:"Tasks",icon:se,isActive:V,onClick:H},t[35]=V,t[36]=H,t[37]=Q):Q=t[37];const W=Q;let G;t[38]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(Wt,{}),t[38]=G):G=t[38];let _;t[39]!==p?(_=p("workflows"),t[39]=p,t[40]=_):_=t[40];let q;t[41]!==i||t[42]!==n||t[43]!==a?(q=()=>i({to:"/$org/$project/workflows",params:{org:n,project:a}}),t[41]=i,t[42]=n,t[43]=a,t[44]=q):q=t[44];let re;t[45]!==_||t[46]!==q?(re={key:"workflows",label:"Workflows",icon:G,isActive:_,onClick:q},t[45]=_,t[46]=q,t[47]=re):re=t[47];const ce=re;let be;t[48]!==e.experimental_tasks||t[49]!==W?(be=e.experimental_tasks?[W]:[],t[48]=e.experimental_tasks,t[49]=W,t[50]=be):be=t[50];const ye=[{type:"items",items:[v,...be,ce]}];if(A.length>0){let I;t[51]===Symbol.for("react.memo_cache_sentinel")?(I={type:"divider"},t[51]=I):I=t[51],ye.push(I);let J;t[52]!==A?(J={type:"items",items:A},t[52]=A,t[53]=J):J=t[53],ye.push(J)}return te.length>0&&ye.push(...te),ye}function xs(t){const e=E.c(11),{label:r,children:o,defaultExpanded:i}=t,l=i===void 0?!0:i,[n,a]=T.useState(l),{state:d}=He(),c=d==="collapsed";let m;e[0]!==n||e[1]!==c||e[2]!==r?(m=c?s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-8 rounded-full bg-sidebar-foreground/15"})}):s.jsx(ie,{children:s.jsx(ne,{children:s.jsxs(Ae,{className:"h-6 cursor-pointer select-none gap-1 [&>svg]:size-3",onClick:()=>a(!n),children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r}),s.jsx(Qe,{size:12,className:B("text-muted-foreground transition-transform duration-200",!n&&"-rotate-90")})]})})}),e[0]=n,e[1]=c,e[2]=r,e[3]=m):m=e[3];let f;e[4]!==o||e[5]!==n||e[6]!==c?(f=(c||n)&&s.jsx(ge,{children:s.jsx(ie,{className:"gap-0.5",children:o})}),e[4]=o,e[5]=n,e[6]=c,e[7]=f):f=e[7];let u;return e[8]!==m||e[9]!==f?(u=s.jsxs(je,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[m,f]}),e[8]=m,e[9]=f,e[10]=u):u=e[10],u}function it(t){const e=E.c(13),{item:r}=t;let o;e[0]!==r.icon?(o=s.jsx("span",{className:"[&>svg]:size-4",children:r.icon}),e[0]=r.icon,e[1]=o):o=e[1];let i;e[2]!==r.label?(i=s.jsx("span",{className:"truncate group-data-[collapsible=icon]:hidden",children:r.label}),e[2]=r.label,e[3]=i):i=e[3];let l;e[4]!==r.isActive||e[5]!==r.label||e[6]!==r.onClick||e[7]!==o||e[8]!==i?(l=s.jsxs(Ae,{onClick:r.onClick,isActive:r.isActive,tooltip:r.label,children:[o,i]}),e[4]=r.isActive,e[5]=r.label,e[6]=r.onClick,e[7]=o,e[8]=i,e[9]=l):l=e[9];let n;return e[10]!==r.key||e[11]!==l?(n=s.jsx(ne,{children:l},r.key),e[10]=r.key,e[11]=l,e[12]=n):n=e[12],n}function hs(t){const e=E.c(12),{section:r}=t;switch(r.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(kt,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=r.group.label,i=r.group.defaultExpanded;let l;e[2]!==r.group.items?(l=r.group.items.map(js),e[2]=r.group.items,e[3]=l):l=e[3];let n;return e[4]!==r.group.defaultExpanded||e[5]!==r.group.label||e[6]!==l?(n=s.jsx(xs,{label:o,defaultExpanded:i,children:l}),e[4]=r.group.defaultExpanded,e[5]=r.group.label,e[6]=l,e[7]=n):n=e[7],n}case"items":{let o;e[8]!==r.items?(o=r.items.map(gs),e[8]=r.items,e[9]=o):o=e[9];let i;return e[10]!==o?(i=s.jsx(je,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ge,{children:s.jsx(ie,{className:"gap-0.5",children:o})})}),e[10]=o,e[11]=i):i=e[11],i}}}function gs(t){return s.jsx(it,{item:t},t.key)}function js(t){return s.jsx(it,{item:t},t.key)}function ot(t){const e=E.c(14),{sections:r,header:o,footer:i,additionalContent:l,variant:n,collapsible:a,contentClassName:d}=t,c=n===void 0?"sidebar":n,m=a===void 0?"icon":a;let f;e[0]!==d?(f=B("flex flex-col flex-1 overflow-x-hidden mt-1 px-3.5 pb-2 group-data-[collapsible=icon]:px-2",d),e[0]=d,e[1]=f):f=e[1];let u;e[2]!==r?(u=r.map(bs),e[2]=r,e[3]=u):u=e[3];let N;e[4]!==l||e[5]!==f||e[6]!==u?(N=s.jsxs(Ct,{className:f,children:[u,l]}),e[4]=l,e[5]=f,e[6]=u,e[7]=N):N=e[7];let x;return e[8]!==m||e[9]!==i||e[10]!==o||e[11]!==N||e[12]!==c?(x=s.jsxs(_t,{variant:c,collapsible:m,children:[o,N,i]}),e[8]=m,e[9]=i,e[10]=o,e[11]=N,e[12]=c,e[13]=x):x=e[13],x}function bs(t,e){return s.jsx(hs,{section:t},e)}ot.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,r)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(Z,{className:"h-full bg-sidebar-accent rounded-md"})},r))})};function ys(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"space-y-0.5 px-1 py-1",children:[s.jsx(Z,{className:"h-8 w-full rounded-lg"}),s.jsx(Z,{className:"h-8 w-full rounded-lg"})]}),t[0]=e):e=t[0],e}function Ns(t){const e=E.c(12),{organizationId:r,currentProjectSlug:o,onSelect:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={suspense:!0},e[0]=l):l=e[0];const{data:n}=Ye(r,l);let a,d;if(e[1]!==o||e[2]!==i||e[3]!==n){d=Symbol.for("react.early_return_sentinel");e:{const m=n?.filter(vs)??[];if(m.length===0){let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:"No projects yet"}),e[6]=u):u=e[6],d=u;break e}let f;e[7]!==o||e[8]!==i?(f=u=>{const N=o===u.slug,x=u.ui?.themeColor??"#3B82F6";return s.jsxs(Y,{className:B("gap-2.5",N&&"bg-accent"),onClick:()=>i(u.slug),children:[s.jsx("div",{className:"size-6 rounded-md shrink-0 flex items-center justify-center overflow-hidden border border-border/50",style:{backgroundColor:x},children:u.ui?.icon?s.jsx("img",{src:u.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"text-xs font-semibold text-white",children:u.name.charAt(0).toUpperCase()})}),s.jsx("span",{className:"flex-1 truncate",children:u.name}),N&&s.jsx(ue,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},u.id)},e[7]=o,e[8]=i,e[9]=f):f=e[9],a=m.map(f)}e[1]=o,e[2]=i,e[3]=n,e[4]=a,e[5]=d}else a=e[4],d=e[5];if(d!==Symbol.for("react.early_return_sentinel"))return d;let c;return e[10]!==a?(c=s.jsx(s.Fragment,{children:a}),e[10]=a,e[11]=c):c=e[11],c}function vs(t){return t.slug!==K}function Ss(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const r=Math.abs(e)%360;return{backgroundColor:`hsl(${r} 55% 70%)`,color:`hsl(${r} 55% 20%)`}}function lt(t){const e=E.c(44),{isCollapsed:r,onCreateProject:o}=t,i=r===void 0?!1:r;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[0]=l):l=e[0];const{org:n,project:a}=Pe(l),{data:d}=ae.useListOrganizations(),c=Ie(),m=d?.find(_=>_.slug===n),[f,u]=T.useState(!1),[N]=_e(),x=N.experimental_projects,h=a===K,{data:j}=Ve(m?.id??"",h?"":a??"");let k;e[1]!==n?(k=(_,q)=>_.slug===n?-1:q.slug===n?1:_.name.localeCompare(q.name),e[1]=n,e[2]=k):k=e[2];const p=[...d??[]].sort(k);let b;e[3]!==c||e[4]!==n?(b=()=>{n&&c({to:"/$org/$project",params:{org:n,project:K}})},e[3]=c,e[4]=n,e[5]=b):b=e[5];const v=b;let g;e[6]!==c||e[7]!==n?(g=_=>{n&&c({to:"/$org/$project",params:{org:n,project:_}})},e[6]=c,e[7]=n,e[8]=g):g=e[8];const S=g;let y;e[9]!==c?(y=_=>{c({to:"/$org/$project",params:{org:_,project:K}})},e[9]=c,e[10]=y):y=e[10];const $=y;let z;e[11]!==o?(z=o?()=>o():void 0,e[11]=o,e[12]=z):z=e[12];const C=z;let w;e[13]!==c||e[14]!==n||e[15]!==a?(w=()=>{if(!n||!a)return;const _=a===K;c({to:"/$org/$project",params:{org:n,project:a},search:q=>({...q,settings:_?"org.general":`project:${a}:general`})})},e[13]=c,e[14]=n,e[15]=a,e[16]=w):w=e[16];const L=w,O=Je,F=i?"w-auto pr-1.5":"w-full";let M;e[17]!==F?(M=B("flex items-center gap-3 rounded-md p-1.5 pr-2 text-left hover:bg-sidebar-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring min-h-[2.75rem]",F),e[17]=F,e[18]=M):M=e[18];const R=h?s.jsx("div",{className:B("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",i?"size-6":"size-8"),style:m?.logo?void 0:Ss(m?.name??""),children:m?.logo?s.jsx("img",{src:m.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:B("font-semibold leading-none",i?"text-[9px]":"text-xs"),children:(m?.name??"?").slice(0,2).toUpperCase()})}):s.jsx("div",{className:B("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",i?"size-6":"size-8"),style:{backgroundColor:j?.ui?.themeColor??"#60a5fa"},children:j?.ui?.icon?s.jsx("img",{src:j.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:B("font-semibold text-white",i?"text-xs":"text-lg"),children:(j?.name??a??"?").charAt(0).toUpperCase()})});let P;e[19]!==m?.name||e[20]!==j?.name||e[21]!==x||e[22]!==i||e[23]!==h||e[24]!==a?(P=!i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:x?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"block text-[11px] text-sidebar-foreground/50 leading-tight truncate",children:m?.name??"Select org"}),s.jsx("span",{className:"block text-sm font-semibold text-sidebar-foreground truncate leading-tight",children:h?"Studio":j?.name??a??""})]}):s.jsx("span",{className:"block text-sm font-semibold text-sidebar-foreground truncate leading-tight",children:m?.name??"Select org"})}),s.jsx(Ut,{size:16,className:"shrink-0 text-sidebar-foreground/40"})]}),e[19]=m?.name,e[20]=j?.name,e[21]=x,e[22]=i,e[23]=h,e[24]=a,e[25]=P):P=e[25];let D;e[26]!==M||e[27]!==R||e[28]!==P?(D=s.jsx(Xe,{asChild:!0,children:s.jsxs("button",{type:"button",className:M,children:[R,P]})}),e[26]=M,e[27]=R,e[28]=P,e[29]=D):D=e[29];const A=Ze,U="start",ee="bottom",te="w-64 flex flex-col gap-0.5",se=ks,V=x?s.jsxs(s.Fragment,{children:[s.jsxs(Y,{className:B("gap-2.5",h&&"bg-accent"),onClick:v,children:[s.jsx(me,{url:m?.logo??"",fallback:m?.name??"",size:"sm",className:"size-6 rounded-md shrink-0",objectFit:"cover"}),s.jsxs("span",{className:"flex-1 truncate",children:["Studio · ",m?.name]}),h&&s.jsx(ue,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]}),s.jsx("p",{className:"px-2 pt-2 pb-0.5 text-[11px] font-medium text-muted-foreground/50 uppercase tracking-wider",children:"Projects"}),m&&s.jsx(T.Suspense,{fallback:s.jsx(ys,{}),children:s.jsx(Ns,{organizationId:m.id,currentProjectSlug:a,orgSlug:n??"",onSelect:S})}),C&&s.jsxs(Y,{className:"gap-2.5",onClick:C,children:[s.jsx(xe,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create project"})]}),s.jsx(he,{}),s.jsxs(Vt,{children:[s.jsxs(Yt,{className:"gap-2.5",children:[s.jsx(qe,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Switch organization"})]}),s.jsxs(Qt,{className:"w-48 flex flex-col gap-0.5",children:[p.map(_=>s.jsxs(Y,{className:B("gap-2.5",_.slug===n&&"bg-accent"),onClick:()=>$(_.slug),children:[s.jsx(me,{url:_.logo??"",fallback:_.name,size:"xs",className:"size-5 rounded-md shrink-0",objectFit:"cover"}),s.jsx("span",{className:"flex-1 truncate",children:_.name}),_.slug===n&&s.jsx(ue,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id)),s.jsx(he,{}),s.jsxs(Y,{className:"gap-2.5",onClick:()=>u(!0),children:[s.jsx(xe,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create organization"})]})]})]}),s.jsxs(Y,{className:"gap-2.5",onClick:L,children:[s.jsx(ke,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Settings"})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"px-2 pt-2 pb-0.5 text-[11px] font-medium text-muted-foreground/50 uppercase tracking-wider",children:"Organizations"}),p.map(_=>s.jsxs(Y,{className:B("gap-2.5",_.slug===n&&"bg-accent"),onClick:()=>$(_.slug),children:[s.jsx(me,{url:_.logo??"",fallback:_.name,size:"sm",className:"size-6 rounded-md shrink-0",objectFit:"cover"}),s.jsx("span",{className:"flex-1 truncate",children:_.name}),_.slug===n&&s.jsx(ue,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id)),s.jsxs(Y,{className:"gap-2.5",onClick:()=>u(!0),children:[s.jsx(xe,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create organization"})]}),s.jsx(he,{}),s.jsxs(Y,{className:"gap-2.5",onClick:L,children:[s.jsx(ke,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Settings"})]})]});let H;e[30]!==A||e[31]!==se||e[32]!==V?(H=s.jsx(A,{align:U,side:ee,className:te,onCloseAutoFocus:se,children:V}),e[30]=A,e[31]=se,e[32]=V,e[33]=H):H=e[33];let Q;e[34]!==O||e[35]!==D||e[36]!==H?(Q=s.jsxs(O,{children:[D,H]}),e[34]=O,e[35]=D,e[36]=H,e[37]=Q):Q=e[37];let W;e[38]!==f||e[39]!==u?(W=s.jsx(Zt,{open:f,onOpenChange:u}),e[38]=f,e[39]=u,e[40]=W):W=e[40];let G;return e[41]!==Q||e[42]!==W?(G=s.jsxs(s.Fragment,{children:[Q,W]}),e[41]=Q,e[42]=W,e[43]=G):G=e[43],G}function ks(t){return t.preventDefault()}lt.Skeleton=function(){return s.jsxs("div",{className:"flex items-center gap-1.5 h-7 px-1.5 w-full",children:[s.jsx(Z,{className:"size-5 rounded-[5px] shrink-0 bg-sidebar-accent"}),s.jsx(Z,{className:"h-3.5 flex-1 bg-sidebar-accent"})]})};function ze(t){const e=E.c(23),{onCreateProject:r}=t,{state:o}=He(),i=o==="collapsed",[l,n]=Oe();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const{org:d,project:c}=Pe(a),{location:m}=Ce(),f=m.pathname===`/${d}/${c}`||m.pathname===`/${d}/${c}/`;let u;e[1]!==n?(u=()=>{n(Cs)},e[1]=n,e[2]=u):u=e[2];const N=u;let x;e[3]!==i||e[4]!==r?(x=s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(lt,{isCollapsed:i,onCreateProject:r})}),e[3]=i,e[4]=r,e[5]=x):x=e[5];const h=i||f?"max-w-0 opacity-0 pointer-events-none":"max-w-[2rem] opacity-100";let j;e[6]!==h?(j=B("flex items-center gap-0.5 shrink-0 overflow-hidden transition-[max-width,opacity] duration-300 ease-[var(--ease-out-quart)]",h),e[6]=h,e[7]=j):j=e[7];const k=l&&"bg-sidebar-accent text-sidebar-foreground";let p;e[8]!==k?(p=B("size-7 hover:bg-sidebar-accent text-sidebar-foreground/50 hover:text-sidebar-foreground",k),e[8]=k,e[9]=p):p=e[9];let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(nt,{size:14,className:"text-inherit"}),e[10]=b):b=e[10];let v;e[11]!==p||e[12]!==N?(v=s.jsx(Gt,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"icon",className:p,onClick:N,"aria-label":"Toggle Decopilot",children:b})}),e[11]=p,e[12]=N,e[13]=v):v=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(qt,{side:"bottom",children:"Toggle Decopilot"}),e[14]=g):g=e[14];let S;e[15]!==v?(S=s.jsxs(Kt,{children:[v,g]}),e[15]=v,e[16]=S):S=e[16];let y;e[17]!==S||e[18]!==j?(y=s.jsx("div",{className:j,children:S}),e[17]=S,e[18]=j,e[19]=y):y=e[19];let $;return e[20]!==y||e[21]!==x?($=s.jsx(We,{className:"px-3 group-data-[collapsible=icon]:px-2 animate-in fade-in-0 duration-200",children:s.jsx(ie,{children:s.jsx(ne,{children:s.jsxs("div",{className:"flex items-center justify-between w-full gap-1",children:[x,y]})})})}),e[20]=y,e[21]=x,e[22]=$):$=e[22],$}function Cs(t){return!t}ze.Skeleton=function(){return s.jsx(We,{className:"px-3",children:s.jsx(ie,{children:s.jsx(ne,{children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 p-1.5",children:[s.jsx(Z,{className:"size-8 rounded-md shrink-0 bg-sidebar-accent"}),s.jsx(Z,{className:"h-3.5 w-16 bg-sidebar-accent"})]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Z,{className:"size-7 rounded-lg bg-sidebar-accent"}),s.jsx(Z,{className:"size-7 rounded-lg bg-sidebar-accent"})]})]})})})})};function _s(t){const e=E.c(50),{user:r,userImage:o}=t,{open:i}=Ke(),[l,n]=T.useState(!1);let a;e[0]!==r.email||e[1]!==r.id||e[2]!==r.name?(a=()=>{const ee=`ID: ${r.id}
|
|
2
|
-
Name: ${r.name||"N/A"}
|
|
3
|
-
Email: ${r.email}`;navigator.clipboard.writeText(ee),n(!0),le.success("User info copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=r.email,e[1]=r.id,e[2]=r.name,e[3]=a):a=e[3];const d=a,c=r.name||r.email||"U";let m;e[4]!==c||e[5]!==o?(m=s.jsx(me,{url:o,fallback:c,shape:"circle",size:"2xs",className:"shrink-0 size-5"}),e[4]=c,e[5]=o,e[6]=m):m=e[6];const f=r.name||"User";let u;e[7]!==f?(u=s.jsx("div",{className:"flex-1 min-w-0 group-data-[collapsible=icon]:hidden",children:s.jsx("div",{className:"text-sm font-medium truncate text-sidebar-foreground leading-none",children:f})}),e[7]=f,e[8]=u):u=e[8];let N;e[9]!==m||e[10]!==u?(N=s.jsx(Xe,{asChild:!0,children:s.jsxs("button",{className:"flex w-full h-8 items-center gap-2 rounded-md px-1 hover:bg-sidebar-accent transition-colors text-left min-w-0",children:[m,u]})}),e[9]=m,e[10]=u,e[11]=N):N=e[11];const x=r.name||r.email||"U";let h;e[12]!==x||e[13]!==o?(h=s.jsx(me,{url:o,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[12]=x,e[13]=o,e[14]=h):h=e[14];const j=r.name||"User";let k;e[15]!==j?(k=s.jsx("div",{className:"text-sm font-medium truncate",children:j}),e[15]=j,e[16]=k):k=e[16];let p;e[17]!==r.email?(p=s.jsx("div",{className:"text-xs text-muted-foreground truncate",children:r.email}),e[17]=r.email,e[18]=p):p=e[18];let b;e[19]!==k||e[20]!==p?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[k,p]}),e[19]=k,e[20]=p,e[21]=b):b=e[21];let v;e[22]!==l?(v=s.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:l?s.jsx(ue,{size:14,className:"text-green-600"}):s.jsx(Jt,{size:14,className:"text-muted-foreground"})}),e[22]=l,e[23]=v):v=e[23];let g;e[24]!==d||e[25]!==b||e[26]!==v||e[27]!==h?(g=s.jsxs(Y,{onClick:d,className:"gap-2.5 group",children:[h,b,v]}),e[24]=d,e[25]=b,e[26]=v,e[27]=h,e[28]=g):g=e[28];let S;e[29]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(he,{}),e[29]=S):S=e[29];let y;e[30]!==i?(y=()=>i("account.preferences"),e[30]=i,e[31]=y):y=e[31];let $,z;e[32]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(ke,{size:14,className:"shrink-0 text-muted-foreground"}),z=s.jsx("span",{children:"Settings"}),e[32]=$,e[33]=z):($=e[32],z=e[33]);let C;e[34]!==y?(C=s.jsxs(Y,{className:"gap-2.5",onClick:y,children:[$,z]}),e[34]=y,e[35]=C):C=e[35];let w;e[36]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Y,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(Xt,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Terms of Use"}),s.jsx(pe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[36]=w):w=e[36];let L;e[37]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Y,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(ts,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Privacy Policy"}),s.jsx(pe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[37]=L):L=e[37];let O;e[38]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Y,{asChild:!0,children:s.jsxs("a",{href:"https://github.com/decocms/mesh",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(ft,{className:"w-3.5 h-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"decocms/mesh"}),s.jsx(pe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[38]=O):O=e[38];let F;e[39]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Y,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com/discord",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(Te,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Community"}),s.jsx(pe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[39]=F):F=e[39];let M,R;e[40]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Y,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(es,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Homepage"}),s.jsx(pe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),R=s.jsx(he,{}),e[40]=M,e[41]=R):(M=e[40],R=e[41]);let P;e[42]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs(Y,{className:"gap-2.5",onClick:ws,children:[s.jsx(rt,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Sign out"})]}),e[42]=P):P=e[42];let D;e[43]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("div",{className:"px-2 py-1.5",children:s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.128.2"]})}),e[43]=D):D=e[43];let A;e[44]!==g||e[45]!==C?(A=s.jsxs(Ze,{side:"top",align:"end",collisionPadding:8,className:"w-64 flex flex-col gap-0.5",onCloseAutoFocus:$s,children:[g,S,C,w,L,O,F,M,R,P,D]}),e[44]=g,e[45]=C,e[46]=A):A=e[46];let U;return e[47]!==A||e[48]!==N?(U=s.jsxs(Je,{children:[N,A]}),e[47]=A,e[48]=N,e[49]=U):U=e[49],U}function ws(){return ae.signOut()}function $s(t){return t.preventDefault()}function at(){const t=E.c(7),{data:e}=ae.useSession();if(!e?.user){let d;return t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(me,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=d):d=t[0],d}const r=e.user,o=r.name??void 0;let i;t[1]!==o||t[2]!==r?(i={...r,name:o},t[1]=o,t[2]=r,t[3]=i):i=t[3];const l=i,n=r.image;let a;return t[4]!==n||t[5]!==l?(a=s.jsx(_s,{user:l,userImage:n}),t[4]=n,t[5]=l,t[6]=a):a=t[6],a}function zs({invitation:t}){const[e,r]=T.useState(!1),[o,i]=T.useState(!1),l=xt(),n=async()=>{r(!0);try{const d=await ae.organization.acceptInvitation({invitationId:t.id});if(d.error)le.error(d.error.message),r(!1);else{const c=await ae.organization.setActive({organizationId:t.organizationId});le.success("Invitation accepted!");const m=c?.data?.slug;window.location.href=m?`/${m}`:"/"}}catch{le.error("Failed to accept invitation"),r(!1)}},a=async()=>{i(!0);try{const d=await ae.organization.rejectInvitation({invitationId:t.id});d.error?(le.error(d.error.message),i(!1)):(le.success("Invitation declined"),l.invalidateQueries())}catch{le.error("Failed to decline invitation"),i(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(Se,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:n,disabled:e||o,"aria-label":"Accept invitation",children:s.jsx(ue,{size:14})}),s.jsx(Se,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||o,"aria-label":"Decline invitation",children:s.jsx(is,{size:14})})]})]})}function Is(){const t=T.useContext(pt),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date)}class Ps extends T.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?null:this.props.children}}const As="gateway-chip-period";function Os(){try{const t=localStorage.getItem(As);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function Ts(t,e){if(!e||e<=0)return"text-foreground/70";const r=t/e;return r<=.05?"text-destructive":r<=.2?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ms(t){return t>=90?"text-destructive":t>=70?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Es(t){const e=E.c(42),{connectionId:r}=t,{open:o}=Ke(),{org:i}=fe();let l;e[0]!==r||e[1]!==i.id?(l={connectionId:r,orgId:i.id},e[0]=r,e[1]=i.id,e[2]=l):l=e[2];const n=Mt(l);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={},e[3]=a):a=e[3];let d;e[4]!==n?(d={client:n,toolName:"GATEWAY_USAGE",toolArguments:a,staleTime:6e4,select:Ds},e[4]=n,e[5]=d):d=e[5];const{data:c}=ls(d),m=c?.billing.mode??"prepaid",f=c?.limit.total??null,u=c?.limit.remaining??0;let N;e[6]!==c?.usage?(N=c?.usage??{total:0,daily:0,weekly:0,monthly:0},e[6]=c?.usage,e[7]=N):N=e[7];const x=N;let h,j,k,p,b,v,g;if(e[8]!==m||e[9]!==h||e[10]!==u||e[11]!==f||e[12]!==o||e[13]!==x){let $;if(m==="prepaid"){h="Credits";let C;e[21]!==u?(C=u.toFixed(2),e[21]=u,e[22]=C):C=e[22],j=`$${C}`,$=Ts(u,f)}else if(f!=null&&f>0){const C=f-u;let w;e[23]!==f||e[24]!==C?(w=Math.round(C/f*100),e[23]=f,e[24]=C,e[25]=w):w=e[25];const L=Math.min(100,w);h="Usage",j=`${L}%`,$=Ms(L)}else{const C=Os(),w=C==="daily"?x.daily:C==="weekly"?x.weekly:x.monthly,L=C==="daily"?"/day":C==="weekly"?"/wk":"/mo";h="Usage";let O;e[26]!==w?(O=w.toFixed(2),e[26]=w,e[27]=O):O=e[27],j=`$${O}${L}`,$="text-foreground/70"}p="button",e[28]!==o?(b=()=>o("org.billing"),e[28]=o,e[29]=b):b=e[29],v="group-data-[collapsible=icon]:hidden flex items-center justify-between w-full px-2 py-1.5 rounded-md hover:bg-sidebar-accent transition-colors";let z;e[30]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ft,{size:13,className:"text-muted-foreground/60 shrink-0"}),e[30]=z):z=e[30],e[31]!==h?(g=s.jsxs("div",{className:"flex items-center gap-1.5",children:[z,s.jsx("span",{className:"text-xs text-muted-foreground",children:h})]}),e[31]=h,e[32]=g):g=e[32],k=B("text-xs font-medium tabular-nums",$),e[8]=m,e[9]=h,e[10]=u,e[11]=f,e[12]=o,e[13]=x,e[14]=k,e[15]=p,e[16]=b,e[17]=v,e[18]=g,e[19]=h,e[20]=j}else k=e[14],p=e[15],b=e[16],v=e[17],g=e[18],h=e[19],j=e[20];let S;e[33]!==k||e[34]!==j?(S=s.jsx("span",{className:k,children:j}),e[33]=k,e[34]=j,e[35]=S):S=e[35];let y;return e[36]!==S||e[37]!==p||e[38]!==b||e[39]!==v||e[40]!==g?(y=s.jsxs("button",{type:p,onClick:b,className:v,children:[g,S]}),e[36]=S,e[37]=p,e[38]=b,e[39]=v,e[40]=g,e[41]=y):y=e[41],y}function Ds(t){return t.structuredContent}function Ls(){const t=E.c(4),e=os();let r;t[0]!==e?(r=e.find(Rs),t[0]=e,t[1]=r):r=t[1];const o=r;if(!o?.id)return null;let i;return t[2]!==o.id?(i=s.jsx(Es,{connectionId:o.id}),t[2]=o.id,t[3]=i):i=t[3],i}function Rs(t){return as(t.connection_url)}function Us(){const t=E.c(13),e=Is();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ps,{children:s.jsx(T.Suspense,{fallback:null,children:s.jsx(Ls,{})})}),t[0]=r):r=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(at,{})}),t[1]=o):o=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(rs,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"icon",className:"size-8 text-sidebar-foreground/50 hover:text-sidebar-foreground hover:bg-sidebar-accent","aria-label":"Open inbox",children:s.jsx(Re,{size:16})})}),t[2]=i):i=t[2];let l;t[3]!==e.length?(l=e.length>0&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 ring-2 ring-sidebar pointer-events-none"}),t[3]=e.length,t[4]=l):l=t[4];let n;t[5]!==l?(n=s.jsxs("div",{className:"relative",children:[i,l]}),t[5]=l,t[6]=n):n=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[7]=a):a=t[7];let d;t[8]!==e?(d=s.jsxs(ss,{side:"right",align:"end",sideOffset:24,className:"w-[400px] p-0 h-[650px] flex flex-col",children:[a,e.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Re,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"No messages or invites pending"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Messages, workspace and project invitations will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Fs)})]}),t[8]=e,t[9]=d):d=t[9];let c;return t[10]!==n||t[11]!==d?(c=s.jsxs(wt,{className:"px-3.5 pb-3 group-data-[collapsible=icon]:px-2",children:[r,s.jsx(ie,{children:s.jsx(ne,{children:s.jsxs("div",{className:"flex items-center w-full gap-1",children:[o,s.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs(ns,{children:[n,d]})})]})})})]}),t[10]=n,t[11]=d,t[12]=c):c=t[12],c}function Fs(t){return s.jsx(zs,{invitation:t},t.id)}function Hs(t){const e=E.c(11),{project:r}=t,o=r.ui?.themeColor??"#60a5fa";if(r.ui?.icon){let d;return e[0]!==r.ui.icon?(d=s.jsx("img",{src:r.ui.icon,alt:"",className:"size-4 rounded object-cover border border-border/50"}),e[0]=r.ui.icon,e[1]=d):d=e[1],d}let i;e[2]!==o?(i={backgroundColor:o},e[2]=o,e[3]=i):i=e[3];let l;e[4]!==r.name?(l=r.name.charAt(0).toUpperCase(),e[4]=r.name,e[5]=l):l=e[5];let n;e[6]!==l?(n=s.jsx("span",{className:"text-[10px] font-medium text-white",children:l}),e[6]=l,e[7]=n):n=e[7];let a;return e[8]!==i||e[9]!==n?(a=s.jsx("div",{className:"size-4 rounded flex items-center justify-center border border-border/50",style:i,children:n}),e[8]=i,e[9]=n,e[10]=a):a=e[10],a}function Ws(t){const e=E.c(14),{project:r}=t,o=Ie(),{org:i}=fe();let l;e[0]!==o||e[1]!==i.slug||e[2]!==r.slug?(l=()=>{o({to:"/$org/$project",params:{org:i.slug,project:r.slug}})},e[0]=o,e[1]=i.slug,e[2]=r.slug,e[3]=l):l=e[3];let n;e[4]!==r?(n=s.jsx(Hs,{project:r}),e[4]=r,e[5]=n):n=e[5];let a;e[6]!==r.name?(a=s.jsx("span",{className:"truncate flex-1 group-data-[collapsible=icon]:hidden",children:r.name}),e[6]=r.name,e[7]=a):a=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(cs,{size:12,className:"text-muted-foreground opacity-0 group-hover/item:opacity-100 transition-opacity group-data-[collapsible=icon]:hidden"}),e[8]=d):d=e[8];let c;return e[9]!==r.name||e[10]!==l||e[11]!==n||e[12]!==a?(c=s.jsx(ne,{children:s.jsxs(Ae,{onClick:l,tooltip:r.name,children:[n,a,d]})}),e[9]=r.name,e[10]=l,e[11]=n,e[12]=a,e[13]=c):c=e[13],c}function Bs(){const t=E.c(55),{org:e}=fe(),{data:r,isLoading:o}=Ye(e.id),[i,l]=T.useState(!0),[n,a]=T.useState(!1);let d,c,m,f,u,N,x,h,j,k,p,b,v;if(t[0]!==o||t[1]!==i||t[2]!==r){v=Symbol.for("react.early_return_sentinel");e:{const O=r?.filter(qs)??[];if(o){let U;t[16]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(ne,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(Z,{className:"h-4 w-4 rounded"}),s.jsx(Z,{className:"h-4 flex-1"})]})}),t[16]=U):U=t[16];let ee;t[17]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(je,{className:"py-0 px-0",children:s.jsx(ge,{children:s.jsxs(ie,{className:"gap-0.5",children:[U,s.jsx(ne,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(Z,{className:"h-4 w-4 rounded"}),s.jsx(Z,{className:"h-4 flex-1"})]})})]})})}),t[17]=ee):ee=t[17],v=ee;break e}b="group/projects-section mt-2",u=Pt,k=i,p=l,f=je,j="py-0 px-0",m=ge,c=ie,x="gap-0.5";let F;t[18]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Projects"}),t[18]=F):F=t[18];const M=!i&&"-rotate-90";let R;t[19]!==M?(R=B("text-muted-foreground shrink-0 transition-transform duration-200",M),t[19]=M,t[20]=R):R=t[20];let P;t[21]!==R?(P=s.jsx(At,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex flex-1 items-center gap-1 cursor-pointer min-w-0",children:[F,s.jsx(Qe,{size:12,className:R})]})}),t[21]=R,t[22]=P):P=t[22];let D;t[23]===Symbol.for("react.memo_cache_sentinel")?(D=()=>a(!0),t[23]=D):D=t[23];let A;t[24]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("button",{type:"button",onClick:D,title:"Create new project",className:"opacity-0 group-hover/projects-section:opacity-100 transition-opacity text-muted-foreground hover:text-foreground flex items-center justify-center h-4 rounded shrink-0",children:s.jsx(xe,{size:16})}),t[24]=A):A=t[24],t[25]!==P?(h=s.jsx(ne,{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs("div",{className:"flex h-6 w-full items-center gap-1 rounded-md pl-1.5 pr-0.5 hover:bg-sidebar-accent transition-colors",children:[P,A]})}),t[25]=P,t[26]=h):h=t[26],d=Ot,N=O.length===0?s.jsx(ne,{children:s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:"No projects yet"})}):O.map(Gs)}t[0]=o,t[1]=i,t[2]=r,t[3]=d,t[4]=c,t[5]=m,t[6]=f,t[7]=u,t[8]=N,t[9]=x,t[10]=h,t[11]=j,t[12]=k,t[13]=p,t[14]=b,t[15]=v}else d=t[3],c=t[4],m=t[5],f=t[6],u=t[7],N=t[8],x=t[9],h=t[10],j=t[11],k=t[12],p=t[13],b=t[14],v=t[15];if(v!==Symbol.for("react.early_return_sentinel"))return v;let g;t[27]!==d||t[28]!==N?(g=s.jsx(d,{children:N}),t[27]=d,t[28]=N,t[29]=g):g=t[29];let S;t[30]!==c||t[31]!==x||t[32]!==h||t[33]!==g?(S=s.jsxs(c,{className:x,children:[h,g]}),t[30]=c,t[31]=x,t[32]=h,t[33]=g,t[34]=S):S=t[34];let y;t[35]!==m||t[36]!==S?(y=s.jsx(m,{children:S}),t[35]=m,t[36]=S,t[37]=y):y=t[37];let $;t[38]!==f||t[39]!==y||t[40]!==j?($=s.jsx(f,{className:j,children:y}),t[38]=f,t[39]=y,t[40]=j,t[41]=$):$=t[41];let z;t[42]!==u||t[43]!==$||t[44]!==k||t[45]!==p?(z=s.jsx(u,{open:k,onOpenChange:p,children:$}),t[42]=u,t[43]=$,t[44]=k,t[45]=p,t[46]=z):z=t[46];let C;t[47]!==z||t[48]!==b?(C=s.jsx("div",{className:b,children:z}),t[47]=z,t[48]=b,t[49]=C):C=t[49];let w;t[50]!==n?(w=s.jsx(Ge,{open:n,onOpenChange:a}),t[50]=n,t[51]=w):w=t[51];let L;return t[52]!==C||t[53]!==w?(L=s.jsxs(s.Fragment,{children:[C,w]}),t[52]=C,t[53]=w,t[54]=L):L=t[54],L}function Gs(t){return s.jsx(Ws,{project:t},t.id)}function qs(t){return t.slug!==K}function Ks(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(T.Suspense,{fallback:s.jsx(je,{className:"py-0 px-0",children:s.jsx(ge,{children:s.jsx(ie,{className:"gap-0.5",children:s.jsx(ne,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(Z,{className:"h-4 w-4 rounded"}),s.jsx(Z,{className:"h-4 flex-1"})]})})})})}),children:s.jsx(Bs,{})}),t[0]=e):e=t[0],e}function Vs(t){const e=E.c(13),{onCreateProject:r}=t,[o]=_e(),i=ps(),{locator:l}=fe();let n;e[0]!==l?(n=$e.isOrgAdminProject(l),e[0]=l,e[1]=n):n=e[1];const a=n;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ze.Skeleton,{}),e[2]=d):d=e[2];let c;e[3]!==r?(c=s.jsx(T.Suspense,{fallback:d,children:s.jsx(ze,{onCreateProject:r})}),e[3]=r,e[4]=c):c=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Us,{}),e[5]=m):m=e[5];let f;e[6]!==a||e[7]!==o?(f=a&&o.experimental_projects?s.jsx(Be,{children:s.jsx(T.Suspense,{fallback:null,children:s.jsx(Ks,{})})}):null,e[6]=a,e[7]=o,e[8]=f):f=e[8];let u;return e[9]!==i||e[10]!==c||e[11]!==f?(u=s.jsx(ot,{sections:i,header:c,footer:m,additionalContent:f}),e[9]=i,e[10]=c,e[11]=f,e[12]=u):u=e[12],u}function Ys(){const t=E.c(2),r=Ce().location.href;let o;return t[0]!==r?(o=s.jsx(bt,{to:"/login",search:{next:r},replace:!0}),t[0]=r,t[1]=o):o=t[1],o}function Qs(t){const e=E.c(6),{children:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ht,{children:s.jsx(Ue,{})}),e[0]=o):o=e[0];let i;e[1]!==r?(i=s.jsx(gt,{children:r}),e[1]=r,e[2]=i):i=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(jt,{children:s.jsx(Ys,{})}),e[3]=l):l=e[3];let n;return e[4]!==i?(n=s.jsxs(s.Fragment,{children:[o,i,l]}),e[4]=i,e[5]=n):n=e[5],n}function Zs(t){const e=E.c(10),{children:r,className:o}=t,[,i]=T.useTransition();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Ee.decoChatPanelWidth(),e[0]=l):l=e[0];const[n,a]=Me(l,30);let d;e[1]!==a?(d=u=>i(()=>a(u)),e[1]=a,e[2]=d):d=e[2];const c=d;let m;e[3]!==o?(m=B("min-w-0",o),e[3]=o,e[4]=m):m=e[4];let f;return e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==m?(f=s.jsx(et,{defaultSize:n,minSize:20,className:m,onResize:c,children:r}),e[5]=n,e[6]=r,e[7]=c,e[8]=m,e[9]=f):f=e[9],f}function Js(t){const e=E.c(5),{children:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Ee.sidebarOpen(),e[0]=o):o=e[0];const[i,l]=Me(o,!0);let n;return e[1]!==r||e[2]!==l||e[3]!==i?(n=s.jsx($t,{open:i,onOpenChange:l,children:r}),e[1]=r,e[2]=l,e[3]=i,e[4]=n):n=e[4],n}function Xs(t){const e=E.c(24),{isStudio:r,isHomeRoute:o,onCreateProject:i}=t,[l]=Oe();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ee.decoChatPanelWidth(),e[0]=n):n=e[0];const[a]=Me(n,30),[d]=_e(),c=r&&d.experimental_projects?"":void 0,m=`${a}cqi`;let f;e[1]!==m?(f={"--sidebar-width":"13.5rem","--sidebar-width-mobile":"11rem","--chat-panel-w":m},e[1]=m,e[2]=f):f=e[2];const u=f;let N;e[3]!==i?(N=s.jsx(Vs,{onCreateProject:i}),e[3]=i,e[4]=N):N=e[4];let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},e[5]=x):x=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h={overflow:"visible"},e[6]=h):h=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j={overflow:"visible"},e[7]=j):j=e[7];const k=l&&"rounded-tr-[0.75rem] border-r";let p;e[8]!==k?(p=B("flex flex-col flex-1 min-h-0 bg-card overflow-hidden","border-t border-l border-sidebar-border","rounded-tl-[0.75rem]","transition-[border-radius] duration-200 ease-[var(--ease-out-quart)]",k),e[8]=k,e[9]=p):p=e[9];let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(Fe,{})}),e[10]=b):b=e[10];let v;e[11]!==p?(v=s.jsx(et,{className:"min-w-0 flex flex-col",style:j,children:s.jsx("div",{className:p,children:b})}),e[11]=p,e[12]=v):v=e[12];let g;e[13]!==l||e[14]!==o?(g=!o&&s.jsxs(s.Fragment,{children:[s.jsx(ds,{className:"bg-sidebar"}),s.jsx(Zs,{className:B("transition-[max-width] duration-200 ease-[var(--ease-out-quart)] overflow-hidden",l?"max-w-[var(--chat-panel-w)] bg-sidebar":"max-w-0"),children:s.jsx("div",{className:"h-full min-w-[var(--chat-panel-w)] pl-1.5 pr-1.5 pb-1.5",children:s.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden border border-sidebar-border shadow-sm",children:s.jsx(fs,{})})})})]}),e[13]=l,e[14]=o,e[15]=g):g=e[15];let S;e[16]!==v||e[17]!==g?(S=s.jsx(zt,{className:"pt-1.5",style:x,children:s.jsxs(ms,{direction:"horizontal",className:"h-full",style:h,children:[v,g]})}),e[16]=v,e[17]=g,e[18]=S):S=e[18];let y;return e[19]!==S||e[20]!==c||e[21]!==u||e[22]!==N?(y=s.jsxs(It,{className:"flex-1 bg-sidebar","data-studio":c,style:u,children:[N,S]}),e[19]=S,e[20]=c,e[21]=u,e[22]=N,e[23]=y):y=e[23],y}function er(){const{org:t,project:e}=Pe({strict:!1}),r=Ce(),[o,i]=T.useState(!1),l=r.location.pathname===`/${t}/${e}`||r.location.pathname===`/${t}/${e}/`,n=e??K,{data:a}=yt({queryKey:Nt.activeOrganization(t),queryFn:async()=>{if(!t)return null;const{data:m}=await ae.organization.setActive({organizationSlug:t});return{org:m,project:{slug:n,isOrgAdmin:n===K}}},gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1});if(!a)return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"h-12 flex items-center justify-end px-4 border-b border-border",children:s.jsx("div",{className:"w-fit",children:s.jsx(at,{})})}),s.jsx(Fe,{})]});if(!a.org)return window.location.pathname!=="/"&&(window.location.href="/"),null;const d={...a,project:{...a.project,slug:n,isOrgAdmin:n===K}},c=n===K;return s.jsxs(vt,{...d,children:[s.jsx(Js,{children:s.jsx("div",{className:"flex flex-col h-screen overflow-hidden",children:s.jsx(X.Provider,{children:s.jsx(Xs,{isStudio:c,isHomeRoute:l,onCreateProject:()=>i(!0)})})})}),s.jsx(Ge,{open:o,onOpenChange:i})]})}function Ln(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Qs,{children:s.jsx(T.Suspense,{fallback:s.jsx(Ue,{}),children:s.jsx(er,{})})}),t[0]=e):e=t[0],e}export{Ln as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as r,j as l}from"./index-uOrjFt6t.js";import{u as c,L as i}from"./localstorage-keys-r_mW6Lq0.js";import{c as f}from"./button-D10odSSz.js";const m={devMode:!1,experimental_projects:!1,experimental_tasks:!1,toolApprovalLevel:"none",enableNotifications:typeof Notification<"u"};function x(){const t=r.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.preferences(),t[0]=e):e=t[0],c(e,p)}function p(t){return{...m,...t}}function S(t){const e=r.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=f("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx("div",{"data-slot":"skeleton",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}export{S,x as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as C,y as d,j as a}from"./index-uOrjFt6t.js";import{c as m}from"./button-D10odSSz.js";const u=d("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",special:"fill-special text-backround"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function h(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=m(u({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=a.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let s;e[5]!==t?(s=a.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=a.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{h as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as i,D as C,E as y,B as T,G as I,Q as M,T as H,M as z,c as A}from"./index-uOrjFt6t.js";import{c as g}from"./button-D10odSSz.js";var b="Switch",[U]=z(b),[q,D]=U(b),E=c.forwardRef((a,e)=>{const{__scopeSwitch:t,name:s,checked:r,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=a,[p,h]=c.useState(null),v=y(e,m=>h(m)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=T({prop:r,defaultProp:n??!1,onChange:k,caller:b});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:I(a.onClick,m=>{N(B=>!B),S&&(x.current=m.isPropagationStopped(),x.current||m.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:s,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=b;var P="SwitchThumb",R=c.forwardRef((a,e)=>{const{__scopeSwitch:t,...s}=a,r=D(P,t);return i.jsx(C.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...s,ref:e})});R.displayName=P;var L="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:a,control:e,checked:t,bubbles:s=!0,...r},n)=>{const o=c.useRef(null),d=y(o,n),u=M(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:s});h.call(l,t),l.dispatchEvent(v)}},[u,t,s]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...r,tabIndex:-1,ref:d,style:{...r.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=L;function j(a){return a?"checked":"unchecked"}var O=E,$=R;function Q(a){const e=A.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),e[3]=t,e[4]=r):r=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx($,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==s||e[7]!==r?(o=i.jsx(O,{"data-slot":"switch",className:r,...s,children:n}),e[6]=s,e[7]=r,e[8]=o):o=e[8],o}export{Q as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as r,j as c}from"./index-uOrjFt6t.js";import{c as i}from"./button-D10odSSz.js";function b(o){const e=r.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("div",{"data-slot":"table-container",className:"w-full min-w-0 bg-background",children:c.jsx("table",{"data-slot":"table",className:s,...l})}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function f(o){const e=r.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr]:border-b sticky top-0 z-10 bg-background",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("thead",{"data-slot":"table-header",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function p(o){const e=r.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("tbody",{"data-slot":"table-body",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function m(o){const e=r.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("tr",{"data-slot":"table-row",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function u(o){const e=r.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("th",{"data-slot":"table-head",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function x(o){const e=r.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=c.jsx("td",{"data-slot":"table-cell",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}export{u as T,f as a,m as b,x as c,p as d,b as e};
|