decocms 4.92.3 → 4.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-B9GlbKHh.js → AlertCircle-C1QMMByE.js} +1 -1
- package/dist/client/assets/{AreaChart-DHN9bK0l.js → AreaChart-q7Xrveeh.js} +1 -1
- package/dist/client/assets/ArrowRight-CMDrgznR.js +1 -0
- package/dist/client/assets/{ArrowUp-DNZsq7Zt.js → ArrowUp-DH3o_6rV.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DZZygrAi.js → ArrowUpRight-ChAriHcE.js} +1 -1
- package/dist/client/assets/Check-CfdDVvTz.js +1 -0
- package/dist/client/assets/{CheckCircle-BEcdXH7-.js → CheckCircle-DLrShk9W.js} +1 -1
- package/dist/client/assets/{ChevronDown-BSRiDjXd.js → ChevronDown-BRbMyZ1B.js} +1 -1
- package/dist/client/assets/{ChevronRight-YmTewr_B.js → ChevronRight-Ck0jEpLN.js} +1 -1
- package/dist/client/assets/ChevronUp-BT9WG4FQ.js +1 -0
- package/dist/client/assets/{Copy01-BkGYkmm-.js → Copy01-Du_h2a2a.js} +1 -1
- package/dist/client/assets/{DotsVertical-BmTi7wpl.js → DotsVertical-DuorjQq1.js} +1 -1
- package/dist/client/assets/{Eye-B-ZfWIGj.js → Eye-IdG-7KTy.js} +1 -1
- package/dist/client/assets/{FilterLines-BwWG7tAk.js → FilterLines-VrXrRt9f.js} +1 -1
- package/dist/client/assets/{Globe01-D3vBqhI7.js → Globe01-FT_j78GO.js} +1 -1
- package/dist/client/assets/{Globe04-pvxBukgJ.js → Globe04-BktKmpI1.js} +1 -1
- package/dist/client/assets/{HardDrive-DutZPQFL.js → HardDrive-y6RDSyxS.js} +1 -1
- package/dist/client/assets/{Image01-PIeYnf-K.js → Image01-jwttKGpp.js} +1 -1
- package/dist/client/assets/{Key01-DhLD806C.js → Key01-CTHo646W.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BI-sXAac.js → LayoutLeft-DDdEDKm1.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DO3QnLus.js → LinkExternal01-Dw89NskH.js} +1 -1
- package/dist/client/assets/{Monitor01-BOILvS2u.js → Monitor01-D8aw2U1c.js} +1 -1
- package/dist/client/assets/{Package-DbEcG94t.js → Package-Bl4wI6gQ.js} +1 -1
- package/dist/client/assets/{Palette-CyZvWKmI.js → Palette-Bb5lq-lb.js} +1 -1
- package/dist/client/assets/{Play-B8fWmOst.js → Play-h_GYgW2i.js} +1 -1
- package/dist/client/assets/{Plus-2c1jULco.js → Plus-DW8HTiM4.js} +1 -1
- package/dist/client/assets/{SearchLg-XmvudKlH.js → SearchLg-CuxPI6CH.js} +1 -1
- package/dist/client/assets/{SearchMd-lwIiBODG.js → SearchMd-B_vHLGSV.js} +1 -1
- package/dist/client/assets/{Settings02-DMpqOK24.js → Settings02-DkDTX6wF.js} +1 -1
- package/dist/client/assets/{Shield01-gTFc9c17.js → Shield01-BTjWMfyt.js} +1 -1
- package/dist/client/assets/{Star01-DoUbKevt.js → Star01-IywRndO8.js} +1 -1
- package/dist/client/assets/{Stars01-CJsm_THn.js → Stars01-awBCSC7p.js} +1 -1
- package/dist/client/assets/{Stars02-B08FvcHQ.js → Stars02-CWszz6x7.js} +1 -1
- package/dist/client/assets/{Sun-nDXz4jeM.js → Sun-CKE25B6W.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Rgis0XWf.js → SwitchHorizontal01-mvedp9Fy.js} +1 -1
- package/dist/client/assets/{Tool01-BR3IBeV9.js → Tool01-CiB1AgGO.js} +1 -1
- package/dist/client/assets/{Tool02-B0-a0UMl.js → Tool02-DatlcCMD.js} +1 -1
- package/dist/client/assets/{Trash01-Ba6bCbNY.js → Trash01-BFrDxOoF.js} +1 -1
- package/dist/client/assets/{TrendUp01-CeRF_789.js → TrendUp01-CtjoH8ZL.js} +1 -1
- package/dist/client/assets/{Upload01-B14IruoN.js → Upload01-BbY627dR.js} +1 -1
- package/dist/client/assets/{User01-ByIE6k8L.js → User01-JYrKFpRC.js} +1 -1
- package/dist/client/assets/{Users01-BdldAr7H.js → Users01-C_vPeB-O.js} +1 -1
- package/dist/client/assets/{Users03-Bx4g7VTC.js → Users03-uSqerTaX.js} +1 -1
- package/dist/client/assets/{X-Dif5I5BD.js → X-BWhzmnUU.js} +1 -1
- package/dist/client/assets/XCircle-C1KpQxmr.js +1 -0
- package/dist/client/assets/{XClose-DomD4542.js → XClose-CVT1rN5P.js} +1 -1
- package/dist/client/assets/{Zap-CEUVQQOc.js → Zap-yAX2Kmmw.js} +1 -1
- package/dist/client/assets/{ZapSquare-EvC2T9CP.js → ZapSquare-BrF3B-Lj.js} +1 -1
- package/dist/client/assets/{ZoomOut-BprgOfkE.js → ZoomOut-HpkK_jz9.js} +1 -1
- package/dist/client/assets/{access-gate-NCJKEJqO.js → access-gate-DNuevEtG.js} +1 -1
- package/dist/client/assets/add-section-modal-WI9lCqFk.js +1 -0
- package/dist/client/assets/agent-icon-C6bqiv4x.js +1 -0
- package/dist/client/assets/agents-list-CE_MFd_Q.js +1 -0
- package/dist/client/assets/ai-providers-Mqj9mjNl.js +1 -0
- package/dist/client/assets/{alert-C_4AvGUo.js → alert-C26tfGUe.js} +1 -1
- package/dist/client/assets/{alert-dialog-DDtUbhoS.js → alert-dialog-BeSbCM7Y.js} +2 -2
- package/dist/client/assets/app-editor-YNDE1p_g.js +1 -0
- package/dist/client/assets/{auth-CsHQFHV_.js → auth-C9enaQvD.js} +1 -1
- package/dist/client/assets/{auth-catchall-_TQy6GDd.js → auth-catchall-v4deh7e8.js} +1 -1
- package/dist/client/assets/{auth-entry-_ePf9_J1.js → auth-entry-C5zoJOD9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D9UYTbxy.js → auth-split-layout-Fi3vrH81.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CEv4KtcH.js → authenticate-and-persist-oauth-pF30Ku2c.js} +1 -1
- package/dist/client/assets/{automation-list-row-CyDHI_uf.js → automation-list-row-CAdX-w7a.js} +1 -1
- package/dist/client/assets/{automation-runs-D8v8nlly.js → automation-runs-CA0Zbin0.js} +5 -5
- package/dist/client/assets/automations-B-DWN4QS.js +1 -0
- package/dist/client/assets/{autosend-BgYoPuWD.js → autosend-CxPf5RKw.js} +1 -1
- package/dist/client/assets/{avatar-BVdHZbMN.js → avatar-CMlDI2D-.js} +1 -1
- package/dist/client/assets/{badge-C_9mnuBd.js → badge-BIKuZNrQ.js} +1 -1
- package/dist/client/assets/{block-document-CcMdXbqY.js → block-document-BioV5ZZf.js} +1 -1
- package/dist/client/assets/{brand-context-B-nZCoNx.js → brand-context-BphHJ3m4.js} +1 -1
- package/dist/client/assets/buckets-DhtwEFa3.js +1 -0
- package/dist/client/assets/bulk-category-panel-ChriKUsA.js +1 -0
- package/dist/client/assets/{calendar-Bxkf6gvE.js → calendar-CcmR6PZG.js} +1 -1
- package/dist/client/assets/{capability-load-error-i6NCyxxk.js → capability-load-error-Bn3urkKl.js} +1 -1
- package/dist/client/assets/{card-C3gg1LtP.js → card-Dd8gUiG_.js} +1 -1
- package/dist/client/assets/category-editor-DI3VJHNG.js +1 -0
- package/dist/client/assets/{chat-context-DSveBxCg.js → chat-context-Bn6Q6CeX.js} +12 -12
- package/dist/client/assets/checkbox-D0oew71k.js +1 -0
- package/dist/client/assets/{cli-auth-success-Cc2B25iW.js → cli-auth-success-ejQ9leoQ.js} +1 -1
- package/dist/client/assets/collection-detail-BwkpwNjs.js +1 -0
- package/dist/client/assets/collection-display-button-C1K9dOzY.js +1 -0
- package/dist/client/assets/{collection-search-TcSAZpqK.js → collection-search-B_OixFPO.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-H4bzUKoO.js → collection-table-wrapper-CKE2AAdw.js} +1 -1
- package/dist/client/assets/{collection-tabs-CIRa_M2W.js → collection-tabs-BbylyFFO.js} +1 -1
- package/dist/client/assets/{command-3z1R7bvy.js → command-CBlINdWQ.js} +1 -1
- package/dist/client/assets/commerce-onboarding-DOHVN1dn.js +1 -0
- package/dist/client/assets/{companions-core-C68sN4Wc.js → companions-core-CBtA8C2P.js} +1 -1
- package/dist/client/assets/connect-B_w51Pf2.js +8 -0
- package/dist/client/assets/connect-desktop-dialog-CS8xcpUf.js +1 -0
- package/dist/client/assets/{connection-card-D_K36Swx.js → connection-card-DgbR5Mwx.js} +1 -1
- package/dist/client/assets/connection-detail-BOoPBRpC.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DyOAEqE9.js → connection-form-helpers-DKOWpJ-1.js} +1 -1
- package/dist/client/assets/connections-C4oqxMQG.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-CEQrv8Fn.js → decopilot-sse-pool-D92X3fNc.js} +1 -1
- package/dist/client/assets/{dialog-DUqhzGiD.js → dialog-a73gSkG2.js} +1 -1
- package/dist/client/assets/{domain-settings-CRIqu0Bs.js → domain-settings-DkMlfYSa.js} +1 -1
- package/dist/client/assets/{drawer-DvhdIHph.js → drawer-BU_sOAKq.js} +1 -1
- package/dist/client/assets/dropdown-menu-QheVZMJA.js +1 -0
- package/dist/client/assets/{empty-state-BHuw6cM9.js → empty-state-CMGZe-XE.js} +1 -1
- package/dist/client/assets/{extract-connection-data-_NDoBHMa.js → extract-connection-data-DB1JAVkl.js} +1 -1
- package/dist/client/assets/file-explorer-BjIj9REP.js +2 -0
- package/dist/client/assets/{file-type-icon-BOCZKON3.js → file-type-icon-D7Qv-wcj.js} +1 -1
- package/dist/client/assets/{files-CelFf8dg.js → files-BSWFZOxo.js} +1 -1
- package/dist/client/assets/{form-C9InGmo4.js → form-hOrojcOx.js} +1 -1
- package/dist/client/assets/general-CNP1ZbZe.js +1 -0
- package/dist/client/assets/{github-repo-picker-Biy9UFu8.js → github-repo-picker-BlPGLfgP.js} +1 -1
- package/dist/client/assets/{hooks-DU-2h9eZ.js → hooks-Ck4NS0BB.js} +1 -1
- package/dist/client/assets/index-B5Jok_EG.js +1 -0
- package/dist/client/assets/index-B7jBuFkn.css +1 -0
- package/dist/client/assets/index-BK8i2815.js +1 -0
- package/dist/client/assets/{index-f6gbzJ8b.js → index-BPUUTwje.js} +1 -1
- package/dist/client/assets/{index-DBhNC4I_.js → index-BZIMlfJW.js} +1 -1
- package/dist/client/assets/{index-DnrPO2j2.js → index-Bm76WXPR.js} +1 -1
- package/dist/client/assets/{index-DmhdwAgP.js → index-CIFSbzEF.js} +14 -14
- package/dist/client/assets/{index-BOgwoJjn.js → index-CISUQ4JK.js} +1 -1
- package/dist/client/assets/{index-CbhDnqOu.js → index-CSvkeXqd.js} +1 -1
- package/dist/client/assets/{index-Du80fsxC.js → index-Cotl-Dca.js} +5 -5
- package/dist/client/assets/index-CufVwosA.js +8 -0
- package/dist/client/assets/{index-CO3868Cu.js → index-D1R93mn_.js} +1 -1
- package/dist/client/assets/{index-DivFugQC.js → index-DPgVKNjM.js} +1 -1
- package/dist/client/assets/{index-nNhZx5bw.js → index-QQfVHF6c.js} +14 -14
- package/dist/client/assets/{index-Cs6hIS7C.js → index-UORAMw49.js} +3 -3
- package/dist/client/assets/{index-redirect-hJFu02mm.js → index-redirect-B3FtJ7Sm.js} +1 -1
- package/dist/client/assets/{input-TkvVVsQL.js → input-COKCWjWn.js} +1 -1
- package/dist/client/assets/{integration-icon-CWb3OXTV.js → integration-icon-8ogu7iqA.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BA1mFY2X.js → invite-member-dialog-BSRSJdKr.js} +1 -1
- package/dist/client/assets/{label-CB2o7dZ2.js → label-BCtHDi1-.js} +1 -1
- package/dist/client/assets/{layout-CqMMMVMm.js → layout-D82AWRF8.js} +1 -1
- package/dist/client/assets/{login-B0EX352Z.js → login-CmLx6gdY.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B5rKpHdd.js → mcp-oauth-C4qKLSfa.js} +1 -1
- package/dist/client/assets/members-CdsfSF6n.js +1 -0
- package/dist/client/assets/{monaco-editor-DfuNvLfy.js → monaco-editor-1CxGfHM9.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B43TP1bq.js → monitoring-stats-row-CJ1mx9EI.js} +1 -1
- package/dist/client/assets/{multi-select-DhXl88EK.js → multi-select-vlgbaYWz.js} +1 -1
- package/dist/client/assets/{oauth-callback-CZ8I3e9V.js → oauth-callback-Dd9QqvGA.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BiKjtCpj.js → oauth-callback-ai-provider-LKEqTcag.js} +1 -1
- package/dist/client/assets/{onboarding-U4YqP9I9.js → onboarding-Nyzpe9OQ.js} +1 -1
- package/dist/client/assets/{org-install-BYDat95r.js → org-install-CAemO7c_.js} +1 -1
- package/dist/client/assets/{org-layout-CVqWtNQa.js → org-layout-CYeMTDG5.js} +1 -1
- package/dist/client/assets/{organization-choice-CkG6QFWH.js → organization-choice-Bzsmy-ch.js} +1 -1
- package/dist/client/assets/orgs-C7gQBiuA.js +1 -0
- package/dist/client/assets/{page-seo-form-8ToiuKnD.js → page-seo-form-DPU2cMFP.js} +1 -1
- package/dist/client/assets/page-seo-sheet-Cxffc7Ri.js +1 -0
- package/dist/client/assets/{popover-DwV6WXHS.js → popover-MfTivQME.js} +1 -1
- package/dist/client/assets/post-editor-CzEfCRc6.js +1 -0
- package/dist/client/assets/{primitives-RdkZFzQM.js → primitives-CVKcZIrh.js} +1 -1
- package/dist/client/assets/profile-CZryQHJW.js +1 -0
- package/dist/client/assets/project-app-view-KvrG1kMx.js +1 -0
- package/dist/client/assets/record-editor-DXTrMUwZ.js +1 -0
- package/dist/client/assets/redirect-editor-Dk0CLnfu.js +1 -0
- package/dist/client/assets/{registry-layout-C2NoRJs0.js → registry-layout-t2McDRi7.js} +3 -3
- package/dist/client/assets/registry-tfN1hupx.js +2 -0
- package/dist/client/assets/{reports-J4B5GOoc.js → reports-C-ToD_ro.js} +2 -2
- package/dist/client/assets/{require-capability-DnfzULDW.js → require-capability-rAgzBn6-.js} +1 -1
- package/dist/client/assets/{required-auth-layout-ABsqitxw.js → required-auth-layout-KO0-1qXO.js} +1 -1
- package/dist/client/assets/{reset-password-CbrThkFS.js → reset-password-D1ZwK8Ps.js} +1 -1
- package/dist/client/assets/roles-B_p27MMh.js +1 -0
- package/dist/client/assets/{search-input-B-RkAjzQ.js → search-input-U68dcFxI.js} +1 -1
- package/dist/client/assets/secrets-Dw7rULfb.js +1 -0
- package/dist/client/assets/{sections-editor-BW9cZUKJ.js → sections-editor-BG6Wp1nc.js} +2 -2
- package/dist/client/assets/select-mGmKPAXK.js +1 -0
- package/dist/client/assets/{select-model-BAk08l-M.js → select-model-DTW46aHa.js} +1 -1
- package/dist/client/assets/self-tool-result-DYhJcSqy.js +1 -0
- package/dist/client/assets/seo-editor-BGid8G-R.js +1 -0
- package/dist/client/assets/settings-layout-BZgySvrP.js +1 -0
- package/dist/client/assets/{settings-section-CNVe03BK.js → settings-section-BrZlvNfy.js} +1 -1
- package/dist/client/assets/{shell-controls-5d4ZCRmi.js → shell-controls-nL7hKmbL.js} +1 -1
- package/dist/client/assets/{shell-layout-6KUu0MA6.js → shell-layout-wwtr-wuO.js} +1 -1
- package/dist/client/assets/{sidebar-DnKMI8jz.js → sidebar-BssgvH2v.js} +1 -1
- package/dist/client/assets/{skeleton-xDZ5Iwb8.js → skeleton-bahy-09d.js} +1 -1
- package/dist/client/assets/sso-lxqjliao.js +1 -0
- package/dist/client/assets/{store-BoCHTDSB.js → store-Cu8mkiNg.js} +1 -1
- package/dist/client/assets/store-registry-_FBAHxHd.js +2 -0
- package/dist/client/assets/{studio-tools-DIWsVaKg.js → studio-tools-DvzlcJzu.js} +1 -1
- package/dist/client/assets/{switch-DS9vYGS-.js → switch-ChtDpIb1.js} +1 -1
- package/dist/client/assets/{table-DnoPpUup.js → table-ClDYVeNV.js} +1 -1
- package/dist/client/assets/{tabs-2srR2H7A.js → tabs-Byd14nsc.js} +1 -1
- package/dist/client/assets/{textarea-DjtAtA2l.js → textarea-Duro92xh.js} +1 -1
- package/dist/client/assets/{toggle-group-DGvoaiio.js → toggle-group--i6PYyQg.js} +1 -1
- package/dist/client/assets/{toolbar-CvkbyWaX.js → toolbar-C7-EzPT_.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Cr-N30KB.js → toolbar-icon-button-VdYqoEpj.js} +1 -1
- package/dist/client/assets/{tooltip-cvFTpZ9W.js → tooltip-B6N5kQd7.js} +1 -1
- package/dist/client/assets/{use-ai-providers-ZLuBEaKb.js → use-ai-providers-kGXTar-o.js} +1 -1
- package/dist/client/assets/use-api-keys-DFJm_Sct.js +1 -0
- package/dist/client/assets/{use-automations-COcieFX-.js → use-automations-lLiWCOOl.js} +1 -1
- package/dist/client/assets/{use-autosave-C46oRXRb.js → use-autosave-BHdnAdy7.js} +1 -1
- package/dist/client/assets/{use-capability-3dRU8tE2.js → use-capability-n8ljqiDB.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BzcS25hV.js → use-clock-tick-CEJuEsd_.js} +1 -1
- package/dist/client/assets/{use-collections-DaXoNaLL.js → use-collections-B-IkeUFK.js} +1 -1
- package/dist/client/assets/{use-connection-DM1ROgj3.js → use-connection-DpPEk8aM.js} +1 -1
- package/dist/client/assets/{use-copy-DC217syR.js → use-copy-DkMO92nk.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Clu62lnk.js → use-create-virtual-mcp-DCIBpgEW.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DYog9M6N.js → use-debounced-autosave-bRNiU42w.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CSp0_yRg.js → use-debounced-value-DMJgrRLy.js} +1 -1
- package/dist/client/assets/use-deco-credits-CipyX0UT.js +1 -0
- package/dist/client/assets/{use-decopilot-events-CX_EuT5c.js → use-decopilot-events-BlazccAI.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CxGr7t4A.js → use-delete-connection-BvPMAZ_W.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-C6-1CBki.js → use-deployment-admin-CXmYBDRU.js} +1 -1
- package/dist/client/assets/{use-file-configs-DASxzk9O.js → use-file-configs-39QQNDS5.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-XidGSyic.js → use-infinite-scroll-DVSx3Rq1.js} +1 -1
- package/dist/client/assets/{use-join-requests-CjypbTMc.js → use-join-requests-DAnhRtlt.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BpAt0IbR.js → use-mcp-auth-status-BMkT9EZ9.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DseZ3Mea.js → use-mcp-client-CJ_CTOi-.js} +4 -4
- package/dist/client/assets/{use-mcp-tools-DJGNLf9H.js → use-mcp-tools-CS9HoteL.js} +1 -1
- package/dist/client/assets/{use-members-CncY3QG2.js → use-members-CgnYyzxD.js} +1 -1
- package/dist/client/assets/{use-mobile-D8w2xyip.js → use-mobile-48jgjwiy.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-YScxPu5L.js → use-navigate-to-agent-BuwUdTe3.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DjREcL_I.js → use-org-auth-client-C7loj_lF.js} +1 -1
- package/dist/client/assets/{use-org-sso-diAgeADE.js → use-org-sso-Bs00unXo.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BuFi-QNO.js → use-organization-roles-DZJy3wYG.js} +1 -1
- package/dist/client/assets/{use-organization-settings-bBY4klS6.js → use-organization-settings-lcyinZ9M.js} +1 -1
- package/dist/client/assets/{use-registry-app-Cy7ipz7c.js → use-registry-app-MQ7-Pl5L.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BZ0Z0jCg.js → use-registry-connections-By2otvi-.js} +1 -1
- package/dist/client/assets/{use-secrets-q_kPvC5B.js → use-secrets-BgDsFD4-.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DG0Zyz9B.js → use-status-sounds-Lt_bZnJO.js} +1 -1
- package/dist/client/assets/{use-t-BjZG1zRp.js → use-t-DfEf5oHx.js} +1 -1
- package/dist/client/assets/{use-view-mode-B02hzmMj.js → use-view-mode-DAFf8-q-.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-urYy02xb.js → use-virtual-mcp-GqxJcvwl.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-2fWwANBn.js +1 -0
- package/dist/client/assets/{useRouterState-C7tRHRC7.js → useRouterState-C7j1zaEX.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BFB3UBwe.js +1 -0
- package/dist/client/assets/{users-CZVOiXsq.js → users-WIzFyPzI.js} +1 -1
- package/dist/client/assets/variant-calendar-BmeiXwwQ.js +1 -0
- package/dist/client/assets/{view-mode-toggle-DziN7a9n.js → view-mode-toggle-zUY6pa7X.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +488 -488
- package/dist/server/server.js +313 -313
- package/package.json +1 -1
- package/dist/client/assets/ChevronUp-D5F6V6Tm.js +0 -1
- package/dist/client/assets/XCircle-C0OdV3N_.js +0 -1
- package/dist/client/assets/add-section-modal-DBjaDtzc.js +0 -1
- package/dist/client/assets/agent-icon-DicjSkHu.js +0 -1
- package/dist/client/assets/agents-list-Bt1R4ueI.js +0 -1
- package/dist/client/assets/ai-providers-TK1CCOpK.js +0 -1
- package/dist/client/assets/app-editor-ptKJtHHM.js +0 -1
- package/dist/client/assets/automations-BoSNNWPc.js +0 -1
- package/dist/client/assets/buckets-DcRE1RUQ.js +0 -1
- package/dist/client/assets/bulk-category-panel-BkJQrEio.js +0 -1
- package/dist/client/assets/category-editor-CaGAyBNX.js +0 -1
- package/dist/client/assets/checkbox-Ba2-hx8r.js +0 -1
- package/dist/client/assets/collection-detail-D9ZCPDhA.js +0 -1
- package/dist/client/assets/collection-display-button-D_kIgil2.js +0 -1
- package/dist/client/assets/commerce-onboarding-DbQ0hYyA.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-DEEL81vf.js +0 -1
- package/dist/client/assets/connection-detail-CKGrDl_p.js +0 -1
- package/dist/client/assets/connections-BJO0R_-8.js +0 -1
- package/dist/client/assets/dropdown-menu-D5BTIZvH.js +0 -1
- package/dist/client/assets/file-explorer-CUr9mfMv.js +0 -2
- package/dist/client/assets/general-DlHL1tW3.js +0 -1
- package/dist/client/assets/index-629FAmzK.js +0 -1
- package/dist/client/assets/index-BQK4XWOD.js +0 -2
- package/dist/client/assets/index-Cb_X1LK0.js +0 -1
- package/dist/client/assets/index-oE__K1ye.css +0 -1
- package/dist/client/assets/members-Ds_Onv02.js +0 -1
- package/dist/client/assets/orgs-B4DrO8iC.js +0 -1
- package/dist/client/assets/page-seo-sheet-BTyypxho.js +0 -1
- package/dist/client/assets/post-editor-j9JAXwQN.js +0 -1
- package/dist/client/assets/profile-DwVJzm_R.js +0 -1
- package/dist/client/assets/project-app-view-e40sJb24.js +0 -1
- package/dist/client/assets/record-editor-BBPLTix7.js +0 -1
- package/dist/client/assets/redirect-editor-C8EDxpmx.js +0 -1
- package/dist/client/assets/registry-CFSvMZwJ.js +0 -2
- package/dist/client/assets/roles-BqueMkJJ.js +0 -1
- package/dist/client/assets/secrets-CEZOniOS.js +0 -1
- package/dist/client/assets/select-AzuoAc3H.js +0 -1
- package/dist/client/assets/self-tool-result-C94YNykg.js +0 -1
- package/dist/client/assets/seo-editor-CR8P7sfk.js +0 -1
- package/dist/client/assets/settings-layout-9yQD_m0n.js +0 -1
- package/dist/client/assets/sso-DNsZ7Hie.js +0 -1
- package/dist/client/assets/store-registry-WZUtBjlh.js +0 -2
- package/dist/client/assets/use-deco-credits-Bm6Hzrca.js +0 -1
- package/dist/client/assets/useInfiniteQuery-nK_JPgM8.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-_ObcRUnC.js +0 -1
- package/dist/client/assets/variant-calendar-DibyF3zD.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,aT as nt,aR as Pe,j as d,cQ as rt,aV as be,aS as k,cR as st,aO as j,aU as _,bF as $,cS as lt,at as Ne,cT as Ee,aP as at,bD as ct,bH as it,cZ as dt,c_ as ut,c$ as pt,d0 as ft,cU as mt,aQ as ht,d1 as vt,cV as gt,cX as xt,c as ee,l as oe}from"./index-CIFSbzEF.js";import{V as St}from"./tooltip-B6N5kQd7.js";import{i as wt}from"./Check-CfdDVvTz.js";import{t as Re}from"./ChevronDown-BRbMyZ1B.js";import{n as Ct}from"./ChevronUp-BT9WG4FQ.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,_t]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,U]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,_e as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as K,at as xt,c as G,j as s,H as He,I as ge,C as pe,n as Ce,J as Ve,M as qe,d as Ne,K as le,t as se,B as ie,p as te,z as gt,l as he,m as vt,b as bt,E as jt,x as yt}from"./index-
|
|
1
|
+
import{r as K,at as xt,c as G,j as s,H as He,I as ge,C as pe,n as Ce,J as Ve,M as qe,d as Ne,K as le,t as se,B as ie,p as te,z as gt,l as he,m as vt,b as bt,E as jt,x as yt}from"./index-CIFSbzEF.js";import{c as Ge,e as Xe,d as Ye,D as St,a as Qe,h as Nt,b as kt}from"./dialog-a73gSkG2.js";import{g as Ct,b as wt,a as It,D as _t}from"./drawer-BU_sOAKq.js";import{u as Mt}from"./use-mobile-48jgjwiy.js";import{S as Te,u as Et,m as Ot,a as we}from"./chat-context-Bn6Q6CeX.js";import{C as Tt}from"./checkbox-D0oew71k.js";import{I as fe}from"./input-COKCWjWn.js";import{S as Pt,a as At,b as zt,c as Rt,d as Lt}from"./select-mGmKPAXK.js";import{S as Q}from"./skeleton-bahy-09d.js";import{i as Je,b as Ze,c as Ft,a as Dt,s as $t}from"./Settings02-DkDTX6wF.js";import{c as Kt,a as Ut,i as Bt}from"./Tool01-CiB1AgGO.js";import{i as Wt}from"./Key01-CTHo646W.js";import{i as et}from"./SearchMd-B_vHLGSV.js";import{b as Ie,u as Ht,a as Vt}from"./use-ai-providers-kGXTar-o.js";import{g as _e}from"./ai-providers-logos-DD3qZ33J.js";import{i as qt}from"./Monitor01-D8aw2U1c.js";import{i as Gt}from"./AlertCircle-C1QMMByE.js";import{u as ke}from"./studio-tools-DvzlcJzu.js";import{u as Me}from"./use-t-DfEf5oHx.js";import{i as Xt}from"./ChevronRight-Ck0jEpLN.js";import{A as Yt}from"./avatar-CMlDI2D-.js";import{S as Pe,a as Ae,b as tt}from"./settings-section-BrZlvNfy.js";import{s as st}from"./Eye-IdG-7KTy.js";import{a as ye,b as Se,C as Qt}from"./connect-desktop-dialog-CS8xcpUf.js";import{t as ze}from"./ChevronDown-BRbMyZ1B.js";import{a as Jt}from"./Image01-jwttKGpp.js";import{t as Zt}from"./Stars01-awBCSC7p.js";function me(n,e,t){let i=t.initialDeps??[],l,o=!0;function r(){var c,u,d;let a;t.key&&((c=t.debug)!=null&&c.call(t))&&(a=Date.now());const m=n();if(!(m.length!==i.length||m.some((x,g)=>i[g]!==x)))return l;i=m;let h;if(t.key&&((u=t.debug)!=null&&u.call(t))&&(h=Date.now()),l=e(...m),t.key&&((d=t.debug)!=null&&d.call(t))){const x=Math.round((Date.now()-a)*100)/100,g=Math.round((Date.now()-h)*100)/100,S=g/16,N=(k,E)=>{for(k=String(k);k.length<E;)k=" "+k;return k};console.info(`%c⏱ ${N(g,5)} /${N(x,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(l),o=!1,l}return r.updateDeps=c=>{i=c},r}function Re(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const es=(n,e)=>Math.abs(n-e)<1.01,ts=(n,e,t)=>{let i;return function(...l){n.clearTimeout(i),i=n.setTimeout(()=>e.apply(this,l),t)}},Le=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},ss=n=>n,is=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),i=[];for(let l=e;l<=t;l++)i.push(l);return i},ns=(n,e)=>{const t=n.scrollElement;if(!t)return;const i=n.targetWindow;if(!i)return;const l=r=>{const{width:c,height:u}=r;e({width:Math.round(c),height:Math.round(u)})};if(l(Le(t)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(r=>{const c=()=>{const u=r[0];if(u?.borderBoxSize){const d=u.borderBoxSize[0];if(d){l({width:d.inlineSize,height:d.blockSize});return}}l(Le(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Fe={passive:!0},De=typeof window>"u"?!0:"onscrollend"in window,ls=(n,e)=>{const t=n.scrollElement;if(!t)return;const i=n.targetWindow;if(!i)return;let l=0;const o=n.options.useScrollendEvent&&De?()=>{}:ts(i,()=>{e(l,!1)},n.options.isScrollingResetDelay),r=a=>()=>{const{horizontal:m,isRtl:f}=n.options;l=m?t.scrollLeft*(f&&-1||1):t.scrollTop,o(),e(l,a)},c=r(!0),u=r(!1);t.addEventListener("scroll",c,Fe);const d=n.options.useScrollendEvent&&De;return d&&t.addEventListener("scrollend",u,Fe),()=>{t.removeEventListener("scroll",c),d&&t.removeEventListener("scrollend",u)}},os=(n,e,t)=>{if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[t.options.horizontal?"inlineSize":"blockSize"])}return n[t.options.horizontal?"offsetWidth":"offsetHeight"]},rs=(n,{adjustments:e=0,behavior:t},i)=>{var l,o;const r=n+e;(o=(l=i.scrollElement)==null?void 0:l.scrollTo)==null||o.call(l,{[i.options.horizontal?"left":"top"]:r,behavior:t})};class as{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,i,l;return((l=(i=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:i.now)==null?void 0:l.call(i))??Date.now()},this.observer=(()=>{let t=null;const i=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(l=>{l.forEach(o=>{const r=()=>{const c=o.target,u=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(c,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var l;(l=i())==null||l.disconnect(),t=null},observe:l=>{var o;return(o=i())==null?void 0:o.observe(l,{box:"border-box"})},unobserve:l=>{var o;return(o=i())==null?void 0:o.unobserve(l)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([i,l])=>{typeof l>"u"&&delete t[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ss,rangeExtractor:is,onChange:()=>{},measureElement:os,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var i,l;(l=(i=this.options).onChange)==null||l.call(i,this,t)},this.maybeNotify=me(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,i)=>{const l=new Map,o=new Map;for(let r=i-1;r>=0;r--){const c=t[r];if(l.has(c.lane))continue;const u=o.get(c.lane);if(u==null||c.end>u.end?o.set(c.lane,c):c.end<u.end&&l.set(c.lane,!0),l.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,c)=>r.end===c.end?r.index-c.index:r.end-c.end)[0]:void 0},this.getMeasurementOptions=me(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,i,l,o,r,c,u)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:i,scrollMargin:l,getItemKey:o,enabled:r,lanes:c,laneAssignmentMode:u}),{key:!1}),this.getMeasurements=me(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:i,scrollMargin:l,getItemKey:o,enabled:r,lanes:c,laneAssignmentMode:u},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const h of this.laneAssignments.keys())h>=t&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const a=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const m=this.measurementsCache.slice(0,a),f=new Array(c).fill(void 0);for(let h=0;h<a;h++){const x=m[h];x&&(f[x.lane]=h)}for(let h=a;h<t;h++){const x=o(h),g=this.laneAssignments.get(h);let S,N;const k=u==="estimate"||d.has(x);if(g!==void 0&&this.options.lanes>1){S=g;const b=f[S],j=b!==void 0?m[b]:void 0;N=j?j.end+this.options.gap:i+l}else{const b=this.options.lanes===1?m[h-1]:this.getFurthestMeasurement(m,h);N=b?b.end+this.options.gap:i+l,S=b?b.lane:h%this.options.lanes,this.options.lanes>1&&k&&this.laneAssignments.set(h,S)}const E=d.get(x),_=typeof E=="number"?E:this.options.estimateSize(h),M=N+_;m[h]={index:h,start:N,size:_,end:M,key:x,lane:S},f[S]=h}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=me(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,i,l,o)=>this.range=t.length>0&&i>0?cs({measurements:t,outerSize:i,scrollOffset:l,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=me(()=>{let t=null,i=null;const l=this.calculateRange();return l&&(t=l.startIndex,i=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,i]},(t,i,l,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:i,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const i=this.options.indexAttribute,l=t.getAttribute(i);return l?parseInt(l,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const l=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(l!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,l-o),c=Math.min(this.options.count-1,l+o);return t>=r&&t<=c}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,c)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(c))});return}const i=this.indexFromElement(t),l=this.options.getItemKey(i),o=this.elementsCache.get(l);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(l,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,i)=>{var l;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,c=i-r;c!==0&&(((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,c,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=c,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,i)),this.notify(!1))},this.getVirtualItems=me(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,i)=>{const l=[];for(let o=0,r=t.length;o<r;o++){const c=t[o],u=i[c];l.push(u)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(i.length!==0)return Re(i[it(0,i.length-1,l=>Re(i[l]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,i,l=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();i==="auto"&&(i=t>=r+o?"end":"start"),i==="center"?t+=(l-o)/2:i==="end"&&(t-=o);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,i="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(i==="auto")if(r.end>=o+l-this.options.scrollPaddingEnd)i="end";else if(r.start<=o+this.options.scrollPaddingStart)i="start";else return[o,i];if(i==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,r.size),i]},this.scrollToOffset=(t,{align:i="start",behavior:l="auto"}={})=>{const o=this.getOffsetForAlignment(t,i),r=this.now();this.scrollState={index:null,align:i,behavior:l,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:i="auto",behavior:l="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,i);if(!o)return;const[r,c]=o,u=this.now();this.scrollState={index:t,align:c,behavior:l,startedAt:u,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:i="auto"}={})=>{const l=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:o,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const i=this.getMeasurements();let l;if(i.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((t=i[i.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=i.length-1;for(;r>=0&&o.some(c=>c===null);){const c=i[r];o[c.lane]===null&&(o[c.lane]=c.end),r--}l=Math.max(...o.filter(c=>c!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:i,behavior:l})=>{this.options.scrollToFn(t,{behavior:l,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,l=i?i[0]:this.scrollState.lastTargetOffset,o=1,r=l!==this.scrollState.lastTargetOffset;if(!r&&es(l,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=l,this.scrollState.behavior="auto",this._scrollToOffset(l,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const it=(n,e,t,i)=>{for(;n<=e;){const l=(n+e)/2|0,o=t(l);if(o<i)n=l+1;else if(o>i)e=l-1;else return l}return n>0?n-1:0};function cs({measurements:n,outerSize:e,scrollOffset:t,lanes:i}){const l=n.length-1,o=u=>n[u].start;if(n.length<=i)return{startIndex:0,endIndex:l};let r=it(0,l,o,t),c=r;if(i===1)for(;c<l&&n[c].end<t+e;)c++;else if(i>1){const u=Array(i).fill(0);for(;c<l&&u.some(a=>a<t+e);){const a=n[c];u[a.lane]=a.end,c++}const d=Array(i).fill(t+e);for(;r>=0&&d.some(a=>a>=t);){const a=n[r];d[a.lane]=a.start,r--}r=Math.max(0,r-r%i),c=Math.min(l,c+(i-1-c%i))}return{startIndex:r,endIndex:c}}const $e=typeof document<"u"?K.useLayoutEffect:K.useEffect;function ds({useFlushSync:n=!0,...e}){const t=K.useReducer(()=>({}),{})[1],i={...e,onChange:(o,r)=>{var c;n&&r?xt.flushSync(t):t(),(c=e.onChange)==null||c.call(e,o,r)}},[l]=K.useState(()=>new as(i));return l.setOptions(i),$e(()=>l._didMount(),[]),$e(()=>l._willUpdate()),l}function us(n){return ds({observeElementRect:ns,observeElementOffset:ls,scrollToFn:rs,...n})}const nt=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function ve(n){if(n)return nt.find(e=>e.id===n)}const Ke=4;function xe(n){const e=G.c(8),{logo:t,name:i,description:l,onClick:o}=n;let r;e[0]!==t||e[1]!==i?(r=t?s.jsx("img",{src:t,alt:i,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Yt,{fallback:i.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=i,e[2]=r):r=e[2];let c;return e[3]!==l||e[4]!==i||e[5]!==o||e[6]!==r?(c=s.jsx(tt,{onClick:o,icon:r,title:i,description:l}),e[3]=l,e[4]=i,e[5]=o,e[6]=r,e[7]=c):c=e[7],c}function lt(n){const e=G.c(32),{providers:t,onSelect:i,onShowAll:l}=n;let o;e[0]!==t?(o=t.find(ps),e[0]=t,e[1]=o):o=e[1];const r=o;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=c):c=e[2];const u=c;let d;if(e[3]!==i||e[4]!==t){let E;e[6]===Symbol.for("react.memo_cache_sentinel")?(E=(p,w)=>{const O=u[p.id]??Number.MAX_SAFE_INTEGER,T=u[w.id]??Number.MAX_SAFE_INTEGER;return O-T},e[6]=E):E=e[6];const _=t.filter(hs).sort(E);let M;e[7]!==t?(M=t.find(fs),e[7]=t,e[8]=M):M=e[8];const b=M;let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=ve("openai"),e[9]=j):j=e[9];const y=j;let I;e[10]!==i?(I=p=>s.jsx(xe,{logo:p.logo,name:p.name,description:p.description,onClick:()=>i({kind:"provider",provider:p})},p.id),e[10]=i,e[11]=I):I=e[11];let C,v;e[12]!==i||e[13]!==b?(C=b&&y?[s.jsx(xe,{logo:y.logo,name:y.name,description:y.description,onClick:()=>i({kind:"openai-compatible",provider:b,preset:y})},y.id)]:[],v=b?[...nt.filter(ms).map(p=>s.jsx(xe,{logo:p.logo,name:p.name,description:p.description,onClick:()=>i({kind:"openai-compatible",provider:b,preset:p})},p.id)),s.jsx(xe,{logo:b.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>i({kind:"openai-compatible",provider:b,preset:null})},"custom")]:[],e[12]=i,e[13]=b,e[14]=C,e[15]=v):(C=e[14],v=e[15]),d=[..._.map(I),...C,...v],e[3]=i,e[4]=t,e[5]=d}else d=e[5];const a=d,m=a.length-Ke,f=!!l&&m>0;let h;e[16]!==a||e[17]!==f?(h=f?a.slice(0,Ke):a,e[16]=a,e[17]=f,e[18]=h):h=e[18];const x=h;let g;e[19]!==r||e[20]!==i?(g=r&&s.jsx(Pe,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(Ae,{className:"relative",children:s.jsx(xe,{logo:r.logo,name:r.name,description:r.description,onClick:()=>i({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=i,e[21]=g):g=e[21];let S;e[22]!==m||e[23]!==l||e[24]!==f?(S=f&&s.jsx(tt,{onClick:l,title:`${m} more provider${m===1?"":"s"}`,action:s.jsx(Xt,{size:16,className:"text-muted-foreground"})}),e[22]=m,e[23]=l,e[24]=f,e[25]=S):S=e[25];let N;e[26]!==S||e[27]!==x?(N=s.jsx(Pe,{children:s.jsxs(Ae,{children:[x,S]})}),e[26]=S,e[27]=x,e[28]=N):N=e[28];let k;return e[29]!==g||e[30]!==N?(k=s.jsxs("div",{className:"flex flex-col gap-6",children:[g,N]}),e[29]=g,e[30]=N,e[31]=k):k=e[31],k}function ms(n){return n.id!=="openai"}function fs(n){return n.id==="openai-compatible"}function hs(n){return n.id!=="deco"&&n.id!=="openai-compatible"}function ps(n){return n.id==="deco"}const xs=He({label:ge().optional(),apiKey:ge().min(1,"API key is required")});function gs(n){const e=G.c(87),{providerId:t,onCancel:i,onSuccess:l}=n,{org:o}=pe(),r=ke(),c=Ce(),[u,d]=K.useState(!1),a=Me();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={resolver:Ve(xs),defaultValues:{label:"",apiKey:""}},e[0]=m):m=e[0];const{register:f,handleSubmit:h,formState:x}=qe(m),{errors:g}=x;let S;e[1]!==t||e[2]!==r||e[3]!==a?(S=async Z=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:Z.label||a("settings.connectForms.defaultKeyLabel"),apiKey:Z.apiKey})},e[1]=t,e[2]=r,e[3]=a,e[4]=S):S=e[4];let N;e[5]!==l||e[6]!==o||e[7]!==c||e[8]!==a?(N=()=>{c.invalidateQueries({queryKey:le.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:le.aiProviders(o.id)}),se.success(a("settings.connectForms.keySavedSuccess")),l()},e[5]=l,e[6]=o,e[7]=c,e[8]=a,e[9]=N):N=e[9];let k;e[10]!==a?(k=Z=>{se.error(a("settings.connectForms.failedSaveKey",{error:Z.message}))},e[10]=a,e[11]=k):k=e[11];let E;e[12]!==S||e[13]!==N||e[14]!==k?(E={mutationFn:S,onSuccess:N,onError:k},e[12]=S,e[13]=N,e[14]=k,e[15]=E):E=e[15];const{mutate:_,isPending:M,error:b}=Ne(E);let j;e[16]!==_?(j=Z=>_(Z),e[16]=_,e[17]=j):j=e[17];let y;e[18]!==h||e[19]!==j?(y=h(j),e[18]=h,e[19]=j,e[20]=y):y=e[20];let I;e[21]!==a?(I=a("settings.connectForms.labelField"),e[21]=a,e[22]=I):I=e[22];let C;e[23]!==I?(C=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:I}),e[23]=I,e[24]=C):C=e[24];let v;e[25]!==a?(v=a("settings.connectForms.labelPlaceholder"),e[25]=a,e[26]=v):v=e[26];let p;e[27]!==f?(p=f("label"),e[27]=f,e[28]=p):p=e[28];let w;e[29]!==v||e[30]!==p?(w=s.jsx(fe,{placeholder:v,...p,className:"h-8 text-sm"}),e[29]=v,e[30]=p,e[31]=w):w=e[31];let O;e[32]!==C||e[33]!==w?(O=s.jsxs("div",{className:"space-y-1",children:[C,w]}),e[32]=C,e[33]=w,e[34]=O):O=e[34];let T;e[35]!==a?(T=a("settings.connectForms.apiKeyField"),e[35]=a,e[36]=T):T=e[36];let z;e[37]!==T?(z=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:T}),e[37]=T,e[38]=z):z=e[38];const A=u?"text":"password";let L;e[39]!==f?(L=f("apiKey"),e[39]=f,e[40]=L):L=e[40];let F;e[41]!==A||e[42]!==L?(F=s.jsx(fe,{type:A,placeholder:"sk-...",...L,className:"ph-no-capture h-8 text-sm pr-8"}),e[41]=A,e[42]=L,e[43]=F):F=e[43];let D;e[44]!==u?(D=()=>d(!u),e[44]=u,e[45]=D):D=e[45];let U;e[46]!==u||e[47]!==a?(U=a(u?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[46]=u,e[47]=a,e[48]=U):U=e[48];let V;e[49]!==u?(V=u?s.jsx(Je,{size:14}):s.jsx(st,{size:14}),e[49]=u,e[50]=V):V=e[50];let X;e[51]!==D||e[52]!==U||e[53]!==V?(X=s.jsx("button",{type:"button",onClick:D,"aria-label":U,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:V}),e[51]=D,e[52]=U,e[53]=V,e[54]=X):X=e[54];let B;e[55]!==F||e[56]!==X?(B=s.jsxs("div",{className:"relative",children:[F,X]}),e[55]=F,e[56]=X,e[57]=B):B=e[57];let Y;e[58]!==g.apiKey?(Y=g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message}),e[58]=g.apiKey,e[59]=Y):Y=e[59];let P;e[60]!==z||e[61]!==B||e[62]!==Y?(P=s.jsxs("div",{className:"space-y-1",children:[z,B,Y]}),e[60]=z,e[61]=B,e[62]=Y,e[63]=P):P=e[63];let q;e[64]!==b?(q=b&&s.jsx("p",{className:"text-xs text-destructive",children:b.message}),e[64]=b,e[65]=q):q=e[65];let $;e[66]!==a?($=a("settings.connectForms.cancel"),e[66]=a,e[67]=$):$=e[67];let W;e[68]!==M||e[69]!==i||e[70]!==$?(W=s.jsx(ie,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:M,children:$}),e[68]=M,e[69]=i,e[70]=$,e[71]=W):W=e[71];let H;e[72]!==M||e[73]!==a?(H=a(M?"settings.connectForms.saving":"settings.connectForms.saveKey"),e[72]=M,e[73]=a,e[74]=H):H=e[74];let R;e[75]!==M||e[76]!==H?(R=s.jsx(ie,{type:"submit",size:"sm",disabled:M,children:H}),e[75]=M,e[76]=H,e[77]=R):R=e[77];let J;e[78]!==W||e[79]!==R?(J=s.jsxs(Ge,{children:[W,R]}),e[78]=W,e[79]=R,e[80]=J):J=e[80];let ee;return e[81]!==O||e[82]!==P||e[83]!==q||e[84]!==J||e[85]!==y?(ee=s.jsxs("form",{onSubmit:y,className:"space-y-3",children:[O,P,q,J]}),e[81]=O,e[82]=P,e[83]=q,e[84]=J,e[85]=y,e[86]=ee):ee=e[86],ee}const vs=He({label:ge().optional(),baseUrl:ge().min(1,"Base URL is required"),apiKey:ge().optional()});function bs(n){const e=G.c(105),{preset:t,onCancel:i,onSuccess:l}=n,{org:o}=pe(),r=ke(),c=Ce(),[u,d]=K.useState(!1),a=Me();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=Ve(vs),e[0]=m):m=e[0];const f=t?.defaultBaseUrl??"";let h;e[1]!==f?(h={resolver:m,defaultValues:{label:"",baseUrl:f,apiKey:""}},e[1]=f,e[2]=h):h=e[2];const{register:x,handleSubmit:g,formState:S}=qe(h),{errors:N}=S;let k;e[3]!==t||e[4]!==r?(k=async ne=>{const pt=JSON.stringify({baseUrl:ne.baseUrl,apiKey:ne.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:ne.label||t?.name||ne.baseUrl,apiKey:pt,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=k):k=e[5];let E;e[6]!==l||e[7]!==o||e[8]!==c||e[9]!==a?(E=()=>{c.invalidateQueries({queryKey:le.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:le.aiProviders(o.id)}),se.success(a("settings.connectForms.connectionSavedSuccess")),l()},e[6]=l,e[7]=o,e[8]=c,e[9]=a,e[10]=E):E=e[10];let _;e[11]!==a?(_=ne=>{se.error(a("settings.connectForms.failedSaveConnection",{error:ne.message}))},e[11]=a,e[12]=_):_=e[12];let M;e[13]!==k||e[14]!==E||e[15]!==_?(M={mutationFn:k,onSuccess:E,onError:_},e[13]=k,e[14]=E,e[15]=_,e[16]=M):M=e[16];const{mutate:b,isPending:j,error:y}=Ne(M);let I;e[17]!==t||e[18]!==a?(I=t?a("settings.connectForms.labelPlaceholderPreset",{name:t.name}):a("settings.connectForms.labelPlaceholderOpenAiCompatible"),e[17]=t,e[18]=a,e[19]=I):I=e[19];const C=I;let v;e[20]!==t?.baseUrlPlaceholder||e[21]!==a?(v=t?.baseUrlPlaceholder??a("settings.connectForms.baseUrlPlaceholder"),e[20]=t?.baseUrlPlaceholder,e[21]=a,e[22]=v):v=e[22];const p=v;let w;e[23]!==b?(w=ne=>b(ne),e[23]=b,e[24]=w):w=e[24];let O;e[25]!==g||e[26]!==w?(O=g(w),e[25]=g,e[26]=w,e[27]=O):O=e[27];let T;e[28]!==a?(T=a("settings.connectForms.labelField"),e[28]=a,e[29]=T):T=e[29];let z;e[30]!==T?(z=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:T}),e[30]=T,e[31]=z):z=e[31];let A;e[32]!==x?(A=x("label"),e[32]=x,e[33]=A):A=e[33];let L;e[34]!==C||e[35]!==A?(L=s.jsx(fe,{placeholder:C,...A,className:"h-8 text-sm"}),e[34]=C,e[35]=A,e[36]=L):L=e[36];let F;e[37]!==z||e[38]!==L?(F=s.jsxs("div",{className:"space-y-1",children:[z,L]}),e[37]=z,e[38]=L,e[39]=F):F=e[39];let D;e[40]!==p||e[41]!==N||e[42]!==t?.defaultBaseUrl||e[43]!==x||e[44]!==a?(D=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...x("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.connectForms.baseUrlField")}),s.jsx(fe,{type:"url",placeholder:p,...x("baseUrl"),className:"h-8 text-sm"}),N.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:N.baseUrl.message})]}),e[40]=p,e[41]=N,e[42]=t?.defaultBaseUrl,e[43]=x,e[44]=a,e[45]=D):D=e[45];let U;e[46]!==a?(U=a("settings.connectForms.apiKeyField"),e[46]=a,e[47]=U):U=e[47];let V;e[48]!==t?.apiKeyRecommended||e[49]!==a?(V=t?.apiKeyRecommended?a("settings.connectForms.recommended"):a("settings.connectForms.optional"),e[48]=t?.apiKeyRecommended,e[49]=a,e[50]=V):V=e[50];let X;e[51]!==V?(X=s.jsxs("span",{className:"text-muted-foreground/60",children:["(",V,")"]}),e[51]=V,e[52]=X):X=e[52];let B;e[53]!==U||e[54]!==X?(B=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[U," ",X]}),e[53]=U,e[54]=X,e[55]=B):B=e[55];const Y=u?"text":"password";let P;e[56]!==x?(P=x("apiKey"),e[56]=x,e[57]=P):P=e[57];let q;e[58]!==Y||e[59]!==P?(q=s.jsx(fe,{type:Y,placeholder:"sk-...",...P,className:"ph-no-capture h-8 text-sm pr-8"}),e[58]=Y,e[59]=P,e[60]=q):q=e[60];let $;e[61]!==u?($=()=>d(!u),e[61]=u,e[62]=$):$=e[62];let W;e[63]!==u||e[64]!==a?(W=a(u?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[63]=u,e[64]=a,e[65]=W):W=e[65];let H;e[66]!==u?(H=u?s.jsx(Je,{size:14}):s.jsx(st,{size:14}),e[66]=u,e[67]=H):H=e[67];let R;e[68]!==$||e[69]!==W||e[70]!==H?(R=s.jsx("button",{type:"button",onClick:$,"aria-label":W,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:H}),e[68]=$,e[69]=W,e[70]=H,e[71]=R):R=e[71];let J;e[72]!==q||e[73]!==R?(J=s.jsxs("div",{className:"relative",children:[q,R]}),e[72]=q,e[73]=R,e[74]=J):J=e[74];let ee;e[75]!==B||e[76]!==J?(ee=s.jsxs("div",{className:"space-y-1",children:[B,J]}),e[75]=B,e[76]=J,e[77]=ee):ee=e[77];let Z;e[78]!==t?(Z=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[78]=t,e[79]=Z):Z=e[79];let oe;e[80]!==y?(oe=y&&s.jsx("p",{className:"text-xs text-destructive",children:y.message}),e[80]=y,e[81]=oe):oe=e[81];let re;e[82]!==a?(re=a("settings.connectForms.cancel"),e[82]=a,e[83]=re):re=e[83];let ae;e[84]!==j||e[85]!==i||e[86]!==re?(ae=s.jsx(ie,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:j,children:re}),e[84]=j,e[85]=i,e[86]=re,e[87]=ae):ae=e[87];let ce;e[88]!==j||e[89]!==a?(ce=a(j?"settings.connectForms.saving":"settings.connectForms.saveConnection"),e[88]=j,e[89]=a,e[90]=ce):ce=e[90];let de;e[91]!==j||e[92]!==ce?(de=s.jsx(ie,{type:"submit",size:"sm",disabled:j,children:ce}),e[91]=j,e[92]=ce,e[93]=de):de=e[93];let ue;e[94]!==ae||e[95]!==de?(ue=s.jsxs(Ge,{children:[ae,de]}),e[94]=ae,e[95]=de,e[96]=ue):ue=e[96];let be;return e[97]!==O||e[98]!==F||e[99]!==D||e[100]!==ee||e[101]!==Z||e[102]!==oe||e[103]!==ue?(be=s.jsxs("form",{onSubmit:O,className:"space-y-3",children:[F,D,ee,Z,oe,ue]}),e[97]=O,e[98]=F,e[99]=D,e[100]=ee,e[101]=Z,e[102]=oe,e[103]=ue,e[104]=be):be=e[104],be}const js={kind:"closed"};function ys(n,e){switch(e.type){case"open":return n.kind==="closed"?{kind:"grid"}:n;case"close":return{kind:"closed"};case"back":switch(n.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return n}case"select-form":return n.kind!=="grid"?n:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return n.kind!=="grid"?n:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return n.kind==="oauth-pending"?{kind:"grid"}:n;case"select-provision":return n.kind!=="grid"?n:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return n.kind!=="provision-pending"?n:{kind:"provision-error",providerId:n.providerId,error:e.error};case"retry-provision":return n.kind!=="provision-error"?n:{kind:"provision-pending",providerId:n.providerId}}}function Ss(n){switch(n.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return n.providerId;default:return null}}function Ns({open:n,onOpenChange:e,initialProvider:t}){const i=Me(),o=Ie()?.providers??[],{org:r}=pe(),c=ke(),u=Ce(),[d,a]=K.useReducer(ys,js),m=K.useRef(!1);K.useEffect(()=>{n&&d.kind==="closed"?a({type:"open"}):!n&&d.kind!=="closed"&&a({type:"close"})},[n,d.kind]);const f=()=>{m.current=!1,a({type:"close"}),e(!1)},h=()=>{u.invalidateQueries({queryKey:le.aiProviderKeys(r.id)}),u.invalidateQueries({queryKey:le.aiProviders(r.id)})},{mutate:x}=Ne({mutationFn:async({providerId:v,code:p,stateToken:w,label:O})=>(await c.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:v,code:p,stateToken:w,label:O}),v),onSuccess:v=>{te("ai_provider_oauth_succeeded",{provider_id:v}),h();const p=o.find(w=>w.id===v);se.success(i("settings.connectProviderDialog.oauthSuccessMessage",{provider:p?.name??i("settings.connectProviderDialog.defaultProviderName")})),f()},onError:(v,p)=>{te("ai_provider_oauth_failed",{provider_id:p.providerId,error:v.message}),se.error(i("settings.connectProviderDialog.oauthFailedMessage",{error:v.message})),a({type:"oauth-failed"})}}),{mutate:g}=Ne({mutationFn:async v=>(await c.call("AI_PROVIDER_PROVISION_KEY",{providerId:v}),v),onSuccess:v=>{te("ai_provider_provision_succeeded",{provider_id:v}),h();const p=o.find(w=>w.id===v);se.success(i("settings.connectProviderDialog.provisionSuccessMessage",{provider:p?.name??i("settings.connectProviderDialog.defaultProviderName")})),f()},onError:(v,p)=>{te("ai_provider_provision_failed",{provider_id:p,error:v.message}),a({type:"provision-error",error:v.message})}}),S=async v=>{const{provider:p}=v,w=v.kind==="openai-compatible"?v.preset?.id??null:null,O=p.supportedMethods.includes("oauth-pkce"),T=p.supportedMethods.includes("api-key");if(p.supportsProvision===!0){te("ai_provider_connect_clicked",{provider_id:p.id,method:"provision"}),a({type:"select-provision",providerId:p.id}),g(p.id);return}if(O){te("ai_provider_connect_clicked",{provider_id:p.id,method:"oauth-pkce"});try{const A=await c.call("AI_PROVIDER_OAUTH_URL",{providerId:p.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!A?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");a({type:"select-oauth",providerId:p.id,stateToken:A.stateToken}),window.open(A.url,"AiProviderOAuth","width=600,height=700")}catch(A){se.error(i("settings.connectProviderDialog.startOAuthFailedMessage",{error:A instanceof Error?A.message:String(A)}))}return}T&&(te("ai_provider_connect_clicked",{provider_id:p.id,...w!==null?{preset_id:w}:{},method:"api-key"}),a({type:"select-form",providerId:p.id,presetId:w}))},N=K.useRef(S);N.current=S;const k=K.useRef(t);k.current=t,K.useEffect(()=>{!k.current||d.kind!=="grid"||m.current||(m.current=!0,N.current(k.current))},[d.kind]);const E=d.kind==="oauth-pending"?d.stateToken:null,_=d.kind==="oauth-pending"?d.providerId:null;K.useEffect(()=>{if(d.kind!=="oauth-pending")return;let v=!1;const p=d.stateToken,w=d.providerId,O=z=>{if(z.origin!==window.location.origin||z.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:A,stateToken:L}=z.data;if(L!==p){se.error(i("settings.connectProviderDialog.securityCheckFailedMessage")),a({type:"oauth-failed"});return}v=!0;const F=o.find(D=>D.id===w);x({providerId:w,code:A,stateToken:p,label:F?.name??w})};window.addEventListener("message",O);const T=setTimeout(()=>{v||(te("ai_provider_oauth_timeout",{provider_id:w}),a({type:"oauth-failed"}),se.error(i("settings.connectProviderDialog.connectionTimedOutMessage")))},12e4);return()=>{window.removeEventListener("message",O),clearTimeout(T)}},[d.kind,E,_,x]);const M=Ss(d),b=M?o.find(v=>v.id===M):null,y=(d.kind==="form"&&d.presetId?ve(d.presetId):null)?.name??b?.name??i("settings.connectProviderDialog.defaultTitle"),I=d.kind!=="grid"&&d.kind!=="closed",C=()=>{t?f():a({type:"back"})};return s.jsx(Xe,{open:d.kind!=="closed",onOpenChange:v=>!v&&f(),children:s.jsxs(Ye,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(St,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[I&&s.jsx(ie,{variant:"ghost",size:"icon","aria-label":i("settings.connectProviderDialog.backButtonLabel"),className:"h-7 w-7",onClick:C,children:s.jsx(Ze,{size:16})}),s.jsx(Qe,{children:y})]}),d.kind==="grid"&&!t&&s.jsx(Nt,{children:i("settings.connectProviderDialog.gridDescription")})]}),d.kind==="grid"&&!t&&s.jsx(lt,{providers:o,onSelect:S}),d.kind==="form"&&(d.providerId==="openai-compatible"?s.jsx(bs,{preset:d.presetId?ve(d.presetId):void 0,onCancel:()=>a({type:"back"}),onSuccess:()=>{h(),f()}}):s.jsx(gs,{providerId:d.providerId,onCancel:()=>a({type:"back"}),onSuccess:()=>{h(),f()}})),d.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Te,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:i("settings.connectProviderDialog.oauthPendingMessage")})]}),d.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Te,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:i("settings.connectProviderDialog.provisionPendingMessage")})]}),d.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(Gt,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:d.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>a({type:"back"}),children:i("settings.connectProviderDialog.backButton")}),s.jsx(ie,{size:"sm",onClick:()=>{a({type:"retry-provision"}),g(d.providerId)},children:i("settings.connectProviderDialog.retryButton")})]})]})]})})}function ks(){const n=G.c(7),{org:e}=pe(),t=ke();let i;n[0]!==e.id?(i=le.defaultBrand(e.id),n[0]=e.id,n[1]=i):i=n[1];let l;n[2]!==t?(l=async()=>{const{items:c}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(c)?c:[]).find(Cs)??null},n[2]=t,n[3]=l):l=n[3];let o;n[4]!==i||n[5]!==l?(o={queryKey:i,queryFn:l},n[4]=i,n[5]=l,n[6]=o):o=n[6];const{data:r}=vt(o);return r??null}function Cs(n){return n.isDefault&&!n.archivedAt}function ws(n){const e=n.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(l=>typeof l=="object"&&l!==null&&"label"in l&&/primary|brand|main/i.test(l.label)),i=t?t.value:e[0]?.value;return typeof i=="string"?i:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function Is(n){const e=G.c(50);let t;e[0]!==n?(t=n===void 0?{}:n,e[0]=n,e[1]=t):t=e[1];const{title:i,description:l,onLocalRuntimePicked:o}=t,{org:r}=pe(),{localMode:c}=gt(),u=ks(),d=Et(),a=Ot(),[m,f]=K.useState(null),[h,x]=K.useState(!1),[g,S]=K.useState(!1),N=Ie();let k;e[2]!==N?.providers?(k=N?.providers??[],e[2]=N?.providers,e[3]=k):k=e[3];const E=k;let _;if(e[4]!==d.capabilities||e[5]!==d.online){if(_=[],d.online){if(d.capabilities.includes("claude-code")){let R;e[7]===Symbol.for("react.memo_cache_sentinel")?(R={option:"claude-code-desktop",label:"Claude Code",icon:s.jsx(ye,{size:16})},e[7]=R):R=e[7],_.push(R)}if(d.capabilities.includes("codex")){let R;e[8]===Symbol.for("react.memo_cache_sentinel")?(R={option:"codex-desktop",label:"Codex",icon:s.jsx(Se,{size:16})},e[8]=R):R=e[8],_.push(R)}}e[4]=d.capabilities,e[5]=d.online,e[6]=_}else _=e[6];const M=_.length>0&&a!==null,b=r.name;let j;e[9]!==u?(j=u?ws(u):null,e[9]=u,e[10]=j):j=e[10];const y=j,I=u?.favicon??u?.logo??null,C=i??(b?`${b} is ready for agents`:"Your agents are almost ready"),v=l??(M?"Your desktop is linked — start now with a local coding agent, or connect a cloud provider for hosted models.":c?"Connect a provider, or run `bunx decocms@latest link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms@latest link` on your desktop to use Claude Code, Codex, or your local files."),p=!!(I||y);let w;e[11]!==y?(w=y?{backgroundColor:`${y}18`,borderColor:`${y}30`}:void 0,e[11]=y,e[12]=w):w=e[12];const O=w,T=p?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let z;e[13]!==T||e[14]!==O||e[15]!==I||e[16]!==d.online||e[17]!==y?(z=I?s.jsx("div",{className:T,style:O,children:s.jsx("img",{src:I,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>S(!0),"aria-label":d.online?"Desktop linked":"Connect your desktop",className:he(T,"cursor-pointer transition-colors hover:bg-accent"),style:O,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(qt,{size:24,style:y?{color:y}:void 0,className:he(!y&&"text-muted-foreground")}),d.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[13]=T,e[14]=O,e[15]=I,e[16]=d.online,e[17]=y,e[18]=z):z=e[18];let A;e[19]!==C?(A=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:C}),e[19]=C,e[20]=A):A=e[20];let L;e[21]!==v?(L=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:v}),e[21]=v,e[22]=L):L=e[22];let F;e[23]!==A||e[24]!==L?(F=s.jsxs("div",{className:"space-y-2",children:[A,L]}),e[23]=A,e[24]=L,e[25]=F):F=e[25];let D;e[26]!==z||e[27]!==F?(D=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[z,F]}),e[26]=z,e[27]=F,e[28]=D):D=e[28];let U;e[29]!==a||e[30]!==M||e[31]!==_||e[32]!==o?(U=M&&s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[s.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:_.map(R=>s.jsxs(ie,{variant:"default",className:"gap-2",onClick:()=>{a?.setPendingAgentOption(R.option),o?.(R.option)},children:[R.icon,"Use ",R.label]},R.option))}),s.jsxs("div",{className:"flex items-center gap-3 w-full max-w-xs text-xs text-muted-foreground",children:[s.jsx("span",{className:"h-px flex-1 bg-border"}),"or connect a cloud provider",s.jsx("span",{className:"h-px flex-1 bg-border"})]})]}),e[29]=a,e[30]=M,e[31]=_,e[32]=o,e[33]=U):U=e[33];let V,X;e[34]===Symbol.for("react.memo_cache_sentinel")?(V=R=>f(R),X=()=>x(!0),e[34]=V,e[35]=X):(V=e[34],X=e[35]);let B;e[36]!==E?(B=s.jsx("div",{className:"w-full",children:s.jsx(lt,{providers:E,onSelect:V,onShowAll:X})}),e[36]=E,e[37]=B):B=e[37];const Y=m!==null||h;let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=R=>{R||(f(null),x(!1))},e[38]=P):P=e[38];const q=m??void 0;let $;e[39]!==Y||e[40]!==q?($=s.jsx(Ns,{open:Y,onOpenChange:P,initialProvider:q}),e[39]=Y,e[40]=q,e[41]=$):$=e[41];let W;e[42]!==g?(W=s.jsx(Qt,{open:g,onOpenChange:S}),e[42]=g,e[43]=W):W=e[43];let H;return e[44]!==U||e[45]!==B||e[46]!==$||e[47]!==W||e[48]!==D?(H=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[D,U,B,$,W]}),e[44]=U,e[45]=B,e[46]=$,e[47]=W,e[48]=D,e[49]=H):H=e[49],H}function Ee(n){const e=n.title.includes(": ");return{provider:e?n.title.split(": ")[0]??"":n.modelId.split("/")[0]??"",displayName:e?n.title.split(": ").slice(1).join(": "):n.title}}function _s(n){return n<32e3?{level:1,label:"Small",description:"Short conversations"}:n<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:n<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const Ms=["bg-destructive","bg-warning","bg-success","bg-success"],Es=["text-success","text-warning","text-warning","text-destructive"];function Os(n){const e=Math.round(n*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(n*.75)} words`}function Ts(n){return n<1?{level:1,label:"Cheap"}:n<5?{level:2,label:"Moderate"}:n<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const Ps={text:{icon:s.jsx(Ut,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(Jt,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(Ft,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(Kt,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(Zt,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(et,{className:"size-3.5"}),label:"Web search"}};function As(n){const e=G.c(5),{capability:t}=n;let i;e[0]!==t?(i=Ps[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=i):i=e[1];const l=i;let o;return e[2]!==l.icon||e[3]!==l.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[l.icon,l.label]}),e[2]=l.icon,e[3]=l.label,e[4]=o):o=e[4],o}function zs(n){const e=G.c(49),{model:t,compact:i}=n,l=i===void 0?!1:i;if(!t){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=b):b=e[0],b}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let c;e[1]!==t?(c=Ee(t),e[1]=t,e[2]=c):c=e[2];const{provider:u,displayName:d}=c;if(l){let b;e[3]!==t.limits?(b=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=b):b=e[4];let j;e[5]!==o?(j=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=j):j=e[6];let y;e[7]!==r?(y=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=y):y=e[8];let I;e[9]!==t.limits?(I=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=I):I=e[10];let C;return e[11]!==b||e[12]!==j||e[13]!==y||e[14]!==I?(C=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[b,j,y,I]}),e[11]=b,e[12]=j,e[13]=y,e[14]=I,e[15]=C):C=e[15],C}let a;e[16]!==u?(a=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:u}),e[16]=u,e[17]=a):a=e[17];let m;e[18]!==t.logo||e[19]!==t.title?(m=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=m):m=e[20];let f;e[21]!==d?(f=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[21]=d,e[22]=f):f=e[22];let h;e[23]!==m||e[24]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2.5",children:[m,f]}),e[23]=m,e[24]=f,e[25]=h):h=e[25];let x;e[26]!==t.modelId?(x=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=x):x=e[27];let g;e[28]!==a||e[29]!==h||e[30]!==x?(g=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[a,h,x]}),e[28]=a,e[29]=h,e[30]=x,e[31]=g):g=e[31];let S;e[32]!==t.capabilities?(S=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(Rs)}),e[32]=t.capabilities,e[33]=S):S=e[33];let N;e[34]!==t.limits?(N=t.limits?.contextWindow&&(()=>{const{level:b,label:j,description:y}=_s(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(I=>s.jsx("div",{className:he("w-2 h-2 rounded-full",I<=b?Ms[b-1]:"bg-muted")},I))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:j}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",y]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=N):N=e[35];let k;e[36]!==t.limits?(k=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:Os(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=k):k=e[37];let E;e[38]!==o||e[39]!==r?(E=(o!=null||r!=null)&&(()=>{const{level:b,label:j}=o!=null?Ts(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(y=>s.jsx("span",{className:he("text-sm font-bold leading-none",y<=b?Es[b-1]:"text-muted-foreground/20"),children:"$"},y))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:j})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=E):E=e[40];let _;e[41]!==N||e[42]!==k||e[43]!==E?(_=s.jsxs("div",{className:"flex flex-col gap-6",children:[N,k,E]}),e[41]=N,e[42]=k,e[43]=E,e[44]=_):_=e[44];let M;return e[45]!==_||e[46]!==g||e[47]!==S?(M=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[g,S,_]}),e[45]=_,e[46]=g,e[47]=S,e[48]=M):M=e[48],M}function Rs(n){return s.jsx(As,{capability:n},n)}function ot(n){const e=G.c(19),{model:t,placeholder:i,isLoading:l}=n,o=i===void 0?"Select model":i;if(l===void 0?!1:l){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Q,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(Q,{className:"w-16 h-3 hidden md:block"})]}),e[0]=g):g=e[0],g}if(!t){let g;e[1]!==o?(g=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=g):g=e[2];let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ze,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=S):S=e[3];let N;return e[4]!==g?(N=s.jsxs("div",{className:"flex items-center gap-1.5",children:[g,S]}),e[4]=g,e[5]=N):N=e[5],N}let c;e[6]!==t?(c=Ee(t),e[6]=t,e[7]=c):c=e[7];const{displayName:u}=c;let d;e[8]!==t?(d=_e(t),e[8]=t,e[9]=d):d=e[9];const a=d;let m;e[10]!==t.title||e[11]!==a?(m=s.jsx("img",{src:a,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=a,e[12]=m):m=e[12];let f;e[13]!==u?(f=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:u}),e[13]=u,e[14]=f):f=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ze,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=h):h=e[15];let x;return e[16]!==m||e[17]!==f?(x=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[m,f,h]}),e[16]=m,e[17]=f,e[18]=x):x=e[18],x}const Ls=["vision","image","file","audio","video"],rt=["image/png","image/jpeg","image/gif","image/webp"],at=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function Oe(n){const e=n?.capabilities;return e?Ls.some(t=>e.includes(t)):!1}function Gi(n,e){if(!n)return!1;if(n.startsWith("text/"))return!0;const t=e?.capabilities??[],i=t.includes("vision")||t.includes("image"),l=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(i&&rt.includes(n)||l&&n==="application/pdf"||o&&n.startsWith("audio/")||r&&n.startsWith("video/")||Oe(e)&&at.includes(n))}function Xi(n){const e=n?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...rt),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),Oe(n)&&t.push(...at),t.join(",")}function Yi(n){const e=n?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),Oe(n)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const ct=["smarter","faster","cheaper"],dt={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},Fs=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],Ds=Fs.flatMap(({tier:n,prefixes:e})=>e.map(t=>({tier:n,prefix:t}))).sort((n,e)=>e.prefix.length-n.prefix.length),$s="google/gemini-2.5-pro",Ue=new Map;function Ks(n){const e=Ue.get(n);if(e!==void 0)return e;let t=null;if(n.endsWith(":free"))t="cheaper";else for(const{tier:i,prefix:l}of Ds)if(n.startsWith(l)){if(l===$s&&n.length>l.length&&n[l.length]==="-"){const r=n[l.length+1];if(!r||!/\d/.test(r))continue}t=i;break}return Ue.set(n,t),t}function Be(n){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of n){const i=Ks(t.modelId);e[i??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((i,l)=>i.title.localeCompare(l.title));return e}const ut="mesh:model-shortlist:",Us=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Bs(n){try{const e=localStorage.getItem(ut+n);return e?new Set(JSON.parse(e)):null}catch{return null}}function Ws(n,e){localStorage.setItem(ut+n,JSON.stringify([...e]))}function Hs(n){const e=G.c(21),{model:t,onHover:i}=n;let l;e[0]!==t?(l=Ee(t),e[0]=t,e[1]=l):l=e[1];const{displayName:o,provider:r}=l;let c;e[2]!==t?(c=_e(t),e[2]=t,e[3]=c):c=e[3];const u=c;let d;e[4]!==t||e[5]!==i?(d=()=>i(t),e[4]=t,e[5]=i,e[6]=d):d=e[6];let a;e[7]!==t.title||e[8]!==u?(a=s.jsx("img",{src:u,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=u,e[9]=a):a=e[9];let m;e[10]!==o?(m=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=m):m=e[11];let f;e[12]!==r?(f=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=f):f=e[13];let h;e[14]!==m||e[15]!==f?(h=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[m,f]}),e[14]=m,e[15]=f,e[16]=h):h=e[16];let x;return e[17]!==d||e[18]!==a||e[19]!==h?(x=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[a,h]}),e[17]=d,e[18]=a,e[19]=h,e[20]=x):x=e[20],x}function Vs(n){const e=G.c(10),{error:t,onRetry:i}=n;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(yt,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let c;e[2]!==r?(c=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=c):c=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx($t,{className:"size-3.5"}),e[4]=u):u=e[4];let d;e[5]!==i?(d=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(ie,{variant:"outline",size:"sm",onClick:i,className:"gap-1.5",children:[u,"Retry"]})}),e[5]=i,e[6]=d):d=e[6];let a;return e[7]!==c||e[8]!==d?(a=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,c,d]}),e[7]=c,e[8]=d,e[9]=a):a=e[9],a}function qs(){const n=G.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Gs)}),n[0]=e):e=n[0],e}function Gs(n,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(Q,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(Q,{className:"flex-1 h-4"}),s.jsx(Q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function We(n){const e=G.c(12),{label:t,models:i,onSelect:l,onHover:o}=n;if(i.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let c;if(e[2]!==i||e[3]!==o||e[4]!==l){let d;e[6]!==o||e[7]!==l?(d=a=>s.jsx("div",{onClick:()=>l(a),className:"cursor-pointer",children:s.jsx(Hs,{model:a,onHover:o})},a.modelId),e[6]=o,e[7]=l,e[8]=d):d=e[8],c=i.map(d),e[2]=i,e[3]=o,e[4]=l,e[5]=c}else c=e[5];let u;return e[9]!==r||e[10]!==c?(u=s.jsxs("div",{children:[r,c]}),e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function Xs(n){const e=G.c(21),{model:t,isChecked:i,onToggle:l,onHover:o}=n,[r,c]=K.useState(i);r!==i&&c(i);let u;e[0]!==t?(u=_e(t),e[0]=t,e[1]=u):u=e[1];const d=u;let a;e[2]!==t||e[3]!==o?(a=()=>o(t),e[2]=t,e[3]=o,e[4]=a):a=e[4];let m;e[5]!==t.modelId||e[6]!==l?(m=()=>{c(Ys),l(t.modelId)},e[5]=t.modelId,e[6]=l,e[7]=m):m=e[7];let f;e[8]!==r||e[9]!==m?(f=s.jsx(Tt,{checked:r,onCheckedChange:m}),e[8]=r,e[9]=m,e[10]=f):f=e[10];let h;e[11]!==d||e[12]!==t.title?(h=s.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=h):h=e[13];let x;e[14]!==t.title?(x=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=x):x=e[15];let g;return e[16]!==a||e[17]!==f||e[18]!==h||e[19]!==x?(g=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:a,children:[f,h,x]}),e[16]=a,e[17]=f,e[18]=h,e[19]=x,e[20]=g):g=e[20],g}function Ys(n){return!n}function Qs(n){const e=[];for(const t of ct)if(n[t].length>0){e.push({type:"header",label:dt[t]});for(const i of n[t])e.push({type:"model",model:i})}if(n.other.length>0){e.push({type:"header",label:"Other"});for(const t of n.other)e.push({type:"model",model:t})}return e}function Js({items:n,shortlistSet:e,onToggle:t,onHover:i}){const l=K.useRef(null),o=us({count:n.length,getScrollElement:()=>l.current,estimateSize:r=>n[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:l,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const c=n[r.index];return c?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:c.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:c.label}):s.jsx(Xs,{model:c.model,isChecked:e.has(c.model.modelId),onToggle:t,onHover:i})},r.key):null})})})}function Zs(n){const e=G.c(23),{keyId:t,searchTerm:i,onHover:l,onModelSelect:o,managing:r,onToggleManage:c,filterModels:u}=n,{models:d}=Vt(t),a=u?d.filter(u):d.filter(ei);let m;e[0]!==t?(m=()=>(t?Bs(t):null)??Us,e[0]=t,e[1]=m):m=e[1];const[f,h]=K.useState(m),[,x]=K.useTransition();let g;e[2]!==t||e[3]!==x?(g=C=>{t&&x(()=>{h(v=>{const p=new Set(v);return p.has(C)?p.delete(C):p.add(C),Ws(t,p),p})})},e[2]=t,e[3]=x,e[4]=g):g=e[4];const S=g,N=i.toLowerCase().trim(),k=C=>N?C.filter(v=>v.title.toLowerCase().includes(N)||v.modelId.toLowerCase().includes(N)):C;if(r){const C=Be(k(a)),v=Qs(C);let p;e[5]!==f?(p=z=>f.has(z.modelId),e[5]=f,e[6]=p):p=e[6];const w=a.filter(p).length;let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ze,{size:14}),e[7]=O):O=e[7];let T;return e[8]!==c?(T=s.jsxs("button",{type:"button",onClick:c,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[O,"Back"]}),e[8]=c,e[9]=T):T=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[T,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[w," selected"]})]}),s.jsx(Js,{items:v,shortlistSet:f,onToggle:S,onHover:l})]})}let E;e[10]!==f?(E=C=>f.has(C.modelId),e[10]=f,e[11]=E):E=e[11];const _=a.filter(E),M=_.length>0?_:a,b=Be(k(M));let j;e[12]!==b||e[13]!==l||e[14]!==o?(j=ct.map(C=>s.jsx(We,{label:dt[C],models:b[C],onSelect:o,onHover:l},C)),e[12]=b,e[13]=l,e[14]=o,e[15]=j):j=e[15];let y;e[16]!==b.other||e[17]!==l||e[18]!==o?(y=s.jsx(We,{label:"Other",models:b.other,onSelect:o,onHover:l}),e[16]=b.other,e[17]=l,e[18]=o,e[19]=y):y=e[19];let I;return e[20]!==j||e[21]!==y?(I=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[j,y]}),e[20]=j,e[21]=y,e[22]=I):I=e[22],I}function ei(n){return n.asyncResearch!==!0}function ti(){const n=G.c(6);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(Q,{className:"size-4 shrink-0"}),s.jsx(Q,{className:"flex-1 h-6"}),s.jsx(Q,{className:"w-[140px] h-8 shrink-0"})]})}),n[0]=e):e=n[0];let t;n[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(si)})]}),n[1]=t):t=n[1];let i;n[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(Q,{className:"size-6 shrink-0"}),s.jsx(Q,{className:"h-6 w-32"})]}),n[2]=i):i=n[2];let l;n[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[i,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Q,{className:"h-6 w-20 rounded-md"}),s.jsx(Q,{className:"h-6 w-24 rounded-md"})]})]}),n[3]=l):l=n[3];let o;n[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Q,{className:"h-4 w-24"}),s.jsx(Q,{className:"h-4 w-32"})]}),n[4]=o):o=n[4];let r;return n[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[l,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Q,{className:"h-4 w-16"}),s.jsx(Q,{className:"h-4 w-40"})]})]})]})})]}),n[5]=r):r=n[5],r}function si(n,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(Q,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(Q,{className:"flex-1 h-4"}),s.jsx(Q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function mt(n){const e=G.c(49),{onClose:t,credentialId:i,onCredentialChange:l,selectedModel:o,onModelChange:r,filterModels:c}=n,[u,d]=K.useState(null),[a,m]=K.useState(""),[f,h]=K.useState(!1),x=K.useRef(null),g=Ie(),S=Ht();let N;e[0]!==g?.providers?(N=Object.fromEntries((g?.providers??[]).map(li)),e[0]=g?.providers,e[1]=N):N=e[1];const k=N,E=bt(),{org:_}=pe();let M;e[2]!==l?(M=P=>{l(P),d(null)},e[2]=l,e[3]=M):M=e[3];const b=M;let j;e[4]!==i||e[5]!==t||e[6]!==r?(j=P=>{i&&(r(P),m(""),t())},e[4]=i,e[5]=t,e[6]=r,e[7]=j):j=e[7];const y=j;if(S.length===0){let P;return e[8]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(Is,{})}),e[8]=P):P=e[8],P}let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(et,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=I):I=e[9];const C=f?"Search all models...":"Search for a model...";let v;e[10]===Symbol.for("react.memo_cache_sentinel")?(v=P=>m(P.target.value),e[10]=v):v=e[10];let p;e[11]!==a||e[12]!==C?(p=s.jsx(fe,{ref:x,type:"text",placeholder:C,value:a,onChange:v,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=a,e[12]=C,e[13]=p):p=e[13];let w;e[14]!==i||e[15]!==b||e[16]!==S||e[17]!==k?(w=S.length>0&&s.jsxs(Pt,{value:i??"",onValueChange:b,children:[s.jsxs(At,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:ni,children:[s.jsx(zt,{placeholder:"Key",children:(()=>{const P=S.find(R=>R.id===i),q=P?k[P.providerId]:void 0,$=ve(P?.presetId),W=$?.logo??q?.logo,H=$?.name??q?.name??P?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[W?s.jsx("img",{src:W,alt:H,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:H.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:H})]})})()}),s.jsx(Bt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(Rt,{children:S.map(P=>{const q=k[P.providerId],$=ve(P.presetId),W=$?.logo??q?.logo,H=$?.name??q?.name??P.providerId;return s.jsx(Lt,{value:P.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[W?s.jsx("img",{src:W,alt:H,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:H.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[H," — ",P.label]})]})},P.id)})})]}),e[14]=i,e[15]=b,e[16]=S,e[17]=k,e[18]=w):w=e[18];let O;e[19]!==p||e[20]!==w?(O=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[I,p,w]})}),e[19]=p,e[20]=w,e[21]=O):O=e[21];let T;e[22]!==i?(T=P=>{const{error:q,resetError:$}=P;return s.jsx(Vs,{error:q,onRetry:$,credentialId:i??void 0})},e[22]=i,e[23]=T):T=e[23];let z;e[24]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(qs,{}),e[24]=z):z=e[24];const A=i??void 0;let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=()=>h(ii),e[25]=L):L=e[25];let F;e[26]!==c||e[27]!==y||e[28]!==f||e[29]!==a||e[30]!==A?(F=s.jsx(K.Suspense,{fallback:z,children:s.jsx(Zs,{keyId:A,searchTerm:a,onHover:d,onModelSelect:y,managing:f,onToggleManage:L,filterModels:c})}),e[26]=c,e[27]=y,e[28]=f,e[29]=a,e[30]=A,e[31]=F):F=e[31];let D;e[32]!==i||e[33]!==T||e[34]!==F?(D=s.jsx(jt,{fallback:T,children:F},i),e[32]=i,e[33]=T,e[34]=F,e[35]=D):D=e[35];let U;e[36]!==f||e[37]!==E||e[38]!==_?(U=!f&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>K.startTransition(()=>h(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(Dt,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>E({to:"/$org/settings/ai-providers",params:{org:_.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(Wt,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=f,e[37]=E,e[38]=_,e[39]=U):U=e[39];let V;e[40]!==D||e[41]!==U||e[42]!==O?(V=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[O,D,U]}),e[40]=D,e[41]=U,e[42]=O,e[43]=V):V=e[43];const X=u??o??null;let B;e[44]!==X?(B=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(zs,{model:X})}),e[44]=X,e[45]=B):B=e[45];let Y;return e[46]!==V||e[47]!==B?(Y=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[V,B]}),e[46]=V,e[47]=B,e[48]=Y):Y=e[48],Y}function ii(n){return!n}function ni(n){return n.stopPropagation()}function li(n){return[n.id,n]}function oi(n){const e=G.c(12),{onClose:t}=n,{credentialId:i,setCredentialId:l,selectedModel:o,setModel:r}=we();let c;e[0]!==l?(c=a=>{te("chat_credential_changed",{credential_id:a}),l(a)},e[0]=l,e[1]=c):c=e[1];let u;e[2]!==i||e[3]!==o?.modelId||e[4]!==r?(u=a=>{i&&(te("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:a.modelId,to_model_provider:a.providerId??null,credential_id:i}),r({...a,keyId:i}))},e[2]=i,e[3]=o?.modelId,e[4]=r,e[5]=u):u=e[5];let d;return e[6]!==i||e[7]!==t||e[8]!==o||e[9]!==c||e[10]!==u?(d=s.jsx(mt,{onClose:t,credentialId:i,onCredentialChange:c,selectedModel:o,onModelChange:u}),e[6]=i,e[7]=t,e[8]=o,e[9]=c,e[10]=u,e[11]=d):d=e[11],d}function ri(n){const e=G.c(2),{onClose:t}=n;let i;return e[0]!==t?(i=s.jsx(oi,{onClose:t}),e[0]=t,e[1]=i):i=e[1],i}function ai(n){const e=G.c(2);let t;return e[0]!==n?(t=s.jsx(mt,{...n}),e[0]=n,e[1]=t):t=e[1],t}const ci=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function ft(n){const e=G.c(10),{modelSet:t,selectedModelId:i,onSelect:l}=n;let o,r;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==l||e[4]!==i){const u=Object.fromEntries(t.models.map(di));o="flex flex-col p-2 w-[320px]",r=ci.map(d=>{const{tier:a,description:m}=d,f=t.tiers[a];if(!f.modelId)return null;const h=u[f.modelId];if(!h)return null;const x=i===f.modelId;return s.jsxs("button",{type:"button",onClick:()=>l(h),className:he("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",x&&"bg-accent/50"),children:[s.jsx("img",{src:t.logo,alt:f.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:f.label}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},a)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=l,e[4]=i,e[5]=o,e[6]=r}else o=e[5],r=e[6];let c;return e[7]!==o||e[8]!==r?(c=s.jsx("div",{className:o,children:r}),e[7]=o,e[8]=r,e[9]=c):c=e[9],c}function di(n){return[n.modelId,n]}const ui=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],je="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",mi=[{providerId:"codex",modelId:"codex:gpt-5.6-sol",title:"GPT-5.6 Sol",description:"Frontier Codex model for deep reasoning, complex coding, and real-world work",capabilities:["text","reasoning"],logo:je,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-terra",title:"GPT-5.6 Terra",description:"Balanced Codex model for everyday coding and agent work",capabilities:["text","reasoning"],logo:je,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-luna",title:"GPT-5.6 Luna",description:"Fast Codex model for lightweight coding tasks and titles",capabilities:["text","reasoning"],logo:je,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:je,limits:null,costs:null}],fi="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",hi="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",pi={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:s.jsx(ye,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:s.jsx(ye,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:s.jsx(ye,{size:16})}},xi={fast:{modelId:"codex:gpt-5.6-luna",label:"GPT-5.6 Luna",description:"Quicker responses",iconNode:s.jsx(Se,{size:16})},smart:{modelId:"codex:gpt-5.6-terra",label:"GPT-5.6 Terra",description:"Balanced quality",iconNode:s.jsx(Se,{size:16})},thinking:{modelId:"codex:gpt-5.6-sol",label:"GPT-5.6 Sol",description:"Deeper reasoning",iconNode:s.jsx(Se,{size:16})}};function ht(n){return n==="claude-code"?{logo:fi,tiers:pi,models:ui}:n==="codex"?{logo:hi,tiers:xi,models:mi}:null}function gi(n){const e=G.c(11),{onClose:t,agent:i}=n,l=we(),o=i??l.pendingHarnessId??"decopilot";let r;e[0]!==o?(r=ht(o),e[0]=o,e[1]=r):r=e[1];const c=r;if(!c){let m;return e[2]!==t?(m=s.jsx(ri,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const u=l.selectedModel?.modelId??c.tiers[l.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==l?(d=m=>{l.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=l,e[6]=d):d=e[6];let a;return e[7]!==c||e[8]!==u||e[9]!==d?(a=s.jsx(ft,{modelSet:c,selectedModelId:u,onSelect:d}),e[7]=c,e[8]=u,e[9]=d,e[10]=a):a=e[10],a}function vi(n){const e=G.c(13);let t,i;e[0]!==n?({agent:t,...i}=n,e[0]=n,e[1]=t,e[2]=i):(t=e[1],i=e[2]);let l;e[3]!==t?(l=t?ht(t):null,e[3]=t,e[4]=l):l=e[4];const o=l;if(!o){let d;return e[5]!==i?(d=s.jsx(ai,{...i}),e[5]=i,e[6]=d):d=e[6],d}const r=i.selectedModel?.modelId??o.tiers.smart.modelId;let c;e[7]!==i?(c=d=>{i.onModelChange(d),i.onClose()},e[7]=i,e[8]=c):c=e[8];let u;return e[9]!==o||e[10]!==r||e[11]!==c?(u=s.jsx(ft,{modelSet:o,selectedModelId:r,onSelect:c}),e[9]=o,e[10]=r,e[11]=c,e[12]=u):u=e[12],u}function Qi(n){const e=G.c(39),{variant:t,className:i,placeholder:l,model:o,isLoading:r,credentialId:c,onCredentialChange:u,onModelChange:d,filterModels:a,agent:m}=n,f=t===void 0?"borderless":t,h=l===void 0?"Select model":l,[x,g]=K.useState(!1),S=d!==void 0,N=Mt(),k=f==="borderless"?"ghost":"outline",E=f==="borderless"&&"md:border-none";let _;e[0]!==i||e[1]!==E?(_=he("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",E,i),e[0]=i,e[1]=E,e[2]=_):_=e[2];let M;e[3]!==r||e[4]!==o||e[5]!==h||e[6]!==S?(M=S?s.jsx(ot,{model:o??null,placeholder:h,isLoading:r}):s.jsx(ji,{placeholder:h}),e[3]=r,e[4]=o,e[5]=h,e[6]=S,e[7]=M):M=e[7];let b;e[8]!==k||e[9]!==_||e[10]!==M?(b=s.jsx(ie,{variant:k,size:"sm",className:_,children:M}),e[8]=k,e[9]=_,e[10]=M,e[11]=b):b=e[11];const j=b;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ti,{}),e[12]=y):y=e[12];let I;e[13]!==m||e[14]!==c||e[15]!==a||e[16]!==o||e[17]!==u||e[18]!==d||e[19]!==S?(I=s.jsx(K.Suspense,{fallback:y,children:S?s.jsx(vi,{onClose:()=>g(!1),agent:m,credentialId:c??null,onCredentialChange:u??bi,selectedModel:o??null,onModelChange:d,filterModels:a}):s.jsx(gi,{onClose:()=>g(!1),agent:m})}),e[13]=m,e[14]=c,e[15]=a,e[16]=o,e[17]=u,e[18]=d,e[19]=S,e[20]=I):I=e[20];const C=I;if(N){let T;e[21]!==j?(T=s.jsx(Ct,{asChild:!0,children:j}),e[21]=j,e[22]=T):T=e[22];let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(wt,{className:"sr-only",children:"Select model"}),e[23]=z):z=e[23];let A;e[24]!==C?(A=s.jsxs(It,{className:"p-0 flex flex-col max-h-[95vh]",children:[z,s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:C})]}),e[24]=C,e[25]=A):A=e[25];let L;return e[26]!==x||e[27]!==T||e[28]!==A?(L=s.jsxs(_t,{open:x,onOpenChange:g,children:[T,A]}),e[26]=x,e[27]=T,e[28]=A,e[29]=L):L=e[29],L}let v;e[30]!==j?(v=s.jsx(kt,{asChild:!0,children:j}),e[30]=j,e[31]=v):v=e[31];let p;e[32]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Qe,{className:"sr-only",children:"Select model"}),e[32]=p):p=e[32];let w;e[33]!==C?(w=s.jsxs(Ye,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,C]}),e[33]=C,e[34]=w):w=e[34];let O;return e[35]!==x||e[36]!==v||e[37]!==w?(O=s.jsxs(Xe,{open:x,onOpenChange:g,children:[v,w]}),e[35]=x,e[36]=v,e[37]=w,e[38]=O):O=e[38],O}function bi(){}function ji(n){const e=G.c(4),{placeholder:t}=n,{selectedModel:i,isModelsLoading:l}=we();let o;return e[0]!==l||e[1]!==i||e[2]!==t?(o=s.jsx(ot,{model:i,placeholder:t,isLoading:l}),e[0]=l,e[1]=i,e[2]=t,e[3]=o):o=e[3],o}export{Ns as C,Qi as M,Is as N,lt as P,Xi as a,ve as b,Yi as g,Gi as i,Oe as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Z as Nt,_ as $e,$ as wt,a0 as Et,a1 as lt,n as he,a2 as It,a3 as Tt,r as Q,a4 as Ot,a5 as Rt,a6 as kt,a7 as At,a8 as it,a9 as Lt,aa as Dt,ab as Pt,c as H,l as ie,j as s,B,d as Oe,K as Y,H as be,I as ae,J as Ce,M as ve,i as Ie,m as me,ac as $t,t as Re,v as Pe,p as oe,Q as zt,E as qt,a as Ft}from"./index-CIFSbzEF.js";import{W as ct,g as Kt,u as ze,S as Ut}from"./use-mcp-client-CJ_CTOi-.js";import{I as qe}from"./integration-icon-8ogu7iqA.js";import{c as fe,a as dt,h as ut,D as mt,d as ft,e as pt}from"./dialog-a73gSkG2.js";import{b as Fe,T as Ke,a as Ue}from"./tooltip-B6N5kQd7.js";import{i as Me}from"./CheckCircle-DLrShk9W.js";import{g as ht,j as Mt,k as gt}from"./agent-icon-C6bqiv4x.js";import{u as J,t as Qt,m as Gt,s as Ht,g as Vt,p as Bt,F as Wt,b as Yt,a as Zt,c as Xt}from"./companions-core-CBtA8C2P.js";import{F as re,a as je,b as le,c as Ee,d as ce,f as de,e as Jt}from"./form-hOrojcOx.js";import{I as _e}from"./input-COKCWjWn.js";import{i as es}from"./Check-CfdDVvTz.js";import{a as xt}from"./Copy01-Du_h2a2a.js";import{i as ts}from"./Settings02-DkDTX6wF.js";import{s as ss}from"./Eye-IdG-7KTy.js";import{u as ns}from"./use-debounced-value-DMJgrRLy.js";import{f as yt,a as os,p as is}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{c as as,e as rs}from"./extract-connection-data-DB1JAVkl.js";import{a as ls}from"./authenticate-and-persist-oauth-pF30Ku2c.js";import{i as bt}from"./ArrowUpRight-ChAriHcE.js";function at(o,e){const t=new Set(e);return o.filter(n=>!t.has(n))}function cs(o,e,t){const n=o.slice(0);return n[e]=t,n}var ds=class extends Nt{#o;#e;#i;#n;#t;#s;#a;#r;#l;#c=[];constructor(o,e,t){super(),this.#o=o,this.#n=t,this.#i=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(o=>{o.subscribe(e=>{this.#f(o,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(o=>{o.destroy()})}setQueries(o,e){this.#i=o,this.#n=e,$e.batch(()=>{const t=this.#t,n=this.#m(this.#i);n.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const i=n.map(r=>r.observer),a=i.map(r=>r.getCurrentResult()),l=t.length!==i.length,c=i.some((r,f)=>r!==t[f]),u=l||c,p=u?!0:a.some((r,f)=>{const m=this.#e[f];return!m||!wt(r,m)});!u&&!p||(u&&(this.#c=n,this.#t=i),this.#e=a,this.hasListeners()&&(u&&(at(t,i).forEach(r=>{r.destroy()}),at(i,t).forEach(r=>{r.subscribe(f=>{this.#f(r,f)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(o=>o.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(o,e){const t=this.#m(o),n=t.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=t.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>this.#u(a??n,e,i),()=>this.#d(n,t)]}#d(o,e){return e.map((t,n)=>{const i=o[n];return t.defaultedQueryOptions.notifyOnChangeProps?i:t.observer.trackResult(i,a=>{e.forEach(l=>{l.observer.trackProp(a)})})})}#u(o,e,t){if(e){const n=this.#l,i=t!==void 0&&n!==void 0&&(n.length!==t.length||t.some((a,l)=>a!==n[l]));return(!this.#s||this.#e!==this.#r||i||e!==this.#a)&&(this.#a=e,this.#r=this.#e,t!==void 0&&(this.#l=t),this.#s=Et(this.#s,e(o))),this.#s}return o}#h(){return this.#n?.combine!==void 0&&this.#t.some((o,e)=>o.options.suspense&&this.#e[e]?.data===void 0)}#m(o){const e=new Map;this.#t.forEach(n=>{const i=n.options.queryHash;if(!i)return;const a=e.get(i);a?a.push(n):e.set(i,[n])});const t=[];return o.forEach(n=>{const i=this.#o.defaultQueryOptions(n),l=e.get(i.queryHash)?.shift()??new lt(this.#o,i);t.push({defaultedQueryOptions:i,observer:l})}),t}#f(o,e){const t=this.#t.indexOf(o);t!==-1&&(this.#e=cs(this.#e,t,e),this.#p())}#p(){if(this.hasListeners()){const o=this.#d(this.#e,this.#c),e=this.#h(),t=this.#s,n=e?t:this.#u(o,this.#n?.combine);(e||t!==n)&&$e.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function us({queries:o,...e},t){const n=he(t),i=It(),a=Tt(),l=Q.useMemo(()=>o.map(C=>{const g=n.defaultQueryOptions(C);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[o,n,i]);l.forEach(C=>{Ot(C);const g=n.getQueryCache().get(C.queryHash);Rt(C,a,g)}),kt(a);const[c]=Q.useState(()=>new ds(n,l,e)),[u,p,r]=c.getOptimisticResult(l,e.combine),f=!i&&e.subscribed!==!1;Q.useSyncExternalStore(Q.useCallback(C=>f?c.subscribe($e.batchCalls(C)):At,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Q.useEffect(()=>{c.setQueries(l,e)},[l,e,c]);const h=u.some((C,g)=>it(l[g],C))?u.flatMap((C,g)=>{const d=l[g];if(d&&it(d,C)){const y=new lt(n,d);return Lt(d,y,a)}return[]}):[];if(h.length>0)throw Promise.all(h);const _=u.find((C,g)=>{const d=l[g];return d&&Dt({result:C,errorResetBoundary:a,throwOnError:d.throwOnError,query:n.getQueryCache().get(d.queryHash),suspense:d.suspense})});if(_?.error)throw _.error;return p(r())}function ms(o,e){return us({...o,queries:o.queries.map(t=>({...t,suspense:!0,throwOnError:Pt,enabled:!0,placeholderData:void 0}))},e)}const fs=/^[a-zA-Z][a-zA-Z\d+.-]*:/,ps=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,hs=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,gs=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Te(o){const e=o.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=fs.test(e),n=ps.test(e),i=hs.test(e);if(t&&!n&&!i)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=n?e:`https://${e}`;let l;try{l=new URL(a)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=l.hostname.split(".");return c.length<2||c.some(u=>!u||!gs.test(u))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function Qn(o,e){if(!o.trim())return!0;const t=Te(o);if(!t.ok||!e)return!1;const n=Te(e);return n.ok&&n.value===t.value}function Gn(o){if(!o)return null;const e=Te(o);return e.ok?new URL(e.value).hostname:null}function xs(o){const e=H.c(14),{children:t,className:n,wrapperClassName:i}=o,[a,l]=Q.useState(!0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=C=>{if(!C)return;const g=()=>{const y=C.scrollHeight-C.scrollTop-C.clientHeight<8;l(y)};g(),C.addEventListener("scroll",g,{passive:!0});const d=new ResizeObserver(g);d.observe(C);for(const y of Array.from(C.children))d.observe(y);return()=>{C.removeEventListener("scroll",g),d.disconnect()}},e[0]=c):c=e[0];const u=c;let p;e[1]!==i?(p=ie("relative",i),e[1]=i,e[2]=p):p=e[2];let r;e[3]!==t||e[4]!==n?(r=s.jsx("div",{ref:u,className:n,children:t}),e[3]=t,e[4]=n,e[5]=r):r=e[5];const f=a?"opacity-0":"opacity-100";let m;e[6]!==f?(m=ie("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",f),e[6]=f,e[7]=m):m=e[7];let h;e[8]!==m?(h=s.jsx("div",{"aria-hidden":!0,className:m}),e[8]=m,e[9]=h):h=e[9];let _;return e[10]!==p||e[11]!==r||e[12]!==h?(_=s.jsxs("div",{className:p,children:[r,h]}),e[10]=p,e[11]=r,e[12]=h,e[13]=_):_=e[13],_}function rt(o){const e=H.c(38);let t,n,i,a,l;e[0]!==o?({value:l,onChange:n,placeholder:i,className:t,...a}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=i,e[4]=a,e[5]=l):(t=e[1],n=e[2],i=e[3],a=e[4],l=e[5]);const[c,u]=Q.useState(!1),[p,r]=Q.useState(!1);let f;e[6]!==l?(f=async()=>{if(l)try{await navigator.clipboard.writeText(l),r(!0),setTimeout(()=>r(!1),2e3)}catch(R){console.error("Failed to copy text: ",R)}},e[6]=l,e[7]=f):f=e[7];const m=f;let h;e[8]!==c?(h=()=>{u(!c)},e[8]=c,e[9]=h):h=e[9];const _=h,C=c?"text":"password";let g;e[10]!==t?(g=ie("pr-20",t),e[10]=t,e[11]=g):g=e[11];let d;e[12]!==n||e[13]!==i||e[14]!==a||e[15]!==C||e[16]!==g||e[17]!==l?(d=s.jsx(_e,{type:C,value:l,onChange:n,placeholder:i,className:g,...a}),e[12]=n,e[13]=i,e[14]=a,e[15]=C,e[16]=g,e[17]=l,e[18]=d):d=e[18];const y=c?"Hide password":"Show password";let v;e[19]!==c?(v=c?s.jsx(ts,{size:16}):s.jsx(ss,{size:16}),e[19]=c,e[20]=v):v=e[20];let x;e[21]!==y||e[22]!==v||e[23]!==_?(x=s.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:_,title:y,children:v}),e[21]=y,e[22]=v,e[23]=_,e[24]=x):x=e[24];const E=!l,S=p?"Copied!":"Copy token";let j;e[25]!==p?(j=p?s.jsx(es,{size:16}):s.jsx(xt,{size:16}),e[25]=p,e[26]=j):j=e[26];let b;e[27]!==m||e[28]!==S||e[29]!==j||e[30]!==E?(b=s.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:m,disabled:E,title:S,children:j}),e[27]=m,e[28]=S,e[29]=j,e[30]=E,e[31]=b):b=e[31];let N;e[32]!==b||e[33]!==x?(N=s.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[x,b]}),e[32]=b,e[33]=x,e[34]=N):N=e[34];let O;return e[35]!==N||e[36]!==d?(O=s.jsxs("div",{className:"relative",children:[d,N]}),e[35]=N,e[36]=d,e[37]=O):O=e[37],O}function Qe(o){const e=H.c(19),{card:t,selfClient:n,org:i,onDone:a,onError:l}=o,c=he();let u;e[0]!==t||e[1]!==n?(u=async g=>{const d={...t.configurationState??{},...g};await n.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:{configuration_state:d}}})},e[0]=t,e[1]=n,e[2]=u):u=e[2];let p;e[3]!==a||e[4]!==i||e[5]!==c?(p=async()=>{await c.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),a()},e[3]=a,e[4]=i,e[5]=c,e[6]=p):p=e[6];let r;e[7]!==l?(r=g=>{l?.(g)},e[7]=l,e[8]=r):r=e[8];let f;e[9]!==u||e[10]!==p||e[11]!==r?(f={mutationFn:u,onSuccess:p,onError:r},e[9]=u,e[10]=p,e[11]=r,e[12]=f):f=e[12];const m=Oe(f);let h;e[13]!==m?(h=g=>m.mutate(g),e[13]=m,e[14]=h):h=e[14];const _=h;let C;return e[15]!==m.error||e[16]!==m.isPending||e[17]!==_?(C={save:_,isPending:m.isPending,error:m.error},e[15]=m.error,e[16]=m.isPending,e[17]=_,e[18]=C):C=e[18],C}const ys=be({accountName:ae().min(1,"Informe o nome da conta"),appKey:ae().optional(),appToken:ae().optional()});function bs(o){const e=H.c(63),{card:t,selfClient:n,org:i,onDone:a,onIsPendingChange:l}=o;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Ce(ys),e[0]=c):c=e[0];const u=t.configurationState?.accountName||"",p=t.configurationState?.appKey||"",r=t.configurationState?.appToken||"";let f;e[1]!==u||e[2]!==p||e[3]!==r?(f={resolver:c,defaultValues:{accountName:u,appKey:p,appToken:r}},e[1]=u,e[2]=p,e[3]=r,e[4]=f):f=e[4];const m=ve(f);let h;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==m?(h=()=>{m.reset({accountName:t.configurationState?.accountName||"",appKey:t.configurationState?.appKey||"",appToken:t.configurationState?.appToken||""})},e[5]=t.configurationState?.accountName,e[6]=t.configurationState?.appKey,e[7]=t.configurationState?.appToken,e[8]=m,e[9]=h):h=e[9];let _;e[10]!==t.configurationState||e[11]!==m?(_=[t.configurationState,m],e[10]=t.configurationState,e[11]=m,e[12]=_):_=e[12],Q.useEffect(h,_);let C;e[13]!==t||e[14]!==a||e[15]!==i||e[16]!==n?(C={card:t,selfClient:n,org:i,onDone:a},e[13]=t,e[14]=a,e[15]=i,e[16]=n,e[17]=C):C=e[17];const{save:g,isPending:d,error:y}=Qe(C);let v,x;e[18]!==d||e[19]!==l?(x=()=>{l?.(d)},v=[d,l],e[18]=d,e[19]=l,e[20]=v,e[21]=x):(v=e[20],x=e[21]),Q.useEffect(x,v);let E;if(e[22]!==m||e[23]!==g){let D;e[25]!==g?(D=async F=>{g(F)},e[25]=g,e[26]=D):D=e[26],E=m.handleSubmit(D),e[22]=m,e[23]=g,e[24]=E}else E=e[24];const S=E;let j;e[27]!==d?(j=D=>{const{field:F}=D;return s.jsxs(le,{children:[s.jsx(Ee,{children:"Nome da conta"}),s.jsx(ce,{children:s.jsx(_e,{placeholder:"Nome da sua conta VTEX",...F,disabled:d})}),s.jsx(de,{})]})},e[27]=d,e[28]=j):j=e[28];let b;e[29]!==m.control||e[30]!==j?(b=s.jsx(re,{control:m.control,name:"accountName",render:j}),e[29]=m.control,e[30]=j,e[31]=b):b=e[31];let N;e[32]!==d?(N=D=>{const{field:F}=D;return s.jsxs(le,{children:[s.jsx(Ee,{children:"App Key (opcional)"}),s.jsx(ce,{children:s.jsx(rt,{placeholder:"App Key da VTEX",...F,disabled:d})}),s.jsx(de,{})]})},e[32]=d,e[33]=N):N=e[33];let O;e[34]!==m.control||e[35]!==N?(O=s.jsx(re,{control:m.control,name:"appKey",render:N}),e[34]=m.control,e[35]=N,e[36]=O):O=e[36];let R;e[37]!==d?(R=D=>{const{field:F}=D;return s.jsxs(le,{children:[s.jsx(Ee,{children:"App Token (opcional)"}),s.jsx(ce,{children:s.jsx(rt,{placeholder:"App Token da VTEX",...F,disabled:d})}),s.jsx(de,{})]})},e[37]=d,e[38]=R):R=e[38];let w;e[39]!==m.control||e[40]!==R?(w=s.jsx(re,{control:m.control,name:"appToken",render:R}),e[39]=m.control,e[40]=R,e[41]=w):w=e[41];let T;e[42]!==m||e[43]!==b||e[44]!==O||e[45]!==w?(T=s.jsxs(je,{...m,children:[b,O,w]}),e[42]=m,e[43]=b,e[44]=O,e[45]=w,e[46]=T):T=e[46];let L;e[47]!==y?(L=y&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y instanceof Error?y.message:"Não foi possível salvar a configuração"}),e[47]=y,e[48]=L):L=e[48];let P;e[49]!==d||e[50]!==a?(P=s.jsx(B,{type:"button",variant:"outline",onClick:a,disabled:d,children:"Cancelar"}),e[49]=d,e[50]=a,e[51]=P):P=e[51];const K=d?"Salvando...":"Salvar";let $;e[52]!==d||e[53]!==K?($=s.jsx(B,{type:"submit",disabled:d,children:K}),e[52]=d,e[53]=K,e[54]=$):$=e[54];let q;e[55]!==P||e[56]!==$?(q=s.jsxs(fe,{className:"pt-4",children:[P,$]}),e[55]=P,e[56]=$,e[57]=q):q=e[57];let M;return e[58]!==S||e[59]!==T||e[60]!==L||e[61]!==q?(M=s.jsxs("form",{onSubmit:S,className:"space-y-4",children:[T,L,q]}),e[58]=S,e[59]=T,e[60]=L,e[61]=q,e[62]=M):M=e[62],M}function Ge(o){const e=H.c(29),{options:t,value:n,onChange:i,disabled:a,ariaLabel:l,searchPlaceholder:c,hideSearch:u}=o,p=c===void 0?"Buscar...":c,r=u===void 0?!1:u,[f,m]=Q.useState("");let h,_,C;if(e[0]!==t||e[1]!==f||e[2]!==n){const j=f.trim().toLowerCase();h=j?t.filter(b=>b.label.toLowerCase().includes(j)):t,_=h.map(Cs),C=_.includes(n)?n:_[0]??"",e[0]=t,e[1]=f,e[2]=n,e[3]=h,e[4]=_,e[5]=C}else h=e[3],_=e[4],C=e[5];const g=C;let d;e[6]!==a||e[7]!==_||e[8]!==i?(d=function(b){if(a||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(b.key))return;b.preventDefault();const O=b.currentTarget.dataset.value,R=_.indexOf(O),w=_.length;if(w===0)return;let T;b.key==="ArrowDown"||b.key==="ArrowRight"?T=(R+1)%w:b.key==="ArrowUp"||b.key==="ArrowLeft"?T=(R-1+w)%w:b.key==="Home"?T=0:T=w-1;const L=_[T];i(L),b.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(L)}"]`)?.focus()},e[6]=a,e[7]=_,e[8]=i,e[9]=d):d=e[9];const y=d;let v;e[10]!==l||e[11]!==a||e[12]!==r||e[13]!==f||e[14]!==p?(v=r?null:s.jsxs("div",{className:"relative",children:[s.jsx(ht,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(_e,{type:"text",value:f,onChange:j=>m(j.target.value),disabled:a,placeholder:p,"aria-label":`Buscar ${l}`,className:"h-8 pl-8"})]}),e[10]=l,e[11]=a,e[12]=r,e[13]=f,e[14]=p,e[15]=v):v=e[15];let x;e[16]!==a||e[17]!==h||e[18]!==y||e[19]!==i||e[20]!==g||e[21]!==n?(x=h.length===0?s.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):h.map(j=>{const b=j.value===n;return s.jsxs("button",{type:"button",role:"radio","aria-checked":b,disabled:a,"data-value":j.value,tabIndex:j.value===g?0:-1,onClick:()=>i(j.value),onKeyDown:y,className:ie("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",b?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[s.jsx("span",{className:"truncate",children:j.label}),b?s.jsx(Me,{size:16,className:"shrink-0 text-primary"}):null]},j.value)}),e[16]=a,e[17]=h,e[18]=y,e[19]=i,e[20]=g,e[21]=n,e[22]=x):x=e[22];let E;e[23]!==l||e[24]!==x?(E=s.jsx("div",{role:"radiogroup","aria-label":l,className:"max-h-[280px] overflow-y-auto",children:x}),e[23]=l,e[24]=x,e[25]=E):E=e[25];let S;return e[26]!==v||e[27]!==E?(S=s.jsxs("div",{className:"space-y-2",children:[v,E]}),e[26]=v,e[27]=E,e[28]=S):S=e[28],S}function Cs(o){return o.value}function He(o){const e=H.c(16),{label:t,iconSize:n,className:i,iconClassName:a,labelClassName:l}=o,c=n===void 0?14:n;let u;e[0]!==i?(u=ie("inline-flex items-center gap-2",i),e[0]=i,e[1]=u):u=e[1];let p;e[2]!==a?(p=ie("shrink-0 animate-spin",a),e[2]=a,e[3]=p):p=e[3];let r;e[4]!==c||e[5]!==p?(r=s.jsx(Ie,{size:c,className:p}),e[4]=c,e[5]=p,e[6]=r):r=e[6];let f;e[7]!==l?(f=ie("text-sm",l),e[7]=l,e[8]=f):f=e[8];let m;e[9]!==t||e[10]!==f?(m=s.jsx("span",{className:f,children:t}),e[9]=t,e[10]=f,e[11]=m):m=e[11];let h;return e[12]!==u||e[13]!==r||e[14]!==m?(h=s.jsxs("span",{className:u,children:[r,m]}),e[12]=u,e[13]=r,e[14]=m,e[15]=h):h=e[15],h}const vs=be({propertyId:ae().min(1,"Selecione uma propriedade")});function js(o){const e=H.c(68),{card:t,connectionId:n,companionClient:i,selfClient:a,org:l,onDone:c,onDisconnect:u,onIsPendingChange:p}=o;let r;e[0]!==n||e[1]!==l.id?(r=Y.commerceDiscoveryCompanionGaProperties(l.id,n),e[0]=n,e[1]=l.id,e[2]=r):r=e[2];let f;e[3]!==i?(f=async()=>{const k=await i.callTool({name:"get-account-summaries",arguments:{}}),I=J(k);return Qt(I)},e[3]=i,e[4]=f):f=e[4];let m;e[5]!==r||e[6]!==f?(m={queryKey:r,queryFn:f},e[5]=r,e[6]=f,e[7]=m):m=e[7];const h=me(m);let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=Ce(vs),e[8]=_):_=e[8];const C=t.configurationState?.propertyId||"";let g;e[9]!==C?(g={resolver:_,defaultValues:{propertyId:C}},e[9]=C,e[10]=g):g=e[10];const d=ve(g);let y;e[11]!==t||e[12]!==c||e[13]!==l||e[14]!==a?(y={card:t,selfClient:a,org:l,onDone:c},e[11]=t,e[12]=c,e[13]=l,e[14]=a,e[15]=y):y=e[15];const{save:v,isPending:x,error:E}=Qe(y);let S,j;e[16]!==x||e[17]!==p?(S=()=>{p?.(x)},j=[x,p],e[16]=x,e[17]=p,e[18]=S,e[19]=j):(S=e[18],j=e[19]),Q.useEffect(S,j);let b;if(e[20]!==d||e[21]!==v){let k;e[23]!==v?(k=async I=>{v(I)},e[23]=v,e[24]=k):k=e[24],b=d.handleSubmit(k),e[20]=d,e[21]=v,e[22]=b}else b=e[22];const N=b;if(h.isLoading){let k;return e[25]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(He,{label:"Carregando propriedades..."})}),e[25]=k):k=e[25],k}if(h.isError){let k;return e[26]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=k):k=e[26],k}let O;e[27]!==h.data?(O=h.data||[],e[27]=h.data,e[28]=O):O=e[28];const R=O;if(R.flatMap(Ss).length===0){let k;e[29]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma propriedade do Google Analytics foi encontrada. Conecte uma conta do Google Analytics com propriedades."}),e[29]=k):k=e[29];let I;e[30]!==u?(I=u?s.jsx("button",{type:"button",onClick:u,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive",children:"Desconectar conta"}):s.jsx("span",{}),e[30]=u,e[31]=I):I=e[31];let G;e[32]!==c?(G=s.jsx(B,{type:"button",variant:"outline",onClick:c,children:"Fechar"}),e[32]=c,e[33]=G):G=e[33];let Z;return e[34]!==I||e[35]!==G?(Z=s.jsxs("div",{className:"space-y-4",children:[k,s.jsxs(fe,{className:"flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[I,G]})]}),e[34]=I,e[35]=G,e[36]=Z):Z=e[36],Z}let T;e[37]!==x||e[38]!==R?(T=k=>{const{field:I}=k;return s.jsxs(le,{children:[s.jsx(ce,{children:s.jsx(Ge,{options:R.flatMap(_s),value:I.value,onChange:I.onChange,disabled:x,ariaLabel:"Propriedade do Google Analytics"})}),s.jsx(de,{})]})},e[37]=x,e[38]=R,e[39]=T):T=e[39];let L;e[40]!==d.control||e[41]!==T?(L=s.jsx(re,{control:d.control,name:"propertyId",render:T}),e[40]=d.control,e[41]=T,e[42]=L):L=e[42];let P;e[43]!==d||e[44]!==L?(P=s.jsx(je,{...d,children:L}),e[43]=d,e[44]=L,e[45]=P):P=e[45];let K;e[46]!==E?(K=E&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:E instanceof Error?E.message:"Não foi possível salvar a configuração"}),e[46]=E,e[47]=K):K=e[47];let $;e[48]!==x||e[49]!==u?($=u?s.jsx("button",{type:"button",onClick:u,disabled:x,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive disabled:opacity-50",children:"Desconectar conta"}):s.jsx("span",{}),e[48]=x,e[49]=u,e[50]=$):$=e[50];let q;e[51]!==x||e[52]!==c?(q=s.jsx(B,{type:"button",variant:"outline",onClick:c,disabled:x,children:"Cancelar"}),e[51]=x,e[52]=c,e[53]=q):q=e[53];const M=x?"Salvando...":"Salvar";let D;e[54]!==x||e[55]!==M?(D=s.jsx(B,{type:"submit",disabled:x,children:M}),e[54]=x,e[55]=M,e[56]=D):D=e[56];let F;e[57]!==q||e[58]!==D?(F=s.jsxs("div",{className:"flex gap-2",children:[q,D]}),e[57]=q,e[58]=D,e[59]=F):F=e[59];let z;e[60]!==$||e[61]!==F?(z=s.jsxs(fe,{className:"flex-col gap-2 pt-4 sm:flex-row sm:items-center sm:justify-between",children:[$,F]}),e[60]=$,e[61]=F,e[62]=z):z=e[62];let U;return e[63]!==N||e[64]!==P||e[65]!==K||e[66]!==z?(U=s.jsxs("form",{onSubmit:N,className:"space-y-4",children:[P,K,z]}),e[63]=N,e[64]=P,e[65]=K,e[66]=z,e[67]=U):U=e[67],U}function _s(o){return o.options}function Ss(o){return o.options}const Ns=be({siteUrl:ae().min(1,"Selecione um site")});function ws(o){const e=H.c(62),{card:t,connectionId:n,companionClient:i,selfClient:a,org:l,contextSiteUrl:c,onDone:u,onIsPendingChange:p}=o;let r;e[0]!==n||e[1]!==l.id?(r=Y.commerceDiscoveryCompanionGscSites(l.id,n),e[0]=n,e[1]=l.id,e[2]=r):r=e[2];let f;e[3]!==i?(f=async()=>{const I=await i.callTool({name:"list_sites",arguments:{}});return J(I).sites||[]},e[3]=i,e[4]=f):f=e[4];let m;e[5]!==r||e[6]!==f?(m={queryKey:r,queryFn:f},e[5]=r,e[6]=f,e[7]=m):m=e[7];const h=me(m);let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=Ce(Ns),e[8]=_):_=e[8];const C=t.configurationState?.siteUrl||"";let g;e[9]!==C?(g={resolver:_,defaultValues:{siteUrl:C}},e[9]=C,e[10]=g):g=e[10];const d=ve(g);let y;e[11]!==t||e[12]!==u||e[13]!==l||e[14]!==a?(y={card:t,selfClient:a,org:l,onDone:u},e[11]=t,e[12]=u,e[13]=l,e[14]=a,e[15]=y):y=e[15];const{save:v,isPending:x,error:E}=Qe(y),S=Q.useRef(!1),j=t.configurationState?.siteUrl;let b,N;e[16]!==x||e[17]!==p?(b=()=>{p?.(x)},N=[x,p],e[16]=x,e[17]=p,e[18]=b,e[19]=N):(b=e[18],N=e[19]),Q.useEffect(b,N);let O,R;e[20]!==c||e[21]!==d||e[22]!==j||e[23]!==h.data||e[24]!==h.isSuccess?(O=()=>{if(!(S.current||!h.isSuccess)){if(S.current=!0,j){d.getValues("siteUrl")!==j&&d.setValue("siteUrl",j);return}if(!d.getValues("siteUrl")){const I=Gt(c,h.data??[]);I&&d.setValue("siteUrl",I)}}},R=[h.isSuccess,h.data,j,c,d],e[20]=c,e[21]=d,e[22]=j,e[23]=h.data,e[24]=h.isSuccess,e[25]=O,e[26]=R):(O=e[25],R=e[26]),Q.useEffect(O,R);let w;if(e[27]!==d||e[28]!==v){let I;e[30]!==v?(I=async G=>{v(G)},e[30]=v,e[31]=I):I=e[31],w=d.handleSubmit(I),e[27]=d,e[28]=v,e[29]=w}else w=e[29];const T=w;if(h.isLoading){let I;return e[32]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(He,{label:"Carregando sites..."})}),e[32]=I):I=e[32],I}if(h.isError){let I;return e[33]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[33]=I):I=e[33],I}let L;e[34]!==h.data?(L=h.data||[],e[34]=h.data,e[35]=L):L=e[35];const P=L;if(P.length===0){let I;return e[36]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[36]=I):I=e[36],I}let K;e[37]!==x||e[38]!==P?(K=I=>{const{field:G}=I;return s.jsxs(le,{children:[s.jsx(ce,{children:s.jsx(Ge,{options:P.map(Es),value:G.value,onChange:G.onChange,disabled:x,ariaLabel:"Site verificado"})}),s.jsx(de,{})]})},e[37]=x,e[38]=P,e[39]=K):K=e[39];let $;e[40]!==d.control||e[41]!==K?($=s.jsx(re,{control:d.control,name:"siteUrl",render:K}),e[40]=d.control,e[41]=K,e[42]=$):$=e[42];let q;e[43]!==d||e[44]!==$?(q=s.jsx(je,{...d,children:$}),e[43]=d,e[44]=$,e[45]=q):q=e[45];let M;e[46]!==E?(M=E&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:E instanceof Error?E.message:"Não foi possível salvar a configuração"}),e[46]=E,e[47]=M):M=e[47];let D;e[48]!==x||e[49]!==u?(D=s.jsx(B,{type:"button",variant:"outline",onClick:u,disabled:x,children:"Cancelar"}),e[48]=x,e[49]=u,e[50]=D):D=e[50];const F=x?"Salvando...":"Salvar";let z;e[51]!==x||e[52]!==F?(z=s.jsx(B,{type:"submit",disabled:x,children:F}),e[51]=x,e[52]=F,e[53]=z):z=e[53];let U;e[54]!==D||e[55]!==z?(U=s.jsxs(fe,{className:"pt-4",children:[D,z]}),e[54]=D,e[55]=z,e[56]=U):U=e[56];let k;return e[57]!==T||e[58]!==q||e[59]!==M||e[60]!==U?(k=s.jsxs("form",{onSubmit:T,className:"space-y-4",children:[q,M,U]}),e[57]=T,e[58]=q,e[59]=M,e[60]=U,e[61]=k):k=e[61],k}function Es(o){return{value:o.siteUrl,label:o.siteUrl}}function Is(o){const[e,t]=o.split("/");return!e||!t?null:{owner:e,name:t}}function Ts(o){const{existingRepo:e,owner:t,name:n}=o;return e?.connectionId&&e.owner.toLowerCase()===t.toLowerCase()&&e.name.toLowerCase()===n.toLowerCase()?{connectionId:e.connectionId,installationId:e.installationId}:null}function Os(o){const{existingRepo:e,existingConnections:t,repoConnectionId:n}=o,i=e?.connectionId&&e.connectionId!==n?e.connectionId:void 0,a=[...t.filter(l=>l.connection_id!==n&&l.connection_id!==i),{connection_id:n,selected_tools:[]}];return{staleConnectionId:i,mergedConnections:a}}const Rs=be({githubRepo:ae().min(1,"Selecione um repositório")}),ks=15e3,As=/^[\w.-]+\/[\w.-]+$/;async function Ls(o,e,t,n){const{installations:i}=await yt(o,t),a=n.trim(),l=await Promise.allSettled(i.map(async r=>{const f=r.type==="User"?"user":"org",m=a?`${f}:${r.login} ${a} in:name`:`${f}:${r.login}`,_=await e.callTool({name:"search_repositories",arguments:{query:m,page:1,perPage:50}},void 0,{signal:AbortSignal.timeout(ks)}),C=_.content?.[0]?.text;if(_.isError)throw new Error(C??"search_repositories failed");if(!C)throw new Error("empty search_repositories response");return JSON.parse(C).items??[]})),c=new Map;let u=0;for(const r of l){if(r.status==="rejected"){u+=1;continue}for(const f of r.value)f.full_name&&!c.has(f.full_name)&&c.set(f.full_name,f)}return{repos:Array.from(c.values()).sort((r,f)=>(f.updated_at??"").localeCompare(r.updated_at??"")).map(r=>r.full_name),failed:u,total:i.length}}function Ds(o){const e=H.c(89),{connectionId:t,companionClient:n,selfClient:i,org:a,onDone:l,onIsPendingChange:c}=o,u=he();let p;e[0]!==a.id?(p=ct.COMMERCE_DISCOVERY(a.id),e[0]=a.id,e[1]=p):p=e[1];const r=p,[f,m]=Q.useState(""),h=ns(f,300),_=Q.useRef(!1);let C;e[2]!==t||e[3]!==a.id?(C=Y.commerceDiscoveryCompanionGithubSelected(a.id,t),e[2]=t,e[3]=a.id,e[4]=C):C=e[4];let g;e[5]!==r||e[6]!==i?(g=async()=>{const W=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:r}}),se=J(W).item?.configuration_state??null;return typeof se?.github_repo=="string"?se.github_repo:""},e[5]=r,e[6]=i,e[7]=g):g=e[7];let d;e[8]!==C||e[9]!==g?(d={queryKey:C,queryFn:g},e[8]=C,e[9]=g,e[10]=d):d=e[10];const y=me(d);let v;e[11]!==t||e[12]!==h||e[13]!==a.id?(v=Y.commerceDiscoveryCompanionGithubRepos(a.id,t,h.trim()),e[11]=t,e[12]=h,e[13]=a.id,e[14]=v):v=e[14];let x;e[15]!==n||e[16]!==t||e[17]!==h||e[18]!==i?(x=()=>Ls(W=>i.callTool(W),n,t,h),e[15]=n,e[16]=t,e[17]=h,e[18]=i,e[19]=x):x=e[19];let E;e[20]!==v||e[21]!==x?(E={queryKey:v,queryFn:x},e[20]=v,e[21]=x,e[22]=E):E=e[22];const S=me(E);let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:Ce(Rs),defaultValues:{githubRepo:""}},e[23]=j):j=e[23];const b=ve(j);let N;e[24]!==r||e[25]!==n||e[26]!==t||e[27]!==a.id||e[28]!==a.slug||e[29]!==i?(N=async W=>{const se=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:r}}),jt={...J(se).item?.configuration_state??null??{},github_repo:W};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:r,data:{configuration_state:jt}}});const Ze=Is(W);if(!Ze)throw new Error(`Repositório inválido: "${W}". Use o formato owner/nome.`);const{owner:ge,name:ke}=Ze,Xe=Kt(a.id),Je=J(await i.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:Xe}})).item,et=Je?.metadata?.githubRepo,_t=Je?.connections??[],tt=Ts({existingRepo:et,owner:ge,name:ke});let Ne=tt?.connectionId,Ae=tt?.installationId,Le;if(!Ne){const{installations:De}=await yt(xe=>i.callTool(xe),t),we=os(De,ge);if(!we)throw new Error(`Nenhuma instalação do GitHub encontrada para "${ge}".`);Ae=we.installationId;const nt=J(await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}})).item;if(!nt)throw new Error("Conexão do GitHub não encontrada.");const{childConnectionId:ot}=await is({orgSlug:a.slug,sourceConnection:nt,installationId:Ae,owner:ge,repo:ke,githubCallTool:xe=>n.callTool(xe),selfCallTool:xe=>i.callTool(xe)});Ne=ot,Le=ot}const{staleConnectionId:st,mergedConnections:St}=Os({existingRepo:et,existingConnections:_t,repoConnectionId:Ne});try{await i.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:Xe,data:{connections:St,metadata:{githubRepo:{owner:ge,name:ke,url:`https://github.com/${W}`,installationId:Ae,connectionId:Ne}}}}}),st&&await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:st,force:!0}}).catch(zs)}catch(De){const we=De;throw Le&&await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:Le,force:!0}}).catch($s),we}},e[24]=r,e[25]=n,e[26]=t,e[27]=a.id,e[28]=a.slug,e[29]=i,e[30]=N):N=e[30];let O;e[31]!==r||e[32]!==l||e[33]!==a.id||e[34]!==u?(O=async()=>{await u.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(a.id,r)}),await u.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(a.id)}),$t(u,a.id),l()},e[31]=r,e[32]=l,e[33]=a.id,e[34]=u,e[35]=O):O=e[35];let R;e[36]!==O||e[37]!==N?(R={mutationFn:N,onSuccess:O},e[36]=O,e[37]=N,e[38]=R):R=e[38];const w=Oe(R),T=w.isPending;let L,P;e[39]!==T||e[40]!==c?(L=()=>{c?.(T)},P=[T,c],e[39]=T,e[40]=c,e[41]=L,e[42]=P):(L=e[41],P=e[42]),Q.useEffect(L,P);const K=y.data??"";let $,q;e[43]!==b||e[44]!==y.data||e[45]!==y.isSuccess?($=()=>{!y.isSuccess||_.current||(_.current=!0,y.data&&b.setValue("githubRepo",y.data))},q=[y.isSuccess,y.data,b],e[43]=b,e[44]=y.data,e[45]=y.isSuccess,e[46]=$,e[47]=q):($=e[46],q=e[47]),Q.useEffect($,q);let M;if(e[48]!==b||e[49]!==w){let W;e[51]!==w?(W=async se=>{w.mutate(se.githubRepo)},e[51]=w,e[52]=W):W=e[52],M=b.handleSubmit(W),e[48]=b,e[49]=w,e[50]=M}else M=e[50];const D=M;let F,z,U;if(e[53]!==h||e[54]!==S.data?.failed||e[55]!==S.data?.repos||e[56]!==S.data?.total||e[57]!==K){const W=S.data?.repos??[];F=S.data?.failed??0,U=S.data?.total??0;const se=h.trim();z=[...W],se&&As.test(se)&&!z.includes(se)&&z.unshift(se),K&&!z.includes(K)&&z.push(K),e[53]=h,e[54]=S.data?.failed,e[55]=S.data?.repos,e[56]=S.data?.total,e[57]=K,e[58]=F,e[59]=z,e[60]=U}else F=e[58],z=e[59],U=e[60];const k=U>0&&F===U,I=S.isError||k?"Não foi possível buscar os repositórios (erro ou tempo esgotado). Tente novamente ou digite o repositório no formato owner/nome.":F>0?"Parte da busca falhou — alguns repositórios podem não ter aparecido. Tente novamente ou digite owner/nome.":null;let G;e[61]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(ht,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[61]=G):G=e[61];let Z;e[62]===Symbol.for("react.memo_cache_sentinel")?(Z=W=>m(W.target.value),e[62]=Z):Z=e[62];let X;e[63]!==T||e[64]!==f?(X=s.jsxs("div",{className:"relative",children:[G,s.jsx(_e,{type:"text",value:f,onChange:Z,disabled:T,placeholder:"Buscar repositório","aria-label":"Buscar repositório",className:"h-8 pl-8"})]}),e[63]=T,e[64]=f,e[65]=X):X=e[65];let ee;e[66]!==b||e[67]!==T||e[68]!==z||e[69]!==S.isLoading||e[70]!==I?(ee=S.isLoading?s.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:s.jsx(He,{label:"Carregando repositórios..."})}):s.jsxs(s.Fragment,{children:[I&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:I}),z.length===0?!I&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum repositório encontrado. Digite o nome do repositório (owner/nome) para buscar."}):s.jsx(je,{...b,children:s.jsx(re,{control:b.control,name:"githubRepo",render:W=>{const{field:se}=W;return s.jsxs(le,{children:[s.jsx(ce,{children:s.jsx(Ge,{options:z.map(Ps),value:se.value,onChange:se.onChange,disabled:T,ariaLabel:"Repositório",hideSearch:!0})}),s.jsx(de,{})]})}})})]}),e[66]=b,e[67]=T,e[68]=z,e[69]=S.isLoading,e[70]=I,e[71]=ee):ee=e[71];let V;e[72]!==w.error?(V=w.error&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:w.error instanceof Error?w.error.message:"Não foi possível salvar a configuração"}),e[72]=w.error,e[73]=V):V=e[73];let A;e[74]!==T||e[75]!==l?(A=s.jsx(B,{type:"button",variant:"outline",onClick:l,disabled:T,children:"Cancelar"}),e[74]=T,e[75]=l,e[76]=A):A=e[76];const te=T?"Salvando...":"Salvar";let ne;e[77]!==T||e[78]!==te?(ne=s.jsx(B,{type:"submit",disabled:T,children:te}),e[77]=T,e[78]=te,e[79]=ne):ne=e[79];let ue;e[80]!==A||e[81]!==ne?(ue=s.jsxs(fe,{className:"pt-4",children:[A,ne]}),e[80]=A,e[81]=ne,e[82]=ue):ue=e[82];let Se;return e[83]!==D||e[84]!==X||e[85]!==ee||e[86]!==V||e[87]!==ue?(Se=s.jsxs("form",{onSubmit:D,className:"space-y-4",children:[X,ee,V,ue]}),e[83]=D,e[84]=X,e[85]=ee,e[86]=V,e[87]=ue,e[88]=Se):Se=e[88],Se}function Ps(o){return{value:o,label:o}}function $s(){}function zs(){}const qs={vtex:bs,"google-analytics":js,"google-search-console":ws,github:Ds},pe="deco-reader@decocms.iam.gserviceaccount.com",Ct={"google-analytics":"ga4","google-search-console":"gsc"},vt={ga4:{label:"Google Analytics",resourceLabel:"ID da propriedade",resourcePlaceholder:"ex: 123456789",resourceHint:"No GA4: Admin → Detalhes da propriedade → ID da propriedade (só números).",connectSteps:["Abra o Google Analytics (GA4) da sua loja.","Vá em Admin → Acesso à propriedade (Gerenciamento de acesso).",`Clique em + → Adicionar usuários, cole ${pe} e conceda o papel Leitor.`,"Copie o ID da propriedade (Admin → Detalhes da propriedade) e cole abaixo."]},gsc:{label:"Google Search Console",resourceLabel:"Site / propriedade",resourcePlaceholder:"ex: sc-domain:sualoja.com.br",resourceHint:"Use o mesmo formato que aparece no Search Console: sc-domain:sualoja.com.br ou https://www.sualoja.com.br/.",connectSteps:["Abra o Google Search Console da sua loja.","Vá em Configurações → Usuários e permissões.",`Clique em Adicionar usuário, cole ${pe} e escolha permissão Completa.`,"Copie o endereço do site como aparece no seletor de propriedades e cole abaixo."]}};function Fs(o,e){const t=vt[o].label;switch(e){case"no-access":return{title:`Ainda não conseguimos acessar este recurso no ${t}.`,steps:o==="ga4"?[`Confirme que ${pe} foi adicionado em Admin → Acesso à propriedade com o papel Leitor.`,"Confira se o ID da propriedade está correto (só números, sem o prefixo 'properties/').","A concessão de acesso pode levar alguns segundos — tente novamente."]:[`Confirme que ${pe} foi adicionado em Configurações → Usuários e permissões.`,"A permissão precisa ser Completa ou Restrita — 'Não verificado' não funciona.","Confira se o endereço do site está exatamente como aparece no Search Console."]};case"no-web-stream":return{title:"Esta propriedade do GA4 não tem um fluxo de dados da Web (site) configurado.",steps:["No GA4, vá em Admin → Fluxos de dados.","Clique em Adicionar fluxo → Web.","Informe a URL do site da sua loja e salve o fluxo.","Volte aqui e tente vincular de novo. (Propriedades só de app precisam de vínculo manual — fale com o suporte.)"]};case"no-match":return{title:"O recurso informado não corresponde ao domínio desta loja.",steps:o==="ga4"?["Verifique se digitou o ID da propriedade certa — provavelmente é de outro site.","No GA4, o site medido aparece em Admin → Fluxos de dados → (seu fluxo Web) → URL do stream."]:["Verifique se selecionou a propriedade do Search Console referente a esta loja.","O endereço precisa cobrir o mesmo domínio do diagnóstico."]};case"resource_already_bound":return{title:"Este recurso já está vinculado a outra loja.",steps:["Se este recurso é realmente desta loja, fale com o suporte para uma revisão manual.","Caso tenha digitado o id errado, confira e tente novamente."]};default:return{title:"Não foi possível verificar o acesso a este recurso.",steps:["Revise os passos de acesso acima e tente novamente.","Se persistir, fale com o suporte."]}}}function Ks(o){const e=H.c(76),{provider:t,siteUrl:n,selfClient:i,org:a,initialResourceId:l,onDone:c,onIsPendingChange:u,onOAuthInstead:p}=o,r=vt[t],f=he(),[m,h]=Q.useState(null);let _,C;if(e[0]!==r.resourceLabel){const V=be({resourceId:ae().trim().min(1,`Informe o ${r.resourceLabel.toLowerCase()}`)});C=ve,_=Ce(V),e[0]=r.resourceLabel,e[1]=_,e[2]=C}else _=e[1],C=e[2];const g=l??"";let d;e[3]!==g?(d={resourceId:g},e[3]=g,e[4]=d):d=e[4];let y;e[5]!==_||e[6]!==d?(y={resolver:_,defaultValues:d},e[5]=_,e[6]=d,e[7]=y):y=e[7];const v=C(y);let x;e[8]!==t||e[9]!==i||e[10]!==n?(x=async V=>{if(!n)throw new Error("URL da loja indisponível — recarregue a página.");const A=await i.callTool({name:"COMMERCE_DISCOVERY_BIND",arguments:{siteUrl:n,provider:t,resourceId:V.resourceId}});return J(A)},e[8]=t,e[9]=i,e[10]=n,e[11]=x):x=e[11];let E,S;e[12]!==u?(E=()=>u?.(!0),S=()=>u?.(!1),e[12]=u,e[13]=E,e[14]=S):(E=e[13],S=e[14]);let j;e[15]!==r.label||e[16]!==c||e[17]!==a||e[18]!==t||e[19]!==f||e[20]!==n?(j=async V=>{if(V.ok){h(null),Re.success(`${r.label} conectado`),n&&await f.invalidateQueries({queryKey:Y.commerceDiscoveryConnectionStatus(a.id,n)}),c();return}h({...Fs(t,V.reason??"unknown"),detail:V.detail})},e[15]=r.label,e[16]=c,e[17]=a,e[18]=t,e[19]=f,e[20]=n,e[21]=j):j=e[21];let b;e[22]!==x||e[23]!==E||e[24]!==S||e[25]!==j?(b={mutationFn:x,onMutate:E,onSettled:S,onSuccess:j},e[22]=x,e[23]=E,e[24]=S,e[25]=j,e[26]=b):b=e[26];const N=Oe(b);let O;if(e[27]!==v||e[28]!==N){let V;e[30]!==N?(V=A=>N.mutate(A),e[30]=N,e[31]=V):V=e[31],O=v.handleSubmit(V),e[27]=v,e[28]=N,e[29]=O}else O=e[29];const R=O,w=N.isPending,T=Qs;let L;e[32]!==r.connectSteps?(L=r.connectSteps.map(Ms),e[32]=r.connectSteps,e[33]=L):L=e[33];let P;e[34]!==L?(P=s.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground",children:L}),e[34]=L,e[35]=P):P=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx("code",{className:"min-w-0 flex-1 truncate text-xs text-foreground",children:pe}),e[36]=K):K=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/40 p-2",children:[K,s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",onClick:T,"aria-label":"Copiar e-mail do service account",children:s.jsx(xt,{size:16})})]}),e[37]=$):$=e[37];let q;e[38]!==r.resourceHint||e[39]!==r.resourceLabel||e[40]!==r.resourcePlaceholder||e[41]!==w?(q=V=>{const{field:A}=V;return s.jsxs(le,{children:[s.jsx(Ee,{children:r.resourceLabel}),s.jsx(ce,{children:s.jsx(_e,{...A,placeholder:r.resourcePlaceholder,disabled:w,autoComplete:"off"})}),s.jsx(Jt,{children:r.resourceHint}),s.jsx(de,{})]})},e[38]=r.resourceHint,e[39]=r.resourceLabel,e[40]=r.resourcePlaceholder,e[41]=w,e[42]=q):q=e[42];let M;e[43]!==v.control||e[44]!==q?(M=s.jsx(re,{control:v.control,name:"resourceId",render:q}),e[43]=v.control,e[44]=q,e[45]=M):M=e[45];let D;e[46]!==v||e[47]!==M?(D=s.jsx(je,{...v,children:M}),e[46]=v,e[47]=M,e[48]=D):D=e[48];let F;e[49]!==m?(F=m&&s.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:m.title}),s.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:m.steps.map(Us)})]}),e[49]=m,e[50]=F):F=e[50];let z;e[51]!==N.error||e[52]!==N.isError?(z=N.isError&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N.error instanceof Error?N.error.message:"Não foi possível vincular."}),e[51]=N.error,e[52]=N.isError,e[53]=z):z=e[53];let U;e[54]!==w||e[55]!==p?(U=p?s.jsx("button",{type:"button",onClick:p,disabled:w,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:opacity-50",children:"autorizar via login do Google"}):s.jsx("span",{}),e[54]=w,e[55]=p,e[56]=U):U=e[56];let k;e[57]!==w||e[58]!==c?(k=s.jsx(B,{type:"button",variant:"outline",onClick:c,disabled:w,children:"Cancelar"}),e[57]=w,e[58]=c,e[59]=k):k=e[59];const I=w?"Verificando...":"Vincular";let G;e[60]!==w||e[61]!==I?(G=s.jsx(B,{type:"submit",disabled:w,children:I}),e[60]=w,e[61]=I,e[62]=G):G=e[62];let Z;e[63]!==k||e[64]!==G?(Z=s.jsxs("div",{className:"flex gap-2",children:[k,G]}),e[63]=k,e[64]=G,e[65]=Z):Z=e[65];let X;e[66]!==U||e[67]!==Z?(X=s.jsxs(fe,{className:"flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[U,Z]}),e[66]=U,e[67]=Z,e[68]=X):X=e[68];let ee;return e[69]!==R||e[70]!==P||e[71]!==D||e[72]!==F||e[73]!==z||e[74]!==X?(ee=s.jsxs("form",{onSubmit:R,className:"space-y-4",children:[P,$,D,F,z,X]}),e[69]=R,e[70]=P,e[71]=D,e[72]=F,e[73]=z,e[74]=X,e[75]=ee):ee=e[75],ee}function Us(o){return s.jsxs("li",{className:"flex gap-2",children:[s.jsx("span",{"aria-hidden":!0,children:"•"}),s.jsx("span",{children:o})]},o)}function Ms(o,e){return s.jsxs("li",{className:"flex gap-2",children:[s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-foreground",children:e+1}),s.jsx("span",{children:o})]},o)}function Qs(){navigator.clipboard?.writeText(pe),Re.success("E-mail copiado")}function Gs(){const o=H.c(2);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0];let t;return o[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[e,s.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[s.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),s.jsx("div",{className:"hidden h-3 w-full animate-pulse rounded bg-muted/60 sm:block"})]}),s.jsx("div",{className:"h-8 w-20 shrink-0 animate-pulse rounded-lg bg-muted/60 sm:mt-auto sm:w-full"})]}),o[1]=t):t=o[1],t}const Hs="rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground";function Vs(o){const e=H.c(36),{card:t,connecting:n,disconnecting:i,disabled:a,onConnect:l,onDisconnect:c,org:u,selfClient:p,siteUrl:r,autoOpenConfigFieldKey:f,onAutoOpenConfigHandled:m}=o,h=t.linkedConnectionId,_=Ct[t.bindingType],C=!!_&&t.boundVia!=="oauth";let g;e[0]!==f||e[1]!==t||e[2]!==n||e[3]!==a||e[4]!==i||e[5]!==h||e[6]!==m||e[7]!==l||e[8]!==c||e[9]!==u||e[10]!==_||e[11]!==p||e[12]!==r||e[13]!==C?(g=C&&_?s.jsx(Bs,{card:t,provider:_,org:u,selfClient:p,siteUrl:r,onOAuthInstead:l,disabled:a,connecting:n}):t.satisfied&&h?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Me,{size:16,className:"text-success"})," Conectado"]}),s.jsx(Q.Suspense,{fallback:s.jsx(Ws,{}),children:s.jsx(Ys,{card:t,org:u,selfClient:p,connectionId:h,contextSiteUrl:r,autoOpen:Ht({autoOpenFieldKey:f,card:t}),onAutoOpenHandled:m})}),s.jsxs(Fe,{children:[s.jsx(Ke,{asChild:!0,children:s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:a||i,onClick:c,"aria-label":`Desconectar ${t.title}`,children:i?s.jsx(Ie,{size:16,className:"animate-spin"}):s.jsx(Mt,{size:16})})}),s.jsx(Ue,{children:"Desconectar"})]})]}):s.jsx(B,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:a||n,onClick:l,"aria-label":`Conectar ${t.title}`,children:n?s.jsx(Ie,{size:16,className:"animate-spin"}):"Conectar"}),e[0]=f,e[1]=t,e[2]=n,e[3]=a,e[4]=i,e[5]=h,e[6]=m,e[7]=l,e[8]=c,e[9]=u,e[10]=_,e[11]=p,e[12]=r,e[13]=C,e[14]=g):g=e[14];const d=g;let y;e[15]!==t.icon||e[16]!==t.title?(y=s.jsx(qe,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"shrink-0 p-1.5"}),e[15]=t.icon,e[16]=t.title,e[17]=y):y=e[17];let v;e[18]!==t.area?(v=t.area&&s.jsx("span",{className:ie("hidden sm:inline-block",Hs),children:t.area}),e[18]=t.area,e[19]=v):v=e[19];let x;e[20]!==y||e[21]!==v?(x=s.jsxs("div",{className:"shrink-0 sm:flex sm:w-full sm:items-center sm:justify-between sm:gap-2",children:[y,v]}),e[20]=y,e[21]=v,e[22]=x):x=e[22];let E;e[23]!==t.title?(E=s.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),e[23]=t.title,e[24]=E):E=e[24];let S;e[25]!==t.headline?(S=t.headline&&s.jsx("p",{className:"hidden text-sm leading-5 text-muted-foreground sm:mt-0.5 sm:line-clamp-2 sm:block",children:t.headline}),e[25]=t.headline,e[26]=S):S=e[26];let j;e[27]!==E||e[28]!==S?(j=s.jsxs("div",{className:"min-w-0 flex-1",children:[E,S]}),e[27]=E,e[28]=S,e[29]=j):j=e[29];let b;e[30]!==d?(b=s.jsx("div",{className:"shrink-0 sm:mt-auto sm:w-full sm:pt-1",children:d}),e[30]=d,e[31]=b):b=e[31];let N;return e[32]!==x||e[33]!==j||e[34]!==b?(N=s.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[x,j,b]}),e[32]=x,e[33]=j,e[34]=b,e[35]=N):N=e[35],N}function Bs(o){const e=H.c(39),{card:t,provider:n,org:i,selfClient:a,siteUrl:l,onOAuthInstead:c,disabled:u,connecting:p}=o,[r,f]=Q.useState(!1),[m,h]=Q.useState(!1);let _;e[0]!==m?(_=T=>{!T&&m||f(T)},e[0]=m,e[1]=_):_=e[1];const C=_;let g;e[2]!==t.satisfied||e[3]!==t.title||e[4]!==p||e[5]!==u?(g=t.satisfied?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Me,{size:16,className:"text-success"})," Conectado"]}),s.jsxs(Fe,{children:[s.jsx(Ke,{asChild:!0,children:s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>f(!0),"aria-label":`Configurar ${t.title}`,children:s.jsx(gt,{size:16})})}),s.jsx(Ue,{children:"Editar configuração"})]})]}):s.jsx(B,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:u||p,onClick:()=>f(!0),"aria-label":`Conectar ${t.title}`,children:p?s.jsx(Ie,{size:16,className:"animate-spin"}):"Conectar"}),e[2]=t.satisfied,e[3]=t.title,e[4]=p,e[5]=u,e[6]=g):g=e[6];let d;e[7]!==t.icon||e[8]!==t.title?(d=s.jsx(qe,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[7]=t.icon,e[8]=t.title,e[9]=d):d=e[9];let y;e[10]!==t.title?(y=s.jsx(dt,{children:t.title}),e[10]=t.title,e[11]=y):y=e[11];let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ut,{children:"Conceda acesso ao nosso leitor e informe o identificador"}),e[12]=v):v=e[12];let x;e[13]!==y?(x=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[y,v]}),e[13]=y,e[14]=x):x=e[14];let E;e[15]!==d||e[16]!==x?(E=s.jsxs(mt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[d,x]}),e[15]=d,e[16]=x,e[17]=E):E=e[17];const S=t.boundResource??void 0;let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f(!1),e[18]=j):j=e[18];let b;e[19]!==t.satisfied||e[20]!==c?(b=t.satisfied?void 0:()=>{f(!1),c()},e[19]=t.satisfied,e[20]=c,e[21]=b):b=e[21];let N;e[22]!==i||e[23]!==n||e[24]!==a||e[25]!==l||e[26]!==b||e[27]!==S?(N=s.jsx(Ks,{provider:n,siteUrl:l,selfClient:a,org:i,initialResourceId:S,onDone:j,onIsPendingChange:h,onOAuthInstead:b}),e[22]=i,e[23]=n,e[24]=a,e[25]=l,e[26]=b,e[27]=S,e[28]=N):N=e[28];let O;e[29]!==N||e[30]!==E?(O=s.jsxs(ft,{className:"sm:max-w-lg",children:[E,N]}),e[29]=N,e[30]=E,e[31]=O):O=e[31];let R;e[32]!==C||e[33]!==r||e[34]!==O?(R=s.jsx(pt,{open:r,onOpenChange:C,children:O}),e[32]=C,e[33]=r,e[34]=O,e[35]=R):R=e[35];let w;return e[36]!==R||e[37]!==g?(w=s.jsxs(s.Fragment,{children:[g,R]}),e[36]=R,e[37]=g,e[38]=w):w=e[38],w}function Ws(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0],e}function Ys(o){const e=H.c(60),{card:t,org:n,selfClient:i,connectionId:a,contextSiteUrl:l,autoOpen:c,onAutoOpenHandled:u}=o;let p;e[0]!==a||e[1]!==n.id||e[2]!==n.slug?(p={connectionId:a,orgId:n.id,orgSlug:n.slug},e[0]=a,e[1]=n.id,e[2]=n.slug,e[3]=p):p=e[3];const r=ze(p),[f,m]=Q.useState(c),[h,_]=Q.useState(!1),C=he(),g=qs[t.bindingType],d=Vt(t.configurationState);let y;e[4]!==c||e[5]!==u?(y=()=>{m(!1),c&&u()},e[4]=c,e[5]=u,e[6]=y):y=e[6];const v=y;let x;e[7]!==v||e[8]!==h?(x=I=>{if(!(!I&&h)){if(!I){v();return}m(!0)}},e[7]=v,e[8]=h,e[9]=x):x=e[9];const E=x;let S;e[10]!==a||e[11]!==i?(S=async()=>{await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})},e[10]=a,e[11]=i,e[12]=S):S=e[12];let j;e[13]!==t.title||e[14]!==v||e[15]!==n.id||e[16]!==C?(j=async()=>{await C.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(n.id)}),Re.success(`${t.title} desconectado`),v()},e[13]=t.title,e[14]=v,e[15]=n.id,e[16]=C,e[17]=j):j=e[17];let b;e[18]!==S||e[19]!==j?(b={mutationFn:S,onSuccess:j,onError:Zs},e[18]=S,e[19]=j,e[20]=b):b=e[20];const N=Oe(b);if(!g)return null;let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=()=>m(!0),e[21]=O):O=e[21];const R=`Configurar ${t.title}`;let w;e[22]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(gt,{size:16}),e[22]=w):w=e[22];let T;e[23]!==R?(T=s.jsx(Ke,{asChild:!0,children:s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:O,"aria-label":R,children:w})}),e[23]=R,e[24]=T):T=e[24];const L=d.length>0?"Editar configuração":"Configurar";let P;e[25]!==L?(P=s.jsx(Ue,{children:L}),e[25]=L,e[26]=P):P=e[26];let K;e[27]!==T||e[28]!==P?(K=s.jsxs(Fe,{children:[T,P]}),e[27]=T,e[28]=P,e[29]=K):K=e[29];let $;e[30]!==t.icon||e[31]!==t.title?($=s.jsx(qe,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[30]=t.icon,e[31]=t.title,e[32]=$):$=e[32];let q;e[33]!==t.title?(q=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsx(dt,{children:t.title}),s.jsxs(ut,{children:["Configure o ",t.title," para enriquecer os dados"]})]}),e[33]=t.title,e[34]=q):q=e[34];let M;e[35]!==$||e[36]!==q?(M=s.jsxs(mt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[$,q]}),e[35]=$,e[36]=q,e[37]=M):M=e[37];let D;e[38]!==N?(D=()=>N.mutate(),e[38]=N,e[39]=D):D=e[39];let F;e[40]!==g||e[41]!==t||e[42]!==v||e[43]!==r||e[44]!==a||e[45]!==l||e[46]!==n||e[47]!==i||e[48]!==D?(F=s.jsx(g,{card:t,connectionId:a,companionClient:r,selfClient:i,org:n,contextSiteUrl:l,onDone:v,onDisconnect:D,onIsPendingChange:_}),e[40]=g,e[41]=t,e[42]=v,e[43]=r,e[44]=a,e[45]=l,e[46]=n,e[47]=i,e[48]=D,e[49]=F):F=e[49];let z;e[50]!==M||e[51]!==F?(z=s.jsxs(ft,{className:"sm:max-w-lg",children:[M,F]}),e[50]=M,e[51]=F,e[52]=z):z=e[52];let U;e[53]!==f||e[54]!==E||e[55]!==z?(U=s.jsx(pt,{open:f,onOpenChange:E,children:z}),e[53]=f,e[54]=E,e[55]=z,e[56]=U):U=e[56];let k;return e[57]!==K||e[58]!==U?(k=s.jsxs(s.Fragment,{children:[K,U]}),e[57]=K,e[58]=U,e[59]=k):k=e[59],k}function Zs(){Re.error("Não foi possível desconectar. Tente novamente.")}const Ve={vtex:{registryAppId:"deco/vtex",area:"Catálogo",headline:"Rupturas e PDPs que travam suas vendas."},"google-analytics":{registryAppId:"deco/google-analytics",area:"Funil",headline:"Onde a receita vaza no seu funil."},"google-search-console":{registryAppId:"deco/google-search-console",area:"Busca",headline:"O tráfego de busca que você deixa na mesa."},github:{registryAppId:"deco/mcp-github",area:"Engenharia",headline:"A saúde da entrega de código por trás da sua loja."}};function Xs(o){const e=H.c(40),{selfClient:t,org:n,cdConnectionId:i,siteUrl:a}=o;let l;e[0]!==i||e[1]!==n.id||e[2]!==n.slug?(l={connectionId:i,orgId:n.id,orgSlug:n.slug},e[0]=i,e[1]=n.id,e[2]=n.slug,e[3]=l):l=e[3];const c=ze(l);let u;e[4]!==i||e[5]!==n.id?(u=Y.commerceDiscoveryCompanionSchema(n.id,i),e[4]=i,e[5]=n.id,e[6]=u):u=e[6];let p;e[7]!==c?(p=async()=>{const A=await c.callTool({name:"MCP_CONFIGURATION",arguments:{}});return J(A)},e[7]=c,e[8]=p):p=e[8];let r;e[9]!==u||e[10]!==p?(r={queryKey:u,queryFn:p,retry:!1},e[9]=u,e[10]=p,e[11]=r):r=e[11];const f=me(r),m=f.data?.stateSchema?Bt(f.data.stateSchema):null,h=m&&m.length>0?m:Wt,_=h.map(cn),C=h.map(ln).filter(rn),g=h.filter(an).map(on),d=[...C,...g].sort().join(",");let y;e[12]!==i||e[13]!==n.id?(y=Y.commerceDiscoveryConnection(n.id,i),e[12]=i,e[13]=n.id,e[14]=y):y=e[14];let v;e[15]!==i||e[16]!==t?(v=async()=>{const A=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return J(A)},e[15]=i,e[16]=t,e[17]=v):v=e[17];let x;e[18]!==y||e[19]!==v?(x={queryKey:y,queryFn:v},e[18]=y,e[19]=v,e[20]=x):x=e[20];const S=Pe(x).data?.item?.configuration_state??null;let j;e[21]!==S?(j=A=>S?.[A.fieldKey]?.value,e[21]=S,e[22]=j):j=e[22];const b=h.map(j).filter(nn),N=[..._.map(sn),...C.map(tn),...b.map(en)].sort().join(","),R=Pe({queryKey:Y.commerceDiscoveryCompanionConnections(n.id,N),queryFn:async()=>{if(h.length===0)return{items:[]};const A=[{field:["app_name"],operator:"in",value:_},{field:["app_id"],operator:"in",value:C}];b.length>0&&A.push({field:["id"],operator:"in",value:b});const te=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:A},limit:1e3}});return J(te)}}).data?.items??[],w=new Set(b),T=R.filter(A=>w.has(A.id)),L=T.filter(Js);let P;e[23]!==n.id||e[24]!==n.slug?(P=A=>({queryKey:Y.commerceDiscoveryCompanionOAuthStatus(n.id,A.id),queryFn:async()=>{try{const te=await fetch(`/api/${encodeURIComponent(n.slug)}/connections/${encodeURIComponent(A.id)}/oauth-token/status`,{credentials:"include"});return te.ok?{hasToken:(await te.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=n.id,e[24]=n.slug,e[25]=P):P=e[25];const K=ms({queries:L.map(P)});let $;e[26]!==K?($=(A,te)=>[A.id,K[te]?.data?.hasToken===!0],e[26]=K,e[27]=$):$=e[27];const q=new Map(L.map($)),M={};for(const A of T)M[A.id]=!A.oauth_config||!!A.connection_token||q.get(A.id)===!0;const D=Pe({queryKey:Y.commerceDiscoveryCompanionRegistry(n.id,d),queryFn:async()=>{if(h.length===0)return{items:[]};const A=Yt(C,g),te=await as(ct.REGISTRY(n.id),n.id,n.slug,"COLLECTION_REGISTRY_APP_LIST",{...A?{where:A}:{},limit:1e3});return J(te)}}),F={},z={};for(const A of D.data?.items??[])F[A.id]=A,A.server?.name&&(z[A.server.name]=A);let U;e[28]!==n.id||e[29]!==a?(U=Y.commerceDiscoveryConnectionStatus(n.id,a??""),e[28]=n.id,e[29]=a,e[30]=U):U=e[30];const k=!!a;let I;e[31]!==t||e[32]!==a?(I=async()=>{const A=await t.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:a}});return J(A)},e[31]=t,e[32]=a,e[33]=I):I=e[33];let G;e[34]!==U||e[35]!==k||e[36]!==I?(G={queryKey:U,enabled:k,queryFn:I},e[34]=U,e[35]=k,e[36]=I,e[37]=G):G=e[37];const Z=me(G),X={};for(const[A,te]of Object.entries(Ct)){const ne=Z.data?.providers?.[te];ne?.connected&&ne.via==="sa"&&(X[A]={resource:ne.resource??null})}const ee=Zt({requirements:h,itemsById:F,itemsByName:z,connections:R,connectionReadiness:M,configurationState:S,curated:Ve,saBindings:X});let V;return e[38]!==ee?(V={cards:ee},e[38]=ee,e[39]=V):V=e[39],V}function Js(o){return o.oauth_config&&!o.connection_token}function en(o){return`linked:${o}`}function tn(o){return`app:${o}`}function sn(o){return`binding:${o}`}function nn(o){return typeof o=="string"&&o.length>0}function on(o){return o.bindingType}function an(o){return!Ve[o.bindingType]}function rn(o){return!!o}function ln(o){return Ve[o.bindingType]?.registryAppId}function cn(o){return o.bindingType}function dn({selfClient:o,org:e,userId:t,cdConnectionId:n,domain:i,siteUrl:a}){const l=he(),[c,u]=Q.useState(null),[p,r]=Q.useState(null),[f,m]=Q.useState(null),h=async(g,d)=>{const y=await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:g,data:d}});return J(y)};async function _(g){u(g.fieldKey),m(null);const d={app_name:g.title,field_key:g.fieldKey,organization_id:e.id,domain:i,site_url:a};oe("commerce_onboarding_companion_connect_clicked",d);try{let y=g.candidateConnectionId;if(!y){const b=rs(g.registryItem,e.id,t,{remoteIndex:0}),N=b.connection_type==="STDIO",O=!!b.connection_url,R=N&&b.connection_headers&&typeof b.connection_headers=="object"&&"command"in b.connection_headers;if(!O&&!R)return oe("commerce_onboarding_companion_connect_failed",{...d,error:"no_connection_method"}),m(`${g.title} cannot be connected: no connection method available`),!1;const w=await o.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:b}});y=J(w).item.id}const v=y,x=await ls({connectionId:v,orgId:e.id,orgSlug:e.slug,persistFallback:b=>h(v,{connection_token:b}).then(()=>{})});if(!x.ok)return oe("commerce_onboarding_companion_connect_failed",{...d,error:x.error}),m(`Couldn't sign in to ${g.title}: ${x.error}`),!1;const E=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}}),S=J(E).item?.configuration_state??null,j=Xt(S,g.fieldKey,g.bindingType,v);return g.bindingType==="github"&&delete j.github_repo,await h(n,{configuration_state:j}),await l.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(e.id,n)}),await l.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),oe("commerce_onboarding_companion_connected",d),!0}catch(y){return oe("commerce_onboarding_companion_connect_failed",{...d,error:y instanceof Error?y.message:String(y)}),m(y instanceof Error?y.message:String(y)),!1}finally{u(null)}}async function C(g){r(g.fieldKey),m(null);const d={app_name:g.title,field_key:g.fieldKey,organization_id:e.id,domain:i,site_url:a};oe("commerce_onboarding_companion_disconnect_clicked",d);try{const y=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}}),x={...J(y).item?.configuration_state??null??{}};return delete x[g.fieldKey],g.bindingType==="github"&&delete x.github_repo,await h(n,{configuration_state:x}),await l.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(e.id,n)}),await l.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),oe("commerce_onboarding_companion_disconnected",d),!0}catch(y){return oe("commerce_onboarding_companion_disconnect_failed",{...d,error:y instanceof Error?y.message:String(y)}),m(y instanceof Error?y.message:String(y)),!1}finally{r(null)}}return{connect:_,connectingFieldKey:c,disconnect:C,disconnectingFieldKey:p,error:f}}const Be="flex min-h-0 flex-1 flex-col gap-4 md:grid md:flex-none md:gap-4";function We(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h1",{className:"text-lg font-medium leading-6 text-foreground lg:text-2xl lg:leading-8",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),o[0]=e):e=o[0],e}function un(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[0,1,2,3].map(mn)}),o[0]=e):e=o[0],e}function mn(o){return s.jsx(Gs,{},o)}function fn(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:Be,children:[s.jsx(We,{}),s.jsx(un,{})]}),o[0]=e):e=o[0],e}function pn(o){const e=H.c(5),{onRetry:t}=o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(We,{}),e[0]=n):n=e[0];let i,a;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),a=s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=i,e[2]=a):(i=e[1],a=e[2]);let l;return e[3]!==t?(l=s.jsxs("div",{className:Be,children:[n,s.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i,a,s.jsx(B,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:"Tentar novamente"})]})]}),e[3]=t,e[4]=l):l=e[4],l}function Hn(o){const e=H.c(2);let t;return e[0]!==o?(t=s.jsx(zt,{children:n=>{const{reset:i}=n;return s.jsx(qt,{fallback:a=>{const{resetError:l}=a;return s.jsx(pn,{onRetry:()=>{i(),l()}})},children:s.jsx(Q.Suspense,{fallback:s.jsx(fn,{}),children:s.jsx(hn,{...o})})})}}),e[0]=o,e[1]=t):t=e[1],t}function hn(o){const e=H.c(46),{org:t,cdConnectionId:n,siteUrl:i,onReadinessChange:a}=o,{data:l}=Ft.useSession(),c=l?.user?.id??"";let u;if(e[0]!==i){const R=i?Te(i):null;if(R?.ok)try{u=new URL(R.value).hostname}catch{u=void 0}e[0]=i,e[1]=u}else u=e[1];let p;e[2]!==t.id||e[3]!==t.slug?(p={connectionId:Ut,orgId:t.id,orgSlug:t.slug},e[2]=t.id,e[3]=t.slug,e[4]=p):p=e[4];const r=ze(p);let f;e[5]!==n||e[6]!==t||e[7]!==r||e[8]!==i?(f={selfClient:r,org:t,cdConnectionId:n,siteUrl:i},e[5]=n,e[6]=t,e[7]=r,e[8]=i,e[9]=f):f=e[9];const{cards:m}=Xs(f);let h;e[10]!==n||e[11]!==t||e[12]!==r||e[13]!==u||e[14]!==i||e[15]!==c?(h={selfClient:r,org:t,userId:c,cdConnectionId:n,domain:u,siteUrl:i},e[10]=n,e[11]=t,e[12]=r,e[13]=u,e[14]=i,e[15]=c,e[16]=h):h=e[16];const{connect:_,connectingFieldKey:C,disconnect:g,disconnectingFieldKey:d,error:y}=dn(h),[v,x]=Q.useState(null);if(a?.(m.length===0||m.some(gn)),m.length===0)return null;const E=C!==null||d!==null;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(We,{}),e[17]=S):S=e[17];let j;e[18]!==y?(j=y&&s.jsx("p",{role:"alert",className:"mb-3 text-sm text-destructive",children:y}),e[18]=y,e[19]=j):j=e[19];let b;if(e[20]!==v||e[21]!==E||e[22]!==m||e[23]!==_||e[24]!==C||e[25]!==g||e[26]!==d||e[27]!==t||e[28]!==r||e[29]!==i){let R;e[31]!==v||e[32]!==E||e[33]!==_||e[34]!==C||e[35]!==g||e[36]!==d||e[37]!==t||e[38]!==r||e[39]!==i?(R=w=>{const T=async()=>{await _(w)&&x(w.fieldKey)};return s.jsx(Vs,{card:w,connecting:C===w.fieldKey,disconnecting:d===w.fieldKey,disabled:E&&C!==w.fieldKey&&d!==w.fieldKey,org:t,selfClient:r,siteUrl:i,autoOpenConfigFieldKey:v,onAutoOpenConfigHandled:()=>x(L=>L===w.fieldKey?null:L),onConnect:()=>{T()},onDisconnect:()=>{g(w)}},w.fieldKey)},e[31]=v,e[32]=E,e[33]=_,e[34]=C,e[35]=g,e[36]=d,e[37]=t,e[38]=r,e[39]=i,e[40]=R):R=e[40],b=m.map(R),e[20]=v,e[21]=E,e[22]=m,e[23]=_,e[24]=C,e[25]=g,e[26]=d,e[27]=t,e[28]=r,e[29]=i,e[30]=b}else b=e[30];let N;e[41]!==b?(N=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:b}),e[41]=b,e[42]=N):N=e[42];let O;return e[43]!==j||e[44]!==N?(O=s.jsxs("div",{className:Be,children:[S,s.jsxs(xs,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[min(60vh,calc(100dvh-330px))] md:flex-none",children:[j,N]})]}),e[43]=j,e[44]=N,e[45]=O):O=e[45],O}function gn(o){return o.satisfied}const Ye="https://decocms.com/agendar",xn="Precisa de ajuda? Fale conosco",yn="Agende uma chamada e ajudamos você a conectar suas ferramentas.",ye=[{photo:"https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png",alt:"Especialista da deco"}],bn="var(--brand-green-dark)";function Vn({siteUrl:o,email:e}){const t=new URL(Ye);return o&&t.searchParams.set("siteUrl",o),e&&t.searchParams.set("email",e),t.toString()}function Cn(o){const e=H.c(12),{href:t,size:n,className:i,orgId:a}=o,l=t===void 0?Ye:t,c=n===void 0?"lg":n;let u;e[0]!==i?(u=ie("w-full",i),e[0]=i,e[1]=u):u=e[1];let p;e[2]!==a?(p=()=>oe("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:a}),e[2]=a,e[3]=p):p=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(bt,{size:16}),e[4]=r):r=e[4];let f;e[5]!==l||e[6]!==p?(f=s.jsxs("a",{href:l,target:"_blank",rel:"noreferrer",onClick:p,children:["Agendar uma reunião",r]}),e[5]=l,e[6]=p,e[7]=f):f=e[7];let m;return e[8]!==c||e[9]!==u||e[10]!==f?(m=s.jsx(B,{asChild:!0,variant:"outline",size:c,className:u,children:f}),e[8]=c,e[9]=u,e[10]=f,e[11]=m):m=e[11],m}function vn(o){const e=H.c(10),{size:t}=o,n=t===void 0?72:t;let i;e[0]!==n?(i=Math.round(n*.3),e[0]=n,e[1]=i):i=e[1];const a=i;let l;e[2]!==n?(l={height:n},e[2]=n,e[3]=l):l=e[3];let c;e[4]!==a||e[5]!==n?(c=ye.map((p,r)=>s.jsxs("div",{className:"relative shrink-0",style:{width:n,height:n,marginLeft:r===0?0:-a,zIndex:ye.length-r},children:[s.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:s.jsx("img",{src:p.photo,alt:p.alt,className:"h-full w-full object-cover",loading:"lazy"})}),r===0&&s.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[s.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),s.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},p.photo)),e[4]=a,e[5]=n,e[6]=c):c=e[6];let u;return e[7]!==l||e[8]!==c?(u=s.jsx("div",{className:"flex items-end",style:l,children:c}),e[7]=l,e[8]=c,e[9]=u):u=e[9],u}function Bn(o){const e=H.c(6),{href:t,orgId:n}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"h-20",style:{backgroundColor:bn}}),e[0]=i):i=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"-mt-9 mb-4",children:s.jsx(vn,{})}),e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:xn}),s.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:yn})]}),e[2]=l):l=e[2];let c;return e[3]!==t||e[4]!==n?(c=s.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:s.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[i,s.jsxs("div",{className:"px-8 pb-8",children:[a,l,s.jsx(Cn,{href:t,size:"lg",className:"mt-6",orgId:n})]})]})}),e[3]=t,e[4]=n,e[5]=c):c=e[5],c}function Wn(o){const e=H.c(13),{className:t,href:n,orgId:i}=o,a=n===void 0?Ye:n;let l;e[0]!==i?(l=()=>oe("commerce_onboarding_meeting_cta_clicked",{placement:"mobile_banner",organization_id:i}),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==t?(c=ie("flex items-center gap-3 rounded-xl border border-border bg-card p-3 card-shadow transition-colors hover:bg-accent",t),e[2]=t,e[3]=c):c=e[3];let u,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(u={height:32,width:32+2*Math.round(22.4)},p=ye.map(jn),e[4]=u,e[5]=p):(u=e[4],p=e[5]);let r,f,m;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"relative flex shrink-0 items-center",style:u,children:[p,s.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full border-2 border-card bg-success","aria-hidden":!0,style:{zIndex:ye.length+1}})]}),f=s.jsx("span",{className:"flex-1 text-sm font-medium leading-tight text-foreground",children:"Precisa de ajuda? Fale conosco"}),m=s.jsx(bt,{size:16,className:"shrink-0 text-muted-foreground"}),e[6]=r,e[7]=f,e[8]=m):(r=e[6],f=e[7],m=e[8]);let h;return e[9]!==a||e[10]!==l||e[11]!==c?(h=s.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",onClick:l,className:c,children:[r,f,m]}),e[9]=a,e[10]=l,e[11]=c,e[12]=h):h=e[12],h}function jn(o,e){return s.jsx("span",{className:"absolute block h-8 w-8 overflow-hidden rounded-full border-2 border-card",style:{left:e*Math.round(22.4),zIndex:ye.length-e},children:s.jsx("img",{src:o.photo,alt:o.alt,className:"h-full w-full object-cover",loading:"lazy"})},o.photo)}function Yn(o){const e=H.c(10),{host:t}=o,n=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let i,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=s.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=i,e[1]=a,e[2]=l):(i=e[0],a=e[1],l=e[2]);let c;e[3]!==n?(c=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:s.jsx("img",{src:n,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=n,e[4]=c):c=e[4];let u;e[5]!==t?(u=s.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=u):u=e[6];let p;return e[7]!==c||e[8]!==u?(p=s.jsxs("div",{className:"flex items-center gap-3",children:[i,a,l,c,u]}),e[7]=c,e[8]=u,e[9]=p):p=e[9],p}function _n(o){return o.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function Zn(o){const e=o;if(e.isError)throw new Error(_n(e));return e.structuredContent??o}export{fn as C,He as L,Yn as S,xs as a,Vn as b,Bn as c,Hn as d,Wn as e,Qn as i,Te as n,Zn as p,Gn as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as T,j as t,r as Q,B as je,i as be}from"./index-CIFSbzEF.js";import{i as Se}from"./ChevronRight-Ck0jEpLN.js";import{a1 as fe}from"./agent-icon-C6bqiv4x.js";import{m as ue}from"./automation-runs-CA0Zbin0.js";import{r as Ne,u as ke,a as _e,b as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-DPU2cMFP.js";import{a3 as xe,r as ze}from"./index-QQfVHF6c.js";import{a as ge}from"./Image01-jwttKGpp.js";import"./AlertCircle-C1QMMByE.js";import"./Tool01-CiB1AgGO.js";import"./ArrowUp-DH3o_6rV.js";import"./Settings02-DkDTX6wF.js";import"./Tool02-DatlcCMD.js";import"./ArrowRight-CMDrgznR.js";import"./ArrowUpRight-ChAriHcE.js";import"./TrendUp01-CtjoH8ZL.js";import"./ZapSquare-BrF3B-Lj.js";import"./ZoomOut-HpkK_jz9.js";import"./Users03-uSqerTaX.js";import"./CheckCircle-DLrShk9W.js";import"./Check-CfdDVvTz.js";import"./ChevronDown-BRbMyZ1B.js";import"./ChevronUp-BT9WG4FQ.js";import"./DotsVertical-DuorjQq1.js";import"./Stars02-CWszz6x7.js";import"./Copy01-Du_h2a2a.js";import"./Globe01-FT_j78GO.js";import"./Eye-IdG-7KTy.js";import"./FilterLines-VrXrRt9f.js";import"./Star01-IywRndO8.js";import"./Globe04-BktKmpI1.js";import"./SwitchHorizontal01-mvedp9Fy.js";import"./HardDrive-y6RDSyxS.js";import"./Key01-CTHo646W.js";import"./LayoutLeft-DDdEDKm1.js";import"./XCircle-C1KpQxmr.js";import"./LinkExternal01-Dw89NskH.js";import"./Monitor01-D8aw2U1c.js";import"./Sun-CKE25B6W.js";import"./Package-Bl4wI6gQ.js";import"./Palette-Bb5lq-lb.js";import"./Play-h_GYgW2i.js";import"./Plus-DW8HTiM4.js";import"./SearchLg-CuxPI6CH.js";import"./SearchMd-B_vHLGSV.js";import"./Shield01-BTjWMfyt.js";import"./Stars01-awBCSC7p.js";import"./Trash01-BFrDxOoF.js";import"./Upload01-BbY627dR.js";import"./User01-JYrKFpRC.js";import"./Users01-C_vPeB-O.js";import"./XClose-CVT1rN5P.js";import"./X-BWhzmnUU.js";import"./Zap-yAX2Kmmw.js";import"./select-mGmKPAXK.js";import"./tooltip-B6N5kQd7.js";import"./useInfiniteQuery-2fWwANBn.js";import"./use-infinite-scroll-DVSx3Rq1.js";import"./use-connection-DpPEk8aM.js";import"./use-collections-B-IkeUFK.js";import"./use-mcp-client-CJ_CTOi-.js";import"./auth-C9enaQvD.js";import"./use-virtual-mcp-GqxJcvwl.js";import"./card-Dd8gUiG_.js";import"./sidebar-BssgvH2v.js";import"./use-mobile-48jgjwiy.js";import"./table-ClDYVeNV.js";import"./empty-state-CMGZe-XE.js";import"./use-members-CgnYyzxD.js";import"./use-org-auth-client-C7loj_lF.js";import"./use-clock-tick-CEJuEsd_.js";import"./use-automations-lLiWCOOl.js";import"./studio-tools-DvzlcJzu.js";import"./useSuspenseInfiniteQuery-BFB3UBwe.js";import"./avatar-CMlDI2D-.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DkMO92nk.js";import"./file-type-icon-D7Qv-wcj.js";import"./dialog-a73gSkG2.js";import"./tab-id-BijBBRwE.js";import"./hooks-Ck4NS0BB.js";import"./decopilot-sse-pool-D92X3fNc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-Bn6Q6CeX.js";import"./autosend-CxPf5RKw.js";import"./use-ai-providers-kGXTar-o.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-BlazccAI.js";import"./use-organization-settings-lcyinZ9M.js";import"./monaco-editor-1CxGfHM9.js";import"./index-Bm76WXPR.js";import"./index-BPUUTwje.js";import"./calendar-CcmR6PZG.js";import"./use-t-DfEf5oHx.js";import"./shell-layout-wwtr-wuO.js";import"./required-auth-layout-KO0-1qXO.js";import"./use-org-sso-Bs00unXo.js";import"./integration-icon-8ogu7iqA.js";import"./use-navigate-to-agent-BuwUdTe3.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-q7Xrveeh.js";import"./form-hOrojcOx.js";import"./label-BCtHDi1-.js";import"./input-COKCWjWn.js";import"./switch-ChtDpIb1.js";import"./drawer-BU_sOAKq.js";import"./collection-search-B_OixFPO.js";import"./index-CufVwosA.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-MQ7-Pl5L.js";import"./use-mcp-tools-CS9HoteL.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-pF30Ku2c.js";import"./mcp-oauth-C4qKLSfa.js";import"./extract-connection-data-DB1JAVkl.js";import"./dropdown-menu-QheVZMJA.js";import"./popover-MfTivQME.js";import"./command-CBlINdWQ.js";import"./index-D1R93mn_.js";import"./companions-core-CBtA8C2P.js";import"./tabs-Byd14nsc.js";import"./toggle-group--i6PYyQg.js";import"./use-deco-credits-CipyX0UT.js";import"./connection-card-DgbR5Mwx.js";import"./use-registry-connections-By2otvi-.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-Duro92xh.js";import"./connection-form-helpers-DKOWpJ-1.js";import"./collection-tabs-BbylyFFO.js";import"./badge-BIKuZNrQ.js";import"./connect-desktop-dialog-CS8xcpUf.js";import"./select-model-DTW46aHa.js";import"./checkbox-D0oew71k.js";import"./skeleton-bahy-09d.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BrZlvNfy.js";import"./index-Cotl-Dca.js";import"./alert-dialog-BeSbCM7Y.js";import"./toolbar-C7-EzPT_.js";import"./use-debounced-value-DMJgrRLy.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Lt_bZnJO.js";import"./use-capability-n8ljqiDB.js";import"./toolbar-icon-button-VdYqoEpj.js";import"./use-debounced-autosave-bRNiU42w.js";import"./index-BZIMlfJW.js";import"./search-input-U68dcFxI.js";import"./use-mcp-auth-status-BMkT9EZ9.js";import"./github-repo-picker-BlPGLfgP.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-BgDsFD4-.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./use-file-configs-39QQNDS5.js";import"./automation-list-row-CAdX-w7a.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let b;return e[23]!==u||e[24]!==y||e[25]!==g?(b=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=b):b=e[26],b}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const b=i.description??ee;let _;e[17]!==y||e[18]!==b?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:b}),e[17]=y,e[18]=b,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let S;e[24]!==i.image?(S=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=S):S=e[25];let k;e[26]!==N||e[27]!==S||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,S]}),e[26]=N,e[27]=S,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Ui(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,b]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),b(Me));const{persistSeo:S,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let V;e[8]!==S||e[9]!==c||e[10]!==v?(V=E=>{if(!c)return;const de=E;v(de),S(de)},e[8]=S,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==b?(H=()=>b(Ke),e[14]=b,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(Se,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(be,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==S||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),S(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=S,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Ui as SeoEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as j,j as t,e as F,C as K,l as z,w as U,L as T,p as E,W as G,a as B,i as V,r as X,O as Y}from"./index-CIFSbzEF.js";import{u as Z}from"./useRouterState-C7j1zaEX.js";import{j as ee,k as se,l as te,S as M,a as O,b as L,d as I,c as R,g as ie,h as ne}from"./sidebar-BssgvH2v.js";import{a as le}from"./index-BZIMlfJW.js";import{n as re,c as oe,a as ae,d as ce,b as me,i as W}from"./ZapSquare-BrF3B-Lj.js";import{t as fe,a as A}from"./Users03-uSqerTaX.js";import{i as de}from"./HardDrive-y6RDSyxS.js";import{i as xe}from"./Key01-CTHo646W.js";import{n as ue}from"./LinkExternal01-Dw89NskH.js";import{i as be}from"./Shield01-BTjWMfyt.js";import{s as ge}from"./User01-JYrKFpRC.js";import{i as pe}from"./Zap-yAX2Kmmw.js";import{u as q}from"./use-t-DfEf5oHx.js";import{a as he}from"./use-capability-n8ljqiDB.js";import{u as je}from"./use-join-requests-DAnhRtlt.js";import{u as H}from"./use-mobile-48jgjwiy.js";import{u as ye}from"./use-status-sounds-Lt_bZnJO.js";import{T as _}from"./toolbar-C7-EzPT_.js";import{S as _e,M as ve}from"./shell-controls-nL7hKmbL.js";import"./LayoutLeft-DDdEDKm1.js";import"./X-BWhzmnUU.js";import"./tooltip-B6N5kQd7.js";import"./studio-tools-DvzlcJzu.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-BlazccAI.js";import"./decopilot-sse-pool-D92X3fNc.js";import"./backoff-CrEUbyZT.js";import"./toolbar-icon-button-VdYqoEpj.js";function J(){const e=j.c(23),s=q(),{capabilities:o,isPrivileged:n,loading:i,error:l}=he(),a=je().length;let r,c;if(e[0]!==o||e[1]!==l||e[2]!==n||e[3]!==a||e[4]!==i||e[5]!==s){c=Symbol.for("react.early_return_sentinel");e:{let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(fe,{size:14}),e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ue,{size:14}),e[9]=f):f=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(re,{size:14}),e[10]=d):d=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(oe,{size:14}),e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(xe,{size:14}),e[12]=u):u=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(de,{size:14}),e[13]=g):g=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ae,{size:14}),e[14]=p):p=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(A,{size:14}),e[15]=b):b=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(pe,{size:14}),e[16]=y):y=e[16];let h;e[17]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(ce,{size:14}),e[17]=h):h=e[17];let v;e[18]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(me,{size:14}),e[18]=v):v=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(A,{size:14}),e[19]=S):S=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(be,{size:14}),e[20]=k):k=e[20];let N;e[21]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(U,{size:14}),e[21]=N):N=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(ge,{size:14}),e[22]=$):$=e[22];const w=[{key:"organization",label:s("settings.nav.organization"),items:[{key:"general",label:s("settings.nav.general"),icon:m,to:"/$org/settings/general",requires:"org:manage"},{key:"connect",label:"Connect to clients",icon:f,to:"/$org/settings/connect"},{key:"brand-context",label:s("settings.nav.brandContext"),icon:d,to:"/$org/settings/brand-context",requires:"org:manage"},{key:"ai-providers",label:s("settings.nav.aiProviders"),icon:x,to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"secrets",label:s("settings.nav.secrets"),icon:u,to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"buckets",label:s("settings.nav.buckets"),icon:g,to:"/$org/settings/buckets",requires:"file-configs:manage"}]},{key:"build",label:s("settings.nav.build"),items:[{key:"connections",label:s("settings.nav.connections"),icon:p,to:"/$org/settings/connections"},{key:"agents",label:s("settings.nav.agents"),icon:b,to:"/$org/settings/agents"},{key:"automations",label:s("settings.nav.automations"),icon:y,to:"/$org/settings/automations",requires:"automations:manage"},{key:"store",label:s("settings.nav.store"),icon:h,to:"/$org/settings/store",requires:"registry:manage"}]},{key:"manage",label:s("settings.nav.manage"),items:[{key:"monitor",label:s("settings.nav.monitor"),icon:v,to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:s("settings.nav.members"),icon:S,to:"/$org/settings/members",requires:"members:manage",badge:a},{key:"roles",label:s("settings.nav.roles"),icon:k,to:"/$org/settings/roles",privilegedOnly:!0},{key:"sso",label:s("settings.nav.security"),icon:N,to:"/$org/settings/sso",requires:"org:manage"}]},{key:"account",label:s("settings.nav.account"),items:[{key:"profile",label:s("settings.nav.profile"),icon:$,to:"/$org/settings/profile"}]}];if(i||l){c=w;break e}r=w.map(P=>({...P,items:P.items.filter(C=>C.privilegedOnly?n:C.requires?n||o[C.requires]:!0)})).filter(Se)}e[0]=o,e[1]=l,e[2]=n,e[3]=a,e[4]=i,e[5]=s,e[6]=r,e[7]=c}else r=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:r}function Se(e){return e.items.length>0}function Q(e){const s=j.c(5),{icon:o,badge:n}=e;let i;s[0]!==n?(i=n?t.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-destructive pointer-events-none"}):null,s[0]=n,s[1]=i):i=s[1];let l;return s[2]!==o||s[3]!==i?(l=t.jsxs("span",{className:"relative shrink-0",children:[o,i]}),s[2]=o,s[3]=i,s[4]=l):l=s[4],l}function D(){const e=j.c(8);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=F(s);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={select:ke},e[1]=n):n=e[1];const i=Z(n);let l;e[2]!==o||e[3]!==i?(l=c=>{const m=c.replace("$org",o);return i.startsWith(m)},e[2]=o,e[3]=i,e[4]=l):l=e[4];const a=l;let r;return e[5]!==a||e[6]!==o?(r={org:o,isActive:a},e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function ke(e){return e.location.pathname}function Ne(){const e=j.c(19),s=q(),o=J(),{org:n,isActive:i}=D();let l;if(e[0]!==o||e[1]!==i||e[2]!==n){let u;e[4]!==i||e[5]!==n?(u=(g,p)=>t.jsxs(M,{className:"pt-0 pr-0 pb-0 pl-0",children:[g.label&&t.jsx("p",{className:z("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",p>0&&"mt-3"),children:g.label}),t.jsx(O,{children:t.jsx(L,{className:"gap-0.5",children:g.items.map(b=>t.jsx(I,{children:t.jsx(R,{asChild:!0,isActive:i(b.to),children:t.jsxs(T,{to:b.to,params:{org:n},onClick:()=>E("settings_nav_clicked",{section_key:b.key,group_key:g.key}),className:"flex items-center gap-2.5 text-sm",children:[t.jsx(Q,{icon:b.icon,badge:b.badge}),t.jsx("span",{className:"truncate",children:b.label})]})})},b.key))})})]},g.key),e[4]=i,e[5]=n,e[6]=u):u=e[6],l=o.map(u),e[0]=o,e[1]=i,e[2]=n,e[3]=l}else l=e[3];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[7]=a):a=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"shrink-0",children:t.jsx(W,{size:14})}),e[8]=r):r=e[8];let c;e[9]!==s?(c=s("settings.nav.signOut"),e[9]=s,e[10]=c):c=e[10];let m;e[11]!==c?(m=t.jsxs(M,{className:"pt-0 pr-0 pb-0 pl-0",children:[a,t.jsx(O,{children:t.jsx(L,{className:"gap-0.5",children:t.jsx(I,{children:t.jsxs(R,{onClick:$e,className:"flex items-center gap-2.5 text-sm",children:[r,t.jsx("span",{className:"truncate",children:c})]})})})})]}),e[11]=c,e[12]=m):m=e[12];let f;e[13]!==l||e[14]!==m?(f=t.jsxs(ie,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[l,m]}),e[13]=l,e[14]=m,e[15]=f):f=e[15];let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"mt-auto px-4 pb-1",children:t.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.94.0"]})}),e[16]=d):d=e[16];let x;return e[17]!==f?(x=t.jsxs(ne,{variant:"sidebar",children:[f,d]}),e[17]=f,e[18]=x):x=e[18],x}function $e(){E("signed_out",{source:"settings_sidebar"}),G(),B.signOut()}function ze(e){const s=j.c(21),{onClose:o}=e,n=q(),i=J(),{org:l,isActive:a}=D();let r;if(s[0]!==i||s[1]!==a||s[2]!==o||s[3]!==l){let p;s[5]!==a||s[6]!==o||s[7]!==l?(p=(b,y)=>t.jsxs("div",{className:"flex flex-col gap-0.5",children:[b.label&&t.jsx("p",{className:z("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",y>0&&"mt-3"),children:b.label}),b.items.map(h=>t.jsxs(T,{to:h.to,params:{org:l},onClick:o,className:z("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",a(h.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[t.jsx(Q,{icon:h.icon,badge:h.badge}),t.jsx("span",{className:"truncate",children:h.label})]},h.key))]},b.key),s[5]=a,s[6]=o,s[7]=l,s[8]=p):p=s[8],r=i.map(p),s[0]=i,s[1]=a,s[2]=o,s[3]=l,s[4]=r}else r=s[4];let c;s[9]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"h-px bg-border/50 my-2"}),s[9]=c):c=s[9];let m;s[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"shrink-0",children:t.jsx(W,{size:14})}),s[10]=m):m=s[10];let f;s[11]!==n?(f=n("settings.nav.signOut"),s[11]=n,s[12]=f):f=s[12];let d;s[13]!==f?(d=t.jsxs("div",{className:"flex flex-col gap-0.5",children:[c,t.jsxs("button",{type:"button",onClick:Ce,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[m,t.jsx("span",{className:"truncate",children:f})]})]}),s[13]=f,s[14]=d):d=s[14];let x;s[15]!==r||s[16]!==d?(x=t.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[r,d]}),s[15]=r,s[16]=d,s[17]=x):x=s[17];let u;s[18]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:t.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.94.0"]})}),s[18]=u):u=s[18];let g;return s[19]!==x?(g=t.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[x,u]}),s[19]=x,s[20]=g):g=s[20],g}function Ce(){G(),B.signOut()}function qe(){const e=j.c(4),s=H(),{org:o}=K();ye(o.slug);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(V,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(X.Suspense,{fallback:n,children:t.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:t.jsx(le,{value:"p-0",children:t.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:t.jsx(Y,{})})})})}),e[1]=i):i=e[1];const l=i;if(s){let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:l}),e[2]=r):r=e[2],r}let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 min-h-0 p-1",children:t.jsx("div",{className:z("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:l})}),e[3]=a):a=e[3],a}function ls(){const e=j.c(21),s=H();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(_.LogoLink,{}),e[0]=o):o=e[0];let n;e[1]!==s?(n=s&&t.jsx(_e,{}),e[1]=s,e[2]=n):n=e[2];let i;e[3]!==n?(i=t.jsxs(_.LeftColumn,{children:[o,n]}),e[3]=n,e[4]=i):i=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(_.CenterSlot,{}),e[5]=l):l=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(_.RightColumn,{children:t.jsx("span",{})}),e[6]=a):a=e[6];let r;e[7]!==i?(r=t.jsxs(_.Header,{children:[i,l,a]}),e[7]=i,e[8]=r):r=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c={"--sidebar-width-icon":"3.125rem"},e[9]=c):c=e[9];let m;e[10]!==s?(m=!s&&t.jsx(Ne,{}),e[10]=s,e[11]=m):m=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ee,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:t.jsx(qe,{})}),e[12]=f):f=e[12];let d;e[13]!==m?(d=t.jsxs(se,{className:"flex-1 bg-sidebar min-h-0",style:c,children:[m,f]}),e[13]=m,e[14]=d):d=e[14];let x;e[15]!==s?(x=s&&t.jsx(ve,{renderSidebar:we}),e[15]=s,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==r||e[19]!==d?(u=t.jsx(_.Provider,{children:t.jsx(te,{defaultOpen:!0,children:t.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[r,d,x]})})}),e[17]=x,e[18]=r,e[19]=d,e[20]=u):u=e[20],u}function we(e){const{onClose:s}=e;return t.jsx(ze,{onClose:s})}export{Ne as SettingsSidebar,ze as SettingsSidebarMobile,ls as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,l as N,j as r,r as S}from"./index-
|
|
1
|
+
import{c as v,l as N,j as r,r as S}from"./index-CIFSbzEF.js";import{C as w}from"./card-Dd8gUiG_.js";import{i as E}from"./ArrowUpRight-ChAriHcE.js";function I(c){const e=v.c(12),{title:i,description:l,docsHref:t,actions:s,className:n,headerClassName:a,children:d}=c;let m;e[0]!==n?(m=N("flex flex-col gap-3",n),e[0]=n,e[1]=m):m=e[1];let f;e[2]!==s||e[3]!==l||e[4]!==t||e[5]!==a||e[6]!==i?(f=(i||l||t||s)&&r.jsxs("div",{className:N("flex items-center justify-between gap-3 px-4",a),children:[r.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i&&r.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:i}),(l||t)&&r.jsxs("p",{className:"text-sm text-muted-foreground leading-snug",children:[l,t&&r.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 ml-1 text-foreground hover:underline",children:["Docs ",r.jsx(E,{size:12})]})]})]}),s&&r.jsx("div",{className:"shrink-0",children:s})]}),e[2]=s,e[3]=l,e[4]=t,e[5]=a,e[6]=i,e[7]=f):f=e[7];let o;return e[8]!==d||e[9]!==m||e[10]!==f?(o=r.jsxs("section",{className:m,children:[f,d]}),e[8]=d,e[9]=m,e[10]=f,e[11]=o):o=e[11],o}function P(c){const e=v.c(11),{className:i,children:l}=c;let t,s,n;if(e[0]!==l||e[1]!==i){const d=S.Children.toArray(l).filter(S.isValidElement);t=w,e[5]!==i?(s=N("p-0 gap-0 overflow-hidden",i),e[5]=i,e[6]=s):s=e[6],n=d.map($),e[0]=l,e[1]=i,e[2]=t,e[3]=s,e[4]=n}else t=e[2],s=e[3],n=e[4];let a;return e[7]!==t||e[8]!==s||e[9]!==n?(a=r.jsx(t,{className:s,children:n}),e[7]=t,e[8]=s,e[9]=n,e[10]=a):a=e[10],a}function $(c,e){return r.jsxs("div",{children:[e>0&&r.jsx("div",{className:"h-px bg-border mx-5"}),c]},e)}function R(c){const e=v.c(27),{icon:i,title:l,description:t,action:s,onClick:n,className:a,children:d}=c,m=d?"flex items-start gap-3 px-4 py-4":"flex items-center gap-3 px-4 py-4",f=n&&"hover:bg-muted/50 cursor-pointer";let o;e[0]!==a||e[1]!==m||e[2]!==f?(o=N(m,f,a),e[0]=a,e[1]=m,e[2]=f,e[3]=o):o=e[3];const b=n?"button":void 0,C=n?0:void 0;let x;e[4]!==n?(x=n?k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),n())}:void 0,e[4]=n,e[5]=x):x=e[5];let p;e[6]!==i?(p=i&&r.jsx("div",{className:"size-8 shrink-0 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground",children:i}),e[6]=i,e[7]=p):p=e[7];let u;e[8]!==l?(u=r.jsx("div",{className:"text-sm font-medium",children:l}),e[8]=l,e[9]=u):u=e[9];let h;e[10]!==t?(h=t&&r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:t}),e[10]=t,e[11]=h):h=e[11];let g;e[12]!==d||e[13]!==u||e[14]!==h?(g=r.jsxs("div",{className:"flex-1 min-w-0",children:[u,h,d]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15];let j;e[16]!==s?(j=s&&r.jsx("div",{className:"shrink-0",onClick:D,children:s}),e[16]=s,e[17]=j):j=e[17];let y;return e[18]!==n||e[19]!==g||e[20]!==j||e[21]!==o||e[22]!==b||e[23]!==C||e[24]!==x||e[25]!==p?(y=r.jsxs("div",{className:o,onClick:n,role:b,tabIndex:C,onKeyDown:x,children:[p,g,j]}),e[18]=n,e[19]=g,e[20]=j,e[21]=o,e[22]=b,e[23]=C,e[24]=x,e[25]=p,e[26]=y):y=e[26],y}function D(c){return c.stopPropagation()}function H(c){const e=v.c(5),{children:i,className:l}=c;let t;e[0]!==l?(t=N("flex items-center justify-end gap-2 px-4 py-4",l),e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==i||e[3]!==t?(s=r.jsx("div",{className:t,children:i}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}function K(c){const e=v.c(5),{className:i,children:l}=c;let t;e[0]!==i?(t=N("flex flex-col gap-10",i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==l||e[3]!==t?(s=r.jsx("div",{className:t,children:l}),e[2]=l,e[3]=t,e[4]=s):s=e[4],s}export{I as S,P as a,R as b,K as c,H as d};
|