decocms 4.344.7 → 4.345.0

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 (258) hide show
  1. package/dist/client/assets/{AlertCircle-CUcQGJWg.js → AlertCircle-piOaFPQJ.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Bjc6phYY.js → AreaChart-C754kxxt.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CSPpZjix.js → ArrowLeft-EySzpaMt.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CpVx9ViU.js → ArrowRight-CN1prjjJ.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DSGIlxLY.js → ArrowUp-39D5k7I2.js} +1 -1
  6. package/dist/client/assets/{Check-1zXE7wWA.js → Check-CmgBwUGv.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DgtK-Ftc.js → CheckCircle-CwJqWx0e.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-DprZKKxq.js → ChevronRight-Dk9nR_C7.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-Bva6hXFn.js → ChevronSelectorVertical-X68ci9mX.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-DwjhbMCo.js → ChevronUp-DLLvYK07.js} +1 -1
  11. package/dist/client/assets/{Copy01-BVJCFNfp.js → Copy01-DlxhdgMn.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-DJQ89VL7.js → CreditCard01-CGG5tsm6.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-B1zgMGCf.js → DotsVertical-Bk31Y8qH.js} +1 -1
  14. package/dist/client/assets/{Download01-d7QlNeIi.js → Download01-CxTJDArl.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-DjQRwN1B.js → ErrorBarContext-DAIYWYhf.js} +1 -1
  16. package/dist/client/assets/{Eye-sLXfRAsu.js → Eye-UEYlbIHb.js} +1 -1
  17. package/dist/client/assets/{GitBranch01-Cevd7IY5.js → GitBranch01-DRT2X7Dj.js} +1 -1
  18. package/dist/client/assets/{Globe01-YMmGLMrH.js → Globe01-Z6BbST4r.js} +1 -1
  19. package/dist/client/assets/{HardDrive-CBNkuV5p.js → HardDrive--vlQvWpi.js} +1 -1
  20. package/dist/client/assets/{Image01-_jew13y9.js → Image01-rCxXluf6.js} +1 -1
  21. package/dist/client/assets/{Key01-DxL7RaRt.js → Key01-By90Yq6k.js} +1 -1
  22. package/dist/client/assets/{Link01-BsnNRJbd.js → Link01-CUe3c6G0.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-CHynaVJX.js → LinkExternal01-D2pSy7v4.js} +1 -1
  24. package/dist/client/assets/{Monitor01-D384tcCL.js → Monitor01-CY2DbFkD.js} +1 -1
  25. package/dist/client/assets/{Package-CICmKbed.js → Package-Bb4KYw9O.js} +1 -1
  26. package/dist/client/assets/{Palette-C3wV8GbF.js → Palette-o-NEtwsW.js} +1 -1
  27. package/dist/client/assets/{Play-DyY4uqsk.js → Play-DpmIDjD8.js} +1 -1
  28. package/dist/client/assets/{Plus-BtzuFXpa.js → Plus-CgVmxzR4.js} +1 -1
  29. package/dist/client/assets/{SearchMd-RzdqOTz6.js → SearchMd-Cjr4mqh9.js} +1 -1
  30. package/dist/client/assets/{Sector-BbXsKxpS.js → Sector-3UpSGQVE.js} +1 -1
  31. package/dist/client/assets/{Settings02-Czze_bb5.js → Settings02-Dss_LnvC.js} +1 -1
  32. package/dist/client/assets/{Share07-DDpIIfsq.js → Share07-CgTNZ1dk.js} +1 -1
  33. package/dist/client/assets/{Shield01-B4pGOGci.js → Shield01-CNbrlPDI.js} +1 -1
  34. package/dist/client/assets/{Stars01-CjHCSDX3.js → Stars01-Dno5l14o.js} +1 -1
  35. package/dist/client/assets/{Sun-Dq3o46U_.js → Sun-DAVD-A5B.js} +1 -1
  36. package/dist/client/assets/{Tool01-DVKwxNl0.js → Tool01-DdmZi7j_.js} +1 -1
  37. package/dist/client/assets/{Tool02-DDmfltgM.js → Tool02-KStnzngn.js} +1 -1
  38. package/dist/client/assets/{Trash01-LsgvHH60.js → Trash01-BevWobXU.js} +1 -1
  39. package/dist/client/assets/{TrendUp01-DioIZ0XZ.js → TrendUp01-NTK3Zf_M.js} +1 -1
  40. package/dist/client/assets/{Upload01-9qmJgRWz.js → Upload01-By19QANP.js} +1 -1
  41. package/dist/client/assets/{User01-AzXDuWJx.js → User01-CDRv3_oY.js} +1 -1
  42. package/dist/client/assets/{UserSquare-BVL5WuNS.js → UserSquare-l4Q5fPEZ.js} +1 -1
  43. package/dist/client/assets/{Users01-twdbMWRY.js → Users01-sAr72jTU.js} +1 -1
  44. package/dist/client/assets/{Users03-B9ZuJ2UL.js → Users03-CrZajyAo.js} +1 -1
  45. package/dist/client/assets/{XCircle-BCL9MwCk.js → XCircle-BTj4-tdv.js} +1 -1
  46. package/dist/client/assets/{XClose-CeiPTewB.js → XClose-C-bbcgCJ.js} +1 -1
  47. package/dist/client/assets/{Zap-CKLZSOSt.js → Zap-D6-O3NZl.js} +1 -1
  48. package/dist/client/assets/{ZoomOut-BIvjfxkI.js → ZoomOut-DpAkOD8e.js} +1 -1
  49. package/dist/client/assets/{access-gate-Co7Qfch9.js → access-gate-DQan09qj.js} +1 -1
  50. package/dist/client/assets/{agent-icon-BpEwOiGV.js → agent-icon-BrQLA9dC.js} +1 -1
  51. package/dist/client/assets/{agents-list-Cwvzogc_.js → agents-list-BIlHhg8F.js} +1 -1
  52. package/dist/client/assets/{ai-providers-DxCToBOI.js → ai-providers-D9jubp2s.js} +1 -1
  53. package/dist/client/assets/{alert-C2fyV676.js → alert-DI_JsgmI.js} +1 -1
  54. package/dist/client/assets/{alert-dialog-DNgGWz87.js → alert-dialog-DuVJ7GC7.js} +1 -1
  55. package/dist/client/assets/{analytics-tab-PHu6l59L.js → analytics-tab-gxTnWc1L.js} +1 -1
  56. package/dist/client/assets/{api-keys-BhwK48l0.js → api-keys-BJORgq17.js} +1 -1
  57. package/dist/client/assets/api-keys-DM-VC8Ks.js +1 -0
  58. package/dist/client/assets/app-editor-ueQwisxj.js +1 -0
  59. package/dist/client/assets/{auth-Dgy_FfAZ.js → auth-CRmM4ftp.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-ekkwg0sn.js → auth-catchall-D9f22qVk.js} +1 -1
  61. package/dist/client/assets/{auth-entry-CIwP8Rqn.js → auth-entry-Z1av5utg.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-inykjGhF.js → auth-split-layout-Dhyl4Mok.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-CHh3ra8X.js → authenticate-and-persist-oauth-DEZCdj-t.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-BZVMG0s5.js → automation-list-row-CJo0GDE_.js} +1 -1
  65. package/dist/client/assets/{automation-runs-DuP-wdLK.js → automation-runs-Ge9BW9cQ.js} +1 -1
  66. package/dist/client/assets/{automations-Bi1i3HXW.js → automations-AOZDTTBB.js} +1 -1
  67. package/dist/client/assets/{autosend-DQFcN1uS.js → autosend-CI7ToXd3.js} +1 -1
  68. package/dist/client/assets/{avatar-p5OetRNi.js → avatar-ncVfbaUx.js} +1 -1
  69. package/dist/client/assets/{badge-DpkiDIOC.js → badge-rtLQpibV.js} +1 -1
  70. package/dist/client/assets/{block-document-DobdtgLr.js → block-document-WxPy4zHY.js} +1 -1
  71. package/dist/client/assets/{breadcrumb-C8vZ3frM.js → breadcrumb-d7wNqsyt.js} +1 -1
  72. package/dist/client/assets/{buckets-Dr-obDzL.js → buckets-NBI_IEuj.js} +1 -1
  73. package/dist/client/assets/{bulk-category-panel-BD6uCEcf.js → bulk-category-panel-B8uZmKXZ.js} +1 -1
  74. package/dist/client/assets/{capability-load-error-DzIqZGl0.js → capability-load-error-BAq8tXOS.js} +1 -1
  75. package/dist/client/assets/{cards-Bzy1Xtvb.js → cards-CgpdHb-U.js} +1 -1
  76. package/dist/client/assets/{category-editor-DERpB4vz.js → category-editor-DrNCa6L7.js} +1 -1
  77. package/dist/client/assets/{cdn-tab-C9cGMfIc.js → cdn-tab-BflNT2VL.js} +1 -1
  78. package/dist/client/assets/{chart-rcdPf4fQ.js → chart-C7j_btUB.js} +1 -1
  79. package/dist/client/assets/{chat-context-avJOfrtu.js → chat-context-BcY08VKG.js} +1 -1
  80. package/dist/client/assets/{checkbox-D9o3_hf-.js → checkbox-D0oTwa58.js} +1 -1
  81. package/dist/client/assets/{choose-editor-Cx_Q-V5I.js → choose-editor-B2cOrwQv.js} +1 -1
  82. package/dist/client/assets/{cli-auth-success-BD12raYd.js → cli-auth-success-G8Y4SVGK.js} +1 -1
  83. package/dist/client/assets/{client-icons-BgRgSWI4.js → client-icons-BE3evb-i.js} +1 -1
  84. package/dist/client/assets/{collection-detail-DHMLnwRz.js → collection-detail-DCICjiwT.js} +1 -1
  85. package/dist/client/assets/{collection-display-button-D7uyuLOA.js → collection-display-button-C4HtW9B5.js} +1 -1
  86. package/dist/client/assets/{collection-search-Dn7QEyUJ.js → collection-search-UW0xDxmi.js} +1 -1
  87. package/dist/client/assets/{collection-table-wrapper-apDDwogq.js → collection-table-wrapper-STLb6VjQ.js} +1 -1
  88. package/dist/client/assets/{collection-tabs-5dU7fGdE.js → collection-tabs-644rp01A.js} +1 -1
  89. package/dist/client/assets/{command-CENaHYOX.js → command-CTH7s7Ya.js} +1 -1
  90. package/dist/client/assets/{commerce-onboarding-CyPVgfTY.js → commerce-onboarding-CxUaxjg3.js} +1 -1
  91. package/dist/client/assets/{connect-2lJ0CWwS.js → connect-DEIsBWg2.js} +1 -1
  92. package/dist/client/assets/{connect-layout-DHtZKhj-.js → connect-layout-CmuGJ6zd.js} +1 -1
  93. package/dist/client/assets/{connection-BXj1lf6L.js → connection-CU1s53fy.js} +1 -1
  94. package/dist/client/assets/{connection-card-xtbTrH0z.js → connection-card-B-DQLE2m.js} +1 -1
  95. package/dist/client/assets/{connection-detail-_tAXd69l.js → connection-detail-C3OYxb5o.js} +1 -1
  96. package/dist/client/assets/{connection-form-helpers-DbWPqpmc.js → connection-form-helpers-B-auMXZc.js} +1 -1
  97. package/dist/client/assets/{connections-LDx4JE2z.js → connections-DPnFX966.js} +1 -1
  98. package/dist/client/assets/{create-organization-dialog-CkEoogzg.js → create-organization-dialog-xnwS5290.js} +1 -1
  99. package/dist/client/assets/{decopilot-sse-pool-DIjPP0nf.js → decopilot-sse-pool-CnHcYfZj.js} +1 -1
  100. package/dist/client/assets/{dialog-BGZ5Hg3Q.js → dialog-DKxWMb0-.js} +1 -1
  101. package/dist/client/assets/{domain-settings-Co45KpqJ.js → domain-settings-yEjTU5K7.js} +1 -1
  102. package/dist/client/assets/{drawer-3JQ45fRR.js → drawer-BaA_lu4x.js} +1 -1
  103. package/dist/client/assets/{dropdown-menu-CTqjAJHc.js → dropdown-menu-CC8IMYtS.js} +1 -1
  104. package/dist/client/assets/{e2e-tab-CVeKwP0K.js → e2e-tab-CyxfrSC2.js} +1 -1
  105. package/dist/client/assets/{editor-yboX_q5K.js → editor-Cm-sI42p.js} +1 -1
  106. package/dist/client/assets/{empty-state-BlkGmg_f.js → empty-state-BioEMyZp.js} +1 -1
  107. package/dist/client/assets/{empty-state-DNkmU35f.js → empty-state-DA8cnNqW.js} +1 -1
  108. package/dist/client/assets/{extract-connection-data-C6uzSv1P.js → extract-connection-data-BdnZZmxw.js} +1 -1
  109. package/dist/client/assets/{file-explorer-BLjo6fOf.js → file-explorer-jXzlywVk.js} +1 -1
  110. package/dist/client/assets/{file-type-icon-BLgP8JAi.js → file-type-icon-ChIQfzaN.js} +1 -1
  111. package/dist/client/assets/{folder-icon-75w1BOQR.js → folder-icon-_4CbErMC.js} +1 -1
  112. package/dist/client/assets/{form-BQfZ_wMX.js → form-CorLMse0.js} +1 -1
  113. package/dist/client/assets/{general-CEPG7r1N.js → general-BCDanvgJ.js} +1 -1
  114. package/dist/client/assets/{github-icon-BfYLFe-E.js → github-icon-CeFWgmVz.js} +1 -1
  115. package/dist/client/assets/{hooks-Dtkl47gt.js → hooks-BOHEAk9Y.js} +1 -1
  116. package/dist/client/assets/{hosting-tab-DA0OMdEY.js → hosting-tab-BktIiwOH.js} +1 -1
  117. package/dist/client/assets/{index-A8aKaNa1.js → index-B8l7Wp2b.js} +1 -1
  118. package/dist/client/assets/{index-qHW_5WLU.js → index-BAPa6G_8.js} +1 -1
  119. package/dist/client/assets/{index-C6TPg4UC.js → index-BlP07NoC.js} +6 -6
  120. package/dist/client/assets/{index-C7-k65cq.js → index-BrCtIPlH.js} +1 -1
  121. package/dist/client/assets/{index-CZn7QLbC.js → index-CYWX8R5H.js} +1 -1
  122. package/dist/client/assets/{index-aGsG7oyA.js → index-D0wjsDWq.js} +1 -1
  123. package/dist/client/assets/{index-HrCtDpMK.js → index-ObIlqSDZ.js} +1 -1
  124. package/dist/client/assets/{index-DwEbGAs2.js → index-YZeWKaou.js} +1 -1
  125. package/dist/client/assets/{index-CFc50fBU.js → index-fS0pDoNW.js} +4 -4
  126. package/dist/client/assets/{index-redirect-Cr7P0vqQ.js → index-redirect-CfbLeyNL.js} +1 -1
  127. package/dist/client/assets/{index-Dr4MBhJ_.js → index-w12TFwlK.js} +1 -1
  128. package/dist/client/assets/{infiniteQueryObserver-C2474thX.js → infiniteQueryObserver-B62setNi.js} +1 -1
  129. package/dist/client/assets/{infra-billing-BmtbdCGi.js → infra-billing-BtMbkXjN.js} +1 -1
  130. package/dist/client/assets/{input-DzyddHML.js → input-DaMV0yqT.js} +1 -1
  131. package/dist/client/assets/{integration-icon-CBipnYKk.js → integration-icon-BFx8Gs71.js} +1 -1
  132. package/dist/client/assets/{invite-member-dialog-CR-r4ixW.js → invite-member-dialog-erQjr6Dv.js} +1 -1
  133. package/dist/client/assets/{label-BNKcfQJl.js → label-Cznjg7Mb.js} +1 -1
  134. package/dist/client/assets/{layout-DFxnRLE_.js → layout-CwmaRw9Y.js} +1 -1
  135. package/dist/client/assets/{login-BP4-jfy7.js → login-DYTFtcpb.js} +1 -1
  136. package/dist/client/assets/{markdown-CtZT5hKm.js → markdown-BNMHtGi6.js} +1 -1
  137. package/dist/client/assets/{mcp-app-renderer-CCUBqyqA.js → mcp-app-renderer-Df-LUzfK.js} +1 -1
  138. package/dist/client/assets/{mcp-oauth-DZRe9Xrr.js → mcp-oauth-CDjOqnrq.js} +1 -1
  139. package/dist/client/assets/{members-DopbgyyL.js → members-s02j5DFH.js} +1 -1
  140. package/dist/client/assets/{monaco-editor-DS9r540U.js → monaco-editor-7CBGfDCH.js} +1 -1
  141. package/dist/client/assets/{monitoring-stats-row-CI8-MHz1.js → monitoring-stats-row-CO2-hLq6.js} +1 -1
  142. package/dist/client/assets/{multi-select-BAWuWZsA.js → multi-select-D1MP7iDa.js} +1 -1
  143. package/dist/client/assets/{oauth-callback-ai-provider-BpnHSb_f.js → oauth-callback-ai-provider-Ce5MHp3r.js} +1 -1
  144. package/dist/client/assets/{oauth-callback-CRBq17FH.js → oauth-callback-t2WmO9-v.js} +1 -1
  145. package/dist/client/assets/{onboarding-CDIl2VPN.js → onboarding-Dg8pqQh4.js} +1 -1
  146. package/dist/client/assets/{org-layout-UBcPgsMB.js → org-layout-dq0fDq-h.js} +1 -1
  147. package/dist/client/assets/{organization-choice-DL8LmN_P.js → organization-choice-Bnr-wpFe.js} +1 -1
  148. package/dist/client/assets/{orgs-rQ-2EkJt.js → orgs-DJfci181.js} +1 -1
  149. package/dist/client/assets/{page-seo-form-BqNS5DgU.js → page-seo-form-B1ADwpo8.js} +1 -1
  150. package/dist/client/assets/{popover-BBlLuKf7.js → popover-sPMAt4On.js} +1 -1
  151. package/dist/client/assets/{post-calendar-BD_Aoold.js → post-calendar-B4Z9Jz7b.js} +1 -1
  152. package/dist/client/assets/{post-editor-1A12IdOK.js → post-editor-CcXinFIi.js} +1 -1
  153. package/dist/client/assets/{primitives-iFjsEhaw.js → primitives-CGxQwrae.js} +1 -1
  154. package/dist/client/assets/{profile-DgSLrn8k.js → profile-C9bBchUu.js} +1 -1
  155. package/dist/client/assets/{project-app-view-79YOW9gG.js → project-app-view-DudFJRxH.js} +1 -1
  156. package/dist/client/assets/{project-icon-BY6IQTkk.js → project-icon-DD8-TjG9.js} +1 -1
  157. package/dist/client/assets/{prompts-DMZfJhvl.js → prompts-CAxx1TcH.js} +1 -1
  158. package/dist/client/assets/record-editor-CQ7QMoAf.js +1 -0
  159. package/dist/client/assets/redirect-editor-B68PccpU.js +1 -0
  160. package/dist/client/assets/registry-CWd0I8mg.js +2 -0
  161. package/dist/client/assets/{registry-layout-BZ5XxgHX.js → registry-layout-Bcal-jx7.js} +1 -1
  162. package/dist/client/assets/{reports-CPPm416A.js → reports-BbDmvyvn.js} +1 -1
  163. package/dist/client/assets/{repositories-XRBoZAlQ.js → repositories-DoZh9xWv.js} +1 -1
  164. package/dist/client/assets/{repository-import-picker-RSPbbE4k.js → repository-import-picker-TTmQRKgM.js} +1 -1
  165. package/dist/client/assets/{repository-picker-biyctM_B.js → repository-picker-Be7NfZEA.js} +1 -1
  166. package/dist/client/assets/{require-capability-BRFbNz3Q.js → require-capability-q7uVdBbT.js} +1 -1
  167. package/dist/client/assets/{required-auth-layout-B9X15pWP.js → required-auth-layout-CR5eG3sF.js} +1 -1
  168. package/dist/client/assets/{reset-password-BEQWew2k.js → reset-password-DnIxE4MM.js} +1 -1
  169. package/dist/client/assets/{review-settings-B8jUIsy8.js → review-settings-Bit87Ep6.js} +1 -1
  170. package/dist/client/assets/roles-CYck8jTX.js +1 -0
  171. package/dist/client/assets/{schema-D92LbIMM.js → schema-CVS6b6X8.js} +1 -1
  172. package/dist/client/assets/{scroll-area-B-ln5xLH.js → scroll-area-DIJ4XfEc.js} +1 -1
  173. package/dist/client/assets/{search-input-D9YW35Vs.js → search-input-BN_fecvo.js} +1 -1
  174. package/dist/client/assets/{secrets-BloGTEAu.js → secrets-Dr0vdQ4d.js} +1 -1
  175. package/dist/client/assets/{sections-editor-BZEfeGQC.js → sections-editor-BsuMEuNO.js} +1 -1
  176. package/dist/client/assets/{select-BaouCTwA.js → select-BJ0Gkkka.js} +1 -1
  177. package/dist/client/assets/{select-model-HYeKeaT4.js → select-model-D8CTPoiO.js} +1 -1
  178. package/dist/client/assets/{self-tool-result-BbupoY5Z.js → self-tool-result-KOheC4HD.js} +1 -1
  179. package/dist/client/assets/{seo-editor-FnjL-Vzx.js → seo-editor-CSFxllkC.js} +1 -1
  180. package/dist/client/assets/settings-layout-DyOsDVbj.js +1 -0
  181. package/dist/client/assets/{settings-sidebar-z3qYuGo6.js → settings-sidebar-C_Tz8rbX.js} +1 -1
  182. package/dist/client/assets/{shell-controls-CfSHSeBw.js → shell-controls-5f0FnXKd.js} +1 -1
  183. package/dist/client/assets/{shell-layout-eEmjDldg.js → shell-layout-D-M6_Jkf.js} +1 -1
  184. package/dist/client/assets/{skill-preview-D76FKEy1.js → skill-preview-5YIvamOb.js} +1 -1
  185. package/dist/client/assets/{skills-CXrKoyD0.js → skills-DMmhWXLy.js} +1 -1
  186. package/dist/client/assets/{sso-D310rMfh.js → sso-nVCDDH4k.js} +1 -1
  187. package/dist/client/assets/{store-BDrmnwCb.js → store-LfRhnjNM.js} +1 -1
  188. package/dist/client/assets/store-registry-D-puuJzT.js +2 -0
  189. package/dist/client/assets/{switch-Caly0pjz.js → switch-C0tiHttS.js} +1 -1
  190. package/dist/client/assets/{synced-repos-BuP48XMW.js → synced-repos-D5wTALWx.js} +1 -1
  191. package/dist/client/assets/{table-CJqB3MCP.js → table-D4dLAB1m.js} +1 -1
  192. package/dist/client/assets/{tabs-BZq41GwT.js → tabs-CDFENeRa.js} +1 -1
  193. package/dist/client/assets/{task-board-3nbsbA9F.js → task-board-B4aUIKJI.js} +1 -1
  194. package/dist/client/assets/{task-route-CxNYrjWE.js → task-route-BUYfM-Mq.js} +1 -1
  195. package/dist/client/assets/tasks-COtpdI-R.js +1 -0
  196. package/dist/client/assets/{textarea-Bt1l-v-4.js → textarea-DIJRp6Ds.js} +1 -1
  197. package/dist/client/assets/{thread-intent-Dvv1EpiP.js → thread-intent-DK53ivxy.js} +1 -1
  198. package/dist/client/assets/{thread-route-CvNO1pt5.js → thread-route-m3qiCJQP.js} +1 -1
  199. package/dist/client/assets/{toggle-group-BIHRiejF.js → toggle-group-BSxkMDRS.js} +1 -1
  200. package/dist/client/assets/{toolbar-wrA0hnju.js → toolbar-DQ2YVpXF.js} +1 -1
  201. package/dist/client/assets/{toolbar-icon-button-HUU3DeDv.js → toolbar-icon-button-DeXrhkGe.js} +1 -1
  202. package/dist/client/assets/{track-BFy8EZMU.js → track-J__dE1p5.js} +1 -1
  203. package/dist/client/assets/{types-BbudkrCP.js → types-C9oYptqr.js} +1 -1
  204. package/dist/client/assets/{use-ai-providers-CygbvKpH.js → use-ai-providers-DMdw1ZKm.js} +1 -1
  205. package/dist/client/assets/{use-automations-Dq9Ujnel.js → use-automations-BrJQYtfT.js} +1 -1
  206. package/dist/client/assets/{use-autosave-D-Inw3HB.js → use-autosave-DXppOUIw.js} +1 -1
  207. package/dist/client/assets/{use-connection-De6kXusM.js → use-connection-DueV7Dd9.js} +1 -1
  208. package/dist/client/assets/{use-copy-CVL8ezCn.js → use-copy-DsM8BkMO.js} +1 -1
  209. package/dist/client/assets/{use-create-virtual-mcp-R1xLoNkw.js → use-create-virtual-mcp-CXxjUZ5c.js} +1 -1
  210. package/dist/client/assets/{use-date-fns-locale-DaHZoCLk.js → use-date-fns-locale-I1vziWnN.js} +1 -1
  211. package/dist/client/assets/{use-debounced-autosave-BMhSKDju.js → use-debounced-autosave-Bep9W3RF.js} +1 -1
  212. package/dist/client/assets/{use-debounced-value-D0HOX65a.js → use-debounced-value-CjFrELYP.js} +1 -1
  213. package/dist/client/assets/{use-decopilot-events-CayI0kWz.js → use-decopilot-events-BxzD46W5.js} +1 -1
  214. package/dist/client/assets/{use-delete-connection-CnWS9tSJ.js → use-delete-connection-BBL_RJLP.js} +1 -1
  215. package/dist/client/assets/{use-deployment-admin-BmIOGiCV.js → use-deployment-admin--_f948uh.js} +1 -1
  216. package/dist/client/assets/{use-destination-route-CSS03xNU.js → use-destination-route-WysfeR7S.js} +1 -1
  217. package/dist/client/assets/{use-file-configs-U1N7vmMJ.js → use-file-configs-BByTBhTa.js} +1 -1
  218. package/dist/client/assets/{use-infinite-scroll-BxDzsK0q.js → use-infinite-scroll-p1RdGJsc.js} +1 -1
  219. package/dist/client/assets/{use-join-requests-BfxTPvq1.js → use-join-requests-D9qT6ziM.js} +1 -1
  220. package/dist/client/assets/{use-mcp-auth-status-Dzn7LvyX.js → use-mcp-auth-status-CTnEpyYI.js} +1 -1
  221. package/dist/client/assets/{use-mcp-client-BSfC7B4l.js → use-mcp-client-DtsRGdvB.js} +1 -1
  222. package/dist/client/assets/{use-mcp-prompts-QVLv6nAF.js → use-mcp-prompts-CD_IWJeZ.js} +1 -1
  223. package/dist/client/assets/{use-mcp-tools-BsEArfgg.js → use-mcp-tools-BKHgcAxL.js} +1 -1
  224. package/dist/client/assets/{use-members-wJ4JxWh4.js → use-members-NWhv5vIl.js} +1 -1
  225. package/dist/client/assets/{use-navigate-to-agent-CP-K3KIR.js → use-navigate-to-agent-Bnmnhqje.js} +1 -1
  226. package/dist/client/assets/{use-org-auth-client-DWK2XwV1.js → use-org-auth-client-CShcDth4.js} +1 -1
  227. package/dist/client/assets/{use-org-notice-B5aH6jEO.js → use-org-notice-B64MrAd9.js} +1 -1
  228. package/dist/client/assets/{use-org-sso-C-CIgBnX.js → use-org-sso-DzsFzLff.js} +1 -1
  229. package/dist/client/assets/{use-organization-roles-BB-gdlQ0.js → use-organization-roles-7PFmB_rs.js} +1 -1
  230. package/dist/client/assets/{use-organization-settings-BL3ZQVJG.js → use-organization-settings-nKtEvYQd.js} +1 -1
  231. package/dist/client/assets/{use-panel-navigate-DtIO2LK2.js → use-panel-navigate-BNmxrdjd.js} +1 -1
  232. package/dist/client/assets/{use-registry-connections-Chb8MZQ9.js → use-registry-connections-Bb6pjxJh.js} +1 -1
  233. package/dist/client/assets/{use-secrets-bCQiMi0L.js → use-secrets-CTUki73i.js} +1 -1
  234. package/dist/client/assets/{use-section-preview-base-DylvTrFU.js → use-section-preview-base-BHSNiN-i.js} +1 -1
  235. package/dist/client/assets/{use-status-sounds-DlTpiOV2.js → use-status-sounds-k-y4u-Dp.js} +1 -1
  236. package/dist/client/assets/{use-tags-3pJUBLb_.js → use-tags-BOUHc_F8.js} +1 -1
  237. package/dist/client/assets/{use-view-mode-054OP7Xj.js → use-view-mode-4DXLgMpz.js} +1 -1
  238. package/dist/client/assets/{use-virtual-mcp-DZn4-6Z9.js → use-virtual-mcp-C5Zt0ewM.js} +1 -1
  239. package/dist/client/assets/useInfiniteQuery-CU7gRlof.js +1 -0
  240. package/dist/client/assets/useSuspenseInfiniteQuery-rXQ07VfR.js +1 -0
  241. package/dist/client/assets/{users-ClG9LEpP.js → users-DRzgVGBP.js} +1 -1
  242. package/dist/client/assets/{variant-calendar-a4eYe0no.js → variant-calendar-TLlf4rAo.js} +1 -1
  243. package/dist/client/assets/{view-mode-toggle-CmvSb5ck.js → view-mode-toggle-CZECgOYC.js} +1 -1
  244. package/dist/client/index.html +1 -1
  245. package/dist/server/cli.js +606 -606
  246. package/dist/server/server.js +395 -395
  247. package/package.json +1 -1
  248. package/dist/client/assets/api-keys-Bc76I_rG.js +0 -1
  249. package/dist/client/assets/app-editor-U_AVP6OL.js +0 -1
  250. package/dist/client/assets/record-editor-BcCUO4IF.js +0 -1
  251. package/dist/client/assets/redirect-editor-L5GxxHxY.js +0 -1
  252. package/dist/client/assets/registry-CBnPiUVh.js +0 -2
  253. package/dist/client/assets/roles-DHyBcYNG.js +0 -1
  254. package/dist/client/assets/settings-layout-DBS_ejWk.js +0 -1
  255. package/dist/client/assets/store-registry-BKZeS0UB.js +0 -2
  256. package/dist/client/assets/tasks-BcAM9xVw.js +0 -1
  257. package/dist/client/assets/useInfiniteQuery-Uy7lOi7c.js +0 -1
  258. package/dist/client/assets/useSuspenseInfiniteQuery-BvETpOBx.js +0 -1
@@ -1,2 +1,2 @@
1
- import{c as ae,b as xe,G as Tt,m as nt,K as Ie,r as ne,j as t,b4 as Ue,l as qe,n as Ze,e as Fe,t as ge,B as be}from"./index-CFc50fBU.js";import{f as De,p as vt,bi as Nt,aB as Pt}from"./agent-icon-BpEwOiGV.js";import{i as wt}from"./Check-1zXE7wWA.js";import{i as St}from"./ChevronRight-DprZKKxq.js";import{a as it}from"./Copy01-BVJCFNfp.js";import{s as kt}from"./Trash01-LsgvHH60.js";import{B as Le}from"./badge-DpkiDIOC.js";import{C as Je}from"./checkbox-D9o3_hf-.js";import{I as Qe}from"./input-DzyddHML.js";import{L as Oe}from"./label-BNKcfQJl.js";import{a as st,d as _t,T as Ct,c as Kt,e as $t,b as Et}from"./table-CJqB3MCP.js";import{i as At,j as Dt,C as Ot,a as qt,b as Lt}from"./chart-rcdPf4fQ.js";import{g as zt,c as Mt,d as Rt,b as Ft,f as Bt,e as It,a as Vt,A as Ht}from"./alert-dialog-DNgGWz87.js";import{c as rt,d as ot,b as ct,D as dt,e as Ut}from"./dialog-BGZ5Hg3Q.js";import{E as Re}from"./empty-state-BlkGmg_f.js";import{u as Qt}from"./use-virtual-mcp-DZn4-6Z9.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-Bjc6phYY.js";import"./AlertCircle-CUcQGJWg.js";import"./Tool01-DVKwxNl0.js";import"./ArrowUp-DSGIlxLY.js";import"./ArrowLeft-CSPpZjix.js";import"./Tool02-DDmfltgM.js";import"./ArrowRight-CpVx9ViU.js";import"./TrendUp01-DioIZ0XZ.js";import"./ZoomOut-BIvjfxkI.js";import"./Users03-B9ZuJ2UL.js";import"./CheckCircle-DgtK-Ftc.js";import"./ChevronUp-DwjhbMCo.js";import"./ChevronSelectorVertical-Bva6hXFn.js";import"./DotsVertical-B1zgMGCf.js";import"./UserSquare-BVL5WuNS.js";import"./CreditCard01-DJQ89VL7.js";import"./Download01-d7QlNeIi.js";import"./Settings02-Czze_bb5.js";import"./Eye-sLXfRAsu.js";import"./Share07-DDpIIfsq.js";import"./GitBranch01-Cevd7IY5.js";import"./Globe01-YMmGLMrH.js";import"./XClose-CeiPTewB.js";import"./HardDrive-CBNkuV5p.js";import"./Image01-_jew13y9.js";import"./Key01-DxL7RaRt.js";import"./Link01-BsnNRJbd.js";import"./LinkExternal01-CHynaVJX.js";import"./Monitor01-D384tcCL.js";import"./Sun-Dq3o46U_.js";import"./Package-CICmKbed.js";import"./Palette-C3wV8GbF.js";import"./Play-DyY4uqsk.js";import"./Plus-BtzuFXpa.js";import"./SearchMd-RzdqOTz6.js";import"./Shield01-B4pGOGci.js";import"./Stars01-CjHCSDX3.js";import"./Upload01-9qmJgRWz.js";import"./User01-AzXDuWJx.js";import"./Users01-twdbMWRY.js";import"./XCircle-BCL9MwCk.js";import"./Zap-CKLZSOSt.js";import"./index-qHW_5WLU.js";import"./use-mcp-client-BSfC7B4l.js";import"./constants-Daqiz8AS.js";import"./auth-Dgy_FfAZ.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 Be(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($t,{children:v}),e[6]=v,e[7]=s):s=e[7],a=Et,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,$]=P,k=b.includes(w),E=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",E?"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:$}),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($=>{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:E}),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=Ie.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($s,{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 $s(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=Es;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 Es(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[41]!==c||e[42]!==a?($=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[43];let k;e[44]!==f||e[45]!==w||e[46]!==$||e[47]!==d||e[48]!==u?(k=t.jsxs("div",{className:"flex flex-col gap-4",children:[d,u,f,w,$]}),e[44]=f,e[45]=w,e[46]=$,e[47]=d,e[48]=u,e[49]=k):k=e[49];let E;return e[50]!==l||e[51]!==k?(E=t.jsx(he,{title:l,children:k}),e[50]=l,e[51]=k,e[52]=E):E=e[52],E}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=>Be(`${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:Ie.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,$,k,E,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],E="flex flex-col gap-5",$="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[24]=k,e[25]=E,e[26]=K}else S=e[20],P=e[21],w=e[22],$=e[23],k=e[24],E=e[25],K=e[26];let A;e[29]!==$||e[30]!==k?(A=t.jsx("p",{className:$,children:k}),e[29]=$,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 B;e[55]!==F||e[56]!==ee?(B=t.jsxs("span",{className:"flex flex-col",children:[F,ee]}),e[55]=F,e[56]=ee,e[57]=B):B=e[57];let I;e[58]!==X||e[59]!==B?(I=t.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 hover:border-border/70",children:[X,B]}),e[58]=X,e[59]=B,e[60]=I):I=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]!==I||e[87]!==V||e[88]!==q||e[89]!==J||e[90]!==E?(se=t.jsxs("div",{className:E,children:[A,Y,I,V,q,J]}),e[84]=A,e[85]=Y,e[86]=I,e[87]=V,e[88]=q,e[89]=J,e[90]=E,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=>Be(`${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:Ie.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,$=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 E=k;let K;e[23]!==$||e[24]!==w||e[25]!==v||e[26]!==N||e[27]!==b?(K=()=>{if($)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[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 B;e[52]!==i?(B=i("mainPanelTabs.analyticsTab.editSamplingHint"),e[52]=i,e[53]=B):B=e[53];let I;e[54]!==B?(I=t.jsx("span",{className:"text-xs text-muted-foreground",children:B}),e[54]=B,e[55]=I):I=e[55];let V;e[56]!==F||e[57]!==ee||e[58]!==I?(V=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[F,ee,I]}),e[56]=F,e[57]=ee,e[58]=I,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=$!=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||e[72]!==$?(le=$?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,e[72]=$,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||$!=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:Ie.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=()=>Be(`${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=>Be(`${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[20]!==n?($=()=>Be(`${n}/analytics`,"DELETE"),e[20]=n,e[21]=$):$=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;e[26]!==$||e[27]!==k?(E={mutationFn:$,onSuccess:k,onError:Is},e[26]=$,e[27]=k,e[28]=E):E=e[28];const K=Fe(E),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 B;e[48]!==s?(B=s("mainPanelTabs.analyticsTab.edit"),e[48]=s,e[49]=B):B=e[49];let I;e[50]!==Z||e[51]!==B?(I=t.jsxs(be,{size:"sm",variant:"ghost",onClick:Z,children:[ee,B]}),e[50]=Z,e[51]=B,e[52]=I):I=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]!==I||e[66]!==V||e[67]!==Q?(J=t.jsxs("div",{className:"flex items-center gap-1.5",children:[F,I,V,Q]}),e[64]=F,e[65]=I,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(Bs),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(Bt,{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 $e;e[135]!==ke||e[136]!==Ke?($e=t.jsxs(It,{children:[ke,Ke]}),e[135]=ke,e[136]=Ke,e[137]=$e):$e=e[137];let Ee;e[138]!==we||e[139]!==$e?(Ee=t.jsxs(Vt,{children:[we,$e]}),e[138]=we,e[139]=$e,e[140]=Ee):Ee=e[140];let Ae;e[141]!==b||e[142]!==p||e[143]!==Ee?(Ae=t.jsx(Ht,{open:b,onOpenChange:p,children:Ee}),e[141]=b,e[142]=p,e[143]=Ee,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 Bs(r){return t.jsx(Le,{variant:"secondary",children:r},r)}function Is(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[33]!==w||e[34]!==f||e[35]!==_?($=t.jsxs("div",{className:f,children:[_,w]}),e[33]=w,e[34]=f,e[35]=_,e[36]=$):$=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 E,K;e[40]===Symbol.for("react.memo_cache_sentinel")?(E=()=>b(!0),K=t.jsx(vt,{className:"size-4"}),e[40]=E,e[41]=K):(E=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:E,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[50]!==D||e[51]!==T?(W=t.jsxs("div",{className:T,children:[$,D]}),e[49]=$,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 B;e[70]===Symbol.for("react.memo_cache_sentinel")?(B=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]=B):B=e[70];let I;e[71]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("dt",{className:"font-mono text-xs text-foreground",children:"purchase({ transactionId, value, currency, items, itemIds })"}),e[71]=I):I=e[71];let V;e[72]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs("dl",{className:"flex flex-col gap-2",children:[F,B,t.jsxs("div",{className:"flex flex-col gap-0.5",children:[I,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" })
1
+ import{c as ae,b as xe,G as Tt,m as nt,K as Ie,r as ne,j as t,b4 as Ue,l as qe,n as Ze,e as Fe,t as ge,B as be}from"./index-fS0pDoNW.js";import{f as De,p as vt,bi as Nt,aB as Pt}from"./agent-icon-BrQLA9dC.js";import{i as wt}from"./Check-CmgBwUGv.js";import{i as St}from"./ChevronRight-Dk9nR_C7.js";import{a as it}from"./Copy01-DlxhdgMn.js";import{s as kt}from"./Trash01-BevWobXU.js";import{B as Le}from"./badge-rtLQpibV.js";import{C as Je}from"./checkbox-D0oTwa58.js";import{I as Qe}from"./input-DaMV0yqT.js";import{L as Oe}from"./label-Cznjg7Mb.js";import{a as st,d as _t,T as Ct,c as Kt,e as $t,b as Et}from"./table-D4dLAB1m.js";import{i as At,j as Dt,C as Ot,a as qt,b as Lt}from"./chart-C7j_btUB.js";import{g as zt,c as Mt,d as Rt,b as Ft,f as Bt,e as It,a as Vt,A as Ht}from"./alert-dialog-DuVJ7GC7.js";import{c as rt,d as ot,b as ct,D as dt,e as Ut}from"./dialog-DKxWMb0-.js";import{E as Re}from"./empty-state-BioEMyZp.js";import{u as Qt}from"./use-virtual-mcp-C5Zt0ewM.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-C754kxxt.js";import"./AlertCircle-piOaFPQJ.js";import"./Tool01-DdmZi7j_.js";import"./ArrowUp-39D5k7I2.js";import"./ArrowLeft-EySzpaMt.js";import"./Tool02-KStnzngn.js";import"./ArrowRight-CN1prjjJ.js";import"./TrendUp01-NTK3Zf_M.js";import"./ZoomOut-DpAkOD8e.js";import"./Users03-CrZajyAo.js";import"./CheckCircle-CwJqWx0e.js";import"./ChevronUp-DLLvYK07.js";import"./ChevronSelectorVertical-X68ci9mX.js";import"./DotsVertical-Bk31Y8qH.js";import"./UserSquare-l4Q5fPEZ.js";import"./CreditCard01-CGG5tsm6.js";import"./Download01-CxTJDArl.js";import"./Settings02-Dss_LnvC.js";import"./Eye-UEYlbIHb.js";import"./Share07-CgTNZ1dk.js";import"./GitBranch01-DRT2X7Dj.js";import"./Globe01-Z6BbST4r.js";import"./XClose-C-bbcgCJ.js";import"./HardDrive--vlQvWpi.js";import"./Image01-rCxXluf6.js";import"./Key01-By90Yq6k.js";import"./Link01-CUe3c6G0.js";import"./LinkExternal01-D2pSy7v4.js";import"./Monitor01-CY2DbFkD.js";import"./Sun-DAVD-A5B.js";import"./Package-Bb4KYw9O.js";import"./Palette-o-NEtwsW.js";import"./Play-DpmIDjD8.js";import"./Plus-CgVmxzR4.js";import"./SearchMd-Cjr4mqh9.js";import"./Shield01-CNbrlPDI.js";import"./Stars01-Dno5l14o.js";import"./Upload01-By19QANP.js";import"./User01-CDRv3_oY.js";import"./Users01-sAr72jTU.js";import"./XCircle-BTj4-tdv.js";import"./Zap-D6-O3NZl.js";import"./index-BAPa6G_8.js";import"./use-mcp-client-DtsRGdvB.js";import"./constants-Daqiz8AS.js";import"./auth-CRmM4ftp.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 Be(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($t,{children:v}),e[6]=v,e[7]=s):s=e[7],a=Et,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,$]=P,k=b.includes(w),E=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",E?"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:$}),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($=>{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:E}),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=Ie.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($s,{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 $s(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=Es;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 Es(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[41]!==c||e[42]!==a?($=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[43];let k;e[44]!==f||e[45]!==w||e[46]!==$||e[47]!==d||e[48]!==u?(k=t.jsxs("div",{className:"flex flex-col gap-4",children:[d,u,f,w,$]}),e[44]=f,e[45]=w,e[46]=$,e[47]=d,e[48]=u,e[49]=k):k=e[49];let E;return e[50]!==l||e[51]!==k?(E=t.jsx(he,{title:l,children:k}),e[50]=l,e[51]=k,e[52]=E):E=e[52],E}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=>Be(`${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:Ie.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,$,k,E,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],E="flex flex-col gap-5",$="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[24]=k,e[25]=E,e[26]=K}else S=e[20],P=e[21],w=e[22],$=e[23],k=e[24],E=e[25],K=e[26];let A;e[29]!==$||e[30]!==k?(A=t.jsx("p",{className:$,children:k}),e[29]=$,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 B;e[55]!==F||e[56]!==ee?(B=t.jsxs("span",{className:"flex flex-col",children:[F,ee]}),e[55]=F,e[56]=ee,e[57]=B):B=e[57];let I;e[58]!==X||e[59]!==B?(I=t.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 hover:border-border/70",children:[X,B]}),e[58]=X,e[59]=B,e[60]=I):I=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]!==I||e[87]!==V||e[88]!==q||e[89]!==J||e[90]!==E?(se=t.jsxs("div",{className:E,children:[A,Y,I,V,q,J]}),e[84]=A,e[85]=Y,e[86]=I,e[87]=V,e[88]=q,e[89]=J,e[90]=E,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=>Be(`${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:Ie.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,$=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 E=k;let K;e[23]!==$||e[24]!==w||e[25]!==v||e[26]!==N||e[27]!==b?(K=()=>{if($)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[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 B;e[52]!==i?(B=i("mainPanelTabs.analyticsTab.editSamplingHint"),e[52]=i,e[53]=B):B=e[53];let I;e[54]!==B?(I=t.jsx("span",{className:"text-xs text-muted-foreground",children:B}),e[54]=B,e[55]=I):I=e[55];let V;e[56]!==F||e[57]!==ee||e[58]!==I?(V=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[F,ee,I]}),e[56]=F,e[57]=ee,e[58]=I,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=$!=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||e[72]!==$?(le=$?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,e[72]=$,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||$!=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:Ie.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=()=>Be(`${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=>Be(`${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[20]!==n?($=()=>Be(`${n}/analytics`,"DELETE"),e[20]=n,e[21]=$):$=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;e[26]!==$||e[27]!==k?(E={mutationFn:$,onSuccess:k,onError:Is},e[26]=$,e[27]=k,e[28]=E):E=e[28];const K=Fe(E),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 B;e[48]!==s?(B=s("mainPanelTabs.analyticsTab.edit"),e[48]=s,e[49]=B):B=e[49];let I;e[50]!==Z||e[51]!==B?(I=t.jsxs(be,{size:"sm",variant:"ghost",onClick:Z,children:[ee,B]}),e[50]=Z,e[51]=B,e[52]=I):I=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]!==I||e[66]!==V||e[67]!==Q?(J=t.jsxs("div",{className:"flex items-center gap-1.5",children:[F,I,V,Q]}),e[64]=F,e[65]=I,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(Bs),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(Bt,{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 $e;e[135]!==ke||e[136]!==Ke?($e=t.jsxs(It,{children:[ke,Ke]}),e[135]=ke,e[136]=Ke,e[137]=$e):$e=e[137];let Ee;e[138]!==we||e[139]!==$e?(Ee=t.jsxs(Vt,{children:[we,$e]}),e[138]=we,e[139]=$e,e[140]=Ee):Ee=e[140];let Ae;e[141]!==b||e[142]!==p||e[143]!==Ee?(Ae=t.jsx(Ht,{open:b,onOpenChange:p,children:Ee}),e[141]=b,e[142]=p,e[143]=Ee,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 Bs(r){return t.jsx(Le,{variant:"secondary",children:r},r)}function Is(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[33]!==w||e[34]!==f||e[35]!==_?($=t.jsxs("div",{className:f,children:[_,w]}),e[33]=w,e[34]=f,e[35]=_,e[36]=$):$=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 E,K;e[40]===Symbol.for("react.memo_cache_sentinel")?(E=()=>b(!0),K=t.jsx(vt,{className:"size-4"}),e[40]=E,e[41]=K):(E=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:E,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[50]!==D||e[51]!==T?(W=t.jsxs("div",{className:T,children:[$,D]}),e[49]=$,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 B;e[70]===Symbol.for("react.memo_cache_sentinel")?(B=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]=B):B=e[70];let I;e[71]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("dt",{className:"font-mono text-xs text-foreground",children:"purchase({ transactionId, value, currency, items, itemIds })"}),e[71]=I):I=e[71];let V;e[72]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs("dl",{className:"flex flex-col gap-2",children:[F,B,t.jsxs("div",{className:"flex flex-col gap-0.5",children:[I,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
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 al(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:Ie.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;e[3]!==a?(E=a("mainPanelTabs.analyticsTab.noSiteTitle"),e[3]=a,e[4]=E):E=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||e[8]!==K?(A=t.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:t.jsx(Re,{icon:k,title:E,description:K})}),e[7]=E,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;e[11]!==a?(E=a("mainPanelTabs.analyticsTab.notConnectedTitle"),e[11]=a,e[12]=E):E=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||e[16]!==K?(A=t.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:t.jsx(Re,{icon:k,title:E,description:K})}),e[15]=E,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 $;return e[42]!==S||e[43]!==P||e[44]!==w?($=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[45],$}export{al as AnalyticsTab};
@@ -1 +1 @@
1
- import{c as A,G as Q,K as R,m as ce,n as U,e as V,j as i,dt as de,b as F,r as O,dp as me,b2 as J,B as v,t as q}from"./index-CFc50fBU.js";import{i as fe}from"./AlertCircle-CUcQGJWg.js";import{a as ue}from"./Copy01-BVJCFNfp.js";import{i as W}from"./Key01-DxL7RaRt.js";import{s as X}from"./Plus-BtzuFXpa.js";import{s as pe}from"./Trash01-LsgvHH60.js";import{A as ge,a as ye,b as xe,c as he,d as je,e as Ke,f as Ce,g as be}from"./alert-dialog-DNgGWz87.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-BGZ5Hg3Q.js";import{I as le}from"./input-DzyddHML.js";import{L as De}from"./label-BNKcfQJl.js";import{u as Y}from"./use-mcp-client-BSfC7B4l.js";import{S as G}from"./constants-Daqiz8AS.js";function H(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:G,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=Y(r);let s;e[3]!==a.id?(s=R.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return H(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:G,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=Y(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return H(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:R.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:G,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=Y(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return H(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:R.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(W,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(pe,{size:14}),e[13]=u):u=e[13];let p;e[14]!==r||e[15]!==m?(p=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=p):p=e[16];let f;return e[17]!==d||e[18]!==p?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,p]}),e[17]=d,e[18]=p,e[19]=f):f=e[19],f}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(W,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let p;e[15]!==a||e[16]!==u?(p=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=p):p=e[17];let f;return e[18]!==d||e[19]!==p?(f=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,p]}),e[18]=d,e[19]=p,e[20]=f):f=e[20],f}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const p=a?.key??"";let f;e[13]!==p?(f=i.jsx(le,{readOnly:!0,value:p,className:"font-mono text-xs"}),e[13]=p,e[14]=f):f=e[14];let g;e[15]!==a||e[16]!==l?(g=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=g):g=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let x;e[21]!==g||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:g,"aria-label":y,children:C}),e[21]=g,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==u?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const M=B;q.error(M instanceof Error?M.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const p=u;let f;e[8]!==m||e[9]!==r?(f=z=>{z?r(z):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let g;e[11]!==s?(g=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=g):g=e[12];let y;e[13]!==g?(y=i.jsx(Z,{children:g}),e[13]=g,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=z=>c(z.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==p||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:p,className:"space-y-4",children:[N,k]}),e[53]=p,e[54]=N,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let $;return e[60]!==a||e[61]!==L||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:L}),e[60]=a,e[61]=L,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function p(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(X,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(Ne,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(ge,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:p,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ge(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ge as O,Ae as a,Se as u};
1
+ import{c as A,G as Q,K as R,m as ce,n as U,e as V,j as i,dt as de,b as F,r as O,dp as me,b2 as J,B as v,t as q}from"./index-fS0pDoNW.js";import{i as fe}from"./AlertCircle-piOaFPQJ.js";import{a as ue}from"./Copy01-DlxhdgMn.js";import{i as W}from"./Key01-By90Yq6k.js";import{s as X}from"./Plus-CgVmxzR4.js";import{s as pe}from"./Trash01-BevWobXU.js";import{A as ge,a as ye,b as xe,c as he,d as je,e as Ke,f as Ce,g as be}from"./alert-dialog-DuVJ7GC7.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-DKxWMb0-.js";import{I as le}from"./input-DaMV0yqT.js";import{L as De}from"./label-Cznjg7Mb.js";import{u as Y}from"./use-mcp-client-DtsRGdvB.js";import{S as G}from"./constants-Daqiz8AS.js";function H(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:G,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=Y(r);let s;e[3]!==a.id?(s=R.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return H(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:G,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=Y(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return H(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:R.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:G,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=Y(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return H(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:R.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(W,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(pe,{size:14}),e[13]=u):u=e[13];let p;e[14]!==r||e[15]!==m?(p=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=p):p=e[16];let f;return e[17]!==d||e[18]!==p?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,p]}),e[17]=d,e[18]=p,e[19]=f):f=e[19],f}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(W,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let p;e[15]!==a||e[16]!==u?(p=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=p):p=e[17];let f;return e[18]!==d||e[19]!==p?(f=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,p]}),e[18]=d,e[19]=p,e[20]=f):f=e[20],f}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const p=a?.key??"";let f;e[13]!==p?(f=i.jsx(le,{readOnly:!0,value:p,className:"font-mono text-xs"}),e[13]=p,e[14]=f):f=e[14];let g;e[15]!==a||e[16]!==l?(g=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=g):g=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let x;e[21]!==g||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:g,"aria-label":y,children:C}),e[21]=g,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==u?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const M=B;q.error(M instanceof Error?M.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const p=u;let f;e[8]!==m||e[9]!==r?(f=z=>{z?r(z):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let g;e[11]!==s?(g=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=g):g=e[12];let y;e[13]!==g?(y=i.jsx(Z,{children:g}),e[13]=g,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=z=>c(z.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==p||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:p,className:"space-y-4",children:[N,k]}),e[53]=p,e[54]=N,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let $;return e[60]!==a||e[61]!==L||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:L}),e[60]=a,e[61]=L,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function p(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(X,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(Ne,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(ge,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:p,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ge(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ge as O,Ae as a,Se as u};
@@ -0,0 +1 @@
1
+ import{c as o,j as r}from"./index-fS0pDoNW.js";import{O as m}from"./api-keys-BJORgq17.js";import{R as p}from"./require-capability-q7uVdBbT.js";import"./AlertCircle-piOaFPQJ.js";import"./Copy01-DlxhdgMn.js";import"./Key01-By90Yq6k.js";import"./Plus-CgVmxzR4.js";import"./Trash01-BevWobXU.js";import"./alert-dialog-DuVJ7GC7.js";import"./dialog-DKxWMb0-.js";import"./input-DaMV0yqT.js";import"./label-Cznjg7Mb.js";import"./use-mcp-client-DtsRGdvB.js";import"./constants-Daqiz8AS.js";import"./auth-CRmM4ftp.js";import"./access-gate-DQan09qj.js";import"./capability-load-error-BAq8tXOS.js";function A(){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{A as default};
@@ -0,0 +1 @@
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-fS0pDoNW.js";import{b as At}from"./chat-context-BcY08VKG.js";import{i as Et}from"./ChevronRight-Dk9nR_C7.js";import{S as Nt}from"./scroll-area-DIJ4XfEc.js";import{u as Rt,A as Tt}from"./use-section-preview-base-BHSNiN-i.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-BlP07NoC.js";import"./use-panel-navigate-BNmxrdjd.js";import"./use-destination-route-WysfeR7S.js";import"./autosend-CI7ToXd3.js";import"./thread-intent-DK53ivxy.js";import"./slugify-CEUa2lfQ.js";import"./hooks-BOHEAk9Y.js";import"./use-mcp-client-DtsRGdvB.js";import"./constants-Daqiz8AS.js";import"./auth-CRmM4ftp.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CnHcYfZj.js";import"./task-board-B4aUIKJI.js";import"./schema-CVS6b6X8.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-C5Zt0ewM.js";import"./use-ai-providers-DMdw1ZKm.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-BxzD46W5.js";import"./thread-route-m3qiCJQP.js";import"./dialog-DKxWMb0-.js";import"./Check-CmgBwUGv.js";import"./Copy01-DlxhdgMn.js";import"./Download01-CxTJDArl.js";import"./use-organization-settings-nKtEvYQd.js";import"./select-BJ0Gkkka.js";import"./ChevronUp-DLLvYK07.js";import"./agent-icon-BrQLA9dC.js";import"./AlertCircle-piOaFPQJ.js";import"./Tool01-DdmZi7j_.js";import"./ArrowUp-39D5k7I2.js";import"./ArrowLeft-EySzpaMt.js";import"./Tool02-KStnzngn.js";import"./ArrowRight-CN1prjjJ.js";import"./TrendUp01-NTK3Zf_M.js";import"./ZoomOut-DpAkOD8e.js";import"./Users03-CrZajyAo.js";import"./CheckCircle-CwJqWx0e.js";import"./ChevronSelectorVertical-X68ci9mX.js";import"./DotsVertical-Bk31Y8qH.js";import"./UserSquare-l4Q5fPEZ.js";import"./CreditCard01-CGG5tsm6.js";import"./Settings02-Dss_LnvC.js";import"./Eye-UEYlbIHb.js";import"./Share07-CgTNZ1dk.js";import"./GitBranch01-DRT2X7Dj.js";import"./Globe01-Z6BbST4r.js";import"./XClose-C-bbcgCJ.js";import"./HardDrive--vlQvWpi.js";import"./Image01-rCxXluf6.js";import"./Key01-By90Yq6k.js";import"./Link01-CUe3c6G0.js";import"./LinkExternal01-D2pSy7v4.js";import"./Monitor01-CY2DbFkD.js";import"./Sun-DAVD-A5B.js";import"./Package-Bb4KYw9O.js";import"./Palette-o-NEtwsW.js";import"./Play-DpmIDjD8.js";import"./Plus-CgVmxzR4.js";import"./SearchMd-Cjr4mqh9.js";import"./Shield01-CNbrlPDI.js";import"./Stars01-Dno5l14o.js";import"./Trash01-BevWobXU.js";import"./Upload01-By19QANP.js";import"./User01-CDRv3_oY.js";import"./Users01-sAr72jTU.js";import"./XCircle-BTj4-tdv.js";import"./Zap-D6-O3NZl.js";import"./input-DaMV0yqT.js";import"./automation-runs-Ge9BW9cQ.js";import"./useInfiniteQuery-CU7gRlof.js";import"./infiniteQueryObserver-B62setNi.js";import"./use-connection-DueV7Dd9.js";import"./table-D4dLAB1m.js";import"./empty-state-DA8cnNqW.js";import"./use-infinite-scroll-p1RdGJsc.js";import"./use-members-NWhv5vIl.js";import"./use-org-auth-client-CShcDth4.js";import"./use-automations-BrJQYtfT.js";import"./useSuspenseInfiniteQuery-rXQ07VfR.js";import"./avatar-ncVfbaUx.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-copy-DsM8BkMO.js";import"./markdown-BNMHtGi6.js";import"./monaco-editor-7CBGfDCH.js";import"./editor-Cm-sI42p.js";import"./mcp-app-renderer-Df-LUzfK.js";import"./types-C9oYptqr.js";import"./shell-layout-D-M6_Jkf.js";import"./project-icon-DD8-TjG9.js";import"./github-repo-CTPv5ZM2.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-CTH7s7Ya.js";import"./index-YZeWKaou.js";import"./required-auth-layout-CR5eG3sF.js";import"./use-org-sso-DzsFzLff.js";import"./use-org-notice-B64MrAd9.js";import"./integration-icon-BFx8Gs71.js";import"./use-navigate-to-agent-Bnmnhqje.js";import"./use-mcp-prompts-CD_IWJeZ.js";import"./form-CorLMse0.js";import"./label-Cznjg7Mb.js";import"./file-type-icon-ChIQfzaN.js";import"./drawer-BaA_lu4x.js";import"./collection-search-UW0xDxmi.js";import"./tabs-CDFENeRa.js";import"./toggle-group-BSxkMDRS.js";import"./task-route-BUYfM-Mq.js";import"./extract-connection-data-BdnZZmxw.js";import"./metadata-dUsYcpuu.js";import"./connection-CU1s53fy.js";import"./connection-card-B-DQLE2m.js";import"./use-registry-connections-Bb6pjxJh.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-DIJRp6Ds.js";import"./connection-form-helpers-B-auMXZc.js";import"./authenticate-and-persist-oauth-DEZCdj-t.js";import"./mcp-oauth-CDjOqnrq.js";import"./collection-tabs-644rp01A.js";import"./badge-rtLQpibV.js";import"./use-file-configs-BByTBhTa.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-CC8IMYtS.js";import"./popover-sPMAt4On.js";import"./github-icon-CeFWgmVz.js";import"./get-initials-D-f_fDFw.js";import"./select-model-D8CTPoiO.js";import"./checkbox-D0oTwa58.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-_4CbErMC.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-k-y4u-Dp.js";import"./toolbar-DQ2YVpXF.js";import"./use-mcp-tools-BKHgcAxL.js";import"./skill-preview-5YIvamOb.js";import"./use-date-fns-locale-I1vziWnN.js";import"./alert-dialog-DuVJ7GC7.js";import"./use-debounced-autosave-Bep9W3RF.js";import"./search-input-BN_fecvo.js";import"./use-mcp-auth-status-CTnEpyYI.js";import"./switch-C0tiHttS.js";import"./repository-import-picker-TTmQRKgM.js";import"./repository-picker-Be7NfZEA.js";import"./use-debounced-value-CjFrELYP.js";import"./use-secrets-CTUki73i.js";import"./client-icons-BE3evb-i.js";import"./connect-layout-CmuGJ6zd.js";import"./self-tool-result-KOheC4HD.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./track-J__dE1p5.js";import"./use-tags-BOUHc_F8.js";import"./breadcrumb-d7wNqsyt.js";import"./toolbar-icon-button-DeXrhkGe.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-CJo0GDE_.js";import"./site-error--i37Vnuw.js";import"./cards-CgpdHb-U.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 Jr(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{Jr as AppEditor};
@@ -1 +1 @@
1
- import{dE as v,dF as $,dG as W,dH as L,dI as H,dJ as D,dK as V,dL as x,dM as q,dN as j,dO as y,dP as N,dQ as B,dR as F,dS as Z}from"./index-CFc50fBU.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,T as b,me as c,P as d,Ue as e};
1
+ import{dE as v,dF as $,dG as W,dH as L,dI as H,dJ as D,dK as V,dL as x,dM as q,dN as j,dO as y,dP as N,dQ as B,dR as F,dS as Z}from"./index-fS0pDoNW.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,T as b,me as c,P as d,Ue as e};
@@ -1 +1 @@
1
- import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-CFc50fBU.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
1
+ import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-fS0pDoNW.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};