decocms 2.176.0 → 2.176.2
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-PBJUtpjc.js → AlertCircle-BWr4XQe9.js} +1 -1
- package/dist/client/assets/{AlignLeft-CddYwC43.js → AlignLeft-BJyvDaBk.js} +1 -1
- package/dist/client/assets/{ArrowDown-LiBnMzQV.js → ArrowDown-BPMtK04S.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BHzi0YLf.js → ArrowLeft-GOjXvqCa.js} +1 -1
- package/dist/client/assets/{ArrowUp-WIHiBhdv.js → ArrowUp-DqOjcDuh.js} +1 -1
- package/dist/client/assets/{Building02-c7FCt8-6.js → Building02-D_v8ZXC2.js} +1 -1
- package/dist/client/assets/{Check-Bme4aNg5.js → Check-DAFdA2oM.js} +1 -1
- package/dist/client/assets/{CheckCircle-BSVa-h_Y.js → CheckCircle-BL2mIAJn.js} +1 -1
- package/dist/client/assets/{CheckVerified02-e9BOcL0K.js → CheckVerified02-YYsvmiw4.js} +1 -1
- package/dist/client/assets/{ChevronDown-jyPVRLzp.js → ChevronDown-C-3qjfHK.js} +1 -1
- package/dist/client/assets/{ChevronLeft-Bn35AKxx.js → ChevronLeft-Dugo1z8_.js} +1 -1
- package/dist/client/assets/{ChevronRight-Ct9VK1GH.js → ChevronRight-B3gSyJmK.js} +1 -1
- package/dist/client/assets/{ChevronUp-B5BOcmGB.js → ChevronUp-Rk5dLXNx.js} +1 -1
- package/dist/client/assets/{Clock-Bwl2wOhM.js → Clock-Ccv6eV04.js} +1 -1
- package/dist/client/assets/{Code01-DygQPwlG.js → Code01-CoEt5nyY.js} +1 -1
- package/dist/client/assets/{Container-BeAIfNvy.js → Container-CQmXt7Nc.js} +1 -1
- package/dist/client/assets/{Copy01-ekqsSfJN.js → Copy01-D7uh0hW0.js} +1 -1
- package/dist/client/assets/{Dataflow03-BGqN1hrV.js → Dataflow03-ccC0qbkR.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-BYFCLgks.js → DotsHorizontal-C3QGwRko.js} +1 -1
- package/dist/client/assets/{DotsVertical-Dn5mVo7u.js → DotsVertical-D5tMnzaQ.js} +1 -1
- package/dist/client/assets/{Download01-DQJbGhrI.js → Download01-BDm0aKH5.js} +1 -1
- package/dist/client/assets/{Edit01-BxDvpu_b.js → Edit01-DEd4k1xo.js} +1 -1
- package/dist/client/assets/{Edit05-Bta0rpFO.js → Edit05-RRC6ol7j.js} +1 -1
- package/dist/client/assets/{Eye-DN-kY_sb.js → Eye-MRRTHIte.js} +1 -1
- package/dist/client/assets/{EyeOff-E0TupCAH.js → EyeOff-CgRP1cSC.js} +1 -1
- package/dist/client/assets/{File02-Cyzf2kpD.js → File02-DdRvGWJN.js} +1 -1
- package/dist/client/assets/{File06-Ba0KxpWu.js → File06-DbRSeish.js} +1 -1
- package/dist/client/assets/{FilterLines-Ce9H-AFe.js → FilterLines-nV8jE7JI.js} +1 -1
- package/dist/client/assets/{Globe01-Cks65mCV.js → Globe01-Bb7jNfEM.js} +1 -1
- package/dist/client/assets/{Globe02-CB2InS06.js → Globe02-CDBspixd.js} +1 -1
- package/dist/client/assets/{Grid01-BvWQ72pJ.js → Grid01-COkHqk9k.js} +1 -1
- package/dist/client/assets/{Home02-C33y4DXe.js → Home02-Bjdq3zLu.js} +1 -1
- package/dist/client/assets/{Image01-B9BH_f0p.js → Image01-D4-tispo.js} +1 -1
- package/dist/client/assets/{Inbox01-ZPruuuHz.js → Inbox01-DiWhz3sk.js} +1 -1
- package/dist/client/assets/{InfoCircle-ETSHVG2F.js → InfoCircle-tftxVx0C.js} +1 -1
- package/dist/client/assets/{Key01-CdH7i8vY.js → Key01-Cv0XYLbb.js} +1 -1
- package/dist/client/assets/{LayersTwo01-8gQGsURS.js → LayersTwo01-DdRcHsrK.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Bn9kcy6T.js → LayoutLeft-BuqgN7z4.js} +1 -1
- package/dist/client/assets/{Link01-B4s1G5Jr.js → Link01-Bo114MSv.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B5VTVW6k.js → LinkExternal01-Div7VvWd.js} +1 -1
- package/dist/client/assets/{List-BU70NJSh.js → List-_Z2X7aPf.js} +1 -1
- package/dist/client/assets/{Loading01-Dt16NixZ.js → Loading01-BYjTtpy0.js} +1 -1
- package/dist/client/assets/{Lock01-DZeZ3WxC.js → Lock01-j13GCiRT.js} +1 -1
- package/dist/client/assets/{Play-WAyK_VUq.js → Play-BOK5c4Hp.js} +1 -1
- package/dist/client/assets/{Plus-DN4FtVmx.js → Plus-1vH_gFoY.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-B88e0cNw.js → RefreshCcw01-ghOVEWuz.js} +1 -1
- package/dist/client/assets/{Save01-BCInJWrH.js → Save01-43mxrIvD.js} +1 -1
- package/dist/client/assets/{SearchMd-BQseJVRu.js → SearchMd-Dn4cWwEm.js} +1 -1
- package/dist/client/assets/{Settings01-CS4vVmx5.js → Settings01-B3FNPQBg.js} +1 -1
- package/dist/client/assets/{Shield01-BZpNsAZG.js → Shield01-0suO3hAe.js} +1 -1
- package/dist/client/assets/{Terminal-BDeJ6lHB.js → Terminal-CvfSVl9m.js} +1 -1
- package/dist/client/assets/{Tool01-xNX6v26H.js → Tool01-3i6uRXKJ.js} +1 -1
- package/dist/client/assets/{Trash01-PnuUudMl.js → Trash01-Dmi4vR7Q.js} +1 -1
- package/dist/client/assets/{Upload01-CSDtabhZ.js → Upload01-Cqh5tD2o.js} +1 -1
- package/dist/client/assets/{Users03-rAyzQyh3.js → Users03-CUiUl0DH.js} +1 -1
- package/dist/client/assets/{X-CxZVsh3L.js → X-Car5B1de.js} +1 -1
- package/dist/client/assets/{XClose-hdsxwv2G.js → XClose-D08ltwBw.js} +1 -1
- package/dist/client/assets/{Zap-azdz5wfI.js → Zap-CbjhdbUU.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-XZw5-X3u.js → agent-connections-preview-Dv4euUYL.js} +1 -1
- package/dist/client/assets/{agent-detail-BJSxCMs1.js → agent-detail-BignzT6b.js} +1 -1
- package/dist/client/assets/{agents-DQWRQl2B.js → agents-DRDlT25N.js} +1 -1
- package/dist/client/assets/{ai-providers-logos-DPOiBl7V.js → ai-providers-logos-4n_w8l7D.js} +1 -1
- package/dist/client/assets/{alert-dialog-DdwA_v8c.js → alert-dialog-BZtQAioB.js} +1 -1
- package/dist/client/assets/{auth-catchall-WCsr2pQN.js → auth-catchall-BorI3Y5Q.js} +1 -1
- package/dist/client/assets/{automation-detail-BZk6VK2r.js → automation-detail-MAP63xhb.js} +1 -1
- package/dist/client/assets/{automations-B0oZ4Oep.js → automations-CXEh0WQH.js} +1 -1
- package/dist/client/assets/{avatar-CXKBBJaI.js → avatar-DEdDAQ0j.js} +1 -1
- package/dist/client/assets/{badge-BfLRgdaW.js → badge-BTw8dF6C.js} +1 -1
- package/dist/client/assets/{binder-B5Q0NNkg.js → binder-B2xnCBeC.js} +1 -1
- package/dist/client/assets/{breadcrumb-BhQI8Xw3.js → breadcrumb-CcE89MsN.js} +1 -1
- package/dist/client/assets/{card-B8QXMrj8.js → card-B6XTMOTf.js} +1 -1
- package/dist/client/assets/{checkbox-C5Om9oxx.js → checkbox-BA_JFbx4.js} +1 -1
- package/dist/client/assets/{collapsible-MCSgly5t.js → collapsible-CW12HasT.js} +1 -1
- package/dist/client/assets/{collection-detail-CrytnlOI.js → collection-detail-DTZ81ye0.js} +1 -1
- package/dist/client/assets/{collection-display-button-D7NovPlc.js → collection-display-button-BJQ_VSFQ.js} +1 -1
- package/dist/client/assets/{collection-search-DDX1Zkg7.js → collection-search-D6ILFEtf.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-YGokzak8.js → collection-table-wrapper-D0JGm79B.js} +1 -1
- package/dist/client/assets/{collection-tabs-D8NPXaOU.js → collection-tabs-fsXO7rse.js} +1 -1
- package/dist/client/assets/{command-BVlE6-p8.js → command-DwfoahUI.js} +1 -1
- package/dist/client/assets/{connection-card-D0Hulz9h.js → connection-card-CoZ_ixiG.js} +1 -1
- package/dist/client/assets/{connection-detail-C-Ge5CVn.js → connection-detail-BPi4jlBF.js} +1 -1
- package/dist/client/assets/{connection-status-CxcA3Thg.js → connection-status-CulzjjXt.js} +1 -1
- package/dist/client/assets/{connections-DWyHpNQR.js → connections-2fSWPLii.js} +1 -1
- package/dist/client/assets/{constants-CKGlP4oN.js → constants-CLw0F8Mm.js} +1 -1
- package/dist/client/assets/constants-D3bMpbG0.js +1 -0
- package/dist/client/assets/{context-ow-zK3BP.js → context-ClUgEsLK.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CFn_U9MK.js → create-organization-dialog-CNZiViYc.js} +1 -1
- package/dist/client/assets/{create-project-dialog-Rt5_XeVq.js → create-project-dialog-QYAKiAC_.js} +1 -1
- package/dist/client/assets/{danger-CgzhgW7h.js → danger-1mM9iHWV.js} +1 -1
- package/dist/client/assets/{danger-zone-CvDs5VVH.js → danger-zone-DSO2EIjr.js} +1 -1
- package/dist/client/assets/{dependencies-BbmKfxYe.js → dependencies-DtSMIESZ.js} +1 -1
- package/dist/client/assets/{dialog-COv8XUO0.js → dialog-ZIc7OUaM.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Cr1iKfFo.js → dropdown-menu-EcTFyr4x.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BIVc19gr.js → dynamic-plugin-layout-D40fWFup.js} +1 -1
- package/dist/client/assets/{editable-task-title-CrGgc8Hx.js → editable-task-title-CeJC7Fwa.js} +1 -1
- package/dist/client/assets/{empty-state-DsQ7yRoE.js → empty-state-gZUVmgL7.js} +1 -1
- package/dist/client/assets/{empty-state-CsEI90cv.js → empty-state-m7QcZ687.js} +1 -1
- package/dist/client/assets/{env-vars-editor-r00KzDtj.js → env-vars-editor-CIM7XauD.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D46U8dB4.js → extract-connection-data-DEaEvOm7.js} +1 -1
- package/dist/client/assets/{file-browser-C8BCEBfL.js → file-browser-ChPNBU91.js} +2 -2
- package/dist/client/assets/{form-CZrleug2.js → form-Cd_AEgzv.js} +1 -1
- package/dist/client/assets/{general-39EgW9sq.js → general-mH6Dkpor.js} +1 -1
- package/dist/client/assets/{grid-view-CYvRmpTY.js → grid-view-C9tD8dqF.js} +1 -1
- package/dist/client/assets/{home-CwDvuqcO.js → home-icifeNIm.js} +1 -1
- package/dist/client/assets/{index-cEL2CgNm.js → index-BPs3Pxaa.js} +1 -1
- package/dist/client/assets/{index-Bc75bxbq.js → index-Bg2XE05Y.js} +1 -1
- package/dist/client/assets/{index-B23wyLB_.js → index-BrqeZa9X.js} +1 -1
- package/dist/client/assets/{index-DRLd-piX.js → index-CRi6734Z.js} +1 -1
- package/dist/client/assets/{index-CVyJGNS2.js → index-CfjT_Fv-.js} +1 -1
- package/dist/client/assets/{index-CT-515LV.js → index-Cg4edYBM.js} +1 -1
- package/dist/client/assets/{index-sEMWxAyS.js → index-Cz_J9f63.js} +1 -1
- package/dist/client/assets/{index-CsqngJxb.js → index-DKWOGpkx.js} +1 -1
- package/dist/client/assets/{index-BlBXXIdz.js → index-Dk4FCobs.js} +1 -1
- package/dist/client/assets/{index-iqPDmcBY.js → index-DxqOk4x4.js} +1 -1
- package/dist/client/assets/{index-B_DxRVw1.js → index-OyLnxARk.js} +3 -3
- package/dist/client/assets/{infiniteQueryObserver-DNhlrWmr.js → infiniteQueryObserver-BkZg7AVk.js} +1 -1
- package/dist/client/assets/{input-DqwWeNgs.js → input-B4YrZuiK.js} +1 -1
- package/dist/client/assets/{integration-icon-Dv0HduyT.js → integration-icon-B3aufi6R.js} +1 -1
- package/dist/client/assets/{label--AQoxbpU.js → label-BoRKSV_h.js} +1 -1
- package/dist/client/assets/{layout-Cji69-Fr.js → layout-C2-eT_B4.js} +1 -1
- package/dist/client/assets/{layout-CDyeWvbl.js → layout-DwPAPIK-.js} +1 -1
- package/dist/client/assets/{login-D1A8YvmQ.js → login-CYxKPB-k.js} +1 -1
- package/dist/client/assets/{logo-upload-BlIbeyor.js → logo-upload-DsXuRpYi.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-D7CJTHIn.js → mcp-app-renderer-KZyUYhBW.js} +1 -1
- package/dist/client/assets/{mcp-server-card-PhaJL10h.js → mcp-server-card-mO0UAT9W.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-BInJ9Okh.js → mcp-server-detail-CyByMkle.js} +2 -2
- package/dist/client/assets/{members-WK1ZXtTy.js → members-3oNbzlXC.js} +1 -1
- package/dist/client/assets/{monaco-editor-Dgc89AWr.js → monaco-editor-DDZgyrgO.js} +1 -1
- package/dist/client/assets/{monitoring-Co1Fc87j.js → monitoring-Xs5hJ6u_.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-BllFPC-c.js → monitoring-dashboard-edit-C_1U7sTf.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-CztiwjLo.js → monitoring-dashboard-view-DcMyYV2C.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C4WAOhN_.js → monitoring-stats-row-CIKRC_fM.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Bcscfh1C.js → oauth-callback-ai-provider-CX0oMmvR.js} +1 -1
- package/dist/client/assets/{oauth-callback-oApNt2lX.js → oauth-callback-kezpwk-4.js} +1 -1
- package/dist/client/assets/{org-ai-providers-BHi1kOOt.js → org-ai-providers-dfJpkNdu.js} +1 -1
- package/dist/client/assets/{page-Dpk4jTO5.js → page-Y307a-9q.js} +1 -1
- package/dist/client/assets/{page-BZV8vSMw.js → page-y0K-3s3k.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BqFvCCv9.js → plugin-empty-state-BB0mg-1W.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DGylhF1c.js → plugin-empty-state-DwyPPEO0.js} +1 -1
- package/dist/client/assets/{plugin-header-B9UGjso3.js → plugin-header-BMLNemwj.js} +1 -1
- package/dist/client/assets/{plugin-header-CMHji8Df.js → plugin-header-DNeIXlLi.js} +1 -1
- package/dist/client/assets/plugins-CVEdGukW.js +1 -0
- package/dist/client/assets/{popover-DOnHuwq3.js → popover-BKHsia9C.js} +1 -1
- package/dist/client/assets/{project-app-view-fPmiutKj.js → project-app-view-C7kPLPhi.js} +1 -1
- package/dist/client/assets/{project-layout-CDVw6pd9.js → project-layout-C_1_eCl-.js} +1 -1
- package/dist/client/assets/{project-plugins-DwwhiaLk.js → project-plugins-BgoKgZwd.js} +1 -1
- package/dist/client/assets/{projects-list-BY_yiyPl.js → projects-list-B3H-urrL.js} +1 -1
- package/dist/client/assets/{registry-layout-4qwa3Yrl.js → registry-layout-BHOAsCzG.js} +1 -1
- package/dist/client/assets/{registry-utils--TC_kKCq.js → registry-utils-D0qx2c0_.js} +1 -1
- package/dist/client/assets/{reset-password-ChK1U3PS.js → reset-password-o3nCvS90.js} +1 -1
- package/dist/client/assets/{resizable-DXBCOl3J.js → resizable-1OPd79St.js} +1 -1
- package/dist/client/assets/{save-actions-ChdDeTz6.js → save-actions-DQ0FV8E3.js} +1 -1
- package/dist/client/assets/{scroll-area-ACn8ZLYT.js → scroll-area-BSQHcCri.js} +1 -1
- package/dist/client/assets/{select-BM9jpLT2.js → select-Ctls6rHz.js} +1 -1
- package/dist/client/assets/{select-virtual-mcp-DzKjKtT5.js → select-virtual-mcp-CEX-N6yN.js} +1 -1
- package/dist/client/assets/{sheet-DCDIRpJJ.js → sheet-MAyp9_-H.js} +1 -1
- package/dist/client/assets/{shell-layout-BTXUcCYK.js → shell-layout-8MdYJa94.js} +2 -2
- package/dist/client/assets/{sidebar-settings-Dy0o9qBx.js → sidebar-settings-BtI4Obrm.js} +1 -1
- package/dist/client/assets/{skeleton-BkpiIfDB.js → skeleton-DAvz6Hk5.js} +1 -1
- package/dist/client/assets/{spinner-tJ67zxkj.js → spinner-CItj22uq.js} +1 -1
- package/dist/client/assets/{store-invite-CTVa-Zvm.js → store-invite-Dr9c1QQu.js} +1 -1
- package/dist/client/assets/{switch-BE6ziGyo.js → switch-BunRXVYQ.js} +1 -1
- package/dist/client/assets/{table-BOA7X4H8.js → table-DHN8Pbh9.js} +1 -1
- package/dist/client/assets/{tabs-BQ5doEBy.js → tabs-kzZLmFuM.js} +1 -1
- package/dist/client/assets/{task-status-B3QSknHK.js → task-status-D6cPLJpA.js} +1 -1
- package/dist/client/assets/tasks-CZAS_EEA.js +1 -0
- package/dist/client/assets/{tasks-panel-BXchRGWe.js → tasks-panel-6uv7gp5j.js} +1 -1
- package/dist/client/assets/{textarea-BDS2584p.js → textarea-CpLkXx5p.js} +1 -1
- package/dist/client/assets/{time-range-picker-CWEE6Pax.js → time-range-picker-CYn_bf9F.js} +1 -1
- package/dist/client/assets/{toggle-group-B9XVwguR.js → toggle-group-C-kSfPqI.js} +1 -1
- package/dist/client/assets/{tools-list-DO_G3ceo.js → tools-list-GuN2kaNF.js} +1 -1
- package/dist/client/assets/{tooltip-Bm11lCIm.js → tooltip--UA5heKX.js} +1 -1
- package/dist/client/assets/{topbar-portal-XGVG-nsS.js → topbar-portal-M3PPIThx.js} +1 -1
- package/dist/client/assets/{types-BnNswHwQ.js → types-DoomhLgW.js} +1 -1
- package/dist/client/assets/{use-automations-nu85KLSx.js → use-automations-D5ELbflL.js} +1 -1
- package/dist/client/assets/{use-collections-aokT1D_C.js → use-collections-DXLoMYCx.js} +1 -1
- package/dist/client/assets/{use-connection-DA77pjoV.js → use-connection-B7ll8uNa.js} +1 -1
- package/dist/client/assets/{use-copy-CPgIfOPM.js → use-copy-XD9UDj7l.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Dd303mOp.js → use-create-virtual-mcp-BvSTYw2n.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DXKnZJHX.js → use-infinite-scroll-CSG4wWka.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-C_csgcCs.js → use-install-from-registry-1KLotWZ_.js} +1 -1
- package/dist/client/assets/{use-list-state-CFQBiz4L.js → use-list-state-CVKHwo0P.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Dw4CvfV3.js → use-mcp-prompts-DyPVjaKa.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-CFkkQw1d.js → use-mcp-resources-CFTlLllB.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C3Vj1u8m.js → use-mcp-tools-S01H2JtZ.js} +1 -1
- package/dist/client/assets/{use-members-BbXqk449.js → use-members-BXkvGAIM.js} +1 -1
- package/dist/client/assets/{use-mobile-BarAf2zx.js → use-mobile-CgJAXGMs.js} +1 -1
- package/dist/client/assets/{use-project-CPyjDcpX.js → use-project-C2o9r0US.js} +1 -1
- package/dist/client/assets/{use-store-discovery-DupAMgFS.js → use-store-discovery-W6XcrfUT.js} +1 -1
- package/dist/client/assets/{use-view-mode-qVlfLymN.js → use-view-mode-CGzXYNrX.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-FAfRsySa.js → use-virtual-mcp-B8SbBr9v.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C9KaycVy.js +1 -0
- package/dist/client/assets/{useMutation-d1AXy22c.js → useMutation-B_6d8oLI.js} +1 -1
- package/dist/client/assets/useQuery-Brtj4EoG.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DD7d1y3B.js +1 -0
- package/dist/client/assets/{user-z34A3977.js → user-BLAfg6Ev.js} +1 -1
- package/dist/client/assets/{workflow-D77B4RT7.js → workflow-DHe_PiQF.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +230 -230
- package/dist/server/node_modules/pg-int8/LICENSE +13 -0
- package/dist/server/node_modules/pg-int8/README.md +16 -0
- package/dist/server/node_modules/pg-int8/index.js +100 -0
- package/dist/server/node_modules/pg-int8/package.json +24 -0
- package/dist/server/node_modules/postgres-bytea/index.js +33 -0
- package/dist/server/node_modules/{xtend/LICENSE → postgres-bytea/license} +2 -1
- package/dist/server/node_modules/postgres-bytea/package.json +34 -0
- package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
- package/dist/server/node_modules/postgres-date/index.js +116 -0
- package/dist/server/node_modules/{pg-connection-string/LICENSE → postgres-date/license} +5 -5
- package/dist/server/node_modules/postgres-date/package.json +33 -0
- package/dist/server/node_modules/postgres-date/readme.md +49 -0
- package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
- package/dist/server/node_modules/postgres-interval/index.js +125 -0
- package/dist/server/node_modules/{pg-cloudflare/LICENSE → postgres-interval/license} +6 -6
- package/dist/server/node_modules/postgres-interval/package.json +36 -0
- package/dist/server/node_modules/postgres-interval/readme.md +48 -0
- package/dist/server/node_modules/split2/LICENSE +13 -0
- package/dist/server/node_modules/split2/README.md +85 -0
- package/dist/server/node_modules/split2/bench.js +27 -0
- package/dist/server/node_modules/split2/index.js +141 -0
- package/dist/server/node_modules/split2/package.json +39 -0
- package/dist/server/node_modules/split2/test.js +409 -0
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/constants-DqZ0hFNm.js +0 -1
- package/dist/client/assets/plugins-DcIPR0Gj.js +0 -1
- package/dist/client/assets/tasks-BqsZZgtJ.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CCGqKrT7.js +0 -1
- package/dist/client/assets/useQuery-B8Io0Oda.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DsCmMd3U.js +0 -1
- package/dist/server/node_modules/pg-cloudflare/README.md +0 -112
- package/dist/server/node_modules/pg-cloudflare/dist/empty.d.ts +0 -2
- package/dist/server/node_modules/pg-cloudflare/dist/empty.js +0 -6
- package/dist/server/node_modules/pg-cloudflare/dist/empty.js.map +0 -1
- package/dist/server/node_modules/pg-cloudflare/dist/index.d.ts +0 -31
- package/dist/server/node_modules/pg-cloudflare/dist/index.js +0 -152
- package/dist/server/node_modules/pg-cloudflare/dist/index.js.map +0 -1
- package/dist/server/node_modules/pg-cloudflare/esm/index.mjs +0 -3
- package/dist/server/node_modules/pg-cloudflare/package.json +0 -39
- package/dist/server/node_modules/pg-cloudflare/src/empty.ts +0 -3
- package/dist/server/node_modules/pg-cloudflare/src/index.ts +0 -166
- package/dist/server/node_modules/pg-cloudflare/src/types.d.ts +0 -25
- package/dist/server/node_modules/pg-connection-string/README.md +0 -105
- package/dist/server/node_modules/pg-connection-string/esm/index.mjs +0 -8
- package/dist/server/node_modules/pg-connection-string/index.d.ts +0 -36
- package/dist/server/node_modules/pg-connection-string/index.js +0 -231
- package/dist/server/node_modules/pg-connection-string/package.json +0 -52
- package/dist/server/node_modules/pg-pool/LICENSE +0 -21
- package/dist/server/node_modules/pg-pool/README.md +0 -357
- package/dist/server/node_modules/pg-pool/esm/index.mjs +0 -5
- package/dist/server/node_modules/pg-pool/index.js +0 -517
- package/dist/server/node_modules/pg-pool/package.json +0 -51
- package/dist/server/node_modules/pg-protocol/LICENSE +0 -21
- package/dist/server/node_modules/pg-protocol/README.md +0 -3
- package/dist/server/node_modules/pg-protocol/dist/b.d.ts +0 -1
- package/dist/server/node_modules/pg-protocol/dist/b.js +0 -23
- package/dist/server/node_modules/pg-protocol/dist/b.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.d.ts +0 -15
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js +0 -55
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.d.ts +0 -16
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js +0 -81
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +0 -1
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js +0 -530
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/index.d.ts +0 -6
- package/dist/server/node_modules/pg-protocol/dist/index.js +0 -15
- package/dist/server/node_modules/pg-protocol/dist/index.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/messages.d.ts +0 -162
- package/dist/server/node_modules/pg-protocol/dist/messages.js +0 -160
- package/dist/server/node_modules/pg-protocol/dist/messages.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +0 -1
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js +0 -252
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/parser.d.ts +0 -24
- package/dist/server/node_modules/pg-protocol/dist/parser.js +0 -324
- package/dist/server/node_modules/pg-protocol/dist/parser.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/serializer.d.ts +0 -42
- package/dist/server/node_modules/pg-protocol/dist/serializer.js +0 -189
- package/dist/server/node_modules/pg-protocol/dist/serializer.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/esm/index.js +0 -11
- package/dist/server/node_modules/pg-protocol/package.json +0 -45
- package/dist/server/node_modules/pg-protocol/src/b.ts +0 -25
- package/dist/server/node_modules/pg-protocol/src/buffer-reader.ts +0 -58
- package/dist/server/node_modules/pg-protocol/src/buffer-writer.ts +0 -85
- package/dist/server/node_modules/pg-protocol/src/inbound-parser.test.ts +0 -575
- package/dist/server/node_modules/pg-protocol/src/index.ts +0 -11
- package/dist/server/node_modules/pg-protocol/src/messages.ts +0 -262
- package/dist/server/node_modules/pg-protocol/src/outbound-serializer.test.ts +0 -276
- package/dist/server/node_modules/pg-protocol/src/parser.ts +0 -413
- package/dist/server/node_modules/pg-protocol/src/serializer.ts +0 -274
- package/dist/server/node_modules/pg-protocol/src/testing/buffer-list.ts +0 -67
- package/dist/server/node_modules/pg-protocol/src/testing/test-buffers.ts +0 -166
- package/dist/server/node_modules/pg-protocol/src/types/chunky.d.ts +0 -1
- package/dist/server/node_modules/pg-types/.travis.yml +0 -7
- package/dist/server/node_modules/pg-types/Makefile +0 -14
- package/dist/server/node_modules/pg-types/README.md +0 -75
- package/dist/server/node_modules/pg-types/index.d.ts +0 -137
- package/dist/server/node_modules/pg-types/index.js +0 -47
- package/dist/server/node_modules/pg-types/index.test-d.ts +0 -21
- package/dist/server/node_modules/pg-types/lib/arrayParser.js +0 -11
- package/dist/server/node_modules/pg-types/lib/binaryParsers.js +0 -257
- package/dist/server/node_modules/pg-types/lib/builtins.js +0 -73
- package/dist/server/node_modules/pg-types/lib/textParsers.js +0 -215
- package/dist/server/node_modules/pg-types/package.json +0 -42
- package/dist/server/node_modules/pg-types/test/index.js +0 -24
- package/dist/server/node_modules/pg-types/test/types.js +0 -597
- package/dist/server/node_modules/pgpass/README.md +0 -74
- package/dist/server/node_modules/pgpass/lib/helper.js +0 -233
- package/dist/server/node_modules/pgpass/lib/index.js +0 -23
- package/dist/server/node_modules/pgpass/package.json +0 -41
- package/dist/server/node_modules/xtend/.jshintrc +0 -30
- package/dist/server/node_modules/xtend/README.md +0 -32
- package/dist/server/node_modules/xtend/immutable.js +0 -19
- package/dist/server/node_modules/xtend/mutable.js +0 -17
- package/dist/server/node_modules/xtend/package.json +0 -55
- package/dist/server/node_modules/xtend/test.js +0 -103
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as B,g as be,e as _e,u as le,r as I,j as t,J as Ce,O as Z,v as M,B as U,t as Ne,M as Se,w as we,K as J}from"./index-B_DxRVw1.js";import{E as ce}from"./empty-state-DsQ7yRoE.js";import{V as de,a as ke}from"./layout-CDyeWvbl.js";import{S as De}from"./save-actions-ChdDeTz6.js";import{u as Ae}from"./ai-providers-logos-DPOiBl7V.js";import{T as Te,a as Ie,M as Me,S as ee}from"./task-status-B3QSknHK.js";import{V as te}from"./select-virtual-mcp-DzKjKtT5.js";import{I as Ee}from"./integration-icon-Dv0HduyT.js";import{U as $e}from"./user-z34A3977.js";import{c as ze,b as Oe,d as Re,e as Q,f as Pe}from"./use-automations-nu85KLSx.js";import{u as me}from"./index-CsqngJxb.js";import{b as ue,d as pe,c as fe,A as xe,e as he,h as ge,a as ye,f as je}from"./alert-dialog-DdwA_v8c.js";import{b as se,d as Ve,c as Fe,e as Le,B as Ue,a as Be}from"./breadcrumb-BhQI8Xw3.js";import{I as He}from"./input-DqwWeNgs.js";import{c as re,a as Ke,d as We,e as qe,f as Ge,b as Je,D as Qe}from"./dropdown-menu-Cr1iKfFo.js";import{P as ne,a as oe,b as ie}from"./popover-DOnHuwq3.js";import{S as Ye}from"./switch-BE6ziGyo.js";import{T as Xe,a as Ze,b as et}from"./tooltip-Bm11lCIm.js";import{u as tt}from"./useQuery-B8Io0Oda.js";import{i as st,u as rt,a as nt}from"./constants-CKGlP4oN.js";import{b as ot}from"./use-virtual-mcp-FAfRsySa.js";import{i as it}from"./ArrowUp-WIHiBhdv.js";import{s as H}from"./Clock-Bwl2wOhM.js";import{i as at}from"./Edit01-BxDvpu_b.js";import{i as G}from"./Loading01-Dt16NixZ.js";import{s as lt}from"./Plus-DN4FtVmx.js";import{s as ct}from"./Trash01-PnuUudMl.js";import{t as ae}from"./Users03-rAyzQyh3.js";import{s as Y}from"./XClose-hdsxwv2G.js";import{a as ve,t as dt,b as mt}from"./context-ow-zK3BP.js";import{f as ut}from"./formatDistanceToNow-Cb2QZZJn.js";import"./Save01-BCInJWrH.js";import"./skeleton-BkpiIfDB.js";import"./spinner-tJ67zxkj.js";import"./use-mcp-prompts-Dw4CvfV3.js";import"./dialog-COv8XUO0.js";import"./X-CxZVsh3L.js";import"./form-CZrleug2.js";import"./label--AQoxbpU.js";import"./index-CVyJGNS2.js";import"./usage-BW6ztpN6.js";import"./ChevronDown-jyPVRLzp.js";import"./Lock01-DZeZ3WxC.js";import"./use-copy-CPgIfOPM.js";import"./AlertCircle-PBJUtpjc.js";import"./select-BM9jpLT2.js";import"./ChevronUp-B5BOcmGB.js";import"./index-DRLd-piX.js";import"./Check-Bme4aNg5.js";import"./org-ai-providers-BHi1kOOt.js";import"./useMutation-d1AXy22c.js";import"./EyeOff-E0TupCAH.js";import"./Eye-DN-kY_sb.js";import"./Key01-CdH7i8vY.js";import"./card-B8QXMrj8.js";import"./toggle-group-B9XVwguR.js";import"./avatar-CXKBBJaI.js";import"./ArrowLeft-BHzi0YLf.js";import"./tabs-BQ5doEBy.js";import"./badge-BfLRgdaW.js";import"./collapsible-MCSgly5t.js";import"./index-Bc75bxbq.js";import"./Code01-DygQPwlG.js";import"./checkbox-C5Om9oxx.js";import"./AlignLeft-CddYwC43.js";import"./Image01-B9BH_f0p.js";import"./RefreshCcw01-B88e0cNw.js";import"./SearchMd-BQseJVRu.js";import"./Settings01-CS4vVmx5.js";import"./Tool01-xNX6v26H.js";import"./use-mcp-resources-CFkkQw1d.js";import"./ChevronRight-Ct9VK1GH.js";import"./Copy01-ekqsSfJN.js";import"./marked.esm-BaswSlok.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-D7CJTHIn.js";import"./types-BnNswHwQ.js";import"./Globe02-CB2InS06.js";import"./LayersTwo01-8gQGsURS.js";import"./use-collections-aokT1D_C.js";import"./useSuspenseInfiniteQuery-DsCmMd3U.js";import"./infiniteQueryObserver-DNhlrWmr.js";import"./CheckCircle-BSVa-h_Y.js";import"./use-create-virtual-mcp-Dd303mOp.js";import"./Container-BeAIfNvy.js";import"./decopilot-events-Brt4gAR6.js";import"./index-iqPDmcBY.js";import"./differenceInSeconds-NQ4PDo0z.js";function K(s){const e=s.trim().split(/\s+/);return e.length!==5?!1:e.every(r=>/^[\d*/,\-]+$/.test(r))}function pt(s){if(!s)return"Unknown schedule";const e=s.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return`Every ${r[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const x=parseInt(o[1]??"1");return x%7===0?`Every ${x/7} weeks`:`Every ${x} days`}const a=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(a){const x=(a[2]??"0").padStart(2,"0"),d=(a[1]??"0").padStart(2,"0");return`Every day at ${x}:${d} UTC`}const h=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(h){const d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(h[3]??"0")]??"day",l=(h[2]??"0").padStart(2,"0"),v=(h[1]??"0").padStart(2,"0");return`Every ${d} at ${l}:${v} UTC`}return s}function ft(s,e){const r=Math.max(1,s);switch(e){case"minutes":return r===1?"* * * * *":`*/${r} * * * *`;case"hours":return r===1?"0 * * * *":`0 */${r} * * *`;case"days":return r===1?"0 0 * * *":`0 0 */${r} * *`;case"weeks":return r===1?"0 0 * * 1":`0 0 */${r*7} * *`}}function xt(s){const e=s.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return{count:parseInt(r[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const a=parseInt(o[1]);return a%7===0?{count:a/7,unit:"weeks"}:{count:a,unit:"days"}}return null}function ht(s,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[s]??s:s}const gt=[{label:"Minute",cron:"* * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}];function yt(s){const e=B.c(26),{automationId:r,open:n,onOpenChange:o,onCustomSelect:a}=s,h=Q(),[x,d]=I.useState(!1),l=n??x;let v;e[0]!==o?(v=C=>{o?o(C):d(C)},e[0]=o,e[1]=v):v=e[1];const f=v;let u;e[2]!==h||e[3]!==r||e[4]!==f?(u=async C=>{try{await h.mutateAsync({automation_id:r,type:"cron",cron_expression:C}),M.success("Starter added"),f(!1)}catch(k){const T=k,D=T instanceof Error?T.message:"Failed to add starter";M.error(D)}},e[2]=h,e[3]=r,e[4]=f,e[5]=u):u=e[5];const N=u;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ke,{asChild:!0,children:t.jsxs(U,{variant:"outline",size:"sm",children:[t.jsx(lt,{size:14}),"Add Starter"]})}),e[6]=m):m=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs(We,{className:"gap-2.5",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every..."]}),e[7]=j):j=e[7];let b;e[8]!==h||e[9]!==N?(b=gt.map(C=>t.jsxs(re,{className:"gap-2.5",onSelect:()=>N(C.cron),disabled:h.isPending,children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every ",C.label]},C.cron)),e[8]=h,e[9]=N,e[10]=b):b=e[10];let i;e[11]!==b?(i=t.jsxs(qe,{children:[j,t.jsx(Ge,{className:"w-[160px]",children:b})]}),e[11]=b,e[12]=i):i=e[12];let p;e[13]!==f||e[14]!==a?(p=()=>{f(!1),a?.()},e[13]=f,e[14]=a,e[15]=p):p=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[16]=_):_=e[16];let g;e[17]!==p?(g=t.jsxs(re,{className:"gap-2.5",onSelect:p,children:[_,"Custom (cron)"]}),e[17]=p,e[18]=g):g=e[18];let y;e[19]!==i||e[20]!==g?(y=t.jsxs(Je,{align:"end",className:"w-[200px]",children:[i,g]}),e[19]=i,e[20]=g,e[21]=y):y=e[21];let S;return e[22]!==f||e[23]!==l||e[24]!==y?(S=t.jsxs(Qe,{open:l,onOpenChange:f,children:[m,y]}),e[22]=f,e[23]=l,e[24]=y,e[25]=S):S=e[25],S}function jt(s){const e=B.c(56),{trigger:r,automationId:n}=s,o=Pe(),a=Q(),[h,x]=I.useState(!1);let d;e[0]!==r.cron_expression?(d=r.cron_expression?xt(r.cron_expression):null,e[0]=r.cron_expression,e[1]=d):d=e[1];const l=d,[v,f]=I.useState(l?.count??1),[u,N]=I.useState(!1),[m,j]=I.useState(r.cron_expression??""),b=o.isPending||a.isPending,i=r.type==="cron";let p;e[2]!==n||e[3]!==o||e[4]!==r.id?(p=async()=>{try{await o.mutateAsync({trigger_id:r.id,automation_id:n}),M.success("Starter removed")}catch{M.error("Failed to remove starter")}x(!1)},e[2]=n,e[3]=o,e[4]=r.id,e[5]=p):p=e[5];const _=p;let g;e[6]!==a||e[7]!==n||e[8]!==m||e[9]!==o||e[10]!==r.cron_expression||e[11]!==r.id?(g=async()=>{const A=m.trim();if(!A||!K(A)||A===r.cron_expression){N(!1),j(r.cron_expression??"");return}try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:A}),await o.mutateAsync({trigger_id:r.id,automation_id:n}),N(!1)}catch{M.error("Failed to update starter"),j(r.cron_expression??""),N(!1)}},e[6]=a,e[7]=n,e[8]=m,e[9]=o,e[10]=r.cron_expression,e[11]=r.id,e[12]=g):g=e[12];const y=g;let S;e[13]!==a||e[14]!==n||e[15]!==l||e[16]!==o||e[17]!==r.cron_expression||e[18]!==r.id?(S=async A=>{if(!l)return;const W=Math.max(1,A),q=ft(W,l.unit);if(q!==r.cron_expression)try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:q}),await o.mutateAsync({trigger_id:r.id,automation_id:n})}catch{M.error("Failed to update starter"),f(l.count)}},e[13]=a,e[14]=n,e[15]=l,e[16]=o,e[17]=r.cron_expression,e[18]=r.id,e[19]=S):S=e[19];const C=S;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[20]=k):k=e[20];let T;e[21]!==v||e[22]!==m||e[23]!==C||e[24]!==y||e[25]!==l||e[26]!==i||e[27]!==u||e[28]!==b||e[29]!==r.cron_expression||e[30]!==r.event_type?(T=l&&i?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Every"}),t.jsx("input",{type:"number",min:1,value:v,onChange:A=>f(parseInt(A.target.value)||1),onBlur:()=>C(v),onKeyDown:A=>{A.key==="Enter"&&A.target.blur(),A.key==="Escape"&&f(l.count)},disabled:b,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus:outline-none focus:ring-1 focus:ring-ring"}),t.jsx("span",{className:"text-sm",children:ht(l.unit,v)})]}):i&&u?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:m,onChange:A=>j(A.target.value),onBlur:y,onKeyDown:A=>{A.key==="Enter"&&A.target.blur(),A.key==="Escape"&&(N(!1),j(r.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),m&&!K(m)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"})]}):t.jsx("span",{className:"text-sm flex-1 font-mono text-xs text-muted-foreground",children:i?pt(r.cron_expression??""):`${r.event_type} event`}),e[21]=v,e[22]=m,e[23]=C,e[24]=y,e[25]=l,e[26]=i,e[27]=u,e[28]=b,e[29]=r.cron_expression,e[30]=r.event_type,e[31]=T):T=e[31];let D;e[32]!==b?(D=b&&t.jsx(G,{size:13,className:"animate-spin text-muted-foreground"}),e[32]=b,e[33]=D):D=e[33];let w;e[34]!==l||e[35]!==i||e[36]!==u||e[37]!==r.cron_expression?(w=i&&!l&&!u&&t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{j(r.cron_expression??""),N(!0)},children:t.jsx(at,{size:13,className:"text-muted-foreground"})}),e[34]=l,e[35]=i,e[36]=u,e[37]=r.cron_expression,e[38]=w):w=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>x(!0),children:t.jsx(Y,{size:13,className:"text-muted-foreground"})}),e[39]=P):P=e[39];let z;e[40]!==D||e[41]!==w?(z=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[D,w,P]}),e[40]=D,e[41]=w,e[42]=z):z=e[42];let E;e[43]!==z||e[44]!==T?(E=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[k,T,z]}),e[43]=z,e[44]=T,e[45]=E):E=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(ue,{children:[t.jsx(fe,{children:"Remove Starter"}),t.jsx(pe,{children:"Are you sure you want to remove this starter?"})]}),e[46]=V):V=e[46];let F;e[47]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(xe,{children:"Cancel"}),e[47]=F):F=e[47];let O;e[48]!==_?(O=t.jsxs(ye,{children:[V,t.jsxs(he,{children:[F,t.jsx(ge,{onClick:_,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),e[48]=_,e[49]=O):O=e[49];let $;e[50]!==h||e[51]!==O?($=t.jsx(je,{open:h,onOpenChange:x,children:O}),e[50]=h,e[51]=O,e[52]=$):$=e[52];let R;return e[53]!==E||e[54]!==$?(R=t.jsxs(t.Fragment,{children:[E,$]}),e[53]=E,e[54]=$,e[55]=R):R=e[55],R}function vt(s){const e=B.c(41),{selectedId:r,onChange:n}=s,[o,a]=I.useState(!1),h=ot();let x,d;e[0]!==h||e[1]!==r?(d=h.filter(bt),x=r?d.find(m=>m.id===r):null,e[0]=h,e[1]=r,e[2]=x,e[3]=d):(x=e[2],d=e[3]);const l=x;if(l){let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ae,{size:16}),e[4]=m):m=e[4];let j;e[5]!==l.icon||e[6]!==l.title?(j=t.jsx(Ee,{icon:l.icon,name:l.title,size:"sm",fallbackIcon:m,className:"rounded-md shrink-0"}),e[5]=l.icon,e[6]=l.title,e[7]=j):j=e[7];let b;e[8]!==l.title?(b=t.jsx("span",{className:"text-sm font-medium truncate",children:l.title}),e[8]=l.title,e[9]=b):b=e[9];let i;e[10]!==j||e[11]!==b?(i=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 flex-1 min-w-0 text-left cursor-pointer",children:[j,b]})}),e[10]=j,e[11]=b,e[12]=i):i=e[12];let p;e[13]!==n?(p=T=>{n(T),a(!1)},e[13]=n,e[14]=p):p=e[14];let _;e[15]!==r||e[16]!==p||e[17]!==d?(_=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(te,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:p})}),e[15]=r,e[16]=p,e[17]=d,e[18]=_):_=e[18];let g;e[19]!==o||e[20]!==i||e[21]!==_?(g=t.jsxs(ie,{open:o,onOpenChange:a,children:[i,_]}),e[19]=o,e[20]=i,e[21]=_,e[22]=g):g=e[22];let y;e[23]!==n?(y=()=>n(null),e[23]=n,e[24]=y):y=e[24];let S;e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Y,{size:13}),e[25]=S):S=e[25];let C;e[26]!==y?(C=t.jsx(U,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 size-7 text-muted-foreground hover:text-foreground",onClick:y,title:"Remove agent",children:S}),e[26]=y,e[27]=C):C=e[27];let k;return e[28]!==C||e[29]!==g?(k=t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border bg-background hover:bg-accent/50 transition-colors",children:[g,C]}),e[28]=C,e[29]=g,e[30]=k):k=e[30],k}let v;e[31]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsxs("div",{className:"relative flex items-center justify-center size-8 rounded-md text-muted-foreground/75 shrink-0",children:[t.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"agent-picker-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[t.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),t.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),t.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),t.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"5.5",stroke:"url(#agent-picker-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),t.jsx(ae,{size:16})]}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"No agent selected. All connections available."})]})}),e[31]=v):v=e[31];let f;e[32]!==n?(f=m=>{n(m),a(!1)},e[32]=n,e[33]=f):f=e[33];let u;e[34]!==r||e[35]!==f||e[36]!==d?(u=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(te,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:f})}),e[34]=r,e[35]=f,e[36]=d,e[37]=u):u=e[37];let N;return e[38]!==o||e[39]!==u?(N=t.jsxs(ie,{open:o,onOpenChange:a,children:[v,u]}),e[38]=o,e[39]=u,e[40]=N):N=e[40],N}function bt(s){return!s.id||!st(s.id)}function _t({automationId:s,automation:e}){const r=Re(),{createTask:n,setVirtualMcpId:o,setSelectedModel:a,setSelectedMode:h,sendMessage:x,credentialId:d,model:l}=ve(),[,v]=me(),f=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[u,N]=I.useState(f),[m,j]=I.useState(f),[b,i]=I.useState(!1),[p,_]=I.useState(!1),[g,y]=I.useState(""),S=Q(),C=I.useRef(!1),k=c=>{N(c),C.current||(C.current=!0,f||j(c))},T=e.models?.credentialId||d||"",D=e.models?.thinking?.id||l?.modelId||"",w=Ne({defaultValues:{name:e.name,active:e.active,agent_id:e.agent?.id??"",credential_id:T,model_id:D}}),P=w.watch("active"),z=w.watch("agent_id"),E=w.watch("credential_id"),V=w.watch("model_id"),{models:F,isLoading:O}=Ae(E||void 0),$=F.find(c=>c.modelId===V)??null,R=async()=>{const c=w.getValues();try{const L=c.credential_id&&c.model_id?c.credential_id:"",X=c.credential_id&&c.model_id?c.model_id:"";return await r.mutateAsync({id:s,name:c.name,active:c.active,agent:{id:c.agent_id,mode:"passthrough"},models:{credentialId:L,thinking:{id:X}},messages:dt(u),temperature:0}),w.reset({...c,credential_id:L,model_id:X}),j(u),M.success("Automation saved"),!0}catch{return M.error("Failed to save automation"),!1}},A=()=>{w.reset(),k(m)},W=w.formState.isDirty||JSON.stringify(u??null)!==JSON.stringify(m??null),q=async()=>{if(W&&!await R())return;if(!u){M.error("No instructions configured for this automation");return}const c=w.getValues();o(c.agent_id||null),h("passthrough"),$&&E&&a({...$,keyId:E}),v(!0),n(),setTimeout(()=>{x(u,{toolApprovalLevel:"yolo"})},0)};return t.jsxs(t.Fragment,{children:[t.jsx(de,{children:t.jsx(De,{onSave:async()=>{await R()},onUndo:A,isDirty:W,isSaving:r.isPending})}),t.jsxs("div",{className:"max-w-2xl mx-auto w-full px-6 py-6 flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(He,{...w.register("name"),placeholder:"Automation name",className:"border-0 shadow-none px-0 text-2xl md:text-2xl font-semibold h-auto focus-visible:ring-0 bg-transparent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Se,{control:w.control,name:"active",render:({field:c})=>t.jsx(Ye,{checked:c.value,onCheckedChange:c.onChange,className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:P?"Active":"Inactive"}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx($e,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Starter"}),t.jsx(yt,{automationId:s,open:b,onOpenChange:i,onCustomSelect:()=>{_(!0),y("")}})]}),e.triggers.length===0&&!p?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["When should this automation run?"," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>i(!0),children:"Add a starter"})," ","to get going."]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(c=>t.jsx(jt,{trigger:c,automationId:s},c.id))}),p&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:g,onChange:c=>y(c.target.value),onBlur:async()=>{const c=g.trim();if(!(!c||!K(c)))try{await S.mutateAsync({automation_id:s,type:"cron",cron_expression:c}),M.success("Starter added"),_(!1),y("")}catch{M.error("Failed to add starter")}},onKeyDown:async c=>{const L=g.trim();c.key==="Enter"&&L&&K(L)&&c.target.blur(),c.key==="Escape"&&(_(!1),y(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),g&&!K(g)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"}),S.isPending&&t.jsx(G,{size:13,className:"animate-spin text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 rounded text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity",onClick:()=>{_(!1),y("")},children:t.jsx(Y,{size:13})})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Agent"}),t.jsx(vt,{selectedId:z||null,onChange:c=>w.setValue("agent_id",c??"",{shouldDirty:!0})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Instructions"}),t.jsx(Te,{tiptapDoc:u,setTiptapDoc:k,placeholder:"What should this automation do?",children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Ie,{virtualMcpId:z||null}),t.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-2.5",children:[t.jsx(Me,{model:$,isLoading:O,credentialId:E||null,onCredentialChange:c=>{w.setValue("credential_id",c??"",{shouldDirty:!0}),w.setValue("model_id","",{shouldDirty:!0})},onModelChange:c=>w.setValue("model_id",c.modelId,{shouldDirty:!0}),placeholder:"Model"}),t.jsxs(Xe,{children:[t.jsx(Ze,{asChild:!0,children:t.jsxs(U,{type:"button",variant:"default",className:"h-8 gap-1.5 rounded-md px-3 text-sm font-medium",onClick:q,children:[t.jsx(it,{size:16}),"Test"]})}),t.jsx(et,{children:"Test Automation"})]})]})]})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Run History"}),t.jsx(Nt,{automationId:s,triggerIds:e.triggers.map(c=>c.id)})]})]})]})}function Ct(s,e,r){const n=B.c(13);let o;n[0]!==s?(o={connectionId:nt,orgId:s},n[0]=s,n[1]=o):o=n[1];const a=rt(o);let h;n[2]!==e||n[3]!==s||n[4]!==r?(h=J.automationRuns(s,e,r),n[2]=e,n[3]=s,n[4]=r,n[5]=h):h=n[5];let x;n[6]!==a||n[7]!==r?(x=async()=>{if(!a)throw new Error("MCP client not available");const v=await a.callTool({name:"COLLECTION_THREADS_LIST",arguments:{where:{trigger_ids:r},limit:20}});return(v.structuredContent??v).items??[]},n[6]=a,n[7]=r,n[8]=x):x=n[8];const d=r.length>0;let l;return n[9]!==h||n[10]!==x||n[11]!==d?(l={queryKey:h,queryFn:x,enabled:d},n[9]=h,n[10]=x,n[11]=d,n[12]=l):l=n[12],tt(l)}function Nt(s){const e=B.c(22),{automationId:r,triggerIds:n}=s,{org:o}=le(),{switchToTask:a}=ve(),[,h]=me(),x=we(),{data:d,isLoading:l}=Ct(o.id,r,n),v=n.length>0;let f;e[0]!==r||e[1]!==o.id||e[2]!==x||e[3]!==d||e[4]!==n?(f=i=>{const p=i.subject,_=d??[];_.find(y=>y.id===p)?x.setQueryData(J.automationRuns(o.id,r,n),_.map(y=>y.id===p?{...y,status:i.data.status,updated_at:new Date().toISOString()}:y)):x.invalidateQueries({queryKey:J.automationRuns(o.id,r,n)})},e[0]=r,e[1]=o.id,e[2]=x,e[3]=d,e[4]=n,e[5]=f):f=e[5];let u;if(e[6]!==o.id||e[7]!==v||e[8]!==f?(u={orgId:o.id,enabled:v,onTaskStatus:f},e[6]=o.id,e[7]=v,e[8]=f,e[9]=u):u=e[9],mt(u),l){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(G,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=i):i=e[10],i}if(!d||d.length===0){let i;return e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ce,{image:null,className:"mt-6",title:"No run history",description:"Run history will appear here when the automation has been triggered."}),e[11]=i):i=e[11],i}let N;e[12]!==h||e[13]!==a?(N=async i=>{await a(i),h(!0)},e[12]=h,e[13]=a,e[14]=N):N=e[14];const m=N;let j;if(e[15]!==m||e[16]!==d){let i;e[18]!==m?(i=p=>{const _=ee[p.status]??ee.completed,g=_.icon;return t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-1 py-2.5 text-left hover:bg-accent/50 transition-colors cursor-pointer rounded-sm",onClick:()=>m(p.id),children:[t.jsx(g,{size:16,className:_.iconClassName}),t.jsx("span",{className:"flex-1 min-w-0 text-sm truncate",children:p.title}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:ut(new Date(p.updated_at),{addSuffix:!0})})]},p.id)},e[18]=m,e[19]=i):i=e[19],j=d.map(i),e[15]=m,e[16]=d,e[17]=j}else j=e[17];let b;return e[20]!==j?(b=t.jsx("div",{className:"flex flex-col divide-y divide-border",children:j}),e[20]=j,e[21]=b):b=e[21],b}function or(){const s=B.c(36);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{automationId:r}=be(e),n=_e(),{org:o}=le(),{data:a,isLoading:h}=ze(r),x=Oe(),[d,l]=I.useState(!1);let v;s[1]!==r||s[2]!==x||s[3]!==n||s[4]!==o?(v=async()=>{try{await x.mutateAsync(r),M.success("Automation deleted"),n({to:"/$org/$project/automations",params:{org:o.slug,project:Z}})}catch{M.error("Failed to delete automation")}l(!1)},s[1]=r,s[2]=x,s[3]=n,s[4]=o,s[5]=v):v=s[5];const f=v;if(h){let D;return s[6]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(G,{size:24,className:"animate-spin text-muted-foreground"})}),s[6]=D):D=s[6],D}if(!a){let D;return s[7]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(ce,{title:"Automation not found",description:"This automation may have been deleted."}),s[7]=D):D=s[7],D}let u;s[8]!==o.slug?(u=t.jsx(se,{children:t.jsx(Ve,{asChild:!0,children:t.jsx(Ce,{to:"/$org/$project/automations",params:{org:o.slug,project:Z},children:"Automations"})})}),s[8]=o.slug,s[9]=u):u=s[9];let N;s[10]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Le,{}),s[10]=N):N=s[10];let m;s[11]!==a.name?(m=t.jsx(se,{children:t.jsx(Fe,{children:a.name})}),s[11]=a.name,s[12]=m):m=s[12];let j;s[13]!==u||s[14]!==m?(j=t.jsx(Ue,{children:t.jsxs(Be,{children:[u,N,m]})}),s[13]=u,s[14]=m,s[15]=j):j=s[15];const b=j;let i;s[16]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(de,{children:t.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 text-destructive hover:text-destructive",onClick:()=>l(!0),children:[t.jsx(ct,{size:14}),"Delete"]})}),s[16]=i):i=s[16];let p;s[17]!==a||s[18]!==r?(p=t.jsx(_t,{automationId:r,automation:a},r),s[17]=a,s[18]=r,s[19]=p):p=s[19];let _;s[20]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(fe,{children:"Delete Automation"}),s[20]=_):_=s[20];let g;s[21]!==a.name?(g=t.jsxs(ue,{children:[_,t.jsxs(pe,{children:['Are you sure you want to delete "',a.name,'"? This action cannot be undone.']})]}),s[21]=a.name,s[22]=g):g=s[22];let y;s[23]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(xe,{children:"Cancel"}),s[23]=y):y=s[23];let S;s[24]!==f?(S=t.jsxs(he,{children:[y,t.jsx(ge,{onClick:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),s[24]=f,s[25]=S):S=s[25];let C;s[26]!==S||s[27]!==g?(C=t.jsxs(ye,{children:[g,S]}),s[26]=S,s[27]=g,s[28]=C):C=s[28];let k;s[29]!==d||s[30]!==C?(k=t.jsx(je,{open:d,onOpenChange:l,children:C}),s[29]=d,s[30]=C,s[31]=k):k=s[31];let T;return s[32]!==b||s[33]!==k||s[34]!==p?(T=t.jsxs(ke,{breadcrumb:b,children:[i,p,k]}),s[32]=b,s[33]=k,s[34]=p,s[35]=T):T=s[35],T}export{or as default};
|
|
1
|
+
import{c as B,g as be,e as _e,u as le,r as I,j as t,J as Ce,O as Z,v as M,B as U,t as Ne,M as Se,w as we,K as J}from"./index-OyLnxARk.js";import{E as ce}from"./empty-state-gZUVmgL7.js";import{V as de,a as ke}from"./layout-DwPAPIK-.js";import{S as De}from"./save-actions-DQ0FV8E3.js";import{u as Ae}from"./ai-providers-logos-4n_w8l7D.js";import{T as Te,a as Ie,M as Me,S as ee}from"./task-status-D6cPLJpA.js";import{V as te}from"./select-virtual-mcp-CEX-N6yN.js";import{I as Ee}from"./integration-icon-B3aufi6R.js";import{U as $e}from"./user-BLAfg6Ev.js";import{c as ze,b as Oe,d as Re,e as Q,f as Pe}from"./use-automations-D5ELbflL.js";import{u as me}from"./index-DKWOGpkx.js";import{b as ue,d as pe,c as fe,A as xe,e as he,h as ge,a as ye,f as je}from"./alert-dialog-BZtQAioB.js";import{b as se,d as Ve,c as Fe,e as Le,B as Ue,a as Be}from"./breadcrumb-CcE89MsN.js";import{I as He}from"./input-B4YrZuiK.js";import{c as re,a as Ke,d as We,e as qe,f as Ge,b as Je,D as Qe}from"./dropdown-menu-EcTFyr4x.js";import{P as ne,a as oe,b as ie}from"./popover-BKHsia9C.js";import{S as Ye}from"./switch-BunRXVYQ.js";import{T as Xe,a as Ze,b as et}from"./tooltip--UA5heKX.js";import{u as tt}from"./useQuery-Brtj4EoG.js";import{i as st,u as rt,a as nt}from"./constants-CLw0F8Mm.js";import{b as ot}from"./use-virtual-mcp-B8SbBr9v.js";import{i as it}from"./ArrowUp-DqOjcDuh.js";import{s as H}from"./Clock-Ccv6eV04.js";import{i as at}from"./Edit01-DEd4k1xo.js";import{i as G}from"./Loading01-BYjTtpy0.js";import{s as lt}from"./Plus-1vH_gFoY.js";import{s as ct}from"./Trash01-Dmi4vR7Q.js";import{t as ae}from"./Users03-CUiUl0DH.js";import{s as Y}from"./XClose-D08ltwBw.js";import{a as ve,t as dt,b as mt}from"./context-ClUgEsLK.js";import{f as ut}from"./formatDistanceToNow-Cb2QZZJn.js";import"./Save01-43mxrIvD.js";import"./skeleton-DAvz6Hk5.js";import"./spinner-CItj22uq.js";import"./use-mcp-prompts-DyPVjaKa.js";import"./dialog-ZIc7OUaM.js";import"./X-Car5B1de.js";import"./form-Cd_AEgzv.js";import"./label-BoRKSV_h.js";import"./index-CfjT_Fv-.js";import"./usage-BW6ztpN6.js";import"./ChevronDown-C-3qjfHK.js";import"./Lock01-j13GCiRT.js";import"./use-copy-XD9UDj7l.js";import"./AlertCircle-BWr4XQe9.js";import"./select-Ctls6rHz.js";import"./ChevronUp-Rk5dLXNx.js";import"./index-CRi6734Z.js";import"./Check-DAFdA2oM.js";import"./org-ai-providers-dfJpkNdu.js";import"./useMutation-B_6d8oLI.js";import"./EyeOff-CgRP1cSC.js";import"./Eye-MRRTHIte.js";import"./Key01-Cv0XYLbb.js";import"./card-B6XTMOTf.js";import"./toggle-group-C-kSfPqI.js";import"./avatar-DEdDAQ0j.js";import"./ArrowLeft-GOjXvqCa.js";import"./tabs-kzZLmFuM.js";import"./badge-BTw8dF6C.js";import"./collapsible-CW12HasT.js";import"./index-Bg2XE05Y.js";import"./Code01-CoEt5nyY.js";import"./checkbox-BA_JFbx4.js";import"./AlignLeft-BJyvDaBk.js";import"./Image01-D4-tispo.js";import"./RefreshCcw01-ghOVEWuz.js";import"./SearchMd-Dn4cWwEm.js";import"./Settings01-B3FNPQBg.js";import"./Tool01-3i6uRXKJ.js";import"./use-mcp-resources-CFTlLllB.js";import"./ChevronRight-B3gSyJmK.js";import"./Copy01-D7uh0hW0.js";import"./marked.esm-BaswSlok.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-KZyUYhBW.js";import"./types-DoomhLgW.js";import"./Globe02-CDBspixd.js";import"./LayersTwo01-DdRcHsrK.js";import"./use-collections-DXLoMYCx.js";import"./useSuspenseInfiniteQuery-DD7d1y3B.js";import"./infiniteQueryObserver-BkZg7AVk.js";import"./CheckCircle-BL2mIAJn.js";import"./use-create-virtual-mcp-BvSTYw2n.js";import"./Container-CQmXt7Nc.js";import"./decopilot-events-Brt4gAR6.js";import"./index-DxqOk4x4.js";import"./differenceInSeconds-NQ4PDo0z.js";function K(s){const e=s.trim().split(/\s+/);return e.length!==5?!1:e.every(r=>/^[\d*/,\-]+$/.test(r))}function pt(s){if(!s)return"Unknown schedule";const e=s.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return`Every ${r[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const x=parseInt(o[1]??"1");return x%7===0?`Every ${x/7} weeks`:`Every ${x} days`}const a=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(a){const x=(a[2]??"0").padStart(2,"0"),d=(a[1]??"0").padStart(2,"0");return`Every day at ${x}:${d} UTC`}const h=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(h){const d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(h[3]??"0")]??"day",l=(h[2]??"0").padStart(2,"0"),v=(h[1]??"0").padStart(2,"0");return`Every ${d} at ${l}:${v} UTC`}return s}function ft(s,e){const r=Math.max(1,s);switch(e){case"minutes":return r===1?"* * * * *":`*/${r} * * * *`;case"hours":return r===1?"0 * * * *":`0 */${r} * * *`;case"days":return r===1?"0 0 * * *":`0 0 */${r} * *`;case"weeks":return r===1?"0 0 * * 1":`0 0 */${r*7} * *`}}function xt(s){const e=s.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return{count:parseInt(r[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const a=parseInt(o[1]);return a%7===0?{count:a/7,unit:"weeks"}:{count:a,unit:"days"}}return null}function ht(s,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[s]??s:s}const gt=[{label:"Minute",cron:"* * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}];function yt(s){const e=B.c(26),{automationId:r,open:n,onOpenChange:o,onCustomSelect:a}=s,h=Q(),[x,d]=I.useState(!1),l=n??x;let v;e[0]!==o?(v=C=>{o?o(C):d(C)},e[0]=o,e[1]=v):v=e[1];const f=v;let u;e[2]!==h||e[3]!==r||e[4]!==f?(u=async C=>{try{await h.mutateAsync({automation_id:r,type:"cron",cron_expression:C}),M.success("Starter added"),f(!1)}catch(k){const T=k,D=T instanceof Error?T.message:"Failed to add starter";M.error(D)}},e[2]=h,e[3]=r,e[4]=f,e[5]=u):u=e[5];const N=u;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ke,{asChild:!0,children:t.jsxs(U,{variant:"outline",size:"sm",children:[t.jsx(lt,{size:14}),"Add Starter"]})}),e[6]=m):m=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs(We,{className:"gap-2.5",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every..."]}),e[7]=j):j=e[7];let b;e[8]!==h||e[9]!==N?(b=gt.map(C=>t.jsxs(re,{className:"gap-2.5",onSelect:()=>N(C.cron),disabled:h.isPending,children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every ",C.label]},C.cron)),e[8]=h,e[9]=N,e[10]=b):b=e[10];let i;e[11]!==b?(i=t.jsxs(qe,{children:[j,t.jsx(Ge,{className:"w-[160px]",children:b})]}),e[11]=b,e[12]=i):i=e[12];let p;e[13]!==f||e[14]!==a?(p=()=>{f(!1),a?.()},e[13]=f,e[14]=a,e[15]=p):p=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[16]=_):_=e[16];let g;e[17]!==p?(g=t.jsxs(re,{className:"gap-2.5",onSelect:p,children:[_,"Custom (cron)"]}),e[17]=p,e[18]=g):g=e[18];let y;e[19]!==i||e[20]!==g?(y=t.jsxs(Je,{align:"end",className:"w-[200px]",children:[i,g]}),e[19]=i,e[20]=g,e[21]=y):y=e[21];let S;return e[22]!==f||e[23]!==l||e[24]!==y?(S=t.jsxs(Qe,{open:l,onOpenChange:f,children:[m,y]}),e[22]=f,e[23]=l,e[24]=y,e[25]=S):S=e[25],S}function jt(s){const e=B.c(56),{trigger:r,automationId:n}=s,o=Pe(),a=Q(),[h,x]=I.useState(!1);let d;e[0]!==r.cron_expression?(d=r.cron_expression?xt(r.cron_expression):null,e[0]=r.cron_expression,e[1]=d):d=e[1];const l=d,[v,f]=I.useState(l?.count??1),[u,N]=I.useState(!1),[m,j]=I.useState(r.cron_expression??""),b=o.isPending||a.isPending,i=r.type==="cron";let p;e[2]!==n||e[3]!==o||e[4]!==r.id?(p=async()=>{try{await o.mutateAsync({trigger_id:r.id,automation_id:n}),M.success("Starter removed")}catch{M.error("Failed to remove starter")}x(!1)},e[2]=n,e[3]=o,e[4]=r.id,e[5]=p):p=e[5];const _=p;let g;e[6]!==a||e[7]!==n||e[8]!==m||e[9]!==o||e[10]!==r.cron_expression||e[11]!==r.id?(g=async()=>{const A=m.trim();if(!A||!K(A)||A===r.cron_expression){N(!1),j(r.cron_expression??"");return}try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:A}),await o.mutateAsync({trigger_id:r.id,automation_id:n}),N(!1)}catch{M.error("Failed to update starter"),j(r.cron_expression??""),N(!1)}},e[6]=a,e[7]=n,e[8]=m,e[9]=o,e[10]=r.cron_expression,e[11]=r.id,e[12]=g):g=e[12];const y=g;let S;e[13]!==a||e[14]!==n||e[15]!==l||e[16]!==o||e[17]!==r.cron_expression||e[18]!==r.id?(S=async A=>{if(!l)return;const W=Math.max(1,A),q=ft(W,l.unit);if(q!==r.cron_expression)try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:q}),await o.mutateAsync({trigger_id:r.id,automation_id:n})}catch{M.error("Failed to update starter"),f(l.count)}},e[13]=a,e[14]=n,e[15]=l,e[16]=o,e[17]=r.cron_expression,e[18]=r.id,e[19]=S):S=e[19];const C=S;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[20]=k):k=e[20];let T;e[21]!==v||e[22]!==m||e[23]!==C||e[24]!==y||e[25]!==l||e[26]!==i||e[27]!==u||e[28]!==b||e[29]!==r.cron_expression||e[30]!==r.event_type?(T=l&&i?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Every"}),t.jsx("input",{type:"number",min:1,value:v,onChange:A=>f(parseInt(A.target.value)||1),onBlur:()=>C(v),onKeyDown:A=>{A.key==="Enter"&&A.target.blur(),A.key==="Escape"&&f(l.count)},disabled:b,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus:outline-none focus:ring-1 focus:ring-ring"}),t.jsx("span",{className:"text-sm",children:ht(l.unit,v)})]}):i&&u?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:m,onChange:A=>j(A.target.value),onBlur:y,onKeyDown:A=>{A.key==="Enter"&&A.target.blur(),A.key==="Escape"&&(N(!1),j(r.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),m&&!K(m)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"})]}):t.jsx("span",{className:"text-sm flex-1 font-mono text-xs text-muted-foreground",children:i?pt(r.cron_expression??""):`${r.event_type} event`}),e[21]=v,e[22]=m,e[23]=C,e[24]=y,e[25]=l,e[26]=i,e[27]=u,e[28]=b,e[29]=r.cron_expression,e[30]=r.event_type,e[31]=T):T=e[31];let D;e[32]!==b?(D=b&&t.jsx(G,{size:13,className:"animate-spin text-muted-foreground"}),e[32]=b,e[33]=D):D=e[33];let w;e[34]!==l||e[35]!==i||e[36]!==u||e[37]!==r.cron_expression?(w=i&&!l&&!u&&t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{j(r.cron_expression??""),N(!0)},children:t.jsx(at,{size:13,className:"text-muted-foreground"})}),e[34]=l,e[35]=i,e[36]=u,e[37]=r.cron_expression,e[38]=w):w=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>x(!0),children:t.jsx(Y,{size:13,className:"text-muted-foreground"})}),e[39]=P):P=e[39];let z;e[40]!==D||e[41]!==w?(z=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[D,w,P]}),e[40]=D,e[41]=w,e[42]=z):z=e[42];let E;e[43]!==z||e[44]!==T?(E=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[k,T,z]}),e[43]=z,e[44]=T,e[45]=E):E=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(ue,{children:[t.jsx(fe,{children:"Remove Starter"}),t.jsx(pe,{children:"Are you sure you want to remove this starter?"})]}),e[46]=V):V=e[46];let F;e[47]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(xe,{children:"Cancel"}),e[47]=F):F=e[47];let O;e[48]!==_?(O=t.jsxs(ye,{children:[V,t.jsxs(he,{children:[F,t.jsx(ge,{onClick:_,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),e[48]=_,e[49]=O):O=e[49];let $;e[50]!==h||e[51]!==O?($=t.jsx(je,{open:h,onOpenChange:x,children:O}),e[50]=h,e[51]=O,e[52]=$):$=e[52];let R;return e[53]!==E||e[54]!==$?(R=t.jsxs(t.Fragment,{children:[E,$]}),e[53]=E,e[54]=$,e[55]=R):R=e[55],R}function vt(s){const e=B.c(41),{selectedId:r,onChange:n}=s,[o,a]=I.useState(!1),h=ot();let x,d;e[0]!==h||e[1]!==r?(d=h.filter(bt),x=r?d.find(m=>m.id===r):null,e[0]=h,e[1]=r,e[2]=x,e[3]=d):(x=e[2],d=e[3]);const l=x;if(l){let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ae,{size:16}),e[4]=m):m=e[4];let j;e[5]!==l.icon||e[6]!==l.title?(j=t.jsx(Ee,{icon:l.icon,name:l.title,size:"sm",fallbackIcon:m,className:"rounded-md shrink-0"}),e[5]=l.icon,e[6]=l.title,e[7]=j):j=e[7];let b;e[8]!==l.title?(b=t.jsx("span",{className:"text-sm font-medium truncate",children:l.title}),e[8]=l.title,e[9]=b):b=e[9];let i;e[10]!==j||e[11]!==b?(i=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 flex-1 min-w-0 text-left cursor-pointer",children:[j,b]})}),e[10]=j,e[11]=b,e[12]=i):i=e[12];let p;e[13]!==n?(p=T=>{n(T),a(!1)},e[13]=n,e[14]=p):p=e[14];let _;e[15]!==r||e[16]!==p||e[17]!==d?(_=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(te,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:p})}),e[15]=r,e[16]=p,e[17]=d,e[18]=_):_=e[18];let g;e[19]!==o||e[20]!==i||e[21]!==_?(g=t.jsxs(ie,{open:o,onOpenChange:a,children:[i,_]}),e[19]=o,e[20]=i,e[21]=_,e[22]=g):g=e[22];let y;e[23]!==n?(y=()=>n(null),e[23]=n,e[24]=y):y=e[24];let S;e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Y,{size:13}),e[25]=S):S=e[25];let C;e[26]!==y?(C=t.jsx(U,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 size-7 text-muted-foreground hover:text-foreground",onClick:y,title:"Remove agent",children:S}),e[26]=y,e[27]=C):C=e[27];let k;return e[28]!==C||e[29]!==g?(k=t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border bg-background hover:bg-accent/50 transition-colors",children:[g,C]}),e[28]=C,e[29]=g,e[30]=k):k=e[30],k}let v;e[31]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsxs("div",{className:"relative flex items-center justify-center size-8 rounded-md text-muted-foreground/75 shrink-0",children:[t.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"agent-picker-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[t.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),t.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),t.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),t.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"5.5",stroke:"url(#agent-picker-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),t.jsx(ae,{size:16})]}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"No agent selected. All connections available."})]})}),e[31]=v):v=e[31];let f;e[32]!==n?(f=m=>{n(m),a(!1)},e[32]=n,e[33]=f):f=e[33];let u;e[34]!==r||e[35]!==f||e[36]!==d?(u=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(te,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:f})}),e[34]=r,e[35]=f,e[36]=d,e[37]=u):u=e[37];let N;return e[38]!==o||e[39]!==u?(N=t.jsxs(ie,{open:o,onOpenChange:a,children:[v,u]}),e[38]=o,e[39]=u,e[40]=N):N=e[40],N}function bt(s){return!s.id||!st(s.id)}function _t({automationId:s,automation:e}){const r=Re(),{createTask:n,setVirtualMcpId:o,setSelectedModel:a,setSelectedMode:h,sendMessage:x,credentialId:d,model:l}=ve(),[,v]=me(),f=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[u,N]=I.useState(f),[m,j]=I.useState(f),[b,i]=I.useState(!1),[p,_]=I.useState(!1),[g,y]=I.useState(""),S=Q(),C=I.useRef(!1),k=c=>{N(c),C.current||(C.current=!0,f||j(c))},T=e.models?.credentialId||d||"",D=e.models?.thinking?.id||l?.modelId||"",w=Ne({defaultValues:{name:e.name,active:e.active,agent_id:e.agent?.id??"",credential_id:T,model_id:D}}),P=w.watch("active"),z=w.watch("agent_id"),E=w.watch("credential_id"),V=w.watch("model_id"),{models:F,isLoading:O}=Ae(E||void 0),$=F.find(c=>c.modelId===V)??null,R=async()=>{const c=w.getValues();try{const L=c.credential_id&&c.model_id?c.credential_id:"",X=c.credential_id&&c.model_id?c.model_id:"";return await r.mutateAsync({id:s,name:c.name,active:c.active,agent:{id:c.agent_id,mode:"passthrough"},models:{credentialId:L,thinking:{id:X}},messages:dt(u),temperature:0}),w.reset({...c,credential_id:L,model_id:X}),j(u),M.success("Automation saved"),!0}catch{return M.error("Failed to save automation"),!1}},A=()=>{w.reset(),k(m)},W=w.formState.isDirty||JSON.stringify(u??null)!==JSON.stringify(m??null),q=async()=>{if(W&&!await R())return;if(!u){M.error("No instructions configured for this automation");return}const c=w.getValues();o(c.agent_id||null),h("passthrough"),$&&E&&a({...$,keyId:E}),v(!0),n(),setTimeout(()=>{x(u,{toolApprovalLevel:"yolo"})},0)};return t.jsxs(t.Fragment,{children:[t.jsx(de,{children:t.jsx(De,{onSave:async()=>{await R()},onUndo:A,isDirty:W,isSaving:r.isPending})}),t.jsxs("div",{className:"max-w-2xl mx-auto w-full px-6 py-6 flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(He,{...w.register("name"),placeholder:"Automation name",className:"border-0 shadow-none px-0 text-2xl md:text-2xl font-semibold h-auto focus-visible:ring-0 bg-transparent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Se,{control:w.control,name:"active",render:({field:c})=>t.jsx(Ye,{checked:c.value,onCheckedChange:c.onChange,className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:P?"Active":"Inactive"}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx($e,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Starter"}),t.jsx(yt,{automationId:s,open:b,onOpenChange:i,onCustomSelect:()=>{_(!0),y("")}})]}),e.triggers.length===0&&!p?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["When should this automation run?"," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>i(!0),children:"Add a starter"})," ","to get going."]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(c=>t.jsx(jt,{trigger:c,automationId:s},c.id))}),p&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:g,onChange:c=>y(c.target.value),onBlur:async()=>{const c=g.trim();if(!(!c||!K(c)))try{await S.mutateAsync({automation_id:s,type:"cron",cron_expression:c}),M.success("Starter added"),_(!1),y("")}catch{M.error("Failed to add starter")}},onKeyDown:async c=>{const L=g.trim();c.key==="Enter"&&L&&K(L)&&c.target.blur(),c.key==="Escape"&&(_(!1),y(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),g&&!K(g)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"}),S.isPending&&t.jsx(G,{size:13,className:"animate-spin text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 rounded text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity",onClick:()=>{_(!1),y("")},children:t.jsx(Y,{size:13})})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Agent"}),t.jsx(vt,{selectedId:z||null,onChange:c=>w.setValue("agent_id",c??"",{shouldDirty:!0})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Instructions"}),t.jsx(Te,{tiptapDoc:u,setTiptapDoc:k,placeholder:"What should this automation do?",children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Ie,{virtualMcpId:z||null}),t.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-2.5",children:[t.jsx(Me,{model:$,isLoading:O,credentialId:E||null,onCredentialChange:c=>{w.setValue("credential_id",c??"",{shouldDirty:!0}),w.setValue("model_id","",{shouldDirty:!0})},onModelChange:c=>w.setValue("model_id",c.modelId,{shouldDirty:!0}),placeholder:"Model"}),t.jsxs(Xe,{children:[t.jsx(Ze,{asChild:!0,children:t.jsxs(U,{type:"button",variant:"default",className:"h-8 gap-1.5 rounded-md px-3 text-sm font-medium",onClick:q,children:[t.jsx(it,{size:16}),"Test"]})}),t.jsx(et,{children:"Test Automation"})]})]})]})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Run History"}),t.jsx(Nt,{automationId:s,triggerIds:e.triggers.map(c=>c.id)})]})]})]})}function Ct(s,e,r){const n=B.c(13);let o;n[0]!==s?(o={connectionId:nt,orgId:s},n[0]=s,n[1]=o):o=n[1];const a=rt(o);let h;n[2]!==e||n[3]!==s||n[4]!==r?(h=J.automationRuns(s,e,r),n[2]=e,n[3]=s,n[4]=r,n[5]=h):h=n[5];let x;n[6]!==a||n[7]!==r?(x=async()=>{if(!a)throw new Error("MCP client not available");const v=await a.callTool({name:"COLLECTION_THREADS_LIST",arguments:{where:{trigger_ids:r},limit:20}});return(v.structuredContent??v).items??[]},n[6]=a,n[7]=r,n[8]=x):x=n[8];const d=r.length>0;let l;return n[9]!==h||n[10]!==x||n[11]!==d?(l={queryKey:h,queryFn:x,enabled:d},n[9]=h,n[10]=x,n[11]=d,n[12]=l):l=n[12],tt(l)}function Nt(s){const e=B.c(22),{automationId:r,triggerIds:n}=s,{org:o}=le(),{switchToTask:a}=ve(),[,h]=me(),x=we(),{data:d,isLoading:l}=Ct(o.id,r,n),v=n.length>0;let f;e[0]!==r||e[1]!==o.id||e[2]!==x||e[3]!==d||e[4]!==n?(f=i=>{const p=i.subject,_=d??[];_.find(y=>y.id===p)?x.setQueryData(J.automationRuns(o.id,r,n),_.map(y=>y.id===p?{...y,status:i.data.status,updated_at:new Date().toISOString()}:y)):x.invalidateQueries({queryKey:J.automationRuns(o.id,r,n)})},e[0]=r,e[1]=o.id,e[2]=x,e[3]=d,e[4]=n,e[5]=f):f=e[5];let u;if(e[6]!==o.id||e[7]!==v||e[8]!==f?(u={orgId:o.id,enabled:v,onTaskStatus:f},e[6]=o.id,e[7]=v,e[8]=f,e[9]=u):u=e[9],mt(u),l){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(G,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=i):i=e[10],i}if(!d||d.length===0){let i;return e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ce,{image:null,className:"mt-6",title:"No run history",description:"Run history will appear here when the automation has been triggered."}),e[11]=i):i=e[11],i}let N;e[12]!==h||e[13]!==a?(N=async i=>{await a(i),h(!0)},e[12]=h,e[13]=a,e[14]=N):N=e[14];const m=N;let j;if(e[15]!==m||e[16]!==d){let i;e[18]!==m?(i=p=>{const _=ee[p.status]??ee.completed,g=_.icon;return t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-1 py-2.5 text-left hover:bg-accent/50 transition-colors cursor-pointer rounded-sm",onClick:()=>m(p.id),children:[t.jsx(g,{size:16,className:_.iconClassName}),t.jsx("span",{className:"flex-1 min-w-0 text-sm truncate",children:p.title}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:ut(new Date(p.updated_at),{addSuffix:!0})})]},p.id)},e[18]=m,e[19]=i):i=e[19],j=d.map(i),e[15]=m,e[16]=d,e[17]=j}else j=e[17];let b;return e[20]!==j?(b=t.jsx("div",{className:"flex flex-col divide-y divide-border",children:j}),e[20]=j,e[21]=b):b=e[21],b}function or(){const s=B.c(36);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{automationId:r}=be(e),n=_e(),{org:o}=le(),{data:a,isLoading:h}=ze(r),x=Oe(),[d,l]=I.useState(!1);let v;s[1]!==r||s[2]!==x||s[3]!==n||s[4]!==o?(v=async()=>{try{await x.mutateAsync(r),M.success("Automation deleted"),n({to:"/$org/$project/automations",params:{org:o.slug,project:Z}})}catch{M.error("Failed to delete automation")}l(!1)},s[1]=r,s[2]=x,s[3]=n,s[4]=o,s[5]=v):v=s[5];const f=v;if(h){let D;return s[6]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(G,{size:24,className:"animate-spin text-muted-foreground"})}),s[6]=D):D=s[6],D}if(!a){let D;return s[7]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(ce,{title:"Automation not found",description:"This automation may have been deleted."}),s[7]=D):D=s[7],D}let u;s[8]!==o.slug?(u=t.jsx(se,{children:t.jsx(Ve,{asChild:!0,children:t.jsx(Ce,{to:"/$org/$project/automations",params:{org:o.slug,project:Z},children:"Automations"})})}),s[8]=o.slug,s[9]=u):u=s[9];let N;s[10]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Le,{}),s[10]=N):N=s[10];let m;s[11]!==a.name?(m=t.jsx(se,{children:t.jsx(Fe,{children:a.name})}),s[11]=a.name,s[12]=m):m=s[12];let j;s[13]!==u||s[14]!==m?(j=t.jsx(Ue,{children:t.jsxs(Be,{children:[u,N,m]})}),s[13]=u,s[14]=m,s[15]=j):j=s[15];const b=j;let i;s[16]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(de,{children:t.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 text-destructive hover:text-destructive",onClick:()=>l(!0),children:[t.jsx(ct,{size:14}),"Delete"]})}),s[16]=i):i=s[16];let p;s[17]!==a||s[18]!==r?(p=t.jsx(_t,{automationId:r,automation:a},r),s[17]=a,s[18]=r,s[19]=p):p=s[19];let _;s[20]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(fe,{children:"Delete Automation"}),s[20]=_):_=s[20];let g;s[21]!==a.name?(g=t.jsxs(ue,{children:[_,t.jsxs(pe,{children:['Are you sure you want to delete "',a.name,'"? This action cannot be undone.']})]}),s[21]=a.name,s[22]=g):g=s[22];let y;s[23]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(xe,{children:"Cancel"}),s[23]=y):y=s[23];let S;s[24]!==f?(S=t.jsxs(he,{children:[y,t.jsx(ge,{onClick:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),s[24]=f,s[25]=S):S=s[25];let C;s[26]!==S||s[27]!==g?(C=t.jsxs(ye,{children:[g,S]}),s[26]=S,s[27]=g,s[28]=C):C=s[28];let k;s[29]!==d||s[30]!==C?(k=t.jsx(je,{open:d,onOpenChange:l,children:C}),s[29]=d,s[30]=C,s[31]=k):k=s[31];let T;return s[32]!==b||s[33]!==k||s[34]!==p?(T=t.jsxs(ke,{breadcrumb:b,children:[i,p,k]}),s[32]=b,s[33]=k,s[34]=p,s[35]=T):T=s[35],T}export{or as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as S,u as _,r as B,O as u,j as e,B as p,y as $,v as h}from"./index-
|
|
1
|
+
import{e as S,u as _,r as B,O as u,j as e,B as p,y as $,v as h}from"./index-OyLnxARk.js";import{C as I}from"./collection-search-D6ILFEtf.js";import{E as L}from"./empty-state-gZUVmgL7.js";import{P as l}from"./index-DKWOGpkx.js";import{u as M,a as E,b as H}from"./use-automations-D5ELbflL.js";import{u as O}from"./use-list-state-CVKHwo0P.js";import{U as R}from"./user-BLAfg6Ev.js";import{f as F,a as K,b as U,c as G,d as J,e as V,A as q,h as Q}from"./alert-dialog-BZtQAioB.js";import{B as W}from"./badge-BTw8dF6C.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-CcE89MsN.js";import{D as te,a as se,b as re,c as C}from"./dropdown-menu-EcTFyr4x.js";import{T as ae,a as oe,b as w,c as ie,d as ne,e as c}from"./table-DHN8Pbh9.js";import{n as le}from"./ArrowDown-BPMtK04S.js";import{i as ce}from"./ArrowUp-DqOjcDuh.js";import{i as de}from"./DotsVertical-D5tMnzaQ.js";import{s as me}from"./Eye-MRRTHIte.js";import{i as x}from"./Loading01-BYjTtpy0.js";import{s as A}from"./Plus-1vH_gFoY.js";import{s as ue}from"./Trash01-Dmi4vR7Q.js";import"./SearchMd-Dn4cWwEm.js";import"./input-B4YrZuiK.js";import"./useQuery-Brtj4EoG.js";import"./useMutation-B_6d8oLI.js";import"./tooltip--UA5heKX.js";import"./index-CRi6734Z.js";import"./constants-CLw0F8Mm.js";import"./use-view-mode-CGzXYNrX.js";import"./use-mobile-CgJAXGMs.js";import"./avatar-DEdDAQ0j.js";import"./ChevronRight-B3gSyJmK.js";import"./Check-DAFdA2oM.js";function Ue(){const g=S(),{org:j,locator:D}=_(),{data:a,isLoading:k}=M(),i=E(),T=H(),[d,m]=B.useState(null),s=O({namespace:j.slug,resource:"automations",defaultViewMode:"table"}),f=D.split("/")[0]??j.slug??u,b=async()=>{try{const t=await i.mutateAsync({name:"New Automation",agent:{id:"",mode:"passthrough"},messages:[],models:{credentialId:"",thinking:{id:""}},temperature:.5,active:!0});g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:t.id}})}catch{h.error("Failed to create automation")}},P=async()=>{if(d)try{await T.mutateAsync(d.id),h.success("Automation deleted")}catch{h.error("Failed to delete automation")}finally{m(null)}},N=t=>{g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:t}})},v=(a??[]).filter(t=>s.searchTerm?t.name.toLowerCase().includes(s.searchTerm.toLowerCase()):!0).sort((t,r)=>{if(!s.sortDirection)return 0;const n=s.sortDirection==="asc"?1:-1,o=s.sortKey;return o==="name"?t.name.localeCompare(r.name)*n:o==="active"?((t.active?1:0)-(r.active?1:0))*n:o==="trigger_count"?((t.trigger_count??0)-(r.trigger_count??0))*n:0}),z="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider group transition-colors select-none";return e.jsxs(l,{children:[e.jsxs(l.Header,{children:[e.jsx(l.Header.Left,{children:e.jsx(X,{children:e.jsx(Y,{children:e.jsx(Z,{children:e.jsxs(ee,{className:"flex items-center gap-2",children:["Automations",a&&a.length>0&&e.jsxs("span",{className:"text-xs font-normal text-muted-foreground tabular-nums",children:[a.length," total"]})]})})})})}),e.jsx(l.Header.Right,{children:e.jsxs(p,{size:"sm",onClick:b,disabled:i.isPending,children:[i.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),"Create Automation"]})})]}),e.jsx(I,{value:s.search,onChange:s.setSearch,placeholder:"Search automations...",onKeyDown:t=>{t.key==="Escape"&&(s.setSearch(""),t.target.blur())}}),e.jsxs(l.Content,{children:[k?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(x,{size:24,className:"animate-spin text-muted-foreground"})}):!a||a.length===0?e.jsx("div",{className:"flex items-center h-full",children:e.jsx(L,{title:"No automations yet",description:"Automations run tasks on a schedule or in response to events.",actions:e.jsxs(p,{size:"sm",onClick:b,disabled:i.isPending,children:[i.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),"Create Automation"]})})}):e.jsxs(ae,{className:"w-full border-collapse",children:[e.jsx(oe,{className:"border-b-0",children:e.jsx(w,{className:"h-9 hover:bg-transparent border-b border-border",children:[{id:"name",label:"Name",className:"flex-1 min-w-0 cursor-pointer hover:bg-accent"},{id:"active",label:"Status",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"trigger_count",label:"Triggers",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"created_by",label:"Created by",className:"w-40 shrink-0"},{id:"_actions",label:"",className:"w-12 shrink-0"}].map(({id:t,label:r,className:n})=>{const o=s.sortKey===t,y=t!=="created_by"&&t!=="_actions";return e.jsx(ie,{className:$(z,n),onClick:y?()=>s.handleSort(t):void 0,children:e.jsxs("span",{className:"flex items-center gap-1",children:[r,y&&e.jsxs("span",{className:"w-4 flex items-center justify-center",children:[o&&s.sortDirection==="asc"&&e.jsx(ce,{size:12,className:"text-muted-foreground"}),o&&s.sortDirection==="desc"&&e.jsx(le,{size:12,className:"text-muted-foreground"})]})]})},t)})})}),e.jsx(ne,{children:v.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"py-16 text-center",children:e.jsxs("span",{className:"text-sm text-muted-foreground",children:['No automations match "',s.search,'"']})})}):v.map(t=>e.jsxs(w,{className:"group/data-row border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>N(t.id),children:[e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm font-medium text-foreground flex-1 min-w-0",children:t.name}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-24 shrink-0",children:e.jsx(W,{variant:t.active?"default":"secondary",children:t.active?"Active":"Inactive"})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm text-muted-foreground w-24 shrink-0",children:t.trigger_count}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-40 shrink-0",children:e.jsx(R,{id:t.created_by})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-12 shrink-0",children:e.jsxs(te,{children:[e.jsx(se,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:r=>r.stopPropagation(),children:e.jsx(de,{size:20})})}),e.jsxs(re,{align:"end",onClick:r=>r.stopPropagation(),children:[e.jsxs(C,{onClick:r=>{r.stopPropagation(),N(t.id)},children:[e.jsx(me,{size:16}),"Open"]}),e.jsxs(C,{variant:"destructive",onClick:r=>{r.stopPropagation(),m({id:t.id,name:t.name})},children:[e.jsx(ue,{size:16}),"Delete"]})]})]})})]},t.id))})]}),e.jsx(F,{open:!!d,onOpenChange:t=>!t&&m(null),children:e.jsxs(K,{children:[e.jsxs(U,{children:[e.jsx(G,{children:"Delete Automation?"}),e.jsxs(J,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:d?.name}),". All triggers will be removed."]})]}),e.jsxs(V,{children:[e.jsx(q,{children:"Cancel"}),e.jsx(Q,{onClick:P,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})]})}export{Ue as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as R,c as j,j as i,y as m,_ as I,aZ as U,a_ as L,a$ as M}from"./index-
|
|
1
|
+
import{r as R,c as j,j as i,y as m,_ as I,aZ as U,a_ as L,a$ as M}from"./index-OyLnxARk.js";const V=({size:a=24,color:e="currentColor",...s})=>R.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},R.createElement("path",{d:"M20 21c0-1.396 0-2.093-.172-2.661a4 4 0 0 0-2.667-2.667c-.568-.172-1.265-.172-2.661-.172h-5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C4 18.907 4 19.604 4 21M16.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));V.displayName="User01";function O(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(M,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function _(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(U,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function T(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(L,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}const S=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],W="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function Z(a){let e=0;for(let t=0;t<a.length;t++)e=a.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%S.length;return S[s]}const $=I("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),B=I("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=a=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[a]||e.base};function G(a){const e=j.c(35);let s,t,o,r,n,d,g,l;e[0]!==a?({url:l,fallback:t,shape:r,size:n,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,[f,x]=R.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let y;e:{if(k){y=W;break e}if(typeof t=="string"){let c;e[11]!==t?(c=Z(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=S[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m($({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==C||e[24]!==E||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",z),children:i.jsx(V,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(_,{src:l,loading:"lazy",alt:"Avatar",className:m(B({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(T,{className:m(z,"rounded-none"),children:C})]}),e[22]=z,e[23]=C,e[24]=E,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(O,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function H(a){const e=j.c(18);let s,t,o,r,n,d,g,l;e[0]!==a?({shape:r,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==k||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(G,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:k,...o}),e[9]=s,e[10]=t,e[11]=k,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}H.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m($({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{H as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,y as u,j as l,U as v,_ as g}from"./index-
|
|
1
|
+
import{c as d,y as u,j as l,U as v,_ as g}from"./index-OyLnxARk.js";const b=g("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function x(o){const e=d.c(12);let r,s,a,t;e[0]!==o?({className:r,variant:t,asChild:a,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=t):(r=e[1],s=e[2],a=e[3],t=e[4]);const c=(a===void 0?!1:a)?v:"span";let i;e[5]!==r||e[6]!==t?(i=u(b({variant:t}),r),e[5]=r,e[6]=t,e[7]=i):i=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==i?(n=l.jsx(c,{"data-slot":"badge",className:i,...s}),e[8]=c,e[9]=s,e[10]=i,e[11]=n):n=e[11],n}export{x as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-OyLnxARk.js";function a(o){return{isImplementedBy:c=>{for(const e of o){const r=typeof e.name=="string"?new RegExp(`^${e.name}$`):e.name,t=c.find(i=>r.test(i.name));if(!(!t&&e.opt)&&!t)return!1}return!0}}}function s(o,c){const e=o.tools;if(!e||e.length===0)return!1;const r=e.map(n=>({name:n.name,inputSchema:n.inputSchema})),t=c.map(n=>({name:n.name,inputSchema:n.inputSchema,opt:n.opt}));return a(t).isImplementedBy(r)}export{a,s as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,y as m,j as o,U as u}from"./index-
|
|
1
|
+
import{c,y as m,j as o,U as u}from"./index-OyLnxARk.js";import{i as d}from"./ChevronRight-B3gSyJmK.js";function b(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("min-w-0 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function x(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("ol",{"data-slot":"breadcrumb-list",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function N(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("inline-flex items-center gap-1.5 min-w-0",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("li",{"data-slot":"breadcrumb-item",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function g(r){const e=c.c(10);let a,t,s;e[0]!==r?({asChild:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);const l=a?u:"a";let i;e[4]!==t?(i=m("hover:text-foreground transition-colors truncate",t),e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==l||e[7]!==s||e[8]!==i?(n=o.jsx(l,{"data-slot":"breadcrumb-link",className:i,...s}),e[6]=l,e[7]=s,e[8]=i,e[9]=n):n=e[9],n}function j(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("text-foreground font-medium truncate",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function h(r){const e=c.c(12);let a,t,s;e[0]!==r?({children:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);let l;e[4]!==t?(l=m("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",t),e[4]=t,e[5]=l):l=e[5];let i;e[6]!==a?(i=a??o.jsx(d,{}),e[6]=a,e[7]=i):i=e[7];let n;return e[8]!==s||e[9]!==l||e[10]!==i?(n=o.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...s,children:i}),e[8]=s,e[9]=l,e[10]=i,e[11]=n):n=e[11],n}export{b as B,x as a,N as b,j as c,g as d,h as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,y as c,j as d}from"./index-
|
|
1
|
+
import{c as l,y as c,j as d}from"./index-OyLnxARk.js";function x(a){const e=l.c(8);let r,s;e[0]!==a?({className:r,...s}=a,e[0]=a,e[1]=r,e[2]=s):(r=e[1],s=e[2]);let o;e[3]!==r?(o=c("bg-card text-card-foreground hover:bg-accent/50 flex flex-col gap-6 rounded-xl border border-border shadow-xs",r),e[3]=r,e[4]=o):o=e[4];let t;return e[5]!==s||e[6]!==o?(t=d.jsx("div",{"data-slot":"card",className:o,...s}),e[5]=s,e[6]=o,e[7]=t):t=e[7],t}export{x as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,y as n,j as c,ak as l,al as m}from"./index-
|
|
1
|
+
import{c as d,y as n,j as c,ak as l,al as m}from"./index-OyLnxARk.js";import{i as b}from"./Check-DAFdA2oM.js";function x(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=n("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(m,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(l,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{x as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,c as i,j as r}from"./index-
|
|
1
|
+
import{r as l,c as i,j as r}from"./index-OyLnxARk.js";import{R as a,C as n,a as c}from"./index-Bg2XE05Y.js";const p=({size:o=24,color:e="currentColor",...t})=>l.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},l.createElement("path",{d:"M4 7h11m0 0-4 4m4-4-4-4M4 17h16m0 0-4 4m4-4-4-4"}));p.displayName="ArrowsRight";const m=({size:o=24,color:e="currentColor",...t})=>l.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},l.createElement("path",{d:"M10 17.659V20a2 2 0 1 0 4 0v-2.341M12 2v1m-9 9H2m3.5-6.5-.6-.6m13.6.6.6-.6M22 12h-1m-3 0a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"}));m.displayName="Lightbulb02";function u(o){const e=i.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let s;return e[2]!==t?(s=r.jsx(a,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=s):s=e[3],s}function f(o){const e=i.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let s;return e[2]!==t?(s=r.jsx(n,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function g(o){const e=i.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let s;return e[2]!==t?(s=r.jsx(c,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{u as C,m as a,f as b,g as c,p as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bi as oe,r as k,o as Zs,n as Tt,c as N,j as o,E as En,u as Q,t as Ys,y as A,_ as eo,g as ge,d as to,J as nt,O as st,B as X,v as On,bQ as J,ci as no,cj as so,b0 as oo,a2 as Vt,a5 as fe,a7 as Rn,b1 as ro,a0 as Ut,b2 as io,b3 as An,a3 as Mn,b4 as lo,b5 as co,a8 as Pn,b7 as ao,ck as Bt,cl as uo,ad as fo,bd as mo,$ as po,w as xo,cm as ho,cn as go,co as Ln}from"./index-B_DxRVw1.js";import{E as Dn}from"./empty-state-DsQ7yRoE.js";import{d as qt,u as Kt}from"./use-collections-aokT1D_C.js";import{u as re,g as Ke,i as bo}from"./constants-CKGlP4oN.js";import{F as $t,a as jo,b as Jt,d as Gt}from"./form-CZrleug2.js";import{I as Xt}from"./input-DqwWeNgs.js";import{T as Dt}from"./textarea-BDS2584p.js";import{V as zn,b as Wn,a as ve}from"./layout-CDyeWvbl.js";import{S as Fn}from"./save-actions-ChdDeTz6.js";import{M as vo}from"./mcp-app-renderer-D7CJTHIn.js";import{g as So,M as gn}from"./types-BnNswHwQ.js";import{S as Hn,a as Vn,b as Un,c as Bn,d as ot}from"./select-BM9jpLT2.js";import{c as Qt,T as rt,a as it,b as lt}from"./tooltip-Bm11lCIm.js";import{i as yo}from"./AlertCircle-PBJUtpjc.js";import{s as wo}from"./Clock-Bwl2wOhM.js";import{i as bn}from"./Code01-DygQPwlG.js";import{a as No}from"./Copy01-ekqsSfJN.js";import{s as Co}from"./LayersTwo01-8gQGsURS.js";import{i as mt}from"./Loading01-Dt16NixZ.js";import{i as Zt}from"./Play-WAyK_VUq.js";import{B as qn,a as Kn,b as We,d as ct,e as at,c as Jn}from"./breadcrumb-BhQI8Xw3.js";import{u as ko,O as Io,M as _o,F as To,v as $o,n as Et}from"./index-cEL2CgNm.js";import{u as pt,b as Eo}from"./use-connection-DA77pjoV.js";import{d as Yt,b as en,a as tn}from"./use-mcp-tools-C3Vj1u8m.js";import{c as Oo}from"./content-blocks-o63cs2vh.js";import{I as xt}from"./integration-icon-Dv0HduyT.js";import{T as Ro}from"./tools-list-DO_G3ceo.js";import{u as Ao,c as Mo}from"./context-ow-zK3BP.js";import{u as Po}from"./index-CsqngJxb.js";import{M as Fe,n as Lo}from"./monaco-editor-Dgc89AWr.js";import{E as nn}from"./empty-state-CsEI90cv.js";import{n as Do}from"./Container-BeAIfNvy.js";import{b as Gn}from"./use-virtual-mcp-FAfRsySa.js";import{b as zo,R as jn,a as Wo}from"./resizable-DXBCOl3J.js";import{B as he}from"./badge-BfLRgdaW.js";import{S as ht}from"./spinner-tJ67zxkj.js";import{V as Fo}from"./collection-display-button-D7NovPlc.js";import{N as Ho,S as Vo,a as Uo,c as Bo,m as et,P as qo,i as Ko,R as Jo,u as Go,b as Xo,d as vn,E as Qo,e as Zo}from"./index-CVyJGNS2.js";import{d as Yo}from"./registry-utils--TC_kKCq.js";import{b as er,D as tr,a as nr,e as sr,c as or,d as rr}from"./dialog-COv8XUO0.js";import"./index-sEMWxAyS.js";import{s as Xn}from"./Plus-DN4FtVmx.js";import{i as gt}from"./Check-Bme4aNg5.js";import{i as ir}from"./DotsHorizontal-BYFCLgks.js";import{a as lr}from"./Tool01-xNX6v26H.js";import{s as sn}from"./XClose-hdsxwv2G.js";import{D as cr,a as ar,b as dr,c as Sn}from"./dropdown-menu-Cr1iKfFo.js";import{T as ur,R as fr,b as mr,c as Qn}from"./index-Bc75bxbq.js";import{i as pr}from"./ChevronRight-Ct9VK1GH.js";import{a as xr,S as hr}from"./scroll-area-ACn8ZLYT.js";import"./index-iqPDmcBY.js";import{i as Zn}from"./X-CxZVsh3L.js";import"./useMutation-d1AXy22c.js";import"./label--AQoxbpU.js";import"./Save01-BCInJWrH.js";import"./use-mcp-resources-CFkkQw1d.js";import"./useQuery-B8Io0Oda.js";import"./ChevronUp-B5BOcmGB.js";import"./index-DRLd-piX.js";import"./ChevronDown-jyPVRLzp.js";import"./File06-Ba0KxpWu.js";import"./Key01-CdH7i8vY.js";import"./constants-DqZ0hFNm.js";import"./extract-connection-data-D46U8dB4.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-C_csgcCs.js";import"./index-CT-515LV.js";import"./index-B23wyLB_.js";import"./select-virtual-mcp-DzKjKtT5.js";import"./popover-DOnHuwq3.js";import"./SearchMd-BQseJVRu.js";import"./Users03-rAyzQyh3.js";import"./use-create-virtual-mcp-Dd303mOp.js";import"./collection-search-DDX1Zkg7.js";import"./collection-table-wrapper-YGokzak8.js";import"./table-BOA7X4H8.js";import"./ArrowDown-LiBnMzQV.js";import"./ArrowUp-WIHiBhdv.js";import"./card-B8QXMrj8.js";import"./Eye-DN-kY_sb.js";import"./Globe02-CB2InS06.js";import"./decopilot-events-Brt4gAR6.js";import"./Grid01-BvWQ72pJ.js";import"./List-BU70NJSh.js";import"./binder-B5Q0NNkg.js";const Yn=oe("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const es=oe("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const on=oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rn=oe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const gr=oe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const br=oe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const jr=oe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ts=oe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ns=oe("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const ss=oe("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const vr=oe("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const os=oe("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const rs=oe("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),ln=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));ln.displayName="AlertOctagon";const is=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));is.displayName="Box";const ls=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));ls.displayName="ClockFastForward";const cs=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));cs.displayName="Code02";const as=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));as.displayName="CornerDownRight";const ds=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));ds.displayName="Database01";const us=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M3 3v10.2c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 18 6.12 18 7.8 18H15m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0ZM3 8h12m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0Z"}));us.displayName="GitBranch01";const fs=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));fs.displayName="Repeat03";const ms=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}),k.createElement("path",{d:"M8 9.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 8 9.04 8 9.6 8h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 8.76 16 9.04 16 9.6v4.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C15.24 16 14.96 16 14.4 16H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 15.24 8 14.96 8 14.4V9.6Z"}));ms.displayName="StopCircle";Zs({title:Tt().min(1),description:Tt().nullable(),body:Tt()});function Ot(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Sr(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function yr(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx($t,{control:n.control,name:"title",render:Cr}),o.jsx($t,{control:n.control,name:"description",render:Nr})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx($t,{control:n.control,name:"body",render:wr})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.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:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(jo,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function wr(t){const{field:e}=t;return o.jsx(Jt,{children:o.jsx(Gt,{children:o.jsx(Dt,{...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 Nr(t){const{field:e}=t;return o.jsxs(Jt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(Gt,{children:o.jsx(Xt,{...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 Cr(t){const{field:e}=t;return o.jsxs(Jt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(Gt,{children:o.jsx(Xt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function kr(t){const e=N.c(35),{providerId:n,promptId:s}=t,{org:i}=Q(),r=n||null;let l;e[0]!==i.id||e[1]!==r?(l={connectionId:r,orgId:i.id},e[0]=i.id,e[1]=r,e[2]=l):l=e[2];const c=re(l),a=qt(n,"PROMPT",s,c),d=Kt(n,"PROMPT",c),u=d.update.isPending;let f;e[3]!==a?(f=a?{title:a.title,description:a.description??null,body:Ot(a)}:void 0,e[3]=a,e[4]=f):f=e[4];let m;e[5]!==f?(m={values:f},e[5]=f,e[6]=m):m=e[6];const x=Ys(m);let p;e[7]!==x||e[8]!==a?(p=()=>{a&&x.reset({title:a.title,description:a.description??null,body:Ot(a)})},e[7]=x,e[8]=a,e[9]=p):p=e[9];const h=p;let g;e[10]!==d.update||e[11]!==x||e[12]!==s?(g=x.handleSubmit(async _=>{const O=await d.update.mutateAsync({id:s,data:{title:_.title,description:_.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:_.body}}]}});x.reset({title:O.title,description:O.description??null,body:Ot(O)})}),e[10]=d.update,e[11]=x,e[12]=s,e[13]=g):g=e[13];const b=g;if(!a){let _;return e[14]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Dn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=_):_=e[14],_}let j;e[15]!==a.title?(j=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[15]=a.title,e[16]=j):j=e[16];let S;e[17]!==a.description?(S=a.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[17]=a.description,e[18]=S):S=e[18];let y;e[19]!==j||e[20]!==S?(y=o.jsx(Wn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[j,S]})}),e[19]=j,e[20]=S,e[21]=y):y=e[21];let v;e[22]!==b?(v=()=>{b()},e[22]=b,e[23]=v):v=e[23];let w;e[24]!==x.formState.isDirty||e[25]!==u||e[26]!==h||e[27]!==v?(w=o.jsx(zn,{children:o.jsx(Fn,{onSave:v,onUndo:h,isDirty:x.formState.isDirty,isSaving:u})}),e[24]=x.formState.isDirty,e[25]=u,e[26]=h,e[27]=v,e[28]=w):w=e[28];let C;e[29]!==x?(C=o.jsx("div",{className:"h-full",children:o.jsx(yr,{form:x})}),e[29]=x,e[30]=C):C=e[30];let $;return e[31]!==w||e[32]!==C||e[33]!==y?($=o.jsxs(ve,{children:[y,w,C]}),e[31]=w,e[32]=C,e[33]=y,e[34]=$):$=e[34],$}function Ir(t){const e=N.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Sr(),e[0]=s):s=e[0];const i=s;if(!i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Dn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let r;return e[2]!==n?(r=o.jsx(En,{children:o.jsx(k.Suspense,{fallback:null,children:o.jsx(kr,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const _r=eo("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Tr(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=A(_r({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function $r(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=A("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Er(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=A("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const Or=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Rr(t){const e=N.c(9),{toolName:n,connectionId:s,onBack:i}=t;let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const l=ko(r);if(!l.isAuthenticated){let d;return e[2]!==l.supportsOAuth||e[3]!==i?(d=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(Io,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(_o,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=d):d=e[4],d}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==c||e[7]!==n?(a=o.jsx(Ar,{toolName:n,connectionId:s},c),e[5]=s,e[6]=c,e[7]=n,e[8]=a):a=e[8],a}function Ar({toolName:t,connectionId:e}){const{replayId:n}=to({strict:!1}),s=(()=>{if(!n)return null;const T=`replay-${n}`,R=sessionStorage.getItem(T);if(!R)return null;sessionStorage.removeItem(T);try{return JSON.parse(R)}catch{return null}})(),i=(()=>{if(!s)return null;const T={};for(const[R,P]of Object.entries(s))P!==null&&typeof P=="object"?T[R]=JSON.stringify(P,null,2):T[R]=P;return T})(),[r,l]=k.useState(i??{}),[c,a]=k.useState(s?JSON.stringify(s,null,2):"{}"),[d,u]=k.useState(null),[f,m]=k.useState(null),[x,p]=k.useState(null),[h,g]=k.useState(null),[b,j]=k.useState(!1),[S,y]=k.useState(null),{org:v}=Q(),w=pt(e),{sendMessage:C,setAppContext:$,clearAppContext:_}=Ao(),[,O]=Po(),M=`${e}:${t}`,D=re({connectionId:e,orgId:v.id}),I=Yt({client:D}),E=I.data?.tools?.find(T=>T.name===t),z=So(E?._meta),H=T=>{const R=Oo(T.content);R.content.length>0&&(O(!0),C(R))},[G,U]=k.useState("json"),[V,Z]=k.useState(!1);z&&!V&&(U("ui"),Z(!0));const ie=E?.inputSchema?.properties,Y=ie?Object.keys(ie):[],W=Y.length>0,B={};if(W&&E?.inputSchema?.properties)for(const T of Y)B[T]=E.inputSchema.required?.includes(T)?"":void 0;const q=T=>Object.prototype.hasOwnProperty.call(r,T),ee=async()=>{j(!0),g(null),u(null),m(null),p(null),y(null);const T=performance.now();try{if(!D)throw new Error("MCP client is not available");const R=W?{...B,...r}:(()=>{const de=c.trim();if(!de)return{};const ue=JSON.parse(de);if(ue&&typeof ue=="object")return ue;throw new Error("Raw JSON input must be an object.")})();W&&E?.inputSchema?.properties&&Object.entries(E.inputSchema.properties).forEach(([de,ue])=>{if((ue.type==="object"||ue.type==="array")&&typeof R[de]=="string")try{R[de]=JSON.parse(R[de])}catch{}});const P=await D.callTool({name:t,arguments:R}),F=P.structuredContent??P,be=performance.now(),Ze=Math.round(be-T);u(F),m(P),p(R);const Ue=JSON.stringify(F),xe=new TextEncoder().encode(Ue).length;y({duration:`${Ze}ms`,bytes:`${xe} bytes`,tokens:`~${Math.ceil(xe/4)} tokens`,cost:"$0.0000"})}catch(R){const P=R instanceof Error?R.message:String(R);g(P||"Unknown error occurred");const F=performance.now();y({duration:`${Math.round(F-T)}ms`})}finally{j(!1)}},te=(T,R)=>{l(P=>({...P,[T]:R}))},le=()=>{u(null),m(null),p(null),g(null),y(null)},ce=E?.name??Or(t),se=o.jsx(qn,{children:o.jsxs(Kn,{children:[o.jsx(We,{children:o.jsx(ct,{asChild:!0,children:o.jsx(nt,{to:"/$org/$project/mcps",params:{org:v.slug,project:st},children:"Connections"})})}),o.jsx(at,{}),w&&o.jsxs(o.Fragment,{children:[o.jsx(We,{children:o.jsx(ct,{asChild:!0,children:o.jsx(nt,{to:"/$org/$project/mcps/$connectionId",params:{org:v.slug,project:st,connectionId:e},search:{tab:"tools"},children:w.title})})}),o.jsx(at,{})]}),o.jsx(We,{children:o.jsx(Jn,{children:ce})})]})});return o.jsx(ve,{breadcrumb:se,children:o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[30%_70%] h-full",children:[o.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:o.jsxs("div",{className:"flex-1 overflow-auto",children:[o.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(xt,{icon:w?.icon||null,name:w?.title||t,size:"sm",className:"shadow-sm shrink-0"}),o.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[I.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):I.isLoading?o.jsx(mt,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:I.isSuccess?"ready":I.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:E?.description||"No description available"})]})}),o.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),E?.inputSchema?.required&&E.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:W&&E?.inputSchema?.properties?Object.entries(E.inputSchema.properties).map(([T,R])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[T,E.inputSchema?.required?.includes(T)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:R.type})]}),R.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:R.description}),R.type==="object"||R.type==="array"?o.jsx(Dt,{className:"font-mono text-xs",value:q(T)?r[T]??"":B[T]??"",onChange:P=>te(T,P.target.value),placeholder:`Enter ${T} as JSON...`,rows:3}):R.type==="boolean"?o.jsxs(Hn,{value:q(T)?String(r[T]??""):"",onValueChange:P=>te(T,P==="true"),children:[o.jsx(Vn,{children:o.jsx(Un,{placeholder:"Select true or false..."})}),o.jsxs(Bn,{children:[o.jsx(ot,{value:"true",children:"true"}),o.jsx(ot,{value:"false",children:"false"})]})]}):o.jsx(Xt,{value:q(T)?r[T]??"":B[T]??"",onChange:P=>te(T,P.target.value),placeholder:`Enter ${T}...`})]},T)):E?.inputSchema&&!W?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(Dt,{className:"font-mono text-xs min-h-[120px]",value:c,onChange:T=>a(T.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),o.jsx(Ro,{annotations:E?.annotations,_meta:E?._meta})]}),S&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(wo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.duration})]}),S.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(is,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.tokens})]}),S.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(ds,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.bytes})]}),S.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:S.cost})})]})]}),o.jsxs("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:[o.jsx("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:b?o.jsxs(X,{size:"sm",variant:"destructive",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:le,children:[o.jsx(ms,{className:"h-3.5 w-3.5"}),"Cancel"]}):o.jsxs(X,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:ee,children:[o.jsx(Zt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),z&&o.jsx(Qt,{children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(rt,{children:[o.jsx(it,{asChild:!0,children:o.jsx(X,{size:"icon",variant:G==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>U("ui"),children:o.jsx(Co,{size:14})})}),o.jsx(lt,{children:"Interactive view"})]}),o.jsxs(rt,{children:[o.jsx(it,{asChild:!0,children:o.jsx(X,{size:"icon",variant:G==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>U("json"),children:o.jsx(bn,{size:14})})}),o.jsx(lt,{children:"JSON view"})]})]})})]}),h&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(Tr,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(yo,{className:"h-4 w-4"}),o.jsx($r,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(Er,{className:"text-xs text-destructive",children:h})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:z&&G==="ui"&&D?o.jsx(k.Suspense,{fallback:o.jsx("div",{className:"flex items-center justify-center h-48",children:o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),o.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:o.jsx(vo,{resourceURI:z,toolInfo:E?{tool:E}:void 0,toolInput:x??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:gn.view.minHeight,maxHeight:gn.view.maxHeight,client:D,onMessage:H,onUpdateModelContext:T=>$(M,T),onTeardown:()=>_(M),className:"h-full"})}):d?o.jsxs(o.Fragment,{children:[o.jsx(Fe,{code:JSON.stringify(d,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(X,{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(d,null,2)),On.success("Copied to clipboard")},children:o.jsx(No,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(bn,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})})}function Mr(t){const e=N.c(7),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[0]=i):i=e[0];const l=ge(i).connectionId;if(!pt(l)||!l){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(mt,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let d;return e[3]!==l||e[4]!==s||e[5]!==n?(d=o.jsx(k.Suspense,{fallback:a,children:o.jsx(Rr,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const yn=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},cn=(t=>t?yn(t):yn),Pr=t=>t;function zt(t,e=Pr){const n=J.useSyncExternalStore(t.subscribe,J.useCallback(()=>e(t.getState()),[t,e]),J.useCallback(()=>e(t.getInitialState()),[t,e]));return J.useDebugValue(n),n}const Lr=t=>{const e=cn(t),n=s=>zt(e,s);return Object.assign(n,e),n},Dr=(t=>Lr);function ps(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Wt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Wt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Wt(s)(n)}}}},zr=(t,e)=>(n,s,i)=>{let r={storage:ps(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(y=>{var v;return y((v=s())!=null?v:x)});const S=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Wt(u.getItem.bind(u))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const v=r.migrate(y.state,y.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var v;if(j!==c)return;const[w,C]=y;if(p=r.merge(C,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(S?.(p,void 0),p=s(),l=!0,d.forEach(y=>y(p)))}).catch(y=>{j===c&&S?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),p||x},xs=zr,{useSyncExternalStoreWithSelector:Wr}=no,Fr=t=>t;function Hr(t,e=Fr,n){const s=Wr(t.subscribe,t.getState,t.getInitialState,e,n);return J.useDebugValue(s),s}const wn=t=>Symbol.iterator in t,Nn=t=>"entries"in t,Cn=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Vr=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Ur(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:wn(t)&&wn(e)?Nn(t)&&Nn(e)?Cn(t,e):Vr(t,e):Cn({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Br(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
1
|
+
import{bi as oe,r as k,o as Zs,n as Tt,c as N,j as o,E as En,u as Q,t as Ys,y as A,_ as eo,g as ge,d as to,J as nt,O as st,B as X,v as On,bQ as J,ci as no,cj as so,b0 as oo,a2 as Vt,a5 as fe,a7 as Rn,b1 as ro,a0 as Ut,b2 as io,b3 as An,a3 as Mn,b4 as lo,b5 as co,a8 as Pn,b7 as ao,ck as Bt,cl as uo,ad as fo,bd as mo,$ as po,w as xo,cm as ho,cn as go,co as Ln}from"./index-OyLnxARk.js";import{E as Dn}from"./empty-state-gZUVmgL7.js";import{d as qt,u as Kt}from"./use-collections-DXLoMYCx.js";import{u as re,g as Ke,i as bo}from"./constants-CLw0F8Mm.js";import{F as $t,a as jo,b as Jt,d as Gt}from"./form-Cd_AEgzv.js";import{I as Xt}from"./input-B4YrZuiK.js";import{T as Dt}from"./textarea-CpLkXx5p.js";import{V as zn,b as Wn,a as ve}from"./layout-DwPAPIK-.js";import{S as Fn}from"./save-actions-DQ0FV8E3.js";import{M as vo}from"./mcp-app-renderer-KZyUYhBW.js";import{g as So,M as gn}from"./types-DoomhLgW.js";import{S as Hn,a as Vn,b as Un,c as Bn,d as ot}from"./select-Ctls6rHz.js";import{c as Qt,T as rt,a as it,b as lt}from"./tooltip--UA5heKX.js";import{i as yo}from"./AlertCircle-BWr4XQe9.js";import{s as wo}from"./Clock-Ccv6eV04.js";import{i as bn}from"./Code01-CoEt5nyY.js";import{a as No}from"./Copy01-D7uh0hW0.js";import{s as Co}from"./LayersTwo01-DdRcHsrK.js";import{i as mt}from"./Loading01-BYjTtpy0.js";import{i as Zt}from"./Play-BOK5c4Hp.js";import{B as qn,a as Kn,b as We,d as ct,e as at,c as Jn}from"./breadcrumb-CcE89MsN.js";import{u as ko,O as Io,M as _o,F as To,v as $o,n as Et}from"./index-BPs3Pxaa.js";import{u as pt,b as Eo}from"./use-connection-B7ll8uNa.js";import{d as Yt,b as en,a as tn}from"./use-mcp-tools-S01H2JtZ.js";import{c as Oo}from"./content-blocks-o63cs2vh.js";import{I as xt}from"./integration-icon-B3aufi6R.js";import{T as Ro}from"./tools-list-GuN2kaNF.js";import{u as Ao,c as Mo}from"./context-ClUgEsLK.js";import{u as Po}from"./index-DKWOGpkx.js";import{M as Fe,n as Lo}from"./monaco-editor-DDZgyrgO.js";import{E as nn}from"./empty-state-m7QcZ687.js";import{n as Do}from"./Container-CQmXt7Nc.js";import{b as Gn}from"./use-virtual-mcp-B8SbBr9v.js";import{b as zo,R as jn,a as Wo}from"./resizable-1OPd79St.js";import{B as he}from"./badge-BTw8dF6C.js";import{S as ht}from"./spinner-CItj22uq.js";import{V as Fo}from"./collection-display-button-BJQ_VSFQ.js";import{N as Ho,S as Vo,a as Uo,c as Bo,m as et,P as qo,i as Ko,R as Jo,u as Go,b as Xo,d as vn,E as Qo,e as Zo}from"./index-CfjT_Fv-.js";import{d as Yo}from"./registry-utils-D0qx2c0_.js";import{b as er,D as tr,a as nr,e as sr,c as or,d as rr}from"./dialog-ZIc7OUaM.js";import"./index-Cz_J9f63.js";import{s as Xn}from"./Plus-1vH_gFoY.js";import{i as gt}from"./Check-DAFdA2oM.js";import{i as ir}from"./DotsHorizontal-C3QGwRko.js";import{a as lr}from"./Tool01-3i6uRXKJ.js";import{s as sn}from"./XClose-D08ltwBw.js";import{D as cr,a as ar,b as dr,c as Sn}from"./dropdown-menu-EcTFyr4x.js";import{T as ur,R as fr,b as mr,c as Qn}from"./index-Bg2XE05Y.js";import{i as pr}from"./ChevronRight-B3gSyJmK.js";import{a as xr,S as hr}from"./scroll-area-BSQHcCri.js";import"./index-DxqOk4x4.js";import{i as Zn}from"./X-Car5B1de.js";import"./useMutation-B_6d8oLI.js";import"./label-BoRKSV_h.js";import"./Save01-43mxrIvD.js";import"./use-mcp-resources-CFTlLllB.js";import"./useQuery-Brtj4EoG.js";import"./ChevronUp-Rk5dLXNx.js";import"./index-CRi6734Z.js";import"./ChevronDown-C-3qjfHK.js";import"./File06-DbRSeish.js";import"./Key01-Cv0XYLbb.js";import"./constants-D3bMpbG0.js";import"./extract-connection-data-DEaEvOm7.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-1KLotWZ_.js";import"./index-Cg4edYBM.js";import"./index-BrqeZa9X.js";import"./select-virtual-mcp-CEX-N6yN.js";import"./popover-BKHsia9C.js";import"./SearchMd-Dn4cWwEm.js";import"./Users03-CUiUl0DH.js";import"./use-create-virtual-mcp-BvSTYw2n.js";import"./collection-search-D6ILFEtf.js";import"./collection-table-wrapper-D0JGm79B.js";import"./table-DHN8Pbh9.js";import"./ArrowDown-BPMtK04S.js";import"./ArrowUp-DqOjcDuh.js";import"./card-B6XTMOTf.js";import"./Eye-MRRTHIte.js";import"./Globe02-CDBspixd.js";import"./decopilot-events-Brt4gAR6.js";import"./Grid01-COkHqk9k.js";import"./List-_Z2X7aPf.js";import"./binder-B2xnCBeC.js";const Yn=oe("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const es=oe("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const on=oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rn=oe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const gr=oe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const br=oe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const jr=oe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ts=oe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ns=oe("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const ss=oe("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const vr=oe("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const os=oe("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const rs=oe("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),ln=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));ln.displayName="AlertOctagon";const is=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));is.displayName="Box";const ls=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));ls.displayName="ClockFastForward";const cs=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));cs.displayName="Code02";const as=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));as.displayName="CornerDownRight";const ds=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));ds.displayName="Database01";const us=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M3 3v10.2c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 18 6.12 18 7.8 18H15m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0ZM3 8h12m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0Z"}));us.displayName="GitBranch01";const fs=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));fs.displayName="Repeat03";const ms=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}),k.createElement("path",{d:"M8 9.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 8 9.04 8 9.6 8h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 8.76 16 9.04 16 9.6v4.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C15.24 16 14.96 16 14.4 16H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 15.24 8 14.96 8 14.4V9.6Z"}));ms.displayName="StopCircle";Zs({title:Tt().min(1),description:Tt().nullable(),body:Tt()});function Ot(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Sr(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function yr(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx($t,{control:n.control,name:"title",render:Cr}),o.jsx($t,{control:n.control,name:"description",render:Nr})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx($t,{control:n.control,name:"body",render:wr})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.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:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(jo,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function wr(t){const{field:e}=t;return o.jsx(Jt,{children:o.jsx(Gt,{children:o.jsx(Dt,{...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 Nr(t){const{field:e}=t;return o.jsxs(Jt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(Gt,{children:o.jsx(Xt,{...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 Cr(t){const{field:e}=t;return o.jsxs(Jt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(Gt,{children:o.jsx(Xt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function kr(t){const e=N.c(35),{providerId:n,promptId:s}=t,{org:i}=Q(),r=n||null;let l;e[0]!==i.id||e[1]!==r?(l={connectionId:r,orgId:i.id},e[0]=i.id,e[1]=r,e[2]=l):l=e[2];const c=re(l),a=qt(n,"PROMPT",s,c),d=Kt(n,"PROMPT",c),u=d.update.isPending;let f;e[3]!==a?(f=a?{title:a.title,description:a.description??null,body:Ot(a)}:void 0,e[3]=a,e[4]=f):f=e[4];let m;e[5]!==f?(m={values:f},e[5]=f,e[6]=m):m=e[6];const x=Ys(m);let p;e[7]!==x||e[8]!==a?(p=()=>{a&&x.reset({title:a.title,description:a.description??null,body:Ot(a)})},e[7]=x,e[8]=a,e[9]=p):p=e[9];const h=p;let g;e[10]!==d.update||e[11]!==x||e[12]!==s?(g=x.handleSubmit(async _=>{const O=await d.update.mutateAsync({id:s,data:{title:_.title,description:_.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:_.body}}]}});x.reset({title:O.title,description:O.description??null,body:Ot(O)})}),e[10]=d.update,e[11]=x,e[12]=s,e[13]=g):g=e[13];const b=g;if(!a){let _;return e[14]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Dn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=_):_=e[14],_}let j;e[15]!==a.title?(j=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[15]=a.title,e[16]=j):j=e[16];let S;e[17]!==a.description?(S=a.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[17]=a.description,e[18]=S):S=e[18];let y;e[19]!==j||e[20]!==S?(y=o.jsx(Wn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[j,S]})}),e[19]=j,e[20]=S,e[21]=y):y=e[21];let v;e[22]!==b?(v=()=>{b()},e[22]=b,e[23]=v):v=e[23];let w;e[24]!==x.formState.isDirty||e[25]!==u||e[26]!==h||e[27]!==v?(w=o.jsx(zn,{children:o.jsx(Fn,{onSave:v,onUndo:h,isDirty:x.formState.isDirty,isSaving:u})}),e[24]=x.formState.isDirty,e[25]=u,e[26]=h,e[27]=v,e[28]=w):w=e[28];let C;e[29]!==x?(C=o.jsx("div",{className:"h-full",children:o.jsx(yr,{form:x})}),e[29]=x,e[30]=C):C=e[30];let $;return e[31]!==w||e[32]!==C||e[33]!==y?($=o.jsxs(ve,{children:[y,w,C]}),e[31]=w,e[32]=C,e[33]=y,e[34]=$):$=e[34],$}function Ir(t){const e=N.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Sr(),e[0]=s):s=e[0];const i=s;if(!i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Dn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let r;return e[2]!==n?(r=o.jsx(En,{children:o.jsx(k.Suspense,{fallback:null,children:o.jsx(kr,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const _r=eo("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Tr(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=A(_r({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function $r(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=A("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Er(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=A("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const Or=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Rr(t){const e=N.c(9),{toolName:n,connectionId:s,onBack:i}=t;let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const l=ko(r);if(!l.isAuthenticated){let d;return e[2]!==l.supportsOAuth||e[3]!==i?(d=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(Io,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(_o,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=d):d=e[4],d}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==c||e[7]!==n?(a=o.jsx(Ar,{toolName:n,connectionId:s},c),e[5]=s,e[6]=c,e[7]=n,e[8]=a):a=e[8],a}function Ar({toolName:t,connectionId:e}){const{replayId:n}=to({strict:!1}),s=(()=>{if(!n)return null;const T=`replay-${n}`,R=sessionStorage.getItem(T);if(!R)return null;sessionStorage.removeItem(T);try{return JSON.parse(R)}catch{return null}})(),i=(()=>{if(!s)return null;const T={};for(const[R,P]of Object.entries(s))P!==null&&typeof P=="object"?T[R]=JSON.stringify(P,null,2):T[R]=P;return T})(),[r,l]=k.useState(i??{}),[c,a]=k.useState(s?JSON.stringify(s,null,2):"{}"),[d,u]=k.useState(null),[f,m]=k.useState(null),[x,p]=k.useState(null),[h,g]=k.useState(null),[b,j]=k.useState(!1),[S,y]=k.useState(null),{org:v}=Q(),w=pt(e),{sendMessage:C,setAppContext:$,clearAppContext:_}=Ao(),[,O]=Po(),M=`${e}:${t}`,D=re({connectionId:e,orgId:v.id}),I=Yt({client:D}),E=I.data?.tools?.find(T=>T.name===t),z=So(E?._meta),H=T=>{const R=Oo(T.content);R.content.length>0&&(O(!0),C(R))},[G,U]=k.useState("json"),[V,Z]=k.useState(!1);z&&!V&&(U("ui"),Z(!0));const ie=E?.inputSchema?.properties,Y=ie?Object.keys(ie):[],W=Y.length>0,B={};if(W&&E?.inputSchema?.properties)for(const T of Y)B[T]=E.inputSchema.required?.includes(T)?"":void 0;const q=T=>Object.prototype.hasOwnProperty.call(r,T),ee=async()=>{j(!0),g(null),u(null),m(null),p(null),y(null);const T=performance.now();try{if(!D)throw new Error("MCP client is not available");const R=W?{...B,...r}:(()=>{const de=c.trim();if(!de)return{};const ue=JSON.parse(de);if(ue&&typeof ue=="object")return ue;throw new Error("Raw JSON input must be an object.")})();W&&E?.inputSchema?.properties&&Object.entries(E.inputSchema.properties).forEach(([de,ue])=>{if((ue.type==="object"||ue.type==="array")&&typeof R[de]=="string")try{R[de]=JSON.parse(R[de])}catch{}});const P=await D.callTool({name:t,arguments:R}),F=P.structuredContent??P,be=performance.now(),Ze=Math.round(be-T);u(F),m(P),p(R);const Ue=JSON.stringify(F),xe=new TextEncoder().encode(Ue).length;y({duration:`${Ze}ms`,bytes:`${xe} bytes`,tokens:`~${Math.ceil(xe/4)} tokens`,cost:"$0.0000"})}catch(R){const P=R instanceof Error?R.message:String(R);g(P||"Unknown error occurred");const F=performance.now();y({duration:`${Math.round(F-T)}ms`})}finally{j(!1)}},te=(T,R)=>{l(P=>({...P,[T]:R}))},le=()=>{u(null),m(null),p(null),g(null),y(null)},ce=E?.name??Or(t),se=o.jsx(qn,{children:o.jsxs(Kn,{children:[o.jsx(We,{children:o.jsx(ct,{asChild:!0,children:o.jsx(nt,{to:"/$org/$project/mcps",params:{org:v.slug,project:st},children:"Connections"})})}),o.jsx(at,{}),w&&o.jsxs(o.Fragment,{children:[o.jsx(We,{children:o.jsx(ct,{asChild:!0,children:o.jsx(nt,{to:"/$org/$project/mcps/$connectionId",params:{org:v.slug,project:st,connectionId:e},search:{tab:"tools"},children:w.title})})}),o.jsx(at,{})]}),o.jsx(We,{children:o.jsx(Jn,{children:ce})})]})});return o.jsx(ve,{breadcrumb:se,children:o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[30%_70%] h-full",children:[o.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:o.jsxs("div",{className:"flex-1 overflow-auto",children:[o.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(xt,{icon:w?.icon||null,name:w?.title||t,size:"sm",className:"shadow-sm shrink-0"}),o.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[I.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):I.isLoading?o.jsx(mt,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:I.isSuccess?"ready":I.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:E?.description||"No description available"})]})}),o.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),E?.inputSchema?.required&&E.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:W&&E?.inputSchema?.properties?Object.entries(E.inputSchema.properties).map(([T,R])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[T,E.inputSchema?.required?.includes(T)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:R.type})]}),R.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:R.description}),R.type==="object"||R.type==="array"?o.jsx(Dt,{className:"font-mono text-xs",value:q(T)?r[T]??"":B[T]??"",onChange:P=>te(T,P.target.value),placeholder:`Enter ${T} as JSON...`,rows:3}):R.type==="boolean"?o.jsxs(Hn,{value:q(T)?String(r[T]??""):"",onValueChange:P=>te(T,P==="true"),children:[o.jsx(Vn,{children:o.jsx(Un,{placeholder:"Select true or false..."})}),o.jsxs(Bn,{children:[o.jsx(ot,{value:"true",children:"true"}),o.jsx(ot,{value:"false",children:"false"})]})]}):o.jsx(Xt,{value:q(T)?r[T]??"":B[T]??"",onChange:P=>te(T,P.target.value),placeholder:`Enter ${T}...`})]},T)):E?.inputSchema&&!W?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(Dt,{className:"font-mono text-xs min-h-[120px]",value:c,onChange:T=>a(T.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),o.jsx(Ro,{annotations:E?.annotations,_meta:E?._meta})]}),S&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(wo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.duration})]}),S.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(is,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.tokens})]}),S.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(ds,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.bytes})]}),S.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:S.cost})})]})]}),o.jsxs("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:[o.jsx("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:b?o.jsxs(X,{size:"sm",variant:"destructive",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:le,children:[o.jsx(ms,{className:"h-3.5 w-3.5"}),"Cancel"]}):o.jsxs(X,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:ee,children:[o.jsx(Zt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),z&&o.jsx(Qt,{children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(rt,{children:[o.jsx(it,{asChild:!0,children:o.jsx(X,{size:"icon",variant:G==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>U("ui"),children:o.jsx(Co,{size:14})})}),o.jsx(lt,{children:"Interactive view"})]}),o.jsxs(rt,{children:[o.jsx(it,{asChild:!0,children:o.jsx(X,{size:"icon",variant:G==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>U("json"),children:o.jsx(bn,{size:14})})}),o.jsx(lt,{children:"JSON view"})]})]})})]}),h&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(Tr,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(yo,{className:"h-4 w-4"}),o.jsx($r,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(Er,{className:"text-xs text-destructive",children:h})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:z&&G==="ui"&&D?o.jsx(k.Suspense,{fallback:o.jsx("div",{className:"flex items-center justify-center h-48",children:o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),o.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:o.jsx(vo,{resourceURI:z,toolInfo:E?{tool:E}:void 0,toolInput:x??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:gn.view.minHeight,maxHeight:gn.view.maxHeight,client:D,onMessage:H,onUpdateModelContext:T=>$(M,T),onTeardown:()=>_(M),className:"h-full"})}):d?o.jsxs(o.Fragment,{children:[o.jsx(Fe,{code:JSON.stringify(d,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(X,{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(d,null,2)),On.success("Copied to clipboard")},children:o.jsx(No,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(bn,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})})}function Mr(t){const e=N.c(7),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[0]=i):i=e[0];const l=ge(i).connectionId;if(!pt(l)||!l){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(mt,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let d;return e[3]!==l||e[4]!==s||e[5]!==n?(d=o.jsx(k.Suspense,{fallback:a,children:o.jsx(Rr,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const yn=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},cn=(t=>t?yn(t):yn),Pr=t=>t;function zt(t,e=Pr){const n=J.useSyncExternalStore(t.subscribe,J.useCallback(()=>e(t.getState()),[t,e]),J.useCallback(()=>e(t.getInitialState()),[t,e]));return J.useDebugValue(n),n}const Lr=t=>{const e=cn(t),n=s=>zt(e,s);return Object.assign(n,e),n},Dr=(t=>Lr);function ps(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Wt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Wt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Wt(s)(n)}}}},zr=(t,e)=>(n,s,i)=>{let r={storage:ps(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(y=>{var v;return y((v=s())!=null?v:x)});const S=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Wt(u.getItem.bind(u))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const v=r.migrate(y.state,y.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var v;if(j!==c)return;const[w,C]=y;if(p=r.merge(C,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(S?.(p,void 0),p=s(),l=!0,d.forEach(y=>y(p)))}).catch(y=>{j===c&&S?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),p||x},xs=zr,{useSyncExternalStoreWithSelector:Wr}=no,Fr=t=>t;function Hr(t,e=Fr,n){const s=Wr(t.subscribe,t.getState,t.getInitialState,e,n);return J.useDebugValue(s),s}const wn=t=>Symbol.iterator in t,Nn=t=>"entries"in t,Cn=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Vr=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Ur(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:wn(t)&&wn(e)?Nn(t)&&Nn(e)?Cn(t,e):Vr(t,e):Cn({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Br(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
2
2
|
${Object.entries(l).map(([d,u])=>{const f=c.has(d)?"":"?";return`${u.description?` /** ${u.description} */
|
|
3
3
|
`:""} ${d}${f}: ${n(u)};`}).join(`
|
|
4
4
|
`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as O,c as U,y as g,j as s,B as se}from"./index-
|
|
1
|
+
import{r as O,c as U,y as g,j as s,B as se}from"./index-OyLnxARk.js";import{c as X,a as oe,b as ie,D as le}from"./dropdown-menu-EcTFyr4x.js";import{n as ne}from"./ArrowDown-BPMtK04S.js";import{i as re}from"./ArrowUp-DqOjcDuh.js";import{i as Y}from"./Check-DAFdA2oM.js";import{c as ae}from"./Grid01-COkHqk9k.js";import{i as ce}from"./List-_Z2X7aPf.js";import{a as de,b as ue,c as fe,T as me}from"./tooltip--UA5heKX.js";import{B as xe}from"./badge-BTw8dF6C.js";const Z=({size:l=24,color:e="currentColor",...o})=>O.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},O.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));Z.displayName="Sliders01";const pe={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function he(l){const e=U.c(66),{value:o,onValueChange:a,options:t,size:w,fullWidth:z,className:j}=l,S=w===void 0?"sm":w,m=z===void 0?!1:z,k=O.useRef(null),C=O.useRef(null);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={left:0,width:0,opacity:0},e[0]=c):c=e[0];const[x,M]=O.useState(c);let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=F=>{if(!F.current)return;const{offsetLeft:ee,offsetWidth:te}=F.current;M({left:ee,width:te,opacity:1})},e[1]=b):b=e[1];const N=b;let d;e[2]!==t[0].value||e[3]!==o?(d=()=>{const F=o===t[0].value?k:C;N(F)},e[2]=t[0].value,e[3]=o,e[4]=d):d=e[4];let v;e[5]!==t||e[6]!==o?(v=[o,t],e[5]=t,e[6]=o,e[7]=v):v=e[7],O.useEffect(d,v);const i=pe[S];let n;e[8]!==j?(n=g("relative flex gap-0 bg-muted rounded-lg",j),e[8]=j,e[9]=n):n=e[9];let r;e[10]!==a||e[11]!==t[0].value?(r=()=>a(t[0].value),e[10]=a,e[11]=t[0].value,e[12]=r):r=e[12];const p=m?"flex-1 h-12 px-4":i.button,h=!m&&t[0].label?"px-3":"";let u;e[13]!==h||e[14]!==p?(u=g("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",p,h),e[13]=h,e[14]=p,e[15]=u):u=e[15];const y=o===t[0].value?"text-foreground":"text-muted-foreground";let f;e[16]!==i.icon||e[17]!==y?(f=g("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",i.icon,y),e[16]=i.icon,e[17]=y,e[18]=f):f=e[18];let _;e[19]!==t[0].icon||e[20]!==f?(_=s.jsx("span",{className:f,children:t[0].icon}),e[19]=t[0].icon,e[20]=f,e[21]=_):_=e[21];let D;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(D=t[0].label&&s.jsx("span",{className:g("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=D):D=e[25];let T;e[26]!==u||e[27]!==_||e[28]!==D||e[29]!==r?(T=s.jsxs("button",{ref:k,type:"button",onClick:r,className:u,children:[_,D]}),e[26]=u,e[27]=_,e[28]=D,e[29]=r,e[30]=T):T=e[30];let V;e[31]!==a||e[32]!==t[1].value?(V=()=>a(t[1].value),e[31]=a,e[32]=t[1].value,e[33]=V):V=e[33];const K=m?"flex-1 h-12 px-4":i.button,q=!m&&t[1].label?"px-3":"";let $;e[34]!==K||e[35]!==q?($=g("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",K,q),e[34]=K,e[35]=q,e[36]=$):$=e[36];const G=o===t[1].value?"text-foreground":"text-muted-foreground";let B;e[37]!==i.icon||e[38]!==G?(B=g("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",i.icon,G),e[37]=i.icon,e[38]=G,e[39]=B):B=e[39];let E;e[40]!==t[1].icon||e[41]!==B?(E=s.jsx("span",{className:B,children:t[1].icon}),e[40]=t[1].icon,e[41]=B,e[42]=E):E=e[42];let R;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(R=t[1].label&&s.jsx("span",{className:g("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=R):R=e[46];let L;e[47]!==V||e[48]!==$||e[49]!==E||e[50]!==R?(L=s.jsxs("button",{ref:C,type:"button",onClick:V,className:$,children:[E,R]}),e[47]=V,e[48]=$,e[49]=E,e[50]=R,e[51]=L):L=e[51];const H=m?"h-12":i.button;let W;e[52]!==H?(W=g("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",H),e[52]=H,e[53]=W):W=e[53];const J=`${x.left}px`,Q=`${x.width}px`;let I;e[54]!==x.opacity||e[55]!==J||e[56]!==Q?(I={left:J,width:Q,opacity:x.opacity},e[54]=x.opacity,e[55]=J,e[56]=Q,e[57]=I):I=e[57];let P;e[58]!==W||e[59]!==I?(P=s.jsx("div",{className:W,style:I}),e[58]=W,e[59]=I,e[60]=P):P=e[60];let A;return e[61]!==T||e[62]!==L||e[63]!==P||e[64]!==n?(A=s.jsxs("div",{className:n,children:[T,L,P]}),e[61]=T,e[62]=L,e[63]=P,e[64]=n,e[65]=A):A=e[65],A}function Me(l){const e=U.c(31),{viewMode:o,onViewModeChange:a,sortKey:t,sortDirection:w,onSort:z,sortOptions:j,filters:S}=l;let m;e[0]!==j?(m=j===void 0?[]:j,e[0]=j,e[1]=m):m=e[1];const k=m;let C;e[2]!==S?(C=S===void 0?[]:S,e[2]=S,e[3]=C):C=e[3];const c=C;let x;e[4]!==c?(x=c.filter(be),e[4]=c,e[5]=x):x=e[5];const M=x.length;let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Z,{size:16}),e[6]=b):b=e[6];let N;e[7]!==M?(N=M>0&&s.jsx(xe,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:M}),e[7]=M,e[8]=N):N=e[8];let d;e[9]!==N?(d=s.jsx(de,{asChild:!0,children:s.jsx(oe,{asChild:!0,children:s.jsxs(se,{variant:"outline",size:"icon",className:"size-7 border border-input relative",children:[b,N]})})}),e[9]=N,e[10]=d):d=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ue,{children:"Display & filters"}),e[11]=v):v=e[11];let i;e[12]!==d?(i=s.jsx(fe,{children:s.jsxs(me,{children:[d,v]})}),e[12]=d,e[13]=i):i=e[13];let n;e[14]!==a||e[15]!==o?(n=a&&o&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(he,{value:o,onValueChange:a,fullWidth:!0,options:[{value:"table",icon:s.jsx(ce,{})},{value:"cards",icon:s.jsx(ae,{})}]})}),e[14]=a,e[15]=o,e[16]=n):n=e[16];let r;e[17]!==z||e[18]!==w||e[19]!==t||e[20]!==k?(r=k.length>0&&z&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),k.map(y=>{const f=t===y.id;return s.jsx(X,{onClick:()=>z(y.id),className:g("h-8 px-2 py-0 cursor-pointer",f&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f&&s.jsx(Y,{size:16,className:"text-foreground shrink-0"}),!f&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),f&&w&&(w==="asc"?s.jsx(re,{size:16,className:"text-foreground shrink-0"}):s.jsx(ne,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=z,e[18]=w,e[19]=t,e[20]=k,e[21]=r):r=e[21];let p;e[22]!==c?(p=c.map(ge),e[22]=c,e[23]=p):p=e[23];let h;e[24]!==n||e[25]!==r||e[26]!==p?(h=s.jsxs(ie,{align:"end",className:"w-[200px] p-0 gap-0",children:[n,r,p]}),e[24]=n,e[25]=r,e[26]=p,e[27]=h):h=e[27];let u;return e[28]!==i||e[29]!==h?(u=s.jsxs(le,{children:[i,h]}),e[28]=i,e[29]=h,e[30]=u):u=e[30],u}function ge(l){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:l.label}),l.options.map(e=>{const o=l.value===e.id;return s.jsx(X,{onClick:()=>l.onChange(e.id),className:g("h-8 px-2 py-0 cursor-pointer",o&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[o&&s.jsx(Y,{size:16,className:"text-foreground shrink-0"}),!o&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},l.label)}function be(l){return l.value!=="ALL"}export{Me as C,he as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,y as b,j as i}from"./index-
|
|
1
|
+
import{c as v,y as b,j as i}from"./index-OyLnxARk.js";import{i as w}from"./Loading01-BYjTtpy0.js";import{i as C}from"./SearchMd-Dn4cWwEm.js";import{I as k}from"./input-B4YrZuiK.js";function I(j){const e=v.c(21),{value:m,onChange:d,placeholder:g,onKeyDown:f,className:p,isSearching:u,disabled:n}=j,x=g===void 0?"Search...":g;let t;e[0]!==p?(t=b("shrink-0 w-full border-b border-border h-12",p),e[0]=p,e[1]=t):t=e[1];const h=n?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let r;e[4]!==u?(r=u?i.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):i.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=u,e[5]=r):r=e[5];let l;e[6]!==d?(l=N=>d(N.target.value),e[6]=d,e[7]=l):l=e[7];let o;e[8]!==n||e[9]!==f||e[10]!==x||e[11]!==l||e[12]!==m?(o=i.jsx(k,{value:m,onChange:l,onKeyDown:f,placeholder:x,disabled:n,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[8]=n,e[9]=f,e[10]=x,e[11]=l,e[12]=m,e[13]=o):o=e[13];let a;e[14]!==s||e[15]!==r||e[16]!==o?(a=i.jsxs("label",{className:s,children:[r,o]}),e[14]=s,e[15]=r,e[16]=o,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=i.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{I as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as r,y}from"./index-
|
|
1
|
+
import{c as k,j as r,y}from"./index-OyLnxARk.js";import{c as S,a as R,b as T,e as H,d as L,T as z}from"./table-DHN8Pbh9.js";import{n as D}from"./ArrowDown-BPMtK04S.js";import{i as E}from"./ArrowUp-DqOjcDuh.js";function I(C){const e=k.c(29),{columns:s,data:f,sortKey:u,sortDirection:x,onSort:i,onRowClick:n,rowClassName:c}=C;let p;e[0]!==x?(p=function(t,h){return r.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&x&&(x==="asc"?r.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}):r.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=x,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let o;if(e[3]!==s||e[4]!==i||e[5]!==b||e[6]!==u){let l;e[8]!==s.length||e[9]!==i||e[10]!==b||e[11]!==u?(l=(t,h)=>{const N=u===t.id;return r.jsx(S,{className:y(a(h,s.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:r.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=s.length,e[9]=i,e[10]=b,e[11]=u,e[12]=l):l=e[12],o=s.map(l),e[3]=s,e[4]=i,e[5]=b,e[6]=u,e[7]=o}else o=e[7];let g;e[13]!==o?(g=r.jsx(R,{className:"border-b-0",children:r.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:o})}),e[13]=o,e[14]=g):g=e[14];let j;if(e[15]!==s||e[16]!==f||e[17]!==n||e[18]!==c){let l;e[20]!==s||e[21]!==n||e[22]!==c?(l=(t,h)=>{const N=c?.(t);return r.jsx(T,{"data-row-index":h,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:s.map(m=>r.jsx(H,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:r.jsx("div",{className:y(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=s,e[21]=n,e[22]=c,e[23]=l):l=e[23],j=f.map(l),e[15]=s,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=r.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=r.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function W(C){const e=k.c(12),{columns:s,data:f,isLoading:u,sortKey:x,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=C;if(u===void 0?!1:u){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||r.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let o;return e[3]!==a?(o=r.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=o):o=e[4],o}let d;return e[5]!==s||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==x?(d=r.jsx("div",{className:"flex-1 overflow-auto",children:r.jsx(I,{columns:s,data:f,sortKey:x,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=s,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=x,e[11]=d):d=e[11],d}export{W as C};
|