decocms 4.255.2 → 4.255.4

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.
Files changed (249) hide show
  1. package/dist/client/assets/{AlertCircle-BckADFTN.js → AlertCircle-rzbi7fmi.js} +1 -1
  2. package/dist/client/assets/{AreaChart-D3FkaC6Z.js → AreaChart-CuKqt6_P.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CA4nZ19l.js → ArrowLeft-D-nEST6C.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-8tGgkrEO.js → ArrowUp-BfWB8MD1.js} +1 -1
  5. package/dist/client/assets/{Check-D4XLgaN4.js → Check-DPWJue1l.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-Dh96WJYX.js → CheckCircle-CzbHy_NQ.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-Dm6QJQj5.js → ChevronDown-Bchtg7Ey.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-Bbyr31or.js → ChevronRight-ywp7R8fi.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-BUgf0an-.js → ChevronSelectorVertical-fzOl_PXo.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-C7jPKNLf.js → ChevronUp-CJaWrIn8.js} +1 -1
  11. package/dist/client/assets/{Copy01-BqCuDnjV.js → Copy01-C1V4JSjm.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-CALthygT.js → CreditCard01-BgWLt525.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-CYMbIa1_.js → DotsVertical-CtCazyXg.js} +1 -1
  14. package/dist/client/assets/{Download01-C6mH6Z8f.js → Download01-B8eccotb.js} +1 -1
  15. package/dist/client/assets/{Eye-jMpQ7fBE.js → Eye-CVdFbQPq.js} +1 -1
  16. package/dist/client/assets/{FilterLines-4Qetm1ho.js → FilterLines-CHSA0Ovv.js} +1 -1
  17. package/dist/client/assets/{Globe01-CkxIxFjV.js → Globe01-C4uOnzpB.js} +1 -1
  18. package/dist/client/assets/{Globe04-CWbZ_xf0.js → Globe04-4ZySY2dL.js} +1 -1
  19. package/dist/client/assets/{HardDrive-DqrbzOlI.js → HardDrive-BpDqLmKr.js} +1 -1
  20. package/dist/client/assets/{Key01-CzBg_w_E.js → Key01-CIlMRmOa.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-BYv4_-zq.js → LinkExternal01-BnF74p76.js} +1 -1
  22. package/dist/client/assets/{LockUnlocked01-BssaZtDy.js → LockUnlocked01-CFo18Geo.js} +1 -1
  23. package/dist/client/assets/{LogOut01-CE6p7Q73.js → LogOut01-mY61xNf_.js} +1 -1
  24. package/dist/client/assets/{Monitor01-DUnpXEZF.js → Monitor01-DRcJh9rJ.js} +1 -1
  25. package/dist/client/assets/{Palette-zSvxc111.js → Palette-Dyv90Vji.js} +1 -1
  26. package/dist/client/assets/{Play-C9tlPC3I.js → Play-DHTGlq1Y.js} +1 -1
  27. package/dist/client/assets/{Plus-BBdbmkEC.js → Plus-BBG-uYzF.js} +1 -1
  28. package/dist/client/assets/{SearchLg-Bg0bWoci.js → SearchLg-3Irji4Em.js} +1 -1
  29. package/dist/client/assets/{SearchMd-B5LTpCxn.js → SearchMd-BiEg7og4.js} +1 -1
  30. package/dist/client/assets/{Settings02-DQ6Qx_Qo.js → Settings02-DdRb7E0Q.js} +1 -1
  31. package/dist/client/assets/{Share07-Di11XO-1.js → Share07-Cx9rW-3h.js} +1 -1
  32. package/dist/client/assets/{Shield01-FnU_LRxr.js → Shield01-Dj1i5rRJ.js} +1 -1
  33. package/dist/client/assets/{Stars01-C8fjQPly.js → Stars01-DsEuNQa4.js} +1 -1
  34. package/dist/client/assets/{Stars02-BC82QMl0.js → Stars02-CQidlt1A.js} +1 -1
  35. package/dist/client/assets/{Sun-CL5Lwimd.js → Sun-CedAoEhV.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-DJAL0oew.js → SwitchHorizontal01-BBS3aq1G.js} +1 -1
  37. package/dist/client/assets/{Tool01-kIIhzZhw.js → Tool01-DYiLYfEf.js} +1 -1
  38. package/dist/client/assets/{Tool02-xsTmH7TW.js → Tool02-53gDBxa-.js} +1 -1
  39. package/dist/client/assets/{Trash01-CISu7ukT.js → Trash01-hrM9uQgS.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-D54j7eRb.js → TrendUp01-CHalSWAC.js} +1 -1
  41. package/dist/client/assets/{Upload01-BBFWsedg.js → Upload01-DgdhEYC-.js} +1 -1
  42. package/dist/client/assets/{User01-Da-P04pG.js → User01-9rQwsqCE.js} +1 -1
  43. package/dist/client/assets/{UserSquare-DgUtDej9.js → UserSquare-BK8-agqd.js} +1 -1
  44. package/dist/client/assets/{Users01-CXfWV5oU.js → Users01-CBrs1-WF.js} +1 -1
  45. package/dist/client/assets/{Users03-BH_DGEIm.js → Users03-Ckv8dpNK.js} +1 -1
  46. package/dist/client/assets/{XCircle-qOGRhnhp.js → XCircle-VjO5lI8H.js} +1 -1
  47. package/dist/client/assets/{XClose-DL2O4uTC.js → XClose-BivECxO7.js} +1 -1
  48. package/dist/client/assets/{YAxis-DyE5fkIu.js → YAxis-BUFR5b9Q.js} +1 -1
  49. package/dist/client/assets/{Zap-DYtDBHNd.js → Zap-Cnsys2Wq.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-CGgQRKSq.js → ZapSquare-CSYRxph5.js} +1 -1
  51. package/dist/client/assets/{access-gate-bxw6GJBM.js → access-gate-C37vr7HM.js} +1 -1
  52. package/dist/client/assets/{agent-icon-RO_lY7mQ.js → agent-icon-BUsh3oGt.js} +1 -1
  53. package/dist/client/assets/agents-list-BSXmKvPI.js +1 -0
  54. package/dist/client/assets/{ai-providers-_bAZfhEo.js → ai-providers-ByCNS5tk.js} +2 -2
  55. package/dist/client/assets/{alert-DS_4c1g8.js → alert-BqDinRfy.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-B3eneGBp.js → alert-dialog-hhGN1kzx.js} +1 -1
  57. package/dist/client/assets/{api-keys-Cn1MTRia.js → api-keys-DHBiaV_r.js} +1 -1
  58. package/dist/client/assets/app-editor-C0hCGxtl.js +1 -0
  59. package/dist/client/assets/{auth-DeQHSbj0.js → auth-BbVa1hsz.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-BWmr3lOz.js → auth-catchall-CFKvepKy.js} +1 -1
  61. package/dist/client/assets/{auth-entry-B3nspDeT.js → auth-entry-BXkmPqvH.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-DH603Yyd.js → auth-split-layout-CQECvTjT.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-DaDpqCGj.js → authenticate-and-persist-oauth-BW7lPmR8.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-GJXCE3Ep.js → automation-list-row-6SRFf-_b.js} +1 -1
  65. package/dist/client/assets/{automation-runs-CggJDo1C.js → automation-runs-BQ0Iu53B.js} +1 -1
  66. package/dist/client/assets/automations-DXRcT17e.js +1 -0
  67. package/dist/client/assets/{avatar-t8xMECgD.js → avatar-CffKfcxD.js} +1 -1
  68. package/dist/client/assets/{badge-3w-z2q_R.js → badge-DdvBiEJO.js} +1 -1
  69. package/dist/client/assets/{block-document-DBAOy7rM.js → block-document-Dp95KQeN.js} +1 -1
  70. package/dist/client/assets/{buckets-C6KeDFl_.js → buckets-C-YB4kjm.js} +1 -1
  71. package/dist/client/assets/bulk-category-panel-xdEU6TlG.js +1 -0
  72. package/dist/client/assets/{capability-load-error-CrnDuhrP.js → capability-load-error-DifEo2uP.js} +1 -1
  73. package/dist/client/assets/{cards-B116B10c.js → cards-BImfAb5p.js} +1 -1
  74. package/dist/client/assets/category-editor-BTtM_Oym.js +1 -0
  75. package/dist/client/assets/{chart-B-JWflUf.js → chart-CQDerfwb.js} +1 -1
  76. package/dist/client/assets/chat-context-BSlnS4lO.js +35 -0
  77. package/dist/client/assets/{checkbox-CTK-987j.js → checkbox-DvnU-G5n.js} +1 -1
  78. package/dist/client/assets/{choose-editor-BiIbar5e.js → choose-editor-DDZWpEEU.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-CWZIlaAu.js → cli-auth-success-BKkBveK7.js} +1 -1
  80. package/dist/client/assets/collection-detail-i2uJ3G4p.js +1 -0
  81. package/dist/client/assets/{collection-display-button-RvJk_3kM.js → collection-display-button-DUWiE5Mh.js} +1 -1
  82. package/dist/client/assets/{collection-search-TDcC3qnQ.js → collection-search-D5bU0Mny.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-AH8YyxhL.js → collection-table-wrapper-6LuinD6M.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-mTx4dyj7.js → collection-tabs-DSNouQYO.js} +1 -1
  85. package/dist/client/assets/{command-BmhGhCGW.js → command-DO658f9K.js} +1 -1
  86. package/dist/client/assets/{commerce-onboarding-DDSFZSw4.js → commerce-onboarding-DTgTL1Sa.js} +1 -1
  87. package/dist/client/assets/{connect-BRqyUKct.js → connect-Bo1Gdnm2.js} +1 -1
  88. package/dist/client/assets/{connection-DPcqqUpI.js → connection-BMZxDUto.js} +1 -1
  89. package/dist/client/assets/{connection-card-Dg2tFKYT.js → connection-card-BxOv_0Pb.js} +1 -1
  90. package/dist/client/assets/connection-detail-Ceqi_UkX.js +1 -0
  91. package/dist/client/assets/{connection-form-helpers-BiSqyE70.js → connection-form-helpers-DwrLlCes.js} +1 -1
  92. package/dist/client/assets/{connections-BRZcZzvE.js → connections-sw9Pef3f.js} +1 -1
  93. package/dist/client/assets/{decopilot-sse-pool-Cn3-H_-J.js → decopilot-sse-pool-CnQZuU8U.js} +1 -1
  94. package/dist/client/assets/{dialog-CaTBZV_d.js → dialog-CRgUvUGD.js} +1 -1
  95. package/dist/client/assets/{domain-settings-DSiUt4s6.js → domain-settings-BHqc8jTd.js} +1 -1
  96. package/dist/client/assets/{drawer-CMaDObPV.js → drawer-B5fFyIgX.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-BRNNpXcy.js → dropdown-menu-C0p1X71u.js} +1 -1
  98. package/dist/client/assets/{empty-state-Dx5RvteD.js → empty-state-nAEi4fmW.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-DDL06q4h.js → extract-connection-data-D3s8EYsm.js} +1 -1
  100. package/dist/client/assets/file-explorer-C3wPz2g1.js +2 -0
  101. package/dist/client/assets/{file-type-icon-C2ALTS96.js → file-type-icon-BxCMRXC7.js} +1 -1
  102. package/dist/client/assets/{form-C1Z3Pgy9.js → form-CkF9Gll6.js} +1 -1
  103. package/dist/client/assets/{general-wKChpaKt.js → general-Bvd3m1q-.js} +1 -1
  104. package/dist/client/assets/{github-repo-picker-CghdTD4a.js → github-repo-picker-uCh44L_P.js} +1 -1
  105. package/dist/client/assets/{hooks-BjFStmIb.js → hooks-BMvgJI-g.js} +10 -10
  106. package/dist/client/assets/index-BxFod4ty.js +1 -0
  107. package/dist/client/assets/{index-k4eNrclM.js → index-C7yUTQLC.js} +1 -1
  108. package/dist/client/assets/{index-DXHENisy.js → index-CRX5z-Jb.js} +1 -1
  109. package/dist/client/assets/{index-Bv7SAPra.js → index-CWPBMaeR.js} +2 -2
  110. package/dist/client/assets/{index-xiyjF2ia.js → index-CxD2n68d.js} +1 -1
  111. package/dist/client/assets/index-CxZcM7iI.js +743 -0
  112. package/dist/client/assets/{index-C-3fd8Ck.js → index-D5JaHC8m.js} +1 -1
  113. package/dist/client/assets/{index-DnfUq0Re.js → index-DGbNQLI2.js} +1 -1
  114. package/dist/client/assets/index-dzFuJh3g.js +1 -0
  115. package/dist/client/assets/{index-DLiSt-zY.js → index-eMuSvnay.js} +5 -5
  116. package/dist/client/assets/{index-redirect-Q-uzQ1ZR.js → index-redirect-CSQT7dVz.js} +1 -1
  117. package/dist/client/assets/{infra-billing-C8apIzey.js → infra-billing-D1_-S4Iu.js} +1 -1
  118. package/dist/client/assets/{input-CY_6SiUS.js → input-CzXHUUzJ.js} +1 -1
  119. package/dist/client/assets/{integration-icon-CGhJSgDA.js → integration-icon-UAHcQu3Y.js} +1 -1
  120. package/dist/client/assets/{invite-member-dialog-B2p8Tm3P.js → invite-member-dialog-a03LtCNI.js} +1 -1
  121. package/dist/client/assets/{label-CIfNh86q.js → label-C-f36Ery.js} +1 -1
  122. package/dist/client/assets/{layout-BCjUdMcW.js → layout-ExdNCowx.js} +1 -1
  123. package/dist/client/assets/{login-Dy6oLdg_.js → login-BoUiAbPR.js} +1 -1
  124. package/dist/client/assets/{mcp-oauth-DImoLDws.js → mcp-oauth-EpOxhfnN.js} +1 -1
  125. package/dist/client/assets/{members-BeZb8rdR.js → members-DRacrCiw.js} +1 -1
  126. package/dist/client/assets/{monaco-editor-ZUjofCql.js → monaco-editor-DXWGpYdI.js} +1 -1
  127. package/dist/client/assets/{monitoring-stats-row-CwawUUDQ.js → monitoring-stats-row-CStChSPF.js} +1 -1
  128. package/dist/client/assets/{multi-select-BasuLjyg.js → multi-select-V9DJTmBZ.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-CkV2aSCc.js → oauth-callback-CvsRTDAl.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-ai-provider-DQzrQ2ZW.js → oauth-callback-ai-provider-BTZRnTS3.js} +1 -1
  131. package/dist/client/assets/{onboarding-ZjEXHRqc.js → onboarding-og3I_xVV.js} +1 -1
  132. package/dist/client/assets/{org-layout-BFuYj0lq.js → org-layout-QWnp58dZ.js} +1 -1
  133. package/dist/client/assets/{organization-choice-CNLElHVj.js → organization-choice-DurkooFh.js} +1 -1
  134. package/dist/client/assets/{orgs-DY4SjhQN.js → orgs-jsXpwgtJ.js} +1 -1
  135. package/dist/client/assets/{page-seo-form-DwRi_S8N.js → page-seo-form-CKaXssEk.js} +1 -1
  136. package/dist/client/assets/{popover-lX6wGPom.js → popover-OOnmalBV.js} +1 -1
  137. package/dist/client/assets/post-editor-CFCYmhEe.js +1 -0
  138. package/dist/client/assets/{primitives-BAE6y0ZV.js → primitives-BhZ-HVLG.js} +1 -1
  139. package/dist/client/assets/{profile-CMoih80z.js → profile-BRSzqaGC.js} +1 -1
  140. package/dist/client/assets/project-app-view-C5juFf3y.js +1 -0
  141. package/dist/client/assets/record-editor-BGJ3Uxr9.js +1 -0
  142. package/dist/client/assets/redirect-editor-BgmzxDxm.js +1 -0
  143. package/dist/client/assets/registry-Us39sPL5.js +2 -0
  144. package/dist/client/assets/{registry-layout-7bL7SAGE.js → registry-layout-CaPQ8D3m.js} +1 -1
  145. package/dist/client/assets/{reports-BkJ5gkYi.js → reports-CZRAYZND.js} +1 -1
  146. package/dist/client/assets/{require-capability-CLTXzK08.js → require-capability-CDs1Pl6o.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-v7tDA1sl.js → required-auth-layout-D7eBvpct.js} +1 -1
  148. package/dist/client/assets/{reset-password-BKBz_Aon.js → reset-password-DDPC0WP5.js} +1 -1
  149. package/dist/client/assets/reusable-new-chat-CzvRy4Pe.js +1 -0
  150. package/dist/client/assets/{roles-qVXSbIQj.js → roles-qcaRRwf8.js} +1 -1
  151. package/dist/client/assets/{search-input-4YJ4nTbO.js → search-input-Dv3_1Uvp.js} +1 -1
  152. package/dist/client/assets/{secrets-D-r8Fhcp.js → secrets-DcwYYhlg.js} +1 -1
  153. package/dist/client/assets/sections-editor-DNihJe6v.js +2 -0
  154. package/dist/client/assets/{select-BwLC9-0c.js → select-Cf3o4e13.js} +1 -1
  155. package/dist/client/assets/{select-model-DpD5UXaD.js → select-model-B7Rf8Feb.js} +1 -1
  156. package/dist/client/assets/{self-tool-result-BeRzbQuP.js → self-tool-result-BawREriG.js} +1 -1
  157. package/dist/client/assets/seo-editor-D_IRi8v_.js +1 -0
  158. package/dist/client/assets/session-runtime-wVXsCwcJ.js +1 -0
  159. package/dist/client/assets/{settings-layout-DTqIuCHt.js → settings-layout-BgcGIDRi.js} +1 -1
  160. package/dist/client/assets/{shell-controls-vM7eX0ni.js → shell-controls-BkJPCi4L.js} +1 -1
  161. package/dist/client/assets/{shell-layout-DEMtIHgw.js → shell-layout-DPDTGLA3.js} +1 -1
  162. package/dist/client/assets/{spinner-Dpvz3p80.js → spinner-CeAynGXW.js} +1 -1
  163. package/dist/client/assets/{sso-BxyVr7dm.js → sso-BlKU6Kgb.js} +1 -1
  164. package/dist/client/assets/{store-CEc4rXka.js → store-BYS_aOKm.js} +1 -1
  165. package/dist/client/assets/store-registry-BPg2BhqF.js +2 -0
  166. package/dist/client/assets/{switch-DBiih54-.js → switch-EyKGbAqJ.js} +1 -1
  167. package/dist/client/assets/synced-repos-BUf8qMc_.js +1 -0
  168. package/dist/client/assets/{tab-id-DrwxksV4.js → tab-id-BupMUSAp.js} +1 -1
  169. package/dist/client/assets/{table-BM3FdIaA.js → table-ByGDNySe.js} +1 -1
  170. package/dist/client/assets/{tabs-C49oMc7W.js → tabs-YXze6Pex.js} +1 -1
  171. package/dist/client/assets/{task-key-2XocQivt.js → task-key-D6-3eaXs.js} +1 -1
  172. package/dist/client/assets/{tasks-DIZudm73.js → tasks-CjQzsFHS.js} +1 -1
  173. package/dist/client/assets/{textarea-BYMb5MM5.js → textarea-BUU8Uzj2.js} +1 -1
  174. package/dist/client/assets/{toggle-group-DmafBxKV.js → toggle-group-5udoaIQ7.js} +1 -1
  175. package/dist/client/assets/{toolbar-BOPj8b0I.js → toolbar-jStDQiC9.js} +1 -1
  176. package/dist/client/assets/{track-Fq5TqDMp.js → track-x1Ue_gqj.js} +1 -1
  177. package/dist/client/assets/{types-7z_oxg9w.js → types-CWfqP-B-.js} +1 -1
  178. package/dist/client/assets/{use-ai-providers-Ck06PFGE.js → use-ai-providers-BJFNFBW8.js} +1 -1
  179. package/dist/client/assets/{use-api-keys-yafBkhyf.js → use-api-keys-zvnJANCI.js} +1 -1
  180. package/dist/client/assets/{use-automations-BrFXzBSZ.js → use-automations-CJu_L57g.js} +1 -1
  181. package/dist/client/assets/{use-autosave-DzyEelZn.js → use-autosave-xiJNpL3o.js} +1 -1
  182. package/dist/client/assets/{use-clock-tick-anNRVc0o.js → use-clock-tick-BY6Y0vZc.js} +1 -1
  183. package/dist/client/assets/use-commerce-diagnostic-DogDSREs.js +1 -0
  184. package/dist/client/assets/{use-connection-r6ziU6lR.js → use-connection-CrWZq_Ri.js} +1 -1
  185. package/dist/client/assets/{use-copy-BeCWcJQD.js → use-copy-X4stx05l.js} +1 -1
  186. package/dist/client/assets/{use-create-virtual-mcp-CRJnDKdI.js → use-create-virtual-mcp-DnKX51Fm.js} +1 -1
  187. package/dist/client/assets/{use-debounced-autosave-B4C2TeP_.js → use-debounced-autosave-C2GBWe-g.js} +1 -1
  188. package/dist/client/assets/{use-debounced-value-cAUV3o-a.js → use-debounced-value-pQUbNH4F.js} +1 -1
  189. package/dist/client/assets/{use-decopilot-events-DZOEgHZF.js → use-decopilot-events-DS-28zR1.js} +1 -1
  190. package/dist/client/assets/{use-delete-connection-Dkclv4mQ.js → use-delete-connection-B9dJVi18.js} +1 -1
  191. package/dist/client/assets/{use-deployment-admin-BNiRhHXk.js → use-deployment-admin-CzS4BgDQ.js} +1 -1
  192. package/dist/client/assets/{use-file-configs-DGfh8vOd.js → use-file-configs-bqn0DQl-.js} +1 -1
  193. package/dist/client/assets/{use-infinite-scroll-DsDG7oFh.js → use-infinite-scroll-DING_ypo.js} +1 -1
  194. package/dist/client/assets/use-join-requests-COAIroPq.js +1 -0
  195. package/dist/client/assets/{use-mcp-client-BsB3UQx0.js → use-mcp-client-DMgRONuR.js} +1 -1
  196. package/dist/client/assets/{use-mcp-tools-D7WtkO_a.js → use-mcp-tools-CrszPH3e.js} +1 -1
  197. package/dist/client/assets/{use-members-DZPpmeBy.js → use-members-D74i7CK7.js} +1 -1
  198. package/dist/client/assets/use-navigate-to-agent-D-PAXyxX.js +1 -0
  199. package/dist/client/assets/{use-org-auth-client-CR2NXIGs.js → use-org-auth-client-DGlgRRC_.js} +1 -1
  200. package/dist/client/assets/{use-org-repo-syncs-B1gYKpB8.js → use-org-repo-syncs-L_Q9jn6Z.js} +1 -1
  201. package/dist/client/assets/{use-org-sso-BhfC5bai.js → use-org-sso-DIKj2vIX.js} +1 -1
  202. package/dist/client/assets/{use-organization-roles-g149SJyR.js → use-organization-roles-CW54FQjL.js} +1 -1
  203. package/dist/client/assets/{use-organization-settings-WfyIMnA9.js → use-organization-settings-KBGKqIJR.js} +1 -1
  204. package/dist/client/assets/{use-registry-connections-WDHdHLId.js → use-registry-connections-B0WaaMcP.js} +1 -1
  205. package/dist/client/assets/{use-secrets-MMdltV8V.js → use-secrets-Cv3PcVUL.js} +1 -1
  206. package/dist/client/assets/use-section-preview-base-BItk4_Sy.js +1 -0
  207. package/dist/client/assets/{use-status-sounds-IuSNJ3uy.js → use-status-sounds-CTsRBUIT.js} +1 -1
  208. package/dist/client/assets/{use-tags-DN3Y1Fjc.js → use-tags-DB9UyYAF.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-Cecw-Bk2.js → use-view-mode-jGpQ2LaX.js} +1 -1
  210. package/dist/client/assets/{use-virtual-mcp-DkibxhFn.js → use-virtual-mcp-M6mi7VuQ.js} +1 -1
  211. package/dist/client/assets/useInfiniteQuery-BUqQM02C.js +1 -0
  212. package/dist/client/assets/useSuspenseInfiniteQuery-DtiiRZ-l.js +1 -0
  213. package/dist/client/assets/{users-3pVvJjVm.js → users-Csrapr9p.js} +1 -1
  214. package/dist/client/assets/variant-calendar-BEGxTpND.js +1 -0
  215. package/dist/client/assets/{view-mode-toggle-3Ft6ZtrM.js → view-mode-toggle-CemYbpmR.js} +1 -1
  216. package/dist/client/index.html +1 -1
  217. package/dist/server/cli.js +520 -519
  218. package/dist/server/server.js +366 -365
  219. package/package.json +1 -1
  220. package/dist/client/assets/agents-list-DEVfy7bO.js +0 -1
  221. package/dist/client/assets/app-editor-CwurZ13A.js +0 -1
  222. package/dist/client/assets/automations-BU9EygDS.js +0 -1
  223. package/dist/client/assets/bulk-category-panel-q0gXcv7r.js +0 -1
  224. package/dist/client/assets/category-editor-J3ebsbj7.js +0 -1
  225. package/dist/client/assets/chat-context-DzbskOkq.js +0 -35
  226. package/dist/client/assets/collection-detail-DosMB9QP.js +0 -1
  227. package/dist/client/assets/connection-detail-BecsUn3M.js +0 -1
  228. package/dist/client/assets/deco-site-production-url-BjY4ZYd-.js +0 -1
  229. package/dist/client/assets/file-explorer-JPclp_ri.js +0 -2
  230. package/dist/client/assets/index-C5dcfsKv.js +0 -1
  231. package/dist/client/assets/index-CErG4sP_.js +0 -743
  232. package/dist/client/assets/index-_2waRVYp.js +0 -1
  233. package/dist/client/assets/post-editor-CHtqUuEA.js +0 -1
  234. package/dist/client/assets/project-app-view-DZkY6r-W.js +0 -1
  235. package/dist/client/assets/record-editor-BHVAEIpq.js +0 -1
  236. package/dist/client/assets/redirect-editor-DfoPFWBF.js +0 -1
  237. package/dist/client/assets/registry-C7_sqj0C.js +0 -2
  238. package/dist/client/assets/reusable-new-chat-CouMjkYR.js +0 -1
  239. package/dist/client/assets/sections-editor-DCdYW5bN.js +0 -2
  240. package/dist/client/assets/seo-editor-BPRdm9p8.js +0 -1
  241. package/dist/client/assets/store-registry-DVE1XJgw.js +0 -2
  242. package/dist/client/assets/synced-repos-DL_Fe1n5.js +0 -1
  243. package/dist/client/assets/use-commerce-diagnostic-spCFF13q.js +0 -1
  244. package/dist/client/assets/use-join-requests-B_O58DBS.js +0 -1
  245. package/dist/client/assets/use-navigate-to-agent-D_YtZ8Nf.js +0 -1
  246. package/dist/client/assets/use-section-preview-base-WS8WDR0j.js +0 -1
  247. package/dist/client/assets/useInfiniteQuery-Tdf3vSzC.js +0 -1
  248. package/dist/client/assets/useSuspenseInfiniteQuery-Dgd9ebpu.js +0 -1
  249. package/dist/client/assets/variant-calendar-Na_TE_QI.js +0 -1
@@ -1 +0,0 @@
1
- import{c as z,b as G,j as t,C as xn,aj as bn,B as ye,r as V,bq as vn,d as at,w as jn,n as Q,a as Te,t as X,y as yn,k as Ve,a5 as Vt,M as Ut,q as K,_ as qt,Z as Kt,Y as Cn,H as le,f as rt,u as lt,a8 as Me,a9 as Pe,ab as Oe,L as _n,G as wn,ao as Nn,ap as Sn,R as Ct,I as kn,K as Ue,p as In,av as ct,o as He,bn as Dn,b2 as An}from"./index-DLiSt-zY.js";import{i as Wt}from"./ChevronRight-Bbyr31or.js";import{aK as Tn,S as Mn,A as qe,e as Pn,s as gt,aC as On,aL as Fn,aM as zn}from"./agent-icon-RO_lY7mQ.js";import{t as _t}from"./ChevronDown-Dm6QJQj5.js";import{a as dt,i as $n,e as Ln,S as Qt,W as Bn,C as Xt,g as En}from"./constants-_08zpzmT.js";import{u as Rn,a as wt}from"./use-virtual-mcp-DkibxhFn.js";import{a as Xe,b as Nt,P as St}from"./popover-lX6wGPom.js";import{i as st}from"./Check-D4XLgaN4.js";import{s as Ke}from"./Plus-BBdbmkEC.js";import{i as Yt}from"./SearchMd-B5LTpCxn.js";import{s as Zt}from"./XClose-DL2O4uTC.js";import{C as Gn,d as Pt}from"./self-tool-result-BeRzbQuP.js";import{T as kt}from"./toolbar-BOPj8b0I.js";import{D as Jt,a as en,b as tn,c as Hn,g as Vn,e as Un,f as qn}from"./drawer-CMaDObPV.js";import{a as Kn,G as Wn}from"./github-repo-picker-CghdTD4a.js";import{g as Qn,a as nn,u as ut,c as Xn}from"./hooks-BjFStmIb.js";import{u as Yn,g as Zn,a as Jn,b as es}from"./use-navigate-to-agent-D_YtZ8Nf.js";import{b as ts,a as sn,g as ns}from"./agent-capabilities-C4tLW0Za.js";import{u as ft,f as ss}from"./shell-layout-DEMtIHgw.js";import{f as os}from"./reusable-new-chat-CouMjkYR.js";import{C as is}from"./collection-search-TDcC3qnQ.js";import{g as as,a as rs,b as ls,e as cs}from"./extract-connection-data-DDL06q4h.js";import{u as on,a as an,g as ds,C as ht}from"./connection-card-Dg2tFKYT.js";import{e as It,d as Dt,a as At,b as Tt,h as rn,c as us}from"./dialog-CaTBZV_d.js";import{d as pe,a as xe,e as be,b as ve,c as je,F as Ot}from"./form-C1Z3Pgy9.js";import{I as Le}from"./input-CY_6SiUS.js";import{S as fs,a as ms,b as gs,c as hs,d as Qe}from"./select-BwLC9-0c.js";import{T as ps}from"./textarea-BYMb5MM5.js";import{b as ln}from"./use-connection-r6ziU6lR.js";import{n as tt,i as pt}from"./Tool02-xsTmH7TW.js";import{c as xs,i as Ze,a as Ft,E as bs,p as vs,b as js,d as ys}from"./connection-form-helpers-BiSqyE70.js";import{a as xt}from"./authenticate-and-persist-oauth-DaDpqCGj.js";import{g as Cs}from"./connection-slug-eyAPH6o3.js";import{C as _s}from"./collection-tabs-mTx4dyj7.js";import{u as zt}from"./use-infinite-scroll-DsDG7oFh.js";import{B as Je}from"./badge-3w-z2q_R.js";import{u as ws}from"./useSuspenseInfiniteQuery-Dgd9ebpu.js";import{u as Ns,m as $t}from"./use-mcp-client-BsB3UQx0.js";import{g as ot}from"./metadata-dUsYcpuu.js";import{u as Ss}from"./use-ai-providers-Ck06PFGE.js";import{i as ks}from"./FilterLines-4Qetm1ho.js";import{a as Is,T as Ds}from"./toggle-group-DmafBxKV.js";import{d as As,a as Ts,c as Ms,b as Ps,C as Os,e as Fs}from"./command-BmhGhCGW.js";import{i as cn}from"./Zap-DYtDBHNd.js";import{c as zs,d as $s,b as Ls,f as Bs,g as Es,e as Rs,a as Gs,A as Hs}from"./alert-dialog-B3eneGBp.js";import{n as Vs}from"./Stars02-BC82QMl0.js";import{g as Us,u as qs,S as Ks}from"./use-clock-tick-anNRVc0o.js";import{a as Ws}from"./format-time-BnbuEtat.js";import{f as Qs}from"./tab-id-DrwxksV4.js";const Xs="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function Ys(){const n=z.c(13),e=G();let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),n[0]=s):s=n[0];let i;n[1]!==e?(i=e("routes.commerceOnboarding.connectModal.quote"),n[1]=e,n[2]=i):i=n[2];let a;n[3]!==i?(a=t.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",i,"”"]}),n[3]=i,n[4]=a):a=n[4];let o;n[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("img",{src:Xs,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),n[5]=o):o=n[5];let r;n[6]!==e?(r=e("routes.commerceOnboarding.connectModal.quoteAuthor"),n[6]=e,n[7]=r):r=n[7];let l;n[8]!==r?(l=t.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[o,t.jsx("span",{className:"text-base font-medium",children:r})]}),n[8]=r,n[9]=l):l=n[9];let c;return n[10]!==a||n[11]!==l?(c=t.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[s,a,l]}),n[10]=a,n[11]=l,n[12]=c):c=n[12],c}function Zs(){const n=z.c(19),e=G();let s;n[0]!==e?(s=e("routes.commerceOnboarding.connectModal.trustRevoke"),n[0]=e,n[1]=s):s=n[1];let i;n[2]!==s?(i={Icon:Tn,label:s},n[2]=s,n[3]=i):i=n[3];let a;n[4]!==e?(a=e("routes.commerceOnboarding.connectModal.trustEncrypted"),n[4]=e,n[5]=a):a=n[5];let o;n[6]!==a?(o={Icon:xn,label:a},n[6]=a,n[7]=o):o=n[7];let r;n[8]!==e?(r=e("routes.commerceOnboarding.connectModal.trustNeverSold"),n[8]=e,n[9]=r):r=n[9];let l;n[10]!==r?(l={Icon:Mn,label:r},n[10]=r,n[11]=l):l=n[11];let c;n[12]!==i||n[13]!==o||n[14]!==l?(c=[i,o,l],n[12]=i,n[13]=o,n[14]=l,n[15]=c):c=n[15];const d=c;let f;n[16]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"h-px w-full bg-white/15"}),n[16]=f):f=n[16];let m;return n[17]!==d?(m=t.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[f,t.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:d.map(Js)})]}),n[17]=d,n[18]=m):m=n[18],m}function Js(n){const{Icon:e,label:s}=n;return t.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[t.jsx(e,{className:"size-4 shrink-0 opacity-85"}),s]},s)}function ba(n){const e=z.c(22),{siteHost:s,footer:i,onClose:a,children:o}=n,r=G(),l=s?`https://www.google.com/s2/favicons?domain=${s}&sz=128`:null;let c;e[0]!==a||e[1]!==r?(c=a&&t.jsx("button",{type:"button",onClick:a,"aria-label":r("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:t.jsx(bn,{size:18})}),e[0]=a,e[1]=r,e[2]=c):c=e[2];let d,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),f=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),e[3]=d,e[4]=f):(d=e[3],f=e[4]);let m;e[5]!==l||e[6]!==s?(m=s&&t.jsxs(t.Fragment,{children:[t.jsx(Wt,{size:16,className:"shrink-0 text-foreground/25"}),l&&t.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:t.jsx("img",{src:l,alt:"",className:"size-full"})}),t.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:s})]}),e[5]=l,e[6]=s,e[7]=m):m=e[7];let u;e[8]!==m?(u=t.jsxs("div",{className:"flex items-center gap-2",children:[d,f,m]}),e[8]=m,e[9]=u):u=e[9];let p;e[10]!==i?(p=t.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:i}),e[10]=i,e[11]=p):p=e[11];let y;e[12]!==o||e[13]!==u||e[14]!==p?(y=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[u,o,p]}),e[12]=o,e[13]=u,e[14]=p,e[15]=y):y=e[15];let x,g;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),g=t.jsx("div",{className:"absolute inset-0 bg-black/20"}),e[16]=x,e[17]=g):(x=e[16],g=e[17]);let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[x,g,t.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[t.jsx("div",{className:"flex-1"}),t.jsx(Ys,{}),t.jsx("div",{className:"flex-1"}),t.jsx(Zs,{})]})]}),e[18]=h):h=e[18];let b;return e[19]!==c||e[20]!==y?(b=t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[c,y,h]}),e[19]=c,e[20]=y,e[21]=b):b=e[21],b}function va(n){const e=z.c(5),{ready:s,pending:i,label:a,onClick:o,children:r}=n,l=i||!s,c=s&&!i?r:null;let d;return e[0]!==a||e[1]!==o||e[2]!==l||e[3]!==c?(d=t.jsxs(ye,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:o,disabled:l,children:[a,c]}),e[0]=a,e[1]=o,e[2]=l,e[3]=c,e[4]=d):d=e[4],d}function dn(){const n=V.useContext(vn),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(a=>a.status==="pending"&&new Date(a.expiresAt)>new Date),refetch:()=>s?.()}}function eo(n){let e=0;for(let i=0;i<n.length;i++)e=n.charCodeAt(i)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function Mt(n){const e=z.c(13),{org:s,size:i}=n,a=i===void 0?"sm":i,o=a==="xs"?"size-5":"size-6",r=a==="xs"?"text-[9px]":"text-xs";let l;e[0]!==o?(l=Q(o,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=o,e[1]=l):l=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:eo(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let d;e[5]!==s.logo||e[6]!==s.name||e[7]!==r?(d=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:Q("font-semibold leading-none",r),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=r,e[8]=d):d=e[8];let f;return e[9]!==l||e[10]!==c||e[11]!==d?(f=t.jsx("div",{className:l,style:c,children:d}),e[9]=l,e[10]=c,e[11]=d,e[12]=f):f=e[12],f}function to({invitation:n,onChanged:e}){const s=G(),[i,a]=V.useState(!1),o=n.organizationName??s("header.orgSwitcher.unknownOrganization"),r=async()=>{a(!0);try{const d=await Te.organization.acceptInvitation({invitationId:n.id});if(d.error){X.error(d.error.message),a(!1);return}}catch{X.error(s("header.orgSwitcher.failedToAcceptInvitation")),a(!1);return}X.success(s("header.orgSwitcher.joined",{name:o})),yn();let c;try{c=(await Te.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},l=async()=>{a(!0);try{const c=await Te.organization.rejectInvitation({invitationId:n.id});if(c.error){X.error(c.error.message),a(!1);return}X.success(s("header.orgSwitcher.invitationDeclined")),a(!1),e()}catch{X.error(s("header.orgSwitcher.failedToDeclineInvitation")),a(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(Mt,{org:{name:o},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:o}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(ye,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:i,children:s("header.orgSwitcher.accept")}),t.jsx(ye,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:i,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:o}),children:t.jsx(Zt,{size:14})})]})]})}function no(n){const e=z.c(32),{orgParam:s,onSelectOrg:i,onCreateOrg:a}=n,o=G(),{data:r}=jn(),{invitations:l,refetch:c}=dn();let d;e[0]!==s?(d=(P,D)=>P.slug===s?-1:D.slug===s?1:P.name.localeCompare(D.name),e[0]=s,e[1]=d):d=e[1];const f=[...r??[]].sort(d),[m,u]=V.useState(""),p=m.toLowerCase(),y=p?f.filter(P=>P.name.toLowerCase().includes(p)||P.slug.toLowerCase().includes(p)):f;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Yt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=P=>u(P.target.value),e[3]=g):g=e[3];let h;e[4]!==m?(h=P=>P.key==="Escape"&&m&&u(""),e[4]=m,e[5]=h):h=e[5];let b;e[6]!==o?(b=o("header.orgSwitcher.searchOrganizations"),e[6]=o,e[7]=b):b=e[7];let j;e[8]!==m||e[9]!==h||e[10]!==b?(j=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:g,onKeyDown:h,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=m,e[9]=h,e[10]=b,e[11]=j):j=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ke,{size:16}),e[12]=C):C=e[12];let w;e[13]!==a?(w=t.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:C}),e[13]=a,e[14]=w):w=e[14];let I;e[15]!==j||e[16]!==w?(I=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,j,w]}),e[15]=j,e[16]=w,e[17]=I):I=e[17];const M="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let v;e[18]!==l||e[19]!==m||e[20]!==c?(v=!m&&l.map(P=>t.jsx(to,{invitation:P,onChanged:c},P.id)),e[18]=l,e[19]=m,e[20]=c,e[21]=v):v=e[21];const N=y.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:m?o("header.orgSwitcher.noOrganizationsMatch",{query:m}):o("header.orgSwitcher.noOrganizationsAvailable")});let A;e[22]!==i||e[23]!==s?(A=P=>t.jsxs("button",{type:"button",onClick:()=>i(P.slug),className:Q("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",P.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(Mt,{org:P,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:P.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.slug})]}),P.slug===s&&t.jsx(st,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},P.id),e[22]=i,e[23]=s,e[24]=A):A=e[24];const S=y.map(A);let _;e[25]!==v||e[26]!==N||e[27]!==S?(_=t.jsxs("div",{className:M,children:[v,N,S]}),e[25]=v,e[26]=N,e[27]=S,e[28]=_):_=e[28];let T;return e[29]!==_||e[30]!==I?(T=t.jsxs(t.Fragment,{children:[I,_]}),e[29]=_,e[30]=I,e[31]=T):T=e[31],T}function so(n){const e=z.c(22),{trigger:s,orgParam:i,align:a,side:o}=n,r=a===void 0?"start":a,l=o===void 0?"bottom":o,c=at(),[d,f]=V.useState(!1),[m,u]=V.useState(!1);let p;e[0]!==s?(p=t.jsx(Xe,{asChild:!0,children:s}),e[0]=s,e[1]=p):p=e[1];const y=String(d);let x;e[2]!==c?(x=I=>{f(!1),c({to:"/$org",params:{org:I}})},e[2]=c,e[3]=x):x=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{f(!1),u(!0)},e[4]=g):g=e[4];let h;e[5]!==i||e[6]!==y||e[7]!==x?(h=t.jsx(no,{orgParam:i,onSelectOrg:x,onCreateOrg:g},y),e[5]=i,e[6]=y,e[7]=x,e[8]=h):h=e[8];let b;e[9]!==r||e[10]!==l||e[11]!==h?(b=t.jsx(Nt,{side:l,align:r,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:io,onCloseAutoFocus:oo,children:h}),e[9]=r,e[10]=l,e[11]=h,e[12]=b):b=e[12];let j;e[13]!==d||e[14]!==p||e[15]!==b?(j=t.jsxs(St,{open:d,onOpenChange:f,children:[p,b]}),e[13]=d,e[14]=p,e[15]=b,e[16]=j):j=e[16];let C;e[17]!==m?(C=t.jsx(Gn,{open:m,onOpenChange:u}),e[17]=m,e[18]=C):C=e[18];let w;return e[19]!==C||e[20]!==j?(w=t.jsxs(t.Fragment,{children:[j,C]}),e[19]=C,e[20]=j,e[21]=w):w=e[21],w}function oo(n){return n.preventDefault()}function io(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ao(n){const e=z.c(21),{value:s,onChange:i,placeholder:a,onKeyDown:o,className:r,isSearching:l,disabled:c}=n,d=a===void 0?"Search...":a;let f;e[0]!==r?(f=Q("shrink-0 w-full border-b border-border h-12",r),e[0]=r,e[1]=f):f=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let u;e[2]!==m?(u=Q("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=u):u=e[3];let p;e[4]!==l?(p=l?t.jsx(Ve,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(Yt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=p):p=e[5];let y;e[6]!==i?(y=b=>i(b.target.value),e[6]=i,e[7]=y):y=e[7];let x;e[8]!==c||e[9]!==o||e[10]!==d||e[11]!==y||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:y,onKeyDown:o,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=o,e[10]=d,e[11]=y,e[12]=s,e[13]=x):x=e[13];let g;e[14]!==u||e[15]!==p||e[16]!==x?(g=t.jsxs("label",{className:u,children:[p,x]}),e[14]=u,e[15]=p,e[16]=x,e[17]=g):g=e[17];let h;return e[18]!==f||e[19]!==g?(h=t.jsx("div",{className:f,children:g}),e[18]=f,e[19]=g,e[20]=h):h=e[20],h}function ro(n,e,s){if(!s)return null;const i=Qn(n,e);return i?i.threads.get().find(o=>o.id===s)?.branch??null:null}function lo(n){const e=z.c(6),{value:s,onChange:i}=n,a=G();let o;e[0]!==a?(o=a("sidebar.agentsSection.searchAgents"),e[0]=a,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o||e[4]!==s?(r=t.jsx(ao,{value:s,onChange:i,placeholder:o}),e[2]=i,e[3]=o,e[4]=s,e[5]=r):r=e[5],r}function co(){const n=z.c(4),e=G();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=i):i=n[3],i}function uo(n){const e=z.c(10),{org:s,onClose:i}=n,a=G();let o;e[0]!==s.slug?(o={org:s.slug},e[0]=s.slug,e[1]=o):o=e[1];let r;e[2]!==i?(r=()=>i(),e[2]=i,e[3]=r):r=e[3];let l;e[4]!==a?(l=a("sidebar.agentsSection.seeAllAgents"),e[4]=a,e[5]=l):l=e[5];let c;return e[6]!==o||e[7]!==r||e[8]!==l?(c=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(_n,{to:"/$org/settings/agents",params:o,onClick:r,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:l})}),e[6]=o,e[7]=r,e[8]=l,e[9]=c):c=e[9],c}function fo(){const n=z.c(4),e=G();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(un,{children:s}),n[2]=s,n[3]=i):i=n[3],i}function mo(n){const e=z.c(11),{onImportFromGithub:s}=n,i=G();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Wn,{className:"size-3.5"}),e[0]=a):a=e[0];let o;e[1]!==i?(o=i("sidebar.agentsSection.import"),e[1]=i,e[2]=o):o=e[2];let r;e[3]!==s||e[4]!==o?(r=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[a,o]}),e[3]=s,e[4]=o,e[5]=r):r=e[5];let l;e[6]!==i?(l=i("sidebar.agentsSection.codeAgents"),e[6]=i,e[7]=l):l=e[7];let c;return e[8]!==r||e[9]!==l?(c=t.jsx(un,{action:r,children:l}),e[8]=r,e[9]=l,e[10]=c):c=e[10],c}function go(n){const e=z.c(11),{setOpen:s,emptyCtaClass:i}=n,a=G();let o;e[0]!==a?(o=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=o):o=e[1];let r;e[2]!==i?(r=Q(i),e[2]=i,e[3]=r):r=e[3];let l;e[4]!==s?(l=()=>{K("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=l):l=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ke,{className:"size-4"}),e[6]=c):c=e[6];let d;return e[7]!==o||e[8]!==r||e[9]!==l?(d=t.jsx(kt,{"aria-label":o,className:r,onClick:l,children:c}),e[7]=o,e[8]=r,e[9]=l,e[10]=d):d=e[10],d}function ho(n){const e=z.c(17),{setOpen:s,highlightEmpty:i,emptyCtaClass:a}=n,o=G();let r;e[0]!==i||e[1]!==o?(r=i?void 0:o("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o,e[2]=r):r=e[2];let l;e[3]!==a?(l=Q(a),e[3]=a,e[4]=l):l=e[4];let c;e[5]!==s?(c=()=>{K("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=c):c=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ke,{}),e[7]=d):d=e[7];let f;e[8]!==o?(f=o("sidebar.agentsSection.newAgent"),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=t.jsx("span",{children:f}),e[10]=f,e[11]=m):m=e[11];let u;return e[12]!==r||e[13]!==l||e[14]!==c||e[15]!==m?(u=t.jsx(qt,{children:t.jsxs(Kt,{tooltip:r,className:l,onClick:c,children:[d,m]})}),e[12]=r,e[13]=l,e[14]=c,e[15]=m,e[16]=u):u=e[16],u}function po(){const n=z.c(4),e=G();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(tn,{className:"sr-only",children:s}),n[2]=s,n[3]=i):i=n[3],i}function xo(n){const e=z.c(8),{emptyCtaClass:s}=n,i=G();let a;e[0]!==i?(a=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=a):a=e[1];let o;e[2]!==s?(o=Q(s),e[2]=s,e[3]=o):o=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ke,{className:"size-4"}),e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==o?(l=t.jsx(kt,{"aria-label":a,className:o,children:r}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function bo(n){const e=z.c(19),{wrapEmptyHint:s,highlightEmpty:i,emptyCtaClass:a}=n,o=G();let r;e[0]!==i||e[1]!==o?(r=i?void 0:o("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o,e[2]=r):r=e[2];let l;e[3]!==a?(l=Q(a),e[3]=a,e[4]=l):l=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ke,{}),e[5]=c):c=e[5];let d;e[6]!==o?(d=o("sidebar.agentsSection.newAgent"),e[6]=o,e[7]=d):d=e[7];let f;e[8]!==d?(f=t.jsx("span",{children:d}),e[8]=d,e[9]=f):f=e[9];let m;e[10]!==r||e[11]!==l||e[12]!==f?(m=t.jsx(Xe,{asChild:!0,children:t.jsxs(Kt,{tooltip:r,className:l,children:[c,f]})}),e[10]=r,e[11]=l,e[12]=f,e[13]=m):m=e[13];let u;e[14]!==m||e[15]!==s?(u=s(m),e[14]=m,e[15]=s,e[16]=u):u=e[16];let p;return e[17]!==u?(p=t.jsx(qt,{children:u}),e[17]=u,e[18]=p):p=e[18],p}function vo(n){const e=z.c(9),{children:s}=n,i=G();let a;e[0]!==s?(a=t.jsx(Me,{asChild:!0,children:s}),e[0]=s,e[1]=a):a=e[1];let o;e[2]!==i?(o=i("sidebar.agentsSection.selectAnExistingAgent"),e[2]=i,e[3]=o):o=e[3];let r;e[4]!==o?(r=t.jsx(Pe,{side:"right",sideOffset:8,children:o}),e[4]=o,e[5]=r):r=e[5];let l;return e[6]!==a||e[7]!==r?(l=t.jsxs(Oe,{defaultOpen:!0,delayDuration:0,children:[a,r]}),e[6]=a,e[7]=r,e[8]=l):l=e[8],l}function jo(n){const e=at(),{create:s}=nn(),{locator:i}=le(),a=rt({strict:!1}),o=lt({strict:!1});return async r=>{const l=crypto.randomUUID(),c=r===o.virtualmcpid?ro(n,i,a.taskId??""):null;try{await s({id:l,virtual_mcp_id:r,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:l},search:{virtualmcpid:r}})}}function bt(n){const e=z.c(20),{agent:s,selected:i,onClick:a}=n,o=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let r;e[0]!==o?(r=Q("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",o),e[0]=o,e[1]=r):r=e[1];let l;e[2]!==s.icon||e[3]!==s.title?(l=t.jsx(qe,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=l):l=e[4];let c;e[5]!==s.title?(c=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=c):c=e[6];let d;e[7]!==s.description?(d=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=d):d=e[8];let f;e[9]!==c||e[10]!==d?(f=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,d]}),e[9]=c,e[10]=d,e[11]=f):f=e[11];let m;e[12]!==i?(m=i&&t.jsx(st,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=m):m=e[13];let u;return e[14]!==a||e[15]!==r||e[16]!==l||e[17]!==f||e[18]!==m?(u=t.jsxs("button",{type:"button",onClick:a,className:r,children:[l,f,m]}),e[14]=a,e[15]=r,e[16]=l,e[17]=f,e[18]=m,e[19]=u):u=e[19],u}function un(n){const e=z.c(5),{children:s,action:i}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let o;return e[2]!==i||e[3]!==a?(o=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[a,i]}),e[2]=i,e[3]=a,e[4]=o):o=e[4],o}function yo(n){const e=z.c(23),{onClose:s,onSelectAgent:i,selectedAgentId:a,onImportFromGithub:o}=n,[r,l]=V.useState(""),c=Rn(),d=c??[],{org:f}=le(),{data:m}=Te.useSession(),u=m?.user?.id??"anon",p=Zn(c),y=Jn(),x=jo(f.slug),g=ts(c),h=r.toLowerCase(),b=d.filter(No).filter(E=>!g.has(E.id)).filter(wo).filter(E=>!r||E.title.toLowerCase().includes(h)),j=b.filter(_o),C=b.filter(Co),w=dt(f.id),I=!r||w.title.toLowerCase().includes(h),M=!!(i&&I);let v;e[0]!==s||e[1]!==i?(v=()=>{i?.(null),s(),l("")},e[0]=s,e[1]=i,e[2]=v):v=e[2];const N=v,A=E=>{if(i){i(E.id),s(),l("");return}es({orgId:f.id,userId:u},E.id,p),y(),s(),l(""),x(E.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let _;e[3]!==r?(_=t.jsx(lo,{value:r,onChange:l}),e[3]=r,e[4]=_):_=e[4];const T="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",P=i&&I&&w&&t.jsx(bt,{agent:w,selected:!a||a===w.id,onClick:N}),D=(j.length>0||!r)&&t.jsx(mo,{onImportFromGithub:o}),F=j.map(E=>t.jsx(bt,{agent:E,selected:i?a===E.id:void 0,onClick:()=>A(E)},E.id)),L=C.length>0&&t.jsx(fo,{}),O=C.map(E=>t.jsx(bt,{agent:E,selected:i?a===E.id:void 0,onClick:()=>A(E)},E.id));let $;e[5]!==M||e[6]!==r||e[7]!==b.length?($=b.length===0&&!M&&r&&t.jsx(co,{}),e[5]=M,e[6]=r,e[7]=b.length,e[8]=$):$=e[8];let U;e[9]!==$||e[10]!==P||e[11]!==D||e[12]!==F||e[13]!==L||e[14]!==O?(U=t.jsxs("div",{className:T,children:[P,D,F,L,O,$]}),e[9]=$,e[10]=P,e[11]=D,e[12]=F,e[13]=L,e[14]=O,e[15]=U):U=e[15];let R;e[16]!==s||e[17]!==f?(R=t.jsx(uo,{org:f,onClose:s}),e[16]=s,e[17]=f,e[18]=R):R=e[18];let q;return e[19]!==U||e[20]!==R||e[21]!==_?(q=t.jsxs("div",{className:S,children:[_,U,R]}),e[19]=U,e[20]=R,e[21]=_,e[22]=q):q=e[22],q}function Co(n){return!sn(n.metadata)}function _o(n){return sn(n.metadata)}function wo(n){return!Ln(n.id)}function No(n){return!$n(n.id)}function So(n){const e=z.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:i,trigger:a,onSelectAgent:o,selectedAgentId:r,side:l,align:c}=s,d=i===void 0?!1:i,f=l===void 0?"right":l,m=c===void 0?"start":c,[u,p]=V.useState(!1),[y,x]=V.useState(!1),g=Vt(),{setOpenMobile:h}=Ut(),b=Yn(),j=b?"border border-border":void 0;let C;e[2]!==b?(C=D=>b?t.jsx(vo,{children:D}):D,e[2]=b,e[3]=C):C=e[3];const w=C;let I;e[4]!==g||e[5]!==h?(I=()=>{p(!1),g&&h(!1)},e[4]=g,e[5]=h,e[6]=I):I=e[6];const M=I;let v;e[7]!==M?(v=()=>{M(),x(!0)},e[7]=M,e[8]=v):v=e[8];const N=v;let A;e[9]!==M||e[10]!==N||e[11]!==o||e[12]!==u||e[13]!==r?(A=u&&t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Cn,{className:"h-4 w-24"})}),children:t.jsx(yo,{onClose:M,onSelectAgent:o,selectedAgentId:r,onImportFromGithub:N})}),e[9]=M,e[10]=N,e[11]=o,e[12]=u,e[13]=r,e[14]=A):A=e[14];const S=A;let _;e[15]!==m||e[16]!==d||e[17]!==j||e[18]!==b||e[19]!==g||e[20]!==u||e[21]!==S||e[22]!==f||e[23]!==a||e[24]!==w?(_=g?t.jsxs(t.Fragment,{children:[a?t.jsx("button",{type:"button",onClick:()=>p(!0),className:"contents",children:a}):d?w(t.jsx(go,{setOpen:p,emptyCtaClass:j})):t.jsx(ho,{setOpen:p,highlightEmpty:b,emptyCtaClass:j}),t.jsx(Jt,{open:u,onOpenChange:p,direction:"bottom",children:t.jsxs(en,{className:"max-h-[85dvh] p-0",children:[t.jsx(po,{}),S]})})]}):t.jsxs(St,{open:u,onOpenChange:D=>{D&&!u&&K("agent_browser_opened",{surface:"desktop_popover"}),p(D)},children:[a?t.jsx(Xe,{asChild:!0,children:a}):d?w(t.jsx(Xe,{asChild:!0,children:t.jsx(xo,{emptyCtaClass:j})})):t.jsx(bo,{wrapEmptyHint:w,highlightEmpty:b,emptyCtaClass:j}),t.jsx(Nt,{className:"w-[380px] p-0 overflow-hidden",side:f,align:m,children:S})]}),e[15]=m,e[16]=d,e[17]=j,e[18]=b,e[19]=g,e[20]=u,e[21]=S,e[22]=f,e[23]=a,e[24]=w,e[25]=_):_=e[25];let T;e[26]!==y?(T=t.jsx(Kn,{open:y,onOpenChange:x,mode:"agent"}),e[26]=y,e[27]=T):T=e[27];let P;return e[28]!==T||e[29]!==_?(P=t.jsxs(t.Fragment,{children:[_,T]}),e[28]=T,e[29]=_,e[30]=P):P=e[30],P}const ko="inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Io(n){const e=z.c(29),{agentId:s,fallback:i,onOpenHome:a,onPick:o}=n,r=G(),l=wt(s)??i??null;let c,d,f,m,u;e[0]!==l?.title||e[1]!==a||e[2]!==r?(u=l?.title??r("header.shellBreadcrumb.superAgentDefaultName"),m="flex min-w-0 items-center gap-0",c="button",d=a,f=r("header.shellBreadcrumb.openAgentHome",{name:u}),e[0]=l?.title,e[1]=a,e[2]=r,e[3]=c,e[4]=d,e[5]=f,e[6]=m,e[7]=u):(c=e[3],d=e[4],f=e[5],m=e[6],u=e[7]);const p=l?.icon??null;let y;e[8]!==p||e[9]!==u?(y=t.jsx(qe,{icon:p,name:u,size:"xs"}),e[8]=p,e[9]=u,e[10]=y):y=e[10];let x;e[11]!==c||e[12]!==d||e[13]!==f||e[14]!==y?(x=t.jsx("button",{type:c,onClick:d,"aria-label":f,className:"flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:y}),e[11]=c,e[12]=d,e[13]=f,e[14]=y,e[15]=x):x=e[15];let g;e[16]!==u?(g=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:u}),e[16]=u,e[17]=g):g=e[17];let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(_t,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=h):h=e[18];let b;e[19]!==g?(b=t.jsxs("button",{type:"button",className:ko,children:[g,h]}),e[19]=g,e[20]=b):b=e[20];let j;e[21]!==s||e[22]!==o||e[23]!==b?(j=t.jsx(So,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:o,trigger:b}),e[21]=s,e[22]=o,e[23]=b,e[24]=j):j=e[24];let C;return e[25]!==j||e[26]!==m||e[27]!==x?(C=t.jsxs("div",{className:m,children:[x,j]}),e[25]=j,e[26]=m,e[27]=x,e[28]=C):C=e[28],C}function ja(n){const e=z.c(30);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:i}=s,a=G(),{org:o}=le(),{state:r,isMobile:l}=Ut(),c=dn().invitations.length>0,d=r==="collapsed"||l;let f;e[2]!==c||e[3]!==o.name||e[4]!==a?(f=c?a("header.shellBreadcrumb.switchOrganizationPendingInvitation",{name:o.name}):a("header.shellBreadcrumb.switchOrganization",{name:o.name}),e[2]=c,e[3]=o.name,e[4]=a,e[5]=f):f=e[5];let m;e[6]!==o?(m=t.jsx(Mt,{org:o,size:"sm"}),e[6]=o,e[7]=m):m=e[7];let u;e[8]!==c||e[9]!==d?(u=c&&t.jsx("span",{className:Q("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[8]=c,e[9]=d,e[10]=u):u=e[10];let p;e[11]!==m||e[12]!==u?(p=t.jsxs("span",{className:"relative inline-flex",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13];let y;e[14]!==o.name||e[15]!==i?(y=i&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[14]=o.name,e[15]=i,e[16]=y):y=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(_t,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[17]=x):x=e[17];let g;e[18]!==f||e[19]!==p||e[20]!==y?(g=t.jsx(Me,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":f,className:"flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[p,y,x]})}),e[18]=f,e[19]=p,e[20]=y,e[21]=g):g=e[21];let h;e[22]!==o.slug||e[23]!==g?(h=t.jsx(so,{orgParam:o.slug,trigger:g}),e[22]=o.slug,e[23]=g,e[24]=h):h=e[24];let b;e[25]!==o.name?(b=t.jsx(Pe,{side:"bottom",children:o.name}),e[25]=o.name,e[26]=b):b=e[26];let j;return e[27]!==b||e[28]!==h?(j=t.jsxs(Oe,{children:[h,b]}),e[27]=b,e[28]=h,e[29]=j):j=e[29],j}function ya(n){const e=z.c(22);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,{org:a}=le();let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[2]=o):o=e[2];const r=rt(o);let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[3]=l):l=e[3];const c=lt(l),{threads:d}=ut(),{data:f}=Te.useSession(),{setTaskId:m,createNewTask:u}=ft();let p;e[4]!==a.id?(p=dt(a.id),e[4]=a.id,e[5]=p):p=e[5];const y=p,x=y.id,g=r.taskId?c.virtualmcpid??x:x;let h;e[6]!==u||e[7]!==x||e[8]!==i||e[9]!==f?.user?.id||e[10]!==m||e[11]!==d?(h=M=>{const v=M??x,N=os(d,v,f?.user?.id);N?m(N.id,v):u(v),i?.()},e[6]=u,e[7]=x,e[8]=i,e[9]=f?.user?.id,e[10]=m,e[11]=d,e[12]=h):h=e[12];const b=h;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=j):j=e[13];const C=g===x?y:void 0;let w;e[14]!==g||e[15]!==b?(w=()=>b(g),e[14]=g,e[15]=b,e[16]=w):w=e[16];let I;return e[17]!==g||e[18]!==b||e[19]!==C||e[20]!==w?(I=t.jsx(V.Suspense,{fallback:j,children:t.jsx(Io,{agentId:g,fallback:C,onOpenHome:w,onPick:b})}),e[17]=g,e[18]=b,e[19]=C,e[20]=w,e[21]=I):I=e[21],I}function Ca(){const n=z.c(24),e=G(),{org:s}=le();let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[0]=i):i=n[0];const a=rt(i);let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},n[1]=o):o=n[1];const r=lt(o),{threads:l}=ut(),{createNewTask:c}=ft();let d;n[2]!==s.id?(d=dt(s.id),n[2]=s.id,n[3]=d):d=n[3];const f=d.id,m=a.taskId?r.virtualmcpid??f:f;let u;n[4]!==a.taskId||n[5]!==l?(u=(a.taskId?l.find(I=>I.id===a.taskId)?.branch:null)??null,n[4]=a.taskId,n[5]=l,n[6]=u):u=n[6];const p=u;let y;n[7]!==m||n[8]!==c||n[9]!==p?(y=()=>{c(m,p)},n[7]=m,n[8]=c,n[9]=p,n[10]=y):y=n[10];const x=y;let g;n[11]!==e?(g=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=g):g=n[12];let h;n[13]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Pn,{size:16}),n[13]=h):h=n[13];let b;n[14]!==x||n[15]!==g?(b=t.jsx(Me,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":g,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:h})}),n[14]=x,n[15]=g,n[16]=b):b=n[16];let j;n[17]!==e?(j=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=j):j=n[18];let C;n[19]!==j?(C=t.jsx(Pe,{side:"bottom",children:j}),n[19]=j,n[20]=C):C=n[20];let w;return n[21]!==b||n[22]!==C?(w=t.jsxs(Oe,{children:[b,C]}),n[21]=b,n[22]=C,n[23]=w):w=n[23],w}function Do({open:n,onOpenChange:e,onCreated:s}){const i=G(),{org:a}=le(),{data:o}=Te.useSession(),{stdioEnabled:r}=wn(),l=Vt(),c=ln(),d=on(),m=an(d,"").items,u=Nn({resolver:Sn(xs),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=u.watch("ui_type"),y=u.watch("connection_url"),x=u.watch("npx_package"),g=Ze({uiType:p,connectionUrl:y??"",npxPackage:x??""})??Ft({uiType:p,connectionUrl:y??"",registryItems:m}),h=v=>{const N=v.trim();if(!N)return;const A=!!u.formState.dirtyFields.title,S=!!u.formState.dirtyFields.description,_=!!u.formState.dirtyFields.env_vars,T=D=>{if(D&&(!A&&!u.getValues("title").trim()&&D.title&&u.setValue("title",D.title,{shouldDirty:!1}),!S&&!(u.getValues("description")??"").trim()&&D.description&&u.setValue("description",D.description,{shouldDirty:!1}),!_&&D.envVarKeys?.length)){const F=u.getValues("env_vars")??[],L=new Set(F.map($=>$.key)),O=D.envVarKeys.filter($=>!L.has($));O.length>0&&u.setValue("env_vars",[...F,...O.map($=>({key:$,value:""}))],{shouldDirty:!0})}},P=vs(N);if(P&&r){u.setValue("ui_type","NPX",{shouldDirty:!0}),u.setValue("npx_package",P.packageName,{shouldDirty:!0}),u.setValue("connection_url","",{shouldDirty:!0}),u.setValue("connection_token",null,{shouldDirty:!0}),T(Ze({uiType:"NPX",npxPackage:P.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const D=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";u.setValue("ui_type",D,{shouldDirty:!0}),u.setValue("connection_url",N,{shouldDirty:!0}),T(Ze({uiType:D,connectionUrl:N})??Ft({uiType:D,connectionUrl:N,registryItems:m}));return}p==="NPX"&&T(Ze({uiType:"NPX",npxPackage:N}))},b=v=>{v||u.reset(),e(v)},j=async v=>{let N,A=null,S=null,_=null;v.ui_type==="NPX"?(N="STDIO",A="",_=js(v.npx_package||"",v.env_vars||[])):v.ui_type==="STDIO"?(N="STDIO",A="",_=ys(v.stdio_command||"",v.stdio_args||"",v.stdio_cwd,v.env_vars||[])):(N=v.ui_type,A=v.connection_url||"",S=v.connection_token||null);const T=as("conn");try{await c.create.mutateAsync({id:T,title:v.title,description:v.description||null,connection_type:N,connection_url:A,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:a.id,icon:v.icon??null,app_name:null,app_id:null,connection_headers:_,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),u.reset(),e(!1),s?.(T)}catch{X.error(i("connections.createConnectionDialog.failedToCreateConnection"))}},C=i("connections.createConnectionDialog.title"),w=i("connections.createConnectionDialog.description"),I=u.formState.isSubmitting?i("connections.createConnectionDialog.saving"):i("connections.createConnectionDialog.createButton"),M=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(pe,{control:u.control,name:"ui_type",render:({field:v})=>t.jsxs(xe,{children:[t.jsx(be,{children:i("connections.createConnectionDialog.typeLabel")}),t.jsxs(fs,{value:v.value,onValueChange:v.onChange,children:[t.jsx(ve,{children:t.jsx(ms,{children:t.jsx(gs,{})})}),t.jsxs(hs,{children:[t.jsx(Qe,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"w-4 h-4"}),i("connections.createConnectionDialog.httpType")]})}),t.jsx(Qe,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"w-4 h-4"}),i("connections.createConnectionDialog.sseType")]})}),t.jsx(Qe,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"w-4 h-4"}),i("connections.createConnectionDialog.websocketType")]})}),r&&t.jsxs(t.Fragment,{children:[t.jsx(Qe,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(tt,{className:"w-4 h-4"}),i("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(Qe,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(On,{className:"w-4 h-4"}),i("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(je,{})]})}),p==="NPX"&&t.jsx(pe,{control:u.control,name:"npx_package",render:({field:v})=>t.jsxs(xe,{children:[t.jsx(be,{children:i("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(ve,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.npmPackagePlaceholder"),...v,value:v.value??"",onPaste:N=>{const A=N.clipboardData.getData("text");A&&(N.preventDefault(),u.setValue("npx_package",A.trim(),{shouldDirty:!0}),h(A))},onBlur:N=>{h(N.target.value),v.onBlur()}})}),t.jsx(je,{})]})}),p==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(pe,{control:u.control,name:"stdio_command",render:({field:v})=>t.jsxs(xe,{children:[t.jsx(be,{children:i("connections.createConnectionDialog.commandLabel")}),t.jsx(ve,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.commandPlaceholder"),...v,value:v.value??""})}),t.jsx(je,{})]})}),t.jsx(pe,{control:u.control,name:"stdio_args",render:({field:v})=>t.jsxs(xe,{children:[t.jsx(be,{children:i("connections.createConnectionDialog.argumentsLabel")}),t.jsx(ve,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.argumentsPlaceholder"),...v,value:v.value??""})}),t.jsx(je,{})]})})]}),t.jsx(pe,{control:u.control,name:"stdio_cwd",render:({field:v})=>t.jsxs(xe,{children:[t.jsx(be,{children:i("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(ve,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.workingDirectoryPlaceholder"),...v,value:v.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(je,{})]})})]}),(p==="NPX"||p==="STDIO")&&t.jsx(pe,{control:u.control,name:"env_vars",render:({field:v})=>t.jsxs(xe,{children:[t.jsx(be,{children:i("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(ve,{children:t.jsx(bs,{value:v.value??[],onChange:v.onChange})}),t.jsx(je,{})]})}),p!=="NPX"&&p!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(pe,{control:u.control,name:"connection_url",render:({field:v})=>t.jsxs(xe,{children:[t.jsx(be,{children:i("connections.createConnectionDialog.urlLabel")}),t.jsx(ve,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.urlPlaceholder"),...v,value:v.value??"",onPaste:N=>{const A=N.clipboardData.getData("text");A&&(N.preventDefault(),u.setValue("connection_url",A.trim(),{shouldDirty:!0}),h(A))},onBlur:N=>{h(N.target.value),v.onBlur()}})}),t.jsx(je,{})]})}),t.jsx(pe,{control:u.control,name:"connection_token",render:({field:v})=>t.jsxs(xe,{children:[t.jsx(be,{children:g?.token?.label??i("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(ve,{children:t.jsx(Le,{type:"password",placeholder:g?.token?.placeholder??i("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...v,value:v.value??""})}),g?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.token.helperText,g.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:i("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(je,{})]})})]}),t.jsx(pe,{control:u.control,name:"title",render:({field:v})=>t.jsxs(xe,{children:[t.jsx(be,{children:i("connections.createConnectionDialog.nameLabel")}),t.jsx(ve,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.namePlaceholder"),...v})}),t.jsx(je,{})]})}),t.jsx(pe,{control:u.control,name:"description",render:({field:v})=>t.jsxs(xe,{children:[t.jsx(be,{children:i("connections.createConnectionDialog.descriptionLabel")}),t.jsx(ve,{children:t.jsx(ps,{placeholder:i("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...v,value:v.value??""})}),t.jsx(je,{})]})})]});return l?t.jsx(Jt,{open:n,onOpenChange:b,children:t.jsxs(en,{className:"max-h-[90vh]",children:[t.jsx(Hn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(tn,{children:C}),t.jsx(Vn,{className:"mt-1",children:w})]}),t.jsx(Un,{asChild:!0,children:t.jsx(ye,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Zt,{size:16})})})]})}),t.jsx(Ot,{...u,children:t.jsxs("form",{onSubmit:u.handleSubmit(j),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:M}),t.jsx(qn,{children:t.jsx(ye,{type:"submit",disabled:u.formState.isSubmitting,className:"w-full",children:I})})]})})]})}):t.jsx(It,{open:n,onOpenChange:b,children:t.jsxs(Dt,{className:"sm:max-w-[525px]",children:[t.jsxs(At,{children:[t.jsx(Tt,{children:C}),t.jsx(rn,{children:w})]}),t.jsx(Ot,{...u,children:t.jsxs("form",{onSubmit:u.handleSubmit(j),children:[t.jsx("div",{className:"py-4",children:M}),t.jsxs(us,{children:[t.jsx(ye,{type:"button",variant:"outline",onClick:()=>b(!1),children:i("connections.createConnectionDialog.cancelButton")}),t.jsx(ye,{type:"submit",disabled:u.formState.isSubmitting,className:"min-w-40",children:I})]})]})})]})})}function Ao(n){const e=z.c(72),{mode:s,agentId:i,addedConnectionIds:a,onAdd:o,onCloneAndAdd:r,onConnectAndAdd:l,connectingItemId:c,search:d,onCreateConnection:f,onBrowseNavigate:m,defaultTab:u}=n,p=s===void 0?"add":s,y=u===void 0?"connected":u,x=G(),{org:g}=le(),h=V.useDeferredValue(d),b=d!==h;let j;e[0]!==h?(j=h.trim().toLowerCase(),e[0]=h,e[1]=j):j=e[1];const C=j;let w;e[2]!==y?(w=k=>k??y,e[2]=y,e[3]=w):w=e[3];const[I,M]=Ct(kn.connectionsTab(g.slug)+(y==="all"?":home-modal":":agent-modal"),w);let v;e[4]!==I||e[5]!==M?(v=k=>{k!==I&&K("connections_dialog_tab_changed",{to_tab:k}),M(k)},e[4]=I,e[5]=M,e[6]=v):v=e[6];const N=v;let A;e[7]!==g.id||e[8]!==g.slug?(A={connectionId:Qt,orgId:g.id,orgSlug:g.slug},e[7]=g.id,e[8]=g.slug,e[9]=A):A=e[9];const S=Ns(A),_=h?.trim().split(/\s+/).filter(Boolean)??[],T=_.length>0?{operator:"or",conditions:_.flatMap(Lo)}:void 0,P={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},D=JSON.stringify(P),{data:F,fetchNextPage:L,hasNextPage:O,isFetchingNextPage:$}=ws({queryKey:Ue.collectionListInfinite(S,g.id,"","CONNECTIONS",D),queryFn:async k=>{const{pageParam:B}=k,J=B===void 0?0:B;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:J}})).structuredContent},initialPageParam:0,getNextPageParam:zo,staleTime:3e4}),U=F?.pages.flatMap(Fo)??[],R=ds(U),q=new Set(U.filter(Oo).map(Po)),E=on(),Y=an(E,h),ee=zt(Y.loadMore,Y.hasMore,Y.isLoadingMore),te=zt(L,O??!1,$),H=I==="all"||!!C,Z=H?Y.items.filter(k=>{const B=rs(k);if(B&&q.has(B))return!1;if(!C)return!0;const J=ot(k._meta),ue=[k.title,k.description,k.name,k.server?.title,k.server?.description,k.server?.name,J?.friendly_name,J?.friendlyName].filter(Boolean).join(" ").toLowerCase();return _.some(he=>ue.includes(he.toLowerCase()))}):[],ne=Z.filter(Mo),W=Z.filter(To);let Ne;e[10]!==a?(Ne=k=>k.some(B=>a.has(B.id)),e[10]=a,e[11]=Ne):Ne=e[11];const Be=Ne;let Ce;e[12]!==a||e[13]!==i||e[14]!==c||e[15]!==Be||e[16]!==p||e[17]!==o||e[18]!==m||e[19]!==r||e[20]!==x?(Ce=(k,B,J,ue,he)=>{const Ye=Be(he),Ge=he.find($e=>!a.has($e.id)),ce=he[0];if(p==="browse"){const $e=Cs(ce);return t.jsx(ht,{connection:{title:B,icon:J,description:he.length>1?`${he.length} instances`:ue??void 0},fallbackIcon:t.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Je,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(st,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{K("connection_browse_clicked",{app_name:ce.app_name??null,connection_id:ce.id,instances_count:he.length}),m?.($e)}},k)}return t.jsx(ht,{connection:{title:B,icon:J,description:ue},fallbackIcon:t.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Ye&&t.jsxs(Je,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(st,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(ye,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:$e=>{$e.stopPropagation(),Ge?(K("connection_add_clicked",{action:"use_existing",app_name:ce.app_name??null,connection_id:Ge.id}),i&&K("agent_connection_attached",{agent_id:i,connection_id:Ge.id,app_name:ce.app_name??null,mode:"existing"}),o(Ge.id)):(K("connection_add_clicked",{action:"clone",app_name:ce.app_name??null,base_connection_id:ce.id}),r(ce))},children:x("virtualMcp.connectionDialogContent.add")})]})},k)},e[12]=a,e[13]=i,e[14]=c,e[15]=Be,e[16]=p,e[17]=o,e[18]=m,e[19]=r,e[20]=x,e[21]=Ce):Ce=e[21];const Ee=Ce;let _e;e[22]!==c||e[23]!==p||e[24]!==l||e[25]!==x?(_e=k=>{const B=ot(k._meta),J=B?.friendlyName||B?.friendly_name||k.server?.title||k.title||k.server?.name||k.name||k.id||"",ue=k.server?.description||k.description||null,he=k.server?.icons?.[0]?.src||ls(k.server?.repository)||null,Ye=B?.official===!0,Ge=B?.verified===!0,ce=B?.owner==="deco";return t.jsx(ht,{connection:{title:J,description:ue,icon:he},fallbackIcon:t.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[ce&&t.jsxs(Oe,{children:[t.jsx(Me,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:x("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(Pe,{children:x("virtualMcp.connectionDialogContent.builtByDeco")})]}),!ce&&Ye&&t.jsxs(Oe,{children:[t.jsx(Me,{asChild:!0,children:t.jsx(Je,{variant:"outline",size:"icon",children:t.jsx(pt,{})})}),t.jsx(Pe,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!ce&&!Ye&&Ge&&t.jsxs(Oe,{children:[t.jsx(Me,{asChild:!0,children:t.jsx(Je,{variant:"outline",size:"icon",children:t.jsx(pt,{})})}),t.jsx(Pe,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ye,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:$e=>{$e.stopPropagation(),K("connection_add_clicked",{action:"connect_new",registry_item_id:k.id,app_name:B?.friendlyName||k.server?.name||k.name||null}),l(k)},children:c===k.id?t.jsx(Ve,{size:14,className:"animate-spin"}):x(p==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${k.id}`)},e[22]=c,e[23]=p,e[24]=l,e[25]=x,e[26]=_e):_e=e[26];const We=_e;let se;e[27]!==I||e[28]!==N||e[29]!==f||e[30]!==C||e[31]!==x?(se=!C&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(_s,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:I,onTabChange:k=>N(k)}),t.jsxs(ye,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{K("connections_dialog_custom_clicked"),f()},children:[t.jsx(Ke,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=I,e[28]=N,e[29]=f,e[30]=C,e[31]=x,e[32]=se):se=e[32];const Se=b&&"opacity-50 pointer-events-none";let oe;e[33]!==Se?(oe=Q("flex-1 overflow-auto p-5 transition-opacity duration-150",Se),e[33]=Se,e[34]=oe):oe=e[34];const Re="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let ke;e[35]!==Ee?(ke=k=>{if(k.type==="group")return Ee(k.key,k.title,k.icon,null,k.connections);const B=k.connection;return Ee(B.id,B.title,B.icon,B.description??null,[B])},e[35]=Ee,e[36]=ke):ke=e[36];const Ie=R.map(ke);let fe;e[37]!==te?(fe=t.jsx("div",{ref:te,className:"col-span-full h-1"}),e[37]=te,e[38]=fe):fe=e[38];let de;e[39]!==$?(de=$&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ve,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=$,e[40]=de):de=e[40];const Fe=H&&ne.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(pt,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),De=H&&ne.map(We),ze=H&&W.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Ae=H&&W.map(We);let me;e[41]!==ee||e[42]!==E||e[43]!==H?(me=H&&E.length>0&&t.jsx("div",{ref:ee,className:"col-span-full h-1"}),e[41]=ee,e[42]=E,e[43]=H,e[44]=me):me=e[44];let ie;e[45]!==Y.isLoadingMore||e[46]!==H?(ie=H&&Y.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ve,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=Y.isLoadingMore,e[46]=H,e[47]=ie):ie=e[47];let ge;e[48]!==Ie||e[49]!==fe||e[50]!==de||e[51]!==Fe||e[52]!==De||e[53]!==ze||e[54]!==Ae||e[55]!==me||e[56]!==ie?(ge=t.jsxs("div",{className:Re,children:[Ie,fe,de,Fe,De,ze,Ae,me,ie]}),e[48]=Ie,e[49]=fe,e[50]=de,e[51]=Fe,e[52]=De,e[53]=ze,e[54]=Ae,e[55]=me,e[56]=ie,e[57]=ge):ge=e[57];let ae;e[58]!==I||e[59]!==R.length||e[60]!==W||e[61]!==d||e[62]!==x||e[63]!==ne?(ae=R.length===0&&ne.length===0&&W.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:d?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:d}):x(I==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=I,e[59]=R.length,e[60]=W,e[61]=d,e[62]=x,e[63]=ne,e[64]=ae):ae=e[64];let re;e[65]!==oe||e[66]!==ge||e[67]!==ae?(re=t.jsxs("div",{className:oe,children:[ge,ae]}),e[65]=oe,e[66]=ge,e[67]=ae,e[68]=re):re=e[68];let we;return e[69]!==se||e[70]!==re?(we=t.jsxs(t.Fragment,{children:[se,re]}),e[69]=se,e[70]=re,e[71]=we):we=e[71],we}function To(n){return!n.verified&&!ot(n._meta)?.verified&&!n.meta?.verified}function Mo(n){return n.verified||ot(n._meta)?.verified||n.meta?.verified}function Po(n){return n.app_name}function Oo(n){return n.app_name}function Fo(n){return n?.items??[]}function zo(n,e){if(n?.hasMore)return e.reduce($o,0)}function $o(n,e){return n+(e?.items?.length??0)}function Lo(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function _a({open:n,onOpenChange:e,defaultTab:s,initialSearch:i="",...a}){const o=G(),r=a.mode??"add",l="agentId"in a?a.agentId:void 0,c="addedConnectionIds"in a?a.addedConnectionIds??new Set:new Set,d="onAdd"in a&&a.onAdd?a.onAdd:S=>{},f=(S,_,T)=>{l&&K("agent_connection_attached",{agent_id:l,connection_id:S,app_name:_,mode:T})},[m,u]=V.useState(null),[p,y]=V.useState(i),[x,g]=V.useState(!1),{org:h}=le(),{data:b}=Te.useSession(),j=ln(),C=In(),w=at(),I=S=>{e(!1),w({to:"/$org/settings/connections/$appSlug",params:{org:h.slug,appSlug:S}})},M=()=>{C.invalidateQueries({predicate:S=>{const _=S.queryKey;return _[1]===h.id&&_[3]==="collection"&&_[4]==="CONNECTIONS"}})},v=async(S,_)=>{K("connection_oauth_succeeded",{connection_id:S,flow:_});const T=new URL(`/api/${h.slug}/mcp/${S}`,window.location.origin);await C.invalidateQueries({queryKey:Ue.isMCPAuthenticated(T.href,null)}),M()},N=async S=>{u(S.app_name??S.id);try{const T=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,D=(await j.create.mutateAsync({title:T,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,F=await xt({connectionId:D,orgId:h.id,orgSlug:h.slug,persistFallback:L=>j.update.mutateAsync({id:D,data:{connection_token:L}}).then(()=>{})});if(F.ran&&!F.ok){K("connection_oauth_failed",{connection_id:D,flow:"clone",error:F.error??"no_token"}),X.error(o("virtualMcp.addConnectionDialog.authenticationFailedError",{error:F.error??"no token received"})),await j.delete.mutateAsync(D);return}F.ran&&await v(D,"clone"),f(D,S.app_name??null,"clone"),d(D)}catch(_){console.error("Failed to add connection:",_),X.error(o("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{u(null)}},A=async S=>{if(!(!h||!b?.user?.id)){u(S.id);try{const _=cs(S,h.id,b.user.id,{remoteIndex:0}),T=_.connection_type==="STDIO",P=!!_.connection_url,D=T&&_.connection_headers&&typeof _.connection_headers=="object"&&"command"in _.connection_headers;if(!P&&!D){X.error(o("virtualMcp.addConnectionDialog.mcpServerConnectionError")),u(null);return}const{id:F}=await j.create.mutateAsync(_),L=await xt({connectionId:F,orgId:h.id,orgSlug:h.slug,persistFallback:O=>j.update.mutateAsync({id:F,data:{connection_token:O}}).then(()=>{})});if(L.ran&&!L.ok){K("connection_oauth_failed",{connection_id:F,flow:"connect_new",error:L.error??"no_token"}),X.warning(o("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:o("virtualMcp.addConnectionDialog.signInFailedDescription",{error:L.error??"no token received"})}),f(F,_.app_name??null,"new"),d(F);return}L.ran?(await v(F,"connect_new"),X.success(o("virtualMcp.addConnectionDialog.connectedAuthenticated"))):X.success(o("virtualMcp.addConnectionDialog.connected")),f(F,_.app_name??null,"new"),d(F)}catch(_){console.error("Failed to connect:",_),X.error(o("virtualMcp.addConnectionDialog.failedToConnect"))}finally{u(null)}}};return t.jsxs(It,{open:n,onOpenChange:e,children:[t.jsxs(Dt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(At,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Tt,{className:"text-base font-semibold",children:o(r==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(is,{value:p,onChange:y,placeholder:o("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ve,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ao,{mode:r,agentId:l,addedConnectionIds:c,onAdd:d,onCloneAndAdd:N,onConnectAndAdd:A,connectingItemId:m,search:p,onCreateConnection:()=>g(!0),onBrowseNavigate:I,defaultTab:s})})]}),t.jsx(Do,{open:x,onOpenChange:g,onCreated:async S=>{g(!1);const _=await xt({connectionId:S,orgId:h.id,orgSlug:h.slug,persistFallback:T=>j.update.mutateAsync({id:S,data:{connection_token:T}}).then(()=>{})});if(_.ran&&!_.ok){K("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:_.error??"no_token"}),X.warning(o("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:o("virtualMcp.addConnectionDialog.signInFailedDescription",{error:_.error??"no token received"})}),f(S,null,"custom"),d(S),e(!1);return}_.ran&&await v(S,"custom_create"),f(S,null,"custom"),d(S),e(!1)}})]})}const Lt=new Map;function wa(){const{org:n}=le(),e=ct(),s=Ss(),i=s.find(g=>g.providerId==="deco"),{data:a,isLoading:o,refetch:r,isFetching:l}=He({queryKey:Ue.aiProviderCredits(n.id,"deco"),enabled:!!i,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=a?.balanceCents??null,d=c!=null?c/100:null,f=V.useRef(new Map);if(c!=null){const g=Lt.get(n.id);f.current.get(n.id)&&g!=null&&c>g&&K("credits_topped_up_detected",{organization_id:n.id,delta_cents:c-g,previous_balance_cents:g,new_balance_cents:c}),Lt.set(n.id,c),f.current.set(n.id,!0)}const m=!!i,u=c!=null&&c>0,p=c!=null&&c===0,y=c!=null&&c===200,x=s.length>0&&s.every(g=>g.providerId==="deco");return{hasDecoKey:m,decoKeyId:i?.id??null,balanceCents:c,balanceDollars:d,hasCredits:u,isZeroBalance:p,isInitialFreeCredit:y,hasOnlyDecoProvider:x,isLoading:o,isFetching:l,refetch:r}}function vt(n){const e=z.c(13),{label:s,value:i,onChange:a,options:o}=n;let r;e[0]!==s?(r=t.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=r):r=e[1];let l;e[2]!==a?(l=m=>m&&a(m),e[2]=a,e[3]=l):l=e[3];let c;e[4]!==o?(c=o.map(Bo),e[4]=o,e[5]=c):c=e[5];let d;e[6]!==l||e[7]!==c||e[8]!==i?(d=t.jsx(Ds,{type:"single",size:"sm",value:i,onValueChange:l,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:c}),e[6]=l,e[7]=c,e[8]=i,e[9]=d):d=e[9];let f;return e[10]!==r||e[11]!==d?(f=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r,d]}),e[10]=r,e[11]=d,e[12]=f):f=e[12],f}function Bo(n){return t.jsxs(Is,{value:n.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[n.icon,n.label]},n.value)}function Na(n){const e=z.c(91),{panel:s,className:i}=n,a=i===void 0?"md:size-[34px] rounded-lg":i,o=G();let r;e[0]!==o?(r=o("sidebar.taskGroupsList.filterChats"),e[0]=o,e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ks,{size:16}),e[2]=l):l=e[2];let c;e[3]!==s.filtersActive?(c=s.filtersActive&&t.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"}),e[3]=s.filtersActive,e[4]=c):c=e[4];let d;e[5]!==a||e[6]!==s.filtersActive||e[7]!==r||e[8]!==c?(d=t.jsx(Me,{asChild:!0,children:t.jsx(Xe,{asChild:!0,children:t.jsxs(kt,{"aria-label":r,active:s.filtersActive,className:a,children:[l,c]})})}),e[5]=a,e[6]=s.filtersActive,e[7]=r,e[8]=c,e[9]=d):d=e[9];let f;e[10]!==o?(f=o("sidebar.taskGroupsList.filterChats"),e[10]=o,e[11]=f):f=e[11];let m;e[12]!==f?(m=t.jsx(Pe,{side:"bottom",children:f}),e[12]=f,e[13]=m):m=e[13];let u;e[14]!==d||e[15]!==m?(u=t.jsxs(Oe,{children:[d,m]}),e[14]=d,e[15]=m,e[16]=u):u=e[16];let p;e[17]!==o?(p=o("sidebar.taskGroupsList.filterView"),e[17]=o,e[18]=p):p=e[18];const y=s.groupBy;let x;e[19]!==s?(x=W=>{K("tasks_panel_group_by_changed",{to_value:W}),s.setGroupBy(W)},e[19]=s,e[20]=x):x=e[20];let g;e[21]!==o?(g=o("sidebar.taskGroupsList.viewList"),e[21]=o,e[22]=g):g=e[22];let h;e[23]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Fn,{size:13}),e[23]=h):h=e[23];let b;e[24]!==g?(b={value:"flat",label:g,icon:h},e[24]=g,e[25]=b):b=e[25];let j;e[26]!==o?(j=o("sidebar.taskGroupsList.viewStatus"),e[26]=o,e[27]=j):j=e[27];let C;e[28]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(zn,{size:13}),e[28]=C):C=e[28];let w;e[29]!==j?(w={value:"status",label:j,icon:C},e[29]=j,e[30]=w):w=e[30];let I;e[31]!==b||e[32]!==w?(I=[b,w],e[31]=b,e[32]=w,e[33]=I):I=e[33];let M;e[34]!==s.groupBy||e[35]!==x||e[36]!==I||e[37]!==p?(M=t.jsx(vt,{label:p,value:y,onChange:x,options:I}),e[34]=s.groupBy,e[35]=x,e[36]=I,e[37]=p,e[38]=M):M=e[38];let v;e[39]!==o?(v=o("sidebar.taskGroupsList.filterType"),e[39]=o,e[40]=v):v=e[40];const N=s.typeFilter;let A;e[41]!==s?(A=W=>{K("tasks_panel_filter_changed",{to_value:W}),s.setTypeFilter(W)},e[41]=s,e[42]=A):A=e[42];let S;e[43]!==o?(S=o("sidebar.taskGroupsList.typeAll"),e[43]=o,e[44]=S):S=e[44];let _;e[45]!==S?(_={value:"all",label:S},e[45]=S,e[46]=_):_=e[46];let T;e[47]!==o?(T=o("sidebar.taskGroupsList.typeChats"),e[47]=o,e[48]=T):T=e[48];let P;e[49]!==T?(P={value:"manual",label:T},e[49]=T,e[50]=P):P=e[50];let D;e[51]!==o?(D=o("sidebar.taskGroupsList.typeAuto"),e[51]=o,e[52]=D):D=e[52];let F;e[53]!==D?(F={value:"automation",label:D},e[53]=D,e[54]=F):F=e[54];let L;e[55]!==_||e[56]!==P||e[57]!==F?(L=[_,P,F],e[55]=_,e[56]=P,e[57]=F,e[58]=L):L=e[58];let O;e[59]!==s.typeFilter||e[60]!==v||e[61]!==A||e[62]!==L?(O=t.jsx(vt,{label:v,value:N,onChange:A,options:L}),e[59]=s.typeFilter,e[60]=v,e[61]=A,e[62]=L,e[63]=O):O=e[63];let $;e[64]!==o?($=o("sidebar.taskGroupsList.filterScope"),e[64]=o,e[65]=$):$=e[65];const U=s.showAll?"team":"mine";let R;e[66]!==s?(R=W=>s.setShowAll(W==="team"),e[66]=s,e[67]=R):R=e[67];let q;e[68]!==o?(q=o("sidebar.taskGroupsList.scopeMine"),e[68]=o,e[69]=q):q=e[69];let E;e[70]!==q?(E={value:"mine",label:q},e[70]=q,e[71]=E):E=e[71];let Y;e[72]!==o?(Y=o("sidebar.taskGroupsList.scopeTeam"),e[72]=o,e[73]=Y):Y=e[73];let ee;e[74]!==Y?(ee={value:"team",label:Y},e[74]=Y,e[75]=ee):ee=e[75];let te;e[76]!==E||e[77]!==ee?(te=[E,ee],e[76]=E,e[77]=ee,e[78]=te):te=e[78];let H;e[79]!==$||e[80]!==U||e[81]!==R||e[82]!==te?(H=t.jsx(vt,{label:$,value:U,onChange:R,options:te}),e[79]=$,e[80]=U,e[81]=R,e[82]=te,e[83]=H):H=e[83];let Z;e[84]!==M||e[85]!==O||e[86]!==H?(Z=t.jsxs(Nt,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[M,O,H]}),e[84]=M,e[85]=O,e[86]=H,e[87]=Z):Z=e[87];let ne;return e[88]!==Z||e[89]!==u?(ne=t.jsxs(St,{children:[u,Z]}),e[88]=Z,e[89]=u,e[90]=ne):ne=e[90],ne}function Eo(n){const e=z.c(9),{virtualMcpId:s,size:i,showAutomationBadge:a}=n,o=i===void 0?"sm":i,r=G();let l;e[0]!==o||e[1]!==s?(l=s?t.jsx(Ro,{virtualMcpId:s,size:o}):t.jsx(qe,{icon:null,name:"?",size:o}),e[0]=o,e[1]=s,e[2]=l):l=e[2];let c;e[3]!==a||e[4]!==r?(c=a&&t.jsx("span",{"aria-label":r("tasksPanel.mcpAvatar.automationTriggered"),className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:t.jsx(cn,{size:10,className:"text-white"})}),e[3]=a,e[4]=r,e[5]=c):c=e[5];let d;return e[6]!==l||e[7]!==c?(d=t.jsxs("div",{className:"relative shrink-0",children:[l,c]}),e[6]=l,e[7]=c,e[8]=d):d=e[8],d}function Ro(n){const e=z.c(6),{virtualMcpId:s,size:i}=n,a=wt(s);if(!a){let l;return e[0]!==i?(l=t.jsx(qe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=l):l=e[1],l}const o=a.icon??null;let r;return e[2]!==a.title||e[3]!==i||e[4]!==o?(r=t.jsx(qe,{icon:o,name:a.title,size:i}),e[2]=a.title,e[3]=i,e[4]=o,e[5]=r):r=e[5],r}function Go(n){const e=z.c(51),{open:s,onOpenChange:i}=n,[a,o]=V.useState(""),{org:r}=le(),{setTaskId:l}=ft(),c=ct(),d=G();let f,m,u;e[0]!==r.id||e[1]!==a?(u=a.trim(),m=He,f=Ue.globalSearch(r.id,u),e[0]=r.id,e[1]=a,e[2]=f,e[3]=m,e[4]=u):(f=e[2],m=e[3],u=e[4]);let p;e[5]!==c||e[6]!==u?(p=async()=>await c.call("GLOBAL_SEARCH",{query:u,limit:u?20:10}),e[5]=c,e[6]=u,e[7]=p):p=e[7];let y;e[8]!==s||e[9]!==f||e[10]!==p?(y={queryKey:f,enabled:s,queryFn:p,staleTime:1e4},e[8]=s,e[9]=f,e[10]=p,e[11]=y):y=e[11];const{data:x,isFetching:g}=m(y);let h;e[12]!==x?.items?(h=x?.items??[],e[12]=x?.items,e[13]=h):h=e[13];const b=h;let j;e[14]!==i?(j=O=>{O||o(""),i(O)},e[14]=i,e[15]=j):j=e[15];const C=j;let w;e[16]!==C||e[17]!==l?(w=O=>{C(!1),l(O.id,O.virtual_mcp_id??void 0)},e[16]=C,e[17]=l,e[18]=w):w=e[18];const I=w;let M;e[19]!==d?(M=d("tasksPanel.globalSearchDialog.title"),e[19]=d,e[20]=M):M=e[20];let v;e[21]!==M?(v=t.jsx(Tt,{children:M}),e[21]=M,e[22]=v):v=e[22];let N;e[23]!==d?(N=d("tasksPanel.globalSearchDialog.description"),e[23]=d,e[24]=N):N=e[24];let A;e[25]!==N?(A=t.jsx(rn,{children:N}),e[25]=N,e[26]=A):A=e[26];let S;e[27]!==A||e[28]!==v?(S=t.jsxs(At,{className:"sr-only",children:[v,A]}),e[27]=A,e[28]=v,e[29]=S):S=e[29];let _;e[30]!==d?(_=d("tasksPanel.globalSearchDialog.placeholder"),e[30]=d,e[31]=_):_=e[31];let T;e[32]!==a||e[33]!==_?(T=t.jsx(Os,{value:a,onValueChange:o,placeholder:_}),e[32]=a,e[33]=_,e[34]=T):T=e[34];let P;e[35]!==I||e[36]!==g||e[37]!==b||e[38]!==d||e[39]!==u?(P=t.jsx(As,{children:g&&b.length===0?t.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:d("tasksPanel.globalSearchDialog.searching")}):b.length===0?t.jsx(Ts,{children:d("tasksPanel.globalSearchDialog.noResults")}):t.jsx(Ms,{heading:u?void 0:d("tasksPanel.globalSearchDialog.recent"),children:b.map(O=>O.type==="thread"?t.jsxs(Ps,{value:`thread:${O.id}:${O.title}`,onSelect:()=>I(O),className:"gap-2.5",children:[t.jsx(Eo,{virtualMcpId:O.virtual_mcp_id,size:"xs"}),t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("div",{className:"text-sm text-foreground truncate",children:O.title||d("tasksPanel.globalSearchDialog.untitledChat")})}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(O.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${O.id}`):null)})}),e[35]=I,e[36]=g,e[37]=b,e[38]=d,e[39]=u,e[40]=P):P=e[40];let D;e[41]!==T||e[42]!==P?(D=t.jsxs(Fs,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[T,P]}),e[41]=T,e[42]=P,e[43]=D):D=e[43];let F;e[44]!==S||e[45]!==D?(F=t.jsxs(Dt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[S,D]}),e[44]=S,e[45]=D,e[46]=F):F=e[46];let L;return e[47]!==C||e[48]!==s||e[49]!==F?(L=t.jsx(It,{open:s,onOpenChange:C,children:F}),e[47]=C,e[48]=s,e[49]=F,e[50]=L):L=e[50],L}function Ho(n){const e=z.c(43),{branch:s,onOutcome:i}=n,a=G();let o;e[0]!==i?(o=M=>{M||i("cancel")},e[0]=i,e[1]=o):o=e[1];let r;e[2]!==a?(r=a("sidebar.archiveWorktreeDialog.title"),e[2]=a,e[3]=r):r=e[3];let l;e[4]!==r?(l=t.jsx(zs,{children:r}),e[4]=r,e[5]=l):l=e[5];let c;e[6]!==a?(c=a("sidebar.archiveWorktreeDialog.stopsAndDeletesBefore"),e[6]=a,e[7]=c):c=e[7];let d;e[8]!==s?(d=t.jsx("span",{className:"font-mono",children:s}),e[8]=s,e[9]=d):d=e[9];let f;e[10]!==a?(f=a("sidebar.archiveWorktreeDialog.stopsAndDeletesAfter"),e[10]=a,e[11]=f):f=e[11];let m;e[12]!==c||e[13]!==d||e[14]!==f?(m=t.jsxs($s,{children:[c," ",d," ",f]}),e[12]=c,e[13]=d,e[14]=f,e[15]=m):m=e[15];let u;e[16]!==l||e[17]!==m?(u=t.jsxs(Ls,{children:[l,m]}),e[16]=l,e[17]=m,e[18]=u):u=e[18];let p;e[19]!==i?(p=()=>i("cancel"),e[19]=i,e[20]=p):p=e[20];let y;e[21]!==a?(y=a("sidebar.archiveWorktreeDialog.cancel"),e[21]=a,e[22]=y):y=e[22];let x;e[23]!==y||e[24]!==p?(x=t.jsx(Bs,{onClick:p,children:y}),e[23]=y,e[24]=p,e[25]=x):x=e[25];let g;e[26]===Symbol.for("react.memo_cache_sentinel")?(g=Q(Dn({variant:"destructive"})),e[26]=g):g=e[26];let h;e[27]!==i?(h=()=>i("confirm"),e[27]=i,e[28]=h):h=e[28];let b;e[29]!==a?(b=a("sidebar.archiveWorktreeDialog.confirm"),e[29]=a,e[30]=b):b=e[30];let j;e[31]!==h||e[32]!==b?(j=t.jsx(Es,{className:g,onClick:h,children:b}),e[31]=h,e[32]=b,e[33]=j):j=e[33];let C;e[34]!==x||e[35]!==j?(C=t.jsxs(Rs,{children:[x,j]}),e[34]=x,e[35]=j,e[36]=C):C=e[36];let w;e[37]!==C||e[38]!==u?(w=t.jsxs(Gs,{children:[u,C]}),e[37]=C,e[38]=u,e[39]=w):w=e[39];let I;return e[40]!==o||e[41]!==w?(I=t.jsx(Hs,{open:!0,onOpenChange:o,children:w}),e[40]=o,e[41]=w,e[42]=I):I=e[42],I}function Vo(n,e,s){if(!s)return;const i=n.findIndex(a=>a.id===e);if(i!==-1){for(let a=i+1;a<n.length;a++){const o=n[a];if(o?.created_by===s)return o}for(let a=i-1;a>=0;a--){const o=n[a];if(o?.created_by===s)return o}}}function Uo(n){return n==="ephemeral"||n.startsWith("thread:")}function fn(n){const e=z.c(45),{task:s,isActive:i,onClick:a,onArchive:o,showAutomationBadge:r,showAgentIcon:l,hideStatusIdle:c,indented:d}=n,f=G(),m=Us(s.status),u=m.icon,p=s.metadata?.kind==="tool_call_run",y=wt(p?void 0:s.virtual_mcp_id);let x;e[0]!==y?(x=ns(y),e[0]=y,e[1]=x):x=e[1];const g=x;qs(6e4);const h=r||!!s.trigger_id,b=s.id,j="button",C=0;let w;e[2]!==a?(w=R=>{R.target===R.currentTarget&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),a())},e[2]=a,e[3]=w):w=e[3];const I=d?"-ml-4 pl-6":"pl-[7px]",M=i?"bg-accent text-accent-foreground":"hover:bg-accent/60";let v;e[4]!==I||e[5]!==M?(v=Q("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",I,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",M),e[4]=I,e[5]=M,e[6]=v):v=e[6];let N;e[7]!==p||e[8]!==l||e[9]!==y?.icon||e[10]!==y?.title?(N=l&&!p&&t.jsx(qe,{icon:y?.icon??null,name:y?.title??"?",size:"2xs"}),e[7]=p,e[8]=l,e[9]=y?.icon,e[10]=y?.title,e[11]=N):N=e[11];let A;e[12]!==h||e[13]!==f?(A=h&&t.jsx(cn,{size:12,"aria-label":f("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-blue-500"}),e[12]=h,e[13]=f,e[14]=A):A=e[14];let S;e[15]!==f||e[16]!==s.title?(S=s.title||f("tasksPanel.taskRow.untitledTask"),e[15]=f,e[16]=s.title,e[17]=S):S=e[17];let _;e[18]!==S?(_=t.jsx("div",{className:"text-sm text-foreground truncate",children:S}),e[18]=S,e[19]=_):_=e[19];let T;e[20]!==A||e[21]!==_?(T=t.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[A,_]}),e[20]=A,e[21]=_,e[22]=T):T=e[22];let P;e[23]!==g||e[24]!==i||e[25]!==s.branch||e[26]!==s.updated_at?(P=s.updated_at&&t.jsxs("div",{className:Q("flex items-center gap-1 text-[11px] min-w-0",i?"text-accent-foreground/70":"text-muted-foreground/60"),children:[s.branch&&!Uo(s.branch)?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"truncate font-mono",children:s.branch}),t.jsx("span",{className:"shrink-0",children:"·"})]}):g?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"truncate",children:[g.owner,"/",g.name]}),t.jsx("span",{className:"shrink-0",children:"·"})]}):null,t.jsx("span",{className:"shrink-0",children:Ws(new Date(s.updated_at))})]}),e[23]=g,e[24]=i,e[25]=s.branch,e[26]=s.updated_at,e[27]=P):P=e[27];let D;e[28]!==T||e[29]!==P?(D=t.jsxs("div",{className:"flex-1 min-w-0",children:[T,P]}),e[28]=T,e[29]=P,e[30]=D):D=e[30];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",L=!c&&t.jsx("span",{className:Q("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",o&&"group-hover/row:opacity-0"),"aria-label":f("tasksPanel.taskRow.statusLabel",{status:m.label}),children:t.jsx(u,{size:14,className:Q(m.iconClassName,s.status==="in_progress"&&"animate-spin")})});let O;e[31]!==o||e[32]!==f?(O=o&&t.jsxs(Oe,{children:[t.jsx(Me,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":f("tasksPanel.taskRow.archiveTask"),onClick:R=>{R.stopPropagation(),o()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-8 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:t.jsx(An,{size:14})})}),t.jsx(Pe,{side:"right",children:f("tasksPanel.taskRow.archive")})]}),e[31]=o,e[32]=f,e[33]=O):O=e[33];let $;e[34]!==L||e[35]!==O?($=t.jsxs("div",{className:F,children:[L,O]}),e[34]=L,e[35]=O,e[36]=$):$=e[36];let U;return e[37]!==a||e[38]!==D||e[39]!==$||e[40]!==w||e[41]!==v||e[42]!==N||e[43]!==s.id?(U=t.jsxs("div",{"data-task-id":b,role:j,tabIndex:C,onClick:a,onKeyDown:w,className:v,children:[N,D,$]}),e[37]=a,e[38]=D,e[39]=$,e[40]=w,e[41]=v,e[42]=N,e[43]=s.id,e[44]=U):U=e[44],U}const Bt=["requires_action","in_progress","failed","expired","completed"];function qo(n){const e=new Map(Bt.map(s=>[s,[]]));for(const s of n){const i=s.status??"completed";(e.get(i)??e.get("completed")).push(s)}return Bt.map(s=>({status:s,threads:e.get(s)}))}const Ko="sidebar.group.expanded.";function Wo(n,e){const s=z.c(3),[i,a]=Ct(`${Ko}${n}`,e);let o;return s[0]!==i||s[1]!==a?(o=[i,a],s[0]=i,s[1]=a,s[2]=o):o=s[2],o}function mn(n){const e=z.c(18),{onClick:s,isFetching:i,indented:a}=n,o=G();let r;e[0]!==o?(r=o("sidebar.showMoreButton.ariaLabel"),e[0]=o,e[1]=r):r=e[1];const l=a?"-ml-4 pl-6 pr-2":"px-2";let c;e[2]!==l?(c=Q("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",l,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[2]=l,e[3]=c):c=e[3];let d;e[4]!==i?(d=i&&t.jsx(Ve,{size:14,className:"animate-spin"}),e[4]=i,e[5]=d):d=e[5];let f;e[6]!==i||e[7]!==o?(f=o(i?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=i,e[7]=o,e[8]=f):f=e[8];let m;e[9]!==f?(m=t.jsx("span",{children:f}),e[9]=f,e[10]=m):m=e[10];let u;return e[11]!==i||e[12]!==s||e[13]!==r||e[14]!==c||e[15]!==d||e[16]!==m?(u=t.jsxs("button",{type:"button","aria-label":r,onClick:s,disabled:i,className:c,children:[d,m]}),e[11]=i,e[12]=s,e[13]=r,e[14]=c,e[15]=d,e[16]=m,e[17]=u):u=e[17],u}function Qo(n,e,s,i){return[n,e,s,i.type,i.member,i.currentUserId??""].join("|")}function Xo(n){return n.member==="mine"&&!n.currentUserId}const gn=4;let nt=0;const yt=[];function Yo(){for(;nt<gn&&yt.length>0;){const n=yt.shift();n&&n()}}function hn(n){return new Promise((e,s)=>{const i=()=>{nt++,n().then(e,s).finally(()=>{nt--,Yo()})};nt<gn?i():yt.push(i)})}const mt=10;function Et(n,e,s,i,a){const o={hidden:!1};i.member==="mine"&&i.currentUserId&&(o.created_by=i.currentUserId),i.type==="automation"&&(o.has_trigger=!0),i.type==="manual"&&(o.has_trigger=!1);const r={where:o,limit:a,offset:s,orderBy:[{field:["updated_at"],direction:"desc"}]};return r.status=e,r}function Zo(n,e,s,i){let a=0;for(const o of n)pn(o,e,s,i)&&a++;return a}function jt(n,e,s,i){return Zo(n,e,s,i)}function Jo(n,e){return!!(n>=mt||n===0&&e)}function Rt(n,e){return n<e}function ei(n,e){return e===!1?!1:e===!0?!0:n}function pn(n,e,s,i){return!(n.hidden||(n.status??"completed")!==s||i.member==="mine"&&i.currentUserId&&n.created_by!==i.currentUserId||i.type==="automation"&&!n.trigger_id||i.type==="manual"&&n.trigger_id)}const it=new Map,et=new Map;function ti(n,e){return e?n>=mt?!0:null:!1}function Gt(n){return it.get(n)}function ni(n,e){it.set(n,e)}function si(n,e,s){const i=it.get(n);if(i!==void 0){s(i);return}let a=et.get(n);a||(a=hn(e).then(o=>(it.set(n,o),et.delete(n),o)).catch(()=>(et.delete(n),Promise.reject(new Error("group probe failed")))),et.set(n,a)),a.then(s,()=>s(!1))}function Ht(n){const e=n,s=Array.isArray(e.items)?e.items:[];return{items:s,hasMore:e.hasMore??s.length===mt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function oi(n,e,s,i,a){let o=0;for(const r of n)e.has(r.id)||pn(r,s,i,a)&&o++;return o}function ii(n,e,s,i){const a=z.c(8),{org:o}=le(),r=Qo(o.id,n,e,s);let l;a[0]!==s?(l=Xo(s),a[0]=s,a[1]=l):l=a[1];const c=l,[d,f]=V.useState({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==r&&f({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:null,serverHasMore:null});const m=Xn(),{threads:u,hasMore:p}=ut(),y=jt(u,n,e,s),x=Jo(y,p),g=ti(y,p),h=ct();if(d.identity===r&&d.serverHasMore===null){const M=g??Gt(r);M!==void 0&&f({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:M})}!c&&d.identity===r&&d.serverHasMore===null&&g===null&&Gt(r)===void 0&&d.probeSubscribedIdentity!==r&&(f(M=>M.identity===r?{...M,isProbing:!0,probeSubscribedIdentity:r}:M),si(r,async()=>{const M=Et(n,e,0,s,1),v=await h.call("COLLECTION_THREADS_LIST",M),{totalCount:N}=Ht(v),A=jt(m.threads.get(),n,e,s);return N===void 0?!1:Rt(A,N)},M=>{f(v=>v.identity!==r?v:{...v,isProbing:!1,serverHasMore:M})}));const j=async function(){if(d.isFetching||d.isProbing||c)return;const v=r;f(N=>N.identity===v?{...N,isFetching:!0}:N);try{const N=jt(u,n,e,s),A=Et(n,e,N,s,mt),S=await hn(()=>h.call("COLLECTION_THREADS_LIST",A)),{items:_,hasMore:T,totalCount:P}=Ht(S),D=new Set(u.map(ai)),F=oi(_,D,n,e,s),L=N;m.mergeThreads(_),f(O=>{if(O.identity!==v)return O;let $;return P!==void 0?$=Rt(L+F,P):$=_.length===0||F===0?!1:T,ni(v,$),{...O,isFetching:!1,serverHasMore:$}})}catch(N){const A=N,S=A instanceof Error?A.message:String(A);X.error(`Could not load more tasks: ${S}`),f(_=>_.identity===v?{..._,isFetching:!1}:_)}},C=d.isFetching||d.isProbing,w=!c&&!C&&ei(x,d.serverHasMore);let I;return a[2]!==C||a[3]!==j||a[4]!==w||a[5]!==d.isProbing||a[6]!==d.serverHasMore?(I={hasMore:w,isFetching:C,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:j},a[2]=C,a[3]=j,a[4]=w,a[5]=d.isProbing,a[6]=d.serverHasMore,a[7]=I):I=a[7],I}function ai(n){return n.id}function ri(n){const e=z.c(20),{status:s,threads:i,activeTaskId:a,onSelectTask:o,onArchiveTask:r,canArchive:l,filters:c}=n,{isFetching:d,isProbing:f,loadMore:m,hasMore:u,serverHasMore:p}=ii("status",s,c),[y,x]=V.useState(!1);!y&&i.length===0&&p===!0&&!d&&!f&&(x(!0),queueMicrotask(()=>{m()}));let g;if(e[0]!==a||e[1]!==l||e[2]!==c||e[3]!==r||e[4]!==o||e[5]!==i){let j;e[7]!==a||e[8]!==l||e[9]!==c||e[10]!==r||e[11]!==o?(j=C=>t.jsx(fn,{task:C,isActive:a===C.id,onClick:()=>o(C),onArchive:l&&C.created_by===c.currentUserId?()=>r(C):void 0,showAutomationBadge:!!C.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},C.id),e[7]=a,e[8]=l,e[9]=c,e[10]=r,e[11]=o,e[12]=j):j=e[12],g=i.map(j),e[0]=a,e[1]=l,e[2]=c,e[3]=r,e[4]=o,e[5]=i,e[6]=g}else g=e[6];let h;e[13]!==u||e[14]!==d||e[15]!==m?(h=(u||d)&&t.jsx(mn,{onClick:()=>{m()},isFetching:d,indented:!0}),e[13]=u,e[14]=d,e[15]=m,e[16]=h):h=e[16];let b;return e[17]!==g||e[18]!==h?(b=t.jsxs(t.Fragment,{children:[g,h]}),e[17]=g,e[18]=h,e[19]=b):b=e[19],b}function li(n){const e=z.c(36),{status:s,threads:i,activeTaskId:a,onSelectTask:o,onArchiveTask:r,canArchive:l,filters:c}=n,d=Ks[s],f=d.icon,[m,u]=Wo(`status-${s}`,!1);let p;e[0]!==m||e[1]!==u?(p=function(){u(!m)},e[0]=m,e[1]=u,e[2]=p):p=e[2];const y=p;let x;e[3]!==y?(x=v=>{v.target===v.currentTarget&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),y())},e[3]=y,e[4]=x):x=e[4];let g;e[5]!==f||e[6]!==d.iconClassName?(g=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:t.jsx(f,{size:12,className:d.iconClassName})}),e[5]=f,e[6]=d.iconClassName,e[7]=g):g=e[7];let h;e[8]!==m?(h=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:m?t.jsx(_t,{size:14}):t.jsx(Wt,{size:14})}),e[8]=m,e[9]=h):h=e[9];let b;e[10]!==g||e[11]!==h?(b=t.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[g,h]}),e[10]=g,e[11]=h,e[12]=b):b=e[12];let j;e[13]!==d.label?(j=t.jsx("span",{className:"flex-1 truncate",children:d.label}),e[13]=d.label,e[14]=j):j=e[14];let C;e[15]!==i.length?(C=t.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:t.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:i.length})}),e[15]=i.length,e[16]=C):C=e[16];let w;e[17]!==m||e[18]!==y||e[19]!==x||e[20]!==b||e[21]!==j||e[22]!==C?(w=t.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,onClick:y,onKeyDown:x,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,j,C]}),e[17]=m,e[18]=y,e[19]=x,e[20]=b,e[21]=j,e[22]=C,e[23]=w):w=e[23];let I;e[24]!==a||e[25]!==l||e[26]!==m||e[27]!==c||e[28]!==r||e[29]!==o||e[30]!==s||e[31]!==i?(I=m&&t.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:t.jsx(ri,{status:s,threads:i,activeTaskId:a,onSelectTask:o,onArchiveTask:r,canArchive:l,filters:c})}),e[24]=a,e[25]=l,e[26]=m,e[27]=c,e[28]=r,e[29]=o,e[30]=s,e[31]=i,e[32]=I):I=e[32];let M;return e[33]!==w||e[34]!==I?(M=t.jsxs("div",{className:"flex flex-col gap-0.5",children:[w,I]}),e[33]=w,e[34]=I,e[35]=M):M=e[35],M}function ci(n){const e=z.c(38),{threads:s,groupBy:i,activeTaskId:a,onSelectTask:o,onArchiveTask:r,filters:l,hasMore:c,isFetchingMore:d,onLoadMore:f,filtersActive:m}=n;if(s.length===0&&!c&&!d){let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Vs,{className:"size-6 opacity-60"}),e[0]=g):g=e[0];const h=m?"No chats match your filters":"No chats yet";let b;return e[1]!==h?(b=t.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[g,t.jsx("p",{className:"text-sm",children:h})]}),e[1]=h,e[2]=b):b=e[2],b}const u=s.length>1||c;if(i==="status"){let g;if(e[3]!==a||e[4]!==u||e[5]!==l||e[6]!==r||e[7]!==o||e[8]!==s){let b;e[10]!==a||e[11]!==u||e[12]!==l||e[13]!==r||e[14]!==o?(b=j=>t.jsx(li,{status:j.status,threads:j.threads,activeTaskId:a,onSelectTask:o,onArchiveTask:r,canArchive:u,filters:l},j.status),e[10]=a,e[11]=u,e[12]=l,e[13]=r,e[14]=o,e[15]=b):b=e[15],g=qo(s).map(b),e[3]=a,e[4]=u,e[5]=l,e[6]=r,e[7]=o,e[8]=s,e[9]=g}else g=e[9];let h;return e[16]!==g?(h=t.jsx(t.Fragment,{children:g}),e[16]=g,e[17]=h):h=e[17],h}let p;if(e[18]!==a||e[19]!==u||e[20]!==l||e[21]!==r||e[22]!==o||e[23]!==s){let g;e[25]!==a||e[26]!==u||e[27]!==l||e[28]!==r||e[29]!==o?(g=h=>t.jsx(fn,{task:h,isActive:a===h.id,onClick:()=>o(h),onArchive:u&&h.created_by===l.currentUserId?()=>r(h):void 0,showAutomationBadge:!!h.trigger_id,showAgentIcon:!0},h.id),e[25]=a,e[26]=u,e[27]=l,e[28]=r,e[29]=o,e[30]=g):g=e[30],p=s.map(g),e[18]=a,e[19]=u,e[20]=l,e[21]=r,e[22]=o,e[23]=s,e[24]=p}else p=e[24];let y;e[31]!==c||e[32]!==d||e[33]!==f?(y=(c||d)&&t.jsx(mn,{onClick:f,isFetching:d}),e[31]=c,e[32]=d,e[33]=f,e[34]=y):y=e[34];let x;return e[35]!==p||e[36]!==y?(x=t.jsxs(t.Fragment,{children:[p,y]}),e[35]=p,e[36]=y,e[37]=x):x=e[37],x}function di(n,e){return null}function ui(n,e){return n.some(s=>s.id!==e.taskId&&!s.hidden&&s.branch===e.branch&&s.virtual_mcp_id===e.virtualMcpId)}const fi=["archive","reclaim-worktree"],mi=[];function gi(n){return n==="confirm"?fi:mi}function Sa(n){const e=z.c(11),{panel:s}=n;let i;return e[0]!==s.activeTaskId||e[1]!==s.archiveTask||e[2]!==s.filters||e[3]!==s.filtersActive||e[4]!==s.groupBy||e[5]!==s.hasMore||e[6]!==s.isFetchingMore||e[7]!==s.loadMore||e[8]!==s.selectTask||e[9]!==s.threads?(i=t.jsx(ci,{threads:s.threads,groupBy:s.groupBy,activeTaskId:s.activeTaskId,onSelectTask:s.selectTask,onArchiveTask:s.archiveTask,filters:s.filters,hasMore:s.hasMore,isFetchingMore:s.isFetchingMore,onLoadMore:s.loadMore,filtersActive:s.filtersActive}),e[0]=s.activeTaskId,e[1]=s.archiveTask,e[2]=s.filters,e[3]=s.filtersActive,e[4]=s.groupBy,e[5]=s.hasMore,e[6]=s.isFetchingMore,e[7]=s.loadMore,e[8]=s.selectTask,e[9]=s.threads,e[10]=i):i=e[10],i}function ka(n){const e=z.c(82);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,a=G(),{data:o}=Te.useSession(),r=o?.user?.id,{org:l}=le();let c;e[2]!==l.id?(c=dt(l.id),e[2]=l.id,e[3]=c):c=e[3];const d=c.id,{threads:f,hasMore:m,isFetchingMore:u,fetchNextPage:p}=ut(),y=f.filter(bi),{hide:x,setScope:g}=nn(),h=at(),b=ct(),{setTaskId:j,createNewTask:C}=ft();let w;e[4]===Symbol.for("react.memo_cache_sentinel")?(w={strict:!1},e[4]=w):w=e[4];const I=rt(w);let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M={strict:!1},e[5]=M):M=e[5];const v=lt(M),N=I.taskId??null;let A;e[6]!==N||e[7]!==f||e[8]!==v.virtualmcpid?(A=v.virtualmcpid??f.find(k=>k.id===N)?.virtual_mcp_id??null,e[6]=N,e[7]=f,e[8]=v.virtualmcpid,e[9]=A):A=e[9];const S=A;let _;e[10]!==i?(_=()=>{i?.()},e[10]=i,e[11]=_):_=e[11];const T=_,P=[...y].sort(xi),[D,F]=V.useState("all"),[L,O]=V.useState("flat"),[$,U]=Ct("sidebar-threads-scope-all",!1),[R,q]=V.useState(!1),[E,Y]=V.useState(!1);let ee;e[12]!==q?(ee=()=>{K("tasks_panel_search_opened"),Y(!0),q(!0)},e[12]=q,e[13]=ee):ee=e[13];const te=ee,[H,Z]=V.useState(null),ne=r??null;let W;e[14]!==ne||e[15]!==D?(W={type:D,member:"mine",currentUserId:ne},e[14]=ne,e[15]=D,e[16]=W):W=e[16];const Ne=W,Be={};$||(Be.created_by="me"),g(Be);let Ce;e[17]!==r?(Ce=k=>r?k.filter(B=>B.created_by===r):[],e[17]=r,e[18]=Ce):Ce=e[18];const Ee=Ce;let _e;e[19]!==D?(_e=k=>D==="automation"?k.filter(pi):D==="manual"?k.filter(hi):k,e[19]=D,e[20]=_e):_e=e[20];const We=_e,se=We($?P:Ee(P));let Se;e[21]!==N||e[22]!==T||e[23]!==r||e[24]!==x||e[25]!==h||e[26]!==l.slug||e[27]!==j||e[28]!==se?(Se=k=>{const B=k.id===N,J=x(k.id);if(ss(k.id),!B)return J;const ue=Vo(se,k.id,r);return T(),ue?j(ue.id,ue.virtual_mcp_id):h({to:"/$org",params:{org:l.slug}}),J},e[21]=N,e[22]=T,e[23]=r,e[24]=x,e[25]=h,e[26]=l.slug,e[27]=j,e[28]=se,e[29]=Se):Se=e[29];const oe=Se;let Re;e[30]!==b||e[31]!==a?(Re=async k=>{try{await b.call("SANDBOX_DELETE",{virtualMcpId:k.virtualMcpId,branch:k.branch,sandboxProviderKind:"user-desktop",removeWorktree:!0})}catch{X.error(a("sidebar.archiveWorktreeDialog.reclaimFailed",{branch:k.branch}))}},e[30]=b,e[31]=a,e[32]=Re):Re=e[32];const ke=Re;let Ie;e[33]!==f||e[34]!==oe||e[35]!==r||e[36]!==Z?(Ie=k=>{if(r&&k.created_by&&k.created_by!==r)return;const B=di();if(!B||ui(f,B)){oe(k);return}Z({task:k,target:B})},e[33]=f,e[34]=oe,e[35]=r,e[36]=Z,e[37]=Ie):Ie=e[37];const fe=Ie;let de;e[38]!==oe||e[39]!==H||e[40]!==ke||e[41]!==Z?(de=k=>{const B=H;B&&(Z(null),(async()=>{for(const J of gi(k))if(J==="archive")try{await oe(B.task)}catch{return}else await ke(B.target)})())},e[38]=oe,e[39]=H,e[40]=ke,e[41]=Z,e[42]=de):de=e[42];const Fe=de;let De;e[43]!==T||e[44]!==j?(De=k=>{T(),j(k.id,k.virtual_mcp_id)},e[43]=T,e[44]=j,e[45]=De):De=e[45];const ze=De;let Ae;e[46]!==S||e[47]!==N||e[48]!==f||e[49]!==T||e[50]!==C||e[51]!==d?(Ae=()=>{const k=S??d,B=f.find(J=>J.id===N)?.branch??null;K("sidebar_new_thread_clicked",{virtual_mcp_id:k}),T(),C(k,B)},e[46]=S,e[47]=N,e[48]=f,e[49]=T,e[50]=C,e[51]=d,e[52]=Ae):Ae=e[52];const me=Ae;let ie;e[53]!==p?(ie=()=>{p()},e[53]=p,e[54]=ie):ie=e[54];const ge=L!=="flat"||D!=="all"||$;let ae;e[55]!==Fe||e[56]!==H?(ae=H?t.jsx(Ho,{branch:H.target.branch,onOutcome:Fe}):null,e[55]=Fe,e[56]=H,e[57]=ae):ae=e[57];let re;e[58]!==E||e[59]!==R||e[60]!==q?(re=E?t.jsx(Go,{open:R,onOpenChange:q}):null,e[58]=E,e[59]=R,e[60]=q,e[61]=re):re=e[61];let we;return e[62]!==N||e[63]!==fe||e[64]!==Ne||e[65]!==L||e[66]!==m||e[67]!==u||e[68]!==me||e[69]!==te||e[70]!==ze||e[71]!==O||e[72]!==U||e[73]!==F||e[74]!==$||e[75]!==ie||e[76]!==ge||e[77]!==ae||e[78]!==re||e[79]!==D||e[80]!==se?(we={threads:se,activeTaskId:N,filters:Ne,hasMore:m,isFetchingMore:u,loadMore:ie,groupBy:L,setGroupBy:O,typeFilter:D,setTypeFilter:F,showAll:$,setShowAll:U,filtersActive:ge,selectTask:ze,archiveTask:fe,newThread:me,openSearch:te,reclaimDialog:ae,searchDialog:re},e[62]=N,e[63]=fe,e[64]=Ne,e[65]=L,e[66]=m,e[67]=u,e[68]=me,e[69]=te,e[70]=ze,e[71]=O,e[72]=U,e[73]=F,e[74]=$,e[75]=ie,e[76]=ge,e[77]=ae,e[78]=re,e[79]=D,e[80]=se,e[81]=we):we=e[81],we}function hi(n){return!n.trigger_id}function pi(n){return!!n.trigger_id}function xi(n,e){return(e.updated_at??"").localeCompare(n.updated_at??"")}function bi(n){return!n.hidden}function vi(n){return n?n.run_in_progress?"generating":n.scanned_at?"ready":"none":"none"}const ji=2e4;function yi(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function Ia(){const n=z.c(17),{org:e}=le(),s=Bn.COMMERCE_DISCOVERY(e.id);let i;n[0]!==e.id||n[1]!==e.slug?(i=$t({connectionId:Qt,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=i):i=n[2];const{data:a}=He(i),r=He({queryKey:Ue.commerceDiscoveryConnection(e.id,s),enabled:!!a,retry:!1,staleTime:6e4,queryFn:async()=>{if(!a)throw new Error("selfClient not ready");const j=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}});return Pt(j)}}).data?.item??null,{data:l}=He({...$t({connectionId:s,orgId:e.id,orgSlug:e.slug}),enabled:!!r}),c=Ue.commerceDiscoveryDiagnostic(e.id,s),d=!!l;let f;n[3]!==l?(f=async()=>{if(!l)throw new Error("cdClient not ready");const j=await l.callTool({name:Xt,arguments:{}});return Pt(j).diagnostic??null},n[3]=l,n[4]=f):f=n[4];let m;n[5]!==c||n[6]!==d||n[7]!==f?(m={queryKey:c,enabled:d,retry:1,refetchInterval:Ci,queryFn:f},n[5]=c,n[6]=d,n[7]=f,n[8]=m):m=n[8];const u=He(m),p=u.data??null,y=u.isSuccess,x=r?.metadata?.siteUrl;let g;n[9]!==x?(g=yi(x),n[9]=x,n[10]=g):g=n[10];const h=l??null;let b;return n[11]!==s||n[12]!==u.isSuccess||n[13]!==p||n[14]!==g||n[15]!==h?(b={diagnostic:p,isSuccess:y,host:g,connectionId:s,cdClient:h},n[11]=s,n[12]=u.isSuccess,n[13]=p,n[14]=g,n[15]=h,n[16]=b):b=n[16],b}function Ci(n){return n.state.status!=="error"&&vi(n.state.data)==="generating"?ji:!1}function Da(n,e){return{to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:En(n.id),main:Qs(e,Xt)}}}export{ya as A,ba as C,Ca as N,ja as O,Na as T,va as a,_a as b,ka as c,so as d,Mt as e,Sa as f,Ia as g,vi as h,Da as i,wa as u};
@@ -1 +0,0 @@
1
- import{c as g,H as N,av as O,bF as _,K as y,o as v,p as A,e as I,t as q}from"./index-DLiSt-zY.js";function Q(){const e=g.c(10),{org:a}=N(),u=O(),{capabilities:r,isPrivileged:c}=_(),d=c||!!r["members:manage"];let t;e[0]!==a.id?(t=y.organizationJoinRequests(a.id),e[0]=a.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const o=!!a.id&&d;let i;e[4]!==t||e[5]!==s||e[6]!==o?(i={queryKey:t,queryFn:s,enabled:o},e[4]=t,e[5]=s,e[6]=o,e[7]=i):i=e[7];const{data:l}=v(i);let n;return e[8]!==l?.requests?(n=l?.requests??[],e[8]=l?.requests,e[9]=n):n=e[9],n}function b(){const e=g.c(21),{org:a,locator:u}=N(),r=O(),c=A();let d;e[0]!==u||e[1]!==a||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(a.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=a,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==r?(s=R=>r.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=r,e[5]=s):s=e[5];let o;e[6]!==t?(o=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=o):o=e[7];let i;e[8]!==s||e[9]!==o?(i={mutationFn:s,onSuccess:o,onError:T},e[8]=s,e[9]=o,e[10]=i):i=e[10];const l=I(i);let n;e[11]!==r?(n=R=>r.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=r,e[12]=n):n=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==n||e[16]!==f?(m={mutationFn:n,onSuccess:f,onError:S},e[15]=n,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function S(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function T(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{b as a,Q as u};
@@ -1 +0,0 @@
1
- import{I as y,r as c,c as b,j as A,d as C,H as E,a as $}from"./index-DLiSt-zY.js";import{u as _}from"./use-virtual-mcp-DkibxhFn.js";import{b as P}from"./hooks-BjFStmIb.js";import{f as w}from"./reusable-new-chat-CouMjkYR.js";const h=new Map;function I(e){return`${e.orgId}:${e.userId}`}function G(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(s=>typeof s=="string"):[]}catch{return[]}}function N(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function U(e){const t=I(e),r=h.get(t);if(r)return r;const s=y.sidebarGroupOrder(e.orgId,e.userId);let a=!1;try{a=localStorage.getItem(s)!==null}catch{}let o=O(s);if(!a&&o.length===0&&e.userId!=="anon"){const i=O(G(e.orgId));i.length>0&&(o=i)}return h.set(t,o),o}function T(e,t){const r=new Set(t);return U(e).filter(s=>!r.has(s))}function j(e,t){h.set(I(e),t),N(y.sidebarGroupOrder(e.orgId,e.userId),t)}function K(e,t,r=[]){if(r.includes(t))return;const s=T(e,r);s.includes(t)||j(e,[t,...s])}const S=c.createContext(null);function Q(e){const t=b.c(7),{children:r}=e,[s,a]=c.useState(!1),[o,i]=c.useState(0);let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>i(k),t[0]=d):d=t[0];const l=d;let n;t[1]!==s||t[2]!==o?(n={empty:s,setEmpty:a,orderRevision:o,bumpOrderRevision:l},t[1]=s,t[2]=o,t[3]=n):n=t[3];let u;return t[4]!==r||t[5]!==n?(u=A.jsx(S.Provider,{value:n,children:r}),t[4]=r,t[5]=n,t[6]=u):u=t[6],u}function k(e){return e+1}function W(){return c.useContext(S)?.empty??!1}function D(){return c.useContext(S)?.bumpOrderRevision??H}function H(){}const v=[],J=()=>()=>{};function L(e){return(e??[]).filter(t=>!!t.pinned).map(t=>t.id)}function X(){const e=b.c(15),t=C(),{org:r}=E(),s=_(),{data:a}=$.useSession(),o=a?.user?.id??"anon";let i;e[0]!==s?(i=L(s),e[0]=s,e[1]=i):i=e[1];const d=i,l=D(),n=P();let u;e[2]!==n?.threads.get?(u=n?.threads.get??V,e[2]=n?.threads.get,e[3]=u):u=e[3];let f;e[4]!==n?.threads.get?(f=n?.threads.get??B,e[4]=n?.threads.get,e[5]=f):f=e[5];const m=c.useSyncExternalStore(n?.threads.subscribe??J,u,f);let g;return e[6]!==l||e[7]!==t||e[8]!==r.id||e[9]!==r.slug||e[10]!==d||e[11]!==a?.user?.id||e[12]!==o||e[13]!==m?(g=(p,x)=>{K({orgId:r.id,userId:o},p,d),l();const R=w(m,p,a?.user?.id)?.id??crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:R},search:{...x?.search??{},virtualmcpid:p}})},e[6]=l,e[7]=t,e[8]=r.id,e[9]=r.slug,e[10]=d,e[11]=a?.user?.id,e[12]=o,e[13]=m,e[14]=g):g=e[14],g}function B(){return v}function V(){return v}export{Q as S,D as a,K as b,X as c,L as g,W as u};
@@ -1 +0,0 @@
1
- import{c as D,b as X,r as w,j as s,n as J}from"./index-DLiSt-zY.js";import{ah as _}from"./agent-icon-RO_lY7mQ.js";import{i as Y}from"./SearchMd-B5LTpCxn.js";import{e as Z,d as ee,b as te,a as se}from"./dialog-CaTBZV_d.js";import{I as re}from"./input-CY_6SiUS.js";import{K as le,L as oe,M as ie,N as K,O as ne,P as ce,Q as ae}from"./index-CErG4sP_.js";const fe=12,z=new Set,q=new Set;function de(){for(const r of q)r()}function ue(r){return z.has(r)?!0:z.size>=fe?!1:(z.add(r),!0)}function Q(r){z.delete(r)&&de()}function me(r){return q.add(r),()=>{q.delete(r)}}function ve(r,e){const t=w.useRef(!1),[c,o]=w.useState(!1),a=w.useRef(null),d=w.useRef(null),n=w.useRef(null),l=w.useRef(r);l.current=r;const[f]=w.useState(()=>{const i=()=>{n.current?.(),n.current=null},u=()=>t.current?!0:ue(e)?(t.current=!0,o(!0),i(),!0):!1;return v=>{if(d.current=v,a.current&&(a.current.disconnect(),a.current=null),i(),!v){t.current&&(Q(e),t.current=!1,o(!1));return}queueMicrotask(()=>{if(d.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!n.current&&(n.current=me(()=>{d.current===v&&u()}));return}i(),t.current&&(Q(e),t.current=!1,o(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),a.current=x})}});return{ref:f,iframeActive:c}}function pe(r){const e=D.c(8),{previewUrl:t,title:c,scrollRootRef:o,slotId:a}=r,{ref:d,iframeActive:n}=ve(o,a),[l,f]=w.useState(!1);let i;e[0]!==n||e[1]!==l||e[2]!==t||e[3]!==c?(i=n?s.jsxs(s.Fragment,{children:[!l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:s.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),s.jsx("iframe",{src:t,title:`Preview ${c}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>f(!0)})]}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=n,e[1]=l,e[2]=t,e[3]=c,e[4]=i):i=e[4];let u;return e[5]!==d||e[6]!==i?(u=s.jsx("div",{ref:d,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:i}),e[5]=d,e[6]=i,e[7]=u):u=e[7],u}function xe(r){const e=D.c(26),{entry:t,previewUrl:c,scrollRootRef:o,onSelect:a}=r,d=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let n;e[0]!==d?(n=J("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",d),e[0]=d,e[1]=n):n=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==c||e[5]!==o?(l=s.jsx(pe,{previewUrl:c,title:t.title,scrollRootRef:o,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=c,e[5]=o,e[6]=l):l=e[6];let f;e[7]!==t.isSavedBlock?(f=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=f):f=e[8];let i;e[9]!==f?(i=s.jsx(_,{className:"h-4 w-4 shrink-0",style:f}),e[9]=f,e[10]=i):i=e[10];let u;e[11]!==t.title?(u=s.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=s.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==i||e[19]!==x?(m=s.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[i,x]}),e[18]=i,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==a||e[22]!==n||e[23]!==l||e[24]!==m?(h=s.jsxs("button",{type:"button",onClick:a,className:n,children:[l,m]}),e[21]=a,e[22]=n,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function Ne(r){const e=D.c(51),{open:t,onOpenChange:c,meta:o,decofile:a,previewBaseUrl:d,onSelect:n}=r,l=X(),[f,i]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&i(""));let m,h,S,b,j,N,y,R,g,P,C;if(e[0]!==a||e[1]!==o||e[2]!==c||e[3]!==n||e[4]!==t||e[5]!==d||e[6]!==f||e[7]!==l){const F=t&&o&&a?le(o,a):[],W=o?oe(o):"",G=a?ie(a):void 0,H=new Map;if(t&&W)for(const p of F)H.set(p.resolveType,K(d,W,p.previewBlock,G));const E=f.trim().toLowerCase(),V=E?F.filter(p=>p.title.toLowerCase().includes(E)||p.resolveType.toLowerCase().includes(E)||p.description?.toLowerCase().includes(E)):F;h=Z,P=t,C=c,m=ee,y="top-3 right-3",R="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==l?(U=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=U):U=e[20];let A;e[21]!==U?(A=s.jsx(te,{children:U}),e[21]=U,e[22]=A):A=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=k):k=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>i(p.target.value),e[24]=$):$=e[24];let B;e[25]!==l?(B=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=B):B=e[26];let M;e[27]!==f||e[28]!==B?(M=s.jsxs("div",{className:"relative pt-2",children:[k,s.jsx(re,{value:f,onChange:$,placeholder:B,className:"h-9 pl-8"})]}),e[27]=f,e[28]=B,e[29]=M):M=e[29],e[30]!==A||e[31]!==M?(g=s.jsxs(se,{className:"shrink-0 border-b px-4 py-3 text-left",children:[A,M]}),e[30]=A,e[31]=M,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=V.length===0?s.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:V.map(p=>s.jsx(xe,{entry:p,scrollRootRef:x,previewUrl:H.get(p.resolveType)??K(d,W,p.previewBlock,G),onSelect:()=>n(p)},p.resolveType))}),e[0]=a,e[1]=o,e[2]=c,e[3]=n,e[4]=t,e[5]=d,e[6]=f,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=y,e[15]=R,e[16]=g,e[17]=P,e[18]=C}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],y=e[14],R=e[15],g=e[16],P=e[17],C=e[18];let T;e[33]!==S||e[34]!==b?(T=s.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=T):T=e[35];let I;e[36]!==T||e[37]!==j||e[38]!==N?(I=s.jsx("div",{ref:j,className:N,children:T}),e[36]=T,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==y||e[43]!==R||e[44]!==g?(L=s.jsxs(m,{closeButtonClassName:y,className:R,children:[g,I]}),e[40]=m,e[41]=I,e[42]=y,e[43]=R,e[44]=g,e[45]=L):L=e[45];let O;return e[46]!==h||e[47]!==L||e[48]!==P||e[49]!==C?(O=s.jsx(h,{open:P,onOpenChange:C,children:L}),e[46]=h,e[47]=L,e[48]=P,e[49]=C,e[50]=O):O=e[50],O}function ye(r){const e=D.c(4),{previewServerUrl:t,active:c}=ce(r.virtualMcpId);let o;return e[0]!==c||e[1]!==r.sandboxUrl||e[2]!==t?(o=ae({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:c}),e[0]=c,e[1]=r.sandboxUrl,e[2]=t,e[3]=o):o=e[3],o}export{Ne as A,ye as u};
@@ -1 +0,0 @@
1
- import{I as u}from"./use-infinite-scroll-DsDG7oFh.js";import{eR as i}from"./index-DLiSt-zY.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./use-infinite-scroll-DsDG7oFh.js";import{eR as u,bD as n}from"./index-DLiSt-zY.js";function a(e,r){return u({...e,enabled:!0,suspense:!0,throwOnError:n},s,r)}export{a as u};
@@ -1 +0,0 @@
1
- import{c as K,b as tt,r as et,j as s,n as ot,a8 as vt,ab as yt,B as nt,a9 as Tt}from"./index-DLiSt-zY.js";import{w as jt,a9 as dt,aM as wt}from"./agent-icon-RO_lY7mQ.js";import{i as Nt}from"./ChevronRight-Bbyr31or.js";import{L as kt}from"./label-CIfNh86q.js";import{B as ft}from"./automation-runs-CggJDo1C.js";import{S as Mt}from"./switch-DBiih54-.js";import{V as _t}from"./view-mode-toggle-3Ft6ZtrM.js";import"./AlertCircle-BckADFTN.js";import"./Tool01-kIIhzZhw.js";import"./ArrowUp-8tGgkrEO.js";import"./ArrowLeft-CA4nZ19l.js";import"./Tool02-xsTmH7TW.js";import"./XCircle-qOGRhnhp.js";import"./TrendUp01-D54j7eRb.js";import"./ZapSquare-CGgQRKSq.js";import"./Users03-BH_DGEIm.js";import"./CheckCircle-Dh96WJYX.js";import"./Check-D4XLgaN4.js";import"./ChevronDown-Dm6QJQj5.js";import"./ChevronSelectorVertical-BUgf0an-.js";import"./ChevronUp-C7jPKNLf.js";import"./DotsVertical-CYMbIa1_.js";import"./Stars02-BC82QMl0.js";import"./UserSquare-DgUtDej9.js";import"./Copy01-BqCuDnjV.js";import"./CreditCard01-CALthygT.js";import"./Download01-C6mH6Z8f.js";import"./Settings02-DQ6Qx_Qo.js";import"./Eye-jMpQ7fBE.js";import"./FilterLines-4Qetm1ho.js";import"./Share07-Di11XO-1.js";import"./Globe01-CkxIxFjV.js";import"./Globe04-CWbZ_xf0.js";import"./SwitchHorizontal01-DJAL0oew.js";import"./HardDrive-DqrbzOlI.js";import"./Key01-CzBg_w_E.js";import"./LinkExternal01-BYv4_-zq.js";import"./LockUnlocked01-BssaZtDy.js";import"./LogOut01-CE6p7Q73.js";import"./Monitor01-DUnpXEZF.js";import"./Sun-CL5Lwimd.js";import"./Palette-zSvxc111.js";import"./Play-C9tlPC3I.js";import"./Plus-BBdbmkEC.js";import"./SearchLg-Bg0bWoci.js";import"./SearchMd-B5LTpCxn.js";import"./Shield01-FnU_LRxr.js";import"./Stars01-C8fjQPly.js";import"./Trash01-CISu7ukT.js";import"./Upload01-BBFWsedg.js";import"./User01-Da-P04pG.js";import"./Users01-CXfWV5oU.js";import"./XClose-DL2O4uTC.js";import"./Zap-DYtDBHNd.js";import"./select-BwLC9-0c.js";import"./useInfiniteQuery-Tdf3vSzC.js";import"./use-infinite-scroll-DsDG7oFh.js";import"./use-connection-r6ziU6lR.js";import"./use-mcp-client-BsB3UQx0.js";import"./constants-_08zpzmT.js";import"./auth-DeQHSbj0.js";import"./use-virtual-mcp-DkibxhFn.js";import"./table-BM3FdIaA.js";import"./empty-state-Dx5RvteD.js";import"./use-members-DZPpmeBy.js";import"./use-org-auth-client-CR2NXIGs.js";import"./use-clock-tick-anNRVc0o.js";import"./use-automations-BrFXzBSZ.js";import"./useSuspenseInfiniteQuery-Dgd9ebpu.js";import"./avatar-t8xMECgD.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BeCWcJQD.js";import"./dialog-CaTBZV_d.js";import"./tab-id-DrwxksV4.js";import"./hooks-BjFStmIb.js";import"./decopilot-sse-pool-Cn3-H_-J.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-DzbskOkq.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-Ck06PFGE.js";import"./use-decopilot-events-DZOEgHZF.js";import"./use-organization-settings-WfyIMnA9.js";import"./monaco-editor-ZUjofCql.js";import"./spinner-Dpvz3p80.js";import"./types-7z_oxg9w.js";import"./shell-layout-DEMtIHgw.js";import"./required-auth-layout-v7tDA1sl.js";import"./use-org-sso-BhfC5bai.js";import"./integration-icon-CGhJSgDA.js";import"./use-navigate-to-agent-D_YtZ8Nf.js";import"./reusable-new-chat-CouMjkYR.js";import"./chart-B-JWflUf.js";import"./index-DXHENisy.js";import"./form-C1Z3Pgy9.js";import"./input-CY_6SiUS.js";import"./file-type-icon-C2ALTS96.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Dt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:n}=e,r=typeof t=="string",a=typeof n=="string";if(!r&&!a)return null;const o=r?new Date(t):Ct,i=a?new Date(n):Dt;return Number.isNaN(o.getTime())||Number.isNaN(i.getTime())||r&&a&&i.getTime()<=o.getTime()?null:{start:o,end:i,openStart:!r,openEnd:!a}}function pt(e,t){if(!e||typeof e!="object")return;const n=e.__resolveType;if(typeof n=="string"){if(Et.has(n)){const r=Rt(e);r&&t.push(r);return}if(St.has(n)){const r=e.matchers;if(Array.isArray(r))for(const a of r)pt(a,t)}}}function Ot(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const n=e.variants;return Array.isArray(n)}function It(e){if(typeof e=="string"){const m=e.trim();if(m.length===0)return null;try{const c=new URL(m).pathname.split("/").filter(Boolean),d=c[c.length-1];if(d)return decodeURIComponent(d)}catch{}return m.length>80?`${m.slice(0,77)}…`:m}if(!e||typeof e!="object")return null;const t=e,n=t.config,a=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,n?.title,n?.name,n?.typeAlert?.message,a?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const m of o)if(typeof m=="string"&&m.trim().length>0)return m.trim();const i=t.__resolveType;if(typeof i=="string"){const l=(i.split("/").pop()??i).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];typeof r=="number"?t.length>0?t[t.length-1]+=`[${r}]`:t.push(`[${r}]`):t.push(r)}return t.join(" · ")}function X(e,t,n,r,a){if(Ot(e)){const o=e.variants,i=e.__resolveType,m=$t.test(i)?"":Pt(r);o.forEach((l,c)=>{if(!l||typeof l!="object")return;const d=l,p=[];if(pt(d.rule,p),p.length===0)return;const x=It(d.value)??(m||n);for(const h of p)a.push({blockKey:t,blockLabel:n,innerPath:m,variantIndex:c,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:i})});for(let l=0;l<o.length;l++){const c=o[l];c&&typeof c=="object"&&X(c.value,t,n,[...r,"variants",l,"value"],a)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)X(e[o],t,n,[...r,o],a);return}if(e&&typeof e=="object")for(const[o,i]of Object.entries(e))o!=="__resolveType"&&X(i,t,n,[...r,o],a)}function Ft(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e))X(r,n,Lt(n),[],t);return t.sort((n,r)=>n.start.getTime()-r.start.getTime())}function Vt(e){const t=[...new Set(e)].sort(),n=new Map;return t.forEach((r,a)=>{const o=a*137.508%360;n.set(r,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),n}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function ut(e,t){return e.get(t)??Ht}const Bt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ht=["January","February","March","April","May","June","July","August","September","October","November","December"],gt=1440*60*1e3;function B(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function xt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function G(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function Z(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function st(e,t){return Math.round((B(e).getTime()-B(t).getTime())/gt)}function Wt(e){const t=(e.getTime()-B(e).getTime())/gt;return Math.min(Math.max(t,0),1)}function at(e,t){return st(e,t)+Wt(e)}function zt(e){const t=Z(e,-e.getDay()),n=[];for(let r=0;r<6;r++){const a=[];for(let o=0;o<7;o++)a.push(Z(t,r*7+o));n.push(a)}for(;n.length>0&&n[n.length-1].every(r=>r.getMonth()!==e.getMonth());)n.pop();return n}function Ut(e,t){const n=B(e[0]),r=Z(n,7),a=n.getTime(),o=r.getTime(),i=[];for(const c of t){const d=B(c.start),p=B(c.end);if(p.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=p.getTime()>=r.getTime()?Z(r,-1):p,h=st(u,n),g=st(x,u)+1;if(g<=0)continue;const b=Math.max(c.start.getTime(),a),j=Math.min(c.end.getTime(),o),v=at(new Date(b),n),f=Math.max(at(new Date(j),n)-v,0);f<=0||i.push({variant:c,startCol:h,span:g,leftUnits:v,widthUnits:f})}i.sort((c,d)=>c.startCol-d.startCol||d.span-c.span||c.variant.blockKey.localeCompare(d.variant.blockKey));const m=[],l=[];for(const c of i){let d=m.findIndex(p=>p<=c.startCol);d===-1&&(d=m.length,m.push(0)),m[d]=c.startCol+c.span,l.push({...c,lane:d})}return l}const it=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Yt(e,t){const n=e.openStart?t("sandbox.variantCalendar.always"):it.format(e.start),r=e.openEnd?t("sandbox.variantCalendar.ongoing"):it.format(e.end);return`${n} → ${r}`}function Gt(e){const t=K.c(18),{variant:n}=e,r=tt();let a;t[0]!==n.blockLabel?(a=s.jsx("div",{className:"font-semibold",children:n.blockLabel}),t[0]=n.blockLabel,t[1]=a):a=t[1];let o;t[2]!==n.innerPath?(o=n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.innerPath}),t[2]=n.innerPath,t[3]=o):o=t[3];let i;t[4]!==n.blockLabel||t[5]!==n.innerPath||t[6]!==n.label?(i=n.label!==n.blockLabel&&n.label!==n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.label}),t[4]=n.blockLabel,t[5]=n.innerPath,t[6]=n.label,t[7]=i):i=t[7];let m;t[8]!==r||t[9]!==n?(m=Yt(n,r),t[8]=r,t[9]=n,t[10]=m):m=t[10];let l;t[11]!==m?(l=s.jsx("div",{className:"mt-1",children:m}),t[11]=m,t[12]=l):l=t[12];let c;return t[13]!==a||t[14]!==o||t[15]!==i||t[16]!==l?(c=s.jsx(Tt,{children:s.jsxs("div",{className:"text-xs",children:[a,o,i,l]})}),t[13]=a,t[14]=o,t[15]=i,t[16]=l,t[17]=c):c=t[17],c}const lt=16;function Kt(e,t){const n=e?"transparent":"#000 0",r=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${n}, #000 ${lt}px, #000 calc(100% - ${lt}px), ${r})`}function bt(e){const t=K.c(26),{variant:n,color:r,style:a,children:o,fadeStart:i,fadeEnd:m}=e,l=i===void 0?!1:i,c=m===void 0?!1:m;let d;t[0]!==c||t[1]!==l?(d=Kt(l,c),t[0]=c,t[1]=l,t[2]=d):d=t[2];const p=d;let u;t[3]!==l?(u=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=u):u=t[4];let x;t[5]!==c?(x=c&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=c,t[6]=x):x=t[6];let h;t[7]!==p?(h=p&&{maskImage:p,WebkitMaskImage:p},t[7]=p,t[8]=h):h=t[8];let g;t[9]!==r.bg||t[10]!==r.text||t[11]!==a||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:r.bg,color:r.text,borderRadius:4,...u,...x,...h,...a},t[9]=r.bg,t[10]=r.text,t[11]=a,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==o?(b=s.jsx("span",{className:"truncate",children:o}),t[16]=o,t[17]=b):b=t[17];let j;t[18]!==g||t[19]!==b?(j=s.jsx(vt,{asChild:!0,children:s.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=j):j=t[20];let v;t[21]!==n?(v=s.jsx(Gt,{variant:n}),t[21]=n,t[22]=v):v=t[22];let f;return t[23]!==v||t[24]!==j?(f=s.jsxs(yt,{children:[j,v]}),t[23]=v,t[24]=j,t[25]=f):f=t[25],f}function tr(e){const t=K.c(72),{decofile:n}=e,r=tt(),[a,o]=et.useState("calendar"),[i,m]=et.useState(Xt),[l,c]=et.useState(!1);let d,p,u;if(t[0]!==n||t[1]!==l){const P=Ft(n);d=P.filter(Qt).length,u=l?P:P.filter(qt),p=Vt(u.map(Jt)),t[0]=n,t[1]=l,t[2]=d,t[3]=p,t[4]=u}else d=t[2],p=t[3],u=t[4];const x=p;let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>m(xt(new Date)),t[5]=h):h=t[5];const g=h;let b;t[6]!==a?(b=()=>m(P=>a==="calendar"?G(P,-1):G(P,-3)),t[6]=a,t[7]=b):b=t[7];const j=b;let v;t[8]!==a?(v=()=>m(P=>a==="calendar"?G(P,1):G(P,3)),t[8]=a,t[9]=v):v=t[9];const f=v;let y;t[10]!==r?(y=r("sandbox.variantCalendar.today"),t[10]=r,t[11]=y):y=t[11];let T;t[12]!==y?(T=s.jsx(nt,{variant:"outline",size:"sm",onClick:g,children:y}),t[12]=y,t[13]=T):T=t[13];let N;t[14]!==r?(N=r("sandbox.variantCalendar.previous"),t[14]=r,t[15]=N):N=t[15];let D;t[16]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(jt,{size:16}),t[16]=D):D=t[16];let k;t[17]!==j||t[18]!==N?(k=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:j,"aria-label":N,children:D}),t[17]=j,t[18]=N,t[19]=k):k=t[19];let M;t[20]!==r?(M=r("sandbox.variantCalendar.next"),t[20]=r,t[21]=M):M=t[21];let S;t[22]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Nt,{size:16}),t[22]=S):S=t[22];let A;t[23]!==f||t[24]!==M?(A=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:f,"aria-label":M,children:S}),t[23]=f,t[24]=M,t[25]=A):A=t[25];const $=ht[i.getMonth()];let C;t[26]!==i?(C=i.getFullYear(),t[26]=i,t[27]=C):C=t[27];let _;t[28]!==$||t[29]!==C?(_=s.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[$," ",C]}),t[28]=$,t[29]=C,t[30]=_):_=t[30];let w;t[31]!==A||t[32]!==_||t[33]!==T||t[34]!==k?(w=s.jsxs("div",{className:"flex items-center gap-2",children:[T,k,A,_]}),t[31]=A,t[32]=_,t[33]=T,t[34]=k,t[35]=w):w=t[35];let L;t[36]!==d||t[37]!==l||t[38]!==r?(L=d>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Mt,{id:"show-ongoing",checked:l,onCheckedChange:c}),s.jsx(kt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:r("sandbox.variantCalendar.showOngoing",{count:d})})]}),t[36]=d,t[37]=l,t[38]=r,t[39]=L):L=t[39];let H;t[40]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(dt,{}),t[40]=H):H=t[40];let F;t[41]!==r?(F=r("sandbox.variantCalendar.calendarMode"),t[41]=r,t[42]=F):F=t[42];let E;t[43]!==F?(E={value:"calendar",icon:H,label:F},t[43]=F,t[44]=E):E=t[44];let W;t[45]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(wt,{}),t[45]=W):W=t[45];let R;t[46]!==r?(R=r("sandbox.variantCalendar.timelineMode"),t[46]=r,t[47]=R):R=t[47];let O;t[48]!==R?(O={value:"timeline",icon:W,label:R},t[48]=R,t[49]=O):O=t[49];let I;t[50]!==E||t[51]!==O?(I=[E,O],t[50]=E,t[51]=O,t[52]=I):I=t[52];let V;t[53]!==I||t[54]!==a?(V=s.jsx(_t,{value:a,onValueChange:o,options:I}),t[53]=I,t[54]=a,t[55]=V):V=t[55];let z;t[56]!==L||t[57]!==V?(z=s.jsxs("div",{className:"flex items-center gap-4",children:[L,V]}),t[56]=L,t[57]=V,t[58]=z):z=t[58];let U;t[59]!==w||t[60]!==z?(U=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[w,z]}),t[59]=w,t[60]=z,t[61]=U):U=t[61];let Y;t[62]!==x||t[63]!==i||t[64]!==d||t[65]!==l||t[66]!==u||t[67]!==a?(Y=u.length===0?s.jsx(Zt,{hiddenOngoing:l?0:d}):a==="calendar"?s.jsx(ee,{monthStart:i,variants:u,colorMap:x}):s.jsx(oe,{monthStart:i,variants:u,colorMap:x}),t[62]=x,t[63]=i,t[64]=d,t[65]=l,t[66]=u,t[67]=a,t[68]=Y):Y=t[68];let q;return t[69]!==U||t[70]!==Y?(q=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[U,Y]}),t[69]=U,t[70]=Y,t[71]=q):q=t[71],q}function Jt(e){return e.blockKey}function qt(e){return!e.openEnd}function Qt(e){return e.openEnd}function Xt(){return xt(new Date)}function Zt(e){const t=K.c(4),{hiddenOngoing:n}=e,r=n===void 0?0:n,a=tt();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(dt,{size:24,className:"text-muted-foreground/60"}),t[0]=o):o=t[0];let i;return t[1]!==r||t[2]!==a?(i=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[o,r>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{children:a("sandbox.variantCalendar.noDatedVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:a("sandbox.variantCalendar.hiddenOngoingVariants",{count:r})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{children:a("sandbox.variantCalendar.noScheduledVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:a("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=r,t[2]=a,t[3]=i):i=t[3],i}const rt=20,ct=2,mt=28,te=6;function ee(e){const t=K.c(17),{monthStart:n,variants:r,colorMap:a}=e;let o,i,m,l,c;if(t[0]!==a||t[1]!==n||t[2]!==r){const u=zt(n),x=B(new Date);o=ft,c="flex-1 min-h-0",i="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:Bt.map(re)}),t[8]=m):m=t[8],l=u.map((h,g)=>{const b=Ut(h,r),j=b.reduce(ne,0),v=mt+j*(rt+ct)+8;return s.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:v},children:[h.map((f,y)=>{const T=f.getMonth()===n.getMonth(),N=f.getTime()===x.getTime();return s.jsx("div",{className:ot("border-r last:border-r-0 px-2 pt-1.5 text-xs",T?"bg-background":"bg-muted/30 text-muted-foreground"),children:s.jsx("span",{className:ot("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:f.getDate()})},y)}),b.map((f,y)=>{const T=ut(a,f.variant.blockKey),N=mt+f.lane*(rt+ct),D=f.leftUnits/7*100,k=f.widthUnits/7*100,M=f.variant.openStart&&g===0,S=f.variant.openEnd&&g===u.length-1;return s.jsxs(bt,{variant:f.variant,color:T,fadeStart:M,fadeEnd:S,style:{top:N,left:`calc(${D}% + 2px)`,width:`calc(${k}% - 4px)`,minWidth:te,height:rt},children:[f.variant.blockLabel,f.variant.label!==f.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",f.variant.label]})]},`${g}-${y}`)})]},g)}),t[0]=a,t[1]=n,t[2]=r,t[3]=o,t[4]=i,t[5]=m,t[6]=l,t[7]=c}else o=t[3],i=t[4],m=t[5],l=t[6],c=t[7];let d;t[9]!==i||t[10]!==m||t[11]!==l?(d=s.jsxs("div",{className:i,children:[m,l]}),t[9]=i,t[10]=m,t[11]=l,t[12]=d):d=t[12];let p;return t[13]!==o||t[14]!==c||t[15]!==d?(p=s.jsx(o,{className:c,children:d}),t[13]=o,t[14]=c,t[15]=d,t[16]=p):p=t[16],p}function ne(e,t){return Math.max(e,t.lane+1)}function re(e){return s.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const Q=4,se=32,J=240;function oe(e){const t=K.c(23),{monthStart:n,variants:r,colorMap:a}=e,o=n,i=G(n,Q),m=new Date,l=new Map;for(const _ of r){const w=l.get(_.blockKey)??[];w.push(_),l.set(_.blockKey,w)}const c=Array.from(l.entries()).sort(le),d=i.getTime()-o.getTime(),p=_=>(Math.max(o.getTime(),Math.min(i.getTime(),_.getTime()))-o.getTime())/d*100;let u;t[0]!==o?(u=(_,w)=>G(o,w),t[0]=o,t[1]=u):u=t[1];const x=Array.from({length:Q},u),h=m.getTime()>=o.getTime()&&m.getTime()<=i.getTime()?p(m):null,g=tt(),b=ft,j="flex-1 min-h-0",v="min-w-[900px] relative";let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f={width:J},t[2]=f):f=t[2];let y;t[3]!==g?(y=g("sandbox.variantCalendar.variantBlock"),t[3]=g,t[4]=y):y=t[4];let T;t[5]!==y?(T=s.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:f,children:y}),t[5]=y,t[6]=T):T=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const D=x.map(ie);let k;t[8]!==D?(k=s.jsx("div",{className:"flex-1 grid",style:N,children:D}),t[8]=D,t[9]=k):k=t[9];let M;t[10]!==T||t[11]!==k?(M=s.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[T,k]}),t[10]=T,t[11]=k,t[12]=M):M=t[12];let S;t[13]!==g||t[14]!==h?(S=h!==null&&s.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${J}px + (100% - ${J}px) * ${h} / 100)`},children:s.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:g("sandbox.variantCalendar.todayLabel")})}),t[13]=g,t[14]=h,t[15]=S):S=t[15];const A=c.map(_=>{const[w,L]=_,H=ut(a,w),F=L[0]?.blockLabel??w;return s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:s.jsx("div",{className:"px-3 truncate",style:{width:J},children:F})}),L.map((E,W)=>s.jsxs("div",{className:"flex border-b items-center",style:{height:se},children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:J},children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:H.bg}}),s.jsx("span",{className:"truncate text-foreground/80",children:E.label})]}),s.jsxs("div",{className:"relative flex-1 h-full",children:[s.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},children:x.map(ae)}),(()=>{const R=Math.max(E.start.getTime(),o.getTime()),O=Math.min(E.end.getTime(),i.getTime());if(O<=R)return null;const I=p(new Date(R)),V=p(new Date(O))-I;return s.jsx(bt,{variant:E,color:H,fadeStart:E.openStart,fadeEnd:E.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${I}%`,width:`calc(${V}% - 2px)`,height:22},children:E.label})})()]})]},W))]},w)});let $;t[16]!==M||t[17]!==S||t[18]!==A?($=s.jsxs("div",{className:v,children:[M,S,A]}),t[16]=M,t[17]=S,t[18]=A,t[19]=$):$=t[19];let C;return t[20]!==b||t[21]!==$?(C=s.jsx(b,{className:j,children:$}),t[20]=b,t[21]=$,t[22]=C):C=t[22],C}function ae(e,t){return s.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function ie(e,t){return s.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ht[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function le(e,t){return e[0].localeCompare(t[0])}export{tr as VariantCalendar};