decocms 3.31.6 → 3.32.0
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-BKrVWRi_.js → AlertCircle-DAV0VdD_.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Cs41tgmO.js → ArrowUpRight-DEOKOSBd.js} +1 -1
- package/dist/client/assets/{Check-_jrJoobZ.js → Check-ClIa17j0.js} +1 -1
- package/dist/client/assets/{CheckCircle-DpZ8gxX3.js → CheckCircle-B7SCOPQ0.js} +1 -1
- package/dist/client/assets/{ChevronDown-DuZw_4bA.js → ChevronDown-DcOlk72I.js} +1 -1
- package/dist/client/assets/{ChevronLeft-D8le3bse.js → ChevronLeft-CxqwkoN-.js} +1 -1
- package/dist/client/assets/{ChevronRight-BVQfgYe8.js → ChevronRight-DFG09LEe.js} +1 -1
- package/dist/client/assets/{ChevronUp-UmgkNnpT.js → ChevronUp-BUzePKUo.js} +1 -1
- package/dist/client/assets/{Container-ocMhpfg8.js → Container-Dl6JrGmY.js} +1 -1
- package/dist/client/assets/{DotsVertical-C9V6bPki.js → DotsVertical-bJa4a1zt.js} +1 -1
- package/dist/client/assets/{Eye-C3fH6hv3.js → Eye-pjtF8UNz.js} +1 -1
- package/dist/client/assets/{FilterLines-BZWeJJ-C.js → FilterLines-BGhu0YVn.js} +1 -1
- package/dist/client/assets/{Globe01-7Z-J00sV.js → Globe01-8bu4SIYa.js} +1 -1
- package/dist/client/assets/{HardDrive-sx0AK3SO.js → HardDrive-CDtaoiCt.js} +1 -1
- package/dist/client/assets/{Key01-Cu_XzqUu.js → Key01-Bk8xH73U.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BMpnotb_.js → LayoutLeft-BiGQffB4.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C_AovQs-.js → LinkExternal01-CpFd7tXn.js} +1 -1
- package/dist/client/assets/{Monitor01-DbTRnsTd.js → Monitor01-B-I27REk.js} +1 -1
- package/dist/client/assets/{Palette-D2TWlK2I.js → Palette-DK2sVT7m.js} +1 -1
- package/dist/client/assets/{Play-DnfTKZT9.js → Play-BwAcOs4w.js} +1 -1
- package/dist/client/assets/{Plus-feLyH0Mp.js → Plus-BnwG6MJP.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CSQneTJA.js → RefreshCcw01-T0T8zVj0.js} +1 -1
- package/dist/client/assets/{SearchMd-JHjczKfV.js → SearchMd-DuTVINbp.js} +1 -1
- package/dist/client/assets/{Settings02-CcMIO7b-.js → Settings02-BQbLvp5G.js} +1 -1
- package/dist/client/assets/{Shield01-CSVIt2bv.js → Shield01-ClirY5c-.js} +1 -1
- package/dist/client/assets/{Star01-DiB8lhA8.js → Star01-Cf3cR-_x.js} +1 -1
- package/dist/client/assets/{Stars01-CHUAJiuF.js → Stars01-D2sTkx04.js} +1 -1
- package/dist/client/assets/{Stars02-q2z0o3k0.js → Stars02-D3fTbcnU.js} +1 -1
- package/dist/client/assets/{Sun-DsAeZvJd.js → Sun-CvyvBO1g.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Dl9XdrMi.js → SwitchHorizontal01-Dwx0lgMF.js} +1 -1
- package/dist/client/assets/{Tool01-BcDxUYLf.js → Tool01-DyFrjTUh.js} +1 -1
- package/dist/client/assets/{Trash01-CT3XJ1Uh.js → Trash01-BQ1nC-zv.js} +1 -1
- package/dist/client/assets/{Upload01-Drau3Bzl.js → Upload01-tQiDFvpO.js} +1 -1
- package/dist/client/assets/{User01-K4a5BHBB.js → User01-CFJi0zLk.js} +1 -1
- package/dist/client/assets/{Users01-ChSEbZ3e.js → Users01-CCPx6uaK.js} +1 -1
- package/dist/client/assets/{Users03-O-O_DaoB.js → Users03-CYOSLpev.js} +1 -1
- package/dist/client/assets/{X-CZkmbhDd.js → X-O_18GBbz.js} +1 -1
- package/dist/client/assets/{XCircle-BlUvUKr4.js → XCircle-COx0scnd.js} +1 -1
- package/dist/client/assets/{XClose-Dj-Bpk8Q.js → XClose-BuvY_ty6.js} +1 -1
- package/dist/client/assets/{Zap-CH2t0knG.js → Zap-Bu7nPvMM.js} +1 -1
- package/dist/client/assets/{ZapSquare-CuzMVb_d.js → ZapSquare-Cs3vJ5qy.js} +1 -1
- package/dist/client/assets/{ZoomOut-Ce855rrm.js → ZoomOut-D3dpdTm8.js} +1 -1
- package/dist/client/assets/{access-gate-DpDV-s7-.js → access-gate-BPUPgBJG.js} +1 -1
- package/dist/client/assets/{accordion-DCYXb9q_.js → accordion-Unl3HPSh.js} +1 -1
- package/dist/client/assets/{add-section-modal-I5siPL27.js → add-section-modal-C-P9HKvD.js} +1 -1
- package/dist/client/assets/{agent-capabilities-C8lkWuYF.js → agent-capabilities-DZXe8nda.js} +1 -1
- package/dist/client/assets/{agent-icon-RRGTKit7.js → agent-icon-PPKWRb0x.js} +1 -1
- package/dist/client/assets/{agent-icons-B9jco32j.js → agent-icons-D5cvN_16.js} +1 -1
- package/dist/client/assets/{agents-list-qgOChDnR.js → agents-list-DB8ULALp.js} +1 -1
- package/dist/client/assets/{ai-providers-Bom23p5t.js → ai-providers-L0fWNbk-.js} +1 -1
- package/dist/client/assets/{alert-BZDQN-HX.js → alert-DwB_hex1.js} +1 -1
- package/dist/client/assets/{alert-dialog-BEGH3aSs.js → alert-dialog-B62p6NY3.js} +1 -1
- package/dist/client/assets/app-editor-DhmA0Qg4.js +1 -0
- package/dist/client/assets/{auth-catchall-DOy-9y_h.js → auth-catchall-y9d1WTIF.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Dk-J3NCC.js → auth-split-layout-D_HnFIOe.js} +1 -1
- package/dist/client/assets/{automation-list-row-CO9dzBs7.js → automation-list-row-Bsy7udbR.js} +1 -1
- package/dist/client/assets/{automation-runs-CttDT0tF.js → automation-runs-DAMuVRpz.js} +1 -1
- package/dist/client/assets/{automations-B1SLUYS3.js → automations-BwICAkNT.js} +1 -1
- package/dist/client/assets/{avatar-DJjsnLZ8.js → avatar-KrgvwmIy.js} +1 -1
- package/dist/client/assets/{badge-paokYscD.js → badge-IOoDOD2d.js} +1 -1
- package/dist/client/assets/{brand-context-Cq8R0PWG.js → brand-context-D1c50aQU.js} +1 -1
- package/dist/client/assets/{buckets-CO6_JmT4.js → buckets-DpI3rsCJ.js} +1 -1
- package/dist/client/assets/{calendar-CshHe2-E.js → calendar-ViRa_cLY.js} +1 -1
- package/dist/client/assets/{capability-load-error-BzZPpBKU.js → capability-load-error-COBJ9SIa.js} +1 -1
- package/dist/client/assets/{card-RD-w7ItO.js → card-wWKMvRKZ.js} +1 -1
- package/dist/client/assets/{chat-context-DVvnFbpg.js → chat-context-BB-zuuiO.js} +1 -1
- package/dist/client/assets/{checkbox-D7gUXZzi.js → checkbox-B-wIlb8X.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CgvJa9yC.js → cli-auth-success-DjoLZu-H.js} +1 -1
- package/dist/client/assets/{collection-detail-BeMXTw_d.js → collection-detail-ricjB52-.js} +1 -1
- package/dist/client/assets/{collection-display-button-CkUbue5a.js → collection-display-button-DfsK9Bs8.js} +1 -1
- package/dist/client/assets/{collection-search-C0EaLZS4.js → collection-search-Dr2f5A66.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-klHkSAlu.js → collection-table-wrapper-C8dEwS2E.js} +1 -1
- package/dist/client/assets/{collection-tabs-DyhBqC-8.js → collection-tabs-MLl5cDDp.js} +1 -1
- package/dist/client/assets/{collections-Dmpjz68A.js → collections-BPfUwJ0B.js} +1 -1
- package/dist/client/assets/{command-CG-I4yfb.js → command-DER0zJyP.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DxYK9LZc.js → connect-desktop-dialog-CghGsZ-I.js} +1 -1
- package/dist/client/assets/{connection-card-DUbIhN9w.js → connection-card-BnPIzRCc.js} +1 -1
- package/dist/client/assets/{connection-detail-BZb9y9S1.js → connection-detail-DkeCmXDv.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DkCIXGb_.js → connection-form-helpers-BIpr_H-z.js} +1 -1
- package/dist/client/assets/{connections-CgxoDDVV.js → connections-BtNF9VJm.js} +1 -1
- package/dist/client/assets/decopilot-sse-pool-CcgwKmA0.js +1 -0
- package/dist/client/assets/{dialog-BUrBoXCN.js → dialog-DzRPb7hw.js} +1 -1
- package/dist/client/assets/{domain-settings-H8atHBE7.js → domain-settings-BLSSHvf3.js} +1 -1
- package/dist/client/assets/{drawer-DCgkPIoM.js → drawer-BkBq4o2v.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Dj3MDDMZ.js → dropdown-menu-Gz8gJsHK.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Cogdc016.js → dynamic-plugin-layout-DXhvrZf3.js} +1 -1
- package/dist/client/assets/{empty-state-BV65O9fn.js → empty-state-D0W0P9GD.js} +1 -1
- package/dist/client/assets/{empty-state-q7rCmySJ.js → empty-state-RPIUAaRd.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DrQCAq1Q.js → extract-connection-data-DDbQkulT.js} +1 -1
- package/dist/client/assets/{features-BLisStRG.js → features-CZ_ObMrU.js} +1 -1
- package/dist/client/assets/{file-explorer-CY92hQVy.js → file-explorer-wWNUqDJX.js} +1 -1
- package/dist/client/assets/{file-type-icon-gSk0CcLc.js → file-type-icon-DInQXRMd.js} +1 -1
- package/dist/client/assets/{files-BQCZBFRW.js → files-BdAyXmXe.js} +1 -1
- package/dist/client/assets/{form-CmIsHFjh.js → form-B7soB8jC.js} +1 -1
- package/dist/client/assets/{general-D4DHnhgL.js → general-BRAACYyp.js} +1 -1
- package/dist/client/assets/{generate-id-DKL4ZRFQ.js → generate-id-CLrPTxed.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DIGxiXIp.js → github-repo-picker-EEGLQxwe.js} +1 -1
- package/dist/client/assets/{header-tab-button-CRg095Ax.js → header-tab-button-CXc-7W-y.js} +1 -1
- package/dist/client/assets/{hover-card-Yr1dbPyS.js → hover-card-C_jcdWqK.js} +1 -1
- package/dist/client/assets/{image-field-2jbuBJet.js → image-field-CELR1Q7c.js} +1 -1
- package/dist/client/assets/{index-D7WzqOrL.js → index-BHkjFI68.js} +1 -1
- package/dist/client/assets/{index-CJ1RZoo0.js → index-BQsP7Vxx.js} +1 -1
- package/dist/client/assets/{index-BklC8DRD.js → index-BRYHW7O-.js} +1 -1
- package/dist/client/assets/{index-ZSNHaanV.js → index-BV4MVxYw.js} +1 -1
- package/dist/client/assets/{index-Bw4OVEpz.js → index-BpAwVigu.js} +1 -1
- package/dist/client/assets/{index-DHlINf31.js → index-Bt1WgamZ.js} +1 -1
- package/dist/client/assets/{index-DbyFiYMM.js → index-BtcINkTm.js} +3 -3
- package/dist/client/assets/{index-BCq3NjWQ.js → index-Bwm3y5gI.js} +1 -1
- package/dist/client/assets/{index-jP7JfGa5.js → index-C9Bg4j43.js} +6 -6
- package/dist/client/assets/{index-Cd5LKuaM.js → index-DM_BD3PV.js} +1 -1
- package/dist/client/assets/{index-DTy0am7R.js → index-DQxsgmSZ.js} +1 -1
- package/dist/client/assets/{index-LbwjjPYV.js → index-DzaeL4V_.js} +1 -1
- package/dist/client/assets/{index-rdndveF4.js → index-F3-A2fnf.js} +1 -1
- package/dist/client/assets/{index-CZbT4ubv.js → index-WZtuW1yT.js} +1 -1
- package/dist/client/assets/{index-redirect-Cg2GxF3Q.js → index-redirect-7WJuoWt3.js} +1 -1
- package/dist/client/assets/{index-D4ozjp1y.js → index-vXImmMbm.js} +1 -1
- package/dist/client/assets/{input-DtSwmTPJ.js → input-BmQ7mzb-.js} +1 -1
- package/dist/client/assets/{integration-icon-D-0Pqfkg.js → integration-icon-CLYC_fiQ.js} +1 -1
- package/dist/client/assets/{label-C08RvJXa.js → label-BOhFc9vG.js} +1 -1
- package/dist/client/assets/{layout-ZZ4fo7Mc.js → layout-UN6X-0n8.js} +1 -1
- package/dist/client/assets/{login-YrW2YB7W.js → login-CLQY1RTP.js} +1 -1
- package/dist/client/assets/{members-1wKbJFKy.js → members-Dr3iJB0d.js} +1 -1
- package/dist/client/assets/{monaco-editor-mR1ddEVj.js → monaco-editor-BfV-qp-L.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-JKex1sDu.js → monitoring-stats-row-zdevYKWj.js} +1 -1
- package/dist/client/assets/{oauth-callback-6CvsGTp0.js → oauth-callback-BzfZ9IBz.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BDwg8dzI.js → oauth-callback-ai-provider-D5QydDmU.js} +1 -1
- package/dist/client/assets/{onboarding-DtHIGhkV.js → onboarding-Cv4NHTRO.js} +1 -1
- package/dist/client/assets/{org-install-Cqp_jJsu.js → org-install-DOs2P6vc.js} +1 -1
- package/dist/client/assets/{org-layout-BwFkXIiZ.js → org-layout-ClaaaTH8.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-BQwU8bMz.js → org-plugin-layout-89k6jNUJ.js} +1 -1
- package/dist/client/assets/{page-seo-form-B0YkU_9m.js → page-seo-form-BHhmKIKz.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DXm8ERlu.js +1 -0
- package/dist/client/assets/{pair-7kbHLtzg.js → pair-BjemMx0o.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CxYF_BKR.js → plugin-empty-state-Cw8xH80Y.js} +1 -1
- package/dist/client/assets/{plugin-header-BODaZvQt.js → plugin-header-BwRG2vvr.js} +1 -1
- package/dist/client/assets/{plugin-layout-CTs2O8tA.js → plugin-layout-Md1GF8Ot.js} +1 -1
- package/dist/client/assets/{popover-CwHcYzFS.js → popover-BH5G0jiV.js} +1 -1
- package/dist/client/assets/{post-editor-BP3ulHBp.js → post-editor-B9MuRoYe.js} +1 -1
- package/dist/client/assets/{primitives-DCBp13mf.js → primitives-CYWK7LII.js} +1 -1
- package/dist/client/assets/{profile-CYGWDyOx.js → profile-Bcgn0loZ.js} +1 -1
- package/dist/client/assets/project-app-view-BYOtDSR_.js +1 -0
- package/dist/client/assets/record-editor-DvPGx3aC.js +1 -0
- package/dist/client/assets/{registry-layout-D4qLoXtF.js → registry-layout-BBFU9boO.js} +1 -1
- package/dist/client/assets/registry-ro4RyTgi.js +2 -0
- package/dist/client/assets/{require-capability-h0AQqiHs.js → require-capability-D3V29zD7.js} +1 -1
- package/dist/client/assets/{required-auth-layout-yPYkXxXO.js → required-auth-layout-ItD57512.js} +1 -1
- package/dist/client/assets/{reset-password-CtDb-5N0.js → reset-password-Da1xAr72.js} +1 -1
- package/dist/client/assets/{resizable-CPQoc3Sn.js → resizable-DCnylz56.js} +1 -1
- package/dist/client/assets/{roles-CqJRhAIB.js → roles-CpXFgPqN.js} +1 -1
- package/dist/client/assets/save-referenced-block-H-RQkqHK.js +1 -0
- package/dist/client/assets/{save-status-BnR1ommC.js → save-status-CjFc8dcc.js} +1 -1
- package/dist/client/assets/{schema-form-CO_B-efV.js → schema-form-nyJ0R2w6.js} +1 -1
- package/dist/client/assets/{scroll-area-CHIBU-0u.js → scroll-area-m4NsTPSx.js} +1 -1
- package/dist/client/assets/{search-input-CnI7Q0Ja.js → search-input-CXhVJuuP.js} +1 -1
- package/dist/client/assets/{secrets-CM3sioi8.js → secrets-DTjefpww.js} +1 -1
- package/dist/client/assets/sections-editor-CYh5bidG.js +2 -0
- package/dist/client/assets/{select-BiXHIjHj.js → select-Dx5F3uHo.js} +1 -1
- package/dist/client/assets/{select-model-Cucq0DZL.js → select-model-BEmU7OgJ.js} +1 -1
- package/dist/client/assets/{seo-editor-DoMvx09c.js → seo-editor-BG_rzCv2.js} +1 -1
- package/dist/client/assets/{settings-layout-DhpebzVO.js → settings-layout-CKLJSJQG.js} +1 -1
- package/dist/client/assets/{settings-section-B5LcEn4_.js → settings-section-Dl4MTBRK.js} +1 -1
- package/dist/client/assets/{sheet-CvXLdiAP.js → sheet-WX1SRekV.js} +1 -1
- package/dist/client/assets/{shell-controls-C8gFQl13.js → shell-controls-z4iBAyRQ.js} +1 -1
- package/dist/client/assets/{shell-layout-DzTsWG8D.js → shell-layout-CAxH797a.js} +1 -1
- package/dist/client/assets/{shell-route-loading-9eNu0yVM.js → shell-route-loading-xQM5_J5V.js} +1 -1
- package/dist/client/assets/{sidebar-BOx1Juuc.js → sidebar-D3j0Ekh6.js} +1 -1
- package/dist/client/assets/{skeleton-BXz-8EJO.js → skeleton-DOxdtDYk.js} +1 -1
- package/dist/client/assets/{sortable.esm-im7McAoS.js → sortable.esm-DeoIpllX.js} +1 -1
- package/dist/client/assets/{spinner-CXXwbat3.js → spinner-DXpgHD1C.js} +1 -1
- package/dist/client/assets/{sso-BWkAIKSk.js → sso-i6ejpf6z.js} +1 -1
- package/dist/client/assets/{store-CTuLUgXQ.js → store-BZLG7BLu.js} +1 -1
- package/dist/client/assets/store-registry-DoLrNAJx.js +2 -0
- package/dist/client/assets/{studio-tools-Du5vJtwE.js → studio-tools-TxENKH8b.js} +1 -1
- package/dist/client/assets/{switch-Di9MyZKS.js → switch-C7oZ8aiH.js} +1 -1
- package/dist/client/assets/{tab-id-C8jy5J4y.js → tab-id-CKMT5NAW.js} +1 -1
- package/dist/client/assets/{table-44DBEP3g.js → table-DkrhBQg4.js} +1 -1
- package/dist/client/assets/{tabs-Bk2wrs4a.js → tabs-SgyHizjR.js} +1 -1
- package/dist/client/assets/{task-status-Ys2F9ON3.js → task-status-CvNvYsGc.js} +1 -1
- package/dist/client/assets/{textarea-BSJHTxdE.js → textarea-DsNDFPec.js} +1 -1
- package/dist/client/assets/{toggle-group-DCS_XWaE.js → toggle-group-C4KUfAuk.js} +1 -1
- package/dist/client/assets/{toolbar-B24AWKsd.js → toolbar-DzwLvPq6.js} +1 -1
- package/dist/client/assets/{tools-list-Ddjskdbm.js → tools-list-CcppNN0Y.js} +1 -1
- package/dist/client/assets/{tooltip-C7-bm38e.js → tooltip-tzy8U_iQ.js} +1 -1
- package/dist/client/assets/{types-nT_sN6ZP.js → types-CsZ3CP5f.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DqUzS21L.js → use-ai-providers-CB9vio0p.js} +1 -1
- package/dist/client/assets/{use-automations-DITRIs_z.js → use-automations-ELFKdIAo.js} +1 -1
- package/dist/client/assets/{use-capability-t45tlxss.js → use-capability-BjULA9g0.js} +1 -1
- package/dist/client/assets/{use-clock-tick-irPF7LyA.js → use-clock-tick-B7WF9o4S.js} +1 -1
- package/dist/client/assets/{use-collections-BdbcXRKO.js → use-collections-XRQSv1Qe.js} +1 -1
- package/dist/client/assets/{use-connection-Bz76T27j.js → use-connection-DeHXMOiI.js} +1 -1
- package/dist/client/assets/{use-copy-CxMD5IOt.js → use-copy-0Tyw7M5N.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CHQo1hat.js → use-create-virtual-mcp-CsvR5Zho.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D7xrpEjy.js → use-debounced-autosave-DPer90Fe.js} +1 -1
- package/dist/client/assets/{use-delete-connection-kVngL2cR.js → use-delete-connection-C2WHNeDG.js} +1 -1
- package/dist/client/assets/{use-file-configs--iLyfxDV.js → use-file-configs-Cl8DYiJo.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BuZXNddy.js → use-infinite-scroll-DNsSee5z.js} +1 -1
- package/dist/client/assets/{use-list-state-BOok686l.js → use-list-state-BtSEqURG.js} +1 -1
- package/dist/client/assets/{use-mcp-client-h23DeI2f.js → use-mcp-client-S74GyiM7.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Ch1EAaF9.js → use-mcp-prompts-Dc8jleBK.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DOI8Xutq.js → use-mcp-tools-BS1B0wUZ.js} +1 -1
- package/dist/client/assets/{use-members-DwhrSoam.js → use-members-4JnAFwog.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BdPyJs7s.js → use-navigate-to-agent-CKFe2J_p.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DpwKZh8Z.js → use-org-auth-client-DY3OKqMz.js} +1 -1
- package/dist/client/assets/{use-org-sso-C9F-3-pP.js → use-org-sso-BIsSirOq.js} +1 -1
- package/dist/client/assets/{use-organization-roles-B2ZkdMhr.js → use-organization-roles-CfjMxwLC.js} +1 -1
- package/dist/client/assets/{use-organization-settings-qDi2TPLQ.js → use-organization-settings-DWZNyi7l.js} +1 -1
- package/dist/client/assets/{use-registry-connections-0SlI3CBQ.js → use-registry-connections-DNx2UuYR.js} +1 -1
- package/dist/client/assets/{use-secrets-BEmaIm7j.js → use-secrets-nPYkV_vv.js} +1 -1
- package/dist/client/assets/{use-status-sounds-B_AEuwHn.js → use-status-sounds-CK6mW4TS.js} +1 -1
- package/dist/client/assets/{use-view-mode-DMKZdcyO.js → use-view-mode-BJ10aE-1.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-B4n2L3Js.js → use-virtual-mcp-ynBH8hOp.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BtPT1URZ.js +1 -0
- package/dist/client/assets/{useRouterState-B2fe7gG7.js → useRouterState-D4hr3MwK.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DCeuFJSM.js +1 -0
- package/dist/client/assets/{user-BBqTJ5uY.js → user-D2lmEMCa.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-LAht3hLg.js → view-mode-toggle-DbLskHlb.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-Bco9QuD0.js → watch-sse-pool-WRJiuO-V.js} +1 -1
- package/dist/client/assets/{workflow-CjZXW11D.js → workflow-B-GcsagV.js} +1 -1
- package/dist/client/assets/workflow-detail-BcCiFshN.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/app-editor-CkYxDWfB.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-Dw26NwzB.js +0 -1
- package/dist/client/assets/page-seo-sheet-DM7cg95T.js +0 -1
- package/dist/client/assets/project-app-view-D5BY9t2w.js +0 -1
- package/dist/client/assets/record-editor-aFAnGOVT.js +0 -1
- package/dist/client/assets/registry-4rB72frg.js +0 -2
- package/dist/client/assets/save-referenced-block-DwYrMvtR.js +0 -1
- package/dist/client/assets/sections-editor-DsCgb-6C.js +0 -2
- package/dist/client/assets/store-registry-Bfx8Lz3t.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Y9ZRWqPn.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Dsg9xb8N.js +0 -1
- package/dist/client/assets/workflow-detail-CHwZpD3f.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as C,j as r}from"./index-BtcINkTm.js";import{I as F}from"./input-BmQ7mzb-.js";import{L as T}from"./label-BOhFc9vG.js";import{T as L}from"./textarea-DsNDFPec.js";import{I as A}from"./image-field-CELR1Q7c.js";import{ae as R,af as D,ah as J}from"./index-C9Bg4j43.js";import{u as K,s as S}from"./primitives-CYWK7LII.js";import{S as M}from"./save-status-CjFc8dcc.js";import"./Tool01-DyFrjTUh.js";import"./Trash01-BQ1nC-zv.js";import"./Upload01-tQiDFvpO.js";import"./AlertCircle-DAV0VdD_.js";import"./Check-ClIa17j0.js";import"./Eye-pjtF8UNz.js";import"./DotsVertical-bJa4a1zt.js";import"./agent-icon-PPKWRb0x.js";import"./SwitchHorizontal01-Dwx0lgMF.js";import"./RefreshCcw01-T0T8zVj0.js";import"./XCircle-COx0scnd.js";import"./ArrowUpRight-DEOKOSBd.js";import"./ZapSquare-Cs3vJ5qy.js";import"./Users03-CYOSLpev.js";import"./CheckCircle-B7SCOPQ0.js";import"./ChevronDown-DcOlk72I.js";import"./ChevronLeft-CxqwkoN-.js";import"./ChevronRight-DFG09LEe.js";import"./ChevronUp-BUzePKUo.js";import"./Container-Dl6JrGmY.js";import"./ZoomOut-D3dpdTm8.js";import"./Globe01-8bu4SIYa.js";import"./FilterLines-BGhu0YVn.js";import"./Star01-Cf3cR-_x.js";import"./Palette-DK2sVT7m.js";import"./HardDrive-CDtaoiCt.js";import"./Stars02-D3fTbcnU.js";import"./Key01-Bk8xH73U.js";import"./LayoutLeft-BiGQffB4.js";import"./LinkExternal01-CpFd7tXn.js";import"./Monitor01-B-I27REk.js";import"./Sun-CvyvBO1g.js";import"./Play-BwAcOs4w.js";import"./Plus-BnwG6MJP.js";import"./SearchMd-DuTVINbp.js";import"./Settings02-BQbLvp5G.js";import"./Shield01-ClirY5c-.js";import"./Stars01-D2sTkx04.js";import"./User01-CFJi0zLk.js";import"./Users01-CCPx6uaK.js";import"./XClose-BuvY_ty6.js";import"./X-O_18GBbz.js";import"./Zap-Bu7nPvMM.js";import"./dialog-DzRPb7hw.js";import"./dropdown-menu-Gz8gJsHK.js";import"./skeleton-DOxdtDYk.js";import"./tabs-SgyHizjR.js";import"./use-file-configs-Cl8DYiJo.js";import"./studio-tools-TxENKH8b.js";import"./useInfiniteQuery-BtPT1URZ.js";import"./use-infinite-scroll-DNsSee5z.js";import"./agent-capabilities-DZXe8nda.js";import"./chat-context-BB-zuuiO.js";import"./tab-id-CKMT5NAW.js";import"./use-mcp-client-S74GyiM7.js";import"./watch-sse-pool-WRJiuO-V.js";import"./decopilot-sse-pool-CcgwKmA0.js";import"./use-virtual-mcp-ynBH8hOp.js";import"./use-collections-XRQSv1Qe.js";import"./use-ai-providers-CB9vio0p.js";import"./use-organization-settings-DWZNyi7l.js";import"./pair-BjemMx0o.js";import"./use-clock-tick-B7WF9o4S.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./scroll-area-m4NsTPSx.js";import"./select-Dx5F3uHo.js";import"./tooltip-tzy8U_iQ.js";import"./use-copy-0Tyw7M5N.js";import"./file-type-icon-DInQXRMd.js";import"./content-blocks-o63cs2vh.js";import"./types-CsZ3CP5f.js";import"./shell-layout-CAxH797a.js";import"./avatar-KrgvwmIy.js";import"./required-auth-layout-ItD57512.js";import"./useRouterState-D4hr3MwK.js";import"./use-org-sso-BIsSirOq.js";import"./integration-icon-CLYC_fiQ.js";import"./use-navigate-to-agent-CKFe2J_p.js";import"./use-connection-DeHXMOiI.js";import"./use-mcp-prompts-Dc8jleBK.js";import"./form-B7soB8jC.js";import"./spinner-DXpgHD1C.js";import"./drawer-BkBq4o2v.js";import"./collection-search-Dr2f5A66.js";import"./toggle-group-C4KUfAuk.js";import"./connect-desktop-dialog-CghGsZ-I.js";import"./agent-icons-D5cvN_16.js";import"./checkbox-B-wIlb8X.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Dl4MTBRK.js";import"./card-wWKMvRKZ.js";import"./popover-BH5G0jiV.js";import"./command-DER0zJyP.js";import"./index-Bt1WgamZ.js";import"./sortable.esm-DeoIpllX.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BnPIzRCc.js";import"./use-registry-connections-DNx2UuYR.js";import"./extract-connection-data-DDbQkulT.js";import"./generate-id-CLrPTxed.js";import"./collections-BPfUwJ0B.js";import"./collection-tabs-MLl5cDDp.js";import"./badge-IOoDOD2d.js";import"./connection-form-helpers-BIpr_H-z.js";import"./useSuspenseInfiniteQuery-DCeuFJSM.js";import"./index-WZtuW1yT.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-xQM5_J5V.js";import"./sidebar-D3j0Ekh6.js";import"./sheet-WX1SRekV.js";import"./toolbar-DzwLvPq6.js";import"./use-create-virtual-mcp-CsvR5Zho.js";import"./github-repo-picker-EEGLQxwe.js";import"./use-mcp-tools-BS1B0wUZ.js";import"./alert-dialog-B62p6NY3.js";import"./index-DzaeL4V_.js";import"./use-org-auth-client-DY3OKqMz.js";import"./hover-card-C_jcdWqK.js";import"./task-status-CvNvYsGc.js";import"./use-status-sounds-CK6mW4TS.js";import"./empty-state-D0W0P9GD.js";import"./resizable-DCnylz56.js";import"./use-capability-BjULA9g0.js";import"./header-tab-button-CXc-7W-y.js";import"./index-vXImmMbm.js";import"./user-D2lmEMCa.js";import"./tools-list-CcppNN0Y.js";import"./switch-C7oZ8aiH.js";import"./use-debounced-autosave-DPer90Fe.js";import"./index-DQxsgmSZ.js";import"./search-input-CXhVJuuP.js";import"./use-secrets-nPYkV_vv.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-Unl3HPSh.js";import"./view-mode-toggle-DbLskHlb.js";import"./select-model-BEmU7OgJ.js";import"./use-automations-ELFKdIAo.js";import"./monaco-editor-BfV-qp-L.js";import"./automation-runs-DAMuVRpz.js";import"./table-DkrhBQg4.js";import"./use-members-4JnAFwog.js";import"./automation-list-row-Bsy7udbR.js";const $={authors:[{key:"name",label:"Name",widget:"text"},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}],categories:[{key:"name",label:"Name",widget:"text"},{key:"slug",label:"Slug",widget:"text",placeholder:"my-category"}]},q={authors:"Author",categories:"Category"};function Fr(P){const t=C.c(34),{orgSlug:v,virtualMcpId:j,branch:f,kind:p,blockKey:y,block:w}=P;let u;t[0]!==f||t[1]!==v||t[2]!==j?(u={orgSlug:v,virtualMcpId:j,branch:f},t[0]=f,t[1]=v,t[2]=j,t[3]=u):u=t[3];const m=R(u);let d;t[4]!==w||t[5]!==p?(d=D(w,p),t[4]=w,t[5]=p,t[6]=d):d=t[6];const B=d;let h;t[7]!==y||t[8]!==p||t[9]!==m?(h=e=>{m.mutate({blockKey:y,data:J(y,p,e)})},t[7]=y,t[8]=p,t[9]=m,t[10]=h):h=t[10];const[i,E]=K(B,h);let k;t[11]!==i||t[12]!==E?(k=(e,o)=>E({...i,[e]:o}),t[11]=i,t[12]=E,t[13]=k):k=t[13];const a=k,N=q[p];let s;t[14]!==N?(s=r.jsx("span",{className:"text-sm font-medium",children:N}),t[14]=N,t[15]=s):s=t[15];let l;t[16]!==m.isError||t[17]!==m.isPending?(l=r.jsx(M,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=l):l=t[18];let n;t[19]!==s||t[20]!==l?(n=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[s,l]}),t[19]=s,t[20]=l,t[21]=n):n=t[21];const I=$[p];let c;if(t[22]!==i||t[23]!==a||t[24]!==I){let e;t[26]!==i||t[27]!==a?(e=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(A,{schema:{type:"string",format:"image-uri",title:o.label},value:i[o.key],onChange:x=>a(o.key,x),path:o.key,label:o.label}):r.jsxs(r.Fragment,{children:[r.jsx(T,{htmlFor:o.key,children:o.label}),o.widget==="textarea"?r.jsx(L,{id:o.key,value:S(i[o.key]),onChange:x=>a(o.key,x.target.value),rows:3}):r.jsx(F,{id:o.key,value:S(i[o.key]),placeholder:o.placeholder,onChange:x=>a(o.key,x.target.value),className:"h-10"})]})},o.key),t[26]=i,t[27]=a,t[28]=e):e=t[28],c=I.map(e),t[22]=i,t[23]=a,t[24]=I,t[25]=c}else c=t[25];let g;t[29]!==c?(g=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:c})}),t[29]=c,t[30]=g):g=t[30];let b;return t[31]!==g||t[32]!==n?(b=r.jsxs("div",{className:"flex h-full flex-col",children:[n,g]}),t[31]=g,t[32]=n,t[33]=b):b=t[33],b}export{Fr as RecordEditor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as Y,q as xe,n as Pe,G as _e,a as fe,o as V,r as M,j as t,B as G,l as Le,c as Z,M as Bs,J as Qs,bl as Vs,bm as Gs}from"./index-
|
|
1
|
+
import{e as Y,q as xe,n as Pe,G as _e,a as fe,o as V,r as M,j as t,B as G,l as Le,c as Z,M as Bs,J as Qs,bl as Vs,bm as Gs}from"./index-BtcINkTm.js";import{c as Zt,b as Ks,d as us,a as Ys,i as Hs,t as Ws,f as Js,e as Zs}from"./XCircle-COx0scnd.js";import{i as Fe}from"./CheckCircle-B7SCOPQ0.js";import{n as Xs}from"./Container-Dl6JrGmY.js";import{a as er}from"./Settings02-BQbLvp5G.js";import{a as ke,u as Ce,W as tr}from"./use-mcp-client-S74GyiM7.js";import{u as ms}from"./useInfiniteQuery-BtPT1URZ.js";import{u as Se}from"./studio-tools-TxENKH8b.js";import{B as F}from"./badge-IOoDOD2d.js";import{I as le}from"./input-BmQ7mzb-.js";import{a as ut,c as we,D as mt,b as xt,j as Xt,k as es,g as sr}from"./dropdown-menu-Gz8gJsHK.js";import{c as Dt,d as Et,a as Be,e as oe,b as At,T as ce}from"./table-DkrhBQg4.js";import{T as rr,a as ts}from"./toggle-group-C4KUfAuk.js";import{u as nr}from"./use-view-mode-BJ10aE-1.js";import{i as $t}from"./DotsVertical-bJa4a1zt.js";import{i as ir}from"./FilterLines-BGhu0YVn.js";import{n as lr,i as xs}from"./Globe01-8bu4SIYa.js";import{i as ar}from"./SearchMd-DuTVINbp.js";import{b as ht,c as pt,e as ft,d as gt,a as jt,D as vt}from"./dialog-DzRPb7hw.js";import{i as Ye}from"./AlertCircle-DAV0VdD_.js";import{i as ss}from"./Upload01-tQiDFvpO.js";import{c as He,b as We,d as Je,f as Ze,g as Xe,e as et,a as tt,A as st}from"./alert-dialog-B62p6NY3.js";import{C as ne}from"./card-wWKMvRKZ.js";import{s as rt}from"./Trash01-BQ1nC-zv.js";import{L as X}from"./label-BOhFc9vG.js";import{d as or,S as cr,a as dr,b as ur,c as Rt}from"./select-Dx5F3uHo.js";import{S as Ue}from"./switch-C7oZ8aiH.js";import{T as bt}from"./textarea-DsNDFPec.js";import{s as Ot,b as mr,i as xr,a as hr}from"./RefreshCcw01-T0T8zVj0.js";import{i as pr}from"./X-O_18GBbz.js";import{t as fr}from"./ChevronDown-DcOlk72I.js";import{n as gr}from"./ChevronUp-BUzePKUo.js";import{C as rs}from"./checkbox-B-wIlb8X.js";import{s as hs,a as Tt}from"./Eye-pjtF8UNz.js";import{n as jr}from"./LinkExternal01-CpFd7tXn.js";import{u as vr}from"./use-infinite-scroll-DNsSee5z.js";import{u as It}from"./use-copy-0Tyw7M5N.js";import{i as Pt}from"./Check-ClIa17j0.js";import{i as br}from"./Key01-Bk8xH73U.js";import{s as yr}from"./Plus-BnwG6MJP.js";import{T as Nr,a as wr,b as _r}from"./tooltip-tzy8U_iQ.js";import{i as Cr}from"./Play-BwAcOs4w.js";import"./ChevronRight-DFG09LEe.js";const Oe="private-registry",kr=`
|
|
2
2
|
You are an MCP tool tester running automated integration checks.
|
|
3
3
|
|
|
4
4
|
Goal:
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BBFU9boO.js","assets/index-BtcINkTm.js","assets/index-DfYyH4IW.css","assets/XCircle-COx0scnd.js","assets/CheckCircle-B7SCOPQ0.js","assets/Container-Dl6JrGmY.js","assets/Settings02-BQbLvp5G.js","assets/use-mcp-client-S74GyiM7.js","assets/useInfiniteQuery-BtPT1URZ.js","assets/use-infinite-scroll-DNsSee5z.js","assets/studio-tools-TxENKH8b.js","assets/badge-IOoDOD2d.js","assets/input-BmQ7mzb-.js","assets/dropdown-menu-Gz8gJsHK.js","assets/Check-ClIa17j0.js","assets/ChevronRight-DFG09LEe.js","assets/DotsVertical-bJa4a1zt.js","assets/table-DkrhBQg4.js","assets/toggle-group-C4KUfAuk.js","assets/use-view-mode-BJ10aE-1.js","assets/tooltip-tzy8U_iQ.js","assets/FilterLines-BGhu0YVn.js","assets/Globe01-8bu4SIYa.js","assets/SearchMd-DuTVINbp.js","assets/dialog-DzRPb7hw.js","assets/X-O_18GBbz.js","assets/AlertCircle-DAV0VdD_.js","assets/Upload01-tQiDFvpO.js","assets/alert-dialog-B62p6NY3.js","assets/card-wWKMvRKZ.js","assets/Trash01-BQ1nC-zv.js","assets/label-BOhFc9vG.js","assets/select-Dx5F3uHo.js","assets/ChevronDown-DcOlk72I.js","assets/ChevronUp-BUzePKUo.js","assets/switch-C7oZ8aiH.js","assets/textarea-DsNDFPec.js","assets/RefreshCcw01-T0T8zVj0.js","assets/checkbox-B-wIlb8X.js","assets/Eye-pjtF8UNz.js","assets/LinkExternal01-CpFd7tXn.js","assets/use-copy-0Tyw7M5N.js","assets/Key01-Bk8xH73U.js","assets/Plus-BnwG6MJP.js","assets/Play-BwAcOs4w.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{e as i,j as e,r as s,l as a,_ as o}from"./index-BtcINkTm.js";import{R as l}from"./require-capability-D3V29zD7.js";import"./use-capability-BjULA9g0.js";import"./access-gate-BPUPgBJG.js";import"./capability-load-error-COBJ9SIa.js";const m=s.lazy(()=>o(()=>import("./registry-layout-BBFU9boO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])));function f(){const r=i.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(l,{capability:"registry:manage",area:"the registry",children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(m,{})})}),r[0]=t):t=r[0],t}export{f as default};
|
package/dist/client/assets/{require-capability-h0AQqiHs.js → require-capability-D3V29zD7.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as p,j as m}from"./index-
|
|
1
|
+
import{e as p,j as m}from"./index-BtcINkTm.js";import{u as l}from"./use-capability-BjULA9g0.js";import{A as u}from"./access-gate-BPUPgBJG.js";function b(n){const t=p.c(6),{capability:c,area:e,children:i}=n,{granted:a,loading:o,error:s}=l(c);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
|
package/dist/client/assets/{required-auth-layout-yPYkXxXO.js → required-auth-layout-ItD57512.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c,j as i,A as a,S as u,h as m,k as f,N as h}from"./index-
|
|
1
|
+
import{e as c,j as i,A as a,S as u,h as m,k as f,N as h}from"./index-BtcINkTm.js";import{u as x}from"./useRouterState-D4hr3MwK.js";function g(){const t=c.c(5),s=x().location.href;let n;t[0]!==s?(n=s==="/login"||s.startsWith("/login?"),t[0]=s,t[1]=n):n=t[1];const r=n;let o;if(t[2]!==s||t[3]!==r){const l=r?{}:{next:s};o=i.jsx(h,{to:"/login",search:l,replace:!0}),t[2]=s,t[3]=r,t[4]=o}else o=t[4];return o}function j(t){const e=c.c(6),{children:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(a,{children:i.jsx(u,{})}),e[0]=n):n=e[0];let r;e[1]!==s?(r=i.jsx(m,{children:s}),e[1]=s,e[2]=r):r=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(f,{children:i.jsx(g,{})}),e[3]=o):o=e[3];let l;return e[4]!==r?(l=i.jsxs(i.Fragment,{children:[n,r,o]}),e[4]=r,e[5]=l):l=e[5],l}export{j as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as q,d as Y,f as A,r as B,a as G,j as s,B as z,b as K}from"./index-
|
|
1
|
+
import{e as q,d as Y,f as A,r as B,a as G,j as s,B as z,b as K}from"./index-BtcINkTm.js";import{I as L}from"./input-BmQ7mzb-.js";function H(){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=G(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 g;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?(g=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]=g):g=e[34];let p;e[35]!==a||e[36]!==t?(p=!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]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==f||e[42]!==g||e[43]!==p?(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,g,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=f,e[42]=g,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await K.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f,aQ as Sn,e as Me,j as he,c as Ye}from"./index-DbyFiYMM.js";import{d as Pn}from"./ZoomOut-Ce855rrm.js";const Ee=f.createContext(null);Ee.displayName="PanelGroupContext";const k={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,je=Sn.useId,wn=typeof je=="function"?je:()=>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 Ze({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:H,getPanelStyle:D,groupId:V,isPanelCollapsed:R,reevaluatePanelConstraints:P,registerPanel:j,resizePanel:X,unregisterPanel:F}=E,G=Ge(l),$=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:M}=$.current,B={...M};$.current.id=G,$.current.idIsFromProps=l!==void 0,$.current.order=u,_.onCollapse=h,_.onExpand=w,_.onResize=p,M.collapsedSize=t,M.collapsible=r,M.defaultSize=i,M.maxSize=a,M.minSize=s,(B.collapsedSize!==M.collapsedSize||B.collapsible!==M.collapsible||B.maxSize!==M.maxSize||B.minSize!==M.minSize)&&P($.current,B)}),ne(()=>{const _=$.current;return j(_),()=>{F(_)}},[u,G,j,F]),f.useImperativeHandle(o,()=>({collapse:()=>{S($.current)},expand:_=>{L($.current,_)},getId(){return G},getSize(){return H($.current)},isCollapsed(){return R($.current)},isExpanded(){return!R($.current)},resize:_=>{X($.current,_)}}),[S,L,H,R,G,X]);const Z=D($.current,i);return f.createElement(z,{...C,children:n,className:e,id:G,style:{...Z,...v},[k.groupId]:V,[k.panel]:"",[k.panelCollapsible]:r||void 0,[k.panelId]:G,[k.panelSize]:parseFloat(""+Z.flexGrow).toFixed(1)})}const Qe=f.forwardRef((n,e)=>f.createElement(Ze,{...n,forwardedRef:e}));Ze.displayName="Panel";Qe.displayName="forwardRef(Panel)";let De=null,Se=-1,Y=null;function Cn(n,e){if(e){const t=(e&on)!==0,r=(e&ln)!==0,i=(e&an)!==0,o=(e&sn)!==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(){Y!==null&&(document.head.removeChild(Y),De=null,Y=null,Se=-1)}function Ae(n,e){var t,r;const i=Cn(n,e);if(De!==i){if(De=i,Y===null&&(Y=document.createElement("style"),document.head.appendChild(Y)),Se>=0){var o;(o=Y.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=Y.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function en(n){return n.type==="keydown"}function nn(n){return n.type.startsWith("pointer")}function tn(n){return n.type.startsWith("mouse")}function Ce(n){if(nn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(tn(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 An(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 kn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function $n(n){var e;const t=getComputedStyle((e=rn(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Hn(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||$n(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"||kn.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ke(n){let e=n.length;for(;e--;){const t=n[e];if(x(t,"Missing node"),Hn(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=rn(n);return e}function rn(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const on=1,ln=2,an=4,sn=8,Nn=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 Mn(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(),un(e)||n.stopImmediatePropagation())}function ke(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 $e(n){const{target:e}=n,{x:t,y:r}=Ce(n);Ie.clear(),ae=!1,U.length>0&&(n.preventDefault(),un(e)||n.stopImmediatePropagation()),we("up",n),Be({target:e,x:t,y:r}),Te(),Pe()}function un(n){let e=n;for(;e;){if(e.hasAttribute(k.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=Nn?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)&&An(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 He(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?Ae("intersection",t):n?Ae("horizontal",t):e?Ae("vertical",t):In()}let Ne=new AbortController;function Pe(){Ne.abort(),Ne=new AbortController;const n={capture:!0,signal:Ne.signal};ze.size&&(ae?(U.length>0&&ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("contextmenu",$e,n),r.addEventListener("pointerleave",ke,n),r.addEventListener("pointermove",ke,n))}),window.addEventListener("pointerup",$e,n),window.addEventListener("pointercancel",$e,n)):ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("pointerdown",Mn,n),r.addEventListener("pointermove",ke,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 J(n,e,t=_e){return te(n,e,t)===0}function W(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(!W(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(W(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}`),W(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}`),W(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(!W(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,!W(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 H=L+C,D=le({panelConstraints:t,panelIndex:S,size:H});if(W(L,D)||(C-=D-L,l[S]=D),W(C,0))break;n>0?S--:S++}}}const w=l.reduce((p,u)=>u+p,0);return W(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(`[${k.resizeHandleId}][data-panel-group-id="${n}"]`))}function cn(n,e,t=document){const i=ye(n,t).findIndex(o=>o.getAttribute(k.resizeHandleId)===e);return i??null}function fn(n,e,t){const r=cn(n,e,t);return r!=null?[r,r+1]:[-1,-1]}function dn(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(`[${k.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 Fn({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=dn(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(k.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(H=>H.id===z);if(L>=0){const H=s[L];x(H,`No panel data found for index ${L}`);const D=r[L],{collapsedSize:V=0,collapsible:R,minSize:P=0}=H.constraints;if(D!=null&&R){const j=ge({delta:W(D,V)?P-V:V-D,initialLayout:r,panelConstraints:s.map(X=>X.constraints),pivotIndices:fn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==j&&l(j)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,n,e,t,r,i,l])}function Oe(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 pn(n,e){const t=n==="horizontal",{x:r,y:i}=Ce(e);return t?r:i}function Wn(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(k.groupId);x(a,"Resize handle element has no group id attribute");let{initialCursorPosition:s}=r;const h=pn(t,n),w=dn(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 jn(n,e,t,r,i,o){if(en(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:Wn(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||J(p,h))&&!J(r,h)&&v(),u&&(p==null||!J(p,h))&&J(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 qe(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 gn(n){return`react-resizable-panels:${n}`}function mn(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 hn(n,e){try{const t=gn(n),r=e.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function On(n,e,t){var r,i;const o=(r=hn(n,t))!==null&&r!==void 0?r:{},l=mn(e);return(i=o[l])!==null&&i!==void 0?i:null}function qn(n,e,t,r,i){var o;const l=gn(n),a=mn(e),s=(o=hn(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 Xe({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(!W(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(!W(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,W(i,0)))break}return t}const Xn=100,me={getItem:n=>(qe(me),me.getItem(n)),setItem:(n,e)=>{qe(me),me.setItem(n,e)}},Je={};function zn({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(),H=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=Xe({layout:c,panelConstraints:g.map(y=>y.constraints)});Oe(b,d)||(S(d),P.current.layout=d,m&&m(d),oe(g,d,H.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}),Fn({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=Je[n];m==null&&(m=Vn(qn,Xn),Je[n]=m);const b=[...c],g=new Map(D.current);m(n,b,g,E,s)}},[n,E,s]),f.useEffect(()=>{});const j=f.useCallback(c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(O=>O.constraints),{collapsedSize:y=0,panelSize:I,pivotIndices:N}=Q(g,c,b);if(x(I!=null,`Panel size not found for panel "${c.id}"`),!J(I,y)){D.current.set(c.id,I);const q=ie(g,c)===g.length-1?I-y:y-I,A=ge({delta:q,initialLayout:b,panelConstraints:d,pivotIndices:N,prevLayout:b,trigger:"imperative-api"});be(b,A)||(S(A),P.current.layout=A,m&&m(A),oe(g,A,H.current))}}},[]),X=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:N=0,minSize:O=0,pivotIndices:q}=Q(d,c,g),A=m??O;if(J(N,I)){const K=D.current.get(c.id),de=K!=null&&K>=A?K:A,Le=ie(d,c)===d.length-1?N-de:de-N,T=ge({delta:Le,initialLayout:g,panelConstraints:y,pivotIndices:q,prevLayout:g,trigger:"imperative-api"});be(g,T)||(S(T),P.current.layout=T,b&&b(T),oe(d,T,H.current))}}},[]),F=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]),$=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&&J(y,g)},[]),Z=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 N=On(c,d,b);N&&(D.current=new Map(Object.entries(N.expandToSizes)),y=N.layout)}y==null&&(y=Kn({panelDataArray:d}));const I=Xe({layout:y,panelConstraints:d.map(N=>N.constraints)});Oe(g,I)||(S(I),P.current.layout=I,m&&m(I),oe(d,I,H.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const M=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:N,id:O,keyboardResizeBy:q,onLayout:A}=R.current,{layout:K,panelDataArray:de}=P.current,{initialLayout:ve}=N??{},Le=fn(O,c,y);let T=jn(d,c,I,N,q,y);const Fe=I==="horizontal";Fe&&m&&(T=-T);const vn=de.map(bn=>bn.constraints),pe=ge({delta:T,initialLayout:ve??K,panelConstraints:vn,pivotIndices:Le,prevLayout:K,trigger:en(d)?"keyboard":"mouse-or-touch"}),We=!be(K,pe);(nn(d)||tn(d))&&V.current!=T&&(V.current=T,!We&&T!==0?Fe?He(c,T<0?on:ln):He(c,T<0?an:sn):He(c,0)),We&&(S(pe),P.current.layout=pe,A&&A(pe),oe(de,pe,H.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:N}=Q(d,c,g);x(I!=null,`Panel size not found for panel "${c.id}"`);const q=ie(d,c)===d.length-1?I-m:m-I,A=ge({delta:q,initialLayout:g,panelConstraints:y,pivotIndices:N,prevLayout:g,trigger:"imperative-api"});be(g,A)||(S(A),P.current.layout=A,b&&b(A),oe(d,A,H.current))},[]),se=f.useCallback((c,m)=>{const{layout:b,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:I=0,collapsible:N,maxSize:O=100,minSize:q=0}=c.constraints,{panelSize:A}=Q(g,c,b);A!=null&&(y&&N&&J(A,d)?J(d,I)||B(c,I):A<q?B(c,q):A>O&&B(c,O))},[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=pn(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 H.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:j,direction:r,dragState:z,expandPanel:X,getPanelSize:F,getPanelStyle:G,groupId:u,isPanelCollapsed:$,isPanelExpanded:Z,reevaluatePanelConstraints:se,registerPanel:_,registerResizeHandle:M,resizePanel:B,startDragging:ue,stopDragging:ce,unregisterPanel:xe,panelGroupElement:v.current}),[j,z,r,X,F,G,u,$,Z,se,_,M,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},[k.group]:"",[k.groupDirection]:r,[k.groupId]:u}))}const yn=f.forwardRef((n,e)=>f.createElement(zn,{...n,forwardedRef:e}));zn.displayName="PanelGroup";yn.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 Jn({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(k.groupId);x(a,`No group element found for id "${a}"`);const s=ye(a,r),h=cn(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 xn({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 H=f.useContext(Ee);if(H===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:V,registerResizeHandle:R,startDragging:P,stopDragging:j,panelGroupElement:X}=H,F=Ge(i),[G,$]=f.useState("inactive"),[Z,_]=f.useState(!1),[M,B]=f.useState(null),se=f.useRef({state:G});ne(()=>{se.current.state=G}),f.useEffect(()=>{if(t)B(null);else{const re=R(F);B(()=>re)}},[t,F,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||M==null)return;const re=S.current;x(re,"Element ref not attached");let fe=!1;return Dn(F,re,D,{coarse:ue,fine:ce},(m,b,g)=>{if(!b){$("inactive");return}switch(m){case"down":{$("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(F,g);const{onDragging:d,onPointerDown:y}=L.current;d?.(!0),y?.();break}case"move":{const{state:d}=se.current;fe=!0,d!=="drag"&&$("hover"),x(g,'Expected event to be defined for "move" action'),M(g);break}case"up":{$("hover"),j();const{onClick:d,onDragging:y,onPointerUp:I}=L.current;y?.(!1),I?.(),fe||d?.();break}}})},[ue,D,t,ce,R,F,M,P,j]),Jn({disabled:t,handleId:F,resizeHandler:M,panelGroupElement:X});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,[k.groupDirection]:D,[k.groupId]:V,[k.resizeHandle]:"",[k.resizeHandleActive]:G==="drag"?"pointer":Z?"keyboard":void 0,[k.resizeHandleEnabled]:!t,[k.resizeHandleId]:F,[k.resizeHandleState]:G})}xn.displayName="PanelResizeHandle";function Qn(n){const e=Me.c(10);let t,r,i;e[0]!==n?({className:t,ref:i,...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=Ye("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[4]=t,e[5]=o):o=e[5];let l;return e[6]!==r||e[7]!==i||e[8]!==o?(l=he.jsx(yn,{ref:i,"data-slot":"resizable-panel-group",className:o,...r}),e[6]=r,e[7]=i,e[8]=o,e[9]=l):l=e[9],l}function et(n){const e=Me.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(Qe,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=r):r=e[3],r}function nt(n){const e=Me.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=Ye("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(Pn,{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(xn,{"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{et as R,nt as a,Qn as b};
|
|
1
|
+
import{r as f,aQ as Sn,e as Me,j as he,c as Ye}from"./index-BtcINkTm.js";import{d as Pn}from"./ZoomOut-D3dpdTm8.js";const Ee=f.createContext(null);Ee.displayName="PanelGroupContext";const k={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,je=Sn.useId,wn=typeof je=="function"?je:()=>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 Ze({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:H,getPanelStyle:D,groupId:V,isPanelCollapsed:R,reevaluatePanelConstraints:P,registerPanel:j,resizePanel:X,unregisterPanel:F}=E,G=Ge(l),$=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:M}=$.current,B={...M};$.current.id=G,$.current.idIsFromProps=l!==void 0,$.current.order=u,_.onCollapse=h,_.onExpand=w,_.onResize=p,M.collapsedSize=t,M.collapsible=r,M.defaultSize=i,M.maxSize=a,M.minSize=s,(B.collapsedSize!==M.collapsedSize||B.collapsible!==M.collapsible||B.maxSize!==M.maxSize||B.minSize!==M.minSize)&&P($.current,B)}),ne(()=>{const _=$.current;return j(_),()=>{F(_)}},[u,G,j,F]),f.useImperativeHandle(o,()=>({collapse:()=>{S($.current)},expand:_=>{L($.current,_)},getId(){return G},getSize(){return H($.current)},isCollapsed(){return R($.current)},isExpanded(){return!R($.current)},resize:_=>{X($.current,_)}}),[S,L,H,R,G,X]);const Z=D($.current,i);return f.createElement(z,{...C,children:n,className:e,id:G,style:{...Z,...v},[k.groupId]:V,[k.panel]:"",[k.panelCollapsible]:r||void 0,[k.panelId]:G,[k.panelSize]:parseFloat(""+Z.flexGrow).toFixed(1)})}const Qe=f.forwardRef((n,e)=>f.createElement(Ze,{...n,forwardedRef:e}));Ze.displayName="Panel";Qe.displayName="forwardRef(Panel)";let De=null,Se=-1,Y=null;function Cn(n,e){if(e){const t=(e&on)!==0,r=(e&ln)!==0,i=(e&an)!==0,o=(e&sn)!==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(){Y!==null&&(document.head.removeChild(Y),De=null,Y=null,Se=-1)}function Ae(n,e){var t,r;const i=Cn(n,e);if(De!==i){if(De=i,Y===null&&(Y=document.createElement("style"),document.head.appendChild(Y)),Se>=0){var o;(o=Y.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=Y.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function en(n){return n.type==="keydown"}function nn(n){return n.type.startsWith("pointer")}function tn(n){return n.type.startsWith("mouse")}function Ce(n){if(nn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(tn(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 An(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 kn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function $n(n){var e;const t=getComputedStyle((e=rn(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Hn(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||$n(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"||kn.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ke(n){let e=n.length;for(;e--;){const t=n[e];if(x(t,"Missing node"),Hn(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=rn(n);return e}function rn(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const on=1,ln=2,an=4,sn=8,Nn=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 Mn(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(),un(e)||n.stopImmediatePropagation())}function ke(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 $e(n){const{target:e}=n,{x:t,y:r}=Ce(n);Ie.clear(),ae=!1,U.length>0&&(n.preventDefault(),un(e)||n.stopImmediatePropagation()),we("up",n),Be({target:e,x:t,y:r}),Te(),Pe()}function un(n){let e=n;for(;e;){if(e.hasAttribute(k.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=Nn?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)&&An(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 He(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?Ae("intersection",t):n?Ae("horizontal",t):e?Ae("vertical",t):In()}let Ne=new AbortController;function Pe(){Ne.abort(),Ne=new AbortController;const n={capture:!0,signal:Ne.signal};ze.size&&(ae?(U.length>0&&ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("contextmenu",$e,n),r.addEventListener("pointerleave",ke,n),r.addEventListener("pointermove",ke,n))}),window.addEventListener("pointerup",$e,n),window.addEventListener("pointercancel",$e,n)):ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("pointerdown",Mn,n),r.addEventListener("pointermove",ke,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 J(n,e,t=_e){return te(n,e,t)===0}function W(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(!W(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(W(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}`),W(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}`),W(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(!W(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,!W(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 H=L+C,D=le({panelConstraints:t,panelIndex:S,size:H});if(W(L,D)||(C-=D-L,l[S]=D),W(C,0))break;n>0?S--:S++}}}const w=l.reduce((p,u)=>u+p,0);return W(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(`[${k.resizeHandleId}][data-panel-group-id="${n}"]`))}function cn(n,e,t=document){const i=ye(n,t).findIndex(o=>o.getAttribute(k.resizeHandleId)===e);return i??null}function fn(n,e,t){const r=cn(n,e,t);return r!=null?[r,r+1]:[-1,-1]}function dn(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(`[${k.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 Fn({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=dn(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(k.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(H=>H.id===z);if(L>=0){const H=s[L];x(H,`No panel data found for index ${L}`);const D=r[L],{collapsedSize:V=0,collapsible:R,minSize:P=0}=H.constraints;if(D!=null&&R){const j=ge({delta:W(D,V)?P-V:V-D,initialLayout:r,panelConstraints:s.map(X=>X.constraints),pivotIndices:fn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==j&&l(j)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,n,e,t,r,i,l])}function Oe(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 pn(n,e){const t=n==="horizontal",{x:r,y:i}=Ce(e);return t?r:i}function Wn(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(k.groupId);x(a,"Resize handle element has no group id attribute");let{initialCursorPosition:s}=r;const h=pn(t,n),w=dn(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 jn(n,e,t,r,i,o){if(en(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:Wn(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||J(p,h))&&!J(r,h)&&v(),u&&(p==null||!J(p,h))&&J(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 qe(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 gn(n){return`react-resizable-panels:${n}`}function mn(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 hn(n,e){try{const t=gn(n),r=e.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function On(n,e,t){var r,i;const o=(r=hn(n,t))!==null&&r!==void 0?r:{},l=mn(e);return(i=o[l])!==null&&i!==void 0?i:null}function qn(n,e,t,r,i){var o;const l=gn(n),a=mn(e),s=(o=hn(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 Xe({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(!W(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(!W(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,W(i,0)))break}return t}const Xn=100,me={getItem:n=>(qe(me),me.getItem(n)),setItem:(n,e)=>{qe(me),me.setItem(n,e)}},Je={};function zn({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(),H=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=Xe({layout:c,panelConstraints:g.map(y=>y.constraints)});Oe(b,d)||(S(d),P.current.layout=d,m&&m(d),oe(g,d,H.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}),Fn({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=Je[n];m==null&&(m=Vn(qn,Xn),Je[n]=m);const b=[...c],g=new Map(D.current);m(n,b,g,E,s)}},[n,E,s]),f.useEffect(()=>{});const j=f.useCallback(c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(O=>O.constraints),{collapsedSize:y=0,panelSize:I,pivotIndices:N}=Q(g,c,b);if(x(I!=null,`Panel size not found for panel "${c.id}"`),!J(I,y)){D.current.set(c.id,I);const q=ie(g,c)===g.length-1?I-y:y-I,A=ge({delta:q,initialLayout:b,panelConstraints:d,pivotIndices:N,prevLayout:b,trigger:"imperative-api"});be(b,A)||(S(A),P.current.layout=A,m&&m(A),oe(g,A,H.current))}}},[]),X=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:N=0,minSize:O=0,pivotIndices:q}=Q(d,c,g),A=m??O;if(J(N,I)){const K=D.current.get(c.id),de=K!=null&&K>=A?K:A,Le=ie(d,c)===d.length-1?N-de:de-N,T=ge({delta:Le,initialLayout:g,panelConstraints:y,pivotIndices:q,prevLayout:g,trigger:"imperative-api"});be(g,T)||(S(T),P.current.layout=T,b&&b(T),oe(d,T,H.current))}}},[]),F=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]),$=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&&J(y,g)},[]),Z=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 N=On(c,d,b);N&&(D.current=new Map(Object.entries(N.expandToSizes)),y=N.layout)}y==null&&(y=Kn({panelDataArray:d}));const I=Xe({layout:y,panelConstraints:d.map(N=>N.constraints)});Oe(g,I)||(S(I),P.current.layout=I,m&&m(I),oe(d,I,H.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const M=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:N,id:O,keyboardResizeBy:q,onLayout:A}=R.current,{layout:K,panelDataArray:de}=P.current,{initialLayout:ve}=N??{},Le=fn(O,c,y);let T=jn(d,c,I,N,q,y);const Fe=I==="horizontal";Fe&&m&&(T=-T);const vn=de.map(bn=>bn.constraints),pe=ge({delta:T,initialLayout:ve??K,panelConstraints:vn,pivotIndices:Le,prevLayout:K,trigger:en(d)?"keyboard":"mouse-or-touch"}),We=!be(K,pe);(nn(d)||tn(d))&&V.current!=T&&(V.current=T,!We&&T!==0?Fe?He(c,T<0?on:ln):He(c,T<0?an:sn):He(c,0)),We&&(S(pe),P.current.layout=pe,A&&A(pe),oe(de,pe,H.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:N}=Q(d,c,g);x(I!=null,`Panel size not found for panel "${c.id}"`);const q=ie(d,c)===d.length-1?I-m:m-I,A=ge({delta:q,initialLayout:g,panelConstraints:y,pivotIndices:N,prevLayout:g,trigger:"imperative-api"});be(g,A)||(S(A),P.current.layout=A,b&&b(A),oe(d,A,H.current))},[]),se=f.useCallback((c,m)=>{const{layout:b,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:I=0,collapsible:N,maxSize:O=100,minSize:q=0}=c.constraints,{panelSize:A}=Q(g,c,b);A!=null&&(y&&N&&J(A,d)?J(d,I)||B(c,I):A<q?B(c,q):A>O&&B(c,O))},[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=pn(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 H.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:j,direction:r,dragState:z,expandPanel:X,getPanelSize:F,getPanelStyle:G,groupId:u,isPanelCollapsed:$,isPanelExpanded:Z,reevaluatePanelConstraints:se,registerPanel:_,registerResizeHandle:M,resizePanel:B,startDragging:ue,stopDragging:ce,unregisterPanel:xe,panelGroupElement:v.current}),[j,z,r,X,F,G,u,$,Z,se,_,M,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},[k.group]:"",[k.groupDirection]:r,[k.groupId]:u}))}const yn=f.forwardRef((n,e)=>f.createElement(zn,{...n,forwardedRef:e}));zn.displayName="PanelGroup";yn.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 Jn({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(k.groupId);x(a,`No group element found for id "${a}"`);const s=ye(a,r),h=cn(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 xn({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 H=f.useContext(Ee);if(H===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:V,registerResizeHandle:R,startDragging:P,stopDragging:j,panelGroupElement:X}=H,F=Ge(i),[G,$]=f.useState("inactive"),[Z,_]=f.useState(!1),[M,B]=f.useState(null),se=f.useRef({state:G});ne(()=>{se.current.state=G}),f.useEffect(()=>{if(t)B(null);else{const re=R(F);B(()=>re)}},[t,F,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||M==null)return;const re=S.current;x(re,"Element ref not attached");let fe=!1;return Dn(F,re,D,{coarse:ue,fine:ce},(m,b,g)=>{if(!b){$("inactive");return}switch(m){case"down":{$("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(F,g);const{onDragging:d,onPointerDown:y}=L.current;d?.(!0),y?.();break}case"move":{const{state:d}=se.current;fe=!0,d!=="drag"&&$("hover"),x(g,'Expected event to be defined for "move" action'),M(g);break}case"up":{$("hover"),j();const{onClick:d,onDragging:y,onPointerUp:I}=L.current;y?.(!1),I?.(),fe||d?.();break}}})},[ue,D,t,ce,R,F,M,P,j]),Jn({disabled:t,handleId:F,resizeHandler:M,panelGroupElement:X});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,[k.groupDirection]:D,[k.groupId]:V,[k.resizeHandle]:"",[k.resizeHandleActive]:G==="drag"?"pointer":Z?"keyboard":void 0,[k.resizeHandleEnabled]:!t,[k.resizeHandleId]:F,[k.resizeHandleState]:G})}xn.displayName="PanelResizeHandle";function Qn(n){const e=Me.c(10);let t,r,i;e[0]!==n?({className:t,ref:i,...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=Ye("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[4]=t,e[5]=o):o=e[5];let l;return e[6]!==r||e[7]!==i||e[8]!==o?(l=he.jsx(yn,{ref:i,"data-slot":"resizable-panel-group",className:o,...r}),e[6]=r,e[7]=i,e[8]=o,e[9]=l):l=e[9],l}function et(n){const e=Me.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(Qe,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=r):r=e[3],r}function nt(n){const e=Me.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=Ye("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(Pn,{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(xn,{"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{et as R,nt as a,Qn as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as $,q as Se,K as re,bb as dt,n as Re,j as s,c as K,l as fe,B as ne,e as H,T as Pe,aH as Ie,W as se,aJ as De,aK as ke,G as $e,H as mt,I as ut,a as Fe,o as he,t as Oe,F as Ke,v as ft,E as ht,f as gt,d as xt}from"./index-DbyFiYMM.js";import{u as pt}from"./use-organization-roles-B2ZkdMhr.js";import{u as je}from"./use-org-auth-client-DpwKZh8Z.js";import{B as ge}from"./badge-paokYscD.js";import{A as Qe,a as He,b as qe,c as Ze,d as Xe,f as Je,e as We,g as et}from"./alert-dialog-BEGH3aSs.js";import{D as bt,a as Et,b as Tt,c as _t}from"./dropdown-menu-Dj3MDDMZ.js";import{i as It}from"./DotsVertical-C9V6bPki.js";import{s as Ae}from"./Plus-feLyH0Mp.js";import{s as St}from"./Trash01-CT3XJ1Uh.js";import{C as Nt}from"./collection-table-wrapper-klHkSAlu.js";import{P as te}from"./index-DTy0am7R.js";import{E as Ge}from"./empty-state-BV65O9fn.js";import{S as ve}from"./search-input-CnI7Q0Ja.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ye}from"./integration-icon-D-0Pqfkg.js";import{u as Ct}from"./use-infinite-scroll-BuZXNddy.js";import{C as we}from"./checkbox-D7gUXZzi.js";import{i as At}from"./RefreshCcw01-CSQneTJA.js";import{u as Rt}from"./useSuspenseInfiniteQuery-Dsg9xb8N.js";import{u as Ot,a as jt}from"./use-mcp-client-h23DeI2f.js";import{C as vt}from"./collection-search-C0EaLZS4.js";import{u as nt}from"./use-members-DwhrSoam.js";import{u as yt}from"./use-connection-Bz76T27j.js";import{u as wt,d as Lt}from"./use-ai-providers-DqUzS21L.js";import{A as lt}from"./avatar-DJjsnLZ8.js";import{S as xe}from"./switch-Di9MyZKS.js";import{c as pe,b as be,T as Ee,a as Te}from"./tooltip-C7-bm38e.js";import{S as Ue,a as Be,b as Ve}from"./settings-section-B5LcEn4_.js";import{t as Mt}from"./ChevronDown-DuZw_4bA.js";import{i as Pt}from"./ChevronRight-BVQfgYe8.js";import{i as ze}from"./X-CZkmbhDd.js";import{a as Dt}from"./use-capability-t45tlxss.js";import{A as kt}from"./access-gate-DpDV-s7-.js";import"./Check-_jrJoobZ.js";import"./table-44DBEP3g.js";import"./SwitchHorizontal01-Dl9XdrMi.js";import"./sidebar-BOx1Juuc.js";import"./LayoutLeft-BMpnotb_.js";import"./sheet-CvXLdiAP.js";import"./SearchMd-JHjczKfV.js";import"./Container-ocMhpfg8.js";import"./agent-icon-RRGTKit7.js";import"./AlertCircle-BKrVWRi_.js";import"./Tool01-BcDxUYLf.js";import"./XCircle-BlUvUKr4.js";import"./ArrowUpRight-Cs41tgmO.js";import"./ZapSquare-CuzMVb_d.js";import"./Users03-O-O_DaoB.js";import"./CheckCircle-DpZ8gxX3.js";import"./ChevronLeft-D8le3bse.js";import"./ChevronUp-UmgkNnpT.js";import"./Eye-C3fH6hv3.js";import"./ZoomOut-Ce855rrm.js";import"./Globe01-7Z-J00sV.js";import"./FilterLines-BZWeJJ-C.js";import"./Star01-DiB8lhA8.js";import"./Palette-D2TWlK2I.js";import"./HardDrive-sx0AK3SO.js";import"./Stars02-q2z0o3k0.js";import"./Key01-Cu_XzqUu.js";import"./LinkExternal01-C_AovQs-.js";import"./Monitor01-DbTRnsTd.js";import"./Sun-DsAeZvJd.js";import"./Play-DnfTKZT9.js";import"./Settings02-CcMIO7b-.js";import"./Shield01-CSVIt2bv.js";import"./Stars01-CHUAJiuF.js";import"./Upload01-Drau3Bzl.js";import"./User01-K4a5BHBB.js";import"./Users01-ChSEbZ3e.js";import"./XClose-Dj-Bpk8Q.js";import"./Zap-CH2t0knG.js";import"./use-collections-BdbcXRKO.js";import"./card-RD-w7ItO.js";import"./capability-load-error-BzZPpBKU.js";const Le="basic-usage",Me=[{id:Le,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_GET","ORGANIZATION_DOMAIN_SET","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_CLEAR"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH","REGISTRY_MONITOR_SCHEDULE_SET","REGISTRY_MONITOR_SCHEDULE_CANCEL"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"event-bus:use",label:"Use event bus",description:"Publish events and manage subscriptions",section:"Developer",tools:["EVENT_PUBLISH","EVENT_SUBSCRIBE","EVENT_UNSUBSCRIBE","EVENT_CANCEL","EVENT_ACK","EVENT_SUBSCRIPTION_LIST","EVENT_SYNC_SUBSCRIPTIONS"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Me.find(t=>t.id===Le)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Me.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Me){if(e.id===Le)continue;const n=t.get(e.section)??[];n.push(e),t.set(e.section,n)}return Array.from(t.entries()).map(([e,n])=>({section:e,capabilities:n}))}function Bt(t,e,n){return n?!0:t.tools.every(l=>e.includes(l))}function Vt(t,e,n){if(n){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const l=new Set(e);for(const i of t.tools)l.delete(i);return Array.from(l)}function zt(t){const e=H.c(21),{connection:n,isSelected:l,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,g=l?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==g?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),e[0]=g,e[1]=f):f=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let x;e[5]!==n.title?(x=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=x):x=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==x?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,x]}),e[7]=h,e[8]=a,e[9]=x,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==n.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=n.tools&&n.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(we,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=n.tools,e[13]=i,e[14]=c,e[15]=d,e[16]=m):m=e[16];let S;return e[17]!==f||e[18]!==o||e[19]!==m?(S=s.jsxs("div",{className:f,children:[o,m]}),e[17]=f,e[18]=o,e[19]=m,e[20]=S):S=e[20],S}function Yt(t){return t.stopPropagation()}function $t(t){const e=H.c(18),{connectionId:n,tool:l,isSelected:i,onToggle:r}=t,d=`tool-${n}-${l.name}`,h=i?"text-foreground":"text-muted-foreground";let c;e[0]!==h?(c=K("text-sm font-medium",h),e[0]=h,e[1]=c):c=e[1];let g;e[2]!==c||e[3]!==l.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:l.name})}),e[2]=c,e[3]=l.name,e[4]=g):g=e[4];let f;e[5]!==l.description?(f=l.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),e[5]=l.description,e[6]=f):f=e[6];let a;e[7]!==g||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,f]}),e[7]=g,e[8]=f,e[9]=a):a=e[9];const x=`tool-${n}-${l.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==x?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(we,{id:x,checked:i,onCheckedChange:r,onClick:Ft})}),e[10]=i,e[11]=r,e[12]=x,e[13]=o):o=e[13];let m;return e[14]!==d||e[15]!==a||e[16]!==o?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[a,o]}),e[14]=d,e[15]=a,e[16]=o,e[17]=m):m=e[17],m}function Ft(t){return t.stopPropagation()}function Kt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:l}){const[i,r]=$.useState(""),d=l!==void 0?l:i,h=$.useDeferredValue(d),[c,g]=$.useState("all"),[f,a]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:o}=Se(),m=Ot({connectionId:jt,orgId:o.id,orgSlug:o.slug}),S=100,T=h.trim(),E=T?{operator:"or",conditions:[{field:["title"],operator:"contains",value:T},{field:["description"],operator:"contains",value:T}]}:void 0,N=!!n,C={...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:0,...N&&{include_virtual:!0}},v=JSON.stringify(C),{data:_,fetchNextPage:R,hasNextPage:p,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:b=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:b,...N&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(b,D)=>{if(b?.hasMore)return D.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),I=_?.pages.flatMap(b=>b?.items??[])??[],j=Ct(R,p??!1,O),u=n?I.filter(b=>b.connection_type!=="VIRTUAL"?!0:dt(b.connection_url)!==n):I,w=x.current,A=[...w.values()].map(b=>u.find(D=>D.id===b)).filter(b=>b!==void 0),k=u.filter(b=>!w.has(b.id)),G=[...A,...k],U=b=>{const D=t[b];return D!==void 0&&D.length>0},B=G.filter(b=>{if(c==="all")return!0;const D=U(b.id);return c==="selected"?D:c==="unselected"?!D:!0}),[L,z]=$.useState(G[0]?.id??null),y=L?G.find(b=>b.id===L)??null:null,{data:M,isFetching:Y}=Re({queryKey:re.collectionItem(m,o.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),F=M?.tools??[],X=(b,D)=>t[b]?.includes(D)??!1,J=(b,D)=>{const Q=t[b]??[],q=Q.includes(D),W={...t};if(q){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[b]:W[b]=Z}else W[b]=[...Q,D];e(W)},le=b=>{const D=b===L?F:[];if(!D.length)return;const Q=t[b]??[],q=D.map(ee=>ee.name),W=Q.length>0&&q.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[b]:(Z[b]=q,z(b)),e(Z)},oe=b=>{z(b),a(!0)},ie=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[l===void 0&&s.jsx(vt,{value:i,onChange:r,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>g("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>g("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>g("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:B.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:d?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[B.map(b=>{const D=L===b.id,Q=D?F.length:0,q=t[b.id]?.length??0;return s.jsx(zt,{connection:{...b,tools:D?F:b.tools},isSelected:D,hasToolsEnabled:U(b.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>oe(b.id),onToggle:()=>le(b.id)},b.id)}),s.jsx("div",{ref:j,className:"h-4"}),O&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:K("flex-1 flex-col",f?"flex":"hidden md:flex"),children:y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ne,{variant:"ghost",size:"sm",onClick:ie,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(At,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(ye,{icon:y.icon,name:y.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:y.title}),y.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:Y?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})}):F.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:F.map(b=>s.jsx($t,{connectionId:y.id,tool:b,isSelected:X(y.id,b.name),onToggle:()=>J(y.id,b.name)},b.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}const Ne=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],Qt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ht(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ne.length;return Ne[n]??Ne[0]}function qt(t,e){return Qt[t]??"bg-neutral-400"}const Zt=Pe({role:Pe({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:ke(),staticPermissions:Ie(se()),toolSet:De(se(),Ie(se())),allowAllModels:ke(),modelSet:De(se(),Ie(se())),memberIds:Ie(se())});function ot(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Ye(t,e,n){const l=s.jsx(xe,{checked:t,disabled:e,onCheckedChange:n});return e?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:l})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):l}function Xt(t){const e=H.c(28),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let g;e[0]!==h?(g=h.trim().toLowerCase(),e[0]=h,e[1]=g):g=e[1];const f=$.useDeferredValue(g);let a;if(e[2]!==n||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==l){const x=Ut(),o=(v,_)=>{if(!c){if(n&&_){const R=x.flatMap(es).flatMap(Wt);i(!1),r(R.filter(p=>!v.tools.includes(p)));return}n||r(Vt(v,l,!_))}};let m;e[10]!==f?(m=v=>{const{section:_,capabilities:R}=v;return{section:_,capabilities:R.filter(p=>!f||p.label.toLowerCase().includes(f)||p.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const S=x.map(m).filter(Jt);let T;e[12]!==n||e[13]!==i||e[14]!==r?(T=()=>{i(!n),r([])},e[12]=n,e[13]=i,e[14]=r,e[15]=T):T=e[15];let E;e[16]!==n||e[17]!==c||e[18]!==T?(E=Ye(n,c,T),e[16]=n,e[17]=c,e[18]=T,e[19]=E):E=e[19];let N;e[20]!==n||e[21]!==i||e[22]!==r||e[23]!==c?(N=c?void 0:()=>{i(!n),r([])},e[20]=n,e[21]=i,e[22]=r,e[23]=c,e[24]=N):N=e[24];let C;e[25]!==E||e[26]!==N?(C=s.jsx(Ue,{title:"General",children:s.jsx(Be,{children:s.jsx(Ve,{title:"All organization permissions",description:"Grant full access to all features below",action:E,onClick:N})})}),e[25]=E,e[26]=N,e[27]=C):C=e[27],a=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[C,S.length===0&&f?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",h,"”"]}):S.map(v=>{const{section:_,capabilities:R}=v;return s.jsx(Ue,{title:_,children:s.jsx(Be,{children:R.map(p=>{const O=Bt(p,l,n);return s.jsx(Ve,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[p.label,p.dangerous&&s.jsx(ft,{size:12,className:"text-amber-500 shrink-0"})]}),description:p.description,action:Ye(O,c,()=>o(p,O)),onClick:c?void 0:()=>o(p,O)},p.id)})})},_)})]})}),e[2]=n,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=l,e[9]=a}else a=e[9];return a}function Jt(t){return t.capabilities.length>0}function Wt(t){return t.tools}function es(t){return t.capabilities}const it={anthropic:"Anthropic",openrouter:"OpenRouter"},ts={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function ss(t,e){const n=t.indexOf("/"),l=n>0?t.slice(0,n):e;return l.startsWith("~")?l.slice(1):l}function ns(t){return ts[t]??it[t]??t}function ls(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const rt=30;function os(t){const e=H.c(44),{connectionId:n,subProviderId:l,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:g,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:x,readOnly:o,defaultExpanded:m}=t,[S,T]=$.useState(m),E=m||S,N=T,[C,v]=$.useState(rt);let _;e[0]!==f||e[1]!==g||e[2]!==c?(_=j=>g||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=g,e[2]=c,e[3]=_):_=e[3];const R=_;let p;if(e[4]!==R||e[5]!==d){let j;e[7]!==R?(j=u=>R(u.id),e[7]=R,e[8]=j):j=e[8],p=d.filter(j),e[4]=R,e[5]=d,e[6]=p}else p=e[6];const O=p.length;let I;if(e[9]!==h||e[10]!==g||e[11]!==n||e[12]!==O||e[13]!==E||e[14]!==r||e[15]!==R||e[16]!==d||e[17]!==x||e[18]!==a||e[19]!==o||e[20]!==l||e[21]!==i||e[22]!==C){const j=d.slice(0,C),u=d.length>C;let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=()=>N(cs),e[24]=w):w=e[24];const A=r??tt[l]??st;let k;e[25]!==i||e[26]!==A?(k=s.jsx(ye,{icon:A,name:i,size:"sm"}),e[25]=i,e[26]=A,e[27]=k):k=e[27];let G;e[28]!==i?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[28]=i,e[29]=G):G=e[29];let U;e[30]!==k||e[31]!==G?(U=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[k,G]}),e[30]=k,e[31]=G,e[32]=U):U=e[32];let B;e[33]!==O||e[34]!==d.length?(B=s.jsxs(ge,{variant:"secondary",className:"text-xs text-muted-foreground",children:[O,"/",d.length," enabled"]}),e[33]=O,e[34]=d.length,e[35]=B):B=e[35];let L;e[36]!==E?(L=E?s.jsx(Mt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=E,e[37]=L):L=e[37];let z;e[38]!==L||e[39]!==B?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,L]}),e[38]=L,e[39]=B,e[40]=z):z=e[40];let y;e[41]!==z||e[42]!==U?(y=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:w,children:[U,z]}),e[41]=z,e[42]=U,e[43]=y):y=e[43],I=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,E&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(M=>{const Y=R(M.id),F=()=>{if(!o){if(g){x(n,h,M.id);return}a(n,M.id)}};return s.jsxs("div",{className:K("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!o&&"hover:bg-muted/50 cursor-pointer"),onClick:F,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:M.title})}),s.jsx("div",{onClick:as,children:o?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:Y,disabled:!0,onCheckedChange:rs})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:Y,onCheckedChange:F})})]},M.id)}),u&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>v(is),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=g,e[11]=n,e[12]=O,e[13]=E,e[14]=r,e[15]=R,e[16]=d,e[17]=x,e[18]=a,e[19]=o,e[20]=l,e[21]=i,e[22]=C,e[23]=I}else I=e[23];return I}function is(t){return t+rt}function rs(){}function as(t){return t.stopPropagation()}function cs(t){return!t}function ds(t){const e=H.c(33),{connection:n,selectedModels:l,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:g}=t,f=Lt(n.id);let a,x,o,m,S;if(e[0]!==h||e[1]!==i||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==g||e[9]!==c||e[10]!==l){S=Symbol.for("react.early_return_sentinel");e:{let N;e[16]!==n.label?(N=A=>({...A,id:A.modelId,provider:n.label}),e[16]=n.label,e[17]=N):N=e[17];const C=f.filter(hs).map(N),v=c.trim().toLowerCase(),_=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(_.length===0){S=null;break e}const R=new Map;for(const A of _){const k=ss(A.id,n.providerId),G=R.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ls(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),R.set(k,G)}const p=Array.from(R.entries()).map(fs).sort(us),O=p.length===1||v.length>0;o="flex flex-col gap-3";const I=tt[n.providerId]??st;let j;e[18]!==n.providerId||e[19]!==I?(j=s.jsx("img",{src:I,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=I,e[20]=j):j=e[20];const u=it[n.providerId]??n.providerId;let w;e[21]!==u?(w=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=w):w=e[22],e[23]!==w||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,w]}),e[23]=w,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",x=p.map(A=>s.jsx(os,{connectionId:n.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(ms),selectedModels:l,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:g,defaultExpanded:O},A.id))}e[0]=h,e[1]=i,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=g,e[9]=c,e[10]=l,e[11]=a,e[12]=x,e[13]=o,e[14]=m,e[15]=S}else a=e[11],x=e[12],o=e[13],m=e[14],S=e[15];if(S!==Symbol.for("react.early_return_sentinel"))return S;let T;e[26]!==a||e[27]!==x?(T=s.jsx("div",{className:a,children:x}),e[26]=a,e[27]=x,e[28]=T):T=e[28];let E;return e[29]!==o||e[30]!==m||e[31]!==T?(E=s.jsxs("div",{className:o,children:[m,T]}),e[29]=o,e[30]=m,e[31]=T,e[32]=E):E=e[32],E}function ms(t){return t.id}function us(t,e){return t.name.localeCompare(e.name)}function fs(t){const[e,n]=t;return{id:e,name:ns(e),logo:n.logo,models:n.models}}function hs(t,e,n){return n.findIndex(l=>l.modelId===t.modelId)===e}function gs(t){const e=H.c(35),{allowAllModels:n,modelSet:l,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,g=$.useDeferredValue(h),f=wt();let a;e[0]!==l||e[1]!==r?(a=(p,O)=>{const I=l[p]??[],j={...l};if(I.includes(O)){const u=I.filter(w=>w!==O);u.length===0?delete j[p]:j[p]=u}else j[p]=[...I,O];r(j)},e[0]=l,e[1]=r,e[2]=a):a=e[2];const x=a;let o;e[3]!==l||e[4]!==i||e[5]!==r?(o=(p,O,I)=>{i(!1),r({...l,[p]:O.filter(j=>j!==I)})},e[3]=l,e[4]=i,e[5]=r,e[6]=o):o=e[6];const m=o,S=!c&&"hover:bg-muted/50 cursor-pointer";let T;e[7]!==S?(T=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=T):T=e[8];let E;e[9]!==n||e[10]!==i||e[11]!==r||e[12]!==c?(E=()=>{if(c)return;const p=!n;i(p),p&&r({})},e[9]=n,e[10]=i,e[11]=r,e[12]=c,e[13]=E):E=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=N):N=e[14];let C;e[15]!==n||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:ps,children:c?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:n,disabled:!0,onCheckedChange:xs})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:n,onCheckedChange:p=>{i(p),p&&r({})}})}),e[15]=n,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==T||e[21]!==E||e[22]!==C?(v=s.jsxs("div",{className:T,onClick:E,children:[N,C]}),e[20]=T,e[21]=E,e[22]=C,e[23]=v):v=e[23];let _;e[24]!==f||e[25]!==n||e[26]!==g||e[27]!==m||e[28]!==l||e[29]!==c||e[30]!==x?(_=f.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):f.map(p=>s.jsx($.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(fe,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(ds,{connection:p,selectedModels:l[p.id]??[],allowAllModels:n,onToggleModel:x,onExitAllowAll:m,allConnectionModelsSelected:(l[p.id]??[]).includes("*"),searchQuery:g,readOnly:c})},p.id)),e[24]=f,e[25]=n,e[26]=g,e[27]=m,e[28]=l,e[29]=c,e[30]=x,e[31]=_):_=e[31];let R;return e[32]!==_||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,_]}),e[32]=_,e[33]=v,e[34]=R):R=e[34],R}function xs(){}function ps(t){return t.stopPropagation()}function bs(t){const e=H.c(52),{open:n,onOpenChange:l,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=$.useState(""),c=$.useDeferredValue(d);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[f,a]=$.useState(g),{data:x}=nt();let o,m,S,T,E,N,C,v,_,R,p;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==r||e[4]!==l||e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==i){const U=x?.data?.members??[];let B;e[20]!==c?(B=y=>{const M=c.toLowerCase();return y.user?.name?.toLowerCase().includes(M)||y.user?.email?.toLowerCase().includes(M)},e[20]=c,e[21]=B):B=e[21];const L=U.filter(B);let z;e[22]!==r||e[23]!==l||e[24]!==f?(z=()=>{r(f),a([]),l(!1)},e[22]=r,e[23]=l,e[24]=f,e[25]=z):z=e[25],S=z,m=Qe,R=n,p=l,o=He,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(qe,{className:"px-6 pt-6",children:[s.jsx(Ze,{children:"Add Members to Role"}),s.jsx(Xe,{children:"Select members to add to this role."})]}),e[26]=_):_=e[26],N="flex flex-col h-80",e[27]!==d?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ve,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],T="flex-1 overflow-auto",E=L.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:L.map(y=>{const M=y.role!=="owner",Y=i.includes(y.id),F=f.includes(y.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!M||Y?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(we,{checked:F||Y,onCheckedChange:()=>{!M||Y||a(X=>X.includes(y.id)?X.filter(J=>J!==y.id):[...X,y.id])},disabled:!M||Y}),s.jsx(lt,{url:y.user?.image??void 0,fallback:ot(y.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:y.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.user?.email})]}),!M&&s.jsx(ge,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&M&&s.jsx(ge,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=r,e[4]=l,e[5]=n,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=S,e[12]=T,e[13]=E,e[14]=N,e[15]=C,e[16]=v,e[17]=_,e[18]=R,e[19]=p}else o=e[9],m=e[10],S=e[11],T=e[12],E=e[13],N=e[14],C=e[15],v=e[16],_=e[17],R=e[18],p=e[19];let O;e[29]!==T||e[30]!==E?(O=s.jsx("div",{className:T,children:E}),e[29]=T,e[30]=E,e[31]=O):O=e[31];let I;e[32]!==O||e[33]!==N||e[34]!==C?(I=s.jsxs("div",{className:N,children:[C,O]}),e[32]=O,e[33]=N,e[34]=C,e[35]=I):I=e[35];let j;e[36]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Je,{children:"Cancel"}),e[36]=j):j=e[36];const u=f.length===0,w=f.length>0&&`(${f.length})`;let A;e[37]!==S||e[38]!==u||e[39]!==w?(A=s.jsxs(We,{className:"px-6 pb-6",children:[j,s.jsxs(et,{onClick:S,disabled:u,children:["Add ",w]})]}),e[37]=S,e[38]=u,e[39]=w,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==I||e[43]!==A||e[44]!==v||e[45]!==_?(k=s.jsxs(o,{className:v,children:[_,I,A]}),e[41]=o,e[42]=I,e[43]=A,e[44]=v,e[45]=_,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==R||e[50]!==p?(G=s.jsx(m,{open:R,onOpenChange:p,children:k}),e[47]=m,e[48]=k,e[49]=R,e[50]=p,e[51]=G):G=e[51],G}function Es(t){const e=H.c(29),{memberIds:n,onMemberIdsChange:l,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,g=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=$.useDeferredValue(d),{data:x}=nt();let o,m,S;if(e[0]!==x?.data?.members||e[1]!==a||e[2]!==n||e[3]!==l||e[4]!==g||e[5]!==f||e[6]!==d){const v=x?.data?.members??[];let _;e[10]!==n?(_=I=>n.includes(I.id),e[10]=n,e[11]=_):_=e[11];const R=v.filter(_);let p;e[12]!==a?(p=I=>{const j=a.toLowerCase();return I.user?.name?.toLowerCase().includes(j)||I.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=p):p=e[13];const O=R.filter(p);S="flex flex-col h-full",o="flex-1 overflow-auto",m=R.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',d,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:O.map(I=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(lt,{url:I.user?.image??void 0,fallback:ot(I.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:I.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.user?.email})]}),g?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(ze,{size:16})})})}),s.jsx(Te,{children:s.jsx("p",{children:f})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(j=>j!==I.id)),children:s.jsx(ze,{size:16})})]},I.id))}),e[0]=x?.data?.members,e[1]=a,e[2]=n,e[3]=l,e[4]=g,e[5]=f,e[6]=d,e[7]=o,e[8]=m,e[9]=S}else o=e[7],m=e[8],S=e[9];let T;e[14]!==o||e[15]!==m?(T=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=T):T=e[16];let E;e[17]!==n||e[18]!==l?(E=v=>l([...n,...v]),e[17]=n,e[18]=l,e[19]=E):E=e[19];let N;e[20]!==h||e[21]!==n||e[22]!==c||e[23]!==E?(N=s.jsx(bs,{open:h,onOpenChange:c,selectedMemberIds:n,onAddMembers:E}),e[20]=h,e[21]=n,e[22]=c,e[23]=E,e[24]=N):N=e[24];let C;return e[25]!==S||e[26]!==T||e[27]!==N?(C=s.jsxs("div",{className:S,children:[T,N]}),e[25]=S,e[26]=T,e[27]=N,e[28]=C):C=e[28],C}function Ts(t){const e=H.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let l;return e[1]!==t?(l=s.jsx($.Suspense,{fallback:n,children:s.jsx(Es,{...t})}),e[1]=t,e[2]=l):l=e[2],l}const _s={owner:[],admin:[],user:[]};function Is(t,e,n,l){const i=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:_s[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function Ss(t,e,n){const l=t.permission||{},i=l.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,x]of Object.entries(l))if(!(a==="self"||a==="models"))if(a==="*")for(const o of n)h[o.id]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x;else{const o=n.find(m=>m.id===a);o&&(h[a]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x)}const c=l.models||[],g=c.length===0||c.includes("*:*"),f={};if(!g)for(const a of c){const x=a.indexOf(":");if(x===-1)continue;const o=a.slice(0,x),m=a.slice(x+1);f[o]||(f[o]=[]),f[o].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:r,staticPermissions:d,toolSet:h,allowAllModels:g,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Ns(t,e){const n={};t.allowAllStaticPermissions?n.self=["*"]:t.staticPermissions.length>0&&(n.self=t.staticPermissions);for(const[l,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===l)?.tools?.map(h=>h.name)??[];n[l]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)l.push(`${i}:${d}`);l.length>0&&(n.models=l)}return n}function Cs(t,e,n){return t.kind==="builtin"?Is(t.role,e,void 0):t.kind==="custom"?Ss(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function As(t){const e=H.c(6),{readOnly:n,readOnlyMessage:l,onOpen:i}=t,r=l===void 0?"Owner membership cannot be changed":l;if(n){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Ae,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let g;return e[1]!==r?(g=s.jsx(pe,{children:s.jsxs(be,{children:[c,s.jsx(Te,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=g):g=e[2],g}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ae,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(ne,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Rs(t){const e=H.c(14),{locator:n}=Se(),l=je(),i=yt();let r;e[0]!==n?(r=re.members(n),e[0]=n,e[1]=r):r=e[1];let d;e[2]!==l?(d=()=>l.organization.listMembers(),e[2]=l,e[3]=d):d=e[3];let h;e[4]!==r||e[5]!==d?(h={queryKey:r,queryFn:d},e[4]=r,e[5]=d,e[6]=h):h=e[6];const{data:c,isPending:g}=Re(h);if(g||!i){let o;return e[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=o):o=e[7],o}let f;e[8]!==c?.data?.members?(f=c?.data?.members??[],e[8]=c?.data?.members,e[9]=f):f=e[9];const a=f;let x;return e[10]!==i||e[11]!==a||e[12]!==t?(x=s.jsx(Os,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=x):x=e[13],x}function Os({target:t,onBack:e,onSaved:n,members:l,connections:i}){const{locator:r}=Se(),d=je(),h=$e(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,x]=$.useState(c?"org":"mcp"),o=mt({resolver:ut(Zt),defaultValues:Cs(t,l,i)}),m=o.formState.isValid,S=o.formState.isDirty,T=Fe({mutationFn:async u=>{const w=Ns(u,i),A=u.role.slug||u.role.label.toLowerCase().replace(/\s+/g,"-"),k=(u.role.slug==="owner"||u.role.slug==="admin"||u.role.slug==="user")&&!u.role.id,G=async(U,B)=>{const L=l.filter(M=>M.role===(B??U)).map(M=>M.id),z=u.memberIds.filter(M=>!L.includes(M)),y=L.filter(M=>!u.memberIds.includes(M));for(const M of z){const Y=await d.organization.updateMemberRole({memberId:M,role:[U]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}for(const M of y){const Y=await d.organization.updateMemberRole({memberId:M,role:["user"]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}};if(k)return await G(u.role.slug),u;if(u.role.id){const U=u.role.label.toLowerCase().replace(/\s+/g,"-"),B=u.role.slug,L=U!==B,z=await d.organization.updateRole({roleId:u.role.id,data:{permission:w,...L?{roleName:U}:{}}});if(z?.error)throw new Error(z.error.message??"Something went wrong");return await G(L?U:B,L?B:void 0),L?{...u,role:{...u.role,slug:U}}:u}else{const U=await d.organization.createRole({role:A,permission:w});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const L=await d.organization.updateMemberRole({memberId:B,role:[A]});if(L?.error)throw new Error(L.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,w)=>{h.invalidateQueries({queryKey:re.members(r)}),h.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!w.role.id&&!w.role.slug,k=w.role.slug==="owner"&&!w.role.id;Oe(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:w.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),o.reset(u),n(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),E=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}T.mutate(u)}),N=!g,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...g?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[_,R]=$.useState(""),[p,O]=$.useState(!1),I=u=>{x(u),R("")},j={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:K("flex flex-col",a!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:N&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{variant:"outline",size:"sm",onClick:e,disabled:T.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:E,disabled:T.isPending||!m||!S,children:T.isPending?"Saving...":f?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",t.kind==="builtin"?qt(t.role):Ht(o.watch("role.label")))}),g&&s.jsx(Ke,{size:16,className:"text-muted-foreground shrink-0"}),f||t.kind==="custom"?s.jsx("input",{...o.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:f}):s.jsx("span",{className:"truncate",children:C})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(u=>s.jsx("button",{type:"button",onClick:()=>I(u.id),className:K("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",a===u.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:u.label},u.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ve,{value:_,onChange:R,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(As,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>O(!0)})]})]})}),s.jsx("div",{className:K("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",a!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:K(a!=="org"&&"h-full overflow-hidden",a!=="models"&&a!=="org"&&"border border-border rounded-xl bg-card"),children:[a==="mcp"&&!g&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:_}),a==="org"&&s.jsx(Xt,{allowAllStaticPermissions:o.watch("allowAllStaticPermissions"),staticPermissions:o.watch("staticPermissions"),onAllowAllChange:u=>o.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>o.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:g,searchQuery:_}),a==="models"&&s.jsx(gs,{allowAllModels:o.watch("allowAllModels"),modelSet:o.watch("modelSet"),onAllowAllChange:u=>o.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>o.setValue("modelSet",u,{shouldDirty:!0}),readOnly:g,searchQuery:_}),a==="members"&&s.jsx(Ts,{memberIds:o.watch("memberIds"),onMemberIdsChange:u=>o.setValue("memberIds",u,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?"User is the default role — members can't be removed from it; assign another role to change their access":"Owner membership cannot be changed",searchQuery:_,addMemberDialogOpen:p,onAddMemberDialogOpenChange:O})]})})]})})}function js(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function vs(t){const e=H.c(6),{area:n,children:l}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==n||e[1]!==l||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:n,children:l}),e[0]=n,e[1]=l,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const ys=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ce=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function ws(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ce.length;return Ce[n]??Ce[0]}const Ls={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ms(t,e){return e?Ls[t]??"bg-neutral-400":ws(t)}function Ps(){const t=H.c(77),[e,n]=$.useState(""),[l,i]=$.useState(null),r=gt();let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[0]=d):d=t[0];const{role:h}=xt(d),{locator:c}=Se(),g=je(),f=$e(),{customRoles:a,refetch:x}=pt();let o;t[1]!==r?(o=P=>r({to:".",search:V=>({...V,role:P})}),t[1]=r,t[2]=o):o=t[2];const m=o;let S;e:{if(!h){S=null;break e}if(h==="new"){S={kind:"new"};break e}if(h.startsWith("builtin-")){S={kind:"builtin",role:h.slice(8)};break e}let P;t[3]!==h?(P=ae=>ae.id===h,t[3]=h,t[4]=P):P=t[4];const V=a.find(P);S=V?{kind:"custom",role:V}:null}const T=S;let E;t[5]!==c?(E=re.members(c),t[5]=c,t[6]=E):E=t[6];let N;t[7]!==g?(N=()=>g.organization.listMembers(),t[7]=g,t[8]=N):N=t[8];let C;t[9]!==E||t[10]!==N?(C={queryKey:E,queryFn:N},t[9]=E,t[10]=N,t[11]=C):C=t[11];const{data:v}=Re(C);let _;t[12]!==v?.data?.members?(_=v?.data?.members??[],t[12]=v?.data?.members,t[13]=_):_=t[13];const R=_;let p;t[14]!==R?(p=P=>R.filter(V=>V.role===P).length,t[14]=R,t[15]=p):p=t[15];const O=p;let I;if(t[16]!==a||t[17]!==O||t[18]!==e){let P;t[20]!==O?(P=ce=>({kind:"builtin",role:{...ce,memberCount:O(ce.role)}}),t[20]=O,t[21]=P):P=t[21];const V=ys.map(P);let ae;t[22]!==O?(ae=ce=>({kind:"custom",role:{...ce,memberCount:O(ce.role)}}),t[22]=O,t[23]=ae):ae=t[23];const at=a.map(ae);if(I=[...V,...at],e){const ce=e.toLowerCase();I=I.filter(ct=>ct.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=I}else I=t[19];let j;t[24]!==g?(j=async P=>{const V=await g.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=g,t[25]=j):j=t[25];const u=Fe({mutationFn:j,onSuccess:(P,V)=>{Oe("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),x(),T?.kind==="custom"&&T.role.id===V&&m(void 0)},onError:zs});let w,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Vs,cellClassName:"flex-1 min-w-0",sortable:!0},w={id:"type",header:"Type",render:Bs,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:Us,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Gs,cellClassName:"w-24 shrink-0"},t[26]=w,t[27]=A,t[28]=k,t[29]=G):(w=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,w,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(bt,{children:[s.jsx(Et,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ks,children:s.jsx(It,{size:16})})}),s.jsx(Tt,{align:"end",onClick:Ds,children:s.jsxs(_t,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(St,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let L;t[31]!==m?(L=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=L):L=t[32];const z=L;if(T){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==x||t[36]!==m?(V=()=>{x(),m(void 0)},t[35]=x,t[36]=m,t[37]=V):V=t[37],s.jsx(Rs,{target:T,onBack:P,onSaved:V},js(T))}let y;t[38]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(te.Title,{children:"Roles"}),t[38]=y):y=t[38];let M;t[39]===Symbol.for("react.memo_cache_sentinel")?(M=P=>{P.key==="Escape"&&(n(""),P.target.blur())},t[39]=M):M=t[39];let Y;t[40]!==e?(Y=s.jsx(ve,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:M}),t[40]=e,t[41]=Y):Y=t[41];let F;t[42]!==m?(F=()=>m("new"),t[42]=m,t[43]=F):F=t[43];let X;t[44]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(Ae,{size:16}),t[44]=X):X=t[44];let J;t[45]!==F?(J=s.jsxs(ne,{onClick:F,children:[X,"Create Role"]}),t[45]=F,t[46]=J):J=t[46];let le;t[47]!==Y||t[48]!==J?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,J]}),t[47]=Y,t[48]=J,t[49]=le):le=t[49];let oe;t[50]!==e?(oe=e?s.jsx(Ge,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(Ge,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==I||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(Nt,{columns:B,data:I,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=I,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let b;t[57]!==le||t[58]!==ie?(b=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,le,ie]})})}),t[57]=le,t[58]=ie,t[59]=b):b=t[59];const D=l!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&i(null),t[60]=Q):Q=t[60];let q;t[61]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Ze,{children:"Delete Role"}),t[61]=q):q=t[61];const W=l?.label;let Z;t[62]!==W?(Z=s.jsxs(qe,{children:[q,s.jsxs(Xe,{children:['Are you sure you want to delete the "',W,'" role? This action cannot be undone.']})]}),t[62]=W,t[63]=Z):Z=t[63];let ee;t[64]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(Je,{children:"Cancel"}),t[64]=ee):ee=t[64];let de;t[65]!==u||t[66]!==l?(de=s.jsxs(We,{children:[ee,s.jsx(et,{onClick:()=>{l?.id&&u.mutate(l.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=l,t[67]=de):de=t[67];let me;t[68]!==Z||t[69]!==de?(me=s.jsxs(He,{children:[Z,de]}),t[68]=Z,t[69]=de,t[70]=me):me=t[70];let ue;t[71]!==D||t[72]!==me?(ue=s.jsx(Qe,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let _e;return t[74]!==b||t[75]!==ue?(_e=s.jsxs(te,{children:[b,ue]}),t[74]=b,t[75]=ue,t[76]=_e):_e=t[76],_e}function Ds(t){return t.stopPropagation()}function ks(t){return t.stopPropagation()}function Gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Us(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,n=[];return e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function Bs(t){return t.kind==="builtin"?s.jsx(ge,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(ge,{variant:"outline",className:"text-xs",children:"Custom"})}function Vs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",Ms(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(Ke,{size:12,className:"text-muted-foreground shrink-0"})]})}function zs(t,e){Oe("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),he.error(t instanceof Error?t.message:"Failed to delete role")}function Ys(){const t=H.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load roles"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{fallback:e,children:s.jsx($.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Ps,{})})}),t[1]=n):n=t[1],n}function ul(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vs,{area:"roles",children:s.jsx(Ys,{})}),t[0]=e):e=t[0],e}export{ul as default};
|
|
1
|
+
import{r as $,q as Se,K as re,bb as dt,n as Re,j as s,c as K,l as fe,B as ne,e as H,T as Pe,aH as Ie,W as se,aJ as De,aK as ke,G as $e,H as mt,I as ut,a as Fe,o as he,t as Oe,F as Ke,v as ft,E as ht,f as gt,d as xt}from"./index-BtcINkTm.js";import{u as pt}from"./use-organization-roles-CfjMxwLC.js";import{u as je}from"./use-org-auth-client-DY3OKqMz.js";import{B as ge}from"./badge-IOoDOD2d.js";import{A as Qe,a as He,b as qe,c as Ze,d as Xe,f as Je,e as We,g as et}from"./alert-dialog-B62p6NY3.js";import{D as bt,a as Et,b as Tt,c as _t}from"./dropdown-menu-Gz8gJsHK.js";import{i as It}from"./DotsVertical-bJa4a1zt.js";import{s as Ae}from"./Plus-BnwG6MJP.js";import{s as St}from"./Trash01-BQ1nC-zv.js";import{C as Nt}from"./collection-table-wrapper-C8dEwS2E.js";import{P as te}from"./index-DQxsgmSZ.js";import{E as Ge}from"./empty-state-D0W0P9GD.js";import{S as ve}from"./search-input-CXhVJuuP.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ye}from"./integration-icon-CLYC_fiQ.js";import{u as Ct}from"./use-infinite-scroll-DNsSee5z.js";import{C as we}from"./checkbox-B-wIlb8X.js";import{i as At}from"./RefreshCcw01-T0T8zVj0.js";import{u as Rt}from"./useSuspenseInfiniteQuery-DCeuFJSM.js";import{u as Ot,a as jt}from"./use-mcp-client-S74GyiM7.js";import{C as vt}from"./collection-search-Dr2f5A66.js";import{u as nt}from"./use-members-4JnAFwog.js";import{u as yt}from"./use-connection-DeHXMOiI.js";import{u as wt,d as Lt}from"./use-ai-providers-CB9vio0p.js";import{A as lt}from"./avatar-KrgvwmIy.js";import{S as xe}from"./switch-C7oZ8aiH.js";import{c as pe,b as be,T as Ee,a as Te}from"./tooltip-tzy8U_iQ.js";import{S as Ue,a as Be,b as Ve}from"./settings-section-Dl4MTBRK.js";import{t as Mt}from"./ChevronDown-DcOlk72I.js";import{i as Pt}from"./ChevronRight-DFG09LEe.js";import{i as ze}from"./X-O_18GBbz.js";import{a as Dt}from"./use-capability-BjULA9g0.js";import{A as kt}from"./access-gate-BPUPgBJG.js";import"./Check-ClIa17j0.js";import"./table-DkrhBQg4.js";import"./SwitchHorizontal01-Dwx0lgMF.js";import"./sidebar-D3j0Ekh6.js";import"./LayoutLeft-BiGQffB4.js";import"./sheet-WX1SRekV.js";import"./SearchMd-DuTVINbp.js";import"./Container-Dl6JrGmY.js";import"./agent-icon-PPKWRb0x.js";import"./AlertCircle-DAV0VdD_.js";import"./Tool01-DyFrjTUh.js";import"./XCircle-COx0scnd.js";import"./ArrowUpRight-DEOKOSBd.js";import"./ZapSquare-Cs3vJ5qy.js";import"./Users03-CYOSLpev.js";import"./CheckCircle-B7SCOPQ0.js";import"./ChevronLeft-CxqwkoN-.js";import"./ChevronUp-BUzePKUo.js";import"./Eye-pjtF8UNz.js";import"./ZoomOut-D3dpdTm8.js";import"./Globe01-8bu4SIYa.js";import"./FilterLines-BGhu0YVn.js";import"./Star01-Cf3cR-_x.js";import"./Palette-DK2sVT7m.js";import"./HardDrive-CDtaoiCt.js";import"./Stars02-D3fTbcnU.js";import"./Key01-Bk8xH73U.js";import"./LinkExternal01-CpFd7tXn.js";import"./Monitor01-B-I27REk.js";import"./Sun-CvyvBO1g.js";import"./Play-BwAcOs4w.js";import"./Settings02-BQbLvp5G.js";import"./Shield01-ClirY5c-.js";import"./Stars01-D2sTkx04.js";import"./Upload01-tQiDFvpO.js";import"./User01-CFJi0zLk.js";import"./Users01-CCPx6uaK.js";import"./XClose-BuvY_ty6.js";import"./Zap-Bu7nPvMM.js";import"./use-collections-XRQSv1Qe.js";import"./card-wWKMvRKZ.js";import"./capability-load-error-COBJ9SIa.js";const Le="basic-usage",Me=[{id:Le,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_GET","ORGANIZATION_DOMAIN_SET","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_CLEAR"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH","REGISTRY_MONITOR_SCHEDULE_SET","REGISTRY_MONITOR_SCHEDULE_CANCEL"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"event-bus:use",label:"Use event bus",description:"Publish events and manage subscriptions",section:"Developer",tools:["EVENT_PUBLISH","EVENT_SUBSCRIBE","EVENT_UNSUBSCRIBE","EVENT_CANCEL","EVENT_ACK","EVENT_SUBSCRIPTION_LIST","EVENT_SYNC_SUBSCRIPTIONS"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Me.find(t=>t.id===Le)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Me.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Me){if(e.id===Le)continue;const n=t.get(e.section)??[];n.push(e),t.set(e.section,n)}return Array.from(t.entries()).map(([e,n])=>({section:e,capabilities:n}))}function Bt(t,e,n){return n?!0:t.tools.every(l=>e.includes(l))}function Vt(t,e,n){if(n){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const l=new Set(e);for(const i of t.tools)l.delete(i);return Array.from(l)}function zt(t){const e=H.c(21),{connection:n,isSelected:l,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,g=l?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==g?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),e[0]=g,e[1]=f):f=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let x;e[5]!==n.title?(x=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=x):x=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==x?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,x]}),e[7]=h,e[8]=a,e[9]=x,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==n.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=n.tools&&n.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(we,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=n.tools,e[13]=i,e[14]=c,e[15]=d,e[16]=m):m=e[16];let S;return e[17]!==f||e[18]!==o||e[19]!==m?(S=s.jsxs("div",{className:f,children:[o,m]}),e[17]=f,e[18]=o,e[19]=m,e[20]=S):S=e[20],S}function Yt(t){return t.stopPropagation()}function $t(t){const e=H.c(18),{connectionId:n,tool:l,isSelected:i,onToggle:r}=t,d=`tool-${n}-${l.name}`,h=i?"text-foreground":"text-muted-foreground";let c;e[0]!==h?(c=K("text-sm font-medium",h),e[0]=h,e[1]=c):c=e[1];let g;e[2]!==c||e[3]!==l.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:l.name})}),e[2]=c,e[3]=l.name,e[4]=g):g=e[4];let f;e[5]!==l.description?(f=l.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),e[5]=l.description,e[6]=f):f=e[6];let a;e[7]!==g||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,f]}),e[7]=g,e[8]=f,e[9]=a):a=e[9];const x=`tool-${n}-${l.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==x?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(we,{id:x,checked:i,onCheckedChange:r,onClick:Ft})}),e[10]=i,e[11]=r,e[12]=x,e[13]=o):o=e[13];let m;return e[14]!==d||e[15]!==a||e[16]!==o?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[a,o]}),e[14]=d,e[15]=a,e[16]=o,e[17]=m):m=e[17],m}function Ft(t){return t.stopPropagation()}function Kt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:l}){const[i,r]=$.useState(""),d=l!==void 0?l:i,h=$.useDeferredValue(d),[c,g]=$.useState("all"),[f,a]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:o}=Se(),m=Ot({connectionId:jt,orgId:o.id,orgSlug:o.slug}),S=100,T=h.trim(),E=T?{operator:"or",conditions:[{field:["title"],operator:"contains",value:T},{field:["description"],operator:"contains",value:T}]}:void 0,N=!!n,C={...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:0,...N&&{include_virtual:!0}},v=JSON.stringify(C),{data:_,fetchNextPage:R,hasNextPage:p,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:b=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:b,...N&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(b,D)=>{if(b?.hasMore)return D.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),I=_?.pages.flatMap(b=>b?.items??[])??[],j=Ct(R,p??!1,O),u=n?I.filter(b=>b.connection_type!=="VIRTUAL"?!0:dt(b.connection_url)!==n):I,w=x.current,A=[...w.values()].map(b=>u.find(D=>D.id===b)).filter(b=>b!==void 0),k=u.filter(b=>!w.has(b.id)),G=[...A,...k],U=b=>{const D=t[b];return D!==void 0&&D.length>0},B=G.filter(b=>{if(c==="all")return!0;const D=U(b.id);return c==="selected"?D:c==="unselected"?!D:!0}),[L,z]=$.useState(G[0]?.id??null),y=L?G.find(b=>b.id===L)??null:null,{data:M,isFetching:Y}=Re({queryKey:re.collectionItem(m,o.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),F=M?.tools??[],X=(b,D)=>t[b]?.includes(D)??!1,J=(b,D)=>{const Q=t[b]??[],q=Q.includes(D),W={...t};if(q){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[b]:W[b]=Z}else W[b]=[...Q,D];e(W)},le=b=>{const D=b===L?F:[];if(!D.length)return;const Q=t[b]??[],q=D.map(ee=>ee.name),W=Q.length>0&&q.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[b]:(Z[b]=q,z(b)),e(Z)},oe=b=>{z(b),a(!0)},ie=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[l===void 0&&s.jsx(vt,{value:i,onChange:r,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>g("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>g("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>g("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:B.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:d?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[B.map(b=>{const D=L===b.id,Q=D?F.length:0,q=t[b.id]?.length??0;return s.jsx(zt,{connection:{...b,tools:D?F:b.tools},isSelected:D,hasToolsEnabled:U(b.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>oe(b.id),onToggle:()=>le(b.id)},b.id)}),s.jsx("div",{ref:j,className:"h-4"}),O&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:K("flex-1 flex-col",f?"flex":"hidden md:flex"),children:y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ne,{variant:"ghost",size:"sm",onClick:ie,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(At,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(ye,{icon:y.icon,name:y.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:y.title}),y.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:Y?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})}):F.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:F.map(b=>s.jsx($t,{connectionId:y.id,tool:b,isSelected:X(y.id,b.name),onToggle:()=>J(y.id,b.name)},b.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}const Ne=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],Qt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ht(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ne.length;return Ne[n]??Ne[0]}function qt(t,e){return Qt[t]??"bg-neutral-400"}const Zt=Pe({role:Pe({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:ke(),staticPermissions:Ie(se()),toolSet:De(se(),Ie(se())),allowAllModels:ke(),modelSet:De(se(),Ie(se())),memberIds:Ie(se())});function ot(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Ye(t,e,n){const l=s.jsx(xe,{checked:t,disabled:e,onCheckedChange:n});return e?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:l})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):l}function Xt(t){const e=H.c(28),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let g;e[0]!==h?(g=h.trim().toLowerCase(),e[0]=h,e[1]=g):g=e[1];const f=$.useDeferredValue(g);let a;if(e[2]!==n||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==l){const x=Ut(),o=(v,_)=>{if(!c){if(n&&_){const R=x.flatMap(es).flatMap(Wt);i(!1),r(R.filter(p=>!v.tools.includes(p)));return}n||r(Vt(v,l,!_))}};let m;e[10]!==f?(m=v=>{const{section:_,capabilities:R}=v;return{section:_,capabilities:R.filter(p=>!f||p.label.toLowerCase().includes(f)||p.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const S=x.map(m).filter(Jt);let T;e[12]!==n||e[13]!==i||e[14]!==r?(T=()=>{i(!n),r([])},e[12]=n,e[13]=i,e[14]=r,e[15]=T):T=e[15];let E;e[16]!==n||e[17]!==c||e[18]!==T?(E=Ye(n,c,T),e[16]=n,e[17]=c,e[18]=T,e[19]=E):E=e[19];let N;e[20]!==n||e[21]!==i||e[22]!==r||e[23]!==c?(N=c?void 0:()=>{i(!n),r([])},e[20]=n,e[21]=i,e[22]=r,e[23]=c,e[24]=N):N=e[24];let C;e[25]!==E||e[26]!==N?(C=s.jsx(Ue,{title:"General",children:s.jsx(Be,{children:s.jsx(Ve,{title:"All organization permissions",description:"Grant full access to all features below",action:E,onClick:N})})}),e[25]=E,e[26]=N,e[27]=C):C=e[27],a=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[C,S.length===0&&f?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",h,"”"]}):S.map(v=>{const{section:_,capabilities:R}=v;return s.jsx(Ue,{title:_,children:s.jsx(Be,{children:R.map(p=>{const O=Bt(p,l,n);return s.jsx(Ve,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[p.label,p.dangerous&&s.jsx(ft,{size:12,className:"text-amber-500 shrink-0"})]}),description:p.description,action:Ye(O,c,()=>o(p,O)),onClick:c?void 0:()=>o(p,O)},p.id)})})},_)})]})}),e[2]=n,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=l,e[9]=a}else a=e[9];return a}function Jt(t){return t.capabilities.length>0}function Wt(t){return t.tools}function es(t){return t.capabilities}const it={anthropic:"Anthropic",openrouter:"OpenRouter"},ts={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function ss(t,e){const n=t.indexOf("/"),l=n>0?t.slice(0,n):e;return l.startsWith("~")?l.slice(1):l}function ns(t){return ts[t]??it[t]??t}function ls(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const rt=30;function os(t){const e=H.c(44),{connectionId:n,subProviderId:l,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:g,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:x,readOnly:o,defaultExpanded:m}=t,[S,T]=$.useState(m),E=m||S,N=T,[C,v]=$.useState(rt);let _;e[0]!==f||e[1]!==g||e[2]!==c?(_=j=>g||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=g,e[2]=c,e[3]=_):_=e[3];const R=_;let p;if(e[4]!==R||e[5]!==d){let j;e[7]!==R?(j=u=>R(u.id),e[7]=R,e[8]=j):j=e[8],p=d.filter(j),e[4]=R,e[5]=d,e[6]=p}else p=e[6];const O=p.length;let I;if(e[9]!==h||e[10]!==g||e[11]!==n||e[12]!==O||e[13]!==E||e[14]!==r||e[15]!==R||e[16]!==d||e[17]!==x||e[18]!==a||e[19]!==o||e[20]!==l||e[21]!==i||e[22]!==C){const j=d.slice(0,C),u=d.length>C;let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=()=>N(cs),e[24]=w):w=e[24];const A=r??tt[l]??st;let k;e[25]!==i||e[26]!==A?(k=s.jsx(ye,{icon:A,name:i,size:"sm"}),e[25]=i,e[26]=A,e[27]=k):k=e[27];let G;e[28]!==i?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[28]=i,e[29]=G):G=e[29];let U;e[30]!==k||e[31]!==G?(U=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[k,G]}),e[30]=k,e[31]=G,e[32]=U):U=e[32];let B;e[33]!==O||e[34]!==d.length?(B=s.jsxs(ge,{variant:"secondary",className:"text-xs text-muted-foreground",children:[O,"/",d.length," enabled"]}),e[33]=O,e[34]=d.length,e[35]=B):B=e[35];let L;e[36]!==E?(L=E?s.jsx(Mt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=E,e[37]=L):L=e[37];let z;e[38]!==L||e[39]!==B?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,L]}),e[38]=L,e[39]=B,e[40]=z):z=e[40];let y;e[41]!==z||e[42]!==U?(y=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:w,children:[U,z]}),e[41]=z,e[42]=U,e[43]=y):y=e[43],I=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,E&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(M=>{const Y=R(M.id),F=()=>{if(!o){if(g){x(n,h,M.id);return}a(n,M.id)}};return s.jsxs("div",{className:K("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!o&&"hover:bg-muted/50 cursor-pointer"),onClick:F,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:M.title})}),s.jsx("div",{onClick:as,children:o?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:Y,disabled:!0,onCheckedChange:rs})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:Y,onCheckedChange:F})})]},M.id)}),u&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>v(is),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=g,e[11]=n,e[12]=O,e[13]=E,e[14]=r,e[15]=R,e[16]=d,e[17]=x,e[18]=a,e[19]=o,e[20]=l,e[21]=i,e[22]=C,e[23]=I}else I=e[23];return I}function is(t){return t+rt}function rs(){}function as(t){return t.stopPropagation()}function cs(t){return!t}function ds(t){const e=H.c(33),{connection:n,selectedModels:l,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:g}=t,f=Lt(n.id);let a,x,o,m,S;if(e[0]!==h||e[1]!==i||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==g||e[9]!==c||e[10]!==l){S=Symbol.for("react.early_return_sentinel");e:{let N;e[16]!==n.label?(N=A=>({...A,id:A.modelId,provider:n.label}),e[16]=n.label,e[17]=N):N=e[17];const C=f.filter(hs).map(N),v=c.trim().toLowerCase(),_=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(_.length===0){S=null;break e}const R=new Map;for(const A of _){const k=ss(A.id,n.providerId),G=R.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ls(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),R.set(k,G)}const p=Array.from(R.entries()).map(fs).sort(us),O=p.length===1||v.length>0;o="flex flex-col gap-3";const I=tt[n.providerId]??st;let j;e[18]!==n.providerId||e[19]!==I?(j=s.jsx("img",{src:I,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=I,e[20]=j):j=e[20];const u=it[n.providerId]??n.providerId;let w;e[21]!==u?(w=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=w):w=e[22],e[23]!==w||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,w]}),e[23]=w,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",x=p.map(A=>s.jsx(os,{connectionId:n.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(ms),selectedModels:l,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:g,defaultExpanded:O},A.id))}e[0]=h,e[1]=i,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=g,e[9]=c,e[10]=l,e[11]=a,e[12]=x,e[13]=o,e[14]=m,e[15]=S}else a=e[11],x=e[12],o=e[13],m=e[14],S=e[15];if(S!==Symbol.for("react.early_return_sentinel"))return S;let T;e[26]!==a||e[27]!==x?(T=s.jsx("div",{className:a,children:x}),e[26]=a,e[27]=x,e[28]=T):T=e[28];let E;return e[29]!==o||e[30]!==m||e[31]!==T?(E=s.jsxs("div",{className:o,children:[m,T]}),e[29]=o,e[30]=m,e[31]=T,e[32]=E):E=e[32],E}function ms(t){return t.id}function us(t,e){return t.name.localeCompare(e.name)}function fs(t){const[e,n]=t;return{id:e,name:ns(e),logo:n.logo,models:n.models}}function hs(t,e,n){return n.findIndex(l=>l.modelId===t.modelId)===e}function gs(t){const e=H.c(35),{allowAllModels:n,modelSet:l,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,g=$.useDeferredValue(h),f=wt();let a;e[0]!==l||e[1]!==r?(a=(p,O)=>{const I=l[p]??[],j={...l};if(I.includes(O)){const u=I.filter(w=>w!==O);u.length===0?delete j[p]:j[p]=u}else j[p]=[...I,O];r(j)},e[0]=l,e[1]=r,e[2]=a):a=e[2];const x=a;let o;e[3]!==l||e[4]!==i||e[5]!==r?(o=(p,O,I)=>{i(!1),r({...l,[p]:O.filter(j=>j!==I)})},e[3]=l,e[4]=i,e[5]=r,e[6]=o):o=e[6];const m=o,S=!c&&"hover:bg-muted/50 cursor-pointer";let T;e[7]!==S?(T=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=T):T=e[8];let E;e[9]!==n||e[10]!==i||e[11]!==r||e[12]!==c?(E=()=>{if(c)return;const p=!n;i(p),p&&r({})},e[9]=n,e[10]=i,e[11]=r,e[12]=c,e[13]=E):E=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=N):N=e[14];let C;e[15]!==n||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:ps,children:c?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:n,disabled:!0,onCheckedChange:xs})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:n,onCheckedChange:p=>{i(p),p&&r({})}})}),e[15]=n,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==T||e[21]!==E||e[22]!==C?(v=s.jsxs("div",{className:T,onClick:E,children:[N,C]}),e[20]=T,e[21]=E,e[22]=C,e[23]=v):v=e[23];let _;e[24]!==f||e[25]!==n||e[26]!==g||e[27]!==m||e[28]!==l||e[29]!==c||e[30]!==x?(_=f.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):f.map(p=>s.jsx($.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(fe,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(ds,{connection:p,selectedModels:l[p.id]??[],allowAllModels:n,onToggleModel:x,onExitAllowAll:m,allConnectionModelsSelected:(l[p.id]??[]).includes("*"),searchQuery:g,readOnly:c})},p.id)),e[24]=f,e[25]=n,e[26]=g,e[27]=m,e[28]=l,e[29]=c,e[30]=x,e[31]=_):_=e[31];let R;return e[32]!==_||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,_]}),e[32]=_,e[33]=v,e[34]=R):R=e[34],R}function xs(){}function ps(t){return t.stopPropagation()}function bs(t){const e=H.c(52),{open:n,onOpenChange:l,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=$.useState(""),c=$.useDeferredValue(d);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[f,a]=$.useState(g),{data:x}=nt();let o,m,S,T,E,N,C,v,_,R,p;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==r||e[4]!==l||e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==i){const U=x?.data?.members??[];let B;e[20]!==c?(B=y=>{const M=c.toLowerCase();return y.user?.name?.toLowerCase().includes(M)||y.user?.email?.toLowerCase().includes(M)},e[20]=c,e[21]=B):B=e[21];const L=U.filter(B);let z;e[22]!==r||e[23]!==l||e[24]!==f?(z=()=>{r(f),a([]),l(!1)},e[22]=r,e[23]=l,e[24]=f,e[25]=z):z=e[25],S=z,m=Qe,R=n,p=l,o=He,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(qe,{className:"px-6 pt-6",children:[s.jsx(Ze,{children:"Add Members to Role"}),s.jsx(Xe,{children:"Select members to add to this role."})]}),e[26]=_):_=e[26],N="flex flex-col h-80",e[27]!==d?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ve,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],T="flex-1 overflow-auto",E=L.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:L.map(y=>{const M=y.role!=="owner",Y=i.includes(y.id),F=f.includes(y.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!M||Y?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(we,{checked:F||Y,onCheckedChange:()=>{!M||Y||a(X=>X.includes(y.id)?X.filter(J=>J!==y.id):[...X,y.id])},disabled:!M||Y}),s.jsx(lt,{url:y.user?.image??void 0,fallback:ot(y.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:y.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.user?.email})]}),!M&&s.jsx(ge,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&M&&s.jsx(ge,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=r,e[4]=l,e[5]=n,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=S,e[12]=T,e[13]=E,e[14]=N,e[15]=C,e[16]=v,e[17]=_,e[18]=R,e[19]=p}else o=e[9],m=e[10],S=e[11],T=e[12],E=e[13],N=e[14],C=e[15],v=e[16],_=e[17],R=e[18],p=e[19];let O;e[29]!==T||e[30]!==E?(O=s.jsx("div",{className:T,children:E}),e[29]=T,e[30]=E,e[31]=O):O=e[31];let I;e[32]!==O||e[33]!==N||e[34]!==C?(I=s.jsxs("div",{className:N,children:[C,O]}),e[32]=O,e[33]=N,e[34]=C,e[35]=I):I=e[35];let j;e[36]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Je,{children:"Cancel"}),e[36]=j):j=e[36];const u=f.length===0,w=f.length>0&&`(${f.length})`;let A;e[37]!==S||e[38]!==u||e[39]!==w?(A=s.jsxs(We,{className:"px-6 pb-6",children:[j,s.jsxs(et,{onClick:S,disabled:u,children:["Add ",w]})]}),e[37]=S,e[38]=u,e[39]=w,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==I||e[43]!==A||e[44]!==v||e[45]!==_?(k=s.jsxs(o,{className:v,children:[_,I,A]}),e[41]=o,e[42]=I,e[43]=A,e[44]=v,e[45]=_,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==R||e[50]!==p?(G=s.jsx(m,{open:R,onOpenChange:p,children:k}),e[47]=m,e[48]=k,e[49]=R,e[50]=p,e[51]=G):G=e[51],G}function Es(t){const e=H.c(29),{memberIds:n,onMemberIdsChange:l,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,g=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=$.useDeferredValue(d),{data:x}=nt();let o,m,S;if(e[0]!==x?.data?.members||e[1]!==a||e[2]!==n||e[3]!==l||e[4]!==g||e[5]!==f||e[6]!==d){const v=x?.data?.members??[];let _;e[10]!==n?(_=I=>n.includes(I.id),e[10]=n,e[11]=_):_=e[11];const R=v.filter(_);let p;e[12]!==a?(p=I=>{const j=a.toLowerCase();return I.user?.name?.toLowerCase().includes(j)||I.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=p):p=e[13];const O=R.filter(p);S="flex flex-col h-full",o="flex-1 overflow-auto",m=R.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',d,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:O.map(I=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(lt,{url:I.user?.image??void 0,fallback:ot(I.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:I.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.user?.email})]}),g?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(ze,{size:16})})})}),s.jsx(Te,{children:s.jsx("p",{children:f})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(j=>j!==I.id)),children:s.jsx(ze,{size:16})})]},I.id))}),e[0]=x?.data?.members,e[1]=a,e[2]=n,e[3]=l,e[4]=g,e[5]=f,e[6]=d,e[7]=o,e[8]=m,e[9]=S}else o=e[7],m=e[8],S=e[9];let T;e[14]!==o||e[15]!==m?(T=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=T):T=e[16];let E;e[17]!==n||e[18]!==l?(E=v=>l([...n,...v]),e[17]=n,e[18]=l,e[19]=E):E=e[19];let N;e[20]!==h||e[21]!==n||e[22]!==c||e[23]!==E?(N=s.jsx(bs,{open:h,onOpenChange:c,selectedMemberIds:n,onAddMembers:E}),e[20]=h,e[21]=n,e[22]=c,e[23]=E,e[24]=N):N=e[24];let C;return e[25]!==S||e[26]!==T||e[27]!==N?(C=s.jsxs("div",{className:S,children:[T,N]}),e[25]=S,e[26]=T,e[27]=N,e[28]=C):C=e[28],C}function Ts(t){const e=H.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let l;return e[1]!==t?(l=s.jsx($.Suspense,{fallback:n,children:s.jsx(Es,{...t})}),e[1]=t,e[2]=l):l=e[2],l}const _s={owner:[],admin:[],user:[]};function Is(t,e,n,l){const i=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:_s[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function Ss(t,e,n){const l=t.permission||{},i=l.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,x]of Object.entries(l))if(!(a==="self"||a==="models"))if(a==="*")for(const o of n)h[o.id]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x;else{const o=n.find(m=>m.id===a);o&&(h[a]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x)}const c=l.models||[],g=c.length===0||c.includes("*:*"),f={};if(!g)for(const a of c){const x=a.indexOf(":");if(x===-1)continue;const o=a.slice(0,x),m=a.slice(x+1);f[o]||(f[o]=[]),f[o].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:r,staticPermissions:d,toolSet:h,allowAllModels:g,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Ns(t,e){const n={};t.allowAllStaticPermissions?n.self=["*"]:t.staticPermissions.length>0&&(n.self=t.staticPermissions);for(const[l,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===l)?.tools?.map(h=>h.name)??[];n[l]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)l.push(`${i}:${d}`);l.length>0&&(n.models=l)}return n}function Cs(t,e,n){return t.kind==="builtin"?Is(t.role,e,void 0):t.kind==="custom"?Ss(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function As(t){const e=H.c(6),{readOnly:n,readOnlyMessage:l,onOpen:i}=t,r=l===void 0?"Owner membership cannot be changed":l;if(n){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Ae,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let g;return e[1]!==r?(g=s.jsx(pe,{children:s.jsxs(be,{children:[c,s.jsx(Te,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=g):g=e[2],g}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ae,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(ne,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Rs(t){const e=H.c(14),{locator:n}=Se(),l=je(),i=yt();let r;e[0]!==n?(r=re.members(n),e[0]=n,e[1]=r):r=e[1];let d;e[2]!==l?(d=()=>l.organization.listMembers(),e[2]=l,e[3]=d):d=e[3];let h;e[4]!==r||e[5]!==d?(h={queryKey:r,queryFn:d},e[4]=r,e[5]=d,e[6]=h):h=e[6];const{data:c,isPending:g}=Re(h);if(g||!i){let o;return e[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=o):o=e[7],o}let f;e[8]!==c?.data?.members?(f=c?.data?.members??[],e[8]=c?.data?.members,e[9]=f):f=e[9];const a=f;let x;return e[10]!==i||e[11]!==a||e[12]!==t?(x=s.jsx(Os,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=x):x=e[13],x}function Os({target:t,onBack:e,onSaved:n,members:l,connections:i}){const{locator:r}=Se(),d=je(),h=$e(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,x]=$.useState(c?"org":"mcp"),o=mt({resolver:ut(Zt),defaultValues:Cs(t,l,i)}),m=o.formState.isValid,S=o.formState.isDirty,T=Fe({mutationFn:async u=>{const w=Ns(u,i),A=u.role.slug||u.role.label.toLowerCase().replace(/\s+/g,"-"),k=(u.role.slug==="owner"||u.role.slug==="admin"||u.role.slug==="user")&&!u.role.id,G=async(U,B)=>{const L=l.filter(M=>M.role===(B??U)).map(M=>M.id),z=u.memberIds.filter(M=>!L.includes(M)),y=L.filter(M=>!u.memberIds.includes(M));for(const M of z){const Y=await d.organization.updateMemberRole({memberId:M,role:[U]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}for(const M of y){const Y=await d.organization.updateMemberRole({memberId:M,role:["user"]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}};if(k)return await G(u.role.slug),u;if(u.role.id){const U=u.role.label.toLowerCase().replace(/\s+/g,"-"),B=u.role.slug,L=U!==B,z=await d.organization.updateRole({roleId:u.role.id,data:{permission:w,...L?{roleName:U}:{}}});if(z?.error)throw new Error(z.error.message??"Something went wrong");return await G(L?U:B,L?B:void 0),L?{...u,role:{...u.role,slug:U}}:u}else{const U=await d.organization.createRole({role:A,permission:w});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const L=await d.organization.updateMemberRole({memberId:B,role:[A]});if(L?.error)throw new Error(L.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,w)=>{h.invalidateQueries({queryKey:re.members(r)}),h.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!w.role.id&&!w.role.slug,k=w.role.slug==="owner"&&!w.role.id;Oe(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:w.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),o.reset(u),n(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),E=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}T.mutate(u)}),N=!g,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...g?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[_,R]=$.useState(""),[p,O]=$.useState(!1),I=u=>{x(u),R("")},j={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:K("flex flex-col",a!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:N&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{variant:"outline",size:"sm",onClick:e,disabled:T.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:E,disabled:T.isPending||!m||!S,children:T.isPending?"Saving...":f?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",t.kind==="builtin"?qt(t.role):Ht(o.watch("role.label")))}),g&&s.jsx(Ke,{size:16,className:"text-muted-foreground shrink-0"}),f||t.kind==="custom"?s.jsx("input",{...o.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:f}):s.jsx("span",{className:"truncate",children:C})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(u=>s.jsx("button",{type:"button",onClick:()=>I(u.id),className:K("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",a===u.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:u.label},u.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ve,{value:_,onChange:R,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(As,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>O(!0)})]})]})}),s.jsx("div",{className:K("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",a!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:K(a!=="org"&&"h-full overflow-hidden",a!=="models"&&a!=="org"&&"border border-border rounded-xl bg-card"),children:[a==="mcp"&&!g&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:_}),a==="org"&&s.jsx(Xt,{allowAllStaticPermissions:o.watch("allowAllStaticPermissions"),staticPermissions:o.watch("staticPermissions"),onAllowAllChange:u=>o.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>o.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:g,searchQuery:_}),a==="models"&&s.jsx(gs,{allowAllModels:o.watch("allowAllModels"),modelSet:o.watch("modelSet"),onAllowAllChange:u=>o.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>o.setValue("modelSet",u,{shouldDirty:!0}),readOnly:g,searchQuery:_}),a==="members"&&s.jsx(Ts,{memberIds:o.watch("memberIds"),onMemberIdsChange:u=>o.setValue("memberIds",u,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?"User is the default role — members can't be removed from it; assign another role to change their access":"Owner membership cannot be changed",searchQuery:_,addMemberDialogOpen:p,onAddMemberDialogOpenChange:O})]})})]})})}function js(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function vs(t){const e=H.c(6),{area:n,children:l}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==n||e[1]!==l||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:n,children:l}),e[0]=n,e[1]=l,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const ys=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ce=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function ws(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ce.length;return Ce[n]??Ce[0]}const Ls={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ms(t,e){return e?Ls[t]??"bg-neutral-400":ws(t)}function Ps(){const t=H.c(77),[e,n]=$.useState(""),[l,i]=$.useState(null),r=gt();let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[0]=d):d=t[0];const{role:h}=xt(d),{locator:c}=Se(),g=je(),f=$e(),{customRoles:a,refetch:x}=pt();let o;t[1]!==r?(o=P=>r({to:".",search:V=>({...V,role:P})}),t[1]=r,t[2]=o):o=t[2];const m=o;let S;e:{if(!h){S=null;break e}if(h==="new"){S={kind:"new"};break e}if(h.startsWith("builtin-")){S={kind:"builtin",role:h.slice(8)};break e}let P;t[3]!==h?(P=ae=>ae.id===h,t[3]=h,t[4]=P):P=t[4];const V=a.find(P);S=V?{kind:"custom",role:V}:null}const T=S;let E;t[5]!==c?(E=re.members(c),t[5]=c,t[6]=E):E=t[6];let N;t[7]!==g?(N=()=>g.organization.listMembers(),t[7]=g,t[8]=N):N=t[8];let C;t[9]!==E||t[10]!==N?(C={queryKey:E,queryFn:N},t[9]=E,t[10]=N,t[11]=C):C=t[11];const{data:v}=Re(C);let _;t[12]!==v?.data?.members?(_=v?.data?.members??[],t[12]=v?.data?.members,t[13]=_):_=t[13];const R=_;let p;t[14]!==R?(p=P=>R.filter(V=>V.role===P).length,t[14]=R,t[15]=p):p=t[15];const O=p;let I;if(t[16]!==a||t[17]!==O||t[18]!==e){let P;t[20]!==O?(P=ce=>({kind:"builtin",role:{...ce,memberCount:O(ce.role)}}),t[20]=O,t[21]=P):P=t[21];const V=ys.map(P);let ae;t[22]!==O?(ae=ce=>({kind:"custom",role:{...ce,memberCount:O(ce.role)}}),t[22]=O,t[23]=ae):ae=t[23];const at=a.map(ae);if(I=[...V,...at],e){const ce=e.toLowerCase();I=I.filter(ct=>ct.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=I}else I=t[19];let j;t[24]!==g?(j=async P=>{const V=await g.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=g,t[25]=j):j=t[25];const u=Fe({mutationFn:j,onSuccess:(P,V)=>{Oe("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),x(),T?.kind==="custom"&&T.role.id===V&&m(void 0)},onError:zs});let w,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Vs,cellClassName:"flex-1 min-w-0",sortable:!0},w={id:"type",header:"Type",render:Bs,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:Us,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Gs,cellClassName:"w-24 shrink-0"},t[26]=w,t[27]=A,t[28]=k,t[29]=G):(w=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,w,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(bt,{children:[s.jsx(Et,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ks,children:s.jsx(It,{size:16})})}),s.jsx(Tt,{align:"end",onClick:Ds,children:s.jsxs(_t,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(St,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let L;t[31]!==m?(L=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=L):L=t[32];const z=L;if(T){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==x||t[36]!==m?(V=()=>{x(),m(void 0)},t[35]=x,t[36]=m,t[37]=V):V=t[37],s.jsx(Rs,{target:T,onBack:P,onSaved:V},js(T))}let y;t[38]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(te.Title,{children:"Roles"}),t[38]=y):y=t[38];let M;t[39]===Symbol.for("react.memo_cache_sentinel")?(M=P=>{P.key==="Escape"&&(n(""),P.target.blur())},t[39]=M):M=t[39];let Y;t[40]!==e?(Y=s.jsx(ve,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:M}),t[40]=e,t[41]=Y):Y=t[41];let F;t[42]!==m?(F=()=>m("new"),t[42]=m,t[43]=F):F=t[43];let X;t[44]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(Ae,{size:16}),t[44]=X):X=t[44];let J;t[45]!==F?(J=s.jsxs(ne,{onClick:F,children:[X,"Create Role"]}),t[45]=F,t[46]=J):J=t[46];let le;t[47]!==Y||t[48]!==J?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,J]}),t[47]=Y,t[48]=J,t[49]=le):le=t[49];let oe;t[50]!==e?(oe=e?s.jsx(Ge,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(Ge,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==I||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(Nt,{columns:B,data:I,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=I,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let b;t[57]!==le||t[58]!==ie?(b=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,le,ie]})})}),t[57]=le,t[58]=ie,t[59]=b):b=t[59];const D=l!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&i(null),t[60]=Q):Q=t[60];let q;t[61]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Ze,{children:"Delete Role"}),t[61]=q):q=t[61];const W=l?.label;let Z;t[62]!==W?(Z=s.jsxs(qe,{children:[q,s.jsxs(Xe,{children:['Are you sure you want to delete the "',W,'" role? This action cannot be undone.']})]}),t[62]=W,t[63]=Z):Z=t[63];let ee;t[64]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(Je,{children:"Cancel"}),t[64]=ee):ee=t[64];let de;t[65]!==u||t[66]!==l?(de=s.jsxs(We,{children:[ee,s.jsx(et,{onClick:()=>{l?.id&&u.mutate(l.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=l,t[67]=de):de=t[67];let me;t[68]!==Z||t[69]!==de?(me=s.jsxs(He,{children:[Z,de]}),t[68]=Z,t[69]=de,t[70]=me):me=t[70];let ue;t[71]!==D||t[72]!==me?(ue=s.jsx(Qe,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let _e;return t[74]!==b||t[75]!==ue?(_e=s.jsxs(te,{children:[b,ue]}),t[74]=b,t[75]=ue,t[76]=_e):_e=t[76],_e}function Ds(t){return t.stopPropagation()}function ks(t){return t.stopPropagation()}function Gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Us(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,n=[];return e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function Bs(t){return t.kind==="builtin"?s.jsx(ge,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(ge,{variant:"outline",className:"text-xs",children:"Custom"})}function Vs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",Ms(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(Ke,{size:12,className:"text-muted-foreground shrink-0"})]})}function zs(t,e){Oe("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),he.error(t instanceof Error?t.message:"Failed to delete role")}function Ys(){const t=H.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load roles"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{fallback:e,children:s.jsx($.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Ps,{})})}),t[1]=n):n=t[1],n}function ul(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vs,{area:"roles",children:s.jsx(Ys,{})}),t[0]=e):e=t[0],e}export{ul as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as c}from"./header-tab-button-CXc-7W-y.js";function t(r){return(e,a)=>{c(e),r(e,a)}}export{t as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as m,j as s,l as o}from"./index-
|
|
1
|
+
import{e as m,j as s,l as o}from"./index-BtcINkTm.js";import{i as c}from"./AlertCircle-DAV0VdD_.js";import{i as l}from"./Check-ClIa17j0.js";function u(i){const e=m.c(3),{isPending:a,isError:n}=i;if(n){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-destructive",children:[s.jsx(c,{size:13}),"Couldn't save"]}),e[0]=t):t=e[0],t}if(a){let t;return e[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(o,{size:13,className:"animate-spin"}),"Saving…"]}),e[1]=t):t=e[1],t}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground/70",children:[s.jsx(l,{size:13}),"Saved"]}),e[2]=r):r=e[2],r}export{u as S};
|