decocms 4.349.0 → 4.350.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 (283) hide show
  1. package/dist/client/assets/{AlertCircle-wAnOHADS.js → AlertCircle-BMk6q2FA.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Dq_zvJWZ.js → AreaChart-BLsqA7uB.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-YvJ2QXtl.js → ArrowLeft-CBdaifdY.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-jfYfDxSI.js → ArrowRight-k7OlY3ZV.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BlmUVKW6.js → ArrowUp-BrUqWSUA.js} +1 -1
  6. package/dist/client/assets/{Check-DwFkAzIE.js → Check-BRo4TcYL.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-C2nq7B8n.js → CheckCircle-ByifJ5DN.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-D2_fST_t.js → ChevronRight-CL-1AW54.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-CgTde0Q8.js → ChevronSelectorVertical-D89G1wQX.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-DNGcpflk.js → ChevronUp-DRrtPFPU.js} +1 -1
  11. package/dist/client/assets/{Copy01-DBOM13CL.js → Copy01-Cz84dNWo.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-DGxkfyx2.js → CreditCard01-16ccuHl7.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-Cz4ekipb.js → DotsVertical-CUeujFxe.js} +1 -1
  14. package/dist/client/assets/{Download01-u2kBF-xv.js → Download01-BY5nFlV8.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-D5oMYtXY.js → ErrorBarContext-laRz9pMB.js} +1 -1
  16. package/dist/client/assets/{Eye-rOw56pjM.js → Eye-DSfFTZ0l.js} +1 -1
  17. package/dist/client/assets/{GitBranch01-CEsq5yX5.js → GitBranch01-CzoRmimO.js} +1 -1
  18. package/dist/client/assets/{Globe01-CivtgibE.js → Globe01-DhXQEmKy.js} +1 -1
  19. package/dist/client/assets/{HardDrive-C2GoE6qs.js → HardDrive-Dz1jdiPQ.js} +1 -1
  20. package/dist/client/assets/{Image01-DBbKbwbi.js → Image01-ChEQz8oh.js} +1 -1
  21. package/dist/client/assets/{Key01-BSosoP95.js → Key01-BOmG8BKE.js} +1 -1
  22. package/dist/client/assets/{Link01-MZ7GmZHO.js → Link01-DkfXBBhQ.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-73pMIgKV.js → LinkExternal01-CbmJH8Oa.js} +1 -1
  24. package/dist/client/assets/{Monitor01-oRlaapId.js → Monitor01-D0BOdaeR.js} +1 -1
  25. package/dist/client/assets/{Package-BYp5l2E5.js → Package-BtdRPN0k.js} +1 -1
  26. package/dist/client/assets/{Palette-8I2sDSog.js → Palette-D3howidE.js} +1 -1
  27. package/dist/client/assets/{Play-B225dlHd.js → Play-BRZZbBP9.js} +1 -1
  28. package/dist/client/assets/{Plus-BDOjM-y2.js → Plus-CHPz10Kd.js} +1 -1
  29. package/dist/client/assets/SearchLg-B8u5Z_-p.js +1 -0
  30. package/dist/client/assets/{SearchMd-BnqlK6CF.js → SearchMd-BfOW0ihr.js} +1 -1
  31. package/dist/client/assets/{Sector-BabrLhPj.js → Sector-C7O4njZA.js} +1 -1
  32. package/dist/client/assets/{Settings02-CrEluPTC.js → Settings02-5Mu_nYD8.js} +1 -1
  33. package/dist/client/assets/{Share07-Nzkr8YZ2.js → Share07-B8Aw6CDi.js} +1 -1
  34. package/dist/client/assets/{Shield01-B_JxVlrS.js → Shield01-BCG_3DYj.js} +1 -1
  35. package/dist/client/assets/{Stars01-mzby3j_o.js → Stars01-foIfuOVN.js} +1 -1
  36. package/dist/client/assets/{Sun-CCLPxWiv.js → Sun-BzWxkbN5.js} +1 -1
  37. package/dist/client/assets/{Tool01-V0KS9Hy0.js → Tool01-BEvJ_YW1.js} +1 -1
  38. package/dist/client/assets/{Tool02-BgHxw_wF.js → Tool02-BJ6DrdG_.js} +1 -1
  39. package/dist/client/assets/{Trash01-DXMXjB5D.js → Trash01-BV_RW_ot.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-ACczpA6C.js → TrendUp01-BQU61XVU.js} +1 -1
  41. package/dist/client/assets/{Upload01-CeJJDeve.js → Upload01-CzJgAWQf.js} +1 -1
  42. package/dist/client/assets/{User01-D2exKDPK.js → User01-BYo154It.js} +1 -1
  43. package/dist/client/assets/{UserSquare-CXfPKP7D.js → UserSquare-B8muuAeC.js} +1 -1
  44. package/dist/client/assets/{Users01-Bab7B5hF.js → Users01-CCJxFqcF.js} +1 -1
  45. package/dist/client/assets/{Users03-DmY-Asfu.js → Users03-B3GcmkAW.js} +1 -1
  46. package/dist/client/assets/{XCircle-C5opwPs7.js → XCircle-B00jwioD.js} +1 -1
  47. package/dist/client/assets/{XClose-CpE_1sco.js → XClose-BSY1lYTG.js} +1 -1
  48. package/dist/client/assets/{Zap-CNl7K3Ps.js → Zap-u6tF2K1C.js} +1 -1
  49. package/dist/client/assets/{ZoomOut-Dmwkd0k-.js → ZoomOut-GAT73I28.js} +1 -1
  50. package/dist/client/assets/{access-gate-BPOiq9_Z.js → access-gate-BUfTolQd.js} +1 -1
  51. package/dist/client/assets/agent-icon-CaI0ggpq.js +1 -0
  52. package/dist/client/assets/agents-list-DLUa5_h5.js +1 -0
  53. package/dist/client/assets/{ai-providers-DScFIfeX.js → ai-providers-CpT_7AV2.js} +1 -1
  54. package/dist/client/assets/{alert-BwZUlKp-.js → alert-BG7MpKMj.js} +1 -1
  55. package/dist/client/assets/{alert-dialog-BWLIdDXs.js → alert-dialog-BJoAnvTa.js} +1 -1
  56. package/dist/client/assets/analytics-tab-CVYQKeUX.js +2 -0
  57. package/dist/client/assets/{api-keys-DyU_J5NW.js → api-keys-C1X3ZED1.js} +1 -1
  58. package/dist/client/assets/api-keys-CgATwrHZ.js +1 -0
  59. package/dist/client/assets/app-editor-CLUQ5UuG.js +1 -0
  60. package/dist/client/assets/{auth-BwvYRMCE.js → auth-DrTXT3NH.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-DtyaVjmG.js → auth-catchall--kEE8BrW.js} +1 -1
  62. package/dist/client/assets/{auth-entry-qj9kdQ0Z.js → auth-entry-Bypdb_OP.js} +1 -1
  63. package/dist/client/assets/{auth-split-layout-C34qWW6w.js → auth-split-layout-C9p5qokp.js} +1 -1
  64. package/dist/client/assets/{authenticate-and-persist-oauth-2hJV8I4L.js → authenticate-and-persist-oauth-BSOO7-Ru.js} +1 -1
  65. package/dist/client/assets/{automation-list-row-CnQFh_fA.js → automation-list-row-CUdrE7CI.js} +1 -1
  66. package/dist/client/assets/{automation-runs-BSJ95uvS.js → automation-runs-staCAMV3.js} +1 -1
  67. package/dist/client/assets/automations-BblO5Bed.js +1 -0
  68. package/dist/client/assets/{autosend-CgQ58D3w.js → autosend-BLWBLlQp.js} +1 -1
  69. package/dist/client/assets/{avatar-a5vmNlMH.js → avatar-8wWRKAWW.js} +1 -1
  70. package/dist/client/assets/{badge-BviUmQbh.js → badge-Dc8kcV5t.js} +1 -1
  71. package/dist/client/assets/{block-document-BGMqKnaG.js → block-document-0d7k0rKQ.js} +1 -1
  72. package/dist/client/assets/{breadcrumb-CQcXrrpt.js → breadcrumb-DTve-fNU.js} +1 -1
  73. package/dist/client/assets/{buckets-CdS9lWJh.js → buckets-Bgjegid2.js} +1 -1
  74. package/dist/client/assets/{bulk-category-panel-Cx3l3JOs.js → bulk-category-panel-BXxBWLb6.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-a_I2a1l9.js → capability-load-error-Bt-0_xjM.js} +1 -1
  76. package/dist/client/assets/{cards-DIV1xWcp.js → cards-C2rTb-Sr.js} +1 -1
  77. package/dist/client/assets/category-editor-DTJMv5Az.js +1 -0
  78. package/dist/client/assets/{cdn-tab-Bd_jP2Zf.js → cdn-tab-DKXQ2vhA.js} +1 -1
  79. package/dist/client/assets/{chart-BFgm1SUy.js → chart-DmKqaSZG.js} +1 -1
  80. package/dist/client/assets/{chat-context-CKaeqWM1.js → chat-context-C48t2Pu7.js} +1 -1
  81. package/dist/client/assets/{checkbox-gsIYGPP6.js → checkbox-CNie4rus.js} +1 -1
  82. package/dist/client/assets/choose-editor-De8eese3.js +1 -0
  83. package/dist/client/assets/{cli-auth-success-rTveabK4.js → cli-auth-success-2KTVF2ia.js} +1 -1
  84. package/dist/client/assets/{client-icons-Ko4eYYhG.js → client-icons-DJ5EKjKX.js} +1 -1
  85. package/dist/client/assets/collection-detail-CIWvltBQ.js +1 -0
  86. package/dist/client/assets/{collection-display-button-COQNanaO.js → collection-display-button-CueahYcm.js} +1 -1
  87. package/dist/client/assets/{collection-search-By0xSdXh.js → collection-search-C-vZtduC.js} +1 -1
  88. package/dist/client/assets/{collection-table-wrapper-B3K9e_Rh.js → collection-table-wrapper-BapDNTsG.js} +1 -1
  89. package/dist/client/assets/{collection-tabs-CCFM8E8R.js → collection-tabs-BnDECkbQ.js} +1 -1
  90. package/dist/client/assets/{command-D1-Cphh8.js → command-Dodm-w8K.js} +1 -1
  91. package/dist/client/assets/commerce-onboarding-DXMBUTDz.js +1 -0
  92. package/dist/client/assets/{connect-CeQER2FM.js → connect-j2mlrPiR.js} +1 -1
  93. package/dist/client/assets/{connect-layout-BXqqP8fB.js → connect-layout-DiecLu9A.js} +1 -1
  94. package/dist/client/assets/{connection-DWNio8Hi.js → connection-BT2Nvm5b.js} +1 -1
  95. package/dist/client/assets/{connection-card-CP_282IY.js → connection-card-DoxPiAfH.js} +1 -1
  96. package/dist/client/assets/connection-detail-DV4_FKFy.js +1 -0
  97. package/dist/client/assets/{connection-form-helpers-DSgbsNsY.js → connection-form-helpers-422OHKLl.js} +1 -1
  98. package/dist/client/assets/connections-CRaA-93j.js +1 -0
  99. package/dist/client/assets/{create-organization-dialog-Zv-z5MlI.js → create-organization-dialog-D8vhxdyz.js} +1 -1
  100. package/dist/client/assets/{decopilot-sse-pool-Carp4gPN.js → decopilot-sse-pool-CC8xuhpc.js} +1 -1
  101. package/dist/client/assets/{dialog-BQdaXz76.js → dialog-Cz0TyjbB.js} +1 -1
  102. package/dist/client/assets/{domain-settings-Dqs6hLvO.js → domain-settings-4DGH3ghA.js} +1 -1
  103. package/dist/client/assets/{drawer-B_XZjJKQ.js → drawer-BJF-pfh2.js} +1 -1
  104. package/dist/client/assets/{dropdown-menu-CHDCkiCh.js → dropdown-menu-BNXoL43E.js} +1 -1
  105. package/dist/client/assets/e2e-tab-Cn2FXk4V.js +1 -0
  106. package/dist/client/assets/{editor-fOvQUP8H.js → editor-COagHbmc.js} +1 -1
  107. package/dist/client/assets/{empty-state-jHV8lblj.js → empty-state-BcShOK8y.js} +1 -1
  108. package/dist/client/assets/{empty-state-A2iC04qV.js → empty-state-R3Gf1cup.js} +1 -1
  109. package/dist/client/assets/{extract-connection-data-CF8SetmF.js → extract-connection-data-WnP-t00f.js} +1 -1
  110. package/dist/client/assets/file-explorer-DoJ3JAGu.js +2 -0
  111. package/dist/client/assets/{file-type-icon-Bc7yMTP-.js → file-type-icon-CkFKND12.js} +1 -1
  112. package/dist/client/assets/{folder-icon-D8EtDac5.js → folder-icon-B_G8NPBM.js} +1 -1
  113. package/dist/client/assets/{form-Ce74eqVN.js → form-BI8lXaWf.js} +1 -1
  114. package/dist/client/assets/general-DpFlP6Mv.js +1 -0
  115. package/dist/client/assets/{github-icon-BlqVDyFM.js → github-icon-Bh8cYN11.js} +1 -1
  116. package/dist/client/assets/{hooks-CL4RZ5Ud.js → hooks-DQxSpV5B.js} +1 -1
  117. package/dist/client/assets/hosting-tab-c114uUEI.js +1 -0
  118. package/dist/client/assets/{index-DLWopY4T.js → index-B4q20JqK.js} +1 -1
  119. package/dist/client/assets/{index-CIOibnVd.js → index-BPQ0yfn_.js} +1 -1
  120. package/dist/client/assets/{index-Y1NuoQwX.js → index-BQndpmm6.js} +2 -2
  121. package/dist/client/assets/index-Bsw_h-fN.js +1 -0
  122. package/dist/client/assets/{index-BU_G2Qj2.js → index-CHwEdqc6.js} +1 -1
  123. package/dist/client/assets/{index-Cyf2Yshe.js → index-CS7wGNbF.js} +1 -1
  124. package/dist/client/assets/{index-B3MtcQ-S.js → index-D7c3ENS3.js} +1 -1
  125. package/dist/client/assets/{index-DSJbN5sX.js → index-DJQUO_5F.js} +4 -4
  126. package/dist/client/assets/{index-CaO2GsnM.js → index-DUxHsoB3.js} +1 -1
  127. package/dist/client/assets/{index-DAXFi2r2.js → index-DfKKmgLE.js} +60 -60
  128. package/dist/client/assets/{index-BxcRoQ2q.js → index-SlLtg_R2.js} +1 -1
  129. package/dist/client/assets/{index-redirect-B-_cQzRP.js → index-redirect-CMnNA3cO.js} +1 -1
  130. package/dist/client/assets/{infiniteQueryObserver-DaPsoYS0.js → infiniteQueryObserver-Dz5k81cL.js} +1 -1
  131. package/dist/client/assets/{infra-billing-rrJDtaqC.js → infra-billing-38iVSWLx.js} +1 -1
  132. package/dist/client/assets/{input-DkSSz62S.js → input-DAq8Cogd.js} +1 -1
  133. package/dist/client/assets/{integration-icon-Dv6YqP4z.js → integration-icon-eQHWUfyl.js} +1 -1
  134. package/dist/client/assets/{invite-member-dialog-Dh3hE-hQ.js → invite-member-dialog-BOj3Gkcq.js} +1 -1
  135. package/dist/client/assets/{label-Bl_k8voC.js → label-C5IuR8oP.js} +1 -1
  136. package/dist/client/assets/{layout-CyHJ3xkT.js → layout-BpEmheyC.js} +1 -1
  137. package/dist/client/assets/{login-tjBobSBC.js → login-DUbU__Dn.js} +1 -1
  138. package/dist/client/assets/{markdown-BiPxNCWQ.js → markdown-gi_MNGvw.js} +1 -1
  139. package/dist/client/assets/{mcp-app-renderer-tgQv33M8.js → mcp-app-renderer-DAhokX0e.js} +1 -1
  140. package/dist/client/assets/{mcp-oauth-BWuSz_1R.js → mcp-oauth-H1nDAtgI.js} +1 -1
  141. package/dist/client/assets/{members-CGAWYRvn.js → members-DjEJdLt1.js} +1 -1
  142. package/dist/client/assets/{monaco-editor-CwveTNZd.js → monaco-editor-s5nxaT6J.js} +1 -1
  143. package/dist/client/assets/{monitoring-stats-row-DYNw4sWT.js → monitoring-stats-row-CaLy4Ryh.js} +1 -1
  144. package/dist/client/assets/{multi-select-DcnZGXL3.js → multi-select-CFqy5bas.js} +1 -1
  145. package/dist/client/assets/{oauth-callback-ChyUx-wX.js → oauth-callback-Jvfg7sIW.js} +1 -1
  146. package/dist/client/assets/{oauth-callback-ai-provider-DpWNSNTg.js → oauth-callback-ai-provider-D5EPLu-K.js} +1 -1
  147. package/dist/client/assets/{onboarding-BItv72fR.js → onboarding-Zr_p1vAb.js} +1 -1
  148. package/dist/client/assets/org-layout-C9lwccdN.js +1 -0
  149. package/dist/client/assets/{organization-choice-OLuLEbMC.js → organization-choice-CTABkZvs.js} +1 -1
  150. package/dist/client/assets/{orgs-Cp6ykCbx.js → orgs-Do50-Jd8.js} +1 -1
  151. package/dist/client/assets/{page-seo-form-DTl7I7qo.js → page-seo-form-B97SOeU5.js} +1 -1
  152. package/dist/client/assets/{popover-CZSG5n66.js → popover-CRp4G2Z6.js} +1 -1
  153. package/dist/client/assets/post-calendar-DPPABLzV.js +1 -0
  154. package/dist/client/assets/post-editor-DSvtP40e.js +1 -0
  155. package/dist/client/assets/{primitives-DYG4k0xC.js → primitives-C7BIiVVo.js} +1 -1
  156. package/dist/client/assets/{profile-BL_S0Oj8.js → profile-BLTCJe7b.js} +1 -1
  157. package/dist/client/assets/project-app-view-Blu2IsZ3.js +1 -0
  158. package/dist/client/assets/{project-icon-Bnqg1Jiw.js → project-icon-sXGV0X2Q.js} +1 -1
  159. package/dist/client/assets/{prompts-DFOwgpeL.js → prompts-3ZqIJFDd.js} +1 -1
  160. package/dist/client/assets/record-editor-CsxPBrFI.js +1 -0
  161. package/dist/client/assets/redirect-editor-Br7pXUqD.js +1 -0
  162. package/dist/client/assets/registry-BOCis5ep.js +2 -0
  163. package/dist/client/assets/{registry-layout-B13x9GkT.js → registry-layout-ED4OGMt2.js} +1 -1
  164. package/dist/client/assets/{reports-DGJOSuVv.js → reports-BdX-p26G.js} +2 -2
  165. package/dist/client/assets/{repositories-C64lR4UL.js → repositories-uAK6PGQO.js} +1 -1
  166. package/dist/client/assets/{repository-import-picker-QtGWdk96.js → repository-import-picker-BOqZjy75.js} +1 -1
  167. package/dist/client/assets/{repository-picker-CBC3P8G3.js → repository-picker-Dg2kea9_.js} +1 -1
  168. package/dist/client/assets/{require-capability-0WTmgba3.js → require-capability-DZaP9GRG.js} +1 -1
  169. package/dist/client/assets/{required-auth-layout-Cr1TIX0a.js → required-auth-layout-BeMcQPLp.js} +1 -1
  170. package/dist/client/assets/{reset-password-CYQPyQkK.js → reset-password-HtxIFDKb.js} +1 -1
  171. package/dist/client/assets/review-settings-D7iT6mdL.js +1 -0
  172. package/dist/client/assets/roles-BoykZStL.js +1 -0
  173. package/dist/client/assets/{schema-CVuODHYG.js → schema-CXWi7OUE.js} +1 -1
  174. package/dist/client/assets/{scroll-area-DntxxD7t.js → scroll-area-DIILjYAD.js} +1 -1
  175. package/dist/client/assets/{search-input-Ey5tt0Lo.js → search-input-BnJ22pqo.js} +1 -1
  176. package/dist/client/assets/{secrets-nVT5_liB.js → secrets-Be4aGdkk.js} +1 -1
  177. package/dist/client/assets/{sections-editor-B5CjhP0e.js → sections-editor-BQDRzdu2.js} +2 -2
  178. package/dist/client/assets/{select-model-bI_cxMDh.js → select-model-BS741VWv.js} +1 -1
  179. package/dist/client/assets/{select-qa0gsZOA.js → select-zsrd2RiW.js} +1 -1
  180. package/dist/client/assets/{self-tool-result-aFpcyvJC.js → self-tool-result-UHlGJAZm.js} +1 -1
  181. package/dist/client/assets/seo-editor-B4chp4Nv.js +1 -0
  182. package/dist/client/assets/settings-layout-DdFAcCKC.js +1 -0
  183. package/dist/client/assets/{settings-sidebar-BoSdeW5u.js → settings-sidebar-qKQ2rd4i.js} +1 -1
  184. package/dist/client/assets/{shell-controls-BrqFXMTD.js → shell-controls-DwOzdtxQ.js} +1 -1
  185. package/dist/client/assets/shell-layout-D38a2ilI.js +1 -0
  186. package/dist/client/assets/{skill-preview-sGMxy1K8.js → skill-preview-BH1OTEDh.js} +1 -1
  187. package/dist/client/assets/{skills-Ch-H6to9.js → skills-B9ZpA0KI.js} +1 -1
  188. package/dist/client/assets/{sso-CaxDXykW.js → sso-DIok2qyj.js} +1 -1
  189. package/dist/client/assets/{store-Bh6c_ok8.js → store-BnWD-sX4.js} +1 -1
  190. package/dist/client/assets/store-registry-Bs_SblgK.js +2 -0
  191. package/dist/client/assets/{switch-D38yrWy1.js → switch-wRuzhZCP.js} +1 -1
  192. package/dist/client/assets/{synced-repos-DQoDFlhE.js → synced-repos-BK1T5QWT.js} +1 -1
  193. package/dist/client/assets/{table-8P8-CnP6.js → table-DMgVyVQS.js} +1 -1
  194. package/dist/client/assets/{tabs-Bwfyb1Oq.js → tabs-C9rYvTFN.js} +1 -1
  195. package/dist/client/assets/{task-board-CeYV0m1B.js → task-board-D0cF49Rr.js} +1 -1
  196. package/dist/client/assets/{task-route-TTh3aO1v.js → task-route-Dyvp3vwK.js} +1 -1
  197. package/dist/client/assets/tasks-DssW8rYC.js +1 -0
  198. package/dist/client/assets/{textarea-D7q7zgt-.js → textarea-NYvkjUAn.js} +1 -1
  199. package/dist/client/assets/{thread-intent-I39tMt_g.js → thread-intent-CgKd5Wx-.js} +1 -1
  200. package/dist/client/assets/{thread-route-CZiD4-sf.js → thread-route-BgI1RAgC.js} +1 -1
  201. package/dist/client/assets/{toggle-group-DJyuyR_U.js → toggle-group-It3hRo8l.js} +1 -1
  202. package/dist/client/assets/{toolbar-C1PA0ETD.js → toolbar-SMhPqa2y.js} +1 -1
  203. package/dist/client/assets/{toolbar-icon-button-Dk-vpF8A.js → toolbar-icon-button-C4gmxVIe.js} +1 -1
  204. package/dist/client/assets/{track-EzTLxDrw.js → track-ByEKyB4m.js} +1 -1
  205. package/dist/client/assets/{types-BXOVDPwd.js → types-DRS7wX8l.js} +1 -1
  206. package/dist/client/assets/{use-ai-providers-BXegGRFX.js → use-ai-providers-Mptwa2nu.js} +1 -1
  207. package/dist/client/assets/{use-automations-qIak6DkB.js → use-automations-xybTlCwA.js} +1 -1
  208. package/dist/client/assets/{use-autosave-B4nxcOu-.js → use-autosave-DKENIaWw.js} +1 -1
  209. package/dist/client/assets/{use-connection-BjftRlxd.js → use-connection-Cj6jhInv.js} +1 -1
  210. package/dist/client/assets/{use-copy-DDzC9hsq.js → use-copy-PCW_eaa6.js} +1 -1
  211. package/dist/client/assets/{use-create-virtual-mcp-Bkm-Wzsa.js → use-create-virtual-mcp-2La6_4nW.js} +1 -1
  212. package/dist/client/assets/{use-date-fns-locale-BUydyvvo.js → use-date-fns-locale-DFrNlcdk.js} +1 -1
  213. package/dist/client/assets/{use-debounced-autosave-C4Aw-mEx.js → use-debounced-autosave-CyQ6phI-.js} +1 -1
  214. package/dist/client/assets/{use-debounced-value-BmfpPcXL.js → use-debounced-value-DTG_WVYT.js} +1 -1
  215. package/dist/client/assets/{use-decopilot-events-BTkjtbaI.js → use-decopilot-events-DnaHPSLF.js} +1 -1
  216. package/dist/client/assets/{use-delete-connection-DKzVOOE_.js → use-delete-connection-8l-RyDdH.js} +1 -1
  217. package/dist/client/assets/{use-deployment-admin-jcToUXO_.js → use-deployment-admin-CShZ060R.js} +1 -1
  218. package/dist/client/assets/{use-destination-route-BpG33_Rz.js → use-destination-route-BS5_9jNo.js} +1 -1
  219. package/dist/client/assets/{use-file-configs-Brm2navQ.js → use-file-configs-BvqhugH-.js} +1 -1
  220. package/dist/client/assets/{use-infinite-scroll-CJikc9M7.js → use-infinite-scroll-DU0M3enW.js} +1 -1
  221. package/dist/client/assets/{use-join-requests-d0yhjihP.js → use-join-requests-lrCf0PQt.js} +1 -1
  222. package/dist/client/assets/{use-mcp-auth-status-BjyYQV9T.js → use-mcp-auth-status-CM0X2Q6P.js} +1 -1
  223. package/dist/client/assets/{use-mcp-client-ugccnX7P.js → use-mcp-client-DOjgXsoM.js} +1 -1
  224. package/dist/client/assets/{use-mcp-prompts-3syEb3Y2.js → use-mcp-prompts-BKEcBOIJ.js} +1 -1
  225. package/dist/client/assets/{use-mcp-tools-J0fpFbFP.js → use-mcp-tools-Bjz_51W4.js} +1 -1
  226. package/dist/client/assets/{use-members-B-dwONVd.js → use-members-BB7OB8zH.js} +1 -1
  227. package/dist/client/assets/{use-navigate-to-agent-DZRUz-6p.js → use-navigate-to-agent-BX5Ov16Z.js} +1 -1
  228. package/dist/client/assets/{use-org-auth-client-C-qSuLQa.js → use-org-auth-client-Dv5ggRPD.js} +1 -1
  229. package/dist/client/assets/{use-org-notice-DeJ9SvBl.js → use-org-notice-Bb3hmM0X.js} +1 -1
  230. package/dist/client/assets/{use-org-sso-CojWQZss.js → use-org-sso-qVsnd7nU.js} +1 -1
  231. package/dist/client/assets/{use-organization-roles-0b8Hgh-v.js → use-organization-roles-c807ZNwQ.js} +1 -1
  232. package/dist/client/assets/{use-organization-settings-DQ5NNlS_.js → use-organization-settings-Duntu8dc.js} +1 -1
  233. package/dist/client/assets/{use-panel-navigate-29aw_nLh.js → use-panel-navigate-lJXqYoE8.js} +1 -1
  234. package/dist/client/assets/{use-registry-connections-CGm4tLfp.js → use-registry-connections-Q445kfkp.js} +1 -1
  235. package/dist/client/assets/{use-secrets-CA0m3B3l.js → use-secrets-D_yQvvYk.js} +1 -1
  236. package/dist/client/assets/{use-section-preview-base-Ch8Y1NGA.js → use-section-preview-base-CQBGEP31.js} +1 -1
  237. package/dist/client/assets/{use-status-sounds-DHEUPIVm.js → use-status-sounds-Dg3N4ijY.js} +1 -1
  238. package/dist/client/assets/{use-tags-DB-qMcQS.js → use-tags-D9wANkyQ.js} +1 -1
  239. package/dist/client/assets/{use-view-mode-ZZVonhYK.js → use-view-mode-D37EDMuR.js} +1 -1
  240. package/dist/client/assets/{use-virtual-mcp-BMf2s6FM.js → use-virtual-mcp-9JWM1UZv.js} +1 -1
  241. package/dist/client/assets/useInfiniteQuery-BCgs6-zI.js +1 -0
  242. package/dist/client/assets/useSuspenseInfiniteQuery-BFXkdPJm.js +1 -0
  243. package/dist/client/assets/{users-DrZOzqRu.js → users-D6I_Ulcy.js} +1 -1
  244. package/dist/client/assets/variant-calendar-OloQMR7L.js +1 -0
  245. package/dist/client/assets/{view-mode-toggle-DfEeq_gd.js → view-mode-toggle-DUf-vSHP.js} +1 -1
  246. package/dist/client/index.html +1 -1
  247. package/dist/server/cli.js +1 -1
  248. package/dist/server/server.js +1 -1
  249. package/package.json +1 -1
  250. package/dist/client/assets/agent-icon-1_qqvbMi.js +0 -1
  251. package/dist/client/assets/agents-list-CfgVQim3.js +0 -1
  252. package/dist/client/assets/analytics-tab-C65Aae2r.js +0 -2
  253. package/dist/client/assets/api-keys-BpHvnsmm.js +0 -1
  254. package/dist/client/assets/app-editor-2m-NCQXX.js +0 -1
  255. package/dist/client/assets/automations-D1uC4yRj.js +0 -1
  256. package/dist/client/assets/category-editor-J1n7bOBC.js +0 -1
  257. package/dist/client/assets/choose-editor-aUUIJkHw.js +0 -1
  258. package/dist/client/assets/collection-detail-DL65LQ9O.js +0 -1
  259. package/dist/client/assets/commerce-onboarding-BWAkUJy9.js +0 -1
  260. package/dist/client/assets/connection-detail-BbOjZfNc.js +0 -1
  261. package/dist/client/assets/connections-DKGl61eY.js +0 -1
  262. package/dist/client/assets/e2e-tab-CE7xe68I.js +0 -1
  263. package/dist/client/assets/file-explorer-CjEteFA8.js +0 -2
  264. package/dist/client/assets/general-CiUjH8d0.js +0 -1
  265. package/dist/client/assets/hosting-tab-BAx77ltM.js +0 -1
  266. package/dist/client/assets/index-okx82rpV.js +0 -1
  267. package/dist/client/assets/org-layout-COCa_ev2.js +0 -1
  268. package/dist/client/assets/post-calendar-z7z3W5rN.js +0 -1
  269. package/dist/client/assets/post-editor-C97Ma5Hq.js +0 -1
  270. package/dist/client/assets/project-app-view-Bo47ktDE.js +0 -1
  271. package/dist/client/assets/record-editor-DMgORvYp.js +0 -1
  272. package/dist/client/assets/redirect-editor-CqngHhC_.js +0 -1
  273. package/dist/client/assets/registry-DoZOHRQB.js +0 -2
  274. package/dist/client/assets/review-settings-CV6irCA9.js +0 -1
  275. package/dist/client/assets/roles-C26Un9-S.js +0 -1
  276. package/dist/client/assets/seo-editor-flCq5YRc.js +0 -1
  277. package/dist/client/assets/settings-layout-CTfh3D4U.js +0 -1
  278. package/dist/client/assets/shell-layout-DWU--wrz.js +0 -1
  279. package/dist/client/assets/store-registry--KEmGV8a.js +0 -2
  280. package/dist/client/assets/tasks-BJlG1V5T.js +0 -1
  281. package/dist/client/assets/useInfiniteQuery-C6DV2nJp.js +0 -1
  282. package/dist/client/assets/useSuspenseInfiniteQuery-D1KypCHs.js +0 -1
  283. package/dist/client/assets/variant-calendar-9BI4K-53.js +0 -1
@@ -1 +0,0 @@
1
- import{c as ue,b as pe,j as o,ab as Ae,B as le,b6 as Te,G as ge,a as we,n as Se,r as O,aR as Le,m as Ee,K as je,e as Fe,o as U,t as fe,l as ke,bd as Pe,P as de}from"./index-DSJbN5sX.js";import{a as ce,b as _e,D as he,c as xe}from"./dropdown-menu-CHDCkiCh.js";import{i as Ge}from"./GitBranch01-CEsq5yX5.js";import{b as Me}from"./Users03-DmY-Asfu.js";import{a as Oe,b as Re,c as ze}from"./use-virtual-mcp-BMf2s6FM.js";import{i as Ue}from"./DotsVertical-Cz4ekipb.js";import{a as Be}from"./Settings02-CrEluPTC.js";import{s as $e}from"./Trash01-DXMXjB5D.js";import{A as Ve,bc as He}from"./agent-icon-1_qqvbMi.js";import{u as Ke,f as Ce}from"./use-date-fns-locale-BUydyvvo.js";import{u as ve}from"./use-navigate-to-agent-DZRUz-6p.js";import{n as Qe}from"./use-organization-settings-DQ5NNlS_.js";import{E as qe}from"./empty-state-A2iC04qV.js";import{u as Ye}from"./use-create-virtual-mcp-Bkm-Wzsa.js";import{b as We,u as Je}from"./use-connection-BjftRlxd.js";import{W as Xe,u as be,S as Ze}from"./use-mcp-client-ugccnX7P.js";import{a as et}from"./authenticate-and-persist-oauth-2hJV8I4L.js";import{c as tt}from"./use-mcp-tools-J0fpFbFP.js";import{e as ot}from"./extract-connection-data-CF8SetmF.js";import{f as st,g as rt}from"./thread-intent-I39tMt_g.js";import{b as it,f as nt,a as lt,G as at,p as ct}from"./provision-repo-scoped-github-connection-WQFARyHG.js";import{D as mt,b as dt,c as ut,d as pt,e as gt}from"./dialog-BQdaXz76.js";import{i as ft}from"./ArrowLeft-YvJ2QXtl.js";import{C as ht}from"./collection-search-By0xSdXh.js";import{G as xt}from"./github-icon-BlqVDyFM.js";import{c as bt,d as jt,b as Ct,f as Dt,g as yt,e as wt,a as St,A as _t}from"./alert-dialog-BWLIdDXs.js";import{S as vt}from"./search-input-Ey5tt0Lo.js";import{s as De}from"./Plus-BDOjM-y2.js";import{R as Nt}from"./repository-import-picker-QtGWdk96.js";import{u as It}from"./use-debounced-value-BmfpPcXL.js";import"./Check-DwFkAzIE.js";import"./ChevronRight-D2_fST_t.js";import"./AlertCircle-wAnOHADS.js";import"./Tool01-V0KS9Hy0.js";import"./ArrowUp-BlmUVKW6.js";import"./Tool02-BgHxw_wF.js";import"./ArrowRight-jfYfDxSI.js";import"./TrendUp01-ACczpA6C.js";import"./ZoomOut-Dmwkd0k-.js";import"./CheckCircle-C2nq7B8n.js";import"./ChevronUp-DNGcpflk.js";import"./ChevronSelectorVertical-CgTde0Q8.js";import"./UserSquare-CXfPKP7D.js";import"./Copy01-DBOM13CL.js";import"./CreditCard01-DGxkfyx2.js";import"./Download01-u2kBF-xv.js";import"./Eye-rOw56pjM.js";import"./Share07-Nzkr8YZ2.js";import"./Globe01-CivtgibE.js";import"./XClose-CpE_1sco.js";import"./HardDrive-C2GoE6qs.js";import"./Image01-DBbKbwbi.js";import"./Key01-BSosoP95.js";import"./Link01-MZ7GmZHO.js";import"./LinkExternal01-73pMIgKV.js";import"./Monitor01-oRlaapId.js";import"./Sun-CCLPxWiv.js";import"./Package-BYp5l2E5.js";import"./Palette-8I2sDSog.js";import"./Play-B225dlHd.js";import"./SearchMd-BnqlK6CF.js";import"./Shield01-B_JxVlrS.js";import"./Stars01-mzby3j_o.js";import"./Upload01-CeJJDeve.js";import"./User01-D2exKDPK.js";import"./Users01-Bab7B5hF.js";import"./XCircle-C5opwPs7.js";import"./Zap-CNl7K3Ps.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-destination-route-BpG33_Rz.js";import"./hooks-CL4RZ5Ud.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-Carp4gPN.js";import"./task-board-CeYV0m1B.js";import"./schema-CVuODHYG.js";import"./github-repo-CTPv5ZM2.js";import"./auth-BwvYRMCE.js";import"./mcp-oauth-BWuSz_1R.js";import"./metadata-dUsYcpuu.js";import"./connection-DWNio8Hi.js";import"./slugify-CEUa2lfQ.js";import"./repository-picker-CBC3P8G3.js";import"./input-DkSSz62S.js";import"./label-Bl_k8voC.js";import"./useInfiniteQuery-C6DV2nJp.js";import"./infiniteQueryObserver-DaPsoYS0.js";import"./avatar-a5vmNlMH.js";function ye(t){const e=ue.c(26),{onCreateFromScratch:s,onImportGitHub:r,onImportDeco:n,isCreating:h,align:p,side:y,showBetaBadge:m,showDecoImport:b}=t,j=p===void 0?"end":p,u=pe();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Me,{size:14}),e[0]=g):g=e[0];let f;e[1]!==u?(f=u("common.createAgentDropdown.createFromScratch"),e[1]=u,e[2]=f):f=e[2];let x;e[3]!==h||e[4]!==s||e[5]!==f?(x=o.jsxs(ce,{disabled:h,onClick:s,children:[g,f]}),e[3]=h,e[4]=s,e[5]=f,e[6]=x):x=e[6];let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(Ge,{className:"size-3.5"}),e[7]=C):C=e[7];let c;e[8]!==u?(c=u("common.createAgentDropdown.importFromGitHub"),e[8]=u,e[9]=c):c=e[9];let l;e[10]!==m?(l=m&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=m,e[11]=l):l=e[11];let a;e[12]!==r||e[13]!==c||e[14]!==l?(a=o.jsxs(ce,{onClick:r,children:[C,c,l]}),e[12]=r,e[13]=c,e[14]=l,e[15]=a):a=e[15];let d;e[16]!==n||e[17]!==b||e[18]!==u?(d=b&&o.jsxs(ce,{onClick:n,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),u("common.createAgentDropdown.importFromDeco")]}),e[16]=n,e[17]=b,e[18]=u,e[19]=d):d=e[19];let D;return e[20]!==j||e[21]!==y||e[22]!==x||e[23]!==a||e[24]!==d?(D=o.jsxs(_e,{side:y,align:j,className:"w-48",children:[x,a,d]}),e[20]=j,e[21]=y,e[22]=x,e[23]=a,e[24]=d,e[25]=D):D=e[25],D}function At(t){const e=ue.c(50),{project:s,lastUsedAt:r,onDeleteClick:n}=t,h=ve(),p=pe(),y=Ke(),m=s.metadata?.ui?.layout;let b;e[0]!==m?(b=Ae(m),e[0]=m,e[1]=b):b=e[1];const j=b;let u;e[2]!==j||e[3]!==h||e[4]!==s.id?(u=()=>h(s.id,{panel:j}),e[2]=j,e[3]=h,e[4]=s.id,e[5]=u):u=e[5];let g;e[6]!==s.title||e[7]!==u?(g=o.jsx("button",{type:"button",onClick:u,className:"absolute inset-0 z-0","aria-label":s.title}),e[6]=s.title,e[7]=u,e[8]=g):g=e[8];let f;e[9]!==s.icon||e[10]!==s.title?(f=o.jsx(Ve,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[9]=s.icon,e[10]=s.title,e[11]=f):f=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(he,{asChild:!0,children:o.jsx(le,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Ue,{size:20})})}),e[12]=x):x=e[12];let C;e[13]!==h||e[14]!==s.id?(C=()=>h(s.id,{panel:"settings"}),e[13]=h,e[14]=s.id,e[15]=C):C=e[15];let c;e[16]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Be,{size:16}),e[16]=c):c=e[16];let l;e[17]!==C?(l=o.jsxs(ce,{onClick:C,children:[c,"Settings"]}),e[17]=C,e[18]=l):l=e[18];let a;e[19]!==n?(a=n&&o.jsxs(ce,{variant:"destructive",onClick:i=>{i.stopPropagation(),n(i)},children:[o.jsx($e,{size:16}),"Delete"]}),e[19]=n,e[20]=a):a=e[20];let d;e[21]!==a||e[22]!==l?(d=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(xe,{children:[x,o.jsxs(_e,{align:"end",children:[l,a]})]})}),e[21]=a,e[22]=l,e[23]=d):d=e[23];let D;e[24]!==d||e[25]!==f?(D=o.jsxs("div",{className:"flex items-start justify-between",children:[f,d]}),e[24]=d,e[25]=f,e[26]=D):D=e[26];let w;e[27]!==s.title?(w=o.jsx("div",{className:"flex items-center gap-2 min-w-0",children:o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title})}),e[27]=s.title,e[28]=w):w=e[28];const K=s.description||"No description";let S;e[29]!==K?(S=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:K}),e[29]=K,e[30]=S):S=e[30];let G;e[31]!==w||e[32]!==S?(G=o.jsxs("div",{className:"flex flex-col gap-1",children:[w,S]}),e[31]=w,e[32]=S,e[33]=G):G=e[33];let N;e[34]!==D||e[35]!==G?(N=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[D,G]}),e[34]=D,e[35]=G,e[36]=N):N=e[36];let T;e[37]!==r||e[38]!==y||e[39]!==s.updated_at||e[40]!==p?(T=r?p("home.projectCard.lastUsed",{time:Ce(new Date(r),{addSuffix:!0,locale:y})}):p("home.projectCard.updated",{time:Ce(new Date(s.updated_at),{addSuffix:!0,locale:y})}),e[37]=r,e[38]=y,e[39]=s.updated_at,e[40]=p,e[41]=T):T=e[41];let L;e[42]!==T?(L=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:T})})}),e[42]=T,e[43]=L):L=e[43];let I;e[44]!==N||e[45]!==L?(I=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[N,L]}),e[44]=N,e[45]=L,e[46]=I):I=e[46];let _;return e[47]!==I||e[48]!==g?(_=o.jsxs(Te,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[g,I]}),e[47]=I,e[48]=g,e[49]=_):_=e[49],_}function Tt(t,e){const s=ue.c(12),{org:r}=ge();let n;s[0]!==r.id?(n=Xe.REGISTRY(r.id),s[0]=r.id,s[1]=n):n=s[1];const h=n;let p;s[2]!==r.id||s[3]!==r.slug||s[4]!==h?(p={connectionId:h,orgId:r.id,orgSlug:r.slug},s[2]=r.id,s[3]=r.slug,s[4]=h,s[5]=p):p=s[5];const y=be(p);let m;s[6]!==t?(m={name:t},s[6]=t,s[7]=m):m=s[7];const b=e?.enabled??!0;let j;return s[8]!==y||s[9]!==m||s[10]!==b?(j={client:y,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:m,enabled:b,staleTime:3e5,select:Lt},s[8]=y,s[9]=m,s[10]=b,s[11]=j):j=s[11],tt(j)}function Lt(t){return t.structuredContent?.item??null}const Et="deco/mcp-github";function Ft(t){const{org:e}=ge(),{data:s}=we.useSession(),r=We(),n=Se(),[h,p]=O.useState("idle"),[y,m]=O.useState(null),[b,j]=O.useState(null),{data:u,isLoading:g}=Tt(Et,{enabled:t.enabled}),f=O.useRef(!1);t.enabled&&u&&!g&&!f.current&&s?.user?.id&&h==="idle"&&(f.current=!0,x());async function x(){if(!(!u||!s?.user?.id||!e))try{p("installing"),m(null);const c=ot(u,e.id,s.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:a}=await r.create.mutateAsync(c);p("authenticating");const d=await et({connectionId:a,orgId:e.id,orgSlug:e.slug,persistFallback:D=>r.update.mutateAsync({id:a,data:{connection_token:D}}).then(()=>{})});if(d.ran&&!d.ok){try{await r.delete.mutateAsync(a)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}Le(n,e.id),j(c),p("ready")}catch(c){m(c instanceof Error?c.message:String(c)),p("error")}}function C(){p("idle"),m(null),j(null),f.current=!1}return t.enabled&&g&&h==="idle"?{status:"installing",error:null,connection:null,retry:C}:{status:h,error:y,connection:b,retry:C}}const kt="deco-sites";function Pt(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const s=e.owner,r=e.repo;return typeof s!="string"||typeof r!="string"||s.length===0||r.length===0?null:{owner:s,repo:r}}function Gt(t,e){const s=e?Pt(e):null,r=s?.owner??kt,n=s?.repo??t;return{owner:r,name:n,url:`https://github.com/${r}/${n}`}}function Mt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const r=await fetch(t,e),n=await r.json().catch(()=>({}));if(!r.ok)throw new Error(n.error??`${s} (${r.status})`);return n}function Ot(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Rt({open:t,onOpenChange:e,onBack:s}){const r=pe(),{org:n}=ge(),h=ve(),p=Se(),{data:y}=we.useSession(),[m,b]=O.useState(null),[j,u]=O.useState(null),[g,f]=O.useState(""),x=be({connectionId:Ze,orgId:n.id,orgSlug:n.slug}),C=Je({slug:"mcp-github"}),c=it(C),l=Ft({enabled:t&&c.length===0}),a=c.length===1?c[0]??null:j,d=c.length>1&&!a,D=be({connectionId:a?.id??"",orgId:n.id,orgSlug:n.slug}),w=t&&c.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:K,isLoading:S,error:G}=Ee({queryKey:je.decoSites(y?.user?.email),queryFn:()=>Ot(n.slug),enabled:t&&!!y?.user?.email,staleTime:6e4,retry:!1}),N=K?.sites??[],T=i=>{i||(b(null),u(null),f("")),e(i)},L=N.filter(i=>i.name.toLowerCase().includes(g.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(g.toLowerCase())??!1)),I=!m||L.some(i=>i.name===m),_=Fe({mutationFn:async i=>{if(!a)throw new Error(r("common.importFromDecoDialog.githubNotConnected"));U("deco_site_import_started",{site_name:i});const{installations:P}=await nt(k=>x.callTool(k),a.id),E=N.find(k=>k.name===i);if(!E)throw new Error(r("common.importFromDecoDialog.siteNoLongerAvailable"));const v=Gt(i,E.metadata),F=lt(P,v.owner);if(!F)throw new Error(r("common.importFromDecoDialog.installGithubApp",{owner:v.owner,installUrl:at}));let R=null,Q=null;const ae=async()=>{Q&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:Q}}).catch(()=>{}),R&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:R,force:!0}}).catch(()=>{})};try{const k=await Ne(`/api/${n.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},r("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:z,reused:H}=await ct({orgSlug:n.slug,sourceConnection:a,installationId:F.installationId,owner:v.owner,repo:v.name,githubCallTool:q=>D.callTool(q),selfCallTool:q=>x.callTool(q)});R=H?null:z;const B=k.icon??null,Y=Mt(i),W=i.toLowerCase(),$=st(i),V=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:B??null,metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:$,productionUrl:$,githubRepo:{owner:v.owner,name:v.name,url:v.url,installationId:F.installationId,connectionId:z},ui:{banner:null,bannerColor:"#22C55E",icon:B,themeColor:"#22C55E",slug:Y,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:z}]}}}),M=V.structuredContent??V;if(!M.item?.id)throw new Error(r("common.importFromDecoDialog.failedToCreateAgent"));return Q=M.item.id,{slug:Y,virtualMcpId:M.item.id,item:M.item}}catch(k){throw await ae(),k}},onSuccess:({slug:i,virtualMcpId:P,item:E})=>{U("deco_site_import_succeeded",{site_name:E.title,virtual_mcp_id:P,slug:i}),p.setQueryData(je.collectionItem(x,n.id,"","VIRTUAL_MCP",P),{item:E}),p.invalidateQueries({predicate:v=>{const F=v.queryKey;return F[1]===n.id&&F[3]==="collection"&&F[4]==="VIRTUAL_MCP"}}),fe.success(r("common.importFromDecoDialog.importSuccess",{slug:i})),T(!1),h(P)},onError:i=>{U("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),fe.error(r("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:r("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(mt,{open:t,onOpenChange:T,children:o.jsxs(dt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ut,{className:"sr-only",children:o.jsx(pt,{children:r("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":r("common.importFromDecoDialog.goBack"),children:o.jsx(ft,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:r("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ht,{value:g,onChange:f,placeholder:r("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.key==="Escape"&&f("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??r("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(le,{variant:"outline",size:"sm",onClick:l.retry,children:r("common.importFromDecoDialog.retryGithubSetup")})]}),w&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.settingUpGithub")}),d&&!w&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:r("common.importFromDecoDialog.selectGithubConnection")})}),c.map(i=>o.jsxs("button",{type:"button",onClick:()=>u(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(xt,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),S&&!w&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.loadingSites")}),!S&&!w&&!d&&l.status!=="error"&&!G&&N.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.noSitesFound")}),!S&&!w&&!d&&l.status!=="error"&&N.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[L.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:r("common.importFromDecoDialog.noSitesMatch",{search:g})}),L.map(i=>{const P=rt(i.domains),E=m===i.name;return o.jsxs("button",{type:"button",onClick:()=>b(i.name),className:ke("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",E?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),P&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:P})]})]},i.name)})]})]}),o.jsxs(gt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(le,{variant:"outline",onClick:()=>T(!1),disabled:_.isPending,children:r("common.importFromDecoDialog.cancel")}),o.jsx(le,{disabled:!m||!I||_.isPending||S||w||d||!a||l.status==="error",onClick:()=>m&&_.mutate(m),children:_.isPending?r("common.importFromDecoDialog.importing"):r("common.importFromDecoDialog.import")})]})]})})}function ys(){const t=ue.c(82),e=pe(),{org:s}=ge(),[r,n]=O.useState(""),h=It(r,300);let p;t[0]!==h?(p={searchTerm:h},t[0]=h,t[1]=p):p=t[1];const y=Oe(p),m=Re();let b;t[2]===Symbol.for("react.memo_cache_sentinel")?(b={navigateOnCreate:!0},t[2]=b):b=t[2];const{createVirtualMCP:j,isCreating:u}=Ye(b),[g,f]=O.useState(null),[x,C]=O.useState(!1),[c,l]=O.useState(!1),{granted:a}=Pe("agents:manage"),d=Qe();let D;t[3]!==s?(D=A=>A.id!==s.id,t[3]=s,t[4]=D):D=t[4];const w=y.filter(D),{data:K}=ze(w.map(zt));let S;t[5]!==m||t[6]!==g||t[7]!==e?(S=async()=>{if(!g)return;const{id:A,title:Ie}=g;f(null);try{await m.delete.mutateAsync(A),U("agent_deleted",{agent_id:A,source:"agents_list"}),fe.success(e("routes.agentsList.deletedAgent",{title:Ie}))}catch{}},t[5]=m,t[6]=g,t[7]=e,t[8]=S):S=t[8];const G=S,N=de,T=de,L=de;let I;t[9]!==e?(I=e("routes.agentsList.title"),t[9]=e,t[10]=I):I=t[10];let _;t[11]!==I?(_=o.jsx(de.Title,{children:I}),t[11]=I,t[12]=_):_=t[12];let i;t[13]!==e?(i=e("routes.agentsList.searchPlaceholder"),t[13]=e,t[14]=i):i=t[14];let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P=A=>{A.key==="Escape"&&(n(""),A.target.blur())},t[15]=P):P=t[15];let E;t[16]!==r||t[17]!==i?(E=o.jsx(vt,{value:r,onChange:n,placeholder:i,className:"w-full md:w-[375px]",onKeyDown:P}),t[16]=r,t[17]=i,t[18]=E):E=t[18];let v;t[19]!==a||t[20]!==j||t[21]!==u||t[22]!==d||t[23]!==e?(v=a&&o.jsxs(xe,{children:[o.jsx(he,{asChild:!0,children:o.jsxs(le,{size:"sm",children:[o.jsx(De,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(ye,{onCreateFromScratch:()=>{U("agent_create_clicked",{source:"agents_list",method:"scratch"}),j()},onImportGitHub:()=>{U("agent_create_clicked",{source:"agents_list",method:"github"}),l(!0)},onImportDeco:()=>{U("agent_create_clicked",{source:"agents_list",method:"deco"}),C(!0)},isCreating:u,align:"end",showDecoImport:d})]}),t[19]=a,t[20]=j,t[21]=u,t[22]=d,t[23]=e,t[24]=v):v=t[24];let F;t[25]!==E||t[26]!==v?(F=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,v]}),t[25]=E,t[26]=v,t[27]=F):F=t[27];let R;t[28]!==F||t[29]!==_?(R=o.jsxs("div",{className:"flex flex-col gap-6",children:[_,F]}),t[28]=F,t[29]=_,t[30]=R):R=t[30];const Q=w.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(qe,{image:o.jsx(He,{size:48,className:"text-muted-foreground"}),title:e(r?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:r?e("routes.agentsList.noAgentsMatchSearch",{search:r}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!r&&a&&o.jsxs(xe,{children:[o.jsx(he,{asChild:!0,children:o.jsxs(le,{size:"sm",children:[o.jsx(De,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(ye,{onCreateFromScratch:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),j()},onImportGitHub:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"github"}),l(!0)},onImportDeco:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),C(!0)},isCreating:u,align:"center",showBetaBadge:!0,showDecoImport:d})]})})}),ae=w.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:w.map(A=>o.jsx(At,{project:A,lastUsedAt:K?.get(A.id)?.last_used_at,onDeleteClick:a?()=>f({id:A.id,title:A.title}):void 0},A.id))})]});let k;t[31]!==R||t[32]!==Q||t[33]!==ae||t[34]!==L.Body?(k=o.jsxs(L.Body,{children:[R,Q,ae]}),t[31]=R,t[32]=Q,t[33]=ae,t[34]=L.Body,t[35]=k):k=t[35];let z;t[36]!==k||t[37]!==T.Content?(z=o.jsx(T.Content,{children:k}),t[36]=k,t[37]=T.Content,t[38]=z):z=t[38];let H;t[39]!==c?(H=o.jsx(Nt,{open:c,onOpenChange:l}),t[39]=c,t[40]=H):H=t[40];let B;t[41]!==x?(B=o.jsx(Rt,{open:x,onOpenChange:C}),t[41]=x,t[42]=B):B=t[42];const Y=!!g;let W;t[43]===Symbol.for("react.memo_cache_sentinel")?(W=A=>!A&&f(null),t[43]=W):W=t[43];let $;t[44]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[44]=e,t[45]=$):$=t[45];let V;t[46]!==$?(V=o.jsx(bt,{children:$}),t[46]=$,t[47]=V):V=t[47];let M;t[48]!==e?(M=e("routes.agentsList.deleteAgentDescription"),t[48]=e,t[49]=M):M=t[49];const q=g?.title;let J;t[50]!==q?(J=o.jsx("span",{className:"font-medium text-foreground",children:q}),t[50]=q,t[51]=J):J=t[51];let X;t[52]!==M||t[53]!==J?(X=o.jsxs(jt,{children:[M," ",J,"."]}),t[52]=M,t[53]=J,t[54]=X):X=t[54];let Z;t[55]!==V||t[56]!==X?(Z=o.jsxs(Ct,{children:[V,X]}),t[55]=V,t[56]=X,t[57]=Z):Z=t[57];let ee;t[58]!==e?(ee=e("routes.agentsList.cancelButton"),t[58]=e,t[59]=ee):ee=t[59];let te;t[60]!==ee?(te=o.jsx(Dt,{children:ee}),t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==e?(oe=e("routes.agentsList.deleteButton"),t[62]=e,t[63]=oe):oe=t[63];let se;t[64]!==G||t[65]!==oe?(se=o.jsx(yt,{onClick:G,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:oe}),t[64]=G,t[65]=oe,t[66]=se):se=t[66];let re;t[67]!==te||t[68]!==se?(re=o.jsxs(wt,{children:[te,se]}),t[67]=te,t[68]=se,t[69]=re):re=t[69];let ie;t[70]!==Z||t[71]!==re?(ie=o.jsxs(St,{children:[Z,re]}),t[70]=Z,t[71]=re,t[72]=ie):ie=t[72];let ne;t[73]!==Y||t[74]!==ie?(ne=o.jsx(_t,{open:Y,onOpenChange:W,children:ie}),t[73]=Y,t[74]=ie,t[75]=ne):ne=t[75];let me;return t[76]!==N||t[77]!==z||t[78]!==H||t[79]!==B||t[80]!==ne?(me=o.jsxs(N,{children:[z,H,B,ne]}),t[76]=N,t[77]=z,t[78]=H,t[79]=B,t[80]=ne,t[81]=me):me=t[81],me}function zt(t){return t.id}export{ys as default};
@@ -1,2 +0,0 @@
1
- import{c as ae,b as xe,G as Tt,m as nt,K as Be,r as ne,j as t,b8 as Ue,l as qe,n as Ze,e as Fe,t as ge,B as be}from"./index-DSJbN5sX.js";import{f as De,p as vt,bk as Nt,aE as Pt}from"./agent-icon-1_qqvbMi.js";import{i as wt}from"./Check-DwFkAzIE.js";import{i as St}from"./ChevronRight-D2_fST_t.js";import{a as it}from"./Copy01-DBOM13CL.js";import{s as kt}from"./Trash01-DXMXjB5D.js";import{B as Le}from"./badge-BviUmQbh.js";import{C as Je}from"./checkbox-gsIYGPP6.js";import{I as Qe}from"./input-DkSSz62S.js";import{L as Oe}from"./label-Bl_k8voC.js";import{a as st,d as _t,T as Ct,c as Kt,e as Et,b as $t}from"./table-8P8-CnP6.js";import{i as At,j as Dt,C as Ot,a as qt,b as Lt}from"./chart-BFgm1SUy.js";import{g as zt,c as Mt,d as Rt,b as Ft,f as It,e as Bt,a as Vt,A as Ht}from"./alert-dialog-BWLIdDXs.js";import{c as rt,d as ot,b as ct,D as dt,e as Ut}from"./dialog-BQdaXz76.js";import{E as Re}from"./empty-state-jHV8lblj.js";import{u as Qt}from"./use-virtual-mcp-BMf2s6FM.js";import{r as Gt}from"./site-slug-uya6Wp4-.js";import{ac as Wt,ad as Yt,a9 as Jt,aa as Xt,ab as Zt}from"./AreaChart-Dq_zvJWZ.js";import"./AlertCircle-wAnOHADS.js";import"./Tool01-V0KS9Hy0.js";import"./ArrowUp-BlmUVKW6.js";import"./ArrowLeft-YvJ2QXtl.js";import"./Tool02-BgHxw_wF.js";import"./ArrowRight-jfYfDxSI.js";import"./TrendUp01-ACczpA6C.js";import"./ZoomOut-Dmwkd0k-.js";import"./Users03-DmY-Asfu.js";import"./CheckCircle-C2nq7B8n.js";import"./ChevronUp-DNGcpflk.js";import"./ChevronSelectorVertical-CgTde0Q8.js";import"./DotsVertical-Cz4ekipb.js";import"./UserSquare-CXfPKP7D.js";import"./CreditCard01-DGxkfyx2.js";import"./Download01-u2kBF-xv.js";import"./Settings02-CrEluPTC.js";import"./Eye-rOw56pjM.js";import"./Share07-Nzkr8YZ2.js";import"./GitBranch01-CEsq5yX5.js";import"./Globe01-CivtgibE.js";import"./XClose-CpE_1sco.js";import"./HardDrive-C2GoE6qs.js";import"./Image01-DBbKbwbi.js";import"./Key01-BSosoP95.js";import"./Link01-MZ7GmZHO.js";import"./LinkExternal01-73pMIgKV.js";import"./Monitor01-oRlaapId.js";import"./Sun-CCLPxWiv.js";import"./Package-BYp5l2E5.js";import"./Palette-8I2sDSog.js";import"./Play-B225dlHd.js";import"./Plus-BDOjM-y2.js";import"./SearchMd-BnqlK6CF.js";import"./Shield01-B_JxVlrS.js";import"./Stars01-mzby3j_o.js";import"./Upload01-CeJJDeve.js";import"./User01-D2exKDPK.js";import"./Users01-Bab7B5hF.js";import"./XCircle-C5opwPs7.js";import"./Zap-CNl7K3Ps.js";import"./index-Cyf2Yshe.js";import"./use-mcp-client-ugccnX7P.js";import"./auth-BwvYRMCE.js";const mt=[{key:"core",labelKey:"mainPanelTabs.analyticsTab.moduleCore",hintKey:"mainPanelTabs.analyticsTab.moduleCoreHint"},{key:"commerce",labelKey:"mainPanelTabs.analyticsTab.moduleCommerce",hintKey:"mainPanelTabs.analyticsTab.moduleCommerceHint"},{key:"vitals",labelKey:"mainPanelTabs.analyticsTab.moduleVitals",hintKey:"mainPanelTabs.analyticsTab.moduleVitalsHint"},{key:"errors",labelKey:"mainPanelTabs.analyticsTab.moduleErrors",hintKey:"mainPanelTabs.analyticsTab.moduleErrorsHint"},{key:"engagement",labelKey:"mainPanelTabs.analyticsTab.moduleEngagement",hintKey:"mainPanelTabs.analyticsTab.moduleEngagementHint"}],es=[{view:"live",labelKey:"mainPanelTabs.analyticsTab.viewLive"},{view:"overview",labelKey:"mainPanelTabs.analyticsTab.viewOverview"},{view:"behaviour",labelKey:"mainPanelTabs.analyticsTab.viewBehaviour"},{view:"events",labelKey:"mainPanelTabs.analyticsTab.viewEvents"},{view:"errors",labelKey:"mainPanelTabs.analyticsTab.viewErrors"},{view:"experiments",labelKey:"mainPanelTabs.analyticsTab.viewExperiments"},{view:"vitals",labelKey:"mainPanelTabs.analyticsTab.viewVitals"},{view:"quality",labelKey:"mainPanelTabs.analyticsTab.viewQuality"},{view:"usage",labelKey:"mainPanelTabs.analyticsTab.viewUsage"}],ts=["5m","15m","30m","1h","24h","7d","30d"],ss=new Set(["usageScope","currency","currencies","dimensions","operators","goals","goal","range","site","view","propKey","filters","usageExplained"]),ft=/^(t|ts|bucket|minute|min|hour|day|date)$/i;function as(r){const e=r instanceof Error?r.message.toLowerCase():"";return e.includes("unauthorized")||e.includes("401")}function ut(r){const e=r instanceof Error?r.message.toLowerCase():"";return e.includes("not_configured")||e.includes("not configured")}function Ve(r){return r instanceof Error?r.message:String(r)}function je(r){const e=r.replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return e.charAt(0).toUpperCase()+e.slice(1)}function Ge(r){const e=typeof r=="number"?r:Number(r);return Number.isFinite(e)?new Intl.NumberFormat().format(e):"—"}function We(r){if(r==null||r==="")return"—";if(Array.isArray(r))return r.length?r.map(e=>String(e)).join(", "):"—";if(typeof r=="number")return Ge(r);if(typeof r=="object")try{return JSON.stringify(r)}catch{return String(r)}return String(r)}function ls(r){return r===null||["string","number","boolean"].includes(typeof r)}async function xt(r){const e=await fetch(r),n=await e.json().catch(()=>({}));if(!e.ok){const a=n&&typeof n=="object"&&"error"in n?String(n.error):`request failed (${e.status})`;throw new Error(a)}return n}async function Ie(r,e,n){const a=await fetch(r,{method:e,headers:n!==void 0?{"Content-Type":"application/json"}:{},body:n!==void 0?JSON.stringify(n):void 0}),c=await a.json().catch(()=>({}));if(!a.ok){const o=c&&typeof c=="object"&&"error"in c?String(c.error):`request failed (${a.status})`;throw new Error(o)}return c}function he(r){const e=ae.c(12),{title:n,action:a,children:c}=r;let o;e[0]!==n?(o=t.jsx("h3",{className:"text-sm font-medium text-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let s;e[2]!==a?(s=a&&t.jsx("div",{className:"ml-auto",children:a}),e[2]=a,e[3]=s):s=e[3];let l;e[4]!==o||e[5]!==s?(l=t.jsxs("header",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[o,s]}),e[4]=o,e[5]=s,e[6]=l):l=e[6];let i;e[7]!==c?(i=t.jsx("div",{className:"p-4",children:c}),e[7]=c,e[8]=i):i=e[8];let d;return e[9]!==l||e[10]!==i?(d=t.jsxs("section",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,i]}),e[9]=l,e[10]=i,e[11]=d):d=e[11],d}function Ye(r,e){if(e==null)return"—";const n=Number(e);if(!Number.isFinite(n))return We(e);if(/(pct|rate|bounce|ratio)/i.test(r))return`${Math.round(n)}%`;if(/(_s$|duration|seconds)/i.test(r)){const a=Math.floor(n/60);return a?`${a}m ${Math.round(n%60)}s`:`${Math.round(n)}s`}return Ge(n)}const ns={kpis:"Overview",series:"Traffic over time",funnel:"Funnel",sources:"Top sources",pages:"Top pages",entryPages:"Entry pages",exitPages:"Exit pages",devices:"Devices",os:"Operating systems",browser:"Browsers",countries:"Countries",regions:"Regions",cities:"Cities",channels:"Channels",channelConversion:"Channel conversion",campaigns:"Campaigns",campaignNames:"Campaign names",attribution:"Attribution",products:"Top products",events:"Events",errors:"Errors",propKeys:"Property keys",propValues:"Property values",scrollDepth:"Scroll depth",searches:"Site searches",outbound:"Outbound links",downloads:"Downloads",variants:"Experiment variants",vitals:"Web vitals",vitalsByPage:"Vitals by page",liveVisitors:"Live visitors",livePages:"Active pages",liveFeed:"Live feed",liveByMinute:"Visitors per minute",usage:"Usage",usageTrend:"Usage over time",usageSites:"Usage by site"},at=["pages","sources","channels","devices","browser","os","countries","regions","cities","entryPages","exitPages","campaigns","products","events","errors"];function pt(r){return ns[r]??je(r)}function is(r){if(r.length<4)return null;const e=Math.floor(r.length/2),n=r.slice(0,e).reduce((c,o)=>c+o,0),a=r.slice(e).reduce((c,o)=>c+o,0);return n===0?null:(a-n)/n*100}function rs(r){const e=ae.c(8),{pct:n,goodDown:a}=r,c=n>=0,s=(a?!c:c)?"text-[var(--chart-2,#16a34a)]":"text-destructive";let l;e[0]!==s?(l=qe("text-xs font-medium tabular-nums",s),e[0]=s,e[1]=l):l=e[1];const i=c?"↑":"↓";let d;e[2]!==n?(d=Math.abs(Math.round(n)),e[2]=n,e[3]=d):d=e[3];let m;return e[4]!==l||e[5]!==i||e[6]!==d?(m=t.jsxs("span",{className:l,children:[i,d,"%"]}),e[4]=l,e[5]=i,e[6]=d,e[7]=m):m=e[7],m}const os=new Set(["min_sampling","sessions_built"]);function cs(r){const e=ae.c(2),{row:n}=r;let a;if(e[0]!==n){const c=Object.entries(n).filter(ms);a=t.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:c.map(ds)}),e[0]=n,e[1]=a}else a=e[1];return a}function ds(r){const[e,n]=r;return t.jsxs("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-4",children:[t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:je(e)}),t.jsx("span",{className:"text-3xl font-semibold leading-none text-foreground tabular-nums",children:Ye(e,n)})]},e)}function ms(r){const[e,n]=r;return(typeof n=="number"||n===null)&&!os.has(e)}function fs(r){if(!Number.isFinite(r))return"";const e=Math.abs(r);return e>=1e6?`${(r/1e6).toFixed(1)}M`:e>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}function bt(r){const e=ae.c(39),{rows:n,timeKey:a,metricKeys:c}=r;let o,s,l,i,d,m,g,b,p,u,v,h,y;if(e[0]!==c||e[1]!==n||e[2]!==a){l=c.filter(Boolean).slice(0,4);const T=l.map(xs),N=n.map(S=>{const P={label:String(S[a]??"")};for(const w of l)P[w]=Number(S[w])||0;return P}),_=Object.fromEntries(l.map((S,P)=>[S,{label:je(S),color:T[P]}]));s=Ot,y=_,d="h-64 w-full",o=Yt,i=N,e[16]===Symbol.for("react.memo_cache_sentinel")?(m={top:8,right:-8,bottom:8,left:0},e[16]=m):m=e[16],g=t.jsx("defs",{children:l.map((S,P)=>t.jsxs("linearGradient",{id:`dq-grad-${S}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:T[P],stopOpacity:.2}),t.jsx("stop",{offset:"100%",stopColor:T[P],stopOpacity:0})]},S))}),e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Jt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[17]=b):b=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Xt,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},tickMargin:8,minTickGap:40,interval:"preserveStartEnd",tickFormatter:us}),e[18]=p):p=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Zt,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},tickFormatter:fs,width:40,tickCount:5}),e[19]=u):u=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(qt,{content:t.jsx(Lt,{indicator:"line"})}),e[20]=v):v=e[20],h=l.map((S,P)=>t.jsx(Wt,{type:"linear",dataKey:S,stroke:T[P],strokeWidth:2,fill:`url(#dq-grad-${S})`,dot:!1,activeDot:{r:4,fill:T[P],stroke:"var(--background)",strokeWidth:2},animationDuration:300},S)),e[0]=c,e[1]=n,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=i,e[7]=d,e[8]=m,e[9]=g,e[10]=b,e[11]=p,e[12]=u,e[13]=v,e[14]=h,e[15]=y}else o=e[3],s=e[4],l=e[5],i=e[6],d=e[7],m=e[8],g=e[9],b=e[10],p=e[11],u=e[12],v=e[13],h=e[14],y=e[15];let x;e[21]!==l.length?(x=l.length>1&&t.jsx(At,{content:t.jsx(Dt,{})}),e[21]=l.length,e[22]=x):x=e[22];let j;e[23]!==o||e[24]!==i||e[25]!==x||e[26]!==m||e[27]!==g||e[28]!==b||e[29]!==p||e[30]!==u||e[31]!==v||e[32]!==h?(j=t.jsxs(o,{data:i,margin:m,children:[g,b,p,u,v,h,x]}),e[23]=o,e[24]=i,e[25]=x,e[26]=m,e[27]=g,e[28]=b,e[29]=p,e[30]=u,e[31]=v,e[32]=h,e[33]=j):j=e[33];let f;return e[34]!==s||e[35]!==d||e[36]!==j||e[37]!==y?(f=t.jsx(s,{config:y,className:d,children:j}),e[34]=s,e[35]=d,e[36]=j,e[37]=y,e[38]=f):f=e[38],f}function us(r){return r.replace("T"," ").slice(5,16)}function xs(r,e){return`var(--chart-${e%5+1})`}function et(r){const e=ae.c(37),{rows:n,labelKey:a,valueKey:c}=r;let o,s,l,i;if(e[0]!==a||e[1]!==n||e[2]!==c){let g;e[7]!==c?(g=(N,_)=>(Number(_[c])||0)-(Number(N[c])||0),e[7]=c,e[8]=g):g=e[8];const b=[...n].sort(g).slice(0,10);let p;e[9]!==c?(p=N=>Number(N[c])||0,e[9]=c,e[10]=p):p=e[10];const u=Math.max(1,...b.map(p));let v;e[11]!==n||e[12]!==c?(v=n.reduce((N,_)=>N+(Number(_[c])||0),0)||1,e[11]=n,e[12]=c,e[13]=v):v=e[13];const h=v;l="flex flex-col";let y;e[14]!==a?(y=je(a),e[14]=a,e[15]=y):y=e[15];let x;e[16]!==y?(x=t.jsx("span",{children:y}),e[16]=y,e[17]=x):x=e[17];let j;e[18]!==c?(j=je(c),e[18]=c,e[19]=j):j=e[19];let f;e[20]!==j?(f=t.jsx("span",{children:j}),e[20]=j,e[21]=f):f=e[21],e[22]!==f||e[23]!==x?(i=t.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:[x,f]}),e[22]=f,e[23]=x,e[24]=i):i=e[24],o="flex flex-col gap-0.5";let T;e[25]!==a||e[26]!==u||e[27]!==h||e[28]!==c?(T=(N,_)=>{const S=Number(N[c])||0;return t.jsxs("div",{className:"relative flex items-center justify-between gap-3 overflow-hidden rounded-md px-2.5 py-2",children:[t.jsx("div",{className:"absolute inset-y-0 left-0 rounded-md bg-muted",style:{width:`${S/u*100}%`}}),t.jsx("span",{className:"relative z-10 truncate font-mono text-xs text-foreground",children:We(N[a])||"—"}),t.jsxs("span",{className:"relative z-10 shrink-0 text-sm tabular-nums text-foreground",children:[Ge(S),t.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:[Math.round(S/h*100),"%"]})]})]},_)},e[25]=a,e[26]=u,e[27]=h,e[28]=c,e[29]=T):T=e[29],s=b.map(T),e[0]=a,e[1]=n,e[2]=c,e[3]=o,e[4]=s,e[5]=l,e[6]=i}else o=e[3],s=e[4],l=e[5],i=e[6];let d;e[30]!==o||e[31]!==s?(d=t.jsx("div",{className:o,children:s}),e[30]=o,e[31]=s,e[32]=d):d=e[32];let m;return e[33]!==l||e[34]!==i||e[35]!==d?(m=t.jsxs("div",{className:l,children:[i,d]}),e[33]=l,e[34]=i,e[35]=d,e[36]=m):m=e[36],m}function gt(r){const e=ae.c(7),{row:n}=r;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[["viewed","Viewed"],["view_item","View item"],["view_item_list","View list"],["select_item","Select item"],["add_to_cart","Add to cart"],["begin_checkout","Begin checkout"],["purchase","Purchase"]],e[0]=a):a=e[0];const c=a;let o;e[1]!==n?(o=c.filter(d=>{const[m]=d;return m in n}),e[1]=n,e[2]=o):o=e[2];const s=o,l=Number(n[s[0]?.[0]??""])||1;let i;return e[3]!==l||e[4]!==n||e[5]!==s?(i=t.jsx("div",{className:"flex flex-col gap-1.5",children:s.map(d=>{const[m,g]=d,b=Number(n[m])||0;return t.jsxs("div",{className:"relative flex items-center justify-between gap-3 overflow-hidden rounded-md px-2.5 py-2",children:[t.jsx("div",{className:"absolute inset-y-0 left-0 rounded-md bg-primary/15",style:{width:`${b/l*100}%`}}),t.jsx("span",{className:"relative z-10 text-sm text-foreground",children:g}),t.jsxs("span",{className:"relative z-10 shrink-0 text-sm tabular-nums text-muted-foreground",children:[Ge(b),t.jsxs("span",{className:"ml-2 text-xs opacity-70",children:[Math.round(b/l*100),"%"]})]})]},m)})}),e[3]=l,e[4]=n,e[5]=s,e[6]=i):i=e[6],i}function ht(r){const e=ae.c(18),{rows:n}=r;let a,c,o,s,l;if(e[0]!==n){const g=Array.from(n.reduce(ps,new Set)),b=new Set(g.filter(h=>n.some(y=>typeof y[h]=="number"))),p=g.find(h=>b.has(h)),u=[...n].sort((h,y)=>p?(Number(y[p])||0)-(Number(h[p])||0):0).slice(0,50);l="overflow-x-auto",c=Kt;const v=t.jsx(st,{className:"border-border hover:bg-transparent",children:g.map(h=>t.jsx(_t,{className:qe("h-8 whitespace-nowrap text-[11px] font-medium uppercase tracking-wide text-muted-foreground",b.has(h)&&"text-right"),children:je(h)},h))});e[6]!==v?(s=t.jsx(Et,{children:v}),e[6]=v,e[7]=s):s=e[7],a=$t,o=u.map((h,y)=>t.jsx(st,{className:"border-border/50",children:g.map(x=>t.jsx(Ct,{className:qe("whitespace-nowrap py-1.5 text-sm tabular-nums",b.has(x)?"text-right text-foreground":"font-mono text-xs text-muted-foreground"),children:typeof h[x]=="number"?Ye(x,h[x]):We(h[x])},x))},y)),e[0]=n,e[1]=a,e[2]=c,e[3]=o,e[4]=s,e[5]=l}else a=e[1],c=e[2],o=e[3],s=e[4],l=e[5];let i;e[8]!==a||e[9]!==o?(i=t.jsx(a,{children:o}),e[8]=a,e[9]=o,e[10]=i):i=e[10];let d;e[11]!==c||e[12]!==s||e[13]!==i?(d=t.jsxs(c,{children:[s,i]}),e[11]=c,e[12]=s,e[13]=i,e[14]=d):d=e[14];let m;return e[15]!==l||e[16]!==d?(m=t.jsx("div",{className:l,children:d}),e[15]=l,e[16]=d,e[17]=m):m=e[17],m}function ps(r,e){return Object.keys(e).forEach(n=>r.add(n)),r}function bs(r){if(r.length===0)return null;const e=r[0]??{},n=Object.keys(e);if(r.length===1&&("viewed"in e||"purchase"in e||"add_to_cart"in e))return{kind:"funnel"};const a=n.find(l=>ft.test(l)),c=a?n.filter(l=>l!==a&&typeof e[l]=="number"):[];if(a&&c.length>0&&r.length>1)return{kind:"series",timeKey:a,metricKeys:c};const o=n.find(l=>l!==a&&typeof e[l]=="string"),s=n.find(l=>typeof e[l]=="number");return o&&s&&n.length<=3?{kind:"bars",labelKey:o,valueKey:s}:r.length===1&&!a&&!o&&Object.values(e).every(ls)?{kind:"kpi"}:{kind:"table"}}function tt(r){const e=ae.c(18),{rows:n,meta:a}=r;let c;e[0]!==n[0]?(c=n[0]??{},e[0]=n[0],e[1]=c):c=e[1];const o=c;switch(a.kind){case"kpi":{let s;return e[2]!==o?(s=t.jsx(cs,{row:o}),e[2]=o,e[3]=s):s=e[3],s}case"funnel":{let s;return e[4]!==o?(s=t.jsx(gt,{row:o}),e[4]=o,e[5]=s):s=e[5],s}case"series":{const s=a.timeKey??"";let l;e[6]!==a.metricKeys?(l=a.metricKeys??[],e[6]=a.metricKeys,e[7]=l):l=e[7];let i;return e[8]!==n||e[9]!==s||e[10]!==l?(i=t.jsx(bt,{rows:n,timeKey:s,metricKeys:l}),e[8]=n,e[9]=s,e[10]=l,e[11]=i):i=e[11],i}case"bars":{const s=a.labelKey??"",l=a.valueKey??"";let i;return e[12]!==n||e[13]!==s||e[14]!==l?(i=t.jsx(et,{rows:n,labelKey:s,valueKey:l}),e[12]=n,e[13]=s,e[14]=l,e[15]=i):i=e[15],i}default:{let s;return e[16]!==n?(s=t.jsx(ht,{rows:n}),e[16]=n,e[17]=s):s=e[17],s}}}function lt(r){const e=ae.c(8),{payload:n,t:a}=r;let c,o;if(e[0]!==n||e[1]!==a){o=Symbol.for("react.early_return_sentinel");e:{const s=Object.entries(n).filter(Ss).map(ws).filter(Ps);if(s.length===0){let m;e[4]!==a?(m=a("mainPanelTabs.analyticsTab.emptyView"),e[4]=a,e[5]=m):m=e[5];let g;e[6]!==m?(g=t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[6]=m,e[7]=g):g=e[7],o=g;break e}const l=s.filter(Ns),i=s.filter(vs),d=s.filter(Ts).sort(js);c=t.jsxs("div",{className:"flex flex-col gap-4",children:[l.map(ys),i.map(hs),d.length>0&&t.jsx("div",{className:"grid gap-4 lg:grid-cols-2 xl:grid-cols-3",children:d.map(gs)})]})}e[0]=n,e[1]=a,e[2]=c,e[3]=o}else c=e[2],o=e[3];return o!==Symbol.for("react.early_return_sentinel")?o:c}function gs(r){return t.jsx(he,{title:pt(r.name),children:t.jsx(tt,{rows:r.rows,meta:r.meta})},r.name)}function hs(r){return t.jsx(he,{title:pt(r.name),children:t.jsx(tt,{rows:r.rows,meta:r.meta})},r.name)}function ys(r){return t.jsx(tt,{rows:r.rows,meta:r.meta},r.name)}function js(r,e){const n=at.indexOf(r.name),a=at.indexOf(e.name);return(n<0?999:n)-(a<0?999:a)}function Ts(r){return r.meta.kind==="bars"||r.meta.kind==="table"}function vs(r){return r.meta.kind==="series"||r.meta.kind==="funnel"}function Ns(r){return r.meta.kind==="kpi"}function Ps(r){return!!r.meta}function ws(r){const[e,n]=r;return{name:e,rows:n,meta:bs(n)}}function Ss(r){const[e,n]=r;return!ss.has(e)&&Array.isArray(n)}const ks=[["visitors","Visitors"],["pageviews","Pageviews"],["sessions","Sessions"],["bounce_pct","Bounce rate"],["duration_s","Avg duration"]];function _s(r){const e=ae.c(24),{payload:n}=r,a=xe();let c;e[0]!==n?(c=P=>Array.isArray(n[P])?n[P]:[],e[0]=n,e[1]=c):c=e[1];const o=c,s=o("kpis")[0]??{},l=o("series");let i;e[2]!==o?(i=o("sources"),e[2]=o,e[3]=i):i=e[3];const d=i;let m;e[4]!==o?(m=o("funnel"),e[4]=o,e[5]=m):m=e[5];const g=m[0],b=l[0]?Object.keys(l[0]).filter(P=>!ft.test(P)&&typeof l[0]?.[P]=="number"):[],p=ks.filter(P=>{const[w]=P;return w in s}),[u,v]=ne.useState(p.find(P=>{const[w]=P;return b.includes(w)})?.[0]??b[0]??""),h="flex flex-col gap-4",y="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5",x=p.map(P=>{const[w,E]=P,k=b.includes(w),$=u===w,K=k?is(l.map(A=>Number(A[w])||0)):null;return t.jsxs("button",{type:"button",disabled:!k,onClick:()=>k&&v(w),className:qe("flex flex-col gap-1.5 rounded-xl border p-4 text-left transition-colors",$?"border-[var(--chart-1)] bg-[var(--chart-1)]/5":"border-border bg-card",k?"cursor-pointer hover:border-[var(--chart-1)]/60":"cursor-default"),children:[t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:E}),t.jsxs("span",{className:"flex items-baseline gap-2",children:[t.jsx("span",{className:"text-3xl font-semibold leading-none text-foreground tabular-nums",children:Ye(w,s[w])}),K!==null&&t.jsx(rs,{pct:K,goodDown:w==="bounce_pct"})]})]},w)});let j;e[6]!==x?(j=t.jsx("div",{className:y,children:x}),e[6]=x,e[7]=j):j=e[7];let f;e[8]!==u||e[9]!==l?(f=u&&l.length>0&&t.jsx(he,{title:`${je(u)} over time`,children:t.jsx(bt,{rows:l,timeKey:"t",metricKeys:[u]})}),e[8]=u,e[9]=l,e[10]=f):f=e[10];let T;e[11]!==d||e[12]!==a?(T=d.length>0&&t.jsx(he,{title:a("mainPanelTabs.analyticsTab.cardTopSources"),children:t.jsx(et,{rows:d,labelKey:"k",valueKey:"n"})}),e[11]=d,e[12]=a,e[13]=T):T=e[13];let N;e[14]!==g||e[15]!==a?(N=g&&t.jsx(he,{title:a("mainPanelTabs.analyticsTab.cardFunnel"),children:t.jsx(gt,{row:g})}),e[14]=g,e[15]=a,e[16]=N):N=e[16];let _;e[17]!==T||e[18]!==N?(_=t.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[T,N]}),e[17]=T,e[18]=N,e[19]=_):_=e[19];let S;return e[20]!==j||e[21]!==f||e[22]!==_?(S=t.jsxs("div",{className:h,children:[j,f,_]}),e[20]=j,e[21]=f,e[22]=_,e[23]=S):S=e[23],S}function Cs(r){const e=ae.c(46),{payload:n}=r,a=xe();let c;e[0]!==n?(c=T=>Array.isArray(n[T])?n[T]:[],e[0]=n,e[1]=c):c=e[1];const o=c;let s,l,i,d,m,g;if(e[2]!==o||e[3]!==a){const T=o("liveVisitors")[0]??{};let N;e[10]!==o?(N=o("liveFeed"),e[10]=o,e[11]=N):N=e[11],s=N;let _;e[12]!==o?(_=o("livePages"),e[12]=o,e[13]=_):_=e[13],l=_;const S=[["visitors","Visitors"],["pageviews","Pageviews"],["events","Events"],["last_event","Last event"]];m="flex flex-col gap-4";let P;e[14]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs("span",{className:"relative flex size-2",children:[t.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-[var(--chart-1)] opacity-75"}),t.jsx("span",{className:"relative inline-flex size-2 rounded-full bg-[var(--chart-1)]"})]}),e[14]=P):P=e[14];let w;e[15]!==a?(w=a("mainPanelTabs.analyticsTab.liveHint"),e[15]=a,e[16]=w):w=e[16],e[17]!==w?(g=t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[P,w]}),e[17]=w,e[18]=g):g=e[18],i="grid grid-cols-2 gap-3 sm:grid-cols-4",d=S.map(E=>{const[k,$]=E;return t.jsxs("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-4",children:[t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:$}),t.jsx("span",{className:"text-3xl font-semibold leading-none text-foreground tabular-nums",children:k==="last_event"?We(T[k]):Ye(k,T[k])})]},k)}),e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=i,e[7]=d,e[8]=m,e[9]=g}else s=e[4],l=e[5],i=e[6],d=e[7],m=e[8],g=e[9];let b;e[19]!==i||e[20]!==d?(b=t.jsx("div",{className:i,children:d}),e[19]=i,e[20]=d,e[21]=b):b=e[21];let p;e[22]!==a?(p=a("mainPanelTabs.analyticsTab.cardLiveFeed"),e[22]=a,e[23]=p):p=e[23];let u;e[24]!==s||e[25]!==a?(u=s.length>0?t.jsx(ht,{rows:s}):t.jsx("p",{className:"text-sm text-muted-foreground",children:a("mainPanelTabs.analyticsTab.emptyLive")}),e[24]=s,e[25]=a,e[26]=u):u=e[26];let v;e[27]!==p||e[28]!==u?(v=t.jsx(he,{title:p,children:u}),e[27]=p,e[28]=u,e[29]=v):v=e[29];let h;e[30]!==a?(h=a("mainPanelTabs.analyticsTab.cardPagesNow"),e[30]=a,e[31]=h):h=e[31];let y;e[32]!==l||e[33]!==a?(y=l.length>0?t.jsx(et,{rows:l,labelKey:"k",valueKey:"n"}):t.jsx("p",{className:"text-sm text-muted-foreground",children:a("mainPanelTabs.analyticsTab.emptyView")}),e[32]=l,e[33]=a,e[34]=y):y=e[34];let x;e[35]!==h||e[36]!==y?(x=t.jsx(he,{title:h,children:y}),e[35]=h,e[36]=y,e[37]=x):x=e[37];let j;e[38]!==x||e[39]!==v?(j=t.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[v,x]}),e[38]=x,e[39]=v,e[40]=j):j=e[40];let f;return e[41]!==j||e[42]!==m||e[43]!==g||e[44]!==b?(f=t.jsxs("div",{className:m,children:[g,b,j]}),e[41]=j,e[42]=m,e[43]=g,e[44]=b,e[45]=f):f=e[45],f}function Ks(r){const e=ae.c(42),{base:n,orgSlug:a,site:c,view:o,range:s,quota:l}=r,i=xe(),d=o==="live",m=d?"5m":s;let g;e[0]!==m||e[1]!==a||e[2]!==c||e[3]!==o?(g=Be.analyticsData(a,c,o,m),e[0]=m,e[1]=a,e[2]=c,e[3]=o,e[4]=g):g=e[4];let b;e[5]!==n||e[6]!==m||e[7]!==o?(b=()=>xt(`${n}/analytics/data?view=${encodeURIComponent(o)}&range=${encodeURIComponent(m)}`),e[5]=n,e[6]=m,e[7]=o,e[8]=b):b=e[8];const p=d?0:3e4,u=d?5e3:!1;let v;e[9]!==g||e[10]!==b||e[11]!==p||e[12]!==u?(v={queryKey:g,queryFn:b,retry:!1,staleTime:p,refetchInterval:u},e[9]=g,e[10]=b,e[11]=p,e[12]=u,e[13]=v):v=e[13];const h=nt(v);if(h.isLoading){let f;return e[14]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Ue,{className:"h-20 w-full"}),t.jsx(Ue,{className:"h-64 w-full"})]}),e[14]=f):f=e[14],f}if(h.error){let f;e[15]!==h.error||e[16]!==i?(f=ut(h.error)?i("mainPanelTabs.analyticsTab.dataNotConfiguredDescription"):i("mainPanelTabs.analyticsTab.dataLoadError"),e[15]=h.error,e[16]=i,e[17]=f):f=e[17];let T;return e[18]!==f?(T=t.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[18]=f,e[19]=T):T=e[19],T}let y;e[20]!==h.data?(y=h.data??{},e[20]=h.data,e[21]=y):y=e[21];const x=y;if(!x.data){let f;e[22]!==i?(f=i("mainPanelTabs.analyticsTab.emptyView"),e[22]=i,e[23]=f):f=e[23];let T;return e[24]!==f?(T=t.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[24]=f,e[25]=T):T=e[25],T}if(d){let f;return e[26]!==x.data?(f=t.jsx(Cs,{payload:x.data}),e[26]=x.data,e[27]=f):f=e[27],f}if(o==="overview"){let f;return e[28]!==x.data?(f=t.jsx(_s,{payload:x.data}),e[28]=x.data,e[29]=f):f=e[29],f}if(o==="usage"){let f;e[30]!==l||e[31]!==x.data?(f=t.jsx(Es,{quota:l,payload:x.data}),e[30]=l,e[31]=x.data,e[32]=f):f=e[32];let T;e[33]!==x.data||e[34]!==i?(T=t.jsx(lt,{payload:x.data,t:i}),e[33]=x.data,e[34]=i,e[35]=T):T=e[35];let N;return e[36]!==f||e[37]!==T?(N=t.jsxs("div",{className:"flex flex-col gap-5",children:[f,T]}),e[36]=f,e[37]=T,e[38]=N):N=e[38],N}let j;return e[39]!==x.data||e[40]!==i?(j=t.jsx(lt,{payload:x.data,t:i}),e[39]=x.data,e[40]=i,e[41]=j):j=e[41],j}function Es(r){const e=ae.c(27),{quota:n,payload:a}=r,c=xe(),o=typeof n=="number"&&n>0;let s,l,i;if(e[0]!==o||e[1]!==a||e[2]!==n||e[3]!==c){let g=null;for(const y of Object.values(a)){const x=y&&typeof y=="object"&&!Array.isArray(y)?y:Array.isArray(y)&&y[0]&&typeof y[0]=="object"?y[0]:null;if(!x)continue;const j=x.events_accepted??x.accepted??x.events;if(typeof j=="number"){g=j;break}}const b=$s;s="flex flex-col gap-2 rounded-xl border border-border bg-card p-4";let p;e[7]!==c?(p=c("mainPanelTabs.analyticsTab.monthlyQuota"),e[7]=c,e[8]=p):p=e[8];let u;e[9]!==p?(u=t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:p}),e[9]=p,e[10]=u):u=e[10];let v;e[11]!==o||e[12]!==n||e[13]!==c?(v=o?`${b(n)} ${c("mainPanelTabs.analyticsTab.eventsPerMonthSuffix")}`:c("mainPanelTabs.analyticsTab.uncapped"),e[11]=o,e[12]=n,e[13]=c,e[14]=v):v=e[14];let h;e[15]!==v?(h=t.jsx("span",{className:"font-mono text-sm tabular-nums text-foreground",children:v}),e[15]=v,e[16]=h):h=e[16],e[17]!==u||e[18]!==h?(l=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u,h]}),e[17]=u,e[18]=h,e[19]=l):l=e[19],i=o&&g!==null&&t.jsx("p",{className:"text-xs text-muted-foreground",children:c("mainPanelTabs.analyticsTab.acceptedInRange",{count:b(g)})}),e[0]=o,e[1]=a,e[2]=n,e[3]=c,e[4]=s,e[5]=l,e[6]=i}else s=e[4],l=e[5],i=e[6];let d;e[20]!==o?(d=!o&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No monthly cap is set — every accepted event is stored. Set one in Configuration to enforce a limit."}),e[20]=o,e[21]=d):d=e[21];let m;return e[22]!==s||e[23]!==l||e[24]!==i||e[25]!==d?(m=t.jsxs("div",{className:s,children:[l,i,d]}),e[22]=s,e[23]=l,e[24]=i,e[25]=d,e[26]=m):m=e[26],m}function $s(r){return r.toLocaleString()}function As(r){const e=ae.c(53),{status:n}=r,a=xe(),c=n.config?.id??"",o=n.key??null,s=`<script async src="https://analytics.decocdn.com/_dq/a.js?k=${o??"YOUR_TOKEN"}"><\/script>`;let l;e[0]!==a?(l=a("mainPanelTabs.analyticsTab.installTitle"),e[0]=a,e[1]=l):l=e[1];let i;e[2]!==a?(i=a("mainPanelTabs.analyticsTab.installHow"),e[2]=a,e[3]=i):i=e[3];let d;e[4]!==i?(d=t.jsx("p",{className:"text-sm text-muted-foreground",children:i}),e[4]=i,e[5]=d):d=e[5];let m;e[6]!==a?(m=a("mainPanelTabs.analyticsTab.installHostTitle"),e[6]=a,e[7]=m):m=e[7];let g;e[8]!==m?(g=t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:m}),e[8]=m,e[9]=g):g=e[9];let b;e[10]!==a?(b=a("mainPanelTabs.analyticsTab.installAuto"),e[10]=a,e[11]=b):b=e[11];let p;e[12]!==b?(p=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[12]=b,e[13]=p):p=e[13];let u;e[14]!==g||e[15]!==p?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[g,p]}),e[14]=g,e[15]=p,e[16]=u):u=e[16];let v;e[17]!==a?(v=a("mainPanelTabs.analyticsTab.installKeyTitle"),e[17]=a,e[18]=v):v=e[18];let h;e[19]!==v?(h=t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:v}),e[19]=v,e[20]=h):h=e[20];let y;e[21]!==o?(y=o&&t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/30 px-3 py-1.5",children:[t.jsx("code",{className:"overflow-x-auto text-xs text-foreground",children:o}),t.jsx(Xe,{text:o})]}),e[21]=o,e[22]=y):y=e[22];let x;e[23]!==s?(x=t.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[t.jsx("code",{className:"overflow-x-auto whitespace-pre-wrap break-all text-xs text-muted-foreground",children:s}),t.jsx(Xe,{text:s})]}),e[23]=s,e[24]=x):x=e[24];let j;e[25]!==a||e[26]!==o?(j=!o&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a("mainPanelTabs.analyticsTab.installTokenNote")}),e[25]=a,e[26]=o,e[27]=j):j=e[27];let f;e[28]!==h||e[29]!==y||e[30]!==x||e[31]!==j?(f=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[h,y,x,j]}),e[28]=h,e[29]=y,e[30]=x,e[31]=j,e[32]=f):f=e[32];let T;e[33]!==a?(T=a("mainPanelTabs.analyticsTab.installTrackPrefix"),e[33]=a,e[34]=T):T=e[34];let N;e[35]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"font-mono",children:"window.__dq"}),e[35]=N):N=e[35];let _;e[36]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("span",{className:"font-mono",children:"pageview()"}),e[36]=_):_=e[36];let S;e[37]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("span",{className:"font-mono",children:"track(name, props)"}),e[37]=S):S=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("span",{className:"font-mono",children:"purchase({…})"}),e[38]=P):P=e[38];let w;e[39]!==T?(w=t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T,N," —"," ",_,","," ",S,","," ",P,"."]}),e[39]=T,e[40]=w):w=e[40];let E;e[41]!==c||e[42]!==a?(E=c&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[a("mainPanelTabs.analyticsTab.installSiteId"),":"," ",t.jsx("span",{className:"font-mono text-foreground",children:c})]}),e[41]=c,e[42]=a,e[43]=E):E=e[43];let k;e[44]!==f||e[45]!==w||e[46]!==E||e[47]!==d||e[48]!==u?(k=t.jsxs("div",{className:"flex flex-col gap-4",children:[d,u,f,w,E]}),e[44]=f,e[45]=w,e[46]=E,e[47]=d,e[48]=u,e[49]=k):k=e[49];let $;return e[50]!==l||e[51]!==k?($=t.jsx(he,{title:l,children:k}),e[50]=l,e[51]=k,e[52]=$):$=e[52],$}function Xe(r){const e=ae.c(11),{text:n}=r,a=xe(),[c,o]=ne.useState(!1);let s;e[0]!==n?(s=()=>{navigator.clipboard?.writeText(n)?.then(()=>{o(!0),setTimeout(()=>o(!1),1500)},Ds)},e[0]=n,e[1]=s):s=e[1];let l;e[2]!==c?(l=c?t.jsx(wt,{className:"size-4"}):t.jsx(it,{className:"size-4"}),e[2]=c,e[3]=l):l=e[3];let i;e[4]!==c||e[5]!==a?(i=a(c?"mainPanelTabs.analyticsTab.copied":"mainPanelTabs.analyticsTab.copy"),e[4]=c,e[5]=a,e[6]=i):i=e[6];let d;return e[7]!==s||e[8]!==l||e[9]!==i?(d=t.jsxs(be,{variant:"ghost",size:"sm",onClick:s,children:[l,i]}),e[7]=s,e[8]=l,e[9]=i,e[10]=d):d=e[10],d}function Ds(){}function yt(r){const e=ae.c(27),{result:n,onDismiss:a}=r,c=xe();let o;e[0]!==n.notes?(o=n.notes??[],e[0]=n.notes,e[1]=o):o=e[1];const s=o,l=!!n.key;if(!l&&!n.snippet&&s.length===0)return null;let i;e[2]!==l||e[3]!==c?(i=c(l?"mainPanelTabs.analyticsTab.tokenTitle":"mainPanelTabs.analyticsTab.registeredOk"),e[2]=l,e[3]=c,e[4]=i):i=e[4];let d;e[5]!==i?(d=t.jsx("h3",{className:"text-sm font-medium text-foreground",children:i}),e[5]=i,e[6]=d):d=e[6];let m;e[7]!==c?(m=c("mainPanelTabs.analyticsTab.dismiss"),e[7]=c,e[8]=m):m=e[8];let g;e[9]!==a||e[10]!==m?(g=t.jsx(be,{variant:"ghost",size:"sm",onClick:a,children:m}),e[9]=a,e[10]=m,e[11]=g):g=e[11];let b;e[12]!==d||e[13]!==g?(b=t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d,g]}),e[12]=d,e[13]=g,e[14]=b):b=e[14];let p;e[15]!==l||e[16]!==c?(p=l&&t.jsx("p",{className:"text-xs text-muted-foreground",children:c("mainPanelTabs.analyticsTab.tokenOnce")}),e[15]=l,e[16]=c,e[17]=p):p=e[17];let u;e[18]!==n.snippet?(u=n.snippet&&t.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[t.jsx("code",{className:"overflow-x-auto whitespace-pre-wrap break-all text-xs text-muted-foreground",children:n.snippet}),t.jsx(Xe,{text:n.snippet})]}),e[18]=n.snippet,e[19]=u):u=e[19];let v;e[20]!==s?(v=s.length>0&&t.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(Os)}),e[20]=s,e[21]=v):v=e[21];let h;return e[22]!==b||e[23]!==p||e[24]!==u||e[25]!==v?(h=t.jsxs("section",{className:"flex flex-col gap-3 rounded-xl border border-primary/30 bg-primary/5 p-4",children:[b,p,u,v]}),e[22]=b,e[23]=p,e[24]=u,e[25]=v,e[26]=h):h=e[26],h}function Os(r,e){return t.jsx("li",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-700 dark:text-amber-400",children:r},e)}function qs(r){const e=ae.c(96),{base:n,orgSlug:a,site:c,host:o,onRegistered:s}=r,l=xe(),i=Ze();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=new Set(["core","commerce","vitals"]),e[0]=d):d=e[0];const[m,g]=ne.useState(d),[b,p]=ne.useState(""),[u,v]=ne.useState(!1),[h,y]=ne.useState("");let x;e[1]!==n?(x=C=>Ie(`${n}/analytics/register`,"POST",C),e[1]=n,e[2]=x):x=e[2];let j;e[3]!==s||e[4]!==a||e[5]!==i||e[6]!==c||e[7]!==l?(j=C=>{i.invalidateQueries({queryKey:Be.analyticsStatus(a,c)}),s(C),ge.success(l("mainPanelTabs.analyticsTab.toastRegistered"))},e[3]=s,e[4]=a,e[5]=i,e[6]=c,e[7]=l,e[8]=j):j=e[8];let f;e[9]!==x||e[10]!==j?(f={mutationFn:x,onSuccess:j,onError:zs},e[9]=x,e[10]=j,e[11]=f):f=e[11];const T=Fe(f);let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=C=>{C!=="core"&&g(G=>{const L=new Set(G);return L.has(C)?L.delete(C):L.add(C),L})},e[12]=N):N=e[12];const _=N;let S,P,w,E,k,$,K;if(e[13]!==h||e[14]!==o||e[15]!==b||e[16]!==T||e[17]!==m||e[18]!==l||e[19]!==u){P=h.split(/[\s,]+/).map(Ls).filter(Boolean),w=()=>{if(u){T.mutate({key:!0,domains:P,modules:[...m]});return}const G=b.trim();T.mutate({modules:[...m],...G?{host:G}:{}})};const C=b.trim()||o||l("mainPanelTabs.analyticsTab.registerHostFallback");S=he,e[27]!==l?(K=l("mainPanelTabs.analyticsTab.registerTitle"),e[27]=l,e[28]=K):K=e[28],$="flex flex-col gap-5",E="text-sm text-muted-foreground",k=l("mainPanelTabs.analyticsTab.registerDescription",{host:u?P[0]||"your domains":C}),e[13]=h,e[14]=o,e[15]=b,e[16]=T,e[17]=m,e[18]=l,e[19]=u,e[20]=S,e[21]=P,e[22]=w,e[23]=E,e[24]=k,e[25]=$,e[26]=K}else S=e[20],P=e[21],w=e[22],E=e[23],k=e[24],$=e[25],K=e[26];let A;e[29]!==E||e[30]!==k?(A=t.jsx("p",{className:E,children:k}),e[29]=E,e[30]=k,e[31]=A):A=e[31];let te;e[32]!==l?(te=l("mainPanelTabs.analyticsTab.modules"),e[32]=l,e[33]=te):te=e[33];let D;e[34]!==te?(D=t.jsx(Oe,{children:te}),e[34]=te,e[35]=D):D=e[35];let W;e[36]!==m||e[37]!==l?(W=mt.map(C=>{const G=C.key==="core",L=G||m.has(C.key);return t.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 hover:border-border/70",children:[t.jsx(Je,{checked:L,disabled:G,onCheckedChange:()=>_(C.key),className:"mt-0.5"}),t.jsxs("span",{className:"flex flex-col",children:[t.jsx("span",{className:"text-sm font-medium text-foreground",children:l(C.labelKey)}),t.jsx("span",{className:"text-xs text-muted-foreground",children:l(C.hintKey)})]})]},C.key)}),e[36]=m,e[37]=l,e[38]=W):W=e[38];let O;e[39]!==W?(O=t.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:W}),e[39]=W,e[40]=O):O=e[40];let Y;e[41]!==D||e[42]!==O?(Y=t.jsxs("div",{className:"flex flex-col gap-2",children:[D,O]}),e[41]=D,e[42]=O,e[43]=Y):Y=e[43];let M;e[44]===Symbol.for("react.memo_cache_sentinel")?(M=C=>v(!!C),e[44]=M):M=e[44];let X;e[45]!==u?(X=t.jsx(Je,{checked:u,onCheckedChange:M,className:"mt-0.5"}),e[45]=u,e[46]=X):X=e[46];let R;e[47]!==l?(R=l("mainPanelTabs.analyticsTab.registerByKey"),e[47]=l,e[48]=R):R=e[48];let F;e[49]!==R?(F=t.jsx("span",{className:"text-sm font-medium text-foreground",children:R}),e[49]=R,e[50]=F):F=e[50];let Z;e[51]!==l?(Z=l("mainPanelTabs.analyticsTab.registerByKeyHint"),e[51]=l,e[52]=Z):Z=e[52];let ee;e[53]!==Z?(ee=t.jsx("span",{className:"text-xs text-muted-foreground",children:Z}),e[53]=Z,e[54]=ee):ee=e[54];let I;e[55]!==F||e[56]!==ee?(I=t.jsxs("span",{className:"flex flex-col",children:[F,ee]}),e[55]=F,e[56]=ee,e[57]=I):I=e[57];let B;e[58]!==X||e[59]!==I?(B=t.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 hover:border-border/70",children:[X,I]}),e[58]=X,e[59]=I,e[60]=B):B=e[60];let V;e[61]!==h||e[62]!==o||e[63]!==b||e[64]!==l||e[65]!==u?(V=u?t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(Oe,{htmlFor:"analytics-domains",children:l("mainPanelTabs.analyticsTab.domainsLabel")}),t.jsx(Qe,{id:"analytics-domains",value:h,onChange:C=>y(C.target.value),placeholder:l("mainPanelTabs.analyticsTab.domainsPlaceholder"),className:"font-mono text-xs"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:l("mainPanelTabs.analyticsTab.domainsHint")})]}):!o&&t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(Oe,{htmlFor:"analytics-host",children:l("mainPanelTabs.analyticsTab.hostLabel")}),t.jsx(Qe,{id:"analytics-host",value:b,onChange:C=>p(C.target.value),placeholder:l("mainPanelTabs.analyticsTab.hostPlaceholder"),className:"font-mono text-xs"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:l("mainPanelTabs.analyticsTab.hostHint")})]}),e[61]=h,e[62]=o,e[63]=b,e[64]=l,e[65]=u,e[66]=V):V=e[66];let H;e[67]!==l?(H=l("mainPanelTabs.analyticsTab.registerInstallHint"),e[67]=l,e[68]=H):H=e[68];let q;e[69]!==H?(q=t.jsx("p",{className:"text-xs text-muted-foreground",children:H}),e[69]=H,e[70]=q):q=e[70];let U;e[71]!==P||e[72]!==o||e[73]!==b||e[74]!==T.isPending||e[75]!==u?(U=T.isPending||(u?P.length===0:!o&&!b.trim()),e[71]=P,e[72]=o,e[73]=b,e[74]=T.isPending,e[75]=u,e[76]=U):U=e[76];let Q;e[77]!==T.isPending||e[78]!==l?(Q=T.isPending?l("mainPanelTabs.analyticsTab.enabling"):l("mainPanelTabs.analyticsTab.enableAnalytics"),e[77]=T.isPending,e[78]=l,e[79]=Q):Q=e[79];let J;e[80]!==w||e[81]!==U||e[82]!==Q?(J=t.jsx("div",{className:"flex justify-end",children:t.jsx(be,{onClick:w,disabled:U,children:Q})}),e[80]=w,e[81]=U,e[82]=Q,e[83]=J):J=e[83];let se;e[84]!==A||e[85]!==Y||e[86]!==B||e[87]!==V||e[88]!==q||e[89]!==J||e[90]!==$?(se=t.jsxs("div",{className:$,children:[A,Y,B,V,q,J]}),e[84]=A,e[85]=Y,e[86]=B,e[87]=V,e[88]=q,e[89]=J,e[90]=$,e[91]=se):se=e[91];let le;return e[92]!==S||e[93]!==se||e[94]!==K?(le=t.jsx(S,{title:K,children:se}),e[92]=S,e[93]=se,e[94]=K,e[95]=le):le=e[95],le}function Ls(r){return r.trim()}function zs(r){return ge.error(Ve(r))}function Ms(r){const e=ae.c(108),{base:n,orgSlug:a,site:c,config:o,open:s,onOpenChange:l}=r,i=xe(),d=Ze();let m;e[0]!==o.modules?(m=o.modules??["core"],e[0]=o.modules,e[1]=m):m=e[1];let g;e[2]!==m?(g=new Set(m),e[2]=m,e[3]=g):g=e[3];const[b,p]=ne.useState(g);let u;e[4]!==o.sampling?(u=Math.round((o.sampling??1)*100),e[4]=o.sampling,e[5]=u):u=e[5];const[v,h]=ne.useState(String(u)),[y,x]=ne.useState(typeof o.quota=="number"&&o.quota>0?String(o.quota):"");let j;e[6]!==n?(j=z=>Ie(`${n}/analytics/config`,"PUT",z),e[6]=n,e[7]=j):j=e[7];let f;e[8]!==l||e[9]!==a||e[10]!==d||e[11]!==c||e[12]!==i?(f=()=>{d.invalidateQueries({queryKey:Be.analyticsStatus(a,c)}),ge.success(i("mainPanelTabs.analyticsTab.toastCollectionUpdated")),l(!1)},e[8]=l,e[9]=a,e[10]=d,e[11]=c,e[12]=i,e[13]=f):f=e[13];let T;e[14]!==j||e[15]!==f?(T={mutationFn:j,onSuccess:f,onError:Rs},e[14]=j,e[15]=f,e[16]=T):T=e[16];const N=Fe(T);let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=z=>{z!=="core"&&p(fe=>{const ue=new Set(fe);return ue.has(z)?ue.delete(z):ue.add(z),ue})},e[17]=_):_=e[17];const S=_;let P;e[18]!==y?(P=y.trim()===""?null:Number(y),e[18]=y,e[19]=P):P=e[19];const w=P,E=w!==null&&(!Number.isInteger(w)||w<1)?"Quota must be a positive whole number of events.":null;let k;e[20]!==o.quota||e[21]!==y?(k=y.trim()===""&&typeof o.quota=="number"&&o.quota>0,e[20]=o.quota,e[21]=y,e[22]=k):k=e[22];const $=k;let K;e[23]!==E||e[24]!==w||e[25]!==v||e[26]!==N||e[27]!==b?(K=()=>{if(E)return;const z=Number(v),fe=Number.isFinite(z)&&z>0?Math.min(z,100)/100:1;N.mutate({modules:[...b],sampling:fe,...w!==null?{quota:w}:{}})},e[23]=E,e[24]=w,e[25]=v,e[26]=N,e[27]=b,e[28]=K):K=e[28];const A=K;let te;e[29]!==i?(te=i("mainPanelTabs.analyticsTab.editTitle"),e[29]=i,e[30]=te):te=e[30];let D;e[31]!==te?(D=t.jsx(rt,{children:t.jsx(ot,{children:te})}),e[31]=te,e[32]=D):D=e[32];let W;e[33]!==i?(W=i("mainPanelTabs.analyticsTab.editModules"),e[33]=i,e[34]=W):W=e[34];let O;e[35]!==W?(O=t.jsx(Oe,{children:W}),e[35]=W,e[36]=O):O=e[36];let Y;e[37]!==b||e[38]!==i?(Y=mt.map(z=>{const fe=z.key==="core",ue=fe||b.has(z.key);return t.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border px-3 py-2 hover:border-border/70",children:[t.jsx(Je,{checked:ue,disabled:fe,onCheckedChange:()=>S(z.key)}),t.jsx("span",{className:"text-sm text-foreground",children:i(z.labelKey)})]},z.key)}),e[37]=b,e[38]=i,e[39]=Y):Y=e[39];let M;e[40]!==Y?(M=t.jsx("div",{className:"grid grid-cols-1 gap-2",children:Y}),e[40]=Y,e[41]=M):M=e[41];let X;e[42]!==O||e[43]!==M?(X=t.jsxs("div",{className:"flex flex-col gap-2",children:[O,M]}),e[42]=O,e[43]=M,e[44]=X):X=e[44];let R;e[45]!==i?(R=i("mainPanelTabs.analyticsTab.editSampling"),e[45]=i,e[46]=R):R=e[46];let F;e[47]!==R?(F=t.jsx(Oe,{htmlFor:"analytics-sampling",children:R}),e[47]=R,e[48]=F):F=e[48];let Z;e[49]===Symbol.for("react.memo_cache_sentinel")?(Z=z=>h(z.target.value),e[49]=Z):Z=e[49];let ee;e[50]!==v?(ee=t.jsx(Qe,{id:"analytics-sampling",type:"number",min:1,max:100,value:v,onChange:Z,className:"font-mono text-xs"}),e[50]=v,e[51]=ee):ee=e[51];let I;e[52]!==i?(I=i("mainPanelTabs.analyticsTab.editSamplingHint"),e[52]=i,e[53]=I):I=e[53];let B;e[54]!==I?(B=t.jsx("span",{className:"text-xs text-muted-foreground",children:I}),e[54]=I,e[55]=B):B=e[55];let V;e[56]!==F||e[57]!==ee||e[58]!==B?(V=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[F,ee,B]}),e[56]=F,e[57]=ee,e[58]=B,e[59]=V):V=e[59];let H;e[60]!==i?(H=i("mainPanelTabs.analyticsTab.monthlyQuota"),e[60]=i,e[61]=H):H=e[61];let q;e[62]!==H?(q=t.jsx(Oe,{htmlFor:"analytics-quota",children:H}),e[62]=H,e[63]=q):q=e[63];let U;e[64]!==i?(U=i("mainPanelTabs.analyticsTab.uncapped"),e[64]=i,e[65]=U):U=e[65];let Q;e[66]===Symbol.for("react.memo_cache_sentinel")?(Q=z=>x(z.target.value),e[66]=Q):Q=e[66];const J=E!=null;let se;e[67]!==y||e[68]!==U||e[69]!==J?(se=t.jsx(Qe,{id:"analytics-quota",type:"number",min:1,value:y,placeholder:U,onChange:Q,"aria-invalid":J,className:"font-mono text-xs"}),e[67]=y,e[68]=U,e[69]=J,e[70]=se):se=e[70];let le;e[71]!==$||e[72]!==E?(le=E?t.jsx("span",{className:"text-xs text-destructive",children:E}):$?t.jsx("span",{className:"text-xs text-amber-600 dark:text-amber-500",children:"Leaving this blank keeps the current cap — clearing a quota isn't a patch. Unregister + re-register to make it uncapped."}):t.jsx("span",{className:"text-xs text-muted-foreground",children:"Accepted events per calendar month. Once the reconciler flags the site as over, the collector drops further events. Blank = uncapped."}),e[71]=$,e[72]=E,e[73]=le):le=e[73];let C;e[74]!==q||e[75]!==se||e[76]!==le?(C=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,se,le]}),e[74]=q,e[75]=se,e[76]=le,e[77]=C):C=e[77];let G;e[78]!==X||e[79]!==V||e[80]!==C?(G=t.jsxs("div",{className:"flex flex-col gap-4",children:[X,V,C]}),e[78]=X,e[79]=V,e[80]=C,e[81]=G):G=e[81];let L;e[82]!==l?(L=()=>l(!1),e[82]=l,e[83]=L):L=e[83];const ze=N.isPending;let ie;e[84]!==i?(ie=i("mainPanelTabs.analyticsTab.cancel"),e[84]=i,e[85]=ie):ie=e[85];let re;e[86]!==N.isPending||e[87]!==L||e[88]!==ie?(re=t.jsx(be,{variant:"outline",type:"button",onClick:L,disabled:ze,children:ie}),e[86]=N.isPending,e[87]=L,e[88]=ie,e[89]=re):re=e[89];const ye=N.isPending||E!=null;let oe;e[90]!==N.isPending||e[91]!==i?(oe=N.isPending?i("mainPanelTabs.analyticsTab.saving"):i("mainPanelTabs.analyticsTab.save"),e[90]=N.isPending,e[91]=i,e[92]=oe):oe=e[92];let ce;e[93]!==A||e[94]!==ye||e[95]!==oe?(ce=t.jsx(be,{type:"button",onClick:A,disabled:ye,children:oe}),e[93]=A,e[94]=ye,e[95]=oe,e[96]=ce):ce=e[96];let de;e[97]!==re||e[98]!==ce?(de=t.jsxs(Ut,{children:[re,ce]}),e[97]=re,e[98]=ce,e[99]=de):de=e[99];let me;e[100]!==D||e[101]!==G||e[102]!==de?(me=t.jsxs(ct,{className:"sm:max-w-md",children:[D,G,de]}),e[100]=D,e[101]=G,e[102]=de,e[103]=me):me=e[103];let pe;return e[104]!==l||e[105]!==s||e[106]!==me?(pe=t.jsx(dt,{open:s,onOpenChange:l,children:me}),e[104]=l,e[105]=s,e[106]=me,e[107]=pe):pe=e[107],pe}function Rs(r){return ge.error(Ve(r))}function Fs(r){const e=ae.c(151),{base:n,orgSlug:a,site:c,status:o}=r,s=xe(),l=Ze(),i=o.config??{},d=i.enabled!==!1,[m,g]=ne.useState(!1),[b,p]=ne.useState(!1),[u,v]=ne.useState(null),h=(i.domains?.length??0)>0;let y;e[0]!==a||e[1]!==l||e[2]!==c?(y=()=>l.invalidateQueries({queryKey:Be.analyticsStatus(a,c)}),e[0]=a,e[1]=l,e[2]=c,e[3]=y):y=e[3];const x=y;let j;e[4]!==n?(j=()=>Ie(`${n}/analytics/rotate-key`,"POST"),e[4]=n,e[5]=j):j=e[5];let f;e[6]!==x||e[7]!==s?(f=Me=>{x(),v(Me),ge.success(s("mainPanelTabs.analyticsTab.toastTokenRotated"))},e[6]=x,e[7]=s,e[8]=f):f=e[8];let T;e[9]!==j||e[10]!==f?(T={mutationFn:j,onSuccess:f,onError:Hs},e[9]=j,e[10]=f,e[11]=T):T=e[11];const N=Fe(T);let _;e[12]!==n?(_=Me=>Ie(`${n}/analytics/disable`,"PUT",{enabled:Me}),e[12]=n,e[13]=_):_=e[13];let S;e[14]!==x||e[15]!==s?(S=()=>{x(),ge.success(s("mainPanelTabs.analyticsTab.toastCollectionUpdated"))},e[14]=x,e[15]=s,e[16]=S):S=e[16];let P;e[17]!==_||e[18]!==S?(P={mutationFn:_,onSuccess:S,onError:Vs},e[17]=_,e[18]=S,e[19]=P):P=e[19];const w=Fe(P);let E;e[20]!==n?(E=()=>Ie(`${n}/analytics`,"DELETE"),e[20]=n,e[21]=E):E=e[21];let k;e[22]!==x||e[23]!==p||e[24]!==s?(k=()=>{x(),ge.success(s("mainPanelTabs.analyticsTab.toastUnregistered")),p(!1)},e[22]=x,e[23]=p,e[24]=s,e[25]=k):k=e[25];let $;e[26]!==E||e[27]!==k?($={mutationFn:E,onSuccess:k,onError:Bs},e[26]=E,e[27]=k,e[28]=$):$=e[28];const K=Fe($),A=i.modules??["core"],te="flex flex-col gap-6";let D;e[29]!==u?(D=u&&t.jsx(yt,{result:u,onDismiss:()=>v(null)}),e[29]=u,e[30]=D):D=e[30];const W=he;let O;e[31]!==s?(O=s("mainPanelTabs.analyticsTab.collection"),e[31]=s,e[32]=O):O=e[32];const Y=d?"outline":"default";let M;e[33]!==d||e[34]!==w?(M=()=>w.mutate(!d),e[33]=d,e[34]=w,e[35]=M):M=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(Nt,{className:"size-4"}),e[36]=X):X=e[36];let R;e[37]!==d||e[38]!==s?(R=s(d?"mainPanelTabs.analyticsTab.pause":"mainPanelTabs.analyticsTab.resume"),e[37]=d,e[38]=s,e[39]=R):R=e[39];let F;e[40]!==Y||e[41]!==M||e[42]!==R||e[43]!==w.isPending?(F=t.jsxs(be,{size:"sm",variant:Y,disabled:w.isPending,onClick:M,children:[X,R]}),e[40]=Y,e[41]=M,e[42]=R,e[43]=w.isPending,e[44]=F):F=e[44];let Z;e[45]!==g?(Z=()=>g(!0),e[45]=g,e[46]=Z):Z=e[46];let ee;e[47]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx(Pt,{className:"size-4"}),e[47]=ee):ee=e[47];let I;e[48]!==s?(I=s("mainPanelTabs.analyticsTab.edit"),e[48]=s,e[49]=I):I=e[49];let B;e[50]!==Z||e[51]!==I?(B=t.jsxs(be,{size:"sm",variant:"ghost",onClick:Z,children:[ee,I]}),e[50]=Z,e[51]=I,e[52]=B):B=e[52];let V;e[53]!==h||e[54]!==N?(V=h&&t.jsxs(be,{size:"sm",variant:"ghost",disabled:N.isPending,onClick:()=>N.mutate(),children:[t.jsx(it,{className:"size-4"}),N.isPending?"Rotating…":"Rotate token"]}),e[53]=h,e[54]=N,e[55]=V):V=e[55];let H;e[56]!==s?(H=s("mainPanelTabs.analyticsTab.unregister"),e[56]=s,e[57]=H):H=e[57];let q;e[58]!==p?(q=()=>p(!0),e[58]=p,e[59]=q):q=e[59];let U;e[60]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(kt,{className:"size-4"}),e[60]=U):U=e[60];let Q;e[61]!==H||e[62]!==q?(Q=t.jsx(be,{size:"icon-sm",variant:"ghost","aria-label":H,className:"text-muted-foreground hover:text-destructive",onClick:q,children:U}),e[61]=H,e[62]=q,e[63]=Q):Q=e[63];let J;e[64]!==F||e[65]!==B||e[66]!==V||e[67]!==Q?(J=t.jsxs("div",{className:"flex items-center gap-1.5",children:[F,B,V,Q]}),e[64]=F,e[65]=B,e[66]=V,e[67]=Q,e[68]=J):J=e[68];const se="flex flex-col gap-3",le="flex flex-wrap items-center gap-2",C=d?"success":"outline";let G;e[69]!==d||e[70]!==s?(G=s(d?"mainPanelTabs.analyticsTab.active":"mainPanelTabs.analyticsTab.paused"),e[69]=d,e[70]=s,e[71]=G):G=e[71];let L;e[72]!==C||e[73]!==G?(L=t.jsx(Le,{variant:C,children:G}),e[72]=C,e[73]=G,e[74]=L):L=e[74];const ze=o.host??"—";let ie;e[75]!==s||e[76]!==ze?(ie=s("mainPanelTabs.analyticsTab.collectingUnder",{host:ze}),e[75]=s,e[76]=ze,e[77]=ie):ie=e[77];let re;e[78]!==ie?(re=t.jsx("span",{className:"text-sm text-muted-foreground",children:ie}),e[78]=ie,e[79]=re):re=e[79];const ye=i.id&&t.jsx("span",{className:"font-mono text-xs text-muted-foreground/80",children:s("mainPanelTabs.analyticsTab.idLabel",{id:i.id})});let oe;e[80]!==L||e[81]!==re||e[82]!==ye?(oe=t.jsxs("div",{className:le,children:[L,re,ye]}),e[80]=L,e[81]=re,e[82]=ye,e[83]=oe):oe=e[83];let ce;e[84]!==A?(ce=A.map(Is),e[84]=A,e[85]=ce):ce=e[85];let de;e[86]!==i.sampling||e[87]!==s?(de=typeof i.sampling=="number"&&i.sampling<1&&t.jsx(Le,{variant:"outline",children:s("mainPanelTabs.analyticsTab.sampling",{percent:String(Math.round(i.sampling*100))})}),e[86]=i.sampling,e[87]=s,e[88]=de):de=e[88];let me;e[89]!==ce||e[90]!==de?(me=t.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[ce,de]}),e[89]=ce,e[90]=de,e[91]=me):me=e[91];let pe;e[92]!==oe||e[93]!==me?(pe=t.jsxs("div",{className:se,children:[oe,me]}),e[92]=oe,e[93]=me,e[94]=pe):pe=e[94];let z;e[95]!==W||e[96]!==O||e[97]!==J||e[98]!==pe?(z=t.jsx(W,{title:O,action:J,children:pe}),e[95]=W,e[96]=O,e[97]=J,e[98]=pe,e[99]=z):z=e[99];let fe;e[100]!==o?(fe=t.jsx(As,{status:o}),e[100]=o,e[101]=fe):fe=e[101];let ue;e[102]!==n||e[103]!==i||e[104]!==m||e[105]!==a||e[106]!==g||e[107]!==c?(ue=t.jsx(Ms,{base:n,orgSlug:a,site:c,config:i,open:m,onOpenChange:g}),e[102]=n,e[103]=i,e[104]=m,e[105]=a,e[106]=g,e[107]=c,e[108]=ue):ue=e[108];let Te;e[109]!==s?(Te=s("mainPanelTabs.analyticsTab.unregisterTitle"),e[109]=s,e[110]=Te):Te=e[110];let ve;e[111]!==Te?(ve=t.jsx(Mt,{children:Te}),e[111]=Te,e[112]=ve):ve=e[112];let Ne;e[113]!==c||e[114]!==s?(Ne=s("mainPanelTabs.analyticsTab.unregisterDescription",{site:c}),e[113]=c,e[114]=s,e[115]=Ne):Ne=e[115];let Pe;e[116]!==Ne?(Pe=t.jsx(Rt,{children:Ne}),e[116]=Ne,e[117]=Pe):Pe=e[117];let we;e[118]!==ve||e[119]!==Pe?(we=t.jsxs(Ft,{children:[ve,Pe]}),e[118]=ve,e[119]=Pe,e[120]=we):we=e[120];const jt=K.isPending;let Se;e[121]!==s?(Se=s("mainPanelTabs.analyticsTab.cancel"),e[121]=s,e[122]=Se):Se=e[122];let ke;e[123]!==K.isPending||e[124]!==Se?(ke=t.jsx(It,{disabled:jt,children:Se}),e[123]=K.isPending,e[124]=Se,e[125]=ke):ke=e[125];let _e;e[126]!==K?(_e=Me=>{Me.preventDefault(),K.mutate()},e[126]=K,e[127]=_e):_e=e[127];let Ce;e[128]!==K.isPending||e[129]!==s?(Ce=K.isPending?s("mainPanelTabs.analyticsTab.unregistering"):s("mainPanelTabs.analyticsTab.unregister"),e[128]=K.isPending,e[129]=s,e[130]=Ce):Ce=e[130];let Ke;e[131]!==K.isPending||e[132]!==_e||e[133]!==Ce?(Ke=t.jsx(zt,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:_e,disabled:K.isPending,children:Ce}),e[131]=K.isPending,e[132]=_e,e[133]=Ce,e[134]=Ke):Ke=e[134];let Ee;e[135]!==ke||e[136]!==Ke?(Ee=t.jsxs(Bt,{children:[ke,Ke]}),e[135]=ke,e[136]=Ke,e[137]=Ee):Ee=e[137];let $e;e[138]!==we||e[139]!==Ee?($e=t.jsxs(Vt,{children:[we,Ee]}),e[138]=we,e[139]=Ee,e[140]=$e):$e=e[140];let Ae;e[141]!==b||e[142]!==p||e[143]!==$e?(Ae=t.jsx(Ht,{open:b,onOpenChange:p,children:$e}),e[141]=b,e[142]=p,e[143]=$e,e[144]=Ae):Ae=e[144];let He;return e[145]!==D||e[146]!==z||e[147]!==fe||e[148]!==ue||e[149]!==Ae?(He=t.jsxs("div",{className:te,children:[D,z,fe,ue,Ae]}),e[145]=D,e[146]=z,e[147]=fe,e[148]=ue,e[149]=Ae,e[150]=He):He=e[150],He}function Is(r){return t.jsx(Le,{variant:"secondary",children:r},r)}function Bs(r){return ge.error(Ve(r))}function Vs(r){return ge.error(Ve(r))}function Hs(r){return ge.error(Ve(r))}function Us(r){const e=ae.c(95),{base:n,orgSlug:a,site:c,status:o}=r,s=xe(),[l,i]=ne.useState("24h"),[d,m]=ne.useState("overview"),[g,b]=ne.useState(!1);let p,u,v,h,y,x,j,f,T,N;if(e[0]!==d||e[1]!==o.config||e[2]!==o.host||e[3]!==s){p=o.config??{};const C=p.enabled!==!1;v=p.modules??["core"],u=d==="live",N="flex flex-col gap-5",T="flex flex-wrap items-start justify-between gap-3",f="flex flex-col gap-2",h="flex flex-wrap items-center gap-2";const G=C?"success":"outline";let L;e[14]!==C||e[15]!==s?(L=s(C?"mainPanelTabs.analyticsTab.active":"mainPanelTabs.analyticsTab.paused"),e[14]=C,e[15]=s,e[16]=L):L=e[16],e[17]!==G||e[18]!==L?(y=t.jsx(Le,{variant:G,children:L}),e[17]=G,e[18]=L,e[19]=y):y=e[19],x=t.jsx("span",{className:"text-sm text-muted-foreground",children:s("mainPanelTabs.analyticsTab.collectingUnder",{host:o.host??p.id??"—"})}),j=p.id&&t.jsx("span",{className:"font-mono text-xs text-muted-foreground/70",children:s("mainPanelTabs.analyticsTab.idLabel",{id:p.id})}),e[0]=d,e[1]=o.config,e[2]=o.host,e[3]=s,e[4]=p,e[5]=u,e[6]=v,e[7]=h,e[8]=y,e[9]=x,e[10]=j,e[11]=f,e[12]=T,e[13]=N}else p=e[4],u=e[5],v=e[6],h=e[7],y=e[8],x=e[9],j=e[10],f=e[11],T=e[12],N=e[13];let _;e[20]!==h||e[21]!==y||e[22]!==x||e[23]!==j?(_=t.jsxs("div",{className:h,children:[y,x,j]}),e[20]=h,e[21]=y,e[22]=x,e[23]=j,e[24]=_):_=e[24];let S;e[25]!==v?(S=v.map(Qs),e[25]=v,e[26]=S):S=e[26];let P;e[27]!==p.sampling||e[28]!==s?(P=typeof p.sampling=="number"&&p.sampling<1&&t.jsx(Le,{variant:"outline",children:s("mainPanelTabs.analyticsTab.sampling",{percent:String(Math.round(p.sampling*100))})}),e[27]=p.sampling,e[28]=s,e[29]=P):P=e[29];let w;e[30]!==P||e[31]!==S?(w=t.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[S,P]}),e[30]=P,e[31]=S,e[32]=w):w=e[32];let E;e[33]!==w||e[34]!==f||e[35]!==_?(E=t.jsxs("div",{className:f,children:[_,w]}),e[33]=w,e[34]=f,e[35]=_,e[36]=E):E=e[36];let k;e[37]!==u||e[38]!==l?(k=!u&&t.jsx("div",{className:"flex items-center gap-0.5 rounded-lg border border-border p-0.5",children:ts.map(C=>t.jsx("button",{type:"button",onClick:()=>i(C),className:qe("rounded-md px-2 py-1 text-xs font-medium tabular-nums transition-colors",l===C?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:C},C))}),e[37]=u,e[38]=l,e[39]=k):k=e[39];let $,K;e[40]===Symbol.for("react.memo_cache_sentinel")?($=()=>b(!0),K=t.jsx(vt,{className:"size-4"}),e[40]=$,e[41]=K):($=e[40],K=e[41]);let A;e[42]!==s?(A=s("mainPanelTabs.analyticsTab.configSectionTitle"),e[42]=s,e[43]=A):A=e[43];let te;e[44]!==A?(te=t.jsxs(be,{variant:"outline",size:"sm",onClick:$,children:[K,A]}),e[44]=A,e[45]=te):te=e[45];let D;e[46]!==k||e[47]!==te?(D=t.jsxs("div",{className:"flex items-center gap-2",children:[k,te]}),e[46]=k,e[47]=te,e[48]=D):D=e[48];let W;e[49]!==E||e[50]!==D||e[51]!==T?(W=t.jsxs("div",{className:T,children:[E,D]}),e[49]=E,e[50]=D,e[51]=T,e[52]=W):W=e[52];let O;e[53]!==d||e[54]!==s?(O=es.map(C=>t.jsx("button",{type:"button",onClick:()=>m(C.view),className:qe("shrink-0 border-b-2 px-3 py-2 text-sm font-medium transition-colors",d===C.view?"border-[var(--chart-1)] text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:s(C.labelKey)},C.view)),e[53]=d,e[54]=s,e[55]=O):O=e[55];let Y;e[56]!==O?(Y=t.jsx("div",{className:"flex items-center gap-1 overflow-x-auto border-b border-border",children:O}),e[56]=O,e[57]=Y):Y=e[57];let M;e[58]!==d||e[59]!==n||e[60]!==p.quota||e[61]!==a||e[62]!==l||e[63]!==c?(M=t.jsx(Ks,{base:n,orgSlug:a,site:c,view:d,range:l,quota:p.quota},d),e[58]=d,e[59]=n,e[60]=p.quota,e[61]=a,e[62]=l,e[63]=c,e[64]=M):M=e[64];let X;e[65]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-4 py-3 text-sm font-medium text-foreground hover:bg-muted/40",children:[t.jsx(St,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-90"}),"Send custom events from your code"]}),e[65]=X):X=e[65];let R;e[66]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsxs("p",{children:["Analytics is active automatically — pageviews are collected with no code. For custom events, call the public client API on"," ",t.jsx("span",{className:"font-mono text-foreground",children:"window.__dq"}),":"]}),e[66]=R):R=e[66];let F;e[67]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("dt",{className:"font-mono text-xs text-foreground",children:"pageview()"}),t.jsx("dd",{className:"text-xs",children:"Record a pageview manually (SPA route change)."})]}),e[67]=F):F=e[67];let Z;e[68]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx("dt",{className:"font-mono text-xs text-foreground",children:"track(name, props?)"}),e[68]=Z):Z=e[68];let ee;e[69]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx("span",{className:"font-mono",children:"name"}),e[69]=ee):ee=e[69];let I;e[70]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsxs("div",{className:"flex flex-col gap-0.5",children:[Z,t.jsxs("dd",{className:"text-xs",children:["A custom event. ",ee," is lowercase a–z, digits and underscore, up to 40 characters;"," ",t.jsx("span",{className:"font-mono",children:"props"})," is an optional flat object."]})]}),e[70]=I):I=e[70];let B;e[71]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("dt",{className:"font-mono text-xs text-foreground",children:"purchase({ transactionId, value, currency, items, itemIds })"}),e[71]=B):B=e[71];let V;e[72]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs("dl",{className:"flex flex-col gap-2",children:[F,I,t.jsxs("div",{className:"flex flex-col gap-0.5",children:[B,t.jsxs("dd",{className:"text-xs",children:["A purchase. ",t.jsx("span",{className:"font-mono",children:"transactionId"})," ","dedupes a reloaded confirmation page so a sale isn't counted twice."]})]})]}),e[72]=V):V=e[72];let H;e[73]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsxs("details",{className:"group rounded-xl border border-border bg-card",children:[X,t.jsxs("div",{className:"flex flex-col gap-3 border-t border-border px-4 py-4 text-sm text-muted-foreground",children:[R,V,t.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2",children:t.jsx("code",{className:"whitespace-pre-wrap break-all text-xs text-muted-foreground",children:`window.__dq.track("newsletter_signup", { plan: "pro" })
2
- window.__dq.purchase({ transactionId: "A123", value: 99.9, currency: "BRL" })`})})]})]}),e[73]=H):H=e[73];let q;e[74]!==s?(q=s("mainPanelTabs.analyticsTab.configSectionTitle"),e[74]=s,e[75]=q):q=e[75];let U;e[76]!==q?(U=t.jsx(rt,{children:t.jsx(ot,{children:q})}),e[76]=q,e[77]=U):U=e[77];let Q;e[78]!==n||e[79]!==a||e[80]!==c||e[81]!==o?(Q=t.jsx(Fs,{base:n,orgSlug:a,site:c,status:o}),e[78]=n,e[79]=a,e[80]=c,e[81]=o,e[82]=Q):Q=e[82];let J;e[83]!==U||e[84]!==Q?(J=t.jsxs(ct,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[U,Q]}),e[83]=U,e[84]=Q,e[85]=J):J=e[85];let se;e[86]!==g||e[87]!==J?(se=t.jsx(dt,{open:g,onOpenChange:b,children:J}),e[86]=g,e[87]=J,e[88]=se):se=e[88];let le;return e[89]!==W||e[90]!==Y||e[91]!==M||e[92]!==se||e[93]!==N?(le=t.jsxs("div",{className:N,children:[W,Y,M,H,se]}),e[89]=W,e[90]=Y,e[91]=M,e[92]=se,e[93]=N,e[94]=le):le=e[94],le}function Qs(r){return t.jsx(Le,{variant:"secondary",children:r},r)}function sl(r){const e=ae.c(46),{virtualMcpId:n}=r,a=xe(),{org:c}=Tt(),o=Qt(n),s=Gt(o),l=!!s,i=s?`/api/${c.slug}/hosting/${encodeURIComponent(s)}`:"";let d;e[0]!==i?(d=()=>xt(`${i}/analytics/status`),e[0]=i,e[1]=d):d=e[1];const m=nt({queryKey:Be.analyticsStatus(c.slug,s??""),queryFn:d,enabled:l,retry:!1,staleTime:3e4}),[g,b]=ne.useState(null);if(!s){let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(De,{className:"size-5"}),e[2]=k):k=e[2];let $;e[3]!==a?($=a("mainPanelTabs.analyticsTab.noSiteTitle"),e[3]=a,e[4]=$):$=e[4];let K;e[5]!==a?(K=a("mainPanelTabs.analyticsTab.noSiteDescription"),e[5]=a,e[6]=K):K=e[6];let A;return e[7]!==$||e[8]!==K?(A=t.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:t.jsx(Re,{icon:k,title:$,description:K})}),e[7]=$,e[8]=K,e[9]=A):A=e[9],A}if(as(m.error)){let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(De,{className:"size-5"}),e[10]=k):k=e[10];let $;e[11]!==a?($=a("mainPanelTabs.analyticsTab.notConnectedTitle"),e[11]=a,e[12]=$):$=e[12];let K;e[13]!==a?(K=a("mainPanelTabs.analyticsTab.notConnectedDescription"),e[13]=a,e[14]=K):K=e[14];let A;return e[15]!==$||e[16]!==K?(A=t.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:t.jsx(Re,{icon:k,title:$,description:K})}),e[15]=$,e[16]=K,e[17]=A):A=e[17],A}let p;e[18]!==m.data?(p=m.data??{},e[18]=m.data,e[19]=p):p=e[19];const u=p,v="h-full min-h-0 overflow-y-auto",h="mx-auto flex w-full max-w-[1400px] flex-col gap-6 p-6",y="flex flex-col gap-1";let x;e[20]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(De,{className:"size-[18px] text-muted-foreground"}),e[20]=x):x=e[20];let j;e[21]!==a?(j=a("mainPanelTabs.analyticsTab.title"),e[21]=a,e[22]=j):j=e[22];let f;e[23]!==j?(f=t.jsxs("div",{className:"flex items-center gap-2",children:[x,t.jsx("h2",{className:"text-base font-semibold text-foreground",children:j})]}),e[23]=j,e[24]=f):f=e[24];const T="text-sm text-muted-foreground",N=a("mainPanelTabs.analyticsTab.subtitle",{site:s});let _;e[25]!==N?(_=t.jsx("p",{className:T,children:N}),e[25]=N,e[26]=_):_=e[26];let S;e[27]!==_||e[28]!==f?(S=t.jsxs("div",{className:y,children:[f,_]}),e[27]=_,e[28]=f,e[29]=S):S=e[29];let P;e[30]!==g||e[31]!==b?(P=g&&t.jsx(yt,{result:g,onDismiss:()=>b(null)}),e[30]=g,e[31]=b,e[32]=P):P=e[32];let w;e[33]!==i||e[34]!==c.slug||e[35]!==b||e[36]!==s||e[37]!==u||e[38]!==m.error||e[39]!==m.isLoading||e[40]!==a?(w=m.isLoading?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Ue,{className:"h-8 w-full"}),t.jsx(Ue,{className:"h-40 w-full"})]}):m.error?ut(m.error)?t.jsx(Re,{icon:t.jsx(De,{className:"size-5"}),title:a("mainPanelTabs.analyticsTab.backendNotConfiguredTitle"),description:a("mainPanelTabs.analyticsTab.backendNotConfiguredDescription")}):t.jsx(Re,{icon:t.jsx(De,{className:"size-5"}),title:a("mainPanelTabs.analyticsTab.statusError")}):u.configured===!1?t.jsx(Re,{icon:t.jsx(De,{className:"size-5"}),title:a("mainPanelTabs.analyticsTab.backendNotConfiguredTitle"),description:a("mainPanelTabs.analyticsTab.backendNotConfiguredDescription")}):u.registered?t.jsx(Us,{base:i,orgSlug:c.slug,site:s,status:u}):t.jsx(qs,{base:i,orgSlug:c.slug,site:s,host:u.host??null,onRegistered:b}),e[33]=i,e[34]=c.slug,e[35]=b,e[36]=s,e[37]=u,e[38]=m.error,e[39]=m.isLoading,e[40]=a,e[41]=w):w=e[41];let E;return e[42]!==S||e[43]!==P||e[44]!==w?(E=t.jsx("div",{className:v,children:t.jsxs("div",{className:h,children:[S,P,w]})}),e[42]=S,e[43]=P,e[44]=w,e[45]=E):E=e[45],E}export{sl as AnalyticsTab};
@@ -1 +0,0 @@
1
- import{c as o,j as r}from"./index-DSJbN5sX.js";import{O as m}from"./api-keys-DyU_J5NW.js";import{R as p}from"./require-capability-0WTmgba3.js";import"./AlertCircle-wAnOHADS.js";import"./Copy01-DBOM13CL.js";import"./Key01-BSosoP95.js";import"./Plus-BDOjM-y2.js";import"./Trash01-DXMXjB5D.js";import"./alert-dialog-BWLIdDXs.js";import"./dialog-BQdaXz76.js";import"./input-DkSSz62S.js";import"./label-Bl_k8voC.js";import"./use-mcp-client-ugccnX7P.js";import"./auth-BwvYRMCE.js";import"./access-gate-BPOiq9_Z.js";import"./capability-load-error-a_I2a1l9.js";function k(){const t=o.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(p,{capability:"api-keys:manage",area:"api-keys",children:r.jsx(m,{})}),t[0]=i):i=t[0],i}export{k as default};
@@ -1 +0,0 @@
1
- import{c as jt,b as Bt,r as A,j as o,l as _t,h as wt,t as ht}from"./index-DSJbN5sX.js";import{b as At}from"./chat-context-CKaeqWM1.js";import{i as Et}from"./ChevronRight-D2_fST_t.js";import{S as Nt}from"./scroll-area-DntxxD7t.js";import{u as Rt,A as Tt}from"./use-section-preview-base-Ch8Y1NGA.js";import{n as Ct,r as Kt,c as Pt,d as Ft,e as Ot,g as Ut,h as $t,S as It,i as zt,j as Lt}from"./index-DAXFi2r2.js";import"./use-panel-navigate-29aw_nLh.js";import"./use-destination-route-BpG33_Rz.js";import"./autosend-CgQ58D3w.js";import"./thread-intent-I39tMt_g.js";import"./slugify-CEUa2lfQ.js";import"./hooks-CL4RZ5Ud.js";import"./use-mcp-client-ugccnX7P.js";import"./auth-BwvYRMCE.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-Carp4gPN.js";import"./task-board-CeYV0m1B.js";import"./schema-CVuODHYG.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-BMf2s6FM.js";import"./use-ai-providers-BXegGRFX.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-BTkjtbaI.js";import"./thread-route-CZiD4-sf.js";import"./dialog-BQdaXz76.js";import"./Check-DwFkAzIE.js";import"./Copy01-DBOM13CL.js";import"./Download01-u2kBF-xv.js";import"./use-organization-settings-DQ5NNlS_.js";import"./select-qa0gsZOA.js";import"./ChevronUp-DNGcpflk.js";import"./agent-icon-1_qqvbMi.js";import"./AlertCircle-wAnOHADS.js";import"./Tool01-V0KS9Hy0.js";import"./ArrowUp-BlmUVKW6.js";import"./ArrowLeft-YvJ2QXtl.js";import"./Tool02-BgHxw_wF.js";import"./ArrowRight-jfYfDxSI.js";import"./TrendUp01-ACczpA6C.js";import"./ZoomOut-Dmwkd0k-.js";import"./Users03-DmY-Asfu.js";import"./CheckCircle-C2nq7B8n.js";import"./ChevronSelectorVertical-CgTde0Q8.js";import"./DotsVertical-Cz4ekipb.js";import"./UserSquare-CXfPKP7D.js";import"./CreditCard01-DGxkfyx2.js";import"./Settings02-CrEluPTC.js";import"./Eye-rOw56pjM.js";import"./Share07-Nzkr8YZ2.js";import"./GitBranch01-CEsq5yX5.js";import"./Globe01-CivtgibE.js";import"./XClose-CpE_1sco.js";import"./HardDrive-C2GoE6qs.js";import"./Image01-DBbKbwbi.js";import"./Key01-BSosoP95.js";import"./Link01-MZ7GmZHO.js";import"./LinkExternal01-73pMIgKV.js";import"./Monitor01-oRlaapId.js";import"./Sun-CCLPxWiv.js";import"./Package-BYp5l2E5.js";import"./Palette-8I2sDSog.js";import"./Play-B225dlHd.js";import"./Plus-BDOjM-y2.js";import"./SearchMd-BnqlK6CF.js";import"./Shield01-B_JxVlrS.js";import"./Stars01-mzby3j_o.js";import"./Trash01-DXMXjB5D.js";import"./Upload01-CeJJDeve.js";import"./User01-D2exKDPK.js";import"./Users01-Bab7B5hF.js";import"./XCircle-C5opwPs7.js";import"./Zap-CNl7K3Ps.js";import"./input-DkSSz62S.js";import"./automation-runs-BSJ95uvS.js";import"./useInfiniteQuery-C6DV2nJp.js";import"./infiniteQueryObserver-DaPsoYS0.js";import"./use-connection-BjftRlxd.js";import"./table-8P8-CnP6.js";import"./empty-state-A2iC04qV.js";import"./use-infinite-scroll-CJikc9M7.js";import"./use-members-B-dwONVd.js";import"./use-org-auth-client-C-qSuLQa.js";import"./use-automations-qIak6DkB.js";import"./useSuspenseInfiniteQuery-D1KypCHs.js";import"./avatar-a5vmNlMH.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-copy-DDzC9hsq.js";import"./markdown-BiPxNCWQ.js";import"./monaco-editor-CwveTNZd.js";import"./editor-fOvQUP8H.js";import"./mcp-app-renderer-tgQv33M8.js";import"./types-BXOVDPwd.js";import"./shell-layout-DWU--wrz.js";import"./project-icon-Bnqg1Jiw.js";import"./github-repo-CTPv5ZM2.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-D1-Cphh8.js";import"./index-B3MtcQ-S.js";import"./required-auth-layout-Cr1TIX0a.js";import"./use-org-sso-CojWQZss.js";import"./use-org-notice-DeJ9SvBl.js";import"./integration-icon-Dv6YqP4z.js";import"./use-navigate-to-agent-DZRUz-6p.js";import"./use-mcp-prompts-3syEb3Y2.js";import"./form-Ce74eqVN.js";import"./label-Bl_k8voC.js";import"./file-type-icon-Bc7yMTP-.js";import"./drawer-B_XZjJKQ.js";import"./collection-search-By0xSdXh.js";import"./tabs-Bwfyb1Oq.js";import"./toggle-group-DJyuyR_U.js";import"./task-route-TTh3aO1v.js";import"./extract-connection-data-CF8SetmF.js";import"./metadata-dUsYcpuu.js";import"./connection-DWNio8Hi.js";import"./connection-card-CP_282IY.js";import"./use-registry-connections-CGm4tLfp.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-D7q7zgt-.js";import"./connection-form-helpers-DSgbsNsY.js";import"./authenticate-and-persist-oauth-2hJV8I4L.js";import"./mcp-oauth-BWuSz_1R.js";import"./collection-tabs-CCFM8E8R.js";import"./badge-BviUmQbh.js";import"./use-file-configs-Brm2navQ.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-CHDCkiCh.js";import"./popover-CZSG5n66.js";import"./github-icon-BlqVDyFM.js";import"./get-initials-D-f_fDFw.js";import"./select-model-bI_cxMDh.js";import"./checkbox-gsIYGPP6.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-D8EtDac5.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DHEUPIVm.js";import"./toolbar-C1PA0ETD.js";import"./use-mcp-tools-J0fpFbFP.js";import"./skill-preview-sGMxy1K8.js";import"./use-date-fns-locale-BUydyvvo.js";import"./alert-dialog-BWLIdDXs.js";import"./use-debounced-autosave-C4Aw-mEx.js";import"./search-input-Ey5tt0Lo.js";import"./use-mcp-auth-status-BjyYQV9T.js";import"./switch-D38yrWy1.js";import"./breadcrumb-CQcXrrpt.js";import"./repository-import-picker-QtGWdk96.js";import"./repository-picker-CBC3P8G3.js";import"./use-debounced-value-BmfpPcXL.js";import"./use-secrets-CA0m3B3l.js";import"./client-icons-Ko4eYYhG.js";import"./connect-layout-BXqqP8fB.js";import"./self-tool-result-aFpcyvJC.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./track-EzTLxDrw.js";import"./use-tags-DB-qMcQS.js";import"./toolbar-icon-button-Dk-vpF8A.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-CnQFh_fA.js";import"./site-error--i37Vnuw.js";import"./cards-DIV1xWcp.js";function Vt(n,t){const m=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",s=Ct(t,i);return{blockKey:s,data:{__resolveType:n.resolveType,name:s}}}function Gr(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:s,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:Z,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,G=At()?.taskId??null,c=Bt();let N;t[0]!==H||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:H},t[0]=H,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==Z||t[4]!==a||t[5]!==v?(R=Kt(v,a,Z),t[3]=Z,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let T;t[7]!==b?(T=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=T):T=t[8];const J=T,dt=bt??(x?Pt(p,x,a):p);let C;t[9]!==s||t[10]!==m||t[11]!==i?(C={orgSlug:m,virtualMcpId:i,branch:s},t[9]=s,t[10]=m,t[11]=i,t[12]=C):C=t[12];const{save:S,flush:Q,isPending:W}=Ft(C);let K;t[13]!==s||t[14]!==m||t[15]!==i?(K={orgSlug:m,virtualMcpId:i,branch:s},t[13]=s,t[14]=m,t[15]=i,t[16]=K):K=t[16];const X=Ot(K);let P;t[17]!==S?(P=zt((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const Y=P,[vt,St]=A.useState(p),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let F;t[19]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[19]=F):F=t[19];const[g,xt]=A.useState(F),[ot,d]=A.useState(!1),O=A.useRef(null);vt!==p&&(St(p),ut(null),ft(Mt),xt([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const rt=U;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let $;t[24]!==rt||t[25]!==y?($={...rt,...y},t[24]=rt,t[25]=y,t[26]=$):$=t[26];const it=$;let I;t[27]!==p||t[28]!==v||t[29]!==S?(I=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=I):I=t[30];const mt=I;let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{xt(e)},t[31]=z):z=t[31];const E=z;let L;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=Vt(e,l);await X.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),Q()}catch(u){const f=u,kt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw ht.error(kt),f}},t[32]=l,t[33]=Q,t[34]=X,t[35]=c,t[36]=L):L=t[36];const k=L;let V;t[37]!==d?(V=e=>{O.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=O.current;if(r)try{await k(e,u=>{r(u),d(!1),O.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const pt=q,at=g.length>0?[dt,...g]:[],gt="flex h-full flex-col",yt="flex h-12 shrink-0 items-center justify-between border-b px-6",nt=at.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:at.map((e,r)=>{const u=r===at.length-1,f=Ut(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:$t(g,r)),ft(qt)},title:f,className:_t("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:dt});let j;t[42]!==W?(j=o.jsx(Lt,{isPending:W,isError:!1}),t[42]=W,t[43]=j):j=t[43];let B;t[44]!==nt||t[45]!==j?(B=o.jsxs("div",{className:yt,children:[nt,j]}),t[44]=nt,t[45]=j,t[46]=B):B=t[46];let _;t[47]!==p||t[48]!==s||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==mt||t[56]!==st||t[57]!==J||t[58]!==a||t[59]!==m||t[60]!==Y||t[61]!==b||t[62]!==D||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(_=o.jsx(Nt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(It,{schema:b,value:it,onChange:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:st,sandbox:{orgSlug:m,virtualMcpId:i,branch:s,threadId:G}},`${p}:${et}`):D?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(wt,{className:"size-4"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=s,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=mt,t[56]=st,t[57]=J,t[58]=a,t[59]=m,t[60]=Y,t[61]=b,t[62]=D,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=_):_=t[67];let w;t[68]!==ot||t[69]!==l||t[70]!==pt||t[71]!==a||t[72]!==h||t[73]!==d?(w=h&&o.jsx(Tt,{open:ot,onOpenChange:e=>{d(e),e||(O.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{pt(e)}}),t[68]=ot,t[69]=l,t[70]=pt,t[71]=a,t[72]=h,t[73]=d,t[74]=w):w=t[74];let M;return t[75]!==B||t[76]!==_||t[77]!==w?(M=o.jsxs("div",{className:gt,children:[B,_,w]}),t[75]=B,t[76]=_,t[77]=w,t[78]=M):M=t[78],M}function qt(n){return n+1}function Mt(n){return n+1}export{Gr as AppEditor};
@@ -1 +0,0 @@
1
- import{c as B,j as o,b as $,G as D,d as M,r as q,P as d,B as G,o as R}from"./index-DSJbN5sX.js";import{s as V}from"./Plus-BDOjM-y2.js";import{i as S}from"./Zap-CNl7K3Ps.js";import{S as F}from"./search-input-Ey5tt0Lo.js";import{E as T}from"./empty-state-A2iC04qV.js";import{c as H}from"./use-automations-qIak6DkB.js";import{u as J}from"./use-navigate-to-agent-DZRUz-6p.js";import{A as K}from"./automation-list-row-CnQFh_fA.js";import{s as O}from"./use-mcp-client-ugccnX7P.js";import{a as Q}from"./use-virtual-mcp-BMf2s6FM.js";import{R as U}from"./require-capability-0WTmgba3.js";import"./SearchMd-BnqlK6CF.js";import"./use-destination-route-BpG33_Rz.js";import"./hooks-CL4RZ5Ud.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-Carp4gPN.js";import"./task-board-CeYV0m1B.js";import"./schema-CVuODHYG.js";import"./thread-intent-I39tMt_g.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-CTPv5ZM2.js";import"./alert-dialog-BWLIdDXs.js";import"./dropdown-menu-CHDCkiCh.js";import"./Check-DwFkAzIE.js";import"./ChevronRight-D2_fST_t.js";import"./DotsVertical-Cz4ekipb.js";import"./agent-icon-1_qqvbMi.js";import"./AlertCircle-wAnOHADS.js";import"./Tool01-V0KS9Hy0.js";import"./ArrowUp-BlmUVKW6.js";import"./ArrowLeft-YvJ2QXtl.js";import"./Tool02-BgHxw_wF.js";import"./ArrowRight-jfYfDxSI.js";import"./TrendUp01-ACczpA6C.js";import"./ZoomOut-Dmwkd0k-.js";import"./Users03-DmY-Asfu.js";import"./CheckCircle-C2nq7B8n.js";import"./ChevronUp-DNGcpflk.js";import"./ChevronSelectorVertical-CgTde0Q8.js";import"./UserSquare-CXfPKP7D.js";import"./Copy01-DBOM13CL.js";import"./CreditCard01-DGxkfyx2.js";import"./Download01-u2kBF-xv.js";import"./Settings02-CrEluPTC.js";import"./Eye-rOw56pjM.js";import"./Share07-Nzkr8YZ2.js";import"./GitBranch01-CEsq5yX5.js";import"./Globe01-CivtgibE.js";import"./XClose-CpE_1sco.js";import"./HardDrive-C2GoE6qs.js";import"./Image01-DBbKbwbi.js";import"./Key01-BSosoP95.js";import"./Link01-MZ7GmZHO.js";import"./LinkExternal01-73pMIgKV.js";import"./Monitor01-oRlaapId.js";import"./Sun-CCLPxWiv.js";import"./Package-BYp5l2E5.js";import"./Palette-8I2sDSog.js";import"./Play-B225dlHd.js";import"./Shield01-B_JxVlrS.js";import"./Stars01-mzby3j_o.js";import"./Trash01-DXMXjB5D.js";import"./Upload01-CeJJDeve.js";import"./User01-D2exKDPK.js";import"./Users01-Bab7B5hF.js";import"./XCircle-C5opwPs7.js";import"./auth-BwvYRMCE.js";import"./access-gate-BPOiq9_Z.js";import"./capability-load-error-a_I2a1l9.js";function W(){const t=B.c(20),e=$(),{org:l}=D(),{data:C}=H(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=M(),[x,E]=q.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(l.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{panel:`automation:${i}`})};let c;t[0]!==f||t[1]!==l.slug?(c=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:l.slug}})},t[0]=f,t[1]=l.slug,t[2]=c):c=t[2];const L=c,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(F,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(G,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function go(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{go as default};
@@ -1 +0,0 @@
1
- import{c as X,r as k,l as Y,j as t,b as Z,B as $,h as _,t as H}from"./index-DSJbN5sX.js";import{b as K}from"./chat-context-CKaeqWM1.js";import{i as tt}from"./ArrowRight-jfYfDxSI.js";import{i as U}from"./ZoomOut-Dmwkd0k-.js";import{n as ot}from"./LinkExternal01-73pMIgKV.js";import{bn as et}from"./agent-icon-1_qqvbMi.js";import{A as rt,a as it,b as st,c as at,d as nt,e as mt,f as lt,g as pt}from"./alert-dialog-BWLIdDXs.js";import{I as W}from"./input-DkSSz62S.js";import{L as M}from"./label-Bl_k8voC.js";import{e as ct,v as dt,w as ut,a5 as gt,j as xt,y as A,H as ft,a6 as ht,z as yt}from"./index-DAXFi2r2.js";import{c as bt,B as jt,a as vt}from"./block-document-BGMqKnaG.js";import{u as Et}from"./use-autosave-B4nxcOu-.js";import{t as Ct}from"./ChevronUp-DNGcpflk.js";import{al as Nt,am as St,an as wt}from"./automation-runs-BSJ95uvS.js";import{s as j,E as kt}from"./primitives-DYG4k0xC.js";import"./use-panel-navigate-29aw_nLh.js";import"./use-destination-route-BpG33_Rz.js";import"./autosend-CgQ58D3w.js";import"./thread-intent-I39tMt_g.js";import"./slugify-CEUa2lfQ.js";import"./hooks-CL4RZ5Ud.js";import"./use-mcp-client-ugccnX7P.js";import"./auth-BwvYRMCE.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-Carp4gPN.js";import"./task-board-CeYV0m1B.js";import"./schema-CVuODHYG.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-BMf2s6FM.js";import"./use-ai-providers-BXegGRFX.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-BTkjtbaI.js";import"./thread-route-CZiD4-sf.js";import"./dialog-BQdaXz76.js";import"./Check-DwFkAzIE.js";import"./Copy01-DBOM13CL.js";import"./Download01-u2kBF-xv.js";import"./use-organization-settings-DQ5NNlS_.js";import"./AlertCircle-wAnOHADS.js";import"./Tool01-V0KS9Hy0.js";import"./ArrowUp-BlmUVKW6.js";import"./ArrowLeft-YvJ2QXtl.js";import"./Tool02-BgHxw_wF.js";import"./TrendUp01-ACczpA6C.js";import"./Users03-DmY-Asfu.js";import"./CheckCircle-C2nq7B8n.js";import"./ChevronRight-D2_fST_t.js";import"./ChevronSelectorVertical-CgTde0Q8.js";import"./DotsVertical-Cz4ekipb.js";import"./UserSquare-CXfPKP7D.js";import"./CreditCard01-DGxkfyx2.js";import"./Settings02-CrEluPTC.js";import"./Eye-rOw56pjM.js";import"./Share07-Nzkr8YZ2.js";import"./GitBranch01-CEsq5yX5.js";import"./Globe01-CivtgibE.js";import"./XClose-CpE_1sco.js";import"./HardDrive-C2GoE6qs.js";import"./Image01-DBbKbwbi.js";import"./Key01-BSosoP95.js";import"./Link01-MZ7GmZHO.js";import"./Monitor01-oRlaapId.js";import"./Sun-CCLPxWiv.js";import"./Package-BYp5l2E5.js";import"./Palette-8I2sDSog.js";import"./Play-B225dlHd.js";import"./Plus-BDOjM-y2.js";import"./SearchMd-BnqlK6CF.js";import"./Shield01-B_JxVlrS.js";import"./Stars01-mzby3j_o.js";import"./Trash01-DXMXjB5D.js";import"./Upload01-CeJJDeve.js";import"./User01-D2exKDPK.js";import"./Users01-Bab7B5hF.js";import"./XCircle-C5opwPs7.js";import"./Zap-CNl7K3Ps.js";import"./drawer-B_XZjJKQ.js";import"./collection-search-By0xSdXh.js";import"./use-mcp-prompts-3syEb3Y2.js";import"./shell-layout-DWU--wrz.js";import"./avatar-a5vmNlMH.js";import"./project-icon-Bnqg1Jiw.js";import"./github-repo-CTPv5ZM2.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-D1-Cphh8.js";import"./index-B3MtcQ-S.js";import"./required-auth-layout-Cr1TIX0a.js";import"./use-org-sso-CojWQZss.js";import"./use-org-notice-DeJ9SvBl.js";import"./form-Ce74eqVN.js";import"./select-qa0gsZOA.js";import"./tabs-Bwfyb1Oq.js";import"./toggle-group-DJyuyR_U.js";import"./task-route-TTh3aO1v.js";import"./extract-connection-data-CF8SetmF.js";import"./metadata-dUsYcpuu.js";import"./connection-DWNio8Hi.js";import"./connection-card-CP_282IY.js";import"./use-registry-connections-CGm4tLfp.js";import"./use-connection-BjftRlxd.js";import"./useInfiniteQuery-C6DV2nJp.js";import"./infiniteQueryObserver-DaPsoYS0.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-Dv6YqP4z.js";import"./textarea-D7q7zgt-.js";import"./connection-form-helpers-DSgbsNsY.js";import"./authenticate-and-persist-oauth-2hJV8I4L.js";import"./mcp-oauth-BWuSz_1R.js";import"./collection-tabs-CCFM8E8R.js";import"./badge-BviUmQbh.js";import"./use-infinite-scroll-CJikc9M7.js";import"./useSuspenseInfiniteQuery-D1KypCHs.js";import"./use-file-configs-Brm2navQ.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-CHDCkiCh.js";import"./popover-CZSG5n66.js";import"./github-icon-BlqVDyFM.js";import"./get-initials-D-f_fDFw.js";import"./select-model-bI_cxMDh.js";import"./checkbox-gsIYGPP6.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-D8EtDac5.js";import"./question-004-sINsf4GQ.js";import"./use-members-B-dwONVd.js";import"./use-org-auth-client-C-qSuLQa.js";import"./use-navigate-to-agent-DZRUz-6p.js";import"./use-status-sounds-DHEUPIVm.js";import"./empty-state-A2iC04qV.js";import"./toolbar-C1PA0ETD.js";import"./use-mcp-tools-J0fpFbFP.js";import"./types-BXOVDPwd.js";import"./file-type-icon-Bc7yMTP-.js";import"./skill-preview-sGMxy1K8.js";import"./markdown-BiPxNCWQ.js";import"./editor-fOvQUP8H.js";import"./use-date-fns-locale-BUydyvvo.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-debounced-autosave-C4Aw-mEx.js";import"./scroll-area-DntxxD7t.js";import"./search-input-Ey5tt0Lo.js";import"./use-mcp-auth-status-BjyYQV9T.js";import"./switch-D38yrWy1.js";import"./breadcrumb-CQcXrrpt.js";import"./repository-import-picker-QtGWdk96.js";import"./repository-picker-CBC3P8G3.js";import"./use-debounced-value-BmfpPcXL.js";import"./use-secrets-CA0m3B3l.js";import"./client-icons-Ko4eYYhG.js";import"./format-time-BtXRrtv4.js";import"./connect-layout-BXqqP8fB.js";import"./self-tool-result-aFpcyvJC.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./track-EzTLxDrw.js";import"./use-tags-DB-qMcQS.js";import"./use-copy-DDzC9hsq.js";import"./toolbar-icon-button-Dk-vpF8A.js";import"./monaco-editor-CwveTNZd.js";import"./safe-image-url-D5z803Ot.js";import"./use-automations-qIak6DkB.js";import"./automation-list-row-CnQFh_fA.js";import"./site-error--i37Vnuw.js";import"./cards-DIV1xWcp.js";import"./table-8P8-CnP6.js";import"./mcp-app-renderer-tgQv33M8.js";function Pt(h){const o=X.c(18),{icon:d,title:n,defaultOpen:v,children:u}=h,P=v===void 0?!1:v,[g,D]=k.useState(P);let m;o[0]!==d?(m=t.jsx(d,{size:15}),o[0]=d,o[1]=m):m=o[1];let r;o[2]!==n?(r=t.jsx("span",{className:"flex-1 text-left",children:n}),o[2]=n,o[3]=r):r=o[3];const y=g&&"rotate-180";let s;o[4]!==y?(s=Y("transition-transform",y),o[4]=y,o[5]=s):s=o[5];let l;o[6]!==s?(l=t.jsx(Ct,{size:15,className:s}),o[6]=s,o[7]=l):l=o[7];let p;o[8]!==m||o[9]!==r||o[10]!==l?(p=t.jsx(Nt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[m,r,l]})}),o[8]=m,o[9]=r,o[10]=l,o[11]=p):p=o[11];let i;o[12]!==u?(i=t.jsx(St,{className:"px-2 pt-4",children:u}),o[12]=u,o[13]=i):i=o[13];let x;return o[14]!==g||o[15]!==p||o[16]!==i?(x=t.jsxs(wt,{open:g,onOpenChange:D,className:"mt-4",children:[p,i]}),o[14]=g,o[15]=p,o[16]=i,o[17]=x):x=o[17],x}function Fr({orgSlug:h,virtualMcpId:o,branch:d,blockKey:n,block:v,decofile:u,meta:P,onManagePosts:g,onOpenPost:D,previewBaseUrl:m}){const r=Z(),y=K()?.taskId??null,s=ct({orgSlug:h,virtualMcpId:o,branch:d}),l=dt({orgSlug:h,virtualMcpId:o,branch:d}),p=ut(v,"categories"),[i,x,q]=Et(p,e=>{s.mutate({blockKey:n,data:A(n,"categories",e)})}),E=(e,w)=>x({...i,[e]:w}),z=bt({decofile:u,category:i,previewBaseUrl:m,draftPointer:l}),a=j(i.slug),[B,b]=k.useState(a),[c,C]=k.useState(null),[N,T]=k.useState(!1),F=a?gt(u).filter(e=>e.categorySlugs.includes(a)):[],S=F.length,G=e=>E("slug",e),J=async(e,w)=>{const V=j(i.name);T(!0);try{let f=0;for(const{key:R,payload:I}of ft(u,"posts")){const L=ht(I,e,{name:V,slug:w});L!==I&&(await s.mutateAsync({blockKey:R,data:A(R,"posts",yt(L))}),f+=1)}const O={...i,slug:w};await s.mutateAsync({blockKey:n,data:A(n,"categories",O)}),q(O),H.success(f>0?r("sandbox.categoryEditor.renameSuccessWithPosts",{count:String(f)}):r("sandbox.categoryEditor.renameSuccessNoPosts")),C(null)}catch(f){b(e),C(null),H.error(f instanceof Error?f.message:r("sandbox.categoryEditor.renameFailed"))}finally{T(!1)}},Q=()=>{const e=B.trim();if(e===a){B!==e&&b(e);return}if(!e){b(a);return}if(S===0){G(e);return}C({oldSlug:a,newSlug:e,count:S})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:j(i.name)||r("sandbox.categoryEditor.untitledCategory")}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(xt,{isPending:s.isPending,isError:s.isError}),z&&t.jsxs($,{type:"button",variant:"outline",size:"sm",title:r("sandbox.categoryEditor.previewTooltip"),onClick:()=>window.open(z,"_blank","noopener,noreferrer"),children:[t.jsx(ot,{size:14}),r("sandbox.categoryEditor.seeCategoryPreview")]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(kt,{value:j(i.name),onChange:e=>E("name",e),placeholder:r("sandbox.categoryEditor.categoryNamePlaceholder"),className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-slug",children:r("sandbox.categoryEditor.slugLabel")}),t.jsx(W,{id:"category-slug",value:B,onChange:e=>b(e.target.value),onBlur:Q,placeholder:r("sandbox.categoryEditor.slugPlaceholder"),className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-description",children:r("sandbox.categoryEditor.descriptionLabel")}),t.jsx(W,{id:"category-description",value:j(i.description),onChange:e=>E("description",e.target.value),placeholder:r("sandbox.categoryEditor.descriptionPlaceholder"),className:"h-10"})]}),t.jsx(Pt,{icon:et,title:r("sandbox.categoryEditor.contentTitle"),defaultOpen:!0,children:t.jsx(jt,{value:vt(i.sections),onChange:e=>E("sections",e),meta:P,sandboxRef:{orgSlug:h,virtualMcpId:o,branch:d,threadId:y},emptyMessage:r("sandbox.categoryEditor.noContentEmpty")})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(U,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:r("sandbox.categoryEditor.postsInCategory",{count:String(S)})})]}),t.jsxs($,{type:"button",variant:"outline",size:"sm",disabled:!a,title:r(a?"sandbox.categoryEditor.pickPostsTooltip":"sandbox.categoryEditor.setSlugTooltip"),onClick:()=>g(a),children:[r("sandbox.categoryEditor.addPostsButton"),t.jsx(tt,{size:14})]})]}),S>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:F.map(e=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>D(e.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(U,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:e.title||r("sandbox.categoryEditor.untitledPost")}),e.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:e.slug})]})]})},e.key))})]})]})})]}),t.jsx(rt,{open:!!c,onOpenChange:e=>{e||N||(b(a),C(null))},children:t.jsxs(it,{children:[t.jsxs(st,{children:[t.jsx(at,{children:r("sandbox.categoryEditor.renameDialogTitle")}),t.jsx(nt,{children:c?r("sandbox.categoryEditor.renameDialogDescription",{oldSlug:c.oldSlug,newSlug:c.newSlug,count:String(c.count)}):null})]}),t.jsxs(mt,{children:[t.jsx(lt,{disabled:N,children:r("sandbox.categoryEditor.cancelButton")}),t.jsx(pt,{onClick:e=>{e.preventDefault(),c&&J(c.oldSlug,c.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(_,{className:"size-3.5"}),r("sandbox.categoryEditor.renamingLabel")]}):r("sandbox.categoryEditor.renameActionButton")})]})]})})]})}export{Fr as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as y,j as s,u as w,b as S,d as T,B as v,y as $,N as C,m as A,K as F,h as I}from"./index-DSJbN5sX.js";import{D as K}from"./use-destination-route-BpG33_Rz.js";import{A as _}from"./agent-icon-1_qqvbMi.js";import{R as P}from"./required-auth-layout-Cr1TIX0a.js";import"./AlertCircle-wAnOHADS.js";import"./Tool01-V0KS9Hy0.js";import"./ArrowUp-BlmUVKW6.js";import"./ArrowLeft-YvJ2QXtl.js";import"./Tool02-BgHxw_wF.js";import"./ArrowRight-jfYfDxSI.js";import"./TrendUp01-ACczpA6C.js";import"./ZoomOut-Dmwkd0k-.js";import"./Users03-DmY-Asfu.js";import"./CheckCircle-C2nq7B8n.js";import"./Check-DwFkAzIE.js";import"./ChevronUp-DNGcpflk.js";import"./ChevronRight-D2_fST_t.js";import"./ChevronSelectorVertical-CgTde0Q8.js";import"./DotsVertical-Cz4ekipb.js";import"./UserSquare-CXfPKP7D.js";import"./Copy01-DBOM13CL.js";import"./CreditCard01-DGxkfyx2.js";import"./Download01-u2kBF-xv.js";import"./Settings02-CrEluPTC.js";import"./Eye-rOw56pjM.js";import"./Share07-Nzkr8YZ2.js";import"./GitBranch01-CEsq5yX5.js";import"./Globe01-CivtgibE.js";import"./XClose-CpE_1sco.js";import"./HardDrive-C2GoE6qs.js";import"./Image01-DBbKbwbi.js";import"./Key01-BSosoP95.js";import"./Link01-MZ7GmZHO.js";import"./LinkExternal01-73pMIgKV.js";import"./Monitor01-oRlaapId.js";import"./Sun-CCLPxWiv.js";import"./Package-BYp5l2E5.js";import"./Palette-8I2sDSog.js";import"./Play-B225dlHd.js";import"./Plus-BDOjM-y2.js";import"./SearchMd-BnqlK6CF.js";import"./Shield01-B_JxVlrS.js";import"./Stars01-mzby3j_o.js";import"./Trash01-DXMXjB5D.js";import"./Upload01-CeJJDeve.js";import"./User01-D2exKDPK.js";import"./Users01-Bab7B5hF.js";import"./XCircle-C5opwPs7.js";import"./Zap-CNl7K3Ps.js";async function k(t){const e=new URLSearchParams({site:t}),l=await fetch(`/api/_editor-resolve?${e.toString()}`,{headers:{Accept:"application/json"}});if(!l.ok){const r=new Error(`editor-resolve HTTP ${l.status}`);throw r.status=l.status,r}return await l.json()}function R(t){const e=t?.status;return typeof e=="number"&&e>=400&&e<500}const N=$("content");function L(t){return{...t.pageId?{contentPageId:t.pageId}:{},...t.path?{contentPath:t.path}:{},...t.pathTemplate?{contentPathTemplate:t.pathTemplate}:{}}}function b(t){const e=y.c(2),{children:l}=t;let r;return e[0]!==l?(r=s.jsx("div",{className:"flex min-h-screen w-full items-center justify-center bg-background p-6",children:s.jsx("div",{className:"flex w-full max-w-md flex-col items-center gap-6 text-center",children:l})}),e[0]=l,e[1]=r):r=e[1],r}function q(){const t=y.c(5),e=S();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(I,{className:"size-6 text-muted-foreground"}),t[0]=l):l=t[0];let r;t[1]!==e?(r=e("chooseEditor.resolving"),t[1]=e,t[2]=r):r=t[2];let i;return t[3]!==r?(i=s.jsxs(b,{children:[l,s.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),t[3]=r,t[4]=i):i=t[4],i}function E(t){const e=y.c(29),{titleKey:l,descriptionKey:r,onRetry:i}=t,n=S(),p=T();let a;e[0]!==n||e[1]!==l?(a=n(l),e[0]=n,e[1]=l,e[2]=a):a=e[2];let u;e[3]!==a?(u=s.jsx("h1",{className:"text-lg font-medium text-foreground",children:a}),e[3]=a,e[4]=u):u=e[4];let d;e[5]!==r||e[6]!==n?(d=n(r),e[5]=r,e[6]=n,e[7]=d):d=e[7];let m;e[8]!==d?(m=s.jsx("p",{className:"text-sm text-muted-foreground",children:d}),e[8]=d,e[9]=m):m=e[9];let c;e[10]!==u||e[11]!==m?(c=s.jsxs("div",{className:"flex flex-col gap-2",children:[u,m]}),e[10]=u,e[11]=m,e[12]=c):c=e[12];let f;e[13]!==i||e[14]!==n?(f=i?s.jsx(v,{variant:"outline",onClick:i,children:n("chooseEditor.retry")}):null,e[13]=i,e[14]=n,e[15]=f):f=e[15];let o;e[16]!==p?(o=()=>p({to:"/"}),e[16]=p,e[17]=o):o=e[17];let g;e[18]!==n?(g=n("chooseEditor.backToStudio"),e[18]=n,e[19]=g):g=e[19];let j;e[20]!==o||e[21]!==g?(j=s.jsx(v,{onClick:o,children:g}),e[20]=o,e[21]=g,e[22]=j):j=e[22];let x;e[23]!==f||e[24]!==j?(x=s.jsxs("div",{className:"flex items-center gap-2",children:[f,j]}),e[23]=f,e[24]=j,e[25]=x):x=e[25];let h;return e[26]!==x||e[27]!==c?(h=s.jsxs(b,{children:[c,x]}),e[26]=x,e[27]=c,e[28]=h):h=e[28],h}function D(t){const e=y.c(8),{orgSlug:l,projectId:r,pageSearch:i}=t;let n;e[0]!==l?(n={org:l,panel:N.panel},e[0]=l,e[1]=n):n=e[1];let p;e[2]!==i||e[3]!==r?(p={...i,...N.payload,virtualmcpid:r},e[2]=i,e[3]=r,e[4]=p):p=e[4];let a;return e[5]!==n||e[6]!==p?(a=s.jsx(C,{to:K.agents,params:n,search:p,replace:!0}),e[5]=n,e[6]=p,e[7]=a):a=e[7],a}function O(t){const e=y.c(26),{matches:l,pageSearch:r}=t,i=S(),n=T();let p;e[0]!==n||e[1]!==r?(p=x=>{n({to:K.agents,params:{org:x.orgSlug,panel:N.panel},search:{...r,...N.payload,virtualmcpid:x.project.id}})},e[0]=n,e[1]=r,e[2]=p):p=e[2];const a=p;let u;e[3]!==i?(u=i("chooseEditor.chooser.title"),e[3]=i,e[4]=u):u=e[4];let d;e[5]!==u?(d=s.jsx("h1",{className:"text-lg font-medium text-foreground",children:u}),e[5]=u,e[6]=d):d=e[6];let m;e[7]!==i?(m=i("chooseEditor.chooser.subtitle"),e[7]=i,e[8]=m):m=e[8];let c;e[9]!==m?(c=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[9]=m,e[10]=c):c=e[10];let f;e[11]!==d||e[12]!==c?(f=s.jsxs("div",{className:"flex flex-col gap-2",children:[d,c]}),e[11]=d,e[12]=c,e[13]=f):f=e[13];let o;if(e[14]!==l||e[15]!==a||e[16]!==i){let x;e[18]!==a||e[19]!==i?(x=h=>s.jsxs("button",{type:"button",onClick:()=>a(h),"aria-label":i("chooseEditor.chooser.openAriaLabel",{title:h.project.title,org:h.orgName}),className:"flex w-full items-center gap-3 rounded-lg border border-border bg-card p-3 text-left transition-colors hover:bg-accent",children:[s.jsx(_,{icon:h.project.icon,name:h.project.title,size:"sm"}),s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:h.project.title}),s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:h.orgName})]})]},`${h.orgSlug}/${h.project.id}`),e[18]=a,e[19]=i,e[20]=x):x=e[20],o=l.map(x),e[14]=l,e[15]=a,e[16]=i,e[17]=o}else o=e[17];let g;e[21]!==o?(g=s.jsx("div",{className:"flex w-full flex-col gap-2",children:o}),e[21]=o,e[22]=g):g=e[22];let j;return e[23]!==f||e[24]!==g?(j=s.jsxs(b,{children:[f,g]}),e[23]=f,e[24]=g,e[25]=j):j=e[25],j}function z(){const t=y.c(24);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/choose-editor"},t[0]=e):e=t[0];const l=w(e);let r,i,n,p;t[1]!==l?(i=l.site?.trim()??"",r=L(l),p=A,n=F.editorResolve(i),t[1]=l,t[2]=r,t[3]=i,t[4]=n,t[5]=p):(r=t[2],i=t[3],n=t[4],p=t[5]);let a;t[6]!==i?(a=()=>k(i),t[6]=i,t[7]=a):a=t[7];const u=i.length>0;let d;t[8]!==n||t[9]!==a||t[10]!==u?(d={queryKey:n,queryFn:a,enabled:u,staleTime:1/0,retry:B},t[8]=n,t[9]=a,t[10]=u,t[11]=d):d=t[11];const m=p(d);if(!i){let o;return t[12]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(E,{titleKey:"chooseEditor.notFound.title",descriptionKey:"chooseEditor.notFound.description"}),t[12]=o):o=t[12],o}if(m.isError){let o;return t[13]!==m?(o=R(m.error)?s.jsx(E,{titleKey:"chooseEditor.notFound.title",descriptionKey:"chooseEditor.notFound.description"}):s.jsx(E,{titleKey:"chooseEditor.error.title",descriptionKey:"chooseEditor.error.description",onRetry:()=>m.refetch()}),t[13]=m,t[14]=o):o=t[14],o}if(!m.data){let o;return t[15]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(q,{}),t[15]=o):o=t[15],o}const{matches:c}=m.data;if(c.length===0){let o;return t[16]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(E,{titleKey:"chooseEditor.notFound.title",descriptionKey:"chooseEditor.notFound.description"}),t[16]=o):o=t[16],o}if(c.length===1&&c[0]){let o;return t[17]!==c[0].orgSlug||t[18]!==c[0].project.id||t[19]!==r?(o=s.jsx(D,{orgSlug:c[0].orgSlug,projectId:c[0].project.id,pageSearch:r}),t[17]=c[0].orgSlug,t[18]=c[0].project.id,t[19]=r,t[20]=o):o=t[20],o}let f;return t[21]!==c||t[22]!==r?(f=s.jsx(O,{matches:c,pageSearch:r}),t[21]=c,t[22]=r,t[23]=f):f=t[23],f}function B(t,e){return!R(e)&&t<2}function qe(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(P,{children:s.jsx(z,{})}),t[0]=e):e=t[0],e}export{qe as default};
@@ -1 +0,0 @@
1
- import{c as L,j as t,B as K,h as X,ae as Ye,ag as ie,b as W,E as De,r as D,G as xe,cc as Ge,cd as Ee,aq as Xe,u as Ze,L as te,a3 as et,a4 as Se,a1 as ye,a2 as we,t as tt,f as fe,ce as Oe}from"./index-DSJbN5sX.js";import{E as Re}from"./empty-state-A2iC04qV.js";import{u as he}from"./use-mcp-client-ugccnX7P.js";import{d as re,F as st,a as ae,b as ce}from"./form-Ce74eqVN.js";import{I as ue}from"./input-DkSSz62S.js";import{T as pe}from"./textarea-D7q7zgt-.js";import{a as ot,b as nt,V as ge,O as lt,M as it}from"./index-DLWopY4T.js";import{aX as rt,V as at,aY as ct,aC as dt,ap as mt,aq as ut,aZ as pt,w as Ce}from"./agent-icon-1_qqvbMi.js";import{M as xt}from"./mcp-app-renderer-tgQv33M8.js";import{g as ft,M as Ie}from"./types-BXOVDPwd.js";import{A as ht,a as gt,b as jt}from"./alert-BwZUlKp-.js";import{S as Te,b as $e,a as Pe,d as ke,c as de}from"./select-qa0gsZOA.js";import{d as Me,e as Fe,B as Y,a as se,b as oe,c as ze}from"./breadcrumb-CQcXrrpt.js";import{i as bt}from"./AlertCircle-wAnOHADS.js";import{a as Nt}from"./Copy01-DBOM13CL.js";import{i as vt}from"./Play-B225dlHd.js";import{g as St}from"./connection-slug-CITJ0kGN.js";import{u as yt,T as wt}from"./use-mcp-auth-status-BjyYQV9T.js";import{a as Be,u as Le}from"./use-connection-BjftRlxd.js";import{u as Ct}from"./use-mcp-tools-J0fpFbFP.js";import{M as It,c as Tt}from"./monaco-editor-CwveTNZd.js";import{I as Ae}from"./integration-icon-Dv6YqP4z.js";import{k as $t,q as Pt}from"./chat-context-CKaeqWM1.js";import{u as kt}from"./shell-layout-DWU--wrz.js";import{E as At}from"./empty-state-jHV8lblj.js";import{n as Dt}from"./Tool02-BgHxw_wF.js";import"./auth-BwvYRMCE.js";import"./label-Bl_k8voC.js";import"./Key01-BSosoP95.js";import"./extract-connection-data-CF8SetmF.js";import"./metadata-dUsYcpuu.js";import"./connection-DWNio8Hi.js";import"./use-registry-connections-CGm4tLfp.js";import"./use-organization-settings-DQ5NNlS_.js";import"./schema-CVuODHYG.js";import"./task-board-CeYV0m1B.js";import"./Plus-BDOjM-y2.js";import"./index-Cyf2Yshe.js";import"./index-BxcRoQ2q.js";import"./index-CaO2GsnM.js";import"./index-B3MtcQ-S.js";import"./popover-CZSG5n66.js";import"./use-virtual-mcp-BMf2s6FM.js";import"./Check-DwFkAzIE.js";import"./SearchMd-BnqlK6CF.js";import"./Users03-DmY-Asfu.js";import"./use-create-virtual-mcp-Bkm-Wzsa.js";import"./use-navigate-to-agent-DZRUz-6p.js";import"./use-destination-route-BpG33_Rz.js";import"./hooks-CL4RZ5Ud.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-Carp4gPN.js";import"./thread-intent-I39tMt_g.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-CTPv5ZM2.js";import"./Tool01-V0KS9Hy0.js";import"./ArrowUp-BlmUVKW6.js";import"./ArrowLeft-YvJ2QXtl.js";import"./ArrowRight-jfYfDxSI.js";import"./TrendUp01-ACczpA6C.js";import"./ZoomOut-Dmwkd0k-.js";import"./CheckCircle-C2nq7B8n.js";import"./ChevronUp-DNGcpflk.js";import"./ChevronRight-D2_fST_t.js";import"./ChevronSelectorVertical-CgTde0Q8.js";import"./DotsVertical-Cz4ekipb.js";import"./UserSquare-CXfPKP7D.js";import"./CreditCard01-DGxkfyx2.js";import"./Download01-u2kBF-xv.js";import"./Settings02-CrEluPTC.js";import"./Eye-rOw56pjM.js";import"./Share07-Nzkr8YZ2.js";import"./GitBranch01-CEsq5yX5.js";import"./Globe01-CivtgibE.js";import"./XClose-CpE_1sco.js";import"./HardDrive-C2GoE6qs.js";import"./Image01-DBbKbwbi.js";import"./Link01-MZ7GmZHO.js";import"./LinkExternal01-73pMIgKV.js";import"./Monitor01-oRlaapId.js";import"./Sun-CCLPxWiv.js";import"./Package-BYp5l2E5.js";import"./Palette-8I2sDSog.js";import"./Shield01-B_JxVlrS.js";import"./Stars01-mzby3j_o.js";import"./Trash01-DXMXjB5D.js";import"./Upload01-CeJJDeve.js";import"./User01-D2exKDPK.js";import"./Users01-Bab7B5hF.js";import"./XCircle-C5opwPs7.js";import"./Zap-CNl7K3Ps.js";import"./badge-BviUmQbh.js";import"./mcp-oauth-BWuSz_1R.js";import"./editor-fOvQUP8H.js";import"./use-panel-navigate-29aw_nLh.js";import"./autosend-CgQ58D3w.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-BXegGRFX.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-BTkjtbaI.js";import"./thread-route-CZiD4-sf.js";import"./dialog-BQdaXz76.js";import"./avatar-a5vmNlMH.js";import"./project-icon-Bnqg1Jiw.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-D1-Cphh8.js";import"./required-auth-layout-Cr1TIX0a.js";import"./use-org-sso-CojWQZss.js";import"./use-org-notice-DeJ9SvBl.js";function Et(s){const e=L.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:a,undoLabel:u}=s,c=a===void 0?"Save":a,n=u===void 0?"Undo":u;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 g;e[1]!==i||e[2]!==o||e[3]!==n?(g=t.jsxs(K,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":n,children:[x,n]}),e[1]=i,e[2]=o,e[3]=n,e[4]=g):g=e[4];let m;e[5]!==i?(m=i?t.jsx(X,{className:"size-3.5"}):t.jsx(at,{size:14}),e[5]=i,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==c||e[10]!==m?(f=t.jsxs(K,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":c,children:[m,c]}),e[7]=i,e[8]=r,e[9]=c,e[10]=m,e[11]=f):f=e[11];let p;return e[12]!==g||e[13]!==f?(p=t.jsxs(t.Fragment,{children:[g,f]}),e[12]=g,e[13]=f,e[14]=p):p=e[14],p}Ye({title:ie().min(1),description:ie().nullable(),body:ie()});function me(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Ot(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Rt(s){const e=L.c(43),{form:r}=s,o=W();let l;e[0]!==o?(l=o("details.prompt.details"),e[0]=o,e[1]=l):l=e[1];let i;e[2]!==l?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:l}),e[2]=l,e[3]=i):i=e[3];let a;e[4]!==o?(a=w=>{const{field:b}=w;return t.jsxs(ae,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:o("details.prompt.title")}),t.jsx(ce,{children:t.jsx(ue,{...b,placeholder:o("details.prompt.titlePlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[4]=o,e[5]=a):a=e[5];let u;e[6]!==r.control||e[7]!==a?(u=t.jsx(re,{control:r.control,name:"title",render:a}),e[6]=r.control,e[7]=a,e[8]=u):u=e[8];let c;e[9]!==o?(c=w=>{const{field:b}=w;return t.jsxs(ae,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:o("details.prompt.description")}),t.jsx(ce,{children:t.jsx(ue,{...b,value:b.value??"",placeholder:o("details.prompt.descriptionPlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[9]=o,e[10]=c):c=e[10];let n;e[11]!==r.control||e[12]!==c?(n=t.jsx(re,{control:r.control,name:"description",render:c}),e[11]=r.control,e[12]=c,e[13]=n):n=e[13];let x;e[14]!==u||e[15]!==n?(x=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u,n]}),e[14]=u,e[15]=n,e[16]=x):x=e[16];let g;e[17]!==i||e[18]!==x?(g=t.jsxs("div",{className:"flex flex-col gap-4",children:[i,x]}),e[17]=i,e[18]=x,e[19]=g):g=e[19];let m;e[20]!==o?(m=o("details.prompt.message"),e[20]=o,e[21]=m):m=e[21];let f;e[22]!==m?(f=t.jsx("div",{className:"text-sm font-medium text-foreground",children:m}),e[22]=m,e[23]=f):f=e[23];let p;e[24]!==o?(p=o("details.prompt.messageDescription"),e[24]=o,e[25]=p):p=e[25];let j;e[26]!==p?(j=t.jsx("div",{className:"text-xs text-muted-foreground",children:p}),e[26]=p,e[27]=j):j=e[27];let N;e[28]!==o?(N=w=>{const{field:b}=w;return t.jsx(ae,{children:t.jsx(ce,{children:t.jsx(pe,{...b,value:b.value??"",placeholder:o("details.prompt.bodyPlaceholder"),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"})})})},e[28]=o,e[29]=N):N=e[29];let S;e[30]!==r.control||e[31]!==N?(S=t.jsx(re,{control:r.control,name:"body",render:N}),e[30]=r.control,e[31]=N,e[32]=S):S=e[32];let $;e[33]!==f||e[34]!==j||e[35]!==S?($=t.jsxs("div",{className:"flex flex-col gap-2",children:[f,j,S]}),e[33]=f,e[34]=j,e[35]=S,e[36]=$):$=e[36];let y;e[37]!==$||e[38]!==g?(y=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:[g,$]}),e[37]=$,e[38]=g,e[39]=y):y=e[39];let P;return e[40]!==r||e[41]!==y?(P=t.jsx(st,{...r,children:y}),e[40]=r,e[41]=y,e[42]=P):P=e[42],P}function Mt(s){const e=L.c(42),{providerId:r,promptId:o}=s,l=W(),{org:i}=xe(),a=r||null;let u;e[0]!==i.id||e[1]!==i.slug||e[2]!==a?(u={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=a,e[3]=u):u=e[3];const c=he(u),n=Ge(r,"PROMPT",o,c),x=Ee(r,"PROMPT",c),g=x.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:me(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let f;e[6]!==m?(f={values:m},e[6]=m,e[7]=f):f=e[7];const p=Xe(f);let j;e[8]!==p||e[9]!==n?(j=()=>{n&&p.reset({title:n.title,description:n.description??null,body:me(n)})},e[8]=p,e[9]=n,e[10]=j):j=e[10];const N=j;let S;e[11]!==x.update||e[12]!==p||e[13]!==o?(S=p.handleSubmit(async C=>{const I=await x.update.mutateAsync({id:o,data:{title:C.title,description:C.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:C.body}}]}});p.reset({title:I.title,description:I.description??null,body:me(I)})}),e[11]=x.update,e[12]=p,e[13]=o,e[14]=S):S=e[14];const $=S;if(!n){let C;e[15]!==l?(C=l("details.prompt.notFoundTitle"),e[15]=l,e[16]=C):C=e[16];let I;e[17]!==l?(I=l("details.prompt.notFoundDescription"),e[17]=l,e[18]=I):I=e[18];let O;return e[19]!==C||e[20]!==I?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Re,{title:C,description:I})}),e[19]=C,e[20]=I,e[21]=O):O=e[21],O}let y;e[22]!==n.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[22]=n.title,e[23]=y):y=e[23];let P;e[24]!==n.description?(P=n.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:n.description})]}):null,e[24]=n.description,e[25]=P):P=e[25];let w;e[26]!==y||e[27]!==P?(w=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,P]})}),e[26]=y,e[27]=P,e[28]=w):w=e[28];let b;e[29]!==$?(b=()=>{$()},e[29]=$,e[30]=b):b=e[30];let k;e[31]!==p.formState.isDirty||e[32]!==g||e[33]!==N||e[34]!==b?(k=t.jsx(ot,{children:t.jsx(Et,{onSave:b,onUndo:N,isDirty:p.formState.isDirty,isSaving:g})}),e[31]=p.formState.isDirty,e[32]=g,e[33]=N,e[34]=b,e[35]=k):k=e[35];let A;e[36]!==p?(A=t.jsx("div",{className:"h-full",children:t.jsx(Rt,{form:p})}),e[36]=p,e[37]=A):A=e[37];let E;return e[38]!==k||e[39]!==A||e[40]!==w?(E=t.jsxs(ge,{children:[w,k,A]}),e[38]=k,e[39]=A,e[40]=w,e[41]=E):E=e[41],E}function Ft(s){const e=L.c(10),{itemId:r}=s,o=W();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Ot(),e[0]=l):l=e[0];const i=l;if(!i){let u;e[1]!==o?(u=o("details.prompt.notFoundTitle"),e[1]=o,e[2]=u):u=e[2];let c;e[3]!==o?(c=o("details.prompt.missingConnectionDescription"),e[3]=o,e[4]=c):c=e[4];let n;return e[5]!==u||e[6]!==c?(n=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Re,{title:u,description:c})}),e[5]=u,e[6]=c,e[7]=n):n=e[7],n}let a;return e[8]!==r?(a=t.jsx(De,{children:t.jsx(D.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:i,promptId:r})})}),e[8]=r,e[9]=a):a=e[9],a}const zt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(s){const e=L.c(12),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:a}=s,u=W();let c;e[0]!==o?(c={connectionId:o},e[0]=o,e[1]=c):c=e[1];const n=yt(c);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==a||e[4]!==u?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(lt,{onAuthenticate:()=>a(),buttonText:u("details.tool.goBackToAuthenticate")}):t.jsx(it,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=a,e[4]=u,e[5]=m):m=e[5],m}const x=`${o}:${r}`;let g;return e[6]!==o||e[7]!==i||e[8]!==l||e[9]!==x||e[10]!==r?(g=t.jsx(Lt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},x),e[6]=o,e[7]=i,e[8]=l,e[9]=x,e[10]=r,e[11]=g):g=e[11],g}function Lt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const l=W(),{replayId:i}=Ze({strict:!1}),a=(()=>{if(!i)return null;const d=`replay-${i}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),u=(()=>{if(!a)return null;const d={};for(const[h,T]of Object.entries(a))T!==null&&typeof T=="object"?d[h]=JSON.stringify(T,null,2):d[h]=T;return d})(),[c,n]=D.useState(u??{}),[x,g]=D.useState(a?JSON.stringify(a,null,2):"{}"),[m,f]=D.useState(null),[p,j]=D.useState(null),[N,S]=D.useState(null),[$,y]=D.useState(null),[P,w]=D.useState(!1),[b,k]=D.useState(null),{org:A}=xe(),E=Be(e),C=$t(),I=Pt(),{openSidePanel:O}=kt(),U=`${e}:${s}`,M=he({connectionId:e,orgId:A.id,orgSlug:A.slug}),V=Ct({client:M}),v=V.data?.tools?.find(d=>d.name===s),R=ft(v?._meta),J=d=>{if(!C)return;const h=Tt(d.content);h.content.length>0&&(O(),C.sendMessage({tiptapDoc:h}))},[F,z]=D.useState("json"),[q,Q]=D.useState(!1);R&&!q&&(z("ui"),Q(!0));const _=v?.inputSchema?.properties,je=_?Object.keys(_):[],G=je.length>0,Z={};if(G&&v?.inputSchema?.properties)for(const d of je)Z[d]=v.inputSchema.required?.includes(d)?"":void 0;const ne=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{w(!0),y(null),f(null),j(null),S(null),k(null);const d=performance.now();try{if(!M)throw new Error("MCP client is not available");const h=G?{...Z,...c}:(()=>{const B=x.trim();if(!B)return{};const H=JSON.parse(B);if(H&&typeof H=="object")return H;throw new Error("Raw JSON input must be an object.")})();G&&v?.inputSchema?.properties&&Object.entries(v.inputSchema.properties).forEach(([B,H])=>{if((H.type==="object"||H.type==="array")&&typeof h[B]=="string")try{h[B]=JSON.parse(h[B])}catch{}else if((H.type==="number"||H.type==="integer")&&typeof h[B]=="string"&&h[B]!==""){const ve=Number(h[B]);Number.isNaN(ve)||(h[B]=ve)}});const T=await M.callTool({name:s,arguments:h}),ee=T.structuredContent??T,Ke=performance.now(),We=Math.round(Ke-d);f(ee),j(T),S(h);const Qe=JSON.stringify(ee),Ne=new TextEncoder().encode(Qe).length;k({duration:`${We}ms`,bytes:`${Ne} bytes`,tokens:`~${Math.ceil(Ne/4)} tokens`,cost:"$0.0000"})}catch(h){const T=h instanceof Error?h.message:String(h);y(T||"Unknown error occurred");const ee=performance.now();k({duration:`${Math.round(ee-d)}ms`})}finally{w(!1)}},le=(d,h)=>{n(T=>({...T,[d]:h}))},Ve=()=>{f(null),j(null),S(null),y(null),k(null)},_e=v?.name??zt(s),Je=t.jsx(Me,{children:t.jsxs(Fe,{children:[t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:A.slug},children:l("details.tool.connections")})})}),t.jsx(oe,{}),E&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:A.slug,appSlug:St(E)},search:{tab:"tools"},children:E.title})})}),t.jsx(oe,{})]}),t.jsx(Y,{children:t.jsx(ze,{children:_e})})]})}),be=r.length>1&&t.jsxs(Te,{value:e,onValueChange:o,children:[t.jsx($e,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(Pe,{})}),t.jsx(ke,{children:r.map(d=>t.jsx(de,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ae,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),qe=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:l("details.tool.parameters")}),v?.inputSchema?.required&&v.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," ",l("details.tool.required")]})]}),t.jsx("div",{className:"space-y-4",children:G&&v?.inputSchema?.properties?Object.entries(v.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,v.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-destructive 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(pe,{className:"font-mono text-xs",value:ne(d)?c[d]??"":Z[d]??"",onChange:T=>le(d,T.target.value),placeholder:l("details.tool.enterAsJson",{key:d}),rows:3}):h.type==="boolean"?t.jsxs(Te,{value:ne(d)?String(c[d]??""):"",onValueChange:T=>le(d,T==="true"),children:[t.jsx($e,{children:t.jsx(Pe,{placeholder:l("details.tool.selectTrueOrFalse")})}),t.jsxs(ke,{children:[t.jsx(de,{value:"true",children:"true"}),t.jsx(de,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ne(d)?c[d]??"":Z[d]??"",onChange:T=>le(d,T.target.value),placeholder:l("details.tool.enter",{key:d})})]},d)):v?.inputSchema&&!G?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:l("details.tool.rawJsonInput")}),t.jsx(pe,{className:"font-mono text-xs min-h-[120px]",value:x,onChange:d=>g(d.target.value),placeholder:l("details.tool.rawJsonExample")})]}):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:l("details.tool.noParametersRequired")})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:P?t.jsxs(K,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Ve,children:[t.jsx(ct,{className:"h-3.5 w-3.5"}),l("details.tool.cancel")]}):t.jsxs(K,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),l("details.tool.executeTool")]})})]}),He=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:l("details.tool.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(dt,{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(mt,{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(ut,{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})})]}),R&&t.jsx(et,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Se,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(K,{size:"icon",variant:F==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>z("ui"),children:t.jsx(pt,{size:14})})}),t.jsx(we,{children:l("details.tool.interactiveView")})]}),t.jsxs(Se,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(K,{size:"icon",variant:F==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>z("json"),children:t.jsx(Ce,{size:14})})}),t.jsx(we,{children:l("details.tool.jsonView")})]})]})})]})]}),$&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(ht,{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(bt,{className:"h-4 w-4"}),t.jsx(gt,{className:"mb-0",children:l("details.tool.executionFailed")})]}),t.jsx(jt,{className:"text-xs text-destructive",children:$})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:R&&F==="ui"&&M?t.jsx(D.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(X,{className:"size-4"}),t.jsx("span",{className:"text-sm",children:l("details.tool.loadingApp")})]})}),children:t.jsx(xt,{resourceURI:R,toolInfo:v?{tool:v}:void 0,toolInput:N??void 0,toolResult:p??void 0,displayMode:"fullscreen",minHeight:Ie.view.minHeight,maxHeight:Ie.view.maxHeight,client:M,onMessage:J,onUpdateModelContext:d=>I?.setAppContext(U,d),onTeardown:()=>I?.clearAppContext(U),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(It,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(K,{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)),tt.success(l("details.tool.copiedToClipboard"))},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(Ce,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:l("details.tool.runToolToSeeResults")})]})})]});return t.jsx(ge,{breadcrumb:Je,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(Ae,{icon:E?.icon||null,name:E?.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:[V.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):V.isLoading?t.jsx(X,{className:"size-[10px] text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:V.isSuccess?"ready":V.isLoading?"connecting":"error"})]}),t.jsx(wt,{annotations:v?.annotations,_meta:v?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:be})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v?.description||"No description available"})]}),r.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:l("details.tool.instance")}),be]}),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:qe}),He]})})]})})}function Ut(s){const e=L.c(20),{itemId:r,siblings:o,onBack:l}=s,i=W(),[a,u]=D.useState(o[0]?.id??"");let c;e[0]!==a||e[1]!==o?(c=o.find(f=>f.id===a)?.id??o[0]?.id??"",e[0]=a,e[1]=o,e[2]=c):c=e[2];const n=c;if(!Be(n||void 0)||!n){let f;e[3]!==i?(f=i("details.tool.connectionNotFound"),e[3]=i,e[4]=f):f=e[4];let p;e[5]!==f?(p=t.jsx("h3",{className:"text-lg font-semibold",children:f}),e[5]=f,e[6]=p):p=e[6];let j;e[7]!==i?(j=i("details.tool.connectionNotFoundMessage"),e[7]=i,e[8]=j):j=e[8];let N;e[9]!==j?(N=t.jsx("p",{className:"text-sm text-muted-foreground",children:j}),e[9]=j,e[10]=N):N=e[10];let S;return e[11]!==p||e[12]!==N?(S=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:[p,N]})}),e[11]=p,e[12]=N,e[13]=S):S=e[13],S}let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{className:"size-8 text-muted-foreground"})}),e[14]=g):g=e[14];let m;return e[15]!==n||e[16]!==l||e[17]!==o||e[18]!==r?(m=t.jsx(D.Suspense,{fallback:g,children:t.jsx(Bt,{toolName:r,connectionId:n,siblings:o,onSelectInstance:u,onBack:l})}),e[15]=n,e[16]=l,e[17]=o,e[18]=r,e[19]=m):m=e[19],m}const Vt={prompt:Ft};function _t(){const s=L.c(9),e=Oe();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=fe(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const a=Le(i);let u;s[3]!==e.history?(u=()=>{e.history.back()},s[3]=e.history,s[4]=u):u=s[4];const c=u,n=Jt;let x;return s[5]!==c||s[6]!==l||s[7]!==a?(x=t.jsx(Ut,{itemId:l,siblings:a,onBack:c,onUpdate:n}),s[5]=c,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Jt(s){return Promise.resolve()}function qt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ht(){const s=L.c(52),e=Oe();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=fe(r),l=W(),i=decodeURIComponent(o.collectionName),a=decodeURIComponent(o.itemId);let u;s[1]!==e.history?(u=()=>{e.history.back()},s[1]=e.history,s[2]=u):u=s[2];const c=u,{org:n}=xe();let x;s[3]!==o.appSlug?(x={slug:o.appSlug},s[3]=o.appSlug,s[4]=x):x=s[4];const m=Le(x)[0]??null,f=m?.id??"",p=f||"no-connection",j=f??null;let N;s[5]!==n.id||s[6]!==n.slug||s[7]!==j?(N={connectionId:j,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=j,s[8]=N):N=s[8];const S=he(N),$=Ee(p,i,S);let y;s[9]!==$||s[10]!==a?(y=async _=>{a&&await $.update.mutateAsync({id:a,data:_})},s[9]=$,s[10]=a,s[11]=y):y=s[11];const P=y;let w;s[12]!==i?(w=i?.toLowerCase(),s[12]=i,s[13]=w):w=s[13];const b=w,k=b&&Vt[b];let A;s[14]!==i?(A=qt(i),s[14]=i,s[15]=A):A=s[15];const E=A;let C;s[16]!==n.slug?(C=t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=C):C=s[17];let I;s[18]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(oe,{}),s[18]=I):I=s[18];let O;s[19]!==i||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(O=m&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:i},children:m.title})})}),t.jsx(oe,{})]}),s[19]=i,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=O):O=s[23];let U;s[24]!==E?(U=t.jsx(Y,{children:t.jsx(ze,{children:E})}),s[24]=E,s[25]=U):U=s[25];let M;s[26]!==O||s[27]!==U||s[28]!==C?(M=t.jsx(Me,{children:t.jsxs(Fe,{children:[C,I,O,U]})}),s[26]=O,s[27]=U,s[28]=C,s[29]=M):M=s[29];const V=M;if(k){let _;return s[30]!==k||s[31]!==c||s[32]!==P||s[33]!==a?(_=t.jsx(k,{itemId:a,onBack:c,onUpdate:P}),s[30]=k,s[31]=c,s[32]=P,s[33]=a,s[34]=_):_=s[34],_}let v;s[35]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Dt,{size:36,className:"text-muted-foreground"}),s[35]=v):v=s[35];let R;s[36]!==l?(R=l("orgs.collectionDetail.noComponentDefinedTitle"),s[36]=l,s[37]=R):R=s[37];let J;s[38]!==l?(J=l("orgs.collectionDetail.noComponentDefinedDescription"),s[38]=l,s[39]=J):J=s[39];let F;s[40]!==l?(F=l("orgs.collectionDetail.goBackButton"),s[40]=l,s[41]=F):F=s[41];let z;s[42]!==c||s[43]!==F?(z={onClick:c,children:F},s[42]=c,s[43]=F,s[44]=z):z=s[44];let q;s[45]!==R||s[46]!==J||s[47]!==z?(q=t.jsx(At,{icon:v,title:R,description:J,buttonProps:z}),s[45]=R,s[46]=J,s[47]=z,s[48]=q):q=s[48];let Q;return s[49]!==V||s[50]!==q?(Q=t.jsx(ge,{breadcrumb:V,children:q}),s[49]=V,s[50]=q,s[51]=Q):Q=s[51],Q}function Kt(){const s=L.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 r=fe(e);if(decodeURIComponent(r.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(_t,{}),s[1]=a):a=s[1],a}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ht,{}),s[2]=i):i=s[2],i}function Go(){const s=L.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(De,{children:t.jsx(D.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Kt,{})})}),s[0]=e):e=s[0],e}export{Go as default};
@@ -1 +0,0 @@
1
- import{c as N,b as Q,j as r,l as Me,o as ue,p as st,B as Ne,u as Xe,r as Y,a as De,q as nt,d as lt,s as at,e as Ze,v as Ee,w as Se,Q as ct,E as mt,K as Be,x as He,N as dt}from"./index-DSJbN5sX.js";import{L as ut,s as Te,S as We,i as gt,n as Re,C as et,p as Le}from"./self-tool-result-aFpcyvJC.js";import{a as ft}from"./auth-entry-qj9kdQ0Z.js";import{A as pt}from"./auth-split-layout-C34qWW6w.js";import{O as qe}from"./organization-choice-OLuLEbMC.js";import{C as Ve}from"./create-organization-dialog-Zv-z5MlI.js";import{r as ht}from"./track-EzTLxDrw.js";import{I as bt}from"./input-DkSSz62S.js";import{D as xt,a as Ke,b as yt,c as Ct}from"./dropdown-menu-CHDCkiCh.js";import{S as jt,u as Ot,W as vt,g as St,a as _t}from"./use-mcp-client-ugccnX7P.js";import{i as wt}from"./ArrowRight-jfYfDxSI.js";import{t as Qe}from"./site-error--i37Vnuw.js";import"./integration-icon-Dv6YqP4z.js";import"./Tool02-BgHxw_wF.js";import"./agent-icon-1_qqvbMi.js";import"./AlertCircle-wAnOHADS.js";import"./Tool01-V0KS9Hy0.js";import"./ArrowUp-BlmUVKW6.js";import"./ArrowLeft-YvJ2QXtl.js";import"./TrendUp01-ACczpA6C.js";import"./ZoomOut-Dmwkd0k-.js";import"./Users03-DmY-Asfu.js";import"./CheckCircle-C2nq7B8n.js";import"./Check-DwFkAzIE.js";import"./ChevronUp-DNGcpflk.js";import"./ChevronRight-D2_fST_t.js";import"./ChevronSelectorVertical-CgTde0Q8.js";import"./DotsVertical-Cz4ekipb.js";import"./UserSquare-CXfPKP7D.js";import"./Copy01-DBOM13CL.js";import"./CreditCard01-DGxkfyx2.js";import"./Download01-u2kBF-xv.js";import"./Settings02-CrEluPTC.js";import"./Eye-rOw56pjM.js";import"./Share07-Nzkr8YZ2.js";import"./GitBranch01-CEsq5yX5.js";import"./Globe01-CivtgibE.js";import"./XClose-CpE_1sco.js";import"./HardDrive-C2GoE6qs.js";import"./Image01-DBbKbwbi.js";import"./Key01-BSosoP95.js";import"./Link01-MZ7GmZHO.js";import"./LinkExternal01-73pMIgKV.js";import"./Monitor01-oRlaapId.js";import"./Sun-CCLPxWiv.js";import"./Package-BYp5l2E5.js";import"./Palette-8I2sDSog.js";import"./Play-B225dlHd.js";import"./Plus-BDOjM-y2.js";import"./SearchMd-BnqlK6CF.js";import"./Shield01-B_JxVlrS.js";import"./Stars01-mzby3j_o.js";import"./Trash01-DXMXjB5D.js";import"./Upload01-CeJJDeve.js";import"./User01-D2exKDPK.js";import"./Users01-Bab7B5hF.js";import"./XCircle-C5opwPs7.js";import"./Zap-CNl7K3Ps.js";import"./dialog-BQdaXz76.js";import"./extract-connection-data-CF8SetmF.js";import"./metadata-dUsYcpuu.js";import"./connection-DWNio8Hi.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./form-Ce74eqVN.js";import"./label-Bl_k8voC.js";import"./use-debounced-value-BmfpPcXL.js";import"./authenticate-and-persist-oauth-2hJV8I4L.js";import"./mcp-oauth-BWuSz_1R.js";import"./auth-BwvYRMCE.js";import"./use-is-desktop-app-BNujXJc_.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-a5vmNlMH.js";import"./alert-dialog-BWLIdDXs.js";const Ge={"pt-BR":"https://decocms.com/agendar",en:"https://www.decocms.com/en/schedule"},Ye=["https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200","https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png","https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png"],Nt="var(--brand-green-dark)";function Ae({siteUrl:t,email:e,locale:s}){const i=(s&&Ge[s])??Ge["pt-BR"]??"https://decocms.com/agendar",o=new URL(i);return t&&o.searchParams.set("siteUrl",t),e&&o.searchParams.set("email",e),o.toString()}function Et(t){const e=N.c(15),{href:s,size:i,className:o,orgId:l}=t,a=i===void 0?"lg":i,n=Q();let c;e[0]!==o?(c=Me("w-full",o),e[0]=o,e[1]=c):c=e[1];let m;e[2]!==l?(m=()=>ue("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:l}),e[2]=l,e[3]=m):m=e[3];let d;e[4]!==n?(d=n("routes.commerceOnboarding.scheduleMeeting.scheduleButton"),e[4]=n,e[5]=d):d=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx(st,{size:16}),e[6]=u):u=e[6];let f;e[7]!==s||e[8]!==m||e[9]!==d?(f=r.jsxs("a",{href:s,target:"_blank",rel:"noreferrer",onClick:m,children:[d,u]}),e[7]=s,e[8]=m,e[9]=d,e[10]=f):f=e[10];let p;return e[11]!==a||e[12]!==c||e[13]!==f?(p=r.jsx(Ne,{asChild:!0,variant:"outline",size:a,className:c,children:f}),e[11]=a,e[12]=c,e[13]=f,e[14]=p):p=e[14],p}function Ut(t){const e=N.c(13),{size:s}=t,i=s===void 0?72:s,o=Q();let l;e[0]!==o?(l=o("routes.commerceOnboarding.scheduleMeeting.expertAlt"),e[0]=o,e[1]=l):l=e[1];const a=l;let n;e[2]!==i?(n=Math.round(i*.3),e[2]=i,e[3]=n):n=e[3];const c=n;let m;e[4]!==i?(m={height:i},e[4]=i,e[5]=m):m=e[5];let d;e[6]!==a||e[7]!==c||e[8]!==i?(d=Ye.map((f,p)=>r.jsxs("div",{className:"relative shrink-0",style:{width:i,height:i,marginLeft:p===0?0:-c,zIndex:Ye.length-p},children:[r.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:r.jsx("img",{src:f,alt:a,className:"h-full w-full object-cover",loading:"lazy"})}),p===0&&r.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[r.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),r.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},f)),e[6]=a,e[7]=c,e[8]=i,e[9]=d):d=e[9];let u;return e[10]!==m||e[11]!==d?(u=r.jsx("div",{className:"flex items-end",style:m,children:d}),e[10]=m,e[11]=d,e[12]=u):u=e[12],u}function Fe(t){const e=N.c(19),{href:s,orgId:i}=t,o=Q();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("div",{className:"h-20",style:{backgroundColor:Nt}}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("div",{className:"-mt-9 mb-4",children:r.jsx(Ut,{})}),e[1]=a):a=e[1];let n;e[2]!==o?(n=o("routes.commerceOnboarding.scheduleMeeting.headline"),e[2]=o,e[3]=n):n=e[3];let c;e[4]!==n?(c=r.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:n}),e[4]=n,e[5]=c):c=e[5];let m;e[6]!==o?(m=o("routes.commerceOnboarding.scheduleMeeting.body"),e[6]=o,e[7]=m):m=e[7];let d;e[8]!==m?(d=r.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:m}),e[8]=m,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=r.jsxs("div",{className:"grid gap-1.5",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let f;e[13]!==s||e[14]!==i?(f=r.jsx(Et,{href:s,size:"lg",className:"mt-6",orgId:i}),e[13]=s,e[14]=i,e[15]=f):f=e[15];let p;return e[16]!==u||e[17]!==f?(p=r.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:r.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[l,r.jsxs("div",{className:"px-8 pb-8",children:[a,u,f]})]})}),e[16]=u,e[17]=f,e[18]=p):p=e[18],p}function tt(t){const e=N.c(10),{host:s}=t,i=`https://www.google.com/s2/favicons?domain=${s}&sz=128`;let o,l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),l=r.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),a=r.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=l,e[2]=a):(o=e[0],l=e[1],a=e[2]);let n;e[3]!==i?(n=r.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:r.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=n):n=e[4];let c;e[5]!==s?(c=r.jsx("span",{className:"text-lg font-medium text-foreground",children:s}),e[5]=s,e[6]=c):c=e[6];let m;return e[7]!==n||e[8]!==c?(m=r.jsxs("div",{className:"flex items-center gap-3",children:[o,l,a,n,c]}),e[7]=n,e[8]=c,e[9]=m):m=e[9],m}function $e(t){const e=N.c(5),{variant:s}=t,i=Q();let o;e[0]!==i||e[1]!==s?(o=i(s==="workspace"?"routes.commerceOnboarding.loading.preparingWorkspace":"routes.commerceOnboarding.loading.preparing"),e[0]=i,e[1]=s,e[2]=o):o=e[2];const l=o;let a;return e[3]!==l?(a=r.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:r.jsx(ut,{label:l,className:"text-muted-foreground"})}),e[3]=l,e[4]=a):a=e[4],a}function mr(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(Lt,{}),t[0]=e):e=t[0],e}const ot=Y.createContext(null),rt=()=>Y.useContext(ot);function It(){const t=N.c(22),[e,s]=Ee(),i=e.language==="pt-BR"?"PT-BR":"EN";let o;t[0]!==i?(o=r.jsx(xt,{asChild:!0,children:r.jsx("button",{className:"text-sm font-medium text-foreground/70 hover:text-foreground transition-colors",type:"button",children:i})}),t[0]=i,t[1]=o):o=t[1];let l;t[2]!==s?(l=()=>{s(zt)},t[2]=s,t[3]=l):l=t[3];const a=e.language==="en"&&"bg-accent";let n;t[4]!==a?(n=Me(a),t[4]=a,t[5]=n):n=t[5];let c;t[6]!==l||t[7]!==n?(c=r.jsx(Ke,{onClick:l,className:n,children:"English"}),t[6]=l,t[7]=n,t[8]=c):c=t[8];let m;t[9]!==s?(m=()=>{s(Pt)},t[9]=s,t[10]=m):m=t[10];const d=e.language==="pt-BR"&&"bg-accent";let u;t[11]!==d?(u=Me(d),t[11]=d,t[12]=u):u=t[12];let f;t[13]!==m||t[14]!==u?(f=r.jsx(Ke,{onClick:m,className:u,children:"Português (Brasil)"}),t[13]=m,t[14]=u,t[15]=f):f=t[15];let p;t[16]!==c||t[17]!==f?(p=r.jsxs(yt,{align:"end",children:[c,f]}),t[16]=c,t[17]=f,t[18]=p):p=t[18];let O;return t[19]!==o||t[20]!==p?(O=r.jsxs(Ct,{children:[o,p]}),t[19]=o,t[20]=p,t[21]=O):O=t[21],O}function Pt(t){return{...t,language:"pt-BR"}}function zt(t){return{...t,language:"en"}}function H(t){const e=N.c(17);let s,i,o;e[0]!==t?({visual:o,children:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=o):(s=e[1],i=e[2],o=e[3]);let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/commerce-onboarding"},e[4]=l):l=e[4];const a=Xe(l),{data:n}=De.useSession(),[c]=Ee(),m=n?.user?.email;let d;e[5]!==c.language||e[6]!==a.siteUrl||e[7]!==m?(d=Ae({siteUrl:a.siteUrl,email:m,locale:c.language}),e[5]=c.language,e[6]=a.siteUrl,e[7]=m,e[8]=d):d=e[8];const u=d;let f;e[9]!==u||e[10]!==o?(f=o??r.jsx(Fe,{href:u}),e[9]=u,e[10]=o,e[11]=f):f=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsxs("div",{className:"flex justify-between items-start mb-8",children:[r.jsx("div",{}),r.jsx(It,{})]}),e[12]=p):p=e[12];let O;return e[13]!==s||e[14]!==i||e[15]!==f?(O=r.jsxs(pt,{...i,visual:f,children:[p,s]}),e[13]=s,e[14]=i,e[15]=f,e[16]=O):O=e[16],O}function Rt(t){return{signUpFailed:t("routes.commerceOnboarding.authCopy.signUpFailed"),signInFailed:t("routes.commerceOnboarding.authCopy.signInFailed"),authenticationFailed:t("routes.commerceOnboarding.authCopy.authenticationFailed"),resetEmailFailed:t("routes.commerceOnboarding.authCopy.resetEmailFailed"),otpSendFailed:t("routes.commerceOnboarding.authCopy.otpSendFailed"),invalidCode:t("routes.commerceOnboarding.authCopy.invalidCode"),invalidEmail:t("routes.commerceOnboarding.authCopy.invalidEmail"),invalidEmailOrPassword:t("routes.commerceOnboarding.authCopy.invalidEmailOrPassword"),accountExists:t("routes.commerceOnboarding.authCopy.accountExists"),networkError:t("routes.commerceOnboarding.authCopy.networkError"),tooManyAttempts:t("routes.commerceOnboarding.authCopy.tooManyAttempts"),invalidOrExpiredCode:t("routes.commerceOnboarding.authCopy.invalidOrExpiredCode"),genericError:t("routes.commerceOnboarding.authCopy.genericError"),resetPasswordTitle:t("routes.commerceOnboarding.authCopy.resetPasswordTitle"),verificationCodeTitle:t("routes.commerceOnboarding.authCopy.verificationCodeTitle"),welcomeTitle:t("routes.commerceOnboarding.authCopy.welcomeTitle"),resetPasswordSubtitle:t("routes.commerceOnboarding.authCopy.resetPasswordSubtitle"),codeSentTo:e=>t("routes.commerceOnboarding.authCopy.codeSentTo",{email:e}),defaultSubtitle:t("routes.commerceOnboarding.authCopy.defaultSubtitle"),resetEmailSent:t("routes.commerceOnboarding.authCopy.resetEmailSent"),continueWith:e=>t("routes.commerceOnboarding.authCopy.continueWith",{provider:e}),divider:t("routes.commerceOnboarding.authCopy.divider"),emailLabel:t("routes.commerceOnboarding.authCopy.emailLabel"),emailPlaceholder:t("routes.commerceOnboarding.authCopy.emailPlaceholder"),sending:t("routes.commerceOnboarding.authCopy.sending"),sendCode:t("routes.commerceOnboarding.authCopy.sendCode"),verificationCodeLabel:t("routes.commerceOnboarding.authCopy.verificationCodeLabel"),enterCodePlaceholder:t("routes.commerceOnboarding.authCopy.enterCodePlaceholder"),verifying:t("routes.commerceOnboarding.authCopy.verifying"),verify:t("routes.commerceOnboarding.authCopy.verify"),useDifferentEmail:t("routes.commerceOnboarding.authCopy.useDifferentEmail"),sendResetLink:t("routes.commerceOnboarding.authCopy.sendResetLink"),nameLabel:t("routes.commerceOnboarding.authCopy.nameLabel"),namePlaceholder:t("routes.commerceOnboarding.authCopy.namePlaceholder"),passwordLabel:t("routes.commerceOnboarding.authCopy.passwordLabel"),forgotPassword:t("routes.commerceOnboarding.authCopy.forgotPassword"),creatingAccount:t("routes.commerceOnboarding.authCopy.creatingAccount"),signingIn:t("routes.commerceOnboarding.authCopy.signingIn"),continue:t("routes.commerceOnboarding.authCopy.continue"),backToSignIn:t("routes.commerceOnboarding.authCopy.backToSignIn"),signInWithPassword:t("routes.commerceOnboarding.authCopy.signInWithPassword"),alreadyHaveAccount:t("routes.commerceOnboarding.authCopy.alreadyHaveAccount"),dontHaveAccount:t("routes.commerceOnboarding.authCopy.dontHaveAccount"),signIn:t("routes.commerceOnboarding.authCopy.signIn"),signUp:t("routes.commerceOnboarding.authCopy.signUp"),signInWithEmailCode:t("routes.commerceOnboarding.authCopy.signInWithEmailCode")}}let Je=!1;function Lt(){const t=Xe({from:"/commerce-onboarding"}),{org:e,siteUrl:s}=t,i=Te(s);if(!Je&&nt()){Je=!0;const o=ht(window.location.search);ue("commerce_onboarding_viewed",{site_url:s,domain:i??void 0,...o,...i?{$set:{last_scanned_domain:i}}:{}})}return r.jsx(ot.Provider,{value:i,children:r.jsx(kt,{requestedOrgSlug:e,siteUrl:s})})}function kt(t){const e=N.c(14),{requestedOrgSlug:s,siteUrl:i}=t,o=Q(),{data:l,isPending:a}=De.useSession(),n=rt();if(a){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(H,{children:r.jsx($e,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!l){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==o?(d=o("routes.commerceOnboarding.unlockDiagnostic"),e[1]=o,e[2]=d):d=e[2];let u;e[3]!==n?(u=n?r.jsx(tt,{host:n}):void 0,e[3]=n,e[4]=u):u=e[4];let f;e[5]!==o?(f=Rt(o),e[5]=o,e[6]=f):f=e[6];let p;return e[7]!==d||e[8]!==u||e[9]!==f?(p=r.jsx(H,{children:r.jsx(ft,{callbackUrl:m,allowAutoLogin:!1,title:d,subtitle:null,brand:u,copy:f})}),e[7]=d,e[8]=u,e[9]=f,e[10]=p):p=e[10],p}let c;return e[11]!==s||e[12]!==i?(c=r.jsx(Mt,{requestedOrgSlug:s,siteUrl:i}),e[11]=s,e[12]=i,e[13]=c):c=e[13],c}function Mt(t){const e=N.c(121),{requestedOrgSlug:s,siteUrl:i}=t,o=Q(),l=lt(),a=at(),[n,c]=Y.useState(null),[m,d]=Y.useState(null),[u,f]=Y.useState(!1),p=a.data?.map(Dt)??[];let O;e[0]===Symbol.for("react.memo_cache_sentinel")?(O={mutationFn:Tt,retry:!1,onSuccess:g=>{d(g)}},e[0]=O):O=e[0];const v=Ze(O);if(a.isPending){let g;return e[1]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(H,{children:r.jsx($e,{variant:"workspace"})}),e[1]=g):g=e[1],g}if(a.error){let g;e[2]!==o?(g=o("routes.commerceOnboarding.couldNotLoadOrgs"),e[2]=o,e[3]=g):g=e[3];let h;e[4]!==o?(h=o("routes.commerceOnboarding.retryToConfigureCommerce"),e[4]=o,e[5]=h):h=e[5];let x;e[6]!==o?(x=o("routes.commerceOnboarding.retryAgain"),e[6]=o,e[7]=x):x=e[7];let b;e[8]!==a?(b=()=>a.refetch(),e[8]=a,e[9]=b):b=e[9];let _;return e[10]!==g||e[11]!==h||e[12]!==x||e[13]!==b?(_=r.jsx(_e,{title:g,description:h,actionLabel:x,onRetry:b}),e[10]=g,e[11]=h,e[12]=x,e[13]=b,e[14]=_):_=e[14],_}const w=s?p.find(g=>g.slug===s):null;if(w){let g;return e[15]!==w||e[16]!==i?(g=r.jsx(ve,{org:w,initialSiteUrl:i}),e[15]=w,e[16]=i,e[17]=g):g=e[17],g}if(s){let g;e[18]!==o?(g=o("routes.commerceOnboarding.orgNotFound"),e[18]=o,e[19]=g):g=e[19];let h;e[20]!==o?(h=o("routes.commerceOnboarding.couldNotFindOrg"),e[20]=o,e[21]=h):h=e[21];let x;e[22]!==o?(x=o("routes.commerceOnboarding.retryAgain"),e[22]=o,e[23]=x):x=e[23];let b;e[24]!==a?(b=()=>a.refetch(),e[24]=a,e[25]=b):b=e[25];let _;return e[26]!==g||e[27]!==h||e[28]!==x||e[29]!==b?(_=r.jsx(_e,{title:g,description:h,actionLabel:x,onRetry:b}),e[26]=g,e[27]=h,e[28]=x,e[29]=b,e[30]=_):_=e[30],_}if(n){let g;return e[31]!==n||e[32]!==i?(g=r.jsx(ve,{org:n,initialSiteUrl:i}),e[31]=n,e[32]=i,e[33]=g):g=e[33],g}if(p.length===1&&p[0]){let g;return e[34]!==p[0]||e[35]!==i?(g=r.jsx(ve,{org:p[0],initialSiteUrl:i}),e[34]=p[0],e[35]=i,e[36]=g):g=e[36],g}if(p.length>1){let g;e[37]!==o?(g=o("routes.commerceOnboarding.chooseOrg"),e[37]=o,e[38]=g):g=e[38];let h;e[39]!==o?(h=o("routes.commerceOnboarding.selectWhereCommerceContinues"),e[39]=o,e[40]=h):h=e[40];let x;e[41]!==g||e[42]!==h?(x=r.jsx(J,{title:g,description:h}),e[41]=g,e[42]=h,e[43]=x):x=e[43];let b;e[44]!==o?(b=o("routes.commerceOnboarding.authCopy.continue"),e[44]=o,e[45]=b):b=e[45];let _;e[46]!==l||e[47]!==i?(_=j=>l({to:"/commerce-onboarding",search:{org:j.slug,siteUrl:i}}),e[46]=l,e[47]=i,e[48]=_):_=e[48];let M;e[49]===Symbol.for("react.memo_cache_sentinel")?(M=()=>f(!0),e[49]=M):M=e[49];let R;e[50]!==o?(R=o("routes.commerceOnboarding.createNewOrg"),e[50]=o,e[51]=R):R=e[51];let z;e[52]!==p||e[53]!==b||e[54]!==_||e[55]!==R?(z=r.jsx(We,{className:"-mx-1 -my-1 max-h-[60vh] overflow-y-auto px-1 py-1",children:r.jsx(qe,{organizations:p,selectLabel:b,onSelected:_,onCreateNew:M,createNewLabel:R})}),e[52]=p,e[53]=b,e[54]=_,e[55]=R,e[56]=z):z=e[56];let U;e[57]!==x||e[58]!==z?(U=r.jsxs("div",{className:"grid gap-10",children:[x,z]}),e[57]=x,e[58]=z,e[59]=U):U=e[59];let T;e[60]!==l||e[61]!==i?(T=j=>{Se(),l({to:"/commerce-onboarding",search:{org:j,siteUrl:i}})},e[60]=l,e[61]=i,e[62]=T):T=e[62];let I;e[63]!==u||e[64]!==T?(I=r.jsx(Ve,{open:u,onOpenChange:f,onCreated:T}),e[63]=u,e[64]=T,e[65]=I):I=e[65];let L;return e[66]!==U||e[67]!==I?(L=r.jsxs(H,{children:[U,I]}),e[66]=U,e[67]=I,e[68]=L):L=e[68],L}if(!m){let g;e[69]!==v?(g=()=>{v.reset(),v.mutate()},e[69]=v,e[70]=g):g=e[70];let h;return e[71]!==v||e[72]!==g?(h=r.jsx(At,{mutation:v,onRetry:g}),e[71]=v,e[72]=g,e[73]=h):h=e[73],h}const C=m;if(C?.success&&(C.status==="created"||C.status==="joined"||C.status==="already_has_organization")&&C.organization){let g;return e[74]!==C.organization||e[75]!==i?(g=r.jsx(ve,{org:C.organization,initialSiteUrl:i}),e[74]=C.organization,e[75]=i,e[76]=g):g=e[76],g}if(C?.status==="ambiguous"&&C.organizations&&C.organizations.length>0){let g;e[77]!==o?(g=o("routes.commerceOnboarding.chooseOrg"),e[77]=o,e[78]=g):g=e[78];let h;e[79]!==o?(h=o("routes.commerceOnboarding.emailAccessMultipleOrgs"),e[79]=o,e[80]=h):h=e[80];let x;e[81]!==g||e[82]!==h?(x=r.jsx(J,{title:g,description:h}),e[81]=g,e[82]=h,e[83]=x):x=e[83];const b=C.organizations,_=C.domain??void 0;let M;e[84]!==l||e[85]!==i?(M=(X,Z)=>{Se(),c({...X,slug:Z}),l({to:"/commerce-onboarding",search:{org:Z,siteUrl:i}})},e[84]=l,e[85]=i,e[86]=M):M=e[86];let R;e[87]===Symbol.for("react.memo_cache_sentinel")?(R=()=>f(!0),e[87]=R):R=e[87];let z;e[88]!==o?(z=o("routes.commerceOnboarding.createNewOrg"),e[88]=o,e[89]=z):z=e[89];let U;e[90]!==C.organizations||e[91]!==_||e[92]!==M||e[93]!==z?(U=r.jsx(We,{className:"-mx-1 -my-1 max-h-[60vh] overflow-y-auto px-1 py-1",children:r.jsx(qe,{organizations:b,domain:_,onJoined:M,onCreateNew:R,createNewLabel:z})}),e[90]=C.organizations,e[91]=_,e[92]=M,e[93]=z,e[94]=U):U=e[94];let T;e[95]!==U||e[96]!==x?(T=r.jsxs("div",{className:"grid gap-10",children:[x,U]}),e[95]=U,e[96]=x,e[97]=T):T=e[97];let I;e[98]!==l||e[99]!==i?(I=X=>{Se(),l({to:"/commerce-onboarding",search:{org:X,siteUrl:i}})},e[98]=l,e[99]=i,e[100]=I):I=e[100];let L;e[101]!==u||e[102]!==I?(L=r.jsx(Ve,{open:u,onOpenChange:f,onCreated:I}),e[101]=u,e[102]=I,e[103]=L):L=e[103];let j;return e[104]!==T||e[105]!==L?(j=r.jsxs(H,{children:[T,L]}),e[104]=T,e[105]=L,e[106]=j):j=e[106],j}let P;e[107]!==o?(P=o("routes.commerceOnboarding.onboardingNeedsSupport"),e[107]=o,e[108]=P):P=e[108];let E;e[109]!==C?.error||e[110]!==o?(E=C?.error??o("routes.commerceOnboarding.couldNotDetermineOrg"),e[109]=C?.error,e[110]=o,e[111]=E):E=e[111];let D;e[112]!==o?(D=o("routes.commerceOnboarding.retryAgain"),e[112]=o,e[113]=D):D=e[113];let W;e[114]!==v?(W=()=>{d(null),v.reset()},e[114]=v,e[115]=W):W=e[115];let q;return e[116]!==P||e[117]!==E||e[118]!==D||e[119]!==W?(q=r.jsx(_e,{title:P,description:E,actionLabel:D,onRetry:W}),e[116]=P,e[117]=E,e[118]=D,e[119]=W,e[120]=q):q=e[120],q}async function Tt(){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&&Se(),e}function Dt(t){return{id:t.id,name:t.name,slug:t.slug,logo:t.logo??null}}function At(t){const e=N.c(16),{mutation:s,onRetry:i}=t,o=Q(),l=Y.useRef(!1);let a;e[0]!==s?(a=d=>{!d||l.current||(l.current=!0,s.mutate())},e[0]=s,e[1]=a):a=e[1];const n=a;if(s.error){let d;e[2]!==o?(d=o("routes.commerceOnboarding.onboardingUnavailable"),e[2]=o,e[3]=d):d=e[3];let u;e[4]!==o?(u=o("routes.commerceOnboarding.couldNotPrepareOrg"),e[4]=o,e[5]=u):u=e[5];let f;e[6]!==o?(f=o("routes.commerceOnboarding.retryAgain"),e[6]=o,e[7]=f):f=e[7];let p;return e[8]!==i||e[9]!==d||e[10]!==u||e[11]!==f?(p=r.jsx(_e,{title:d,description:u,actionLabel:f,onRetry:i}),e[8]=i,e[9]=d,e[10]=u,e[11]=f,e[12]=p):p=e[12],p}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx($e,{variant:"generic"}),e[13]=c):c=e[13];let m;return e[14]!==n?(m=r.jsx(H,{children:r.jsx("div",{ref:n,children:c})}),e[14]=n,e[15]=m):m=e[15],m}function J(t){const e=N.c(8),{title:s,description:i}=t,o=rt();let l;e[0]!==o?(l=o?r.jsx(tt,{host:o}):r.jsxs("div",{children:[r.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),r.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==i||e[3]!==s?(a=(s||i)&&r.jsxs("div",{className:"space-y-2",children:[s&&r.jsx("h1",{className:"text-2xl font-medium leading-8",children:s}),i&&r.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=s,e[4]=a):a=e[4];let n;return e[5]!==l||e[6]!==a?(n=r.jsxs("div",{className:"grid gap-10",children:[l,a]}),e[5]=l,e[6]=a,e[7]=n):n=e[7],n}function _e(t){const e=N.c(9),{title:s,description:i,actionLabel:o,onRetry:l}=t;let a;e[0]!==i||e[1]!==s?(a=r.jsx(J,{title:s,description:i}),e[0]=i,e[1]=s,e[2]=a):a=e[2];let n;e[3]!==o||e[4]!==l?(n=r.jsx(Ne,{type:"button",size:"xl",className:"w-full",onClick:l,children:o}),e[3]=o,e[4]=l,e[5]=n):n=e[5];let c;return e[6]!==a||e[7]!==n?(c=r.jsx(H,{children:r.jsxs("div",{className:"grid gap-10",children:[a,n]})}),e[6]=a,e[7]=n,e[8]=c):c=e[8],c}function ve(t){const e=N.c(13),{org:s,initialSiteUrl:i}=t,o=Q(),{data:l}=De.useSession(),[a]=Ee(),n=l?.user?.email;let c;e[0]!==i||e[1]!==a.language||e[2]!==n?(c=Ae({siteUrl:i,email:n,locale:a.language}),e[0]=i,e[1]=a.language,e[2]=n,e[3]=c):c=e[3];const m=c;let d;e[4]!==m||e[5]!==s.id?(d=r.jsx(Fe,{href:m,orgId:s.id}),e[4]=m,e[5]=s.id,e[6]=d):d=e[6];const u=d;let f;return e[7]!==i||e[8]!==u||e[9]!==s||e[10]!==l?.user?.email||e[11]!==o?(f=r.jsx(ct,{children:p=>{const{reset:O}=p;return r.jsx(mt,{fallback:v=>{const{error:w,resetError:C}=v;return r.jsx(H,{visual:u,children:r.jsx(Ft,{orgName:s.name,message:w instanceof Error?w.message:o("routes.commerceOnboarding.couldNotVerifyCommerceSetting"),onRetry:()=>{O(),C()}})})},children:r.jsx(Y.Suspense,{fallback:r.jsx(it,{visual:u}),children:r.jsx($t,{org:s,initialSiteUrl:i,sessionEmail:l?.user?.email},`${s.id}:${i??""}`)})})}}),e[7]=i,e[8]=u,e[9]=s,e[10]=l?.user?.email,e[11]=o,e[12]=f):f=e[12],f}function it(t){const e=N.c(3),{visual:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[r.jsx(J,{}),r.jsx(et,{})]}),e[0]=i):i=e[0];let o;return e[1]!==s?(o=r.jsx(H,{align:"fill",visual:s,children:i}),e[1]=s,e[2]=o):o=e[2],o}function Ft(t){const e=N.c(19),{orgName:s,message:i,onRetry:o}=t,l=Q();let a;e[0]!==l?(a=l("routes.commerceOnboarding.commerceDiagnostic"),e[0]=l,e[1]=a):a=e[1];let n;e[2]!==s||e[3]!==l?(n=l("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s}),e[2]=s,e[3]=l,e[4]=n):n=e[4];let c;e[5]!==a||e[6]!==n?(c=r.jsx(J,{title:a,description:n}),e[5]=a,e[6]=n,e[7]=c):c=e[7];let m;e[8]!==i?(m=r.jsx(we,{message:i}),e[8]=i,e[9]=m):m=e[9];let d;e[10]!==l?(d=l("routes.commerceOnboarding.retryAgain"),e[10]=l,e[11]=d):d=e[11];let u;e[12]!==o||e[13]!==d?(u=r.jsx(Ne,{type:"button",size:"xl",className:"w-full",onClick:o,children:d}),e[12]=o,e[13]=d,e[14]=u):u=e[14];let f;return e[15]!==c||e[16]!==m||e[17]!==u?(f=r.jsxs("div",{className:"grid gap-10",children:[c,m,u]}),e[15]=c,e[16]=m,e[17]=u,e[18]=f):f=e[18],f}function $t(t){const e=N.c(135),{org:s,initialSiteUrl:i,sessionEmail:o}=t;let l;e[0]!==s.id||e[1]!==s.slug?(l={connectionId:jt,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l):l=e[2];const a=Ot(l),[n,c]=Y.useState(i??""),[m,d]=Y.useState(null),u=Y.useRef(!1),f=vt.COMMERCE_DISCOVERY(s.id),p=St(s.id),O=Be.commerceDiscoveryConnection(s.id,f);let v;e[3]!==f||e[4]!==a?(v=async()=>{const y=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:f}});return Le(y)},e[3]=f,e[4]=a,e[5]=v):v=e[5];let w;e[6]!==O||e[7]!==v?(w={queryKey:O,queryFn:v,retry:!1},e[6]=O,e[7]=v,e[8]=w):w=e[8];const C=He(w),P=Be.commerceDiscoveryVirtualMcp(s.id,p);let E;e[9]!==a||e[10]!==p?(E=async()=>{const y=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:p}});return Le(y)},e[9]=a,e[10]=p,e[11]=E):E=e[11];let D;e[12]!==P||e[13]!==E?(D={queryKey:P,queryFn:E,retry:!1},e[12]=P,e[13]=E,e[14]=D):D=e[14];const W=He(D);let q;e[15]!==a?(q=async y=>{const S=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:y}});return Le(S)},e[15]=a,e[16]=q):q=e[16];let g;e[17]!==C||e[18]!==s.id||e[19]!==W?(g=(y,S)=>{ue("commerce_onboarding_setup_succeeded",{domain:Te(S)??void 0,organization_id:s.id}),d(null),C.refetch(),W.refetch()},e[17]=C,e[18]=s.id,e[19]=W,e[20]=g):g=e[20];let h;e[21]!==s.id?(h=(y,S)=>{ue("commerce_onboarding_setup_failed",{domain:Te(S)??void 0,organization_id:s.id,error:y instanceof Error?y.message:String(y)}),d(y instanceof Error?y.message:"__configurationFailed")},e[21]=s.id,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==q||e[25]!==g?(x={mutationFn:q,retry:!1,onSuccess:g,onError:h},e[23]=h,e[24]=q,e[25]=g,e[26]=x):x=e[26];const b=Ze(x),_=!!C.data.item&&!!W.data.item,M=C.data.item,R=typeof M?.metadata?.siteUrl=="string"?M.metadata.siteUrl:void 0,z=i||n||"";let U;e[27]!==R||e[28]!==z?(U=gt(z,R),e[27]=R,e[28]=z,e[29]=U):U=e[29];const I=_&&U,L=i||n||R||"",j=Q(),[X]=Ee();let Z;e[30]!==L||e[31]!==X.language||e[32]!==o?(Z=Ae({siteUrl:L,email:o,locale:X.language}),e[30]=L,e[31]=X.language,e[32]=o,e[33]=Z):Z=e[33];const Ue=Z;let ge;e[34]!==Ue||e[35]!==s.id?(ge=r.jsx(Fe,{href:Ue,orgId:s.id}),e[34]=Ue,e[35]=s.id,e[36]=ge):ge=e[36];const $=ge;let fe;e[37]!==m||e[38]!==j?(fe=m?Qe(j,m):null,e[37]=m,e[38]=j,e[39]=fe):fe=e[39];const B=fe;let pe;e[40]!==b?(pe=y=>{const S=Re(y);if(!S.ok){d(S.error);return}d(null),b.mutate(S.value)},e[40]=b,e[41]=pe):pe=e[41];const ee=pe;let he;e[42]!==i||e[43]!==ee||e[44]!==I?(he=y=>{!y||u.current||I||!i||(u.current=!0,ee(i))},e[42]=i,e[43]=ee,e[44]=I,e[45]=he):he=e[45];const Ie=he;let be;e[46]!==s.id||e[47]!==ee||e[48]!==n?(be=y=>{y.preventDefault();const S=Re(n);S.ok&&ue("commerce_onboarding_site_url_submitted",{domain:new URL(S.value).hostname,organization_id:s.id}),ee(n)},e[46]=s.id,e[47]=ee,e[48]=n,e[49]=be):be=e[49];const V=be;if(I){const y=s.slug;let S;e[50]===Symbol.for("react.memo_cache_sentinel")?(S=crypto.randomUUID(),e[50]=S):S=e[50];let k;e[51]!==s.slug?(k={org:y,taskId:S},e[51]=s.slug,e[52]=k):k=e[52];let A;e[53]!==s.id?(A=_t(s.id),e[53]=s.id,e[54]=A):A=e[54];const G=L||void 0;let F;e[55]!==A.id||e[56]!==G?(F={virtualmcpid:A.id,connect:"1",siteUrl:G},e[55]=A.id,e[56]=G,e[57]=F):F=e[57];let K;return e[58]!==k||e[59]!==F?(K=r.jsx(dt,{to:"/$org/$taskId",params:k,search:F,replace:!0}),e[58]=k,e[59]=F,e[60]=K):K=e[60],K}if(b.isPending){let y;return e[61]!==$?(y=r.jsx(it,{visual:$}),e[61]=$,e[62]=y):y=e[62],y}if(i){let y,S,k,A,G,F,K,ne;if(e[63]!==$||e[64]!==V||e[65]!==i||e[66]!==s.name||e[67]!==b.isPending||e[68]!==n||e[69]!==j||e[70]!==B||e[71]!==Ie){ne=Symbol.for("react.early_return_sentinel");e:{const Pe=Re(i);if(!Pe.ok){let me;e[80]!==j?(me=j("routes.commerceOnboarding.commerceDiagnostic"),e[80]=j,e[81]=me):me=e[81];let de;e[82]!==s.name||e[83]!==j?(de=j("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s.name}),e[82]=s.name,e[83]=j,e[84]=de):de=e[84];let Ce;e[85]!==me||e[86]!==de?(Ce=r.jsx(J,{title:me,description:de}),e[85]=me,e[86]=de,e[87]=Ce):Ce=e[87];let je;e[88]!==V||e[89]!==b.isPending||e[90]!==n||e[91]!==B?(je=r.jsx(ke,{siteUrl:n,error:B,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V}),e[88]=V,e[89]=b.isPending,e[90]=n,e[91]=B,e[92]=je):je=e[92];const ze=r.jsxs("div",{className:"grid gap-10",children:[Ce,r.jsx(we,{message:Qe(j,Pe.error)}),je]});let Oe;e[93]!==$||e[94]!==ze?(Oe=r.jsx(H,{visual:$,children:ze}),e[93]=$,e[94]=ze,e[95]=Oe):Oe=e[95],ne=Oe;break e}S=H,K=$,G=Ie,F="grid gap-10",y=J,e[96]!==j?(k=j("routes.commerceOnboarding.commerceDiagnostic"),e[96]=j,e[97]=k):k=e[97],A=j("routes.commerceOnboarding.commerceDiscoveryBeingPrepared",{url:Pe.value})}e[63]=$,e[64]=V,e[65]=i,e[66]=s.name,e[67]=b.isPending,e[68]=n,e[69]=j,e[70]=B,e[71]=Ie,e[72]=y,e[73]=S,e[74]=k,e[75]=A,e[76]=G,e[77]=F,e[78]=K,e[79]=ne}else y=e[72],S=e[73],k=e[74],A=e[75],G=e[76],F=e[77],K=e[78],ne=e[79];if(ne!==Symbol.for("react.early_return_sentinel"))return ne;let le;e[98]!==y||e[99]!==k||e[100]!==A?(le=r.jsx(y,{title:k,description:A}),e[98]=y,e[99]=k,e[100]=A,e[101]=le):le=e[101];let ae;e[102]!==V||e[103]!==b.isPending||e[104]!==n||e[105]!==B?(ae=B?r.jsxs(r.Fragment,{children:[r.jsx(we,{message:B}),r.jsx(ke,{siteUrl:n,error:null,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V})]}):r.jsx(et,{}),e[102]=V,e[103]=b.isPending,e[104]=n,e[105]=B,e[106]=ae):ae=e[106];let ce;e[107]!==G||e[108]!==F||e[109]!==le||e[110]!==ae?(ce=r.jsxs("div",{ref:G,className:F,children:[le,ae]}),e[107]=G,e[108]=F,e[109]=le,e[110]=ae,e[111]=ce):ce=e[111];let ye;return e[112]!==S||e[113]!==K||e[114]!==ce?(ye=r.jsx(S,{visual:K,children:ce}),e[112]=S,e[113]=K,e[114]=ce,e[115]=ye):ye=e[115],ye}let te;e[116]!==j?(te=j("routes.commerceOnboarding.commerceDiagnostic"),e[116]=j,e[117]=te):te=e[117];let oe;e[118]!==s.name||e[119]!==j?(oe=j("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s.name}),e[118]=s.name,e[119]=j,e[120]=oe):oe=e[120];let re;e[121]!==te||e[122]!==oe?(re=r.jsx(J,{title:te,description:oe}),e[121]=te,e[122]=oe,e[123]=re):re=e[123];let ie;e[124]!==V||e[125]!==b.isPending||e[126]!==n||e[127]!==B?(ie=r.jsx(ke,{siteUrl:n,error:B,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V}),e[124]=V,e[125]=b.isPending,e[126]=n,e[127]=B,e[128]=ie):ie=e[128];let se;e[129]!==re||e[130]!==ie?(se=r.jsxs("div",{className:"grid gap-10",children:[re,ie]}),e[129]=re,e[130]=ie,e[131]=se):se=e[131];let xe;return e[132]!==$||e[133]!==se?(xe=r.jsx(H,{visual:$,children:se}),e[132]=$,e[133]=se,e[134]=xe):xe=e[134],xe}function ke(t){const e=N.c(30),{siteUrl:s,error:i,isSubmitting:o,onSiteUrlChange:l,onSubmit:a}=t,n=Q();let c;e[0]!==n?(c=n("routes.commerceOnboarding.siteUrlLabel"),e[0]=n,e[1]=c):c=e[1];let m;e[2]!==c?(m=r.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:c}),e[2]=c,e[3]=m):m=e[3];let d;e[4]!==l?(d=D=>l(D.target.value),e[4]=l,e[5]=d):d=e[5];let u;e[6]!==n?(u=n("routes.commerceOnboarding.siteUrlPlaceholder"),e[6]=n,e[7]=u):u=e[7];const f=!!i;let p;e[8]!==o||e[9]!==s||e[10]!==d||e[11]!==u||e[12]!==f?(p=r.jsx(bt,{id:"commerce-site-url",type:"text",inputMode:"url",value:s,onChange:d,placeholder:u,"aria-invalid":f,disabled:o}),e[8]=o,e[9]=s,e[10]=d,e[11]=u,e[12]=f,e[13]=p):p=e[13];let O;e[14]!==i?(O=i?r.jsx(we,{message:i}):null,e[14]=i,e[15]=O):O=e[15];let v;e[16]!==m||e[17]!==p||e[18]!==O?(v=r.jsxs("div",{className:"grid gap-2",children:[m,p,O]}),e[16]=m,e[17]=p,e[18]=O,e[19]=v):v=e[19];let w;e[20]!==n?(w=n("routes.commerceOnboarding.authCopy.continue"),e[20]=n,e[21]=w):w=e[21];let C;e[22]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsx(wt,{size:16}),e[22]=C):C=e[22];let P;e[23]!==o||e[24]!==w?(P=r.jsxs(Ne,{type:"submit",size:"xl",className:"w-full",disabled:o,children:[w,C]}),e[23]=o,e[24]=w,e[25]=P):P=e[25];let E;return e[26]!==a||e[27]!==P||e[28]!==v?(E=r.jsxs("form",{className:"grid gap-4",onSubmit:a,children:[v,P]}),e[26]=a,e[27]=P,e[28]=v,e[29]=E):E=e[29],E}function we(t){const e=N.c(2),{message:s}=t;let i;return e[0]!==s?(i=r.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:s}),e[0]=s,e[1]=i):i=e[1],i}export{mr as default};