decocms 4.211.12 → 4.211.13
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-iMFIwWNV.js → AlertCircle-BMPkNMGJ.js} +1 -1
- package/dist/client/assets/{AreaChart-GCRS_-AP.js → AreaChart-488R_nQ_.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CsWtY_gB.js → ArrowLeft-Bo0FpGQs.js} +1 -1
- package/dist/client/assets/{ArrowUp-DSxXxGdv.js → ArrowUp-Cmxc5KIG.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-erfF6BcP.js → ArrowUpRight-OVKS4c5s.js} +1 -1
- package/dist/client/assets/{Check-CABzt6--.js → Check-CeB_ZeLq.js} +1 -1
- package/dist/client/assets/{CheckCircle-N8333lb0.js → CheckCircle-C9SAYY-W.js} +1 -1
- package/dist/client/assets/{ChevronDown-DsDzbrOb.js → ChevronDown-CGwhMiqT.js} +1 -1
- package/dist/client/assets/{ChevronRight-DwahmHLA.js → ChevronRight-Cux_llMB.js} +1 -1
- package/dist/client/assets/{ChevronUp-DBUIuLI5.js → ChevronUp-3dsPU76D.js} +1 -1
- package/dist/client/assets/{Copy01-B995BWXi.js → Copy01-CXcHnxi0.js} +1 -1
- package/dist/client/assets/{CpuChip01-lt7Rkp-U.js → CpuChip01-CGpR8wkh.js} +1 -1
- package/dist/client/assets/{CreditCard01-GxtaywC9.js → CreditCard01-DSA6UjMO.js} +1 -1
- package/dist/client/assets/{DotsVertical-BRYCw47k.js → DotsVertical-9U5tOb04.js} +1 -1
- package/dist/client/assets/{Eye-Clu-LouG.js → Eye-DXWAJYKq.js} +1 -1
- package/dist/client/assets/{FilterLines-CNzwsg4F.js → FilterLines-DZrlB4Kh.js} +1 -1
- package/dist/client/assets/{Globe01-0reGbJcL.js → Globe01-Cm-V-gHj.js} +1 -1
- package/dist/client/assets/{Globe04-sue1ujzC.js → Globe04-m1tzMty0.js} +1 -1
- package/dist/client/assets/{HardDrive-CuFY6j2o.js → HardDrive-Dvps78YO.js} +1 -1
- package/dist/client/assets/{Key01-C8zGItpI.js → Key01-DY7yaq7L.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BowuBtX2.js → LayoutLeft-C0u89h3U.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B3QGOPZ8.js → LinkExternal01-CLr9HZg0.js} +1 -1
- package/dist/client/assets/{LogOut01-CwZ1Y9u4.js → LogOut01-BeE1lxGA.js} +1 -1
- package/dist/client/assets/{Monitor01-Bni1e5h7.js → Monitor01-RiuZmvGS.js} +1 -1
- package/dist/client/assets/{Palette-B6o-2LWT.js → Palette-C8S3zMtK.js} +1 -1
- package/dist/client/assets/{Play-BC8nRLNF.js → Play-B8V74CpU.js} +1 -1
- package/dist/client/assets/{Plus-BPZja4FC.js → Plus-CGrXNe_q.js} +1 -1
- package/dist/client/assets/{SearchLg-CGtAP5EH.js → SearchLg-DrUBeTI6.js} +1 -1
- package/dist/client/assets/{SearchMd-BVrWvjH3.js → SearchMd-DFwCvkV1.js} +1 -1
- package/dist/client/assets/{Settings02-C9fJkEJh.js → Settings02-DBlt8Mfk.js} +1 -1
- package/dist/client/assets/{Share07-DS8-754J.js → Share07-C1_p27Hs.js} +1 -1
- package/dist/client/assets/{Shield01-CrVGBhuR.js → Shield01-CZr-J1Qk.js} +1 -1
- package/dist/client/assets/{Star01-CwL23CRL.js → Star01-ClwU4gOx.js} +1 -1
- package/dist/client/assets/{Stars01-D94NieJP.js → Stars01-jLom0LSv.js} +1 -1
- package/dist/client/assets/{Stars02-B08-JGxx.js → Stars02-2eb3r8Gu.js} +1 -1
- package/dist/client/assets/{Sun-kp4es37w.js → Sun-m3RjKnDt.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-ChVU7SWq.js → SwitchHorizontal01-D0Mi7oaK.js} +1 -1
- package/dist/client/assets/{Tool01-DStbcY86.js → Tool01-DMQJZ6a0.js} +1 -1
- package/dist/client/assets/{Tool02-7YE_lsQ5.js → Tool02-CZZOjaKh.js} +1 -1
- package/dist/client/assets/{Trash01-DGt8nZn9.js → Trash01-BCoCDH0H.js} +1 -1
- package/dist/client/assets/{TrendUp01-C6JwA-Np.js → TrendUp01-CYPiI6vW.js} +1 -1
- package/dist/client/assets/{Upload01-DgSyem4d.js → Upload01-mvF19nky.js} +1 -1
- package/dist/client/assets/{User01-CPSa9S2T.js → User01-UnLfhP79.js} +1 -1
- package/dist/client/assets/{Users01-DUxHx9ib.js → Users01-BGTUZMIA.js} +1 -1
- package/dist/client/assets/{Users03-Dqls41gn.js → Users03-C0P658nm.js} +1 -1
- package/dist/client/assets/{X-CseWQ5OZ.js → X-CId2-nhW.js} +1 -1
- package/dist/client/assets/{XCircle-Cpx4dopB.js → XCircle-DOtlBDfF.js} +1 -1
- package/dist/client/assets/{XClose-3fY-ChCg.js → XClose-BoiJoxeV.js} +1 -1
- package/dist/client/assets/{Zap-B6D2E55F.js → Zap-C6ApHWIY.js} +1 -1
- package/dist/client/assets/{ZapSquare-kC-fhZGr.js → ZapSquare-GHgi4Hl7.js} +1 -1
- package/dist/client/assets/{access-gate-CA12_xun.js → access-gate-C95F2WkH.js} +1 -1
- package/dist/client/assets/{agent-icon-CWBP36-h.js → agent-icon-D_vHJRnE.js} +1 -1
- package/dist/client/assets/{agents-list-OMhP8qfw.js → agents-list-DkgLS7SC.js} +1 -1
- package/dist/client/assets/{ai-providers-D478OIo1.js → ai-providers-Bu525zoa.js} +1 -1
- package/dist/client/assets/{alert-DIuR7XaR.js → alert-DbDLUaFg.js} +1 -1
- package/dist/client/assets/{alert-dialog-Xn8LpVc8.js → alert-dialog-BgN-Tqd-.js} +1 -1
- package/dist/client/assets/{app-editor-yIDNZzzT.js → app-editor-BxnAP5XK.js} +1 -1
- package/dist/client/assets/{auth-ANCOmttW.js → auth-BcPAS4K5.js} +1 -1
- package/dist/client/assets/{auth-catchall-CPei7TNu.js → auth-catchall-beEoU58X.js} +1 -1
- package/dist/client/assets/{auth-entry-DR2aLV1R.js → auth-entry-Ba9Dx-Qf.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CkRUAeEO.js → auth-split-layout-BWtw05-K.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C-JqvyRh.js → authenticate-and-persist-oauth-COCTTCRF.js} +1 -1
- package/dist/client/assets/{automation-list-row-BcUdJrVC.js → automation-list-row-BYFAi_YA.js} +1 -1
- package/dist/client/assets/{automation-runs-BifnU8_i.js → automation-runs-DeLRBvkt.js} +1 -1
- package/dist/client/assets/{automations-B9um6d70.js → automations-BRAq3s1h.js} +1 -1
- package/dist/client/assets/{avatar-CPIgr7-p.js → avatar-CKAwkvrw.js} +1 -1
- package/dist/client/assets/{badge-BoP7NhL_.js → badge-CxlSzoE1.js} +1 -1
- package/dist/client/assets/{billing-BHFWSCxm.js → billing-B-o9jNmN.js} +1 -1
- package/dist/client/assets/{block-document-CPSclET4.js → block-document-B55t08Gk.js} +1 -1
- package/dist/client/assets/{brand-context-Lk6JoeGu.js → brand-context-BFbc6Rr3.js} +1 -1
- package/dist/client/assets/{buckets-BiDyk4mP.js → buckets-DPkGfuKn.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-0zirRi61.js → bulk-category-panel-DEeeidyr.js} +1 -1
- package/dist/client/assets/{capability-load-error-S-JNljGC.js → capability-load-error-BJPRtvi9.js} +1 -1
- package/dist/client/assets/{card-lxFop9oJ.js → card-GrGBYBXG.js} +1 -1
- package/dist/client/assets/{cards-S5FAmKUB.js → cards-DY2u3Spm.js} +1 -1
- package/dist/client/assets/{category-editor-Bv8ApHAC.js → category-editor-ZQJJznra.js} +1 -1
- package/dist/client/assets/{chat-context-CV2ibxPd.js → chat-context-cK_4I7Xc.js} +1 -1
- package/dist/client/assets/{checkbox-ZpkUR1gq.js → checkbox-DjytOswq.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BdE-we7c.js → cli-auth-success-BM-cW7fp.js} +1 -1
- package/dist/client/assets/{collection-detail-7LB4xM1G.js → collection-detail-agcgXjLA.js} +1 -1
- package/dist/client/assets/{collection-display-button-DTKyHVFX.js → collection-display-button-C1_cSZ46.js} +1 -1
- package/dist/client/assets/{collection-search-BzYqusXY.js → collection-search-Cwveue76.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BSS6Wd5g.js → collection-table-wrapper-rFP3w6Km.js} +1 -1
- package/dist/client/assets/{collection-tabs-Di0fmDNx.js → collection-tabs-DMyjVQaZ.js} +1 -1
- package/dist/client/assets/{command-Bemo-h0S.js → command-DktWLnIE.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-D1H67vwy.js → commerce-onboarding-m9N-S4Gz.js} +1 -1
- package/dist/client/assets/{connect-D8FiLV07.js → connect-D2N1y-Ip.js} +1 -1
- package/dist/client/assets/{connection-card-D-cmYmCq.js → connection-card-BoEQ2uqc.js} +1 -1
- package/dist/client/assets/{connection-detail-ckAlH1gW.js → connection-detail-CQcpDcrD.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DFqceUmS.js → connection-form-helpers-DB6bc0s9.js} +1 -1
- package/dist/client/assets/{connection-Bq8ZZ2Em.js → connection-xiSJ6-RD.js} +1 -1
- package/dist/client/assets/{connections-qMM5bDwN.js → connections-Dw0iE25b.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Cvk81TxT.js → decopilot-sse-pool-CYVKd86r.js} +1 -1
- package/dist/client/assets/{dialog-CF1cQ1rb.js → dialog-7h2q_S_D.js} +1 -1
- package/dist/client/assets/{domain-settings-BEadEJ2B.js → domain-settings-VApHKPI3.js} +1 -1
- package/dist/client/assets/{drawer-DfRIJaDr.js → drawer-WhUz4erM.js} +1 -1
- package/dist/client/assets/{dropdown-menu-AkajeJh4.js → dropdown-menu-D3TVm231.js} +1 -1
- package/dist/client/assets/{empty-state-D7Q_5Yzc.js → empty-state-tOcrn7Ci.js} +1 -1
- package/dist/client/assets/{extract-connection-data-sVdeut_9.js → extract-connection-data-BKY0ec6n.js} +1 -1
- package/dist/client/assets/{file-explorer-Dwz4AmxP.js → file-explorer-Dq0lQM5q.js} +1 -1
- package/dist/client/assets/{file-type-icon-BBtbE_NU.js → file-type-icon-CpiTVpKx.js} +1 -1
- package/dist/client/assets/{form-D6GqaWU9.js → form-FE1JRkSu.js} +1 -1
- package/dist/client/assets/{general-8nn2nvKH.js → general-g40hJC_5.js} +1 -1
- package/dist/client/assets/{github-repo-picker-yxnDF_Mi.js → github-repo-picker-BId4yHDh.js} +1 -1
- package/dist/client/assets/{hooks-CJA4VXgB.js → hooks-BTTh4oan.js} +4 -4
- package/dist/client/assets/{index-Al4HY1a3.js → index-BEPKcH_a.js} +1 -1
- package/dist/client/assets/{index-DC7whFuR.js → index-BEYzla8F.js} +5 -5
- package/dist/client/assets/{index-cF1kQ4rp.js → index-BYGXPjH8.js} +1 -1
- package/dist/client/assets/{index-vEFJuUdN.js → index-Bfy-Fe7V.js} +3 -3
- package/dist/client/assets/{index-C3vGEoWV.js → index-Bqv-pFdx.js} +1 -1
- package/dist/client/assets/{index-C2hrpyVC.js → index-C6ZFB-pr.js} +1 -1
- package/dist/client/assets/{index-BMSi953J.js → index-CGRQEzbN.js} +1 -1
- package/dist/client/assets/{index-EI3Ugq-F.js → index-D5KNWpFX.js} +1 -1
- package/dist/client/assets/{index-CjTnqBk_.js → index-GMtytQiz.js} +1 -1
- package/dist/client/assets/{index-kxBCs5fd.js → index-UyBix6gL.js} +1 -1
- package/dist/client/assets/{index-redirect-Bue7X2lf.js → index-redirect-ck6OyrmB.js} +1 -1
- package/dist/client/assets/{input-5e_3GJtI.js → input-BVD_WyXJ.js} +1 -1
- package/dist/client/assets/{integration-icon-Hw_CmlIO.js → integration-icon-BbWY9vfD.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BFxexQWA.js → invite-member-dialog-CV1AK1O7.js} +1 -1
- package/dist/client/assets/{label-DfGzQmB5.js → label-Dplc1_oE.js} +1 -1
- package/dist/client/assets/{layout-J1KutV1s.js → layout-D5YUqSjq.js} +1 -1
- package/dist/client/assets/{login-DFC8t92m.js → login-BhrXfYan.js} +1 -1
- package/dist/client/assets/{mcp-oauth-OIUxe3g2.js → mcp-oauth-Bi0vxp4Q.js} +1 -1
- package/dist/client/assets/{members-D04j8LGY.js → members-Ji9eO7Ec.js} +1 -1
- package/dist/client/assets/{monaco-editor-DXyVTFn_.js → monaco-editor-a45QrHzb.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DwkTMqaP.js → monitoring-stats-row-Clyov0L3.js} +1 -1
- package/dist/client/assets/{multi-select-CMm9r82c.js → multi-select-CjPTNrcr.js} +1 -1
- package/dist/client/assets/{oauth-callback-DvccsXft.js → oauth-callback-DiDAIf8E.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-JuzGzHF3.js → oauth-callback-ai-provider-IqzbVWPo.js} +1 -1
- package/dist/client/assets/{onboarding-CITeeAzg.js → onboarding-BJiKjmun.js} +1 -1
- package/dist/client/assets/{org-layout-r55BUxSU.js → org-layout-PfQPZIP6.js} +1 -1
- package/dist/client/assets/{organization-choice-DdAEAan-.js → organization-choice-gP3A2ZAR.js} +1 -1
- package/dist/client/assets/{orgs-DbDUgk30.js → orgs-Cr1CFs6W.js} +1 -1
- package/dist/client/assets/{page-seo-form-DArIhi5S.js → page-seo-form-DudbV1zC.js} +1 -1
- package/dist/client/assets/{popover-DlPz4To4.js → popover-DigaZ5Sb.js} +1 -1
- package/dist/client/assets/{post-editor-DHPRvNNO.js → post-editor-BWzSgRMR.js} +1 -1
- package/dist/client/assets/{primitives-BydS_vZK.js → primitives-J7wgcQJq.js} +1 -1
- package/dist/client/assets/{profile-DI6Ilt8P.js → profile-BDbSzozU.js} +1 -1
- package/dist/client/assets/{project-app-view-C6HXVzqk.js → project-app-view-DAXzq1Ls.js} +1 -1
- package/dist/client/assets/record-editor-ppkuJl7e.js +1 -0
- package/dist/client/assets/{redirect-editor-HVBMW8WM.js → redirect-editor-pHmu3bPB.js} +1 -1
- package/dist/client/assets/registry-Cd5hmvAQ.js +2 -0
- package/dist/client/assets/{registry-layout-BkpbsKCB.js → registry-layout-CpdnxiQT.js} +1 -1
- package/dist/client/assets/{reports-CXIrzC-d.js → reports-DRHBtKft.js} +1 -1
- package/dist/client/assets/{require-capability-fB062a2_.js → require-capability-ATUore6a.js} +1 -1
- package/dist/client/assets/{required-auth-layout-_hvJxMv_.js → required-auth-layout-BFPFAQoy.js} +1 -1
- package/dist/client/assets/{reset-password-BEaSK5jb.js → reset-password-Dqj508VS.js} +1 -1
- package/dist/client/assets/{roles-D12c7S0D.js → roles-CxUv-U9E.js} +1 -1
- package/dist/client/assets/{search-input-Bao8w6Sm.js → search-input--fbtpx3Q.js} +1 -1
- package/dist/client/assets/{secrets-DxgxqJVW.js → secrets-Bks5AT9o.js} +1 -1
- package/dist/client/assets/{sections-editor-DNFZvceN.js → sections-editor-D3-0_ytR.js} +1 -1
- package/dist/client/assets/{select-model-CR0-6PXS.js → select-model-BpUI37HY.js} +1 -1
- package/dist/client/assets/{select-Dez5FrF9.js → select-wwJ8EUoY.js} +1 -1
- package/dist/client/assets/{self-tool-result-CEBp4imh.js → self-tool-result-Cch-sPi1.js} +1 -1
- package/dist/client/assets/{seo-editor-DpWrQCog.js → seo-editor-B-BXD83I.js} +1 -1
- package/dist/client/assets/{settings-layout-DM6YanNm.js → settings-layout-ByUBxOIX.js} +1 -1
- package/dist/client/assets/{settings-section-DPTzp_P_.js → settings-section-CfhHwu3l.js} +1 -1
- package/dist/client/assets/{shell-controls-CAI3Vo2K.js → shell-controls-CCkUJzaH.js} +1 -1
- package/dist/client/assets/{shell-layout-Udqd-jvd.js → shell-layout-C7FmlawD.js} +1 -1
- package/dist/client/assets/{sidebar-BXJraWph.js → sidebar-CusUIOZL.js} +1 -1
- package/dist/client/assets/{skeleton-pl0N1Ino.js → skeleton-Dd2jseki.js} +1 -1
- package/dist/client/assets/{spinner-CppnwMRY.js → spinner-Cq2vfE1B.js} +1 -1
- package/dist/client/assets/{sso-BKgAJn6H.js → sso-B3-RbBmC.js} +1 -1
- package/dist/client/assets/{store-BKFBI3A2.js → store-pPcfwgDj.js} +1 -1
- package/dist/client/assets/store-registry-BvvyMLoR.js +2 -0
- package/dist/client/assets/{studio-tools-CBUmjJWM.js → studio-tools-BBDHxwPb.js} +1 -1
- package/dist/client/assets/{switch-By_6CkwD.js → switch-CAjDqeuV.js} +1 -1
- package/dist/client/assets/{synced-repos-DMX6VroD.js → synced-repos-B2r15ecn.js} +1 -1
- package/dist/client/assets/{tab-id-DdzeNQQR.js → tab-id-BtKEoC5y.js} +1 -1
- package/dist/client/assets/{table-7K7oqOU1.js → table-DwuSaCi4.js} +1 -1
- package/dist/client/assets/{tabs-mQsLl4zR.js → tabs-CIxl9qVO.js} +1 -1
- package/dist/client/assets/{textarea-B-bmHFzf.js → textarea-BkOjJMTl.js} +1 -1
- package/dist/client/assets/{toggle-group-De9TzUcu.js → toggle-group-znNdMK--.js} +1 -1
- package/dist/client/assets/{toolbar-BgPfvPzL.js → toolbar-CdII6jdL.js} +1 -1
- package/dist/client/assets/{tooltip-BUztXQ1W.js → tooltip-F9SMeJ-j.js} +1 -1
- package/dist/client/assets/{track-BdasaloK.js → track-CQoHeM9p.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B0Xkp5BB.js → use-ai-providers-NYX7QSgc.js} +1 -1
- package/dist/client/assets/{use-automations-CfmioFHT.js → use-automations-DoX-Tmqm.js} +1 -1
- package/dist/client/assets/{use-autosave-jnj9qMUO.js → use-autosave-BpJYCCvJ.js} +1 -1
- package/dist/client/assets/{use-capability-D7eAS5np.js → use-capability-DssZIcHp.js} +1 -1
- package/dist/client/assets/{use-clock-tick-iKIdVntg.js → use-clock-tick-CFTIWs0c.js} +1 -1
- package/dist/client/assets/{use-connection-C57YbTcG.js → use-connection-niAftPf5.js} +1 -1
- package/dist/client/assets/{use-copy-B7m5krwW.js → use-copy-C8wJsCEn.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B0-zziyl.js → use-create-virtual-mcp-BeJ2z9vu.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave--SMcEphJ.js → use-debounced-autosave-CGiNF_NH.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CEYSL9GY.js → use-debounced-value-BolYSN9R.js} +1 -1
- package/dist/client/assets/{use-deco-credits-9r63SN2F.js → use-deco-credits-De3PrmGo.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-9EcaK7qN.js → use-decopilot-events-UAWY9DUq.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Bjv1M5P5.js → use-delete-connection-BcCyYYBn.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CQBUmrw8.js → use-deployment-admin-Dkp6hxxc.js} +1 -1
- package/dist/client/assets/{use-file-configs-BWwvZiOJ.js → use-file-configs-Cq0JL4Et.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DKJxpa0X.js → use-infinite-scroll-BMPCHIFs.js} +1 -1
- package/dist/client/assets/{use-join-requests-BjdU0X7c.js → use-join-requests-BGkaC20q.js} +1 -1
- package/dist/client/assets/{use-mcp-client-lJgGp2B_.js → use-mcp-client-CMZDCFwV.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CMs4Nd8q.js → use-mcp-tools-DcIN6xvI.js} +1 -1
- package/dist/client/assets/{use-members-BDcNIFeP.js → use-members-CNN6Y-Zt.js} +1 -1
- package/dist/client/assets/{use-mobile-WXO34F35.js → use-mobile-RWxooM53.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-_rWnI-Xt.js → use-navigate-to-agent-ChzmcYSy.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-CtUM2rs7.js → use-open-billing-url-XDJk2wdH.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CO9ez288.js → use-org-auth-client-hxCPh-jf.js} +1 -1
- package/dist/client/assets/{use-org-sso-BORI0Gqf.js → use-org-sso-FYR_uf1o.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DjooZXVB.js → use-organization-roles-H8GHPaLQ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CgP5KHWU.js → use-organization-settings-CmS9ohCu.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C45H6T-8.js → use-registry-connections-CvNGLAr0.js} +1 -1
- package/dist/client/assets/{use-secrets-QG_xgP3_.js → use-secrets-B-jc_6m7.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-C0W9rmU4.js → use-section-preview-base-B2DzWzr2.js} +1 -1
- package/dist/client/assets/{use-status-sounds-B8tGf8un.js → use-status-sounds-UrQRxkaM.js} +1 -1
- package/dist/client/assets/{use-tags-DyMD1IY8.js → use-tags-opYrp-Zi.js} +1 -1
- package/dist/client/assets/{use-view-mode-D_OPtVgy.js → use-view-mode-Dgp9VTk6.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DKb7Fyg4.js → use-virtual-mcp-CvLFbjo1.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DuCyL_is.js +1 -0
- package/dist/client/assets/{useRouterState-BHJ0jJB4.js → useRouterState-rS_ZBcbr.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-ByQ627dx.js +1 -0
- package/dist/client/assets/{users-Bhh884_S.js → users-BQPiAp2u.js} +1 -1
- package/dist/client/assets/{variant-calendar-fAA5D3m3.js → variant-calendar-DboldH8s.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DjIWnqV3.js → view-mode-toggle-DDofaiqJ.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +408 -408
- package/dist/server/server.js +288 -288
- package/package.json +1 -1
- package/dist/client/assets/record-editor-D47fnaIP.js +0 -1
- package/dist/client/assets/registry-CijDpud_.js +0 -2
- package/dist/client/assets/store-registry-R3Z16Gp0.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Hwy4ey-5.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CdsuGwEV.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ge,b as me,j as o,v as Ae,t as le,B as ne,F as De,o as Ie,a as Le,r as X,n as Te,K as de,e as Ee,p as V,G as Fe,m as ke}from"./index-vEFJuUdN.js";import{a as re,b as ye,D as ue,c as pe}from"./dropdown-menu-AkajeJh4.js";import{a as Ge}from"./Users03-Dqls41gn.js";import{G as we,b as Me,a as Pe}from"./github-repo-picker-yxnDF_Mi.js";import{a as Oe,b as ze,c as Be}from"./use-virtual-mcp-DKb7Fyg4.js";import{P as ce}from"./index-EI3Ugq-F.js";import{a as Ue}from"./DotsVertical-BRYCw47k.js";import{A as Re,C as fe,aW as $e}from"./agent-icon-CWBP36-h.js";import{a as He}from"./Settings02-C9fJkEJh.js";import{s as Ve}from"./Trash01-DGt8nZn9.js";import{p as Ke,f as he}from"./pt-BR-CLy76QW2.js";import{c as Se}from"./use-navigate-to-agent-_rWnI-Xt.js";import{e as qe,h as Qe}from"./use-organization-settings-CgP5KHWU.js";import{u as _e}from"./use-capability-D7eAS5np.js";import{C as Je}from"./card-lxFop9oJ.js";import{E as Ye}from"./empty-state-D7Q_5Yzc.js";import{u as We}from"./use-create-virtual-mcp-B0-zziyl.js";import{u as Xe}from"./use-connection-C57YbTcG.js";import{u as xe,S as Ze}from"./use-mcp-client-lJgGp2B_.js";import{p as et,a as je}from"./deco-site-production-url-BjY4ZYd-.js";import{g as tt,f as ot,b as st,G as it,p as nt}from"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import{e as rt,d as lt,a as at,b as ct,c as mt}from"./dialog-CF1cQ1rb.js";import{i as dt}from"./ArrowLeft-CsWtY_gB.js";import{C as ut}from"./collection-search-BzYqusXY.js";import{A as pt,a as gt,b as ft,c as ht,d as xt,e as jt,f as Ct,g as bt}from"./alert-dialog-Xn8LpVc8.js";import{S as Dt}from"./search-input-Bao8w6Sm.js";import{s as Ce}from"./Plus-BPZja4FC.js";import"./Check-CABzt6--.js";import"./ChevronRight-DwahmHLA.js";import"./use-debounced-value-CEYSL9GY.js";import"./authenticate-and-persist-oauth-C-JqvyRh.js";import"./mcp-oauth-OIUxe3g2.js";import"./auth-ANCOmttW.js";import"./LinkExternal01-B3QGOPZ8.js";import"./Share07-DS8-754J.js";import"./use-mcp-tools-CMs4Nd8q.js";import"./extract-connection-data-sVdeut_9.js";import"./metadata-dUsYcpuu.js";import"./sidebar-BXJraWph.js";import"./LayoutLeft-BowuBtX2.js";import"./use-mobile-WXO34F35.js";import"./X-CseWQ5OZ.js";import"./tooltip-BUztXQ1W.js";import"./AlertCircle-iMFIwWNV.js";import"./Tool01-DStbcY86.js";import"./ArrowUp-DSxXxGdv.js";import"./Tool02-7YE_lsQ5.js";import"./XCircle-Cpx4dopB.js";import"./ArrowUpRight-erfF6BcP.js";import"./TrendUp01-C6JwA-Np.js";import"./ZapSquare-kC-fhZGr.js";import"./CheckCircle-N8333lb0.js";import"./ChevronDown-DsDzbrOb.js";import"./ChevronUp-DBUIuLI5.js";import"./Stars02-B08-JGxx.js";import"./Copy01-B995BWXi.js";import"./CpuChip01-lt7Rkp-U.js";import"./CreditCard01-GxtaywC9.js";import"./Globe01-0reGbJcL.js";import"./Eye-Clu-LouG.js";import"./FilterLines-CNzwsg4F.js";import"./Star01-CwL23CRL.js";import"./Globe04-sue1ujzC.js";import"./SwitchHorizontal01-ChVU7SWq.js";import"./HardDrive-CuFY6j2o.js";import"./Key01-C8zGItpI.js";import"./LogOut01-CwZ1Y9u4.js";import"./Monitor01-Bni1e5h7.js";import"./Sun-kp4es37w.js";import"./Palette-B6o-2LWT.js";import"./Play-BC8nRLNF.js";import"./SearchLg-CGtAP5EH.js";import"./SearchMd-BVrWvjH3.js";import"./Shield01-CrVGBhuR.js";import"./Stars01-D94NieJP.js";import"./Upload01-DgSyem4d.js";import"./User01-CPSa9S2T.js";import"./Users01-DUxHx9ib.js";import"./XClose-3fY-ChCg.js";import"./Zap-B6D2E55F.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-CJA4VXgB.js";import"./decopilot-sse-pool-Cvk81TxT.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./studio-tools-CBUmjJWM.js";function be(t){const e=ge.c(28),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:r,isCreating:f,align:c,side:G,showBetaBadge:x}=t,M=c===void 0?"end":c,d=me();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Ge,{size:14}),e[0]=T):T=e[0];let m;e[1]!==d?(m=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=m):m=e[2];let D;e[3]!==f||e[4]!==i||e[5]!==m?(D=o.jsxs(re,{disabled:f,onClick:i,children:[T,m]}),e[3]=f,e[4]=i,e[5]=m,e[6]=D):D=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(we,{className:"size-3.5"}),e[7]=j):j=e[7];let y;e[8]!==d?(y=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=y):y=e[9];let a;e[10]!==x?(a=x&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=x,e[11]=a):a=e[11];let l;e[12]!==n||e[13]!==y||e[14]!==a?(l=o.jsxs(re,{onClick:n,children:[j,y,a]}),e[12]=n,e[13]=y,e[14]=a,e[15]=l):l=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=h):h=e[16];let C;e[17]!==d?(C=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=C):C=e[18];let w;e[19]!==r||e[20]!==C?(w=o.jsxs(re,{onClick:r,children:[h,C]}),e[19]=r,e[20]=C,e[21]=w):w=e[21];let u;return e[22]!==M||e[23]!==G||e[24]!==w||e[25]!==D||e[26]!==l?(u=o.jsxs(ye,{side:G,align:M,className:"w-48",children:[D,l,w]}),e[22]=M,e[23]=G,e[24]=w,e[25]=D,e[26]=l,e[27]=u):u=e[27],u}function yt(t){const e=ge.c(65),{project:i,lastUsedAt:n,onDeleteClick:r}=t,f=Se(),c=me(),[G]=Ae(),x=G.language==="pt-BR"?Ke:void 0,{mainAgentId:M}=qe(),d=Qe(),{granted:T}=_e("org:manage"),m=M===i.id;let D;e[0]!==m||e[1]!==i.id||e[2]!==i.title||e[3]!==d||e[4]!==c?(D=()=>{const I=m?null:i.id;d.mutate(I,{onSuccess:()=>le.success(m?c("home.projectCard.mainAgentUnset",{title:i.title}):c("home.projectCard.mainAgentSet",{title:i.title})),onError:()=>le.error(c("home.projectCard.mainAgentError"))})},e[0]=m,e[1]=i.id,e[2]=i.title,e[3]=d,e[4]=c,e[5]=D):D=e[5];const j=D;let y;e[6]!==f||e[7]!==i.id?(y=()=>f(i.id),e[6]=f,e[7]=i.id,e[8]=y):y=e[8];let a;e[9]!==i.title||e[10]!==y?(a=o.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[9]=i.title,e[10]=y,e[11]=a):a=e[11];let l;e[12]!==i.icon||e[13]!==i.title?(l=o.jsx(Re,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[12]=i.icon,e[13]=i.title,e[14]=l):l=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ue,{asChild:!0,children:o.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Ue,{size:20})})}),e[15]=h):h=e[15];let C;e[16]!==f||e[17]!==i.id?(C=()=>f(i.id,{search:{main:"settings"}}),e[16]=f,e[17]=i.id,e[18]=C):C=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(He,{size:16}),e[19]=w):w=e[19];let u;e[20]!==C?(u=o.jsxs(re,{onClick:C,children:[w,"Settings"]}),e[20]=C,e[21]=u):u=e[21];let O;e[22]!==T||e[23]!==m||e[24]!==c||e[25]!==j?(O=T&&o.jsxs(re,{onClick:I=>{I.stopPropagation(),j()},children:[o.jsx(fe,{size:16}),c(m?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[22]=T,e[23]=m,e[24]=c,e[25]=j,e[26]=O):O=e[26];let E;e[27]!==r?(E=r&&o.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ve,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(ye,{align:"end",children:[u,O,E]})]})}),e[29]=E,e[30]=u,e[31]=O,e[32]=z):z=e[32];let S;e[33]!==z||e[34]!==l?(S=o.jsxs("div",{className:"flex items-start justify-between",children:[l,z]}),e[33]=z,e[34]=l,e[35]=S):S=e[35];let v;e[36]!==i.title?(v=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[36]=i.title,e[37]=v):v=e[37];let N;e[38]!==m||e[39]!==c?(N=m&&o.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[o.jsx(fe,{size:12}),c("home.projectCard.mainAgentBadge")]}),e[38]=m,e[39]=c,e[40]=N):N=e[40];let P;e[41]!==v||e[42]!==N?(P=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,N]}),e[41]=v,e[42]=N,e[43]=P):P=e[43];const F=i.description||"No description";let s;e[44]!==F?(s=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:F}),e[44]=F,e[45]=s):s=e[45];let p;e[46]!==P||e[47]!==s?(p=o.jsxs("div",{className:"flex flex-col gap-1",children:[P,s]}),e[46]=P,e[47]=s,e[48]=p):p=e[48];let g;e[49]!==S||e[50]!==p?(g=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[S,p]}),e[49]=S,e[50]=p,e[51]=g):g=e[51];let b;e[52]!==n||e[53]!==x||e[54]!==i.updated_at||e[55]!==c?(b=n?c("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:x})}):c("home.projectCard.updated",{time:he(new Date(i.updated_at),{addSuffix:!0,locale:x})}),e[52]=n,e[53]=x,e[54]=i.updated_at,e[55]=c,e[56]=b):b=e[56];let _;e[57]!==b?(_=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:b})})}),e[57]=b,e[58]=_):_=e[58];let A;e[59]!==g||e[60]!==_?(A=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[g,_]}),e[59]=g,e[60]=_,e[61]=A):A=e[61];let k;return e[62]!==A||e[63]!==a?(k=o.jsxs(Je,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[a,A]}),e[62]=A,e[63]=a,e[64]=k):k=e[64],k}const wt="deco-sites";function St(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function _t(t,e){const i=e?St(e):null,n=i?.owner??wt,r=i?.repo??t;return{owner:n,name:r,url:`https://github.com/${n}/${r}`}}function vt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function ve(t,e,i){const n=await fetch(t,e),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error??`${i} (${n.status})`);return r}function Nt(t){return ve(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function At({open:t,onOpenChange:e,onBack:i}){const n=me(),{org:r}=De(),f=Se(),c=Ie(),{data:G}=Le.useSession(),[x,M]=X.useState(null),[d,T]=X.useState(null),[m,D]=X.useState(""),j=xe({connectionId:Ze,orgId:r.id,orgSlug:r.slug}),y=Xe({slug:"mcp-github"}),a=tt(y),l=Me({enabled:t&&a.length===0}),h=a.length===1?a[0]??null:d,C=a.length>1&&!h,w=xe({connectionId:h?.id??"",orgId:r.id,orgSlug:r.slug}),u=t&&a.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:E,error:z}=Te({queryKey:de.decoSites(G?.user?.email),queryFn:()=>Nt(r.slug),enabled:t&&!!G?.user?.email,staleTime:6e4,retry:!1}),S=O?.sites??[],v=s=>{s||(M(null),T(null),D("")),e(s)},N=S.filter(s=>s.name.toLowerCase().includes(m.toLowerCase())||(s.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),P=!x||N.some(s=>s.name===x),F=Ee({mutationFn:async s=>{if(!h)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));V("deco_site_import_started",{site_name:s});const{installations:p}=await ot(B=>j.callTool(B),h.id),g=S.find(B=>B.name===s);if(!g)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const b=_t(s,g.metadata),_=st(p,b.owner);if(!_)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:it}));let A=null,k=null,I=null;const J=async()=>{I&&await j.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:I}}).catch(()=>{}),k&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),A&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const B=await ve(`/api/${r.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:s})},n("common.importFromDecoDialog.failedToCreateConnection")),U=B.connId;if(!U)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=U;const{childConnectionId:$,reused:Y}=await nt({orgSlug:r.slug,sourceConnection:h,installationId:_.installationId,owner:b.owner,repo:b.name,githubCallTool:H=>w.callTool(H),selfCallTool:H=>j.callTool(H)});k=Y?null:$;const K=B.icon??null,Z=vt(s),W=s.toLowerCase(),q=et(je(g.domains)),Q=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s,description:"Imported from deco.cx",pinned:!1,icon:K??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:q,productionUrl:q,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:_.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:Z,pinnedViews:[{connectionId:U,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:U,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:U},{connection_id:$}]}}}),R=Q.structuredContent??Q;if(!R.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=R.item.id,{slug:Z,virtualMcpId:R.item.id,connId:U,item:R.item}}catch(B){throw await J(),B}},onSuccess:({slug:s,virtualMcpId:p,item:g})=>{V("deco_site_import_succeeded",{site_name:g.title,virtual_mcp_id:p,slug:s}),c.setQueryData(de.collectionItem(j,r.id,"","VIRTUAL_MCP",p),{item:g}),c.invalidateQueries({predicate:b=>{const _=b.queryKey;return _[1]===r.id&&_[3]==="collection"&&_[4]==="VIRTUAL_MCP"}}),c.invalidateQueries({queryKey:de.projects(r.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:s})),v(!1),localStorage.setItem(Fe.sidebarOpen(),JSON.stringify(!1)),f(p)},onError:s=>{V("deco_site_import_failed",{error:s instanceof Error?s.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(s instanceof Error?s.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(rt,{open:t,onOpenChange:v,children:o.jsxs(lt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(at,{className:"sr-only",children:o.jsx(ct,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&o.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(dt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ut,{value:m,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:s=>{s.key==="Escape"&&D("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ne,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),C&&!u&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:n("common.importFromDecoDialog.selectGithubConnection")})}),a.map(s=>o.jsxs("button",{type:"button",onClick:()=>T(s),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?o.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(we,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}),E&&!u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!E&&!u&&!C&&l.status!=="error"&&!z&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!E&&!u&&!C&&l.status!=="error"&&S.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[N.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:m})}),N.map(s=>{const p=je(s.domains),g=x===s.name;return o.jsxs("button",{type:"button",onClick:()=>M(s.name),className:ke("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:s.thumb_url?o.jsx("img",{src:s.thumb_url,alt:s.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.name}),p&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},s.name)})]})]}),o.jsxs(mt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ne,{variant:"outline",onClick:()=>v(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ne,{disabled:!x||!P||F.isPending||E||u||C||!h||l.status==="error",onClick:()=>x&&F.mutate(x),children:F.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ms(){const t=ge.c(77),e=me(),{org:i}=De(),n=Oe(),r=ze(),[f,c]=X.useState("");let G;t[0]===Symbol.for("react.memo_cache_sentinel")?(G={navigateOnCreate:!0},t[0]=G):G=t[0];const{createVirtualMCP:x,isCreating:M}=We(G),[d,T]=X.useState(null),[m,D]=X.useState(!1),[j,y]=X.useState(!1),{granted:a}=_e("agents:manage"),l=f.toLowerCase(),h=n.filter(L=>L.id!==i.id&&(L.title.toLowerCase().includes(l)||L.description?.toLowerCase().includes(l))),{data:C}=Be(h.map(It));let w;t[1]!==r||t[2]!==d||t[3]!==e?(w=async()=>{if(!d)return;const{id:L,title:Ne}=d;T(null);try{await r.delete.mutateAsync(L),V("agent_deleted",{agent_id:L,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:Ne}))}catch{}},t[1]=r,t[2]=d,t[3]=e,t[4]=w):w=t[4];const u=w,O=ce,E=ce,z=ce;let S;t[5]!==e?(S=e("routes.agentsList.title"),t[5]=e,t[6]=S):S=t[6];let v;t[7]!==S?(v=o.jsx(ce.Title,{children:S}),t[7]=S,t[8]=v):v=t[8];let N;t[9]!==e?(N=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=N):N=t[10];let P;t[11]===Symbol.for("react.memo_cache_sentinel")?(P=L=>{L.key==="Escape"&&(c(""),L.target.blur())},t[11]=P):P=t[11];let F;t[12]!==f||t[13]!==N?(F=o.jsx(Dt,{value:f,onChange:c,placeholder:N,className:"w-full md:w-[375px]",onKeyDown:P}),t[12]=f,t[13]=N,t[14]=F):F=t[14];let s;t[15]!==a||t[16]!==x||t[17]!==M||t[18]!==e?(s=a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:M,align:"end"})]}),t[15]=a,t[16]=x,t[17]=M,t[18]=e,t[19]=s):s=t[19];let p;t[20]!==F||t[21]!==s?(p=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[F,s]}),t[20]=F,t[21]=s,t[22]=p):p=t[22];let g;t[23]!==p||t[24]!==v?(g=o.jsxs("div",{className:"flex flex-col gap-6",children:[v,p]}),t[23]=p,t[24]=v,t[25]=g):g=t[25];const b=h.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{image:o.jsx($e,{size:48,className:"text-muted-foreground"}),title:e(f?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:f?e("routes.agentsList.noAgentsMatchSearch",{search:f}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!f&&a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:M,align:"center",showBetaBadge:!0})]})})}),_=h.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:h.map(L=>o.jsx(yt,{project:L,lastUsedAt:C?.get(L.id)?.last_used_at,onDeleteClick:a?()=>T({id:L.id,title:L.title}):void 0},L.id))})]});let A;t[26]!==g||t[27]!==b||t[28]!==_||t[29]!==z.Body?(A=o.jsxs(z.Body,{children:[g,b,_]}),t[26]=g,t[27]=b,t[28]=_,t[29]=z.Body,t[30]=A):A=t[30];let k;t[31]!==A||t[32]!==E.Content?(k=o.jsx(E.Content,{children:A}),t[31]=A,t[32]=E.Content,t[33]=k):k=t[33];let I;t[34]!==j?(I=o.jsx(Pe,{open:j,onOpenChange:y}),t[34]=j,t[35]=I):I=t[35];let J;t[36]!==m?(J=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=J):J=t[37];const B=!!d;let U;t[38]===Symbol.for("react.memo_cache_sentinel")?(U=L=>!L&&T(null),t[38]=U):U=t[38];let $;t[39]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=$):$=t[40];let Y;t[41]!==$?(Y=o.jsx(pt,{children:$}),t[41]=$,t[42]=Y):Y=t[42];let K;t[43]!==e?(K=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=K):K=t[44];const Z=d?.title;let W;t[45]!==Z?(W=o.jsx("span",{className:"font-medium text-foreground",children:Z}),t[45]=Z,t[46]=W):W=t[46];let q;t[47]!==K||t[48]!==W?(q=o.jsxs(gt,{children:[K," ",W,"."]}),t[47]=K,t[48]=W,t[49]=q):q=t[49];let Q;t[50]!==Y||t[51]!==q?(Q=o.jsxs(ft,{children:[Y,q]}),t[50]=Y,t[51]=q,t[52]=Q):Q=t[52];let R;t[53]!==e?(R=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=R):R=t[54];let H;t[55]!==R?(H=o.jsx(ht,{children:R}),t[55]=R,t[56]=H):H=t[56];let ee;t[57]!==e?(ee=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=ee):ee=t[58];let te;t[59]!==u||t[60]!==ee?(te=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ee}),t[59]=u,t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==H||t[63]!==te?(oe=o.jsxs(jt,{children:[H,te]}),t[62]=H,t[63]=te,t[64]=oe):oe=t[64];let se;t[65]!==Q||t[66]!==oe?(se=o.jsxs(Ct,{children:[Q,oe]}),t[65]=Q,t[66]=oe,t[67]=se):se=t[67];let ie;t[68]!==B||t[69]!==se?(ie=o.jsx(bt,{open:B,onOpenChange:U,children:se}),t[68]=B,t[69]=se,t[70]=ie):ie=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==J||t[75]!==ie?(ae=o.jsxs(O,{children:[k,I,J,ie]}),t[71]=O,t[72]=k,t[73]=I,t[74]=J,t[75]=ie,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ms as default};
|
|
1
|
+
import{c as ge,b as me,j as o,v as Ae,t as le,B as ne,F as De,o as Ie,a as Le,r as X,n as Te,K as de,e as Ee,p as V,G as Fe,m as ke}from"./index-Bfy-Fe7V.js";import{a as re,b as ye,D as ue,c as pe}from"./dropdown-menu-D3TVm231.js";import{a as Ge}from"./Users03-C0P658nm.js";import{G as we,b as Me,a as Pe}from"./github-repo-picker-BId4yHDh.js";import{a as Oe,b as ze,c as Be}from"./use-virtual-mcp-CvLFbjo1.js";import{P as ce}from"./index-D5KNWpFX.js";import{a as Ue}from"./DotsVertical-9U5tOb04.js";import{A as Re,C as fe,aW as $e}from"./agent-icon-D_vHJRnE.js";import{a as He}from"./Settings02-DBlt8Mfk.js";import{s as Ve}from"./Trash01-BCoCDH0H.js";import{p as Ke,f as he}from"./pt-BR-CLy76QW2.js";import{c as Se}from"./use-navigate-to-agent-ChzmcYSy.js";import{e as qe,h as Qe}from"./use-organization-settings-CmS9ohCu.js";import{u as _e}from"./use-capability-DssZIcHp.js";import{C as Je}from"./card-GrGBYBXG.js";import{E as Ye}from"./empty-state-tOcrn7Ci.js";import{u as We}from"./use-create-virtual-mcp-BeJ2z9vu.js";import{u as Xe}from"./use-connection-niAftPf5.js";import{u as xe,S as Ze}from"./use-mcp-client-CMZDCFwV.js";import{p as et,a as je}from"./deco-site-production-url-BjY4ZYd-.js";import{g as tt,f as ot,b as st,G as it,p as nt}from"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import{e as rt,d as lt,a as at,b as ct,c as mt}from"./dialog-7h2q_S_D.js";import{i as dt}from"./ArrowLeft-Bo0FpGQs.js";import{C as ut}from"./collection-search-Cwveue76.js";import{A as pt,a as gt,b as ft,c as ht,d as xt,e as jt,f as Ct,g as bt}from"./alert-dialog-BgN-Tqd-.js";import{S as Dt}from"./search-input--fbtpx3Q.js";import{s as Ce}from"./Plus-CGrXNe_q.js";import"./Check-CeB_ZeLq.js";import"./ChevronRight-Cux_llMB.js";import"./use-debounced-value-BolYSN9R.js";import"./authenticate-and-persist-oauth-COCTTCRF.js";import"./mcp-oauth-Bi0vxp4Q.js";import"./auth-BcPAS4K5.js";import"./LinkExternal01-CLr9HZg0.js";import"./Share07-C1_p27Hs.js";import"./use-mcp-tools-DcIN6xvI.js";import"./extract-connection-data-BKY0ec6n.js";import"./metadata-dUsYcpuu.js";import"./sidebar-CusUIOZL.js";import"./LayoutLeft-C0u89h3U.js";import"./use-mobile-RWxooM53.js";import"./X-CId2-nhW.js";import"./tooltip-F9SMeJ-j.js";import"./AlertCircle-BMPkNMGJ.js";import"./Tool01-DMQJZ6a0.js";import"./ArrowUp-Cmxc5KIG.js";import"./Tool02-CZZOjaKh.js";import"./XCircle-DOtlBDfF.js";import"./ArrowUpRight-OVKS4c5s.js";import"./TrendUp01-CYPiI6vW.js";import"./ZapSquare-GHgi4Hl7.js";import"./CheckCircle-C9SAYY-W.js";import"./ChevronDown-CGwhMiqT.js";import"./ChevronUp-3dsPU76D.js";import"./Stars02-2eb3r8Gu.js";import"./Copy01-CXcHnxi0.js";import"./CpuChip01-CGpR8wkh.js";import"./CreditCard01-DSA6UjMO.js";import"./Globe01-Cm-V-gHj.js";import"./Eye-DXWAJYKq.js";import"./FilterLines-DZrlB4Kh.js";import"./Star01-ClwU4gOx.js";import"./Globe04-m1tzMty0.js";import"./SwitchHorizontal01-D0Mi7oaK.js";import"./HardDrive-Dvps78YO.js";import"./Key01-DY7yaq7L.js";import"./LogOut01-BeE1lxGA.js";import"./Monitor01-RiuZmvGS.js";import"./Sun-m3RjKnDt.js";import"./Palette-C8S3zMtK.js";import"./Play-B8V74CpU.js";import"./SearchLg-DrUBeTI6.js";import"./SearchMd-DFwCvkV1.js";import"./Shield01-CZr-J1Qk.js";import"./Stars01-jLom0LSv.js";import"./Upload01-mvF19nky.js";import"./User01-UnLfhP79.js";import"./Users01-BGTUZMIA.js";import"./XClose-BoiJoxeV.js";import"./Zap-C6ApHWIY.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-BTTh4oan.js";import"./decopilot-sse-pool-CYVKd86r.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./studio-tools-BBDHxwPb.js";function be(t){const e=ge.c(28),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:r,isCreating:f,align:c,side:G,showBetaBadge:x}=t,M=c===void 0?"end":c,d=me();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Ge,{size:14}),e[0]=T):T=e[0];let m;e[1]!==d?(m=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=m):m=e[2];let D;e[3]!==f||e[4]!==i||e[5]!==m?(D=o.jsxs(re,{disabled:f,onClick:i,children:[T,m]}),e[3]=f,e[4]=i,e[5]=m,e[6]=D):D=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(we,{className:"size-3.5"}),e[7]=j):j=e[7];let y;e[8]!==d?(y=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=y):y=e[9];let a;e[10]!==x?(a=x&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=x,e[11]=a):a=e[11];let l;e[12]!==n||e[13]!==y||e[14]!==a?(l=o.jsxs(re,{onClick:n,children:[j,y,a]}),e[12]=n,e[13]=y,e[14]=a,e[15]=l):l=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=h):h=e[16];let C;e[17]!==d?(C=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=C):C=e[18];let w;e[19]!==r||e[20]!==C?(w=o.jsxs(re,{onClick:r,children:[h,C]}),e[19]=r,e[20]=C,e[21]=w):w=e[21];let u;return e[22]!==M||e[23]!==G||e[24]!==w||e[25]!==D||e[26]!==l?(u=o.jsxs(ye,{side:G,align:M,className:"w-48",children:[D,l,w]}),e[22]=M,e[23]=G,e[24]=w,e[25]=D,e[26]=l,e[27]=u):u=e[27],u}function yt(t){const e=ge.c(65),{project:i,lastUsedAt:n,onDeleteClick:r}=t,f=Se(),c=me(),[G]=Ae(),x=G.language==="pt-BR"?Ke:void 0,{mainAgentId:M}=qe(),d=Qe(),{granted:T}=_e("org:manage"),m=M===i.id;let D;e[0]!==m||e[1]!==i.id||e[2]!==i.title||e[3]!==d||e[4]!==c?(D=()=>{const I=m?null:i.id;d.mutate(I,{onSuccess:()=>le.success(m?c("home.projectCard.mainAgentUnset",{title:i.title}):c("home.projectCard.mainAgentSet",{title:i.title})),onError:()=>le.error(c("home.projectCard.mainAgentError"))})},e[0]=m,e[1]=i.id,e[2]=i.title,e[3]=d,e[4]=c,e[5]=D):D=e[5];const j=D;let y;e[6]!==f||e[7]!==i.id?(y=()=>f(i.id),e[6]=f,e[7]=i.id,e[8]=y):y=e[8];let a;e[9]!==i.title||e[10]!==y?(a=o.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[9]=i.title,e[10]=y,e[11]=a):a=e[11];let l;e[12]!==i.icon||e[13]!==i.title?(l=o.jsx(Re,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[12]=i.icon,e[13]=i.title,e[14]=l):l=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ue,{asChild:!0,children:o.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Ue,{size:20})})}),e[15]=h):h=e[15];let C;e[16]!==f||e[17]!==i.id?(C=()=>f(i.id,{search:{main:"settings"}}),e[16]=f,e[17]=i.id,e[18]=C):C=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(He,{size:16}),e[19]=w):w=e[19];let u;e[20]!==C?(u=o.jsxs(re,{onClick:C,children:[w,"Settings"]}),e[20]=C,e[21]=u):u=e[21];let O;e[22]!==T||e[23]!==m||e[24]!==c||e[25]!==j?(O=T&&o.jsxs(re,{onClick:I=>{I.stopPropagation(),j()},children:[o.jsx(fe,{size:16}),c(m?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[22]=T,e[23]=m,e[24]=c,e[25]=j,e[26]=O):O=e[26];let E;e[27]!==r?(E=r&&o.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ve,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(ye,{align:"end",children:[u,O,E]})]})}),e[29]=E,e[30]=u,e[31]=O,e[32]=z):z=e[32];let S;e[33]!==z||e[34]!==l?(S=o.jsxs("div",{className:"flex items-start justify-between",children:[l,z]}),e[33]=z,e[34]=l,e[35]=S):S=e[35];let v;e[36]!==i.title?(v=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[36]=i.title,e[37]=v):v=e[37];let N;e[38]!==m||e[39]!==c?(N=m&&o.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[o.jsx(fe,{size:12}),c("home.projectCard.mainAgentBadge")]}),e[38]=m,e[39]=c,e[40]=N):N=e[40];let P;e[41]!==v||e[42]!==N?(P=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,N]}),e[41]=v,e[42]=N,e[43]=P):P=e[43];const F=i.description||"No description";let s;e[44]!==F?(s=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:F}),e[44]=F,e[45]=s):s=e[45];let p;e[46]!==P||e[47]!==s?(p=o.jsxs("div",{className:"flex flex-col gap-1",children:[P,s]}),e[46]=P,e[47]=s,e[48]=p):p=e[48];let g;e[49]!==S||e[50]!==p?(g=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[S,p]}),e[49]=S,e[50]=p,e[51]=g):g=e[51];let b;e[52]!==n||e[53]!==x||e[54]!==i.updated_at||e[55]!==c?(b=n?c("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:x})}):c("home.projectCard.updated",{time:he(new Date(i.updated_at),{addSuffix:!0,locale:x})}),e[52]=n,e[53]=x,e[54]=i.updated_at,e[55]=c,e[56]=b):b=e[56];let _;e[57]!==b?(_=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:b})})}),e[57]=b,e[58]=_):_=e[58];let A;e[59]!==g||e[60]!==_?(A=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[g,_]}),e[59]=g,e[60]=_,e[61]=A):A=e[61];let k;return e[62]!==A||e[63]!==a?(k=o.jsxs(Je,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[a,A]}),e[62]=A,e[63]=a,e[64]=k):k=e[64],k}const wt="deco-sites";function St(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function _t(t,e){const i=e?St(e):null,n=i?.owner??wt,r=i?.repo??t;return{owner:n,name:r,url:`https://github.com/${n}/${r}`}}function vt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function ve(t,e,i){const n=await fetch(t,e),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error??`${i} (${n.status})`);return r}function Nt(t){return ve(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function At({open:t,onOpenChange:e,onBack:i}){const n=me(),{org:r}=De(),f=Se(),c=Ie(),{data:G}=Le.useSession(),[x,M]=X.useState(null),[d,T]=X.useState(null),[m,D]=X.useState(""),j=xe({connectionId:Ze,orgId:r.id,orgSlug:r.slug}),y=Xe({slug:"mcp-github"}),a=tt(y),l=Me({enabled:t&&a.length===0}),h=a.length===1?a[0]??null:d,C=a.length>1&&!h,w=xe({connectionId:h?.id??"",orgId:r.id,orgSlug:r.slug}),u=t&&a.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:E,error:z}=Te({queryKey:de.decoSites(G?.user?.email),queryFn:()=>Nt(r.slug),enabled:t&&!!G?.user?.email,staleTime:6e4,retry:!1}),S=O?.sites??[],v=s=>{s||(M(null),T(null),D("")),e(s)},N=S.filter(s=>s.name.toLowerCase().includes(m.toLowerCase())||(s.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),P=!x||N.some(s=>s.name===x),F=Ee({mutationFn:async s=>{if(!h)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));V("deco_site_import_started",{site_name:s});const{installations:p}=await ot(B=>j.callTool(B),h.id),g=S.find(B=>B.name===s);if(!g)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const b=_t(s,g.metadata),_=st(p,b.owner);if(!_)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:it}));let A=null,k=null,I=null;const J=async()=>{I&&await j.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:I}}).catch(()=>{}),k&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),A&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const B=await ve(`/api/${r.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:s})},n("common.importFromDecoDialog.failedToCreateConnection")),U=B.connId;if(!U)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=U;const{childConnectionId:$,reused:Y}=await nt({orgSlug:r.slug,sourceConnection:h,installationId:_.installationId,owner:b.owner,repo:b.name,githubCallTool:H=>w.callTool(H),selfCallTool:H=>j.callTool(H)});k=Y?null:$;const K=B.icon??null,Z=vt(s),W=s.toLowerCase(),q=et(je(g.domains)),Q=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s,description:"Imported from deco.cx",pinned:!1,icon:K??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:q,productionUrl:q,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:_.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:Z,pinnedViews:[{connectionId:U,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:U,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:U},{connection_id:$}]}}}),R=Q.structuredContent??Q;if(!R.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=R.item.id,{slug:Z,virtualMcpId:R.item.id,connId:U,item:R.item}}catch(B){throw await J(),B}},onSuccess:({slug:s,virtualMcpId:p,item:g})=>{V("deco_site_import_succeeded",{site_name:g.title,virtual_mcp_id:p,slug:s}),c.setQueryData(de.collectionItem(j,r.id,"","VIRTUAL_MCP",p),{item:g}),c.invalidateQueries({predicate:b=>{const _=b.queryKey;return _[1]===r.id&&_[3]==="collection"&&_[4]==="VIRTUAL_MCP"}}),c.invalidateQueries({queryKey:de.projects(r.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:s})),v(!1),localStorage.setItem(Fe.sidebarOpen(),JSON.stringify(!1)),f(p)},onError:s=>{V("deco_site_import_failed",{error:s instanceof Error?s.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(s instanceof Error?s.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(rt,{open:t,onOpenChange:v,children:o.jsxs(lt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(at,{className:"sr-only",children:o.jsx(ct,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&o.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(dt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ut,{value:m,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:s=>{s.key==="Escape"&&D("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ne,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),C&&!u&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:n("common.importFromDecoDialog.selectGithubConnection")})}),a.map(s=>o.jsxs("button",{type:"button",onClick:()=>T(s),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?o.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(we,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}),E&&!u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!E&&!u&&!C&&l.status!=="error"&&!z&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!E&&!u&&!C&&l.status!=="error"&&S.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[N.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:m})}),N.map(s=>{const p=je(s.domains),g=x===s.name;return o.jsxs("button",{type:"button",onClick:()=>M(s.name),className:ke("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:s.thumb_url?o.jsx("img",{src:s.thumb_url,alt:s.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.name}),p&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},s.name)})]})]}),o.jsxs(mt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ne,{variant:"outline",onClick:()=>v(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ne,{disabled:!x||!P||F.isPending||E||u||C||!h||l.status==="error",onClick:()=>x&&F.mutate(x),children:F.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ms(){const t=ge.c(77),e=me(),{org:i}=De(),n=Oe(),r=ze(),[f,c]=X.useState("");let G;t[0]===Symbol.for("react.memo_cache_sentinel")?(G={navigateOnCreate:!0},t[0]=G):G=t[0];const{createVirtualMCP:x,isCreating:M}=We(G),[d,T]=X.useState(null),[m,D]=X.useState(!1),[j,y]=X.useState(!1),{granted:a}=_e("agents:manage"),l=f.toLowerCase(),h=n.filter(L=>L.id!==i.id&&(L.title.toLowerCase().includes(l)||L.description?.toLowerCase().includes(l))),{data:C}=Be(h.map(It));let w;t[1]!==r||t[2]!==d||t[3]!==e?(w=async()=>{if(!d)return;const{id:L,title:Ne}=d;T(null);try{await r.delete.mutateAsync(L),V("agent_deleted",{agent_id:L,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:Ne}))}catch{}},t[1]=r,t[2]=d,t[3]=e,t[4]=w):w=t[4];const u=w,O=ce,E=ce,z=ce;let S;t[5]!==e?(S=e("routes.agentsList.title"),t[5]=e,t[6]=S):S=t[6];let v;t[7]!==S?(v=o.jsx(ce.Title,{children:S}),t[7]=S,t[8]=v):v=t[8];let N;t[9]!==e?(N=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=N):N=t[10];let P;t[11]===Symbol.for("react.memo_cache_sentinel")?(P=L=>{L.key==="Escape"&&(c(""),L.target.blur())},t[11]=P):P=t[11];let F;t[12]!==f||t[13]!==N?(F=o.jsx(Dt,{value:f,onChange:c,placeholder:N,className:"w-full md:w-[375px]",onKeyDown:P}),t[12]=f,t[13]=N,t[14]=F):F=t[14];let s;t[15]!==a||t[16]!==x||t[17]!==M||t[18]!==e?(s=a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:M,align:"end"})]}),t[15]=a,t[16]=x,t[17]=M,t[18]=e,t[19]=s):s=t[19];let p;t[20]!==F||t[21]!==s?(p=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[F,s]}),t[20]=F,t[21]=s,t[22]=p):p=t[22];let g;t[23]!==p||t[24]!==v?(g=o.jsxs("div",{className:"flex flex-col gap-6",children:[v,p]}),t[23]=p,t[24]=v,t[25]=g):g=t[25];const b=h.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{image:o.jsx($e,{size:48,className:"text-muted-foreground"}),title:e(f?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:f?e("routes.agentsList.noAgentsMatchSearch",{search:f}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!f&&a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:M,align:"center",showBetaBadge:!0})]})})}),_=h.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:h.map(L=>o.jsx(yt,{project:L,lastUsedAt:C?.get(L.id)?.last_used_at,onDeleteClick:a?()=>T({id:L.id,title:L.title}):void 0},L.id))})]});let A;t[26]!==g||t[27]!==b||t[28]!==_||t[29]!==z.Body?(A=o.jsxs(z.Body,{children:[g,b,_]}),t[26]=g,t[27]=b,t[28]=_,t[29]=z.Body,t[30]=A):A=t[30];let k;t[31]!==A||t[32]!==E.Content?(k=o.jsx(E.Content,{children:A}),t[31]=A,t[32]=E.Content,t[33]=k):k=t[33];let I;t[34]!==j?(I=o.jsx(Pe,{open:j,onOpenChange:y}),t[34]=j,t[35]=I):I=t[35];let J;t[36]!==m?(J=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=J):J=t[37];const B=!!d;let U;t[38]===Symbol.for("react.memo_cache_sentinel")?(U=L=>!L&&T(null),t[38]=U):U=t[38];let $;t[39]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=$):$=t[40];let Y;t[41]!==$?(Y=o.jsx(pt,{children:$}),t[41]=$,t[42]=Y):Y=t[42];let K;t[43]!==e?(K=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=K):K=t[44];const Z=d?.title;let W;t[45]!==Z?(W=o.jsx("span",{className:"font-medium text-foreground",children:Z}),t[45]=Z,t[46]=W):W=t[46];let q;t[47]!==K||t[48]!==W?(q=o.jsxs(gt,{children:[K," ",W,"."]}),t[47]=K,t[48]=W,t[49]=q):q=t[49];let Q;t[50]!==Y||t[51]!==q?(Q=o.jsxs(ft,{children:[Y,q]}),t[50]=Y,t[51]=q,t[52]=Q):Q=t[52];let R;t[53]!==e?(R=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=R):R=t[54];let H;t[55]!==R?(H=o.jsx(ht,{children:R}),t[55]=R,t[56]=H):H=t[56];let ee;t[57]!==e?(ee=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=ee):ee=t[58];let te;t[59]!==u||t[60]!==ee?(te=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ee}),t[59]=u,t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==H||t[63]!==te?(oe=o.jsxs(jt,{children:[H,te]}),t[62]=H,t[63]=te,t[64]=oe):oe=t[64];let se;t[65]!==Q||t[66]!==oe?(se=o.jsxs(Ct,{children:[Q,oe]}),t[65]=Q,t[66]=oe,t[67]=se):se=t[67];let ie;t[68]!==B||t[69]!==se?(ie=o.jsx(bt,{open:B,onOpenChange:U,children:se}),t[68]=B,t[69]=se,t[70]=ie):ie=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==J||t[75]!==ie?(ae=o.jsxs(O,{children:[k,I,J,ie]}),t[71]=O,t[72]=k,t[73]=I,t[74]=J,t[75]=ie,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ms as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Z as X,$ as K,_ as Ae,a3 as Ke,a4 as ne,a0 as Be,b8 as Oe,c as Z,b as le,a2 as ze,a1 as Le,r as W,j as s,a5 as at,t as ee,av as Ve,F as _e,o as ke,e as ae,K as ie,n as Re,m as Ue,B as se,v as Qe,p as Ge,E as ct}from"./index-vEFJuUdN.js";import{i as dt}from"./AlertCircle-iMFIwWNV.js";import{P as Ne}from"./index-EI3Ugq-F.js";import{S as Ee}from"./skeleton-pl0N1Ino.js";import{b as We,a as Me,S as Te,c as mt}from"./settings-section-DPTzp_P_.js";import{u as Ye,b as we,i as ut,c as pt,p as ft,d as Fe,e as gt,f as Je}from"./use-ai-providers-B0Xkp5BB.js";import{i as ht}from"./CheckCircle-N8333lb0.js";import{b as xt,j as vt}from"./use-organization-settings-CgP5KHWU.js";import{c as bt,d as Ze,P as yt,C as $e}from"./select-model-CR0-6PXS.js";import{u as jt}from"./use-debounced-autosave--SMcEphJ.js";import{I as Ce}from"./input-5e_3GJtI.js";import{T as qe,a as St}from"./toggle-group-De9TzUcu.js";import{A as Xe,a as et,b as tt,c as st,d as it,e as lt,f as ot,g as rt}from"./alert-dialog-Xn8LpVc8.js";import{u as ce}from"./studio-tools-CBUmjJWM.js";import{s as Ct}from"./Plus-BPZja4FC.js";import{p as _t,f as kt}from"./pt-BR-CLy76QW2.js";import{c as Pt}from"./Tool01-DStbcY86.js";import{s as It}from"./Trash01-DGt8nZn9.js";import{A as Nt}from"./avatar-CPIgr7-p.js";import{P as wt}from"./ai-providers-logos-DD3qZ33J.js";import{i as Dt}from"./Settings02-C9fJkEJh.js";import{s as Kt}from"./Eye-Clu-LouG.js";import{b as At,a as Rt,d as Et,e as Mt,c as Tt}from"./dialog-CF1cQ1rb.js";import{S as Ft}from"./spinner-CppnwMRY.js";import{R as Ot}from"./require-capability-fB062a2_.js";import"./sidebar-BXJraWph.js";import"./LayoutLeft-BowuBtX2.js";import"./use-mobile-WXO34F35.js";import"./X-CseWQ5OZ.js";import"./tooltip-BUztXQ1W.js";import"./card-lxFop9oJ.js";import"./ArrowUpRight-erfF6BcP.js";import"./use-mcp-client-lJgGp2B_.js";import"./auth-ANCOmttW.js";import"./drawer-DfRIJaDr.js";import"./chat-context-CV2ibxPd.js";import"./tab-id-DdzeNQQR.js";import"./Check-CABzt6--.js";import"./Copy01-B995BWXi.js";import"./hooks-CJA4VXgB.js";import"./decopilot-sse-pool-Cvk81TxT.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DKb7Fyg4.js";import"./use-decopilot-events-9EcaK7qN.js";import"./checkbox-ZpkUR1gq.js";import"./select-Dez5FrF9.js";import"./ChevronDown-DsDzbrOb.js";import"./ChevronUp-DBUIuLI5.js";import"./ArrowLeft-CsWtY_gB.js";import"./Key01-C8zGItpI.js";import"./SearchMd-BVrWvjH3.js";import"./Monitor01-Bni1e5h7.js";import"./ChevronRight-DwahmHLA.js";import"./Stars01-D94NieJP.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-CPSa9S2T.js";import"./use-capability-D7eAS5np.js";import"./access-gate-CA12_xun.js";import"./capability-load-error-S-JNljGC.js";X({title:K(),url:K(),icon:K()});X({registries:Ke(K(),X({enabled:ne()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(K()).describe("List of MCP app_name or app_id values to hide from the store.")});const re=X({keyId:K(),modelId:K(),title:K().optional()}).nullable();Be(["fast","smart","thinking","image","web_search","deep_research"]);Be(["fast","smart","thinking"]);const Ut=X({tiers:X({fast:re,smart:re,thinking:re,image:re,web_search:re,deep_research:re})});X({tiers:X({fast:re.optional(),smart:re.optional(),thinking:re.optional()})});X({ids:Ae(K()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});X({demo_mode:ne().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:ne().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),qa_agent_enabled:ne().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:ne().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:ne().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human. If the merge is blocked by a conflict with the base branch, hand the PR back to the Super Agent to resolve the conflict (check out the branch, merge the base, push) so it can then merge."),auto_assign_report_tasks_to_super_agent:ne().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned.")});X({id:K().describe("Brand context ID"),name:K().describe("Company name"),domain:K().describe("Company domain (e.g. example.com)"),overview:K().describe("Company overview / description"),logo:K().nullable().optional().describe("Logo URL"),favicon:K().nullable().optional().describe("Favicon URL"),ogImage:K().nullable().optional().describe("OG image URL"),fonts:X({heading:K().optional().describe("Font family for headings"),body:K().optional().describe("Font family for body text"),code:K().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:X({primary:K().optional().describe("Primary brand color (hex)"),secondary:K().optional().describe("Secondary brand color (hex)"),accent:K().optional().describe("Accent / highlight color (hex)"),background:K().optional().describe("Background color (hex)"),foreground:K().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(Ke(K(),Oe())).nullable().optional().describe("Brand images"),metadata:Ke(K(),Oe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:K().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:ne().optional().describe("Whether this is the default brand for the organization")});const $t=e=>e.capabilities?.includes("image")===!0,qt=e=>ut(e),Ht=e=>pt(e),Bt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:$t},{key:"web_search",filter:qt},{key:"deep_research",filter:Ht}];function zt(e){const t=Z.c(30),{slot:i,onSlotChange:l,filterModels:n,defaultKeyId:a}=e,c=Ye(),r=c.some(C=>C.id===i?.keyId)?i?.keyId:null,[f,I]=W.useState(r??a);let y,o;t[0]!==r?(y=()=>{r&&I(r)},o=[r],t[0]=r,t[1]=y,t[2]=o):(y=t[1],o=t[2]),W.useEffect(y,o);let p;t[3]!==c||t[4]!==a||t[5]!==f?(p=c.some(C=>C.id===f)?f:a,t[3]=c,t[4]=a,t[5]=f,t[6]=p):p=t[6];const m=p;let u;t[7]!==m||t[8]!==c?(u=m?c.find(C=>C.id===m):null,t[7]=m,t[8]=c,t[9]=u):u=t[9];const k=u,{models:x,isLoading:v}=we(n?m??void 0:void 0),g=n?v||x.some(n):!0;let _;t[10]!==i||t[11]!==k?.providerId||t[12]!==r?(_=i&&r?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:k?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=k?.providerId,t[12]=r,t[13]=_):_=t[13];const N=_,h=le();if(n&&!g){let C;t[14]!==h?(C=h("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=h,t[15]=C):C=t[15];let w;return t[16]!==C?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:C}),t[16]=C,t[17]=w):w=t[17],w}let j;t[18]!==h?(j=h("settings.simpleModeSection.pickModel"),t[18]=h,t[19]=j):j=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=C=>I(C),t[20]=S):S=t[20];let d;t[21]!==m||t[22]!==l?(d=C=>{const w=C.keyId??m??"";I(w),l({keyId:w,modelId:C.modelId,title:C.title})},t[21]=m,t[22]=l,t[23]=d):d=t[23];let b;return t[24]!==m||t[25]!==n||t[26]!==N||t[27]!==j||t[28]!==d?(b=s.jsx(bt,{variant:"bordered",placeholder:j,model:N,credentialId:m,filterModels:n,onCredentialChange:S,onModelChange:d}),t[24]=m,t[25]=n,t[26]=N,t[27]=j,t[28]=d,t[29]=b):b=t[29],b}function Lt(e){const t=Z.c(10),{isPending:i,showSaved:l}=e,n=le();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ve,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=c):c=t[2];let r;return t[3]!==c?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[3]=c,t[4]=r):r=t[4],r}if(l){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ht,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=c):c=t[7];let r;return t[8]!==c?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[8]=c,t[9]=r):r=t[9],r}return null}function Vt(){const e=Z.c(58),t=le(),i=Ye(),l=xt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=ze(Ut),e[0]=a):a=e[0];let c;e[1]!==l?(c={resolver:a,values:l,mode:"onChange"},e[1]=l,e[2]=c):c=e[2];const r=Le(c),{mutate:f,isPending:I,isSuccess:y}=vt(),o=r.formState.isDirty;let p;e[3]!==r||e[4]!==l||e[5]!==t||e[6]!==f?(p={delayMs:250,save:async()=>{const P=r.getValues();f(P,{onSuccess:()=>r.reset(P,{keepValues:!0}),onError:F=>{r.reset(l),ee.error(t("settings.simpleModeSection.failedToSave",{error:F.message}))}})}},e[3]=r,e[4]=l,e[5]=t,e[6]=f,e[7]=p):p=e[7];const{schedule:m}=jt(p),u=i[0],k=i[1],x=i[2],{models:v}=we(u?.id),{models:g}=we(k?.id),{models:_}=we(x?.id);let N,h;e[8]!==r||e[9]!==n?(N=()=>{n||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},h=[n,r],e[8]=r,e[9]=n,e[10]=N,e[11]=h):(N=e[10],h=e[11]),W.useEffect(N,h);let j;e[12]!==i||e[13]!==r||e[14]!==u||e[15]!==k||e[16]!==x||e[17]!==v||e[18]!==g||e[19]!==_?(j=()=>{const P=r.getValues(),F=new Set(i.map(Qt)),O={};u?.id&&(O[u.id]=v),k?.id&&(O[k.id]=g),x?.id&&(O[x.id]=_);const T=G=>G!=null&&!F.has(G.keyId),D={fast:T(P.tiers.fast)?null:P.tiers.fast,smart:T(P.tiers.smart)?null:P.tiers.smart,thinking:T(P.tiers.thinking)?null:P.tiers.thinking,image:T(P.tiers.image)?null:P.tiers.image,web_search:T(P.tiers.web_search)?null:P.tiers.web_search,deep_research:T(P.tiers.deep_research)?null:P.tiers.deep_research},Y=!D.fast||!D.smart||!D.thinking||!D.image||!D.web_search||!D.deep_research,J=D.fast===P.tiers.fast&&D.smart===P.tiers.smart&&D.thinking===P.tiers.thinking&&D.image===P.tiers.image&&D.web_search===P.tiers.web_search&&D.deep_research===P.tiers.deep_research;if(!Y&&J)return;const z=ft(i,O);r.reset({tiers:{fast:D.fast??z.chat.fast,smart:D.smart??z.chat.smart,thinking:D.thinking??z.chat.thinking,image:D.image??z.image,web_search:D.web_search??z.webSearch,deep_research:D.deep_research??z.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=r,e[14]=u,e[15]=k,e[16]=x,e[17]=v,e[18]=g,e[19]=_,e[20]=j):j=e[20];const S=u?.id,d=k?.id,b=x?.id;let C;e[21]!==i||e[22]!==r||e[23]!==v||e[24]!==g||e[25]!==_||e[26]!==S||e[27]!==d||e[28]!==b?(C=[r,i,v,g,_,S,d,b],e[21]=i,e[22]=r,e[23]=v,e[24]=g,e[25]=_,e[26]=S,e[27]=d,e[28]=b,e[29]=C):C=e[29],W.useEffect(j,C);let w;e[30]!==t?(w=P=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[P]||P,e[30]=t,e[31]=w):w=e[31];const R=w;let A;e[32]!==t?(A=P=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[P]||"",e[32]=t,e[33]=A):A=e[33];const E=A;let M;e[34]!==t?(M=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=M):M=e[35];let U;e[36]!==t?(U=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=U):U=e[37];let L;e[38]!==U?(L=s.jsx("p",{className:"text-sm text-muted-foreground",children:U}),e[38]=U,e[39]=L):L=e[39];const Q=y&&!o;let $;e[40]!==I||e[41]!==Q?($=s.jsx(Lt,{isPending:I,showSaved:Q}),e[40]=I,e[41]=Q,e[42]=$):$=e[42];let q;e[43]!==L||e[44]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[L,$]}),e[43]=L,e[44]=$,e[45]=q):q=e[45];let H;e[46]!==i[0]?.id||e[47]!==r.control||e[48]!==E||e[49]!==R||e[50]!==m?(H=Bt.map(P=>s.jsx(at,{control:r.control,name:`tiers.${P.key}`,render:F=>{const{field:O}=F;return s.jsx(We,{title:R(P.key),description:E(P.key),action:s.jsx(zt,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:P.filter,onSlotChange:T=>{O.onChange(T),m()}})})}},P.key)),e[46]=i[0]?.id,e[47]=r.control,e[48]=E,e[49]=R,e[50]=m,e[51]=H):H=e[51];let B;e[52]!==H?(B=s.jsx(Me,{children:H}),e[52]=H,e[53]=B):B=e[53];let V;return e[54]!==M||e[55]!==q||e[56]!==B?(V=s.jsxs(Te,{title:M,headerClassName:"pl-0",children:[q,B]}),e[54]=M,e[55]=q,e[56]=B,e[57]=V):V=e[57],V}function Qt(e){return e.id}const Gt={usd:[10,20,100],brl:[50,100,500]};function Wt(){const e=Z.c(30),t=le(),i=ce(),[l]=Qe(),[n,a]=W.useState(!1);let c;e[0]!==t?(c=d=>{ee.error(t("settings.decoCreditsHero.topUpFailed",{message:d.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:r,isPending:f}=ae({mutationFn:async d=>{const{url:b}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:d,currency:m});return b},onSuccess:Yt,onError:c}),[I,y]=W.useState(""),[o,p]=W.useState(l.language==="pt-BR"?"brl":"usd"),m=o,u=parseFloat(I),k=!isNaN(u)&&u>=1,x=m==="brl"?"R$":"$";let v;e[2]!==p?(v=d=>{d&&p(d)},e[2]=p,e[3]=v):v=e[3];let g,_;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(qe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),_=s.jsx(qe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=g,e[5]=_):(g=e[4],_=e[5]);let N;e[6]!==m||e[7]!==v?(N=s.jsxs(St,{type:"single",variant:"outline",size:"default",value:m,onValueChange:v,children:[g,_]}),e[6]=m,e[7]=v,e[8]=N):N=e[8];let h;e[9]!==m||e[10]!==x||e[11]!==n||e[12]!==f||e[13]!==t||e[14]!==r?(h=!n&&s.jsxs(s.Fragment,{children:[Gt[m].map(d=>s.jsxs(se,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:f,onClick:()=>r(d*100),children:[x,d]},d)),s.jsx(se,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:f,children:t("settings.decoCreditsHero.custom")})]}),e[9]=m,e[10]=x,e[11]=n,e[12]=f,e[13]=t,e[14]=r,e[15]=h):h=e[15];let j;e[16]!==x||e[17]!==I||e[18]!==u||e[19]!==n||e[20]!==k||e[21]!==f||e[22]!==y||e[23]!==t||e[24]!==r?(j=n&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:x}),s.jsx(Ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:I,onChange:d=>y(d.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(se,{className:"h-10",disabled:!k||f,onClick:()=>r(Math.round(u*100)),children:f?"...":t("settings.decoCreditsHero.add")}),s.jsx(se,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),y("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=x,e[17]=I,e[18]=u,e[19]=n,e[20]=k,e[21]=f,e[22]=y,e[23]=t,e[24]=r,e[25]=j):j=e[25];let S;return e[26]!==N||e[27]!==h||e[28]!==j?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[N,h,j]})}),e[26]=N,e[27]=h,e[28]=j,e[29]=S):S=e[29],S}function Yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Jt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Zt(){const e=Z.c(121),t=le(),{org:i}=_e(),l=ce(),n=ke(),a=Fe();let c;e[0]!==a?(c=a.find(Xt),e[0]=a,e[1]=c):c=e[1];const r=c,[f,I]=W.useState(!1);let y;e[2]!==r||e[3]!==l?(y=async()=>{r&&await l.call("AI_PROVIDER_KEY_DELETE",{keyId:r.id})},e[2]=r,e[3]=l,e[4]=y):y=e[4];let o;e[5]!==i.id||e[6]!==n||e[7]!==t?(o=()=>{n.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:ie.aiProviders(i.id)}),ee.success(t("settings.decoCreditsHero.disconnectSuccess")),I(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=o):o=e[8];let p;e[9]!==t?(p=nt=>{ee.error(t("settings.decoCreditsHero.disconnectError",{message:nt.message}))},e[9]=t,e[10]=p):p=e[10];let m;e[11]!==y||e[12]!==o||e[13]!==p?(m={mutationFn:y,onSuccess:o,onError:p},e[11]=y,e[12]=o,e[13]=p,e[14]=m):m=e[14];const{mutate:u,isPending:k}=ae(m);let x;e[15]!==i.id?(x=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=x):x=e[16];const v=!!r;let g;e[17]!==l?(g=async()=>{try{return await l.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=l,e[18]=g):g=e[18];let _;e[19]!==x||e[20]!==v||e[21]!==g?(_={queryKey:x,enabled:v,staleTime:6e4,queryFn:g},e[19]=x,e[20]=v,e[21]=g,e[22]=_):_=e[22];const{data:N,isLoading:h,refetch:j,isFetching:S}=Re(_);if(!r)return null;const d=N?.balanceCents!=null?N.balanceCents/100:null;let b;e[23]!==d?(b=d!=null?`$${d.toFixed(2)}`:"—",e[23]=d,e[24]=b):b=e[24];const C=b;let w;e[25]!==t?(w=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=w):w=e[26];let R;e[27]!==t?(R=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=R):R=e[28];let A;e[29]!==R?(A=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:R,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=R,e[30]=A):A=e[30];let E;e[31]!==t?(E=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=E):E=e[32];let M;e[33]!==E?(M=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})}),e[33]=E,e[34]=M):M=e[34];let U;e[35]!==A||e[36]!==M?(U=s.jsxs("div",{className:"flex items-center gap-3",children:[A,M]}),e[35]=A,e[36]=M,e[37]=U):U=e[37];let L;e[38]===Symbol.for("react.memo_cache_sentinel")?(L=()=>I(!0),e[38]=L):L=e[38];let Q;e[39]!==t?(Q=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=Q):Q=e[40];let $;e[41]!==k||e[42]!==Q?($=s.jsx(se,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:L,disabled:k,children:Q}),e[41]=k,e[42]=Q,e[43]=$):$=e[43];let q;e[44]!==U||e[45]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between",children:[U,$]}),e[44]=U,e[45]=$,e[46]=q):q=e[46];let H;e[47]!==t?(H=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=H):H=e[48];let B;e[49]!==H?(B=s.jsx(Xe,{children:H}),e[49]=H,e[50]=B):B=e[50];let V;e[51]!==t?(V=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=V):V=e[52];let P;e[53]!==V?(P=s.jsx(et,{children:V}),e[53]=V,e[54]=P):P=e[54];let F;e[55]!==B||e[56]!==P?(F=s.jsxs(tt,{children:[B,P]}),e[55]=B,e[56]=P,e[57]=F):F=e[57];let O;e[58]!==t?(O=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=O):O=e[59];let T;e[60]!==O?(T=s.jsx(st,{children:O}),e[60]=O,e[61]=T):T=e[61];let D;e[62]!==u?(D=()=>u(),e[62]=u,e[63]=D):D=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let J;e[66]!==D||e[67]!==Y?(J=s.jsx(it,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=D,e[67]=Y,e[68]=J):J=e[68];let z;e[69]!==T||e[70]!==J?(z=s.jsxs(lt,{children:[T,J]}),e[69]=T,e[70]=J,e[71]=z):z=e[71];let G;e[72]!==F||e[73]!==z?(G=s.jsxs(ot,{children:[F,z]}),e[72]=F,e[73]=z,e[74]=G):G=e[74];let oe;e[75]!==f||e[76]!==G?(oe=s.jsx(rt,{open:f,onOpenChange:I,children:G}),e[75]=f,e[76]=G,e[77]=oe):oe=e[77];let te;e[78]!==d||e[79]!==C||e[80]!==S||e[81]!==h?(te=h||S?s.jsx(Ee,{className:"h-9 w-24"}):s.jsx("span",{className:Ue("text-3xl font-semibold tabular-nums tracking-tight",d!=null&&Jt(d)),children:C}),e[78]=d,e[79]=C,e[80]=S,e[81]=h,e[82]=te):te=e[82];let de;e[83]!==j?(de=()=>j(),e[83]=j,e[84]=de):de=e[84];let me;e[85]!==t?(me=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=me):me=e[86];const De=S&&"animate-spin";let ue;e[87]!==De?(ue=Ue(De),e[87]=De,e[88]=ue):ue=e[88];let pe;e[89]!==ue?(pe=s.jsx(Ve,{size:14,className:ue}),e[89]=ue,e[90]=pe):pe=e[90];let fe;e[91]!==S||e[92]!==de||e[93]!==me||e[94]!==pe?(fe=s.jsx("button",{type:"button",onClick:de,disabled:S,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":me,children:pe}),e[91]=S,e[92]=de,e[93]=me,e[94]=pe,e[95]=fe):fe=e[95];let ge;e[96]!==te||e[97]!==fe?(ge=s.jsxs("div",{className:"flex items-baseline gap-2",children:[te,fe]}),e[96]=te,e[97]=fe,e[98]=ge):ge=e[98];let he;e[99]!==t?(he=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=he):he=e[100];let xe;e[101]!==he?(xe=s.jsx("p",{className:"text-xs text-muted-foreground",children:he}),e[101]=he,e[102]=xe):xe=e[102];let ve;e[103]!==ge||e[104]!==xe?(ve=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[ge,xe]}),e[103]=ge,e[104]=xe,e[105]=ve):ve=e[105];let be;e[106]!==t?(be=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=be):be=e[107];let ye;e[108]!==be?(ye=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:be}),e[108]=be,e[109]=ye):ye=e[109];let Pe;e[110]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(Wt,{}),e[110]=Pe):Pe=e[110];let je;e[111]!==ye?(je=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[ye,Pe]}),e[111]=ye,e[112]=je):je=e[112];let Se;e[113]!==q||e[114]!==oe||e[115]!==ve||e[116]!==je?(Se=s.jsx(Me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[q,oe,ve,je]})}),e[113]=q,e[114]=oe,e[115]=ve,e[116]=je,e[117]=Se):Se=e[117];let Ie;return e[118]!==w||e[119]!==Se?(Ie=s.jsx(Te,{title:w,children:Se}),e[118]=w,e[119]=Se,e[120]=Ie):Ie=e[120],Ie}function Xt(e){return e.providerId==="deco"}function es(){const e=Z.c(8),{org:t}=_e(),i=ce(),l=ke();let n;e[0]!==i?(n=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=n):n=e[1];let a;e[2]!==t||e[3]!==l?(a=()=>{Ge("ai_provider_provision_succeeded",{provider_id:"deco"}),l.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),l.invalidateQueries({queryKey:ie.aiProviders(t.id)}),ee.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=l,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==a?(c={mutationFn:n,onSuccess:a,onError:ts},e[5]=n,e[6]=a,e[7]=c):c=e[7],ae(c)}function ts(e){Ge("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),ee.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function ss(){const e=Z.c(37),t=le(),{mutate:i,isPending:l}=es();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=a):a=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let r;e[4]!==c?(r=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=r):r=e[5];let f;e[6]!==t?(f=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=f):f=e[7];let I;e[8]!==f?(I=s.jsx("p",{className:"text-base font-semibold",children:f}),e[8]=f,e[9]=I):I=e[9];let y;e[10]!==t?(y=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=y):y=e[11];let o;e[12]!==y?(o=s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:y}),e[12]=y,e[13]=o):o=e[13];let p;e[14]!==I||e[15]!==o?(p=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[I,o]}),e[14]=I,e[15]=o,e[16]=p):p=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let u;e[19]!==m?(u=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=u):u=e[20];let k;e[21]!==u||e[22]!==p?(k=s.jsxs("div",{className:"flex-1 min-w-0",children:[p,u]}),e[21]=u,e[22]=p,e[23]=k):k=e[23];let x;e[24]!==i?(x=()=>i(),e[24]=i,e[25]=x):x=e[25];let v;e[26]!==l||e[27]!==t?(v=t(l?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=l,e[27]=t,e[28]=v):v=e[28];let g;e[29]!==l||e[30]!==x||e[31]!==v?(g=s.jsx(se,{variant:"outline",disabled:l,onClick:x,children:v}),e[29]=l,e[30]=x,e[31]=v,e[32]=g):g=e[32];let _;return e[33]!==k||e[34]!==g||e[35]!==r?(_=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[a,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[r,k,g]})]}),e[33]=k,e[34]=g,e[35]=r,e[36]=_):_=e[36],_}const is=e=>X({label:K().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:K().optional(),baseUrl:K().optional()});function ls({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:l}){return e&&!!t&&t!==i&&!l}function os({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:n,currentBaseUrl:a,onCancel:c,onSuccess:r}){const{org:f}=_e(),I=ce(),y=ke(),o=le(),[p,m]=W.useState(!1),u=t.id==="openai-compatible",k=t.supportedMethods.includes("api-key"),x=is(o),{register:v,handleSubmit:g,watch:_,setError:N,formState:{errors:h}}=Le({resolver:ze(x),defaultValues:{label:n,apiKey:"",baseUrl:a??""}}),j=_("apiKey")??"",{mutate:S,isPending:d}=ae({mutationFn:async b=>{let C;b.apiKey&&(u?C=JSON.stringify({baseUrl:b.baseUrl||a||"",apiKey:b.apiKey}):C=b.apiKey),await I.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:b.label,...C!==void 0?{apiKey:C}:{}})},onSuccess:()=>{y.invalidateQueries({queryKey:ie.aiProviderKeys(f.id)}),y.invalidateQueries({queryKey:ie.aiProviders(f.id)}),ee.success(o("settings.editProviderDialog.providerUpdated")),r()},onError:b=>ee.error(o("settings.editProviderDialog.failedToUpdate",{error:b.message}))});return s.jsxs("form",{onSubmit:g(b=>{if(ls({isOpenAICompatible:u,baseUrl:b.baseUrl,currentBaseUrl:a,apiKey:b.apiKey})){N("apiKey",{message:o("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}S(b)}),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:o("settings.editProviderDialog.label")}),s.jsx(Ce,{placeholder:o("settings.editProviderDialog.labelPlaceholder"),...v("label"),className:"h-8 text-sm"}),h.label&&s.jsx("p",{className:"text-xs text-destructive",children:h.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:o("settings.editProviderDialog.baseUrl")}),s.jsx(Ce,{type:"url",placeholder:i?.baseUrlPlaceholder??o("settings.editProviderDialog.baseUrlPlaceholder"),...v("baseUrl"),className:"h-8 text-sm"})]}),k&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[o("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",o("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ce,{type:p&&j?"text":"password",placeholder:l,...v("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),j&&s.jsx("button",{type:"button",onClick:()=>m(!p),"aria-label":o(p?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:p?s.jsx(Dt,{size:14}):s.jsx(Kt,{size:14})})]}),h.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:h.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Tt,{children:[s.jsx(se,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:d,children:o("settings.editProviderDialog.cancel")}),s.jsx(se,{type:"submit",size:"sm",disabled:d,children:o(d?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function rs(e){const t=Z.c(31),{providerKey:i,provider:l,open:n,onOpenChange:a}=e,c=le(),r=ce(),f=l.id==="openai-compatible"&&i.presetId?Ze(i.presetId):void 0,I=f?.name??l.name;let y;t[0]!==i.id?(y=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=y):y=t[1];let o;t[2]!==i.id||t[3]!==r?(o=()=>r.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=r,t[4]=o):o=t[4];let p;t[5]!==n||t[6]!==y||t[7]!==o?(p={queryKey:y,queryFn:o,enabled:n,staleTime:0},t[5]=n,t[6]=y,t[7]=o,t[8]=p):p=t[8];const{data:m,isLoading:u}=Re(p),k=Mt,x=Et,v="sm:max-w-md",g=Rt,_=At,N=c("settings.editProviderDialog.editTitle",{name:I});let h;t[9]!==_||t[10]!==N?(h=s.jsx(_,{children:N}),t[9]=_,t[10]=N,t[11]=h):h=t[11];let j;t[12]!==g||t[13]!==h?(j=s.jsx(g,{children:h}),t[12]=g,t[13]=h,t[14]=j):j=t[14];let S;t[15]!==u||t[16]!==a||t[17]!==f||t[18]!==m||t[19]!==l||t[20]!==i?(S=u||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Ft,{})}):s.jsx(os,{providerKey:i,provider:l,preset:f,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[15]=u,t[16]=a,t[17]=f,t[18]=m,t[19]=l,t[20]=i,t[21]=S):S=t[21];let d;t[22]!==x||t[23]!==j||t[24]!==S?(d=s.jsxs(x,{className:v,children:[j,S]}),t[22]=x,t[23]=j,t[24]=S,t[25]=d):d=t[25];let b;return t[26]!==k||t[27]!==a||t[28]!==n||t[29]!==d?(b=s.jsx(k,{open:n,onOpenChange:a,children:d}),t[26]=k,t[27]=a,t[28]=n,t[29]=d,t[30]=b):b=t[30],b}function ns(e){const t=Z.c(86),{providerKey:i,provider:l}=e,{org:n}=_e(),a=ce(),c=ke(),[r,f]=W.useState(!1),[I,y]=W.useState(!1),o=le(),[p]=Qe(),m=p.language==="pt-BR"?_t:void 0,u=l?.id==="openai-compatible";let k;t[0]!==u||t[1]!==i.presetId?(k=u&&i.presetId?Ze(i.presetId):void 0,t[0]=u,t[1]=i.presetId,t[2]=k):k=t[2];const x=k;let v;t[3]!==u||t[4]!==x||t[5]!==l?.name||t[6]!==i.providerId||t[7]!==o?(v=x?x.name:u?o("settings.aiProviders.customOpenAiCompatible"):l?.name??(i.providerId==="claude-code"?o("settings.providerKeyRow.claudeCode"):i.providerId==="codex"?o("settings.providerKeyRow.codex"):i.providerId),t[3]=u,t[4]=x,t[5]=l?.name,t[6]=i.providerId,t[7]=o,t[8]=v):v=t[8];const g=v,_=x?.logo??l?.logo??wt[i.providerId];let N;e:{if(u){N=i.label;break e}let te;t[9]!==m||t[10]!==i.createdAt||t[11]!==i.label||t[12]!==o?(te=o("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:kt(new Date(i.createdAt),{locale:m})}),t[9]=m,t[10]=i.createdAt,t[11]=i.label,t[12]=o,t[13]=te):te=t[13],N=te}const h=N;let j;t[14]!==i.id||t[15]!==a?(j=async()=>{await a.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[14]=i.id,t[15]=a,t[16]=j):j=t[16];let S;t[17]!==n||t[18]!==i.id||t[19]!==c||t[20]!==o?(S=()=>{c.invalidateQueries({queryKey:ie.aiProviderKeys(n.id)}),c.invalidateQueries({queryKey:ie.aiProviders(n.id)}),c.invalidateQueries({queryKey:ie.aiProviderModels(n.id,i.id)}),ee.success(o("settings.providerKeyRow.keyDeleted")),f(!1)},t[17]=n,t[18]=i.id,t[19]=c,t[20]=o,t[21]=S):S=t[21];let d;t[22]!==o?(d=te=>ee.error(o("settings.providerKeyRow.failedToDeleteKey",{error:te.message})),t[22]=o,t[23]=d):d=t[23];let b;t[24]!==j||t[25]!==S||t[26]!==d?(b={mutationFn:j,onSuccess:S,onError:d},t[24]=j,t[25]=S,t[26]=d,t[27]=b):b=t[27];const{mutate:C,isPending:w}=ae(b);let R;t[28]!==g||t[29]!==_?(R=_?s.jsx("img",{src:_,alt:g,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Nt,{fallback:g.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[28]=g,t[29]=_,t[30]=R):R=t[30];let A;t[31]!==l||t[32]!==o?(A=l?s.jsx(se,{variant:"ghost",size:"icon","aria-label":o("settings.providerKeyRow.editProviderKey"),className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>y(!0),children:s.jsx(Pt,{size:14})}):null,t[31]=l,t[32]=o,t[33]=A):A=t[33];let E;t[34]!==o?(E=o("settings.providerKeyRow.deleteProviderKey"),t[34]=o,t[35]=E):E=t[35];let M,U;t[36]===Symbol.for("react.memo_cache_sentinel")?(M=()=>f(!0),U=s.jsx(It,{size:14}),t[36]=M,t[37]=U):(M=t[36],U=t[37]);let L;t[38]!==w||t[39]!==E?(L=s.jsx(se,{variant:"ghost",size:"icon","aria-label":E,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:w,onClick:M,children:U}),t[38]=w,t[39]=E,t[40]=L):L=t[40];let Q;t[41]!==L||t[42]!==A?(Q=s.jsxs("div",{className:"flex items-center gap-0.5",children:[A,L]}),t[41]=L,t[42]=A,t[43]=Q):Q=t[43];let $;t[44]!==h||t[45]!==g||t[46]!==Q||t[47]!==R?($=s.jsx(We,{icon:R,title:g,description:h,action:Q}),t[44]=h,t[45]=g,t[46]=Q,t[47]=R,t[48]=$):$=t[48];let q;t[49]!==I||t[50]!==l||t[51]!==i?(q=l?s.jsx(rs,{providerKey:i,provider:l,open:I,onOpenChange:y}):null,t[49]=I,t[50]=l,t[51]=i,t[52]=q):q=t[52];let H;t[53]!==o?(H=o("settings.providerKeyRow.deleteApiKey"),t[53]=o,t[54]=H):H=t[54];let B;t[55]!==H?(B=s.jsx(Xe,{children:H}),t[55]=H,t[56]=B):B=t[56];let V;t[57]!==i.label?(V=s.jsxs(et,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[57]=i.label,t[58]=V):V=t[58];let P;t[59]!==B||t[60]!==V?(P=s.jsxs(tt,{children:[B,V]}),t[59]=B,t[60]=V,t[61]=P):P=t[61];let F;t[62]!==o?(F=o("settings.providerKeyRow.cancel"),t[62]=o,t[63]=F):F=t[63];let O;t[64]!==F?(O=s.jsx(st,{children:F}),t[64]=F,t[65]=O):O=t[65];let T;t[66]!==C?(T=()=>C(),t[66]=C,t[67]=T):T=t[67];let D;t[68]!==o?(D=o("settings.providerKeyRow.delete"),t[68]=o,t[69]=D):D=t[69];let Y;t[70]!==T||t[71]!==D?(Y=s.jsx(it,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),t[70]=T,t[71]=D,t[72]=Y):Y=t[72];let J;t[73]!==O||t[74]!==Y?(J=s.jsxs(lt,{children:[O,Y]}),t[73]=O,t[74]=Y,t[75]=J):J=t[75];let z;t[76]!==P||t[77]!==J?(z=s.jsxs(ot,{children:[P,J]}),t[76]=P,t[77]=J,t[78]=z):z=t[78];let G;t[79]!==r||t[80]!==z?(G=s.jsx(rt,{open:r,onOpenChange:f,children:z}),t[79]=r,t[80]=z,t[81]=G):G=t[81];let oe;return t[82]!==$||t[83]!==q||t[84]!==G?(oe=s.jsxs(s.Fragment,{children:[$,q,G]}),t[82]=$,t[83]=q,t[84]=G,t[85]=oe):oe=t[85],oe}function as(e){const t=e.filter(i=>gt(i.providerId));return{hasInventory:e.length>0,hasHostedProvider:t.length>0,hasDeco:t.some(i=>i.providerId==="deco")}}function cs(e,t){return e.filter(i=>i.providerId!=="deco").map(i=>({key:i,provider:t.find(l=>l.id===i.providerId)??null}))}function He(e){const t=Z.c(13),{onConnectClick:i}=e,l=le(),n=Fe(),a=Je();let c;if(t[0]!==a?.providers||t[1]!==n||t[2]!==i||t[3]!==l){const r=a?.providers??[],f=cs(n,r);let I;t[5]!==l?(I=l("settings.connectedProvidersSection.sectionTitle"),t[5]=l,t[6]=I):I=t[6];let y;t[7]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ct,{size:14}),t[7]=y):y=t[7];let o;t[8]!==l?(o=l("settings.connectedProvidersSection.connectButton"),t[8]=l,t[9]=o):o=t[9];let p;t[10]!==i||t[11]!==o?(p=s.jsxs(se,{size:"sm",onClick:i,children:[y,o]}),t[10]=i,t[11]=o,t[12]=p):p=t[12],c=s.jsx(Te,{title:I,headerClassName:"px-0",actions:p,children:f.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:l("settings.connectedProvidersSection.emptyState")}):s.jsx(Me,{children:f.map(ds)})}),t[0]=a?.providers,t[1]=n,t[2]=i,t[3]=l,t[4]=c}else c=t[4];return c}function ds(e){const{key:t,provider:i}=e;return s.jsx(ns,{providerKey:t,provider:i},t.id)}function ms(){const e=Z.c(55),t=le(),{org:i}=_e(),l=ce(),n=ke(),[a,c]=W.useState("");let r;e[0]!==i.id?(r=ie.claudeSubscription(i.id),e[0]=i.id,e[1]=r):r=e[1];let f;e[2]!==l?(f=()=>l.call("CLAUDE_SUBSCRIPTION_STATUS",{}),e[2]=l,e[3]=f):f=e[3];let I;e[4]!==r||e[5]!==f?(I={queryKey:r,queryFn:f},e[4]=r,e[5]=f,e[6]=I):I=e[6];const y=Re(I);let o;e[7]!==i.id||e[8]!==n?(o=()=>n.invalidateQueries({queryKey:ie.claudeSubscription(i.id)}),e[7]=i.id,e[8]=n,e[9]=o):o=e[9];const p=o;let m;e[10]!==l||e[11]!==a?(m=()=>l.call("CLAUDE_SUBSCRIPTION_CONNECT",{token:a}),e[10]=l,e[11]=a,e[12]=m):m=e[12];let u;e[13]!==p||e[14]!==t?(u=async()=>{c(""),await p(),ee.success(t("settings.claudeSubscription.connected"))},e[13]=p,e[14]=t,e[15]=u):u=e[15];let k;e[16]!==m||e[17]!==u?(k={mutationFn:m,onSuccess:u,onError:ps},e[16]=m,e[17]=u,e[18]=k):k=e[18];const x=ae(k);let v;e[19]!==l?(v=()=>l.call("CLAUDE_SUBSCRIPTION_DISCONNECT",{}),e[19]=l,e[20]=v):v=e[20];let g;e[21]!==p||e[22]!==t?(g=async()=>{await p(),ee.success(t("settings.claudeSubscription.disconnected"))},e[21]=p,e[22]=t,e[23]=g):g=e[23];let _;e[24]!==v||e[25]!==g?(_={mutationFn:v,onSuccess:g,onError:us},e[24]=v,e[25]=g,e[26]=_):_=e[26];const N=ae(_),h=y.data?.connected===!0,j=!h&&!!y.data?.linkedAt;let S;e[27]!==t?(S=t("settings.claudeSubscription.title"),e[27]=t,e[28]=S):S=e[28];let d;e[29]!==S?(d=s.jsx("p",{className:"text-base font-semibold",children:S}),e[29]=S,e[30]=d):d=e[30];let b;e[31]!==h||e[32]!==j||e[33]!==t?(b=t(h?"settings.claudeSubscription.active":j?"settings.claudeSubscription.expired":"settings.claudeSubscription.description"),e[31]=h,e[32]=j,e[33]=t,e[34]=b):b=e[34];let C;e[35]!==b?(C=s.jsx("p",{className:"text-sm text-muted-foreground",children:b}),e[35]=b,e[36]=C):C=e[36];let w;e[37]!==d||e[38]!==C?(w=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,C]}),e[37]=d,e[38]=C,e[39]=w):w=e[39];let R;e[40]!==h||e[41]!==N||e[42]!==t?(R=h?s.jsx(se,{variant:"outline",disabled:N.isPending,onClick:()=>N.mutate(),children:t("settings.claudeSubscription.disconnect")}):null,e[40]=h,e[41]=N,e[42]=t,e[43]=R):R=e[43];let A;e[44]!==w||e[45]!==R?(A=s.jsxs("div",{className:"flex items-center gap-4",children:[w,R]}),e[44]=w,e[45]=R,e[46]=A):A=e[46];let E;e[47]!==x||e[48]!==h||e[49]!==t||e[50]!==a?(E=h?null:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[t("settings.claudeSubscription.howTo")," ",s.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"claude setup-token"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ce,{type:"password",value:a,onChange:U=>c(U.target.value),placeholder:t("settings.claudeSubscription.tokenPlaceholder")}),s.jsx(se,{disabled:a.trim().length===0||x.isPending,onClick:()=>x.mutate(),children:t("settings.claudeSubscription.connect")})]})]}),e[47]=x,e[48]=h,e[49]=t,e[50]=a,e[51]=E):E=e[51];let M;return e[52]!==A||e[53]!==E?(M=s.jsxs("div",{className:"rounded-xl border border-border px-6 py-5 flex flex-col gap-4",children:[A,E]}),e[52]=A,e[53]=E,e[54]=M):M=e[54],M}function us(e){return ee.error(e.message)}function ps(e){return ee.error(e.message)}function fs(e){const t=Z.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(dt,{size:16}),t[0]=l):l=t[0];let n;return t[1]!==i.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=n):n=t[2],n}function gs(){const e=Z.c(27),t=Fe();let i;e[0]!==t?(i=as(t),e[0]=t,e[1]=i):i=e[1];const{hasInventory:l,hasHostedProvider:n,hasDeco:a}=i,[c,r]=W.useState(!1),[f,I]=W.useState(null),y=Je();let o;e[2]!==y?.providers?(o=y?.providers??[],e[2]=y?.providers,e[3]=o):o=e[3];const p=o;if(!n){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>r(!0),e[4]=_):_=e[4];let N;e[5]!==p?(N=s.jsx(yt,{providers:p,onSelect:I,onShowAll:_}),e[5]=p,e[6]=N):N=e[6];const h=f!==null||c;let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=w=>{w||(I(null),r(!1))},e[7]=j):j=e[7];const S=f??void 0;let d;e[8]!==h||e[9]!==S?(d=s.jsx($e,{open:h,onOpenChange:j,initialProvider:S}),e[8]=h,e[9]=S,e[10]=d):d=e[10];let b;e[11]!==l?(b=l?s.jsx(He,{onConnectClick:()=>r(!0)}):null,e[11]=l,e[12]=b):b=e[12];let C;return e[13]!==N||e[14]!==d||e[15]!==b?(C=s.jsxs(s.Fragment,{children:[N,d,b]}),e[13]=N,e[14]=d,e[15]=b,e[16]=C):C=e[16],C}let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-16 w-full"}),children:s.jsx(Vt,{})}),e[17]=m):m=e[17];let u;e[18]!==a?(u=a?s.jsx(Zt,{}):s.jsx(ss,{}),e[18]=a,e[19]=u):u=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ms,{}),e[20]=k):k=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(He,{onConnectClick:()=>r(!0)}),e[21]=x):x=e[21];let v;e[22]!==c?(v=s.jsx($e,{open:c,onOpenChange:r}),e[22]=c,e[23]=v):v=e[23];let g;return e[24]!==u||e[25]!==v?(g=s.jsxs(s.Fragment,{children:[m,u,k,x,v]}),e[24]=u,e[25]=v,e[26]=g):g=e[26],g}function hs(){const e=Z.c(7),t=le();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let l;e[2]!==i?(l=s.jsx(Ne.Title,{children:i}),e[2]=i,e[3]=l):l=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ct,{fallback:xs,children:s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-64 w-full"}),children:s.jsx(gs,{})})}),e[4]=n):n=e[4];let a;return e[5]!==l?(a=s.jsx(Ne,{children:s.jsx(Ne.Content,{children:s.jsx(Ne.Body,{children:s.jsxs(mt,{children:[l,n]})})})}),e[5]=l,e[6]=a):a=e[6],a}function xs(e){const{error:t}=e;return s.jsx(fs,{error:t??new Error("Failed to load AI providers")})}function ki(){const e=Z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(hs,{})}),e[0]=t):t=e[0],t}export{ki as default};
|
|
1
|
+
import{Z as X,$ as K,_ as Ae,a3 as Ke,a4 as ne,a0 as Be,b8 as Oe,c as Z,b as le,a2 as ze,a1 as Le,r as W,j as s,a5 as at,t as ee,av as Ve,F as _e,o as ke,e as ae,K as ie,n as Re,m as Ue,B as se,v as Qe,p as Ge,E as ct}from"./index-Bfy-Fe7V.js";import{i as dt}from"./AlertCircle-BMPkNMGJ.js";import{P as Ne}from"./index-D5KNWpFX.js";import{S as Ee}from"./skeleton-Dd2jseki.js";import{b as We,a as Me,S as Te,c as mt}from"./settings-section-CfhHwu3l.js";import{u as Ye,b as we,i as ut,c as pt,p as ft,d as Fe,e as gt,f as Je}from"./use-ai-providers-NYX7QSgc.js";import{i as ht}from"./CheckCircle-C9SAYY-W.js";import{b as xt,j as vt}from"./use-organization-settings-CmS9ohCu.js";import{c as bt,d as Ze,P as yt,C as $e}from"./select-model-BpUI37HY.js";import{u as jt}from"./use-debounced-autosave-CGiNF_NH.js";import{I as Ce}from"./input-BVD_WyXJ.js";import{T as qe,a as St}from"./toggle-group-znNdMK--.js";import{A as Xe,a as et,b as tt,c as st,d as it,e as lt,f as ot,g as rt}from"./alert-dialog-BgN-Tqd-.js";import{u as ce}from"./studio-tools-BBDHxwPb.js";import{s as Ct}from"./Plus-CGrXNe_q.js";import{p as _t,f as kt}from"./pt-BR-CLy76QW2.js";import{c as Pt}from"./Tool01-DMQJZ6a0.js";import{s as It}from"./Trash01-BCoCDH0H.js";import{A as Nt}from"./avatar-CKAwkvrw.js";import{P as wt}from"./ai-providers-logos-DD3qZ33J.js";import{i as Dt}from"./Settings02-DBlt8Mfk.js";import{s as Kt}from"./Eye-DXWAJYKq.js";import{b as At,a as Rt,d as Et,e as Mt,c as Tt}from"./dialog-7h2q_S_D.js";import{S as Ft}from"./spinner-Cq2vfE1B.js";import{R as Ot}from"./require-capability-ATUore6a.js";import"./sidebar-CusUIOZL.js";import"./LayoutLeft-C0u89h3U.js";import"./use-mobile-RWxooM53.js";import"./X-CId2-nhW.js";import"./tooltip-F9SMeJ-j.js";import"./card-GrGBYBXG.js";import"./ArrowUpRight-OVKS4c5s.js";import"./use-mcp-client-CMZDCFwV.js";import"./auth-BcPAS4K5.js";import"./drawer-WhUz4erM.js";import"./chat-context-cK_4I7Xc.js";import"./tab-id-BtKEoC5y.js";import"./Check-CeB_ZeLq.js";import"./Copy01-CXcHnxi0.js";import"./hooks-BTTh4oan.js";import"./decopilot-sse-pool-CYVKd86r.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CvLFbjo1.js";import"./use-decopilot-events-UAWY9DUq.js";import"./checkbox-DjytOswq.js";import"./select-wwJ8EUoY.js";import"./ChevronDown-CGwhMiqT.js";import"./ChevronUp-3dsPU76D.js";import"./ArrowLeft-Bo0FpGQs.js";import"./Key01-DY7yaq7L.js";import"./SearchMd-DFwCvkV1.js";import"./Monitor01-RiuZmvGS.js";import"./ChevronRight-Cux_llMB.js";import"./Stars01-jLom0LSv.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-UnLfhP79.js";import"./use-capability-DssZIcHp.js";import"./access-gate-C95F2WkH.js";import"./capability-load-error-BJPRtvi9.js";X({title:K(),url:K(),icon:K()});X({registries:Ke(K(),X({enabled:ne()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(K()).describe("List of MCP app_name or app_id values to hide from the store.")});const re=X({keyId:K(),modelId:K(),title:K().optional()}).nullable();Be(["fast","smart","thinking","image","web_search","deep_research"]);Be(["fast","smart","thinking"]);const Ut=X({tiers:X({fast:re,smart:re,thinking:re,image:re,web_search:re,deep_research:re})});X({tiers:X({fast:re.optional(),smart:re.optional(),thinking:re.optional()})});X({ids:Ae(K()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});X({demo_mode:ne().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:ne().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),qa_agent_enabled:ne().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:ne().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:ne().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human. If the merge is blocked by a conflict with the base branch, hand the PR back to the Super Agent to resolve the conflict (check out the branch, merge the base, push) so it can then merge."),auto_assign_report_tasks_to_super_agent:ne().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned.")});X({id:K().describe("Brand context ID"),name:K().describe("Company name"),domain:K().describe("Company domain (e.g. example.com)"),overview:K().describe("Company overview / description"),logo:K().nullable().optional().describe("Logo URL"),favicon:K().nullable().optional().describe("Favicon URL"),ogImage:K().nullable().optional().describe("OG image URL"),fonts:X({heading:K().optional().describe("Font family for headings"),body:K().optional().describe("Font family for body text"),code:K().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:X({primary:K().optional().describe("Primary brand color (hex)"),secondary:K().optional().describe("Secondary brand color (hex)"),accent:K().optional().describe("Accent / highlight color (hex)"),background:K().optional().describe("Background color (hex)"),foreground:K().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(Ke(K(),Oe())).nullable().optional().describe("Brand images"),metadata:Ke(K(),Oe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:K().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:ne().optional().describe("Whether this is the default brand for the organization")});const $t=e=>e.capabilities?.includes("image")===!0,qt=e=>ut(e),Ht=e=>pt(e),Bt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:$t},{key:"web_search",filter:qt},{key:"deep_research",filter:Ht}];function zt(e){const t=Z.c(30),{slot:i,onSlotChange:l,filterModels:n,defaultKeyId:a}=e,c=Ye(),r=c.some(C=>C.id===i?.keyId)?i?.keyId:null,[f,I]=W.useState(r??a);let y,o;t[0]!==r?(y=()=>{r&&I(r)},o=[r],t[0]=r,t[1]=y,t[2]=o):(y=t[1],o=t[2]),W.useEffect(y,o);let p;t[3]!==c||t[4]!==a||t[5]!==f?(p=c.some(C=>C.id===f)?f:a,t[3]=c,t[4]=a,t[5]=f,t[6]=p):p=t[6];const m=p;let u;t[7]!==m||t[8]!==c?(u=m?c.find(C=>C.id===m):null,t[7]=m,t[8]=c,t[9]=u):u=t[9];const k=u,{models:x,isLoading:v}=we(n?m??void 0:void 0),g=n?v||x.some(n):!0;let _;t[10]!==i||t[11]!==k?.providerId||t[12]!==r?(_=i&&r?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:k?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=k?.providerId,t[12]=r,t[13]=_):_=t[13];const N=_,h=le();if(n&&!g){let C;t[14]!==h?(C=h("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=h,t[15]=C):C=t[15];let w;return t[16]!==C?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:C}),t[16]=C,t[17]=w):w=t[17],w}let j;t[18]!==h?(j=h("settings.simpleModeSection.pickModel"),t[18]=h,t[19]=j):j=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=C=>I(C),t[20]=S):S=t[20];let d;t[21]!==m||t[22]!==l?(d=C=>{const w=C.keyId??m??"";I(w),l({keyId:w,modelId:C.modelId,title:C.title})},t[21]=m,t[22]=l,t[23]=d):d=t[23];let b;return t[24]!==m||t[25]!==n||t[26]!==N||t[27]!==j||t[28]!==d?(b=s.jsx(bt,{variant:"bordered",placeholder:j,model:N,credentialId:m,filterModels:n,onCredentialChange:S,onModelChange:d}),t[24]=m,t[25]=n,t[26]=N,t[27]=j,t[28]=d,t[29]=b):b=t[29],b}function Lt(e){const t=Z.c(10),{isPending:i,showSaved:l}=e,n=le();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ve,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=c):c=t[2];let r;return t[3]!==c?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[3]=c,t[4]=r):r=t[4],r}if(l){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ht,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=c):c=t[7];let r;return t[8]!==c?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[8]=c,t[9]=r):r=t[9],r}return null}function Vt(){const e=Z.c(58),t=le(),i=Ye(),l=xt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=ze(Ut),e[0]=a):a=e[0];let c;e[1]!==l?(c={resolver:a,values:l,mode:"onChange"},e[1]=l,e[2]=c):c=e[2];const r=Le(c),{mutate:f,isPending:I,isSuccess:y}=vt(),o=r.formState.isDirty;let p;e[3]!==r||e[4]!==l||e[5]!==t||e[6]!==f?(p={delayMs:250,save:async()=>{const P=r.getValues();f(P,{onSuccess:()=>r.reset(P,{keepValues:!0}),onError:F=>{r.reset(l),ee.error(t("settings.simpleModeSection.failedToSave",{error:F.message}))}})}},e[3]=r,e[4]=l,e[5]=t,e[6]=f,e[7]=p):p=e[7];const{schedule:m}=jt(p),u=i[0],k=i[1],x=i[2],{models:v}=we(u?.id),{models:g}=we(k?.id),{models:_}=we(x?.id);let N,h;e[8]!==r||e[9]!==n?(N=()=>{n||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},h=[n,r],e[8]=r,e[9]=n,e[10]=N,e[11]=h):(N=e[10],h=e[11]),W.useEffect(N,h);let j;e[12]!==i||e[13]!==r||e[14]!==u||e[15]!==k||e[16]!==x||e[17]!==v||e[18]!==g||e[19]!==_?(j=()=>{const P=r.getValues(),F=new Set(i.map(Qt)),O={};u?.id&&(O[u.id]=v),k?.id&&(O[k.id]=g),x?.id&&(O[x.id]=_);const T=G=>G!=null&&!F.has(G.keyId),D={fast:T(P.tiers.fast)?null:P.tiers.fast,smart:T(P.tiers.smart)?null:P.tiers.smart,thinking:T(P.tiers.thinking)?null:P.tiers.thinking,image:T(P.tiers.image)?null:P.tiers.image,web_search:T(P.tiers.web_search)?null:P.tiers.web_search,deep_research:T(P.tiers.deep_research)?null:P.tiers.deep_research},Y=!D.fast||!D.smart||!D.thinking||!D.image||!D.web_search||!D.deep_research,J=D.fast===P.tiers.fast&&D.smart===P.tiers.smart&&D.thinking===P.tiers.thinking&&D.image===P.tiers.image&&D.web_search===P.tiers.web_search&&D.deep_research===P.tiers.deep_research;if(!Y&&J)return;const z=ft(i,O);r.reset({tiers:{fast:D.fast??z.chat.fast,smart:D.smart??z.chat.smart,thinking:D.thinking??z.chat.thinking,image:D.image??z.image,web_search:D.web_search??z.webSearch,deep_research:D.deep_research??z.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=r,e[14]=u,e[15]=k,e[16]=x,e[17]=v,e[18]=g,e[19]=_,e[20]=j):j=e[20];const S=u?.id,d=k?.id,b=x?.id;let C;e[21]!==i||e[22]!==r||e[23]!==v||e[24]!==g||e[25]!==_||e[26]!==S||e[27]!==d||e[28]!==b?(C=[r,i,v,g,_,S,d,b],e[21]=i,e[22]=r,e[23]=v,e[24]=g,e[25]=_,e[26]=S,e[27]=d,e[28]=b,e[29]=C):C=e[29],W.useEffect(j,C);let w;e[30]!==t?(w=P=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[P]||P,e[30]=t,e[31]=w):w=e[31];const R=w;let A;e[32]!==t?(A=P=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[P]||"",e[32]=t,e[33]=A):A=e[33];const E=A;let M;e[34]!==t?(M=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=M):M=e[35];let U;e[36]!==t?(U=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=U):U=e[37];let L;e[38]!==U?(L=s.jsx("p",{className:"text-sm text-muted-foreground",children:U}),e[38]=U,e[39]=L):L=e[39];const Q=y&&!o;let $;e[40]!==I||e[41]!==Q?($=s.jsx(Lt,{isPending:I,showSaved:Q}),e[40]=I,e[41]=Q,e[42]=$):$=e[42];let q;e[43]!==L||e[44]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[L,$]}),e[43]=L,e[44]=$,e[45]=q):q=e[45];let H;e[46]!==i[0]?.id||e[47]!==r.control||e[48]!==E||e[49]!==R||e[50]!==m?(H=Bt.map(P=>s.jsx(at,{control:r.control,name:`tiers.${P.key}`,render:F=>{const{field:O}=F;return s.jsx(We,{title:R(P.key),description:E(P.key),action:s.jsx(zt,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:P.filter,onSlotChange:T=>{O.onChange(T),m()}})})}},P.key)),e[46]=i[0]?.id,e[47]=r.control,e[48]=E,e[49]=R,e[50]=m,e[51]=H):H=e[51];let B;e[52]!==H?(B=s.jsx(Me,{children:H}),e[52]=H,e[53]=B):B=e[53];let V;return e[54]!==M||e[55]!==q||e[56]!==B?(V=s.jsxs(Te,{title:M,headerClassName:"pl-0",children:[q,B]}),e[54]=M,e[55]=q,e[56]=B,e[57]=V):V=e[57],V}function Qt(e){return e.id}const Gt={usd:[10,20,100],brl:[50,100,500]};function Wt(){const e=Z.c(30),t=le(),i=ce(),[l]=Qe(),[n,a]=W.useState(!1);let c;e[0]!==t?(c=d=>{ee.error(t("settings.decoCreditsHero.topUpFailed",{message:d.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:r,isPending:f}=ae({mutationFn:async d=>{const{url:b}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:d,currency:m});return b},onSuccess:Yt,onError:c}),[I,y]=W.useState(""),[o,p]=W.useState(l.language==="pt-BR"?"brl":"usd"),m=o,u=parseFloat(I),k=!isNaN(u)&&u>=1,x=m==="brl"?"R$":"$";let v;e[2]!==p?(v=d=>{d&&p(d)},e[2]=p,e[3]=v):v=e[3];let g,_;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(qe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),_=s.jsx(qe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=g,e[5]=_):(g=e[4],_=e[5]);let N;e[6]!==m||e[7]!==v?(N=s.jsxs(St,{type:"single",variant:"outline",size:"default",value:m,onValueChange:v,children:[g,_]}),e[6]=m,e[7]=v,e[8]=N):N=e[8];let h;e[9]!==m||e[10]!==x||e[11]!==n||e[12]!==f||e[13]!==t||e[14]!==r?(h=!n&&s.jsxs(s.Fragment,{children:[Gt[m].map(d=>s.jsxs(se,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:f,onClick:()=>r(d*100),children:[x,d]},d)),s.jsx(se,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:f,children:t("settings.decoCreditsHero.custom")})]}),e[9]=m,e[10]=x,e[11]=n,e[12]=f,e[13]=t,e[14]=r,e[15]=h):h=e[15];let j;e[16]!==x||e[17]!==I||e[18]!==u||e[19]!==n||e[20]!==k||e[21]!==f||e[22]!==y||e[23]!==t||e[24]!==r?(j=n&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:x}),s.jsx(Ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:I,onChange:d=>y(d.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(se,{className:"h-10",disabled:!k||f,onClick:()=>r(Math.round(u*100)),children:f?"...":t("settings.decoCreditsHero.add")}),s.jsx(se,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),y("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=x,e[17]=I,e[18]=u,e[19]=n,e[20]=k,e[21]=f,e[22]=y,e[23]=t,e[24]=r,e[25]=j):j=e[25];let S;return e[26]!==N||e[27]!==h||e[28]!==j?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[N,h,j]})}),e[26]=N,e[27]=h,e[28]=j,e[29]=S):S=e[29],S}function Yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Jt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Zt(){const e=Z.c(121),t=le(),{org:i}=_e(),l=ce(),n=ke(),a=Fe();let c;e[0]!==a?(c=a.find(Xt),e[0]=a,e[1]=c):c=e[1];const r=c,[f,I]=W.useState(!1);let y;e[2]!==r||e[3]!==l?(y=async()=>{r&&await l.call("AI_PROVIDER_KEY_DELETE",{keyId:r.id})},e[2]=r,e[3]=l,e[4]=y):y=e[4];let o;e[5]!==i.id||e[6]!==n||e[7]!==t?(o=()=>{n.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:ie.aiProviders(i.id)}),ee.success(t("settings.decoCreditsHero.disconnectSuccess")),I(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=o):o=e[8];let p;e[9]!==t?(p=nt=>{ee.error(t("settings.decoCreditsHero.disconnectError",{message:nt.message}))},e[9]=t,e[10]=p):p=e[10];let m;e[11]!==y||e[12]!==o||e[13]!==p?(m={mutationFn:y,onSuccess:o,onError:p},e[11]=y,e[12]=o,e[13]=p,e[14]=m):m=e[14];const{mutate:u,isPending:k}=ae(m);let x;e[15]!==i.id?(x=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=x):x=e[16];const v=!!r;let g;e[17]!==l?(g=async()=>{try{return await l.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=l,e[18]=g):g=e[18];let _;e[19]!==x||e[20]!==v||e[21]!==g?(_={queryKey:x,enabled:v,staleTime:6e4,queryFn:g},e[19]=x,e[20]=v,e[21]=g,e[22]=_):_=e[22];const{data:N,isLoading:h,refetch:j,isFetching:S}=Re(_);if(!r)return null;const d=N?.balanceCents!=null?N.balanceCents/100:null;let b;e[23]!==d?(b=d!=null?`$${d.toFixed(2)}`:"—",e[23]=d,e[24]=b):b=e[24];const C=b;let w;e[25]!==t?(w=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=w):w=e[26];let R;e[27]!==t?(R=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=R):R=e[28];let A;e[29]!==R?(A=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:R,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=R,e[30]=A):A=e[30];let E;e[31]!==t?(E=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=E):E=e[32];let M;e[33]!==E?(M=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})}),e[33]=E,e[34]=M):M=e[34];let U;e[35]!==A||e[36]!==M?(U=s.jsxs("div",{className:"flex items-center gap-3",children:[A,M]}),e[35]=A,e[36]=M,e[37]=U):U=e[37];let L;e[38]===Symbol.for("react.memo_cache_sentinel")?(L=()=>I(!0),e[38]=L):L=e[38];let Q;e[39]!==t?(Q=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=Q):Q=e[40];let $;e[41]!==k||e[42]!==Q?($=s.jsx(se,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:L,disabled:k,children:Q}),e[41]=k,e[42]=Q,e[43]=$):$=e[43];let q;e[44]!==U||e[45]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between",children:[U,$]}),e[44]=U,e[45]=$,e[46]=q):q=e[46];let H;e[47]!==t?(H=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=H):H=e[48];let B;e[49]!==H?(B=s.jsx(Xe,{children:H}),e[49]=H,e[50]=B):B=e[50];let V;e[51]!==t?(V=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=V):V=e[52];let P;e[53]!==V?(P=s.jsx(et,{children:V}),e[53]=V,e[54]=P):P=e[54];let F;e[55]!==B||e[56]!==P?(F=s.jsxs(tt,{children:[B,P]}),e[55]=B,e[56]=P,e[57]=F):F=e[57];let O;e[58]!==t?(O=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=O):O=e[59];let T;e[60]!==O?(T=s.jsx(st,{children:O}),e[60]=O,e[61]=T):T=e[61];let D;e[62]!==u?(D=()=>u(),e[62]=u,e[63]=D):D=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let J;e[66]!==D||e[67]!==Y?(J=s.jsx(it,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=D,e[67]=Y,e[68]=J):J=e[68];let z;e[69]!==T||e[70]!==J?(z=s.jsxs(lt,{children:[T,J]}),e[69]=T,e[70]=J,e[71]=z):z=e[71];let G;e[72]!==F||e[73]!==z?(G=s.jsxs(ot,{children:[F,z]}),e[72]=F,e[73]=z,e[74]=G):G=e[74];let oe;e[75]!==f||e[76]!==G?(oe=s.jsx(rt,{open:f,onOpenChange:I,children:G}),e[75]=f,e[76]=G,e[77]=oe):oe=e[77];let te;e[78]!==d||e[79]!==C||e[80]!==S||e[81]!==h?(te=h||S?s.jsx(Ee,{className:"h-9 w-24"}):s.jsx("span",{className:Ue("text-3xl font-semibold tabular-nums tracking-tight",d!=null&&Jt(d)),children:C}),e[78]=d,e[79]=C,e[80]=S,e[81]=h,e[82]=te):te=e[82];let de;e[83]!==j?(de=()=>j(),e[83]=j,e[84]=de):de=e[84];let me;e[85]!==t?(me=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=me):me=e[86];const De=S&&"animate-spin";let ue;e[87]!==De?(ue=Ue(De),e[87]=De,e[88]=ue):ue=e[88];let pe;e[89]!==ue?(pe=s.jsx(Ve,{size:14,className:ue}),e[89]=ue,e[90]=pe):pe=e[90];let fe;e[91]!==S||e[92]!==de||e[93]!==me||e[94]!==pe?(fe=s.jsx("button",{type:"button",onClick:de,disabled:S,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":me,children:pe}),e[91]=S,e[92]=de,e[93]=me,e[94]=pe,e[95]=fe):fe=e[95];let ge;e[96]!==te||e[97]!==fe?(ge=s.jsxs("div",{className:"flex items-baseline gap-2",children:[te,fe]}),e[96]=te,e[97]=fe,e[98]=ge):ge=e[98];let he;e[99]!==t?(he=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=he):he=e[100];let xe;e[101]!==he?(xe=s.jsx("p",{className:"text-xs text-muted-foreground",children:he}),e[101]=he,e[102]=xe):xe=e[102];let ve;e[103]!==ge||e[104]!==xe?(ve=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[ge,xe]}),e[103]=ge,e[104]=xe,e[105]=ve):ve=e[105];let be;e[106]!==t?(be=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=be):be=e[107];let ye;e[108]!==be?(ye=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:be}),e[108]=be,e[109]=ye):ye=e[109];let Pe;e[110]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(Wt,{}),e[110]=Pe):Pe=e[110];let je;e[111]!==ye?(je=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[ye,Pe]}),e[111]=ye,e[112]=je):je=e[112];let Se;e[113]!==q||e[114]!==oe||e[115]!==ve||e[116]!==je?(Se=s.jsx(Me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[q,oe,ve,je]})}),e[113]=q,e[114]=oe,e[115]=ve,e[116]=je,e[117]=Se):Se=e[117];let Ie;return e[118]!==w||e[119]!==Se?(Ie=s.jsx(Te,{title:w,children:Se}),e[118]=w,e[119]=Se,e[120]=Ie):Ie=e[120],Ie}function Xt(e){return e.providerId==="deco"}function es(){const e=Z.c(8),{org:t}=_e(),i=ce(),l=ke();let n;e[0]!==i?(n=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=n):n=e[1];let a;e[2]!==t||e[3]!==l?(a=()=>{Ge("ai_provider_provision_succeeded",{provider_id:"deco"}),l.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),l.invalidateQueries({queryKey:ie.aiProviders(t.id)}),ee.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=l,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==a?(c={mutationFn:n,onSuccess:a,onError:ts},e[5]=n,e[6]=a,e[7]=c):c=e[7],ae(c)}function ts(e){Ge("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),ee.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function ss(){const e=Z.c(37),t=le(),{mutate:i,isPending:l}=es();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=a):a=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let r;e[4]!==c?(r=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=r):r=e[5];let f;e[6]!==t?(f=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=f):f=e[7];let I;e[8]!==f?(I=s.jsx("p",{className:"text-base font-semibold",children:f}),e[8]=f,e[9]=I):I=e[9];let y;e[10]!==t?(y=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=y):y=e[11];let o;e[12]!==y?(o=s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:y}),e[12]=y,e[13]=o):o=e[13];let p;e[14]!==I||e[15]!==o?(p=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[I,o]}),e[14]=I,e[15]=o,e[16]=p):p=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let u;e[19]!==m?(u=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=u):u=e[20];let k;e[21]!==u||e[22]!==p?(k=s.jsxs("div",{className:"flex-1 min-w-0",children:[p,u]}),e[21]=u,e[22]=p,e[23]=k):k=e[23];let x;e[24]!==i?(x=()=>i(),e[24]=i,e[25]=x):x=e[25];let v;e[26]!==l||e[27]!==t?(v=t(l?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=l,e[27]=t,e[28]=v):v=e[28];let g;e[29]!==l||e[30]!==x||e[31]!==v?(g=s.jsx(se,{variant:"outline",disabled:l,onClick:x,children:v}),e[29]=l,e[30]=x,e[31]=v,e[32]=g):g=e[32];let _;return e[33]!==k||e[34]!==g||e[35]!==r?(_=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[a,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[r,k,g]})]}),e[33]=k,e[34]=g,e[35]=r,e[36]=_):_=e[36],_}const is=e=>X({label:K().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:K().optional(),baseUrl:K().optional()});function ls({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:l}){return e&&!!t&&t!==i&&!l}function os({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:n,currentBaseUrl:a,onCancel:c,onSuccess:r}){const{org:f}=_e(),I=ce(),y=ke(),o=le(),[p,m]=W.useState(!1),u=t.id==="openai-compatible",k=t.supportedMethods.includes("api-key"),x=is(o),{register:v,handleSubmit:g,watch:_,setError:N,formState:{errors:h}}=Le({resolver:ze(x),defaultValues:{label:n,apiKey:"",baseUrl:a??""}}),j=_("apiKey")??"",{mutate:S,isPending:d}=ae({mutationFn:async b=>{let C;b.apiKey&&(u?C=JSON.stringify({baseUrl:b.baseUrl||a||"",apiKey:b.apiKey}):C=b.apiKey),await I.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:b.label,...C!==void 0?{apiKey:C}:{}})},onSuccess:()=>{y.invalidateQueries({queryKey:ie.aiProviderKeys(f.id)}),y.invalidateQueries({queryKey:ie.aiProviders(f.id)}),ee.success(o("settings.editProviderDialog.providerUpdated")),r()},onError:b=>ee.error(o("settings.editProviderDialog.failedToUpdate",{error:b.message}))});return s.jsxs("form",{onSubmit:g(b=>{if(ls({isOpenAICompatible:u,baseUrl:b.baseUrl,currentBaseUrl:a,apiKey:b.apiKey})){N("apiKey",{message:o("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}S(b)}),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:o("settings.editProviderDialog.label")}),s.jsx(Ce,{placeholder:o("settings.editProviderDialog.labelPlaceholder"),...v("label"),className:"h-8 text-sm"}),h.label&&s.jsx("p",{className:"text-xs text-destructive",children:h.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:o("settings.editProviderDialog.baseUrl")}),s.jsx(Ce,{type:"url",placeholder:i?.baseUrlPlaceholder??o("settings.editProviderDialog.baseUrlPlaceholder"),...v("baseUrl"),className:"h-8 text-sm"})]}),k&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[o("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",o("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ce,{type:p&&j?"text":"password",placeholder:l,...v("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),j&&s.jsx("button",{type:"button",onClick:()=>m(!p),"aria-label":o(p?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:p?s.jsx(Dt,{size:14}):s.jsx(Kt,{size:14})})]}),h.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:h.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Tt,{children:[s.jsx(se,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:d,children:o("settings.editProviderDialog.cancel")}),s.jsx(se,{type:"submit",size:"sm",disabled:d,children:o(d?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function rs(e){const t=Z.c(31),{providerKey:i,provider:l,open:n,onOpenChange:a}=e,c=le(),r=ce(),f=l.id==="openai-compatible"&&i.presetId?Ze(i.presetId):void 0,I=f?.name??l.name;let y;t[0]!==i.id?(y=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=y):y=t[1];let o;t[2]!==i.id||t[3]!==r?(o=()=>r.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=r,t[4]=o):o=t[4];let p;t[5]!==n||t[6]!==y||t[7]!==o?(p={queryKey:y,queryFn:o,enabled:n,staleTime:0},t[5]=n,t[6]=y,t[7]=o,t[8]=p):p=t[8];const{data:m,isLoading:u}=Re(p),k=Mt,x=Et,v="sm:max-w-md",g=Rt,_=At,N=c("settings.editProviderDialog.editTitle",{name:I});let h;t[9]!==_||t[10]!==N?(h=s.jsx(_,{children:N}),t[9]=_,t[10]=N,t[11]=h):h=t[11];let j;t[12]!==g||t[13]!==h?(j=s.jsx(g,{children:h}),t[12]=g,t[13]=h,t[14]=j):j=t[14];let S;t[15]!==u||t[16]!==a||t[17]!==f||t[18]!==m||t[19]!==l||t[20]!==i?(S=u||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Ft,{})}):s.jsx(os,{providerKey:i,provider:l,preset:f,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[15]=u,t[16]=a,t[17]=f,t[18]=m,t[19]=l,t[20]=i,t[21]=S):S=t[21];let d;t[22]!==x||t[23]!==j||t[24]!==S?(d=s.jsxs(x,{className:v,children:[j,S]}),t[22]=x,t[23]=j,t[24]=S,t[25]=d):d=t[25];let b;return t[26]!==k||t[27]!==a||t[28]!==n||t[29]!==d?(b=s.jsx(k,{open:n,onOpenChange:a,children:d}),t[26]=k,t[27]=a,t[28]=n,t[29]=d,t[30]=b):b=t[30],b}function ns(e){const t=Z.c(86),{providerKey:i,provider:l}=e,{org:n}=_e(),a=ce(),c=ke(),[r,f]=W.useState(!1),[I,y]=W.useState(!1),o=le(),[p]=Qe(),m=p.language==="pt-BR"?_t:void 0,u=l?.id==="openai-compatible";let k;t[0]!==u||t[1]!==i.presetId?(k=u&&i.presetId?Ze(i.presetId):void 0,t[0]=u,t[1]=i.presetId,t[2]=k):k=t[2];const x=k;let v;t[3]!==u||t[4]!==x||t[5]!==l?.name||t[6]!==i.providerId||t[7]!==o?(v=x?x.name:u?o("settings.aiProviders.customOpenAiCompatible"):l?.name??(i.providerId==="claude-code"?o("settings.providerKeyRow.claudeCode"):i.providerId==="codex"?o("settings.providerKeyRow.codex"):i.providerId),t[3]=u,t[4]=x,t[5]=l?.name,t[6]=i.providerId,t[7]=o,t[8]=v):v=t[8];const g=v,_=x?.logo??l?.logo??wt[i.providerId];let N;e:{if(u){N=i.label;break e}let te;t[9]!==m||t[10]!==i.createdAt||t[11]!==i.label||t[12]!==o?(te=o("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:kt(new Date(i.createdAt),{locale:m})}),t[9]=m,t[10]=i.createdAt,t[11]=i.label,t[12]=o,t[13]=te):te=t[13],N=te}const h=N;let j;t[14]!==i.id||t[15]!==a?(j=async()=>{await a.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[14]=i.id,t[15]=a,t[16]=j):j=t[16];let S;t[17]!==n||t[18]!==i.id||t[19]!==c||t[20]!==o?(S=()=>{c.invalidateQueries({queryKey:ie.aiProviderKeys(n.id)}),c.invalidateQueries({queryKey:ie.aiProviders(n.id)}),c.invalidateQueries({queryKey:ie.aiProviderModels(n.id,i.id)}),ee.success(o("settings.providerKeyRow.keyDeleted")),f(!1)},t[17]=n,t[18]=i.id,t[19]=c,t[20]=o,t[21]=S):S=t[21];let d;t[22]!==o?(d=te=>ee.error(o("settings.providerKeyRow.failedToDeleteKey",{error:te.message})),t[22]=o,t[23]=d):d=t[23];let b;t[24]!==j||t[25]!==S||t[26]!==d?(b={mutationFn:j,onSuccess:S,onError:d},t[24]=j,t[25]=S,t[26]=d,t[27]=b):b=t[27];const{mutate:C,isPending:w}=ae(b);let R;t[28]!==g||t[29]!==_?(R=_?s.jsx("img",{src:_,alt:g,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Nt,{fallback:g.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[28]=g,t[29]=_,t[30]=R):R=t[30];let A;t[31]!==l||t[32]!==o?(A=l?s.jsx(se,{variant:"ghost",size:"icon","aria-label":o("settings.providerKeyRow.editProviderKey"),className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>y(!0),children:s.jsx(Pt,{size:14})}):null,t[31]=l,t[32]=o,t[33]=A):A=t[33];let E;t[34]!==o?(E=o("settings.providerKeyRow.deleteProviderKey"),t[34]=o,t[35]=E):E=t[35];let M,U;t[36]===Symbol.for("react.memo_cache_sentinel")?(M=()=>f(!0),U=s.jsx(It,{size:14}),t[36]=M,t[37]=U):(M=t[36],U=t[37]);let L;t[38]!==w||t[39]!==E?(L=s.jsx(se,{variant:"ghost",size:"icon","aria-label":E,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:w,onClick:M,children:U}),t[38]=w,t[39]=E,t[40]=L):L=t[40];let Q;t[41]!==L||t[42]!==A?(Q=s.jsxs("div",{className:"flex items-center gap-0.5",children:[A,L]}),t[41]=L,t[42]=A,t[43]=Q):Q=t[43];let $;t[44]!==h||t[45]!==g||t[46]!==Q||t[47]!==R?($=s.jsx(We,{icon:R,title:g,description:h,action:Q}),t[44]=h,t[45]=g,t[46]=Q,t[47]=R,t[48]=$):$=t[48];let q;t[49]!==I||t[50]!==l||t[51]!==i?(q=l?s.jsx(rs,{providerKey:i,provider:l,open:I,onOpenChange:y}):null,t[49]=I,t[50]=l,t[51]=i,t[52]=q):q=t[52];let H;t[53]!==o?(H=o("settings.providerKeyRow.deleteApiKey"),t[53]=o,t[54]=H):H=t[54];let B;t[55]!==H?(B=s.jsx(Xe,{children:H}),t[55]=H,t[56]=B):B=t[56];let V;t[57]!==i.label?(V=s.jsxs(et,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[57]=i.label,t[58]=V):V=t[58];let P;t[59]!==B||t[60]!==V?(P=s.jsxs(tt,{children:[B,V]}),t[59]=B,t[60]=V,t[61]=P):P=t[61];let F;t[62]!==o?(F=o("settings.providerKeyRow.cancel"),t[62]=o,t[63]=F):F=t[63];let O;t[64]!==F?(O=s.jsx(st,{children:F}),t[64]=F,t[65]=O):O=t[65];let T;t[66]!==C?(T=()=>C(),t[66]=C,t[67]=T):T=t[67];let D;t[68]!==o?(D=o("settings.providerKeyRow.delete"),t[68]=o,t[69]=D):D=t[69];let Y;t[70]!==T||t[71]!==D?(Y=s.jsx(it,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),t[70]=T,t[71]=D,t[72]=Y):Y=t[72];let J;t[73]!==O||t[74]!==Y?(J=s.jsxs(lt,{children:[O,Y]}),t[73]=O,t[74]=Y,t[75]=J):J=t[75];let z;t[76]!==P||t[77]!==J?(z=s.jsxs(ot,{children:[P,J]}),t[76]=P,t[77]=J,t[78]=z):z=t[78];let G;t[79]!==r||t[80]!==z?(G=s.jsx(rt,{open:r,onOpenChange:f,children:z}),t[79]=r,t[80]=z,t[81]=G):G=t[81];let oe;return t[82]!==$||t[83]!==q||t[84]!==G?(oe=s.jsxs(s.Fragment,{children:[$,q,G]}),t[82]=$,t[83]=q,t[84]=G,t[85]=oe):oe=t[85],oe}function as(e){const t=e.filter(i=>gt(i.providerId));return{hasInventory:e.length>0,hasHostedProvider:t.length>0,hasDeco:t.some(i=>i.providerId==="deco")}}function cs(e,t){return e.filter(i=>i.providerId!=="deco").map(i=>({key:i,provider:t.find(l=>l.id===i.providerId)??null}))}function He(e){const t=Z.c(13),{onConnectClick:i}=e,l=le(),n=Fe(),a=Je();let c;if(t[0]!==a?.providers||t[1]!==n||t[2]!==i||t[3]!==l){const r=a?.providers??[],f=cs(n,r);let I;t[5]!==l?(I=l("settings.connectedProvidersSection.sectionTitle"),t[5]=l,t[6]=I):I=t[6];let y;t[7]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ct,{size:14}),t[7]=y):y=t[7];let o;t[8]!==l?(o=l("settings.connectedProvidersSection.connectButton"),t[8]=l,t[9]=o):o=t[9];let p;t[10]!==i||t[11]!==o?(p=s.jsxs(se,{size:"sm",onClick:i,children:[y,o]}),t[10]=i,t[11]=o,t[12]=p):p=t[12],c=s.jsx(Te,{title:I,headerClassName:"px-0",actions:p,children:f.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:l("settings.connectedProvidersSection.emptyState")}):s.jsx(Me,{children:f.map(ds)})}),t[0]=a?.providers,t[1]=n,t[2]=i,t[3]=l,t[4]=c}else c=t[4];return c}function ds(e){const{key:t,provider:i}=e;return s.jsx(ns,{providerKey:t,provider:i},t.id)}function ms(){const e=Z.c(55),t=le(),{org:i}=_e(),l=ce(),n=ke(),[a,c]=W.useState("");let r;e[0]!==i.id?(r=ie.claudeSubscription(i.id),e[0]=i.id,e[1]=r):r=e[1];let f;e[2]!==l?(f=()=>l.call("CLAUDE_SUBSCRIPTION_STATUS",{}),e[2]=l,e[3]=f):f=e[3];let I;e[4]!==r||e[5]!==f?(I={queryKey:r,queryFn:f},e[4]=r,e[5]=f,e[6]=I):I=e[6];const y=Re(I);let o;e[7]!==i.id||e[8]!==n?(o=()=>n.invalidateQueries({queryKey:ie.claudeSubscription(i.id)}),e[7]=i.id,e[8]=n,e[9]=o):o=e[9];const p=o;let m;e[10]!==l||e[11]!==a?(m=()=>l.call("CLAUDE_SUBSCRIPTION_CONNECT",{token:a}),e[10]=l,e[11]=a,e[12]=m):m=e[12];let u;e[13]!==p||e[14]!==t?(u=async()=>{c(""),await p(),ee.success(t("settings.claudeSubscription.connected"))},e[13]=p,e[14]=t,e[15]=u):u=e[15];let k;e[16]!==m||e[17]!==u?(k={mutationFn:m,onSuccess:u,onError:ps},e[16]=m,e[17]=u,e[18]=k):k=e[18];const x=ae(k);let v;e[19]!==l?(v=()=>l.call("CLAUDE_SUBSCRIPTION_DISCONNECT",{}),e[19]=l,e[20]=v):v=e[20];let g;e[21]!==p||e[22]!==t?(g=async()=>{await p(),ee.success(t("settings.claudeSubscription.disconnected"))},e[21]=p,e[22]=t,e[23]=g):g=e[23];let _;e[24]!==v||e[25]!==g?(_={mutationFn:v,onSuccess:g,onError:us},e[24]=v,e[25]=g,e[26]=_):_=e[26];const N=ae(_),h=y.data?.connected===!0,j=!h&&!!y.data?.linkedAt;let S;e[27]!==t?(S=t("settings.claudeSubscription.title"),e[27]=t,e[28]=S):S=e[28];let d;e[29]!==S?(d=s.jsx("p",{className:"text-base font-semibold",children:S}),e[29]=S,e[30]=d):d=e[30];let b;e[31]!==h||e[32]!==j||e[33]!==t?(b=t(h?"settings.claudeSubscription.active":j?"settings.claudeSubscription.expired":"settings.claudeSubscription.description"),e[31]=h,e[32]=j,e[33]=t,e[34]=b):b=e[34];let C;e[35]!==b?(C=s.jsx("p",{className:"text-sm text-muted-foreground",children:b}),e[35]=b,e[36]=C):C=e[36];let w;e[37]!==d||e[38]!==C?(w=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,C]}),e[37]=d,e[38]=C,e[39]=w):w=e[39];let R;e[40]!==h||e[41]!==N||e[42]!==t?(R=h?s.jsx(se,{variant:"outline",disabled:N.isPending,onClick:()=>N.mutate(),children:t("settings.claudeSubscription.disconnect")}):null,e[40]=h,e[41]=N,e[42]=t,e[43]=R):R=e[43];let A;e[44]!==w||e[45]!==R?(A=s.jsxs("div",{className:"flex items-center gap-4",children:[w,R]}),e[44]=w,e[45]=R,e[46]=A):A=e[46];let E;e[47]!==x||e[48]!==h||e[49]!==t||e[50]!==a?(E=h?null:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[t("settings.claudeSubscription.howTo")," ",s.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"claude setup-token"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ce,{type:"password",value:a,onChange:U=>c(U.target.value),placeholder:t("settings.claudeSubscription.tokenPlaceholder")}),s.jsx(se,{disabled:a.trim().length===0||x.isPending,onClick:()=>x.mutate(),children:t("settings.claudeSubscription.connect")})]})]}),e[47]=x,e[48]=h,e[49]=t,e[50]=a,e[51]=E):E=e[51];let M;return e[52]!==A||e[53]!==E?(M=s.jsxs("div",{className:"rounded-xl border border-border px-6 py-5 flex flex-col gap-4",children:[A,E]}),e[52]=A,e[53]=E,e[54]=M):M=e[54],M}function us(e){return ee.error(e.message)}function ps(e){return ee.error(e.message)}function fs(e){const t=Z.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(dt,{size:16}),t[0]=l):l=t[0];let n;return t[1]!==i.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=n):n=t[2],n}function gs(){const e=Z.c(27),t=Fe();let i;e[0]!==t?(i=as(t),e[0]=t,e[1]=i):i=e[1];const{hasInventory:l,hasHostedProvider:n,hasDeco:a}=i,[c,r]=W.useState(!1),[f,I]=W.useState(null),y=Je();let o;e[2]!==y?.providers?(o=y?.providers??[],e[2]=y?.providers,e[3]=o):o=e[3];const p=o;if(!n){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>r(!0),e[4]=_):_=e[4];let N;e[5]!==p?(N=s.jsx(yt,{providers:p,onSelect:I,onShowAll:_}),e[5]=p,e[6]=N):N=e[6];const h=f!==null||c;let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=w=>{w||(I(null),r(!1))},e[7]=j):j=e[7];const S=f??void 0;let d;e[8]!==h||e[9]!==S?(d=s.jsx($e,{open:h,onOpenChange:j,initialProvider:S}),e[8]=h,e[9]=S,e[10]=d):d=e[10];let b;e[11]!==l?(b=l?s.jsx(He,{onConnectClick:()=>r(!0)}):null,e[11]=l,e[12]=b):b=e[12];let C;return e[13]!==N||e[14]!==d||e[15]!==b?(C=s.jsxs(s.Fragment,{children:[N,d,b]}),e[13]=N,e[14]=d,e[15]=b,e[16]=C):C=e[16],C}let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-16 w-full"}),children:s.jsx(Vt,{})}),e[17]=m):m=e[17];let u;e[18]!==a?(u=a?s.jsx(Zt,{}):s.jsx(ss,{}),e[18]=a,e[19]=u):u=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ms,{}),e[20]=k):k=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(He,{onConnectClick:()=>r(!0)}),e[21]=x):x=e[21];let v;e[22]!==c?(v=s.jsx($e,{open:c,onOpenChange:r}),e[22]=c,e[23]=v):v=e[23];let g;return e[24]!==u||e[25]!==v?(g=s.jsxs(s.Fragment,{children:[m,u,k,x,v]}),e[24]=u,e[25]=v,e[26]=g):g=e[26],g}function hs(){const e=Z.c(7),t=le();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let l;e[2]!==i?(l=s.jsx(Ne.Title,{children:i}),e[2]=i,e[3]=l):l=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ct,{fallback:xs,children:s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-64 w-full"}),children:s.jsx(gs,{})})}),e[4]=n):n=e[4];let a;return e[5]!==l?(a=s.jsx(Ne,{children:s.jsx(Ne.Content,{children:s.jsx(Ne.Body,{children:s.jsxs(mt,{children:[l,n]})})})}),e[5]=l,e[6]=a):a=e[6],a}function xs(e){const{error:t}=e;return s.jsx(fs,{error:t??new Error("Failed to load AI providers")})}function ki(){const e=Z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(hs,{})}),e[0]=t):t=e[0],t}export{ki as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,m as o,j as c,bC as d}from"./index-
|
|
1
|
+
import{c as n,m as o,j as c,bC as d}from"./index-Bfy-Fe7V.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as r,cT as T,cV as w,aL as m,cX as A,dY as O,H as M,aN as I,cU as L,dZ as D,cW as z,d3 as F,aJ as Y,d5 as G,cY as H,c as n,m as p,U as v}from"./index-
|
|
1
|
+
import{r as i,j as r,cT as T,cV as w,aL as m,cX as A,dY as O,H as M,aN as I,cU as L,dZ as D,cW as z,d3 as F,aJ as Y,d5 as G,cY as H,c as n,m as p,U as v}from"./index-Bfy-Fe7V.js";var x="AlertDialog",[V]=Y(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t,modal:!0})};N.displayName=x;var W="AlertDialogTrigger",k=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(G,{...o,...a,ref:e})});k.displayName=W;var U="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=U;var q="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});_.displayName=q;var f="AlertDialogContent",[B,J]=V(f),X=F("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:h,docsSlug:"alert-dialog",children:r.jsx(B,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(X,{children:a}),r.jsx(K,{contentRef:c})]})})})});j.displayName=f;var h="AlertDialogTitle",b=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});b.displayName=h;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});R.displayName=E;var Z="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=Z;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=J($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var K=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Bt,b as kt,r as A,j as o,m as jt,k as _t,t as xt}from"./index-vEFJuUdN.js";import{i as wt}from"./ChevronRight-DwahmHLA.js";import{B as At}from"./automation-runs-BifnU8_i.js";import{u as Et,A as Nt}from"./use-section-preview-base-C0W9rmU4.js";import{A as Rt,B as Ct,C as Kt,D as Tt,F as Ft,G as Pt,H as $t,S as Ut,I as Ot,J as zt}from"./index-DC7whFuR.js";import"./select-Dez5FrF9.js";import"./tooltip-BUztXQ1W.js";import"./Check-CABzt6--.js";import"./ChevronDown-DsDzbrOb.js";import"./ChevronUp-DBUIuLI5.js";import"./agent-icon-CWBP36-h.js";import"./AlertCircle-iMFIwWNV.js";import"./Tool01-DStbcY86.js";import"./ArrowUp-DSxXxGdv.js";import"./ArrowLeft-CsWtY_gB.js";import"./Tool02-7YE_lsQ5.js";import"./XCircle-Cpx4dopB.js";import"./ArrowUpRight-erfF6BcP.js";import"./TrendUp01-C6JwA-Np.js";import"./ZapSquare-kC-fhZGr.js";import"./Users03-Dqls41gn.js";import"./CheckCircle-N8333lb0.js";import"./DotsVertical-BRYCw47k.js";import"./Stars02-B08-JGxx.js";import"./Copy01-B995BWXi.js";import"./CpuChip01-lt7Rkp-U.js";import"./CreditCard01-GxtaywC9.js";import"./Globe01-0reGbJcL.js";import"./Settings02-C9fJkEJh.js";import"./Eye-Clu-LouG.js";import"./FilterLines-CNzwsg4F.js";import"./Share07-DS8-754J.js";import"./Star01-CwL23CRL.js";import"./Globe04-sue1ujzC.js";import"./SwitchHorizontal01-ChVU7SWq.js";import"./HardDrive-CuFY6j2o.js";import"./Key01-C8zGItpI.js";import"./LayoutLeft-BowuBtX2.js";import"./LinkExternal01-B3QGOPZ8.js";import"./LogOut01-CwZ1Y9u4.js";import"./Monitor01-Bni1e5h7.js";import"./Sun-kp4es37w.js";import"./Palette-B6o-2LWT.js";import"./Play-BC8nRLNF.js";import"./Plus-BPZja4FC.js";import"./SearchLg-CGtAP5EH.js";import"./SearchMd-BVrWvjH3.js";import"./Shield01-CrVGBhuR.js";import"./Stars01-D94NieJP.js";import"./Trash01-DGt8nZn9.js";import"./Upload01-DgSyem4d.js";import"./User01-CPSa9S2T.js";import"./Users01-DUxHx9ib.js";import"./XClose-3fY-ChCg.js";import"./X-CseWQ5OZ.js";import"./Zap-B6D2E55F.js";import"./useInfiniteQuery-Hwy4ey-5.js";import"./use-infinite-scroll-DKJxpa0X.js";import"./use-connection-C57YbTcG.js";import"./use-mcp-client-lJgGp2B_.js";import"./auth-ANCOmttW.js";import"./use-virtual-mcp-DKb7Fyg4.js";import"./card-lxFop9oJ.js";import"./sidebar-BXJraWph.js";import"./use-mobile-WXO34F35.js";import"./table-7K7oqOU1.js";import"./empty-state-D7Q_5Yzc.js";import"./use-members-BDcNIFeP.js";import"./use-org-auth-client-CO9ez288.js";import"./use-clock-tick-iKIdVntg.js";import"./use-automations-CfmioFHT.js";import"./studio-tools-CBUmjJWM.js";import"./useSuspenseInfiniteQuery-CdsuGwEV.js";import"./avatar-CPIgr7-p.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B7m5krwW.js";import"./dialog-CF1cQ1rb.js";import"./tab-id-DdzeNQQR.js";import"./hooks-CJA4VXgB.js";import"./decopilot-sse-pool-Cvk81TxT.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-CV2ibxPd.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-B0Xkp5BB.js";import"./use-decopilot-events-9EcaK7qN.js";import"./use-organization-settings-CgP5KHWU.js";import"./monaco-editor-DXyVTFn_.js";import"./spinner-CppnwMRY.js";import"./index-CjTnqBk_.js";import"./shell-layout-Udqd-jvd.js";import"./required-auth-layout-_hvJxMv_.js";import"./use-org-sso-BORI0Gqf.js";import"./integration-icon-Hw_CmlIO.js";import"./use-navigate-to-agent-_rWnI-Xt.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-GCRS_-AP.js";import"./form-D6GqaWU9.js";import"./label-DfGzQmB5.js";import"./input-5e_3GJtI.js";import"./file-type-icon-BBtbE_NU.js";import"./drawer-DfRIJaDr.js";import"./collection-search-BzYqusXY.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-mQsLl4zR.js";import"./toggle-group-De9TzUcu.js";import"./use-deco-credits-9r63SN2F.js";import"./popover-DlPz4To4.js";import"./self-tool-result-CEBp4imh.js";import"./alert-dialog-Xn8LpVc8.js";import"./extract-connection-data-sVdeut_9.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-CEYSL9GY.js";import"./authenticate-and-persist-oauth-C-JqvyRh.js";import"./mcp-oauth-OIUxe3g2.js";import"./track-BdasaloK.js";import"./toolbar-BgPfvPzL.js";import"./skeleton-pl0N1Ino.js";import"./github-repo-picker-yxnDF_Mi.js";import"./use-mcp-tools-CMs4Nd8q.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-D-cmYmCq.js";import"./use-registry-connections-C45H6T-8.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-B-bmHFzf.js";import"./connection-form-helpers-DFqceUmS.js";import"./collection-tabs-Di0fmDNx.js";import"./badge-BoP7NhL_.js";import"./use-open-billing-url-CtUM2rs7.js";import"./select-model-CR0-6PXS.js";import"./checkbox-ZpkUR1gq.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DPTzp_P_.js";import"./cards-S5FAmKUB.js";import"./dropdown-menu-AkajeJh4.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B8tGf8un.js";import"./use-capability-D7eAS5np.js";import"./pt-BR-CLy76QW2.js";import"./switch-By_6CkwD.js";import"./use-debounced-autosave--SMcEphJ.js";import"./index-EI3Ugq-F.js";import"./search-input-Bao8w6Sm.js";import"./index-Al4HY1a3.js";import"./use-secrets-QG_xgP3_.js";import"./use-tags-DyMD1IY8.js";import"./get-initials-D-f_fDFw.js";import"./command-Bemo-h0S.js";import"./index-C3vGEoWV.js";import"./use-file-configs-BWwvZiOJ.js";import"./automation-list-row-BcUdJrVC.js";function It(n,t){const s=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",m=Rt(t,i);return{blockKey:m,data:{__resolveType:n.resolveType,name:m}}}function $r(n){const t=Bt.c(78),{orgSlug:s,virtualMcpId:i,branch:m,blockKey:p,block:x,meta:a,decofile:l,title:ht,excludeFields:H,schemaPending:nt,previewBaseUrl:lt}=n,M=nt===void 0?!1:nt,Z=lt===void 0?null:lt,c=kt();let N;t[0]!==Z||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:Z},t[0]=Z,t[1]=i,t[2]=N):N=t[2];const h=Et(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==H||t[4]!==a||t[5]!==v?(R=Ct(v,a,H),t[3]=H,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let C;t[7]!==b?(C=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=C):C=t[8];const G=C,ct=ht??(x?Kt(p,x,a):p);let K;t[9]!==m||t[10]!==s||t[11]!==i?(K={orgSlug:s,virtualMcpId:i,branch:m},t[9]=m,t[10]=s,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:J,isPending:Q}=Tt(K);let T;t[13]!==m||t[14]!==s||t[15]!==i?(T={orgSlug:s,virtualMcpId:i,branch:m},t[13]=m,t[14]=s,t[15]=i,t[16]=T):T=t[16];const W=Ft(T);let F;t[17]!==S?(F=Ot((e,r)=>S(e,r)),t[17]=S,t[18]=F):F=t[18];const X=F,[bt,vt]=A.useState(p),[Y,dt]=A.useState(null),[tt,ut]=A.useState(0);let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[19]=P):P=t[19];const[g,ft]=A.useState(P),[et,d]=A.useState(!1),$=A.useRef(null);bt!==p&&(vt(p),dt(null),ut(Vt),ft([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const ot=U;let y;t[22]!==Y?(y=Y??{},t[22]=Y,t[23]=y):y=t[23];let O;t[24]!==ot||t[25]!==y?(O={...ot,...y},t[24]=ot,t[25]=y,t[26]=O):O=t[26];const rt=O;let z;t[27]!==p||t[28]!==v||t[29]!==S?(z=e=>{const r=e;dt(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=z):z=t[30];const it=z;let I;t[31]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{ft(e)},t[31]=I):I=t[31];const E=I;let L;t[32]!==l||t[33]!==J||t[34]!==W||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=It(e,l);await W.mutateAsync({blockKey:u,data:f}),xt.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),J()}catch(u){const f=u,yt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw xt.error(yt),f}},t[32]=l,t[33]=J,t[34]=W,t[35]=c,t[36]=L):L=t[36];const B=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==B||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await B(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=B,t[40]=d,t[41]=q):q=t[41];const mt=q,pt=g.length>0?[ct,...g]:[],St="flex h-full flex-col",gt="flex h-12 shrink-0 items-center justify-between border-b px-6",at=pt.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:pt.map((e,r)=>{const u=r===pt.length-1,f=Pt(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(wt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:$t(g,r)),ut(Lt)},title:f,className:jt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:ct});let k;t[42]!==Q?(k=o.jsx(zt,{isPending:Q,isError:!1}),t[42]=Q,t[43]=k):k=t[43];let j;t[44]!==at||t[45]!==k?(j=o.jsxs("div",{className:gt,children:[at,k]}),t[44]=at,t[45]=k,t[46]=j):j=t[46];let _;t[47]!==p||t[48]!==m||t[49]!==g||t[50]!==l||t[51]!==rt||t[52]!==tt||t[53]!==B||t[54]!==E||t[55]!==it||t[56]!==st||t[57]!==G||t[58]!==a||t[59]!==s||t[60]!==X||t[61]!==b||t[62]!==M||t[63]!==h||t[64]!==c||t[65]!==i?(_=o.jsx(At,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:G?o.jsx(Ut,{schema:b,value:rt,onChange:it,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:X,previewBaseUrl:h,onAddSectionItem:B,onRequestAddSection:st,sandbox:{orgSlug:s,virtualMcpId:i,branch:m}},`${p}:${tt}`):M?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=m,t[49]=g,t[50]=l,t[51]=rt,t[52]=tt,t[53]=B,t[54]=E,t[55]=it,t[56]=st,t[57]=G,t[58]=a,t[59]=s,t[60]=X,t[61]=b,t[62]=M,t[63]=h,t[64]=c,t[65]=i,t[66]=_):_=t[66];let w;t[67]!==et||t[68]!==l||t[69]!==mt||t[70]!==a||t[71]!==h||t[72]!==d?(w=h&&o.jsx(Nt,{open:et,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{mt(e)}}),t[67]=et,t[68]=l,t[69]=mt,t[70]=a,t[71]=h,t[72]=d,t[73]=w):w=t[73];let D;return t[74]!==j||t[75]!==_||t[76]!==w?(D=o.jsxs("div",{className:St,children:[j,_,w]}),t[74]=j,t[75]=_,t[76]=w,t[77]=D):D=t[77],D}function Lt(n){return n+1}function Vt(n){return n+1}export{$r as AppEditor};
|
|
1
|
+
import{c as Bt,b as kt,r as A,j as o,m as jt,k as _t,t as xt}from"./index-Bfy-Fe7V.js";import{i as wt}from"./ChevronRight-Cux_llMB.js";import{B as At}from"./automation-runs-DeLRBvkt.js";import{u as Et,A as Nt}from"./use-section-preview-base-B2DzWzr2.js";import{A as Rt,B as Ct,C as Kt,D as Tt,F as Ft,G as Pt,H as $t,S as Ut,I as Ot,J as zt}from"./index-BEYzla8F.js";import"./select-wwJ8EUoY.js";import"./tooltip-F9SMeJ-j.js";import"./Check-CeB_ZeLq.js";import"./ChevronDown-CGwhMiqT.js";import"./ChevronUp-3dsPU76D.js";import"./agent-icon-D_vHJRnE.js";import"./AlertCircle-BMPkNMGJ.js";import"./Tool01-DMQJZ6a0.js";import"./ArrowUp-Cmxc5KIG.js";import"./ArrowLeft-Bo0FpGQs.js";import"./Tool02-CZZOjaKh.js";import"./XCircle-DOtlBDfF.js";import"./ArrowUpRight-OVKS4c5s.js";import"./TrendUp01-CYPiI6vW.js";import"./ZapSquare-GHgi4Hl7.js";import"./Users03-C0P658nm.js";import"./CheckCircle-C9SAYY-W.js";import"./DotsVertical-9U5tOb04.js";import"./Stars02-2eb3r8Gu.js";import"./Copy01-CXcHnxi0.js";import"./CpuChip01-CGpR8wkh.js";import"./CreditCard01-DSA6UjMO.js";import"./Globe01-Cm-V-gHj.js";import"./Settings02-DBlt8Mfk.js";import"./Eye-DXWAJYKq.js";import"./FilterLines-DZrlB4Kh.js";import"./Share07-C1_p27Hs.js";import"./Star01-ClwU4gOx.js";import"./Globe04-m1tzMty0.js";import"./SwitchHorizontal01-D0Mi7oaK.js";import"./HardDrive-Dvps78YO.js";import"./Key01-DY7yaq7L.js";import"./LayoutLeft-C0u89h3U.js";import"./LinkExternal01-CLr9HZg0.js";import"./LogOut01-BeE1lxGA.js";import"./Monitor01-RiuZmvGS.js";import"./Sun-m3RjKnDt.js";import"./Palette-C8S3zMtK.js";import"./Play-B8V74CpU.js";import"./Plus-CGrXNe_q.js";import"./SearchLg-DrUBeTI6.js";import"./SearchMd-DFwCvkV1.js";import"./Shield01-CZr-J1Qk.js";import"./Stars01-jLom0LSv.js";import"./Trash01-BCoCDH0H.js";import"./Upload01-mvF19nky.js";import"./User01-UnLfhP79.js";import"./Users01-BGTUZMIA.js";import"./XClose-BoiJoxeV.js";import"./X-CId2-nhW.js";import"./Zap-C6ApHWIY.js";import"./useInfiniteQuery-DuCyL_is.js";import"./use-infinite-scroll-BMPCHIFs.js";import"./use-connection-niAftPf5.js";import"./use-mcp-client-CMZDCFwV.js";import"./auth-BcPAS4K5.js";import"./use-virtual-mcp-CvLFbjo1.js";import"./card-GrGBYBXG.js";import"./sidebar-CusUIOZL.js";import"./use-mobile-RWxooM53.js";import"./table-DwuSaCi4.js";import"./empty-state-tOcrn7Ci.js";import"./use-members-CNN6Y-Zt.js";import"./use-org-auth-client-hxCPh-jf.js";import"./use-clock-tick-CFTIWs0c.js";import"./use-automations-DoX-Tmqm.js";import"./studio-tools-BBDHxwPb.js";import"./useSuspenseInfiniteQuery-ByQ627dx.js";import"./avatar-CKAwkvrw.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C8wJsCEn.js";import"./dialog-7h2q_S_D.js";import"./tab-id-BtKEoC5y.js";import"./hooks-BTTh4oan.js";import"./decopilot-sse-pool-CYVKd86r.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-cK_4I7Xc.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-NYX7QSgc.js";import"./use-decopilot-events-UAWY9DUq.js";import"./use-organization-settings-CmS9ohCu.js";import"./monaco-editor-a45QrHzb.js";import"./spinner-Cq2vfE1B.js";import"./index-GMtytQiz.js";import"./shell-layout-C7FmlawD.js";import"./required-auth-layout-BFPFAQoy.js";import"./use-org-sso-FYR_uf1o.js";import"./integration-icon-BbWY9vfD.js";import"./use-navigate-to-agent-ChzmcYSy.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-488R_nQ_.js";import"./form-FE1JRkSu.js";import"./label-Dplc1_oE.js";import"./input-BVD_WyXJ.js";import"./file-type-icon-CpiTVpKx.js";import"./drawer-WhUz4erM.js";import"./collection-search-Cwveue76.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-CIxl9qVO.js";import"./toggle-group-znNdMK--.js";import"./use-deco-credits-De3PrmGo.js";import"./popover-DigaZ5Sb.js";import"./self-tool-result-Cch-sPi1.js";import"./alert-dialog-BgN-Tqd-.js";import"./extract-connection-data-BKY0ec6n.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-BolYSN9R.js";import"./authenticate-and-persist-oauth-COCTTCRF.js";import"./mcp-oauth-Bi0vxp4Q.js";import"./track-CQoHeM9p.js";import"./toolbar-CdII6jdL.js";import"./skeleton-Dd2jseki.js";import"./github-repo-picker-BId4yHDh.js";import"./use-mcp-tools-DcIN6xvI.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-BoEQ2uqc.js";import"./use-registry-connections-CvNGLAr0.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BkOjJMTl.js";import"./connection-form-helpers-DB6bc0s9.js";import"./collection-tabs-DMyjVQaZ.js";import"./badge-CxlSzoE1.js";import"./use-open-billing-url-XDJk2wdH.js";import"./select-model-BpUI37HY.js";import"./checkbox-DjytOswq.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CfhHwu3l.js";import"./cards-DY2u3Spm.js";import"./dropdown-menu-D3TVm231.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-UrQRxkaM.js";import"./use-capability-DssZIcHp.js";import"./pt-BR-CLy76QW2.js";import"./switch-CAjDqeuV.js";import"./use-debounced-autosave-CGiNF_NH.js";import"./index-D5KNWpFX.js";import"./search-input--fbtpx3Q.js";import"./index-BEPKcH_a.js";import"./use-secrets-B-jc_6m7.js";import"./use-tags-opYrp-Zi.js";import"./get-initials-D-f_fDFw.js";import"./command-DktWLnIE.js";import"./index-Bqv-pFdx.js";import"./use-file-configs-Cq0JL4Et.js";import"./automation-list-row-BYFAi_YA.js";function It(n,t){const s=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",m=Rt(t,i);return{blockKey:m,data:{__resolveType:n.resolveType,name:m}}}function $r(n){const t=Bt.c(78),{orgSlug:s,virtualMcpId:i,branch:m,blockKey:p,block:x,meta:a,decofile:l,title:ht,excludeFields:H,schemaPending:nt,previewBaseUrl:lt}=n,M=nt===void 0?!1:nt,Z=lt===void 0?null:lt,c=kt();let N;t[0]!==Z||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:Z},t[0]=Z,t[1]=i,t[2]=N):N=t[2];const h=Et(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==H||t[4]!==a||t[5]!==v?(R=Ct(v,a,H),t[3]=H,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let C;t[7]!==b?(C=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=C):C=t[8];const G=C,ct=ht??(x?Kt(p,x,a):p);let K;t[9]!==m||t[10]!==s||t[11]!==i?(K={orgSlug:s,virtualMcpId:i,branch:m},t[9]=m,t[10]=s,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:J,isPending:Q}=Tt(K);let T;t[13]!==m||t[14]!==s||t[15]!==i?(T={orgSlug:s,virtualMcpId:i,branch:m},t[13]=m,t[14]=s,t[15]=i,t[16]=T):T=t[16];const W=Ft(T);let F;t[17]!==S?(F=Ot((e,r)=>S(e,r)),t[17]=S,t[18]=F):F=t[18];const X=F,[bt,vt]=A.useState(p),[Y,dt]=A.useState(null),[tt,ut]=A.useState(0);let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[19]=P):P=t[19];const[g,ft]=A.useState(P),[et,d]=A.useState(!1),$=A.useRef(null);bt!==p&&(vt(p),dt(null),ut(Vt),ft([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const ot=U;let y;t[22]!==Y?(y=Y??{},t[22]=Y,t[23]=y):y=t[23];let O;t[24]!==ot||t[25]!==y?(O={...ot,...y},t[24]=ot,t[25]=y,t[26]=O):O=t[26];const rt=O;let z;t[27]!==p||t[28]!==v||t[29]!==S?(z=e=>{const r=e;dt(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=z):z=t[30];const it=z;let I;t[31]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{ft(e)},t[31]=I):I=t[31];const E=I;let L;t[32]!==l||t[33]!==J||t[34]!==W||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=It(e,l);await W.mutateAsync({blockKey:u,data:f}),xt.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),J()}catch(u){const f=u,yt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw xt.error(yt),f}},t[32]=l,t[33]=J,t[34]=W,t[35]=c,t[36]=L):L=t[36];const B=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==B||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await B(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=B,t[40]=d,t[41]=q):q=t[41];const mt=q,pt=g.length>0?[ct,...g]:[],St="flex h-full flex-col",gt="flex h-12 shrink-0 items-center justify-between border-b px-6",at=pt.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:pt.map((e,r)=>{const u=r===pt.length-1,f=Pt(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(wt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:$t(g,r)),ut(Lt)},title:f,className:jt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:ct});let k;t[42]!==Q?(k=o.jsx(zt,{isPending:Q,isError:!1}),t[42]=Q,t[43]=k):k=t[43];let j;t[44]!==at||t[45]!==k?(j=o.jsxs("div",{className:gt,children:[at,k]}),t[44]=at,t[45]=k,t[46]=j):j=t[46];let _;t[47]!==p||t[48]!==m||t[49]!==g||t[50]!==l||t[51]!==rt||t[52]!==tt||t[53]!==B||t[54]!==E||t[55]!==it||t[56]!==st||t[57]!==G||t[58]!==a||t[59]!==s||t[60]!==X||t[61]!==b||t[62]!==M||t[63]!==h||t[64]!==c||t[65]!==i?(_=o.jsx(At,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:G?o.jsx(Ut,{schema:b,value:rt,onChange:it,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:X,previewBaseUrl:h,onAddSectionItem:B,onRequestAddSection:st,sandbox:{orgSlug:s,virtualMcpId:i,branch:m}},`${p}:${tt}`):M?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=m,t[49]=g,t[50]=l,t[51]=rt,t[52]=tt,t[53]=B,t[54]=E,t[55]=it,t[56]=st,t[57]=G,t[58]=a,t[59]=s,t[60]=X,t[61]=b,t[62]=M,t[63]=h,t[64]=c,t[65]=i,t[66]=_):_=t[66];let w;t[67]!==et||t[68]!==l||t[69]!==mt||t[70]!==a||t[71]!==h||t[72]!==d?(w=h&&o.jsx(Nt,{open:et,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{mt(e)}}),t[67]=et,t[68]=l,t[69]=mt,t[70]=a,t[71]=h,t[72]=d,t[73]=w):w=t[73];let D;return t[74]!==j||t[75]!==_||t[76]!==w?(D=o.jsxs("div",{className:St,children:[j,_,w]}),t[74]=j,t[75]=_,t[76]=w,t[77]=D):D=t[77],D}function Lt(n){return n+1}function Vt(n){return n+1}export{$r as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cB as v,cC as $,cD as W,cE as L,cF as H,cG as D,cH as V,cI as x,cJ as q,cK as j,cL as y,cM as N,cN as B,cO as F,cP as Z}from"./index-vEFJuUdN.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Y(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Y(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,T as b,me as c,P as d,Ue as e};
|
|
1
|
+
import{cB as v,cC as $,cD as W,cE as L,cF as H,cG as D,cH as V,cI as x,cJ as q,cK as j,cL as y,cM as N,cN as B,cO as F,cP as Z}from"./index-Bfy-Fe7V.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Y(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Y(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,T as b,me as c,P as d,Ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-
|
|
1
|
+
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-Bfy-Fe7V.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
|