decocms 3.113.0 → 3.114.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DsW3Bcrl.js → AlertCircle-CcSFfV77.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BWTy0YGq.js → ArrowUpRight-tDQJAL67.js} +1 -1
- package/dist/client/assets/{CheckCircle-c5WK8XV9.js → CheckCircle-Bo8RhoHc.js} +1 -1
- package/dist/client/assets/{ChevronDown-DqDfDEN8.js → ChevronDown-DGUkcHCY.js} +1 -1
- package/dist/client/assets/{ChevronLeft-t20dnuIe.js → ChevronLeft-CT8VG2sR.js} +1 -1
- package/dist/client/assets/{ChevronRight-C44MBYbI.js → ChevronRight-BewjrEd1.js} +1 -1
- package/dist/client/assets/{ChevronUp-DYj_Lqiv.js → ChevronUp-D66blh1X.js} +1 -1
- package/dist/client/assets/{DotsVertical-DAFoZ0nv.js → DotsVertical-DdLfRBis.js} +1 -1
- package/dist/client/assets/{Eye-DTIj4iPZ.js → Eye-YeyPpi7V.js} +1 -1
- package/dist/client/assets/{FilterLines-BV29E9UP.js → FilterLines-CfEcrHxA.js} +1 -1
- package/dist/client/assets/{Globe01-D6yUjZQH.js → Globe01-TC18CGdM.js} +1 -1
- package/dist/client/assets/{Globe04-bVwR5WWU.js → Globe04-DME-DJQ-.js} +1 -1
- package/dist/client/assets/{HardDrive-B8km64Z9.js → HardDrive-CsaekOtP.js} +1 -1
- package/dist/client/assets/{Key01-B7j5egoB.js → Key01-DKOFQydv.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CXvEGxxp.js → LayoutLeft-1izXnPxF.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CQ-4gvfk.js → LinkExternal01-aZXDuv4U.js} +1 -1
- package/dist/client/assets/{Monitor01-Bj_EAAMU.js → Monitor01-CO-Enulg.js} +1 -1
- package/dist/client/assets/{Palette-B-GrEc4W.js → Palette-C3zaJK31.js} +1 -1
- package/dist/client/assets/{Play-C-OyJs5r.js → Play-BqfvJQVr.js} +1 -1
- package/dist/client/assets/{Plus-CYbhotOA.js → Plus-DOgHjIX9.js} +1 -1
- package/dist/client/assets/{SearchLg-Cj30V7ex.js → SearchLg-DQKb1VNM.js} +1 -1
- package/dist/client/assets/{SearchMd-1Z8N8N3h.js → SearchMd-B32Ad7io.js} +1 -1
- package/dist/client/assets/{Settings02-DMwxMpRK.js → Settings02-CYOmhlmV.js} +1 -1
- package/dist/client/assets/{Shield01-B1Sc3Ias.js → Shield01-B_24XQcn.js} +1 -1
- package/dist/client/assets/{Star01-BqeGqz7Y.js → Star01-uNhkeRtE.js} +1 -1
- package/dist/client/assets/{Stars01-ZIjfY467.js → Stars01-cIMvuemx.js} +1 -1
- package/dist/client/assets/{Stars02-cvN6aU_Q.js → Stars02-BOpzhYLk.js} +1 -1
- package/dist/client/assets/{Sun-BHvYVIBh.js → Sun-CeAMOAEs.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Bej1Xe59.js → SwitchHorizontal01-CMQLiHqX.js} +1 -1
- package/dist/client/assets/{Tool01-BxZPwNZl.js → Tool01-B7VdTvOT.js} +1 -1
- package/dist/client/assets/{Trash01-DYl35j3Y.js → Trash01-D_oOLkKd.js} +1 -1
- package/dist/client/assets/{Upload01-CKysXsn0.js → Upload01-CCZMQP8k.js} +1 -1
- package/dist/client/assets/{User01-Bl0_xtnf.js → User01-AgBVPRI6.js} +1 -1
- package/dist/client/assets/{Users01-DBGMUy31.js → Users01-DqhpNieN.js} +1 -1
- package/dist/client/assets/{Users03-BG9oeNVT.js → Users03-BjoKI_ge.js} +1 -1
- package/dist/client/assets/{X-h9nJ-EBx.js → X-BHVpMy2x.js} +1 -1
- package/dist/client/assets/{XCircle-C0eLN21-.js → XCircle-EGqPzNtx.js} +1 -1
- package/dist/client/assets/{XClose-DYr8fUgN.js → XClose-CIwi5bNb.js} +1 -1
- package/dist/client/assets/{Zap-CIpGBf2d.js → Zap-DCajI6T4.js} +1 -1
- package/dist/client/assets/{ZapSquare-DYkBLN1d.js → ZapSquare-Cutw6peE.js} +1 -1
- package/dist/client/assets/{ZoomOut-YIKSKCYE.js → ZoomOut-Cf2pqc2h.js} +1 -1
- package/dist/client/assets/{access-gate-C3iaY6XN.js → access-gate-DjCVWS45.js} +1 -1
- package/dist/client/assets/{add-section-modal-Ba7H5Exj.js → add-section-modal-DEuzRw2e.js} +1 -1
- package/dist/client/assets/{agent-icon-C6pv2ku7.js → agent-icon-a-rhspZM.js} +1 -1
- package/dist/client/assets/{agents-list-CJYSERw-.js → agents-list-jAUqfE_v.js} +1 -1
- package/dist/client/assets/{ai-providers-DnKknC5p.js → ai-providers-Mrbi70Ts.js} +1 -1
- package/dist/client/assets/{alert-BflofFov.js → alert-GMzbDkMJ.js} +1 -1
- package/dist/client/assets/{alert-dialog-B7wd15se.js → alert-dialog-ChIIhfyT.js} +1 -1
- package/dist/client/assets/{app-editor-Dl_tCFps.js → app-editor-qnnuMudl.js} +1 -1
- package/dist/client/assets/{auth-Bb0aNoyE.js → auth-65aLEbI2.js} +1 -1
- package/dist/client/assets/{auth-catchall-B7Ui9zYP.js → auth-catchall-CXeJC7TN.js} +1 -1
- package/dist/client/assets/{auth-entry-C1OXrB7Q.js → auth-entry-DmNM-plc.js} +1 -1
- package/dist/client/assets/{auth-split-layout-WM3kMmar.js → auth-split-layout-CTaWM0I-.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DWufXUh3.js → authenticate-and-persist-oauth-TvOevGQc.js} +1 -1
- package/dist/client/assets/{automation-list-row-CQamw_ai.js → automation-list-row-CBkXLMVX.js} +1 -1
- package/dist/client/assets/{automation-runs-BLnP5I-H.js → automation-runs-efbkpB-f.js} +1 -1
- package/dist/client/assets/{automations-DsnpSNUS.js → automations-C3PdCkb8.js} +1 -1
- package/dist/client/assets/{avatar-BgE6fJJB.js → avatar-VxJ-6aDh.js} +1 -1
- package/dist/client/assets/{badge-BXVUKWgQ.js → badge-DIxPM3x-.js} +1 -1
- package/dist/client/assets/{block-document-DejJteuP.js → block-document-DriTFdh_.js} +1 -1
- package/dist/client/assets/{brand-context-JKdVwCPZ.js → brand-context-DamWQORe.js} +1 -1
- package/dist/client/assets/{buckets-C1GZcmB3.js → buckets-BedOyeCd.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-uV9viI1z.js → bulk-category-panel-B4bfLdT1.js} +1 -1
- package/dist/client/assets/{capability-load-error-y-w2JHZP.js → capability-load-error-D27HvRuH.js} +1 -1
- package/dist/client/assets/{card-Bq-T-A3c.js → card-C3Ij48Iw.js} +1 -1
- package/dist/client/assets/{category-editor-DaY4efbU.js → category-editor-COw3H3fq.js} +1 -1
- package/dist/client/assets/{chat-context-DXkfcYfb.js → chat-context-BqWG1EiS.js} +1 -1
- package/dist/client/assets/{checkbox-BJPI9nCv.js → checkbox-D2Dn2ZZa.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Dd7-t_Uh.js → cli-auth-success-Bf4jn0_H.js} +1 -1
- package/dist/client/assets/collection-detail-BgbxIqiY.js +1 -0
- package/dist/client/assets/{collection-display-button-CjpbDBCg.js → collection-display-button-B21lcChD.js} +1 -1
- package/dist/client/assets/{collection-search-faBG8zWd.js → collection-search-DC2fej2p.js} +1 -1
- package/dist/client/assets/{collection-tabs-CUrRmOty.js → collection-tabs-DaxyQO6S.js} +1 -1
- package/dist/client/assets/{command-CEPgisvd.js → command-DAqgJNfS.js} +1 -1
- package/dist/client/assets/commerce-onboarding-nIURC3la.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-BDLcc0Rq.js → connect-desktop-dialog-CW7yo-dK.js} +1 -1
- package/dist/client/assets/{connection-card-B7OCM5c1.js → connection-card-Cw8E8wob.js} +1 -1
- package/dist/client/assets/{connection-detail-CD_hohzd.js → connection-detail-Dovj_nsw.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-D-2z8iRp.js → connection-form-helpers-Bvs9581e.js} +1 -1
- package/dist/client/assets/{connections-CAsCfI-h.js → connections-DPycxT62.js} +1 -1
- package/dist/client/assets/{context-menu-CeXqMhpU.js → context-menu-DHuZVv7j.js} +1 -1
- package/dist/client/assets/{decopilot-BHpemSf8.js → decopilot-CxJIqkTy.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DZ7iO7mi.js → decopilot-sse-pool-B_qHYLwH.js} +1 -1
- package/dist/client/assets/{dialog-Chku3vbX.js → dialog-Ctq63OWS.js} +1 -1
- package/dist/client/assets/{domain-settings-CI2CXR6O.js → domain-settings-CRHgvwUR.js} +1 -1
- package/dist/client/assets/{drawer-DDuANtUO.js → drawer-RsFEHJ33.js} +1 -1
- package/dist/client/assets/{dropdown-menu-VowKBuzA.js → dropdown-menu-CtLcHkVh.js} +1 -1
- package/dist/client/assets/{empty-state-CTy-QySs.js → empty-state-DiLh_lHV.js} +1 -1
- package/dist/client/assets/{extract-connection-data-ALY8RBIl.js → extract-connection-data-k5NevbxB.js} +1 -1
- package/dist/client/assets/{file-explorer-C2L8VtpT.js → file-explorer-CNSLo1hk.js} +1 -1
- package/dist/client/assets/{file-type-icon-DkI0cvrO.js → file-type-icon-DCSufhQC.js} +1 -1
- package/dist/client/assets/{files-DbmP_Gyb.js → files-DGIgdUoI.js} +1 -1
- package/dist/client/assets/{form-BsHVq-vM.js → form-D1tHmaSj.js} +1 -1
- package/dist/client/assets/{general-QxHhLyDv.js → general-BJQzSrJI.js} +1 -1
- package/dist/client/assets/{github-repo-picker-B01rapBh.js → github-repo-picker-DYvb5Ftb.js} +1 -1
- package/dist/client/assets/{hooks-uefC-6qo.js → hooks-ozyyAKwo.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-DwDKm1yA.js → import-from-deco-dialog-DLeBAP-8.js} +1 -1
- package/dist/client/assets/{index-DoucUl3Y.js → index-BMkJCAKU.js} +4 -4
- package/dist/client/assets/{index-CIZIZhq0.js → index-Bl-M2Q1m.js} +5 -5
- package/dist/client/assets/{index-d5v42Ku_.js → index-Cb4TSEjk.js} +1 -1
- package/dist/client/assets/{index-FHSU_qaz.js → index-Cdpp661X.js} +1 -1
- package/dist/client/assets/{index-DmS8LVoF.js → index-Cw3uKtmI.js} +1 -1
- package/dist/client/assets/{index-FQ27y3Bo.js → index-CxGekiC9.js} +1 -1
- package/dist/client/assets/index-DrNYS32Q.js +1 -0
- package/dist/client/assets/{index-D4zXllKr.js → index-Dx_XvWM7.js} +1 -1
- package/dist/client/assets/{index-C8dtbTi8.js → index-SmpxP2Qa.js} +1 -1
- package/dist/client/assets/{index-DZkk2p2c.js → index-VNRRgucY.js} +1 -1
- package/dist/client/assets/{index-C2l8NKUk.js → index-ZGn8-6Z1.js} +1 -1
- package/dist/client/assets/{index-j7z2yPFO.js → index-e4slOEn4.js} +2 -2
- package/dist/client/assets/{index-n4sZg5eT.js → index-idZ7arEa.js} +1 -1
- package/dist/client/assets/{index-ThpKT5W3.js → index-lg9tRTXA.js} +1 -1
- package/dist/client/assets/{index-redirect-DA-zZfwH.js → index-redirect-CQd9jAKu.js} +1 -1
- package/dist/client/assets/{input-DJWrldEm.js → input-BBg0qoi0.js} +1 -1
- package/dist/client/assets/{integration-icon-Cf-Rmmga.js → integration-icon-B1MgAV39.js} +1 -1
- package/dist/client/assets/{label-DWCu1aOX.js → label-gmNo-OgB.js} +1 -1
- package/dist/client/assets/{login-BaUM4qoK.js → login-B0XeP_I8.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cv0VZ7hC.js → mcp-oauth-CGJOuYvc.js} +1 -1
- package/dist/client/assets/{members-BQ922LlJ.js → members-BnYdY_wo.js} +1 -1
- package/dist/client/assets/{monaco-editor-xeAwVHxY.js → monaco-editor-C45zSurY.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-yNqAUufn.js → monitoring-stats-row-11wf2acl.js} +1 -1
- package/dist/client/assets/{oauth-callback-3A7T2jnX.js → oauth-callback-Ci_BF5l2.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-MJfALJzK.js → oauth-callback-ai-provider-DusV-rca.js} +1 -1
- package/dist/client/assets/{onboarding-CAhnqw2H.js → onboarding-y08jENLb.js} +1 -1
- package/dist/client/assets/{org-install-B4p26QgM.js → org-install-BIudV4tz.js} +1 -1
- package/dist/client/assets/{org-layout-C0UFwcFu.js → org-layout-C-t3yTn-.js} +1 -1
- package/dist/client/assets/{organization-choice-BziMexFb.js → organization-choice-3G9nmz_p.js} +1 -1
- package/dist/client/assets/{page-seo-form-Nu87LQxK.js → page-seo-form-DOJEysx7.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CvQiL2HI.js +1 -0
- package/dist/client/assets/{popover-Cu2CWUc6.js → popover-CNaSC_8y.js} +1 -1
- package/dist/client/assets/{post-editor-Rz4voUbL.js → post-editor-CFQ8onHp.js} +1 -1
- package/dist/client/assets/{preview-dialog-TWb4uSgf.js → preview-dialog-CjeX8ddp.js} +1 -1
- package/dist/client/assets/{primitives-Cm1xngZF.js → primitives-CGiY0RZx.js} +1 -1
- package/dist/client/assets/{profile-BAtklMbJ.js → profile-DE6UqsDT.js} +1 -1
- package/dist/client/assets/project-app-view-CuTuXCcv.js +1 -0
- package/dist/client/assets/record-editor-CQryYkea.js +1 -0
- package/dist/client/assets/registry-BOya-Bit.js +2 -0
- package/dist/client/assets/{registry-layout-BF6KWN0l.js → registry-layout-BSuHflGz.js} +1 -1
- package/dist/client/assets/{require-capability-Dw5StpLR.js → require-capability-Cue4iuIr.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Cni39UJP.js → required-auth-layout-C-Z8KOaK.js} +1 -1
- package/dist/client/assets/{reset-password-BU6FOuSM.js → reset-password-BvE3CdHm.js} +1 -1
- package/dist/client/assets/{roles-DpF4dUXk.js → roles-DFf0HGd5.js} +1 -1
- package/dist/client/assets/{scroll-area-C6-KaVJV.js → scroll-area-BPyAfu2r.js} +1 -1
- package/dist/client/assets/{search-input-fiAwXyYz.js → search-input-IHFVAkh9.js} +1 -1
- package/dist/client/assets/{secrets-DzbntMBc.js → secrets-CM1dofr1.js} +1 -1
- package/dist/client/assets/{sections-editor-hGU3YaZd.js → sections-editor-BX9bzwmK.js} +1 -1
- package/dist/client/assets/{select-CcRNcLs4.js → select-DutbBQce.js} +1 -1
- package/dist/client/assets/{select-model-CivzIgEY.js → select-model-BQkvveqR.js} +1 -1
- package/dist/client/assets/{seo-editor-BGFqjoDz.js → seo-editor-DqVyNUNF.js} +1 -1
- package/dist/client/assets/{settings-layout-hzLamTV6.js → settings-layout-DSfi9iIU.js} +1 -1
- package/dist/client/assets/{settings-section-1TBLdu48.js → settings-section-BZuPg87T.js} +1 -1
- package/dist/client/assets/{sheet-DNq52yos.js → sheet-WG9Gc6Zy.js} +1 -1
- package/dist/client/assets/{shell-controls-VLayj47H.js → shell-controls-DQP1W7-y.js} +1 -1
- package/dist/client/assets/shell-layout-92HzJBFm.js +1 -0
- package/dist/client/assets/{shell-route-loading-1e-ao78p.js → shell-route-loading-DnFEcWzw.js} +1 -1
- package/dist/client/assets/{sidebar-deyzgweY.js → sidebar-10UvHhLX.js} +1 -1
- package/dist/client/assets/{skeleton-DYw0rOyr.js → skeleton-D79TYCUQ.js} +1 -1
- package/dist/client/assets/{sortable.esm-DvDPoJZ_.js → sortable.esm-I-jX3xbI.js} +1 -1
- package/dist/client/assets/{sso-raBSLbel.js → sso-Ya2aCQum.js} +1 -1
- package/dist/client/assets/{store-DLPEafBl.js → store-G6HUAb4s.js} +1 -1
- package/dist/client/assets/store-registry-DXsSg63w.js +2 -0
- package/dist/client/assets/{studio-tools-Czz5alz9.js → studio-tools-C2IysvJT.js} +1 -1
- package/dist/client/assets/{switch-CA3c3Ikc.js → switch-Drz6Nz2H.js} +1 -1
- package/dist/client/assets/{table-BJIlpBQx.js → table-BnvehZik.js} +1 -1
- package/dist/client/assets/{tabs-UZ20kq7U.js → tabs-CJGRnM4H.js} +1 -1
- package/dist/client/assets/{task-status--kAAfJo6.js → task-status-CTZ3zFX5.js} +1 -1
- package/dist/client/assets/{textarea-BIYgBm1i.js → textarea-DxC3NCiC.js} +1 -1
- package/dist/client/assets/{toggle-group-BbjdiqkS.js → toggle-group-ebsm5HLy.js} +1 -1
- package/dist/client/assets/{toolbar-DaNx41W4.js → toolbar-3uEA9Jtx.js} +1 -1
- package/dist/client/assets/{tools-list-BchYfnfX.js → tools-list-MTzwyG3Q.js} +1 -1
- package/dist/client/assets/{tooltip-yt7lmbFR.js → tooltip-CFYRqans.js} +1 -1
- package/dist/client/assets/{types-E7XN7ErV.js → types-eyrQ2JHf.js} +1 -1
- package/dist/client/assets/{use-ai-providers-luzuoW6F.js → use-ai-providers-C2Ipg5Bb.js} +1 -1
- package/dist/client/assets/{use-automations-LY-NXMZq.js → use-automations-BFJI29e5.js} +1 -1
- package/dist/client/assets/{use-capability-BqaOVotK.js → use-capability-COm9oHfd.js} +1 -1
- package/dist/client/assets/{use-clock-tick-z5rLDCie.js → use-clock-tick-BJmjlXQS.js} +1 -1
- package/dist/client/assets/{use-collections-BsTbK7kB.js → use-collections-BZ14jHnD.js} +1 -1
- package/dist/client/assets/{use-connection-BnsrqzP3.js → use-connection-DQT4g2hA.js} +1 -1
- package/dist/client/assets/{use-copy-C8Cy_h_n.js → use-copy-CeTfzHGl.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CokZEX-4.js → use-create-virtual-mcp-CYZZM9Z4.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DYZ9j_la.js → use-debounced-autosave-B__-e6QF.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DzjV_Ydf.js → use-debounced-value-DYPjh7o3.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-QszXAsve.js → use-decopilot-events-SN4kMHd6.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BIZiu7yA.js → use-delete-connection-C4-MC4My.js} +1 -1
- package/dist/client/assets/{use-file-configs-Dj9CIuJ1.js → use-file-configs-DqnJ-VJ3.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CpYSd4m7.js → use-infinite-scroll-mpQZLpnl.js} +1 -1
- package/dist/client/assets/{use-join-requests-BOnGNzWY.js → use-join-requests-BeDSG8hQ.js} +1 -1
- package/dist/client/assets/{use-mcp-client-WvxqfcnZ.js → use-mcp-client-BytPyyDj.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BlOjON_R.js → use-mcp-prompts-BHHR2eWu.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CA7LHiOg.js → use-mcp-tools-C5_BGC5L.js} +1 -1
- package/dist/client/assets/{use-members-BI13P71I.js → use-members-DgRXwj6v.js} +1 -1
- package/dist/client/assets/{use-mobile-uxXHtQgn.js → use-mobile-OapB20t1.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Xf5ZXEBe.js → use-navigate-to-agent-CJzJWYSV.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Cu0XnCiD.js → use-org-auth-client-B7x6vcfU.js} +1 -1
- package/dist/client/assets/{use-org-fs-_YTXbBHs.js → use-org-fs-DI8XTZI9.js} +1 -1
- package/dist/client/assets/{use-org-sso-BRUmxKLf.js → use-org-sso-DBQ9ORV2.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BRIlem76.js → use-organization-roles-BLqPnSj0.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CiVN8spL.js → use-organization-settings-DdRJ5SNk.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BB5C1xbN.js → use-registry-connections-CEhsncan.js} +1 -1
- package/dist/client/assets/{use-secrets-tjI_7kqR.js → use-secrets-a3M4uj_e.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CLXD0DTi.js → use-status-sounds-Gnff6sFt.js} +1 -1
- package/dist/client/assets/{use-view-mode-D1s3xfpd.js → use-view-mode-vrWF2aLR.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-B1rjWllH.js → use-virtual-mcp-CFjAoglb.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CM3TCwRn.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-6L8ywPai.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-BAt7-u1b.js → useSuspenseQueries-D7zxc41g.js} +1 -1
- package/dist/client/assets/variant-calendar-BrKroRCi.js +1 -0
- package/dist/client/assets/{view-mode-toggle-DJ4H3DkB.js → view-mode-toggle-Coyxfq0e.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +287 -287
- package/dist/server/server.js +246 -246
- package/package.json +1 -1
- package/dist/client/assets/collection-detail-FtAmNTpi.js +0 -1
- package/dist/client/assets/commerce-onboarding-DwMnSck_.js +0 -1
- package/dist/client/assets/index-CNGM5Nz3.js +0 -1
- package/dist/client/assets/page-seo-sheet-DERDt-LV.js +0 -1
- package/dist/client/assets/project-app-view-Qtck7ma4.js +0 -1
- package/dist/client/assets/record-editor-BPVyubLj.js +0 -1
- package/dist/client/assets/registry-DDW5POMG.js +0 -2
- package/dist/client/assets/shell-layout-CuK3Vqry.js +0 -1
- package/dist/client/assets/store-registry-DkH_8n_H.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DC079uf3.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B202GQEQ.js +0 -1
- package/dist/client/assets/variant-calendar-DxD12-Lb.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as y,j as t,B as F,i as X,o as Ge,s as se,E as Pe,r as T,D as ie,p as Qe,l as V,bg as Ye,u as Xe,G,t as Ze,e as ae,b2 as ke}from"./index-DoucUl3Y.js";import{E as Ee}from"./empty-state-CTy-QySs.js";import{u as et,a as Ae}from"./use-collections-BsTbK7kB.js";import{u as ce}from"./use-mcp-client-WvxqfcnZ.js";import{F as ne,a as tt,b as de,d as me}from"./form-BsHVq-vM.js";import{I as ue}from"./input-DJWrldEm.js";import{T as re}from"./textarea-BIYgBm1i.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-C8dtbTi8.js";import{al as rt,y as it,aa as at,am as ct,_ as dt,an as mt,N as be}from"./agent-icon-C6pv2ku7.js";import{g as ut,M as xt,a as Ne}from"./types-E7XN7ErV.js";import{A as pt,a as ft,b as ht}from"./alert-BflofFov.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-CcRNcLs4.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-yt7lmbFR.js";import{i as jt}from"./AlertCircle-DsW3Bcrl.js";import{s as bt}from"./Stars02-cvN6aU_Q.js";import{a as Nt}from"./Eye-DTIj4iPZ.js";import{i as vt}from"./Play-C-OyJs5r.js";import{i as St}from"./ChevronRight-C44MBYbI.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./tools-list-BchYfnfX.js";import{a as Oe,u as Re}from"./use-connection-BnsrqzP3.js";import{a as It}from"./use-mcp-tools-CA7LHiOg.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-Cf-Rmmga.js";import{i as Tt,l as Pt}from"./chat-context-DXkfcYfb.js";import{b as kt}from"./shell-layout-CuK3Vqry.js";import{M as Et}from"./monaco-editor-xeAwVHxY.js";import{n as At}from"./XCircle-C0eLN21-.js";import"./auth-Bb0aNoyE.js";import"./label-DWCu1aOX.js";import"./index-FHSU_qaz.js";import"./sidebar-deyzgweY.js";import"./LayoutLeft-CXvEGxxp.js";import"./use-mobile-uxXHtQgn.js";import"./sheet-DNq52yos.js";import"./X-h9nJ-EBx.js";import"./ZoomOut-YIKSKCYE.js";import"./Key01-B7j5egoB.js";import"./extract-connection-data-ALY8RBIl.js";import"./use-registry-connections-BB5C1xbN.js";import"./use-organization-settings-CiVN8spL.js";import"./studio-tools-Czz5alz9.js";import"./Plus-CYbhotOA.js";import"./index-FQ27y3Bo.js";import"./index-D4zXllKr.js";import"./index-DmS8LVoF.js";import"./popover-Cu2CWUc6.js";import"./use-virtual-mcp-B1rjWllH.js";import"./ChevronUp-DYj_Lqiv.js";import"./SearchMd-1Z8N8N3h.js";import"./Users03-BG9oeNVT.js";import"./use-create-virtual-mcp-CokZEX-4.js";import"./use-navigate-to-agent-Xf5ZXEBe.js";import"./Tool01-BxZPwNZl.js";import"./SwitchHorizontal01-Bej1Xe59.js";import"./Settings02-DMwxMpRK.js";import"./ArrowUpRight-BWTy0YGq.js";import"./ZapSquare-DYkBLN1d.js";import"./CheckCircle-c5WK8XV9.js";import"./ChevronDown-DqDfDEN8.js";import"./ChevronLeft-t20dnuIe.js";import"./DotsVertical-DAFoZ0nv.js";import"./Globe01-D6yUjZQH.js";import"./FilterLines-BV29E9UP.js";import"./Star01-BqeGqz7Y.js";import"./Globe04-bVwR5WWU.js";import"./HardDrive-B8km64Z9.js";import"./LinkExternal01-CQ-4gvfk.js";import"./Monitor01-Bj_EAAMU.js";import"./Sun-BHvYVIBh.js";import"./Palette-B-GrEc4W.js";import"./SearchLg-Cj30V7ex.js";import"./Shield01-B1Sc3Ias.js";import"./Stars01-ZIjfY467.js";import"./Trash01-DYl35j3Y.js";import"./Upload01-CKysXsn0.js";import"./User01-Bl0_xtnf.js";import"./Users01-DBGMUy31.js";import"./XClose-DYr8fUgN.js";import"./Zap-CIpGBf2d.js";import"./mcp-oauth-Cv0VZ7hC.js";import"./badge-BXVUKWgQ.js";import"./hooks-uefC-6qo.js";import"./decopilot-sse-pool-DZ7iO7mi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-luzuoW6F.js";import"./use-decopilot-events-QszXAsve.js";import"./tab-id-BptcWVWa.js";import"./avatar-BgE6fJJB.js";import"./dialog-Chku3vbX.js";import"./required-auth-layout-Cni39UJP.js";import"./use-org-sso-BRUmxKLf.js";import"./index-d5v42Ku_.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Mt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Dt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Dt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Mt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const je=Number(h[M]);Number.isNaN(je)||(h[M]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(De,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(Me,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&D==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async D=>{r&&await R.update.mutateAsync({id:r,data:D})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(Me,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(De,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let D;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(D=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Ln(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Ln as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as z,r as K,l as oe,j as n,B as G,m as Xe,d as we,K as Z,o as De,s as be,n as Fe,p as Me,i as et,k as tt,t as bt,q as ye,v as te,Q as vt,E as jt,a as qe,u as Ct,w as Bt,b as St,x as Gt,y as _t,L as Qt}from"./index-DoucUl3Y.js";import{A as Wt}from"./auth-entry-C1OXrB7Q.js";import{A as Yt}from"./auth-split-layout-WM3kMmar.js";import{O as pt}from"./organization-choice-BziMexFb.js";import{f as Jt}from"./tab-id-BptcWVWa.js";import{I as Oe}from"./input-DJWrldEm.js";import{u as Ke,W as Nt,S as Et,g as Zt,C as Xt}from"./use-mcp-client-WvxqfcnZ.js";import{i as wt}from"./XCircle-C0eLN21-.js";import{I as nt}from"./integration-icon-Cf-Rmmga.js";import{D as Ve,a as It,b as Tt,c as Ot,d as At,e as kt}from"./dialog-Chku3vbX.js";import{T as Rt,a as Ut,b as Pt}from"./tooltip-yt7lmbFR.js";import{i as st}from"./CheckCircle-c5WK8XV9.js";import{i as en,t as zt}from"./agent-icon-C6pv2ku7.js";import{g as tn,c as nn,e as sn}from"./extract-connection-data-ALY8RBIl.js";import{F as ve,a as He,b as je,c as Le,d as Ce,e as Se,f as on}from"./form-BsHVq-vM.js";import{i as rn}from"./ChevronUp-DYj_Lqiv.js";import{s as an,a as Lt}from"./Eye-DTIj4iPZ.js";import{i as ln}from"./Settings02-DMwxMpRK.js";import{u as cn}from"./useSuspenseQueries-BAt7-u1b.js";import{a as dn}from"./authenticate-and-persist-oauth-DWufXUh3.js";import{i as $t}from"./ArrowUpRight-BWTy0YGq.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-BgE6fJJB.js";import"./User01-Bl0_xtnf.js";import"./auth-Bb0aNoyE.js";import"./X-h9nJ-EBx.js";import"./AlertCircle-DsW3Bcrl.js";import"./Tool01-BxZPwNZl.js";import"./SwitchHorizontal01-Bej1Xe59.js";import"./ZapSquare-DYkBLN1d.js";import"./Users03-BG9oeNVT.js";import"./ChevronDown-DqDfDEN8.js";import"./ChevronLeft-t20dnuIe.js";import"./ChevronRight-C44MBYbI.js";import"./DotsVertical-DAFoZ0nv.js";import"./Stars02-cvN6aU_Q.js";import"./ZoomOut-YIKSKCYE.js";import"./Globe01-D6yUjZQH.js";import"./FilterLines-BV29E9UP.js";import"./Star01-BqeGqz7Y.js";import"./Globe04-bVwR5WWU.js";import"./HardDrive-B8km64Z9.js";import"./Key01-B7j5egoB.js";import"./LayoutLeft-CXvEGxxp.js";import"./LinkExternal01-CQ-4gvfk.js";import"./Monitor01-Bj_EAAMU.js";import"./Sun-BHvYVIBh.js";import"./Palette-B-GrEc4W.js";import"./Play-C-OyJs5r.js";import"./Plus-CYbhotOA.js";import"./SearchLg-Cj30V7ex.js";import"./SearchMd-1Z8N8N3h.js";import"./Shield01-B1Sc3Ias.js";import"./Stars01-ZIjfY467.js";import"./Trash01-DYl35j3Y.js";import"./Upload01-CKysXsn0.js";import"./Users01-DBGMUy31.js";import"./XClose-DYr8fUgN.js";import"./Zap-CIpGBf2d.js";import"./label-DWCu1aOX.js";import"./mcp-oauth-Cv0VZ7hC.js";const mn=/^[a-zA-Z][a-zA-Z\d+.-]*:/,un=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,fn=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,pn=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Ne(o){const e=o.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=mn.test(e),s=un.test(e),i=fn.test(e);if(t&&!s&&!i)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=s?e:`https://${e}`;let r;try{r=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const l=r.hostname.split(".");return l.length<2||l.some(a=>!a||!pn.test(a))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function Je(o){const e=z.c(14),{children:t,className:s,wrapperClassName:i}=o,[c,r]=K.useState(!0);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=j=>{if(!j)return;const v=()=>{const f=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(f)};v(),j.addEventListener("scroll",v,{passive:!0});const g=new ResizeObserver(v);g.observe(j);for(const f of Array.from(j.children))g.observe(f);return()=>{j.removeEventListener("scroll",v),g.disconnect()}},e[0]=l):l=e[0];const a=l;let m;e[1]!==i?(m=oe("relative",i),e[1]=i,e[2]=m):m=e[2];let u;e[3]!==t||e[4]!==s?(u=n.jsx("div",{ref:a,className:s,children:t}),e[3]=t,e[4]=s,e[5]=u):u=e[5];const p=c?"opacity-0":"opacity-100";let d;e[6]!==p?(d=oe("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",p),e[6]=p,e[7]=d):d=e[7];let h;e[8]!==d?(h=n.jsx("div",{"aria-hidden":!0,className:d}),e[8]=d,e[9]=h):h=e[9];let y;return e[10]!==m||e[11]!==u||e[12]!==h?(y=n.jsxs("div",{className:m,children:[u,h]}),e[10]=m,e[11]=u,e[12]=h,e[13]=y):y=e[13],y}function gn(o){const e=o.properties;if(!e)return[];const t=[];for(const[s,i]of Object.entries(e)){const l=i?.properties?.__type?.const;typeof l=="string"&&l.length>0&&t.push({fieldKey:s,bindingType:l})}return t}function hn(o,e){const t=[];if(o.length&&t.push({field:["id"],operator:"in",value:o}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function se(o){const e=o;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??o}function xn(o,e,t,s){return{...o??{},[e]:{__type:t,value:s}}}function Ze(o){return o==null?!1:typeof o=="string"?o.trim().length>0:typeof o=="number"||typeof o=="boolean"?!0:Array.isArray(o)?o.some(Ze):typeof o=="object"?Object.entries(o).some(([e,t])=>!e.startsWith("__")&&Ze(t)):!1}function yn(o){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[o]?e[o]:o.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function bn(o){return Ze(o)?typeof o=="string"?o.trim():typeof o=="number"||typeof o=="boolean"?String(o):JSON.stringify(o):null}function vn(o){return o?Object.entries(o).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const s=bn(t);return s?[{key:e,label:yn(e),value:s}]:[]}):[]}function jn({autoOpenFieldKey:o,card:e}){return o===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function Cn(o,e,t){const s=o.filter(i=>i.app_name===e||!!t&&i.app_id===t);return s.length===0?null:(s.sort((i,c)=>{const r=l=>l.status==="active"?0:1;return r(i)!==r(c)?r(i)-r(c):(c.updated_at??"").localeCompare(i.updated_at??"")}),s[0].id)}function Sn(o){return o.server?.icons?.[0]?.src??tn(o.server?.repository)??null}function _n(o,e){const t=o._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||o.title||o.server?.title||o.server?.name||e}function Nn(o){const e=[],t=new Map(o.connections.map(s=>[s.id,s]));for(const s of o.requirements){const i=o.curated[s.bindingType],c=i?o.itemsById[i.registryAppId]:o.itemsByName[s.bindingType];if(!c)continue;const r=o.configurationState?.[s.fieldKey]?.value,l=r?t.get(r):void 0,a=r&&l?r:null,m=a?o.connectionReadiness?.[a]!==!1:!1,u=!!a&&m,p=u?void 0:o.saBindings?.[s.bindingType],d=u||!!p,h=u?"oauth":p?"sa":null;e.push({fieldKey:s.fieldKey,bindingType:s.bindingType,registryItem:c,title:_n(c,s.bindingType),icon:Sn(c),headline:i?.headline??c._meta?.["mcp.mesh"]?.short_description??null,area:i?.area??null,bullets:i?.bullets??[],satisfied:d,candidateConnectionId:d?null:a||Cn(o.connections,s.bindingType,i?.registryAppId),linkedConnectionId:a,configurationState:l?.configuration_state??null,boundVia:h,boundResource:p?.resource??null})}return e}function En(o,e){if(!o)return null;const t=i=>{if(i.startsWith("sc-domain:"))return i.substring(10);try{let r=new URL(i.startsWith("http")?i:`https://${i}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return i}},s=t(o);for(const i of e)if(t(i.siteUrl)===s)return i.siteUrl;return null}function wn(o){return(o?.response?.accountSummaries??[]).map(s=>({account:s.account,options:(s.propertySummaries??[]).map(i=>({value:i.property,label:`${i.displayName} (${s.displayName})`}))}))}function gt(o){const e=z.c(38);let t,s,i,c,r;e[0]!==o?({value:r,onChange:s,placeholder:i,className:t,...c}=o,e[0]=o,e[1]=t,e[2]=s,e[3]=i,e[4]=c,e[5]=r):(t=e[1],s=e[2],i=e[3],c=e[4],r=e[5]);const[l,a]=K.useState(!1),[m,u]=K.useState(!1);let p;e[6]!==r?(p=async()=>{if(r)try{await navigator.clipboard.writeText(r),u(!0),setTimeout(()=>u(!1),2e3)}catch(U){console.error("Failed to copy text: ",U)}},e[6]=r,e[7]=p):p=e[7];const d=p;let h;e[8]!==l?(h=()=>{a(!l)},e[8]=l,e[9]=h):h=e[9];const y=h,j=l?"text":"password";let v;e[10]!==t?(v=oe("pr-20",t),e[10]=t,e[11]=v):v=e[11];let g;e[12]!==s||e[13]!==i||e[14]!==c||e[15]!==j||e[16]!==v||e[17]!==r?(g=n.jsx(Oe,{type:j,value:r,onChange:s,placeholder:i,className:v,...c}),e[12]=s,e[13]=i,e[14]=c,e[15]=j,e[16]=v,e[17]=r,e[18]=g):g=e[18];const f=l?"Hide password":"Show password";let x;e[19]!==l?(x=l?n.jsx(ln,{size:16}):n.jsx(an,{size:16}),e[19]=l,e[20]=x):x=e[20];let b;e[21]!==f||e[22]!==x||e[23]!==y?(b=n.jsx(G,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:y,title:f,children:x}),e[21]=f,e[22]=x,e[23]=y,e[24]=b):b=e[24];const C=!r,w=m?"Copied!":"Copy token";let E;e[25]!==m?(E=m?n.jsx(rn,{size:16}):n.jsx(Lt,{size:16}),e[25]=m,e[26]=E):E=e[26];let _;e[27]!==d||e[28]!==w||e[29]!==E||e[30]!==C?(_=n.jsx(G,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:d,disabled:C,title:w,children:E}),e[27]=d,e[28]=w,e[29]=E,e[30]=C,e[31]=_):_=e[31];let N;e[32]!==_||e[33]!==b?(N=n.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[b,_]}),e[32]=_,e[33]=b,e[34]=N):N=e[34];let I;return e[35]!==N||e[36]!==g?(I=n.jsxs("div",{className:"relative",children:[g,N]}),e[35]=N,e[36]=g,e[37]=I):I=e[37],I}function ot(o){const e=z.c(19),{card:t,selfClient:s,org:i,onDone:c,onError:r}=o,l=Xe();let a;e[0]!==t||e[1]!==s?(a=async v=>{const g={...t.configurationState??{},...v};await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:{configuration_state:g}}})},e[0]=t,e[1]=s,e[2]=a):a=e[2];let m;e[3]!==c||e[4]!==i||e[5]!==l?(m=async()=>{await l.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),c()},e[3]=c,e[4]=i,e[5]=l,e[6]=m):m=e[6];let u;e[7]!==r?(u=v=>{r?.(v)},e[7]=r,e[8]=u):u=e[8];let p;e[9]!==a||e[10]!==m||e[11]!==u?(p={mutationFn:a,onSuccess:m,onError:u},e[9]=a,e[10]=m,e[11]=u,e[12]=p):p=e[12];const d=we(p);let h;e[13]!==d?(h=v=>d.mutate(v),e[13]=d,e[14]=h):h=e[14];const y=h;let j;return e[15]!==d.error||e[16]!==d.isPending||e[17]!==y?(j={save:y,isPending:d.isPending,error:d.error},e[15]=d.error,e[16]=d.isPending,e[17]=y,e[18]=j):j=e[18],j}const In=De({accountName:be().min(1,"Informe o nome da conta"),appKey:be().optional(),appToken:be().optional()});function Tn(o){const e=z.c(63),{card:t,selfClient:s,org:i,onDone:c,onIsPendingChange:r}=o;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Fe(In),e[0]=l):l=e[0];const a=t.configurationState?.accountName||"",m=t.configurationState?.appKey||"",u=t.configurationState?.appToken||"";let p;e[1]!==a||e[2]!==m||e[3]!==u?(p={resolver:l,defaultValues:{accountName:a,appKey:m,appToken:u}},e[1]=a,e[2]=m,e[3]=u,e[4]=p):p=e[4];const d=Me(p);let h;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==d?(h=()=>{d.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]=d,e[9]=h):h=e[9];let y;e[10]!==t.configurationState||e[11]!==d?(y=[t.configurationState,d],e[10]=t.configurationState,e[11]=d,e[12]=y):y=e[12],K.useEffect(h,y);let j;e[13]!==t||e[14]!==c||e[15]!==i||e[16]!==s?(j={card:t,selfClient:s,org:i,onDone:c},e[13]=t,e[14]=c,e[15]=i,e[16]=s,e[17]=j):j=e[17];const{save:v,isPending:g,error:f}=ot(j);let x,b;e[18]!==g||e[19]!==r?(b=()=>{r?.(g)},x=[g,r],e[18]=g,e[19]=r,e[20]=x,e[21]=b):(x=e[20],b=e[21]),K.useEffect(b,x);let C;if(e[22]!==d||e[23]!==v){let q;e[25]!==v?(q=async S=>{v(S)},e[25]=v,e[26]=q):q=e[26],C=d.handleSubmit(q),e[22]=d,e[23]=v,e[24]=C}else C=e[24];const w=C;let E;e[27]!==g?(E=q=>{const{field:S}=q;return n.jsxs(je,{children:[n.jsx(Le,{children:"Nome da conta"}),n.jsx(Ce,{children:n.jsx(Oe,{placeholder:"Nome da sua conta VTEX",...S,disabled:g})}),n.jsx(Se,{})]})},e[27]=g,e[28]=E):E=e[28];let _;e[29]!==d.control||e[30]!==E?(_=n.jsx(ve,{control:d.control,name:"accountName",render:E}),e[29]=d.control,e[30]=E,e[31]=_):_=e[31];let N;e[32]!==g?(N=q=>{const{field:S}=q;return n.jsxs(je,{children:[n.jsx(Le,{children:"App Key (opcional)"}),n.jsx(Ce,{children:n.jsx(gt,{placeholder:"App Key da VTEX",...S,disabled:g})}),n.jsx(Se,{})]})},e[32]=g,e[33]=N):N=e[33];let I;e[34]!==d.control||e[35]!==N?(I=n.jsx(ve,{control:d.control,name:"appKey",render:N}),e[34]=d.control,e[35]=N,e[36]=I):I=e[36];let U;e[37]!==g?(U=q=>{const{field:S}=q;return n.jsxs(je,{children:[n.jsx(Le,{children:"App Token (opcional)"}),n.jsx(Ce,{children:n.jsx(gt,{placeholder:"App Token da VTEX",...S,disabled:g})}),n.jsx(Se,{})]})},e[37]=g,e[38]=U):U=e[38];let T;e[39]!==d.control||e[40]!==U?(T=n.jsx(ve,{control:d.control,name:"appToken",render:U}),e[39]=d.control,e[40]=U,e[41]=T):T=e[41];let O;e[42]!==d||e[43]!==_||e[44]!==I||e[45]!==T?(O=n.jsxs(He,{...d,children:[_,I,T]}),e[42]=d,e[43]=_,e[44]=I,e[45]=T,e[46]=O):O=e[46];let k;e[47]!==f?(k=f&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:f instanceof Error?f.message:"Não foi possível salvar a configuração"}),e[47]=f,e[48]=k):k=e[48];let R;e[49]!==g||e[50]!==c?(R=n.jsx(G,{type:"button",variant:"outline",onClick:c,disabled:g,children:"Cancelar"}),e[49]=g,e[50]=c,e[51]=R):R=e[51];const $=g?"Salvando...":"Salvar";let M;e[52]!==g||e[53]!==$?(M=n.jsx(G,{type:"submit",disabled:g,children:$}),e[52]=g,e[53]=$,e[54]=M):M=e[54];let L;e[55]!==R||e[56]!==M?(L=n.jsxs(Ve,{className:"pt-4",children:[R,M]}),e[55]=R,e[56]=M,e[57]=L):L=e[57];let F;return e[58]!==w||e[59]!==O||e[60]!==k||e[61]!==L?(F=n.jsxs("form",{onSubmit:w,className:"space-y-4",children:[O,k,L]}),e[58]=w,e[59]=O,e[60]=k,e[61]=L,e[62]=F):F=e[62],F}function Dt(o){const e=z.c(30),{options:t,value:s,onChange:i,disabled:c,ariaLabel:r,searchPlaceholder:l}=o,a=l===void 0?"Buscar...":l,[m,u]=K.useState("");let p,d,h;if(e[0]!==t||e[1]!==m||e[2]!==s){const _=m.trim().toLowerCase();p=_?t.filter(N=>N.label.toLowerCase().includes(_)):t,d=p.map(On),h=d.includes(s)?s:d[0]??"",e[0]=t,e[1]=m,e[2]=s,e[3]=p,e[4]=d,e[5]=h}else p=e[3],d=e[4],h=e[5];const y=h;let j;e[6]!==c||e[7]!==d||e[8]!==i?(j=function(N){if(c||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(N.key))return;N.preventDefault();const U=N.currentTarget.dataset.value,T=d.indexOf(U),O=d.length;if(O===0)return;let k;N.key==="ArrowDown"||N.key==="ArrowRight"?k=(T+1)%O:N.key==="ArrowUp"||N.key==="ArrowLeft"?k=(T-1+O)%O:N.key==="Home"?k=0:k=O-1;const R=d[k];i(R),N.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(R)}"]`)?.focus()},e[6]=c,e[7]=d,e[8]=i,e[9]=j):j=e[9];const v=j;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(en,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[10]=g):g=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=_=>u(_.target.value),e[11]=f):f=e[11];const x=`Buscar ${r}`;let b;e[12]!==c||e[13]!==m||e[14]!==a||e[15]!==x?(b=n.jsxs("div",{className:"relative",children:[g,n.jsx(Oe,{type:"text",value:m,onChange:f,disabled:c,placeholder:a,"aria-label":x,className:"h-8 pl-8"})]}),e[12]=c,e[13]=m,e[14]=a,e[15]=x,e[16]=b):b=e[16];let C;e[17]!==c||e[18]!==p||e[19]!==v||e[20]!==i||e[21]!==y||e[22]!==s?(C=p.length===0?n.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):p.map(_=>{const N=_.value===s;return n.jsxs("button",{type:"button",role:"radio","aria-checked":N,disabled:c,"data-value":_.value,tabIndex:_.value===y?0:-1,onClick:()=>i(_.value),onKeyDown:v,className:oe("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",N?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[n.jsx("span",{className:"truncate",children:_.label}),N?n.jsx(st,{size:16,className:"shrink-0 text-primary"}):null]},_.value)}),e[17]=c,e[18]=p,e[19]=v,e[20]=i,e[21]=y,e[22]=s,e[23]=C):C=e[23];let w;e[24]!==r||e[25]!==C?(w=n.jsx("div",{role:"radiogroup","aria-label":r,className:"max-h-[280px] overflow-y-auto",children:C}),e[24]=r,e[25]=C,e[26]=w):w=e[26];let E;return e[27]!==b||e[28]!==w?(E=n.jsxs("div",{className:"space-y-2",children:[b,w]}),e[27]=b,e[28]=w,e[29]=E):E=e[29],E}function On(o){return o.value}function it(o){const e=z.c(16),{label:t,iconSize:s,className:i,iconClassName:c,labelClassName:r}=o,l=s===void 0?14:s;let a;e[0]!==i?(a=oe("inline-flex items-center gap-2",i),e[0]=i,e[1]=a):a=e[1];let m;e[2]!==c?(m=oe("shrink-0 animate-spin",c),e[2]=c,e[3]=m):m=e[3];let u;e[4]!==l||e[5]!==m?(u=n.jsx(et,{size:l,className:m}),e[4]=l,e[5]=m,e[6]=u):u=e[6];let p;e[7]!==r?(p=oe("text-sm",r),e[7]=r,e[8]=p):p=e[8];let d;e[9]!==t||e[10]!==p?(d=n.jsx("span",{className:p,children:t}),e[9]=t,e[10]=p,e[11]=d):d=e[11];let h;return e[12]!==a||e[13]!==u||e[14]!==d?(h=n.jsxs("span",{className:a,children:[u,d]}),e[12]=a,e[13]=u,e[14]=d,e[15]=h):h=e[15],h}const An=De({propertyId:be().min(1,"Selecione uma propriedade")});function kn(o){const e=z.c(55),{card:t,connectionId:s,companionClient:i,selfClient:c,org:r,onDone:l,onIsPendingChange:a}=o;let m;e[0]!==s||e[1]!==r.id?(m=Z.commerceDiscoveryCompanionGaProperties(r.id,s),e[0]=s,e[1]=r.id,e[2]=m):m=e[2];let u;e[3]!==i?(u=async()=>{const S=await i.callTool({name:"get-account-summaries",arguments:{}}),D=se(S);return wn(D)},e[3]=i,e[4]=u):u=e[4];let p;e[5]!==m||e[6]!==u?(p={queryKey:m,queryFn:u},e[5]=m,e[6]=u,e[7]=p):p=e[7];const d=tt(p);let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=Fe(An),e[8]=h):h=e[8];const y=t.configurationState?.propertyId||"";let j;e[9]!==y?(j={resolver:h,defaultValues:{propertyId:y}},e[9]=y,e[10]=j):j=e[10];const v=Me(j);let g;e[11]!==t||e[12]!==l||e[13]!==r||e[14]!==c?(g={card:t,selfClient:c,org:r,onDone:l},e[11]=t,e[12]=l,e[13]=r,e[14]=c,e[15]=g):g=e[15];const{save:f,isPending:x,error:b}=ot(g);let C,w;e[16]!==x||e[17]!==a?(C=()=>{a?.(x)},w=[x,a],e[16]=x,e[17]=a,e[18]=C,e[19]=w):(C=e[18],w=e[19]),K.useEffect(C,w);let E;if(e[20]!==v||e[21]!==f){let S;e[23]!==f?(S=async D=>{f(D)},e[23]=f,e[24]=S):S=e[24],E=v.handleSubmit(S),e[20]=v,e[21]=f,e[22]=E}else E=e[22];const _=E;if(d.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:n.jsx(it,{label:"Carregando propriedades..."})}),e[25]=S):S=e[25],S}if(d.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=S):S=e[26],S}let N;e[27]!==d.data?(N=d.data||[],e[27]=d.data,e[28]=N):N=e[28];const I=N;if(I.flatMap(Un).length===0){let S;return e[29]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx("div",{className:"space-y-4",children:n.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]=S):S=e[29],S}let T;e[30]!==x||e[31]!==I?(T=S=>{const{field:D}=S;return n.jsxs(je,{children:[n.jsx(Ce,{children:n.jsx(Dt,{options:I.flatMap(Rn),value:D.value,onChange:D.onChange,disabled:x,ariaLabel:"Propriedade do Google Analytics"})}),n.jsx(Se,{})]})},e[30]=x,e[31]=I,e[32]=T):T=e[32];let O;e[33]!==v.control||e[34]!==T?(O=n.jsx(ve,{control:v.control,name:"propertyId",render:T}),e[33]=v.control,e[34]=T,e[35]=O):O=e[35];let k;e[36]!==v||e[37]!==O?(k=n.jsx(He,{...v,children:O}),e[36]=v,e[37]=O,e[38]=k):k=e[38];let R;e[39]!==b?(R=b&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:b instanceof Error?b.message:"Não foi possível salvar a configuração"}),e[39]=b,e[40]=R):R=e[40];let $;e[41]!==x||e[42]!==l?($=n.jsx(G,{type:"button",variant:"outline",onClick:l,disabled:x,children:"Cancelar"}),e[41]=x,e[42]=l,e[43]=$):$=e[43];const M=x?"Salvando...":"Salvar";let L;e[44]!==x||e[45]!==M?(L=n.jsx(G,{type:"submit",disabled:x,children:M}),e[44]=x,e[45]=M,e[46]=L):L=e[46];let F;e[47]!==$||e[48]!==L?(F=n.jsxs(Ve,{className:"pt-4",children:[$,L]}),e[47]=$,e[48]=L,e[49]=F):F=e[49];let q;return e[50]!==_||e[51]!==k||e[52]!==R||e[53]!==F?(q=n.jsxs("form",{onSubmit:_,className:"space-y-4",children:[k,R,F]}),e[50]=_,e[51]=k,e[52]=R,e[53]=F,e[54]=q):q=e[54],q}function Rn(o){return o.options}function Un(o){return o.options}const Pn=De({siteUrl:be().min(1,"Selecione um site")});function zn(o){const e=z.c(59),{card:t,connectionId:s,companionClient:i,selfClient:c,org:r,contextSiteUrl:l,onDone:a,onIsPendingChange:m}=o;let u;e[0]!==s||e[1]!==r.id?(u=Z.commerceDiscoveryCompanionGscSites(r.id,s),e[0]=s,e[1]=r.id,e[2]=u):u=e[2];let p;e[3]!==i?(p=async()=>{const S=await i.callTool({name:"list_sites",arguments:{}});return se(S).sites||[]},e[3]=i,e[4]=p):p=e[4];let d;e[5]!==u||e[6]!==p?(d={queryKey:u,queryFn:p},e[5]=u,e[6]=p,e[7]=d):d=e[7];const h=tt(d);let y;e[8]===Symbol.for("react.memo_cache_sentinel")?(y=Fe(Pn),e[8]=y):y=e[8];const j=t.configurationState?.siteUrl||"";let v;e[9]!==j?(v={resolver:y,defaultValues:{siteUrl:j}},e[9]=j,e[10]=v):v=e[10];const g=Me(v);let f;e[11]!==t||e[12]!==a||e[13]!==r||e[14]!==c?(f={card:t,selfClient:c,org:r,onDone:a},e[11]=t,e[12]=a,e[13]=r,e[14]=c,e[15]=f):f=e[15];const{save:x,isPending:b,error:C}=ot(f);let w,E;e[16]!==b||e[17]!==m?(w=()=>{m?.(b)},E=[b,m],e[16]=b,e[17]=m,e[18]=w,e[19]=E):(w=e[18],E=e[19]),K.useEffect(w,E);let _;if(e[20]!==g||e[21]!==x){let S;e[23]!==x?(S=async D=>{x(D)},e[23]=x,e[24]=S):S=e[24],_=g.handleSubmit(S),e[20]=g,e[21]=x,e[22]=_}else _=e[22];const N=_;if(h.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:n.jsx(it,{label:"Carregando sites..."})}),e[25]=S):S=e[25],S}if(h.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[26]=S):S=e[26],S}let I,U;if(e[27]!==t.configurationState?.siteUrl||e[28]!==l||e[29]!==g||e[30]!==h.data){U=Symbol.for("react.early_return_sentinel");e:{if(I=h.data||[],I.length===0){let D;e[33]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[33]=D):D=e[33],U=D;break e}const S=t.configurationState?.siteUrl;if(S&&g.getValues("siteUrl")!==S)g.setValue("siteUrl",S);else if(!S&&!g.getValues("siteUrl")){const D=En(l,I);D&&g.setValue("siteUrl",D)}}e[27]=t.configurationState?.siteUrl,e[28]=l,e[29]=g,e[30]=h.data,e[31]=I,e[32]=U}else I=e[31],U=e[32];if(U!==Symbol.for("react.early_return_sentinel"))return U;let T;e[34]!==b||e[35]!==I?(T=S=>{const{field:D}=S;return n.jsxs(je,{children:[n.jsx(Ce,{children:n.jsx(Dt,{options:I.map(Ln),value:D.value,onChange:D.onChange,disabled:b,ariaLabel:"Site verificado"})}),n.jsx(Se,{})]})},e[34]=b,e[35]=I,e[36]=T):T=e[36];let O;e[37]!==g.control||e[38]!==T?(O=n.jsx(ve,{control:g.control,name:"siteUrl",render:T}),e[37]=g.control,e[38]=T,e[39]=O):O=e[39];let k;e[40]!==g||e[41]!==O?(k=n.jsx(He,{...g,children:O}),e[40]=g,e[41]=O,e[42]=k):k=e[42];let R;e[43]!==C?(R=C&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C instanceof Error?C.message:"Não foi possível salvar a configuração"}),e[43]=C,e[44]=R):R=e[44];let $;e[45]!==b||e[46]!==a?($=n.jsx(G,{type:"button",variant:"outline",onClick:a,disabled:b,children:"Cancelar"}),e[45]=b,e[46]=a,e[47]=$):$=e[47];const M=b?"Salvando...":"Salvar";let L;e[48]!==b||e[49]!==M?(L=n.jsx(G,{type:"submit",disabled:b,children:M}),e[48]=b,e[49]=M,e[50]=L):L=e[50];let F;e[51]!==$||e[52]!==L?(F=n.jsxs(Ve,{className:"pt-4",children:[$,L]}),e[51]=$,e[52]=L,e[53]=F):F=e[53];let q;return e[54]!==N||e[55]!==k||e[56]!==R||e[57]!==F?(q=n.jsxs("form",{onSubmit:N,className:"space-y-4",children:[k,R,F]}),e[54]=N,e[55]=k,e[56]=R,e[57]=F,e[58]=q):q=e[58],q}function Ln(o){return{value:o.siteUrl,label:o.siteUrl}}const $n={vtex:Tn,"google-analytics":kn,"google-search-console":zn},_e="deco-reader@decocms.iam.gserviceaccount.com",Ft={"google-analytics":"ga4","google-search-console":"gsc"},Mt={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 ${_e} 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 ${_e} e escolha permissão Completa.`,"Copie o endereço do site como aparece no seletor de propriedades e cole abaixo."]}};function Dn(o,e){const t=Mt[o].label;switch(e){case"no-access":return{title:`Ainda não conseguimos acessar este recurso no ${t}.`,steps:o==="ga4"?[`Confirme que ${_e} 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 ${_e} 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 Fn(o){const e=z.c(76),{provider:t,siteUrl:s,selfClient:i,org:c,initialResourceId:r,onDone:l,onIsPendingChange:a,onOAuthInstead:m}=o,u=Mt[t],p=Xe(),[d,h]=K.useState(null);let y,j;if(e[0]!==u.resourceLabel){const A=De({resourceId:be().trim().min(1,`Informe o ${u.resourceLabel.toLowerCase()}`)});j=Me,y=Fe(A),e[0]=u.resourceLabel,e[1]=y,e[2]=j}else y=e[1],j=e[2];const v=r??"";let g;e[3]!==v?(g={resourceId:v},e[3]=v,e[4]=g):g=e[4];let f;e[5]!==y||e[6]!==g?(f={resolver:y,defaultValues:g},e[5]=y,e[6]=g,e[7]=f):f=e[7];const x=j(f);let b;e[8]!==t||e[9]!==i||e[10]!==s?(b=async A=>{if(!s)throw new Error("URL da loja indisponível — recarregue a página.");const V=await i.callTool({name:"COMMERCE_DISCOVERY_BIND",arguments:{siteUrl:s,provider:t,resourceId:A.resourceId}});return se(V)},e[8]=t,e[9]=i,e[10]=s,e[11]=b):b=e[11];let C,w;e[12]!==a?(C=()=>a?.(!0),w=()=>a?.(!1),e[12]=a,e[13]=C,e[14]=w):(C=e[13],w=e[14]);let E;e[15]!==u.label||e[16]!==l||e[17]!==c||e[18]!==t||e[19]!==p||e[20]!==s?(E=async A=>{if(A.ok){h(null),bt.success(`${u.label} conectado`),s&&await p.invalidateQueries({queryKey:Z.commerceDiscoveryConnectionStatus(c.id,s)}),l();return}h({...Dn(t,A.reason??"unknown"),detail:A.detail})},e[15]=u.label,e[16]=l,e[17]=c,e[18]=t,e[19]=p,e[20]=s,e[21]=E):E=e[21];let _;e[22]!==b||e[23]!==C||e[24]!==w||e[25]!==E?(_={mutationFn:b,onMutate:C,onSettled:w,onSuccess:E},e[22]=b,e[23]=C,e[24]=w,e[25]=E,e[26]=_):_=e[26];const N=we(_);let I;if(e[27]!==x||e[28]!==N){let A;e[30]!==N?(A=V=>N.mutate(V),e[30]=N,e[31]=A):A=e[31],I=x.handleSubmit(A),e[27]=x,e[28]=N,e[29]=I}else I=e[29];const U=I,T=N.isPending,O=Kn;let k;e[32]!==u.connectSteps?(k=u.connectSteps.map(qn),e[32]=u.connectSteps,e[33]=k):k=e[33];let R;e[34]!==k?(R=n.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground",children:k}),e[34]=k,e[35]=R):R=e[35];let $;e[36]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx("code",{className:"min-w-0 flex-1 truncate text-xs text-foreground",children:_e}),e[36]=$):$=e[36];let M;e[37]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/40 p-2",children:[$,n.jsx(G,{type:"button",variant:"ghost",size:"icon-sm",onClick:O,"aria-label":"Copiar e-mail do service account",children:n.jsx(Lt,{size:16})})]}),e[37]=M):M=e[37];let L;e[38]!==u.resourceHint||e[39]!==u.resourceLabel||e[40]!==u.resourcePlaceholder||e[41]!==T?(L=A=>{const{field:V}=A;return n.jsxs(je,{children:[n.jsx(Le,{children:u.resourceLabel}),n.jsx(Ce,{children:n.jsx(Oe,{...V,placeholder:u.resourcePlaceholder,disabled:T,autoComplete:"off"})}),n.jsx(on,{children:u.resourceHint}),n.jsx(Se,{})]})},e[38]=u.resourceHint,e[39]=u.resourceLabel,e[40]=u.resourcePlaceholder,e[41]=T,e[42]=L):L=e[42];let F;e[43]!==x.control||e[44]!==L?(F=n.jsx(ve,{control:x.control,name:"resourceId",render:L}),e[43]=x.control,e[44]=L,e[45]=F):F=e[45];let q;e[46]!==x||e[47]!==F?(q=n.jsx(He,{...x,children:F}),e[46]=x,e[47]=F,e[48]=q):q=e[48];let S;e[49]!==d?(S=d&&n.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:d.title}),n.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:d.steps.map(Mn)})]}),e[49]=d,e[50]=S):S=e[50];let D;e[51]!==N.error||e[52]!==N.isError?(D=N.isError&&n.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]=D):D=e[53];let W;e[54]!==T||e[55]!==m?(W=m?n.jsx("button",{type:"button",onClick:m,disabled:T,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:opacity-50",children:"autorizar via login do Google"}):n.jsx("span",{}),e[54]=T,e[55]=m,e[56]=W):W=e[56];let Q;e[57]!==T||e[58]!==l?(Q=n.jsx(G,{type:"button",variant:"outline",onClick:l,disabled:T,children:"Cancelar"}),e[57]=T,e[58]=l,e[59]=Q):Q=e[59];const H=T?"Verificando...":"Vincular";let X;e[60]!==T||e[61]!==H?(X=n.jsx(G,{type:"submit",disabled:T,children:H}),e[60]=T,e[61]=H,e[62]=X):X=e[62];let Y;e[63]!==Q||e[64]!==X?(Y=n.jsxs("div",{className:"flex gap-2",children:[Q,X]}),e[63]=Q,e[64]=X,e[65]=Y):Y=e[65];let J;e[66]!==W||e[67]!==Y?(J=n.jsxs(Ve,{className:"flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[W,Y]}),e[66]=W,e[67]=Y,e[68]=J):J=e[68];let ee;return e[69]!==U||e[70]!==R||e[71]!==q||e[72]!==S||e[73]!==D||e[74]!==J?(ee=n.jsxs("form",{onSubmit:U,className:"space-y-4",children:[R,M,q,S,D,J]}),e[69]=U,e[70]=R,e[71]=q,e[72]=S,e[73]=D,e[74]=J,e[75]=ee):ee=e[75],ee}function Mn(o){return n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{"aria-hidden":!0,children:"•"}),n.jsx("span",{children:o})]},o)}function qn(o,e){return n.jsxs("li",{className:"flex gap-2",children:[n.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}),n.jsx("span",{children:o})]},o)}function Kn(){navigator.clipboard?.writeText(_e),bt.success("E-mail copiado")}function Vn(){const o=z.c(2);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.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=n.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-4 sm:h-full sm:flex-col sm:items-stretch",children:[e,n.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[n.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),n.jsx("div",{className:"h-3 w-full animate-pulse rounded bg-muted/60"})]}),n.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 ht="rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground";function Hn(o){const e=z.c(37),{card:t,connecting:s,disabled:i,onConnect:c,org:r,selfClient:l,siteUrl:a,autoOpenConfigFieldKey:m,onAutoOpenConfigHandled:u}=o,p=t.linkedConnectionId,d=Ft[t.bindingType],h=!!d&&t.boundVia!=="oauth";let y;e[0]!==m||e[1]!==t||e[2]!==s||e[3]!==i||e[4]!==p||e[5]!==u||e[6]!==c||e[7]!==r||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==h?(y=h&&d?n.jsx(Bn,{card:t,provider:d,org:r,selfClient:l,siteUrl:a,onOAuthInstead:c,disabled:i,connecting:s}):t.satisfied&&p?n.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[n.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[n.jsx(st,{size:16,className:"text-success"})," Conectado"]}),n.jsx(K.Suspense,{fallback:n.jsx(Gn,{}),children:n.jsx(Qn,{card:t,org:r,selfClient:l,connectionId:p,contextSiteUrl:a,autoOpen:jn({autoOpenFieldKey:m,card:t}),onAutoOpenHandled:u})})]}):n.jsx(G,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:i||s,onClick:c,"aria-label":`Conectar ${t.title}`,children:s?n.jsx(et,{size:16,className:"animate-spin"}):"Conectar"}),e[0]=m,e[1]=t,e[2]=s,e[3]=i,e[4]=p,e[5]=u,e[6]=c,e[7]=r,e[8]=d,e[9]=l,e[10]=a,e[11]=h,e[12]=y):y=e[12];const j=y;let v;e[13]!==t.icon||e[14]!==t.title?(v=n.jsx(nt,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"shrink-0 p-1.5"}),e[13]=t.icon,e[14]=t.title,e[15]=v):v=e[15];let g;e[16]!==t.area?(g=t.area&&n.jsx("span",{className:oe("hidden sm:inline-block",ht),children:t.area}),e[16]=t.area,e[17]=g):g=e[17];let f;e[18]!==v||e[19]!==g?(f=n.jsxs("div",{className:"shrink-0 self-start sm:flex sm:w-full sm:items-center sm:justify-between sm:gap-2",children:[v,g]}),e[18]=v,e[19]=g,e[20]=f):f=e[20];let x;e[21]!==t.area?(x=t.area&&n.jsx("span",{className:oe("mb-1 inline-block sm:hidden",ht),children:t.area}),e[21]=t.area,e[22]=x):x=e[22];let b;e[23]!==t.title?(b=n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),e[23]=t.title,e[24]=b):b=e[24];let C;e[25]!==t.headline?(C=t.headline&&n.jsx("p",{className:"mt-0.5 line-clamp-2 text-sm leading-5 text-muted-foreground",children:t.headline}),e[25]=t.headline,e[26]=C):C=e[26];let w;e[27]!==x||e[28]!==b||e[29]!==C?(w=n.jsxs("div",{className:"min-w-0 flex-1",children:[x,b,C]}),e[27]=x,e[28]=b,e[29]=C,e[30]=w):w=e[30];let E;e[31]!==j?(E=n.jsx("div",{className:"shrink-0 sm:mt-auto sm:w-full sm:pt-1",children:j}),e[31]=j,e[32]=E):E=e[32];let _;return e[33]!==f||e[34]!==w||e[35]!==E?(_=n.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-4 sm:h-full sm:flex-col sm:items-stretch",children:[f,w,E]}),e[33]=f,e[34]=w,e[35]=E,e[36]=_):_=e[36],_}function Bn(o){const e=z.c(39),{card:t,provider:s,org:i,selfClient:c,siteUrl:r,onOAuthInstead:l,disabled:a,connecting:m}=o,[u,p]=K.useState(!1),[d,h]=K.useState(!1);let y;e[0]!==d?(y=O=>{!O&&d||p(O)},e[0]=d,e[1]=y):y=e[1];const j=y;let v;e[2]!==t.satisfied||e[3]!==t.title||e[4]!==m||e[5]!==a?(v=t.satisfied?n.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[n.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[n.jsx(st,{size:16,className:"text-success"})," Conectado"]}),n.jsxs(Rt,{children:[n.jsx(Ut,{asChild:!0,children:n.jsx(G,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>p(!0),"aria-label":`Configurar ${t.title}`,children:n.jsx(zt,{size:16})})}),n.jsx(Pt,{children:"Editar configuração"})]})]}):n.jsx(G,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:a||m,onClick:()=>p(!0),"aria-label":`Conectar ${t.title}`,children:m?n.jsx(et,{size:16,className:"animate-spin"}):"Conectar"}),e[2]=t.satisfied,e[3]=t.title,e[4]=m,e[5]=a,e[6]=v):v=e[6];let g;e[7]!==t.icon||e[8]!==t.title?(g=n.jsx(nt,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[7]=t.icon,e[8]=t.title,e[9]=g):g=e[9];let f;e[10]!==t.title?(f=n.jsx(It,{children:t.title}),e[10]=t.title,e[11]=f):f=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Tt,{children:"Conceda acesso ao nosso leitor e informe o identificador"}),e[12]=x):x=e[12];let b;e[13]!==f?(b=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[f,x]}),e[13]=f,e[14]=b):b=e[14];let C;e[15]!==g||e[16]!==b?(C=n.jsxs(Ot,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[g,b]}),e[15]=g,e[16]=b,e[17]=C):C=e[17];const w=t.boundResource??void 0;let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=()=>p(!1),e[18]=E):E=e[18];let _;e[19]!==t.satisfied||e[20]!==l?(_=t.satisfied?void 0:()=>{p(!1),l()},e[19]=t.satisfied,e[20]=l,e[21]=_):_=e[21];let N;e[22]!==i||e[23]!==s||e[24]!==c||e[25]!==r||e[26]!==_||e[27]!==w?(N=n.jsx(Fn,{provider:s,siteUrl:r,selfClient:c,org:i,initialResourceId:w,onDone:E,onIsPendingChange:h,onOAuthInstead:_}),e[22]=i,e[23]=s,e[24]=c,e[25]=r,e[26]=_,e[27]=w,e[28]=N):N=e[28];let I;e[29]!==N||e[30]!==C?(I=n.jsxs(At,{className:"sm:max-w-lg",children:[C,N]}),e[29]=N,e[30]=C,e[31]=I):I=e[31];let U;e[32]!==j||e[33]!==u||e[34]!==I?(U=n.jsx(kt,{open:u,onOpenChange:j,children:I}),e[32]=j,e[33]=u,e[34]=I,e[35]=U):U=e[35];let T;return e[36]!==U||e[37]!==v?(T=n.jsxs(n.Fragment,{children:[v,U]}),e[36]=U,e[37]=v,e[38]=T):T=e[38],T}function Gn(){const o=z.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0],e}function Qn(o){const e=z.c(46),{card:t,org:s,selfClient:i,connectionId:c,contextSiteUrl:r,autoOpen:l,onAutoOpenHandled:a}=o;let m;e[0]!==c||e[1]!==s.id||e[2]!==s.slug?(m={connectionId:c,orgId:s.id,orgSlug:s.slug},e[0]=c,e[1]=s.id,e[2]=s.slug,e[3]=m):m=e[3];const u=Ke(m),[p,d]=K.useState(l),[h,y]=K.useState(!1),j=$n[t.bindingType],v=vn(t.configurationState);let g;e[4]!==l||e[5]!==a?(g=()=>{d(!1),l&&a()},e[4]=l,e[5]=a,e[6]=g):g=e[6];const f=g;let x;e[7]!==f||e[8]!==h?(x=F=>{if(!(!F&&h)){if(!F){f();return}d(!0)}},e[7]=f,e[8]=h,e[9]=x):x=e[9];const b=x;if(!j)return null;let C;e[10]===Symbol.for("react.memo_cache_sentinel")?(C=()=>d(!0),e[10]=C):C=e[10];const w=`Configurar ${t.title}`;let E;e[11]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(zt,{size:16}),e[11]=E):E=e[11];let _;e[12]!==w?(_=n.jsx(Ut,{asChild:!0,children:n.jsx(G,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:C,"aria-label":w,children:E})}),e[12]=w,e[13]=_):_=e[13];const N=v.length>0?"Editar configuração":"Configurar";let I;e[14]!==N?(I=n.jsx(Pt,{children:N}),e[14]=N,e[15]=I):I=e[15];let U;e[16]!==_||e[17]!==I?(U=n.jsxs(Rt,{children:[_,I]}),e[16]=_,e[17]=I,e[18]=U):U=e[18];let T;e[19]!==t.icon||e[20]!==t.title?(T=n.jsx(nt,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[19]=t.icon,e[20]=t.title,e[21]=T):T=e[21];let O;e[22]!==t.title?(O=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[n.jsx(It,{children:t.title}),n.jsxs(Tt,{children:["Configure o ",t.title," para enriquecer os dados"]})]}),e[22]=t.title,e[23]=O):O=e[23];let k;e[24]!==T||e[25]!==O?(k=n.jsxs(Ot,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[T,O]}),e[24]=T,e[25]=O,e[26]=k):k=e[26];let R;e[27]!==j||e[28]!==t||e[29]!==f||e[30]!==u||e[31]!==c||e[32]!==r||e[33]!==s||e[34]!==i?(R=n.jsx(j,{card:t,connectionId:c,companionClient:u,selfClient:i,org:s,contextSiteUrl:r,onDone:f,onIsPendingChange:y}),e[27]=j,e[28]=t,e[29]=f,e[30]=u,e[31]=c,e[32]=r,e[33]=s,e[34]=i,e[35]=R):R=e[35];let $;e[36]!==k||e[37]!==R?($=n.jsxs(At,{className:"sm:max-w-lg",children:[k,R]}),e[36]=k,e[37]=R,e[38]=$):$=e[38];let M;e[39]!==p||e[40]!==b||e[41]!==$?(M=n.jsx(kt,{open:p,onOpenChange:b,children:$}),e[39]=p,e[40]=b,e[41]=$,e[42]=M):M=e[42];let L;return e[43]!==U||e[44]!==M?(L=n.jsxs(n.Fragment,{children:[U,M]}),e[43]=U,e[44]=M,e[45]=L):L=e[45],L}const rt={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."}};function Wn(o){const e=z.c(40),{selfClient:t,org:s,cdConnectionId:i,siteUrl:c}=o;let r;e[0]!==i||e[1]!==s.id||e[2]!==s.slug?(r={connectionId:i,orgId:s.id,orgSlug:s.slug},e[0]=i,e[1]=s.id,e[2]=s.slug,e[3]=r):r=e[3];const l=Ke(r);let a;e[4]!==i||e[5]!==s.id?(a=Z.commerceDiscoveryCompanionSchema(s.id,i),e[4]=i,e[5]=s.id,e[6]=a):a=e[6];let m;e[7]!==l?(m=async()=>{const A=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return se(A)},e[7]=l,e[8]=m):m=e[8];let u;e[9]!==a||e[10]!==m?(u={queryKey:a,queryFn:m},e[9]=a,e[10]=m,e[11]=u):u=e[11];const p=ye(u),d=gn(p.data?.stateSchema??{properties:{}}),h=d.map(is),y=d.map(os).filter(ss),j=d.filter(ns).map(ts),v=[...y,...j].sort().join(",");let g;e[12]!==i||e[13]!==s.id?(g=Z.commerceDiscoveryConnection(s.id,i),e[12]=i,e[13]=s.id,e[14]=g):g=e[14];let f;e[15]!==i||e[16]!==t?(f=async()=>{const A=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return se(A)},e[15]=i,e[16]=t,e[17]=f):f=e[17];let x;e[18]!==g||e[19]!==f?(x={queryKey:g,queryFn:f},e[18]=g,e[19]=f,e[20]=x):x=e[20];const C=ye(x).data?.item?.configuration_state??null;let w;e[21]!==C?(w=A=>C?.[A.fieldKey]?.value,e[21]=C,e[22]=w):w=e[22];const E=d.map(w).filter(es),_=[...h.map(Xn),...y.map(Zn),...E.map(Jn)].sort().join(","),I=ye({queryKey:Z.commerceDiscoveryCompanionConnections(s.id,_),queryFn:async()=>{if(d.length===0)return{items:[]};const A=[{field:["app_name"],operator:"in",value:h},{field:["app_id"],operator:"in",value:y}];E.length>0&&A.push({field:["id"],operator:"in",value:E});const V=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:A},limit:1e3}});return se(V)}}).data?.items??[],U=new Set(E),T=I.filter(A=>U.has(A.id)),O=T.filter(Yn);let k;e[23]!==s.id||e[24]!==s.slug?(k=A=>({queryKey:Z.commerceDiscoveryCompanionOAuthStatus(s.id,A.id),queryFn:async()=>{try{const V=await fetch(`/api/${encodeURIComponent(s.slug)}/connections/${encodeURIComponent(A.id)}/oauth-token/status`,{credentials:"include"});return V.ok?{hasToken:(await V.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=s.id,e[24]=s.slug,e[25]=k):k=e[25];const R=cn({queries:O.map(k)});let $;e[26]!==R?($=(A,V)=>[A.id,R[V]?.data?.hasToken===!0],e[26]=R,e[27]=$):$=e[27];const M=new Map(O.map($)),L={};for(const A of T)L[A.id]=!A.oauth_config||!!A.connection_token||M.get(A.id)===!0;const F=ye({queryKey:Z.commerceDiscoveryCompanionRegistry(s.id,v),queryFn:async()=>{if(d.length===0)return{items:[]};const A=hn(y,j),V=await nn(Nt.REGISTRY(s.id),s.id,s.slug,"COLLECTION_REGISTRY_APP_LIST",{...A?{where:A}:{},limit:1e3});return se(V)}}),q={},S={};for(const A of F.data?.items??[])q[A.id]=A,A.server?.name&&(S[A.server.name]=A);let D;e[28]!==s.id||e[29]!==c?(D=Z.commerceDiscoveryConnectionStatus(s.id,c??""),e[28]=s.id,e[29]=c,e[30]=D):D=e[30];const W=!!c;let Q;e[31]!==t||e[32]!==c?(Q=async()=>{const A=await t.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:c}});return se(A)},e[31]=t,e[32]=c,e[33]=Q):Q=e[33];let H;e[34]!==D||e[35]!==W||e[36]!==Q?(H={queryKey:D,enabled:W,queryFn:Q},e[34]=D,e[35]=W,e[36]=Q,e[37]=H):H=e[37];const X=tt(H),Y={};for(const[A,V]of Object.entries(Ft)){const ie=X.data?.providers?.[V];ie?.connected&&ie.via==="sa"&&(Y[A]={resource:ie.resource??null})}const J=Nn({requirements:d,itemsById:q,itemsByName:S,connections:I,connectionReadiness:L,configurationState:C,curated:rt,saBindings:Y});let ee;return e[38]!==J?(ee={cards:J},e[38]=J,e[39]=ee):ee=e[39],ee}function Yn(o){return o.oauth_config&&!o.connection_token}function Jn(o){return`linked:${o}`}function Zn(o){return`app:${o}`}function Xn(o){return`binding:${o}`}function es(o){return typeof o=="string"&&o.length>0}function ts(o){return o.bindingType}function ns(o){return!rt[o.bindingType]}function ss(o){return!!o}function os(o){return rt[o.bindingType]?.registryAppId}function is(o){return o.bindingType}function rs({selfClient:o,org:e,userId:t,cdConnectionId:s}){const i=Xe(),[c,r]=K.useState(null),[l,a]=K.useState(null),m=async(p,d)=>{const h=await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:p,data:d}});return se(h)};async function u(p){r(p.fieldKey),a(null);const d={app_name:p.title,field_key:p.fieldKey,organization_id:e.id};te("commerce_onboarding_companion_connect_clicked",d);try{let h=p.candidateConnectionId;if(!h){const x=sn(p.registryItem,e.id,t,{remoteIndex:0}),b=x.connection_type==="STDIO",C=!!x.connection_url,w=b&&x.connection_headers&&typeof x.connection_headers=="object"&&"command"in x.connection_headers;if(!C&&!w)return te("commerce_onboarding_companion_connect_failed",{...d,error:"no_connection_method"}),a(`${p.title} cannot be connected: no connection method available`),!1;const E=await o.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:x}});h=se(E).item.id}const y=h,j=await dn({connectionId:y,orgId:e.id,orgSlug:e.slug,persistFallback:x=>m(y,{connection_token:x}).then(()=>{})});if(!j.ok)return te("commerce_onboarding_companion_connect_failed",{...d,error:j.error}),a(`Couldn't sign in to ${p.title}: ${j.error}`),!1;const v=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}}),g=se(v).item?.configuration_state??null,f=xn(g,p.fieldKey,p.bindingType,y);return await m(s,{configuration_state:f}),await i.invalidateQueries({queryKey:Z.commerceDiscoveryConnection(e.id,s)}),await i.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),te("commerce_onboarding_companion_connected",d),!0}catch(h){return te("commerce_onboarding_companion_connect_failed",{...d,error:h instanceof Error?h.message:String(h)}),a(h instanceof Error?h.message:String(h)),!1}finally{r(null)}}return{connect:u,connectingFieldKey:c,error:l}}const at="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function lt(){const o=z.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("h1",{className:"text-2xl font-medium leading-8 text-foreground",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),o[0]=e):e=o[0],e}function as(){const o=z.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[0,1,2,3].map(ls)}),o[0]=e):e=o[0],e}function ls(o){return n.jsx(Vn,{},o)}function ct(){const o=z.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:at,children:[n.jsx(lt,{}),n.jsx(as,{})]}),o[0]=e):e=o[0],e}function cs(o){const e=z.c(5),{onRetry:t}=o;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(lt,{}),e[0]=s):s=e[0];let i,c;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),c=n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=i,e[2]=c):(i=e[1],c=e[2]);let r;return e[3]!==t?(r=n.jsxs("div",{className:at,children:[s,n.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i,c,n.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:"Tentar novamente"})]})]}),e[3]=t,e[4]=r):r=e[4],r}function ds(o){const e=z.c(2);let t;return e[0]!==o?(t=n.jsx(vt,{children:s=>{const{reset:i}=s;return n.jsx(jt,{fallback:c=>{const{resetError:r}=c;return n.jsx(cs,{onRetry:()=>{i(),r()}})},children:n.jsx(K.Suspense,{fallback:n.jsx(ct,{}),children:n.jsx(ms,{...o})})})}}),e[0]=o,e[1]=t):t=e[1],t}function ms(o){const e=z.c(38),{org:t,cdConnectionId:s,siteUrl:i}=o,{data:c}=qe.useSession(),r=c?.user?.id??"";let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:Et,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const a=Ke(l);let m;e[3]!==s||e[4]!==t||e[5]!==a||e[6]!==i?(m={selfClient:a,org:t,cdConnectionId:s,siteUrl:i},e[3]=s,e[4]=t,e[5]=a,e[6]=i,e[7]=m):m=e[7];const{cards:u}=Wn(m);let p;e[8]!==s||e[9]!==t||e[10]!==a||e[11]!==r?(p={selfClient:a,org:t,userId:r,cdConnectionId:s},e[8]=s,e[9]=t,e[10]=a,e[11]=r,e[12]=p):p=e[12];const{connect:d,connectingFieldKey:h,error:y}=rs(p),[j,v]=K.useState(null);if(u.length===0)return null;const g=h!==null;let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(lt,{}),e[13]=f):f=e[13];let x;e[14]!==y?(x=y&&n.jsx("p",{role:"alert",className:"mb-3 text-sm text-destructive",children:y}),e[14]=y,e[15]=x):x=e[15];let b;if(e[16]!==j||e[17]!==g||e[18]!==u||e[19]!==d||e[20]!==h||e[21]!==t||e[22]!==a||e[23]!==i){let E;e[25]!==j||e[26]!==g||e[27]!==d||e[28]!==h||e[29]!==t||e[30]!==a||e[31]!==i?(E=_=>{const N=async()=>{await d(_)&&v(_.fieldKey)};return n.jsx(Hn,{card:_,connecting:h===_.fieldKey,disabled:g&&h!==_.fieldKey,org:t,selfClient:a,siteUrl:i,autoOpenConfigFieldKey:j,onAutoOpenConfigHandled:()=>v(I=>I===_.fieldKey?null:I),onConnect:()=>{N()}},_.fieldKey)},e[25]=j,e[26]=g,e[27]=d,e[28]=h,e[29]=t,e[30]=a,e[31]=i,e[32]=E):E=e[32],b=u.map(E),e[16]=j,e[17]=g,e[18]=u,e[19]=d,e[20]=h,e[21]=t,e[22]=a,e[23]=i,e[24]=b}else b=e[24];let C;e[33]!==b?(C=n.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:b}),e[33]=b,e[34]=C):C=e[34];let w;return e[35]!==x||e[36]!==C?(w=n.jsxs("div",{className:at,children:[f,n.jsxs(Je,{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:[x,C]})]}),e[35]=x,e[36]=C,e[37]=w):w=e[37],w}const dt="https://decocms.com/agendar",us="Precisa de ajuda? Fale conosco",fs="Agende uma chamada de 20 minutos e rodamos o diagnóstico com você, ao vivo.",Ie=[{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"}],ps="var(--brand-green-dark)";function mt({siteUrl:o,email:e}){const t=new URL(dt);return o&&t.searchParams.set("siteUrl",o),e&&t.searchParams.set("email",e),t.toString()}function gs(o){const e=z.c(12),{href:t,size:s,className:i,orgId:c}=o,r=t===void 0?dt:t,l=s===void 0?"lg":s;let a;e[0]!==i?(a=oe("w-full",i),e[0]=i,e[1]=a):a=e[1];let m;e[2]!==c?(m=()=>te("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:c}),e[2]=c,e[3]=m):m=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx($t,{size:16}),e[4]=u):u=e[4];let p;e[5]!==r||e[6]!==m?(p=n.jsxs("a",{href:r,target:"_blank",rel:"noreferrer",onClick:m,children:["Agendar uma reunião",u]}),e[5]=r,e[6]=m,e[7]=p):p=e[7];let d;return e[8]!==l||e[9]!==a||e[10]!==p?(d=n.jsx(G,{asChild:!0,variant:"outline",size:l,className:a,children:p}),e[8]=l,e[9]=a,e[10]=p,e[11]=d):d=e[11],d}function hs(o){const e=z.c(10),{size:t}=o,s=t===void 0?72:t;let i;e[0]!==s?(i=Math.round(s*.3),e[0]=s,e[1]=i):i=e[1];const c=i;let r;e[2]!==s?(r={height:s},e[2]=s,e[3]=r):r=e[3];let l;e[4]!==c||e[5]!==s?(l=Ie.map((m,u)=>n.jsxs("div",{className:"relative shrink-0",style:{width:s,height:s,marginLeft:u===0?0:-c,zIndex:Ie.length-u},children:[n.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:n.jsx("img",{src:m.photo,alt:m.alt,className:"h-full w-full object-cover",loading:"lazy"})}),u===0&&n.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[n.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),n.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},m.photo)),e[4]=c,e[5]=s,e[6]=l):l=e[6];let a;return e[7]!==r||e[8]!==l?(a=n.jsx("div",{className:"flex items-end",style:r,children:l}),e[7]=r,e[8]=l,e[9]=a):a=e[9],a}function ut(o){const e=z.c(6),{href:t,orgId:s}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"h-20",style:{backgroundColor:ps}}),e[0]=i):i=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"-mt-9 mb-4",children:n.jsx(hs,{})}),e[1]=c):c=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"grid gap-1.5",children:[n.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:us}),n.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:fs})]}),e[2]=r):r=e[2];let l;return e[3]!==t||e[4]!==s?(l=n.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:n.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[i,n.jsxs("div",{className:"px-8 pb-8",children:[c,r,n.jsx(gs,{href:t,size:"lg",className:"mt-6",orgId:s})]})]})}),e[3]=t,e[4]=s,e[5]=l):l=e[5],l}function xs(o){const e=z.c(13),{className:t,href:s,orgId:i}=o,c=s===void 0?dt:s;let r;e[0]!==i?(r=()=>te("commerce_onboarding_meeting_cta_clicked",{placement:"mobile_banner",organization_id:i}),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t?(l=oe("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",t),e[2]=t,e[3]=l):l=e[3];let a,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(a={height:44,width:44+2*Math.round(30.799999999999997)},m=Ie.map(ys),e[4]=a,e[5]=m):(a=e[4],m=e[5]);let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsxs("span",{className:"relative flex shrink-0 items-center",style:a,children:[m,n.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-3 w-3 rounded-full border-2 border-card bg-success","aria-hidden":!0,style:{zIndex:Ie.length+1}})]}),e[6]=u):u=e[6];let p,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs("span",{className:"flex-1 text-base font-medium leading-5 text-foreground",children:["Precisa de ajuda?",n.jsx("br",{}),"Fale conosco"]}),d=n.jsx($t,{size:18,className:"shrink-0 text-muted-foreground"}),e[7]=p,e[8]=d):(p=e[7],d=e[8]);let h;return e[9]!==c||e[10]!==r||e[11]!==l?(h=n.jsxs("a",{href:c,target:"_blank",rel:"noreferrer",onClick:r,className:l,children:[u,p,d]}),e[9]=c,e[10]=r,e[11]=l,e[12]=h):h=e[12],h}function ys(o,e){return n.jsx("span",{className:"absolute block h-11 w-11 overflow-hidden rounded-full border-2 border-card",style:{left:e*Math.round(30.799999999999997),zIndex:Ie.length-e},children:n.jsx("img",{src:o.photo,alt:o.alt,className:"h-full w-full object-cover",loading:"lazy"})},o.photo)}function qt(o){const e=z.c(10),{host:t}=o,s=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let i,c,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),c=n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=n.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=i,e[1]=c,e[2]=r):(i=e[0],c=e[1],r=e[2]);let l;e[3]!==s?(l=n.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:n.jsx("img",{src:s,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=s,e[4]=l):l=e[4];let a;e[5]!==t?(a=n.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=a):a=e[6];let m;return e[7]!==l||e[8]!==a?(m=n.jsxs("div",{className:"flex items-center gap-3",children:[i,c,r,l,a]}),e[7]=l,e[8]=a,e[9]=m):m=e[9],m}const bs={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function vs(o){return bs[o]}function ft(o){const e=z.c(4),{variant:t}=o;let s;e[0]!==t?(s=vs(t),e[0]=t,e[1]=s):s=e[1];let i;return e[2]!==s?(i=n.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:n.jsx(it,{label:s,className:"text-muted-foreground"})}),e[2]=s,e[3]=i):i=e[3],i}function Mo(){const o=z.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Cs,{}),o[0]=e):e=o[0],e}const Kt=K.createContext(null),Vt=()=>K.useContext(Kt);function ne(o){const e=z.c(13);let t,s;e[0]!==o?({visual:s,...t}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/commerce-onboarding"},e[3]=i):i=e[3];const c=Ct(i),{data:r}=qe.useSession(),l=r?.user?.email;let a;e[4]!==c.siteUrl||e[5]!==l?(a=mt({siteUrl:c.siteUrl,email:l}),e[4]=c.siteUrl,e[5]=l,e[6]=a):a=e[6];const m=a;let u;e[7]!==m||e[8]!==s?(u=s??n.jsx(ut,{href:m}),e[7]=m,e[8]=s,e[9]=u):u=e[9];let p;return e[10]!==t||e[11]!==u?(p=n.jsx(Yt,{...t,visual:u}),e[10]=t,e[11]=u,e[12]=p):p=e[12],p}const js={signUpFailed:"Falha ao criar conta",signInFailed:"Falha ao entrar",authenticationFailed:"Falha na autenticação",resetEmailFailed:"Não foi possível enviar o e-mail de redefinição",otpSendFailed:"Não foi possível enviar o código",invalidCode:"Código inválido",invalidEmail:"E-mail inválido",invalidEmailOrPassword:"E-mail ou senha inválidos. Tente novamente.",accountExists:"Já existe uma conta com este e-mail. Tente entrar em vez de criar uma nova conta.",networkError:"Erro de rede. Verifique sua conexão e tente novamente.",tooManyAttempts:"Muitas tentativas. Aguarde um momento e tente novamente.",invalidOrExpiredCode:"Código inválido ou expirado. Tente novamente.",genericError:"Algo deu errado. Tente novamente.",resetPasswordTitle:"Redefinir sua senha",verificationCodeTitle:"Informe o código de verificação",welcomeTitle:"Bem-vindo à deco",resetPasswordSubtitle:"Enviaremos um link de redefinição",codeSentTo:o=>`Código enviado para ${o}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:o=>`Continuar com ${o}`,divider:"ou",emailLabel:"E-mail",emailPlaceholder:"Endereço de e-mail",sending:"Enviando...",sendCode:"Enviar código",verificationCodeLabel:"Código de verificação",enterCodePlaceholder:"Informe o código",verifying:"Verificando...",verify:"Verificar",useDifferentEmail:"Usar outro e-mail",sendResetLink:"Enviar link de redefinição",nameLabel:"Nome",namePlaceholder:"Seu nome",passwordLabel:"Senha",forgotPassword:"Esqueceu a senha?",creatingAccount:"Criando conta...",signingIn:"Entrando...",continue:"Continuar",backToSignIn:"Voltar para entrar",signInWithPassword:"Entrar com senha",alreadyHaveAccount:"Já tem uma conta? ",dontHaveAccount:"Não tem uma conta? ",signIn:"Entrar",signUp:"Criar conta",signInWithEmailCode:"Entrar com código por e-mail"};function Ee(o){if(!o)return null;const e=Ne(o);return e.ok?new URL(e.value).hostname:null}function xt(o){switch(o){case"Enter a website URL.":return"Informe a URL de um site.";case"Use an HTTP or HTTPS website URL.":return"Use uma URL de site HTTP ou HTTPS.";case"Enter a valid website URL.":return"Informe uma URL de site válida.";default:return o}}let yt=!1;function Cs(){const o=Ct({from:"/commerce-onboarding"}),{org:e,siteUrl:t}=o,s=Ee(t);return!yt&&Bt()&&(yt=!0,te("commerce_onboarding_viewed",{site_url:t,domain:s??void 0,...s?{$set:{last_scanned_domain:s}}:{}})),n.jsx(Kt.Provider,{value:s,children:n.jsx(Ss,{requestedOrgSlug:e,siteUrl:t})})}function Ss(o){const e=z.c(8),{requestedOrgSlug:t,siteUrl:s}=o,{data:i,isPending:c}=qe.useSession(),r=Vt();if(c){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ne,{children:n.jsx(ft,{variant:"generic"})}),e[0]=a):a=e[0],a}if(!i){const a=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let m;e[1]!==r?(m=r?n.jsx(qt,{host:r}):void 0,e[1]=r,e[2]=m):m=e[2];let u;return e[3]!==m?(u=n.jsx(ne,{children:n.jsx(Wt,{callbackUrl:a,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:m,copy:js})}),e[3]=m,e[4]=u):u=e[4],u}let l;return e[5]!==t||e[6]!==s?(l=n.jsx(_s,{requestedOrgSlug:t,siteUrl:s}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function _s(o){const e=z.c(40),{requestedOrgSlug:t,siteUrl:s}=o,i=St(),c=Gt(),[r,l]=K.useState(null),[a,m]=K.useState(null),u=c.data?.map(Es)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:Ns,retry:!1,onSuccess:f=>{m(f)}},e[0]=p):p=e[0];const d=we(p);if(c.isPending){let f;return e[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ne,{children:n.jsx(ft,{variant:"workspace"})}),e[1]=f):f=e[1],f}if(c.error){let f;return e[2]!==c?(f=n.jsx($e,{title:"Não foi possível carregar suas organizações",description:"Tente novamente para continuar a configuração de commerce nesta página.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[2]=c,e[3]=f):f=e[3],f}const h=t?u.find(f=>f.slug===t):null;if(h){let f;return e[4]!==h||e[5]!==s?(f=n.jsx(ze,{org:h,initialSiteUrl:s}),e[4]=h,e[5]=s,e[6]=f):f=e[6],f}if(t){let f;return e[7]!==c?(f=n.jsx($e,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[7]=c,e[8]=f):f=e[8],f}if(r){let f;return e[9]!==r||e[10]!==s?(f=n.jsx(ze,{org:r,initialSiteUrl:s}),e[9]=r,e[10]=s,e[11]=f):f=e[11],f}if(u.length===1&&u[0]){let f;return e[12]!==u[0]||e[13]!==s?(f=n.jsx(ze,{org:u[0],initialSiteUrl:s}),e[12]=u[0],e[13]=s,e[14]=f):f=e[14],f}if(u.length>1){let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(re,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=f):f=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=C=>l(C),e[16]=x):x=e[16];let b;return e[17]!==u?(b=n.jsx(ne,{children:n.jsxs("div",{className:"grid gap-10",children:[f,n.jsx(Je,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(pt,{organizations:u,selectLabel:"Continuar",onSelected:x})})]})}),e[17]=u,e[18]=b):b=e[18],b}if(!a){let f;e[19]!==d?(f=()=>{d.reset(),d.mutate()},e[19]=d,e[20]=f):f=e[20];let x;return e[21]!==d||e[22]!==f?(x=n.jsx(ws,{mutation:d,onRetry:f}),e[21]=d,e[22]=f,e[23]=x):x=e[23],x}const y=a;if(y?.success&&(y.status==="created"||y.status==="joined"||y.status==="already_has_organization")&&y.organization){let f;return e[24]!==y.organization||e[25]!==s?(f=n.jsx(ze,{org:y.organization,initialSiteUrl:s}),e[24]=y.organization,e[25]=s,e[26]=f):f=e[26],f}if(y?.status==="ambiguous"&&y.organizations&&y.organizations.length>0){let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(re,{title:"Escolha uma organização",description:"Seu e-mail pode acessar mais de uma organização. Escolha onde a configuração de commerce deve continuar."}),e[27]=f):f=e[27];const x=y.domain??void 0;let b;e[28]!==i||e[29]!==s?(b=(w,E)=>{_t(),l({...w,slug:E}),i({to:"/commerce-onboarding",search:{org:E,siteUrl:s}})},e[28]=i,e[29]=s,e[30]=b):b=e[30];let C;return e[31]!==y.organizations||e[32]!==x||e[33]!==b?(C=n.jsx(ne,{children:n.jsxs("div",{className:"grid gap-10",children:[f,n.jsx(Je,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(pt,{organizations:y.organizations,domain:x,onJoined:b})})]})}),e[31]=y.organizations,e[32]=x,e[33]=b,e[34]=C):C=e[34],C}const j=y?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let v;e[35]!==d?(v=()=>{m(null),d.reset()},e[35]=d,e[36]=v):v=e[36];let g;return e[37]!==j||e[38]!==v?(g=n.jsx($e,{title:"O onboarding de commerce precisa de suporte",description:j,actionLabel:"Tentar novamente",onRetry:v}),e[37]=j,e[38]=v,e[39]=g):g=e[39],g}async function Ns(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&_t(),e}function Es(o){return{id:o.id,name:o.name,slug:o.slug,logo:o.logo??null}}function ws(o){const e=z.c(7),{mutation:t,onRetry:s}=o,i=K.useRef(!1);let c;e[0]!==t?(c=m=>{!m||i.current||(i.current=!0,t.mutate())},e[0]=t,e[1]=c):c=e[1];const r=c;if(t.error){let m;return e[2]!==s?(m=n.jsx($e,{title:"Onboarding de commerce indisponível",description:"Não foi possível preparar uma organização para a configuração de commerce. Tente novamente por esta página ou fale com o suporte.",actionLabel:"Tentar novamente",onRetry:s}),e[2]=s,e[3]=m):m=e[3],m}let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(ft,{variant:"generic"}),e[4]=l):l=e[4];let a;return e[5]!==r?(a=n.jsx(ne,{children:n.jsx("div",{ref:r,children:l})}),e[5]=r,e[6]=a):a=e[6],a}function re(o){const e=z.c(8),{title:t,description:s}=o,i=Vt();let c;e[0]!==i?(c=i?n.jsx(qt,{host:i}):n.jsxs("div",{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==s||e[3]!==t?(r=(t||s)&&n.jsxs("div",{className:"space-y-2",children:[t&&n.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),s&&n.jsx("p",{className:"text-base text-muted-foreground leading-6",children:s})]}),e[2]=s,e[3]=t,e[4]=r):r=e[4];let l;return e[5]!==c||e[6]!==r?(l=n.jsxs("div",{className:"grid gap-10",children:[c,r]}),e[5]=c,e[6]=r,e[7]=l):l=e[7],l}function $e(o){const e=z.c(9),{title:t,description:s,actionLabel:i,onRetry:c}=o;let r;e[0]!==s||e[1]!==t?(r=n.jsx(re,{title:t,description:s}),e[0]=s,e[1]=t,e[2]=r):r=e[2];let l;e[3]!==i||e[4]!==c?(l=n.jsx(G,{type:"button",size:"xl",className:"w-full",onClick:c,children:i}),e[3]=i,e[4]=c,e[5]=l):l=e[5];let a;return e[6]!==r||e[7]!==l?(a=n.jsx(ne,{children:n.jsxs("div",{className:"grid gap-10",children:[r,l]})}),e[6]=r,e[7]=l,e[8]=a):a=e[8],a}function Is(o){return o.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function Pe(o){const e=o;if(e.isError)throw new Error(Is(e));return e.structuredContent??o}function ze(o){const e=z.c(11),{org:t,initialSiteUrl:s}=o,{data:i}=qe.useSession(),c=i?.user?.email;let r;e[0]!==s||e[1]!==c?(r=mt({siteUrl:s,email:c}),e[0]=s,e[1]=c,e[2]=r):r=e[2];const l=r;let a;e[3]!==l||e[4]!==t.id?(a=n.jsx(ut,{href:l,orgId:t.id}),e[3]=l,e[4]=t.id,e[5]=a):a=e[5];const m=a;let u;return e[6]!==s||e[7]!==m||e[8]!==t||e[9]!==i?.user?.email?(u=n.jsx(vt,{children:p=>{const{reset:d}=p;return n.jsx(jt,{fallback:h=>{const{error:y,resetError:j}=h;return n.jsx(ne,{visual:m,children:n.jsx(Ts,{orgName:t.name,message:y instanceof Error?y.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{d(),j()}})})},children:n.jsx(K.Suspense,{fallback:n.jsx(Ht,{visual:m}),children:n.jsx(Os,{org:t,initialSiteUrl:s,sessionEmail:i?.user?.email},`${t.id}:${s??""}`)})})}}),e[6]=s,e[7]=m,e[8]=t,e[9]=i?.user?.email,e[10]=u):u=e[10],u}function Ht(o){const e=z.c(3),{visual:t}=o;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[n.jsx(re,{}),n.jsx(ct,{})]}),e[0]=s):s=e[0];let i;return e[1]!==t?(i=n.jsx(ne,{align:"fill",visual:t,children:s}),e[1]=t,e[2]=i):i=e[2],i}function Ts(o){const e=z.c(10),{orgName:t,message:s,onRetry:i}=o,c=`A configuração de commerce continuará em ${t}.`;let r;e[0]!==c?(r=n.jsx(re,{title:"Diagnóstico de commerce",description:c}),e[0]=c,e[1]=r):r=e[1];let l;e[2]!==s?(l=n.jsx(Te,{message:s}),e[2]=s,e[3]=l):l=e[3];let a;e[4]!==i?(a=n.jsx(G,{type:"button",size:"xl",className:"w-full",onClick:i,children:"Tentar novamente"}),e[4]=i,e[5]=a):a=e[5];let m;return e[6]!==r||e[7]!==l||e[8]!==a?(m=n.jsxs("div",{className:"grid gap-10",children:[r,l,a]}),e[6]=r,e[7]=l,e[8]=a,e[9]=m):m=e[9],m}function Os(o){const e=z.c(117),{org:t,initialSiteUrl:s,sessionEmail:i}=o,c=St();let r;e[0]!==t.id||e[1]!==t.slug?(r={connectionId:Et,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=r):r=e[2];const l=Ke(r),[a,m]=K.useState(s??""),[u,p]=K.useState(null),[d,h]=K.useState(null),y=K.useRef(!1),j=Nt.COMMERCE_DISCOVERY(t.id),v=Zt(t.id),g=Z.commerceDiscoveryConnection(t.id,j);let f;e[3]!==j||e[4]!==l?(f=async()=>{const P=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:j}});return Pe(P)},e[3]=j,e[4]=l,e[5]=f):f=e[5];let x;e[6]!==g||e[7]!==f?(x={queryKey:g,queryFn:f,retry:!1},e[6]=g,e[7]=f,e[8]=x):x=e[8];const b=ye(x),C=Z.commerceDiscoveryVirtualMcp(t.id,v);let w;e[9]!==l||e[10]!==v?(w=async()=>{const P=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:v}});return Pe(P)},e[9]=l,e[10]=v,e[11]=w):w=e[11];let E;e[12]!==C||e[13]!==w?(E={queryKey:C,queryFn:w,retry:!1},e[12]=C,e[13]=w,e[14]=E):E=e[14];const _=ye(E);let N;e[15]!==l?(N=async P=>{const B=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:P}});return Pe(B)},e[15]=l,e[16]=N):N=e[16];let I;e[17]!==b||e[18]!==t.id||e[19]!==_?(I=(P,B)=>{te("commerce_onboarding_setup_succeeded",{domain:Ee(B)??void 0,organization_id:t.id}),p(P),h(null),b.refetch(),_.refetch()},e[17]=b,e[18]=t.id,e[19]=_,e[20]=I):I=e[20];let U;e[21]!==t.id?(U=(P,B)=>{te("commerce_onboarding_setup_failed",{domain:Ee(B)??void 0,organization_id:t.id,error:P instanceof Error?P.message:String(P)}),h(P instanceof Error?P.message:"A configuração do Commerce Discovery falhou.")},e[21]=t.id,e[22]=U):U=e[22];let T;e[23]!==U||e[24]!==N||e[25]!==I?(T={mutationFn:N,retry:!1,onSuccess:I,onError:U},e[23]=U,e[24]=N,e[25]=I,e[26]=T):T=e[26];const O=we(T);let k;e[27]!==l?(k={mutationFn:async P=>{const B=await l.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:P}});return Pe(B)},retry:!1},e[27]=l,e[28]=k):k=e[28];const R=we(k),[$,M]=K.useState(null),L=!!b.data.item&&!!_.data.item,F=b.data.item,q=typeof F?.metadata?.siteUrl=="string"?F.metadata.siteUrl:void 0,S=s||a||q||"";let D;e[29]!==S||e[30]!==i?(D=mt({siteUrl:S,email:i}),e[29]=S,e[30]=i,e[31]=D):D=e[31];const W=D;let Q;e[32]!==W||e[33]!==t.id?(Q=n.jsx(ut,{href:W,orgId:t.id}),e[32]=W,e[33]=t.id,e[34]=Q):Q=e[34];const H=Q;let X;e[35]!==O?(X=P=>{const B=Ne(P);if(!B.ok){h(xt(B.error));return}h(null),O.mutate(B.value)},e[35]=O,e[36]=X):X=e[36];const Y=X;let J;e[37]!==s||e[38]!==Y||e[39]!==L?(J=P=>{!P||y.current||L||!s||(y.current=!0,Y(s))},e[37]=s,e[38]=Y,e[39]=L,e[40]=J):J=e[40];const ee=J;let A;e[41]!==t.id||e[42]!==Y||e[43]!==a?(A=P=>{P.preventDefault();const B=Ne(a);B.ok&&te("commerce_onboarding_site_url_submitted",{domain:new URL(B.value).hostname,organization_id:t.id}),Y(a)},e[41]=t.id,e[42]=Y,e[43]=a,e[44]=A):A=e[44];const V=A;let ie;e[45]!==j||e[46]!==u?.reportApp||e[47]!==v?(ie=u?.reportApp??{connectionId:j,virtualMcpId:v,toolName:Xt},e[45]=j,e[46]=u?.reportApp,e[47]=v,e[48]=ie):ie=e[48];const ae=ie;let Ae;e[49]!==S||e[50]!==c||e[51]!==t.id||e[52]!==t.slug||e[53]!==ae||e[54]!==R?(Ae=async()=>{M(null),te("commerce_onboarding_open_report_clicked",{domain:Ee(S)??void 0,organization_id:t.id});const P=Ne(S);if(P.ok)try{await R.mutateAsync(P.value)}catch(B){const le=B;te("commerce_onboarding_run_failed",{domain:Ee(S)??void 0,organization_id:t.id,error:le instanceof Error?le.message:String(le)}),M("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}localStorage.setItem(Qt.sidebarOpen(),JSON.stringify(!1)),c({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:ae.virtualMcpId,main:Jt(ae.connectionId,ae.toolName),chat:0}})},e[49]=S,e[50]=c,e[51]=t.id,e[52]=t.slug,e[53]=ae,e[54]=R,e[55]=Ae):Ae=e[55];const Be=Ae;if(L){let P;return e[56]!==W||e[57]!==H||e[58]!==S||e[59]!==Be||e[60]!==t||e[61]!==ae||e[62]!==$||e[63]!==R.isPending?(P=n.jsx(As,{org:t,reportApp:ae,onOpenReport:Be,isSubmitting:R.isPending,error:$,meetingUrl:W,meetingVisual:H,siteUrl:S}),e[56]=W,e[57]=H,e[58]=S,e[59]=Be,e[60]=t,e[61]=ae,e[62]=$,e[63]=R.isPending,e[64]=P):P=e[64],P}if(O.isPending){let P;return e[65]!==H?(P=n.jsx(Ht,{visual:H}),e[65]=H,e[66]=P):P=e[66],P}if(s){let P,B;if(e[67]!==H||e[68]!==V||e[69]!==s||e[70]!==d||e[71]!==t.name||e[72]!==O.isPending||e[73]!==a){B=Symbol.for("react.early_return_sentinel");e:if(P=Ne(s),!P.ok){const Qe=`A configuração de commerce continuará em ${t.name}.`;let ge;e[76]!==Qe?(ge=n.jsx(re,{title:"Diagnóstico de commerce",description:Qe}),e[76]=Qe,e[77]=ge):ge=e[77];const We=n.jsx(Te,{message:xt(P.error)});let he;e[78]!==V||e[79]!==d||e[80]!==O.isPending||e[81]!==a?(he=n.jsx(Ye,{siteUrl:a,error:d,isSubmitting:O.isPending,onSiteUrlChange:m,onSubmit:V}),e[78]=V,e[79]=d,e[80]=O.isPending,e[81]=a,e[82]=he):he=e[82];let xe;e[83]!==ge||e[84]!==We||e[85]!==he?(xe=n.jsxs("div",{className:"grid gap-10",children:[ge,We,he]}),e[83]=ge,e[84]=We,e[85]=he,e[86]=xe):xe=e[86];let Ue;e[87]!==H||e[88]!==xe?(Ue=n.jsx(ne,{visual:H,children:xe}),e[87]=H,e[88]=xe,e[89]=Ue):Ue=e[89],B=Ue;break e}e[67]=H,e[68]=V,e[69]=s,e[70]=d,e[71]=t.name,e[72]=O.isPending,e[73]=a,e[74]=P,e[75]=B}else P=e[74],B=e[75];if(B!==Symbol.for("react.early_return_sentinel"))return B;const le=`O Commerce Discovery está sendo preparado para ${P.value}.`;let ue;e[90]!==le?(ue=n.jsx(re,{title:"Diagnóstico de commerce",description:le}),e[90]=le,e[91]=ue):ue=e[91];let fe;e[92]!==V||e[93]!==d||e[94]!==O.isPending||e[95]!==a?(fe=d?n.jsxs(n.Fragment,{children:[n.jsx(Te,{message:d}),n.jsx(Ye,{siteUrl:a,error:null,isSubmitting:O.isPending,onSiteUrlChange:m,onSubmit:V})]}):n.jsx(ct,{}),e[92]=V,e[93]=d,e[94]=O.isPending,e[95]=a,e[96]=fe):fe=e[96];let pe;e[97]!==ue||e[98]!==fe||e[99]!==ee?(pe=n.jsxs("div",{ref:ee,className:"grid gap-10",children:[ue,fe]}),e[97]=ue,e[98]=fe,e[99]=ee,e[100]=pe):pe=e[100];let Re;return e[101]!==H||e[102]!==pe?(Re=n.jsx(ne,{visual:H,children:pe}),e[101]=H,e[102]=pe,e[103]=Re):Re=e[103],Re}const Ge=`A configuração de commerce continuará em ${t.name}.`;let ce;e[104]!==Ge?(ce=n.jsx(re,{title:"Diagnóstico de commerce",description:Ge}),e[104]=Ge,e[105]=ce):ce=e[105];let de;e[106]!==V||e[107]!==d||e[108]!==O.isPending||e[109]!==a?(de=n.jsx(Ye,{siteUrl:a,error:d,isSubmitting:O.isPending,onSiteUrlChange:m,onSubmit:V}),e[106]=V,e[107]=d,e[108]=O.isPending,e[109]=a,e[110]=de):de=e[110];let me;e[111]!==ce||e[112]!==de?(me=n.jsxs("div",{className:"grid gap-10",children:[ce,de]}),e[111]=ce,e[112]=de,e[113]=me):me=e[113];let ke;return e[114]!==H||e[115]!==me?(ke=n.jsx(ne,{visual:H,children:me}),e[114]=H,e[115]=me,e[116]=ke):ke=e[116],ke}function Ye(o){const e=z.c(20),{siteUrl:t,error:s,isSubmitting:i,onSiteUrlChange:c,onSubmit:r}=o;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=l):l=e[0];let a;e[1]!==c?(a=v=>c(v.target.value),e[1]=c,e[2]=a):a=e[2];const m=!!s;let u;e[3]!==i||e[4]!==t||e[5]!==a||e[6]!==m?(u=n.jsx(Oe,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:a,placeholder:"https://example.com","aria-invalid":m,disabled:i}),e[3]=i,e[4]=t,e[5]=a,e[6]=m,e[7]=u):u=e[7];let p;e[8]!==s?(p=s?n.jsx(Te,{message:s}):null,e[8]=s,e[9]=p):p=e[9];let d;e[10]!==u||e[11]!==p?(d=n.jsxs("div",{className:"grid gap-2",children:[l,u,p]}),e[10]=u,e[11]=p,e[12]=d):d=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(wt,{size:16}),e[13]=h):h=e[13];let y;e[14]!==i?(y=n.jsxs(G,{type:"submit",size:"xl",className:"w-full",disabled:i,children:["Continuar",h]}),e[14]=i,e[15]=y):y=e[15];let j;return e[16]!==r||e[17]!==d||e[18]!==y?(j=n.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[d,y]}),e[16]=r,e[17]=d,e[18]=y,e[19]=j):j=e[19],j}function As(o){const e=z.c(27),{org:t,reportApp:s,onOpenReport:i,isSubmitting:c,error:r,meetingUrl:l,meetingVisual:a,siteUrl:m}=o;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(re,{}),e[0]=u):u=e[0];let p;e[1]!==t||e[2]!==s.connectionId||e[3]!==m?(p=n.jsx(ds,{org:t,cdConnectionId:s.connectionId,siteUrl:m}),e[1]=t,e[2]=s.connectionId,e[3]=m,e[4]=p):p=e[4];let d;e[5]!==l||e[6]!==t.id?(d=n.jsx(xs,{className:"md:hidden",href:l,orgId:t.id}),e[5]=l,e[6]=t.id,e[7]=d):d=e[7];let h;e[8]!==r?(h=r?n.jsx(Te,{message:r}):null,e[8]=r,e[9]=h):h=e[9];const y=c||!s.virtualMcpId,j=c?"Abrindo relatório...":"Ver relatório completo";let v;e[10]!==c?(v=c?null:n.jsx(wt,{size:18}),e[10]=c,e[11]=v):v=e[11];let g;e[12]!==i||e[13]!==y||e[14]!==j||e[15]!==v?(g=n.jsxs(G,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:i,disabled:y,children:[j,v]}),e[12]=i,e[13]=y,e[14]=j,e[15]=v,e[16]=g):g=e[16];let f;e[17]!==d||e[18]!==h||e[19]!==g?(f=n.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[d,h,g]}),e[17]=d,e[18]=h,e[19]=g,e[20]=f):f=e[20];let x;e[21]!==p||e[22]!==f?(x=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[u,p,f]}),e[21]=p,e[22]=f,e[23]=x):x=e[23];let b;return e[24]!==a||e[25]!==x?(b=n.jsx(ne,{align:"fill",visual:a,children:x}),e[24]=a,e[25]=x,e[26]=b):b=e[26],b}function Te(o){const e=z.c(2),{message:t}=o;let s;return e[0]!==t?(s=n.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=s):s=e[1],s}export{Mo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,j as n,r as $,D as J,m as xe,l as Q,i as le,an as Z,t as U,K as te,k as se,B as Y,d as st,a8 as nt,E as it,a as ot}from"./index-DoucUl3Y.js";import{u as ge}from"./use-mobile-uxXHtQgn.js";import{u as rt}from"./useSuspenseQueries-BAt7-u1b.js";import{i as lt,u as ae,m as at,a as ct,S as dt}from"./use-mcp-client-WvxqfcnZ.js";import{u as mt,b as ut,v as ft,a as pt}from"./use-virtual-mcp-B1rjWllH.js";import{i as ht}from"./ChevronUp-DYj_Lqiv.js";import{i as xt,A as ce,t as gt,ac as yt,E as bt,k as jt}from"./agent-icon-C6pv2ku7.js";import{s as ye}from"./Plus-CYbhotOA.js";import{i as $e}from"./X-h9nJ-EBx.js";import{C as oe}from"./index-ThpKT5W3.js";import{b as vt}from"./chat-context-DXkfcYfb.js";import{N as Nt}from"./decopilot-BHpemSf8.js";import{g as wt,b as Ae,c as re,K as Pe,P as Ee,D as Me,d as St,S as _t,v as Ct,e as It,C as Tt,s as kt,l as $t,k as At,o as Pt,u as Et,j as Mt,h as zt}from"./sortable.esm-DvDPoJZ_.js";import{u as ze,a as Oe,o as Ot}from"./use-organization-settings-CiVN8spL.js";import{c as be,b as Lt,h as Dt}from"./shell-layout-CuK3Vqry.js";import{I as Le}from"./input-DJWrldEm.js";import{S as Ht,t as je,P as Rt,j as Ft,s as Ut,g as Bt}from"./scroll-area-C6-KaVJV.js";import{S as Vt,a as Kt,b as Wt,c as qt,d as Gt}from"./sheet-DNq52yos.js";import{S as H}from"./skeleton-DYw0rOyr.js";import{t as De}from"./ChevronDown-DqDfDEN8.js";import{c as He}from"./ZoomOut-YIKSKCYE.js";import{g as Re,M as Qt}from"./types-E7XN7ErV.js";import{I as Fe}from"./integration-icon-Cf-Rmmga.js";import{b as Jt,c as Xt,S as Zt,a as we,d as Yt}from"./select-CcRNcLs4.js";import{T as es}from"./textarea-BIYgBm1i.js";import{u as Ue}from"./studio-tools-Czz5alz9.js";import{a as ts}from"./use-mcp-tools-CA7LHiOg.js";import{i as ss}from"./XCircle-C0eLN21-.js";import{f as ns}from"./tab-id-BptcWVWa.js";import{g as is}from"./use-mcp-prompts-BlOjON_R.js";import{u as os,w as rs}from"./hooks-uefC-6qo.js";import{a as ls,g as as,c as cs,b as ds,D as ms}from"./dropdown-menu-VowKBuzA.js";import{s as us}from"./Trash01-DYl35j3Y.js";import{a as fs,u as ps}from"./use-ai-providers-luzuoW6F.js";import{u as hs}from"./connect-desktop-dialog-BDLcc0Rq.js";import{a as xs}from"./toolbar-DaNx41W4.js";import"./auth-Bb0aNoyE.js";import"./use-collections-BsTbK7kB.js";import"./AlertCircle-DsW3Bcrl.js";import"./Tool01-BxZPwNZl.js";import"./SwitchHorizontal01-Bej1Xe59.js";import"./Settings02-DMwxMpRK.js";import"./ArrowUpRight-BWTy0YGq.js";import"./ZapSquare-DYkBLN1d.js";import"./Users03-BG9oeNVT.js";import"./CheckCircle-c5WK8XV9.js";import"./ChevronLeft-t20dnuIe.js";import"./ChevronRight-C44MBYbI.js";import"./DotsVertical-DAFoZ0nv.js";import"./Stars02-cvN6aU_Q.js";import"./Eye-DTIj4iPZ.js";import"./Globe01-D6yUjZQH.js";import"./FilterLines-BV29E9UP.js";import"./Star01-BqeGqz7Y.js";import"./Globe04-bVwR5WWU.js";import"./HardDrive-B8km64Z9.js";import"./Key01-B7j5egoB.js";import"./LayoutLeft-CXvEGxxp.js";import"./LinkExternal01-CQ-4gvfk.js";import"./Monitor01-Bj_EAAMU.js";import"./Sun-BHvYVIBh.js";import"./Palette-B-GrEc4W.js";import"./Play-C-OyJs5r.js";import"./SearchLg-Cj30V7ex.js";import"./SearchMd-1Z8N8N3h.js";import"./Shield01-B1Sc3Ias.js";import"./Stars01-ZIjfY467.js";import"./Upload01-CKysXsn0.js";import"./User01-Bl0_xtnf.js";import"./Users01-DBGMUy31.js";import"./XClose-DYr8fUgN.js";import"./Zap-CIpGBf2d.js";import"./tooltip-yt7lmbFR.js";import"./dialog-Chku3vbX.js";import"./drawer-DDuANtUO.js";import"./collection-search-faBG8zWd.js";import"./form-BsHVq-vM.js";import"./label-DWCu1aOX.js";import"./tabs-UZ20kq7U.js";import"./toggle-group-BbjdiqkS.js";import"./popover-Cu2CWUc6.js";import"./command-CEPgisvd.js";import"./index-DmS8LVoF.js";import"./useInfiniteQuery-DC079uf3.js";import"./use-infinite-scroll-CpYSd4m7.js";import"./use-org-fs-_YTXbBHs.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-QszXAsve.js";import"./decopilot-sse-pool-DZ7iO7mi.js";import"./backoff-CrEUbyZT.js";import"./checkbox-BJPI9nCv.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BgE6fJJB.js";import"./settings-section-1TBLdu48.js";import"./card-Bq-T-A3c.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B7OCM5c1.js";import"./use-registry-connections-BB5C1xbN.js";import"./use-connection-BnsrqzP3.js";import"./extract-connection-data-ALY8RBIl.js";import"./collection-tabs-CUrRmOty.js";import"./badge-BXVUKWgQ.js";import"./connection-form-helpers-D-2z8iRp.js";import"./authenticate-and-persist-oauth-DWufXUh3.js";import"./mcp-oauth-Cv0VZ7hC.js";import"./useSuspenseInfiniteQuery-B202GQEQ.js";import"./required-auth-layout-Cni39UJP.js";import"./use-org-sso-BRUmxKLf.js";import"./use-clock-tick-z5rLDCie.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C8Cy_h_n.js";import"./file-type-icon-DkI0cvrO.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-Xf5ZXEBe.js";import"./delay-CnY5UFtP.js";function Be(t){const e=k.c(11),{properties:s,required:o,values:i,onChange:r}=t;let a;e[0]!==o?(a=o??[],e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=new Set(a),e[2]=a,e[3]=d):d=e[3];const l=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,p]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,l.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:p.type})]}),p.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:p.description}),n.jsx(gs,{type:p.type,fieldKey:f,value:i[f],onChange:h=>r(f,h)})]},f)})}),e[6]=r,e[7]=l,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function gs(t){const e=k.c(19),{type:s,fieldKey:o,value:i,onChange:r}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==r?(u=h=>r(h.target.value),e[0]=r,e[1]=u):u=e[1];const f=`Enter ${o} as JSON…`;let p;return e[2]!==c||e[3]!==u||e[4]!==f?(p=n.jsx(es,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=p):p=e[5],p}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==r?(u=x=>r(x==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Jt,{className:"h-7 text-xs",children:n.jsx(Xt,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(Zt,{children:[n.jsx(we,{value:"true",children:"true"}),n.jsx(we,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(Yt,{value:c,onValueChange:u,children:[f,p]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}const a=i??"";let d;e[13]!==r?(d=c=>r(c.target.value),e[13]=r,e[14]=d):d=e[14];const l=`Enter ${o}…`;let m;return e[15]!==a||e[16]!==d||e[17]!==l?(m=n.jsx(Le,{className:"h-7 text-xs",value:a,onChange:d,placeholder:l}),e[15]=a,e[16]=d,e[17]=l,e[18]=m):m=e[18],m}const ne=8;function ys(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=$.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Vt,{children:"Manage home"}),d=n.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(xt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=l):l=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=x=>r(x.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(Wt,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(Le,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Gs,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(Ht,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(js,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(qt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=p):p=e[11];let h;return e[12]!==o||e[13]!==s||e[14]!==p?(h=n.jsx(Gt,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function bs(t){const e=k.c(32),{org:s}=J(),o=ze();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=Oe(),d=ut(),l=xe();let m;e[2]!==s||e[3]!==l?(m=()=>l.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=m):m=e[4];const c=m;let u;e[5]!==r?(u=_=>r.includes(_),e[5]=r,e[6]=u):u=e[6];const f=u;let p;e[7]!==r||e[8]!==t?(p=t?r.filter(_=>t.has(_)).length:r.length,e[7]=r,e[8]=t,e[9]=p):p=e[9];const x=p>=ne;let y;e[10]!==x||e[11]!==f||e[12]!==a?(y=_=>f(_)||x?Promise.resolve():a.apply(I=>I.includes(_)?null:[...I,_]),e[10]=x,e[11]=f,e[12]=a,e[13]=y):y=e[13];const b=y;let v;e[14]!==a?(v=_=>a.apply(I=>I.filter(T=>T!==_)),e[14]=a,e[15]=v):v=e[15];const N=v;let j;e[16]!==a?(j=_=>a.apply(()=>_),e[16]=a,e[17]=j):j=e[17];const g=j;let w;e[18]!==d||e[19]!==x||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,I)=>{await d.update.mutateAsync({id:_.id,data:{metadata:I}}),!f(_.id)&&!x&&await a.apply(T=>T.includes(_.id)?null:[...T,_.id]),await c()},e[18]=d,e[19]=x,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let C;return e[24]!==b||e[25]!==x||e[26]!==r||e[27]!==f||e[28]!==N||e[29]!==g||e[30]!==S?(C={homeIds:r,isOnHome:f,atLimit:x,addAgent:b,removeAgent:N,reorder:g,saveAgentMetadata:S},e[24]=b,e[25]=x,e[26]=r,e[27]=f,e[28]=N,e[29]=g,e[30]=S,e[31]=C):C=e[31],C}function js(t){const e=k.c(21),{search:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:1e3},e[0]=o):o=e[0];const i=mt(o);let r;e[1]!==i?(r=new Set(i.map(_s)),e[1]=i,e[2]=r):r=e[2];const a=bs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const x=new Map(i.map(Ss));d=s.trim().toLowerCase();const y=N=>!d||N.title?.toLowerCase().includes(d);l=a.homeIds.map(N=>x.get(N)).filter(ws).filter(y);const b=wt(i);let v;e[9]!==a?(v=N=>!a.isOnHome(N.id),e[9]=a,e[10]=v):v=e[10],m=i.filter(Ns).filter(N=>!b.has(N.id)).filter(v).filter(y).sort(vs),e[3]=i,e[4]=a,e[5]=s,e[6]=d,e[7]=l,e[8]=m}else d=e[6],l=e[7],m=e[8];const c=m;let u;e[11]!==a||e[12]!==l?(u=n.jsx(Cs,{home:a,agents:l}),e[11]=a,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==c||e[15]!==a||e[16]!==f?(p=n.jsx(ks,{home:a,agents:c,hasSearch:f}),e[14]=c,e[15]=a,e[16]=f,e[17]=p):p=e[17];let h;return e[18]!==u||e[19]!==p?(h=n.jsxs(n.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=h):h=e[20],h}function vs(t,e){return(t.title??"").localeCompare(e.title??"")}function Ns(t){return t.id&&!lt(t.id)}function ws(t){return!!t}function Ss(t){return[t.id,t]}function _s(t){return t.id}function Ve(t){const e=k.c(7),{title:s,hint:o}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==o?(r=o&&n.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==r?(a=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6],a}function Cs(t){const e=k.c(14),{home:s,agents:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:kt},e[1]=r):r=e[1];const a=Ae(re(Ee,i),re(Pe,r));let d;e[2]!==s?(d=p=>{const{active:h,over:x}=p;if(!x||h.id===x.id)return;const y=s.homeIds,b=y.indexOf(h.id),v=y.indexOf(x.id);b===-1||v===-1||s.reorder($t([...y],b,v)).catch(Ts)},e[2]=s,e[3]=d):d=e[3];const l=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(Ve,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==a?(u=o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Me,{sensors:a,collisionDetection:St,onDragEnd:l,children:n.jsx(_t,{items:o.map(Is),strategy:Ct,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(As,{agent:p,home:s},p.id))})})}),e[6]=o,e[7]=l,e[8]=s,e[9]=a,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Is(t){return t.id}function Ts(){return U.error("Couldn't reorder home — please try again.")}function ks(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,a]=$.useState(20);let d;if(e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==r){const l=o.slice(0,r);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ve,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:l.map(c=>n.jsx(Ms,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a($s),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",o.length-r,")"]})]})]}),e[0]=o,e[1]=i,e[2]=s,e[3]=r,e[4]=d}else d=e[4];return d}function $s(t){return t+20}function Ke(t){const e=Z(t.metadata?.ui).filter(r=>!!r.resourceUri).length,s=t.metadata?.ui?.homePrompts,o=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),o!==null&&o>0&&i.push(`${o} prompt${o===1?"":"s"}`),o===0&&i.push("prompts off"),i.join(" · ")}function As(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=$.useState(!1);let a;e[0]!==s.id?(a={id:s.id},e[0]=s.id,e[1]=a):a=e[1];const{attributes:d,listeners:l,setNodeRef:m,transform:c,transition:u,isDragging:f}=It(a),p=Ke(s)||"Quick access";let h;e[2]!==c?(h=Tt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const x=f?.5:void 0,y=f?100:void 0;let b;e[4]!==h||e[5]!==x||e[6]!==y||e[7]!==u?(b={transform:h,transition:u,opacity:x,zIndex:y},e[4]=h,e[5]=x,e[6]=y,e[7]=u,e[8]=b):b=e[8];const v=b,N=f&&"shadow-lg";let j;e[9]!==N?(j=Q("rounded-lg border border-border bg-card",N),e[9]=N,e[10]=j):j=e[10];const g=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(He,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==g?(S=n.jsx("button",{type:"button",...d,...l,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":g,children:w}),e[12]=d,e[13]=l,e[14]=g,e[15]=S):S=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=()=>r(Es),e[16]=C):C=e[16];const _=s.title??s.id;let I;e[17]!==s.icon||e[18]!==_?(I=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=I):I=e[19];const T=s.title??s.id;let P;e[20]!==T?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=P):P=e[21];let M;e[22]!==p?(M=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=M):M=e[23];let z;e[24]!==P||e[25]!==M?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,M]}),e[24]=P,e[25]=M,e[26]=z):z=e[26];const B=i&&"rotate-180";let O;e[27]!==B?(O=Q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=O):O=e[28];let L;e[29]!==O?(L=n.jsx(De,{size:16,className:O}),e[29]=O,e[30]=L):L=e[30];let K;e[31]!==i||e[32]!==I||e[33]!==z||e[34]!==L?(K=n.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,z,L]}),e[31]=i,e[32]=I,e[33]=z,e[34]=L,e[35]=K):K=e[35];let A;e[36]!==s.id||e[37]!==o?(A=()=>o.removeAgent(s.id).catch(Ps),e[36]=s.id,e[37]=o,e[38]=A):A=e[38];const V=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx($e,{size:14}),e[39]=D):D=e[39];let E;e[40]!==A||e[41]!==V?(E=n.jsx("button",{type:"button",onClick:A,"aria-label":V,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:D}),e[40]=A,e[41]=V,e[42]=E):E=e[42];let R;e[43]!==S||e[44]!==K||e[45]!==E?(R=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,K,E]}),e[43]=S,e[44]=K,e[45]=E,e[46]=R):R=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==o?(F=i&&n.jsx(We,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=F):F=e[50];let q;return e[51]!==m||e[52]!==v||e[53]!==R||e[54]!==F||e[55]!==j?(q=n.jsxs("div",{ref:m,style:v,className:j,children:[R,F]}),e[51]=m,e[52]=v,e[53]=R,e[54]=F,e[55]=j,e[56]=q):q=e[56],q}function Ps(){return U.error("Couldn't remove from home — please try again.")}function Es(t){return!t}function Ms({agent:t,home:e}){const[s,o]=$.useState(!1),[i,r]=$.useState(!1),a=Ke(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{r(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>o(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(ce,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),a&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a})]}),n.jsx(De,{size:16,className:Q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(le,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(We,{agent:t,home:e})]})}function We(t){const e=k.c(17),{agent:s,home:o}=t,i=s.metadata?.ui;let r;e[0]!==i?(r=Z(i),e[0]=i,e[1]=r):r=e[1];const a=r;let d;e[2]!==s.connections?(d=(s.connections??[]).map(zs).sort(),e[2]=s.connections,e[3]=d):d=e[3];const l=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==l||e[6]!==o||e[7]!==a?(c=n.jsx(Ls,{agent:s,home:o,connectionIds:l,pinnedTiles:a}),e[4]=s,e[5]=l,e[6]=o,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Os,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx($.Suspense,{fallback:u,children:n.jsx(Us,{agent:s,home:o,curated:f})}),e[10]=s,e[11]=o,e[12]=f,e[13]=p):p=e[13];let h;return e[14]!==c||e[15]!==p?(h=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,p]}),e[14]=c,e[15]=p,e[16]=h):h=e[16],h}function zs(t){return t.connection_id}function Os(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Ls({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Ue(),{data:r,isLoading:a}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),p=(f?.tools??[]).flatMap(h=>{const x=Re(h._meta);return x?[{name:h.name,description:h.description,resourceUri:x,inputSchema:h.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:p}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(a)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!r||r.length===0)return null;const d=new Map;for(const c of r)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const l=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=o.some(c=>!!l(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),o.map(c=>{const u=l(c);return u?n.jsx(Rs,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),r.map(c=>c.uiTools.map(u=>n.jsx(Fs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function qe(t,e){const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;if((r==="object"||r==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[o]=JSON.parse(i)}catch{return null}}else if((r==="number"||r==="integer")&&typeof i=="string"){if(!i.trim())continue;s[o]=Number(i)}else i!==""&&i!=null&&(s[o]=i)}return s}function Ds(t,e){if(!t||!e)return{};const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;(r==="object"||r==="array")&&i!=null&&typeof i!="string"?s[o]=JSON.stringify(i,null,2):s[o]=i}return s}function Hs(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,o])=>{const i=typeof o=="object"?JSON.stringify(o):String(o);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function Rs({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=$.useState(!1),[d,l]=$.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=$.useState(()=>Ds(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const x=Z(t.metadata?.ui),y=i.tileId?x.filter(v=>v.tileId!==i.tileId):x.filter(v=>v!==i),b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,b),l(!1)}catch(x){console.error("[home-tiles] failed to remove tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let x;if(m&&o.inputSchema?.properties){const N=qe(c,o.inputSchema.properties);if(!N){U.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(N).length>0&&(x=N)}const b=Z(t.metadata?.ui).map(N=>(i.tileId?N.tileId===i.tileId:N===i)?{...N,toolInput:x}:N),v={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,v),l(!1)}catch(x){console.error("[home-tiles] failed to save tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Hs(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(o.name)}),h&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:h})]}),m&&n.jsx("button",{type:"button",onClick:()=>l(x=>!x),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(gt,{size:14})}),n.jsx(ve,{isPinned:!0,submitting:r,onClick:f,label:"Remove from home"})]}),d&&m&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(x,y)=>u(b=>({...b,[x]:y}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>l(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:r,onClick:p,children:r?n.jsx(le,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function Fs({agent:t,home:e,connection:s,tool:o}){const[i,r]=$.useState(!1),[a,d]=$.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const b=qe(m,o.inputSchema.properties);if(!b){U.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(b).length>0&&(p=b)}const x=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:x}};await e.saveAgentMetadata(t,y),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),U.error("Couldn't update home — please try again.")}finally{r(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(o.name)}),n.jsx(ve,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),a&&l&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(x=>({...x,[p]:h}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(le,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function ve(t){const e=k.c(11),{isPinned:s,submitting:o,onClick:i,label:r}=t,a=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==a?(d=Q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==o?(l=o?n.jsx(le,{size:12,className:"animate-spin"}):s?n.jsx(yt,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==l?(m=n.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":r,title:r,className:d,children:l}),e[5]=r,e[6]=i,e[7]=o,e[8]=d,e[9]=l,e[10]=m):m=e[10],m}function Us(t){const e=k.c(32),{agent:s,home:o,curated:i}=t,{org:r}=J();let a;e[0]!==s.id||e[1]!==r.id||e[2]!==r.slug?(a={connectionId:s.id,orgId:r.id,orgSlug:r.slug},e[0]=s.id,e[1]=r.id,e[2]=r.slug,e[3]=a):a=e[3];const d=ae(a);let l;e[4]!==s.id||e[5]!==r.id?(l=te.agentPrompts(r.id,s.id),e[4]=s.id,e[5]=r.id,e[6]=l):l=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:g}=await d.listPrompts();return g.map(Ws)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==l||e[10]!==m?(c={queryKey:l,queryFn:m,staleTime:3e4,retry:!1},e[9]=l,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:p}=se(c),h=be(r.slug);let x,y;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let g;e[17]!==s.id?(g=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=g):g=e[18],x=h.prompts.filter(g).map(Ks);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],y=[...w];for(const S of x)y.some(C=>C.name===S.name)||y.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=x,e[16]=y}else x=e[15],y=e[16];if(f&&x.length===0){let g;return e[21]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=g):g=e[21],g}if(p&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(y.length===0)return null;let b;e[22]!==i||e[23]!==y?(b=i??y.map(Vs),e[22]=i,e[23]=y,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const N=v;let j;return e[27]!==s||e[28]!==o||e[29]!==y||e[30]!==N?(j=n.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(g=>n.jsx(qs,{agent:s,home:o,prompt:g,allPromptNames:y.map(Bs),isPinned:N.has(g.name)},g.name))}),e[27]=s,e[28]=o,e[29]=y,e[30]=N,e[31]=j):j=e[31],j}function Bs(t){return t.name}function Vs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Ws(t){return{name:t.name,title:t.title,description:t.description}}function qs({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}a(!0);try{const l=t.metadata?.ui?.homePrompts;let m;Array.isArray(l)?m=i?l.filter(u=>u!==s.name):[...l,s.name]:m=i?o.filter(u=>u!==s.name):o;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),U.error("Couldn't update home — please try again.")}finally{a(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(ve,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function Gs(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Qs)}),t[0]=e):e=t[0],e}function Qs(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ge=`home-board.layout.v${ee}`;function Qe(t){return`home-board.layout.v${ee}.${t}`}const Je={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Je:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Js(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Xs(t){try{const e=localStorage.getItem(Qe(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Se(t,e){try{localStorage.setItem(Qe(t),JSON.stringify(e))}catch{}}async function _e(t,e){if(!(await fetch(`/api/${t}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function Zs(t){const e=k.c(24),s=xe();let o;e[0]!==t?(o=te.boardLayout(t),e[0]=t,e[1]=o):o=e[1];const i=o;let r;e[2]!==t?(r=Xs(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${Ge}`);if(b.status===404)return a&&Js(a)?(await _e(t,a),a):Je;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),N=fe(v.value);return Se(t,N),N},e[4]=a,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==i||e[9]!==d?(l={queryKey:i,queryFn:d,initialData:a,staleTime:0,refetchOnWindowFocus:!1},e[7]=a,e[8]=i,e[9]=d,e[10]=l):l=e[10];const{data:m,isLoading:c}=se(l);let u;e[11]!==t?(u={mutationFn:b=>_e(t,b)},e[11]=t,e[12]=u):u=e[12];const f=st(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(p=b=>{Se(t,b),s.setQueryData(i,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let x;e[18]!==m?(x=fe(m),e[18]=m,e[19]=x):x=e[19];let y;return e[20]!==c||e[21]!==h||e[22]!==x?(y={layout:x,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=x,e[23]=y):y=e[23],y}const Xe=$.createContext(null);function Ys(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=Zs(o.slug),[r,a]=$.useState(!1),[d,l]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{l(i.layout),a(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),a(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==i?(p=()=>{d&&i.save(d),l(null),a(!1)},e[3]=d,e[4]=i,e[5]=p):p=e[5];const h=p,x=r&&d!==null,y=x?d:i.layout;let b;e[6]!==d||e[7]!==x||e[8]!==i.layout?(b=x?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=x,e[8]=i.layout,e[9]=b):b=e[9];const v=b;let N;e[10]!==r||e[11]!==i?(N=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=N):N=e[12];const j=N;let g;e[13]!==j||e[14]!==c||e[15]!==v||e[16]!==r||e[17]!==y||e[18]!==h||e[19]!==i.isLoading?(g={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:v,layout:y,isLayoutLoading:i.isLoading,commitLayout:j},e[13]=j,e[14]=c,e[15]=v,e[16]=r,e[17]=y,e[18]=h,e[19]=i.isLoading,e[20]=g):g=e[20];let w;return e[21]!==s||e[22]!==g?(w=n.jsx(Xe.Provider,{value:g,children:s}),e[21]=s,e[22]=g,e[23]=w):w=e[23],w}function Ze(){const t=$.useContext(Xe);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function en({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=os(),{setTaskId:r}=Lt(),[a,d]=$.useState(null),[l,m]=$.useState(!1),c=$.useRef(!1),u=async(y,b)=>{if(!o){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const v=await is(o,y.name,b),N={type:"doc",content:[{type:"paragraph",content:[Ft({id:y.name,name:Ut(y.name,Bt(y._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},j=crypto.randomUUID();rs(sessionStorage,s,j,{tiptapDoc:N}),await i({id:j,virtual_mcp_id:t}),r(j,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async y=>{if(!c.current){if(y.arguments&&y.arguments.length>0){d(y);return}await u(y)}},p=async y=>{if(!a)return;const b=a;d(null),await u(b,y)};return{start:f,startBlank:async y=>{if(!c.current){c.current=!0,m(!0);try{const b=crypto.randomUUID();await i({id:b,virtual_mcp_id:t}),r(b,t,y?.main?{main:y.main}:void 0)}catch(b){console.error("[start-thread-from-prompt] startBlank failed",b),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Rt,{prompt:a,setPrompt:y=>d(y),onSubmit:p}),dialogPrompt:a,starting:l}}const W=4,G=100,Ce=12,tn=5,sn={w:2,h:2};class pe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(nt,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function nn(t){const e=k.c(72),{tiles:s,isEditMode:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=$.useRef(null),[c,u]=$.useState(null),[f,p]=$.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const x=Ae(re(Ee,h),re(Pe)),y=s.reduce(on,0),b=o?Math.max(y+2,4):Math.max(y,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/W,cellHeight:G}:null},e[1]=v):v=e[1];const N=v;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=A=>{u(String(A.active.id)),p(N())},e[2]=j):j=e[2];const g=j;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=A=>{const V=String(A.active.id),D=f??N();if(u(null),p(null),!D||D.cellWidth<=0)return;const E=s.find(q=>q.id===V);if(!E)return;const R=Math.round(A.delta.x/D.cellWidth),F=Math.round(A.delta.y/D.cellHeight);R===0&&F===0||r(V,{x:E.x+R,y:E.y+F})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let A;if(e[7]!==i||e[8]!==s){let D;e[10]!==i?(D=E=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(E)})},E.id),e[10]=i,e[11]=D):D=e[11],A=s.map(D),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let V;return e[12]!==A?(V=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=V):V=e[13],V}let C,_,I,T,P,M,z,B,O;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==x||e[22]!==s||e[23]!==b){const A=c?s.find(X=>X.id===c):null;_=Me,B=x,O=g,I=S;const V=b*G,D=o?G*4:G;let E;e[33]!==V||e[34]!==D?(E={height:V,minHeight:D},e[33]=V,e[34]=D,e[35]=E):E=e[35];let R;e[36]!==o||e[37]!==s||e[38]!==b?(R=o&&n.jsx(rn,{rows:b,tiles:s}),e[36]=o,e[37]=s,e[38]=b,e[39]=R):R=e[39];let F;if(e[40]!==c||e[41]!==o||e[42]!==d||e[43]!==a||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==o||e[49]!==d||e[50]!==a||e[51]!==i?(X=ie=>n.jsx(an,{tile:ie,isEditMode:o,isDragging:c===ie.id,onResize:a,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=o,e[49]=d,e[50]=a,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==E||e[54]!==R||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:E,children:[R,F]}),e[53]=E,e[54]=R,e[55]=F,e[56]=T):T=e[56],C=At,P=null;const q=A&&f?A.w*f.cellWidth-Ce:void 0,de=A&&f?A.h*f.cellHeight-Ce:void 0;e[57]!==q||e[58]!==de?(M={width:q,height:de},e[57]=q,e[58]=de,e[59]=M):M=e[59],z=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(pe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=x,e[22]=s,e[23]=b,e[24]=C,e[25]=_,e[26]=I,e[27]=T,e[28]=P,e[29]=M,e[30]=z,e[31]=B,e[32]=O}else C=e[24],_=e[25],I=e[26],T=e[27],P=e[28],M=e[29],z=e[30],B=e[31],O=e[32];let L;e[60]!==C||e[61]!==P||e[62]!==M||e[63]!==z?(L=n.jsx(C,{dropAnimation:P,style:M,children:z}),e[60]=C,e[61]=P,e[62]=M,e[63]=z,e[64]=L):L=e[64];let K;return e[65]!==_||e[66]!==I||e[67]!==T||e[68]!==L||e[69]!==B||e[70]!==O?(K=n.jsxs(_,{sensors:B,onDragStart:O,onDragEnd:I,children:[T,L]}),e[65]=_,e[66]=I,e[67]=T,e[68]=L,e[69]=B,e[70]=O,e[71]=K):K=e[71],K}function on(t,e){return Math.max(t,e.y+e.h)}function rn(t){const e=k.c(7),{rows:s,tiles:o}=t;let i;e[0]!==o?(i=(l,m)=>o.some(c=>l>=c.x&&l<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=o,e[1]=i):i=e[1];const r=i;let a;if(e[2]!==r||e[3]!==s){a=[];for(let l=0;l<s;l++)for(let m=0;m<W;m++)r(m,l)||a.push({x:m,y:l});e[2]=r,e[3]=s,e[4]=a}else a=e[4];let d;return e[5]!==a?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.map(ln)}),e[5]=a,e[6]=d):d=e[6],d}function ln(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/W*100}%`,top:t.y*G,width:`${1/W*100}%`,height:G},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function an(t){const e=k.c(31),{tile:s,isEditMode:o,isDragging:i,onResize:r,onRemove:a,children:d}=t,l=!o;let m;e[0]!==l||e[1]!==s.id?(m={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:p}=Pt(m),h=`${s.x/W*100}%`,x=`${s.w/W*100}%`,y=s.y*G,b=s.h*G,v=p||i,N=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",j=v&&"opacity-30";let g;e[3]!==N||e[4]!==j?(g=Q("absolute p-1 will-change-[left,top,width,height,opacity]",N,j),e[3]=N,e[4]=j,e[5]=g):g=e[5];let w;e[6]!==b||e[7]!==h||e[8]!==y||e[9]!==x?(w={left:h,top:y,width:x,height:b},e[6]=b,e[7]=h,e[8]=y,e[9]=x,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let C;e[11]!==S?(C=Q("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=C):C=e[12];let _;e[13]!==u||e[14]!==o||e[15]!==f||e[16]!==a||e[17]!==r||e[18]!==s?(_=o&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(He,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(cn,{tile:s,onResize:r,onRemove:a})})]}),e[13]=u,e[14]=o,e[15]=f,e[16]=a,e[17]=r,e[18]=s,e[19]=_):_=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==C||e[24]!==_?(T=n.jsxs("div",{className:C,children:[_,I]}),e[22]=I,e[23]=C,e[24]=_,e[25]=T):T=e[25];let P;return e[26]!==c||e[27]!==T||e[28]!==g||e[29]!==w?(P=n.jsx("div",{ref:c,className:g,style:w,children:T}),e[26]=c,e[27]=T,e[28]=g,e[29]=w,e[30]=P):P=e[30],P}function cn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ls,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(bt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=y=>{o(s.id,y),a(!1)},e[1]=o,e[2]=s.id,e[3]=l):l=e[3];let m;e[4]!==l||e[5]!==s?(m=n.jsx(dn,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(as,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(us,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(cs,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=n.jsxs(ds,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let x;return e[17]!==r||e[18]!==h?(x=n.jsxs(ms,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=x):x=e[19],x}function dn(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=$.useState(null);let l;e[0]!==a||e[1]!==s.h||e[2]!==s.w?(l=a??{w:s.w,h:s.h},e[0]=a,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const m=l;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${W}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let h;e[10]!==m.h||e[11]!==m.w||e[12]!==r||e[13]!==i||e[14]!==o?(h=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:tn},(y,b)=>Array.from({length:W},(v,N)=>{const j=N+1,g=b+1,w=j<i||g<r,S=j<=m.w&&g<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${j} by ${g}`,onPointerEnter:()=>d({w:j,h:g}),onClick:()=>o({w:j,h:g}),className:Q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",w?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${j}x${g}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let x;return e[16]!==u||e[17]!==h?(x=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=x):x=e[18],x}function mn(t,e,s){return t.some(o=>e>=o.x&&e<o.x+o.w&&s>=o.y&&s<o.y+o.h)}function he(t,e,s){for(let o=0;o<100;o++)for(let i=0;i<=W-e;i++){let r=!0;for(let a=0;a<s&&r;a++)for(let d=0;d<e&&r;d++)mn(t,i+d,o+a)&&(r=!1);if(r)return{x:i,y:o}}return{x:0,y:0}}function me(t,e,s={w:1,h:1}){const o=Math.max(s.w,Math.min(W,t)),i=Math.max(s.h,Math.min(6,e));return{w:o,h:i}}function ue(t,e,s){const o=Math.max(0,Math.min(W-s,t)),i=Math.max(0,e);return{x:o,y:i}}function un(t,e,s){const o=t.find(l=>l.id===e);if(!o)return t;const i=t.filter(l=>l.id!==e),r=i.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(r&&r.w===o.w&&r.h===o.h)return t.map(l=>l.id===e?{...l,x:r.x,y:r.y}:l.id===r.id?{...l,x:o.x,y:o.y}:l);const d=[{...o,x:s.x,y:s.y}];for(const l of i){const m=he(d,l.w,l.h);d.push({...l,x:m.x,y:m.y})}return d}function fn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ze();let r;e[0]!==s.hidden?(r=new Set(s.hidden),e[0]=s.hidden,e[1]=r):r=e[1];const a=r;let d,l;if(e[2]!==t||e[3]!==a||e[4]!==s.tiles){l=[];let v;e[7]!==a?(v=j=>j.pinned||!a.has(j.id),e[7]=a,e[8]=v):v=e[8];const N=t.filter(v);d=new Map;for(const j of t)j.minSize&&d.set(j.id,j.minSize);for(const j of N){const g=s.tiles[j.id];if(!g)continue;const w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),{x:_,y:I}=ue(g.x,g.y,S);l.push({id:j.id,x:_,y:I,w:S,h:C,minW:w?.w,minH:w?.h})}for(const j of N){if(l.some(I=>I.id===j.id))continue;const g=j.defaultSize??sn,w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),_=he(l,S,C);l.push({id:j.id,x:_.x,y:_.y,w:S,h:C,minW:w?.w,minH:w?.h})}e[2]=t,e[3]=a,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let m;e[9]!==t?(m=new Set(t.map(pn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(v,N)=>{const j={};for(const g of v)j[g.id]={x:g.x,y:g.y,w:g.w,h:g.h};i({version:ee,tiles:j,hidden:N.filter(g=>c.has(g))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let h;e[16]!==f||e[17]!==s||e[18]!==l?(h=(v,N)=>{const j=l.find(S=>S.id===v);if(!j)return;const g=ue(N.x,N.y,j.w);if(g.x===j.x&&g.y===j.y)return;const w=un(l,v,g);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let x;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(x=(v,N)=>{const j=l.find(T=>T.id===v);if(!j)return;const g=d.get(v),{w,h:S}=me(N.w,N.h,g);if(w===j.w&&S===j.h)return;const C={...j,w,h:S,x:ue(j.x,j.y,w).x},_=l.filter(T=>T.id!==v),I=[C];for(const T of _){const P=he(I,T.w,T.h);I.push({...T,x:P.x,y:P.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=x):x=e[24];let y;e[25]!==f||e[26]!==s||e[27]!==l?(y=v=>{const N=l.filter(j=>j.id!==v);f(N,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=y):y=e[28];let b;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==x||e[33]!==y?(b={snapshot:p,isLoading:o,moveTile:h,resizeTile:x,hideTile:y},e[29]=o,e[30]=p,e[31]=h,e[32]=x,e[33]=y,e[34]=b):b=e[34],b}function pn(t){return t.id}const hn={w:2,h:4},xn={w:1,h:2},gn={w:1,h:1};function yn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function bn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function jn(t){return t.promptName?t.agentName:t.description}function vn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function Ye(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=at({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=o):o=e[3];const{data:i}=se(o),r=!!i&&!t.toolName;let a;e[4]!==i||e[5]!==r?(a={client:i,enabled:r},e[4]=i,e[5]=r,e[6]=a):a=e[6];const{data:d}=ts(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Re(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=l):l=e[10];const m=l;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?ns(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:o,startBlank:i,dialog:r,starting:a}=en(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(vn(c))},e[2]=o,e[3]=i,e[4]=d):d=e[4];const l=d;let m;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==a?(m={open:l,startBlank:i,dialog:r,starting:a},e[5]=r,e[6]=l,e[7]=i,e[8]=a,e[9]=m):m=e[9],m}function Nn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const l=a||o,m=!o&&"cursor-pointer transition-colors hover:bg-accent/40",c=o&&"cursor-default pl-12",u=a&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=Q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=n.jsx(ce,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let h;e[10]!==s.title?(h=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=h):h=e[11];let x;e[12]!==s?(x=jn(s),e[12]=s,e[13]=x):x=e[13];let y;e[14]!==x?(y=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=y):y=e[15];let b;e[16]!==y||e[17]!==h?(b=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,y]}),e[16]=y,e[17]=h,e[18]=b):b=e[18];let v;e[19]!==o?(v=!o&&n.jsx(ss,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=o,e[20]=v):v=e[20];let N;e[21]!==a||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(N=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,b,v]}),e[21]=a,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=N):N=e[28];let j;return e[29]!==r||e[30]!==N?(j=n.jsxs(n.Fragment,{children:[N,r]}),e[29]=r,e[30]=N,e[31]=j):j=e[31],j}function wn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Sn)}),t[0]=e):e=t[0],e}function Sn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function _n(t){const e=k.c(17),{tile:s,prompts:o,isEditMode:i,tileWidth:r}=t,{org:a}=J(),{open:d,startBlank:l,dialog:m,starting:c}=Ne(s.agentId),u=o.filter(Cn),f=Ye(s),p="relative flex h-full w-full flex-col p-3";let h;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==c?(h=!i&&n.jsx("button",{type:"button",onClick:()=>{l(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=l,e[3]=c,e[4]=h):h=e[4];const x="flex min-h-0 flex-1 gap-3 overflow-hidden";let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Tn,{}),e[5]=y):y=e[5];let b;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(b=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:y,children:n.jsx(In,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=b):b=e[9];const v=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(g=>n.jsx("button",{type:"button",onClick:()=>d(g),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:g.title})},g.promptName))});let N;e[10]!==b||e[11]!==v?(N=n.jsxs("div",{className:x,children:[b,v]}),e[10]=b,e[11]=v,e[12]=N):N=e[12];let j;return e[13]!==m||e[14]!==h||e[15]!==N?(j=n.jsxs("div",{className:p,children:[h,N,m]}),e[13]=m,e[14]=h,e[15]=N,e[16]=j):j=e[16],j}function Cn(t){return!!t.promptName}function In(t){const e=k.c(13),{tile:s,orgId:o,orgSlug:i}=t;let r;e[0]!==o||e[1]!==i||e[2]!==s.connectionId?(r={connectionId:s.connectionId,orgId:o,orgSlug:i},e[0]=o,e[1]=i,e[2]=s.connectionId,e[3]=r):r=e[3];const a=ae(r),d=s.minHeight??200,l=s.maxHeight??4e3;let m;return e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(Qt,{resourceURI:s.resourceUri,orgId:o,orgSlug:i,connectionId:s.connectionId,client:a,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=a,e[5]=o,e[6]=i,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function kn(t){const e=k.c(14),{icon:s,name:o}=t;let i;e[0]!==s||e[1]!==o?(i=n.jsx(ce,{icon:s,name:o,size:"sm+"}),e[0]=s,e[1]=o,e[2]=i):i=e[2];let r;e[3]!==o?(r=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=a):a=e[5];let d;e[6]!==r?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[r,a]}),e[6]=r,e[7]=d):d=e[7];let l;e[8]!==i||e[9]!==d?(l=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=l):l=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==l?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,m]}),e[12]=l,e[13]=c):c=e[13],c}function $n(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=Ne(s.agentId),m=o.filter(An),c=Ye(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==a?(f=()=>{a(c?{main:c}:void 0)},e[0]=c,e[1]=a,e[2]=f):f=e[2];const p=l||i;let h;e[3]!==f||e[4]!==p?(h=n.jsx("button",{type:"button",onClick:f,disabled:p,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=p,e[5]=h):h=e[5];const x=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(b=>n.jsx("button",{type:"button",onClick:()=>!i&&r(b),disabled:l,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let y;return e[6]!==d||e[7]!==h||e[8]!==x?(y=n.jsxs("div",{className:u,children:[h,x,d]}),e[6]=d,e[7]=h,e[8]=x,e[9]=y):y=e[9],y}function An(t){return!!t.promptName}function et({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=be(e.slug),r=ze()?.ids??[],a=new Set(r),d=Oe(),l=Ue(),m=xe(),c=new Set(i.map(g=>g.agentId)),u=new Map;for(const g of o){const w=u.get(g.agentId);w?w.push(g):u.set(g.agentId,[g])}const f=o.filter(g=>!c.has(g.agentId)),p=[...i.map(g=>({kind:"tile",id:bn(g),data:g})),...f.map(g=>({kind:"prompt",id:yn(g),data:g}))],h=new Map(p.map(g=>[g.id,g])),x=fn(p.map(g=>({id:g.id,defaultSize:g.kind==="tile"?hn:gn,minSize:g.kind==="tile"?xn:void 0,pinned:a.has(g.data.agentId)}))),y=g=>{d.apply(w=>w.filter(S=>S!==g)).catch(()=>U.error("Couldn't remove from home — please try again."))},b=async g=>{if(i.filter(S=>S.agentId===g.agentId).length<=1){y(g.agentId);return}try{const C=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:g.agentId})).item;if(!C)throw new Error("Agent not found");const _=Z(C.metadata?.ui),I=g.tileId?_.filter(T=>T.tileId!==g.tileId):_.filter(T=>T.connectionId!==g.connectionId||T.resourceUri!==g.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:g.agentId,data:{metadata:{...C.metadata??{},ui:{...C.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},v=g=>{const w=h.get(g);if(w){if(!a.has(w.data.agentId)){x.hideTile(g);return}w.kind==="tile"?b(w.data):y(w.data.agentId)}},N=g=>{const w=h.get(g.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(it,{fallback:n.jsx($n,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(kn,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(_n,{tile:w.data,prompts:S,isEditMode:t,tileWidth:g.w})})})}return n.jsx(Nn,{entry:w.data,isEditMode:t})};return s||x.isLoading?n.jsx(wn,{}):x.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(nn,{tiles:x.snapshot.visible,isEditMode:t,renderTile:N,onMove:x.moveTile,onResize:x.resizeTile,onRemove:v})})}function Pn(t){const e=k.c(2),{prompts:s,tiles:o}=be(t),i=o.length>0||s.length>0;let r;return e[0]!==i?(r={hasVisibleTiles:i},e[0]=i,e[1]=r):r=e[1],r}const Ie=420,Te=305;function tt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ie}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ie}}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Te}}),t[2]=o):o=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,o,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Te}})]}),t[3]=i):i=t[3],i}function ke(){const t=k.c(33),{data:e}=ot.useSession(),{org:s}=J(),o=ge(),i=hs(),{selectedVirtualMcp:r}=vt();let a;t[0]!==s.id?(a=ct(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Dt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:dt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ae(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=fs(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==s.slug?(p=Ot(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=p):p=t[12];let h;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(h=ft(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let x;t[17]!==f||t[18]!==p||t[19]!==h?(x={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=x):x=t[20],rt(x);const y=ps(),b=pt(l.id),{hasDecoKey:v,isZeroBalance:N,isInitialFreeCredit:j,balanceDollars:g,hasOnlyDecoProvider:w}=Et(),{hasVisibleTiles:S}=Pn(s.slug),C=Mt(b?.metadata);if(y.length===0&&!(C&&zt(i))){let L;return t[21]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Nt,{})})}),t[21]=L):L=t[21],L}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,P=v&&j&&g!=null,M=v&&N&&w;let z;t[24]!==g||t[25]!==P||t[26]!==M?(z=P?n.jsx(oe.CreditsEyebrow,{balanceDollars:g}):M?n.jsx(oe.NoCreditsEyebrow,{}):null,t[24]=g,t[25]=P,t[26]=M,t[27]=z):z=t[27];const B=z;let O;return t[28]!==B||t[29]!==S||t[30]!==o||t[31]!==T?(O=n.jsx(Ys,{children:o?n.jsx(En,{eyebrow:B,userName:T}):n.jsx(Mn,{eyebrow:B,userName:T,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=o,t[31]=T,t[32]=O):O=t[32],O}function En(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(tt,{}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==o?(a=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",o,"?"]}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==a?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[r,a]}),e[5]=r,e[6]=a,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(oe.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(et,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,l,m]}),e[10]=d,e[11]=c):c=e[11],c}function Mn(t){const e=k.c(32),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ze(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let p;e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==r||e[5]!==d?(p=n.jsx(xs.Right,{children:n.jsx(zn,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=a,e[3]=m,e[4]=r,e[5]=d,e[6]=p):p=e[6];let h;e[7]!==c?(h=n.jsx(ys,{open:c,onOpenChange:u}),e[7]=c,e[8]=h):h=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(tt,{}),e[9]=x):x=e[9];const y=i||r?"pt-32":"flex-1 justify-center";let b;e[10]!==y?(b=Q("relative flex flex-col items-center px-10 pb-4",y),e[10]=y,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let N;e[14]!==o?(N=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[14]=o,e[15]=N):N=e[15];let j;e[16]!==v||e[17]!==N?(j=n.jsxs("div",{className:"text-center mb-10",children:[v,N]}),e[16]=v,e[17]=N,e[18]=j):j=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"relative w-full",children:[n.jsx(On,{}),n.jsx(oe.Input,{showConnectionsBanner:!0})]}),e[19]=g):g=e[19];let w;e[20]!==j?(w=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[j,g]}),e[20]=j,e[21]=w):w=e[21];let S;e[22]!==r?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(et,{isEditMode:r})}),e[22]=r,e[23]=S):S=e[23];let C;e[24]!==w||e[25]!==S||e[26]!==b?(C=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:b,children:[w,S]})})]}),e[24]=w,e[25]=S,e[26]=b,e[27]=C):C=e[27];let _;return e[28]!==C||e[29]!==p||e[30]!==h?(_=n.jsxs(n.Fragment,{children:[p,h,C]}),e[28]=C,e[29]=p,e[30]=h,e[31]=_):_=e[31],_}function zn(t){const e=k.c(17),{isEditMode:s,hasChanges:o,onEnter:i,onSave:r,onCancel:a,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx($e,{size:14}),e[3]=f):f=e[3];let p;e[4]!==a?(p=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:a,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=a,e[5]=p):p=e[5];const h=!o;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ht,{size:14}),e[6]=x):x=e[6];let y;e[7]!==r||e[8]!==h?(y=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=r,e[8]=h,e[9]=y):y=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==y?(b=n.jsxs(n.Fragment,{children:[u,p,y]}),e[10]=u,e[11]=p,e[12]=y,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(jt,{size:14}),e[14]=l):l=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[l,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function On(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Ko(){const t=k.c(2);if(ge()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(ke,{})}),t[0]=o):o=t[0],o}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(ke,{})})})}),t[1]=s):s=t[1],s}export{Ko as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as it,r as E,j as e,i as rt}from"./index-DoucUl3Y.js";import{S as mt,b as pt,c as st,d as at}from"./sheet-DNq52yos.js";import{S as nt}from"./scroll-area-C6-KaVJV.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-Nu87LQxK.js";import{p as xt}from"./index-CIZIZhq0.js";import"./X-h9nJ-EBx.js";import"./agent-icon-C6pv2ku7.js";import"./AlertCircle-DsW3Bcrl.js";import"./Tool01-BxZPwNZl.js";import"./SwitchHorizontal01-Bej1Xe59.js";import"./Settings02-DMwxMpRK.js";import"./XCircle-C0eLN21-.js";import"./ArrowUpRight-BWTy0YGq.js";import"./ZapSquare-DYkBLN1d.js";import"./Users03-BG9oeNVT.js";import"./CheckCircle-c5WK8XV9.js";import"./ChevronUp-DYj_Lqiv.js";import"./ChevronDown-DqDfDEN8.js";import"./ChevronLeft-t20dnuIe.js";import"./ChevronRight-C44MBYbI.js";import"./DotsVertical-DAFoZ0nv.js";import"./Stars02-cvN6aU_Q.js";import"./Eye-DTIj4iPZ.js";import"./ZoomOut-YIKSKCYE.js";import"./Globe01-D6yUjZQH.js";import"./FilterLines-BV29E9UP.js";import"./Star01-BqeGqz7Y.js";import"./Globe04-bVwR5WWU.js";import"./HardDrive-B8km64Z9.js";import"./Key01-B7j5egoB.js";import"./LayoutLeft-CXvEGxxp.js";import"./LinkExternal01-CQ-4gvfk.js";import"./Monitor01-Bj_EAAMU.js";import"./Sun-BHvYVIBh.js";import"./Palette-B-GrEc4W.js";import"./Play-C-OyJs5r.js";import"./Plus-CYbhotOA.js";import"./SearchLg-Cj30V7ex.js";import"./SearchMd-1Z8N8N3h.js";import"./Shield01-B1Sc3Ias.js";import"./Stars01-ZIjfY467.js";import"./Trash01-DYl35j3Y.js";import"./Upload01-CKysXsn0.js";import"./User01-Bl0_xtnf.js";import"./Users01-DBGMUy31.js";import"./XClose-DYr8fUgN.js";import"./Zap-CIpGBf2d.js";import"./use-clock-tick-z5rLDCie.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C8Cy_h_n.js";import"./tooltip-yt7lmbFR.js";import"./file-type-icon-DkI0cvrO.js";import"./dialog-Chku3vbX.js";import"./use-mobile-uxXHtQgn.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-E7XN7ErV.js";import"./use-mcp-client-WvxqfcnZ.js";import"./auth-Bb0aNoyE.js";import"./chat-context-DXkfcYfb.js";import"./hooks-uefC-6qo.js";import"./decopilot-sse-pool-DZ7iO7mi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-B1rjWllH.js";import"./use-collections-BsTbK7kB.js";import"./use-ai-providers-luzuoW6F.js";import"./studio-tools-Czz5alz9.js";import"./use-decopilot-events-QszXAsve.js";import"./use-organization-settings-CiVN8spL.js";import"./shell-layout-CuK3Vqry.js";import"./avatar-BgE6fJJB.js";import"./required-auth-layout-Cni39UJP.js";import"./use-org-sso-BRUmxKLf.js";import"./integration-icon-Cf-Rmmga.js";import"./use-navigate-to-agent-Xf5ZXEBe.js";import"./use-connection-BnsrqzP3.js";import"./use-mcp-prompts-BlOjON_R.js";import"./form-BsHVq-vM.js";import"./label-DWCu1aOX.js";import"./input-DJWrldEm.js";import"./select-CcRNcLs4.js";import"./switch-CA3c3Ikc.js";import"./index-ThpKT5W3.js";import"./drawer-DDuANtUO.js";import"./collection-search-faBG8zWd.js";import"./tabs-UZ20kq7U.js";import"./toggle-group-BbjdiqkS.js";import"./sortable.esm-DvDPoJZ_.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B7OCM5c1.js";import"./use-registry-connections-BB5C1xbN.js";import"./useInfiniteQuery-DC079uf3.js";import"./use-infinite-scroll-CpYSd4m7.js";import"./extract-connection-data-ALY8RBIl.js";import"./card-Bq-T-A3c.js";import"./collection-tabs-CUrRmOty.js";import"./badge-BXVUKWgQ.js";import"./textarea-BIYgBm1i.js";import"./connection-form-helpers-D-2z8iRp.js";import"./authenticate-and-persist-oauth-DWufXUh3.js";import"./mcp-oauth-Cv0VZ7hC.js";import"./useSuspenseInfiniteQuery-B202GQEQ.js";import"./connect-desktop-dialog-BDLcc0Rq.js";import"./decopilot-BHpemSf8.js";import"./checkbox-BJPI9nCv.js";import"./skeleton-DYw0rOyr.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-1TBLdu48.js";import"./popover-Cu2CWUc6.js";import"./command-CEPgisvd.js";import"./index-DmS8LVoF.js";import"./use-org-fs-_YTXbBHs.js";import"./dropdown-menu-VowKBuzA.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CLXD0DTi.js";import"./empty-state-CTy-QySs.js";import"./toolbar-DaNx41W4.js";import"./preview-dialog-TWb4uSgf.js";import"./index-d5v42Ku_.js";import"./use-mcp-tools-CA7LHiOg.js";import"./use-capability-BqaOVotK.js";import"./shell-route-loading-1e-ao78p.js";import"./tools-list-BchYfnfX.js";import"./alert-dialog-B7wd15se.js";import"./use-debounced-autosave-DYZ9j_la.js";import"./index-FHSU_qaz.js";import"./sidebar-deyzgweY.js";import"./search-input-fiAwXyYz.js";import"./github-repo-picker-B01rapBh.js";import"./use-debounced-value-DzjV_Ydf.js";import"./use-secrets-tjI_7kqR.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DJ4H3DkB.js";import"./automation-runs-BLnP5I-H.js";import"./table-BJIlpBQx.js";import"./use-members-BI13P71I.js";import"./use-org-auth-client-Cu0XnCiD.js";import"./task-status--kAAfJo6.js";import"./use-automations-LY-NXMZq.js";import"./use-file-configs-Dj9CIuJ1.js";import"./monaco-editor-xeAwVHxY.js";import"./select-model-CivzIgEY.js";import"./automation-list-row-CQamw_ai.js";function mi(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{mi as SeoSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as $,D as H,j as A}from"./index-DoucUl3Y.js";import{l as L,g as E,s as y}from"./scroll-area-C6-KaVJV.js";import{p as O,u as k}from"./use-mcp-client-WvxqfcnZ.js";import{b as q,c as B}from"./use-mcp-tools-CA7LHiOg.js";import{u as Y}from"./index-CIZIZhq0.js";import{c as G}from"./content-blocks-o63cs2vh.js";import{g as K,M as V,a as w}from"./types-E7XN7ErV.js";import{u as z,b as F}from"./chat-context-DXkfcYfb.js";import{b as J}from"./shell-layout-CuK3Vqry.js";import"./agent-icon-C6pv2ku7.js";import"./AlertCircle-DsW3Bcrl.js";import"./Tool01-BxZPwNZl.js";import"./SwitchHorizontal01-Bej1Xe59.js";import"./Settings02-DMwxMpRK.js";import"./XCircle-C0eLN21-.js";import"./ArrowUpRight-BWTy0YGq.js";import"./ZapSquare-DYkBLN1d.js";import"./Users03-BG9oeNVT.js";import"./CheckCircle-c5WK8XV9.js";import"./ChevronUp-DYj_Lqiv.js";import"./ChevronDown-DqDfDEN8.js";import"./ChevronLeft-t20dnuIe.js";import"./ChevronRight-C44MBYbI.js";import"./DotsVertical-DAFoZ0nv.js";import"./Stars02-cvN6aU_Q.js";import"./Eye-DTIj4iPZ.js";import"./ZoomOut-YIKSKCYE.js";import"./Globe01-D6yUjZQH.js";import"./FilterLines-BV29E9UP.js";import"./Star01-BqeGqz7Y.js";import"./Globe04-bVwR5WWU.js";import"./HardDrive-B8km64Z9.js";import"./Key01-B7j5egoB.js";import"./LayoutLeft-CXvEGxxp.js";import"./LinkExternal01-CQ-4gvfk.js";import"./Monitor01-Bj_EAAMU.js";import"./Sun-BHvYVIBh.js";import"./Palette-B-GrEc4W.js";import"./Play-C-OyJs5r.js";import"./Plus-CYbhotOA.js";import"./SearchLg-Cj30V7ex.js";import"./SearchMd-1Z8N8N3h.js";import"./Shield01-B1Sc3Ias.js";import"./Stars01-ZIjfY467.js";import"./Trash01-DYl35j3Y.js";import"./Upload01-CKysXsn0.js";import"./User01-Bl0_xtnf.js";import"./Users01-DBGMUy31.js";import"./XClose-DYr8fUgN.js";import"./X-h9nJ-EBx.js";import"./Zap-CIpGBf2d.js";import"./use-clock-tick-z5rLDCie.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C8Cy_h_n.js";import"./tooltip-yt7lmbFR.js";import"./file-type-icon-DkI0cvrO.js";import"./dialog-Chku3vbX.js";import"./use-mobile-uxXHtQgn.js";import"./tab-id-BptcWVWa.js";import"./hooks-uefC-6qo.js";import"./decopilot-sse-pool-DZ7iO7mi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-Czz5alz9.js";import"./sheet-DNq52yos.js";import"./integration-icon-Cf-Rmmga.js";import"./use-virtual-mcp-B1rjWllH.js";import"./use-collections-BsTbK7kB.js";import"./use-navigate-to-agent-Xf5ZXEBe.js";import"./use-connection-BnsrqzP3.js";import"./use-mcp-prompts-BlOjON_R.js";import"./form-BsHVq-vM.js";import"./label-DWCu1aOX.js";import"./input-DJWrldEm.js";import"./select-CcRNcLs4.js";import"./auth-Bb0aNoyE.js";import"./index-ThpKT5W3.js";import"./drawer-DDuANtUO.js";import"./collection-search-faBG8zWd.js";import"./tabs-UZ20kq7U.js";import"./toggle-group-BbjdiqkS.js";import"./sortable.esm-DvDPoJZ_.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B7OCM5c1.js";import"./use-registry-connections-BB5C1xbN.js";import"./use-organization-settings-CiVN8spL.js";import"./useInfiniteQuery-DC079uf3.js";import"./use-infinite-scroll-CpYSd4m7.js";import"./extract-connection-data-ALY8RBIl.js";import"./card-Bq-T-A3c.js";import"./collection-tabs-CUrRmOty.js";import"./badge-BXVUKWgQ.js";import"./textarea-BIYgBm1i.js";import"./connection-form-helpers-D-2z8iRp.js";import"./authenticate-and-persist-oauth-DWufXUh3.js";import"./mcp-oauth-Cv0VZ7hC.js";import"./useSuspenseInfiniteQuery-B202GQEQ.js";import"./use-ai-providers-luzuoW6F.js";import"./connect-desktop-dialog-BDLcc0Rq.js";import"./decopilot-BHpemSf8.js";import"./checkbox-BJPI9nCv.js";import"./skeleton-DYw0rOyr.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BgE6fJJB.js";import"./settings-section-1TBLdu48.js";import"./popover-Cu2CWUc6.js";import"./command-CEPgisvd.js";import"./index-DmS8LVoF.js";import"./use-org-fs-_YTXbBHs.js";import"./dropdown-menu-VowKBuzA.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CLXD0DTi.js";import"./use-decopilot-events-QszXAsve.js";import"./empty-state-CTy-QySs.js";import"./toolbar-DaNx41W4.js";import"./preview-dialog-TWb4uSgf.js";import"./index-d5v42Ku_.js";import"./use-capability-BqaOVotK.js";import"./shell-route-loading-1e-ao78p.js";import"./tools-list-BchYfnfX.js";import"./alert-dialog-B7wd15se.js";import"./switch-CA3c3Ikc.js";import"./use-debounced-autosave-DYZ9j_la.js";import"./index-FHSU_qaz.js";import"./sidebar-deyzgweY.js";import"./search-input-fiAwXyYz.js";import"./github-repo-picker-B01rapBh.js";import"./use-debounced-value-DzjV_Ydf.js";import"./use-secrets-tjI_7kqR.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DJ4H3DkB.js";import"./automation-runs-BLnP5I-H.js";import"./table-BJIlpBQx.js";import"./use-members-BI13P71I.js";import"./use-org-auth-client-Cu0XnCiD.js";import"./task-status--kAAfJo6.js";import"./use-automations-LY-NXMZq.js";import"./use-file-configs-Dj9CIuJ1.js";import"./monaco-editor-xeAwVHxY.js";import"./select-model-CivzIgEY.js";import"./automation-list-row-CQamw_ai.js";import"./required-auth-layout-Cni39UJP.js";import"./use-org-sso-BRUmxKLf.js";const Q={};function W(S){const t=$.c(37),{client:r,resourceURI:h,tool:o,connectionId:p,orgId:l,args:M}=S,{sendMessage:I}=z(),{setAppContext:u,clearAppContext:n}=F(),{setChatOpen:f,openTab:g}=J(),e=`${p}:${o.name}`;let a;t[0]!==g?(a=C=>C==="inline"?(g("0"),"inline"):"fullscreen",t[0]=g,t[1]=a):a=t[1];const m=a,s=M??Q;let c;t[2]!==r||t[3]!==o.name||t[4]!==s?(c={client:r,toolName:o.name,toolArguments:s},t[2]=r,t[3]=o.name,t[4]=s,t[5]=c):c=t[5];const{data:i}=B(c);let x;if(t[6]!==o._meta||t[7]!==o.name){const C=E(o._meta);x=y(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const U=x;let d;t[9]!==o.inputSchema?(d=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=d):d=t[10];let N;t[11]!==U||t[12]!==d||t[13]!==o?(N={...o,name:U,inputSchema:d},t[11]=U,t[12]=d,t[13]=o,t[14]=N):N=t[14];const b=N;let _;t[15]!==I||t[16]!==f?(_=C=>{const D=G(C.content);D.content.length>0&&(f(!0),I({tiptapDoc:D}))},t[15]=I,t[16]=f,t[17]=_):_=t[17];const j=_;let P;t[18]!==b?(P={tool:b},t[18]=b,t[19]=P):P=t[19];let T;t[20]!==u||t[21]!==e?(T=C=>u(e,C),t[20]=u,t[21]=e,t[22]=T):T=t[22];let R;t[23]!==n||t[24]!==e?(R=()=>n(e),t[23]=n,t[24]=e,t[25]=R):R=t[25];let v;return t[26]!==r||t[27]!==j||t[28]!==m||t[29]!==l||t[30]!==h||t[31]!==P||t[32]!==T||t[33]!==R||t[34]!==s||t[35]!==i?(v=A.jsx(V,{resourceURI:h,orgId:l,toolInfo:P,toolInput:s,toolResult:i,displayMode:"fullscreen",minHeight:w.fullscreen.minHeight,maxHeight:w.fullscreen.maxHeight,client:r,onMessage:j,onUpdateModelContext:T,onTeardown:R,onRequestDisplayMode:m,className:"h-full"}),t[26]=r,t[27]=j,t[28]=m,t[29]=l,t[30]=h,t[31]=P,t[32]=T,t[33]=R,t[34]=s,t[35]=i,t[36]=v):v=t[36],v}function we(S){const t=$.c(24),{connectionId:r,toolName:h,args:o}=S,{org:p}=H(),l=Y();let M;t[0]!==r||t[1]!==l?(M=O(r)&&l.vmEntry?.sandboxProviderKind==="user-desktop"&&l.previewUrl?`${l.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=r,t[1]=l,t[2]=M):M=t[2];const I=M;let u;t[3]!==r||t[4]!==I||t[5]!==p.id||t[6]!==p.slug?(u={connectionId:r,orgId:p.id,orgSlug:p.slug,mcpUrl:I},t[3]=r,t[4]=I,t[5]=p.id,t[6]=p.slug,t[7]=u):u=t[7];const n=k(u);let f;t[8]!==n?(f={client:n},t[8]=n,t[9]=f):f=t[9];const{data:g}=q(f);let e,a,m;t[10]!==h||t[11]!==g.tools?(e=L(decodeURIComponent(h)),m=g.tools.find(i=>i.name===e)??g.tools.find(i=>{const x=E(i._meta);if(!x)return!1;if(y(i.name,x)===e)return!0;const d=y(e,x);return d!==e&&i.name===d}),a=m?._meta?K(m._meta):void 0,t[10]=h,t[11]=g.tools,t[12]=e,t[13]=a,t[14]=m):(e=t[12],a=t[13],m=t[14]);const s=a;if(!m||!s){let i;return t[15]!==e?(i=A.jsx("div",{className:"flex items-center justify-center h-full w-full",children:A.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',e,'" not found or has no UI']})}),t[15]=e,t[16]=i):i=t[16],i}let c;return t[17]!==o||t[18]!==n||t[19]!==r||t[20]!==p.id||t[21]!==s||t[22]!==m?(c=A.jsx(W,{client:n,resourceURI:s,tool:m,connectionId:r,orgId:p.id,args:o}),t[17]=o,t[18]=n,t[19]=r,t[20]=p.id,t[21]=s,t[22]=m,t[23]=c):c=t[23],c}export{we as AppViewContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as S,j as r}from"./index-DoucUl3Y.js";import{I as T}from"./input-DJWrldEm.js";import{L as C}from"./label-DWCu1aOX.js";import{T as L}from"./textarea-BIYgBm1i.js";import{au as A,av as R,at as D,aw as J,ax as K}from"./index-CIZIZhq0.js";import{u as M,s as P}from"./primitives-Cm1xngZF.js";import"./index-ThpKT5W3.js";import"./SwitchHorizontal01-Bej1Xe59.js";import"./chat-context-DXkfcYfb.js";import"./hooks-uefC-6qo.js";import"./use-mcp-client-WvxqfcnZ.js";import"./auth-Bb0aNoyE.js";import"./decopilot-sse-pool-DZ7iO7mi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-B1rjWllH.js";import"./use-collections-BsTbK7kB.js";import"./use-ai-providers-luzuoW6F.js";import"./studio-tools-Czz5alz9.js";import"./use-decopilot-events-QszXAsve.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-CiVN8spL.js";import"./scroll-area-C6-KaVJV.js";import"./agent-icon-C6pv2ku7.js";import"./AlertCircle-DsW3Bcrl.js";import"./Tool01-BxZPwNZl.js";import"./Settings02-DMwxMpRK.js";import"./XCircle-C0eLN21-.js";import"./ArrowUpRight-BWTy0YGq.js";import"./ZapSquare-DYkBLN1d.js";import"./Users03-BG9oeNVT.js";import"./CheckCircle-c5WK8XV9.js";import"./ChevronUp-DYj_Lqiv.js";import"./ChevronDown-DqDfDEN8.js";import"./ChevronLeft-t20dnuIe.js";import"./ChevronRight-C44MBYbI.js";import"./DotsVertical-DAFoZ0nv.js";import"./Stars02-cvN6aU_Q.js";import"./Eye-DTIj4iPZ.js";import"./ZoomOut-YIKSKCYE.js";import"./Globe01-D6yUjZQH.js";import"./FilterLines-BV29E9UP.js";import"./Star01-BqeGqz7Y.js";import"./Globe04-bVwR5WWU.js";import"./HardDrive-B8km64Z9.js";import"./Key01-B7j5egoB.js";import"./LayoutLeft-CXvEGxxp.js";import"./LinkExternal01-CQ-4gvfk.js";import"./Monitor01-Bj_EAAMU.js";import"./Sun-BHvYVIBh.js";import"./Palette-B-GrEc4W.js";import"./Play-C-OyJs5r.js";import"./Plus-CYbhotOA.js";import"./SearchLg-Cj30V7ex.js";import"./SearchMd-1Z8N8N3h.js";import"./Shield01-B1Sc3Ias.js";import"./Stars01-ZIjfY467.js";import"./Trash01-DYl35j3Y.js";import"./Upload01-CKysXsn0.js";import"./User01-Bl0_xtnf.js";import"./Users01-DBGMUy31.js";import"./XClose-DYr8fUgN.js";import"./X-h9nJ-EBx.js";import"./Zap-CIpGBf2d.js";import"./use-clock-tick-z5rLDCie.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C8Cy_h_n.js";import"./tooltip-yt7lmbFR.js";import"./file-type-icon-DkI0cvrO.js";import"./dialog-Chku3vbX.js";import"./use-mobile-uxXHtQgn.js";import"./content-blocks-o63cs2vh.js";import"./types-E7XN7ErV.js";import"./shell-layout-CuK3Vqry.js";import"./avatar-BgE6fJJB.js";import"./required-auth-layout-Cni39UJP.js";import"./use-org-sso-BRUmxKLf.js";import"./sheet-DNq52yos.js";import"./integration-icon-Cf-Rmmga.js";import"./use-navigate-to-agent-Xf5ZXEBe.js";import"./use-connection-BnsrqzP3.js";import"./use-mcp-prompts-BlOjON_R.js";import"./form-BsHVq-vM.js";import"./select-CcRNcLs4.js";import"./drawer-DDuANtUO.js";import"./collection-search-faBG8zWd.js";import"./tabs-UZ20kq7U.js";import"./toggle-group-BbjdiqkS.js";import"./sortable.esm-DvDPoJZ_.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B7OCM5c1.js";import"./use-registry-connections-BB5C1xbN.js";import"./useInfiniteQuery-DC079uf3.js";import"./use-infinite-scroll-CpYSd4m7.js";import"./extract-connection-data-ALY8RBIl.js";import"./card-Bq-T-A3c.js";import"./collection-tabs-CUrRmOty.js";import"./badge-BXVUKWgQ.js";import"./connection-form-helpers-D-2z8iRp.js";import"./authenticate-and-persist-oauth-DWufXUh3.js";import"./mcp-oauth-Cv0VZ7hC.js";import"./useSuspenseInfiniteQuery-B202GQEQ.js";import"./connect-desktop-dialog-BDLcc0Rq.js";import"./decopilot-BHpemSf8.js";import"./checkbox-BJPI9nCv.js";import"./skeleton-DYw0rOyr.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-1TBLdu48.js";import"./popover-Cu2CWUc6.js";import"./command-CEPgisvd.js";import"./index-DmS8LVoF.js";import"./use-org-fs-_YTXbBHs.js";import"./dropdown-menu-VowKBuzA.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CLXD0DTi.js";import"./empty-state-CTy-QySs.js";import"./toolbar-DaNx41W4.js";import"./preview-dialog-TWb4uSgf.js";import"./index-d5v42Ku_.js";import"./use-mcp-tools-CA7LHiOg.js";import"./use-capability-BqaOVotK.js";import"./shell-route-loading-1e-ao78p.js";import"./tools-list-BchYfnfX.js";import"./alert-dialog-B7wd15se.js";import"./switch-CA3c3Ikc.js";import"./use-debounced-autosave-DYZ9j_la.js";import"./index-FHSU_qaz.js";import"./sidebar-deyzgweY.js";import"./search-input-fiAwXyYz.js";import"./github-repo-picker-B01rapBh.js";import"./use-debounced-value-DzjV_Ydf.js";import"./use-secrets-tjI_7kqR.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DJ4H3DkB.js";import"./automation-runs-BLnP5I-H.js";import"./table-BJIlpBQx.js";import"./use-members-BI13P71I.js";import"./use-org-auth-client-Cu0XnCiD.js";import"./task-status--kAAfJo6.js";import"./use-automations-LY-NXMZq.js";import"./use-file-configs-Dj9CIuJ1.js";import"./monaco-editor-xeAwVHxY.js";import"./select-model-CivzIgEY.js";import"./automation-list-row-CQamw_ai.js";const $={authors:[{key:"name",label:"Name",widget:"text"},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}]},q={authors:"Author"};function Nr(B){const t=S.c(34),{orgSlug:v,virtualMcpId:j,branch:w,kind:p,blockKey:g,block:f}=B;let y;t[0]!==w||t[1]!==v||t[2]!==j?(y={orgSlug:v,virtualMcpId:j,branch:w},t[0]=w,t[1]=v,t[2]=j,t[3]=y):y=t[3];const m=A(y);let d;t[4]!==f||t[5]!==p?(d=R(f,p),t[4]=f,t[5]=p,t[6]=d):d=t[6];const F=d;let h;t[7]!==g||t[8]!==p||t[9]!==m?(h=e=>{m.mutate({blockKey:g,data:J(g,p,e)})},t[7]=g,t[8]=p,t[9]=m,t[10]=h):h=t[10];const[i,E]=M(F,h);let k;t[11]!==i||t[12]!==E?(k=(e,o)=>E({...i,[e]:o}),t[11]=i,t[12]=E,t[13]=k):k=t[13];const a=k,N=q[p];let s;t[14]!==N?(s=r.jsx("span",{className:"text-sm font-medium",children:N}),t[14]=N,t[15]=s):s=t[15];let l;t[16]!==m.isError||t[17]!==m.isPending?(l=r.jsx(D,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=l):l=t[18];let n;t[19]!==s||t[20]!==l?(n=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[s,l]}),t[19]=s,t[20]=l,t[21]=n):n=t[21];const I=$[p];let c;if(t[22]!==i||t[23]!==a||t[24]!==I){let e;t[26]!==i||t[27]!==a?(e=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(K,{schema:{type:"string",format:"image-uri",title:o.label},value:i[o.key],onChange:u=>a(o.key,u),path:o.key,label:o.label}):r.jsxs(r.Fragment,{children:[r.jsx(C,{htmlFor:o.key,children:o.label}),o.widget==="textarea"?r.jsx(L,{id:o.key,value:P(i[o.key]),onChange:u=>a(o.key,u.target.value),rows:3}):r.jsx(T,{id:o.key,value:P(i[o.key]),placeholder:o.placeholder,onChange:u=>a(o.key,u.target.value),className:"h-10"})]})},o.key),t[26]=i,t[27]=a,t[28]=e):e=t[28],c=I.map(e),t[22]=i,t[23]=a,t[24]=I,t[25]=c}else c=t[25];let x;t[29]!==c?(x=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:c})}),t[29]=c,t[30]=x):x=t[30];let b;return t[31]!==x||t[32]!==n?(b=r.jsxs("div",{className:"flex h-full flex-col",children:[n,x]}),t[31]=x,t[32]=n,t[33]=b):b=t[33],b}export{Nr as RecordEditor};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BF6KWN0l.js","assets/index-DoucUl3Y.js","assets/index-1MQY-aKx.css","assets/XCircle-C0eLN21-.js","assets/CheckCircle-c5WK8XV9.js","assets/Settings02-DMwxMpRK.js","assets/use-mcp-client-WvxqfcnZ.js","assets/auth-Bb0aNoyE.js","assets/useInfiniteQuery-DC079uf3.js","assets/use-infinite-scroll-CpYSd4m7.js","assets/studio-tools-Czz5alz9.js","assets/badge-BXVUKWgQ.js","assets/input-DJWrldEm.js","assets/dropdown-menu-VowKBuzA.js","assets/ChevronUp-DYj_Lqiv.js","assets/ChevronRight-C44MBYbI.js","assets/DotsVertical-DAFoZ0nv.js","assets/table-BJIlpBQx.js","assets/toggle-group-BbjdiqkS.js","assets/use-view-mode-D1s3xfpd.js","assets/use-mobile-uxXHtQgn.js","assets/FilterLines-BV29E9UP.js","assets/Globe01-D6yUjZQH.js","assets/SearchMd-1Z8N8N3h.js","assets/dialog-Chku3vbX.js","assets/X-h9nJ-EBx.js","assets/AlertCircle-DsW3Bcrl.js","assets/Upload01-CKysXsn0.js","assets/alert-dialog-B7wd15se.js","assets/card-Bq-T-A3c.js","assets/Trash01-DYl35j3Y.js","assets/label-DWCu1aOX.js","assets/select-CcRNcLs4.js","assets/tooltip-yt7lmbFR.js","assets/ChevronDown-DqDfDEN8.js","assets/switch-CA3c3Ikc.js","assets/textarea-BIYgBm1i.js","assets/checkbox-BJPI9nCv.js","assets/Eye-DTIj4iPZ.js","assets/LinkExternal01-CQ-4gvfk.js","assets/use-copy-C8Cy_h_n.js","assets/Key01-B7j5egoB.js","assets/Plus-CYbhotOA.js","assets/mcp-oauth-Cv0VZ7hC.js","assets/Play-C-OyJs5r.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as s,j as e,r as i,i as a,am as o}from"./index-DoucUl3Y.js";import{R as m}from"./require-capability-Dw5StpLR.js";import"./use-capability-BqaOVotK.js";import"./access-gate-C3iaY6XN.js";import"./capability-load-error-y-w2JHZP.js";const n=i.lazy(()=>o(()=>import("./registry-layout-BF6KWN0l.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])));function f(){const r=s.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(m,{capability:"registry:manage",area:"the registry",children:e.jsx(i.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(n,{})})}),r[0]=t):t=r[0],t}export{f as default};
|