decocms 3.18.3 → 3.18.4
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-B-r3okdw.js → AlertCircle-DBLUz--u.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-tDPH0_4m.js → ArrowUpRight-l-GcKPYK.js} +1 -1
- package/dist/client/assets/{Check-BhYHl6b1.js → Check-BxIVbrMR.js} +1 -1
- package/dist/client/assets/{CheckCircle-CVL_FX-8.js → CheckCircle-rFqh1KDn.js} +1 -1
- package/dist/client/assets/{ChevronDown-CniGrT2-.js → ChevronDown-P5aorJ8-.js} +1 -1
- package/dist/client/assets/{ChevronLeft-kGfXoAV-.js → ChevronLeft-e8a25ahy.js} +1 -1
- package/dist/client/assets/{ChevronRight-COCWmVlT.js → ChevronRight-WB5knV5A.js} +1 -1
- package/dist/client/assets/{ChevronUp-DzsjrX2b.js → ChevronUp-nQBmktAW.js} +1 -1
- package/dist/client/assets/{Container-D1PVb_TW.js → Container-Dls_ClFq.js} +1 -1
- package/dist/client/assets/{DotsVertical-_gNEu7zY.js → DotsVertical-CxHHcGx6.js} +1 -1
- package/dist/client/assets/{Eye-Cja82Q7U.js → Eye-EKPlnsLc.js} +1 -1
- package/dist/client/assets/{FilterLines-Bel4K6qN.js → FilterLines-DqQIAzT9.js} +1 -1
- package/dist/client/assets/{Globe01-D39kUdoP.js → Globe01-Tm1ARX4Z.js} +1 -1
- package/dist/client/assets/{HardDrive-CgdcwvGL.js → HardDrive-JzeH-CyJ.js} +1 -1
- package/dist/client/assets/{Key01-DYyg_tnP.js → Key01-CeoBFgZd.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CoO_xxXK.js → LayoutLeft-xp2y9xUi.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DN-lMhNz.js → LinkExternal01-BrCQL34C.js} +1 -1
- package/dist/client/assets/{Monitor01-gHlWGw8m.js → Monitor01-DhIohKdB.js} +1 -1
- package/dist/client/assets/{Palette-D9uHHj9p.js → Palette-DcvO-xme.js} +1 -1
- package/dist/client/assets/{Play-RXfEurLC.js → Play-Cl-75oPS.js} +1 -1
- package/dist/client/assets/{Plus-7ete7Chf.js → Plus-DMk97-_x.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-BcEdc8yb.js → RefreshCcw01-BKQsxntF.js} +1 -1
- package/dist/client/assets/{SearchMd-CW4p_47C.js → SearchMd-D5J9uZcf.js} +1 -1
- package/dist/client/assets/{Settings02-BilcqWFp.js → Settings02-VViB9t6t.js} +1 -1
- package/dist/client/assets/{Shield01-CWDizliI.js → Shield01-D5gYDa2-.js} +1 -1
- package/dist/client/assets/{Star01-Bc8W2nUe.js → Star01--s8ZFg64.js} +1 -1
- package/dist/client/assets/{Stars01-H8xKRb3B.js → Stars01-BidgaxVI.js} +1 -1
- package/dist/client/assets/{Stars02-BG9BQfDN.js → Stars02-CIMeB8Tw.js} +1 -1
- package/dist/client/assets/{Sun-2czCa7nh.js → Sun-F5_OmHwF.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-X0-A3wlA.js → SwitchHorizontal01-BDAEnkfq.js} +1 -1
- package/dist/client/assets/{Tool01-C_efsdJ9.js → Tool01-BgJ0N26M.js} +1 -1
- package/dist/client/assets/{Trash01-D8gyPG4F.js → Trash01-C7l0NheK.js} +1 -1
- package/dist/client/assets/{Upload01-CeZYEoZ8.js → Upload01-BpTwEhwN.js} +1 -1
- package/dist/client/assets/{User01-CfhPWLkj.js → User01-61G-I9Nt.js} +1 -1
- package/dist/client/assets/{Users01-CwA0YZWL.js → Users01-DedWtozu.js} +1 -1
- package/dist/client/assets/{Users03-D_dEpKEB.js → Users03-DhyPNTfH.js} +1 -1
- package/dist/client/assets/{X-Dlvmz5Lj.js → X-gpy8SRoe.js} +1 -1
- package/dist/client/assets/{XCircle-Q3LP6RaJ.js → XCircle-B8hhQ7We.js} +1 -1
- package/dist/client/assets/{XClose-CMlIOxQg.js → XClose-BIl1LPyR.js} +1 -1
- package/dist/client/assets/{Zap-C5hsI9kw.js → Zap-DRW8v7hZ.js} +1 -1
- package/dist/client/assets/{ZapSquare-OkNAvBeL.js → ZapSquare-DwVlJ80d.js} +1 -1
- package/dist/client/assets/{ZoomOut-Btzzfq_K.js → ZoomOut-CTra4wHa.js} +1 -1
- package/dist/client/assets/{access-gate-Uv1zLF5Y.js → access-gate-uwoZnAgx.js} +1 -1
- package/dist/client/assets/{accordion-CoOSA6zg.js → accordion-B0fd1tnF.js} +1 -1
- package/dist/client/assets/{add-section-modal-BH5ViPBB.js → add-section-modal-DiKHi0M1.js} +1 -1
- package/dist/client/assets/agent-capabilities-BjTqE21c.js +3 -0
- package/dist/client/assets/{agent-icon-BiKNgOeT.js → agent-icon-DZCJD2_a.js} +1 -1
- package/dist/client/assets/{agent-icons-Bt1m_ENb.js → agent-icons-jN-Zyl-6.js} +1 -1
- package/dist/client/assets/{agents-list-Bf5wbGTB.js → agents-list-B-auSMeU.js} +1 -1
- package/dist/client/assets/{ai-providers-DRIUaAzW.js → ai-providers-9z8nTePs.js} +1 -1
- package/dist/client/assets/{alert-BWTI9LY5.js → alert-CXw2R1J0.js} +1 -1
- package/dist/client/assets/{alert-dialog-D1sXzFR6.js → alert-dialog-BEqZ9uGO.js} +1 -1
- package/dist/client/assets/app-editor-L6xg0gr0.js +1 -0
- package/dist/client/assets/{auth-catchall-p5-aZBW9.js → auth-catchall-Bfw73AGa.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DUM0vTfJ.js → auth-split-layout-BReVBoRk.js} +1 -1
- package/dist/client/assets/{automation-list-row-Cdl3j3R5.js → automation-list-row-DijFSvDw.js} +1 -1
- package/dist/client/assets/{automation-runs-DjKtm8sC.js → automation-runs-hCC2W9Z-.js} +1 -1
- package/dist/client/assets/{automations-DQdCdeIY.js → automations-CmCVzo7I.js} +1 -1
- package/dist/client/assets/{avatar-DcRL4WFc.js → avatar-Bcbs0fiL.js} +1 -1
- package/dist/client/assets/{badge-B2isb5t4.js → badge-BARx7FvE.js} +1 -1
- package/dist/client/assets/{brand-context-BlzqcU4f.js → brand-context-DdQzgdZa.js} +1 -1
- package/dist/client/assets/{buckets-CNaD-KsO.js → buckets-uoDmahjJ.js} +1 -1
- package/dist/client/assets/{calendar-DleQOR6C.js → calendar-B30GJXaY.js} +1 -1
- package/dist/client/assets/{capability-load-error-BIabmgVZ.js → capability-load-error-ClqXQbgV.js} +1 -1
- package/dist/client/assets/{card-7rPQAdEb.js → card-opRPZv32.js} +1 -1
- package/dist/client/assets/{chat-context-BpOhQo4D.js → chat-context-BbbKc5EF.js} +1 -1
- package/dist/client/assets/{checkbox-DmtUHgAJ.js → checkbox-wlYL0b3G.js} +1 -1
- package/dist/client/assets/{cli-auth-success-C8MYWV1f.js → cli-auth-success-Bs1_vcy6.js} +1 -1
- package/dist/client/assets/{collection-detail-CClLQ75n.js → collection-detail-C2S9fIG-.js} +1 -1
- package/dist/client/assets/{collection-display-button-CCzBk9Sy.js → collection-display-button-Cay-ZdpD.js} +1 -1
- package/dist/client/assets/{collection-search-CmhXzxiX.js → collection-search-C3Lp1ZRv.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-C0xQn6vd.js → collection-table-wrapper-BnCe5cyI.js} +1 -1
- package/dist/client/assets/{collection-tabs-CyAZqj58.js → collection-tabs-BoQd-dND.js} +1 -1
- package/dist/client/assets/{collections-D4J1DJ61.js → collections-BaDzxzwW.js} +1 -1
- package/dist/client/assets/{command-B-HknKNN.js → command-DWpPyJE7.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-wDkcQT-i.js → connect-desktop-dialog-Cy-b1jPM.js} +1 -1
- package/dist/client/assets/{connection-card-DiU6mNhU.js → connection-card-BI-CSazh.js} +1 -1
- package/dist/client/assets/{connection-detail-w_f-Stjx.js → connection-detail-OEPQ1Wwv.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B5x3bKYp.js → connection-form-helpers-CbxXqT_u.js} +1 -1
- package/dist/client/assets/{connections-tTj2cPUZ.js → connections-XD7RqsTp.js} +1 -1
- package/dist/client/assets/{constants-DpuEAZHq.js → constants-Cee8XKoZ.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-CLAzhWPC.js → decopilot-sse-pool-DiOxs3f4.js} +1 -1
- package/dist/client/assets/{dialog-Co3xDPPR.js → dialog-CFcYm0YL.js} +1 -1
- package/dist/client/assets/{domain-settings-C-YGglFw.js → domain-settings-BeRCH_mn.js} +1 -1
- package/dist/client/assets/{drawer-B7pzzO8k.js → drawer-CG7DFuyM.js} +1 -1
- package/dist/client/assets/{dropdown-menu-cIyq0nsy.js → dropdown-menu-CKTrR8YS.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-2hRmXntY.js → dynamic-plugin-layout-7IcBH65R.js} +1 -1
- package/dist/client/assets/{empty-state-BVd0NO3b.js → empty-state-74R-YcQz.js} +1 -1
- package/dist/client/assets/{empty-state-BEKtdW4r.js → empty-state-D653N76e.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CV_04Mqr.js → extract-connection-data-BpQPulqJ.js} +1 -1
- package/dist/client/assets/{features-MBg0vBXI.js → features-DC4Mx65d.js} +1 -1
- package/dist/client/assets/{file-explorer-DFh0G9AW.js → file-explorer-DI37WbgR.js} +1 -1
- package/dist/client/assets/{file-type-icon-BUGLJdWu.js → file-type-icon-fKTDY3M7.js} +1 -1
- package/dist/client/assets/{files-DrFFkAhA.js → files-ermEyeeq.js} +1 -1
- package/dist/client/assets/{form-ngFqzDUs.js → form-BOkSmTHo.js} +1 -1
- package/dist/client/assets/{general-CjaqrNa3.js → general-CIbzkCUo.js} +1 -1
- package/dist/client/assets/{generate-id-B72e1YIz.js → generate-id-CvWg9hET.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BYeMQGhG.js → github-repo-picker-qlUkWRPg.js} +1 -1
- package/dist/client/assets/{header-tab-button-CBrvR3rT.js → header-tab-button-C4vmTyQ-.js} +1 -1
- package/dist/client/assets/{hover-card-HMEbmFNY.js → hover-card-BQqzA1_o.js} +1 -1
- package/dist/client/assets/{image-field-BxdtQ-6B.js → image-field-DKZ33h0l.js} +1 -1
- package/dist/client/assets/{index-Dx0tF1g4.js → index-6hdndQvf.js} +1 -1
- package/dist/client/assets/{index-CgH2OhoV.js → index-9yLZw74n.js} +1 -1
- package/dist/client/assets/{index-Bi91cUM-.js → index-B6UNbCvs.js} +1 -1
- package/dist/client/assets/{index-bE1s1gBY.js → index-BEJQhciB.js} +1 -1
- package/dist/client/assets/{index-CsEESfyT.js → index-BNRdhvYz.js} +1 -1
- package/dist/client/assets/{index-XIClfKQB.js → index-Bp-x4MAC.js} +1 -1
- package/dist/client/assets/{index-gacl_Tlu.js → index-BtYLUKbU.js} +4 -4
- package/dist/client/assets/{index-DSTr5vNX.js → index-BvVmJXZO.js} +1 -1
- package/dist/client/assets/{index-BHx2Zpbq.js → index-CcNaSzIS.js} +1 -1
- package/dist/client/assets/{index-B_bvlyHZ.js → index-CdECG0JX.js} +1 -1
- package/dist/client/assets/{index-CKvOOOxk.js → index-DAqM6n6y.js} +1 -1
- package/dist/client/assets/{index-CpmOG_Bg.js → index-DI_C2zjL.js} +3 -3
- package/dist/client/assets/{index-d6i1w1J2.js → index-DKAPjhpZ.js} +1 -1
- package/dist/client/assets/{index-DMh_yIhm.js → index-DcdwlrBS.js} +1 -1
- package/dist/client/assets/{index-NBs1GdqN.js → index-o8XwCFMV.js} +1 -1
- package/dist/client/assets/{index-redirect-8hjLwAwq.js → index-redirect-Db4r9v6-.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BGllKZAR.js → infiniteQueryObserver-UtxmrGCk.js} +1 -1
- package/dist/client/assets/{input-CUu-drFE.js → input-D6XA36wX.js} +1 -1
- package/dist/client/assets/{integration-icon-D6q3hp18.js → integration-icon-CDYbzYpO.js} +1 -1
- package/dist/client/assets/{label-BxSv953n.js → label-DP3KsQ6l.js} +1 -1
- package/dist/client/assets/{layout-D9O0_n5-.js → layout-paBHZrq0.js} +1 -1
- package/dist/client/assets/{login-BtinjvRm.js → login-Dd5gU9xf.js} +1 -1
- package/dist/client/assets/{members-9bhWlLnl.js → members-DHkEbny2.js} +1 -1
- package/dist/client/assets/{monaco-editor-B1H6hrQ7.js → monaco-editor-CqS2PrxS.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CJK7nT7g.js → monitoring-stats-row-D1YkU8mA.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-12bTV2K3.js → oauth-callback-ai-provider-BXsbx5oM.js} +1 -1
- package/dist/client/assets/{oauth-callback-hNERmzi5.js → oauth-callback-dhWNgkQO.js} +1 -1
- package/dist/client/assets/{onboarding-DjpXCG4b.js → onboarding-BeaJ_uSB.js} +1 -1
- package/dist/client/assets/{org-install-C84qwAhG.js → org-install-Cp2eVvRj.js} +1 -1
- package/dist/client/assets/{org-layout-C1IF22AV.js → org-layout-a0K80q4T.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-B-hCG8Uv.js → org-plugin-layout-BSiJYore.js} +1 -1
- package/dist/client/assets/{page-seo-form-Cl71A8BB.js → page-seo-form-3l62DB_T.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BKqm5eyl.js +1 -0
- package/dist/client/assets/{pair-DN3rU5fI.js → pair-d72l3oOt.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-osfTULg-.js → plugin-empty-state-DJKQIP1H.js} +1 -1
- package/dist/client/assets/{plugin-header-YyMZMpGs.js → plugin-header-wZ3SAPoW.js} +1 -1
- package/dist/client/assets/{plugin-layout-BKOCCklg.js → plugin-layout-Bnm1d9fT.js} +1 -1
- package/dist/client/assets/{popover-CH95HqFo.js → popover-LMWhCL8q.js} +1 -1
- package/dist/client/assets/{post-editor-caWnstD2.js → post-editor-DYc1KPrG.js} +1 -1
- package/dist/client/assets/{primitives-CYYfaGAN.js → primitives-DKgG_RLP.js} +1 -1
- package/dist/client/assets/{profile-C9o-RNVI.js → profile-sY3vkifi.js} +1 -1
- package/dist/client/assets/project-app-view-DZbc50FT.js +1 -0
- package/dist/client/assets/record-editor-CQX_ONN9.js +1 -0
- package/dist/client/assets/registry-Z2xBxz0q.js +2 -0
- package/dist/client/assets/{registry-layout-TnzbGAE3.js → registry-layout-DICcLMZ-.js} +1 -1
- package/dist/client/assets/{require-capability-BIm35L6j.js → require-capability-BaEq85xc.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DxD0Fs_0.js → required-auth-layout-ctnrloiI.js} +1 -1
- package/dist/client/assets/{reset-password-BUxs2XXK.js → reset-password-QZaqz6_E.js} +1 -1
- package/dist/client/assets/{resizable-DELp11qo.js → resizable-Ctmig1x8.js} +1 -1
- package/dist/client/assets/{roles-CqFm6K9j.js → roles-l3bqeHe8.js} +1 -1
- package/dist/client/assets/{save-status-XWlbhoid.js → save-status-CCYbhtqv.js} +1 -1
- package/dist/client/assets/{schema-form-BnfXp9eD.js → schema-form-CYyNLLkP.js} +1 -1
- package/dist/client/assets/{scroll-area-B_wDwopu.js → scroll-area-ChLxDxAv.js} +1 -1
- package/dist/client/assets/{search-input-Dy32u4Yx.js → search-input-DlQucyGn.js} +1 -1
- package/dist/client/assets/{secrets-CwM9vgs8.js → secrets-DUz1PrMw.js} +1 -1
- package/dist/client/assets/{sections-editor-DOTPiLfV.js → sections-editor-CjgAxmAC.js} +1 -1
- package/dist/client/assets/{select-C1e50dcv.js → select-DiczE1GW.js} +1 -1
- package/dist/client/assets/{select-model-B7fxBb8r.js → select-model-BwFIV8qg.js} +1 -1
- package/dist/client/assets/{seo-editor-CywpjSiB.js → seo-editor-SK8O4TOZ.js} +1 -1
- package/dist/client/assets/{settings-layout-Dz5plwN0.js → settings-layout-B-mK5baR.js} +1 -1
- package/dist/client/assets/{settings-section-CrtDCHpp.js → settings-section-COvXOm16.js} +1 -1
- package/dist/client/assets/{sheet-lTSOvxho.js → sheet-B1_zl6Wy.js} +1 -1
- package/dist/client/assets/{shell-controls-BzKJJ-t7.js → shell-controls-F9PQTaJd.js} +1 -1
- package/dist/client/assets/{shell-layout-D0i8OAWU.js → shell-layout-CVo7gBu0.js} +1 -1
- package/dist/client/assets/{shell-route-loading-B_ai_Hb2.js → shell-route-loading-DlXSyVMe.js} +1 -1
- package/dist/client/assets/{sidebar-Cjaut6KM.js → sidebar-D_9iQq6y.js} +1 -1
- package/dist/client/assets/{skeleton-BVkQR9ek.js → skeleton-DvAAEHK-.js} +1 -1
- package/dist/client/assets/{sortable.esm-CgNsuB5K.js → sortable.esm-BcW2lbKS.js} +1 -1
- package/dist/client/assets/{spinner-BAjOwgiW.js → spinner-CIGunEVj.js} +1 -1
- package/dist/client/assets/{sso-Co4mP4Ha.js → sso-BkO-JF6F.js} +1 -1
- package/dist/client/assets/{store-HVcQT0BU.js → store-BP-9ENq2.js} +1 -1
- package/dist/client/assets/store-registry-BTGA7RTa.js +2 -0
- package/dist/client/assets/{switch-B3N-67ht.js → switch-CvANR6OB.js} +1 -1
- package/dist/client/assets/{tab-id-QoM_GeD5.js → tab-id-Bjr6GpO9.js} +1 -1
- package/dist/client/assets/{table-CBD1Q3-l.js → table-6ZxoVDj9.js} +1 -1
- package/dist/client/assets/{tabs-DVFYJOQB.js → tabs-BXch7lF5.js} +1 -1
- package/dist/client/assets/{task-status-CG4f8Ssf.js → task-status-FrpiwVZ0.js} +1 -1
- package/dist/client/assets/{textarea-BBLzCLOA.js → textarea-CTP7aZSb.js} +1 -1
- package/dist/client/assets/{toggle-group-Bpw9J7_z.js → toggle-group-5ZT1fa--.js} +1 -1
- package/dist/client/assets/{toolbar-CspqzRI5.js → toolbar-Ct5Db6Po.js} +1 -1
- package/dist/client/assets/{tools-list-xaKK1ECj.js → tools-list-BlrRNNBe.js} +1 -1
- package/dist/client/assets/{tooltip-DW2J8RRA.js → tooltip-KdhQZ3ej.js} +1 -1
- package/dist/client/assets/{types-LM2jh-lQ.js → types-Dw4nSNDC.js} +1 -1
- package/dist/client/assets/{use-ai-providers-eErv1C43.js → use-ai-providers-D_ipcxZj.js} +1 -1
- package/dist/client/assets/{use-automations-HnokK13N.js → use-automations-ByYKrwPE.js} +1 -1
- package/dist/client/assets/{use-capability-FIcb8UxS.js → use-capability-DySoFAxN.js} +1 -1
- package/dist/client/assets/{use-collections-CqTjT3Mq.js → use-collections-XA0KebJY.js} +1 -1
- package/dist/client/assets/{use-connection-D6Cpeajq.js → use-connection-wp_lbmMU.js} +1 -1
- package/dist/client/assets/{use-copy-Cw1fcUIO.js → use-copy-BWvpIWuf.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CJC57gOy.js → use-create-virtual-mcp-W4rKr9xF.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CgMlJ6Br.js → use-debounced-autosave-DWajIZmJ.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Bfeg-vSl.js → use-delete-connection-C7S2ugSQ.js} +1 -1
- package/dist/client/assets/{use-file-configs-P699ZQaF.js → use-file-configs-C-sgICQR.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DiT_tcXi.js → use-infinite-scroll-Bk8f-w0n.js} +1 -1
- package/dist/client/assets/{use-list-state-BNJ-tlPA.js → use-list-state-DCu2_qcV.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-2--n2jev.js → use-mcp-prompts-GwuiMx2k.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BvO9OVFB.js → use-mcp-tools-BJM8Ch_b.js} +1 -1
- package/dist/client/assets/{use-members-B36Y5TQt.js → use-members-BFSN3QPN.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-dXmSFUhJ.js → use-navigate-to-agent-D_yYvurh.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CAkVEUwL.js → use-org-auth-client-D8sE5x8D.js} +1 -1
- package/dist/client/assets/{use-org-sso-ClqqHr-X.js → use-org-sso-CDLauwp2.js} +1 -1
- package/dist/client/assets/{use-organization-roles-GUTuXgpC.js → use-organization-roles-Cr7Rw0vS.js} +1 -1
- package/dist/client/assets/{use-organization-settings-0_8sPkX5.js → use-organization-settings-DZ2KDW5r.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BYyCxXS_.js → use-registry-connections-CkLpetCN.js} +1 -1
- package/dist/client/assets/{use-secrets-WmW0rqmn.js → use-secrets-BCTkTNAt.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DaqA5e9-.js → use-status-sounds-DuoYs6Rs.js} +1 -1
- package/dist/client/assets/{use-view-mode-C3RTWiyQ.js → use-view-mode-DUw7PprD.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Bpydv1NG.js → use-virtual-mcp-BE7Deo6L.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DTZY836s.js +1 -0
- package/dist/client/assets/{useRouterState-DK-9Hx-j.js → useRouterState-nKULYO8g.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BZcmZLll.js +1 -0
- package/dist/client/assets/{user-DgFB9DGX.js → user-DXVwfRLH.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DwClLpGQ.js → view-mode-toggle-GVqZ4OkD.js} +1 -1
- package/dist/client/assets/{workflow-Cfw5Ndhx.js → workflow-C6bXXXmh.js} +1 -1
- package/dist/client/assets/workflow-detail-B7TlrPBG.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +480 -480
- package/dist/server/server.js +306 -306
- package/package.json +1 -1
- package/dist/client/assets/agent-capabilities-B5uA64tf.js +0 -3
- package/dist/client/assets/app-editor-BBElfEes.js +0 -1
- package/dist/client/assets/page-seo-sheet-BEHOuaNm.js +0 -1
- package/dist/client/assets/project-app-view-DAOiIs80.js +0 -1
- package/dist/client/assets/record-editor-BPzwKRSp.js +0 -1
- package/dist/client/assets/registry-_ZY4UYXD.js +0 -2
- package/dist/client/assets/store-registry-B0_EtqCG.js +0 -2
- package/dist/client/assets/useInfiniteQuery-8wlNRgz7.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bg_jTe-C.js +0 -1
- package/dist/client/assets/workflow-detail-DDad04ZD.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-DICcLMZ-.js","assets/index-DI_C2zjL.js","assets/index-BgFgIfs8.css","assets/XCircle-B8hhQ7We.js","assets/CheckCircle-rFqh1KDn.js","assets/Container-Dls_ClFq.js","assets/Settings02-VViB9t6t.js","assets/constants-Cee8XKoZ.js","assets/useInfiniteQuery-DTZY836s.js","assets/infiniteQueryObserver-UtxmrGCk.js","assets/badge-BARx7FvE.js","assets/input-D6XA36wX.js","assets/dropdown-menu-CKTrR8YS.js","assets/Check-BxIVbrMR.js","assets/ChevronRight-WB5knV5A.js","assets/DotsVertical-CxHHcGx6.js","assets/table-6ZxoVDj9.js","assets/toggle-group-5ZT1fa--.js","assets/use-view-mode-DUw7PprD.js","assets/tooltip-KdhQZ3ej.js","assets/FilterLines-DqQIAzT9.js","assets/Globe01-Tm1ARX4Z.js","assets/SearchMd-D5J9uZcf.js","assets/dialog-CFcYm0YL.js","assets/X-gpy8SRoe.js","assets/AlertCircle-DBLUz--u.js","assets/Upload01-BpTwEhwN.js","assets/alert-dialog-BEqZ9uGO.js","assets/card-opRPZv32.js","assets/Trash01-C7l0NheK.js","assets/label-DP3KsQ6l.js","assets/select-DiczE1GW.js","assets/ChevronDown-P5aorJ8-.js","assets/ChevronUp-nQBmktAW.js","assets/switch-CvANR6OB.js","assets/textarea-CTP7aZSb.js","assets/RefreshCcw01-BKQsxntF.js","assets/checkbox-wlYL0b3G.js","assets/Eye-EKPlnsLc.js","assets/LinkExternal01-BrCQL34C.js","assets/use-copy-BWvpIWuf.js","assets/Key01-CeoBFgZd.js","assets/Plus-DMk97-_x.js","assets/Play-Cl-75oPS.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{e as i,j as e,r as s,l as a,_ as o}from"./index-DI_C2zjL.js";import{R as l}from"./require-capability-BaEq85xc.js";import"./use-capability-DySoFAxN.js";import"./access-gate-uwoZnAgx.js";import"./capability-load-error-ClqXQbgV.js";const m=s.lazy(()=>o(()=>import("./registry-layout-DICcLMZ-.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])));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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as Y,q as ie,n as Ie,G as ke,a as je,o as V,r as M,j as t,B as G,l as ze,c as Z,M as Fs,J as Bs,bl as Qs,bm as Vs}from"./index-
|
|
1
|
+
import{e as Y,q as ie,n as Ie,G as ke,a as je,o as V,r as M,j as t,B as G,l as ze,c as Z,M as Fs,J as Bs,bl as Qs,bm as Vs}from"./index-DI_C2zjL.js";import{c as Jt,b as Gs,d as ds,a as Ks,i as Ys,t as Hs,f as Ws,e as Js}from"./XCircle-B8hhQ7We.js";import{i as Le}from"./CheckCircle-rFqh1KDn.js";import{n as Zs}from"./Container-Dls_ClFq.js";import{a as Xs}from"./Settings02-VViB9t6t.js";import{S as ce,u as oe,W as er}from"./constants-Cee8XKoZ.js";import{u as us}from"./useInfiniteQuery-DTZY836s.js";import{B as F}from"./badge-BARx7FvE.js";import{I as ae}from"./input-D6XA36wX.js";import{a as dt,c as Ce,D as ut,b as mt,h as Zt,k as Xt,d as tr}from"./dropdown-menu-CKTrR8YS.js";import{c as Mt,d as Et,a as Fe,e as ue,b as Dt,T as me}from"./table-6ZxoVDj9.js";import{T as sr,a as es}from"./toggle-group-5ZT1fa--.js";import{u as rr}from"./use-view-mode-DUw7PprD.js";import{i as At}from"./DotsVertical-CxHHcGx6.js";import{i as nr}from"./FilterLines-DqQIAzT9.js";import{n as ir,i as ms}from"./Globe01-Tm1ARX4Z.js";import{i as lr}from"./SearchMd-D5J9uZcf.js";import{b as xt,c as ht,e as pt,d as ft,a as gt,D as jt}from"./dialog-CFcYm0YL.js";import{i as Ke}from"./AlertCircle-DBLUz--u.js";import{i as ts}from"./Upload01-BpTwEhwN.js";import{c as Ye,b as He,d as We,f as Je,g as Ze,e as Xe,a as et,A as tt}from"./alert-dialog-BEqZ9uGO.js";import{C as ne}from"./card-opRPZv32.js";import{s as st}from"./Trash01-C7l0NheK.js";import{L as X}from"./label-DP3KsQ6l.js";import{d as ar,S as or,a as cr,b as dr,c as St}from"./select-DiczE1GW.js";import{S as Oe}from"./switch-CvANR6OB.js";import{T as vt}from"./textarea-CTP7aZSb.js";import{s as $t,b as ur,i as mr,a as xr}from"./RefreshCcw01-BKQsxntF.js";import{i as hr}from"./X-gpy8SRoe.js";import{t as pr}from"./ChevronDown-P5aorJ8-.js";import{n as fr}from"./ChevronUp-nQBmktAW.js";import{C as ss}from"./checkbox-wlYL0b3G.js";import{s as xs,a as Rt}from"./Eye-EKPlnsLc.js";import{n as gr}from"./LinkExternal01-BrCQL34C.js";import{u as Tt}from"./use-copy-BWvpIWuf.js";import{i as It}from"./Check-BxIVbrMR.js";import{i as jr}from"./Key01-CeoBFgZd.js";import{s as vr}from"./Plus-DMk97-_x.js";import{T as br,a as yr,b as Nr}from"./tooltip-KdhQZ3ej.js";import{i as wr}from"./Play-Cl-75oPS.js";import"./infiniteQueryObserver-UtxmrGCk.js";import"./ChevronRight-WB5knV5A.js";const $e="private-registry",_r=`
|
|
2
2
|
You are an MCP tool tester running automated integration checks.
|
|
3
3
|
|
|
4
4
|
Goal:
|
package/dist/client/assets/{require-capability-BIm35L6j.js → require-capability-BaEq85xc.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as p,j as m}from"./index-
|
|
1
|
+
import{e as p,j as m}from"./index-DI_C2zjL.js";import{u as l}from"./use-capability-DySoFAxN.js";import{A as u}from"./access-gate-uwoZnAgx.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-DxD0Fs_0.js → required-auth-layout-ctnrloiI.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-DI_C2zjL.js";import{u as x}from"./useRouterState-nKULYO8g.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-DI_C2zjL.js";import{I as L}from"./input-D6XA36wX.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-CpmOG_Bg.js";import{d as Pn}from"./ZoomOut-Btzzfq_K.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-DI_C2zjL.js";import{d as Pn}from"./ZoomOut-CTra4wHa.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 z,e as H,c as K,j as s,q as Se,K as re,bb as dt,n as Re,l as fe,B as ne,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-CpmOG_Bg.js";import{u as pt}from"./use-organization-roles-GUTuXgpC.js";import{u as je}from"./use-org-auth-client-CAkVEUwL.js";import{B as ge}from"./badge-B2isb5t4.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-D1sXzFR6.js";import{D as bt,a as Et,b as Tt,c as _t}from"./dropdown-menu-cIyq0nsy.js";import{i as It}from"./DotsVertical-_gNEu7zY.js";import{s as Ae}from"./Plus-7ete7Chf.js";import{s as St}from"./Trash01-D8gyPG4F.js";import{C as Nt}from"./collection-table-wrapper-C0xQn6vd.js";import{P as te}from"./index-CsEESfyT.js";import{E as Ge}from"./empty-state-BEKtdW4r.js";import{S as ve}from"./search-input-Dy32u4Yx.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ye}from"./integration-icon-D6q3hp18.js";import{u as Ct}from"./use-infinite-scroll-DiT_tcXi.js";import{C as we}from"./checkbox-DmtUHgAJ.js";import{i as At}from"./RefreshCcw01-BcEdc8yb.js";import{u as Rt}from"./useSuspenseInfiniteQuery-Bg_jTe-C.js";import{u as Ot,S as jt}from"./constants-DpuEAZHq.js";import{C as vt}from"./collection-search-CmhXzxiX.js";import{u as nt}from"./use-members-B36Y5TQt.js";import{u as yt}from"./use-connection-D6Cpeajq.js";import{u as wt,d as Lt}from"./use-ai-providers-eErv1C43.js";import{A as lt}from"./avatar-DcRL4WFc.js";import{S as xe}from"./switch-B3N-67ht.js";import{c as pe,b as be,T as Ee,a as Te}from"./tooltip-DW2J8RRA.js";import{S as Ue,a as Be,b as Ve}from"./settings-section-CrtDCHpp.js";import{t as Mt}from"./ChevronDown-CniGrT2-.js";import{i as Pt}from"./ChevronRight-COCWmVlT.js";import{i as ze}from"./X-Dlvmz5Lj.js";import{a as Dt}from"./use-capability-FIcb8UxS.js";import{A as kt}from"./access-gate-Uv1zLF5Y.js";import"./Check-BhYHl6b1.js";import"./table-CBD1Q3-l.js";import"./SwitchHorizontal01-X0-A3wlA.js";import"./sidebar-Cjaut6KM.js";import"./LayoutLeft-CoO_xxXK.js";import"./sheet-lTSOvxho.js";import"./SearchMd-CW4p_47C.js";import"./Container-D1PVb_TW.js";import"./agent-icon-BiKNgOeT.js";import"./AlertCircle-B-r3okdw.js";import"./Tool01-C_efsdJ9.js";import"./XCircle-Q3LP6RaJ.js";import"./ArrowUpRight-tDPH0_4m.js";import"./ZapSquare-OkNAvBeL.js";import"./Users03-D_dEpKEB.js";import"./CheckCircle-CVL_FX-8.js";import"./ChevronLeft-kGfXoAV-.js";import"./ChevronUp-DzsjrX2b.js";import"./Eye-Cja82Q7U.js";import"./ZoomOut-Btzzfq_K.js";import"./Globe01-D39kUdoP.js";import"./FilterLines-Bel4K6qN.js";import"./Star01-Bc8W2nUe.js";import"./Palette-D9uHHj9p.js";import"./HardDrive-CgdcwvGL.js";import"./Stars02-BG9BQfDN.js";import"./Key01-DYyg_tnP.js";import"./LinkExternal01-DN-lMhNz.js";import"./Monitor01-gHlWGw8m.js";import"./Sun-2czCa7nh.js";import"./Play-RXfEurLC.js";import"./Settings02-BilcqWFp.js";import"./Shield01-CWDizliI.js";import"./Stars01-H8xKRb3B.js";import"./Upload01-CeZYEoZ8.js";import"./User01-CfhPWLkj.js";import"./Users01-CwA0YZWL.js";import"./XClose-CMlIOxQg.js";import"./Zap-C5hsI9kw.js";import"./infiniteQueryObserver-BGllKZAR.js";import"./use-collections-CqTjT3Mq.js";import"./card-7rPQAdEb.js";import"./capability-load-error-BIabmgVZ.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 o=new Set(e);for(const r of t.tools)o.add(r);return Array.from(o)}const l=new Set(e);for(const o of t.tools)l.delete(o);return Array.from(l)}const zt=z.memo(function(e){const n=H.c(21),{connection:l,isSelected:o,hasToolsEnabled:r,activeToolsCount:c,totalToolsCount:f,onSelect:d,onToggle:h}=e,g=o?"bg-accent/50":"hover:bg-muted/50";let a;n[0]!==g?(a=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),n[0]=g,n[1]=a):a=n[1];let x;n[2]!==l.icon||n[3]!==l.title?(x=s.jsx(ye,{icon:l.icon,name:l.title,size:"xs"}),n[2]=l.icon,n[3]=l.title,n[4]=x):x=n[4];let i;n[5]!==l.title?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),n[5]=l.title,n[6]=i):i=n[6];let m;n[7]!==d||n[8]!==x||n[9]!==i?(m=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:d,children:[x,i]}),n[7]=d,n[8]=x,n[9]=i,n[10]=m):m=n[10];let _;n[11]!==c||n[12]!==l.tools||n[13]!==r||n[14]!==h||n[15]!==f?(_=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[c,"/",f]}),s.jsx(we,{checked:r,onCheckedChange:h,onClick:Ft})]}),n[11]=c,n[12]=l.tools,n[13]=r,n[14]=h,n[15]=f,n[16]=_):_=n[16];let E;return n[17]!==a||n[18]!==m||n[19]!==_?(E=s.jsxs("div",{className:a,children:[m,_]}),n[17]=a,n[18]=m,n[19]=_,n[20]=E):E=n[20],E}),Yt=z.memo(function(e){const n=H.c(18),{connectionId:l,tool:o,isSelected:r,onToggle:c}=e,f=`tool-${l}-${o.name}`,d=r?"text-foreground":"text-muted-foreground";let h;n[0]!==d?(h=K("text-sm font-medium",d),n[0]=d,n[1]=h):h=n[1];let g;n[2]!==h||n[3]!==o.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:h,children:o.name})}),n[2]=h,n[3]=o.name,n[4]=g):g=n[4];let a;n[5]!==o.description?(a=o.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:o.description}),n[5]=o.description,n[6]=a):a=n[6];let x;n[7]!==g||n[8]!==a?(x=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,a]}),n[7]=g,n[8]=a,n[9]=x):x=n[9];const i=`tool-${l}-${o.name}`;let m;n[10]!==r||n[11]!==c||n[12]!==i?(m=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(we,{id:i,checked:r,onCheckedChange:c,onClick:Kt})}),n[10]=r,n[11]=c,n[12]=i,n[13]=m):m=n[13];let _;return n[14]!==f||n[15]!==x||n[16]!==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:f,children:[x,m]}),n[14]=f,n[15]=x,n[16]=m,n[17]=_):_=n[17],_});function $t({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:l}){const[o,r]=z.useState(""),c=l!==void 0?l:o,f=z.useDeferredValue(c),[d,h]=z.useState("all"),[g,a]=z.useState(!1),x=z.useRef(new Set(Object.keys(t))),{org:i}=Se(),m=Ot({connectionId:jt,orgId:i.id,orgSlug:i.slug}),_=100,E=f.trim(),T=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,N=!!n,C={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:_,offset:0,...N&&{include_virtual:!0}},v=JSON.stringify(C),{data:I,fetchNextPage:R,hasNextPage:p,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,i.id,"","CONNECTIONS",v),queryFn:async({pageParam:b=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:_,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}),S=I?.pages.flatMap(b=>b?.items??[])??[],j=Ct(R,p??!1,O),u=n?S.filter(b=>b.connection_type!=="VIRTUAL"?!0:dt(b.connection_url)!==n):S,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(d==="all")return!0;const D=U(b.id);return d==="selected"?D:d==="unselected"?!D:!0}),[L,Y]=z.useState(G[0]?.id??null),y=L?G.find(b=>b.id===L)??null:null,{data:M,isFetching:$}=Re({queryKey:re.collectionItem(m,i.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,Y(b)),e(Z)},oe=b=>{Y(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",g&&"hidden md:flex"),children:[l===void 0&&s.jsx(vt,{value:o,onChange:r,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>h("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>h("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>h("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="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:c?"No connections found":d==="selected"?"No servers selected":d==="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",g?"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:$?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(Yt,{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"})})})]})}function Ft(t){return t.stopPropagation()}function Kt(t){return t.stopPropagation()}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 o=t.charCodeAt(l);e=(e<<5)-e+o,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:o,onPermissionsChange:r,readOnly:c,searchQuery:f}=t,d=c===void 0?!1:c;let h;e[0]!==f?(h=f.trim().toLowerCase(),e[0]=f,e[1]=h):h=e[1];const g=z.useDeferredValue(h);let a;if(e[2]!==n||e[3]!==g||e[4]!==o||e[5]!==r||e[6]!==d||e[7]!==f||e[8]!==l){const x=Ut(),i=(v,I)=>{if(!d){if(n&&I){const R=x.flatMap(es).flatMap(Wt);o(!1),r(R.filter(p=>!v.tools.includes(p)));return}n||r(Vt(v,l,!I))}};let m;e[10]!==g?(m=v=>{const{section:I,capabilities:R}=v;return{section:I,capabilities:R.filter(p=>!g||p.label.toLowerCase().includes(g)||p.description.toLowerCase().includes(g))}},e[10]=g,e[11]=m):m=e[11];const _=x.map(m).filter(Jt);let E;e[12]!==n||e[13]!==o||e[14]!==r?(E=()=>{o(!n),r([])},e[12]=n,e[13]=o,e[14]=r,e[15]=E):E=e[15];let T;e[16]!==n||e[17]!==d||e[18]!==E?(T=Ye(n,d,E),e[16]=n,e[17]=d,e[18]=E,e[19]=T):T=e[19];let N;e[20]!==n||e[21]!==o||e[22]!==r||e[23]!==d?(N=d?void 0:()=>{o(!n),r([])},e[20]=n,e[21]=o,e[22]=r,e[23]=d,e[24]=N):N=e[24];let C;e[25]!==T||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:T,onClick:N})})}),e[25]=T,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,_.length===0&&g?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",f,"”"]}):_.map(v=>{const{section:I,capabilities:R}=v;return s.jsx(Ue,{title:I,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,d,()=>i(p,O)),onClick:d?void 0:()=>i(p,O)},p.id)})})},I)})]})}),e[2]=n,e[3]=g,e[4]=o,e[5]=r,e[6]=d,e[7]=f,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:o,groupLogo:r,models:c,allConnectionModelIds:f,selectedModels:d,allowAllModels:h,allConnectionModelsSelected:g,onToggleModel:a,onExitAllowAll:x,readOnly:i,defaultExpanded:m}=t,[_,E]=z.useState(m),T=m||_,N=E,[C,v]=z.useState(rt);let I;e[0]!==g||e[1]!==h||e[2]!==d?(I=j=>h||g||d.includes("*")||d.includes(j),e[0]=g,e[1]=h,e[2]=d,e[3]=I):I=e[3];const R=I;let p;if(e[4]!==R||e[5]!==c){let j;e[7]!==R?(j=u=>R(u.id),e[7]=R,e[8]=j):j=e[8],p=c.filter(j),e[4]=R,e[5]=c,e[6]=p}else p=e[6];const O=p.length;let S;if(e[9]!==f||e[10]!==h||e[11]!==n||e[12]!==O||e[13]!==T||e[14]!==r||e[15]!==R||e[16]!==c||e[17]!==x||e[18]!==a||e[19]!==i||e[20]!==l||e[21]!==o||e[22]!==C){const j=c.slice(0,C),u=c.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]!==o||e[26]!==A?(k=s.jsx(ye,{icon:A,name:o,size:"sm"}),e[25]=o,e[26]=A,e[27]=k):k=e[27];let G;e[28]!==o?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:o}),e[28]=o,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]!==c.length?(B=s.jsxs(ge,{variant:"secondary",className:"text-xs text-muted-foreground",children:[O,"/",c.length," enabled"]}),e[33]=O,e[34]=c.length,e[35]=B):B=e[35];let L;e[36]!==T?(L=T?s.jsx(Mt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=T,e[37]=L):L=e[37];let Y;e[38]!==L||e[39]!==B?(Y=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,L]}),e[38]=L,e[39]=B,e[40]=Y):Y=e[40];let y;e[41]!==Y||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,Y]}),e[41]=Y,e[42]=U,e[43]=y):y=e[43],S=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,T&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(M=>{const $=R(M.id),F=()=>{if(!i){if(h){x(n,f,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",!i&&"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:i?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:$,disabled:!0,onCheckedChange:rs})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:$,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 (",c.length-C," remaining)"]})]})]}),e[9]=f,e[10]=h,e[11]=n,e[12]=O,e[13]=T,e[14]=r,e[15]=R,e[16]=c,e[17]=x,e[18]=a,e[19]=i,e[20]=l,e[21]=o,e[22]=C,e[23]=S}else S=e[23];return S}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:o,onToggleModel:r,onExitAllowAll:c,allConnectionModelsSelected:f,searchQuery:d,readOnly:h}=t,g=Lt(n.id);let a,x,i,m,_;if(e[0]!==f||e[1]!==o||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==c||e[6]!==r||e[7]!==g||e[8]!==h||e[9]!==d||e[10]!==l){_=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=g.filter(hs).map(N),v=d.trim().toLowerCase(),I=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(I.length===0){_=null;break e}const R=new Map;for(const A of I){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;i="flex flex-col gap-3";const S=tt[n.providerId]??st;let j;e[18]!==n.providerId||e[19]!==S?(j=s.jsx("img",{src:S,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]=S,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:o,allConnectionModelsSelected:f,onToggleModel:r,onExitAllowAll:c,readOnly:h,defaultExpanded:O},A.id))}e[0]=f,e[1]=o,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=c,e[6]=r,e[7]=g,e[8]=h,e[9]=d,e[10]=l,e[11]=a,e[12]=x,e[13]=i,e[14]=m,e[15]=_}else a=e[11],x=e[12],i=e[13],m=e[14],_=e[15];if(_!==Symbol.for("react.early_return_sentinel"))return _;let E;e[26]!==a||e[27]!==x?(E=s.jsx("div",{className:a,children:x}),e[26]=a,e[27]=x,e[28]=E):E=e[28];let T;return e[29]!==i||e[30]!==m||e[31]!==E?(T=s.jsxs("div",{className:i,children:[m,E]}),e[29]=i,e[30]=m,e[31]=E,e[32]=T):T=e[32],T}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:o,onModelSetChange:r,readOnly:c,searchQuery:f}=t,d=c===void 0?!1:c,h=z.useDeferredValue(f),g=wt();let a;e[0]!==l||e[1]!==r?(a=(p,O)=>{const S=l[p]??[],j={...l};if(S.includes(O)){const u=S.filter(w=>w!==O);u.length===0?delete j[p]:j[p]=u}else j[p]=[...S,O];r(j)},e[0]=l,e[1]=r,e[2]=a):a=e[2];const x=a;let i;e[3]!==l||e[4]!==o||e[5]!==r?(i=(p,O,S)=>{o(!1),r({...l,[p]:O.filter(j=>j!==S)})},e[3]=l,e[4]=o,e[5]=r,e[6]=i):i=e[6];const m=i,_=!d&&"hover:bg-muted/50 cursor-pointer";let E;e[7]!==_?(E=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",_),e[7]=_,e[8]=E):E=e[8];let T;e[9]!==n||e[10]!==o||e[11]!==r||e[12]!==d?(T=()=>{if(d)return;const p=!n;o(p),p&&r({})},e[9]=n,e[10]=o,e[11]=r,e[12]=d,e[13]=T):T=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]!==o||e[17]!==r||e[18]!==d?(C=s.jsx("div",{onClick:ps,children:d?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=>{o(p),p&&r({})}})}),e[15]=n,e[16]=o,e[17]=r,e[18]=d,e[19]=C):C=e[19];let v;e[20]!==E||e[21]!==T||e[22]!==C?(v=s.jsxs("div",{className:E,onClick:T,children:[N,C]}),e[20]=E,e[21]=T,e[22]=C,e[23]=v):v=e[23];let I;e[24]!==g||e[25]!==n||e[26]!==h||e[27]!==m||e[28]!==l||e[29]!==d||e[30]!==x?(I=g.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):g.map(p=>s.jsx(z.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:h,readOnly:d})},p.id)),e[24]=g,e[25]=n,e[26]=h,e[27]=m,e[28]=l,e[29]=d,e[30]=x,e[31]=I):I=e[31];let R;return e[32]!==I||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,I]}),e[32]=I,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:o,onAddMembers:r}=t,[c,f]=z.useState(""),d=z.useDeferredValue(c);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[g,a]=z.useState(h),{data:x}=nt();let i,m,_,E,T,N,C,v,I,R,p;if(e[1]!==x?.data?.members||e[2]!==d||e[3]!==r||e[4]!==l||e[5]!==n||e[6]!==g||e[7]!==c||e[8]!==o){const U=x?.data?.members??[];let B;e[20]!==d?(B=y=>{const M=d.toLowerCase();return y.user?.name?.toLowerCase().includes(M)||y.user?.email?.toLowerCase().includes(M)},e[20]=d,e[21]=B):B=e[21];const L=U.filter(B);let Y;e[22]!==r||e[23]!==l||e[24]!==g?(Y=()=>{r(g),a([]),l(!1)},e[22]=r,e[23]=l,e[24]=g,e[25]=Y):Y=e[25],_=Y,m=Qe,R=n,p=l,i=He,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(I=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]=I):I=e[26],N="flex flex-col h-80",e[27]!==c?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ve,{value:c,onChange:f,placeholder:"Search members...",className:"w-full"})}),e[27]=c,e[28]=C):C=e[28],E="flex-1 overflow-auto",T=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:c?"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",$=o.includes(y.id),F=g.includes(y.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!M||$?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(we,{checked:F||$,onCheckedChange:()=>{!M||$||a(X=>X.includes(y.id)?X.filter(J=>J!==y.id):[...X,y.id])},disabled:!M||$}),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"}),$&&M&&s.jsx(ge,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=x?.data?.members,e[2]=d,e[3]=r,e[4]=l,e[5]=n,e[6]=g,e[7]=c,e[8]=o,e[9]=i,e[10]=m,e[11]=_,e[12]=E,e[13]=T,e[14]=N,e[15]=C,e[16]=v,e[17]=I,e[18]=R,e[19]=p}else i=e[9],m=e[10],_=e[11],E=e[12],T=e[13],N=e[14],C=e[15],v=e[16],I=e[17],R=e[18],p=e[19];let O;e[29]!==E||e[30]!==T?(O=s.jsx("div",{className:E,children:T}),e[29]=E,e[30]=T,e[31]=O):O=e[31];let S;e[32]!==O||e[33]!==N||e[34]!==C?(S=s.jsxs("div",{className:N,children:[C,O]}),e[32]=O,e[33]=N,e[34]=C,e[35]=S):S=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=g.length===0,w=g.length>0&&`(${g.length})`;let A;e[37]!==_||e[38]!==u||e[39]!==w?(A=s.jsxs(We,{className:"px-6 pb-6",children:[j,s.jsxs(et,{onClick:_,disabled:u,children:["Add ",w]})]}),e[37]=_,e[38]=u,e[39]=w,e[40]=A):A=e[40];let k;e[41]!==i||e[42]!==S||e[43]!==A||e[44]!==v||e[45]!==I?(k=s.jsxs(i,{className:v,children:[I,S,A]}),e[41]=i,e[42]=S,e[43]=A,e[44]=v,e[45]=I,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:o,readOnlyMessage:r,searchQuery:c,addMemberDialogOpen:f,onAddMemberDialogOpenChange:d}=t,h=o===void 0?!1:o,g=r===void 0?"Owner membership cannot be changed":r,a=z.useDeferredValue(c),{data:x}=nt();let i,m,_;if(e[0]!==x?.data?.members||e[1]!==a||e[2]!==n||e[3]!==l||e[4]!==h||e[5]!==g||e[6]!==c){const v=x?.data?.members??[];let I;e[10]!==n?(I=S=>n.includes(S.id),e[10]=n,e[11]=I):I=e[11];const R=v.filter(I);let p;e[12]!==a?(p=S=>{const j=a.toLowerCase();return S.user?.name?.toLowerCase().includes(j)||S.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=p):p=e[13];const O=R.filter(p);_="flex flex-col h-full",i="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 "',c,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:O.map(S=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(lt,{url:S.user?.image??void 0,fallback:ot(S.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:S.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.user?.email})]}),h?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:g})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(j=>j!==S.id)),children:s.jsx(ze,{size:16})})]},S.id))}),e[0]=x?.data?.members,e[1]=a,e[2]=n,e[3]=l,e[4]=h,e[5]=g,e[6]=c,e[7]=i,e[8]=m,e[9]=_}else i=e[7],m=e[8],_=e[9];let E;e[14]!==i||e[15]!==m?(E=s.jsx("div",{className:i,children:m}),e[14]=i,e[15]=m,e[16]=E):E=e[16];let T;e[17]!==n||e[18]!==l?(T=v=>l([...n,...v]),e[17]=n,e[18]=l,e[19]=T):T=e[19];let N;e[20]!==f||e[21]!==n||e[22]!==d||e[23]!==T?(N=s.jsx(bs,{open:f,onOpenChange:d,selectedMemberIds:n,onAddMembers:T}),e[20]=f,e[21]=n,e[22]=d,e[23]=T,e[24]=N):N=e[24];let C;return e[25]!==_||e[26]!==E||e[27]!==N?(C=s.jsxs("div",{className:_,children:[E,N]}),e[25]=_,e[26]=E,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(z.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 o=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:o,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||{},o=l.self||[],r=o.includes("*"),c=r?[]:o.filter(a=>a!=="*"),f={};for(const[a,x]of Object.entries(l))if(!(a==="self"||a==="models"))if(a==="*")for(const i of n)f[i.id]=x.includes("*")?i.tools?.map(m=>m.name)??[]:x;else{const i=n.find(m=>m.id===a);i&&(f[a]=x.includes("*")?i.tools?.map(m=>m.name)??[]:x)}const d=l.models||[],h=d.length===0||d.includes("*:*"),g={};if(!h)for(const a of d){const x=a.indexOf(":");if(x===-1)continue;const i=a.slice(0,x),m=a.slice(x+1);g[i]||(g[i]=[]),g[i].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:r,staticPermissions:c,toolSet:f,allowAllModels:h,modelSet:g,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,o]of Object.entries(t.toolSet))if(o.length>0){const c=e.find(f=>f.id===l)?.tools?.map(f=>f.name)??[];n[l]=c.length>0&&c.every(f=>o.includes(f))?["*"]:o}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[o,r]of Object.entries(t.modelSet))for(const c of r)l.push(`${o}:${c}`);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:o}=t,r=l===void 0?"Owner membership cannot be changed":l;if(n){let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=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]=d):d=e[0];let h;return e[1]!==r?(h=s.jsx(pe,{children:s.jsxs(be,{children:[d,s.jsx(Te,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=h):h=e[2],h}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ae,{size:16}),e[3]=c):c=e[3];let f;return e[4]!==o?(f=s.jsxs(ne,{variant:"outline",size:"sm",onClick:o,children:[c,"Add Member"]}),e[4]=o,e[5]=f):f=e[5],f}function Rs(t){const e=H.c(14),{locator:n}=Se(),l=je(),o=yt();let r;e[0]!==n?(r=re.members(n),e[0]=n,e[1]=r):r=e[1];let c;e[2]!==l?(c=()=>l.organization.listMembers(),e[2]=l,e[3]=c):c=e[3];let f;e[4]!==r||e[5]!==c?(f={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=f):f=e[6];const{data:d,isPending:h}=Re(f);if(h||!o){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i):i=e[7],i}let g;e[8]!==d?.data?.members?(g=d?.data?.members??[],e[8]=d?.data?.members,e[9]=g):g=e[9];const a=g;let x;return e[10]!==o||e[11]!==a||e[12]!==t?(x=s.jsx(Os,{...t,members:a,connections:o}),e[10]=o,e[11]=a,e[12]=t,e[13]=x):x=e[13],x}function Os({target:t,onBack:e,onSaved:n,members:l,connections:o}){const{locator:r}=Se(),c=je(),f=$e(),d=t.kind==="builtin",h=t.kind==="builtin"&&t.role==="owner",g=t.kind==="new",[a,x]=z.useState(d?"org":"mcp"),i=mt({resolver:ut(Zt),defaultValues:Cs(t,l,o)}),m=i.formState.isValid,_=i.formState.isDirty,E=Fe({mutationFn:async u=>{const w=Ns(u,o),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),Y=u.memberIds.filter(M=>!L.includes(M)),y=L.filter(M=>!u.memberIds.includes(M));for(const M of Y){const $=await c.organization.updateMemberRole({memberId:M,role:[U]});if($?.error)throw new Error($.error.message??"Something went wrong")}for(const M of y){const $=await c.organization.updateMemberRole({memberId:M,role:["user"]});if($?.error)throw new Error($.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,Y=await c.organization.updateRole({roleId:u.role.id,data:{permission:w,...L?{roleName:U}:{}}});if(Y?.error)throw new Error(Y.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 c.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 c.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)=>{f.invalidateQueries({queryKey:re.members(r)}),f.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!"),i.reset(u),n(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),T=i.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),i.setFocus("role.label");return}E.mutate(u)}),N=!h,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...h?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[I,R]=z.useState(""),[p,O]=z.useState(!1),S=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:E.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:T,disabled:E.isPending||!m||!_,children:E.isPending?"Saving...":g?"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(i.watch("role.label")))}),h&&s.jsx(Ke,{size:16,className:"text-muted-foreground shrink-0"}),g||t.kind==="custom"?s.jsx("input",{...i.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:g}):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:()=>S(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:I,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"&&!h&&s.jsx($t,{toolSet:i.watch("toolSet"),onToolSetChange:u=>i.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:I}),a==="org"&&s.jsx(Xt,{allowAllStaticPermissions:i.watch("allowAllStaticPermissions"),staticPermissions:i.watch("staticPermissions"),onAllowAllChange:u=>i.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>i.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:h,searchQuery:I}),a==="models"&&s.jsx(gs,{allowAllModels:i.watch("allowAllModels"),modelSet:i.watch("modelSet"),onAllowAllChange:u=>i.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>i.setValue("modelSet",u,{shouldDirty:!0}),readOnly:h,searchQuery:I}),a==="members"&&s.jsx(Ts,{memberIds:i.watch("memberIds"),onMemberIdsChange:u=>i.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:I,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:o,loading:r,error:c}=Dt();let f;return e[0]!==n||e[1]!==l||e[2]!==c||e[3]!==o||e[4]!==r?(f=s.jsx(kt,{granted:o,loading:r,error:c,area:n,children:l}),e[0]=n,e[1]=l,e[2]=c,e[3]=o,e[4]=r,e[5]=f):f=e[5],f}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 o=t.charCodeAt(l);e=(e<<5)-e+o,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]=z.useState(""),[l,o]=z.useState(null),r=gt();let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const{role:f}=xt(c),{locator:d}=Se(),h=je(),g=$e(),{customRoles:a,refetch:x}=pt();let i;t[1]!==r?(i=P=>r({to:".",search:V=>({...V,role:P})}),t[1]=r,t[2]=i):i=t[2];const m=i;let _;e:{if(!f){_=null;break e}if(f==="new"){_={kind:"new"};break e}if(f.startsWith("builtin-")){_={kind:"builtin",role:f.slice(8)};break e}let P;t[3]!==f?(P=ae=>ae.id===f,t[3]=f,t[4]=P):P=t[4];const V=a.find(P);_=V?{kind:"custom",role:V}:null}const E=_;let T;t[5]!==d?(T=re.members(d),t[5]=d,t[6]=T):T=t[6];let N;t[7]!==h?(N=()=>h.organization.listMembers(),t[7]=h,t[8]=N):N=t[8];let C;t[9]!==T||t[10]!==N?(C={queryKey:T,queryFn:N},t[9]=T,t[10]=N,t[11]=C):C=t[11];const{data:v}=Re(C);let I;t[12]!==v?.data?.members?(I=v?.data?.members??[],t[12]=v?.data?.members,t[13]=I):I=t[13];const R=I;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 S;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(S=[...V,...at],e){const ce=e.toLowerCase();S=S.filter(ct=>ct.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=S}else S=t[19];let j;t[24]!==h?(j=async P=>{const V=await h.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=h,t[25]=j):j=t[25];const u=Fe({mutationFn:j,onSuccess:(P,V)=>{Oe("role_deleted",{role_id:V}),g.invalidateQueries({queryKey:re.members(d)}),g.invalidateQueries({queryKey:re.organizationRoles(d)}),he.success("Role deleted successfully!"),x(),E?.kind==="custom"&&E.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&&o({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 Y=L;if(E){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:E,onBack:P,onSaved:V},js(E))}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 $;t[40]!==e?($=s.jsx(ve,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:M}),t[40]=e,t[41]=$):$=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]!==$||t[48]!==J?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[$,J]}),t[47]=$,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]!==S||t[53]!==B||t[54]!==Y||t[55]!==oe?(ie=s.jsx(Nt,{columns:B,data:S,isLoading:!1,onRowClick:Y,emptyState:oe}),t[52]=S,t[53]=B,t[54]=Y,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&&o(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),o(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(z.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 fl(){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{fl as default};
|
|
1
|
+
import{r as z,e as H,c as K,j as s,q as Se,K as re,bb as dt,n as Re,l as fe,B as ne,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-DI_C2zjL.js";import{u as pt}from"./use-organization-roles-Cr7Rw0vS.js";import{u as je}from"./use-org-auth-client-D8sE5x8D.js";import{B as ge}from"./badge-BARx7FvE.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-BEqZ9uGO.js";import{D as bt,a as Et,b as Tt,c as _t}from"./dropdown-menu-CKTrR8YS.js";import{i as It}from"./DotsVertical-CxHHcGx6.js";import{s as Ae}from"./Plus-DMk97-_x.js";import{s as St}from"./Trash01-C7l0NheK.js";import{C as Nt}from"./collection-table-wrapper-BnCe5cyI.js";import{P as te}from"./index-BNRdhvYz.js";import{E as Ge}from"./empty-state-D653N76e.js";import{S as ve}from"./search-input-DlQucyGn.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ye}from"./integration-icon-CDYbzYpO.js";import{u as Ct}from"./use-infinite-scroll-Bk8f-w0n.js";import{C as we}from"./checkbox-wlYL0b3G.js";import{i as At}from"./RefreshCcw01-BKQsxntF.js";import{u as Rt}from"./useSuspenseInfiniteQuery-BZcmZLll.js";import{u as Ot,S as jt}from"./constants-Cee8XKoZ.js";import{C as vt}from"./collection-search-C3Lp1ZRv.js";import{u as nt}from"./use-members-BFSN3QPN.js";import{u as yt}from"./use-connection-wp_lbmMU.js";import{u as wt,d as Lt}from"./use-ai-providers-D_ipcxZj.js";import{A as lt}from"./avatar-Bcbs0fiL.js";import{S as xe}from"./switch-CvANR6OB.js";import{c as pe,b as be,T as Ee,a as Te}from"./tooltip-KdhQZ3ej.js";import{S as Ue,a as Be,b as Ve}from"./settings-section-COvXOm16.js";import{t as Mt}from"./ChevronDown-P5aorJ8-.js";import{i as Pt}from"./ChevronRight-WB5knV5A.js";import{i as ze}from"./X-gpy8SRoe.js";import{a as Dt}from"./use-capability-DySoFAxN.js";import{A as kt}from"./access-gate-uwoZnAgx.js";import"./Check-BxIVbrMR.js";import"./table-6ZxoVDj9.js";import"./SwitchHorizontal01-BDAEnkfq.js";import"./sidebar-D_9iQq6y.js";import"./LayoutLeft-xp2y9xUi.js";import"./sheet-B1_zl6Wy.js";import"./SearchMd-D5J9uZcf.js";import"./Container-Dls_ClFq.js";import"./agent-icon-DZCJD2_a.js";import"./AlertCircle-DBLUz--u.js";import"./Tool01-BgJ0N26M.js";import"./XCircle-B8hhQ7We.js";import"./ArrowUpRight-l-GcKPYK.js";import"./ZapSquare-DwVlJ80d.js";import"./Users03-DhyPNTfH.js";import"./CheckCircle-rFqh1KDn.js";import"./ChevronLeft-e8a25ahy.js";import"./ChevronUp-nQBmktAW.js";import"./Eye-EKPlnsLc.js";import"./ZoomOut-CTra4wHa.js";import"./Globe01-Tm1ARX4Z.js";import"./FilterLines-DqQIAzT9.js";import"./Star01--s8ZFg64.js";import"./Palette-DcvO-xme.js";import"./HardDrive-JzeH-CyJ.js";import"./Stars02-CIMeB8Tw.js";import"./Key01-CeoBFgZd.js";import"./LinkExternal01-BrCQL34C.js";import"./Monitor01-DhIohKdB.js";import"./Sun-F5_OmHwF.js";import"./Play-Cl-75oPS.js";import"./Settings02-VViB9t6t.js";import"./Shield01-D5gYDa2-.js";import"./Stars01-BidgaxVI.js";import"./Upload01-BpTwEhwN.js";import"./User01-61G-I9Nt.js";import"./Users01-DedWtozu.js";import"./XClose-BIl1LPyR.js";import"./Zap-DRW8v7hZ.js";import"./infiniteQueryObserver-UtxmrGCk.js";import"./use-collections-XA0KebJY.js";import"./card-opRPZv32.js";import"./capability-load-error-ClqXQbgV.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 o=new Set(e);for(const r of t.tools)o.add(r);return Array.from(o)}const l=new Set(e);for(const o of t.tools)l.delete(o);return Array.from(l)}const zt=z.memo(function(e){const n=H.c(21),{connection:l,isSelected:o,hasToolsEnabled:r,activeToolsCount:c,totalToolsCount:f,onSelect:d,onToggle:h}=e,g=o?"bg-accent/50":"hover:bg-muted/50";let a;n[0]!==g?(a=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),n[0]=g,n[1]=a):a=n[1];let x;n[2]!==l.icon||n[3]!==l.title?(x=s.jsx(ye,{icon:l.icon,name:l.title,size:"xs"}),n[2]=l.icon,n[3]=l.title,n[4]=x):x=n[4];let i;n[5]!==l.title?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),n[5]=l.title,n[6]=i):i=n[6];let m;n[7]!==d||n[8]!==x||n[9]!==i?(m=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:d,children:[x,i]}),n[7]=d,n[8]=x,n[9]=i,n[10]=m):m=n[10];let _;n[11]!==c||n[12]!==l.tools||n[13]!==r||n[14]!==h||n[15]!==f?(_=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[c,"/",f]}),s.jsx(we,{checked:r,onCheckedChange:h,onClick:Ft})]}),n[11]=c,n[12]=l.tools,n[13]=r,n[14]=h,n[15]=f,n[16]=_):_=n[16];let E;return n[17]!==a||n[18]!==m||n[19]!==_?(E=s.jsxs("div",{className:a,children:[m,_]}),n[17]=a,n[18]=m,n[19]=_,n[20]=E):E=n[20],E}),Yt=z.memo(function(e){const n=H.c(18),{connectionId:l,tool:o,isSelected:r,onToggle:c}=e,f=`tool-${l}-${o.name}`,d=r?"text-foreground":"text-muted-foreground";let h;n[0]!==d?(h=K("text-sm font-medium",d),n[0]=d,n[1]=h):h=n[1];let g;n[2]!==h||n[3]!==o.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:h,children:o.name})}),n[2]=h,n[3]=o.name,n[4]=g):g=n[4];let a;n[5]!==o.description?(a=o.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:o.description}),n[5]=o.description,n[6]=a):a=n[6];let x;n[7]!==g||n[8]!==a?(x=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,a]}),n[7]=g,n[8]=a,n[9]=x):x=n[9];const i=`tool-${l}-${o.name}`;let m;n[10]!==r||n[11]!==c||n[12]!==i?(m=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(we,{id:i,checked:r,onCheckedChange:c,onClick:Kt})}),n[10]=r,n[11]=c,n[12]=i,n[13]=m):m=n[13];let _;return n[14]!==f||n[15]!==x||n[16]!==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:f,children:[x,m]}),n[14]=f,n[15]=x,n[16]=m,n[17]=_):_=n[17],_});function $t({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:l}){const[o,r]=z.useState(""),c=l!==void 0?l:o,f=z.useDeferredValue(c),[d,h]=z.useState("all"),[g,a]=z.useState(!1),x=z.useRef(new Set(Object.keys(t))),{org:i}=Se(),m=Ot({connectionId:jt,orgId:i.id,orgSlug:i.slug}),_=100,E=f.trim(),T=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,N=!!n,C={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:_,offset:0,...N&&{include_virtual:!0}},v=JSON.stringify(C),{data:I,fetchNextPage:R,hasNextPage:p,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,i.id,"","CONNECTIONS",v),queryFn:async({pageParam:b=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:_,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}),S=I?.pages.flatMap(b=>b?.items??[])??[],j=Ct(R,p??!1,O),u=n?S.filter(b=>b.connection_type!=="VIRTUAL"?!0:dt(b.connection_url)!==n):S,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(d==="all")return!0;const D=U(b.id);return d==="selected"?D:d==="unselected"?!D:!0}),[L,Y]=z.useState(G[0]?.id??null),y=L?G.find(b=>b.id===L)??null:null,{data:M,isFetching:$}=Re({queryKey:re.collectionItem(m,i.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,Y(b)),e(Z)},oe=b=>{Y(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",g&&"hidden md:flex"),children:[l===void 0&&s.jsx(vt,{value:o,onChange:r,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>h("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>h("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>h("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="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:c?"No connections found":d==="selected"?"No servers selected":d==="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",g?"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:$?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(Yt,{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"})})})]})}function Ft(t){return t.stopPropagation()}function Kt(t){return t.stopPropagation()}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 o=t.charCodeAt(l);e=(e<<5)-e+o,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:o,onPermissionsChange:r,readOnly:c,searchQuery:f}=t,d=c===void 0?!1:c;let h;e[0]!==f?(h=f.trim().toLowerCase(),e[0]=f,e[1]=h):h=e[1];const g=z.useDeferredValue(h);let a;if(e[2]!==n||e[3]!==g||e[4]!==o||e[5]!==r||e[6]!==d||e[7]!==f||e[8]!==l){const x=Ut(),i=(v,I)=>{if(!d){if(n&&I){const R=x.flatMap(es).flatMap(Wt);o(!1),r(R.filter(p=>!v.tools.includes(p)));return}n||r(Vt(v,l,!I))}};let m;e[10]!==g?(m=v=>{const{section:I,capabilities:R}=v;return{section:I,capabilities:R.filter(p=>!g||p.label.toLowerCase().includes(g)||p.description.toLowerCase().includes(g))}},e[10]=g,e[11]=m):m=e[11];const _=x.map(m).filter(Jt);let E;e[12]!==n||e[13]!==o||e[14]!==r?(E=()=>{o(!n),r([])},e[12]=n,e[13]=o,e[14]=r,e[15]=E):E=e[15];let T;e[16]!==n||e[17]!==d||e[18]!==E?(T=Ye(n,d,E),e[16]=n,e[17]=d,e[18]=E,e[19]=T):T=e[19];let N;e[20]!==n||e[21]!==o||e[22]!==r||e[23]!==d?(N=d?void 0:()=>{o(!n),r([])},e[20]=n,e[21]=o,e[22]=r,e[23]=d,e[24]=N):N=e[24];let C;e[25]!==T||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:T,onClick:N})})}),e[25]=T,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,_.length===0&&g?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",f,"”"]}):_.map(v=>{const{section:I,capabilities:R}=v;return s.jsx(Ue,{title:I,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,d,()=>i(p,O)),onClick:d?void 0:()=>i(p,O)},p.id)})})},I)})]})}),e[2]=n,e[3]=g,e[4]=o,e[5]=r,e[6]=d,e[7]=f,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:o,groupLogo:r,models:c,allConnectionModelIds:f,selectedModels:d,allowAllModels:h,allConnectionModelsSelected:g,onToggleModel:a,onExitAllowAll:x,readOnly:i,defaultExpanded:m}=t,[_,E]=z.useState(m),T=m||_,N=E,[C,v]=z.useState(rt);let I;e[0]!==g||e[1]!==h||e[2]!==d?(I=j=>h||g||d.includes("*")||d.includes(j),e[0]=g,e[1]=h,e[2]=d,e[3]=I):I=e[3];const R=I;let p;if(e[4]!==R||e[5]!==c){let j;e[7]!==R?(j=u=>R(u.id),e[7]=R,e[8]=j):j=e[8],p=c.filter(j),e[4]=R,e[5]=c,e[6]=p}else p=e[6];const O=p.length;let S;if(e[9]!==f||e[10]!==h||e[11]!==n||e[12]!==O||e[13]!==T||e[14]!==r||e[15]!==R||e[16]!==c||e[17]!==x||e[18]!==a||e[19]!==i||e[20]!==l||e[21]!==o||e[22]!==C){const j=c.slice(0,C),u=c.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]!==o||e[26]!==A?(k=s.jsx(ye,{icon:A,name:o,size:"sm"}),e[25]=o,e[26]=A,e[27]=k):k=e[27];let G;e[28]!==o?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:o}),e[28]=o,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]!==c.length?(B=s.jsxs(ge,{variant:"secondary",className:"text-xs text-muted-foreground",children:[O,"/",c.length," enabled"]}),e[33]=O,e[34]=c.length,e[35]=B):B=e[35];let L;e[36]!==T?(L=T?s.jsx(Mt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=T,e[37]=L):L=e[37];let Y;e[38]!==L||e[39]!==B?(Y=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,L]}),e[38]=L,e[39]=B,e[40]=Y):Y=e[40];let y;e[41]!==Y||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,Y]}),e[41]=Y,e[42]=U,e[43]=y):y=e[43],S=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,T&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(M=>{const $=R(M.id),F=()=>{if(!i){if(h){x(n,f,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",!i&&"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:i?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:$,disabled:!0,onCheckedChange:rs})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:$,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 (",c.length-C," remaining)"]})]})]}),e[9]=f,e[10]=h,e[11]=n,e[12]=O,e[13]=T,e[14]=r,e[15]=R,e[16]=c,e[17]=x,e[18]=a,e[19]=i,e[20]=l,e[21]=o,e[22]=C,e[23]=S}else S=e[23];return S}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:o,onToggleModel:r,onExitAllowAll:c,allConnectionModelsSelected:f,searchQuery:d,readOnly:h}=t,g=Lt(n.id);let a,x,i,m,_;if(e[0]!==f||e[1]!==o||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==c||e[6]!==r||e[7]!==g||e[8]!==h||e[9]!==d||e[10]!==l){_=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=g.filter(hs).map(N),v=d.trim().toLowerCase(),I=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(I.length===0){_=null;break e}const R=new Map;for(const A of I){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;i="flex flex-col gap-3";const S=tt[n.providerId]??st;let j;e[18]!==n.providerId||e[19]!==S?(j=s.jsx("img",{src:S,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]=S,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:o,allConnectionModelsSelected:f,onToggleModel:r,onExitAllowAll:c,readOnly:h,defaultExpanded:O},A.id))}e[0]=f,e[1]=o,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=c,e[6]=r,e[7]=g,e[8]=h,e[9]=d,e[10]=l,e[11]=a,e[12]=x,e[13]=i,e[14]=m,e[15]=_}else a=e[11],x=e[12],i=e[13],m=e[14],_=e[15];if(_!==Symbol.for("react.early_return_sentinel"))return _;let E;e[26]!==a||e[27]!==x?(E=s.jsx("div",{className:a,children:x}),e[26]=a,e[27]=x,e[28]=E):E=e[28];let T;return e[29]!==i||e[30]!==m||e[31]!==E?(T=s.jsxs("div",{className:i,children:[m,E]}),e[29]=i,e[30]=m,e[31]=E,e[32]=T):T=e[32],T}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:o,onModelSetChange:r,readOnly:c,searchQuery:f}=t,d=c===void 0?!1:c,h=z.useDeferredValue(f),g=wt();let a;e[0]!==l||e[1]!==r?(a=(p,O)=>{const S=l[p]??[],j={...l};if(S.includes(O)){const u=S.filter(w=>w!==O);u.length===0?delete j[p]:j[p]=u}else j[p]=[...S,O];r(j)},e[0]=l,e[1]=r,e[2]=a):a=e[2];const x=a;let i;e[3]!==l||e[4]!==o||e[5]!==r?(i=(p,O,S)=>{o(!1),r({...l,[p]:O.filter(j=>j!==S)})},e[3]=l,e[4]=o,e[5]=r,e[6]=i):i=e[6];const m=i,_=!d&&"hover:bg-muted/50 cursor-pointer";let E;e[7]!==_?(E=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",_),e[7]=_,e[8]=E):E=e[8];let T;e[9]!==n||e[10]!==o||e[11]!==r||e[12]!==d?(T=()=>{if(d)return;const p=!n;o(p),p&&r({})},e[9]=n,e[10]=o,e[11]=r,e[12]=d,e[13]=T):T=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]!==o||e[17]!==r||e[18]!==d?(C=s.jsx("div",{onClick:ps,children:d?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=>{o(p),p&&r({})}})}),e[15]=n,e[16]=o,e[17]=r,e[18]=d,e[19]=C):C=e[19];let v;e[20]!==E||e[21]!==T||e[22]!==C?(v=s.jsxs("div",{className:E,onClick:T,children:[N,C]}),e[20]=E,e[21]=T,e[22]=C,e[23]=v):v=e[23];let I;e[24]!==g||e[25]!==n||e[26]!==h||e[27]!==m||e[28]!==l||e[29]!==d||e[30]!==x?(I=g.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):g.map(p=>s.jsx(z.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:h,readOnly:d})},p.id)),e[24]=g,e[25]=n,e[26]=h,e[27]=m,e[28]=l,e[29]=d,e[30]=x,e[31]=I):I=e[31];let R;return e[32]!==I||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,I]}),e[32]=I,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:o,onAddMembers:r}=t,[c,f]=z.useState(""),d=z.useDeferredValue(c);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[g,a]=z.useState(h),{data:x}=nt();let i,m,_,E,T,N,C,v,I,R,p;if(e[1]!==x?.data?.members||e[2]!==d||e[3]!==r||e[4]!==l||e[5]!==n||e[6]!==g||e[7]!==c||e[8]!==o){const U=x?.data?.members??[];let B;e[20]!==d?(B=y=>{const M=d.toLowerCase();return y.user?.name?.toLowerCase().includes(M)||y.user?.email?.toLowerCase().includes(M)},e[20]=d,e[21]=B):B=e[21];const L=U.filter(B);let Y;e[22]!==r||e[23]!==l||e[24]!==g?(Y=()=>{r(g),a([]),l(!1)},e[22]=r,e[23]=l,e[24]=g,e[25]=Y):Y=e[25],_=Y,m=Qe,R=n,p=l,i=He,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(I=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]=I):I=e[26],N="flex flex-col h-80",e[27]!==c?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ve,{value:c,onChange:f,placeholder:"Search members...",className:"w-full"})}),e[27]=c,e[28]=C):C=e[28],E="flex-1 overflow-auto",T=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:c?"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",$=o.includes(y.id),F=g.includes(y.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!M||$?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(we,{checked:F||$,onCheckedChange:()=>{!M||$||a(X=>X.includes(y.id)?X.filter(J=>J!==y.id):[...X,y.id])},disabled:!M||$}),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"}),$&&M&&s.jsx(ge,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=x?.data?.members,e[2]=d,e[3]=r,e[4]=l,e[5]=n,e[6]=g,e[7]=c,e[8]=o,e[9]=i,e[10]=m,e[11]=_,e[12]=E,e[13]=T,e[14]=N,e[15]=C,e[16]=v,e[17]=I,e[18]=R,e[19]=p}else i=e[9],m=e[10],_=e[11],E=e[12],T=e[13],N=e[14],C=e[15],v=e[16],I=e[17],R=e[18],p=e[19];let O;e[29]!==E||e[30]!==T?(O=s.jsx("div",{className:E,children:T}),e[29]=E,e[30]=T,e[31]=O):O=e[31];let S;e[32]!==O||e[33]!==N||e[34]!==C?(S=s.jsxs("div",{className:N,children:[C,O]}),e[32]=O,e[33]=N,e[34]=C,e[35]=S):S=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=g.length===0,w=g.length>0&&`(${g.length})`;let A;e[37]!==_||e[38]!==u||e[39]!==w?(A=s.jsxs(We,{className:"px-6 pb-6",children:[j,s.jsxs(et,{onClick:_,disabled:u,children:["Add ",w]})]}),e[37]=_,e[38]=u,e[39]=w,e[40]=A):A=e[40];let k;e[41]!==i||e[42]!==S||e[43]!==A||e[44]!==v||e[45]!==I?(k=s.jsxs(i,{className:v,children:[I,S,A]}),e[41]=i,e[42]=S,e[43]=A,e[44]=v,e[45]=I,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:o,readOnlyMessage:r,searchQuery:c,addMemberDialogOpen:f,onAddMemberDialogOpenChange:d}=t,h=o===void 0?!1:o,g=r===void 0?"Owner membership cannot be changed":r,a=z.useDeferredValue(c),{data:x}=nt();let i,m,_;if(e[0]!==x?.data?.members||e[1]!==a||e[2]!==n||e[3]!==l||e[4]!==h||e[5]!==g||e[6]!==c){const v=x?.data?.members??[];let I;e[10]!==n?(I=S=>n.includes(S.id),e[10]=n,e[11]=I):I=e[11];const R=v.filter(I);let p;e[12]!==a?(p=S=>{const j=a.toLowerCase();return S.user?.name?.toLowerCase().includes(j)||S.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=p):p=e[13];const O=R.filter(p);_="flex flex-col h-full",i="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 "',c,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:O.map(S=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(lt,{url:S.user?.image??void 0,fallback:ot(S.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:S.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.user?.email})]}),h?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:g})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(j=>j!==S.id)),children:s.jsx(ze,{size:16})})]},S.id))}),e[0]=x?.data?.members,e[1]=a,e[2]=n,e[3]=l,e[4]=h,e[5]=g,e[6]=c,e[7]=i,e[8]=m,e[9]=_}else i=e[7],m=e[8],_=e[9];let E;e[14]!==i||e[15]!==m?(E=s.jsx("div",{className:i,children:m}),e[14]=i,e[15]=m,e[16]=E):E=e[16];let T;e[17]!==n||e[18]!==l?(T=v=>l([...n,...v]),e[17]=n,e[18]=l,e[19]=T):T=e[19];let N;e[20]!==f||e[21]!==n||e[22]!==d||e[23]!==T?(N=s.jsx(bs,{open:f,onOpenChange:d,selectedMemberIds:n,onAddMembers:T}),e[20]=f,e[21]=n,e[22]=d,e[23]=T,e[24]=N):N=e[24];let C;return e[25]!==_||e[26]!==E||e[27]!==N?(C=s.jsxs("div",{className:_,children:[E,N]}),e[25]=_,e[26]=E,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(z.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 o=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:o,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||{},o=l.self||[],r=o.includes("*"),c=r?[]:o.filter(a=>a!=="*"),f={};for(const[a,x]of Object.entries(l))if(!(a==="self"||a==="models"))if(a==="*")for(const i of n)f[i.id]=x.includes("*")?i.tools?.map(m=>m.name)??[]:x;else{const i=n.find(m=>m.id===a);i&&(f[a]=x.includes("*")?i.tools?.map(m=>m.name)??[]:x)}const d=l.models||[],h=d.length===0||d.includes("*:*"),g={};if(!h)for(const a of d){const x=a.indexOf(":");if(x===-1)continue;const i=a.slice(0,x),m=a.slice(x+1);g[i]||(g[i]=[]),g[i].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:r,staticPermissions:c,toolSet:f,allowAllModels:h,modelSet:g,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,o]of Object.entries(t.toolSet))if(o.length>0){const c=e.find(f=>f.id===l)?.tools?.map(f=>f.name)??[];n[l]=c.length>0&&c.every(f=>o.includes(f))?["*"]:o}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[o,r]of Object.entries(t.modelSet))for(const c of r)l.push(`${o}:${c}`);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:o}=t,r=l===void 0?"Owner membership cannot be changed":l;if(n){let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=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]=d):d=e[0];let h;return e[1]!==r?(h=s.jsx(pe,{children:s.jsxs(be,{children:[d,s.jsx(Te,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=h):h=e[2],h}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ae,{size:16}),e[3]=c):c=e[3];let f;return e[4]!==o?(f=s.jsxs(ne,{variant:"outline",size:"sm",onClick:o,children:[c,"Add Member"]}),e[4]=o,e[5]=f):f=e[5],f}function Rs(t){const e=H.c(14),{locator:n}=Se(),l=je(),o=yt();let r;e[0]!==n?(r=re.members(n),e[0]=n,e[1]=r):r=e[1];let c;e[2]!==l?(c=()=>l.organization.listMembers(),e[2]=l,e[3]=c):c=e[3];let f;e[4]!==r||e[5]!==c?(f={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=f):f=e[6];const{data:d,isPending:h}=Re(f);if(h||!o){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i):i=e[7],i}let g;e[8]!==d?.data?.members?(g=d?.data?.members??[],e[8]=d?.data?.members,e[9]=g):g=e[9];const a=g;let x;return e[10]!==o||e[11]!==a||e[12]!==t?(x=s.jsx(Os,{...t,members:a,connections:o}),e[10]=o,e[11]=a,e[12]=t,e[13]=x):x=e[13],x}function Os({target:t,onBack:e,onSaved:n,members:l,connections:o}){const{locator:r}=Se(),c=je(),f=$e(),d=t.kind==="builtin",h=t.kind==="builtin"&&t.role==="owner",g=t.kind==="new",[a,x]=z.useState(d?"org":"mcp"),i=mt({resolver:ut(Zt),defaultValues:Cs(t,l,o)}),m=i.formState.isValid,_=i.formState.isDirty,E=Fe({mutationFn:async u=>{const w=Ns(u,o),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),Y=u.memberIds.filter(M=>!L.includes(M)),y=L.filter(M=>!u.memberIds.includes(M));for(const M of Y){const $=await c.organization.updateMemberRole({memberId:M,role:[U]});if($?.error)throw new Error($.error.message??"Something went wrong")}for(const M of y){const $=await c.organization.updateMemberRole({memberId:M,role:["user"]});if($?.error)throw new Error($.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,Y=await c.organization.updateRole({roleId:u.role.id,data:{permission:w,...L?{roleName:U}:{}}});if(Y?.error)throw new Error(Y.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 c.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 c.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)=>{f.invalidateQueries({queryKey:re.members(r)}),f.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!"),i.reset(u),n(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),T=i.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),i.setFocus("role.label");return}E.mutate(u)}),N=!h,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...h?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[I,R]=z.useState(""),[p,O]=z.useState(!1),S=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:E.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:T,disabled:E.isPending||!m||!_,children:E.isPending?"Saving...":g?"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(i.watch("role.label")))}),h&&s.jsx(Ke,{size:16,className:"text-muted-foreground shrink-0"}),g||t.kind==="custom"?s.jsx("input",{...i.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:g}):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:()=>S(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:I,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"&&!h&&s.jsx($t,{toolSet:i.watch("toolSet"),onToolSetChange:u=>i.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:I}),a==="org"&&s.jsx(Xt,{allowAllStaticPermissions:i.watch("allowAllStaticPermissions"),staticPermissions:i.watch("staticPermissions"),onAllowAllChange:u=>i.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>i.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:h,searchQuery:I}),a==="models"&&s.jsx(gs,{allowAllModels:i.watch("allowAllModels"),modelSet:i.watch("modelSet"),onAllowAllChange:u=>i.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>i.setValue("modelSet",u,{shouldDirty:!0}),readOnly:h,searchQuery:I}),a==="members"&&s.jsx(Ts,{memberIds:i.watch("memberIds"),onMemberIdsChange:u=>i.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:I,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:o,loading:r,error:c}=Dt();let f;return e[0]!==n||e[1]!==l||e[2]!==c||e[3]!==o||e[4]!==r?(f=s.jsx(kt,{granted:o,loading:r,error:c,area:n,children:l}),e[0]=n,e[1]=l,e[2]=c,e[3]=o,e[4]=r,e[5]=f):f=e[5],f}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 o=t.charCodeAt(l);e=(e<<5)-e+o,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]=z.useState(""),[l,o]=z.useState(null),r=gt();let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const{role:f}=xt(c),{locator:d}=Se(),h=je(),g=$e(),{customRoles:a,refetch:x}=pt();let i;t[1]!==r?(i=P=>r({to:".",search:V=>({...V,role:P})}),t[1]=r,t[2]=i):i=t[2];const m=i;let _;e:{if(!f){_=null;break e}if(f==="new"){_={kind:"new"};break e}if(f.startsWith("builtin-")){_={kind:"builtin",role:f.slice(8)};break e}let P;t[3]!==f?(P=ae=>ae.id===f,t[3]=f,t[4]=P):P=t[4];const V=a.find(P);_=V?{kind:"custom",role:V}:null}const E=_;let T;t[5]!==d?(T=re.members(d),t[5]=d,t[6]=T):T=t[6];let N;t[7]!==h?(N=()=>h.organization.listMembers(),t[7]=h,t[8]=N):N=t[8];let C;t[9]!==T||t[10]!==N?(C={queryKey:T,queryFn:N},t[9]=T,t[10]=N,t[11]=C):C=t[11];const{data:v}=Re(C);let I;t[12]!==v?.data?.members?(I=v?.data?.members??[],t[12]=v?.data?.members,t[13]=I):I=t[13];const R=I;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 S;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(S=[...V,...at],e){const ce=e.toLowerCase();S=S.filter(ct=>ct.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=S}else S=t[19];let j;t[24]!==h?(j=async P=>{const V=await h.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=h,t[25]=j):j=t[25];const u=Fe({mutationFn:j,onSuccess:(P,V)=>{Oe("role_deleted",{role_id:V}),g.invalidateQueries({queryKey:re.members(d)}),g.invalidateQueries({queryKey:re.organizationRoles(d)}),he.success("Role deleted successfully!"),x(),E?.kind==="custom"&&E.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&&o({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 Y=L;if(E){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:E,onBack:P,onSaved:V},js(E))}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 $;t[40]!==e?($=s.jsx(ve,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:M}),t[40]=e,t[41]=$):$=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]!==$||t[48]!==J?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[$,J]}),t[47]=$,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]!==S||t[53]!==B||t[54]!==Y||t[55]!==oe?(ie=s.jsx(Nt,{columns:B,data:S,isLoading:!1,onRowClick:Y,emptyState:oe}),t[52]=S,t[53]=B,t[54]=Y,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&&o(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),o(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(z.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 fl(){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{fl as default};
|
|
@@ -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-DI_C2zjL.js";import{i as c}from"./AlertCircle-DBLUz--u.js";import{i as l}from"./Check-BxIVbrMR.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};
|