decocms 3.90.0 → 3.90.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/dist/client/assets/{AlertCircle-eL7jEjpx.js → AlertCircle-BFW82Glo.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BtZv9HXz.js → ArrowUpRight-B8NHPBEV.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-Ce4sW5Fr.js → CheckCircle-DNGMJpxK.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-8-SpQ5a6.js → ChevronDown-CIJ7-0w6.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-DQ6Y033o.js → ChevronLeft-DwrsIjn7.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-C7AnVgNL.js → ChevronRight-CFrkN22M.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-hzSQl57_.js → ChevronUp-5yVty_-J.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-CBCiPEnd.js → DotsVertical-B_6X1vi7.js} +1 -1
  9. package/dist/client/assets/{Eye-Du8USWUC.js → Eye-CVnhloDi.js} +1 -1
  10. package/dist/client/assets/{FilterLines-D51fKry2.js → FilterLines-aCF-EO8Z.js} +1 -1
  11. package/dist/client/assets/{Globe01-ByUFNYZ1.js → Globe01-CThKgW6h.js} +1 -1
  12. package/dist/client/assets/{Globe04-BnUIZrLZ.js → Globe04-BM8I7PlJ.js} +1 -1
  13. package/dist/client/assets/{HardDrive-OrjxQFg1.js → HardDrive-CnFxYfXA.js} +1 -1
  14. package/dist/client/assets/{Key01-CI_-yaVv.js → Key01-NlklfK2W.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-DnqAFiqW.js → LayoutLeft-DeMAAMUQ.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-C9plWUCQ.js → LinkExternal01-BQAshidh.js} +1 -1
  17. package/dist/client/assets/{Monitor01-Cx6UPY56.js → Monitor01-Dvufl23t.js} +1 -1
  18. package/dist/client/assets/{Palette-DxYtHeiN.js → Palette-BpmN1_H8.js} +1 -1
  19. package/dist/client/assets/{Play-Bpofg5MS.js → Play-BLi-TNw8.js} +1 -1
  20. package/dist/client/assets/{Plus-B6Bp27KE.js → Plus-DiPCnPyI.js} +1 -1
  21. package/dist/client/assets/{SearchMd-DY2IStnr.js → SearchMd-CKZEESAy.js} +1 -1
  22. package/dist/client/assets/{Settings02-CzDpZT_t.js → Settings02-xJ3tiWNi.js} +1 -1
  23. package/dist/client/assets/{Shield01-ByoQOTwe.js → Shield01-CJTqMoEC.js} +1 -1
  24. package/dist/client/assets/{Star01-COmcJPAd.js → Star01-BO7uFQpG.js} +1 -1
  25. package/dist/client/assets/{Stars01-DjTb55Tj.js → Stars01-BXxzvxO4.js} +1 -1
  26. package/dist/client/assets/{Stars02-B4L_1USv.js → Stars02-CjJwnXFf.js} +1 -1
  27. package/dist/client/assets/{Sun-BrBndJzL.js → Sun-O-ShYNtI.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-COrtT0WP.js → SwitchHorizontal01-Bw76z7hc.js} +1 -1
  29. package/dist/client/assets/{Tool01-D9Z3ra2m.js → Tool01-D2a8I_Gf.js} +1 -1
  30. package/dist/client/assets/{Trash01-S_d8yXYH.js → Trash01-DmRbdJUk.js} +1 -1
  31. package/dist/client/assets/{Upload01-BovBQGIq.js → Upload01-Ccj_plFg.js} +1 -1
  32. package/dist/client/assets/{User01-Dcns6QTI.js → User01-BzP8oKZ3.js} +1 -1
  33. package/dist/client/assets/{Users01-Dua8TttV.js → Users01-CdAaoMtW.js} +1 -1
  34. package/dist/client/assets/{Users03-DTBaxDUb.js → Users03-fR0V8I72.js} +1 -1
  35. package/dist/client/assets/{X-ClFhIPPx.js → X-BAIghubv.js} +1 -1
  36. package/dist/client/assets/{XCircle-ZlnM-le2.js → XCircle-CdCz4npr.js} +1 -1
  37. package/dist/client/assets/{XClose-Cr1-H9ci.js → XClose-vwNqWD2m.js} +1 -1
  38. package/dist/client/assets/{Zap-TPho1Yix.js → Zap-BJK90vlv.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-Brn6J5mG.js → ZapSquare-DuHMAFt7.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-BkeollDv.js → ZoomOut-Bpyue_Zw.js} +1 -1
  41. package/dist/client/assets/{access-gate-FCkKFtCU.js → access-gate-DcWgdeR9.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-CP8OZAs0.js → add-section-modal-DT5a2xfl.js} +1 -1
  43. package/dist/client/assets/{agent-icon-B6eCx9D1.js → agent-icon-Dh6cDydc.js} +1 -1
  44. package/dist/client/assets/{agents-list-CoW11iHc.js → agents-list-DTju_D-G.js} +1 -1
  45. package/dist/client/assets/{ai-providers-DZvST0-1.js → ai-providers-lyzQuhAE.js} +1 -1
  46. package/dist/client/assets/{alert-DG7kpTTq.js → alert-BPkaPX8i.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-DCN5JdMo.js → alert-dialog-szhg9nbv.js} +1 -1
  48. package/dist/client/assets/{app-editor-Cslki56N.js → app-editor-C-GJQzq3.js} +1 -1
  49. package/dist/client/assets/{auth-catchall-c1PPJXlb.js → auth-catchall-C5WYUBq2.js} +1 -1
  50. package/dist/client/assets/{auth-entry-_nOUFp_x.js → auth-entry-v4IJxk9p.js} +1 -1
  51. package/dist/client/assets/{auth-split-layout-DqH6c0k8.js → auth-split-layout-D6VmaiAh.js} +1 -1
  52. package/dist/client/assets/{auth-B9FveTwh.js → auth-ylAHlhew.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-DiMpH9Hf.js → authenticate-and-persist-oauth-v9BhfxwO.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-D6X7gs0k.js → automation-list-row-BDQR6lip.js} +1 -1
  55. package/dist/client/assets/{automation-runs-B9slN7zB.js → automation-runs-CE9uyAtN.js} +1 -1
  56. package/dist/client/assets/{automations-DgNLJXiB.js → automations-YJ5Px3_a.js} +1 -1
  57. package/dist/client/assets/{avatar-CMukQvh7.js → avatar-C54BAvwV.js} +1 -1
  58. package/dist/client/assets/{badge-BkyT3WoL.js → badge-WRzJoL2O.js} +1 -1
  59. package/dist/client/assets/{block-document-DuE6VWLI.js → block-document-DUdX-3AH.js} +1 -1
  60. package/dist/client/assets/{brand-context--ofWuplm.js → brand-context-BZ1-31a8.js} +1 -1
  61. package/dist/client/assets/{buckets-YjT6-1gl.js → buckets-DsHDoGzh.js} +1 -1
  62. package/dist/client/assets/{capability-load-error-b3EGpgG0.js → capability-load-error-BhBYuN70.js} +1 -1
  63. package/dist/client/assets/{card-Bs3t5A2h.js → card-CZbszR9z.js} +1 -1
  64. package/dist/client/assets/{category-editor-CEjlWNxU.js → category-editor-BSjmmy8p.js} +1 -1
  65. package/dist/client/assets/{chat-context-DueHVvJY.js → chat-context-2a9Unx31.js} +1 -1
  66. package/dist/client/assets/{checkbox-LHoIUSFR.js → checkbox-BbXVn_YC.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-ML14RiWT.js → cli-auth-success-UyrL3uNf.js} +1 -1
  68. package/dist/client/assets/{collection-detail-ibjdpE0q.js → collection-detail-BEFyIol2.js} +1 -1
  69. package/dist/client/assets/{collection-display-button-Drrg41_3.js → collection-display-button-CZL1yZYo.js} +1 -1
  70. package/dist/client/assets/{collection-search-CgpTu-Mz.js → collection-search-DBIvyJJc.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-C8hplLSb.js → collection-tabs-C7lBi7ts.js} +1 -1
  72. package/dist/client/assets/{command-BQdrUZdP.js → command-yaXImYX7.js} +1 -1
  73. package/dist/client/assets/{commerce-onboarding-D1XLRejF.js → commerce-onboarding-DrBs9RF7.js} +1 -1
  74. package/dist/client/assets/{connect-desktop-dialog-XNmCdvVO.js → connect-desktop-dialog-8X7uGHQP.js} +1 -1
  75. package/dist/client/assets/{connection-card-DFgMcv0g.js → connection-card-B9W_RY27.js} +1 -1
  76. package/dist/client/assets/{connection-detail-D4rMC3p5.js → connection-detail-q-5qcjda.js} +1 -1
  77. package/dist/client/assets/{connection-form-helpers-BehaoK99.js → connection-form-helpers-BzU7xnbX.js} +1 -1
  78. package/dist/client/assets/{connections-EApUiHUb.js → connections-DZXZfK8S.js} +1 -1
  79. package/dist/client/assets/{context-menu-BrlUfyhd.js → context-menu-C5FEV_by.js} +1 -1
  80. package/dist/client/assets/{decopilot-2OorXRZy.js → decopilot-BJ5FU5R8.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-BTlcRVcA.js → decopilot-sse-pool-CjP6zAlU.js} +1 -1
  82. package/dist/client/assets/{dialog-DGm31nBN.js → dialog-lbyUpqPt.js} +1 -1
  83. package/dist/client/assets/{domain-settings-CdtyE8KM.js → domain-settings-Bxo_fvwt.js} +1 -1
  84. package/dist/client/assets/{drawer-DdWdZjEE.js → drawer-BZYAwdgw.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-BLOjaXD3.js → dropdown-menu-DF3B7I1K.js} +1 -1
  86. package/dist/client/assets/{empty-state-DVp61Buk.js → empty-state-BAyVSC9K.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-D_bB-ShD.js → extract-connection-data-C4TpBkxN.js} +1 -1
  88. package/dist/client/assets/{file-explorer-vaSlSqZW.js → file-explorer-BQgJH40A.js} +1 -1
  89. package/dist/client/assets/{file-type-icon-BCa6hDuH.js → file-type-icon-D7nzXwZZ.js} +1 -1
  90. package/dist/client/assets/{files-DQb9-lnV.js → files-mQKfk-tg.js} +1 -1
  91. package/dist/client/assets/{form-B5xe8o6u.js → form-BGbfy77_.js} +1 -1
  92. package/dist/client/assets/{general-ydE7PYML.js → general-3ck_txNd.js} +1 -1
  93. package/dist/client/assets/{github-repo-picker-8IaQB8YW.js → github-repo-picker-Dt_KVpAO.js} +1 -1
  94. package/dist/client/assets/{hooks-DpQFLCh_.js → hooks-BdAROdrZ.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-CRv9nGz3.js → import-from-deco-dialog-l8ENbsJP.js} +1 -1
  96. package/dist/client/assets/{index-EMcMxAnt.js → index-BKAnigFO.js} +1 -1
  97. package/dist/client/assets/{index-CZQAHCWx.js → index-BUS-a-tW.js} +3 -3
  98. package/dist/client/assets/{index-CthwRpPw.js → index-C0eVGhHT.js} +1 -1
  99. package/dist/client/assets/{index-hv1cpMXB.js → index-C6PDcnUv.js} +5 -5
  100. package/dist/client/assets/{index-DRv0VWsh.js → index-CInyex9M.js} +1 -1
  101. package/dist/client/assets/{index-CRPVmS_G.js → index-Cj5OqjXz.js} +1 -1
  102. package/dist/client/assets/{index-w238AwGD.js → index-CqqoV_UO.js} +1 -1
  103. package/dist/client/assets/{index-CS7neKAN.js → index-CuICTOkh.js} +1 -1
  104. package/dist/client/assets/{index-BCPspZww.js → index-D0fvhtT3.js} +1 -1
  105. package/dist/client/assets/{index-B6YHm6is.js → index-DOaXG0Oi.js} +1 -1
  106. package/dist/client/assets/{index-CuxqDMpm.js → index-Dg5jx7eC.js} +1 -1
  107. package/dist/client/assets/{index-BRdqVONz.js → index-DlWRWOod.js} +1 -1
  108. package/dist/client/assets/{index-BOJe9uwl.js → index-n4Vo7V4h.js} +1 -1
  109. package/dist/client/assets/{index-redirect-Q0F80k5-.js → index-redirect-ChD654T3.js} +1 -1
  110. package/dist/client/assets/{index-BtAPhKbE.js → index-waTLikGH.js} +1 -1
  111. package/dist/client/assets/{input-Bnf6c030.js → input-D8TXMXM-.js} +1 -1
  112. package/dist/client/assets/{integration-icon-BZb9eAa5.js → integration-icon-D2yZ6MPG.js} +1 -1
  113. package/dist/client/assets/{label-Di7vPCvs.js → label-CFlYbKnz.js} +1 -1
  114. package/dist/client/assets/{login-2SyCeWam.js → login-CnaQyAhS.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-CkPjLCsH.js → mcp-oauth-oXYSrL8I.js} +1 -1
  116. package/dist/client/assets/{members-CjaCp3dg.js → members-BQ3iSjR0.js} +1 -1
  117. package/dist/client/assets/{monaco-editor-DwYoS9zw.js → monaco-editor-D82OjyDd.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-DkqIQOcq.js → monitoring-stats-row-BuPr-4zl.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-CZp0JiJW.js → oauth-callback-DtstK2kL.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-Dg09kVke.js → oauth-callback-ai-provider-BgnPPSol.js} +1 -1
  121. package/dist/client/assets/{onboarding-BbfRp_j7.js → onboarding-CJH0Leuw.js} +1 -1
  122. package/dist/client/assets/{org-install-C35OKz52.js → org-install-D67sKYgq.js} +1 -1
  123. package/dist/client/assets/{org-layout-DZByPEyS.js → org-layout-BLUbiGyn.js} +1 -1
  124. package/dist/client/assets/{organization-choice-D-8Jpbxq.js → organization-choice-CHjmYj3j.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-DpKXv5ZW.js → page-seo-form-C4I7m4Df.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-YKiIzrJb.js +1 -0
  127. package/dist/client/assets/{popover-BLg2uxUj.js → popover-D2Q2Eswn.js} +1 -1
  128. package/dist/client/assets/{post-editor-DtfgS5ZG.js → post-editor-Bv1F9MYX.js} +1 -1
  129. package/dist/client/assets/{preview-dialog-DqH-_Rmc.js → preview-dialog-Bc2VzAN-.js} +1 -1
  130. package/dist/client/assets/{primitives-DXpcMQqJ.js → primitives-DHTHNxUS.js} +1 -1
  131. package/dist/client/assets/{profile-BoEvNBMC.js → profile-B6N3yux5.js} +1 -1
  132. package/dist/client/assets/project-app-view-BELIYBcW.js +1 -0
  133. package/dist/client/assets/record-editor-DaT6c7WV.js +1 -0
  134. package/dist/client/assets/registry-DCDFj_rf.js +2 -0
  135. package/dist/client/assets/{registry-layout-DkLgn4PF.js → registry-layout-Cy_01Sh1.js} +1 -1
  136. package/dist/client/assets/{require-capability-ghUcEykT.js → require-capability-ClWn_lpQ.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-SCPc1ODv.js → required-auth-layout-wwcnSe6F.js} +1 -1
  138. package/dist/client/assets/{reset-password-ohLffP_O.js → reset-password-DaGLhf4o.js} +1 -1
  139. package/dist/client/assets/{roles-BjyevsY6.js → roles-CaiOtbXD.js} +1 -1
  140. package/dist/client/assets/{save-status-COIKtaoc.js → save-status-CTER4gWs.js} +1 -1
  141. package/dist/client/assets/{scroll-area-DFbOrGft.js → scroll-area-CryCPcTg.js} +1 -1
  142. package/dist/client/assets/{search-input-Db1Wlp2M.js → search-input-CeZYeezj.js} +1 -1
  143. package/dist/client/assets/{secrets-BORDpp9r.js → secrets-BrjgXM97.js} +1 -1
  144. package/dist/client/assets/{sections-editor-CsdioN2W.js → sections-editor-F-BnnENl.js} +1 -1
  145. package/dist/client/assets/{select-Biv4m02a.js → select-BumbnE5Z.js} +1 -1
  146. package/dist/client/assets/{select-model-B6vWutyx.js → select-model-CTcIByf-.js} +1 -1
  147. package/dist/client/assets/{seo-editor-CSTNL9M8.js → seo-editor-ClI_EAvi.js} +1 -1
  148. package/dist/client/assets/{settings-layout-5lmse1ub.js → settings-layout-DXkAusB2.js} +1 -1
  149. package/dist/client/assets/{settings-section-CD_Cl2xg.js → settings-section-C5bkQp2g.js} +1 -1
  150. package/dist/client/assets/{sheet-CLgUQ0k9.js → sheet-BbFKIkah.js} +1 -1
  151. package/dist/client/assets/{shell-controls-DuKZWqgd.js → shell-controls-DGWPxiPv.js} +1 -1
  152. package/dist/client/assets/{shell-layout-fqgrNv9Y.js → shell-layout-C9OrPrc4.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-B3Il8pQg.js → shell-route-loading-DaawUhrG.js} +1 -1
  154. package/dist/client/assets/{sidebar-B6ogJK6o.js → sidebar-DaurSYcm.js} +1 -1
  155. package/dist/client/assets/{skeleton-7DG8UULc.js → skeleton-C0NWZPiq.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-BBNRI0-0.js → sortable.esm-BqlsxZdn.js} +1 -1
  157. package/dist/client/assets/{sso-50J9BcfO.js → sso-9s_kUvCN.js} +1 -1
  158. package/dist/client/assets/{store-D0nqcAbk.js → store-Ba8mcjDx.js} +1 -1
  159. package/dist/client/assets/store-registry-DEktUT3r.js +2 -0
  160. package/dist/client/assets/{studio-tools-DCyngkzJ.js → studio-tools-BO3QwsEE.js} +1 -1
  161. package/dist/client/assets/{switch-DQj88pZv.js → switch-B87bQp16.js} +1 -1
  162. package/dist/client/assets/{table-Du45gWno.js → table-N4-giWdo.js} +1 -1
  163. package/dist/client/assets/{tabs--E0r9_Sj.js → tabs-CRPtX_rJ.js} +1 -1
  164. package/dist/client/assets/{task-status-B_9F2gh5.js → task-status-2UEXnm8o.js} +1 -1
  165. package/dist/client/assets/{textarea-BFNmWFvP.js → textarea-Du6Le5sO.js} +1 -1
  166. package/dist/client/assets/{toggle-group-KbM3MWcV.js → toggle-group-CBnuvlgo.js} +1 -1
  167. package/dist/client/assets/{toolbar-BgwgtfBD.js → toolbar-DdFuWthq.js} +1 -1
  168. package/dist/client/assets/{tooltip-Dcp4xtTX.js → tooltip-xmkm89yV.js} +1 -1
  169. package/dist/client/assets/{types-BhFW6kUE.js → types-D8C9oPp4.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-BMg8Dsli.js → use-ai-providers-9J9bNHdx.js} +1 -1
  171. package/dist/client/assets/{use-automations-D4GU11Hn.js → use-automations-D_7wf0xL.js} +1 -1
  172. package/dist/client/assets/{use-capability-CAL5M8kW.js → use-capability-DNSU4SSH.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-CG1lc4nO.js → use-clock-tick-6wGCr9QA.js} +1 -1
  174. package/dist/client/assets/{use-collections-BYr7pEmZ.js → use-collections-FvPggnCf.js} +1 -1
  175. package/dist/client/assets/{use-connection-D9HsjWxg.js → use-connection-C3KlVqRc.js} +1 -1
  176. package/dist/client/assets/{use-copy-B6e0ArXF.js → use-copy-DvqrWhoO.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-UIYeNsla.js → use-create-virtual-mcp-CTi94rag.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-xepBeP7W.js → use-debounced-autosave-BtHhY3kf.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-BEeKZ9NT.js → use-delete-connection-Ba_GRKCM.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-BmyLNtzY.js → use-file-configs-Pe4NRgWE.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-CJlKxIxa.js → use-infinite-scroll-DL5hyVmQ.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-Dh4DPnmF.js → use-join-requests-D_Gq_19N.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-7EfqWxgd.js → use-mcp-client-CLcTwBS1.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-DIkRTD9t.js → use-mcp-prompts-DC-bHnlV.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-W08KOK_v.js → use-mcp-tools-DHra8uvX.js} +1 -1
  186. package/dist/client/assets/{use-members-DyLgAHg5.js → use-members-DARPXJlK.js} +1 -1
  187. package/dist/client/assets/{use-mobile-CeVjRMu3.js → use-mobile-DFs3QJqY.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-CfSjeQwH.js → use-navigate-to-agent-rF0GaXHe.js} +1 -1
  189. package/dist/client/assets/{use-org-auth-client-CVfi2bFZ.js → use-org-auth-client-C7qnan75.js} +1 -1
  190. package/dist/client/assets/{use-org-sso-3_seOFru.js → use-org-sso-Bo9vUunv.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-BBD5Uy2k.js → use-organization-roles-De8oePVP.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-Bvieu16r.js → use-organization-settings-57SGXats.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-DgPJKdCX.js → use-registry-connections-Ii3j5xH_.js} +1 -1
  194. package/dist/client/assets/{use-secrets-Bpmq5HaY.js → use-secrets-C4ru1qie.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-Dsmk_M7Y.js → use-status-sounds-BP_ijgUo.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-DhQbMx-b.js → use-view-mode-Bl_CH29I.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-CTBnE7sF.js → use-virtual-mcp-DgKfTExI.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-uhUmaTO5.js +1 -0
  199. package/dist/client/assets/{useQueries-DRRNcEOA.js → useQueries-CgTem5R4.js} +1 -1
  200. package/dist/client/assets/useSuspenseInfiniteQuery-DjACAiSm.js +1 -0
  201. package/dist/client/assets/{variant-calendar-D-QL2C_C.js → variant-calendar-CyMRGA_z.js} +1 -1
  202. package/dist/client/assets/{view-mode-toggle-9We3fjVd.js → view-mode-toggle-DNw1iw_b.js} +1 -1
  203. package/dist/client/index.html +1 -1
  204. package/dist/server/cli.js +429 -429
  205. package/package.json +1 -1
  206. package/dist/client/assets/page-seo-sheet-BNm6Mm2L.js +0 -1
  207. package/dist/client/assets/project-app-view-DMQWiDoZ.js +0 -1
  208. package/dist/client/assets/record-editor-GeUn2Cfg.js +0 -1
  209. package/dist/client/assets/registry-BnG2g9Fw.js +0 -2
  210. package/dist/client/assets/store-registry-DZK1gxtR.js +0 -2
  211. package/dist/client/assets/useInfiniteQuery-B8aLEC__.js +0 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-BJo3aYmp.js +0 -1
@@ -1 +1 @@
1
- import{c as y,j as t,B,i as X,o as Ge,s as se,E as Pe,r as T,C as ie,p as Qe,l as V,bf as Ye,u as Xe,F as G,t as Ze,e as ae,b1 as ke}from"./index-CZQAHCWx.js";import{E as Ee}from"./empty-state-DVp61Buk.js";import{u as et,a as Ae}from"./use-collections-BYr7pEmZ.js";import{u as ce}from"./use-mcp-client-7EfqWxgd.js";import{F as ne,a as tt,b as de,d as me}from"./form-B5xe8o6u.js";import{I as ue}from"./input-Bnf6c030.js";import{T as re}from"./textarea-BFNmWFvP.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-CS7neKAN.js";import{ah as rt,x as it,a6 as at,ai as ct,a2 as dt,aj as mt,M as be}from"./agent-icon-B6eCx9D1.js";import{g as ut,M as xt,a as Ne}from"./types-BhFW6kUE.js";import{A as pt,a as ft,b as ht}from"./alert-DG7kpTTq.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-Biv4m02a.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-Dcp4xtTX.js";import{i as jt}from"./AlertCircle-eL7jEjpx.js";import{s as bt}from"./Stars02-B4L_1USv.js";import{a as Nt}from"./Eye-Du8USWUC.js";import{i as vt}from"./Play-Bpofg5MS.js";import{i as St}from"./ChevronRight-C7AnVgNL.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-CthwRpPw.js";import{a as Oe,u as Re}from"./use-connection-D9HsjWxg.js";import{a as It}from"./use-mcp-tools-W08KOK_v.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-BZb9eAa5.js";import{f as Tt,h as Pt}from"./chat-context-DueHVvJY.js";import{b as kt}from"./shell-layout-fqgrNv9Y.js";import{M as Et}from"./monaco-editor-DwYoS9zw.js";import{n as At}from"./XCircle-ZlnM-le2.js";import"./auth-B9FveTwh.js";import"./label-Di7vPCvs.js";import"./index-BtAPhKbE.js";import"./sidebar-B6ogJK6o.js";import"./LayoutLeft-DnqAFiqW.js";import"./use-mobile-CeVjRMu3.js";import"./sheet-CLgUQ0k9.js";import"./X-ClFhIPPx.js";import"./ZoomOut-BkeollDv.js";import"./Key01-CI_-yaVv.js";import"./extract-connection-data-D_bB-ShD.js";import"./use-registry-connections-DgPJKdCX.js";import"./use-organization-settings-Bvieu16r.js";import"./studio-tools-DCyngkzJ.js";import"./Plus-B6Bp27KE.js";import"./index-CuxqDMpm.js";import"./index-BOJe9uwl.js";import"./popover-BLg2uxUj.js";import"./use-virtual-mcp-CTBnE7sF.js";import"./ChevronUp-hzSQl57_.js";import"./SearchMd-DY2IStnr.js";import"./Users03-DTBaxDUb.js";import"./use-create-virtual-mcp-UIYeNsla.js";import"./use-navigate-to-agent-CfSjeQwH.js";import"./Tool01-D9Z3ra2m.js";import"./SwitchHorizontal01-COrtT0WP.js";import"./Settings02-CzDpZT_t.js";import"./ArrowUpRight-BtZv9HXz.js";import"./ZapSquare-Brn6J5mG.js";import"./CheckCircle-Ce4sW5Fr.js";import"./ChevronDown-8-SpQ5a6.js";import"./ChevronLeft-DQ6Y033o.js";import"./DotsVertical-CBCiPEnd.js";import"./Globe01-ByUFNYZ1.js";import"./FilterLines-D51fKry2.js";import"./Star01-COmcJPAd.js";import"./Globe04-BnUIZrLZ.js";import"./HardDrive-OrjxQFg1.js";import"./LinkExternal01-C9plWUCQ.js";import"./Monitor01-Cx6UPY56.js";import"./Sun-BrBndJzL.js";import"./Palette-DxYtHeiN.js";import"./Shield01-ByoQOTwe.js";import"./Stars01-DjTb55Tj.js";import"./Trash01-S_d8yXYH.js";import"./Upload01-BovBQGIq.js";import"./User01-Dcns6QTI.js";import"./Users01-Dua8TttV.js";import"./XClose-Cr1-H9ci.js";import"./Zap-TPho1Yix.js";import"./mcp-oauth-CkPjLCsH.js";import"./badge-BkyT3WoL.js";import"./hooks-DpQFLCh_.js";import"./decopilot-sse-pool-BTlcRVcA.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BMg8Dsli.js";import"./tab-id-BptcWVWa.js";import"./avatar-CMukQvh7.js";import"./dialog-DGm31nBN.js";import"./required-auth-layout-SCPc1ODv.js";import"./use-org-sso-3_seOFru.js";import"./index-CRPVmS_G.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(B,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(B,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const F=JSON.parse(D);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,F])=>{if((F.type==="object"||F.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((F.type==="number"||F.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Fe=()=>{p(null),g(null),I(null),$(null),w(null)},Be=j?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Be})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(B,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Fe,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(B,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(B,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Bt,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(B,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Mn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Mn as default};
1
+ import{c as y,j as t,B,i as X,o as Ge,s as se,E as Pe,r as T,C as ie,p as Qe,l as V,bf as Ye,u as Xe,F as G,t as Ze,e as ae,b1 as ke}from"./index-BUS-a-tW.js";import{E as Ee}from"./empty-state-BAyVSC9K.js";import{u as et,a as Ae}from"./use-collections-FvPggnCf.js";import{u as ce}from"./use-mcp-client-CLcTwBS1.js";import{F as ne,a as tt,b as de,d as me}from"./form-BGbfy77_.js";import{I as ue}from"./input-D8TXMXM-.js";import{T as re}from"./textarea-Du6Le5sO.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-CuICTOkh.js";import{ah as rt,x as it,a6 as at,ai as ct,a2 as dt,aj as mt,M as be}from"./agent-icon-Dh6cDydc.js";import{g as ut,M as xt,a as Ne}from"./types-D8C9oPp4.js";import{A as pt,a as ft,b as ht}from"./alert-BPkaPX8i.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-BumbnE5Z.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-xmkm89yV.js";import{i as jt}from"./AlertCircle-BFW82Glo.js";import{s as bt}from"./Stars02-CjJwnXFf.js";import{a as Nt}from"./Eye-CVnhloDi.js";import{i as vt}from"./Play-BLi-TNw8.js";import{i as St}from"./ChevronRight-CFrkN22M.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-C0eVGhHT.js";import{a as Oe,u as Re}from"./use-connection-C3KlVqRc.js";import{a as It}from"./use-mcp-tools-DHra8uvX.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-D2yZ6MPG.js";import{f as Tt,h as Pt}from"./chat-context-2a9Unx31.js";import{b as kt}from"./shell-layout-C9OrPrc4.js";import{M as Et}from"./monaco-editor-D82OjyDd.js";import{n as At}from"./XCircle-CdCz4npr.js";import"./auth-ylAHlhew.js";import"./label-CFlYbKnz.js";import"./index-waTLikGH.js";import"./sidebar-DaurSYcm.js";import"./LayoutLeft-DeMAAMUQ.js";import"./use-mobile-DFs3QJqY.js";import"./sheet-BbFKIkah.js";import"./X-BAIghubv.js";import"./ZoomOut-Bpyue_Zw.js";import"./Key01-NlklfK2W.js";import"./extract-connection-data-C4TpBkxN.js";import"./use-registry-connections-Ii3j5xH_.js";import"./use-organization-settings-57SGXats.js";import"./studio-tools-BO3QwsEE.js";import"./Plus-DiPCnPyI.js";import"./index-Dg5jx7eC.js";import"./index-n4Vo7V4h.js";import"./popover-D2Q2Eswn.js";import"./use-virtual-mcp-DgKfTExI.js";import"./ChevronUp-5yVty_-J.js";import"./SearchMd-CKZEESAy.js";import"./Users03-fR0V8I72.js";import"./use-create-virtual-mcp-CTi94rag.js";import"./use-navigate-to-agent-rF0GaXHe.js";import"./Tool01-D2a8I_Gf.js";import"./SwitchHorizontal01-Bw76z7hc.js";import"./Settings02-xJ3tiWNi.js";import"./ArrowUpRight-B8NHPBEV.js";import"./ZapSquare-DuHMAFt7.js";import"./CheckCircle-DNGMJpxK.js";import"./ChevronDown-CIJ7-0w6.js";import"./ChevronLeft-DwrsIjn7.js";import"./DotsVertical-B_6X1vi7.js";import"./Globe01-CThKgW6h.js";import"./FilterLines-aCF-EO8Z.js";import"./Star01-BO7uFQpG.js";import"./Globe04-BM8I7PlJ.js";import"./HardDrive-CnFxYfXA.js";import"./LinkExternal01-BQAshidh.js";import"./Monitor01-Dvufl23t.js";import"./Sun-O-ShYNtI.js";import"./Palette-BpmN1_H8.js";import"./Shield01-CJTqMoEC.js";import"./Stars01-BXxzvxO4.js";import"./Trash01-DmRbdJUk.js";import"./Upload01-Ccj_plFg.js";import"./User01-BzP8oKZ3.js";import"./Users01-CdAaoMtW.js";import"./XClose-vwNqWD2m.js";import"./Zap-BJK90vlv.js";import"./mcp-oauth-oXYSrL8I.js";import"./badge-WRzJoL2O.js";import"./hooks-BdAROdrZ.js";import"./decopilot-sse-pool-CjP6zAlU.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-9J9bNHdx.js";import"./tab-id-BptcWVWa.js";import"./avatar-C54BAvwV.js";import"./dialog-lbyUpqPt.js";import"./required-auth-layout-wwcnSe6F.js";import"./use-org-sso-Bo9vUunv.js";import"./index-Cj5OqjXz.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(B,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(B,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const F=JSON.parse(D);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,F])=>{if((F.type==="object"||F.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((F.type==="number"||F.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Fe=()=>{p(null),g(null),I(null),$(null),w(null)},Be=j?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Be})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(B,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Fe,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(B,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(B,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Bt,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(B,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Mn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Mn as default};
@@ -1 +1 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-CZQAHCWx.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-BLOjaXD3.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-COrtT0WP.js";import{i as S}from"./ChevronUp-hzSQl57_.js";import{a as I,b as K,c as P,T as W}from"./tooltip-Dcp4xtTX.js";import{V as q}from"./view-mode-toggle-9We3fjVd.js";import{B as G}from"./badge-BkyT3WoL.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
1
+ import{c as B,j as s,l as M,B as V}from"./index-BUS-a-tW.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-DF3B7I1K.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-Bw76z7hc.js";import{i as S}from"./ChevronUp-5yVty_-J.js";import{a as I,b as K,c as P,T as W}from"./tooltip-xmkm89yV.js";import{V as q}from"./view-mode-toggle-DNw1iw_b.js";import{B as G}from"./badge-WRzJoL2O.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
@@ -1 +1 @@
1
- import{c as v,l as b,j as a,i as w}from"./index-CZQAHCWx.js";import{i as C}from"./SearchMd-DY2IStnr.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
1
+ import{c as v,l as b,j as a,i as w}from"./index-BUS-a-tW.js";import{i as C}from"./SearchMd-CKZEESAy.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
@@ -1 +1 @@
1
- import{c as f,l as u,j as m}from"./index-CZQAHCWx.js";import{B as g}from"./badge-BkyT3WoL.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
1
+ import{c as f,l as u,j as m}from"./index-BUS-a-tW.js";import{B as g}from"./badge-WRzJoL2O.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
@@ -1 +1 @@
1
- import{c as d,l as i,j as n}from"./index-CZQAHCWx.js";import{_ as m}from"./index-BOJe9uwl.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-DGm31nBN.js";import{i as y}from"./SearchMd-DY2IStnr.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{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}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,H as a,z as b,G as c,C as d,R as e,S as f,B as g};
1
+ import{c as d,l as i,j as n}from"./index-BUS-a-tW.js";import{_ as m}from"./index-n4Vo7V4h.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-lbyUpqPt.js";import{i as y}from"./SearchMd-CKZEESAy.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{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}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,H as a,z as b,G as c,C as d,R as e,S as f,B as g};
@@ -1 +1 @@
1
- import{c as E,r as q,l as X,j as t,B as V,m as Xe,d as Le,K as H,o as Ae,s as me,n as De,p as Me,k as ue,i as Je,a as Fe,u as Ct,b as et,q as St,v as tt,Q as vt,E as Nt,w as Qe,L as _t}from"./index-CZQAHCWx.js";import{A as wt}from"./auth-entry-_nOUFp_x.js";import{A as Q}from"./auth-split-layout-DqH6c0k8.js";import{O as We}from"./organization-choice-D-8Jpbxq.js";import{f as It}from"./tab-id-BptcWVWa.js";import{I as Ke}from"./input-Bnf6c030.js";import{u as _e,W as nt,S as st,g as Tt,C as Et}from"./use-mcp-client-7EfqWxgd.js";import{i as it}from"./XCircle-ZlnM-le2.js";import{I as kt}from"./integration-icon-BZb9eAa5.js";import{D as qe,a as Ot,b as Rt,c as Ut,d as $t,e as Pt}from"./dialog-DGm31nBN.js";import{T as zt,a as Lt,b as At}from"./tooltip-Dcp4xtTX.js";import{i as ot}from"./CheckCircle-Ce4sW5Fr.js";import{i as Dt}from"./ZoomOut-BkeollDv.js";import{g as Mt,c as Ft,e as Kt}from"./extract-connection-data-D_bB-ShD.js";import{F as fe,a as Ve,b as pe,c as ge,d as he,e as xe}from"./form-B5xe8o6u.js";import{i as qt}from"./ChevronUp-hzSQl57_.js";import{s as Vt,a as Bt}from"./Eye-Du8USWUC.js";import{i as Gt}from"./Settings02-CzDpZT_t.js";import{S as rt,a as lt,b as at,c as ct,d as dt}from"./select-Biv4m02a.js";import{u as Ht}from"./useQueries-DRRNcEOA.js";import{a as Qt}from"./authenticate-and-persist-oauth-DiMpH9Hf.js";import{i as ut}from"./ArrowUpRight-BtZv9HXz.js";import{s as mt}from"./User01-Dcns6QTI.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-CMukQvh7.js";import"./auth-B9FveTwh.js";import"./agent-icon-B6eCx9D1.js";import"./AlertCircle-eL7jEjpx.js";import"./Tool01-D9Z3ra2m.js";import"./SwitchHorizontal01-COrtT0WP.js";import"./ZapSquare-Brn6J5mG.js";import"./Users03-DTBaxDUb.js";import"./ChevronDown-8-SpQ5a6.js";import"./ChevronLeft-DQ6Y033o.js";import"./ChevronRight-C7AnVgNL.js";import"./DotsVertical-CBCiPEnd.js";import"./Stars02-B4L_1USv.js";import"./Globe01-ByUFNYZ1.js";import"./FilterLines-D51fKry2.js";import"./Star01-COmcJPAd.js";import"./Globe04-BnUIZrLZ.js";import"./HardDrive-OrjxQFg1.js";import"./Key01-CI_-yaVv.js";import"./LayoutLeft-DnqAFiqW.js";import"./LinkExternal01-C9plWUCQ.js";import"./Monitor01-Cx6UPY56.js";import"./Sun-BrBndJzL.js";import"./Palette-DxYtHeiN.js";import"./Play-Bpofg5MS.js";import"./Plus-B6Bp27KE.js";import"./SearchMd-DY2IStnr.js";import"./Shield01-ByoQOTwe.js";import"./Stars01-DjTb55Tj.js";import"./Trash01-S_d8yXYH.js";import"./Upload01-BovBQGIq.js";import"./Users01-Dua8TttV.js";import"./XClose-Cr1-H9ci.js";import"./X-ClFhIPPx.js";import"./Zap-TPho1Yix.js";import"./label-Di7vPCvs.js";import"./mcp-oauth-CkPjLCsH.js";const Wt=/^[a-zA-Z][a-zA-Z\d+.-]*:/,Yt=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,Zt=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,Xt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Ue(s){const e=s.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const n=Wt.test(e),i=Yt.test(e),o=Zt.test(e);if(n&&!i&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=i?e:`https://${e}`;let r;try{r=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=r.hostname.split(".");return a.length<2||a.some(l=>!l||!Xt.test(l))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function $e(s){const e=E.c(14),{children:n,className:i,wrapperClassName:o}=s,[c,r]=q.useState(!0);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=j=>{if(!j)return;const y=()=>{const m=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(m)};y(),j.addEventListener("scroll",y,{passive:!0});const h=new ResizeObserver(y);h.observe(j);for(const m of Array.from(j.children))h.observe(m);return()=>{j.removeEventListener("scroll",y),h.disconnect()}},e[0]=a):a=e[0];const l=a;let d;e[1]!==o?(d=X("relative",o),e[1]=o,e[2]=d):d=e[2];let f;e[3]!==n||e[4]!==i?(f=t.jsx("div",{ref:l,className:i,children:n}),e[3]=n,e[4]=i,e[5]=f):f=e[5];const p=c?"opacity-0":"opacity-100";let u;e[6]!==p?(u=X("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",p),e[6]=p,e[7]=u):u=e[7];let x;e[8]!==u?(x=t.jsx("div",{"aria-hidden":!0,className:u}),e[8]=u,e[9]=x):x=e[9];let g;return e[10]!==d||e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:d,children:[f,x]}),e[10]=d,e[11]=f,e[12]=x,e[13]=g):g=e[13],g}function Jt(s){const e=s.properties;if(!e)return[];const n=[];for(const[i,o]of Object.entries(e)){const a=o?.properties?.__type?.const;typeof a=="string"&&a.length>0&&n.push({fieldKey:i,bindingType:a})}return n}function en(s,e){const n=[];if(s.length&&n.push({field:["id"],operator:"in",value:s}),e.length&&n.push({field:["name"],operator:"in",value:e}),n.length!==0)return n.length===1?n[0]:{operator:"or",conditions:n}}function Z(s){const e=s;if(e.isError)throw new Error(e.content?.find(n=>n.text)?.text??"Tool call failed");return e.structuredContent??s}function tn(s,e,n,i){return{...s??{},[e]:{__type:n,value:i}}}function Pe(s){return s==null?!1:typeof s=="string"?s.trim().length>0:typeof s=="number"||typeof s=="boolean"?!0:Array.isArray(s)?s.some(Pe):typeof s=="object"?Object.entries(s).some(([e,n])=>!e.startsWith("__")&&Pe(n)):!1}function nn(s){return s.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase())}function sn(s){return Pe(s)?typeof s=="string"?s.trim():typeof s=="number"||typeof s=="boolean"?String(s):JSON.stringify(s):null}function on(s){return s?Object.entries(s).flatMap(([e,n])=>{if(e.startsWith("__"))return[];const i=sn(n);return i?[{key:e,label:nn(e),value:i}]:[]}):[]}function rn(s,e,n){const i=s.filter(o=>o.app_name===e||!!n&&o.app_id===n);return i.length===0?null:(i.sort((o,c)=>{const r=a=>a.status==="active"?0:1;return r(o)!==r(c)?r(o)-r(c):(c.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function ln(s){return s.server?.icons?.[0]?.src??Mt(s.server?.repository)??null}function an(s,e){const n=s._meta?.["mcp.mesh"];return n?.friendlyName||n?.friendly_name||s.title||s.server?.title||s.server?.name||e}function cn(s){const e=[],n=new Map(s.connections.map(i=>[i.id,i]));for(const i of s.requirements){const o=s.curated[i.bindingType],c=o?s.itemsById[o.registryAppId]:s.itemsByName[i.bindingType];if(!c)continue;const r=s.configurationState?.[i.fieldKey]?.value,a=r?n.get(r):void 0,l=r&&a?r:null,d=l?s.connectionReadiness?.[l]!==!1:!1,f=!!l&&d;e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:c,title:an(c,i.bindingType),icon:ln(c),headline:o?.headline??c._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:f,candidateConnectionId:f?null:l||rn(s.connections,i.bindingType,o?.registryAppId),linkedConnectionId:l,configurationState:a?.configuration_state??null})}return e}function dn(s,e){if(!s)return null;const n=o=>{if(o.startsWith("sc-domain:"))return o.substring(10);try{let r=new URL(o.startsWith("http")?o:`https://${o}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return o}},i=n(s);for(const o of e)if(n(o.siteUrl)===i)return o.siteUrl;return null}function un(s){return(s?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:o.displayName}))}))}function Ye(s){const e=E.c(38);let n,i,o,c,r;e[0]!==s?({value:r,onChange:i,placeholder:o,className:n,...c}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=o,e[4]=c,e[5]=r):(n=e[1],i=e[2],o=e[3],c=e[4],r=e[5]);const[a,l]=q.useState(!1),[d,f]=q.useState(!1);let p;e[6]!==r?(p=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch(K){console.error("Failed to copy text: ",K)}},e[6]=r,e[7]=p):p=e[7];const u=p;let x;e[8]!==a?(x=()=>{l(!a)},e[8]=a,e[9]=x):x=e[9];const g=x,j=a?"text":"password";let y;e[10]!==n?(y=X("pr-20",n),e[10]=n,e[11]=y):y=e[11];let h;e[12]!==i||e[13]!==o||e[14]!==c||e[15]!==j||e[16]!==y||e[17]!==r?(h=t.jsx(Ke,{type:j,value:r,onChange:i,placeholder:o,className:y,...c}),e[12]=i,e[13]=o,e[14]=c,e[15]=j,e[16]=y,e[17]=r,e[18]=h):h=e[18];const m=a?"Hide password":"Show password";let b;e[19]!==a?(b=a?t.jsx(Gt,{size:16}):t.jsx(Vt,{size:16}),e[19]=a,e[20]=b):b=e[20];let C;e[21]!==m||e[22]!==b||e[23]!==g?(C=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:g,title:m,children:b}),e[21]=m,e[22]=b,e[23]=g,e[24]=C):C=e[24];const v=!r,N=d?"Copied!":"Copy token";let _;e[25]!==d?(_=d?t.jsx(qt,{size:16}):t.jsx(Bt,{size:16}),e[25]=d,e[26]=_):_=e[26];let k;e[27]!==u||e[28]!==N||e[29]!==_||e[30]!==v?(k=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u,disabled:v,title:N,children:_}),e[27]=u,e[28]=N,e[29]=_,e[30]=v,e[31]=k):k=e[31];let O;e[32]!==k||e[33]!==C?(O=t.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[C,k]}),e[32]=k,e[33]=C,e[34]=O):O=e[34];let T;return e[35]!==O||e[36]!==h?(T=t.jsxs("div",{className:"relative",children:[h,O]}),e[35]=O,e[36]=h,e[37]=T):T=e[37],T}function Be(s){const e=E.c(19),{card:n,selfClient:i,org:o,onDone:c,onError:r}=s,a=Xe();let l;e[0]!==n||e[1]!==i?(l=async y=>{const h={...n.configurationState??{},...y};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n.linkedConnectionId||n.candidateConnectionId,data:{configuration_state:h}}})},e[0]=n,e[1]=i,e[2]=l):l=e[2];let d;e[3]!==c||e[4]!==o||e[5]!==a?(d=async()=>{await a.invalidateQueries({queryKey:H.commerceDiscoveryCompanionConnections(o.id)}),c()},e[3]=c,e[4]=o,e[5]=a,e[6]=d):d=e[6];let f;e[7]!==r?(f=y=>{r?.(y)},e[7]=r,e[8]=f):f=e[8];let p;e[9]!==l||e[10]!==d||e[11]!==f?(p={mutationFn:l,onSuccess:d,onError:f},e[9]=l,e[10]=d,e[11]=f,e[12]=p):p=e[12];const u=Le(p);let x;e[13]!==u?(x=y=>u.mutate(y),e[13]=u,e[14]=x):x=e[14];const g=x;let j;return e[15]!==u.error||e[16]!==u.isPending||e[17]!==g?(j={save:g,isPending:u.isPending,error:u.error},e[15]=u.error,e[16]=u.isPending,e[17]=g,e[18]=j):j=e[18],j}const mn=Ae({accountName:me().min(1,"Account name is required"),appKey:me().optional(),appToken:me().optional()});function fn(s){const e=E.c(63),{card:n,selfClient:i,org:o,onDone:c,onIsPendingChange:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=De(mn),e[0]=a):a=e[0];const l=n.configurationState?.accountName||"",d=n.configurationState?.appKey||"",f=n.configurationState?.appToken||"";let p;e[1]!==l||e[2]!==d||e[3]!==f?(p={resolver:a,defaultValues:{accountName:l,appKey:d,appToken:f}},e[1]=l,e[2]=d,e[3]=f,e[4]=p):p=e[4];const u=Me(p);let x;e[5]!==n.configurationState?.accountName||e[6]!==n.configurationState?.appKey||e[7]!==n.configurationState?.appToken||e[8]!==u?(x=()=>{u.reset({accountName:n.configurationState?.accountName||"",appKey:n.configurationState?.appKey||"",appToken:n.configurationState?.appToken||""})},e[5]=n.configurationState?.accountName,e[6]=n.configurationState?.appKey,e[7]=n.configurationState?.appToken,e[8]=u,e[9]=x):x=e[9];let g;e[10]!==n.configurationState||e[11]!==u?(g=[n.configurationState,u],e[10]=n.configurationState,e[11]=u,e[12]=g):g=e[12],q.useEffect(x,g);let j;e[13]!==n||e[14]!==c||e[15]!==o||e[16]!==i?(j={card:n,selfClient:i,org:o,onDone:c},e[13]=n,e[14]=c,e[15]=o,e[16]=i,e[17]=j):j=e[17];const{save:y,isPending:h,error:m}=Be(j);let b,C;e[18]!==h||e[19]!==r?(C=()=>{r?.(h)},b=[h,r],e[18]=h,e[19]=r,e[20]=b,e[21]=C):(b=e[20],C=e[21]),q.useEffect(C,b);let v;if(e[22]!==u||e[23]!==y){let z;e[25]!==y?(z=async S=>{y(S)},e[25]=y,e[26]=z):z=e[26],v=u.handleSubmit(z),e[22]=u,e[23]=y,e[24]=v}else v=e[24];const N=v;let _;e[27]!==h?(_=z=>{const{field:S}=z;return t.jsxs(pe,{children:[t.jsx(ge,{children:"Account Name"}),t.jsx(he,{children:t.jsx(Ke,{placeholder:"Your VTEX account name",...S,disabled:h})}),t.jsx(xe,{})]})},e[27]=h,e[28]=_):_=e[28];let k;e[29]!==u.control||e[30]!==_?(k=t.jsx(fe,{control:u.control,name:"accountName",render:_}),e[29]=u.control,e[30]=_,e[31]=k):k=e[31];let O;e[32]!==h?(O=z=>{const{field:S}=z;return t.jsxs(pe,{children:[t.jsx(ge,{children:"App Key (optional)"}),t.jsx(he,{children:t.jsx(Ye,{placeholder:"VTEX app key",...S,disabled:h})}),t.jsx(xe,{})]})},e[32]=h,e[33]=O):O=e[33];let T;e[34]!==u.control||e[35]!==O?(T=t.jsx(fe,{control:u.control,name:"appKey",render:O}),e[34]=u.control,e[35]=O,e[36]=T):T=e[36];let K;e[37]!==h?(K=z=>{const{field:S}=z;return t.jsxs(pe,{children:[t.jsx(ge,{children:"App Token (optional)"}),t.jsx(he,{children:t.jsx(Ye,{placeholder:"VTEX app token",...S,disabled:h})}),t.jsx(xe,{})]})},e[37]=h,e[38]=K):K=e[38];let U;e[39]!==u.control||e[40]!==K?(U=t.jsx(fe,{control:u.control,name:"appToken",render:K}),e[39]=u.control,e[40]=K,e[41]=U):U=e[41];let w;e[42]!==u||e[43]!==k||e[44]!==T||e[45]!==U?(w=t.jsxs(Ve,{...u,children:[k,T,U]}),e[42]=u,e[43]=k,e[44]=T,e[45]=U,e[46]=w):w=e[46];let $;e[47]!==m?($=m&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m instanceof Error?m.message:"Failed to save configuration"}),e[47]=m,e[48]=$):$=e[48];let P;e[49]!==h||e[50]!==c?(P=t.jsx(V,{type:"button",variant:"outline",onClick:c,disabled:h,children:"Cancel"}),e[49]=h,e[50]=c,e[51]=P):P=e[51];const F=h?"Saving...":"Save";let D;e[52]!==h||e[53]!==F?(D=t.jsx(V,{type:"submit",disabled:h,children:F}),e[52]=h,e[53]=F,e[54]=D):D=e[54];let A;e[55]!==P||e[56]!==D?(A=t.jsxs(qe,{className:"pt-4",children:[P,D]}),e[55]=P,e[56]=D,e[57]=A):A=e[57];let R;return e[58]!==N||e[59]!==w||e[60]!==$||e[61]!==A?(R=t.jsxs("form",{onSubmit:N,className:"space-y-4",children:[w,$,A]}),e[58]=N,e[59]=w,e[60]=$,e[61]=A,e[62]=R):R=e[62],R}const pn=Ae({propertyId:me().min(1,"Property is required")});function gn(s){const e=E.c(55),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,onDone:a,onIsPendingChange:l}=s;let d;e[0]!==i||e[1]!==r.id?(d=H.commerceDiscoveryCompanionGaProperties(r.id,i),e[0]=i,e[1]=r.id,e[2]=d):d=e[2];let f;e[3]!==o?(f=async()=>{const S=await o.callTool({name:"get-account-summaries",arguments:{}}),L=Z(S);return un(L)},e[3]=o,e[4]=f):f=e[4];let p;e[5]!==d||e[6]!==f?(p={queryKey:d,queryFn:f},e[5]=d,e[6]=f,e[7]=p):p=e[7];const u=ue(p);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=De(pn),e[8]=x):x=e[8];const g=n.configurationState?.propertyId||"";let j;e[9]!==g?(j={resolver:x,defaultValues:{propertyId:g}},e[9]=g,e[10]=j):j=e[10];const y=Me(j);let h;e[11]!==n||e[12]!==a||e[13]!==r||e[14]!==c?(h={card:n,selfClient:c,org:r,onDone:a},e[11]=n,e[12]=a,e[13]=r,e[14]=c,e[15]=h):h=e[15];const{save:m,isPending:b,error:C}=Be(h);let v,N;e[16]!==b||e[17]!==l?(v=()=>{l?.(b)},N=[b,l],e[16]=b,e[17]=l,e[18]=v,e[19]=N):(v=e[18],N=e[19]),q.useEffect(v,N);let _;if(e[20]!==y||e[21]!==m){let S;e[23]!==m?(S=async L=>{m(L)},e[23]=m,e[24]=S):S=e[24],_=y.handleSubmit(S),e[20]=y,e[21]=m,e[22]=_}else _=e[22];const k=_;if(u.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading properties..."})}),e[25]=S):S=e[25],S}if(u.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Analytics properties."})}),e[26]=S):S=e[26],S}let O;e[27]!==u.data?(O=u.data||[],e[27]=u.data,e[28]=O):O=e[28];const T=O;if(T.flatMap(yn).length===0){let S;return e[29]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No Google Analytics properties found. Please connect a Google Analytics account with properties."})}),e[29]=S):S=e[29],S}let U;e[30]!==b||e[31]!==T?(U=S=>{const{field:L}=S;return t.jsxs(pe,{children:[t.jsx(ge,{children:"Google Analytics Property"}),t.jsx(he,{children:t.jsxs(rt,{value:L.value,onValueChange:L.onChange,disabled:b,children:[t.jsx(lt,{children:t.jsx(at,{placeholder:"Select a property"})}),t.jsx(ct,{children:T.map(hn)})]})}),t.jsx(xe,{})]})},e[30]=b,e[31]=T,e[32]=U):U=e[32];let w;e[33]!==y.control||e[34]!==U?(w=t.jsx(fe,{control:y.control,name:"propertyId",render:U}),e[33]=y.control,e[34]=U,e[35]=w):w=e[35];let $;e[36]!==y||e[37]!==w?($=t.jsx(Ve,{...y,children:w}),e[36]=y,e[37]=w,e[38]=$):$=e[38];let P;e[39]!==C?(P=C&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C instanceof Error?C.message:"Failed to save configuration"}),e[39]=C,e[40]=P):P=e[40];let F;e[41]!==b||e[42]!==a?(F=t.jsx(V,{type:"button",variant:"outline",onClick:a,disabled:b,children:"Cancel"}),e[41]=b,e[42]=a,e[43]=F):F=e[43];const D=b?"Saving...":"Save";let A;e[44]!==b||e[45]!==D?(A=t.jsx(V,{type:"submit",disabled:b,children:D}),e[44]=b,e[45]=D,e[46]=A):A=e[46];let R;e[47]!==F||e[48]!==A?(R=t.jsxs(qe,{className:"pt-4",children:[F,A]}),e[47]=F,e[48]=A,e[49]=R):R=e[49];let z;return e[50]!==k||e[51]!==$||e[52]!==P||e[53]!==R?(z=t.jsxs("form",{onSubmit:k,className:"space-y-4",children:[$,P,R]}),e[50]=k,e[51]=$,e[52]=P,e[53]=R,e[54]=z):z=e[54],z}function hn(s){return t.jsx("div",{children:s.options.map(xn)},s.account)}function xn(s){return t.jsx(dt,{value:s.value,children:s.label},s.value)}function yn(s){return s.options}const jn=Ae({siteUrl:me().min(1,"Site is required")});function bn(s){const e=E.c(59),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,contextSiteUrl:a,onDone:l,onIsPendingChange:d}=s;let f;e[0]!==i||e[1]!==r.id?(f=H.commerceDiscoveryCompanionGscSites(r.id,i),e[0]=i,e[1]=r.id,e[2]=f):f=e[2];let p;e[3]!==o?(p=async()=>{const S=await o.callTool({name:"list_sites",arguments:{}});return Z(S).sites||[]},e[3]=o,e[4]=p):p=e[4];let u;e[5]!==f||e[6]!==p?(u={queryKey:f,queryFn:p},e[5]=f,e[6]=p,e[7]=u):u=e[7];const x=ue(u);let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=De(jn),e[8]=g):g=e[8];const j=n.configurationState?.siteUrl||"";let y;e[9]!==j?(y={resolver:g,defaultValues:{siteUrl:j}},e[9]=j,e[10]=y):y=e[10];const h=Me(y);let m;e[11]!==n||e[12]!==l||e[13]!==r||e[14]!==c?(m={card:n,selfClient:c,org:r,onDone:l},e[11]=n,e[12]=l,e[13]=r,e[14]=c,e[15]=m):m=e[15];const{save:b,isPending:C,error:v}=Be(m);let N,_;e[16]!==C||e[17]!==d?(N=()=>{d?.(C)},_=[C,d],e[16]=C,e[17]=d,e[18]=N,e[19]=_):(N=e[18],_=e[19]),q.useEffect(N,_);let k;if(e[20]!==h||e[21]!==b){let S;e[23]!==b?(S=async L=>{b(L)},e[23]=b,e[24]=S):S=e[24],k=h.handleSubmit(S),e[20]=h,e[21]=b,e[22]=k}else k=e[22];const O=k;if(x.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading sites..."})}),e[25]=S):S=e[25],S}if(x.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Search Console sites."})}),e[26]=S):S=e[26],S}let T,K;if(e[27]!==n.configurationState?.siteUrl||e[28]!==a||e[29]!==h||e[30]!==x.data){K=Symbol.for("react.early_return_sentinel");e:{if(T=x.data||[],T.length===0){let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No verified sites found. Please verify a site in Google Search Console."})}),e[33]=L):L=e[33],K=L;break e}const S=n.configurationState?.siteUrl;if(S&&h.getValues("siteUrl")!==S)h.setValue("siteUrl",S);else if(!S&&!h.getValues("siteUrl")){const L=dn(a,T);L&&h.setValue("siteUrl",L)}}e[27]=n.configurationState?.siteUrl,e[28]=a,e[29]=h,e[30]=x.data,e[31]=T,e[32]=K}else T=e[31],K=e[32];if(K!==Symbol.for("react.early_return_sentinel"))return K;let U;e[34]!==C||e[35]!==T?(U=S=>{const{field:L}=S;return t.jsxs(pe,{children:[t.jsx(ge,{children:"Verified Site"}),t.jsx(he,{children:t.jsxs(rt,{value:L.value,onValueChange:L.onChange,disabled:C,children:[t.jsx(lt,{children:t.jsx(at,{placeholder:"Select a site"})}),t.jsx(ct,{children:T.map(Cn)})]})}),t.jsx(xe,{})]})},e[34]=C,e[35]=T,e[36]=U):U=e[36];let w;e[37]!==h.control||e[38]!==U?(w=t.jsx(fe,{control:h.control,name:"siteUrl",render:U}),e[37]=h.control,e[38]=U,e[39]=w):w=e[39];let $;e[40]!==h||e[41]!==w?($=t.jsx(Ve,{...h,children:w}),e[40]=h,e[41]=w,e[42]=$):$=e[42];let P;e[43]!==v?(P=v&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v instanceof Error?v.message:"Failed to save configuration"}),e[43]=v,e[44]=P):P=e[44];let F;e[45]!==C||e[46]!==l?(F=t.jsx(V,{type:"button",variant:"outline",onClick:l,disabled:C,children:"Cancel"}),e[45]=C,e[46]=l,e[47]=F):F=e[47];const D=C?"Saving...":"Save";let A;e[48]!==C||e[49]!==D?(A=t.jsx(V,{type:"submit",disabled:C,children:D}),e[48]=C,e[49]=D,e[50]=A):A=e[50];let R;e[51]!==F||e[52]!==A?(R=t.jsxs(qe,{className:"pt-4",children:[F,A]}),e[51]=F,e[52]=A,e[53]=R):R=e[53];let z;return e[54]!==O||e[55]!==$||e[56]!==P||e[57]!==R?(z=t.jsxs("form",{onSubmit:O,className:"space-y-4",children:[$,P,R]}),e[54]=O,e[55]=$,e[56]=P,e[57]=R,e[58]=z):z=e[58],z}function Cn(s){return t.jsx(dt,{value:s.siteUrl,children:s.siteUrl},s.siteUrl)}const Sn={vtex:fn,"google-analytics":gn,"google-search-console":bn};function vn(){const s=E.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),t.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),s[1]=n):n=s[1];let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[n,t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),s[2]=i):i=s[2],i}function ze(s){const e=E.c(3),{children:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ot,{size:14,className:"shrink-0 text-blue-500"}),e[0]=i):i=e[0];let o;return e[1]!==n?(o=t.jsxs("div",{className:"flex items-center gap-2 p-1",children:[i,t.jsx("p",{className:"text-sm text-foreground",children:n})]}),e[1]=n,e[2]=o):o=e[2],o}function Nn(s){const e=E.c(43),{card:n,connecting:i,disabled:o,onConnect:c,org:r,selfClient:a,siteUrl:l}=s,d=n.linkedConnectionId;let f;e[0]!==n.configurationState?(f=on(n.configurationState),e[0]=n.configurationState,e[1]=f):f=e[1];const p=f;let u;e[2]!==n.icon||e[3]!==n.title?(u=t.jsx(kt,{icon:n.icon,name:n.title,size:"sm",fit:"contain",className:"p-1.5"}),e[2]=n.icon,e[3]=n.title,e[4]=u):u=e[4];let x;e[5]!==n.title?(x=t.jsx("p",{className:"flex-1 text-sm text-foreground",children:n.title}),e[5]=n.title,e[6]=x):x=e[6];let g;e[7]!==n.satisfied||e[8]!==n.title||e[9]!==i||e[10]!==o||e[11]!==c?(g=n.satisfied?t.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[t.jsx(ot,{size:16})," Connected"]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",disabled:o||i,onClick:c,"aria-label":`Connect ${n.title}`,children:i?t.jsx(Je,{size:16,className:"animate-spin"}):"Connect"}),e[7]=n.satisfied,e[8]=n.title,e[9]=i,e[10]=o,e[11]=c,e[12]=g):g=e[12];let j;e[13]!==u||e[14]!==x||e[15]!==g?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[u,x,g]}),e[13]=u,e[14]=x,e[15]=g,e[16]=j):j=e[16];let y;e[17]!==n.checks?(y=n.checks!==null&&t.jsxs(ze,{children:["+ ",n.checks," checks"]}),e[17]=n.checks,e[18]=y):y=e[18];let h;e[19]!==n.headline?(h=n.headline&&t.jsx(ze,{children:n.headline}),e[19]=n.headline,e[20]=h):h=e[20];let m;e[21]!==n.bullets?(m=n.bullets.map(_n),e[21]=n.bullets,e[22]=m):m=e[22];let b;e[23]!==n.candidateConnectionId||e[24]!==n.satisfied||e[25]!==n.title?(b=!n.satisfied&&n.candidateConnectionId&&t.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",n.title]}),e[23]=n.candidateConnectionId,e[24]=n.satisfied,e[25]=n.title,e[26]=b):b=e[26];let C;e[27]!==y||e[28]!==h||e[29]!==m||e[30]!==b?(C=t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[y,h,m,b]}),e[27]=y,e[28]=h,e[29]=m,e[30]=b,e[31]=C):C=e[31];let v;e[32]!==n||e[33]!==d||e[34]!==r||e[35]!==p||e[36]!==a||e[37]!==l?(v=n.satisfied&&d&&t.jsx(Tn,{card:n,org:r,selfClient:a,connectionId:d,savedConfigEntries:p,contextSiteUrl:l}),e[32]=n,e[33]=d,e[34]=r,e[35]=p,e[36]=a,e[37]=l,e[38]=v):v=e[38];let N;return e[39]!==C||e[40]!==v||e[41]!==j?(N=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[j,C,v]}),e[39]=C,e[40]=v,e[41]=j,e[42]=N):N=e[42],N}function _n(s){return t.jsx(ze,{children:s},s)}function wn(s,e){return/(token|secret|password|appKey|key)$/i.test(s)?"••••••••":e}function In(s){const e=E.c(2),{title:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configuration isn't available here yet for ",n,"."]})}),e[0]=n,e[1]=i):i=e[1],i}function Tn(s){const e=E.c(36),{card:n,org:i,selfClient:o,connectionId:c,savedConfigEntries:r,contextSiteUrl:a}=s;let l;e[0]!==c||e[1]!==i.id||e[2]!==i.slug?(l={connectionId:c,orgId:i.id,orgSlug:i.slug},e[0]=c,e[1]=i.id,e[2]=i.slug,e[3]=l):l=e[3];const d=_e(l),[f,p]=q.useState(!1),[u,x]=q.useState(!1),g=Sn[n.bindingType];let j;e[4]!==u?(j=T=>{!T&&u||p(T)},e[4]=u,e[5]=j):j=e[5];const y=j;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuration"}),e[6]=h):h=e[6];let m;e[7]!==r.length?(m=r.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No configuration values saved yet."}),e[7]=r.length,e[8]=m):m=e[8];let b;e[9]!==m?(b=t.jsxs("div",{className:"grid gap-1",children:[h,m]}),e[9]=m,e[10]=b):b=e[10];let C;e[11]!==g||e[12]!==n.title||e[13]!==r.length?(C=r.length>0?t.jsxs(zt,{children:[t.jsx(Lt,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>p(!0),"aria-label":`Edit ${n.title} configuration`,disabled:!g,children:t.jsx(Dt,{size:14})})}),t.jsx(At,{children:"Edit configuration"})]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!0),disabled:!g,children:"Configure"}),e[11]=g,e[12]=n.title,e[13]=r.length,e[14]=C):C=e[14];let v;e[15]!==b||e[16]!==C?(v=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[b,C]}),e[15]=b,e[16]=C,e[17]=v):v=e[17];let N;e[18]!==r?(N=r.length>0&&t.jsx("dl",{className:"grid gap-2",children:r.map(En)}),e[18]=r,e[19]=N):N=e[19];let _;e[20]!==v||e[21]!==N?(_=t.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[v,N]}),e[20]=v,e[21]=N,e[22]=_):_=e[22];let k;e[23]!==g||e[24]!==n||e[25]!==d||e[26]!==c||e[27]!==a||e[28]!==f||e[29]!==y||e[30]!==i||e[31]!==o?(k=g?t.jsx(Ot,{open:f,onOpenChange:y,children:t.jsxs(Rt,{className:"sm:max-w-lg",children:[t.jsxs(Ut,{children:[t.jsxs($t,{children:["Configure ",n.title]}),t.jsx(Pt,{children:"Update the values this companion uses for Commerce Discovery."})]}),t.jsx(g,{card:n,connectionId:c,companionClient:d,selfClient:o,org:i,contextSiteUrl:a,onDone:()=>p(!1),onIsPendingChange:x})]})}):t.jsx(In,{title:n.title}),e[23]=g,e[24]=n,e[25]=d,e[26]=c,e[27]=a,e[28]=f,e[29]=y,e[30]=i,e[31]=o,e[32]=k):k=e[32];let O;return e[33]!==k||e[34]!==_?(O=t.jsxs(t.Fragment,{children:[_,k]}),e[33]=k,e[34]=_,e[35]=O):O=e[35],O}function En(s){return t.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[t.jsx("dt",{className:"text-muted-foreground",children:s.label}),t.jsx("dd",{className:"truncate text-foreground",children:wn(s.key,s.value)})]},s.key)}const Ge={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Out-of-stock, thin PDPs & attribute gaps across every SKU"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Where revenue leaks between product view and checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Search visibility & indexing gaps across your catalog"}};function kn(s){const e=E.c(39),{selfClient:n,org:i,cdConnectionId:o}=s;let c;e[0]!==o||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:o,orgId:i.id,orgSlug:i.slug},e[0]=o,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const r=_e(c);let a;e[4]!==o||e[5]!==i.id?(a=H.commerceDiscoveryCompanionSchema(i.id,o),e[4]=o,e[5]=i.id,e[6]=a):a=e[6];let l;e[7]!==r?(l=async()=>{const I=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return Z(I)},e[7]=r,e[8]=l):l=e[8];let d;e[9]!==a||e[10]!==l?(d={queryKey:a,queryFn:l},e[9]=a,e[10]=l,e[11]=d):d=e[11];const f=ue(d),p=Jt(f.data?.stateSchema??{properties:{}}),u=p.map(An),x=p.map(Ln).filter(zn),g=p.filter(Pn).map($n),j=[...x,...g].sort().join(",");let y;e[12]!==o||e[13]!==i.id?(y=H.commerceDiscoveryConnection(i.id,o),e[12]=o,e[13]=i.id,e[14]=y):y=e[14];let h;e[15]!==o||e[16]!==n?(h=async()=>{const I=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return Z(I)},e[15]=o,e[16]=n,e[17]=h):h=e[17];let m;e[18]!==y||e[19]!==h?(m={queryKey:y,queryFn:h},e[18]=y,e[19]=h,e[20]=m):m=e[20];const b=ue(m),C=b.data?.item?.configuration_state??null;let v;e[21]!==C?(v=I=>C?.[I.fieldKey]?.value,e[21]=C,e[22]=v):v=e[22];const N=p.map(v).filter(Un),_=ue({queryKey:H.commerceDiscoveryCompanionConnections(i.id),enabled:p.length>0,queryFn:async()=>{const I=[{field:["app_name"],operator:"in",value:u},{field:["app_id"],operator:"in",value:x}];N.length>0&&I.push({field:["id"],operator:"in",value:N});const B=await n.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:I},limit:1e3}});return Z(B)}}),k=_.data?.items??[],O=new Set(N),T=k.filter(I=>O.has(I.id)),K=T.filter(Rn);let U;e[23]!==i.id||e[24]!==i.slug?(U=I=>({queryKey:H.commerceDiscoveryCompanionOAuthStatus(i.id,I.id),queryFn:async()=>{const B=await fetch(`/api/${encodeURIComponent(i.slug)}/connections/${encodeURIComponent(I.id)}/oauth-token/status`,{credentials:"include"});return B.ok?{hasToken:(await B.json()).hasToken===!0}:{hasToken:!1}},retry:!1}),e[23]=i.id,e[24]=i.slug,e[25]=U):U=e[25];const w=Ht({queries:K.map(U)});let $;e[26]!==w?($=(I,B)=>[I.id,w[B]?.data?.hasToken===!0],e[26]=w,e[27]=$):$=e[27];const P=new Map(K.map($)),F={};for(const I of T)F[I.id]=!I.oauth_config||!!I.connection_token||P.get(I.id)===!0;const D=ue({queryKey:H.commerceDiscoveryCompanionRegistry(i.id,j),enabled:p.length>0,queryFn:async()=>{const I=en(x,g),B=await Ft(nt.REGISTRY(i.id),i.id,i.slug,"COLLECTION_REGISTRY_APP_LIST",{...I?{where:I}:{},limit:1e3});return Z(B)}}),A={},R={};for(const I of D.data?.items??[])A[I.id]=I,I.server?.name&&(R[I.server.name]=I);const z=cn({requirements:p,itemsById:A,itemsByName:R,connections:k,connectionReadiness:F,configurationState:C,curated:Ge});let S;e[28]!==b||e[29]!==_||e[30]!==w||e[31]!==D||e[32]!==p||e[33]!==f.isPending?(S=f.isPending||b.isPending||p.length>0&&(_.isPending||D.isPending||w.some(On)),e[28]=b,e[29]=_,e[30]=w,e[31]=D,e[32]=p,e[33]=f.isPending,e[34]=S):S=e[34];const L=S,ee=f.error??b.error??_.error??D.error??null;let Y;return e[35]!==z||e[36]!==ee||e[37]!==L?(Y={cards:z,isLoading:L,error:ee},e[35]=z,e[36]=ee,e[37]=L,e[38]=Y):Y=e[38],Y}function On(s){return s.isPending}function Rn(s){return s.oauth_config&&!s.connection_token}function Un(s){return typeof s=="string"&&s.length>0}function $n(s){return s.bindingType}function Pn(s){return!Ge[s.bindingType]}function zn(s){return!!s}function Ln(s){return Ge[s.bindingType]?.registryAppId}function An(s){return s.bindingType}function Dn({selfClient:s,org:e,userId:n,cdConnectionId:i}){const o=Xe(),[c,r]=q.useState(null),[a,l]=q.useState(null),d=async(p,u)=>{const x=await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:p,data:u}});return Z(x)};async function f(p){r(p.fieldKey),l(null);try{let u=p.candidateConnectionId;if(!u){const m=Kt(p.registryItem,e.id,n,{remoteIndex:0}),b=m.connection_type==="STDIO",C=!!m.connection_url,v=b&&m.connection_headers&&typeof m.connection_headers=="object"&&"command"in m.connection_headers;if(!C&&!v){l(`${p.title} cannot be connected: no connection method available`);return}const N=await s.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:m}});u=Z(N).item.id}const x=u,g=await Qt({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>d(x,{connection_token:m}).then(()=>{})});if(!g.ok){l(`Couldn't sign in to ${p.title}: ${g.error}`);return}const j=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}}),y=Z(j).item?.configuration_state??null,h=tn(y,p.fieldKey,p.bindingType,x);await d(i,{configuration_state:h}),await o.invalidateQueries({queryKey:H.commerceDiscoveryConnection(e.id,i)}),await o.invalidateQueries({queryKey:H.commerceDiscoveryCompanionConnections(e.id)})}catch(u){l(u instanceof Error?u.message:String(u))}finally{r(null)}}return{connect:f,connectingFieldKey:c,error:a}}const Mn="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function Fn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),t.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),s[0]=e):e=s[0],e}function Kn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid gap-4",children:[0,1,2].map(qn)}),s[0]=e):e=s[0],e}function qn(s){return t.jsx(vn,{},s)}function Vn(s){const e=E.c(24),{org:n,cdConnectionId:i,siteUrl:o}=s,{data:c}=Fe.useSession(),r=c?.user?.id??"";let a;e[0]!==n.id||e[1]!==n.slug?(a={connectionId:st,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=a):a=e[2];const l=_e(a);let d;e[3]!==i||e[4]!==n||e[5]!==l?(d={selfClient:l,org:n,cdConnectionId:i},e[3]=i,e[4]=n,e[5]=l,e[6]=d):d=e[6];const{cards:f,isLoading:p,error:u}=kn(d);let x;e[7]!==i||e[8]!==n||e[9]!==l||e[10]!==r?(x={selfClient:l,org:n,userId:r,cdConnectionId:i},e[7]=i,e[8]=n,e[9]=l,e[10]=r,e[11]=x):x=e[11];const{connect:g,connectingFieldKey:j,error:y}=Dn(x);if(!p&&!u&&f.length===0)return null;const h=j!==null;let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Fn,{}),e[12]=m):m=e[12];let b;return e[13]!==h||e[14]!==f||e[15]!==g||e[16]!==y||e[17]!==j||e[18]!==u||e[19]!==p||e[20]!==n||e[21]!==l||e[22]!==o?(b=t.jsxs("div",{className:Mn,children:[m,u?t.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[t.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):p?t.jsx(Kn,{}):t.jsx($e,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[45vh] md:flex-none",children:t.jsxs("div",{className:"grid gap-4",children:[y&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y}),f.map(C=>t.jsx(Nn,{card:C,connecting:j===C.fieldKey,disabled:h&&j!==C.fieldKey,org:n,selfClient:l,siteUrl:o,onConnect:()=>{g(C)}},C.fieldKey))]})})]}),e[13]=h,e[14]=f,e[15]=g,e[16]=y,e[17]=j,e[18]=u,e[19]=p,e[20]=n,e[21]=l,e[22]=o,e[23]=b):b=e[23],b}const He="https://decocms-tanstack.deco-cx.workers.dev/agendar",Bn="Rather have us walk you through it?",Gn="Book a 20-minute call and we'll run the diagnostic with you, live.";function ft({siteUrl:s,email:e}){const n=new URL(He);return s&&n.searchParams.set("siteUrl",s),e&&n.searchParams.set("email",e),n.toString()}function Hn(s){const e=E.c(9),{href:n,size:i,className:o}=s,c=n===void 0?He:n,r=i===void 0?"lg":i;let a;e[0]!==o?(a=X("w-full",o),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ut,{size:16}),e[2]=l):l=e[2];let d;e[3]!==c?(d=t.jsxs("a",{href:c,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",l]}),e[3]=c,e[4]=d):d=e[4];let f;return e[5]!==r||e[6]!==a||e[7]!==d?(f=t.jsx(V,{asChild:!0,variant:"outline",size:r,className:a,children:d}),e[5]=r,e[6]=a,e[7]=d,e[8]=f):f=e[8],f}function Ze(s){const e=E.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:n}),e[0]=n,e[1]=i):i=e[1],i}function Qn(){const s=E.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ze,{children:t.jsx(mt,{size:20,className:"text-muted-foreground"})}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:t.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),s[1]=n):n=s[1];let i;s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),s[2]=i):i=s[2];let o;return s[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,n,t.jsxs("div",{className:"relative",children:[i,t.jsxs(Ze,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),s[3]=o):o=s[3],o}function pt(s){const e=E.c(4),{href:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qn,{}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"grid gap-2",children:[t.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:Bn}),t.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:Gn})]}),e[1]=o):o=e[1];let c;return e[2]!==n?(c=t.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:t.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[i,o,t.jsx(Hn,{href:n,size:"xl"})]})}),e[2]=n,e[3]=c):c=e[3],c}function Wn(s){const e=E.c(8),{className:n,href:i}=s,o=i===void 0?He:i;let c;e[0]!==n?(c=X("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",n),e[0]=n,e[1]=c):c=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(mt,{size:20})}),e[2]=r):r=e[2];let a,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[t.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),t.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),l=t.jsx(ut,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=a,e[4]=l):(a=e[3],l=e[4]);let d;return e[5]!==o||e[6]!==c?(d=t.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:c,children:[r,a,l]}),e[5]=o,e[6]=c,e[7]=d):d=e[7],d}function gt(s){const e=E.c(10),{host:n}=s,i=`https://www.google.com/s2/favicons?domain=${n}&sz=128`;let o,c,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),c=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=t.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=c,e[2]=r):(o=e[0],c=e[1],r=e[2]);let a;e[3]!==i?(a=t.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:t.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=a):a=e[4];let l;e[5]!==n?(l=t.jsx("span",{className:"text-lg font-medium text-foreground",children:n}),e[5]=n,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==l?(d=t.jsxs("div",{className:"flex items-center gap-3",children:[o,c,r,a,l]}),e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function ht(s){const e=E.c(16),{label:n,iconSize:i,className:o,iconClassName:c,labelClassName:r}=s,a=i===void 0?14:i;let l;e[0]!==o?(l=X("inline-flex items-center gap-2",o),e[0]=o,e[1]=l):l=e[1];let d;e[2]!==c?(d=X("shrink-0 animate-spin",c),e[2]=c,e[3]=d):d=e[3];let f;e[4]!==a||e[5]!==d?(f=t.jsx(Je,{size:a,className:d}),e[4]=a,e[5]=d,e[6]=f):f=e[6];let p;e[7]!==r?(p=X("text-sm",r),e[7]=r,e[8]=p):p=e[8];let u;e[9]!==n||e[10]!==p?(u=t.jsx("span",{className:p,children:n}),e[9]=n,e[10]=p,e[11]=u):u=e[11];let x;return e[12]!==l||e[13]!==f||e[14]!==u?(x=t.jsxs("span",{className:l,children:[f,u]}),e[12]=l,e[13]=f,e[14]=u,e[15]=x):x=e[15],x}const Yn={route:"Preparing commerce onboarding...",workspace:"Preparing your commerce workspace...",connect:"Connecting workspace...",setup:"Setting up Commerce Discovery...",button:"Setting up"};function xt(s){return Yn[s]}function yt(s){const e=E.c(2),{variant:n}=s;let i;return e[0]!==n?(i=t.jsx(Q,{children:t.jsx(we,{variant:n})}),e[0]=n,e[1]=i):i=e[1],i}function we(s){const e=E.c(4),{variant:n}=s;let i;e[0]!==n?(i=xt(n),e[0]=n,e[1]=i):i=e[1];let o;return e[2]!==i?(o=t.jsx("div",{className:"py-4",role:"status","aria-live":"polite",children:t.jsx(ht,{label:i,className:"text-muted-foreground"})}),e[2]=i,e[3]=o):o=e[3],o}function Zn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ht,{label:xt("button")}),s[0]=e):e=s[0],e}function xi(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Jn,{}),s[0]=e):e=s[0],e}const jt=q.createContext(null),bt=()=>q.useContext(jt);function Xn(s){if(!s)return null;const e=Ue(s);return e.ok?new URL(e.value).hostname:null}function Jn(){const s=E.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},s[0]=e):e=s[0];const n=Ct(e),{org:i,siteUrl:o}=n;let c;s[1]!==o?(c=Xn(o),s[1]=o,s[2]=c):c=s[2];const r=c;let a;s[3]!==i||s[4]!==o?(a=t.jsx(es,{requestedOrgSlug:i,siteUrl:o}),s[3]=i,s[4]=o,s[5]=a):a=s[5];let l;return s[6]!==r||s[7]!==a?(l=t.jsx(jt.Provider,{value:r,children:a}),s[6]=r,s[7]=a,s[8]=l):l=s[8],l}function es(s){const e=E.c(8),{requestedOrgSlug:n,siteUrl:i}=s,{data:o,isPending:c}=Fe.useSession(),r=bt();if(c){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(yt,{variant:"route"}),e[0]=l):l=e[0],l}if(!o){const l=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==r?(d=r?t.jsx(gt,{host:r}):void 0,e[1]=r,e[2]=d):d=e[2];let f;return e[3]!==d?(f=t.jsx(Q,{children:t.jsx(wt,{callbackUrl:l,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:d})}),e[3]=d,e[4]=f):f=e[4],f}let a;return e[5]!==n||e[6]!==i?(a=t.jsx(ts,{requestedOrgSlug:n,siteUrl:i}),e[5]=n,e[6]=i,e[7]=a):a=e[7],a}function ts(s){const e=E.c(40),{requestedOrgSlug:n,siteUrl:i}=s,o=et(),c=St(),[r,a]=q.useState(null),[l,d]=q.useState(null),f=c.data?.map(ss)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:ns,retry:!1,onSuccess:m=>{d(m)}},e[0]=p):p=e[0];const u=Le(p);if(c.isPending){let m;return e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(yt,{variant:"route"}),e[1]=m):m=e[1],m}if(c.error){let m;return e[2]!==c?(m=t.jsx(ve,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[2]=c,e[3]=m):m=e[3],m}const x=n?f.find(m=>m.slug===n):null;if(x){let m;return e[4]!==x||e[5]!==i?(m=t.jsx(Se,{org:x,initialSiteUrl:i}),e[4]=x,e[5]=i,e[6]=m):m=e[6],m}if(n){let m;return e[7]!==c?(m=t.jsx(ve,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[7]=c,e[8]=m):m=e[8],m}if(r){let m;return e[9]!==r||e[10]!==i?(m=t.jsx(Se,{org:r,initialSiteUrl:i}),e[9]=r,e[10]=i,e[11]=m):m=e[11],m}if(f.length===1&&f[0]){let m;return e[12]!==f[0]||e[13]!==i?(m=t.jsx(Se,{org:f[0],initialSiteUrl:i}),e[12]=f[0],e[13]=i,e[14]=m):m=e[14],m}if(f.length>1){let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(J,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=m):m=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=v=>a(v),e[16]=b):b=e[16];let C;return e[17]!==f?(C=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx($e,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(We,{organizations:f,selectLabel:"Continue",onSelected:b})})]})}),e[17]=f,e[18]=C):C=e[18],C}if(!l){let m;e[19]!==u?(m=()=>{u.reset(),u.mutate()},e[19]=u,e[20]=m):m=e[20];let b;return e[21]!==u||e[22]!==m?(b=t.jsx(is,{mutation:u,onRetry:m}),e[21]=u,e[22]=m,e[23]=b):b=e[23],b}const g=l;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let m;return e[24]!==g.organization||e[25]!==i?(m=t.jsx(Se,{org:g.organization,initialSiteUrl:i}),e[24]=g.organization,e[25]=i,e[26]=m):m=e[26],m}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let m;e[27]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(J,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=m):m=e[27];const b=g.domain??void 0;let C;e[28]!==o||e[29]!==i?(C=(N,_)=>{tt(),a({...N,slug:_}),o({to:"/commerce-onboarding",search:{org:_,siteUrl:i}})},e[28]=o,e[29]=i,e[30]=C):C=e[30];let v;return e[31]!==g.organizations||e[32]!==b||e[33]!==C?(v=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx($e,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(We,{organizations:g.organizations,domain:b,onJoined:C})})]})}),e[31]=g.organizations,e[32]=b,e[33]=C,e[34]=v):v=e[34],v}const j=g?.error??"We could not determine a commerce organization for this account.";let y;e[35]!==u?(y=()=>{d(null),u.reset()},e[35]=u,e[36]=y):y=e[36];let h;return e[37]!==j||e[38]!==y?(h=t.jsx(ve,{title:"Commerce onboarding needs support",description:j,actionLabel:"Try again",onRetry:y}),e[37]=j,e[38]=y,e[39]=h):h=e[39],h}async function ns(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&tt(),e}function ss(s){return{id:s.id,name:s.name,slug:s.slug,logo:s.logo??null}}function is(s){const e=E.c(7),{mutation:n,onRetry:i}=s,o=q.useRef(!1);let c;e[0]!==n?(c=d=>{!d||o.current||(o.current=!0,n.mutate())},e[0]=n,e[1]=c):c=e[1];const r=c;if(n.error){let d;return e[2]!==i?(d=t.jsx(ve,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:i}),e[2]=i,e[3]=d):d=e[3],d}let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{variant:"workspace"}),e[4]=a):a=e[4];let l;return e[5]!==r?(l=t.jsx(Q,{children:t.jsx("div",{ref:r,children:a})}),e[5]=r,e[6]=l):l=e[6],l}function J(s){const e=E.c(8),{title:n,description:i}=s,o=bt();let c;e[0]!==o?(c=o?t.jsx(gt,{host:o}):t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=c):c=e[1];let r;e[2]!==i||e[3]!==n?(r=(n||i)&&t.jsxs("div",{className:"space-y-2",children:[n&&t.jsx("h1",{className:"text-2xl font-medium leading-8",children:n}),i&&t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==c||e[6]!==r?(a=t.jsxs("div",{className:"grid gap-10",children:[c,r]}),e[5]=c,e[6]=r,e[7]=a):a=e[7],a}function ve(s){const e=E.c(9),{title:n,description:i,actionLabel:o,onRetry:c}=s;let r;e[0]!==i||e[1]!==n?(r=t.jsx(J,{title:n,description:i}),e[0]=i,e[1]=n,e[2]=r):r=e[2];let a;e[3]!==o||e[4]!==c?(a=t.jsx(V,{type:"button",size:"xl",className:"w-full",onClick:c,children:o}),e[3]=o,e[4]=c,e[5]=a):a=e[5];let l;return e[6]!==r||e[7]!==a?(l=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[r,a]})}),e[6]=r,e[7]=a,e[8]=l):l=e[8],l}function os(s){return s.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function Oe(s){const e=s;if(e.isError)throw new Error(os(e));return e.structuredContent??s}function Se(s){const e=E.c(10),{org:n,initialSiteUrl:i}=s,{data:o}=Fe.useSession(),c=o?.user?.email;let r;e[0]!==i||e[1]!==c?(r=ft({siteUrl:i,email:c}),e[0]=i,e[1]=c,e[2]=r):r=e[2];const a=r;let l;e[3]!==a?(l=t.jsx(pt,{href:a}),e[3]=a,e[4]=l):l=e[4];const d=l;let f;return e[5]!==i||e[6]!==d||e[7]!==n||e[8]!==o?.user?.email?(f=t.jsx(vt,{children:p=>{const{reset:u}=p;return t.jsx(Nt,{fallback:x=>{const{error:g,resetError:j}=x;return t.jsx(Q,{visual:d,children:t.jsx(rs,{orgName:n.name,message:g instanceof Error?g.message:"We could not check Commerce Discovery setup.",onRetry:()=>{u(),j()}})})},children:t.jsx(q.Suspense,{fallback:t.jsx(Q,{visual:d,children:t.jsx(we,{variant:"connect"})}),children:t.jsx(ls,{org:n,initialSiteUrl:i,sessionEmail:o?.user?.email},`${n.id}:${i??""}`)})})}}),e[5]=i,e[6]=d,e[7]=n,e[8]=o?.user?.email,e[9]=f):f=e[9],f}function rs(s){const e=E.c(10),{orgName:n,message:i,onRetry:o}=s,c=`Commerce setup will continue for ${n}.`;let r;e[0]!==c?(r=t.jsx(J,{title:"Commerce diagnostics",description:c}),e[0]=c,e[1]=r):r=e[1];let a;e[2]!==i?(a=t.jsx(Ne,{message:i}),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==o?(l=t.jsx(V,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=l):l=e[5];let d;return e[6]!==r||e[7]!==a||e[8]!==l?(d=t.jsxs("div",{className:"grid gap-10",children:[r,a,l]}),e[6]=r,e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function ls(s){const e=E.c(100),{org:n,initialSiteUrl:i,sessionEmail:o}=s,c=et();let r;e[0]!==n.id||e[1]!==n.slug?(r={connectionId:st,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=r):r=e[2];const a=_e(r),[l,d]=q.useState(i??""),[f,p]=q.useState(null),[u,x]=q.useState(null),g=q.useRef(!1),j=nt.COMMERCE_DISCOVERY(n.id),y=Tt(n.id),h=H.commerceDiscoveryConnection(n.id,j);let m;e[3]!==j||e[4]!==a?(m=async()=>{const M=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:j}});return Oe(M)},e[3]=j,e[4]=a,e[5]=m):m=e[5];let b;e[6]!==h||e[7]!==m?(b={queryKey:h,queryFn:m,retry:!1},e[6]=h,e[7]=m,e[8]=b):b=e[8];const C=Qe(b),v=H.commerceDiscoveryVirtualMcp(n.id,y);let N;e[9]!==a||e[10]!==y?(N=async()=>{const M=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:y}});return Oe(M)},e[9]=a,e[10]=y,e[11]=N):N=e[11];let _;e[12]!==v||e[13]!==N?(_={queryKey:v,queryFn:N,retry:!1},e[12]=v,e[13]=N,e[14]=_):_=e[14];const k=Qe(_);let O;e[15]!==a?(O=async M=>{const W=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:M}});return Oe(W)},e[15]=a,e[16]=O):O=e[16];let T;e[17]!==C||e[18]!==k?(T=M=>{p(M),x(null),C.refetch(),k.refetch()},e[17]=C,e[18]=k,e[19]=T):T=e[19];let K;e[20]===Symbol.for("react.memo_cache_sentinel")?(K=M=>{x(M instanceof Error?M.message:"Commerce Discovery setup failed.")},e[20]=K):K=e[20];let U;e[21]!==O||e[22]!==T?(U={mutationFn:O,retry:!1,onSuccess:T,onError:K},e[21]=O,e[22]=T,e[23]=U):U=e[23];const w=Le(U),$=!!C.data.item&&!!k.data.item,P=i??l;let F;e[24]!==P||e[25]!==o?(F=ft({siteUrl:P,email:o}),e[24]=P,e[25]=o,e[26]=F):F=e[26];const D=F;let A;e[27]!==D?(A=t.jsx(pt,{href:D}),e[27]=D,e[28]=A):A=e[28];const R=A;let z;e[29]!==w?(z=M=>{const W=Ue(M);if(!W.ok){x(W.error);return}x(null),w.mutate(W.value)},e[29]=w,e[30]=z):z=e[30];const S=z;let L;e[31]!==i||e[32]!==S||e[33]!==$?(L=M=>{!M||g.current||$||!i||(g.current=!0,S(i))},e[31]=i,e[32]=S,e[33]=$,e[34]=L):L=e[34];const ee=L;let Y;e[35]!==S||e[36]!==l?(Y=M=>{M.preventDefault(),S(l)},e[35]=S,e[36]=l,e[37]=Y):Y=e[37];const I=Y;let B;e[38]!==j||e[39]!==f?.reportApp||e[40]!==y?(B=f?.reportApp??{connectionId:j,virtualMcpId:y,toolName:Et},e[38]=j,e[39]=f?.reportApp,e[40]=y,e[41]=B):B=e[41];const G=B;let ye;e[42]!==c||e[43]!==n.slug||e[44]!==G.connectionId||e[45]!==G.toolName||e[46]!==G.virtualMcpId?(ye=()=>{localStorage.setItem(_t.sidebarOpen(),JSON.stringify(!1)),c({to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:G.virtualMcpId,main:It(G.connectionId,G.toolName),chat:0}})},e[42]=c,e[43]=n.slug,e[44]=G.connectionId,e[45]=G.toolName,e[46]=G.virtualMcpId,e[47]=ye):ye=e[47];const Ie=ye;if($){let M;return e[48]!==D||e[49]!==R||e[50]!==P||e[51]!==Ie||e[52]!==n||e[53]!==G?(M=t.jsx(as,{org:n,reportApp:G,onOpenReport:Ie,meetingUrl:D,meetingVisual:R,siteUrl:P}),e[48]=D,e[49]=R,e[50]=P,e[51]=Ie,e[52]=n,e[53]=G,e[54]=M):M=e[54],M}if(i){let M;e[55]!==i?(M=Ue(i),e[55]=i,e[56]=M):M=e[56];const W=M;if(!W.ok){const ke=`Commerce setup will continue for ${n.name}.`;let le;e[57]!==ke?(le=t.jsx(J,{title:"Commerce diagnostics",description:ke}),e[57]=ke,e[58]=le):le=e[58];let ae;e[59]!==W.error?(ae=t.jsx(Ne,{message:W.error}),e[59]=W.error,e[60]=ae):ae=e[60];let ce;e[61]!==I||e[62]!==u||e[63]!==w.isPending||e[64]!==l?(ce=t.jsx(Re,{siteUrl:l,error:u,isSubmitting:w.isPending,onSiteUrlChange:d,onSubmit:I}),e[61]=I,e[62]=u,e[63]=w.isPending,e[64]=l,e[65]=ce):ce=e[65];let de;e[66]!==le||e[67]!==ae||e[68]!==ce?(de=t.jsxs("div",{className:"grid gap-10",children:[le,ae,ce]}),e[66]=le,e[67]=ae,e[68]=ce,e[69]=de):de=e[69];let Ce;return e[70]!==R||e[71]!==de?(Ce=t.jsx(Q,{visual:R,children:de}),e[70]=R,e[71]=de,e[72]=Ce):Ce=e[72],Ce}const Ee=`Commerce Discovery is being prepared for ${W.value}.`;let ie;e[73]!==Ee?(ie=t.jsx(J,{title:"Commerce diagnostics",description:Ee}),e[73]=Ee,e[74]=ie):ie=e[74];let oe;e[75]!==I||e[76]!==u||e[77]!==w||e[78]!==l?(oe=u?t.jsxs(t.Fragment,{children:[t.jsx(Ne,{message:u}),t.jsx(Re,{siteUrl:l,error:null,isSubmitting:w.isPending,onSiteUrlChange:d,onSubmit:I})]}):t.jsx(we,{variant:"setup"}),e[75]=I,e[76]=u,e[77]=w,e[78]=l,e[79]=oe):oe=e[79];let re;e[80]!==ie||e[81]!==oe||e[82]!==ee?(re=t.jsxs("div",{ref:ee,className:"grid gap-10",children:[ie,oe]}),e[80]=ie,e[81]=oe,e[82]=ee,e[83]=re):re=e[83];let be;return e[84]!==R||e[85]!==re?(be=t.jsx(Q,{visual:R,children:re}),e[84]=R,e[85]=re,e[86]=be):be=e[86],be}const Te=`Commerce setup will continue for ${n.name}.`;let te;e[87]!==Te?(te=t.jsx(J,{title:"Commerce diagnostics",description:Te}),e[87]=Te,e[88]=te):te=e[88];let ne;e[89]!==I||e[90]!==u||e[91]!==w.isPending||e[92]!==l?(ne=t.jsx(Re,{siteUrl:l,error:u,isSubmitting:w.isPending,onSiteUrlChange:d,onSubmit:I}),e[89]=I,e[90]=u,e[91]=w.isPending,e[92]=l,e[93]=ne):ne=e[93];let se;e[94]!==te||e[95]!==ne?(se=t.jsxs("div",{className:"grid gap-10",children:[te,ne]}),e[94]=te,e[95]=ne,e[96]=se):se=e[96];let je;return e[97]!==R||e[98]!==se?(je=t.jsx(Q,{visual:R,children:se}),e[97]=R,e[98]=se,e[99]=je):je=e[99],je}function Re(s){const e=E.c(22),{siteUrl:n,error:i,isSubmitting:o,onSiteUrlChange:c,onSubmit:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=a):a=e[0];let l;e[1]!==c?(l=y=>c(y.target.value),e[1]=c,e[2]=l):l=e[2];const d=!!i;let f;e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==d?(f=t.jsx(Ke,{id:"commerce-site-url",type:"text",inputMode:"url",value:n,onChange:l,placeholder:"https://example.com","aria-invalid":d,disabled:o}),e[3]=o,e[4]=n,e[5]=l,e[6]=d,e[7]=f):f=e[7];let p;e[8]!==i?(p=i?t.jsx(Ne,{message:i}):null,e[8]=i,e[9]=p):p=e[9];let u;e[10]!==f||e[11]!==p?(u=t.jsxs("div",{className:"grid gap-2",children:[a,f,p]}),e[10]=f,e[11]=p,e[12]=u):u=e[12];let x;e[13]!==o?(x=o?t.jsx(Zn,{}):t.jsxs(t.Fragment,{children:["Continue",t.jsx(it,{size:16})]}),e[13]=o,e[14]=x):x=e[14];let g;e[15]!==o||e[16]!==x?(g=t.jsx(V,{type:"submit",size:"xl",className:"w-full",disabled:o,children:x}),e[15]=o,e[16]=x,e[17]=g):g=e[17];let j;return e[18]!==r||e[19]!==u||e[20]!==g?(j=t.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[u,g]}),e[18]=r,e[19]=u,e[20]=g,e[21]=j):j=e[21],j}function as(s){const e=E.c(20),{org:n,reportApp:i,onOpenReport:o,meetingUrl:c,meetingVisual:r,siteUrl:a}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(J,{}),e[0]=l):l=e[0];let d;e[1]!==n||e[2]!==i.connectionId||e[3]!==a?(d=t.jsx(Vn,{org:n,cdConnectionId:i.connectionId,siteUrl:a}),e[1]=n,e[2]=i.connectionId,e[3]=a,e[4]=d):d=e[4];let f;e[5]!==c?(f=t.jsx(Wn,{className:"md:hidden",href:c}),e[5]=c,e[6]=f):f=e[6];const p=!i.virtualMcpId;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(it,{size:18}),e[7]=u):u=e[7];let x;e[8]!==o||e[9]!==p?(x=t.jsxs(V,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:p,children:["See full report",u]}),e[8]=o,e[9]=p,e[10]=x):x=e[10];let g;e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[f,x]}),e[11]=f,e[12]=x,e[13]=g):g=e[13];let j;e[14]!==d||e[15]!==g?(j=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[l,d,g]}),e[14]=d,e[15]=g,e[16]=j):j=e[16];let y;return e[17]!==r||e[18]!==j?(y=t.jsx(Q,{align:"fill",visual:r,children:j}),e[17]=r,e[18]=j,e[19]=y):y=e[19],y}function Ne(s){const e=E.c(2),{message:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:n}),e[0]=n,e[1]=i):i=e[1],i}export{xi as default};
1
+ import{c as E,r as q,l as X,j as t,B as V,m as Xe,d as Le,K as H,o as Ae,s as me,n as De,p as Me,k as ue,i as Je,a as Fe,u as Ct,b as et,q as St,v as tt,Q as vt,E as Nt,w as Qe,L as _t}from"./index-BUS-a-tW.js";import{A as wt}from"./auth-entry-v4IJxk9p.js";import{A as Q}from"./auth-split-layout-D6VmaiAh.js";import{O as We}from"./organization-choice-CHjmYj3j.js";import{f as It}from"./tab-id-BptcWVWa.js";import{I as Ke}from"./input-D8TXMXM-.js";import{u as _e,W as nt,S as st,g as Tt,C as Et}from"./use-mcp-client-CLcTwBS1.js";import{i as it}from"./XCircle-CdCz4npr.js";import{I as kt}from"./integration-icon-D2yZ6MPG.js";import{D as qe,a as Ot,b as Rt,c as Ut,d as $t,e as Pt}from"./dialog-lbyUpqPt.js";import{T as zt,a as Lt,b as At}from"./tooltip-xmkm89yV.js";import{i as ot}from"./CheckCircle-DNGMJpxK.js";import{i as Dt}from"./ZoomOut-Bpyue_Zw.js";import{g as Mt,c as Ft,e as Kt}from"./extract-connection-data-C4TpBkxN.js";import{F as fe,a as Ve,b as pe,c as ge,d as he,e as xe}from"./form-BGbfy77_.js";import{i as qt}from"./ChevronUp-5yVty_-J.js";import{s as Vt,a as Bt}from"./Eye-CVnhloDi.js";import{i as Gt}from"./Settings02-xJ3tiWNi.js";import{S as rt,a as lt,b as at,c as ct,d as dt}from"./select-BumbnE5Z.js";import{u as Ht}from"./useQueries-CgTem5R4.js";import{a as Qt}from"./authenticate-and-persist-oauth-v9BhfxwO.js";import{i as ut}from"./ArrowUpRight-B8NHPBEV.js";import{s as mt}from"./User01-BzP8oKZ3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-C54BAvwV.js";import"./auth-ylAHlhew.js";import"./agent-icon-Dh6cDydc.js";import"./AlertCircle-BFW82Glo.js";import"./Tool01-D2a8I_Gf.js";import"./SwitchHorizontal01-Bw76z7hc.js";import"./ZapSquare-DuHMAFt7.js";import"./Users03-fR0V8I72.js";import"./ChevronDown-CIJ7-0w6.js";import"./ChevronLeft-DwrsIjn7.js";import"./ChevronRight-CFrkN22M.js";import"./DotsVertical-B_6X1vi7.js";import"./Stars02-CjJwnXFf.js";import"./Globe01-CThKgW6h.js";import"./FilterLines-aCF-EO8Z.js";import"./Star01-BO7uFQpG.js";import"./Globe04-BM8I7PlJ.js";import"./HardDrive-CnFxYfXA.js";import"./Key01-NlklfK2W.js";import"./LayoutLeft-DeMAAMUQ.js";import"./LinkExternal01-BQAshidh.js";import"./Monitor01-Dvufl23t.js";import"./Sun-O-ShYNtI.js";import"./Palette-BpmN1_H8.js";import"./Play-BLi-TNw8.js";import"./Plus-DiPCnPyI.js";import"./SearchMd-CKZEESAy.js";import"./Shield01-CJTqMoEC.js";import"./Stars01-BXxzvxO4.js";import"./Trash01-DmRbdJUk.js";import"./Upload01-Ccj_plFg.js";import"./Users01-CdAaoMtW.js";import"./XClose-vwNqWD2m.js";import"./X-BAIghubv.js";import"./Zap-BJK90vlv.js";import"./label-CFlYbKnz.js";import"./mcp-oauth-oXYSrL8I.js";const Wt=/^[a-zA-Z][a-zA-Z\d+.-]*:/,Yt=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,Zt=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,Xt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Ue(s){const e=s.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const n=Wt.test(e),i=Yt.test(e),o=Zt.test(e);if(n&&!i&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=i?e:`https://${e}`;let r;try{r=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=r.hostname.split(".");return a.length<2||a.some(l=>!l||!Xt.test(l))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function $e(s){const e=E.c(14),{children:n,className:i,wrapperClassName:o}=s,[c,r]=q.useState(!0);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=j=>{if(!j)return;const y=()=>{const m=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(m)};y(),j.addEventListener("scroll",y,{passive:!0});const h=new ResizeObserver(y);h.observe(j);for(const m of Array.from(j.children))h.observe(m);return()=>{j.removeEventListener("scroll",y),h.disconnect()}},e[0]=a):a=e[0];const l=a;let d;e[1]!==o?(d=X("relative",o),e[1]=o,e[2]=d):d=e[2];let f;e[3]!==n||e[4]!==i?(f=t.jsx("div",{ref:l,className:i,children:n}),e[3]=n,e[4]=i,e[5]=f):f=e[5];const p=c?"opacity-0":"opacity-100";let u;e[6]!==p?(u=X("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",p),e[6]=p,e[7]=u):u=e[7];let x;e[8]!==u?(x=t.jsx("div",{"aria-hidden":!0,className:u}),e[8]=u,e[9]=x):x=e[9];let g;return e[10]!==d||e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:d,children:[f,x]}),e[10]=d,e[11]=f,e[12]=x,e[13]=g):g=e[13],g}function Jt(s){const e=s.properties;if(!e)return[];const n=[];for(const[i,o]of Object.entries(e)){const a=o?.properties?.__type?.const;typeof a=="string"&&a.length>0&&n.push({fieldKey:i,bindingType:a})}return n}function en(s,e){const n=[];if(s.length&&n.push({field:["id"],operator:"in",value:s}),e.length&&n.push({field:["name"],operator:"in",value:e}),n.length!==0)return n.length===1?n[0]:{operator:"or",conditions:n}}function Z(s){const e=s;if(e.isError)throw new Error(e.content?.find(n=>n.text)?.text??"Tool call failed");return e.structuredContent??s}function tn(s,e,n,i){return{...s??{},[e]:{__type:n,value:i}}}function Pe(s){return s==null?!1:typeof s=="string"?s.trim().length>0:typeof s=="number"||typeof s=="boolean"?!0:Array.isArray(s)?s.some(Pe):typeof s=="object"?Object.entries(s).some(([e,n])=>!e.startsWith("__")&&Pe(n)):!1}function nn(s){return s.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase())}function sn(s){return Pe(s)?typeof s=="string"?s.trim():typeof s=="number"||typeof s=="boolean"?String(s):JSON.stringify(s):null}function on(s){return s?Object.entries(s).flatMap(([e,n])=>{if(e.startsWith("__"))return[];const i=sn(n);return i?[{key:e,label:nn(e),value:i}]:[]}):[]}function rn(s,e,n){const i=s.filter(o=>o.app_name===e||!!n&&o.app_id===n);return i.length===0?null:(i.sort((o,c)=>{const r=a=>a.status==="active"?0:1;return r(o)!==r(c)?r(o)-r(c):(c.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function ln(s){return s.server?.icons?.[0]?.src??Mt(s.server?.repository)??null}function an(s,e){const n=s._meta?.["mcp.mesh"];return n?.friendlyName||n?.friendly_name||s.title||s.server?.title||s.server?.name||e}function cn(s){const e=[],n=new Map(s.connections.map(i=>[i.id,i]));for(const i of s.requirements){const o=s.curated[i.bindingType],c=o?s.itemsById[o.registryAppId]:s.itemsByName[i.bindingType];if(!c)continue;const r=s.configurationState?.[i.fieldKey]?.value,a=r?n.get(r):void 0,l=r&&a?r:null,d=l?s.connectionReadiness?.[l]!==!1:!1,f=!!l&&d;e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:c,title:an(c,i.bindingType),icon:ln(c),headline:o?.headline??c._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:f,candidateConnectionId:f?null:l||rn(s.connections,i.bindingType,o?.registryAppId),linkedConnectionId:l,configurationState:a?.configuration_state??null})}return e}function dn(s,e){if(!s)return null;const n=o=>{if(o.startsWith("sc-domain:"))return o.substring(10);try{let r=new URL(o.startsWith("http")?o:`https://${o}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return o}},i=n(s);for(const o of e)if(n(o.siteUrl)===i)return o.siteUrl;return null}function un(s){return(s?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:o.displayName}))}))}function Ye(s){const e=E.c(38);let n,i,o,c,r;e[0]!==s?({value:r,onChange:i,placeholder:o,className:n,...c}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=o,e[4]=c,e[5]=r):(n=e[1],i=e[2],o=e[3],c=e[4],r=e[5]);const[a,l]=q.useState(!1),[d,f]=q.useState(!1);let p;e[6]!==r?(p=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch(K){console.error("Failed to copy text: ",K)}},e[6]=r,e[7]=p):p=e[7];const u=p;let x;e[8]!==a?(x=()=>{l(!a)},e[8]=a,e[9]=x):x=e[9];const g=x,j=a?"text":"password";let y;e[10]!==n?(y=X("pr-20",n),e[10]=n,e[11]=y):y=e[11];let h;e[12]!==i||e[13]!==o||e[14]!==c||e[15]!==j||e[16]!==y||e[17]!==r?(h=t.jsx(Ke,{type:j,value:r,onChange:i,placeholder:o,className:y,...c}),e[12]=i,e[13]=o,e[14]=c,e[15]=j,e[16]=y,e[17]=r,e[18]=h):h=e[18];const m=a?"Hide password":"Show password";let b;e[19]!==a?(b=a?t.jsx(Gt,{size:16}):t.jsx(Vt,{size:16}),e[19]=a,e[20]=b):b=e[20];let C;e[21]!==m||e[22]!==b||e[23]!==g?(C=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:g,title:m,children:b}),e[21]=m,e[22]=b,e[23]=g,e[24]=C):C=e[24];const v=!r,N=d?"Copied!":"Copy token";let _;e[25]!==d?(_=d?t.jsx(qt,{size:16}):t.jsx(Bt,{size:16}),e[25]=d,e[26]=_):_=e[26];let k;e[27]!==u||e[28]!==N||e[29]!==_||e[30]!==v?(k=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u,disabled:v,title:N,children:_}),e[27]=u,e[28]=N,e[29]=_,e[30]=v,e[31]=k):k=e[31];let O;e[32]!==k||e[33]!==C?(O=t.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[C,k]}),e[32]=k,e[33]=C,e[34]=O):O=e[34];let T;return e[35]!==O||e[36]!==h?(T=t.jsxs("div",{className:"relative",children:[h,O]}),e[35]=O,e[36]=h,e[37]=T):T=e[37],T}function Be(s){const e=E.c(19),{card:n,selfClient:i,org:o,onDone:c,onError:r}=s,a=Xe();let l;e[0]!==n||e[1]!==i?(l=async y=>{const h={...n.configurationState??{},...y};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n.linkedConnectionId||n.candidateConnectionId,data:{configuration_state:h}}})},e[0]=n,e[1]=i,e[2]=l):l=e[2];let d;e[3]!==c||e[4]!==o||e[5]!==a?(d=async()=>{await a.invalidateQueries({queryKey:H.commerceDiscoveryCompanionConnections(o.id)}),c()},e[3]=c,e[4]=o,e[5]=a,e[6]=d):d=e[6];let f;e[7]!==r?(f=y=>{r?.(y)},e[7]=r,e[8]=f):f=e[8];let p;e[9]!==l||e[10]!==d||e[11]!==f?(p={mutationFn:l,onSuccess:d,onError:f},e[9]=l,e[10]=d,e[11]=f,e[12]=p):p=e[12];const u=Le(p);let x;e[13]!==u?(x=y=>u.mutate(y),e[13]=u,e[14]=x):x=e[14];const g=x;let j;return e[15]!==u.error||e[16]!==u.isPending||e[17]!==g?(j={save:g,isPending:u.isPending,error:u.error},e[15]=u.error,e[16]=u.isPending,e[17]=g,e[18]=j):j=e[18],j}const mn=Ae({accountName:me().min(1,"Account name is required"),appKey:me().optional(),appToken:me().optional()});function fn(s){const e=E.c(63),{card:n,selfClient:i,org:o,onDone:c,onIsPendingChange:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=De(mn),e[0]=a):a=e[0];const l=n.configurationState?.accountName||"",d=n.configurationState?.appKey||"",f=n.configurationState?.appToken||"";let p;e[1]!==l||e[2]!==d||e[3]!==f?(p={resolver:a,defaultValues:{accountName:l,appKey:d,appToken:f}},e[1]=l,e[2]=d,e[3]=f,e[4]=p):p=e[4];const u=Me(p);let x;e[5]!==n.configurationState?.accountName||e[6]!==n.configurationState?.appKey||e[7]!==n.configurationState?.appToken||e[8]!==u?(x=()=>{u.reset({accountName:n.configurationState?.accountName||"",appKey:n.configurationState?.appKey||"",appToken:n.configurationState?.appToken||""})},e[5]=n.configurationState?.accountName,e[6]=n.configurationState?.appKey,e[7]=n.configurationState?.appToken,e[8]=u,e[9]=x):x=e[9];let g;e[10]!==n.configurationState||e[11]!==u?(g=[n.configurationState,u],e[10]=n.configurationState,e[11]=u,e[12]=g):g=e[12],q.useEffect(x,g);let j;e[13]!==n||e[14]!==c||e[15]!==o||e[16]!==i?(j={card:n,selfClient:i,org:o,onDone:c},e[13]=n,e[14]=c,e[15]=o,e[16]=i,e[17]=j):j=e[17];const{save:y,isPending:h,error:m}=Be(j);let b,C;e[18]!==h||e[19]!==r?(C=()=>{r?.(h)},b=[h,r],e[18]=h,e[19]=r,e[20]=b,e[21]=C):(b=e[20],C=e[21]),q.useEffect(C,b);let v;if(e[22]!==u||e[23]!==y){let z;e[25]!==y?(z=async S=>{y(S)},e[25]=y,e[26]=z):z=e[26],v=u.handleSubmit(z),e[22]=u,e[23]=y,e[24]=v}else v=e[24];const N=v;let _;e[27]!==h?(_=z=>{const{field:S}=z;return t.jsxs(pe,{children:[t.jsx(ge,{children:"Account Name"}),t.jsx(he,{children:t.jsx(Ke,{placeholder:"Your VTEX account name",...S,disabled:h})}),t.jsx(xe,{})]})},e[27]=h,e[28]=_):_=e[28];let k;e[29]!==u.control||e[30]!==_?(k=t.jsx(fe,{control:u.control,name:"accountName",render:_}),e[29]=u.control,e[30]=_,e[31]=k):k=e[31];let O;e[32]!==h?(O=z=>{const{field:S}=z;return t.jsxs(pe,{children:[t.jsx(ge,{children:"App Key (optional)"}),t.jsx(he,{children:t.jsx(Ye,{placeholder:"VTEX app key",...S,disabled:h})}),t.jsx(xe,{})]})},e[32]=h,e[33]=O):O=e[33];let T;e[34]!==u.control||e[35]!==O?(T=t.jsx(fe,{control:u.control,name:"appKey",render:O}),e[34]=u.control,e[35]=O,e[36]=T):T=e[36];let K;e[37]!==h?(K=z=>{const{field:S}=z;return t.jsxs(pe,{children:[t.jsx(ge,{children:"App Token (optional)"}),t.jsx(he,{children:t.jsx(Ye,{placeholder:"VTEX app token",...S,disabled:h})}),t.jsx(xe,{})]})},e[37]=h,e[38]=K):K=e[38];let U;e[39]!==u.control||e[40]!==K?(U=t.jsx(fe,{control:u.control,name:"appToken",render:K}),e[39]=u.control,e[40]=K,e[41]=U):U=e[41];let w;e[42]!==u||e[43]!==k||e[44]!==T||e[45]!==U?(w=t.jsxs(Ve,{...u,children:[k,T,U]}),e[42]=u,e[43]=k,e[44]=T,e[45]=U,e[46]=w):w=e[46];let $;e[47]!==m?($=m&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m instanceof Error?m.message:"Failed to save configuration"}),e[47]=m,e[48]=$):$=e[48];let P;e[49]!==h||e[50]!==c?(P=t.jsx(V,{type:"button",variant:"outline",onClick:c,disabled:h,children:"Cancel"}),e[49]=h,e[50]=c,e[51]=P):P=e[51];const F=h?"Saving...":"Save";let D;e[52]!==h||e[53]!==F?(D=t.jsx(V,{type:"submit",disabled:h,children:F}),e[52]=h,e[53]=F,e[54]=D):D=e[54];let A;e[55]!==P||e[56]!==D?(A=t.jsxs(qe,{className:"pt-4",children:[P,D]}),e[55]=P,e[56]=D,e[57]=A):A=e[57];let R;return e[58]!==N||e[59]!==w||e[60]!==$||e[61]!==A?(R=t.jsxs("form",{onSubmit:N,className:"space-y-4",children:[w,$,A]}),e[58]=N,e[59]=w,e[60]=$,e[61]=A,e[62]=R):R=e[62],R}const pn=Ae({propertyId:me().min(1,"Property is required")});function gn(s){const e=E.c(55),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,onDone:a,onIsPendingChange:l}=s;let d;e[0]!==i||e[1]!==r.id?(d=H.commerceDiscoveryCompanionGaProperties(r.id,i),e[0]=i,e[1]=r.id,e[2]=d):d=e[2];let f;e[3]!==o?(f=async()=>{const S=await o.callTool({name:"get-account-summaries",arguments:{}}),L=Z(S);return un(L)},e[3]=o,e[4]=f):f=e[4];let p;e[5]!==d||e[6]!==f?(p={queryKey:d,queryFn:f},e[5]=d,e[6]=f,e[7]=p):p=e[7];const u=ue(p);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=De(pn),e[8]=x):x=e[8];const g=n.configurationState?.propertyId||"";let j;e[9]!==g?(j={resolver:x,defaultValues:{propertyId:g}},e[9]=g,e[10]=j):j=e[10];const y=Me(j);let h;e[11]!==n||e[12]!==a||e[13]!==r||e[14]!==c?(h={card:n,selfClient:c,org:r,onDone:a},e[11]=n,e[12]=a,e[13]=r,e[14]=c,e[15]=h):h=e[15];const{save:m,isPending:b,error:C}=Be(h);let v,N;e[16]!==b||e[17]!==l?(v=()=>{l?.(b)},N=[b,l],e[16]=b,e[17]=l,e[18]=v,e[19]=N):(v=e[18],N=e[19]),q.useEffect(v,N);let _;if(e[20]!==y||e[21]!==m){let S;e[23]!==m?(S=async L=>{m(L)},e[23]=m,e[24]=S):S=e[24],_=y.handleSubmit(S),e[20]=y,e[21]=m,e[22]=_}else _=e[22];const k=_;if(u.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading properties..."})}),e[25]=S):S=e[25],S}if(u.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Analytics properties."})}),e[26]=S):S=e[26],S}let O;e[27]!==u.data?(O=u.data||[],e[27]=u.data,e[28]=O):O=e[28];const T=O;if(T.flatMap(yn).length===0){let S;return e[29]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No Google Analytics properties found. Please connect a Google Analytics account with properties."})}),e[29]=S):S=e[29],S}let U;e[30]!==b||e[31]!==T?(U=S=>{const{field:L}=S;return t.jsxs(pe,{children:[t.jsx(ge,{children:"Google Analytics Property"}),t.jsx(he,{children:t.jsxs(rt,{value:L.value,onValueChange:L.onChange,disabled:b,children:[t.jsx(lt,{children:t.jsx(at,{placeholder:"Select a property"})}),t.jsx(ct,{children:T.map(hn)})]})}),t.jsx(xe,{})]})},e[30]=b,e[31]=T,e[32]=U):U=e[32];let w;e[33]!==y.control||e[34]!==U?(w=t.jsx(fe,{control:y.control,name:"propertyId",render:U}),e[33]=y.control,e[34]=U,e[35]=w):w=e[35];let $;e[36]!==y||e[37]!==w?($=t.jsx(Ve,{...y,children:w}),e[36]=y,e[37]=w,e[38]=$):$=e[38];let P;e[39]!==C?(P=C&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C instanceof Error?C.message:"Failed to save configuration"}),e[39]=C,e[40]=P):P=e[40];let F;e[41]!==b||e[42]!==a?(F=t.jsx(V,{type:"button",variant:"outline",onClick:a,disabled:b,children:"Cancel"}),e[41]=b,e[42]=a,e[43]=F):F=e[43];const D=b?"Saving...":"Save";let A;e[44]!==b||e[45]!==D?(A=t.jsx(V,{type:"submit",disabled:b,children:D}),e[44]=b,e[45]=D,e[46]=A):A=e[46];let R;e[47]!==F||e[48]!==A?(R=t.jsxs(qe,{className:"pt-4",children:[F,A]}),e[47]=F,e[48]=A,e[49]=R):R=e[49];let z;return e[50]!==k||e[51]!==$||e[52]!==P||e[53]!==R?(z=t.jsxs("form",{onSubmit:k,className:"space-y-4",children:[$,P,R]}),e[50]=k,e[51]=$,e[52]=P,e[53]=R,e[54]=z):z=e[54],z}function hn(s){return t.jsx("div",{children:s.options.map(xn)},s.account)}function xn(s){return t.jsx(dt,{value:s.value,children:s.label},s.value)}function yn(s){return s.options}const jn=Ae({siteUrl:me().min(1,"Site is required")});function bn(s){const e=E.c(59),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,contextSiteUrl:a,onDone:l,onIsPendingChange:d}=s;let f;e[0]!==i||e[1]!==r.id?(f=H.commerceDiscoveryCompanionGscSites(r.id,i),e[0]=i,e[1]=r.id,e[2]=f):f=e[2];let p;e[3]!==o?(p=async()=>{const S=await o.callTool({name:"list_sites",arguments:{}});return Z(S).sites||[]},e[3]=o,e[4]=p):p=e[4];let u;e[5]!==f||e[6]!==p?(u={queryKey:f,queryFn:p},e[5]=f,e[6]=p,e[7]=u):u=e[7];const x=ue(u);let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=De(jn),e[8]=g):g=e[8];const j=n.configurationState?.siteUrl||"";let y;e[9]!==j?(y={resolver:g,defaultValues:{siteUrl:j}},e[9]=j,e[10]=y):y=e[10];const h=Me(y);let m;e[11]!==n||e[12]!==l||e[13]!==r||e[14]!==c?(m={card:n,selfClient:c,org:r,onDone:l},e[11]=n,e[12]=l,e[13]=r,e[14]=c,e[15]=m):m=e[15];const{save:b,isPending:C,error:v}=Be(m);let N,_;e[16]!==C||e[17]!==d?(N=()=>{d?.(C)},_=[C,d],e[16]=C,e[17]=d,e[18]=N,e[19]=_):(N=e[18],_=e[19]),q.useEffect(N,_);let k;if(e[20]!==h||e[21]!==b){let S;e[23]!==b?(S=async L=>{b(L)},e[23]=b,e[24]=S):S=e[24],k=h.handleSubmit(S),e[20]=h,e[21]=b,e[22]=k}else k=e[22];const O=k;if(x.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading sites..."})}),e[25]=S):S=e[25],S}if(x.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Search Console sites."})}),e[26]=S):S=e[26],S}let T,K;if(e[27]!==n.configurationState?.siteUrl||e[28]!==a||e[29]!==h||e[30]!==x.data){K=Symbol.for("react.early_return_sentinel");e:{if(T=x.data||[],T.length===0){let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No verified sites found. Please verify a site in Google Search Console."})}),e[33]=L):L=e[33],K=L;break e}const S=n.configurationState?.siteUrl;if(S&&h.getValues("siteUrl")!==S)h.setValue("siteUrl",S);else if(!S&&!h.getValues("siteUrl")){const L=dn(a,T);L&&h.setValue("siteUrl",L)}}e[27]=n.configurationState?.siteUrl,e[28]=a,e[29]=h,e[30]=x.data,e[31]=T,e[32]=K}else T=e[31],K=e[32];if(K!==Symbol.for("react.early_return_sentinel"))return K;let U;e[34]!==C||e[35]!==T?(U=S=>{const{field:L}=S;return t.jsxs(pe,{children:[t.jsx(ge,{children:"Verified Site"}),t.jsx(he,{children:t.jsxs(rt,{value:L.value,onValueChange:L.onChange,disabled:C,children:[t.jsx(lt,{children:t.jsx(at,{placeholder:"Select a site"})}),t.jsx(ct,{children:T.map(Cn)})]})}),t.jsx(xe,{})]})},e[34]=C,e[35]=T,e[36]=U):U=e[36];let w;e[37]!==h.control||e[38]!==U?(w=t.jsx(fe,{control:h.control,name:"siteUrl",render:U}),e[37]=h.control,e[38]=U,e[39]=w):w=e[39];let $;e[40]!==h||e[41]!==w?($=t.jsx(Ve,{...h,children:w}),e[40]=h,e[41]=w,e[42]=$):$=e[42];let P;e[43]!==v?(P=v&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v instanceof Error?v.message:"Failed to save configuration"}),e[43]=v,e[44]=P):P=e[44];let F;e[45]!==C||e[46]!==l?(F=t.jsx(V,{type:"button",variant:"outline",onClick:l,disabled:C,children:"Cancel"}),e[45]=C,e[46]=l,e[47]=F):F=e[47];const D=C?"Saving...":"Save";let A;e[48]!==C||e[49]!==D?(A=t.jsx(V,{type:"submit",disabled:C,children:D}),e[48]=C,e[49]=D,e[50]=A):A=e[50];let R;e[51]!==F||e[52]!==A?(R=t.jsxs(qe,{className:"pt-4",children:[F,A]}),e[51]=F,e[52]=A,e[53]=R):R=e[53];let z;return e[54]!==O||e[55]!==$||e[56]!==P||e[57]!==R?(z=t.jsxs("form",{onSubmit:O,className:"space-y-4",children:[$,P,R]}),e[54]=O,e[55]=$,e[56]=P,e[57]=R,e[58]=z):z=e[58],z}function Cn(s){return t.jsx(dt,{value:s.siteUrl,children:s.siteUrl},s.siteUrl)}const Sn={vtex:fn,"google-analytics":gn,"google-search-console":bn};function vn(){const s=E.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),t.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),s[1]=n):n=s[1];let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[n,t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),s[2]=i):i=s[2],i}function ze(s){const e=E.c(3),{children:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ot,{size:14,className:"shrink-0 text-blue-500"}),e[0]=i):i=e[0];let o;return e[1]!==n?(o=t.jsxs("div",{className:"flex items-center gap-2 p-1",children:[i,t.jsx("p",{className:"text-sm text-foreground",children:n})]}),e[1]=n,e[2]=o):o=e[2],o}function Nn(s){const e=E.c(43),{card:n,connecting:i,disabled:o,onConnect:c,org:r,selfClient:a,siteUrl:l}=s,d=n.linkedConnectionId;let f;e[0]!==n.configurationState?(f=on(n.configurationState),e[0]=n.configurationState,e[1]=f):f=e[1];const p=f;let u;e[2]!==n.icon||e[3]!==n.title?(u=t.jsx(kt,{icon:n.icon,name:n.title,size:"sm",fit:"contain",className:"p-1.5"}),e[2]=n.icon,e[3]=n.title,e[4]=u):u=e[4];let x;e[5]!==n.title?(x=t.jsx("p",{className:"flex-1 text-sm text-foreground",children:n.title}),e[5]=n.title,e[6]=x):x=e[6];let g;e[7]!==n.satisfied||e[8]!==n.title||e[9]!==i||e[10]!==o||e[11]!==c?(g=n.satisfied?t.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[t.jsx(ot,{size:16})," Connected"]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",disabled:o||i,onClick:c,"aria-label":`Connect ${n.title}`,children:i?t.jsx(Je,{size:16,className:"animate-spin"}):"Connect"}),e[7]=n.satisfied,e[8]=n.title,e[9]=i,e[10]=o,e[11]=c,e[12]=g):g=e[12];let j;e[13]!==u||e[14]!==x||e[15]!==g?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[u,x,g]}),e[13]=u,e[14]=x,e[15]=g,e[16]=j):j=e[16];let y;e[17]!==n.checks?(y=n.checks!==null&&t.jsxs(ze,{children:["+ ",n.checks," checks"]}),e[17]=n.checks,e[18]=y):y=e[18];let h;e[19]!==n.headline?(h=n.headline&&t.jsx(ze,{children:n.headline}),e[19]=n.headline,e[20]=h):h=e[20];let m;e[21]!==n.bullets?(m=n.bullets.map(_n),e[21]=n.bullets,e[22]=m):m=e[22];let b;e[23]!==n.candidateConnectionId||e[24]!==n.satisfied||e[25]!==n.title?(b=!n.satisfied&&n.candidateConnectionId&&t.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",n.title]}),e[23]=n.candidateConnectionId,e[24]=n.satisfied,e[25]=n.title,e[26]=b):b=e[26];let C;e[27]!==y||e[28]!==h||e[29]!==m||e[30]!==b?(C=t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[y,h,m,b]}),e[27]=y,e[28]=h,e[29]=m,e[30]=b,e[31]=C):C=e[31];let v;e[32]!==n||e[33]!==d||e[34]!==r||e[35]!==p||e[36]!==a||e[37]!==l?(v=n.satisfied&&d&&t.jsx(Tn,{card:n,org:r,selfClient:a,connectionId:d,savedConfigEntries:p,contextSiteUrl:l}),e[32]=n,e[33]=d,e[34]=r,e[35]=p,e[36]=a,e[37]=l,e[38]=v):v=e[38];let N;return e[39]!==C||e[40]!==v||e[41]!==j?(N=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[j,C,v]}),e[39]=C,e[40]=v,e[41]=j,e[42]=N):N=e[42],N}function _n(s){return t.jsx(ze,{children:s},s)}function wn(s,e){return/(token|secret|password|appKey|key)$/i.test(s)?"••••••••":e}function In(s){const e=E.c(2),{title:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configuration isn't available here yet for ",n,"."]})}),e[0]=n,e[1]=i):i=e[1],i}function Tn(s){const e=E.c(36),{card:n,org:i,selfClient:o,connectionId:c,savedConfigEntries:r,contextSiteUrl:a}=s;let l;e[0]!==c||e[1]!==i.id||e[2]!==i.slug?(l={connectionId:c,orgId:i.id,orgSlug:i.slug},e[0]=c,e[1]=i.id,e[2]=i.slug,e[3]=l):l=e[3];const d=_e(l),[f,p]=q.useState(!1),[u,x]=q.useState(!1),g=Sn[n.bindingType];let j;e[4]!==u?(j=T=>{!T&&u||p(T)},e[4]=u,e[5]=j):j=e[5];const y=j;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuration"}),e[6]=h):h=e[6];let m;e[7]!==r.length?(m=r.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No configuration values saved yet."}),e[7]=r.length,e[8]=m):m=e[8];let b;e[9]!==m?(b=t.jsxs("div",{className:"grid gap-1",children:[h,m]}),e[9]=m,e[10]=b):b=e[10];let C;e[11]!==g||e[12]!==n.title||e[13]!==r.length?(C=r.length>0?t.jsxs(zt,{children:[t.jsx(Lt,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>p(!0),"aria-label":`Edit ${n.title} configuration`,disabled:!g,children:t.jsx(Dt,{size:14})})}),t.jsx(At,{children:"Edit configuration"})]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!0),disabled:!g,children:"Configure"}),e[11]=g,e[12]=n.title,e[13]=r.length,e[14]=C):C=e[14];let v;e[15]!==b||e[16]!==C?(v=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[b,C]}),e[15]=b,e[16]=C,e[17]=v):v=e[17];let N;e[18]!==r?(N=r.length>0&&t.jsx("dl",{className:"grid gap-2",children:r.map(En)}),e[18]=r,e[19]=N):N=e[19];let _;e[20]!==v||e[21]!==N?(_=t.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[v,N]}),e[20]=v,e[21]=N,e[22]=_):_=e[22];let k;e[23]!==g||e[24]!==n||e[25]!==d||e[26]!==c||e[27]!==a||e[28]!==f||e[29]!==y||e[30]!==i||e[31]!==o?(k=g?t.jsx(Ot,{open:f,onOpenChange:y,children:t.jsxs(Rt,{className:"sm:max-w-lg",children:[t.jsxs(Ut,{children:[t.jsxs($t,{children:["Configure ",n.title]}),t.jsx(Pt,{children:"Update the values this companion uses for Commerce Discovery."})]}),t.jsx(g,{card:n,connectionId:c,companionClient:d,selfClient:o,org:i,contextSiteUrl:a,onDone:()=>p(!1),onIsPendingChange:x})]})}):t.jsx(In,{title:n.title}),e[23]=g,e[24]=n,e[25]=d,e[26]=c,e[27]=a,e[28]=f,e[29]=y,e[30]=i,e[31]=o,e[32]=k):k=e[32];let O;return e[33]!==k||e[34]!==_?(O=t.jsxs(t.Fragment,{children:[_,k]}),e[33]=k,e[34]=_,e[35]=O):O=e[35],O}function En(s){return t.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[t.jsx("dt",{className:"text-muted-foreground",children:s.label}),t.jsx("dd",{className:"truncate text-foreground",children:wn(s.key,s.value)})]},s.key)}const Ge={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Out-of-stock, thin PDPs & attribute gaps across every SKU"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Where revenue leaks between product view and checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Search visibility & indexing gaps across your catalog"}};function kn(s){const e=E.c(39),{selfClient:n,org:i,cdConnectionId:o}=s;let c;e[0]!==o||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:o,orgId:i.id,orgSlug:i.slug},e[0]=o,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const r=_e(c);let a;e[4]!==o||e[5]!==i.id?(a=H.commerceDiscoveryCompanionSchema(i.id,o),e[4]=o,e[5]=i.id,e[6]=a):a=e[6];let l;e[7]!==r?(l=async()=>{const I=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return Z(I)},e[7]=r,e[8]=l):l=e[8];let d;e[9]!==a||e[10]!==l?(d={queryKey:a,queryFn:l},e[9]=a,e[10]=l,e[11]=d):d=e[11];const f=ue(d),p=Jt(f.data?.stateSchema??{properties:{}}),u=p.map(An),x=p.map(Ln).filter(zn),g=p.filter(Pn).map($n),j=[...x,...g].sort().join(",");let y;e[12]!==o||e[13]!==i.id?(y=H.commerceDiscoveryConnection(i.id,o),e[12]=o,e[13]=i.id,e[14]=y):y=e[14];let h;e[15]!==o||e[16]!==n?(h=async()=>{const I=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return Z(I)},e[15]=o,e[16]=n,e[17]=h):h=e[17];let m;e[18]!==y||e[19]!==h?(m={queryKey:y,queryFn:h},e[18]=y,e[19]=h,e[20]=m):m=e[20];const b=ue(m),C=b.data?.item?.configuration_state??null;let v;e[21]!==C?(v=I=>C?.[I.fieldKey]?.value,e[21]=C,e[22]=v):v=e[22];const N=p.map(v).filter(Un),_=ue({queryKey:H.commerceDiscoveryCompanionConnections(i.id),enabled:p.length>0,queryFn:async()=>{const I=[{field:["app_name"],operator:"in",value:u},{field:["app_id"],operator:"in",value:x}];N.length>0&&I.push({field:["id"],operator:"in",value:N});const B=await n.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:I},limit:1e3}});return Z(B)}}),k=_.data?.items??[],O=new Set(N),T=k.filter(I=>O.has(I.id)),K=T.filter(Rn);let U;e[23]!==i.id||e[24]!==i.slug?(U=I=>({queryKey:H.commerceDiscoveryCompanionOAuthStatus(i.id,I.id),queryFn:async()=>{const B=await fetch(`/api/${encodeURIComponent(i.slug)}/connections/${encodeURIComponent(I.id)}/oauth-token/status`,{credentials:"include"});return B.ok?{hasToken:(await B.json()).hasToken===!0}:{hasToken:!1}},retry:!1}),e[23]=i.id,e[24]=i.slug,e[25]=U):U=e[25];const w=Ht({queries:K.map(U)});let $;e[26]!==w?($=(I,B)=>[I.id,w[B]?.data?.hasToken===!0],e[26]=w,e[27]=$):$=e[27];const P=new Map(K.map($)),F={};for(const I of T)F[I.id]=!I.oauth_config||!!I.connection_token||P.get(I.id)===!0;const D=ue({queryKey:H.commerceDiscoveryCompanionRegistry(i.id,j),enabled:p.length>0,queryFn:async()=>{const I=en(x,g),B=await Ft(nt.REGISTRY(i.id),i.id,i.slug,"COLLECTION_REGISTRY_APP_LIST",{...I?{where:I}:{},limit:1e3});return Z(B)}}),A={},R={};for(const I of D.data?.items??[])A[I.id]=I,I.server?.name&&(R[I.server.name]=I);const z=cn({requirements:p,itemsById:A,itemsByName:R,connections:k,connectionReadiness:F,configurationState:C,curated:Ge});let S;e[28]!==b||e[29]!==_||e[30]!==w||e[31]!==D||e[32]!==p||e[33]!==f.isPending?(S=f.isPending||b.isPending||p.length>0&&(_.isPending||D.isPending||w.some(On)),e[28]=b,e[29]=_,e[30]=w,e[31]=D,e[32]=p,e[33]=f.isPending,e[34]=S):S=e[34];const L=S,ee=f.error??b.error??_.error??D.error??null;let Y;return e[35]!==z||e[36]!==ee||e[37]!==L?(Y={cards:z,isLoading:L,error:ee},e[35]=z,e[36]=ee,e[37]=L,e[38]=Y):Y=e[38],Y}function On(s){return s.isPending}function Rn(s){return s.oauth_config&&!s.connection_token}function Un(s){return typeof s=="string"&&s.length>0}function $n(s){return s.bindingType}function Pn(s){return!Ge[s.bindingType]}function zn(s){return!!s}function Ln(s){return Ge[s.bindingType]?.registryAppId}function An(s){return s.bindingType}function Dn({selfClient:s,org:e,userId:n,cdConnectionId:i}){const o=Xe(),[c,r]=q.useState(null),[a,l]=q.useState(null),d=async(p,u)=>{const x=await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:p,data:u}});return Z(x)};async function f(p){r(p.fieldKey),l(null);try{let u=p.candidateConnectionId;if(!u){const m=Kt(p.registryItem,e.id,n,{remoteIndex:0}),b=m.connection_type==="STDIO",C=!!m.connection_url,v=b&&m.connection_headers&&typeof m.connection_headers=="object"&&"command"in m.connection_headers;if(!C&&!v){l(`${p.title} cannot be connected: no connection method available`);return}const N=await s.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:m}});u=Z(N).item.id}const x=u,g=await Qt({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>d(x,{connection_token:m}).then(()=>{})});if(!g.ok){l(`Couldn't sign in to ${p.title}: ${g.error}`);return}const j=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}}),y=Z(j).item?.configuration_state??null,h=tn(y,p.fieldKey,p.bindingType,x);await d(i,{configuration_state:h}),await o.invalidateQueries({queryKey:H.commerceDiscoveryConnection(e.id,i)}),await o.invalidateQueries({queryKey:H.commerceDiscoveryCompanionConnections(e.id)})}catch(u){l(u instanceof Error?u.message:String(u))}finally{r(null)}}return{connect:f,connectingFieldKey:c,error:a}}const Mn="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function Fn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),t.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),s[0]=e):e=s[0],e}function Kn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid gap-4",children:[0,1,2].map(qn)}),s[0]=e):e=s[0],e}function qn(s){return t.jsx(vn,{},s)}function Vn(s){const e=E.c(24),{org:n,cdConnectionId:i,siteUrl:o}=s,{data:c}=Fe.useSession(),r=c?.user?.id??"";let a;e[0]!==n.id||e[1]!==n.slug?(a={connectionId:st,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=a):a=e[2];const l=_e(a);let d;e[3]!==i||e[4]!==n||e[5]!==l?(d={selfClient:l,org:n,cdConnectionId:i},e[3]=i,e[4]=n,e[5]=l,e[6]=d):d=e[6];const{cards:f,isLoading:p,error:u}=kn(d);let x;e[7]!==i||e[8]!==n||e[9]!==l||e[10]!==r?(x={selfClient:l,org:n,userId:r,cdConnectionId:i},e[7]=i,e[8]=n,e[9]=l,e[10]=r,e[11]=x):x=e[11];const{connect:g,connectingFieldKey:j,error:y}=Dn(x);if(!p&&!u&&f.length===0)return null;const h=j!==null;let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Fn,{}),e[12]=m):m=e[12];let b;return e[13]!==h||e[14]!==f||e[15]!==g||e[16]!==y||e[17]!==j||e[18]!==u||e[19]!==p||e[20]!==n||e[21]!==l||e[22]!==o?(b=t.jsxs("div",{className:Mn,children:[m,u?t.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[t.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):p?t.jsx(Kn,{}):t.jsx($e,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[45vh] md:flex-none",children:t.jsxs("div",{className:"grid gap-4",children:[y&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y}),f.map(C=>t.jsx(Nn,{card:C,connecting:j===C.fieldKey,disabled:h&&j!==C.fieldKey,org:n,selfClient:l,siteUrl:o,onConnect:()=>{g(C)}},C.fieldKey))]})})]}),e[13]=h,e[14]=f,e[15]=g,e[16]=y,e[17]=j,e[18]=u,e[19]=p,e[20]=n,e[21]=l,e[22]=o,e[23]=b):b=e[23],b}const He="https://decocms-tanstack.deco-cx.workers.dev/agendar",Bn="Rather have us walk you through it?",Gn="Book a 20-minute call and we'll run the diagnostic with you, live.";function ft({siteUrl:s,email:e}){const n=new URL(He);return s&&n.searchParams.set("siteUrl",s),e&&n.searchParams.set("email",e),n.toString()}function Hn(s){const e=E.c(9),{href:n,size:i,className:o}=s,c=n===void 0?He:n,r=i===void 0?"lg":i;let a;e[0]!==o?(a=X("w-full",o),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ut,{size:16}),e[2]=l):l=e[2];let d;e[3]!==c?(d=t.jsxs("a",{href:c,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",l]}),e[3]=c,e[4]=d):d=e[4];let f;return e[5]!==r||e[6]!==a||e[7]!==d?(f=t.jsx(V,{asChild:!0,variant:"outline",size:r,className:a,children:d}),e[5]=r,e[6]=a,e[7]=d,e[8]=f):f=e[8],f}function Ze(s){const e=E.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:n}),e[0]=n,e[1]=i):i=e[1],i}function Qn(){const s=E.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ze,{children:t.jsx(mt,{size:20,className:"text-muted-foreground"})}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:t.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),s[1]=n):n=s[1];let i;s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),s[2]=i):i=s[2];let o;return s[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,n,t.jsxs("div",{className:"relative",children:[i,t.jsxs(Ze,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),s[3]=o):o=s[3],o}function pt(s){const e=E.c(4),{href:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qn,{}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"grid gap-2",children:[t.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:Bn}),t.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:Gn})]}),e[1]=o):o=e[1];let c;return e[2]!==n?(c=t.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:t.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[i,o,t.jsx(Hn,{href:n,size:"xl"})]})}),e[2]=n,e[3]=c):c=e[3],c}function Wn(s){const e=E.c(8),{className:n,href:i}=s,o=i===void 0?He:i;let c;e[0]!==n?(c=X("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",n),e[0]=n,e[1]=c):c=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(mt,{size:20})}),e[2]=r):r=e[2];let a,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[t.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),t.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),l=t.jsx(ut,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=a,e[4]=l):(a=e[3],l=e[4]);let d;return e[5]!==o||e[6]!==c?(d=t.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:c,children:[r,a,l]}),e[5]=o,e[6]=c,e[7]=d):d=e[7],d}function gt(s){const e=E.c(10),{host:n}=s,i=`https://www.google.com/s2/favicons?domain=${n}&sz=128`;let o,c,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),c=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=t.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=c,e[2]=r):(o=e[0],c=e[1],r=e[2]);let a;e[3]!==i?(a=t.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:t.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=a):a=e[4];let l;e[5]!==n?(l=t.jsx("span",{className:"text-lg font-medium text-foreground",children:n}),e[5]=n,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==l?(d=t.jsxs("div",{className:"flex items-center gap-3",children:[o,c,r,a,l]}),e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function ht(s){const e=E.c(16),{label:n,iconSize:i,className:o,iconClassName:c,labelClassName:r}=s,a=i===void 0?14:i;let l;e[0]!==o?(l=X("inline-flex items-center gap-2",o),e[0]=o,e[1]=l):l=e[1];let d;e[2]!==c?(d=X("shrink-0 animate-spin",c),e[2]=c,e[3]=d):d=e[3];let f;e[4]!==a||e[5]!==d?(f=t.jsx(Je,{size:a,className:d}),e[4]=a,e[5]=d,e[6]=f):f=e[6];let p;e[7]!==r?(p=X("text-sm",r),e[7]=r,e[8]=p):p=e[8];let u;e[9]!==n||e[10]!==p?(u=t.jsx("span",{className:p,children:n}),e[9]=n,e[10]=p,e[11]=u):u=e[11];let x;return e[12]!==l||e[13]!==f||e[14]!==u?(x=t.jsxs("span",{className:l,children:[f,u]}),e[12]=l,e[13]=f,e[14]=u,e[15]=x):x=e[15],x}const Yn={route:"Preparing commerce onboarding...",workspace:"Preparing your commerce workspace...",connect:"Connecting workspace...",setup:"Setting up Commerce Discovery...",button:"Setting up"};function xt(s){return Yn[s]}function yt(s){const e=E.c(2),{variant:n}=s;let i;return e[0]!==n?(i=t.jsx(Q,{children:t.jsx(we,{variant:n})}),e[0]=n,e[1]=i):i=e[1],i}function we(s){const e=E.c(4),{variant:n}=s;let i;e[0]!==n?(i=xt(n),e[0]=n,e[1]=i):i=e[1];let o;return e[2]!==i?(o=t.jsx("div",{className:"py-4",role:"status","aria-live":"polite",children:t.jsx(ht,{label:i,className:"text-muted-foreground"})}),e[2]=i,e[3]=o):o=e[3],o}function Zn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ht,{label:xt("button")}),s[0]=e):e=s[0],e}function xi(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Jn,{}),s[0]=e):e=s[0],e}const jt=q.createContext(null),bt=()=>q.useContext(jt);function Xn(s){if(!s)return null;const e=Ue(s);return e.ok?new URL(e.value).hostname:null}function Jn(){const s=E.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},s[0]=e):e=s[0];const n=Ct(e),{org:i,siteUrl:o}=n;let c;s[1]!==o?(c=Xn(o),s[1]=o,s[2]=c):c=s[2];const r=c;let a;s[3]!==i||s[4]!==o?(a=t.jsx(es,{requestedOrgSlug:i,siteUrl:o}),s[3]=i,s[4]=o,s[5]=a):a=s[5];let l;return s[6]!==r||s[7]!==a?(l=t.jsx(jt.Provider,{value:r,children:a}),s[6]=r,s[7]=a,s[8]=l):l=s[8],l}function es(s){const e=E.c(8),{requestedOrgSlug:n,siteUrl:i}=s,{data:o,isPending:c}=Fe.useSession(),r=bt();if(c){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(yt,{variant:"route"}),e[0]=l):l=e[0],l}if(!o){const l=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==r?(d=r?t.jsx(gt,{host:r}):void 0,e[1]=r,e[2]=d):d=e[2];let f;return e[3]!==d?(f=t.jsx(Q,{children:t.jsx(wt,{callbackUrl:l,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:d})}),e[3]=d,e[4]=f):f=e[4],f}let a;return e[5]!==n||e[6]!==i?(a=t.jsx(ts,{requestedOrgSlug:n,siteUrl:i}),e[5]=n,e[6]=i,e[7]=a):a=e[7],a}function ts(s){const e=E.c(40),{requestedOrgSlug:n,siteUrl:i}=s,o=et(),c=St(),[r,a]=q.useState(null),[l,d]=q.useState(null),f=c.data?.map(ss)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:ns,retry:!1,onSuccess:m=>{d(m)}},e[0]=p):p=e[0];const u=Le(p);if(c.isPending){let m;return e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(yt,{variant:"route"}),e[1]=m):m=e[1],m}if(c.error){let m;return e[2]!==c?(m=t.jsx(ve,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[2]=c,e[3]=m):m=e[3],m}const x=n?f.find(m=>m.slug===n):null;if(x){let m;return e[4]!==x||e[5]!==i?(m=t.jsx(Se,{org:x,initialSiteUrl:i}),e[4]=x,e[5]=i,e[6]=m):m=e[6],m}if(n){let m;return e[7]!==c?(m=t.jsx(ve,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[7]=c,e[8]=m):m=e[8],m}if(r){let m;return e[9]!==r||e[10]!==i?(m=t.jsx(Se,{org:r,initialSiteUrl:i}),e[9]=r,e[10]=i,e[11]=m):m=e[11],m}if(f.length===1&&f[0]){let m;return e[12]!==f[0]||e[13]!==i?(m=t.jsx(Se,{org:f[0],initialSiteUrl:i}),e[12]=f[0],e[13]=i,e[14]=m):m=e[14],m}if(f.length>1){let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(J,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=m):m=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=v=>a(v),e[16]=b):b=e[16];let C;return e[17]!==f?(C=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx($e,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(We,{organizations:f,selectLabel:"Continue",onSelected:b})})]})}),e[17]=f,e[18]=C):C=e[18],C}if(!l){let m;e[19]!==u?(m=()=>{u.reset(),u.mutate()},e[19]=u,e[20]=m):m=e[20];let b;return e[21]!==u||e[22]!==m?(b=t.jsx(is,{mutation:u,onRetry:m}),e[21]=u,e[22]=m,e[23]=b):b=e[23],b}const g=l;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let m;return e[24]!==g.organization||e[25]!==i?(m=t.jsx(Se,{org:g.organization,initialSiteUrl:i}),e[24]=g.organization,e[25]=i,e[26]=m):m=e[26],m}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let m;e[27]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(J,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=m):m=e[27];const b=g.domain??void 0;let C;e[28]!==o||e[29]!==i?(C=(N,_)=>{tt(),a({...N,slug:_}),o({to:"/commerce-onboarding",search:{org:_,siteUrl:i}})},e[28]=o,e[29]=i,e[30]=C):C=e[30];let v;return e[31]!==g.organizations||e[32]!==b||e[33]!==C?(v=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx($e,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(We,{organizations:g.organizations,domain:b,onJoined:C})})]})}),e[31]=g.organizations,e[32]=b,e[33]=C,e[34]=v):v=e[34],v}const j=g?.error??"We could not determine a commerce organization for this account.";let y;e[35]!==u?(y=()=>{d(null),u.reset()},e[35]=u,e[36]=y):y=e[36];let h;return e[37]!==j||e[38]!==y?(h=t.jsx(ve,{title:"Commerce onboarding needs support",description:j,actionLabel:"Try again",onRetry:y}),e[37]=j,e[38]=y,e[39]=h):h=e[39],h}async function ns(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&tt(),e}function ss(s){return{id:s.id,name:s.name,slug:s.slug,logo:s.logo??null}}function is(s){const e=E.c(7),{mutation:n,onRetry:i}=s,o=q.useRef(!1);let c;e[0]!==n?(c=d=>{!d||o.current||(o.current=!0,n.mutate())},e[0]=n,e[1]=c):c=e[1];const r=c;if(n.error){let d;return e[2]!==i?(d=t.jsx(ve,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:i}),e[2]=i,e[3]=d):d=e[3],d}let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{variant:"workspace"}),e[4]=a):a=e[4];let l;return e[5]!==r?(l=t.jsx(Q,{children:t.jsx("div",{ref:r,children:a})}),e[5]=r,e[6]=l):l=e[6],l}function J(s){const e=E.c(8),{title:n,description:i}=s,o=bt();let c;e[0]!==o?(c=o?t.jsx(gt,{host:o}):t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=c):c=e[1];let r;e[2]!==i||e[3]!==n?(r=(n||i)&&t.jsxs("div",{className:"space-y-2",children:[n&&t.jsx("h1",{className:"text-2xl font-medium leading-8",children:n}),i&&t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==c||e[6]!==r?(a=t.jsxs("div",{className:"grid gap-10",children:[c,r]}),e[5]=c,e[6]=r,e[7]=a):a=e[7],a}function ve(s){const e=E.c(9),{title:n,description:i,actionLabel:o,onRetry:c}=s;let r;e[0]!==i||e[1]!==n?(r=t.jsx(J,{title:n,description:i}),e[0]=i,e[1]=n,e[2]=r):r=e[2];let a;e[3]!==o||e[4]!==c?(a=t.jsx(V,{type:"button",size:"xl",className:"w-full",onClick:c,children:o}),e[3]=o,e[4]=c,e[5]=a):a=e[5];let l;return e[6]!==r||e[7]!==a?(l=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[r,a]})}),e[6]=r,e[7]=a,e[8]=l):l=e[8],l}function os(s){return s.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function Oe(s){const e=s;if(e.isError)throw new Error(os(e));return e.structuredContent??s}function Se(s){const e=E.c(10),{org:n,initialSiteUrl:i}=s,{data:o}=Fe.useSession(),c=o?.user?.email;let r;e[0]!==i||e[1]!==c?(r=ft({siteUrl:i,email:c}),e[0]=i,e[1]=c,e[2]=r):r=e[2];const a=r;let l;e[3]!==a?(l=t.jsx(pt,{href:a}),e[3]=a,e[4]=l):l=e[4];const d=l;let f;return e[5]!==i||e[6]!==d||e[7]!==n||e[8]!==o?.user?.email?(f=t.jsx(vt,{children:p=>{const{reset:u}=p;return t.jsx(Nt,{fallback:x=>{const{error:g,resetError:j}=x;return t.jsx(Q,{visual:d,children:t.jsx(rs,{orgName:n.name,message:g instanceof Error?g.message:"We could not check Commerce Discovery setup.",onRetry:()=>{u(),j()}})})},children:t.jsx(q.Suspense,{fallback:t.jsx(Q,{visual:d,children:t.jsx(we,{variant:"connect"})}),children:t.jsx(ls,{org:n,initialSiteUrl:i,sessionEmail:o?.user?.email},`${n.id}:${i??""}`)})})}}),e[5]=i,e[6]=d,e[7]=n,e[8]=o?.user?.email,e[9]=f):f=e[9],f}function rs(s){const e=E.c(10),{orgName:n,message:i,onRetry:o}=s,c=`Commerce setup will continue for ${n}.`;let r;e[0]!==c?(r=t.jsx(J,{title:"Commerce diagnostics",description:c}),e[0]=c,e[1]=r):r=e[1];let a;e[2]!==i?(a=t.jsx(Ne,{message:i}),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==o?(l=t.jsx(V,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=l):l=e[5];let d;return e[6]!==r||e[7]!==a||e[8]!==l?(d=t.jsxs("div",{className:"grid gap-10",children:[r,a,l]}),e[6]=r,e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function ls(s){const e=E.c(100),{org:n,initialSiteUrl:i,sessionEmail:o}=s,c=et();let r;e[0]!==n.id||e[1]!==n.slug?(r={connectionId:st,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=r):r=e[2];const a=_e(r),[l,d]=q.useState(i??""),[f,p]=q.useState(null),[u,x]=q.useState(null),g=q.useRef(!1),j=nt.COMMERCE_DISCOVERY(n.id),y=Tt(n.id),h=H.commerceDiscoveryConnection(n.id,j);let m;e[3]!==j||e[4]!==a?(m=async()=>{const M=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:j}});return Oe(M)},e[3]=j,e[4]=a,e[5]=m):m=e[5];let b;e[6]!==h||e[7]!==m?(b={queryKey:h,queryFn:m,retry:!1},e[6]=h,e[7]=m,e[8]=b):b=e[8];const C=Qe(b),v=H.commerceDiscoveryVirtualMcp(n.id,y);let N;e[9]!==a||e[10]!==y?(N=async()=>{const M=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:y}});return Oe(M)},e[9]=a,e[10]=y,e[11]=N):N=e[11];let _;e[12]!==v||e[13]!==N?(_={queryKey:v,queryFn:N,retry:!1},e[12]=v,e[13]=N,e[14]=_):_=e[14];const k=Qe(_);let O;e[15]!==a?(O=async M=>{const W=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:M}});return Oe(W)},e[15]=a,e[16]=O):O=e[16];let T;e[17]!==C||e[18]!==k?(T=M=>{p(M),x(null),C.refetch(),k.refetch()},e[17]=C,e[18]=k,e[19]=T):T=e[19];let K;e[20]===Symbol.for("react.memo_cache_sentinel")?(K=M=>{x(M instanceof Error?M.message:"Commerce Discovery setup failed.")},e[20]=K):K=e[20];let U;e[21]!==O||e[22]!==T?(U={mutationFn:O,retry:!1,onSuccess:T,onError:K},e[21]=O,e[22]=T,e[23]=U):U=e[23];const w=Le(U),$=!!C.data.item&&!!k.data.item,P=i??l;let F;e[24]!==P||e[25]!==o?(F=ft({siteUrl:P,email:o}),e[24]=P,e[25]=o,e[26]=F):F=e[26];const D=F;let A;e[27]!==D?(A=t.jsx(pt,{href:D}),e[27]=D,e[28]=A):A=e[28];const R=A;let z;e[29]!==w?(z=M=>{const W=Ue(M);if(!W.ok){x(W.error);return}x(null),w.mutate(W.value)},e[29]=w,e[30]=z):z=e[30];const S=z;let L;e[31]!==i||e[32]!==S||e[33]!==$?(L=M=>{!M||g.current||$||!i||(g.current=!0,S(i))},e[31]=i,e[32]=S,e[33]=$,e[34]=L):L=e[34];const ee=L;let Y;e[35]!==S||e[36]!==l?(Y=M=>{M.preventDefault(),S(l)},e[35]=S,e[36]=l,e[37]=Y):Y=e[37];const I=Y;let B;e[38]!==j||e[39]!==f?.reportApp||e[40]!==y?(B=f?.reportApp??{connectionId:j,virtualMcpId:y,toolName:Et},e[38]=j,e[39]=f?.reportApp,e[40]=y,e[41]=B):B=e[41];const G=B;let ye;e[42]!==c||e[43]!==n.slug||e[44]!==G.connectionId||e[45]!==G.toolName||e[46]!==G.virtualMcpId?(ye=()=>{localStorage.setItem(_t.sidebarOpen(),JSON.stringify(!1)),c({to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:G.virtualMcpId,main:It(G.connectionId,G.toolName),chat:0}})},e[42]=c,e[43]=n.slug,e[44]=G.connectionId,e[45]=G.toolName,e[46]=G.virtualMcpId,e[47]=ye):ye=e[47];const Ie=ye;if($){let M;return e[48]!==D||e[49]!==R||e[50]!==P||e[51]!==Ie||e[52]!==n||e[53]!==G?(M=t.jsx(as,{org:n,reportApp:G,onOpenReport:Ie,meetingUrl:D,meetingVisual:R,siteUrl:P}),e[48]=D,e[49]=R,e[50]=P,e[51]=Ie,e[52]=n,e[53]=G,e[54]=M):M=e[54],M}if(i){let M;e[55]!==i?(M=Ue(i),e[55]=i,e[56]=M):M=e[56];const W=M;if(!W.ok){const ke=`Commerce setup will continue for ${n.name}.`;let le;e[57]!==ke?(le=t.jsx(J,{title:"Commerce diagnostics",description:ke}),e[57]=ke,e[58]=le):le=e[58];let ae;e[59]!==W.error?(ae=t.jsx(Ne,{message:W.error}),e[59]=W.error,e[60]=ae):ae=e[60];let ce;e[61]!==I||e[62]!==u||e[63]!==w.isPending||e[64]!==l?(ce=t.jsx(Re,{siteUrl:l,error:u,isSubmitting:w.isPending,onSiteUrlChange:d,onSubmit:I}),e[61]=I,e[62]=u,e[63]=w.isPending,e[64]=l,e[65]=ce):ce=e[65];let de;e[66]!==le||e[67]!==ae||e[68]!==ce?(de=t.jsxs("div",{className:"grid gap-10",children:[le,ae,ce]}),e[66]=le,e[67]=ae,e[68]=ce,e[69]=de):de=e[69];let Ce;return e[70]!==R||e[71]!==de?(Ce=t.jsx(Q,{visual:R,children:de}),e[70]=R,e[71]=de,e[72]=Ce):Ce=e[72],Ce}const Ee=`Commerce Discovery is being prepared for ${W.value}.`;let ie;e[73]!==Ee?(ie=t.jsx(J,{title:"Commerce diagnostics",description:Ee}),e[73]=Ee,e[74]=ie):ie=e[74];let oe;e[75]!==I||e[76]!==u||e[77]!==w||e[78]!==l?(oe=u?t.jsxs(t.Fragment,{children:[t.jsx(Ne,{message:u}),t.jsx(Re,{siteUrl:l,error:null,isSubmitting:w.isPending,onSiteUrlChange:d,onSubmit:I})]}):t.jsx(we,{variant:"setup"}),e[75]=I,e[76]=u,e[77]=w,e[78]=l,e[79]=oe):oe=e[79];let re;e[80]!==ie||e[81]!==oe||e[82]!==ee?(re=t.jsxs("div",{ref:ee,className:"grid gap-10",children:[ie,oe]}),e[80]=ie,e[81]=oe,e[82]=ee,e[83]=re):re=e[83];let be;return e[84]!==R||e[85]!==re?(be=t.jsx(Q,{visual:R,children:re}),e[84]=R,e[85]=re,e[86]=be):be=e[86],be}const Te=`Commerce setup will continue for ${n.name}.`;let te;e[87]!==Te?(te=t.jsx(J,{title:"Commerce diagnostics",description:Te}),e[87]=Te,e[88]=te):te=e[88];let ne;e[89]!==I||e[90]!==u||e[91]!==w.isPending||e[92]!==l?(ne=t.jsx(Re,{siteUrl:l,error:u,isSubmitting:w.isPending,onSiteUrlChange:d,onSubmit:I}),e[89]=I,e[90]=u,e[91]=w.isPending,e[92]=l,e[93]=ne):ne=e[93];let se;e[94]!==te||e[95]!==ne?(se=t.jsxs("div",{className:"grid gap-10",children:[te,ne]}),e[94]=te,e[95]=ne,e[96]=se):se=e[96];let je;return e[97]!==R||e[98]!==se?(je=t.jsx(Q,{visual:R,children:se}),e[97]=R,e[98]=se,e[99]=je):je=e[99],je}function Re(s){const e=E.c(22),{siteUrl:n,error:i,isSubmitting:o,onSiteUrlChange:c,onSubmit:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=a):a=e[0];let l;e[1]!==c?(l=y=>c(y.target.value),e[1]=c,e[2]=l):l=e[2];const d=!!i;let f;e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==d?(f=t.jsx(Ke,{id:"commerce-site-url",type:"text",inputMode:"url",value:n,onChange:l,placeholder:"https://example.com","aria-invalid":d,disabled:o}),e[3]=o,e[4]=n,e[5]=l,e[6]=d,e[7]=f):f=e[7];let p;e[8]!==i?(p=i?t.jsx(Ne,{message:i}):null,e[8]=i,e[9]=p):p=e[9];let u;e[10]!==f||e[11]!==p?(u=t.jsxs("div",{className:"grid gap-2",children:[a,f,p]}),e[10]=f,e[11]=p,e[12]=u):u=e[12];let x;e[13]!==o?(x=o?t.jsx(Zn,{}):t.jsxs(t.Fragment,{children:["Continue",t.jsx(it,{size:16})]}),e[13]=o,e[14]=x):x=e[14];let g;e[15]!==o||e[16]!==x?(g=t.jsx(V,{type:"submit",size:"xl",className:"w-full",disabled:o,children:x}),e[15]=o,e[16]=x,e[17]=g):g=e[17];let j;return e[18]!==r||e[19]!==u||e[20]!==g?(j=t.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[u,g]}),e[18]=r,e[19]=u,e[20]=g,e[21]=j):j=e[21],j}function as(s){const e=E.c(20),{org:n,reportApp:i,onOpenReport:o,meetingUrl:c,meetingVisual:r,siteUrl:a}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(J,{}),e[0]=l):l=e[0];let d;e[1]!==n||e[2]!==i.connectionId||e[3]!==a?(d=t.jsx(Vn,{org:n,cdConnectionId:i.connectionId,siteUrl:a}),e[1]=n,e[2]=i.connectionId,e[3]=a,e[4]=d):d=e[4];let f;e[5]!==c?(f=t.jsx(Wn,{className:"md:hidden",href:c}),e[5]=c,e[6]=f):f=e[6];const p=!i.virtualMcpId;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(it,{size:18}),e[7]=u):u=e[7];let x;e[8]!==o||e[9]!==p?(x=t.jsxs(V,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:p,children:["See full report",u]}),e[8]=o,e[9]=p,e[10]=x):x=e[10];let g;e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[f,x]}),e[11]=f,e[12]=x,e[13]=g):g=e[13];let j;e[14]!==d||e[15]!==g?(j=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[l,d,g]}),e[14]=d,e[15]=g,e[16]=j):j=e[16];let y;return e[17]!==r||e[18]!==j?(y=t.jsx(Q,{align:"fill",visual:r,children:j}),e[17]=r,e[18]=j,e[19]=y):y=e[19],y}function Ne(s){const e=E.c(2),{message:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:n}),e[0]=n,e[1]=i):i=e[1],i}export{xi as default};
@@ -1 +1 @@
1
- import{c as b,C as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-CZQAHCWx.js";import{d as I,e as S,c as E,b as R,a as D}from"./dialog-DGm31nBN.js";import{S as _}from"./chat-context-DueHVvJY.js";import{i as $}from"./ChevronUp-hzSQl57_.js";import{a as A}from"./Eye-Du8USWUC.js";import{u as B}from"./studio-tools-DCyngkzJ.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=k(),l=B();let o;i[0]!==e.id?(o=w.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",N=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return N.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(E,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:N.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(R,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(D,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
1
+ import{c as b,C as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-BUS-a-tW.js";import{d as I,e as S,c as E,b as R,a as D}from"./dialog-lbyUpqPt.js";import{S as _}from"./chat-context-2a9Unx31.js";import{i as $}from"./ChevronUp-5yVty_-J.js";import{a as A}from"./Eye-CVnhloDi.js";import{u as B}from"./studio-tools-BO3QwsEE.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=k(),l=B();let o;i[0]!==e.id?(o=w.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",N=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return N.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(E,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:N.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(R,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(D,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};