decocms 4.21.0 → 4.22.1
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-DrgnpYmf.js → AlertCircle-hfr9WJXe.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CEF-CsVj.js → ArrowUpRight-DBXurizV.js} +1 -1
- package/dist/client/assets/Check-DhEV1E4F.js +1 -0
- package/dist/client/assets/{CheckCircle-xbzaC4iQ.js → CheckCircle-CbuPUNoj.js} +1 -1
- package/dist/client/assets/{ChevronDown-DDeoixaJ.js → ChevronDown-BJvvkmIr.js} +1 -1
- package/dist/client/assets/{ChevronRight-Cc93D1fP.js → ChevronRight-BP1EbKKr.js} +1 -1
- package/dist/client/assets/ChevronUp-CVqQKtsY.js +1 -0
- package/dist/client/assets/Circle-BnMDtDeu.js +1 -0
- package/dist/client/assets/Copy01-Cm6DymEJ.js +1 -0
- package/dist/client/assets/DotsVertical-BU3qKzJo.js +1 -0
- package/dist/client/assets/Eye-CtocRVwR.js +1 -0
- package/dist/client/assets/{FilterLines-C174NPGB.js → FilterLines-XaejSF3d.js} +1 -1
- package/dist/client/assets/{Globe01-y8c9C4nH.js → Globe01-CxIEuzOP.js} +1 -1
- package/dist/client/assets/{Globe04-v8yJBvO0.js → Globe04-DZ-Pm9xo.js} +1 -1
- package/dist/client/assets/{HardDrive-vkw_bVtH.js → HardDrive-C2sIA93N.js} +1 -1
- package/dist/client/assets/{Key01-8wUzNiiB.js → Key01-D8bQG_zp.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DFSfhhoN.js → LayoutLeft-C8PdEJOQ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CPcvHi4V.js → LinkExternal01-D58rAWvm.js} +1 -1
- package/dist/client/assets/List-vf0HKUEp.js +1 -0
- package/dist/client/assets/Loading02-DejqZGnO.js +1 -0
- package/dist/client/assets/{Monitor01-DQ9B5dBT.js → Monitor01-CodDwsVO.js} +1 -1
- package/dist/client/assets/{Palette-BP0gnn-x.js → Palette-CgTelSEQ.js} +1 -1
- package/dist/client/assets/{Play-6woe_bCf.js → Play-Dh4_54hC.js} +1 -1
- package/dist/client/assets/{Plus-sSvDtP2D.js → Plus-DX9uB6jT.js} +1 -1
- package/dist/client/assets/{SearchLg-BHGwQ11F.js → SearchLg-D0ZqoPSb.js} +1 -1
- package/dist/client/assets/{SearchMd-DcwBMfFO.js → SearchMd-DWSBWjan.js} +1 -1
- package/dist/client/assets/{Settings02-B0ZT4yzH.js → Settings02-CZ9vMUyw.js} +1 -1
- package/dist/client/assets/{Shield01-16ivhP9D.js → Shield01-DvUXE0jO.js} +1 -1
- package/dist/client/assets/{Star01-BwzFDtQr.js → Star01-7qhyucrX.js} +1 -1
- package/dist/client/assets/{Stars01-D_GgsBTV.js → Stars01-DN1mvd59.js} +1 -1
- package/dist/client/assets/{Stars02-CgeR-sX4.js → Stars02-CFivD_f8.js} +1 -1
- package/dist/client/assets/{Sun-vVeG2mZ0.js → Sun-CHp4Y1Dq.js} +1 -1
- package/dist/client/assets/SwitchHorizontal01-sG-IqCt6.js +1 -0
- package/dist/client/assets/{Tool01-BUi-a5a2.js → Tool01-DGnLcysQ.js} +1 -1
- package/dist/client/assets/{Trash01-YsCUBRvj.js → Trash01-CAEn55T5.js} +1 -1
- package/dist/client/assets/{Upload01-CTPdQzyc.js → Upload01-DKn5tYXN.js} +1 -1
- package/dist/client/assets/{User01-C4JQrjGt.js → User01-IYcmkjnc.js} +1 -1
- package/dist/client/assets/{Users01-TIl6xBro.js → Users01-0WxprMle.js} +1 -1
- package/dist/client/assets/{Users03-Cw_16vbZ.js → Users03-DHP7OUDR.js} +1 -1
- package/dist/client/assets/{X-CAjmVwOR.js → X-BWG-JTku.js} +1 -1
- package/dist/client/assets/{XCircle-D3nhMqns.js → XCircle-C94QFqN0.js} +1 -1
- package/dist/client/assets/{XClose-B93vthJT.js → XClose-CQikaAXa.js} +1 -1
- package/dist/client/assets/{Zap-8CUqVoBU.js → Zap-DeHaXJHA.js} +1 -1
- package/dist/client/assets/{ZapSquare-BDUSHcAn.js → ZapSquare-DBjTUciD.js} +1 -1
- package/dist/client/assets/{ZoomOut-BN-KB_0J.js → ZoomOut-DltoXGbL.js} +1 -1
- package/dist/client/assets/{access-gate-B6S-WMth.js → access-gate-CaRDuo1w.js} +1 -1
- package/dist/client/assets/{add-section-modal-CQq5kJUo.js → add-section-modal-Dkbb81MA.js} +1 -1
- package/dist/client/assets/agent-capabilities-BBWlBKsQ.js +1 -0
- package/dist/client/assets/agent-icon-CuxkxUe-.js +1 -0
- package/dist/client/assets/agents-list-BiXTIWXs.js +1 -0
- package/dist/client/assets/ai-providers-BQfoPc8M.js +1 -0
- package/dist/client/assets/{alert-BBmFOgXs.js → alert-BU-LVOFa.js} +1 -1
- package/dist/client/assets/{alert-dialog-ClCDLHyi.js → alert-dialog-BLM89Cw2.js} +1 -1
- package/dist/client/assets/app-editor-BxQrAgCs.js +1 -0
- package/dist/client/assets/{auth-CxjVr2Fw.js → auth-By4coGKl.js} +1 -1
- package/dist/client/assets/{auth-catchall-DCUDZpnm.js → auth-catchall-CZA5Hfvu.js} +1 -1
- package/dist/client/assets/{auth-entry-CDU8nxvN.js → auth-entry-HXEUnKNQ.js} +1 -1
- package/dist/client/assets/{auth-split-layout-VRGxSLqT.js → auth-split-layout-X0hXvUdh.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CZ-MLzKy.js → authenticate-and-persist-oauth-1U_DESs3.js} +1 -1
- package/dist/client/assets/{automation-list-row-B57SiMbH.js → automation-list-row-BMTjAch1.js} +1 -1
- package/dist/client/assets/automation-runs-C8J9he9y.js +1 -0
- package/dist/client/assets/automations-CJ9i_c9k.js +1 -0
- package/dist/client/assets/{avatar-BAkTMYHj.js → avatar-BeEkEhV9.js} +1 -1
- package/dist/client/assets/{badge-CxIGH9s7.js → badge-EC_FS1hJ.js} +1 -1
- package/dist/client/assets/{block-document-sOmo01vI.js → block-document-zDNpXx1K.js} +1 -1
- package/dist/client/assets/{brand-context-rYfc__eE.js → brand-context-BkgDlw8b.js} +1 -1
- package/dist/client/assets/{breadcrumb-WlMbFTff.js → breadcrumb-UZDdQrwI.js} +1 -1
- package/dist/client/assets/buckets-8plr1d-P.js +1 -0
- package/dist/client/assets/bulk-category-panel-76hRbL0c.js +1 -0
- package/dist/client/assets/{capability-load-error-Bj6xKhKF.js → capability-load-error-6mU8gg9S.js} +1 -1
- package/dist/client/assets/{card-9jdGQNnr.js → card-Cd_UT82w.js} +1 -1
- package/dist/client/assets/category-editor-CAmRTXwv.js +1 -0
- package/dist/client/assets/{chat-context-OmrHZlWm.js → chat-context-BEYxfvRE.js} +5 -5
- package/dist/client/assets/checkbox-B7ovMLyf.js +1 -0
- package/dist/client/assets/{cli-auth-success-CkMPwuV_.js → cli-auth-success-LMcjXaku.js} +1 -1
- package/dist/client/assets/collection-detail-D-KxR4bK.js +1 -0
- package/dist/client/assets/collection-display-button-DmoD5b6J.js +1 -0
- package/dist/client/assets/{collection-search-BHP0uS8b.js → collection-search-_ltIvUcU.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DeKnxXxy.js → collection-table-wrapper-Cz2kpo8j.js} +1 -1
- package/dist/client/assets/{collection-tabs-CvLerKx4.js → collection-tabs-ByJ2lCEV.js} +1 -1
- package/dist/client/assets/{command-D9kK6qBS.js → command-D8TSS276.js} +1 -1
- package/dist/client/assets/commerce-onboarding-BlroNemj.js +1 -0
- package/dist/client/assets/connect-desktop-dialog-D4NpUtWr.js +1 -0
- package/dist/client/assets/connection-card-COLJGGyb.js +1 -0
- package/dist/client/assets/connection-detail-IEtqvqDx.js +1 -0
- package/dist/client/assets/{connection-form-helpers-oKSRt7Z9.js → connection-form-helpers-Bx2EyqE0.js} +1 -1
- package/dist/client/assets/connections-CtMf6Y72.js +1 -0
- package/dist/client/assets/constants-C8_Swa4x.js +1 -0
- package/dist/client/assets/{decopilot-xPgbGeJc.js → decopilot-CphvkEuu.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BdE-V58A.js → decopilot-sse-pool-tveLasMO.js} +1 -1
- package/dist/client/assets/{dialog-D_ieAQTy.js → dialog-1PlbGnxl.js} +1 -1
- package/dist/client/assets/{domain-settings-ByTW2skH.js → domain-settings-C5LwCZzv.js} +1 -1
- package/dist/client/assets/{drawer-BP70Rujn.js → drawer-D7F9J8H1.js} +1 -1
- package/dist/client/assets/dropdown-menu-DgucD0Wn.js +1 -0
- package/dist/client/assets/{empty-state-BS7npFnj.js → empty-state-CKmzL0iR.js} +1 -1
- package/dist/client/assets/extract-connection-data-DXmsDXzN.js +1 -0
- package/dist/client/assets/file-explorer-Dw7VTTo2.js +2 -0
- package/dist/client/assets/{file-type-icon-DALXnNwz.js → file-type-icon-CjQ-i8Tj.js} +1 -1
- package/dist/client/assets/{files-hG4e0Y52.js → files-4PjS2DE6.js} +1 -1
- package/dist/client/assets/{form-DaxgojJl.js → form-DY5CJF6A.js} +1 -1
- package/dist/client/assets/format-time-Cy7tTmZp.js +1 -0
- package/dist/client/assets/general-B1x-jxiu.js +1 -0
- package/dist/client/assets/github-repo-picker-C928_gR2.js +1 -0
- package/dist/client/assets/{hooks-ChlRS_Cr.js → hooks-C98PDXkO.js} +4 -4
- package/dist/client/assets/{index-DpMErrhr.js → index-3pMCJF1F.js} +1 -1
- package/dist/client/assets/{index-DgNLMhiy.js → index-BIvxcsMT.js} +25 -25
- package/dist/client/assets/{index-CvxPzQfb.js → index-BeJ1yeue.js} +1 -1
- package/dist/client/assets/{index-DSNOu07Q.js → index-BhywTD9L.js} +12 -12
- package/dist/client/assets/{index-xZ8IGJ2g.js → index-BnU8c8Ro.js} +2 -2
- package/dist/client/assets/{index-6Q-DcRF4.js → index-CCO5X6vK.js} +1 -1
- package/dist/client/assets/{index-CYTkc5bj.js → index-CXhPz6Na.js} +1 -1
- package/dist/client/assets/index-ChDm4HPz.js +1 -0
- package/dist/client/assets/{index-CrIRvXb3.js → index-Co62zZxD.js} +4 -4
- package/dist/client/assets/index-CveMeMql.css +1 -0
- package/dist/client/assets/{index-7osCyUPH.js → index-D2iM60An.js} +1 -1
- package/dist/client/assets/index-D7F2qNe_.js +1 -0
- package/dist/client/assets/index-DBJUANyT.js +1 -0
- package/dist/client/assets/{index-Bo5LvjuQ.js → index-DPO0Ar5L.js} +6 -6
- package/dist/client/assets/{index-yloThw-p.js → index-Du424YAy.js} +1 -1
- package/dist/client/assets/{index-redirect-TiE2LCg3.js → index-redirect-B-jN-fhS.js} +1 -1
- package/dist/client/assets/{input-CjQtu1h5.js → input-C-5bkxwu.js} +1 -1
- package/dist/client/assets/{integration-icon-DvmR_kCi.js → integration-icon-DWcR_mMd.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BHrSHQE6.js → invite-member-dialog-c6uPezaw.js} +2 -2
- package/dist/client/assets/{label-CyPUYQaT.js → label-CuPUA6lI.js} +1 -1
- package/dist/client/assets/{library-tab-CrasAutb.js → library-tab-B9PQjg9x.js} +3 -3
- package/dist/client/assets/{login-C4Xj3ZGq.js → login-MwH_nULc.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cjq6PMkC.js → mcp-oauth-BFb5Mr2N.js} +1 -1
- package/dist/client/assets/members-DMKRSesY.js +1 -0
- package/dist/client/assets/{monaco-editor-kdhsccRw.js → monaco-editor-B_E6MYgL.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DeKE4QGN.js → monitoring-stats-row-CDUo4bJg.js} +1 -1
- package/dist/client/assets/{oauth-callback-CTt195fk.js → oauth-callback-CpqRc4mk.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CXZF8sn_.js → oauth-callback-ai-provider-BEZ67TTl.js} +1 -1
- package/dist/client/assets/{onboarding-BgKa_2mX.js → onboarding-DY1XdIjP.js} +1 -1
- package/dist/client/assets/{org-install-CFWrpbg8.js → org-install-_qYii8TY.js} +1 -1
- package/dist/client/assets/{org-layout-B7y5gvzJ.js → org-layout-CH6-dACM.js} +1 -1
- package/dist/client/assets/{organization-choice-LKw28vSy.js → organization-choice-q9IVQdh1.js} +1 -1
- package/dist/client/assets/{page-seo-form-DmWg08s4.js → page-seo-form-Dl3vlbYl.js} +1 -1
- package/dist/client/assets/page-seo-sheet-pnb4BjH1.js +1 -0
- package/dist/client/assets/{popover-Dk6C_xyw.js → popover-BnhIWYgB.js} +1 -1
- package/dist/client/assets/post-editor-BzHE5onr.js +1 -0
- package/dist/client/assets/{primitives-D3eMc46F.js → primitives-B_yiwpb8.js} +1 -1
- package/dist/client/assets/profile-q_xefMdi.js +1 -0
- package/dist/client/assets/project-app-view-BoTA9-Gv.js +1 -0
- package/dist/client/assets/record-editor-C6Mdc0zg.js +1 -0
- package/dist/client/assets/registry-BRcT-CVu.js +2 -0
- package/dist/client/assets/{registry-layout-BljHeZAP.js → registry-layout-CY97jFJ5.js} +4 -4
- package/dist/client/assets/{require-capability-ByiCIEvf.js → require-capability-B4CjdwjM.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B1_k8uZH.js → required-auth-layout-B14liizk.js} +1 -1
- package/dist/client/assets/{reset-password-14ERSLOr.js → reset-password-xrDJRi-g.js} +1 -1
- package/dist/client/assets/roles-Bjp9hGjL.js +1 -0
- package/dist/client/assets/{scroll-area-DVEw9jTn.js → scroll-area-CiGoarGm.js} +11 -11
- package/dist/client/assets/{search-input-Cw7dukB_.js → search-input-CmJ7IuJz.js} +1 -1
- package/dist/client/assets/secrets-CuAdzo5u.js +1 -0
- package/dist/client/assets/{sections-editor-Bnz1L7UN.js → sections-editor-CDssHvQJ.js} +2 -2
- package/dist/client/assets/select-XC9B8kYb.js +1 -0
- package/dist/client/assets/{select-model-1JGm9WVZ.js → select-model-Bb4qdZ4V.js} +1 -1
- package/dist/client/assets/seo-editor-CBv7uxMZ.js +1 -0
- package/dist/client/assets/{settings-layout-f8IHCdTn.js → settings-layout-D8XYD_1r.js} +1 -1
- package/dist/client/assets/{settings-section-CTfa0pnb.js → settings-section-CZoUIOGy.js} +1 -1
- package/dist/client/assets/{sheet-B3x8ZiS-.js → sheet-DMsXF2a5.js} +1 -1
- package/dist/client/assets/{shell-controls-C4LCUc-y.js → shell-controls-K02mDLgA.js} +1 -1
- package/dist/client/assets/shell-layout-CX1dOlGj.js +1 -0
- package/dist/client/assets/{sidebar-C8N0hRhw.js → sidebar-BxApc71_.js} +1 -1
- package/dist/client/assets/{skeleton-C5L5O22N.js → skeleton-CS6PjKeZ.js} +1 -1
- package/dist/client/assets/sso-DEuC0ilk.js +1 -0
- package/dist/client/assets/store-CW4k1iID.js +1 -0
- package/dist/client/assets/store-registry-C0XIPk1o.js +2 -0
- package/dist/client/assets/{studio-tools-kXfq3pN5.js → studio-tools-DGpKprde.js} +1 -1
- package/dist/client/assets/{switch-BL5aJnqG.js → switch-BofmoE_g.js} +1 -1
- package/dist/client/assets/{table-77ubNeic.js → table-Cbxpe5u6.js} +1 -1
- package/dist/client/assets/{tabs-Dh_kZG_m.js → tabs-mPJyea1e.js} +1 -1
- package/dist/client/assets/task-row-BrC9ZQiv.js +1 -0
- package/dist/client/assets/task-status-MSiVemqS.js +1 -0
- package/dist/client/assets/{textarea-D5nE7rMP.js → textarea-BJ7uXt99.js} +1 -1
- package/dist/client/assets/{toggle-group-oUYd1Jxm.js → toggle-group-CRVZDsng.js} +1 -1
- package/dist/client/assets/{toolbar-BSesNl59.js → toolbar-BIJJ6VS7.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Da4GFxZS.js → toolbar-icon-button-sU8FyquD.js} +1 -1
- package/dist/client/assets/{tools-list-JC_5uk0t.js → tools-list-D-u8vbQL.js} +1 -1
- package/dist/client/assets/{tooltip-B3h8W9fM.js → tooltip-BGL3A5jy.js} +1 -1
- package/dist/client/assets/{types-H_rr3OSP.js → types-DUULP3Cg.js} +1 -1
- package/dist/client/assets/{use-ai-providers-lTSdzFgc.js → use-ai-providers-CGMLoVgI.js} +1 -1
- package/dist/client/assets/use-automations-eYq1QdPO.js +1 -0
- package/dist/client/assets/{use-capability-Cgr7yHYD.js → use-capability--pStQfW2.js} +1 -1
- package/dist/client/assets/use-clock-tick-CF30qkon.js +1 -0
- package/dist/client/assets/{use-collections-Bb5vIdWQ.js → use-collections-DaNfbX0Q.js} +1 -1
- package/dist/client/assets/use-connection-rw8Y5wYH.js +1 -0
- package/dist/client/assets/{use-copy-ClKjk1Nz.js → use-copy-CLk0PZni.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BcrC97GS.js → use-create-virtual-mcp-B_ygxy0B.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CEbGGyRe.js → use-debounced-autosave-Chq2pCXJ.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BCxrmAGw.js → use-debounced-value-DarNUEml.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CkQ3Rugh.js → use-decopilot-events-C4jxMeza.js} +1 -1
- package/dist/client/assets/{use-delete-connection-COjWhEca.js → use-delete-connection-GWWQ0NwP.js} +1 -1
- package/dist/client/assets/{use-file-configs-CxoqQtr4.js → use-file-configs--8K7Ji7z.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DqqX0EF_.js → use-infinite-scroll-C2oRLreW.js} +1 -1
- package/dist/client/assets/{use-join-requests-BFV1IEGJ.js → use-join-requests-n3oXhO9U.js} +1 -1
- package/dist/client/assets/use-mcp-client-DbN0o_29.js +10 -0
- package/dist/client/assets/{use-mcp-prompts-F7AgPwEV.js → use-mcp-prompts-k9BBdGe-.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-UjXU5ids.js → use-mcp-tools-BaQM5Bz7.js} +1 -1
- package/dist/client/assets/{use-members-B-1xXj0d.js → use-members-CJvmy-r3.js} +1 -1
- package/dist/client/assets/{use-mobile-CTYLPqKT.js → use-mobile-CdswWdV_.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-ZLpx01PW.js → use-navigate-to-agent-yzOIB4ca.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-NLz6RBvg.js → use-org-auth-client-DQwimkN2.js} +1 -1
- package/dist/client/assets/{use-org-sso-nbZu8iS1.js → use-org-sso-DRbO1SYZ.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BEuKNbP8.js → use-organization-roles-CoVa3Svg.js} +1 -1
- package/dist/client/assets/use-organization-settings-B87409No.js +1 -0
- package/dist/client/assets/use-registry-connections-DPvd05bN.js +1 -0
- package/dist/client/assets/{use-secrets-CIN5lIiD.js → use-secrets-BfSDmFK4.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Bl8mPZM3.js → use-status-sounds-DzIbcTbB.js} +1 -1
- package/dist/client/assets/{use-view-mode-DE98MrNw.js → use-view-mode-viB7TTSY.js} +1 -1
- package/dist/client/assets/use-virtual-mcp-st0OLLtk.js +1 -0
- package/dist/client/assets/useInfiniteQuery-Cd0Nyb0J.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DO0pAzSF.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-g9RVw8Va.js → useSuspenseQueries-_jBEPc9k.js} +1 -1
- package/dist/client/assets/variant-calendar-BaDsfBeS.js +1 -0
- package/dist/client/assets/{view-mode-toggle-B3xxjWBP.js → view-mode-toggle-BekCb9Y2.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +513 -523
- package/dist/server/migrate.js +83 -83
- package/dist/server/server.js +314 -314
- package/package.json +1 -1
- package/dist/client/assets/ChevronUp-C2DYINXH.js +0 -1
- package/dist/client/assets/DotsVertical-CB1RTV9h.js +0 -1
- package/dist/client/assets/Eye-DHiUyPMS.js +0 -1
- package/dist/client/assets/SwitchHorizontal01-DTag6ZGf.js +0 -1
- package/dist/client/assets/agent-capabilities-BLdjNi42.js +0 -1
- package/dist/client/assets/agent-icon-HIFEO6vs.js +0 -1
- package/dist/client/assets/agents-list-YngYFo7C.js +0 -1
- package/dist/client/assets/ai-providers-BbExXFlh.js +0 -1
- package/dist/client/assets/app-editor-dXgIlUYv.js +0 -1
- package/dist/client/assets/automation-runs-LATF_NNh.js +0 -1
- package/dist/client/assets/automations-BBkP1No_.js +0 -1
- package/dist/client/assets/buckets-oHa98Efr.js +0 -1
- package/dist/client/assets/bulk-category-panel-C9FEvCBV.js +0 -1
- package/dist/client/assets/category-editor-Y8aXIh-A.js +0 -1
- package/dist/client/assets/checkbox-DnPlj3-W.js +0 -1
- package/dist/client/assets/collection-detail-C28Se3ZZ.js +0 -1
- package/dist/client/assets/collection-display-button-DOUzSfH_.js +0 -1
- package/dist/client/assets/commerce-onboarding-Dwo4yg2j.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-3SiI_mFd.js +0 -1
- package/dist/client/assets/connection-card-MLfvU4EZ.js +0 -1
- package/dist/client/assets/connection-detail-AC0jwDBB.js +0 -1
- package/dist/client/assets/connections-DNvp-Wd0.js +0 -1
- package/dist/client/assets/dropdown-menu-Ctb60TB7.js +0 -1
- package/dist/client/assets/extract-connection-data-RxV5HgFK.js +0 -1
- package/dist/client/assets/file-explorer-CqV9i4IM.js +0 -2
- package/dist/client/assets/general-mdgztBV6.js +0 -1
- package/dist/client/assets/github-repo-picker-CZI-ClVg.js +0 -1
- package/dist/client/assets/index-B1I1Oi0g.css +0 -1
- package/dist/client/assets/index-BMeJsDzW.js +0 -1
- package/dist/client/assets/index-DoOMda_E.js +0 -1
- package/dist/client/assets/members-C-oUAFwh.js +0 -1
- package/dist/client/assets/page-seo-sheet-Cg02Z-pf.js +0 -1
- package/dist/client/assets/post-editor-DoYb2wDl.js +0 -1
- package/dist/client/assets/profile-D3nqggYc.js +0 -1
- package/dist/client/assets/project-app-view-B9CUuk6-.js +0 -1
- package/dist/client/assets/record-editor-CjPHKje-.js +0 -1
- package/dist/client/assets/registry-8Yn6aIkw.js +0 -2
- package/dist/client/assets/roles-Dk6u6yco.js +0 -1
- package/dist/client/assets/secrets-CswlU-Ba.js +0 -1
- package/dist/client/assets/select-bneCBMXH.js +0 -1
- package/dist/client/assets/seo-editor-D0gZRnH2.js +0 -1
- package/dist/client/assets/shell-layout-CSNtx2tN.js +0 -1
- package/dist/client/assets/sso-CmKVccvq.js +0 -1
- package/dist/client/assets/store-DnZXwM23.js +0 -1
- package/dist/client/assets/store-registry-DzUKthzk.js +0 -2
- package/dist/client/assets/task-row-LdEr6awi.js +0 -1
- package/dist/client/assets/task-status-DNIO7fCq.js +0 -1
- package/dist/client/assets/use-automations-1J-hXDhd.js +0 -1
- package/dist/client/assets/use-clock-tick-D7gbCPid.js +0 -1
- package/dist/client/assets/use-connection-C0zEwTpO.js +0 -1
- package/dist/client/assets/use-mcp-client-C62ZsAPE.js +0 -10
- package/dist/client/assets/use-organization-settings-Dys1xzl0.js +0 -1
- package/dist/client/assets/use-registry-connections-By0sWOC0.js +0 -1
- package/dist/client/assets/use-virtual-mcp-D_g2q7bN.js +0 -1
- package/dist/client/assets/useInfiniteQuery-YzbBhr0w.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cgpvcam3.js +0 -1
- package/dist/client/assets/variant-calendar-CHjE3Ibi.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as K,D as ze,G as Ie,m as Le,K as Oe,k as Ke,d as ge,j as n,B as Ae,v as H,t as L,r as Te,p as Ue,l as _e,a1 as fe}from"./index-DgNLMhiy.js";import{t as Xe}from"./ChevronDown-DDeoixaJ.js";import{i as He}from"./ChevronRight-Cc93D1fP.js";import{s as qe,t as Me}from"./Star01-BwzFDtQr.js";import{n as Ve}from"./LinkExternal01-CPcvHi4V.js";import{s as Re}from"./Plus-sSvDtP2D.js";import{s as Ge}from"./Trash01-YsCUBRvj.js";import{i as Qe}from"./Zap-8CUqVoBU.js";import{c as Ye,b as Je,d as We,A as Ze,g as et,e as tt,a as st,f as nt}from"./alert-dialog-ClCDLHyi.js";import{I as ue}from"./input-CjQtu1h5.js";import{T as lt}from"./textarea-D5nE7rMP.js";import{P as Ne}from"./index-CvxPzQfb.js";import{u as $e}from"./studio-tools-kXfq3pN5.js";import{u as ot}from"./use-debounced-autosave-CEbGGyRe.js";import{R as rt}from"./require-capability-ByiCIEvf.js";import"./sidebar-C8N0hRhw.js";import"./LayoutLeft-DFSfhhoN.js";import"./use-mobile-CTYLPqKT.js";import"./sheet-B3x8ZiS-.js";import"./X-CAjmVwOR.js";import"./tooltip-B3h8W9fM.js";import"./use-capability-Cgr7yHYD.js";import"./access-gate-B6S-WMth.js";import"./capability-load-error-Bj6xKhKF.js";function we(t){const e=K.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==s?(c=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=c):c=e[3];let f;return e[4]!==o||e[5]!==r||e[6]!==c?(f=n.jsxs("div",{className:r,children:[c,o]}),e[4]=o,e[5]=r,e[6]=c,e[7]=f):f=e[7],f}function at(t){const e=K.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Te.useState("");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Qe,{size:18,className:"text-primary"})}),e[0]=c):c=e[0];let f,g;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),g=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=f,e[2]=g):(f=e[1],g=e[2]);let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=m=>r(m.target.value),e[3]=b):b=e[3];let p;e[4]!==l||e[5]!==o||e[6]!==s?(p=m=>{m.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==p?(d=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:b,className:"max-w-xs",onKeyDown:p}),e[8]=l,e[9]=p,e[10]=d):d=e[10];let a;e[11]!==l||e[12]!==o?(a=!l.trim()||o,e[11]=l,e[12]=o,e[13]=a):a=e[13];let i;e[14]!==l||e[15]!==s?(i=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=i):i=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(qe,{size:14}),e[17]=u):u=e[17];const h=o?"Extracting...":"Extract";let x;e[18]!==h||e[19]!==a||e[20]!==i?(x=n.jsxs(Ae,{variant:"outline",disabled:a,onClick:i,children:[u,h]}),e[18]=h,e[19]=a,e[20]=i,e[21]=x):x=e[21];let v;return e[22]!==x||e[23]!==d?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[c,n.jsxs("div",{className:"flex-1",children:[f,g,n.jsxs("div",{className:"mt-3 flex gap-2",children:[d,x]})]})]})}),e[22]=x,e[23]=d,e[24]=v):v=e[24],v}function it(t){const e=K.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const c=r;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=f):f=e[2];let g;e[3]!==o||e[4]!==l?(g=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=g):g=e[5];let b;e[6]!==s.control||e[7]!==g?(b=n.jsxs("div",{children:[f,n.jsx(fe,{control:s.control,name:"name",render:g})]}),e[6]=s.control,e[7]=g,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{children:"Domain"}),e[9]=p):p=e[9];let d;e[10]!==c?(d=c&&n.jsxs("a",{href:`https://${c}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Ve,{size:10}),"open"]}),e[10]=c,e[11]=d):d=e[11];let a;e[12]!==d?(a=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[p,d]}),e[12]=d,e[13]=a):a=e[13];let i;e[14]!==o||e[15]!==l?(i=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=i):i=e[16];let u;e[17]!==s.control||e[18]!==i?(u=n.jsx(fe,{control:s.control,name:"domain",render:i}),e[17]=s.control,e[18]=i,e[19]=u):u=e[19];let h;e[20]!==a||e[21]!==u?(h=n.jsxs("div",{children:[a,u]}),e[20]=a,e[21]=u,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b,h]}),e[23]=h,e[24]=b,e[25]=x):x=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let m;e[27]!==o||e[28]!==l?(m=D=>{const{field:y}=D;return n.jsx(lt,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=m):m=e[29];let C;e[30]!==s.control||e[31]!==m?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:m})]}),e[30]=s.control,e[31]=m,e[32]=C):C=e[32];let k;return e[33]!==x||e[34]!==C?(k=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[x,C]})}),e[33]=x,e[34]=C,e[35]=k):k=e[35],k}const ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Se(t){const e=K.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:c,onFieldCommit:f}=t,g=r===void 0?"h-full w-full object-contain p-3":r;let b;e[0]!==s||e[1]!==o?(b=s.watch(o),e[0]=s,e[1]=o,e[2]=b):b=e[2];const p=b;let d;e[3]!==g||e[4]!==l||e[5]!==p?(d=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:ct,children:p?n.jsx("img",{src:p,alt:l,className:g,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=g,e[4]=l,e[5]=p,e[6]=d):d=e[6];let a;e[7]!==l?(a=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=a):a=e[8];let i;e[9]!==c||e[10]!==f?(i=v=>{const{field:m}=v;return n.jsx(ue,{...m,onChange:C=>{m.onChange(C),c()},onBlur:()=>{m.onBlur(),f()},placeholder:"https://..."})},e[9]=c,e[10]=f,e[11]=i):i=e[11];let u;e[12]!==s.control||e[13]!==o||e[14]!==i?(u=n.jsx(fe,{control:s.control,name:o,render:i}),e[12]=s.control,e[13]=o,e[14]=i,e[15]=u):u=e[15];let h;e[16]!==a||e[17]!==u?(h=n.jsxs("div",{className:"flex-1",children:[a,u]}),e[16]=a,e[17]=u,e[18]=h):h=e[18];let x;return e[19]!==d||e[20]!==h?(x=n.jsxs("div",{className:"flex items-start gap-3",children:[d,h]}),e[19]=d,e[20]=h,e[21]=x):x=e[21],x}function dt(t){const e=K.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Se,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const mt=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ft(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=mt.map(f=>{const{key:g,label:b}=f,p=`fonts.${g}`,d=s.watch(p);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:b}),d&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:d},children:d})]}),n.jsx(fe,{control:s.control,name:p,render:a=>{const{field:i}=a;return n.jsx(ue,{...i,value:i.value??"",onChange:u=>{i.onChange(u),o()},onBlur:()=>{i.onBlur(),l()},placeholder:`Font family for ${b.toLowerCase()}`})}})]},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}const ut=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function xt(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(f=>{const{key:g,label:b}=f,p=`colors.${g}`;return n.jsx(fe,{control:s.control,name:p,render:d=>{const{field:a}=d;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:a.value??"#000000",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:a.value??"",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:b})]})}},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}function gt(t){const e=K.c(127),{brand:s,onChanged:o}=t,l=$e(),[r,c]=Te.useState(s.isDefault??!1),[f,g]=Te.useState(!1),b=s.name??"",p=s.domain??"",d=s.overview??"",a=s.logo??"",i=s.favicon??"",u=s.ogImage??"";let h;e[0]!==s.fonts?(h=s.fonts??{},e[0]=s.fonts,e[1]=h):h=e[1];let x;e[2]!==s.colors?(x=s.colors??{},e[2]=s.colors,e[3]=x):x=e[3];let v;e[4]!==b||e[5]!==p||e[6]!==d||e[7]!==a||e[8]!==i||e[9]!==u||e[10]!==h||e[11]!==x?(v={values:{name:b,domain:p,overview:d,logo:a,favicon:i,ogImage:u,fonts:h,colors:x}},e[4]=b,e[5]=p,e[6]=d,e[7]=a,e[8]=i,e[9]=u,e[10]=h,e[11]=x,e[12]=v):v=e[12];const m=Ue(v);let C;e[13]!==s.id||e[14]!==l?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(wt),Ce=Object.values(j.colors).some(_t);await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null})},onError:Nt},e[13]=s.id,e[14]=l,e[15]=C):C=e[15];const k=ge(C);let D;e[16]!==s.id||e[17]!==m||e[18]!==o||e[19]!==k?(D={delayMs:500,save:async()=>{const j=m.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=m.getValues(),Pe=m.control._defaultValues;m.reset(Ce,{keepValues:!0});try{await k.mutateAsync(Ce),H("brand_updated",{brand_id:s.id,fields:ve}),L.success("Brand context updated successfully"),o()}catch{m.reset(Pe,{keepValues:!0})}}},e[16]=s.id,e[17]=m,e[18]=o,e[19]=k,e[20]=D):D=e[20];const{schedule:y,flush:_}=ot(D);let $;e[21]!==s.id||e[22]!==l?($=async()=>{await l.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[21]=s.id,e[22]=l,e[23]=$):$=e[23];let P;e[24]!==s.id||e[25]!==o?(P=()=>{H("brand_deleted",{brand_id:s.id}),g(!1),o(),L.success("Brand deleted")},e[24]=s.id,e[25]=o,e[26]=P):P=e[26];let q;e[27]!==$||e[28]!==P?(q={mutationFn:$,onSuccess:P,onError:Ct},e[27]=$,e[28]=P,e[29]=q):q=e[29];const{mutate:U,isPending:N}=ge(q);let A;e[30]!==s.id||e[31]!==s.isDefault||e[32]!==l?(A=async()=>{await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[30]=s.id,e[31]=s.isDefault,e[32]=l,e[33]=A):A=e[33];let B;e[34]!==s.id||e[35]!==s.isDefault||e[36]!==o?(B=()=>{H(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),o(),L.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[34]=s.id,e[35]=s.isDefault,e[36]=o,e[37]=B):B=e[37];let T;e[38]!==A||e[39]!==B?(T={mutationFn:A,onSuccess:B,onError:vt},e[38]=A,e[39]=B,e[40]=T):T=e[40];const{mutate:X}=ge(T),xe=s.isDefault?"border-primary/30":"border-border/60";let O;e[41]!==xe?(O=_e("rounded-2xl border bg-background",xe),e[41]=xe,e[42]=O):O=e[42];let z;e[43]!==r?(z=()=>c(!r),e[43]=r,e[44]=z):z=e[44];let E;e[45]!==r?(E=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Xe,{size:14}):n.jsx(He,{size:14})}),e[45]=r,e[46]=E):E=e[46];let F;e[47]!==s.logo||e[48]!==s.name?(F=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:yt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[47]=s.logo,e[48]=s.name,e[49]=F):F=e[49];const I=s.name||"Untitled Brand";let S;e[50]!==I?(S=n.jsx("span",{className:"text-sm font-medium text-foreground",children:I}),e[50]=I,e[51]=S):S=e[51];let R;e[52]!==s.domain?(R=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[52]=s.domain,e[53]=R):R=e[53];let w;e[54]!==S||e[55]!==R?(w=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[S,R]}),e[54]=S,e[55]=R,e[56]=w):w=e[56];let M;e[57]!==s.colors||e[58]!==r?(M=!r&&s.colors&&Object.values(s.colors).some(jt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(bt).map(pt)}),e[57]=s.colors,e[58]=r,e[59]=M):M=e[59];let V;e[60]!==s.fonts||e[61]!==r?(V=!r&&s.fonts&&Object.values(s.fonts).some(ht)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[60]=s.fonts,e[61]=r,e[62]=V):V=e[62];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let G;e[63]!==De?(G=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[63]=De,e[64]=G):G=e[64];let Q,Y;e[65]!==X?(Q=j=>{j.stopPropagation(),X()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),X())},e[65]=X,e[66]=Q,e[67]=Y):(Q=e[66],Y=e[67]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[68]!==Be?(J=_e(Be),e[68]=Be,e[69]=J):J=e[69];let W;e[70]!==J?(W=n.jsx(Me,{size:13,className:J}),e[70]=J,e[71]=W):W=e[71];let Z;e[72]!==G||e[73]!==Q||e[74]!==Y||e[75]!==ke||e[76]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:G,onClick:Q,onKeyDown:Y,title:ke,children:W}),e[72]=G,e[73]=Q,e[74]=Y,e[75]=ke,e[76]=W,e[77]=Z):Z=e[77];let he,pe;e[78]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),g(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),g(!0))},e[78]=he,e[79]=pe):(he=e[78],pe=e[79]);let be;e[80]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Ge,{size:13,className:"text-muted-foreground"})}),e[80]=be):be=e[80];let ee;e[81]!==z||e[82]!==E||e[83]!==F||e[84]!==w||e[85]!==M||e[86]!==V||e[87]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:z,children:[E,F,w,M,V,Z,be]}),e[81]=z,e[82]=E,e[83]=F,e[84]=w,e[85]=M,e[86]=V,e[87]=Z,e[88]=ee):ee=e[88];let te;e[89]!==r||e[90]!==_||e[91]!==m||e[92]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(it,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(dt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(xt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(ft,{form:m,onFieldChange:y,onFieldCommit:_})]})]}),e[89]=r,e[90]=_,e[91]=m,e[92]=y,e[93]=te):te=e[93];let se;e[94]!==N?(se=j=>{!j&&!N&&g(!1)},e[94]=N,e[95]=se):se=e[95];let je;e[96]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(Ye,{children:"Delete brand?"}),e[96]=je):je=e[96];const Ee=s.name||"this brand";let ne;e[97]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[97]=Ee,e[98]=ne):ne=e[98];let le;e[99]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[99]=s.isDefault,e[100]=le):le=e[100];let oe;e[101]!==ne||e[102]!==le?(oe=n.jsxs(Je,{children:[je,n.jsx(We,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[101]=ne,e[102]=le,e[103]=oe):oe=e[103];let re;e[104]!==N?(re=n.jsx(Ze,{disabled:N,children:"Cancel"}),e[104]=N,e[105]=re):re=e[105];let ae;e[106]!==U?(ae=j=>{j.preventDefault(),U()},e[106]=U,e[107]=ae):ae=e[107];const Fe=N?"Deleting...":"Delete";let ie;e[108]!==N||e[109]!==ae||e[110]!==Fe?(ie=n.jsx(et,{onClick:ae,disabled:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[108]=N,e[109]=ae,e[110]=Fe,e[111]=ie):ie=e[111];let ce;e[112]!==re||e[113]!==ie?(ce=n.jsxs(tt,{children:[re,ie]}),e[112]=re,e[113]=ie,e[114]=ce):ce=e[114];let de;e[115]!==oe||e[116]!==ce?(de=n.jsxs(st,{children:[oe,ce]}),e[115]=oe,e[116]=ce,e[117]=de):de=e[117];let me;e[118]!==f||e[119]!==se||e[120]!==de?(me=n.jsx(nt,{open:f,onOpenChange:se,children:de}),e[118]=f,e[119]=se,e[120]=de,e[121]=me):me=e[121];let ye;return e[122]!==O||e[123]!==ee||e[124]!==te||e[125]!==me?(ye=n.jsxs("div",{className:O,children:[ee,te,me]}),e[122]=O,e[123]=ee,e[124]=te,e[125]=me,e[126]=ye):ye=e[126],ye}function ht(t){return t}function pt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function bt(t){const[,e]=t;return e}function jt(t){return t}function yt(t){t.target.style.display="none"}function vt(){return L.error("Failed to update default brand")}function Ct(){return L.error("Failed to delete brand")}function Nt(){return L.error("Failed to save brand context")}function _t(t){return t?.trim()}function wt(t){return t?.trim()}function Dt(){const t=K.c(53),{brandExtractEnabled:e}=ze(),{org:s}=Ie(),o=$e(),l=Le();let r;t[0]!==s.id?(r=Oe.brandContext(s.id),t[0]=s.id,t[1]=r):r=t[1];let c;t[2]!==o?(c=async()=>{const{items:w}=await o.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return w},t[2]=o,t[3]=c):c=t[3];let f;t[4]!==r||t[5]!==c?(f={queryKey:r,queryFn:c},t[4]=r,t[5]=c,t[6]=f):f=t[6];const{data:g}=Ke(f),p=(g===void 0?[]:g).filter(Et);let d;t[7]!==s.id||t[8]!==l?(d=()=>l.invalidateQueries({queryKey:Oe.brandContext(s.id),refetchType:"all"}),t[7]=s.id,t[8]=l,t[9]=d):d=t[9];const a=d;let i;t[10]!==o?(i=async()=>{await o.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=o,t[11]=i):i=t[11];let u;t[12]!==a?(u=()=>{H("brand_created"),a(),L.success("Brand created")},t[12]=a,t[13]=u):u=t[13];let h;t[14]!==i||t[15]!==u?(h={mutationFn:i,onSuccess:u,onError:Bt},t[14]=i,t[15]=u,t[16]=h):h=t[16];const{mutate:x,isPending:v}=ge(h);let m;t[17]!==o?(m=async w=>{H("brand_extract_started",{domain:w}),await o.call("BRAND_CONTEXT_EXTRACT",{domain:w})},t[17]=o,t[18]=m):m=t[18];let C;t[19]!==a?(C=()=>{H("brand_extract_succeeded"),a(),L.success("Brand extracted successfully")},t[19]=a,t[20]=C):C=t[20];let k;t[21]!==m||t[22]!==C?(k={mutationFn:m,onSuccess:C,onError:kt},t[21]=m,t[22]=C,t[23]=k):k=t[23];const{mutate:D,isPending:y}=ge(k),_=Ne,$=Ne,P=Ne,q="flex flex-col gap-6";let U;t[24]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[24]=U):U=t[24];let N;t[25]!==x?(N=()=>x(),t[25]=x,t[26]=N):N=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Re,{size:14}),t[27]=A):A=t[27];let B;t[28]!==v||t[29]!==N?(B=n.jsxs("div",{className:"flex items-center justify-between",children:[U,n.jsxs(Ae,{variant:"outline",onClick:N,disabled:v,children:[A,"Add Brand"]})]}),t[28]=v,t[29]=N,t[30]=B):B=t[30];let T;t[31]!==e||t[32]!==D||t[33]!==y?(T=e&&n.jsx(at,{onExtract:w=>D(w),isExtracting:y}),t[31]=e,t[32]=D,t[33]=y,t[34]=T):T=t[34];const X=p.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Ae,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>x(),disabled:v,children:[n.jsx(Re,{size:14}),"Add your first brand"]})]}),xe="group space-y-3";let O;t[35]!==a?(O=w=>n.jsx(gt,{brand:w,onChanged:a},w.id),t[35]=a,t[36]=O):O=t[36];const z=p.map(O);let E;t[37]!==z?(E=n.jsx("div",{className:xe,children:z}),t[37]=z,t[38]=E):E=t[38];let F;t[39]!==B||t[40]!==T||t[41]!==X||t[42]!==E?(F=n.jsxs("div",{className:q,children:[B,T,X,E]}),t[39]=B,t[40]=T,t[41]=X,t[42]=E,t[43]=F):F=t[43];let I;t[44]!==P.Body||t[45]!==F?(I=n.jsx(P.Body,{children:F}),t[44]=P.Body,t[45]=F,t[46]=I):I=t[46];let S;t[47]!==$.Content||t[48]!==I?(S=n.jsx($.Content,{children:I}),t[47]=$.Content,t[48]=I,t[49]=S):S=t[49];let R;return t[50]!==_||t[51]!==S?(R=n.jsx(_,{children:S}),t[50]=_,t[51]=S,t[52]=R):R=t[52],R}function kt(t){H("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),L.error(t instanceof Error?t.message:"Failed to extract brand")}function Bt(){return L.error("Failed to create brand")}function Et(t){return!t.archivedAt}function es(){const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(rt,{capability:"org:manage",area:"brand context",children:n.jsx(Dt,{})}),t[0]=e):e=t[0],e}export{es as default};
|
|
1
|
+
import{c as K,F as ze,D as Ie,m as Le,K as Oe,k as Ke,d as ge,j as n,B as Ae,v as H,t as L,r as Te,p as Ue,l as _e,a1 as fe}from"./index-BIvxcsMT.js";import{t as Xe}from"./ChevronDown-BJvvkmIr.js";import{i as He}from"./ChevronRight-BP1EbKKr.js";import{s as qe,t as Me}from"./Star01-7qhyucrX.js";import{n as Ve}from"./LinkExternal01-D58rAWvm.js";import{s as Re}from"./Plus-DX9uB6jT.js";import{s as Qe}from"./Trash01-CAEn55T5.js";import{i as Ge}from"./Zap-DeHaXJHA.js";import{c as Ye,b as Je,d as We,A as Ze,g as et,e as tt,a as st,f as nt}from"./alert-dialog-BLM89Cw2.js";import{I as ue}from"./input-C-5bkxwu.js";import{T as lt}from"./textarea-BJ7uXt99.js";import{P as Ne}from"./index-BeJ1yeue.js";import{u as $e}from"./studio-tools-DGpKprde.js";import{u as ot}from"./use-debounced-autosave-Chq2pCXJ.js";import{R as rt}from"./require-capability-B4CjdwjM.js";import"./sidebar-BxApc71_.js";import"./LayoutLeft-C8PdEJOQ.js";import"./use-mobile-CdswWdV_.js";import"./sheet-DMsXF2a5.js";import"./X-BWG-JTku.js";import"./tooltip-BGL3A5jy.js";import"./use-capability--pStQfW2.js";import"./access-gate-CaRDuo1w.js";import"./capability-load-error-6mU8gg9S.js";function we(t){const e=K.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==s?(c=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=c):c=e[3];let f;return e[4]!==o||e[5]!==r||e[6]!==c?(f=n.jsxs("div",{className:r,children:[c,o]}),e[4]=o,e[5]=r,e[6]=c,e[7]=f):f=e[7],f}function at(t){const e=K.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Te.useState("");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Ge,{size:18,className:"text-primary"})}),e[0]=c):c=e[0];let f,g;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),g=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=f,e[2]=g):(f=e[1],g=e[2]);let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=m=>r(m.target.value),e[3]=b):b=e[3];let p;e[4]!==l||e[5]!==o||e[6]!==s?(p=m=>{m.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==p?(d=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:b,className:"max-w-xs",onKeyDown:p}),e[8]=l,e[9]=p,e[10]=d):d=e[10];let a;e[11]!==l||e[12]!==o?(a=!l.trim()||o,e[11]=l,e[12]=o,e[13]=a):a=e[13];let i;e[14]!==l||e[15]!==s?(i=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=i):i=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(qe,{size:14}),e[17]=u):u=e[17];const h=o?"Extracting...":"Extract";let x;e[18]!==h||e[19]!==a||e[20]!==i?(x=n.jsxs(Ae,{variant:"outline",disabled:a,onClick:i,children:[u,h]}),e[18]=h,e[19]=a,e[20]=i,e[21]=x):x=e[21];let v;return e[22]!==x||e[23]!==d?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[c,n.jsxs("div",{className:"flex-1",children:[f,g,n.jsxs("div",{className:"mt-3 flex gap-2",children:[d,x]})]})]})}),e[22]=x,e[23]=d,e[24]=v):v=e[24],v}function it(t){const e=K.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const c=r;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=f):f=e[2];let g;e[3]!==o||e[4]!==l?(g=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=g):g=e[5];let b;e[6]!==s.control||e[7]!==g?(b=n.jsxs("div",{children:[f,n.jsx(fe,{control:s.control,name:"name",render:g})]}),e[6]=s.control,e[7]=g,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{children:"Domain"}),e[9]=p):p=e[9];let d;e[10]!==c?(d=c&&n.jsxs("a",{href:`https://${c}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Ve,{size:10}),"open"]}),e[10]=c,e[11]=d):d=e[11];let a;e[12]!==d?(a=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[p,d]}),e[12]=d,e[13]=a):a=e[13];let i;e[14]!==o||e[15]!==l?(i=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=i):i=e[16];let u;e[17]!==s.control||e[18]!==i?(u=n.jsx(fe,{control:s.control,name:"domain",render:i}),e[17]=s.control,e[18]=i,e[19]=u):u=e[19];let h;e[20]!==a||e[21]!==u?(h=n.jsxs("div",{children:[a,u]}),e[20]=a,e[21]=u,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b,h]}),e[23]=h,e[24]=b,e[25]=x):x=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let m;e[27]!==o||e[28]!==l?(m=D=>{const{field:y}=D;return n.jsx(lt,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=m):m=e[29];let C;e[30]!==s.control||e[31]!==m?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:m})]}),e[30]=s.control,e[31]=m,e[32]=C):C=e[32];let k;return e[33]!==x||e[34]!==C?(k=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[x,C]})}),e[33]=x,e[34]=C,e[35]=k):k=e[35],k}const ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Se(t){const e=K.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:c,onFieldCommit:f}=t,g=r===void 0?"h-full w-full object-contain p-3":r;let b;e[0]!==s||e[1]!==o?(b=s.watch(o),e[0]=s,e[1]=o,e[2]=b):b=e[2];const p=b;let d;e[3]!==g||e[4]!==l||e[5]!==p?(d=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:ct,children:p?n.jsx("img",{src:p,alt:l,className:g,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=g,e[4]=l,e[5]=p,e[6]=d):d=e[6];let a;e[7]!==l?(a=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=a):a=e[8];let i;e[9]!==c||e[10]!==f?(i=v=>{const{field:m}=v;return n.jsx(ue,{...m,onChange:C=>{m.onChange(C),c()},onBlur:()=>{m.onBlur(),f()},placeholder:"https://..."})},e[9]=c,e[10]=f,e[11]=i):i=e[11];let u;e[12]!==s.control||e[13]!==o||e[14]!==i?(u=n.jsx(fe,{control:s.control,name:o,render:i}),e[12]=s.control,e[13]=o,e[14]=i,e[15]=u):u=e[15];let h;e[16]!==a||e[17]!==u?(h=n.jsxs("div",{className:"flex-1",children:[a,u]}),e[16]=a,e[17]=u,e[18]=h):h=e[18];let x;return e[19]!==d||e[20]!==h?(x=n.jsxs("div",{className:"flex items-start gap-3",children:[d,h]}),e[19]=d,e[20]=h,e[21]=x):x=e[21],x}function dt(t){const e=K.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Se,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const mt=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ft(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=mt.map(f=>{const{key:g,label:b}=f,p=`fonts.${g}`,d=s.watch(p);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:b}),d&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:d},children:d})]}),n.jsx(fe,{control:s.control,name:p,render:a=>{const{field:i}=a;return n.jsx(ue,{...i,value:i.value??"",onChange:u=>{i.onChange(u),o()},onBlur:()=>{i.onBlur(),l()},placeholder:`Font family for ${b.toLowerCase()}`})}})]},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}const ut=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function xt(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(f=>{const{key:g,label:b}=f,p=`colors.${g}`;return n.jsx(fe,{control:s.control,name:p,render:d=>{const{field:a}=d;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:a.value??"#000000",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:a.value??"",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:b})]})}},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}function gt(t){const e=K.c(127),{brand:s,onChanged:o}=t,l=$e(),[r,c]=Te.useState(s.isDefault??!1),[f,g]=Te.useState(!1),b=s.name??"",p=s.domain??"",d=s.overview??"",a=s.logo??"",i=s.favicon??"",u=s.ogImage??"";let h;e[0]!==s.fonts?(h=s.fonts??{},e[0]=s.fonts,e[1]=h):h=e[1];let x;e[2]!==s.colors?(x=s.colors??{},e[2]=s.colors,e[3]=x):x=e[3];let v;e[4]!==b||e[5]!==p||e[6]!==d||e[7]!==a||e[8]!==i||e[9]!==u||e[10]!==h||e[11]!==x?(v={values:{name:b,domain:p,overview:d,logo:a,favicon:i,ogImage:u,fonts:h,colors:x}},e[4]=b,e[5]=p,e[6]=d,e[7]=a,e[8]=i,e[9]=u,e[10]=h,e[11]=x,e[12]=v):v=e[12];const m=Ue(v);let C;e[13]!==s.id||e[14]!==l?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(wt),Ce=Object.values(j.colors).some(_t);await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null})},onError:Nt},e[13]=s.id,e[14]=l,e[15]=C):C=e[15];const k=ge(C);let D;e[16]!==s.id||e[17]!==m||e[18]!==o||e[19]!==k?(D={delayMs:500,save:async()=>{const j=m.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=m.getValues(),Pe=m.control._defaultValues;m.reset(Ce,{keepValues:!0});try{await k.mutateAsync(Ce),H("brand_updated",{brand_id:s.id,fields:ve}),L.success("Brand context updated successfully"),o()}catch{m.reset(Pe,{keepValues:!0})}}},e[16]=s.id,e[17]=m,e[18]=o,e[19]=k,e[20]=D):D=e[20];const{schedule:y,flush:_}=ot(D);let $;e[21]!==s.id||e[22]!==l?($=async()=>{await l.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[21]=s.id,e[22]=l,e[23]=$):$=e[23];let P;e[24]!==s.id||e[25]!==o?(P=()=>{H("brand_deleted",{brand_id:s.id}),g(!1),o(),L.success("Brand deleted")},e[24]=s.id,e[25]=o,e[26]=P):P=e[26];let q;e[27]!==$||e[28]!==P?(q={mutationFn:$,onSuccess:P,onError:Ct},e[27]=$,e[28]=P,e[29]=q):q=e[29];const{mutate:U,isPending:N}=ge(q);let A;e[30]!==s.id||e[31]!==s.isDefault||e[32]!==l?(A=async()=>{await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[30]=s.id,e[31]=s.isDefault,e[32]=l,e[33]=A):A=e[33];let B;e[34]!==s.id||e[35]!==s.isDefault||e[36]!==o?(B=()=>{H(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),o(),L.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[34]=s.id,e[35]=s.isDefault,e[36]=o,e[37]=B):B=e[37];let T;e[38]!==A||e[39]!==B?(T={mutationFn:A,onSuccess:B,onError:vt},e[38]=A,e[39]=B,e[40]=T):T=e[40];const{mutate:X}=ge(T),xe=s.isDefault?"border-primary/30":"border-border/60";let O;e[41]!==xe?(O=_e("rounded-2xl border bg-background",xe),e[41]=xe,e[42]=O):O=e[42];let z;e[43]!==r?(z=()=>c(!r),e[43]=r,e[44]=z):z=e[44];let E;e[45]!==r?(E=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Xe,{size:14}):n.jsx(He,{size:14})}),e[45]=r,e[46]=E):E=e[46];let F;e[47]!==s.logo||e[48]!==s.name?(F=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:yt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[47]=s.logo,e[48]=s.name,e[49]=F):F=e[49];const I=s.name||"Untitled Brand";let S;e[50]!==I?(S=n.jsx("span",{className:"text-sm font-medium text-foreground",children:I}),e[50]=I,e[51]=S):S=e[51];let R;e[52]!==s.domain?(R=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[52]=s.domain,e[53]=R):R=e[53];let w;e[54]!==S||e[55]!==R?(w=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[S,R]}),e[54]=S,e[55]=R,e[56]=w):w=e[56];let M;e[57]!==s.colors||e[58]!==r?(M=!r&&s.colors&&Object.values(s.colors).some(jt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(bt).map(pt)}),e[57]=s.colors,e[58]=r,e[59]=M):M=e[59];let V;e[60]!==s.fonts||e[61]!==r?(V=!r&&s.fonts&&Object.values(s.fonts).some(ht)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[60]=s.fonts,e[61]=r,e[62]=V):V=e[62];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let Q;e[63]!==De?(Q=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[63]=De,e[64]=Q):Q=e[64];let G,Y;e[65]!==X?(G=j=>{j.stopPropagation(),X()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),X())},e[65]=X,e[66]=G,e[67]=Y):(G=e[66],Y=e[67]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[68]!==Be?(J=_e(Be),e[68]=Be,e[69]=J):J=e[69];let W;e[70]!==J?(W=n.jsx(Me,{size:13,className:J}),e[70]=J,e[71]=W):W=e[71];let Z;e[72]!==Q||e[73]!==G||e[74]!==Y||e[75]!==ke||e[76]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:Q,onClick:G,onKeyDown:Y,title:ke,children:W}),e[72]=Q,e[73]=G,e[74]=Y,e[75]=ke,e[76]=W,e[77]=Z):Z=e[77];let he,pe;e[78]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),g(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),g(!0))},e[78]=he,e[79]=pe):(he=e[78],pe=e[79]);let be;e[80]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Qe,{size:13,className:"text-muted-foreground"})}),e[80]=be):be=e[80];let ee;e[81]!==z||e[82]!==E||e[83]!==F||e[84]!==w||e[85]!==M||e[86]!==V||e[87]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:z,children:[E,F,w,M,V,Z,be]}),e[81]=z,e[82]=E,e[83]=F,e[84]=w,e[85]=M,e[86]=V,e[87]=Z,e[88]=ee):ee=e[88];let te;e[89]!==r||e[90]!==_||e[91]!==m||e[92]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(it,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(dt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(xt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(ft,{form:m,onFieldChange:y,onFieldCommit:_})]})]}),e[89]=r,e[90]=_,e[91]=m,e[92]=y,e[93]=te):te=e[93];let se;e[94]!==N?(se=j=>{!j&&!N&&g(!1)},e[94]=N,e[95]=se):se=e[95];let je;e[96]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(Ye,{children:"Delete brand?"}),e[96]=je):je=e[96];const Ee=s.name||"this brand";let ne;e[97]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[97]=Ee,e[98]=ne):ne=e[98];let le;e[99]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[99]=s.isDefault,e[100]=le):le=e[100];let oe;e[101]!==ne||e[102]!==le?(oe=n.jsxs(Je,{children:[je,n.jsx(We,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[101]=ne,e[102]=le,e[103]=oe):oe=e[103];let re;e[104]!==N?(re=n.jsx(Ze,{disabled:N,children:"Cancel"}),e[104]=N,e[105]=re):re=e[105];let ae;e[106]!==U?(ae=j=>{j.preventDefault(),U()},e[106]=U,e[107]=ae):ae=e[107];const Fe=N?"Deleting...":"Delete";let ie;e[108]!==N||e[109]!==ae||e[110]!==Fe?(ie=n.jsx(et,{onClick:ae,disabled:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[108]=N,e[109]=ae,e[110]=Fe,e[111]=ie):ie=e[111];let ce;e[112]!==re||e[113]!==ie?(ce=n.jsxs(tt,{children:[re,ie]}),e[112]=re,e[113]=ie,e[114]=ce):ce=e[114];let de;e[115]!==oe||e[116]!==ce?(de=n.jsxs(st,{children:[oe,ce]}),e[115]=oe,e[116]=ce,e[117]=de):de=e[117];let me;e[118]!==f||e[119]!==se||e[120]!==de?(me=n.jsx(nt,{open:f,onOpenChange:se,children:de}),e[118]=f,e[119]=se,e[120]=de,e[121]=me):me=e[121];let ye;return e[122]!==O||e[123]!==ee||e[124]!==te||e[125]!==me?(ye=n.jsxs("div",{className:O,children:[ee,te,me]}),e[122]=O,e[123]=ee,e[124]=te,e[125]=me,e[126]=ye):ye=e[126],ye}function ht(t){return t}function pt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function bt(t){const[,e]=t;return e}function jt(t){return t}function yt(t){t.target.style.display="none"}function vt(){return L.error("Failed to update default brand")}function Ct(){return L.error("Failed to delete brand")}function Nt(){return L.error("Failed to save brand context")}function _t(t){return t?.trim()}function wt(t){return t?.trim()}function Dt(){const t=K.c(53),{brandExtractEnabled:e}=ze(),{org:s}=Ie(),o=$e(),l=Le();let r;t[0]!==s.id?(r=Oe.brandContext(s.id),t[0]=s.id,t[1]=r):r=t[1];let c;t[2]!==o?(c=async()=>{const{items:w}=await o.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return w},t[2]=o,t[3]=c):c=t[3];let f;t[4]!==r||t[5]!==c?(f={queryKey:r,queryFn:c},t[4]=r,t[5]=c,t[6]=f):f=t[6];const{data:g}=Ke(f),p=(g===void 0?[]:g).filter(Et);let d;t[7]!==s.id||t[8]!==l?(d=()=>l.invalidateQueries({queryKey:Oe.brandContext(s.id),refetchType:"all"}),t[7]=s.id,t[8]=l,t[9]=d):d=t[9];const a=d;let i;t[10]!==o?(i=async()=>{await o.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=o,t[11]=i):i=t[11];let u;t[12]!==a?(u=()=>{H("brand_created"),a(),L.success("Brand created")},t[12]=a,t[13]=u):u=t[13];let h;t[14]!==i||t[15]!==u?(h={mutationFn:i,onSuccess:u,onError:Bt},t[14]=i,t[15]=u,t[16]=h):h=t[16];const{mutate:x,isPending:v}=ge(h);let m;t[17]!==o?(m=async w=>{H("brand_extract_started",{domain:w}),await o.call("BRAND_CONTEXT_EXTRACT",{domain:w})},t[17]=o,t[18]=m):m=t[18];let C;t[19]!==a?(C=()=>{H("brand_extract_succeeded"),a(),L.success("Brand extracted successfully")},t[19]=a,t[20]=C):C=t[20];let k;t[21]!==m||t[22]!==C?(k={mutationFn:m,onSuccess:C,onError:kt},t[21]=m,t[22]=C,t[23]=k):k=t[23];const{mutate:D,isPending:y}=ge(k),_=Ne,$=Ne,P=Ne,q="flex flex-col gap-6";let U;t[24]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[24]=U):U=t[24];let N;t[25]!==x?(N=()=>x(),t[25]=x,t[26]=N):N=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Re,{size:14}),t[27]=A):A=t[27];let B;t[28]!==v||t[29]!==N?(B=n.jsxs("div",{className:"flex items-center justify-between",children:[U,n.jsxs(Ae,{variant:"outline",onClick:N,disabled:v,children:[A,"Add Brand"]})]}),t[28]=v,t[29]=N,t[30]=B):B=t[30];let T;t[31]!==e||t[32]!==D||t[33]!==y?(T=e&&n.jsx(at,{onExtract:w=>D(w),isExtracting:y}),t[31]=e,t[32]=D,t[33]=y,t[34]=T):T=t[34];const X=p.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Ae,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>x(),disabled:v,children:[n.jsx(Re,{size:14}),"Add your first brand"]})]}),xe="group space-y-3";let O;t[35]!==a?(O=w=>n.jsx(gt,{brand:w,onChanged:a},w.id),t[35]=a,t[36]=O):O=t[36];const z=p.map(O);let E;t[37]!==z?(E=n.jsx("div",{className:xe,children:z}),t[37]=z,t[38]=E):E=t[38];let F;t[39]!==B||t[40]!==T||t[41]!==X||t[42]!==E?(F=n.jsxs("div",{className:q,children:[B,T,X,E]}),t[39]=B,t[40]=T,t[41]=X,t[42]=E,t[43]=F):F=t[43];let I;t[44]!==P.Body||t[45]!==F?(I=n.jsx(P.Body,{children:F}),t[44]=P.Body,t[45]=F,t[46]=I):I=t[46];let S;t[47]!==$.Content||t[48]!==I?(S=n.jsx($.Content,{children:I}),t[47]=$.Content,t[48]=I,t[49]=S):S=t[49];let R;return t[50]!==_||t[51]!==S?(R=n.jsx(_,{children:S}),t[50]=_,t[51]=S,t[52]=R):R=t[52],R}function kt(t){H("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),L.error(t instanceof Error?t.message:"Failed to extract brand")}function Bt(){return L.error("Failed to create brand")}function Et(t){return!t.archivedAt}function es(){const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(rt,{capability:"org:manage",area:"brand context",children:n.jsx(Dt,{})}),t[0]=e):e=t[0],e}export{es as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,l as m,j as o,b9 as u}from"./index-
|
|
1
|
+
import{c,l as m,j as o,b9 as u}from"./index-BIvxcsMT.js";import{i as d}from"./ChevronRight-BP1EbKKr.js";function b(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("min-w-0 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function x(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("ol",{"data-slot":"breadcrumb-list",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function N(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("inline-flex items-center gap-1.5 min-w-0",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("li",{"data-slot":"breadcrumb-item",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function g(r){const e=c.c(10);let a,t,s;e[0]!==r?({asChild:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);const l=a?u:"a";let i;e[4]!==t?(i=m("hover:text-foreground transition-colors truncate",t),e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==l||e[7]!==s||e[8]!==i?(n=o.jsx(l,{"data-slot":"breadcrumb-link",className:i,...s}),e[6]=l,e[7]=s,e[8]=i,e[9]=n):n=e[9],n}function j(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("text-foreground font-medium truncate",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function h(r){const e=c.c(12);let a,t,s;e[0]!==r?({children:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);let l;e[4]!==t?(l=m("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",t),e[4]=t,e[5]=l):l=e[5];let i;e[6]!==a?(i=a??o.jsx(d,{}),e[6]=a,e[7]=i):i=e[7];let n;return e[8]!==s||e[9]!==l||e[10]!==i?(n=o.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...s,children:i}),e[8]=s,e[9]=l,e[10]=i,e[11]=n):n=e[11],n}export{N as B,b as a,x as b,g as c,h as d,j as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as D,j as t,E as V,r as v,B as F,t as _}from"./index-BIvxcsMT.js";import{i as J}from"./AlertCircle-hfr9WJXe.js";import{i as O}from"./HardDrive-C2sIA93N.js";import{s as L}from"./Plus-DX9uB6jT.js";import{s as Q}from"./Trash01-CAEn55T5.js";import{A as X,g as Y,c as Z,b as ee,d as te,e as se,a as ie,f as re}from"./alert-dialog-BLM89Cw2.js";import{e as ne,d as le,c as ae,a as oe,b as ce,D as de}from"./dialog-1PlbGnxl.js";import{I as N}from"./input-C-5bkxwu.js";import{L as C}from"./label-CuPUA6lI.js";import{d as me,S as ue,a as fe,b as pe,c as q}from"./select-XC9B8kYb.js";import{S as xe}from"./switch-BofmoE_g.js";import{S as he}from"./skeleton-CS6PjKeZ.js";import{T as ge}from"./textarea-BJ7uXt99.js";import{P}from"./index-BeJ1yeue.js";import{c as je}from"./settings-section-CZoUIOGy.js";import{u as ye,b as be,c as ve}from"./use-file-configs--8K7Ji7z.js";import{R as Se}from"./require-capability-B4CjdwjM.js";import"./X-BWG-JTku.js";import"./tooltip-BGL3A5jy.js";import"./Check-DhEV1E4F.js";import"./ChevronDown-BJvvkmIr.js";import"./ChevronUp-CVqQKtsY.js";import"./sidebar-BxApc71_.js";import"./LayoutLeft-C8PdEJOQ.js";import"./use-mobile-CdswWdV_.js";import"./sheet-DMsXF2a5.js";import"./card-Cd_UT82w.js";import"./ArrowUpRight-DBXurizV.js";import"./studio-tools-DGpKprde.js";import"./use-capability--pStQfW2.js";import"./access-gate-CaRDuo1w.js";import"./capability-load-error-6mU8gg9S.js";function Ce(s,e){if(!(s instanceof Error))return e;const i=s.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(i)try{const r=JSON.parse(i[0])[0];if(r?.message){const l=r.path?.join(".");return l?`${l}: ${r.message}`:r.message}}catch{}return s.message||e}function ke(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(J,{size:16}),e[0]=n):n=e[0];let r;return e[1]!==i.message?(r=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load file configurations: ",i.message]})]}),e[1]=i.message,e[2]=r):r=e[2],r}function Ne(s){const e=D.c(44),{config:i,onDelete:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(O,{size:16,className:"text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]!==i.name?(l=t.jsx("span",{className:"font-medium text-sm truncate",children:i.name}),e[1]=i.name,e[2]=l):l=e[2];let o;e[3]!==i.credentialType?(o=i.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):i.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"Managed"}):null,e[3]=i.credentialType,e[4]=o):o=e[4];let g;e[5]!==i.bucket||e[6]!==i.region?(g=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[5]=i.bucket,e[6]=i.region,e[7]=g):g=e[7];let c;e[8]!==l||e[9]!==o||e[10]!==g?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o,g]}),e[8]=l,e[9]=o,e[10]=g,e[11]=c):c=e[11];let b;e[12]!==i.description?(b=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[12]=i.description,e[13]=b):b=e[13];let j;e[14]!==i.endpoint||e[15]!==i.forcePathStyle?(j=i.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[i.endpoint,i.forcePathStyle?" (path-style)":""]}):null,e[14]=i.endpoint,e[15]=i.forcePathStyle,e[16]=j):j=e[16];let d;e[17]!==i.prefix?(d=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[17]=i.prefix,e[18]=d):d=e[18];let m;e[19]!==i.publicUrlBase?(m=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[19]=i.publicUrlBase,e[20]=m):m=e[20];let y;e[21]!==c||e[22]!==b||e[23]!==j||e[24]!==d||e[25]!==m?(y=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[c,b,j,d,m]})]}),e[21]=c,e[22]=b,e[23]=j,e[24]=d,e[25]=m,e[26]=y):y=e[26];let f;e[27]!==i.createdAt?(f=new Date(i.createdAt).toLocaleDateString(),e[27]=i.createdAt,e[28]=f):f=e[28];let u;e[29]!==f?(u=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[29]=f,e[30]=u):u=e[30];let p;e[31]!==i||e[32]!==n?(p=()=>n(i),e[31]=i,e[32]=n,e[33]=p):p=e[33];const x=`Delete ${i.name}`;let h;e[34]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Q,{size:14}),e[34]=h):h=e[34];let k;e[35]!==p||e[36]!==x?(k=t.jsx(F,{variant:"ghost",size:"sm",onClick:p,"aria-label":x,children:h}),e[35]=p,e[36]=x,e[37]=k):k=e[37];let S;e[38]!==u||e[39]!==k?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,k]}),e[38]=u,e[39]=k,e[40]=S):S=e[40];let A;return e[41]!==y||e[42]!==S?(A=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[y,S]}),e[41]=y,e[42]=S,e[43]=A):A=e[43],A}function Ae(s){const e=D.c(5),{onCreate:i}=s;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(O,{size:20,className:"text-muted-foreground"})}),r=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No buckets configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket (AWS S3, Cloudflare R2, Google Cloud Storage, MinIO). Access keys are encrypted at rest and never returned over the API."})]}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(L,{size:14}),e[2]=l):l=e[2];let o;return e[3]!==i?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[n,r,t.jsxs(F,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function K({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,g]=v.useState(""),[c,b]=v.useState(""),[j,d]=v.useState(""),[m,y]=v.useState(!1),[f,u]=v.useState(""),[p,x]=v.useState(""),[h,k]=v.useState("static"),[S,A]=v.useState(""),[R,I]=v.useState(""),[T,U]=v.useState(""),[B,E]=v.useState(""),w=be();function $(){n(""),l(""),g(""),b(""),d(""),y(!1),u(""),x(""),k("static"),A(""),I(""),U(""),E("")}const z=h==="sts-session"?!!(T.trim()&&B.trim()):!!(S&&R);async function M(a){if(a.preventDefault(),!i.trim()||!o.trim()||!c.trim()||!z)return;const W=h==="sts-session"?{credentialType:"sts-session",refreshUrl:T.trim(),apiKey:B.trim()}:{credentialType:"static",accessKeyId:S,secretAccessKey:R};try{await w.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:c.trim(),endpoint:j.trim()||void 0,forcePathStyle:m,prefix:f.trim()||void 0,publicUrlBase:p.trim()||void 0,...W}),_.success(`Bucket "${i.trim()}" added`),$(),e(!1)}catch(H){_.error(Ce(H,"Failed to add bucket"))}}const G=w.isPending||!i.trim()||!o.trim()||!c.trim()||!z;return t.jsx(ne,{open:s,onOpenChange:e,children:t.jsxs(le,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(ae,{children:[t.jsx(oe,{children:"Add S3 bucket"}),t.jsx(ce,{children:"Credentials are encrypted at rest and never returned over the API. For Cloudflare R2, Google Cloud Storage, or MinIO, set a custom endpoint."})]}),t.jsxs("form",{onSubmit:M,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:a=>n(a.target.value),placeholder:"production-uploads",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Unique within the organization."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:a=>g(a.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:c,onChange:a=>b(a.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:j,onChange:a=>d(a.target.value),placeholder:"https://<account>.r2.cloudflarestorage.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for non-AWS providers (R2, GCS, MinIO)."})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(C,{htmlFor:"file-config-path-style",className:"text-sm",children:"Force path-style URLs"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Required for Google Cloud Storage and most MinIO setups."})]}),t.jsx(xe,{id:"file-config-path-style",checked:m,onCheckedChange:y})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:f,onChange:a=>u(a.target.value),placeholder:"tenants/acme/",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"All object keys are written under this prefix. Useful for multi-tenant buckets or credentials scoped to a sub-path. A trailing slash is added automatically."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:p,onChange:a=>x(a.target.value),placeholder:"https://pub-xxxx.r2.dev or https://cdn.example.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Host used to build public URLs returned by the picker (R2 dev domain, CDN, custom host). Leave blank to use the bucket's S3 host (AWS default)."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-credential-type",children:"Credentials"}),t.jsxs(me,{value:h,onValueChange:a=>k(a),children:[t.jsx(ue,{id:"file-config-credential-type",className:"w-full",children:t.jsx(fe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:"Static key pair (long-lived)"}),t.jsx(q,{value:"sts-session",children:"Temporary session (STS, auto-refreshed)"})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:h==="sts-session"?"Stores only a refresh endpoint + API key; short-lived credentials are fetched on demand and refreshed automatically.":"A long-lived access key ID and secret, used as-is."})]}),h==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:S,onChange:a=>A(a.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:R,onChange:a=>I(a.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-refresh-url",children:"Refresh URL"}),t.jsx(N,{id:"file-config-refresh-url",type:"url",value:T,onChange:a=>U(a.target.value),placeholder:"https://admin.example.com/api/acme/s3-credentials",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Endpoint POSTed (with the API key below) to vend temporary credentials. Must return accessKeyId, secretAccessKey, sessionToken, and expiration."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-api-key",children:"API key"}),t.jsx(N,{id:"file-config-api-key",type:"password",value:B,onChange:a=>E(a.target.value),autoComplete:"new-password",required:!0}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Sent as the ",t.jsx("code",{children:"x-api-key"})," header on each refresh call."]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(ge,{id:"file-config-description",value:r,onChange:a=>l(a.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(de,{children:[t.jsx(F,{type:"button",variant:"outline",onClick:()=>{$(),e(!1)},disabled:w.isPending,children:"Cancel"}),t.jsx(F,{type:"submit",disabled:G,children:w.isPending?"Adding…":"Add bucket"})]})]})]})})}function De(s){const e=D.c(25),{config:i,onClose:n}=s,r=ve();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),_.success(`Bucket "${i.name}" removed`),n()}catch(k){const S=k;_.error(S instanceof Error?S.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,g=i!==null;let c;e[4]!==n?(c=h=>!h&&n(),e[4]=n,e[5]=c):c=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Z,{children:"Remove bucket configuration?"}),e[6]=b):b=e[6];const j=i?.name;let d;e[7]!==j?(d=t.jsxs(ee,{children:[b,t.jsxs(te,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:j}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=j,e[8]=d):d=e[8];let m;e[9]!==r.isPending?(m=t.jsx(X,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=m):m=e[10];const y=r.isPending?"Removing…":"Remove";let f;e[11]!==r.isPending||e[12]!==o||e[13]!==y?(f=t.jsx(Y,{onClick:o,disabled:r.isPending,children:y}),e[11]=r.isPending,e[12]=o,e[13]=y,e[14]=f):f=e[14];let u;e[15]!==m||e[16]!==f?(u=t.jsxs(se,{children:[m,f]}),e[15]=m,e[16]=f,e[17]=u):u=e[17];let p;e[18]!==u||e[19]!==d?(p=t.jsxs(ie,{children:[d,u]}),e[18]=u,e[19]=d,e[20]=p):p=e[20];let x;return e[21]!==p||e[22]!==g||e[23]!==c?(x=t.jsx(re,{open:g,onOpenChange:c,children:p}),e[21]=p,e[22]=g,e[23]=c,e[24]=x):x=e[24],x}function Fe(){const s=D.c(25),e=ye(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let x;s[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ae,{onCreate:()=>n(!0)}),s[0]=x):x=s[0];let h;return s[1]!==i?(h=t.jsxs(t.Fragment,{children:[x,t.jsx(K,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=h):h=s[2],h}const o=e.length===1?"":"s";let g;s[3]!==e.length||s[4]!==o?(g=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=g):g=s[5];let c;s[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n(!0),s[6]=c):c=s[6];let b;s[7]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs(F,{onClick:c,size:"sm",children:[t.jsx(L,{size:14}),"Add bucket"]}),s[7]=b):b=s[7];let j;s[8]!==g?(j=t.jsxs("div",{className:"flex items-center justify-between",children:[g,b]}),s[8]=g,s[9]=j):j=s[9];let d;if(s[10]!==e){let x;s[12]===Symbol.for("react.memo_cache_sentinel")?(x=h=>t.jsx(Ne,{config:h,onDelete:l},h.id),s[12]=x):x=s[12],d=e.map(x),s[10]=e,s[11]=d}else d=s[11];let m;s[13]!==d?(m=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:d})}),s[13]=d,s[14]=m):m=s[14];let y;s[15]!==i?(y=t.jsx(K,{open:i,onOpenChange:n}),s[15]=i,s[16]=y):y=s[16];let f;s[17]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),s[17]=f):f=s[17];let u;s[18]!==r?(u=t.jsx(De,{config:r,onClose:f}),s[18]=r,s[19]=u):u=s[19];let p;return s[20]!==j||s[21]!==m||s[22]!==y||s[23]!==u?(p=t.jsxs(t.Fragment,{children:[j,m,y,u]}),s[20]=j,s[21]=m,s[22]=y,s[23]=u,s[24]=p):p=s[24],p}function we(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(P.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(P,{children:t.jsx(P.Content,{children:t.jsx(P.Body,{children:t.jsxs(je,{children:[e,t.jsx(V,{fallback:Pe,children:t.jsx(v.Suspense,{fallback:t.jsx(he,{className:"h-32 w-full"}),children:t.jsx(Fe,{})})})]})})})}),s[1]=i):i=s[1],i}function Pe(s){const{error:e}=s;return t.jsx(ke,{error:e??new Error("Failed to load file configs")})}function ct(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Se,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),s[0]=e):e=s[0],e}export{ct as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as O,l as X,j as t,r as Q,B as H,i as le}from"./index-BIvxcsMT.js";import{Y as Z}from"./agent-icon-CuxkxUe-.js";import{i as ie}from"./X-BWG-JTku.js";import{L as J}from"./label-CuPUA6lI.js";import{I as oe,R as re,a as ae}from"./index-D2iM60An.js";import{i as ce}from"./Circle-BnMDtDeu.js";import{d as ne,S as me,a as de,b as pe,c as xe}from"./select-XC9B8kYb.js";import{a as fe,b as ue,T as he}from"./tooltip-BGL3A5jy.js";import"./AlertCircle-hfr9WJXe.js";import"./Tool01-DGnLcysQ.js";import"./SwitchHorizontal01-sG-IqCt6.js";import"./Settings02-CZ9vMUyw.js";import"./XCircle-C94QFqN0.js";import"./ArrowUpRight-DBXurizV.js";import"./ZapSquare-DBjTUciD.js";import"./Users03-DHP7OUDR.js";import"./CheckCircle-CbuPUNoj.js";import"./Check-DhEV1E4F.js";import"./ChevronDown-BJvvkmIr.js";import"./ChevronRight-BP1EbKKr.js";import"./ChevronUp-CVqQKtsY.js";import"./Stars02-CFivD_f8.js";import"./Loading02-DejqZGnO.js";import"./Copy01-Cm6DymEJ.js";import"./ZoomOut-DltoXGbL.js";import"./DotsVertical-BU3qKzJo.js";import"./Globe01-CxIEuzOP.js";import"./Eye-CtocRVwR.js";import"./FilterLines-XaejSF3d.js";import"./Star01-7qhyucrX.js";import"./Globe04-DZ-Pm9xo.js";import"./HardDrive-C2sIA93N.js";import"./Key01-D8bQG_zp.js";import"./LayoutLeft-C8PdEJOQ.js";import"./LinkExternal01-D58rAWvm.js";import"./List-vf0HKUEp.js";import"./Monitor01-CodDwsVO.js";import"./Sun-CHp4Y1Dq.js";import"./Palette-CgTelSEQ.js";import"./Play-Dh4_54hC.js";import"./Plus-DX9uB6jT.js";import"./SearchLg-D0ZqoPSb.js";import"./SearchMd-DWSBWjan.js";import"./Shield01-DvUXE0jO.js";import"./Stars01-DN1mvd59.js";import"./Trash01-CAEn55T5.js";import"./Upload01-DKn5tYXN.js";import"./User01-IYcmkjnc.js";import"./Users01-0WxprMle.js";import"./XClose-CQikaAXa.js";import"./Zap-DeHaXJHA.js";function ge(i){const e=O.c(8);let o,s;e[0]!==i?({className:o,...s}=i,e[0]=i,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=X("grid gap-3",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=t.jsx(re,{"data-slot":"radio-group",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function W(i){const e=O.c(9);let o,s;e[0]!==i?({className:o,...s}=i,e[0]=i,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=X("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",o),e[3]=o,e[4]=r):r=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ae,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(ce,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==r?(c=t.jsx(oe,{"data-slot":"radio-group-item",className:r,...s,children:l}),e[6]=s,e[7]=r,e[8]=c):c=e[8],c}function gt(i){const e=O.c(69),{posts:o,categories:s,initialSlug:r,isPending:l,onApply:c,onClose:d}=i,[n,ee]=Q.useState(r&&s.some(m=>m.slug===r)?r:s[0]?.slug??""),[p,te]=Q.useState("add");let T;if(e[0]!==s||e[1]!==n){let m;e[3]!==n?(m=se=>se.slug===n,e[3]=n,e[4]=m):m=e[4],T=s.find(m),e[0]=s,e[1]=n,e[2]=T}else T=e[2];const x=T,a=o.length,K=a===1?"post":"posts";let f;e[5]!==a||e[6]!==K?(f=t.jsxs("span",{className:"truncate text-sm font-medium",children:[a," ",K," selected"]}),e[5]=a,e[6]=K,e[7]=f):f=e[7];let E;e[8]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ie,{size:14}),e[8]=E):E=e[8];let u;e[9]!==l||e[10]!==d?(u=t.jsx(fe,{asChild:!0,children:t.jsx(H,{type:"button",variant:"ghost",size:"icon",disabled:l,onClick:d,"aria-label":"Exit selection",children:E})}),e[9]=l,e[10]=d,e[11]=u):u=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ue,{side:"bottom",children:"Exit selection"}),e[12]=I):I=e[12];let h;e[13]!==u?(h=t.jsxs(he,{children:[u,I]}),e[13]=u,e[14]=h):h=e[14];let g;e[15]!==f||e[16]!==h?(g=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[f,h]}),e[15]=f,e[16]=h,e[17]=g):g=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Update category"}),e[18]=A):A=e[18];const M=a===0?"Select posts from the list to choose what this update applies to.":`Choose a category to apply to ${a} ${a===1?"post":"posts"}.`;let j;e[19]!==M?(j=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:M}),e[19]=M,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(J,{children:"Category"}),e[21]=B):B=e[21];let b;e[22]!==s||e[23]!==n?(b=t.jsxs("div",{className:"space-y-2",children:[B,s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):t.jsxs(ne,{value:n,onValueChange:ee,children:[t.jsx(me,{className:"w-full",children:t.jsx(de,{placeholder:"Select a category"})}),t.jsx(pe,{children:s.map(be)})]})]}),e[22]=s,e[23]=n,e[24]=b):b=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=m=>te(m),e[25]=F):F=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(W,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[26]=V):V=e[26];let G;e[27]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsxs(J,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[V,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[27]=G):G=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(W,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[28]=L):L=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs(J,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[L,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[29]=P):P=e[29];let y;e[30]!==p?(y=t.jsxs(ge,{value:p,onValueChange:F,className:"gap-2",children:[G,P]}),e[30]=p,e[31]=y):y=e[31];let N;e[32]!==l||e[33]!==d?(N=t.jsx(H,{type:"button",variant:"outline",onClick:d,disabled:l,children:"Cancel"}),e[32]=l,e[33]=d,e[34]=N):N=e[34];const Y=!x||l||a===0;let v;e[35]!==p||e[36]!==c||e[37]!==x?(v=()=>x&&c(p,{name:x.name,slug:x.slug}),e[35]=p,e[36]=c,e[37]=x,e[38]=v):v=e[38];let S;e[39]!==l?(S=l?t.jsxs(t.Fragment,{children:[t.jsx(le,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[39]=l,e[40]=S):S=e[40];let _;e[41]!==Y||e[42]!==v||e[43]!==S?(_=t.jsx(H,{type:"button",disabled:Y,onClick:v,children:S}),e[41]=Y,e[42]=v,e[43]=S,e[44]=_):_=e[44];let k;e[45]!==N||e[46]!==_?(k=t.jsxs("div",{className:"flex justify-end gap-2",children:[N,_]}),e[45]=N,e[46]=_,e[47]=k):k=e[47];let C;e[48]!==b||e[49]!==y||e[50]!==k?(C=t.jsxs("div",{className:"mt-6 space-y-4",children:[b,y,k]}),e[48]=b,e[49]=y,e[50]=k,e[51]=C):C=e[51];let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Z,{size:16,className:"shrink-0 text-muted-foreground"}),e[52]=U):U=e[52];const D=a===1?"post":"posts";let w;e[53]!==a||e[54]!==D?(w=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[U,t.jsxs("span",{className:"text-sm",children:[a," selected ",D]})]}),e[53]=a,e[54]=D,e[55]=w):w=e[55];let R;e[56]!==a||e[57]!==o?(R=a===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:"No posts selected yet — pick them from the list on the left."}):t.jsx("ul",{className:"divide-y border-t bg-background",children:o.map(je)}),e[56]=a,e[57]=o,e[58]=R):R=e[58];let $;e[59]!==w||e[60]!==R?($=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[w,R]}),e[59]=w,e[60]=R,e[61]=$):$=e[61];let z;e[62]!==j||e[63]!==C||e[64]!==$?(z=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[A,j,C,$]})}),e[62]=j,e[63]=C,e[64]=$,e[65]=z):z=e[65];let q;return e[66]!==z||e[67]!==g?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[g,z]}),e[66]=z,e[67]=g,e[68]=q):q=e[68],q}function je(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(Z,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function be(i){return t.jsx(xe,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{gt as BulkCategoryPanel};
|
package/dist/client/assets/{capability-load-error-Bj6xKhKF.js → capability-load-error-6mU8gg9S.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,m as o,
|
|
1
|
+
import{c as a,m as o,D as c,j as t,W as m,B as u,K as x}from"./index-BIvxcsMT.js";function f(){const e=a.c(5),l=o(),{locator:n}=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(m,{size:28})}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Couldn't load your permissions"}),t.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Something went wrong checking your access. This is usually temporary."})]}),e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==l?(r=t.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[s,i,t.jsx(u,{variant:"outline",size:"sm",onClick:()=>l.invalidateQueries({queryKey:x.myCapabilities(n)}),children:"Try again"})]}),e[2]=n,e[3]=l,e[4]=r):r=e[4],r}export{f as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,l as n,j as c}from"./index-
|
|
1
|
+
import{c as o,l as n,j as c}from"./index-BIvxcsMT.js";function i(a){const e=o.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl card-shadow",t),e[3]=t,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=c.jsx("div",{"data-slot":"card",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function f(a){const e=o.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{i as C,f as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as G,r as S,l as J,j as t,B as U,i as Q,t as I}from"./index-BIvxcsMT.js";import{i as V}from"./XCircle-C94QFqN0.js";import{aE as X,Y as T}from"./agent-icon-CuxkxUe-.js";import{n as Z}from"./LinkExternal01-D58rAWvm.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-BLM89Cw2.js";import{I as L}from"./input-C-5bkxwu.js";import{L as M}from"./label-CuPUA6lI.js";import{au as at,av as mt,aD as nt,at as lt,aw as R,ay as pt,aE as ct}from"./index-BhywTD9L.js";import{c as dt,B as ut,a as gt}from"./block-document-zDNpXx1K.js";import{u as xt,s as v,E as ft}from"./primitives-B_yiwpb8.js";import{t as ht}from"./ChevronDown-BJvvkmIr.js";import{f as yt,h as jt,e as vt}from"./scroll-area-CiGoarGm.js";import"./AlertCircle-hfr9WJXe.js";import"./Tool01-DGnLcysQ.js";import"./SwitchHorizontal01-sG-IqCt6.js";import"./Settings02-CZ9vMUyw.js";import"./ArrowUpRight-DBXurizV.js";import"./ZapSquare-DBjTUciD.js";import"./Users03-DHP7OUDR.js";import"./CheckCircle-CbuPUNoj.js";import"./Check-DhEV1E4F.js";import"./ChevronRight-BP1EbKKr.js";import"./ChevronUp-CVqQKtsY.js";import"./Circle-BnMDtDeu.js";import"./Stars02-CFivD_f8.js";import"./Loading02-DejqZGnO.js";import"./Copy01-Cm6DymEJ.js";import"./ZoomOut-DltoXGbL.js";import"./DotsVertical-BU3qKzJo.js";import"./Globe01-CxIEuzOP.js";import"./Eye-CtocRVwR.js";import"./FilterLines-XaejSF3d.js";import"./Star01-7qhyucrX.js";import"./Globe04-DZ-Pm9xo.js";import"./HardDrive-C2sIA93N.js";import"./Key01-D8bQG_zp.js";import"./LayoutLeft-C8PdEJOQ.js";import"./List-vf0HKUEp.js";import"./Monitor01-CodDwsVO.js";import"./Sun-CHp4Y1Dq.js";import"./Palette-CgTelSEQ.js";import"./Play-Dh4_54hC.js";import"./Plus-DX9uB6jT.js";import"./SearchLg-D0ZqoPSb.js";import"./SearchMd-DWSBWjan.js";import"./Shield01-DvUXE0jO.js";import"./Stars01-DN1mvd59.js";import"./Trash01-CAEn55T5.js";import"./Upload01-DKn5tYXN.js";import"./User01-IYcmkjnc.js";import"./Users01-0WxprMle.js";import"./XClose-CQikaAXa.js";import"./X-BWG-JTku.js";import"./Zap-DeHaXJHA.js";import"./library-tab-B9PQjg9x.js";import"./chat-context-BEYxfvRE.js";import"./hooks-C98PDXkO.js";import"./use-mcp-client-DbN0o_29.js";import"./constants-C8_Swa4x.js";import"./auth-By4coGKl.js";import"./decopilot-sse-pool-tveLasMO.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-st0OLLtk.js";import"./use-collections-DaNfbX0Q.js";import"./use-ai-providers-CGMLoVgI.js";import"./studio-tools-DGpKprde.js";import"./use-decopilot-events-C4jxMeza.js";import"./tab-id-CLpu897Q.js";import"./use-organization-settings-B87409No.js";import"./tooltip-BGL3A5jy.js";import"./dialog-1PlbGnxl.js";import"./drawer-D7F9J8H1.js";import"./collection-search-_ltIvUcU.js";import"./use-mobile-CdswWdV_.js";import"./use-mcp-prompts-k9BBdGe-.js";import"./shell-layout-CX1dOlGj.js";import"./avatar-BeEkEhV9.js";import"./required-auth-layout-B14liizk.js";import"./use-org-sso-DRbO1SYZ.js";import"./form-DY5CJF6A.js";import"./select-XC9B8kYb.js";import"./tabs-mPJyea1e.js";import"./toggle-group-CRVZDsng.js";import"./agent-capabilities-BBWlBKsQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-COLJGGyb.js";import"./use-registry-connections-DPvd05bN.js";import"./use-connection-rw8Y5wYH.js";import"./useInfiniteQuery-Cd0Nyb0J.js";import"./use-infinite-scroll-C2oRLreW.js";import"./extract-connection-data-DXmsDXzN.js";import"./card-Cd_UT82w.js";import"./integration-icon-DWcR_mMd.js";import"./collection-tabs-ByJ2lCEV.js";import"./badge-EC_FS1hJ.js";import"./textarea-BJ7uXt99.js";import"./connection-form-helpers-Bx2EyqE0.js";import"./authenticate-and-persist-oauth-1U_DESs3.js";import"./mcp-oauth-BFb5Mr2N.js";import"./useSuspenseInfiniteQuery-DO0pAzSF.js";import"./connect-desktop-dialog-D4NpUtWr.js";import"./decopilot-CphvkEuu.js";import"./checkbox-B7ovMLyf.js";import"./skeleton-CS6PjKeZ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CZoUIOGy.js";import"./popover-BnhIWYgB.js";import"./command-D8TSS276.js";import"./index-Du424YAy.js";import"./index-DPO0Ar5L.js";import"./file-type-icon-CjQ-i8Tj.js";import"./toolbar-BIJJ6VS7.js";import"./use-debounced-value-DarNUEml.js";import"./dropdown-menu-DgucD0Wn.js";import"./index-CXhPz6Na.js";import"./question-004-sINsf4GQ.js";import"./task-row-BrC9ZQiv.js";import"./task-status-MSiVemqS.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-clock-tick-CF30qkon.js";import"./use-status-sounds-DzIbcTbB.js";import"./empty-state-CKmzL0iR.js";import"./use-mcp-tools-BaQM5Bz7.js";import"./types-DUULP3Cg.js";import"./use-capability--pStQfW2.js";import"./tools-list-D-u8vbQL.js";import"./switch-BofmoE_g.js";import"./use-debounced-autosave-Chq2pCXJ.js";import"./index-BeJ1yeue.js";import"./sidebar-BxApc71_.js";import"./sheet-DMsXF2a5.js";import"./search-input-CmJ7IuJz.js";import"./github-repo-picker-C928_gR2.js";import"./use-navigate-to-agent-yzOIB4ca.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-BfSDmFK4.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-sU8FyquD.js";import"./automation-runs-C8J9he9y.js";import"./table-Cbxpe5u6.js";import"./use-members-CJvmy-r3.js";import"./use-org-auth-client-DQwimkN2.js";import"./use-automations-eYq1QdPO.js";import"./use-file-configs--8K7Ji7z.js";import"./monaco-editor-B_E6MYgL.js";import"./select-model-Bb4qdZ4V.js";import"./automation-list-row-BMTjAch1.js";import"./use-copy-CLk0PZni.js";import"./content-blocks-o63cs2vh.js";function bt(k){const e=G.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=J("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function dr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=S.useState(a),[m,C]=S.useState(null),[N,E]=S.useState(!1),$=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],j=$.length,H=o=>s("slug",o),W=async(o,w)=>{const q=v(r.name);E(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:q,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:R(P,"posts",F)}),g+=1)}const z={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",z)}),c(z),I.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),I.error(g instanceof Error?g.message:"Rename failed")}finally{E(!1)}},Y=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){H(o);return}C({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:Y,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:X,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(V,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!m,onOpenChange:o=>{o||N||(y(a),C(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&W(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Q,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{dr as CategoryEditor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ue,l as
|
|
1
|
+
import{c as ue,l as Ge,by as Xe,j as U,cp as Ze,H as Le,m as Ne,D as se,K as ge,t as ne,C as le,L as de,b as qe,u as Fe,e as Ye,r as m,v as Je,a as et,I as tt,aC as nt}from"./index-BIvxcsMT.js";import{A as je,S as st,u as ot,d as at,e as rt,f as it,b as ct,w as lt}from"./hooks-C98PDXkO.js";import{u as dt}from"./use-mcp-client-DbN0o_29.js";import{a as ut,S as pt}from"./constants-C8_Swa4x.js";import{a as ft}from"./use-virtual-mcp-st0OLLtk.js";import{u as ht,b as me}from"./use-ai-providers-CGMLoVgI.js";import{u as mt}from"./use-decopilot-events-C4jxMeza.js";import{q as gt,n as yt}from"./tab-id-CLpu897Q.js";import{f as St}from"./use-organization-settings-B87409No.js";const xt={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.6-luna"]},vt={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.6-terra"]},It={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.6-sol"]},Ct={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},kt={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},bt={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function Ue(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function Mt(t){return Ue(t).includes("deepresearch")}const Tt=["sonar","searchpreview","online"];function Qe(t){const e=Ue(t);return e.includes("deepresearch")?!1:Tt.some(n=>e.includes(n))}function Ke(t){return t.asyncResearch!==!0&&Qe(t.modelId)}function Ve(t){return t.asyncResearch===!0||Mt(t.modelId)||Qe(t.modelId)}function ie(t,e,n,s){for(const o of n){const a=t.find(r=>r.modelId===o);if(a)return{keyId:e,modelId:a.modelId,title:a.title}}for(const o of n){const a=t.find(r=>r.modelId.includes(o));if(a)return{keyId:e,modelId:a.modelId,title:a.title}}if(s){const o=t.find(s);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}return null}function wt(t,e){const n={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const s of t){const o=e[s.id]??[],a=s.providerId;n.chat.fast||(n.chat.fast=ie(o,s.id,xt[a]??[])),n.chat.smart||(n.chat.smart=ie(o,s.id,vt[a]??[])),n.chat.thinking||(n.chat.thinking=ie(o,s.id,It[a]??[])),n.image||(n.image=ie(o,s.id,Ct[a]??[],r=>r.capabilities?.includes("image")===!0)),n.webSearch||(n.webSearch=ie(o,s.id,kt[a]??[],Ke)),n.deepResearch||(n.deepResearch=ie(o,s.id,bt[a]??[],Ve))}return n}const Et=Xe("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function hn(t){const e=ue.c(10),{variant:n,size:s}=t;let o;e[0]!==s||e[1]!==n?(o=Ge(Et({variant:n,size:s})),e[0]=s,e[1]=n,e[2]=o):o=e[2];let a,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=U.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=U.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=a,e[4]=r):(a=e[3],r=e[4]);let l;e[5]!==o?(l=U.jsxs("svg",{"aria-hidden":"true",className:o,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a,r]}),e[5]=o,e[6]=l):l=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=U.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=g):g=e[7];let y;return e[8]!==l?(y=U.jsxs("div",{role:"status",children:[l,g]}),e[8]=l,e[9]=y):y=e[9],y}function At(t,e=[]){return t==="stop"?e.filter(o=>o.type==="text"&&o.text).map(o=>o.text).join(`
|
|
2
2
|
`).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(s=>s.type==="tool-user_ask"&&s.state==="input-available"||s.state==="approval-requested")?"requires_action":"completed":"failed"}const Me={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"decopilot-desktop":{harness:"decopilot",sandbox:"user-desktop"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function Rt(t,e){if(!t)return null;const n=e?Ze(e):null;if(t==="decopilot"&&n===null)return"decopilot";for(const[s,o]of Object.entries(Me))if(o.harness===t&&o.sandbox===n)return s;return null}function $t(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function Pt(t){const e=ue.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=n):n=e[0];const s=Le(n);let o;if(e[1]!==s?.params.appSlug||e[2]!==s?.params.collectionName||e[3]!==s?.params.itemId||e[4]!==t){o=[],t&&o.push(`### Selected Agent
|
|
3
3
|
- ID: ${t}`);let a;e[6]!==s?.params.appSlug||e[7]!==s?.params.collectionName||e[8]!==s?.params.itemId?(a=[],s?.params.appSlug&&a.push(`- Connection ID: ${s?.params.appSlug}`),s?.params.collectionName&&a.push(`- Collection: ${s?.params.collectionName}`),s?.params.itemId&&a.push(`- Item ID: ${s?.params.itemId}`),e[6]=s?.params.appSlug,e[7]=s?.params.collectionName,e[8]=s?.params.itemId,e[9]=a):a=e[9],a.length>0&&o.push(`### Current Resource
|
|
4
4
|
The user is viewing the following resource:
|
|
@@ -7,7 +7,7 @@ ${a.join(`
|
|
|
7
7
|
|
|
8
8
|
Help the user understand and work with this resource.`),e[1]=s?.params.appSlug,e[2]=s?.params.collectionName,e[3]=s?.params.itemId,e[4]=t,e[5]=o}else o=e[5];return o.join(`
|
|
9
9
|
|
|
10
|
-
`)}function _t(){const t=ue.c(5),e=Ne(),{org:n}=se();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const o=Le(s);let a;return t[1]!==o?.params||t[2]!==n||t[3]!==e?(a=r=>{const g=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!g||!g[1])return;const y=g[1],I=o?.params.appSlug;if(!I)return;e.invalidateQueries({queryKey:ge.collection(n.slug,I,y)});const T=y.toLowerCase().replace(/_/g," ");ne.success(`${T} updated`)},t[1]=o?.params,t[2]=n,t[3]=e,t[4]=a):a=t[4],a}function Dt(){const t=ue.c(4),{org:e,project:n}=se(),s=`${e.id}/${n.id}`;let o;t[0]!==s?(o=de.taskLastViewed(s),t[0]=s,t[1]=o):o=t[1];const[,a]=le(o,Ot);let r;return t[2]!==a?(r={markTaskRead:g=>{a(y=>({...y,[g]:new Date().toISOString()}))}},t[2]=a,t[3]=r):r=t[3],r}function Ot(t){return t??{}}function We(){const t=qe(),{org:e}=se(),n=Fe({strict:!1}),s=Ye({strict:!1}),o=n.virtualmcpid??
|
|
10
|
+
`)}function _t(){const t=ue.c(5),e=Ne(),{org:n}=se();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const o=Le(s);let a;return t[1]!==o?.params||t[2]!==n||t[3]!==e?(a=r=>{const g=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!g||!g[1])return;const y=g[1],I=o?.params.appSlug;if(!I)return;e.invalidateQueries({queryKey:ge.collection(n.slug,I,y)});const T=y.toLowerCase().replace(/_/g," ");ne.success(`${T} updated`)},t[1]=o?.params,t[2]=n,t[3]=e,t[4]=a):a=t[4],a}function Dt(){const t=ue.c(4),{org:e,project:n}=se(),s=`${e.id}/${n.id}`;let o;t[0]!==s?(o=de.taskLastViewed(s),t[0]=s,t[1]=o):o=t[1];const[,a]=le(o,Ot);let r;return t[2]!==a?(r={markTaskRead:g=>{a(y=>({...y,[g]:new Date().toISOString()}))}},t[2]=a,t[3]=r):r=t[3],r}function Ot(t){return t??{}}function We(){const t=qe(),{org:e}=se(),n=Fe({strict:!1}),s=Ye({strict:!1}),o=n.virtualmcpid??ut(e.id).id,a=(g,y)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:g},search:I=>{const T={},q=y?.virtualMcpId??I.virtualmcpid;q&&(T.virtualmcpid=q);const p=I.main;return p&&typeof p=="string"&&!gt(p)&&(T.main=p),I.chat&&(T.chat=I.chat),y?.autosend&&(T.autosend=je),T}})},r=m.useRef(crypto.randomUUID()),l=s.taskId??r.current;return{virtualMcpId:o,taskId:l,navigateToTask:a}}function Lt(t,e){const{mimeType:n,data:s}=t;if(n.startsWith("text/"))try{const o=new TextDecoder().decode(Uint8Array.from(atob(s),a=>a.charCodeAt(0)));return[{type:"text",text:`${e}
|
|
11
11
|
${o}`}]}catch(o){console.error("Failed to decode text file:",o)}return[{type:"file",url:`data:${n};base64,${s}`,filename:e,mediaType:n}]}function Pe(t,e){const n=[];for(const s of t)"text"in s&&s.text?n.push({type:"text",text:`[${e}]
|
|
12
12
|
${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&n.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)});return n}function Nt(t,e){const n=(t.files??[]).filter(r=>r.content?.trim()),s=t.omittedPaths??[];if(n.length===0&&s.length===0)return[];const o=n.map(r=>`<skill-file path="${r.relPath}">
|
|
13
13
|
${r.content.trim()}
|
|
@@ -19,10 +19,10 @@ Other files in \`${t.sandboxPath}/\`: ${s.join(", ")}`:"";return[{type:"text",te
|
|
|
19
19
|
${o}${a}`}]}function qt(t,e){const n=[];for(const s of t){if(s.role!=="user"||!s.content)continue;const o=Array.isArray(s.content)?s.content:[s.content];for(const a of o)switch(a.type){case"text":{const r=a.text?.trim();if(!r)continue;n.push({type:"text",text:`[${e}]
|
|
20
20
|
${r}`});break}case"image":case"audio":{if(!a.data||!a.mimeType)continue;n.push({type:"file",url:`data:${a.mimeType};base64,${a.data}`,mediaType:a.mimeType});break}case"resource":{const r=a.resource;if(!r||!r.mimeType)continue;r&&("text"in r&&r.text?n.push({type:"text",text:`[${e}]
|
|
21
21
|
${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&n.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)}));break}}}return n}function Be(t){if(!t)return[];const e=[];let n="";const s=o=>{if(o){if(o.type==="text"&&"text"in o&&typeof o.text=="string")n+=o.text;else if(o.type==="mention"&&o.attrs){const a=o.attrs.char??"/",r=`${a}${o.attrs.name}`;if(n+=r,a==="@"){const l=o.attrs.metadata;l&&!Array.isArray(l)&&"agentId"in l?e.push({type:"text",text:`[DELEGATE TO AGENT: ${l.title??o.attrs.name} (agent_id: ${l.agentId})]
|
|
22
|
-
Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(l)&&e.push(...Pe(l,r))}else if(o.attrs.kind==="skill"){const l=o.attrs.metadata;l&&!Array.isArray(l)&&Array.isArray(l.files)&&e.push(...Nt(l,r))}else{const l=o.attrs.metadata||o.attrs.prompts||[];Array.isArray(l)&&l.length>0&&"role"in l[0]?e.push(...qt(l,r)):Array.isArray(l)&&e.push(...Pe(l,r))}}else if(o.type==="file"&&o.attrs){const a=o.attrs,r=`[file:://${encodeURIComponent(a.name)}]`;n+=r,e.push(...Lt(a,r))}if("content"in o&&Array.isArray(o.content))for(const a of o.content)s(a)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function
|
|
23
|
-
`);if(!v){he(i);return}new TextEncoder().encode(v).length>Yt||fe(O=>Object.keys(O).length>=Jt&&!(i in O)?O:{...O,[i]:v})},he=i=>{fe(h=>{const{[i]:D,...v}=h;return v})},[oe,ke]=le(de.chatLastAgentOption(e),i=>i&&i in Me?i:null),J=sn(),be=J?.isThreadLocked&&J.lockedHarness!=null?Rt(J.lockedHarness,J.lockedSandbox):null,$e=oe,ae=J?.isThreadLocked?be:$e,ve=ae?Me[ae]:null,c=ve?.harness??null,d=ve?.sandbox??null,[w,A]=m.useState(void 0),f=m.useRef(w);f.current=w;const P={selectedModel:
|
|
22
|
+
Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(l)&&e.push(...Pe(l,r))}else if(o.attrs.kind==="skill"){const l=o.attrs.metadata;l&&!Array.isArray(l)&&Array.isArray(l.files)&&e.push(...Nt(l,r))}else{const l=o.attrs.metadata||o.attrs.prompts||[];Array.isArray(l)&&l.length>0&&"role"in l[0]?e.push(...qt(l,r)):Array.isArray(l)&&e.push(...Pe(l,r))}}else if(o.type==="file"&&o.attrs){const a=o.attrs,r=`[file:://${encodeURIComponent(a.name)}]`;n+=r,e.push(...Lt(a,r))}if("content"in o&&Array.isArray(o.content))for(const a of o.content)s(a)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function mn(t){const e=Be(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function gn(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Ft(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function yn(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function jt(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function Ut(t,e){return t.filter(n=>n.messageId!==e)}const _e=new Map,we=new Set;function Qt(t){we.add(t)}function Kt(t){return we.has(t)}function Vt(t){we.delete(t)}function ye(t){let e=_e.get(t);return e||(e=new st([]),_e.set(t,e)),e}function He(t,e){ye(t).update(n=>jt(n,e))}function Te(t,e){ye(t).update(n=>Ut(n,e))}function Wt(t,e){ye(t).set(e)}const Ie=new Map;function Bt(t,e){Ie.set(`${t}:${e.id}`,e)}function Ht(t,e){const n=`${t}:${e}`,s=Ie.get(n);return Ie.delete(n),s}function De(t,e){Ie.delete(`${t}:${e}`)}async function X(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const s=await n.json();Wt(e,s.items??[])}catch{}}function Sn(t){const e=ue.c(2);let n;e[0]!==t?(n=ye(t),e[0]=t,e[1]=n):n=e[1];const s=n;return m.useSyncExternalStore(s.subscribe,s.get,s.get)}function zt(){const{org:t}=se();return{enqueue:He,refresh:e=>X(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;Te(e,n);try{const o=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(s)}`,{method:"POST",credentials:"include"});if(!o.ok&&o.status!==404)throw new Error(`Cancel failed: ${o.status}`);return!0}catch(o){return ne.error(o instanceof Error?o.message:"Failed to cancel"),!1}finally{await X(t.slug,e)}}}}const Oe=new Set,ee=new Set;function ce(t){return m.useSyncExternalStore(t.subscribe,t.get,t.get)}function Gt(t){return t.kind==="loading"?"ready":t.kind}function te(t,e,n,s){if(!t)return null;const o=e.find(r=>r.id===t.keyId);if(!o)return null;const a=n.find(r=>r.modelId===t.modelId);return a?{...a,keyId:t.keyId}:{modelId:t.modelId,title:s??t.modelId,keyId:t.keyId,providerId:o.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function Xt(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function Zt(t,e,n,s){if(!n||s.length===0)return null;const o=e.find(g=>g.id===n);if(!o)return null;const a=wt([o],{[n]:s}),r=t==="fast"?a.chat.fast:t==="thinking"?a.chat.thinking:a.chat.smart;if(!r)return null;const l=s.find(g=>g.modelId===r.modelId);return l?{...l,keyId:n}:null}const Yt=1e4,Jt=10,Ee=m.createContext(null),Ae=m.createContext(null),Re=m.createContext(null),ze=m.createContext(null);function en({children:t}){const{locator:e}=se(),{virtualMcpId:n}=We(),[s,o]=le(de.chatSelectedImageModel(e),null),[a,r]=le(de.chatSelectedWebSearchModel(e),null),[l,g]=le(de.chatSelectedDeepResearchModel(e),null),[y,I]=m.useState(null),[T,q]=m.useState("default"),p=St(),[R,Q]=le(de.chatSimpleModeTier(e),null),_=Xt(R),C=ht(),k=p.tiers[_],$=y&&C.some(i=>i.id===y)?y:k?.keyId??C[0]?.id??null,{models:S,isLoading:K}=me($??void 0),{models:H}=me(k?.keyId),{models:Z}=me(p.tiers.image?.keyId),{models:M}=me(p.tiers.web_search?.keyId),{models:V}=me(p.tiers.deep_research?.keyId),z=te(k,C,H,k?.title)??Zt(_,C,$,S),W=K,B=S.filter(i=>i.capabilities?.includes("image")),F=te(s,C,B),u=te(p.tiers.image,C,Z,p.tiers.image?.title)??F??B[0]??null,E=S.filter(Ke),L=te(a,C,E),Y=E.find(i=>i.modelId==="perplexity/sonar")??E[0]??null,j=te(p.tiers.web_search,C,M,p.tiers.web_search?.title)??L??Y,N=S.filter(Ve),b=te(l,C,N),x=N.find(i=>i.modelId==="perplexity/deep-research")??N.find(i=>i.asyncResearch===!0)??N[0]??null,G=te(p.tiers.deep_research,C,V,p.tiers.deep_research?.title)??b??x,Se=ft(n)??{id:n,title:"",description:null,icon:null},[Ce,fe]=m.useState({}),xe=(i,h)=>{const D=[];for(const O of h.content??[])O.type==="text"&&O.text?.trim()&&D.push(O.text.trim());const v=D.join(`
|
|
23
|
+
`);if(!v){he(i);return}new TextEncoder().encode(v).length>Yt||fe(O=>Object.keys(O).length>=Jt&&!(i in O)?O:{...O,[i]:v})},he=i=>{fe(h=>{const{[i]:D,...v}=h;return v})},[oe,ke]=le(de.chatLastAgentOption(e),i=>i&&i in Me?i:null),J=sn(),be=J?.isThreadLocked&&J.lockedHarness!=null?Rt(J.lockedHarness,J.lockedSandbox):null,$e=oe,ae=J?.isThreadLocked?be:$e,ve=ae?Me[ae]:null,c=ve?.harness??null,d=ve?.sandbox??null,[w,A]=m.useState(void 0),f=m.useRef(w);f.current=w;const P={selectedModel:z,setModel:()=>{},credentialId:$,setCredentialId:I,allModelsConnections:C,isModelsLoading:W,selectedVirtualMcp:Se,imageModel:u,setImageModel:i=>{o(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},webSearchModel:j,setWebSearchModel:i=>{r(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},deepResearchModel:G,setDeepResearchModel:i=>{g(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},chatMode:T,setChatMode:q,appContexts:Ce,setAppContext:xe,clearAppContext:he,tiptapDoc:w,setTiptapDoc:A,tiptapDocRef:f,resetInteraction:()=>{},simpleModeTier:_,setSimpleModeTier:i=>Q(i),pendingAgentOption:ae,setPendingAgentOption:ke,pendingHarnessId:c,pendingSandboxProviderKind:d};return U.jsx(Re.Provider,{value:P,children:t})}function xn(t){const e=ue.c(41),{virtualMcpId:n,task:s,children:o}=t,{locator:a}=se(),{data:r}=et.useSession(),l=r?.user??null,{taskId:g,virtualMcpId:y,navigateToTask:I}=We(),[T]=tt(),{markTaskRead:q}=Dt(),p=ct(),R=g,Q=y,_=Pt(Q);let C;e[0]!==q||e[1]!==I?(C=(b,x)=>{q(b),I(b,{virtualMcpId:x?.virtualMcpId,autosend:x?.autosend})},e[0]=q,e[1]=I,e[2]=C):C=e[2];const k=C,$=R&&s?.id===R?s:null,S=$?.harness_id??null,K=$?.sandbox_provider_kind??null,H=$?.branch??null,Z=S!=null,M=H;let V;e[3]!==M||e[4]!==k||e[5]!==p||e[6]!==n?(V=()=>{const b=crypto.randomUUID();return p.create({id:b,virtual_mcp_id:n,...M?{branch:M}:{}}).then(()=>k(b)).catch(()=>{k(b)}),b},e[3]=M,e[4]=k,e[5]=p,e[6]=n,e[7]=V):V=e[7];const z=V;let W;e[8]!==M||e[9]!==a||e[10]!==k||e[11]!==p||e[12]!==n?(W=b=>{const x=crypto.randomUUID(),G=b.virtualMcpId??n,pe=G===n?M:null;lt(sessionStorage,a,x,b.message),p.create({id:x,virtual_mcp_id:G,...pe?{branch:pe}:{}}).then(()=>k(x,{virtualMcpId:b.virtualMcpId,autosend:!0})).catch(()=>{k(x,{virtualMcpId:b.virtualMcpId,autosend:!0})})},e[8]=M,e[9]=a,e[10]=k,e[11]=p,e[12]=n,e[13]=W):W=e[13];const B=W;let F;e[14]!==R||e[15]!==p?(F=b=>{R&&p.setBranch(R,b)},e[14]=R,e[15]=p,e[16]=F):F=e[16];let u;e[17]!==$||e[18]!==z||e[19]!==B||e[20]!==M||e[21]!==R||e[22]!==Q||e[23]!==Z||e[24]!==H||e[25]!==S||e[26]!==K||e[27]!==k||e[28]!==F?(u={virtualMcpId:Q,taskId:R,openTask:k,createTask:z,createTaskWithMessage:B,activeTask:$,isThreadLocked:Z,lockedHarness:S,lockedSandbox:K,lockedBranch:H,currentBranch:M,setCurrentTaskBranch:F},e[17]=$,e[18]=z,e[19]=B,e[20]=M,e[21]=R,e[22]=Q,e[23]=Z,e[24]=H,e[25]=S,e[26]=K,e[27]=k,e[28]=F,e[29]=u):u=e[29];const E=u;let L;e[30]!==_||e[31]!==T||e[32]!==I||e[33]!==l?(L={user:l,contextPrompt:_,preferences:T,rawNavigateToTask:I},e[30]=_,e[31]=T,e[32]=I,e[33]=l,e[34]=L):L=e[34];const Y=L;let j;e[35]!==o||e[36]!==Y?(j=U.jsx(en,{children:U.jsx(ze.Provider,{value:Y,children:o})}),e[35]=o,e[36]=Y,e[37]=j):j=e[37];let N;return e[38]!==j||e[39]!==E?(N=U.jsx(Ae.Provider,{value:E,children:j}),e[38]=j,e[39]=E,e[40]=N):N=e[40],N}function vn({taskId:t,children:e}){const{virtualMcpId:n,activeTask:s,currentBranch:o}=tn();t&&!Oe.has(t)&&(Oe.add(t),Je("chat_opened",{thread_id:t}));const{imageModel:a,webSearchModel:r,deepResearchModel:l,chatMode:g,setChatMode:y,appContexts:I,setTiptapDoc:T,simpleModeTier:q,pendingSandboxProviderKind:p,pendingHarnessId:R}=nn(),Q=m.useContext(ze);if(!Q)throw new Error("ActiveTaskProvider must be used within ChatContextProvider");const{user:_,contextPrompt:C,preferences:k,rawNavigateToTask:$}=Q,{org:S,locator:K}=se(),H=zt(),[Z,M]=m.useState(null),V=_t(),z=Ne(),W=ot(),B=qe(),F=dt({connectionId:pt,orgId:S.id,orgSlug:S.slug}),u=at(S.slug,t,{client:F});m.use(u.ready);const E=ce(u.messages),L=ce(u.status),Y=ce(u.finishReason),j=ce(u.runStatusStage),N=ce(u.hasMoreOlder),b=ce(u.isFetchingOlder),x=m.useRef({onToolCall:V,queryClient:z,rawNavigateToTask:$,taskId:t,manager:W,navigate:B,orgId:S.id,orgSlug:S.slug});x.current={onToolCall:V,queryClient:z,rawNavigateToTask:$,taskId:t,manager:W,navigate:B,orgId:S.id,orgSlug:S.slug},mt({orgSlug:S.slug,taskId:t,onTaskStatus:c=>{const d=x.current,w=c.data.message_id;if(c.data.status==="in_progress"&&w){Te(d.taskId,w);const A=Ht(d.taskId,w);A&&u.applyLocalMessage(A),X(d.orgSlug,d.taskId)}Kt(d.taskId)&&(async()=>(await X(d.orgSlug,d.taskId),await u.reconcileFromServer()&&ye(d.taskId).get().length===0&&Vt(d.taskId)))()}}),m.useEffect(()=>{const c={onData:f=>{if(f.type==="data-thread-title"){const P=f.data;if(!P?.title)return;const i=x.current;if(!i.taskId)return;i.manager.patchThread({id:i.taskId,title:P.title,updated_at:new Date().toISOString()});return}if(f.type==="data-deck-updated"){const P=f.data;if(!P?.path)return;const i=P.path,h=x.current;h.queryClient.invalidateQueries({queryKey:ge.orgFsStat(h.orgId,"home",i)}),h.queryClient.invalidateQueries({queryKey:ge.orgFsRecent(h.orgId)}),h.navigate({to:".",search:D=>({...D,main:yt(i)}),replace:!0});return}},onFinish:(f,P,i)=>{const h=x.current;h.taskId&&X(h.orgSlug,h.taskId),h.taskId&&h.manager.patchThread({id:h.taskId,status:At(i,f.parts),updated_at:new Date().toISOString()});const D=f.parts?.some(O=>{const re=O;return(re.type==="tool-share_with_user"||re.type==="tool-bash"||re.type==="tool-write")&&re.state==="output-available"});if(h.taskId&&D){const O=ge.threadOutputs(h.taskId);for(const re of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{h.queryClient.invalidateQueries({queryKey:O})},re)}h.queryClient.invalidateQueries({queryKey:ge.homeNextActions(h.orgSlug)});const v=f.metadata?.thread_id;v&&v!==h.taskId&&h.rawNavigateToTask(v)},onError:f=>{M(f),console.error("[chat] Error",f)},onToolCall:f=>x.current.onToolCall(f)};u.observer=c,X(x.current.orgSlug,x.current.taskId);const d=f=>f==="submitted"||f==="streaming";let w=d(u.status.get().kind);const A=u.status.subscribe(()=>{const f=d(u.status.get().kind);if(f===w)return;w=f;const P=x.current;X(P.orgSlug,P.taskId)});return()=>{u.observer===c&&(u.observer=null),A()}},[u]);const G=L.kind==="submitted"||L.kind==="streaming",pe=E.length===0,Se=E.at(-1),Ce=!G&&Se?.role==="assistant"&&Se.parts.some(c=>"state"in c&&c.state==="approval-requested"),fe=s,xe=(fe?.status==="in_progress"||fe?.status==="expired")&&L.kind==="ready"&&E.length>0;async function he(c){const d=t,w=n,A=Object.entries(I),f=A.length>0?A.map(([D,v])=>`### App Context: ${D}
|
|
24
24
|
${v}`).join(`
|
|
25
25
|
|
|
26
26
|
`):"",P=[C,f].filter(Boolean).join(`
|
|
27
27
|
|
|
28
|
-
`);let i=g;i==="gen-image"&&!a&&(i="default"),i==="web-search"&&!r&&(i="default"),i==="deep-research"&&!l&&(i="default"),(i==="web-search"||i==="deep-research")&&y("default");const h={tier:q,mode:i,toolApprovalLevel:k.toolApprovalLevel??nt(),system:P||void 0,agent:{id:w},thread_id:d,...$t({thread:s?{harness_id:s.harness_id??null,sandbox_provider_kind:s.sandbox_provider_kind??null,branch:s.branch??null}:null,globals:{harnessId:R??void 0,sandboxProviderKind:p??void 0,branch:o}})};try{if(
|
|
28
|
+
`);let i=g;i==="gen-image"&&!a&&(i="default"),i==="web-search"&&!r&&(i="default"),i==="deep-research"&&!l&&(i="default"),(i==="web-search"||i==="deep-research")&&y("default");const h={tier:q,mode:i,toolApprovalLevel:k.toolApprovalLevel??nt(),system:P||void 0,agent:{id:w},thread_id:d,...$t({thread:s?{harness_id:s.harness_id??null,sandbox_provider_kind:s.sandbox_provider_kind??null,branch:s.branch??null}:null,globals:{harnessId:R??void 0,sandboxProviderKind:p??void 0,branch:o}})};try{if(G||xe){let D=!0;try{Bt(d,c),await u.enqueue(c,h),He(d,{workflowId:`thread-run:${d}:${c.id}`,messageId:c.id,text:Ft(c.parts),hasAttachments:c.parts.some(v=>v.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Qt(d)}catch(v){D=!1,De(d,c.id),Te(d,c.id),M(v instanceof Error?v:new Error(String(v))),ne.error(v instanceof Error?v.message:"Failed to queue message")}return X(S.slug,d),D}return await u.submit({kind:"message",message:c},h),!0}finally{ee.delete(d)}}async function oe(c){const d=c.parts??Be(c.tiptapDoc);if(d.length===0||ee.has(t))return;ee.add(t),M(null),T(void 0);const w={tiptapDoc:c.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:_?.image??void 0,name:_?.name??"you"}},A={id:crypto.randomUUID(),role:"user",parts:d,metadata:w};await he(A)}async function ke(c,d){if(ee.has(t))return ne.info("Still sending your previous message — try again in a moment"),!1;if(ee.add(t),!await H.cancel(t,c))return ee.delete(t),ne.error("Couldn't remove the original message"),!1;De(t,c),u.removeLocalMessage(c);const A={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:d}],metadata:{created_at:new Date().toISOString(),user:{avatar:_?.image??void 0,name:_?.name??"you"}}};try{return await he(A)}catch(f){return ne.error(f instanceof Error?f.message:"Failed to send edited message"),!1}}const J=async()=>{u.stop();try{const c=await fetch(`/api/${S.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(c.status===404)return;if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.message??`Cancel failed: ${c.status}`)}}catch(c){const d=c instanceof Error?c.message:"Failed to cancel";ne.error(d),console.error("[chat] cancelRun",c)}},be=c=>c&&typeof c=="object"&&"type"in c?oe({tiptapDoc:c}):oe(c),ae=Fe({strict:!1}).autosend===je;m.useEffect(()=>{if(!ae||E.length>0)return;const c=rt(sessionStorage,K,t);c&&oe(c.message).then(()=>{it(sessionStorage,K,t)})},[ae,E.length,K,t,oe]);const ve={messages:E,status:Gt(L),sendMessage:be,editQueuedMessage:ke,stop:()=>{J()},submit:(c,d)=>u.submit(c,d),removeLocalMessage:c=>u.removeLocalMessage(c),isSendInFlight:()=>ee.has(t),error:Z,clearError:()=>M(null),finishReason:Y,runStatusStage:j,clearFinishReason:()=>u.finishReason.set(null),isStreaming:G,isChatEmpty:pe,isWaitingForApprovals:Ce??!1,isRunInProgress:xe,hasMoreOlder:N,isFetchingOlder:b,fetchOlderMessages:u.fetchOlderMessages.bind(u)};return U.jsx(Ee.Provider,{value:ve,children:e})}function In(){const t=m.useContext(Ee);if(!t)throw new Error("useChatStream must be used within ActiveTaskProvider");return t}function Cn(){return m.useContext(Ee)}function tn(){const t=m.useContext(Ae);if(!t)throw new Error("useChatTask must be used within ChatContextProvider");return t}function nn(){const t=m.useContext(Re);if(!t)throw new Error("useChatPrefs must be used within ChatContextProvider");return t}function kn(){return m.useContext(Re)}function sn(){return m.useContext(Ae)}export{vn as A,en as C,hn as S,tn as a,nn as b,sn as c,Be as d,We as e,Sn as f,zt as g,De as h,Rt as i,Cn as j,xn as k,gn as l,kn as m,Ke as n,Ve as o,wt as p,yn as s,mn as t,In as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as n,l as d,j as c,bA as l,bB as b}from"./index-BIvxcsMT.js";import{i as m}from"./Check-DhEV1E4F.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,a as c,r as m,j as o}from"./index-
|
|
1
|
+
import{c as a,a as c,r as m,j as o}from"./index-BIvxcsMT.js";import{A as u}from"./auth-split-layout-X0hXvUdh.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as O,j as t,B as F,i as Y,o as Ge,s as te,E as Pe,r as $,D as re,p as Qe,u as Ye,T as K,t as Xe,l as je,e as le,aW as ke}from"./index-BIvxcsMT.js";import{E as Ee}from"./empty-state-CKmzL0iR.js";import{u as Ze,a as Ae}from"./use-collections-DaNfbX0Q.js";import{u as ae}from"./use-mcp-client-DbN0o_29.js";import{F as se,a as et,b as ce,d as de}from"./form-DY5CJF6A.js";import{I as me}from"./input-C-5bkxwu.js";import{T as ie}from"./textarea-BJ7uXt99.js";import{a as tt,b as st,V as ue,O as nt,M as ot}from"./index-BnU8c8Ro.js";import{an as it,C as rt,ac as lt,ao as at,a0 as ct,ap as dt,L as be}from"./agent-icon-CuxkxUe-.js";import{g as mt,M as ut,a as Ne}from"./types-DUULP3Cg.js";import{A as xt,a as pt,b as ft}from"./alert-BU-LVOFa.js";import{d as ve,S as Se,a as ye,b as we,c as ne}from"./select-XC9B8kYb.js";import{c as ht,T as Ce,a as Ie,b as $e}from"./tooltip-BGL3A5jy.js";import{i as gt}from"./AlertCircle-hfr9WJXe.js";import{s as jt}from"./Stars02-CFivD_f8.js";import{a as bt}from"./Copy01-Cm6DymEJ.js";import{i as Nt}from"./Play-Dh4_54hC.js";import{a as Oe,b as Re,B as J,c as G,d as Q,e as _e}from"./breadcrumb-UZDdQrwI.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-D-u8vbQL.js";import{a as De,u as Me}from"./use-connection-rw8Y5wYH.js";import{a as wt}from"./use-mcp-tools-BaQM5Bz7.js";import{c as Ct}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-DWcR_mMd.js";import{j as It,m as $t}from"./chat-context-BEYxfvRE.js";import{b as Tt}from"./shell-layout-CX1dOlGj.js";import{M as Pt}from"./monaco-editor-B_E6MYgL.js";import{n as kt}from"./XCircle-C94QFqN0.js";import"./constants-C8_Swa4x.js";import"./auth-By4coGKl.js";import"./label-CuPUA6lI.js";import"./index-BeJ1yeue.js";import"./sidebar-BxApc71_.js";import"./LayoutLeft-C8PdEJOQ.js";import"./use-mobile-CdswWdV_.js";import"./sheet-DMsXF2a5.js";import"./X-BWG-JTku.js";import"./ZoomOut-DltoXGbL.js";import"./Key01-D8bQG_zp.js";import"./extract-connection-data-DXmsDXzN.js";import"./use-registry-connections-DPvd05bN.js";import"./use-organization-settings-B87409No.js";import"./studio-tools-DGpKprde.js";import"./Plus-DX9uB6jT.js";import"./index-3pMCJF1F.js";import"./index-D2iM60An.js";import"./index-Du424YAy.js";import"./popover-BnhIWYgB.js";import"./use-virtual-mcp-st0OLLtk.js";import"./Check-DhEV1E4F.js";import"./SearchMd-DWSBWjan.js";import"./Users03-DHP7OUDR.js";import"./use-create-virtual-mcp-B_ygxy0B.js";import"./use-navigate-to-agent-yzOIB4ca.js";import"./Tool01-DGnLcysQ.js";import"./SwitchHorizontal01-sG-IqCt6.js";import"./Settings02-CZ9vMUyw.js";import"./ArrowUpRight-DBXurizV.js";import"./ZapSquare-DBjTUciD.js";import"./CheckCircle-CbuPUNoj.js";import"./ChevronDown-BJvvkmIr.js";import"./ChevronRight-BP1EbKKr.js";import"./ChevronUp-CVqQKtsY.js";import"./Circle-BnMDtDeu.js";import"./Loading02-DejqZGnO.js";import"./DotsVertical-BU3qKzJo.js";import"./Globe01-CxIEuzOP.js";import"./Eye-CtocRVwR.js";import"./FilterLines-XaejSF3d.js";import"./Star01-7qhyucrX.js";import"./Globe04-DZ-Pm9xo.js";import"./HardDrive-C2sIA93N.js";import"./LinkExternal01-D58rAWvm.js";import"./List-vf0HKUEp.js";import"./Monitor01-CodDwsVO.js";import"./Sun-CHp4Y1Dq.js";import"./Palette-CgTelSEQ.js";import"./SearchLg-D0ZqoPSb.js";import"./Shield01-DvUXE0jO.js";import"./Stars01-DN1mvd59.js";import"./Trash01-CAEn55T5.js";import"./Upload01-DKn5tYXN.js";import"./User01-IYcmkjnc.js";import"./Users01-0WxprMle.js";import"./XClose-CQikaAXa.js";import"./Zap-DeHaXJHA.js";import"./mcp-oauth-BFb5Mr2N.js";import"./badge-EC_FS1hJ.js";import"./hooks-C98PDXkO.js";import"./decopilot-sse-pool-tveLasMO.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CGMLoVgI.js";import"./use-decopilot-events-C4jxMeza.js";import"./tab-id-CLpu897Q.js";import"./avatar-BeEkEhV9.js";import"./dialog-1PlbGnxl.js";import"./alert-dialog-BLM89Cw2.js";import"./required-auth-layout-B14liizk.js";import"./use-org-sso-DRbO1SYZ.js";import"./index-CXhPz6Na.js";function Et(s){const e=O.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:c,undoLabel:d}=s,n=c===void 0?"Save":c,u=d===void 0?"Undo":d;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(it,{size:14}),e[0]=x):x=e[0];let m;e[1]!==i||e[2]!==o||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":u,children:[x,u]}),e[1]=i,e[2]=o,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==i?(p=i?t.jsx(Y,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==n||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":n,children:[p,n]}),e[7]=i,e[8]=r,e[9]=n,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function At(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Ot(s){const e=O.c(13),{form:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let l;e[1]!==r.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:r.control,name:"title",render:Dt}),t.jsx(se,{control:r.control,name:"description",render:_t})]})]}),e[1]=r.control,e[2]=l):l=e[2];let i,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),c=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=c):(i=e[3],c=e[4]);let d;e[5]!==r.control?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,c,t.jsx(se,{control:r.control,name:"body",render:Rt})]}),e[5]=r.control,e[6]=d):d=e[6];let n;e[7]!==l||e[8]!==d?(n=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,d]}),e[7]=l,e[8]=d,e[9]=n):n=e[9];let u;return e[10]!==r||e[11]!==n?(u=t.jsx(et,{...r,children:n}),e[10]=r,e[11]=n,e[12]=u):u=e[12],u}function Rt(s){const{field:e}=s;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(ie,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function _t(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(de,{children:t.jsx(me,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(de,{children:t.jsx(me,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const e=O.c(36),{providerId:r,promptId:o}=s,{org:l}=re(),i=r||null;let c;e[0]!==l.id||e[1]!==l.slug||e[2]!==i?(c={connectionId:i,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=i,e[3]=c):c=e[3];const d=ae(c),n=Ze(r,"PROMPT",o,d),u=Ae(r,"PROMPT",d),x=u.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:oe(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==n?(g=()=>{n&&f.reset({title:n.title,description:n.description??null,body:oe(n)})},e[8]=f,e[9]=n,e[10]=g):g=e[10];const S=g;let C;e[11]!==u.update||e[12]!==f||e[13]!==o?(C=f.handleSubmit(async N=>{const E=await u.update.mutateAsync({id:o,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:E.title,description:E.description??null,body:oe(E)})}),e[11]=u.update,e[12]=f,e[13]=o,e[14]=C):C=e[14];const R=C;if(!n){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let I;e[16]!==n.title?(I=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[16]=n.title,e[17]=I):I=e[17];let k;e[18]!==n.description?(k=n.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:n.description})]}):null,e[18]=n.description,e[19]=k):k=e[19];let T;e[20]!==I||e[21]!==k?(T=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[20]=I,e[21]=k,e[22]=T):T=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let y;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(y=t.jsx(tt,{children:t.jsx(Et,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=y):y=e[29];let w;e[30]!==f?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:f})}),e[30]=f,e[31]=w):w=e[31];let P;return e[32]!==y||e[33]!==w||e[34]!==T?(P=t.jsxs(ue,{children:[T,y,w]}),e[32]=y,e[33]=w,e[34]=T,e[35]=P):P=e[35],P}function zt(s){const e=O.c(4),{itemId:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=At(),e[0]=o):o=e[0];const l=o;if(!l){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==r?(i=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:l,promptId:r})})}),e[2]=r,e[3]=i):i=e[3],i}const Lt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=O.c(11),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:c}=s;let d;e[0]!==o?(d={connectionId:o},e[0]=o,e[1]=d):d=e[1];const n=St(d);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(nt,{onAuthenticate:()=>c(),buttonText:"Go back to authenticate"}):t.jsx(ot,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=c,e[4]=m):m=e[4],m}const u=`${o}:${r}`;let x;return e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==u||e[9]!==r?(x=t.jsx(Bt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},u),e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=r,e[10]=x):x=e[10],x}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const{replayId:l}=Ye({strict:!1}),i=(()=>{if(!l)return null;const a=`replay-${l}`,h=sessionStorage.getItem(a);if(!h)return null;sessionStorage.removeItem(a);try{return JSON.parse(h)}catch{return null}})(),c=(()=>{if(!i)return null;const a={};for(const[h,v]of Object.entries(i))v!==null&&typeof v=="object"?a[h]=JSON.stringify(v,null,2):a[h]=v;return a})(),[d,n]=$.useState(c??{}),[u,x]=$.useState(i?JSON.stringify(i,null,2):"{}"),[m,p]=$.useState(null),[f,g]=$.useState(null),[S,C]=$.useState(null),[R,I]=$.useState(null),[k,T]=$.useState(!1),[b,y]=$.useState(null),{org:w}=re(),P=De(e),N=It(),E=$t(),{setChatOpen:U}=Tt(),z=`${e}:${s}`,_=ae({connectionId:e,orgId:w.id,orgSlug:w.slug}),L=wt({client:_}),j=L.data?.tools?.find(a=>a.name===s),A=mt(j?._meta),V=a=>{if(!N)return;const h=Ct(a.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,X]=$.useState("json"),[ze,Le]=$.useState(!1);A&&!ze&&(X("ui"),Le(!0));const xe=j?.inputSchema?.properties,pe=xe?Object.keys(xe):[],q=pe.length>0,H={};if(q&&j?.inputSchema?.properties)for(const a of pe)H[a]=j.inputSchema.required?.includes(a)?"":void 0;const Z=a=>Object.prototype.hasOwnProperty.call(d,a),Ue=async()=>{T(!0),I(null),p(null),g(null),C(null),y(null);const a=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=q?{...H,...d}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();q&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const ge=Number(h[M]);Number.isNaN(ge)||(h[M]=ge)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),We=Math.round(He-a);p(W),g(v),C(h);const Ke=JSON.stringify(W),he=new TextEncoder().encode(Ke).length;y({duration:`${We}ms`,bytes:`${he} bytes`,tokens:`~${Math.ceil(he/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);I(v||"Unknown error occurred");const W=performance.now();y({duration:`${Math.round(W-a)}ms`})}finally{T(!1)}},ee=(a,h)=>{n(v=>({...v,[a]:h}))},Be=()=>{p(null),g(null),C(null),I(null),y(null)},Fe=j?.name??Lt(s),Ve=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(Q,{}),P&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt(P)},search:{tab:"tools"},children:P.title})})}),t.jsx(Q,{})]}),t.jsx(J,{children:t.jsx(_e,{children:Fe})})]})}),fe=r.length>1&&t.jsxs(ve,{value:e,onValueChange:o,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:r.map(a=>t.jsx(ne,{value:a.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}),a.title]})},a.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([a,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[a,j.inputSchema?.required?.includes(a)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(ie,{className:"font-mono text-xs",value:Z(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:Z(a)?String(d[a]??""):"",onValueChange:v=>ee(a,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(me,{value:Z(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a}...`})]},a)):j?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(ie,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:a=>x(a.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(lt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(jt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),A&&t.jsx(ht,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(dt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"h-4 w-4"}),t.jsx(pt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ft,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:A&&D==="ui"&&_?t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(ut,{resourceURI:A,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:V,onUpdateModelContext:a=>E?.setAppContext(z,a),onTeardown:()=>E?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Pt,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(bt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(ue,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:P?.icon||null,name:P?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(Y,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:fe})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),r.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),fe]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Ft(s){const e=O.c(10),{itemId:r,siblings:o,onBack:l}=s,[i,c]=$.useState(o[0]?.id??"");let d;e[0]!==i||e[1]!==o?(d=o.find(p=>p.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=d):d=e[2];const n=d;if(!De(n||void 0)||!n){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==r?(m=t.jsx($.Suspense,{fallback:x,children:t.jsx(Ut,{toolName:r,connectionId:n,siblings:o,onSelectInstance:c,onBack:l})}),e[5]=n,e[6]=l,e[7]=o,e[8]=r,e[9]=m):m=e[9],m}function Vt(s){const e=O.c(21),{icon:r,illustration:o,title:l,description:i,buttonProps:c,buttonComponent:d,className:n,children:u}=s;let x;e[0]!==n?(x=je("flex flex-col items-center justify-center py-16 text-center",n),e[0]=n,e[1]=x):x=e[1];let m;e[2]!==r||e[3]!==o?(m=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==d||e[13]!==c?(S=(d??c)&&t.jsx("div",{className:"mt-4",children:d??(c&&t.jsx(F,{size:"sm",className:je(c?.className),...c}))}),e[12]=d,e[13]=c,e[14]=S):S=e[14];let C;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(C=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=C):C=e[20],C}const Jt={prompt:zt};function qt(){const s=O.c(9),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const c=Me(i);let d;s[3]!==e.history?(d=()=>{e.history.back()},s[3]=e.history,s[4]=d):d=s[4];const n=d,u=Ht;let x;return s[5]!==n||s[6]!==l||s[7]!==c?(x=t.jsx(Ft,{itemId:l,siblings:c,onBack:n,onUpdate:u}),s[5]=n,s[6]=l,s[7]=c,s[8]=x):x=s[8],x}async function Ht(s){return Promise.resolve()}function Wt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Kt(){const s=O.c(41),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:n}=re();let u;s[3]!==o.appSlug?(u={slug:o.appSlug},s[3]=o.appSlug,s[4]=u):u=s[4];const m=Me(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==n.id||s[6]!==n.slug||s[7]!==g?(S={connectionId:g,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=g,s[8]=S):S=s[8];const C=ae(S),R=Ae(f,l,C);let I;s[9]!==R||s[10]!==i?(I=async D=>{i&&await R.update.mutateAsync({id:i,data:D})},s[9]=R,s[10]=i,s[11]=I):I=s[11];const k=I;let T;s[12]!==l?(T=l?.toLowerCase(),s[12]=l,s[13]=T):T=s[13];const b=T,y=b&&Jt[b];let w;s[14]!==l?(w=Wt(l),s[14]=l,s[15]=w):w=s[15];const P=w;let N;s[16]!==n.slug?(N=t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=N):N=s[17];let E;s[18]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Q,{}),s[18]=E):E=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Q,{})]}),s[19]=l,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=U):U=s[23];let z;s[24]!==P?(z=t.jsx(J,{children:t.jsx(_e,{children:P})}),s[24]=P,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(Oe,{children:t.jsxs(Re,{children:[N,E,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(y){let D;return s[30]!==y||s[31]!==d||s[32]!==k||s[33]!==i?(D=t.jsx(y,{itemId:i,onBack:d,onUpdate:k}),s[30]=y,s[31]=d,s[32]=k,s[33]=i,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(kt,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let A;s[36]!==d?(A=t.jsx(Vt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:d,children:"Go back"}}),s[36]=d,s[37]=A):A=s[37];let V;return s[38]!==L||s[39]!==A?(V=t.jsx(ue,{breadcrumb:L,children:A}),s[38]=L,s[39]=A,s[40]=V):V=s[40],V}function Gt(){const s=O.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const r=le(e);if(decodeURIComponent(r.collectionName)==="tools"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(qt,{}),s[1]=c):c=s[1],c}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{}),s[2]=i):i=s[2],i}function Jn(){const s=O.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{Jn as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as B,j as s,l as M,B as V}from"./index-BIvxcsMT.js";import{c as z,b as _,D as $,a as E}from"./dropdown-menu-DgucD0Wn.js";import{i as L,n as O,b as R,c as A}from"./SwitchHorizontal01-sG-IqCt6.js";import{i as S}from"./Check-DhEV1E4F.js";import{i as F}from"./List-vf0HKUEp.js";import{a as I,b as K,c as P,T as W}from"./tooltip-BGL3A5jy.js";import{V as q}from"./view-mode-toggle-BekCb9Y2.js";import{B as G}from"./badge-EC_FS1hJ.js";function re(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(F,{})},{value:"cards",icon:s.jsx(A,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{re as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,l as b,j as a,i as w}from"./index-
|
|
1
|
+
import{c as v,l as b,j as a,i as w}from"./index-BIvxcsMT.js";import{i as C}from"./SearchMd-DWSBWjan.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as s,l as C}from"./index-
|
|
1
|
+
import{c as k,j as s,l as C}from"./index-BIvxcsMT.js";import{e as S,d as R,a as T,T as H,b as L,c as z}from"./table-Cbxpe5u6.js";import{i as D,n as E}from"./SwitchHorizontal01-sG-IqCt6.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:x,sortDirection:u,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==u?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&u&&(u==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=u,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==x){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==x?(o=(t,h)=>{const N=x===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=x,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=x,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:x,sortKey:u,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(x===void 0?!1:x){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==u?(d=s.jsx("div",{className:"flex-1",children:s.jsx(I,{columns:r,data:f,sortKey:u,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}export{B as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,l as u,j as m}from"./index-
|
|
1
|
+
import{c as f,l as u,j as m}from"./index-BIvxcsMT.js";import{B as g}from"./badge-EC_FS1hJ.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
|