decocms 4.576.2 → 4.576.3

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 (391) hide show
  1. package/dist/client/assets/{AlertCircle-CQW1P7_R.js → AlertCircle-BGZ0JmbE.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BEgOgZZj.js → AreaChart-C7qhucyl.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-sSY9Zm-O.js → ArrowLeft-B14bIrz5.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-VZphHDPw.js → ArrowUp-DP5euuHF.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-Bku6CBeN.js → CartesianChart-C5XP_HSc.js} +1 -1
  6. package/dist/client/assets/{CategoricalChart-CI96Ht0A.js → CategoricalChart-BD28cWcj.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BAqlx5xq.js → CheckCircle-DbgO7kVp.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-CAw9AQRt.js → ChevronSelectorVertical-Cy067w0k.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-RQuomTlc.js → ChevronUp-C7zL3mw4.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-uW1Nq0L7.js → CreditCard01-BKUaIref.js} +1 -1
  11. package/dist/client/assets/{Globe04-1JEh9zst.js → Globe04-DZKfwJo_.js} +1 -1
  12. package/dist/client/assets/{Key01-B-MK6puk.js → Key01-CNSpLGm4.js} +1 -1
  13. package/dist/client/assets/{LinkBroken01-ArAKWl5D.js → LinkBroken01-DBe4JVRU.js} +1 -1
  14. package/dist/client/assets/{Minus-y3rEkH4O.js → Minus-DF8ZH8rU.js} +1 -1
  15. package/dist/client/assets/{Monitor01-DkdtFPE6.js → Monitor01-BEGkS_TY.js} +1 -1
  16. package/dist/client/assets/{Play-BtmesR9D.js → Play-AS-vXB2p.js} +1 -1
  17. package/dist/client/assets/{Plus-BhSB1FAc.js → Plus-Bki9UHMX.js} +1 -1
  18. package/dist/client/assets/{ReferenceLine-CguuPF_F.js → ReferenceLine-BPJoTcfl.js} +1 -1
  19. package/dist/client/assets/{SearchMd-CTCaP47C.js → SearchMd-OdGIG7dP.js} +1 -1
  20. package/dist/client/assets/{ShoppingBag01-DEtqIAKG.js → ShoppingBag01-B_7M6ZMN.js} +1 -1
  21. package/dist/client/assets/{Sun-DhrY2nq7.js → Sun-BsibC9j3.js} +1 -1
  22. package/dist/client/assets/{SwitchHorizontal01-DTDSJnjG.js → SwitchHorizontal01-P8CzcCPk.js} +1 -1
  23. package/dist/client/assets/{Tool01-CE4RsL2T.js → Tool01-JPE_S_5w.js} +1 -1
  24. package/dist/client/assets/{Tooltip-DzoIZZA-.js → Tooltip-CgFtWJzz.js} +1 -1
  25. package/dist/client/assets/{Trash01-DQCE9WJt.js → Trash01-CC6cJr6C.js} +1 -1
  26. package/dist/client/assets/{Upload01-C8pH3Rp-.js → Upload01-BhfCOWsO.js} +1 -1
  27. package/dist/client/assets/{UserSquare-DfCEdLMW.js → UserSquare-okz5KCgc.js} +1 -1
  28. package/dist/client/assets/{Users01-RbJbPNL4.js → Users01-tkZwiAma.js} +1 -1
  29. package/dist/client/assets/{XClose-B9seet19.js → XClose-DMFJf5PD.js} +1 -1
  30. package/dist/client/assets/{Zap-B2TeJ3jk.js → Zap-5B1zE-Cq.js} +1 -1
  31. package/dist/client/assets/{access-gate-B3-8eUAT.js → access-gate-Dd32RuSa.js} +1 -1
  32. package/dist/client/assets/{add-connection-dialog-BZazlImL.js → add-connection-dialog-iKWxCDdu.js} +1 -1
  33. package/dist/client/assets/agent-app-s-umxx2Y.js +1 -0
  34. package/dist/client/assets/{agent-assets-D6n5n_j9.js → agent-assets-Cc3mV0Mf.js} +1 -1
  35. package/dist/client/assets/{agent-automation-BDFDUDqF.js → agent-automation-7c1_U7uQ.js} +1 -1
  36. package/dist/client/assets/{agent-automations-CTb19iEo.js → agent-automations-DFfMFGhd.js} +1 -1
  37. package/dist/client/assets/{agent-calendar-dOBBocaZ.js → agent-calendar-CqhCVGBu.js} +1 -1
  38. package/dist/client/assets/{agent-capabilities-D8RyEQle.js → agent-capabilities-BeIiqiLF.js} +1 -1
  39. package/dist/client/assets/{agent-connect-sources-Cv_HfEov.js → agent-connect-sources-C7hEGK5L.js} +1 -1
  40. package/dist/client/assets/agent-deck-C2bqxoNs.js +1 -0
  41. package/dist/client/assets/{agent-e2e-UuVTzQty.js → agent-e2e-Rde0TwlT.js} +1 -1
  42. package/dist/client/assets/agent-experiments-D5CZTwDU.js +1 -0
  43. package/dist/client/assets/{agent-file-BxTgqKD4.js → agent-file-BJlL7OGw.js} +1 -1
  44. package/dist/client/assets/{agent-hosting-SFnhs_AJ.js → agent-hosting-DpfieKoe.js} +1 -1
  45. package/dist/client/assets/{agent-icon-DmYd33Zd.js → agent-icon-C4wH6TqA.js} +1 -1
  46. package/dist/client/assets/agent-library-CZtpFACI.js +1 -0
  47. package/dist/client/assets/agent-library-file-CKDcRuQq.js +1 -0
  48. package/dist/client/assets/agent-overview-CLQyhFk7.js +1 -0
  49. package/dist/client/assets/{agent-releases-Nv7L0dpy.js → agent-releases-DT3MzrHe.js} +1 -1
  50. package/dist/client/assets/agent-settings-DXodP8-_.js +1 -0
  51. package/dist/client/assets/{agent-site-editor-DLrFF0Rn.js → agent-site-editor-BMAUaRoI.js} +1 -1
  52. package/dist/client/assets/agent-site-editor-code-ZPjgHjQ-.js +2 -0
  53. package/dist/client/assets/agent-site-editor-content-CCAiLoH4.js +1 -0
  54. package/dist/client/assets/agent-site-editor-preview-oKSpBWEU.js +1 -0
  55. package/dist/client/assets/agent-view-B8_VPUoM.js +1 -0
  56. package/dist/client/assets/{agent-view-guard-D0qWi85T.js → agent-view-guard-DXc8NvMC.js} +1 -1
  57. package/dist/client/assets/{ai-providers-CjPCR-pK.js → ai-providers-CyyZ9O7O.js} +1 -1
  58. package/dist/client/assets/{alert-C5FPaAXQ.js → alert-CuKzYWFQ.js} +1 -1
  59. package/dist/client/assets/{analytics-sections-BGMxhZwl.js → analytics-sections-CJciQkJY.js} +1 -1
  60. package/dist/client/assets/{api-keys-p6Xw6r8B.js → api-keys-BNob-3BW.js} +1 -1
  61. package/dist/client/assets/api-keys-cqWOR-Sh.js +1 -0
  62. package/dist/client/assets/{app-editor-DQwdeZHJ.js → app-editor-BSZX8Pcd.js} +1 -1
  63. package/dist/client/assets/{asset-utils-BW1FTT9q.js → asset-utils-BJyCQIV3.js} +1 -1
  64. package/dist/client/assets/{auth-DeNsOsKX.js → auth-BR_-50-H.js} +1 -1
  65. package/dist/client/assets/{auth-catchall-C3auT4P_.js → auth-catchall-TZ-5S8R2.js} +1 -1
  66. package/dist/client/assets/{auth-entry-BBIyDdU5.js → auth-entry-Bl1R5XwV.js} +1 -1
  67. package/dist/client/assets/{auth-split-layout-CpPst90z.js → auth-split-layout-BIRuyBSf.js} +1 -1
  68. package/dist/client/assets/{authenticate-and-persist-oauth-Ca1G6bWy.js → authenticate-and-persist-oauth-Fn4MDzen.js} +1 -1
  69. package/dist/client/assets/{automation-list-row-GTaw28qY.js → automation-list-row-DCfp4Tde.js} +1 -1
  70. package/dist/client/assets/{automation-runs-e7UMBmIy.js → automation-runs-D6C56Nz1.js} +1 -1
  71. package/dist/client/assets/{automations-DVHIEzYX.js → automations-BOuoNiFk.js} +1 -1
  72. package/dist/client/assets/{autosend-0p4cszrD.js → autosend-JAeO1MO9.js} +1 -1
  73. package/dist/client/assets/{badge-fJOJmdQG.js → badge-B3JA5w4M.js} +1 -1
  74. package/dist/client/assets/{block-document-D6lQw_Sn.js → block-document-CQwP7bkH.js} +1 -1
  75. package/dist/client/assets/{blocks-preview-workspace-context-CevYm8XG.js → blocks-preview-workspace-context-60di0anZ.js} +1 -1
  76. package/dist/client/assets/{blocks-tab-states-BLBUtwwS.js → blocks-tab-states-XQX-SOYK.js} +1 -1
  77. package/dist/client/assets/{blog-schema-CW6OwOTr.js → blog-schema-DeL7vtaX.js} +1 -1
  78. package/dist/client/assets/{buckets-DJjTeJ67.js → buckets-quspHKfn.js} +1 -1
  79. package/dist/client/assets/{build-improve-prompt-doc-Bz_NuW8p.js → build-improve-prompt-doc-CQ-0ERTf.js} +1 -1
  80. package/dist/client/assets/{calendar-BN8LK6az.js → calendar-DUCdCjhn.js} +1 -1
  81. package/dist/client/assets/{capability-load-error-BwSdaWc5.js → capability-load-error-boWeZxSq.js} +1 -1
  82. package/dist/client/assets/{category-editor-B2fU3l2-.js → category-editor-C9px3_ZQ.js} +1 -1
  83. package/dist/client/assets/{chart-TbvRqjuj.js → chart-O8mftGMP.js} +1 -1
  84. package/dist/client/assets/{chat-context-BwoQSegQ.js → chat-context-CbElEPZP.js} +1 -1
  85. package/dist/client/assets/{chat-draft-DH581p83.js → chat-draft-Ws7vmGFP.js} +1 -1
  86. package/dist/client/assets/{checkbox-BYltfk17.js → checkbox-CxN3Fjiq.js} +1 -1
  87. package/dist/client/assets/{choose-editor-CF8pbtbx.js → choose-editor-dGnb5yiP.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-8VRhz3fQ.js → cli-auth-success-D753-m59.js} +1 -1
  89. package/dist/client/assets/{client-icons-azPimjhr.js → client-icons-CtciVivs.js} +1 -1
  90. package/dist/client/assets/{cms-settings-editor-Dh2cgMIJ.js → cms-settings-editor--iUORKcc.js} +1 -1
  91. package/dist/client/assets/cms-store-drafts-DB9v44ni.js +1 -0
  92. package/dist/client/assets/{collapsible-DMIxs55h.js → collapsible-BM5EsiJu.js} +1 -1
  93. package/dist/client/assets/{collection-detail-BNTXyqsr.js → collection-detail-BhoXZGve.js} +1 -1
  94. package/dist/client/assets/{collection-display-button-DlPhjc6E.js → collection-display-button-B7AG7T_s.js} +1 -1
  95. package/dist/client/assets/{collection-search-DFoNgd1T.js → collection-search-Cpx7FdKh.js} +1 -1
  96. package/dist/client/assets/{collection-table-wrapper-OwJoF9HU.js → collection-table-wrapper-83pzwG59.js} +1 -1
  97. package/dist/client/assets/{collection-tabs-DTr38V1c.js → collection-tabs-DD0XrMnx.js} +1 -1
  98. package/dist/client/assets/{combobox-B8pIOucr.js → combobox-RWKHmu8G.js} +1 -1
  99. package/dist/client/assets/{command-8eo7blzl.js → command-BdQjVogo.js} +1 -1
  100. package/dist/client/assets/{companion-mcps-section-OBc1XSiN.js → companion-mcps-section-VvKSvC1-.js} +1 -1
  101. package/dist/client/assets/{config-CZxXYayZ.js → config-CjTdpysa.js} +1 -1
  102. package/dist/client/assets/{connect-BDnlsqF3.js → connect-BUn_edb-.js} +1 -1
  103. package/dist/client/assets/{connect-layout-f8wmYpiF.js → connect-layout-6JCWAkJI.js} +1 -1
  104. package/dist/client/assets/{connect-source-dialog-BnoBKHvg.js → connect-source-dialog-mnrKW9tr.js} +1 -1
  105. package/dist/client/assets/{connection-B4VgNpkK.js → connection-D-9gmcf_.js} +1 -1
  106. package/dist/client/assets/{connection-card-Cp7AJMDR.js → connection-card-BkrffNnj.js} +1 -1
  107. package/dist/client/assets/{connection-detail-BYR-qeWG.js → connection-detail-PQDIgw6J.js} +1 -1
  108. package/dist/client/assets/{connection-form-helpers-DqULERyx.js → connection-form-helpers-CkddBWFC.js} +1 -1
  109. package/dist/client/assets/{connection-slug-CK9E8VRg.js → connection-slug-qdewS16o.js} +1 -1
  110. package/dist/client/assets/{connections-D1yKPCTH.js → connections-CQvyCWFe.js} +1 -1
  111. package/dist/client/assets/{content-tab-D-PBLIve.js → content-tab-BQujSyeJ.js} +3 -3
  112. package/dist/client/assets/{context-Ciehk0ao.js → context-PxyW-yAc.js} +1 -1
  113. package/dist/client/assets/{context-menu-SmukJNMU.js → context-menu-B0tv9mb4.js} +1 -1
  114. package/dist/client/assets/{context-shell-CO4fTNNJ.js → context-shell-BguLHg5-.js} +3 -3
  115. package/dist/client/assets/{core.esm-B_Pr2KZA.js → core.esm-CeNdN4SL.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-8e7uLr8k.js → create-organization-dialog-CADzVlWV.js} +1 -1
  117. package/dist/client/assets/{device-hint-_3UpNo1y.js → device-hint-Dwhdkmg3.js} +1 -1
  118. package/dist/client/assets/{discover-j-WmLzAr.js → discover-C8C1-br7.js} +1 -1
  119. package/dist/client/assets/{domain-settings-nzh2Xqh2.js → domain-settings-DVsYWXEj.js} +1 -1
  120. package/dist/client/assets/{drawer-BiZQd3jF.js → drawer-DYm_G94M.js} +1 -1
  121. package/dist/client/assets/{editor-B5BFg8L4.js → editor-DV8TZj40.js} +1 -1
  122. package/dist/client/assets/{editor-classes-DxfrzHp8.js → editor-classes-DMJ6Hg22.js} +1 -1
  123. package/dist/client/assets/{empty-state-CPhGFwFG.js → empty-state-DAmvATEO.js} +1 -1
  124. package/dist/client/assets/{empty-state-D5FGRI4e.js → empty-state-DMRldxOE.js} +1 -1
  125. package/dist/client/assets/{experiments-tab-choice-5NNTmJRW.js → experiments-tab-choice-WXtp_vZO.js} +1 -1
  126. package/dist/client/assets/{extract-connection-data-lBAlP3pz.js → extract-connection-data-C3PHmvAg.js} +1 -1
  127. package/dist/client/assets/{feature-gate-Djob_jbU.js → feature-gate-BpkRzrJq.js} +1 -1
  128. package/dist/client/assets/{feature-paywall-DWnzqDkt.js → feature-paywall-B8kSC1DC.js} +1 -1
  129. package/dist/client/assets/{file-explorer-B7HqI107.js → file-explorer-wAIQCwVQ.js} +1 -1
  130. package/dist/client/assets/{file-preview-CVLvq53I.js → file-preview-DV_YTmT4.js} +1 -1
  131. package/dist/client/assets/{file-share-button-Ug-zwu4d.js → file-share-button-ChvJ9FX3.js} +1 -1
  132. package/dist/client/assets/{file-type-icon-BZTtX6EK.js → file-type-icon-Bbyu2O2G.js} +1 -1
  133. package/dist/client/assets/{folder-icon-C2EzD8if.js → folder-icon-BICKgvRR.js} +1 -1
  134. package/dist/client/assets/{form-Bhgzwnyp.js → form-DxSJX34K.js} +1 -1
  135. package/dist/client/assets/{general-CPLHJuRp.js → general-ClYHh6w0.js} +1 -1
  136. package/dist/client/assets/{github-icon-Buu0H1v4.js → github-icon-yZ-setqb.js} +1 -1
  137. package/dist/client/assets/{home-BCYh-a3a.js → home-DpS28S0w.js} +1 -1
  138. package/dist/client/assets/{home-overview-DTtXcEkG.js → home-overview-CVu3OLQ0.js} +1 -1
  139. package/dist/client/assets/{hosted-reconcile-BdwyWhOE.js → hosted-reconcile-oZ2zb0h4.js} +1 -1
  140. package/dist/client/assets/{icon-button-Dls6AzVP.js → icon-button-CrVBEVIa.js} +1 -1
  141. package/dist/client/assets/{index-CQIKg7tc.js → index-7Bh5bPAK.js} +1 -1
  142. package/dist/client/assets/{index-B6eHz5VS.js → index-ByhqU7WB.js} +1 -1
  143. package/dist/client/assets/{index-BJrkqMqs.js → index-Cz_nGGoI.js} +1 -1
  144. package/dist/client/assets/{index-CtJa8hR9.js → index-D1VYZVf1.js} +1 -1
  145. package/dist/client/assets/{index-B4tnBHnb.js → index-D5JmhpYX.js} +1 -1
  146. package/dist/client/assets/{index-B3BrFVGB.js → index-D66PnEg6.js} +1 -1
  147. package/dist/client/assets/{index-C8i-vHCI.js → index-DCGDEEi6.js} +1 -1
  148. package/dist/client/assets/{index-0xCVweSM.js → index-DLoz6ZlL.js} +1 -1
  149. package/dist/client/assets/{index-UxIaE43S.js → index-DU8IkezA.js} +1 -1
  150. package/dist/client/assets/{index-XdUWZF5g.js → index-DWzXxNX7.js} +3 -3
  151. package/dist/client/assets/{index-CJKJ4WN3.js → index-DlMpGjHy.js} +1 -1
  152. package/dist/client/assets/{index-BJqMJFEL.js → index-DxXdXz0T.js} +1 -1
  153. package/dist/client/assets/{index-CKuu5BgI.js → index-WxcX208m.js} +1 -1
  154. package/dist/client/assets/{index-CMl-YIkn.js → index-ZWUnfk7T.js} +1 -1
  155. package/dist/client/assets/{index-DJy_S3Mn.js → index-_AW8aUhQ.js} +1 -1
  156. package/dist/client/assets/{index-D_HCIUjf.js → index-d0f9bdj0.js} +1 -1
  157. package/dist/client/assets/{index-DAFka6tK.js → index-qYMwPj3t.js} +1 -1
  158. package/dist/client/assets/{index-redirect-ZoX0Nmet.js → index-redirect-BSJdkB8w.js} +1 -1
  159. package/dist/client/assets/{infiniteQueryObserver-DgQQHW6Y.js → infiniteQueryObserver-BKza5thB.js} +1 -1
  160. package/dist/client/assets/{infra-billing-CbpAOQ7f.js → infra-billing-DHsk6-3O.js} +1 -1
  161. package/dist/client/assets/{input-BneF5n5F.js → input-BX2oSBO4.js} +3 -3
  162. package/dist/client/assets/{input-BBwM3ir1.js → input-vhdOtqt2.js} +1 -1
  163. package/dist/client/assets/{integration-icon-DpoZYM7e.js → integration-icon-DuegKJ2_.js} +1 -1
  164. package/dist/client/assets/{jira-icon-CfXcnbRW.js → jira-icon-D1GuI0H7.js} +1 -1
  165. package/dist/client/assets/{label-CUqIqnOS.js → label-CWhwsMTf.js} +1 -1
  166. package/dist/client/assets/{layout-CZKu8-AR.js → layout-DKcFq13F.js} +1 -1
  167. package/dist/client/assets/{legacy-admin-welcome-dialog-D12aat8e.js → legacy-admin-welcome-dialog-Dk-fpkjK.js} +1 -1
  168. package/dist/client/assets/{legacy-agents-deep-C46PUrrS.js → legacy-agents-deep-CKjKeJEh.js} +1 -1
  169. package/dist/client/assets/{legacy-main-redirect-si54JTxO.js → legacy-main-redirect-C-zO3OBa.js} +1 -1
  170. package/dist/client/assets/library-UHTrZbfy.js +1 -0
  171. package/dist/client/assets/{library-tab-EiyuBjPa.js → library-tab-lBGHAo4i.js} +1 -1
  172. package/dist/client/assets/{login-D0eYUue3.js → login-DiKVnxy3.js} +1 -1
  173. package/dist/client/assets/{markdown-A06Oe1_p.js → markdown-BdcV-XI9.js} +1 -1
  174. package/dist/client/assets/{mcp-app-renderer-Dkj1yLIG.js → mcp-app-renderer-Bs5HuimZ.js} +1 -1
  175. package/dist/client/assets/{mcp-oauth-L4CbK4hz.js → mcp-oauth-BGHnDVvZ.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-u5RBmpff.js → mcp-oauth-D9q81Rer.js} +1 -1
  177. package/dist/client/assets/{members-D2W9FUHb.js → members-CpOjuktX.js} +1 -1
  178. package/dist/client/assets/{memory-nZuh_3HW.js → memory-B4BzuUSD.js} +1 -1
  179. package/dist/client/assets/{mock-board-DkI2cfk-.js → mock-board-ZlnpNb3Q.js} +3 -3
  180. package/dist/client/assets/{monaco-editor-DoTBOc-e.js → monaco-editor-BsSw5DlP.js} +1 -1
  181. package/dist/client/assets/{monitoring-DZ1uqyFT.js → monitoring-Btg8EYH_.js} +1 -1
  182. package/dist/client/assets/{monitoring-stats-row-Be_-YMn8.js → monitoring-stats-row-D00_thYM.js} +1 -1
  183. package/dist/client/assets/{multi-select-CzoYfyvg.js → multi-select-CXh_YZmY.js} +1 -1
  184. package/dist/client/assets/{mustache-BctGjQ5L.js → mustache-ijbeIyug.js} +1 -1
  185. package/dist/client/assets/{named-rule-view-DUsv8g0V.js → named-rule-view-7yn9QFhf.js} +1 -1
  186. package/dist/client/assets/{new-project-dialog-151PED_m.js → new-project-dialog-CZMbpoW0.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-DrwI5ATg.js → oauth-callback-BapgbOPv.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-ai-provider-D9pLn0-_.js → oauth-callback-ai-provider-DG71ZNmd.js} +1 -1
  189. package/dist/client/assets/{oauth-consent-o6k0sIQ6.js → oauth-consent-eAFYFB2A.js} +1 -1
  190. package/dist/client/assets/{onboarding-BMQJZ4PX.js → onboarding-D7R7ruD-.js} +1 -1
  191. package/dist/client/assets/{openai-conversation-CWam_Ql8.js → openai-conversation-BCvZ5ej9.js} +1 -1
  192. package/dist/client/assets/{optimistic-project-sidebar-views-Dx-3KOhR.js → optimistic-project-sidebar-views-Bz2DeBl-.js} +1 -1
  193. package/dist/client/assets/{order-monitor-day-DGR3iDef.js → order-monitor-day-BNl8fFb3.js} +1 -1
  194. package/dist/client/assets/{organization-choice-1Lr2hM9B.js → organization-choice-C8ztyWAj.js} +1 -1
  195. package/dist/client/assets/{orgs-CbmN-Uo3.js → orgs-BEIL9qOj.js} +1 -1
  196. package/dist/client/assets/{own-accounts-section-DPfUOm23.js → own-accounts-section-DHsCZaa_.js} +1 -1
  197. package/dist/client/assets/{pair-BCJ5sFP0.js → pair-DgyQyGxu.js} +1 -1
  198. package/dist/client/assets/{parse-sections-DxG18Udv.js → parse-sections-BINxH4jk.js} +3 -3
  199. package/dist/client/assets/{plan-BaYlHrHs.js → plan-CDcC0rOK.js} +1 -1
  200. package/dist/client/assets/{plan-ladder-LKl9l3TA.js → plan-ladder-Co_eK5AC.js} +1 -1
  201. package/dist/client/assets/{plan-usage-card-wDWYSVHD.js → plan-usage-card-4u1GJF-M.js} +1 -1
  202. package/dist/client/assets/{popover-DmqBIPKi.js → popover-0QOAqVJk.js} +1 -1
  203. package/dist/client/assets/{post-calendar-C4TZhDJz.js → post-calendar-DduTegNs.js} +1 -1
  204. package/dist/client/assets/{post-editor-DGrj-qXP.js → post-editor-Mf4GsYRx.js} +1 -1
  205. package/dist/client/assets/{preview-content-8R1QUim7.js → preview-content-DyOPmPcx.js} +1 -1
  206. package/dist/client/assets/{preview-dialog-ZNHmoyI1.js → preview-dialog-CZkiEbrD.js} +1 -1
  207. package/dist/client/assets/{preview-panel-DbX8A-HE.js → preview-panel-DvDhWRl1.js} +1 -1
  208. package/dist/client/assets/{preview-tab-DglGrCFS.js → preview-tab-BokCsWoa.js} +3 -3
  209. package/dist/client/assets/{product-picker-dialog-B84p2GNz.js → product-picker-dialog-BhLQcpty.js} +1 -1
  210. package/dist/client/assets/{profile-Bhqnq92W.js → profile-CHHeRrkg.js} +1 -1
  211. package/dist/client/assets/{project-app-view-BH2u01TO.js → project-app-view-B5l4fRim.js} +1 -1
  212. package/dist/client/assets/{project-apps-CTuZm-1a.js → project-apps-CoyGgkBY.js} +1 -1
  213. package/dist/client/assets/{project-icon-BhWIi9DN.js → project-icon-Dw0hv3sh.js} +1 -1
  214. package/dist/client/assets/{project-index-_-BCnGMR.js → project-index-BBHuv0EO.js} +1 -1
  215. package/dist/client/assets/project-reports-Dw67W6gg.js +1 -0
  216. package/dist/client/assets/project-tasks-D1jsCkuJ.js +1 -0
  217. package/dist/client/assets/{projects-CbLcC2Cm.js → projects-D8S3qo1_.js} +1 -1
  218. package/dist/client/assets/{projects-empty-state-DgeHjyWl.js → projects-empty-state-Dua7Nz71.js} +1 -1
  219. package/dist/client/assets/{prompts-CIAk1CWx.js → prompts-xYUuYqKM.js} +1 -1
  220. package/dist/client/assets/{record-editor-Cqt0X6zj.js → record-editor-DJX_9RjM.js} +1 -1
  221. package/dist/client/assets/{redirect-editor-DrfUg_M2.js → redirect-editor-Dg7R7Khp.js} +1 -1
  222. package/dist/client/assets/{reports-BqGiKAfm.js → reports-IK3JTc_Y.js} +1 -1
  223. package/dist/client/assets/reports-Nkw-tSTQ.js +1 -0
  224. package/dist/client/assets/{reports-onboarding-LZjQ8G8T.js → reports-onboarding-Bck_9H7P.js} +1 -1
  225. package/dist/client/assets/{reports-tab-B55dyiL7.js → reports-tab-YtH5s1_c.js} +2 -2
  226. package/dist/client/assets/{repositories-0RznNRUX.js → repositories-BbC792Td.js} +1 -1
  227. package/dist/client/assets/repositories-Cv9neHx3.js +1 -0
  228. package/dist/client/assets/{repository-binding-Cfy_YQIZ.js → repository-binding-iKwK7-Ti.js} +1 -1
  229. package/dist/client/assets/{repository-picker-BKWo-jhF.js → repository-picker-CsVAueef.js} +1 -1
  230. package/dist/client/assets/{require-capability-Bpnmr0un.js → require-capability-C6UIHdLW.js} +1 -1
  231. package/dist/client/assets/{required-auth-layout-CRKzQVpv.js → required-auth-layout-ArdFAKbC.js} +1 -1
  232. package/dist/client/assets/{reset-password-DVKc7osA.js → reset-password-Bklo3usB.js} +1 -1
  233. package/dist/client/assets/{resizable-w4diu4pE.js → resizable-C2H4ncbK.js} +1 -1
  234. package/dist/client/assets/{resolve-tab-icon-DY3vlmxg.js → resolve-tab-icon-BAd7FTFI.js} +1 -1
  235. package/dist/client/assets/{review-settings-D7Ld59mb.js → review-settings-Bsn_peiy.js} +1 -1
  236. package/dist/client/assets/{role-color-DfOmE7Fu.js → role-color-Bq_c6zFx.js} +1 -1
  237. package/dist/client/assets/{roles-RQS02DUg.js → roles-CdZGB-Lc.js} +1 -1
  238. package/dist/client/assets/{route-BRvX0p-n.js → route-44gxFGGl.js} +1 -1
  239. package/dist/client/assets/{route-B-HA2s4_.js → route-8_Ltt6UK.js} +1 -1
  240. package/dist/client/assets/route-CO9mZKjn.js +1 -0
  241. package/dist/client/assets/{sandbox-lifecycle-context-D-PaTa6M.js → sandbox-lifecycle-context-c0vInBKE.js} +1 -1
  242. package/dist/client/assets/{schema-CJ9UcSNs.js → schema-B4KfFv9K.js} +1 -1
  243. package/dist/client/assets/{schema-Dq7led26.js → schema-C2wAdAKO.js} +1 -1
  244. package/dist/client/assets/{scroll-area-PZSCT0ow.js → scroll-area-CEetJcQw.js} +1 -1
  245. package/dist/client/assets/{search-input-DO66exG7.js → search-input-Chjp2YsI.js} +1 -1
  246. package/dist/client/assets/{search-toggle-DaBbNP1T.js → search-toggle-FFxbO1K_.js} +1 -1
  247. package/dist/client/assets/{secret-picker-bljsK2mV.js → secret-picker-DlDvGxNZ.js} +1 -1
  248. package/dist/client/assets/{secrets-CBAb9cvk.js → secrets-DK0kdPrM.js} +1 -1
  249. package/dist/client/assets/{section-array-field-CPrkBgr3.js → section-array-field-CUnAh-PO.js} +1 -1
  250. package/dist/client/assets/{sections-T2vi-zI4.js → sections-Hj5eDRSE.js} +1 -1
  251. package/dist/client/assets/{sections-editor-DQwNUlLv.js → sections-editor-fEz6l-4h.js} +1 -1
  252. package/dist/client/assets/{select-BABowMoY.js → select-C0xcPtOB.js} +1 -1
  253. package/dist/client/assets/{select-model-CbEyJ33x.js → select-model-CK9gtFkN.js} +1 -1
  254. package/dist/client/assets/{seo-editor-C9V4Y_YB.js → seo-editor-CgwSwkDR.js} +1 -1
  255. package/dist/client/assets/{separator-CM0d_WPE.js → separator-iYeuLY5_.js} +1 -1
  256. package/dist/client/assets/settings-tab-BLLBbRtb.js +1 -0
  257. package/dist/client/assets/{sheet-BSCF-nmk.js → sheet-DhQijbAd.js} +1 -1
  258. package/dist/client/assets/{shell-layout-d2Ief2ja.js → shell-layout-BqRG9822.js} +1 -1
  259. package/dist/client/assets/site-draft-actions-Cf0a_R1v.js +3 -0
  260. package/dist/client/assets/{site-draft-view-CbKyFhEM.js → site-draft-view-6pCAsqBR.js} +1 -1
  261. package/dist/client/assets/site-editor-CvqXGd3U.js +1 -0
  262. package/dist/client/assets/{site-editor-toast-CluWI-yZ.js → site-editor-toast-D-duKOmm.js} +1 -1
  263. package/dist/client/assets/{skills-BOpgUaHZ.js → skills-B42MCTu7.js} +1 -1
  264. package/dist/client/assets/{slider-QcqvUsSI.js → slider-BIOaJhia.js} +1 -1
  265. package/dist/client/assets/{sortable.esm-0yomt8g2.js → sortable.esm-BKk9QQu5.js} +1 -1
  266. package/dist/client/assets/{sso-CbSeZ9e5.js → sso-DQhr1VaY.js} +1 -1
  267. package/dist/client/assets/{suggestion-C9bDFuOo.js → suggestion-CARH8w5s.js} +1 -1
  268. package/dist/client/assets/{super-agent-icon-DMm0_lmO.js → super-agent-icon-BlS9Y_VB.js} +1 -1
  269. package/dist/client/assets/{switch-CRe3xUPs.js → switch-DGJZecXh.js} +1 -1
  270. package/dist/client/assets/{synced-repos-D900mhEv.js → synced-repos-CTm5Cs5h.js} +1 -1
  271. package/dist/client/assets/{tab-icon-glyph-D5lXXFkj.js → tab-icon-glyph-Bh2gIgbX.js} +1 -1
  272. package/dist/client/assets/{table-C-Iqqanf.js → table-BrWdZgmB.js} +1 -1
  273. package/dist/client/assets/{tabs-CPwYT_wy.js → tabs-Drvd2w0d.js} +1 -1
  274. package/dist/client/assets/{task-board-B-Jl-DnQ.js → task-board-DFqxjiEI.js} +1 -1
  275. package/dist/client/assets/{task-route-C-boE7jG.js → task-route-DIG8cCWi.js} +1 -1
  276. package/dist/client/assets/{task-status-Dg7JusRR.js → task-status-7WzxwBOT.js} +1 -1
  277. package/dist/client/assets/{taskboard-analytics-DwDfRDQC.js → taskboard-analytics-C9XD4rr5.js} +1 -1
  278. package/dist/client/assets/tasks-BIC49KNy.js +1 -0
  279. package/dist/client/assets/{tasks-ElocVpWd.js → tasks-BWa9YrLw.js} +1 -1
  280. package/dist/client/assets/{textarea-DSiKrnTK.js → textarea-BIef_B53.js} +1 -1
  281. package/dist/client/assets/{thread-analytics-BtdCUFGw.js → thread-analytics-DGuFmj7S.js} +1 -1
  282. package/dist/client/assets/{thread-intent-DnduoWYb.js → thread-intent-D3YJu4FC.js} +1 -1
  283. package/dist/client/assets/{thread-route-D0P3i7B7.js → thread-route-6BVXiIwW.js} +1 -1
  284. package/dist/client/assets/{thread-route-DSQLBJ4Y.js → thread-route-BAbyqgqJ.js} +1 -1
  285. package/dist/client/assets/{thread-sheet-body-BHjT7Rlx.js → thread-sheet-body-nkZQvgwg.js} +1 -1
  286. package/dist/client/assets/{time-range-picker-B0Xtja-D.js → time-range-picker-DQ1ODBVb.js} +1 -1
  287. package/dist/client/assets/{toggle-group-CO1s8gR-.js → toggle-group-J_c3_HoS.js} +1 -1
  288. package/dist/client/assets/{tool-namespace-BskMFdfX.js → tool-namespace-GXxgJjDC.js} +1 -1
  289. package/dist/client/assets/{tool-set-selector-DbHsII-W.js → tool-set-selector-DMkw7-QF.js} +1 -1
  290. package/dist/client/assets/{toolbar-icon-button-DQHnJFhG.js → toolbar-icon-button-Dk3kMLWj.js} +1 -1
  291. package/dist/client/assets/{tooltip-C1oPRuFg.js → tooltip-DRLrjg1Z.js} +1 -1
  292. package/dist/client/assets/{tooltipContext-Dk4Jh8sf.js → tooltipContext-CgaE1Ykh.js} +1 -1
  293. package/dist/client/assets/{track-DQNlgsAd.js → track-BrOHLJ00.js} +1 -1
  294. package/dist/client/assets/{types-sVhbGxrT.js → types-KmQE3GXh.js} +1 -1
  295. package/dist/client/assets/{url-slug-kny4-Gd8.js → url-slug-qoNh9b30.js} +1 -1
  296. package/dist/client/assets/{usage-stats-CkprzoQA.js → usage-stats-CjtMu5Zx.js} +1 -1
  297. package/dist/client/assets/{use-ai-providers-BmwnG2L7.js → use-ai-providers-BDUElYx2.js} +1 -1
  298. package/dist/client/assets/{use-apply-named-rule-QQXumPyC.js → use-apply-named-rule-DM9ntGDg.js} +1 -1
  299. package/dist/client/assets/use-ask-in-chat-BshuIOHJ.js +1 -0
  300. package/dist/client/assets/{use-automations-pGpYlQfd.js → use-automations-CgzpDpYo.js} +1 -1
  301. package/dist/client/assets/{use-autosave-C1VLdEbv.js → use-autosave-Ds1iXAxS.js} +1 -1
  302. package/dist/client/assets/use-blocks-v8-project-CtykppCm.js +1 -0
  303. package/dist/client/assets/{use-chat-layout-state-Ep7OkPup.js → use-chat-layout-state-DjgvyXQQ.js} +1 -1
  304. package/dist/client/assets/{use-cms-publish-actions-Cls9mAWe.js → use-cms-publish-actions-DiaP6Bp7.js} +1 -1
  305. package/dist/client/assets/{use-connect-companion-B0uthGiU.js → use-connect-companion-x8idSj8x.js} +1 -1
  306. package/dist/client/assets/{use-connection-DFsrW4Mv.js → use-connection-C_WGTEZq.js} +1 -1
  307. package/dist/client/assets/{use-content-sync-BYcD8LZk.js → use-content-sync-D3d_ExK_.js} +1 -1
  308. package/dist/client/assets/{use-copy-9wHvlEmg.js → use-copy-D7ZZ3KMu.js} +1 -1
  309. package/dist/client/assets/{use-date-fns-locale-CfiWZhP7.js → use-date-fns-locale-BzMub9mF.js} +1 -1
  310. package/dist/client/assets/{use-debounced-autosave-CK8e7jku.js → use-debounced-autosave-CzyS953U.js} +1 -1
  311. package/dist/client/assets/{use-debounced-value-Cs49dczG.js → use-debounced-value-XK-wyi5u.js} +1 -1
  312. package/dist/client/assets/{use-deco-credits-ChuCrYAR.js → use-deco-credits-CatOkC_w.js} +1 -1
  313. package/dist/client/assets/{use-decopilot-events-CR7NJgme.js → use-decopilot-events-k-yjMTX4.js} +1 -1
  314. package/dist/client/assets/{use-delete-connection-Dq2UKTpz.js → use-delete-connection-CEcRA8Xn.js} +1 -1
  315. package/dist/client/assets/{use-deployment-admin-CALPlo_8.js → use-deployment-admin-CYH4bscG.js} +1 -1
  316. package/dist/client/assets/{use-entitlements-DzfUP8ON.js → use-entitlements-e6B2Hr8Z.js} +1 -1
  317. package/dist/client/assets/{use-fast-preview-draft-url-B0ysxeQy.js → use-fast-preview-draft-url-Djb-_I6o.js} +1 -1
  318. package/dist/client/assets/{use-file-configs-CfNCrD6y.js → use-file-configs-C4NlrYt7.js} +1 -1
  319. package/dist/client/assets/{use-id-selection-BeGsI2-X.js → use-id-selection-DDwQKiQU.js} +1 -1
  320. package/dist/client/assets/{use-inbox-feed-HViitByF.js → use-inbox-feed-Di-8v2sk.js} +1 -1
  321. package/dist/client/assets/{use-infinite-scroll-DdKcODzJ.js → use-infinite-scroll-DUONvrYP.js} +1 -1
  322. package/dist/client/assets/{use-join-requests-Dg5vHh8i.js → use-join-requests-DKQMcSk1.js} +1 -1
  323. package/dist/client/assets/{use-main-panel-tabs-DZH6Z-sf.js → use-main-panel-tabs-CrJHUqht.js} +1 -1
  324. package/dist/client/assets/{use-mcp-auth-status-C13HkQ9w.js → use-mcp-auth-status-thBksWSk.js} +1 -1
  325. package/dist/client/assets/{use-mcp-client-B9_8tfCL.js → use-mcp-client-C1kVArlZ.js} +1 -1
  326. package/dist/client/assets/{use-mcp-prompts-NcFGfyZU.js → use-mcp-prompts-BNy6CE1f.js} +1 -1
  327. package/dist/client/assets/{use-mcp-tools-wrSWiD0P.js → use-mcp-tools-C8CHF0k6.js} +1 -1
  328. package/dist/client/assets/{use-mobile-DSmr8Fj3.js → use-mobile-DQW_XOug.js} +1 -1
  329. package/dist/client/assets/{use-move-blocks-gne4gzCh.js → use-move-blocks-DdIUC_tq.js} +1 -1
  330. package/dist/client/assets/{use-navigate-to-agent-ycEqYJX7.js → use-navigate-to-agent-CtNID66l.js} +1 -1
  331. package/dist/client/assets/{use-org-fs-C57fsXyq.js → use-org-fs-7KKDVAQZ.js} +1 -1
  332. package/dist/client/assets/{use-org-repo-syncs-BcOvlKwo.js → use-org-repo-syncs-oGSVYIPr.js} +1 -1
  333. package/dist/client/assets/{use-org-sso-B5c0saDF.js → use-org-sso-BNoONX8B.js} +1 -1
  334. package/dist/client/assets/{use-organization-settings-B0lt5dXR.js → use-organization-settings-Cx5lerOS.js} +1 -1
  335. package/dist/client/assets/{use-project-native-view-presence-BBRyl28q.js → use-project-native-view-presence-CEs9QAB1.js} +1 -1
  336. package/dist/client/assets/{use-project-scope-C1eT4xwT.js → use-project-scope-BScqgH6_.js} +1 -1
  337. package/dist/client/assets/{use-recent-apps-CU27r377.js → use-recent-apps-8dRhCmC4.js} +1 -1
  338. package/dist/client/assets/{use-reports-diagnostic-QLTyI1c7.js → use-reports-diagnostic-CkfwR8yn.js} +1 -1
  339. package/dist/client/assets/{use-sandbox-events-BNcBCK9X.js → use-sandbox-events-Ca9uLRCX.js} +1 -1
  340. package/dist/client/assets/{use-secrets-Dh7bZZgD.js → use-secrets-BE1GFmsp.js} +1 -1
  341. package/dist/client/assets/{use-section-preview-base-53RIdpth.js → use-section-preview-base-K5lOIzyw.js} +1 -1
  342. package/dist/client/assets/{use-sidebar-collapsed-XX5WdYs3.js → use-sidebar-collapsed-DvtsV-tY.js} +1 -1
  343. package/dist/client/assets/{use-tags-Cbxwh1yu.js → use-tags-Cc-fOvuK.js} +1 -1
  344. package/dist/client/assets/{use-task-board-analytics-BseFgQx7.js → use-task-board-analytics-BdqVNu2r.js} +1 -1
  345. package/dist/client/assets/{use-task-board-events-CMb3Vjy2.js → use-task-board-events-DjlevGZD.js} +1 -1
  346. package/dist/client/assets/{use-task-board-item-prs-2_-y1IH5.js → use-task-board-item-prs-DJDkhnjm.js} +1 -1
  347. package/dist/client/assets/{use-task-board-items-CnG0LR-k.js → use-task-board-items-DuPNBzus.js} +1 -1
  348. package/dist/client/assets/{use-task-board-prompts-DschKVPr.js → use-task-board-prompts-DL7UT4ge.js} +1 -1
  349. package/dist/client/assets/{use-task-metadata-KJjG2-5j.js → use-task-metadata-CXoj0Mgb.js} +1 -1
  350. package/dist/client/assets/{use-thread-outputs-B6Mbzgsq.js → use-thread-outputs-CVtFpcBH.js} +1 -1
  351. package/dist/client/assets/{use-voice-input-BVeAO01v.js → use-voice-input-D5EWzPOm.js} +1 -1
  352. package/dist/client/assets/useInfiniteQuery-CHzLTZOu.js +1 -0
  353. package/dist/client/assets/{useQueries-COskgQPI.js → useQueries-Bi8p-84q.js} +1 -1
  354. package/dist/client/assets/useSuspenseInfiniteQuery-_UZTXUPR.js +1 -0
  355. package/dist/client/assets/{users-D9U38Uiq.js → users-D8vW0k7J.js} +1 -1
  356. package/dist/client/assets/{utils-C07I_8BL.js → utils-B4PWyytn.js} +1 -1
  357. package/dist/client/assets/{variant-calendar-B1xF-pvj.js → variant-calendar-C6dqbiTH.js} +1 -1
  358. package/dist/client/assets/{variant-matcher-override-O46bQvi2.js → variant-matcher-override-AGfqIbEM.js} +1 -1
  359. package/dist/client/assets/{view-header-CB8g9i8I.js → view-header-B_Yo88m4.js} +1 -1
  360. package/dist/client/assets/{virtual-mcp-DkEy_7-s.js → virtual-mcp-D75pLq3k.js} +1 -1
  361. package/dist/client/assets/{watch-sse-pool-BUtg06cI.js → watch-sse-pool-BqlJNCTB.js} +1 -1
  362. package/dist/client/index.html +1 -1
  363. package/dist/server/server.js +1 -1
  364. package/package.json +1 -1
  365. package/dist/client/assets/agent-app-S0Wudwb2.js +0 -1
  366. package/dist/client/assets/agent-deck-Cp4W6NYg.js +0 -1
  367. package/dist/client/assets/agent-experiments-DqEDCkUD.js +0 -1
  368. package/dist/client/assets/agent-library-D-dnSVJn.js +0 -1
  369. package/dist/client/assets/agent-library-file-S8fMrNmL.js +0 -1
  370. package/dist/client/assets/agent-overview-DTBRMEQ0.js +0 -1
  371. package/dist/client/assets/agent-settings-BiadK6yu.js +0 -1
  372. package/dist/client/assets/agent-site-editor-code-CYv63Bju.js +0 -2
  373. package/dist/client/assets/agent-site-editor-content-hqsSwJg4.js +0 -1
  374. package/dist/client/assets/agent-site-editor-preview-YV7jDYx1.js +0 -1
  375. package/dist/client/assets/agent-view-X2daaOWI.js +0 -1
  376. package/dist/client/assets/api-keys-D-r93aBn.js +0 -1
  377. package/dist/client/assets/cms-store-drafts-DOqjCS5l.js +0 -1
  378. package/dist/client/assets/library-bWgDO9u6.js +0 -1
  379. package/dist/client/assets/project-reports-yDx2KIN5.js +0 -1
  380. package/dist/client/assets/project-tasks-CZ24XPn7.js +0 -1
  381. package/dist/client/assets/reports-BeqJdfY-.js +0 -1
  382. package/dist/client/assets/repositories-BoB8X409.js +0 -1
  383. package/dist/client/assets/route-59M5FlvK.js +0 -1
  384. package/dist/client/assets/settings-tab-DUqPlhAE.js +0 -1
  385. package/dist/client/assets/site-draft-actions-CH7jTGTc.js +0 -3
  386. package/dist/client/assets/site-editor-CX53l3C_.js +0 -1
  387. package/dist/client/assets/tasks-DMBPC4PI.js +0 -1
  388. package/dist/client/assets/use-ask-in-chat-C56CHpt0.js +0 -1
  389. package/dist/client/assets/use-blocks-v8-project-DSiCCdEB.js +0 -1
  390. package/dist/client/assets/useInfiniteQuery-BvhkDMwv.js +0 -1
  391. package/dist/client/assets/useSuspenseInfiniteQuery-CHeSvNyF.js +0 -1
@@ -1 +1 @@
1
- import{c as lt,m as J,j as l}from"./index-XdUWZF5g.js";import{C as Q,c as Z,B as mt,b as ut}from"./chart-TbvRqjuj.js";import{C as tt,X as et,Y as at}from"./CartesianChart-Bku6CBeN.js";import{a as dt,A as ht}from"./AreaChart-BEgOgZZj.js";import{C as pt}from"./tooltipContext-Dk4Jh8sf.js";const it=60*1e3,P=60*it,xt=24*P,st=25*P;function q(s,t){if(s.length===0)return 0;const r=[...s].sort((f,c)=>f-c),e=Math.max(0,Math.min(r.length-1,Math.ceil(t*r.length)-1));return r[e]??0}function gt(s,t){return t<=st?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString([],{month:"short",day:"numeric"})}function yt(s,t){const r=t-s;return r<=P?Math.max(1,Math.min(60,Math.ceil(r/it))):r<=st?Math.max(1,Math.min(25,Math.ceil(r/P))):Math.max(1,Math.min(31,Math.ceil(r/xt)))}function kt(s,t,r,e){const f=t.getTime(),c=r.getTime(),h=Math.max(1,c-f),n=yt(f,c),g=Math.max(1,Math.floor(h/n)),a=[];for(let o=0;o<n;o++){const i=new Date(f+o*g);a.push({t:i.toISOString(),ts:i.getTime(),label:gt(i,h),calls:0,errors:0,durations:[]})}for(const o of s){const i=new Date(o.timestamp).getTime(),m=Math.floor((i-f)/g),x=Math.max(0,Math.min(n-1,m)),u=a[x];u&&(u.calls+=1,o.isError&&(u.errors+=1),Number.isFinite(o.durationMs)&&u.durations.push(o.durationMs))}return a.map(o=>({t:o.t,ts:o.ts,label:o.label,calls:o.calls,errors:o.errors,errorRate:o.calls>0?o.errors/o.calls*100:0,avg:Math.round(o.durations.length>0?o.durations.reduce((i,m)=>i+m,0)/o.durations.length:0),p50:Math.round(q(o.durations,.5)),p95:Math.round(q(o.durations,.95))}))}function _t(s,t,r,e,f){const c=e??s.length,h=f??s.filter(i=>i.isError).length,n=s.map(i=>i.durationMs),g=n.length>0?n.reduce((i,m)=>i+m,0)/n.length:0,a=q(n,.95),o=kt(s,t.startDate,t.endDate);return{totalCalls:c,totalErrors:h,avgDurationMs:g,p95DurationMs:a,data:o}}function ot(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function rt(s){const t=lt.c(19),{active:r,payload:e,dataKey:f,colorVar:c}=s;if(!r||!e?.length)return null;const h=e[0],n=h?.payload?.t??"";let g;t[0]!==h?.payload?.label||t[1]!==n?(g=n?new Date(n).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):h?.payload?.label??"",t[0]=h?.payload?.label,t[1]=n,t[2]=g):g=t[2];const a=g,o=h?.value,i=typeof o=="number"?o:0,m=f==="avg"||f==="p50"||f==="p95",x=f==="costUsd";let u;t[3]!==x||t[4]!==m||t[5]!==i?(u=x?`$${i.toFixed(i<1?4:2)}`:m?i>=1e4?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`:i.toLocaleString(),t[3]=x,t[4]=m,t[5]=i,t[6]=u):u=t[6];const S=u;let y;t[7]!==a?(y=l.jsx("div",{className:"text-2xs text-muted-foreground mb-1",children:a}),t[7]=a,t[8]=y):y=t[8];let k;t[9]!==c?(k=l.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:c}}),t[9]=c,t[10]=k):k=t[10];let v;t[11]!==S?(v=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=v):v=t[12];let p;t[13]!==k||t[14]!==v?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,v]}),t[13]=k,t[14]=v,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",children:[y,p]}),t[16]=y,t[17]=p,t[18]=j):j=t[18],j}function Ct(s){const t=lt.c(85),{data:r,dataKey:e,colorNum:f,chartHeight:c,variant:h,ariaLabel:n}=s,g=h===void 0?"bar":h,a=`var(--chart-${f})`,o=`kpi-gradient-${e}-${f}`,i=Math.max(...r.map(d=>d[e]??0),0);if(g==="area"){let d;t[0]!==c?(d=J(c,"w-full"),t[0]=c,t[1]=d):d=t[1];let M;t[2]!==a||t[3]!==e?(M={label:e,color:a},t[2]=a,t[3]=e,t[4]=M):M=t[4];let b;t[5]!==e||t[6]!==M?(b={[e]:M},t[5]=e,t[6]=M,t[7]=b):b=t[7];let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I={left:0,right:-12,top:8,bottom:8},t[8]=I):I=t[8];let $,O;t[9]!==a?($=l.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.2}),O=l.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),t[9]=a,t[10]=$,t[11]=O):($=t[10],O=t[11]);let w;t[12]!==o||t[13]!==$||t[14]!==O?(w=l.jsx("defs",{children:l.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[$,O]})}),t[12]=o,t[13]=$,t[14]=O,t[15]=w):w=t[15];let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[16]=R):R=t[16];let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),t[17]=V):V=t[17];let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[18]=U):U=t[18];const W=i>0?"auto":10;let E;t[19]!==W?(E=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ot,width:40,domain:[0,W],tickCount:5}),t[19]=W,t[20]=E):E=t[20];let Y;t[21]===Symbol.for("react.memo_cache_sentinel")?(Y={stroke:"var(--border)",strokeDasharray:"4 4"},t[21]=Y):Y=t[21];let T;t[22]!==a||t[23]!==e?(T=l.jsx(Q,{cursor:Y,content:nt=>{const{active:ct,payload:ft}=nt;return l.jsx(rt,{active:ct,payload:ft,dataKey:e,colorVar:a})}}),t[22]=a,t[23]=e,t[24]=T):T=t[24];const X=`url(#${o})`;let z;t[25]!==a?(z={r:4,fill:a,stroke:"var(--background)",strokeWidth:2},t[25]=a,t[26]=z):z=t[26];let A;t[27]!==a||t[28]!==e||t[29]!==X||t[30]!==z?(A=l.jsx(dt,{type:"linear",dataKey:e,stroke:a,strokeWidth:2,fill:X,animationDuration:300,dot:!1,activeDot:z}),t[27]=a,t[28]=e,t[29]=X,t[30]=z,t[31]=A):A=t[31];let B;t[32]!==r||t[33]!==E||t[34]!==T||t[35]!==A||t[36]!==w?(B=l.jsxs(ht,{data:r,margin:I,children:[w,R,V,E,T,A]}),t[32]=r,t[33]=E,t[34]=T,t[35]=A,t[36]=w,t[37]=B):B=t[37];let H;return t[38]!==n||t[39]!==B||t[40]!==d||t[41]!==b?(H=l.jsx(Z,{role:"img","aria-label":n,className:d,config:b,children:B}),t[38]=n,t[39]=B,t[40]=d,t[41]=b,t[42]=H):H=t[42],H}let m;t[43]!==c?(m=J(c,"w-full"),t[43]=c,t[44]=m):m=t[44];let x;t[45]!==a||t[46]!==e?(x={label:e,color:a},t[45]=a,t[46]=e,t[47]=x):x=t[47];let u;t[48]!==e||t[49]!==x?(u={[e]:x},t[48]=e,t[49]=x,t[50]=u):u=t[50];let S,y;t[51]===Symbol.for("react.memo_cache_sentinel")?(S={left:0,right:-12,top:8,bottom:8},y=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[51]=S,t[52]=y):(S=t[51],y=t[52]);let k;t[53]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[53]=k):k=t[53];const v=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==v?(p=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:v,tickMargin:8}),t[54]=v,t[55]=p):p=t[55];let j;t[56]===Symbol.for("react.memo_cache_sentinel")?(j={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[56]=j):j=t[56];const G=i>0?"auto":10;let _;t[57]!==G?(_=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:j,tickFormatter:ot,width:40,domain:[0,G],tickCount:5}),t[57]=G,t[58]=_):_=t[58];let K;t[59]===Symbol.for("react.memo_cache_sentinel")?(K={fill:"var(--muted)",opacity:.3},t[59]=K):K=t[59];let C;t[60]!==a||t[61]!==e?(C=l.jsx(Q,{cursor:K,content:d=>{const{active:M,payload:b}=d;return l.jsx(rt,{active:M,payload:b,dataKey:e,colorVar:a})}}),t[60]=a,t[61]=e,t[62]=C):C=t[62];let L;if(t[63]!==a||t[64]!==r||t[65]!==e){let d;t[67]!==a||t[68]!==e?(d=(M,b)=>l.jsx(pt,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${b}`),t[67]=a,t[68]=e,t[69]=d):d=t[69],L=r.map(d),t[63]=a,t[64]=r,t[65]=e,t[66]=L}else L=t[66];let D;t[70]!==a||t[71]!==e||t[72]!==L?(D=l.jsx(mt,{dataKey:e,fill:a,radius:0,minPointSize:1,children:L}),t[70]=a,t[71]=e,t[72]=L,t[73]=D):D=t[73];let N;t[74]!==r||t[75]!==_||t[76]!==C||t[77]!==D||t[78]!==p?(N=l.jsxs(ut,{data:r,margin:S,children:[y,p,_,C,D]}),t[74]=r,t[75]=_,t[76]=C,t[77]=D,t[78]=p,t[79]=N):N=t[79];let F;return t[80]!==n||t[81]!==N||t[82]!==m||t[83]!==u?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:u,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=u,t[84]=F):F=t[84],F}export{Ct as K,_t as c};
1
+ import{c as lt,m as J,j as l}from"./index-DWzXxNX7.js";import{C as Q,c as Z,B as mt,b as ut}from"./chart-O8mftGMP.js";import{C as tt,X as et,Y as at}from"./CartesianChart-C5XP_HSc.js";import{a as dt,A as ht}from"./AreaChart-C7qhucyl.js";import{C as pt}from"./tooltipContext-CgaE1Ykh.js";const it=60*1e3,P=60*it,xt=24*P,st=25*P;function q(s,t){if(s.length===0)return 0;const r=[...s].sort((f,c)=>f-c),e=Math.max(0,Math.min(r.length-1,Math.ceil(t*r.length)-1));return r[e]??0}function gt(s,t){return t<=st?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString([],{month:"short",day:"numeric"})}function yt(s,t){const r=t-s;return r<=P?Math.max(1,Math.min(60,Math.ceil(r/it))):r<=st?Math.max(1,Math.min(25,Math.ceil(r/P))):Math.max(1,Math.min(31,Math.ceil(r/xt)))}function kt(s,t,r,e){const f=t.getTime(),c=r.getTime(),h=Math.max(1,c-f),n=yt(f,c),g=Math.max(1,Math.floor(h/n)),a=[];for(let o=0;o<n;o++){const i=new Date(f+o*g);a.push({t:i.toISOString(),ts:i.getTime(),label:gt(i,h),calls:0,errors:0,durations:[]})}for(const o of s){const i=new Date(o.timestamp).getTime(),m=Math.floor((i-f)/g),x=Math.max(0,Math.min(n-1,m)),u=a[x];u&&(u.calls+=1,o.isError&&(u.errors+=1),Number.isFinite(o.durationMs)&&u.durations.push(o.durationMs))}return a.map(o=>({t:o.t,ts:o.ts,label:o.label,calls:o.calls,errors:o.errors,errorRate:o.calls>0?o.errors/o.calls*100:0,avg:Math.round(o.durations.length>0?o.durations.reduce((i,m)=>i+m,0)/o.durations.length:0),p50:Math.round(q(o.durations,.5)),p95:Math.round(q(o.durations,.95))}))}function _t(s,t,r,e,f){const c=e??s.length,h=f??s.filter(i=>i.isError).length,n=s.map(i=>i.durationMs),g=n.length>0?n.reduce((i,m)=>i+m,0)/n.length:0,a=q(n,.95),o=kt(s,t.startDate,t.endDate);return{totalCalls:c,totalErrors:h,avgDurationMs:g,p95DurationMs:a,data:o}}function ot(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function rt(s){const t=lt.c(19),{active:r,payload:e,dataKey:f,colorVar:c}=s;if(!r||!e?.length)return null;const h=e[0],n=h?.payload?.t??"";let g;t[0]!==h?.payload?.label||t[1]!==n?(g=n?new Date(n).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):h?.payload?.label??"",t[0]=h?.payload?.label,t[1]=n,t[2]=g):g=t[2];const a=g,o=h?.value,i=typeof o=="number"?o:0,m=f==="avg"||f==="p50"||f==="p95",x=f==="costUsd";let u;t[3]!==x||t[4]!==m||t[5]!==i?(u=x?`$${i.toFixed(i<1?4:2)}`:m?i>=1e4?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`:i.toLocaleString(),t[3]=x,t[4]=m,t[5]=i,t[6]=u):u=t[6];const S=u;let y;t[7]!==a?(y=l.jsx("div",{className:"text-2xs text-muted-foreground mb-1",children:a}),t[7]=a,t[8]=y):y=t[8];let k;t[9]!==c?(k=l.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:c}}),t[9]=c,t[10]=k):k=t[10];let v;t[11]!==S?(v=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=v):v=t[12];let p;t[13]!==k||t[14]!==v?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,v]}),t[13]=k,t[14]=v,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",children:[y,p]}),t[16]=y,t[17]=p,t[18]=j):j=t[18],j}function Ct(s){const t=lt.c(85),{data:r,dataKey:e,colorNum:f,chartHeight:c,variant:h,ariaLabel:n}=s,g=h===void 0?"bar":h,a=`var(--chart-${f})`,o=`kpi-gradient-${e}-${f}`,i=Math.max(...r.map(d=>d[e]??0),0);if(g==="area"){let d;t[0]!==c?(d=J(c,"w-full"),t[0]=c,t[1]=d):d=t[1];let M;t[2]!==a||t[3]!==e?(M={label:e,color:a},t[2]=a,t[3]=e,t[4]=M):M=t[4];let b;t[5]!==e||t[6]!==M?(b={[e]:M},t[5]=e,t[6]=M,t[7]=b):b=t[7];let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I={left:0,right:-12,top:8,bottom:8},t[8]=I):I=t[8];let $,O;t[9]!==a?($=l.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.2}),O=l.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),t[9]=a,t[10]=$,t[11]=O):($=t[10],O=t[11]);let w;t[12]!==o||t[13]!==$||t[14]!==O?(w=l.jsx("defs",{children:l.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[$,O]})}),t[12]=o,t[13]=$,t[14]=O,t[15]=w):w=t[15];let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[16]=R):R=t[16];let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),t[17]=V):V=t[17];let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[18]=U):U=t[18];const W=i>0?"auto":10;let E;t[19]!==W?(E=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ot,width:40,domain:[0,W],tickCount:5}),t[19]=W,t[20]=E):E=t[20];let Y;t[21]===Symbol.for("react.memo_cache_sentinel")?(Y={stroke:"var(--border)",strokeDasharray:"4 4"},t[21]=Y):Y=t[21];let T;t[22]!==a||t[23]!==e?(T=l.jsx(Q,{cursor:Y,content:nt=>{const{active:ct,payload:ft}=nt;return l.jsx(rt,{active:ct,payload:ft,dataKey:e,colorVar:a})}}),t[22]=a,t[23]=e,t[24]=T):T=t[24];const X=`url(#${o})`;let z;t[25]!==a?(z={r:4,fill:a,stroke:"var(--background)",strokeWidth:2},t[25]=a,t[26]=z):z=t[26];let A;t[27]!==a||t[28]!==e||t[29]!==X||t[30]!==z?(A=l.jsx(dt,{type:"linear",dataKey:e,stroke:a,strokeWidth:2,fill:X,animationDuration:300,dot:!1,activeDot:z}),t[27]=a,t[28]=e,t[29]=X,t[30]=z,t[31]=A):A=t[31];let B;t[32]!==r||t[33]!==E||t[34]!==T||t[35]!==A||t[36]!==w?(B=l.jsxs(ht,{data:r,margin:I,children:[w,R,V,E,T,A]}),t[32]=r,t[33]=E,t[34]=T,t[35]=A,t[36]=w,t[37]=B):B=t[37];let H;return t[38]!==n||t[39]!==B||t[40]!==d||t[41]!==b?(H=l.jsx(Z,{role:"img","aria-label":n,className:d,config:b,children:B}),t[38]=n,t[39]=B,t[40]=d,t[41]=b,t[42]=H):H=t[42],H}let m;t[43]!==c?(m=J(c,"w-full"),t[43]=c,t[44]=m):m=t[44];let x;t[45]!==a||t[46]!==e?(x={label:e,color:a},t[45]=a,t[46]=e,t[47]=x):x=t[47];let u;t[48]!==e||t[49]!==x?(u={[e]:x},t[48]=e,t[49]=x,t[50]=u):u=t[50];let S,y;t[51]===Symbol.for("react.memo_cache_sentinel")?(S={left:0,right:-12,top:8,bottom:8},y=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[51]=S,t[52]=y):(S=t[51],y=t[52]);let k;t[53]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[53]=k):k=t[53];const v=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==v?(p=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:v,tickMargin:8}),t[54]=v,t[55]=p):p=t[55];let j;t[56]===Symbol.for("react.memo_cache_sentinel")?(j={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[56]=j):j=t[56];const G=i>0?"auto":10;let _;t[57]!==G?(_=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:j,tickFormatter:ot,width:40,domain:[0,G],tickCount:5}),t[57]=G,t[58]=_):_=t[58];let K;t[59]===Symbol.for("react.memo_cache_sentinel")?(K={fill:"var(--muted)",opacity:.3},t[59]=K):K=t[59];let C;t[60]!==a||t[61]!==e?(C=l.jsx(Q,{cursor:K,content:d=>{const{active:M,payload:b}=d;return l.jsx(rt,{active:M,payload:b,dataKey:e,colorVar:a})}}),t[60]=a,t[61]=e,t[62]=C):C=t[62];let L;if(t[63]!==a||t[64]!==r||t[65]!==e){let d;t[67]!==a||t[68]!==e?(d=(M,b)=>l.jsx(pt,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${b}`),t[67]=a,t[68]=e,t[69]=d):d=t[69],L=r.map(d),t[63]=a,t[64]=r,t[65]=e,t[66]=L}else L=t[66];let D;t[70]!==a||t[71]!==e||t[72]!==L?(D=l.jsx(mt,{dataKey:e,fill:a,radius:0,minPointSize:1,children:L}),t[70]=a,t[71]=e,t[72]=L,t[73]=D):D=t[73];let N;t[74]!==r||t[75]!==_||t[76]!==C||t[77]!==D||t[78]!==p?(N=l.jsxs(ut,{data:r,margin:S,children:[y,p,_,C,D]}),t[74]=r,t[75]=_,t[76]=C,t[77]=D,t[78]=p,t[79]=N):N=t[79];let F;return t[80]!==n||t[81]!==N||t[82]!==m||t[83]!==u?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:u,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=u,t[84]=F):F=t[84],F}export{Ct as K,_t as c};
@@ -1 +1 @@
1
- import{c as ie,r as U,m as ce,j as t}from"./index-XdUWZF5g.js";import{B as le}from"./badge-fJOJmdQG.js";import{C as ne}from"./checkbox-BYltfk17.js";import{t as ae}from"./ChevronUp-RQuomTlc.js";import{a as de,C as me,b as oe,c as ue,e as fe,f as he}from"./command-8eo7blzl.js";import{a as xe,b as pe,P as ge}from"./popover-DmqBIPKi.js";const ve=[];function Ve(r){const e=ie.c(68),{options:a,onValueChange:o,defaultValue:W,placeholder:X,animation:Z,maxCount:ee,modalPopover:te,className:M,disabled:se,onSearchChange:S}=r,d=W===void 0?ve:W,$=X===void 0?"Select items":X,P=Z===void 0?0:Z,k=ee===void 0?3:ee,J=te===void 0?!1:te,Y=se===void 0?!1:se,[s,y]=U.useState(d),[F,_]=U.useState(!1);let V,E;e[0]!==d||e[1]!==s?(V=()=>{JSON.stringify(s)!==JSON.stringify(d)&&y(d)},E=[d,s],e[0]=d,e[1]=s,e[2]=V,e[3]=E):(V=e[2],E=e[3]),U.useEffect(V,E);let O;e[4]!==o||e[5]!==s?(O=l=>{if(l.key==="Enter")_(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const n=[...s];n.pop(),y(n),o(n)}},e[4]=o,e[5]=s,e[6]=O):O=e[6];const G=O;let D;e[7]!==o||e[8]!==s?(D=l=>{const n=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];y(n),o(n)},e[7]=o,e[8]=s,e[9]=D):D=e[9];const c=D;let I;e[10]!==o?(I=()=>{y([]),o([])},e[10]=o,e[11]=I):I=e[11];const L=I;let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{_(Ne)},e[12]=z):z=e[12];const re=z;let A;e[13]!==L||e[14]!==o||e[15]!==a||e[16]!==s.length?(A=()=>{if(s.length===a.length)L();else{const l=a.map(Ce);y(l),o(l)}},e[13]=L,e[14]=o,e[15]=a,e[16]=s.length,e[17]=A):A=e[17];const i=A;let m;e[18]!==M?(m=ce("focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex h-[var(--studio-control-height,2.25rem)] w-full max-w-xs items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] pr-3 pl-1.5 text-sm shadow-edge transition-[background-color,box-shadow] hover:bg-sidebar disabled:pointer-events-none disabled:text-subtle-foreground",M),e[18]=M,e[19]=m):m=e[19];let u;e[20]!==P||e[21]!==k||e[22]!==a||e[23]!==$||e[24]!==s?(u=s.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[s.slice(0,k).map(l=>{const n=a.find(Q=>Q.value===l),w=n?.icon;return t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card max-w-28",style:{animationDuration:`${P}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:n?.label})]},l)}),s.length>k&&t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card flex-shrink-0",style:{animationDuration:`${P}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})})]}):t.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[t.jsx("span",{className:"text-subtle-foreground pl-1.5 text-sm",children:$}),t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})]}),e[20]=P,e[21]=k,e[22]=a,e[23]=$,e[24]=s,e[25]=u):u=e[25];let f;e[26]!==Y||e[27]!==m||e[28]!==u?(f=t.jsx(xe,{asChild:!0,children:t.jsx("button",{type:"button",onClick:re,className:m,disabled:Y,children:u})}),e[26]=Y,e[27]=m,e[28]=u,e[29]=f):f=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=()=>_(!1),e[30]=R):R=e[30];const q=!S;let h;e[31]!==G||e[32]!==S?(h=t.jsx(de,{placeholder:"Search...",onKeyDown:G,onValueChange:S,className:"rounded-t-xl"}),e[31]=G,e[32]=S,e[33]=h):h=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(me,{children:"No results found."}),e[34]=T):T=e[34];let x;e[35]!==i?(x=()=>{i()},e[35]=i,e[36]=x):x=e[36];let p;e[37]!==i?(p=l=>{l.stopPropagation(),i()},e[37]=i,e[38]=p):p=e[38];const H=s.length===a.length&&a.length>0;let g;e[39]!==H||e[40]!==i?(g=t.jsx(ne,{checked:H,onCheckedChange:i,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:be}),e[39]=H,e[40]=i,e[41]=g):g=e[41];let B;e[42]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{children:"(Select All)"}),e[42]=B):B=e[42];let v;e[43]!==p||e[44]!==g?(v=t.jsxs("div",{className:"flex items-center w-full",onClick:p,children:[g,B]}),e[43]=p,e[44]=g,e[45]=v):v=e[45];let j;e[46]!==x||e[47]!==v?(j=t.jsx(oe,{onSelect:x,className:"cursor-pointer",children:v},"all"),e[46]=x,e[47]=v,e[48]=j):j=e[48];let b;if(e[49]!==a||e[50]!==s||e[51]!==c){let l;e[53]!==s||e[54]!==c?(l=n=>{const w=s.includes(n.value);return t.jsx(oe,{onSelect:()=>{c(n)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:Q=>{Q.stopPropagation(),c(n)},children:[t.jsx(ne,{checked:w,onCheckedChange:()=>{c(n)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:je}),n.icon&&t.jsx(n.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:n.label})]})},n.value)},e[53]=s,e[54]=c,e[55]=l):l=e[55],b=a.map(l),e[49]=a,e[50]=s,e[51]=c,e[52]=b}else b=e[52];let C;e[56]!==j||e[57]!==b?(C=t.jsxs(ue,{className:"rounded-b-xl",children:[T,t.jsxs(fe,{children:[j,b]})]}),e[56]=j,e[57]=b,e[58]=C):C=e[58];let N;e[59]!==q||e[60]!==h||e[61]!==C?(N=t.jsx(pe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:R,children:t.jsxs(he,{shouldFilter:q,className:"rounded-xl",children:[h,C]})}),e[59]=q,e[60]=h,e[61]=C,e[62]=N):N=e[62];let K;return e[63]!==F||e[64]!==J||e[65]!==f||e[66]!==N?(K=t.jsxs(ge,{open:F,onOpenChange:_,modal:J,children:[f,N]}),e[63]=F,e[64]=J,e[65]=f,e[66]=N,e[67]=K):K=e[67],K}function je(r){return r.stopPropagation()}function be(r){return r.stopPropagation()}function Ce(r){return r.value}function Ne(r){return!r}export{Ve as M};
1
+ import{c as ie,r as U,m as ce,j as t}from"./index-DWzXxNX7.js";import{B as le}from"./badge-B3JA5w4M.js";import{C as ne}from"./checkbox-CxN3Fjiq.js";import{t as ae}from"./ChevronUp-C7zL3mw4.js";import{a as de,C as me,b as oe,c as ue,e as fe,f as he}from"./command-BdQjVogo.js";import{a as xe,b as pe,P as ge}from"./popover-0QOAqVJk.js";const ve=[];function Ve(r){const e=ie.c(68),{options:a,onValueChange:o,defaultValue:W,placeholder:X,animation:Z,maxCount:ee,modalPopover:te,className:M,disabled:se,onSearchChange:S}=r,d=W===void 0?ve:W,$=X===void 0?"Select items":X,P=Z===void 0?0:Z,k=ee===void 0?3:ee,J=te===void 0?!1:te,Y=se===void 0?!1:se,[s,y]=U.useState(d),[F,_]=U.useState(!1);let V,E;e[0]!==d||e[1]!==s?(V=()=>{JSON.stringify(s)!==JSON.stringify(d)&&y(d)},E=[d,s],e[0]=d,e[1]=s,e[2]=V,e[3]=E):(V=e[2],E=e[3]),U.useEffect(V,E);let O;e[4]!==o||e[5]!==s?(O=l=>{if(l.key==="Enter")_(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const n=[...s];n.pop(),y(n),o(n)}},e[4]=o,e[5]=s,e[6]=O):O=e[6];const G=O;let D;e[7]!==o||e[8]!==s?(D=l=>{const n=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];y(n),o(n)},e[7]=o,e[8]=s,e[9]=D):D=e[9];const c=D;let I;e[10]!==o?(I=()=>{y([]),o([])},e[10]=o,e[11]=I):I=e[11];const L=I;let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{_(Ne)},e[12]=z):z=e[12];const re=z;let A;e[13]!==L||e[14]!==o||e[15]!==a||e[16]!==s.length?(A=()=>{if(s.length===a.length)L();else{const l=a.map(Ce);y(l),o(l)}},e[13]=L,e[14]=o,e[15]=a,e[16]=s.length,e[17]=A):A=e[17];const i=A;let m;e[18]!==M?(m=ce("focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex h-[var(--studio-control-height,2.25rem)] w-full max-w-xs items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] pr-3 pl-1.5 text-sm shadow-edge transition-[background-color,box-shadow] hover:bg-sidebar disabled:pointer-events-none disabled:text-subtle-foreground",M),e[18]=M,e[19]=m):m=e[19];let u;e[20]!==P||e[21]!==k||e[22]!==a||e[23]!==$||e[24]!==s?(u=s.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[s.slice(0,k).map(l=>{const n=a.find(Q=>Q.value===l),w=n?.icon;return t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card max-w-28",style:{animationDuration:`${P}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:n?.label})]},l)}),s.length>k&&t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card flex-shrink-0",style:{animationDuration:`${P}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})})]}):t.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[t.jsx("span",{className:"text-subtle-foreground pl-1.5 text-sm",children:$}),t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})]}),e[20]=P,e[21]=k,e[22]=a,e[23]=$,e[24]=s,e[25]=u):u=e[25];let f;e[26]!==Y||e[27]!==m||e[28]!==u?(f=t.jsx(xe,{asChild:!0,children:t.jsx("button",{type:"button",onClick:re,className:m,disabled:Y,children:u})}),e[26]=Y,e[27]=m,e[28]=u,e[29]=f):f=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=()=>_(!1),e[30]=R):R=e[30];const q=!S;let h;e[31]!==G||e[32]!==S?(h=t.jsx(de,{placeholder:"Search...",onKeyDown:G,onValueChange:S,className:"rounded-t-xl"}),e[31]=G,e[32]=S,e[33]=h):h=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(me,{children:"No results found."}),e[34]=T):T=e[34];let x;e[35]!==i?(x=()=>{i()},e[35]=i,e[36]=x):x=e[36];let p;e[37]!==i?(p=l=>{l.stopPropagation(),i()},e[37]=i,e[38]=p):p=e[38];const H=s.length===a.length&&a.length>0;let g;e[39]!==H||e[40]!==i?(g=t.jsx(ne,{checked:H,onCheckedChange:i,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:be}),e[39]=H,e[40]=i,e[41]=g):g=e[41];let B;e[42]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{children:"(Select All)"}),e[42]=B):B=e[42];let v;e[43]!==p||e[44]!==g?(v=t.jsxs("div",{className:"flex items-center w-full",onClick:p,children:[g,B]}),e[43]=p,e[44]=g,e[45]=v):v=e[45];let j;e[46]!==x||e[47]!==v?(j=t.jsx(oe,{onSelect:x,className:"cursor-pointer",children:v},"all"),e[46]=x,e[47]=v,e[48]=j):j=e[48];let b;if(e[49]!==a||e[50]!==s||e[51]!==c){let l;e[53]!==s||e[54]!==c?(l=n=>{const w=s.includes(n.value);return t.jsx(oe,{onSelect:()=>{c(n)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:Q=>{Q.stopPropagation(),c(n)},children:[t.jsx(ne,{checked:w,onCheckedChange:()=>{c(n)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:je}),n.icon&&t.jsx(n.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:n.label})]})},n.value)},e[53]=s,e[54]=c,e[55]=l):l=e[55],b=a.map(l),e[49]=a,e[50]=s,e[51]=c,e[52]=b}else b=e[52];let C;e[56]!==j||e[57]!==b?(C=t.jsxs(ue,{className:"rounded-b-xl",children:[T,t.jsxs(fe,{children:[j,b]})]}),e[56]=j,e[57]=b,e[58]=C):C=e[58];let N;e[59]!==q||e[60]!==h||e[61]!==C?(N=t.jsx(pe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:R,children:t.jsxs(he,{shouldFilter:q,className:"rounded-xl",children:[h,C]})}),e[59]=q,e[60]=h,e[61]=C,e[62]=N):N=e[62];let K;return e[63]!==F||e[64]!==J||e[65]!==f||e[66]!==N?(K=t.jsxs(ge,{open:F,onOpenChange:_,modal:J,children:[f,N]}),e[63]=F,e[64]=J,e[65]=f,e[66]=N,e[67]=K):K=e[67],K}function je(r){return r.stopPropagation()}function be(r){return r.stopPropagation()}function Ce(r){return r.value}function Ne(r){return!r}export{Ve as M};
@@ -1,4 +1,4 @@
1
- import{q as z,b as W,e as F,K,c as V,j as m,r as J,D as $,v as L,w as Y,x as G,B as O,t as U}from"./index-XdUWZF5g.js";import{u as X}from"./use-voice-input-BVeAO01v.js";import{o as Z,c as _,u as I,l as M,a5 as ee,a7 as te,a9 as re,aC as se,aa as ne,ad as ae,Y as oe,W as ie,X as ce,aj as ue,ai as le,q as fe,_ as pe}from"./site-editor-toast-CluWI-yZ.js";import{s as he}from"./sandbox-git-api-DcqI6XE4.js";import{u as de}from"./chat-context-BwoQSegQ.js";import{z as ve,H as ye}from"./hosted-reconcile-BdwyWhOE.js";import{x as B,u as ge}from"./parse-sections-DxG18Udv.js";import{b as we}from"./sandbox-url-D3mC8qhT.js";import{d as me}from"./utils-C07I_8BL.js";import{i as xe}from"./CheckCircle-BAqlx5xq.js";import{e as Ee}from"./agent-icon-DmYd33Zd.js";import{MonacoCodeEditor as ke}from"./monaco-editor-DoTBOc-e.js";function Ie({orgSlug:s,virtualMcpId:e,branch:r}){const t=z(),a=de()?.taskId??null,n=Z(e),o=X(e).runtime==="cms",{url:u}=_(e),c=I(e,r),p=c.kind==="protocol"?c:null,d=M({orgSlug:s,virtualMcpId:e,branch:r}),y=async i=>{if(u)return{ok:!0,existed:!0};if(o){const h=await ue({orgSlug:s,virtualMcpId:e,branch:r},{delete:[i]});return le(t,{orgSlug:s,virtualMcpId:e,branch:r},h),await t.invalidateQueries({queryKey:he({orgSlug:s,virtualMcpId:e,branch:r,threadId:a})}),{ok:!0,existed:!0}}const f=fe(n,me(i)),l=await fetch(we({orgSlug:s,virtualMcpId:e,branch:r,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():pe(l,"Delete")},x=W(),C=F({mutationKey:ce(s,e,r),scope:ie(s,e,r),mutationFn:async({blockKey:i,base:f,shown:l})=>{if(c.kind==="pending"||c.kind==="unavailable")throw ne("CMS storage");if(p?.source==="github"){const h=l?.();try{await ve({queryClient:t,backend:p,params:{orgSlug:s,virtualMcpId:e,branch:r},cacheKey:d},{writes:{},deletes:[i]},f&&f.value!==void 0?{[i]:f.value}:void 0,h&&h.value!==void 0?{[i]:h}:void 0)}catch(v){if(v instanceof ye)return{keptTheirs:!0,deleted:!1};throw v}return{ok:!0,existed:!0}}return p?(await ae(t,p,{orgSlug:s,virtualMcpId:e,branch:r},d,{delete:[i]}),{ok:!0,existed:!0}):oe({queryClient:t,orgSlug:s,virtualMcpId:e,branch:r,backend:c,cacheKey:d},{kind:"edit",write:()=>y(i)})},onMutate:async({blockKey:i})=>{const f=K.decofile(d);await t.cancelQueries({queryKey:f});const l=t.getQueryData(f),h=!!l&&i in l,v=l?.[i];return t.setQueryData(f,E=>{if(!E)return E;const{[i]:w,...j}=E;return j}),{queryKey:f,blockKey:i,hadKey:h,previousValue:v}},onError:(i,f,l)=>{te(x,i),l&&(p?.source==="github"&&(re(i)||i instanceof se)||t.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h))},onSuccess:i=>{if(B(i)){ee(x,!1);return}t.invalidateQueries({queryKey:K.liveMeta(s,e,r)})}}),D=i=>{if(i.base)return i;const f=t.getQueryData(K.decofile(d));return f?{...i,base:{value:f[i.blockKey]}}:i};return{...C,mutate:(i,f)=>C.mutate(D(i),f),mutateAsync:(i,f)=>C.mutateAsync(D(i),f)}}function Ce({open:s,onOpenChange:e,pageKey:r,decofile:t,onSave:a}){const n=W(),o=t[r],u=o===void 0,c=u?"":JSON.stringify(o,null,2),[p,d]=J.useState(!1),[y,x]=J.useState(c),[C,D]=J.useState(!1),i=!a||u,f=y!==c,l=()=>{navigator.clipboard.writeText(y).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})},h=async v=>{if(!a||C)return;let E;try{E=JSON.parse(v)}catch{U.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}D(!0);try{const w=await a(E);B(w)||U.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(w){U.error(n("sectionsEditor.pageJsonDialog.saveError",{error:w instanceof Error?w.message:String(w)}))}finally{D(!1)}};return m.jsx($,{open:s,onOpenChange:e,children:m.jsxs(L,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[m.jsxs(Y,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[m.jsx(G,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),m.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[m.jsxs(O,{variant:"ghost",size:"sm",onClick:l,className:"text-xs",children:[p?m.jsx(xe,{size:12}):m.jsx(Ee,{size:12}),n(p?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!i&&m.jsx(O,{size:"sm",onClick:()=>h(y),disabled:!f||C,className:"h-7 text-xs",children:n(C?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),u?m.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):m.jsx("div",{className:"min-h-0 flex-1 py-2",children:m.jsx(ke,{code:c,language:"json",readOnly:i,height:"100%",onChange:v=>x(v??""),onSave:v=>{h(v)}})})]})})}function Me(s){const e=V.c(10);let r,t;e[0]!==s?({params:r,...t}=s,e[0]=s,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={holdsCopy:!0},e[3]=a):a=e[3];const n=ge(r,a);let o;e[4]!==t.pageKey||e[5]!==n?(o=c=>n.mutateAsync({blockKey:t.pageKey,data:c}),e[4]=t.pageKey,e[5]=n,e[6]=o):o=e[6];let u;return e[7]!==t||e[8]!==o?(u=m.jsx(Ce,{...t,onSave:o}),e[7]=t,e[8]=o,e[9]=u):u=e[9],u}var Se=Object.prototype.toString,b=Array.isArray||function(e){return Se.call(e)==="[object Array]"};function q(s){return typeof s=="function"}function De(s){return b(s)?"array":typeof s}function N(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A(s,e){return s!=null&&typeof s=="object"&&e in s}function Pe(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var be=RegExp.prototype.test;function je(s,e){return be.call(s,e)}var Te=/\S/;function Re(s){return!je(Te,s)}var Ke={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Je(s){return String(s).replace(/[&<>"'`=\/]/g,function(r){return Ke[r]})}var Ue=/\s*/,Ne=/\s+/,Q=/\s*=/,qe=/\s*\}/,Oe=/#|\^|\/|>|\{|&|=|!/;function Ae(s,e){if(!s)return[];var r=!1,t=[],a=[],n=[],o=!1,u=!1,c="",p=0;function d(){if(o&&!u)for(;n.length;)delete a[n.pop()];else n=[];o=!1,u=!1}var y,x,C;function D(S){if(typeof S=="string"&&(S=S.split(Ne,2)),!b(S)||S.length!==2)throw new Error("Invalid tags: "+S);y=new RegExp(N(S[0])+"\\s*"),x=new RegExp("\\s*"+N(S[1])),C=new RegExp("\\s*"+N("}"+S[1]))}D(e||k.tags);for(var i=new R(s),f,l,h,v,E,w;!i.eos();){if(f=i.pos,h=i.scanUntil(y),h)for(var j=0,H=h.length;j<H;++j)v=h.charAt(j),Re(v)?(n.push(a.length),c+=v):(u=!0,r=!0,c+=" "),a.push(["text",v,f,f+1]),f+=1,v===`
1
+ import{q as z,b as W,e as F,K,c as V,j as m,r as J,D as $,v as L,w as Y,x as G,B as O,t as U}from"./index-DWzXxNX7.js";import{u as X}from"./use-voice-input-D5EWzPOm.js";import{o as Z,c as _,u as I,l as M,a5 as ee,a7 as te,a9 as re,aC as se,aa as ne,ad as ae,Y as oe,W as ie,X as ce,aj as ue,ai as le,q as fe,_ as pe}from"./site-editor-toast-D-duKOmm.js";import{s as he}from"./sandbox-git-api-DcqI6XE4.js";import{u as de}from"./chat-context-CbElEPZP.js";import{z as ve,H as ye}from"./hosted-reconcile-oZ2zb0h4.js";import{x as B,u as ge}from"./parse-sections-BINxH4jk.js";import{b as we}from"./sandbox-url-D3mC8qhT.js";import{d as me}from"./utils-B4PWyytn.js";import{i as xe}from"./CheckCircle-DbgO7kVp.js";import{e as Ee}from"./agent-icon-C4wH6TqA.js";import{MonacoCodeEditor as ke}from"./monaco-editor-BsSw5DlP.js";function Ie({orgSlug:s,virtualMcpId:e,branch:r}){const t=z(),a=de()?.taskId??null,n=Z(e),o=X(e).runtime==="cms",{url:u}=_(e),c=I(e,r),p=c.kind==="protocol"?c:null,d=M({orgSlug:s,virtualMcpId:e,branch:r}),y=async i=>{if(u)return{ok:!0,existed:!0};if(o){const h=await ue({orgSlug:s,virtualMcpId:e,branch:r},{delete:[i]});return le(t,{orgSlug:s,virtualMcpId:e,branch:r},h),await t.invalidateQueries({queryKey:he({orgSlug:s,virtualMcpId:e,branch:r,threadId:a})}),{ok:!0,existed:!0}}const f=fe(n,me(i)),l=await fetch(we({orgSlug:s,virtualMcpId:e,branch:r,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():pe(l,"Delete")},x=W(),C=F({mutationKey:ce(s,e,r),scope:ie(s,e,r),mutationFn:async({blockKey:i,base:f,shown:l})=>{if(c.kind==="pending"||c.kind==="unavailable")throw ne("CMS storage");if(p?.source==="github"){const h=l?.();try{await ve({queryClient:t,backend:p,params:{orgSlug:s,virtualMcpId:e,branch:r},cacheKey:d},{writes:{},deletes:[i]},f&&f.value!==void 0?{[i]:f.value}:void 0,h&&h.value!==void 0?{[i]:h}:void 0)}catch(v){if(v instanceof ye)return{keptTheirs:!0,deleted:!1};throw v}return{ok:!0,existed:!0}}return p?(await ae(t,p,{orgSlug:s,virtualMcpId:e,branch:r},d,{delete:[i]}),{ok:!0,existed:!0}):oe({queryClient:t,orgSlug:s,virtualMcpId:e,branch:r,backend:c,cacheKey:d},{kind:"edit",write:()=>y(i)})},onMutate:async({blockKey:i})=>{const f=K.decofile(d);await t.cancelQueries({queryKey:f});const l=t.getQueryData(f),h=!!l&&i in l,v=l?.[i];return t.setQueryData(f,E=>{if(!E)return E;const{[i]:w,...j}=E;return j}),{queryKey:f,blockKey:i,hadKey:h,previousValue:v}},onError:(i,f,l)=>{te(x,i),l&&(p?.source==="github"&&(re(i)||i instanceof se)||t.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h))},onSuccess:i=>{if(B(i)){ee(x,!1);return}t.invalidateQueries({queryKey:K.liveMeta(s,e,r)})}}),D=i=>{if(i.base)return i;const f=t.getQueryData(K.decofile(d));return f?{...i,base:{value:f[i.blockKey]}}:i};return{...C,mutate:(i,f)=>C.mutate(D(i),f),mutateAsync:(i,f)=>C.mutateAsync(D(i),f)}}function Ce({open:s,onOpenChange:e,pageKey:r,decofile:t,onSave:a}){const n=W(),o=t[r],u=o===void 0,c=u?"":JSON.stringify(o,null,2),[p,d]=J.useState(!1),[y,x]=J.useState(c),[C,D]=J.useState(!1),i=!a||u,f=y!==c,l=()=>{navigator.clipboard.writeText(y).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})},h=async v=>{if(!a||C)return;let E;try{E=JSON.parse(v)}catch{U.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}D(!0);try{const w=await a(E);B(w)||U.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(w){U.error(n("sectionsEditor.pageJsonDialog.saveError",{error:w instanceof Error?w.message:String(w)}))}finally{D(!1)}};return m.jsx($,{open:s,onOpenChange:e,children:m.jsxs(L,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[m.jsxs(Y,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[m.jsx(G,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),m.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[m.jsxs(O,{variant:"ghost",size:"sm",onClick:l,className:"text-xs",children:[p?m.jsx(xe,{size:12}):m.jsx(Ee,{size:12}),n(p?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!i&&m.jsx(O,{size:"sm",onClick:()=>h(y),disabled:!f||C,className:"h-7 text-xs",children:n(C?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),u?m.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):m.jsx("div",{className:"min-h-0 flex-1 py-2",children:m.jsx(ke,{code:c,language:"json",readOnly:i,height:"100%",onChange:v=>x(v??""),onSave:v=>{h(v)}})})]})})}function Me(s){const e=V.c(10);let r,t;e[0]!==s?({params:r,...t}=s,e[0]=s,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={holdsCopy:!0},e[3]=a):a=e[3];const n=ge(r,a);let o;e[4]!==t.pageKey||e[5]!==n?(o=c=>n.mutateAsync({blockKey:t.pageKey,data:c}),e[4]=t.pageKey,e[5]=n,e[6]=o):o=e[6];let u;return e[7]!==t||e[8]!==o?(u=m.jsx(Ce,{...t,onSave:o}),e[7]=t,e[8]=o,e[9]=u):u=e[9],u}var Se=Object.prototype.toString,b=Array.isArray||function(e){return Se.call(e)==="[object Array]"};function q(s){return typeof s=="function"}function De(s){return b(s)?"array":typeof s}function N(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A(s,e){return s!=null&&typeof s=="object"&&e in s}function Pe(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var be=RegExp.prototype.test;function je(s,e){return be.call(s,e)}var Te=/\S/;function Re(s){return!je(Te,s)}var Ke={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Je(s){return String(s).replace(/[&<>"'`=\/]/g,function(r){return Ke[r]})}var Ue=/\s*/,Ne=/\s+/,Q=/\s*=/,qe=/\s*\}/,Oe=/#|\^|\/|>|\{|&|=|!/;function Ae(s,e){if(!s)return[];var r=!1,t=[],a=[],n=[],o=!1,u=!1,c="",p=0;function d(){if(o&&!u)for(;n.length;)delete a[n.pop()];else n=[];o=!1,u=!1}var y,x,C;function D(S){if(typeof S=="string"&&(S=S.split(Ne,2)),!b(S)||S.length!==2)throw new Error("Invalid tags: "+S);y=new RegExp(N(S[0])+"\\s*"),x=new RegExp("\\s*"+N(S[1])),C=new RegExp("\\s*"+N("}"+S[1]))}D(e||k.tags);for(var i=new R(s),f,l,h,v,E,w;!i.eos();){if(f=i.pos,h=i.scanUntil(y),h)for(var j=0,H=h.length;j<H;++j)v=h.charAt(j),Re(v)?(n.push(a.length),c+=v):(u=!0,r=!0,c+=" "),a.push(["text",v,f,f+1]),f+=1,v===`
2
2
  `&&(d(),c="",p=0,r=!1);if(!i.scan(y))break;if(o=!0,l=i.scan(Oe)||"name",i.scan(Ue),l==="="?(h=i.scanUntil(Q),i.scan(Q),i.scanUntil(x)):l==="{"?(h=i.scanUntil(C),i.scan(qe),i.scanUntil(x),l="&"):h=i.scanUntil(x),!i.scan(x))throw new Error("Unclosed tag at "+i.pos);if(l==">"?E=[l,h,f,i.pos,c,p,r]:E=[l,h,f,i.pos],p++,a.push(E),l==="#"||l==="^")t.push(E);else if(l==="/"){if(w=t.pop(),!w)throw new Error('Unopened section "'+h+'" at '+f);if(w[1]!==h)throw new Error('Unclosed section "'+w[1]+'" at '+f)}else l==="name"||l==="{"||l==="&"?u=!0:l==="="&&D(h)}if(d(),w=t.pop(),w)throw new Error('Unclosed section "'+w[1]+'" at '+i.pos);return We(Qe(a))}function Qe(s){for(var e=[],r,t,a=0,n=s.length;a<n;++a)r=s[a],r&&(r[0]==="text"&&t&&t[0]==="text"?(t[1]+=r[1],t[3]=r[3]):(e.push(r),t=r));return e}function We(s){for(var e=[],r=e,t=[],a,n,o=0,u=s.length;o<u;++o)switch(a=s[o],a[0]){case"#":case"^":r.push(a),t.push(a),r=a[4]=[];break;case"/":n=t.pop(),n[5]=a[2],r=t.length>0?t[t.length-1][4]:e;break;default:r.push(a)}return e}function R(s){this.string=s,this.tail=s,this.pos=0}R.prototype.eos=function(){return this.tail===""};R.prototype.scan=function(e){var r=this.tail.match(e);if(!r||r.index!==0)return"";var t=r[0];return this.tail=this.tail.substring(t.length),this.pos+=t.length,t};R.prototype.scanUntil=function(e){var r=this.tail.search(e),t;switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t};function P(s,e){this.view=s,this.cache={".":this.view},this.parent=e}P.prototype.push=function(e){return new P(e,this)};P.prototype.lookup=function(e){var r=this.cache,t;if(r.hasOwnProperty(e))t=r[e];else{for(var a=this,n,o,u,c=!1;a;){if(e.indexOf(".")>0)for(n=a.view,o=e.split("."),u=0;n!=null&&u<o.length;)u===o.length-1&&(c=A(n,o[u])||Pe(n,o[u])),n=n[o[u++]];else n=a.view[e],c=A(a.view,e);if(c){t=n;break}a=a.parent}r[e]=t}return q(t)&&(t=t.call(this.view)),t};function g(){this.templateCache={_cache:{},set:function(e,r){this._cache[e]=r},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}g.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};g.prototype.parse=function(e,r){var t=this.templateCache,a=e+":"+(r||k.tags).join(":"),n=typeof t<"u",o=n?t.get(a):void 0;return o==null&&(o=Ae(e,r),n&&t.set(a,o)),o};g.prototype.render=function(e,r,t,a){var n=this.getConfigTags(a),o=this.parse(e,n),u=r instanceof P?r:new P(r,void 0);return this.renderTokens(o,u,t,e,a)};g.prototype.renderTokens=function(e,r,t,a,n){for(var o="",u,c,p,d=0,y=e.length;d<y;++d)p=void 0,u=e[d],c=u[0],c==="#"?p=this.renderSection(u,r,t,a,n):c==="^"?p=this.renderInverted(u,r,t,a,n):c===">"?p=this.renderPartial(u,r,t,n):c==="&"?p=this.unescapedValue(u,r):c==="name"?p=this.escapedValue(u,r,n):c==="text"&&(p=this.rawValue(u)),p!==void 0&&(o+=p);return o};g.prototype.renderSection=function(e,r,t,a,n){var o=this,u="",c=r.lookup(e[1]);function p(x){return o.render(x,r,t,n)}if(c){if(b(c))for(var d=0,y=c.length;d<y;++d)u+=this.renderTokens(e[4],r.push(c[d]),t,a,n);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")u+=this.renderTokens(e[4],r.push(c),t,a,n);else if(q(c)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(r.view,a.slice(e[3],e[5]),p),c!=null&&(u+=c)}else u+=this.renderTokens(e[4],r,t,a,n);return u}};g.prototype.renderInverted=function(e,r,t,a,n){var o=r.lookup(e[1]);if(!o||b(o)&&o.length===0)return this.renderTokens(e[4],r,t,a,n)};g.prototype.indentPartial=function(e,r,t){for(var a=r.replace(/[^ \t]/g,""),n=e.split(`
3
3
  `),o=0;o<n.length;o++)n[o].length&&(o>0||!t)&&(n[o]=a+n[o]);return n.join(`
4
4
  `)};g.prototype.renderPartial=function(e,r,t,a){if(t){var n=this.getConfigTags(a),o=q(t)?t(e[1]):t[e[1]];if(o!=null){var u=e[6],c=e[5],p=e[4],d=o;c==0&&p&&(d=this.indentPartial(o,p,u));var y=this.parse(d,n);return this.renderTokens(y,r,t,d,a)}}};g.prototype.unescapedValue=function(e,r){var t=r.lookup(e[1]);if(t!=null)return t};g.prototype.escapedValue=function(e,r,t){var a=this.getConfigEscape(t)||k.escape,n=r.lookup(e[1]);if(n!=null)return typeof n=="number"&&a===k.escape?String(n):a(n)};g.prototype.rawValue=function(e){return e[1]};g.prototype.getConfigTags=function(e){return b(e)?e:e&&typeof e=="object"?e.tags:void 0};g.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!b(e))return e.escape};var k={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(s){T.templateCache=s},get templateCache(){return T.templateCache}},T=new g;k.clearCache=function(){return T.clearCache()};k.parse=function(e,r){return T.parse(e,r)};k.render=function(e,r,t,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+De(e)+'" was given as the first argument for mustache#render(template, view, partials)');return T.render(e,r,t,a)};k.escape=Je;k.Scanner=R;k.Context=P;k.Writer=g;export{Ce as P,Me as S,k as m,Ie as u};
@@ -1 +1 @@
1
- import{b as S,r as U,j as p,B as ee,t as E,c as N,x as te,v as ne,D as se}from"./index-XdUWZF5g.js";import{B as z}from"./badge-fJOJmdQG.js";import{ae as b,aj as H,ai as L,am as ae,g as le}from"./blocks-tab-states-BLBUtwwS.js";import{v as oe,C as re,k as ie}from"./hosted-reconcile-BdwyWhOE.js";import{s as ce}from"./Trash01-DQCE9WJt.js";import{a5 as q,aU as de,aV as B,u as G,l as J,a1 as Q,ax as W}from"./site-editor-toast-CluWI-yZ.js";import{u as ue}from"./use-apply-named-rule-QQXumPyC.js";function fe(n,e,t,s){const a=b(n,e);return a.kind==="conflict"?null:{writes:{[H(e).blockKey]:L(a.block,e,t,s)}}}function me(n,e,t,s){const a=b(n,e);if(a.kind==="conflict")return{problem:"conflict"};const r=oe(t,Object.keys(a.values));return r?{problem:r}:{change:fe(n,e,t.trim(),s)}}function he(n,e,t){const s=b(n,e);return s.kind!=="saved"||!Object.hasOwn(s.block,t)?null:{writes:{[H(e).blockKey]:ae(s.block,t)}}}function ge(n,e,t,s){if(s===void 0)return null;const a=b(n,e);return a.kind==="conflict"||Object.hasOwn(a.block,t)?null:{writes:{[H(e).blockKey]:L(a.block,e,t,s)}}}function Me(n,e,t,s){if(!n)return null;const a=b(n,e);return a.kind!=="saved"||!Object.hasOwn(a.values,t)?"new":pe(a.values[t],s)?"published":"changed"}function Ie(n,e,t){if(!n)return;const s=b(n,e);if(s.kind==="saved")return s.values[t]}function Ke(n,e,t){if(!e)return[];const s=b(e,t);if(s.kind!=="saved")return[];const a=b(n,t),r=a.kind==="conflict"?{}:a.values;return Object.keys(s.values).filter(o=>!Object.hasOwn(r,o))}function pe(n,e){return typeof n=="number"||typeof e=="number"?n===e:F(n.start,e.start)&&F(n.end,e.end)}function F(n,e){return n===void 0||e===void 0?n===e:n===e||new Date(n).getTime()===new Date(e).getTime()}function ve({kind:n,name:e,pending:t,apply:s,reread:a,onDeleted:r,onUndo:o}){const l=S(),i=n==="experiments",[c,f]=U.useState(!1),u=async()=>{const m=await a();return m||E.info(l("sectionsEditor.namedRules.unavailable"),{...B,description:l("sectionsEditor.namedRules.unavailableHint")}),m},h=async m=>{const g=await u();if(!g)return;const x=ge(g,n,e,m);if(x){o(x);return}const w=b(g,n).kind==="conflict";E.info(l(w?"sectionsEditor.namedRules.changedMeanwhile":"sectionsEditor.namedRules.alreadyBack"),{...B,description:l(w?"sectionsEditor.namedRules.changedMeanwhileHint":"sectionsEditor.namedRules.alreadyBackHint")})},d=async()=>{f(!0);let m;try{m=await u()}finally{f(!1)}if(!m)return;const g=he(m,n,e);if(!g)return;const x=b(m,n),w=x.kind==="saved"?x.block[e]:void 0,k=await s(g);if(k.ok){if(k.keptTheirs){q(l,!1);return}r(),E.success(i?l("experiments.v8.deleted",{name:e}):l("sandbox.dateCampaigns.deleted",{name:e}),{id:de,description:l(i?"experiments.v8.deletedHint":"sandbox.dateCampaigns.deletedHint"),action:{label:l("sectionsEditor.namedRules.undo"),onClick:()=>{h(w)}}})}};return p.jsxs(ee,{type:"button",variant:"ghost",size:"sm",disabled:t||c,onClick:()=>{d()},children:[p.jsx(ce,{size:16}),l(i?"experiments.v8.delete":"sandbox.dateCampaigns.delete")]})}function be(n,e){const t={...n};for(const[s,a]of Object.entries(e))a.kind!==null&&(a.before!==null?t[s]=a.before:a.baseVersion===null&&delete t[s]);return t}function xe(n){const e=N.c(7);let t;e[0]!==n.branch||e[1]!==n.orgSlug||e[2]!==n.virtualMcpId?(t={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[0]=n.branch,e[1]=n.orgSlug,e[2]=n.virtualMcpId,e[3]=t):t=e[3];const s=t,a=G(n.virtualMcpId,n.branch),r=J(s),o=Q(a,r||null),l=W(a,r||null,o.data);if(!n.decofile||!o.data)return null;if(Object.keys(o.data.changes).length===0)return n.decofile;let i;return e[4]!==n.decofile||e[5]!==l.data?(i=l.data?.entries?be(n.decofile,l.data.entries):null,e[4]=n.decofile,e[5]=l.data,e[6]=i):i=e[6],i}function ye(n,e,t,s){if(!Object.hasOwn(e,s))return n;const a=t&&Object.hasOwn(t,s)?t[s]:null;if(!a)return"unknown";if(a.kind===null)return n;if(a.before!==null)return{...n,[s]:a.before};if(a.baseVersion!==null)return"unknown";const r={...n};return delete r[s],r}function we(n){const e=N.c(16);let t;e[0]!==n.branch||e[1]!==n.orgSlug||e[2]!==n.virtualMcpId?(t={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[0]=n.branch,e[1]=n.orgSlug,e[2]=n.virtualMcpId,e[3]=t):t=e[3];const s=t,a=G(n.virtualMcpId,n.branch),r=J(s),o=Q(a,r||null),l=W(a,r||null,o.data);if(!o.data){let d;return e[4]!==o?(d=o.isError?{state:"failed",retry:()=>{o.refetch()}}:{state:"loading"},e[4]=o,e[5]=d):d=e[5],d}if(!n.decofile){let d;return e[6]===Symbol.for("react.memo_cache_sentinel")?(d={state:"loading"},e[6]=d):d=e[6],d}if(Object.hasOwn(o.data.changes,n.blockKey)&&!l.data){let d;return e[7]!==l?(d=l.isError?{state:"failed",retry:()=>{l.refetch()}}:{state:"loading"},e[7]=l,e[8]=d):d=e[8],d}const c=l.data?.entries;let f;e[9]!==o.data.changes||e[10]!==n.blockKey||e[11]!==n.decofile||e[12]!==c?(f=ye(n.decofile,o.data.changes,c,n.blockKey),e[9]=o.data.changes,e[10]=n.blockKey,e[11]=n.decofile,e[12]=c,e[13]=f):f=e[13];const u=f;let h;return e[14]!==u?(h=u==="unknown"?{state:"unknown"}:{state:"ready",content:u},e[14]=u,e[15]=h):h=e[15],h}function _(n,e){return e==="experiments"?{new:n("experiments.v8.new"),stateNew:n("experiments.v8.state.new"),stateChanged:n("experiments.v8.state.changed"),removedTitle:n("experiments.v8.removedTitle"),removedHint:n("experiments.v8.removedHint"),created:t=>n("sectionsEditor.namedRulePicker.createdTest",{name:t})}:{new:n("sandbox.dateCampaigns.new"),stateNew:n("sandbox.dateCampaigns.state.new"),stateChanged:n("sandbox.dateCampaigns.state.changed"),removedTitle:n("sandbox.dateCampaigns.removedTitle"),removedHint:n("sandbox.dateCampaigns.removedHint"),created:t=>n("sectionsEditor.namedRulePicker.createdCampaign",{name:t})}}function Ne(n,e,t){const s=le(e,t);return s!=="available"?s:b(n,t).kind==="conflict"?"conflict":null}function Be(n,e){const t=N.c(46),s=S(),{orgSlug:a,virtualMcpId:r,branch:o,decofile:l,meta:i}=e;let c;t[0]!==o||t[1]!==l||t[2]!==a||t[3]!==r?(c={orgSlug:a,virtualMcpId:r,branch:o,decofile:l},t[0]=o,t[1]=l,t[2]=a,t[3]=r,t[4]=c):c=t[4];const f=xe(c);let u;t[5]!==n?(u=H(n),t[5]=n,t[6]=u):u=t[6];let h;t[7]!==o||t[8]!==l||t[9]!==a||t[10]!==u.blockKey||t[11]!==r?(h={orgSlug:a,virtualMcpId:r,branch:o,decofile:l,blockKey:u.blockKey},t[7]=o,t[8]=l,t[9]=a,t[10]=u.blockKey,t[11]=r,t[12]=h):h=t[12];const d=we(h);let m;t[13]!==o||t[14]!==a||t[15]!==r?(m={orgSlug:a,virtualMcpId:r,branch:o},t[13]=o,t[14]=a,t[15]=r,t[16]=m):m=t[16];const{apply:g,reread:x,isPending:w,holdsCopy:k}=ue(m),[X,Y]=U.useState(null),P=e.open?e.open.name:X,C=e.open?e.open.set:Y,[V,A]=U.useState(!1);let T;t[17]!==g||t[18]!==s?(T=async(v,K)=>{const D=K===void 0?s("sectionsEditor.namedRules.saved"):K;if(!v)return!1;const R=await g(v);return R.ok&&R.keptTheirs?q(s,!1):R.ok&&E.success(D,{...B,description:s("sectionsEditor.namedRules.savedHint")}),R.ok},t[17]=g,t[18]=s,t[19]=T):T=t[19];const y=T;let M;t[20]!==l||t[21]!==n||t[22]!==y||t[23]!==C||t[24]!==s?(M=v=>{if(v.kind!==n||!v.create)return;const K=v.kind==="experiments"?v.create.share:v.create.window,D=me(l,n,v.name,K);if(!("change"in D)){E.info(D.problem==="conflict"?s("sectionsEditor.namedRules.changedMeanwhile"):re(s,D.problem),B);return}const R=v.name.trim();y(D.change,_(s,n).created(R)).then(Z=>{Z&&(A(!1),C(R))})},t[20]=l,t[21]=n,t[22]=y,t[23]=C,t[24]=s,t[25]=M):M=t[25];const $=M;let j;t[26]!==l||t[27]!==n||t[28]!==i?(j=Ne(l,i,n),t[26]=l,t[27]=n,t[28]=i,t[29]=j):j=t[29];let O;t[30]!==y?(O=v=>{y(v)},t[30]=y,t[31]=O):O=t[31];let I;return t[32]!==g||t[33]!==$||t[34]!==V||t[35]!==k||t[36]!==w||t[37]!==d||t[38]!==P||t[39]!==f||t[40]!==x||t[41]!==y||t[42]!==C||t[43]!==j||t[44]!==O?(I={published:f,live:d,apply:g,reread:x,isPending:w,holdsCopy:k,openName:P,setOpenName:C,creating:V,setCreating:A,blocked:j,save:y,create:$,undo:O},t[32]=g,t[33]=$,t[34]=V,t[35]=k,t[36]=w,t[37]=d,t[38]=P,t[39]=f,t[40]=x,t[41]=y,t[42]=C,t[43]=j,t[44]=O,t[45]=I):I=t[45],I}function He(n){const e=N.c(23),{kind:t,open:s,onOpenChange:a,existingNames:r,pending:o,onCreate:l}=n,i=S();let c;e[0]!==t||e[1]!==i?(c=_(i,t),e[0]=t,e[1]=i,e[2]=c):c=e[2];let f;e[3]!==c.new?(f=p.jsx(te,{className:"sr-only",children:c.new}),e[3]=c.new,e[4]=f):f=e[4];let u;e[5]!==i?(u=i("sectionsEditor.namedRules.create"),e[5]=i,e[6]=u):u=e[6];let h;e[7]!==a?(h=()=>a(!1),e[7]=a,e[8]=h):h=e[8];let d;e[9]!==r||e[10]!==t||e[11]!==l||e[12]!==o||e[13]!==u||e[14]!==h?(d=p.jsx(ie,{kind:t,initialName:"",existingNames:r,pending:o,submitLabel:u,dismiss:"cancel",standalone:!0,onBack:h,onSubmit:l}),e[9]=r,e[10]=t,e[11]=l,e[12]=o,e[13]=u,e[14]=h,e[15]=d):d=e[15];let m;e[16]!==f||e[17]!==d?(m=p.jsxs(ne,{className:"p-0 sm:max-w-md",children:[f,d]}),e[16]=f,e[17]=d,e[18]=m):m=e[18];let g;return e[19]!==a||e[20]!==s||e[21]!==m?(g=p.jsx(se,{open:s,onOpenChange:a,children:m}),e[19]=a,e[20]=s,e[21]=m,e[22]=g):g=e[22],g}function _e(n){const e=N.c(15),{kind:t,removed:s}=n,a=S();let r;e[0]!==t||e[1]!==a?(r=_(a,t),e[0]=t,e[1]=a,e[2]=r):r=e[2];const o=r;if(s.length===0)return null;let l;e[3]!==o.removedTitle?(l=p.jsx("h3",{className:"text-sm font-medium",children:o.removedTitle}),e[3]=o.removedTitle,e[4]=l):l=e[4];let i;e[5]!==o.removedHint?(i=p.jsx("p",{className:"text-xs text-muted-foreground",children:o.removedHint}),e[5]=o.removedHint,e[6]=i):i=e[6];let c;e[7]!==s?(c=s.map(Re),e[7]=s,e[8]=c):c=e[8];let f;e[9]!==c?(f=p.jsx("ul",{className:"text-sm text-muted-foreground",children:c}),e[9]=c,e[10]=f):f=e[10];let u;return e[11]!==l||e[12]!==i||e[13]!==f?(u=p.jsxs("div",{className:"flex flex-col gap-1",children:[l,i,f]}),e[11]=l,e[12]=i,e[13]=f,e[14]=u):u=e[14],u}function Re(n){return p.jsx("li",{className:"line-through",children:n},n)}function ke(n){const e=N.c(7),{kind:t,state:s,changed:a}=n,r=a===void 0?!0:a,o=S();let l;e[0]!==t||e[1]!==o?(l=_(o,t),e[0]=t,e[1]=o,e[2]=l):l=e[2];const i=l;if(s==="new"){let c;return e[3]!==i.stateNew?(c=p.jsx(z,{variant:"muted",children:i.stateNew}),e[3]=i.stateNew,e[4]=c):c=e[4],c}if(s==="changed"&&r){let c;return e[5]!==i.stateChanged?(c=p.jsx(z,{variant:"muted",children:i.stateChanged}),e[5]=i.stateChanged,e[6]=c):c=e[6],c}return null}function Pe(n){const e=N.c(9),{kind:t,name:s,status:a,entryState:r}=n;let o;e[0]!==s?(o=p.jsx("h2",{className:"text-lg font-semibold",children:s}),e[0]=s,e[1]=o):o=e[1];let l;e[2]!==r||e[3]!==t?(l=p.jsx(ke,{kind:t,state:r,changed:!1}),e[2]=r,e[3]=t,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==o||e[7]!==l?(i=p.jsxs("div",{className:"flex items-center gap-3",children:[o,a,l]}),e[5]=a,e[6]=o,e[7]=l,e[8]=i):i=e[8],i}function Ve(n){const e=N.c(8),{kind:t,detail:s}=n;let a;return e[0]!==s.apply||e[1]!==s.onDeleted||e[2]!==s.onUndo||e[3]!==s.pending||e[4]!==s.reread||e[5]!==s.row.name||e[6]!==t?(a=p.jsx(ve,{kind:t,name:s.row.name,pending:s.pending,apply:s.apply,reread:s.reread,onDeleted:s.onDeleted,onUndo:s.onUndo}),e[0]=s.apply,e[1]=s.onDeleted,e[2]=s.onUndo,e[3]=s.pending,e[4]=s.reread,e[5]=s.row.name,e[6]=t,e[7]=a):a=e[7],a}function $e(n,e,t){return{row:e,decofile:t.decofile,meta:t.meta,pending:n.isPending,holdsCopy:n.holdsCopy,onBack:()=>n.setOpenName(null),onSave:n.save,apply:n.apply,reread:n.reread,onDeleted:()=>n.setOpenName(null),onUndo:n.undo}}export{ke as N,Ke as a,Ne as b,Be as c,$e as d,He as e,Pe as f,_e as g,fe as h,Ve as i,Me as n,Ie as p,we as u};
1
+ import{b as S,r as U,j as p,B as ee,t as E,c as N,x as te,v as ne,D as se}from"./index-DWzXxNX7.js";import{B as z}from"./badge-B3JA5w4M.js";import{ae as b,aj as H,ai as L,am as ae,g as le}from"./blocks-tab-states-XQX-SOYK.js";import{v as oe,C as re,k as ie}from"./hosted-reconcile-oZ2zb0h4.js";import{s as ce}from"./Trash01-CC6cJr6C.js";import{a5 as q,aU as de,aV as B,u as G,l as J,a1 as Q,ax as W}from"./site-editor-toast-D-duKOmm.js";import{u as ue}from"./use-apply-named-rule-DM9ntGDg.js";function fe(n,e,t,s){const a=b(n,e);return a.kind==="conflict"?null:{writes:{[H(e).blockKey]:L(a.block,e,t,s)}}}function me(n,e,t,s){const a=b(n,e);if(a.kind==="conflict")return{problem:"conflict"};const r=oe(t,Object.keys(a.values));return r?{problem:r}:{change:fe(n,e,t.trim(),s)}}function he(n,e,t){const s=b(n,e);return s.kind!=="saved"||!Object.hasOwn(s.block,t)?null:{writes:{[H(e).blockKey]:ae(s.block,t)}}}function ge(n,e,t,s){if(s===void 0)return null;const a=b(n,e);return a.kind==="conflict"||Object.hasOwn(a.block,t)?null:{writes:{[H(e).blockKey]:L(a.block,e,t,s)}}}function Me(n,e,t,s){if(!n)return null;const a=b(n,e);return a.kind!=="saved"||!Object.hasOwn(a.values,t)?"new":pe(a.values[t],s)?"published":"changed"}function Ie(n,e,t){if(!n)return;const s=b(n,e);if(s.kind==="saved")return s.values[t]}function Ke(n,e,t){if(!e)return[];const s=b(e,t);if(s.kind!=="saved")return[];const a=b(n,t),r=a.kind==="conflict"?{}:a.values;return Object.keys(s.values).filter(o=>!Object.hasOwn(r,o))}function pe(n,e){return typeof n=="number"||typeof e=="number"?n===e:F(n.start,e.start)&&F(n.end,e.end)}function F(n,e){return n===void 0||e===void 0?n===e:n===e||new Date(n).getTime()===new Date(e).getTime()}function ve({kind:n,name:e,pending:t,apply:s,reread:a,onDeleted:r,onUndo:o}){const l=S(),i=n==="experiments",[c,f]=U.useState(!1),u=async()=>{const m=await a();return m||E.info(l("sectionsEditor.namedRules.unavailable"),{...B,description:l("sectionsEditor.namedRules.unavailableHint")}),m},h=async m=>{const g=await u();if(!g)return;const x=ge(g,n,e,m);if(x){o(x);return}const w=b(g,n).kind==="conflict";E.info(l(w?"sectionsEditor.namedRules.changedMeanwhile":"sectionsEditor.namedRules.alreadyBack"),{...B,description:l(w?"sectionsEditor.namedRules.changedMeanwhileHint":"sectionsEditor.namedRules.alreadyBackHint")})},d=async()=>{f(!0);let m;try{m=await u()}finally{f(!1)}if(!m)return;const g=he(m,n,e);if(!g)return;const x=b(m,n),w=x.kind==="saved"?x.block[e]:void 0,k=await s(g);if(k.ok){if(k.keptTheirs){q(l,!1);return}r(),E.success(i?l("experiments.v8.deleted",{name:e}):l("sandbox.dateCampaigns.deleted",{name:e}),{id:de,description:l(i?"experiments.v8.deletedHint":"sandbox.dateCampaigns.deletedHint"),action:{label:l("sectionsEditor.namedRules.undo"),onClick:()=>{h(w)}}})}};return p.jsxs(ee,{type:"button",variant:"ghost",size:"sm",disabled:t||c,onClick:()=>{d()},children:[p.jsx(ce,{size:16}),l(i?"experiments.v8.delete":"sandbox.dateCampaigns.delete")]})}function be(n,e){const t={...n};for(const[s,a]of Object.entries(e))a.kind!==null&&(a.before!==null?t[s]=a.before:a.baseVersion===null&&delete t[s]);return t}function xe(n){const e=N.c(7);let t;e[0]!==n.branch||e[1]!==n.orgSlug||e[2]!==n.virtualMcpId?(t={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[0]=n.branch,e[1]=n.orgSlug,e[2]=n.virtualMcpId,e[3]=t):t=e[3];const s=t,a=G(n.virtualMcpId,n.branch),r=J(s),o=Q(a,r||null),l=W(a,r||null,o.data);if(!n.decofile||!o.data)return null;if(Object.keys(o.data.changes).length===0)return n.decofile;let i;return e[4]!==n.decofile||e[5]!==l.data?(i=l.data?.entries?be(n.decofile,l.data.entries):null,e[4]=n.decofile,e[5]=l.data,e[6]=i):i=e[6],i}function ye(n,e,t,s){if(!Object.hasOwn(e,s))return n;const a=t&&Object.hasOwn(t,s)?t[s]:null;if(!a)return"unknown";if(a.kind===null)return n;if(a.before!==null)return{...n,[s]:a.before};if(a.baseVersion!==null)return"unknown";const r={...n};return delete r[s],r}function we(n){const e=N.c(16);let t;e[0]!==n.branch||e[1]!==n.orgSlug||e[2]!==n.virtualMcpId?(t={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[0]=n.branch,e[1]=n.orgSlug,e[2]=n.virtualMcpId,e[3]=t):t=e[3];const s=t,a=G(n.virtualMcpId,n.branch),r=J(s),o=Q(a,r||null),l=W(a,r||null,o.data);if(!o.data){let d;return e[4]!==o?(d=o.isError?{state:"failed",retry:()=>{o.refetch()}}:{state:"loading"},e[4]=o,e[5]=d):d=e[5],d}if(!n.decofile){let d;return e[6]===Symbol.for("react.memo_cache_sentinel")?(d={state:"loading"},e[6]=d):d=e[6],d}if(Object.hasOwn(o.data.changes,n.blockKey)&&!l.data){let d;return e[7]!==l?(d=l.isError?{state:"failed",retry:()=>{l.refetch()}}:{state:"loading"},e[7]=l,e[8]=d):d=e[8],d}const c=l.data?.entries;let f;e[9]!==o.data.changes||e[10]!==n.blockKey||e[11]!==n.decofile||e[12]!==c?(f=ye(n.decofile,o.data.changes,c,n.blockKey),e[9]=o.data.changes,e[10]=n.blockKey,e[11]=n.decofile,e[12]=c,e[13]=f):f=e[13];const u=f;let h;return e[14]!==u?(h=u==="unknown"?{state:"unknown"}:{state:"ready",content:u},e[14]=u,e[15]=h):h=e[15],h}function _(n,e){return e==="experiments"?{new:n("experiments.v8.new"),stateNew:n("experiments.v8.state.new"),stateChanged:n("experiments.v8.state.changed"),removedTitle:n("experiments.v8.removedTitle"),removedHint:n("experiments.v8.removedHint"),created:t=>n("sectionsEditor.namedRulePicker.createdTest",{name:t})}:{new:n("sandbox.dateCampaigns.new"),stateNew:n("sandbox.dateCampaigns.state.new"),stateChanged:n("sandbox.dateCampaigns.state.changed"),removedTitle:n("sandbox.dateCampaigns.removedTitle"),removedHint:n("sandbox.dateCampaigns.removedHint"),created:t=>n("sectionsEditor.namedRulePicker.createdCampaign",{name:t})}}function Ne(n,e,t){const s=le(e,t);return s!=="available"?s:b(n,t).kind==="conflict"?"conflict":null}function Be(n,e){const t=N.c(46),s=S(),{orgSlug:a,virtualMcpId:r,branch:o,decofile:l,meta:i}=e;let c;t[0]!==o||t[1]!==l||t[2]!==a||t[3]!==r?(c={orgSlug:a,virtualMcpId:r,branch:o,decofile:l},t[0]=o,t[1]=l,t[2]=a,t[3]=r,t[4]=c):c=t[4];const f=xe(c);let u;t[5]!==n?(u=H(n),t[5]=n,t[6]=u):u=t[6];let h;t[7]!==o||t[8]!==l||t[9]!==a||t[10]!==u.blockKey||t[11]!==r?(h={orgSlug:a,virtualMcpId:r,branch:o,decofile:l,blockKey:u.blockKey},t[7]=o,t[8]=l,t[9]=a,t[10]=u.blockKey,t[11]=r,t[12]=h):h=t[12];const d=we(h);let m;t[13]!==o||t[14]!==a||t[15]!==r?(m={orgSlug:a,virtualMcpId:r,branch:o},t[13]=o,t[14]=a,t[15]=r,t[16]=m):m=t[16];const{apply:g,reread:x,isPending:w,holdsCopy:k}=ue(m),[X,Y]=U.useState(null),P=e.open?e.open.name:X,C=e.open?e.open.set:Y,[V,A]=U.useState(!1);let T;t[17]!==g||t[18]!==s?(T=async(v,K)=>{const D=K===void 0?s("sectionsEditor.namedRules.saved"):K;if(!v)return!1;const R=await g(v);return R.ok&&R.keptTheirs?q(s,!1):R.ok&&E.success(D,{...B,description:s("sectionsEditor.namedRules.savedHint")}),R.ok},t[17]=g,t[18]=s,t[19]=T):T=t[19];const y=T;let M;t[20]!==l||t[21]!==n||t[22]!==y||t[23]!==C||t[24]!==s?(M=v=>{if(v.kind!==n||!v.create)return;const K=v.kind==="experiments"?v.create.share:v.create.window,D=me(l,n,v.name,K);if(!("change"in D)){E.info(D.problem==="conflict"?s("sectionsEditor.namedRules.changedMeanwhile"):re(s,D.problem),B);return}const R=v.name.trim();y(D.change,_(s,n).created(R)).then(Z=>{Z&&(A(!1),C(R))})},t[20]=l,t[21]=n,t[22]=y,t[23]=C,t[24]=s,t[25]=M):M=t[25];const $=M;let j;t[26]!==l||t[27]!==n||t[28]!==i?(j=Ne(l,i,n),t[26]=l,t[27]=n,t[28]=i,t[29]=j):j=t[29];let O;t[30]!==y?(O=v=>{y(v)},t[30]=y,t[31]=O):O=t[31];let I;return t[32]!==g||t[33]!==$||t[34]!==V||t[35]!==k||t[36]!==w||t[37]!==d||t[38]!==P||t[39]!==f||t[40]!==x||t[41]!==y||t[42]!==C||t[43]!==j||t[44]!==O?(I={published:f,live:d,apply:g,reread:x,isPending:w,holdsCopy:k,openName:P,setOpenName:C,creating:V,setCreating:A,blocked:j,save:y,create:$,undo:O},t[32]=g,t[33]=$,t[34]=V,t[35]=k,t[36]=w,t[37]=d,t[38]=P,t[39]=f,t[40]=x,t[41]=y,t[42]=C,t[43]=j,t[44]=O,t[45]=I):I=t[45],I}function He(n){const e=N.c(23),{kind:t,open:s,onOpenChange:a,existingNames:r,pending:o,onCreate:l}=n,i=S();let c;e[0]!==t||e[1]!==i?(c=_(i,t),e[0]=t,e[1]=i,e[2]=c):c=e[2];let f;e[3]!==c.new?(f=p.jsx(te,{className:"sr-only",children:c.new}),e[3]=c.new,e[4]=f):f=e[4];let u;e[5]!==i?(u=i("sectionsEditor.namedRules.create"),e[5]=i,e[6]=u):u=e[6];let h;e[7]!==a?(h=()=>a(!1),e[7]=a,e[8]=h):h=e[8];let d;e[9]!==r||e[10]!==t||e[11]!==l||e[12]!==o||e[13]!==u||e[14]!==h?(d=p.jsx(ie,{kind:t,initialName:"",existingNames:r,pending:o,submitLabel:u,dismiss:"cancel",standalone:!0,onBack:h,onSubmit:l}),e[9]=r,e[10]=t,e[11]=l,e[12]=o,e[13]=u,e[14]=h,e[15]=d):d=e[15];let m;e[16]!==f||e[17]!==d?(m=p.jsxs(ne,{className:"p-0 sm:max-w-md",children:[f,d]}),e[16]=f,e[17]=d,e[18]=m):m=e[18];let g;return e[19]!==a||e[20]!==s||e[21]!==m?(g=p.jsx(se,{open:s,onOpenChange:a,children:m}),e[19]=a,e[20]=s,e[21]=m,e[22]=g):g=e[22],g}function _e(n){const e=N.c(15),{kind:t,removed:s}=n,a=S();let r;e[0]!==t||e[1]!==a?(r=_(a,t),e[0]=t,e[1]=a,e[2]=r):r=e[2];const o=r;if(s.length===0)return null;let l;e[3]!==o.removedTitle?(l=p.jsx("h3",{className:"text-sm font-medium",children:o.removedTitle}),e[3]=o.removedTitle,e[4]=l):l=e[4];let i;e[5]!==o.removedHint?(i=p.jsx("p",{className:"text-xs text-muted-foreground",children:o.removedHint}),e[5]=o.removedHint,e[6]=i):i=e[6];let c;e[7]!==s?(c=s.map(Re),e[7]=s,e[8]=c):c=e[8];let f;e[9]!==c?(f=p.jsx("ul",{className:"text-sm text-muted-foreground",children:c}),e[9]=c,e[10]=f):f=e[10];let u;return e[11]!==l||e[12]!==i||e[13]!==f?(u=p.jsxs("div",{className:"flex flex-col gap-1",children:[l,i,f]}),e[11]=l,e[12]=i,e[13]=f,e[14]=u):u=e[14],u}function Re(n){return p.jsx("li",{className:"line-through",children:n},n)}function ke(n){const e=N.c(7),{kind:t,state:s,changed:a}=n,r=a===void 0?!0:a,o=S();let l;e[0]!==t||e[1]!==o?(l=_(o,t),e[0]=t,e[1]=o,e[2]=l):l=e[2];const i=l;if(s==="new"){let c;return e[3]!==i.stateNew?(c=p.jsx(z,{variant:"muted",children:i.stateNew}),e[3]=i.stateNew,e[4]=c):c=e[4],c}if(s==="changed"&&r){let c;return e[5]!==i.stateChanged?(c=p.jsx(z,{variant:"muted",children:i.stateChanged}),e[5]=i.stateChanged,e[6]=c):c=e[6],c}return null}function Pe(n){const e=N.c(9),{kind:t,name:s,status:a,entryState:r}=n;let o;e[0]!==s?(o=p.jsx("h2",{className:"text-lg font-semibold",children:s}),e[0]=s,e[1]=o):o=e[1];let l;e[2]!==r||e[3]!==t?(l=p.jsx(ke,{kind:t,state:r,changed:!1}),e[2]=r,e[3]=t,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==o||e[7]!==l?(i=p.jsxs("div",{className:"flex items-center gap-3",children:[o,a,l]}),e[5]=a,e[6]=o,e[7]=l,e[8]=i):i=e[8],i}function Ve(n){const e=N.c(8),{kind:t,detail:s}=n;let a;return e[0]!==s.apply||e[1]!==s.onDeleted||e[2]!==s.onUndo||e[3]!==s.pending||e[4]!==s.reread||e[5]!==s.row.name||e[6]!==t?(a=p.jsx(ve,{kind:t,name:s.row.name,pending:s.pending,apply:s.apply,reread:s.reread,onDeleted:s.onDeleted,onUndo:s.onUndo}),e[0]=s.apply,e[1]=s.onDeleted,e[2]=s.onUndo,e[3]=s.pending,e[4]=s.reread,e[5]=s.row.name,e[6]=t,e[7]=a):a=e[7],a}function $e(n,e,t){return{row:e,decofile:t.decofile,meta:t.meta,pending:n.isPending,holdsCopy:n.holdsCopy,onBack:()=>n.setOpenName(null),onSave:n.save,apply:n.apply,reread:n.reread,onDeleted:()=>n.setOpenName(null),onUndo:n.undo}}export{ke as N,Ke as a,Ne as b,Be as c,$e as d,He as e,Pe as f,_e as g,fe as h,Ve as i,Me as n,Ie as p,we as u};
@@ -1 +1 @@
1
- import{c as g,b as D,a4 as z,q,T as U,df as Z,t as A,j as t,r as N,E as T,B as E,D as Q,v as G,w as W,x as J,aS as X,I as Y,m as ee}from"./index-XdUWZF5g.js";import{i as te}from"./ArrowLeft-sSY9Zm-O.js";import{s as oe}from"./Plus-BhSB1FAc.js";import{L as ne}from"./label-CUqIqnOS.js";import{u as re}from"./use-mcp-client-B9_8tfCL.js";import{u as L}from"./use-navigate-to-agent-ycEqYJX7.js";import{t as se,R as ce}from"./repository-picker-BKWo-jhF.js";import{S as ie}from"./thread-intent-DnduoWYb.js";import{c as ae}from"./repository-binding-Cfy_YQIZ.js";function le(i){const e=i.path.split("/"),s=e[e.length-1]??i.path;return{owner:e.slice(0,-1).join("/"),name:s,url:i.webUrl}}function pe(i,e,s){return{title:e.name,description:s.description,pinned:!1,icon:null,metadata:{repository:{owner:e.owner,name:e.name,url:e.url,repositoryId:i.id},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[]}}function de(i){const e=g.c(25),{open:s,onOpenChange:n,title:r,onImportComplete:o,mode:a}=i,l=a===void 0?"agent":a,c=D(),{org:p}=z(),u=q(),h=L();let f;e[0]!==p.id||e[1]!==p.slug?(f={connectionId:U,orgId:p.id,orgSlug:p.slug},e[0]=p.id,e[1]=p.slug,e[2]=f):f=e[2];const j=re(f);let x;e[3]!==l||e[4]!==c||e[5]!==r?(x=r??c(l==="link"?"common.repositoryPicker.addRepo":"common.repositoryPicker.importFromGitHub"),e[3]=l,e[4]=c,e[5]=r,e[6]=x):x=e[6];const y=x;let P;e[7]!==j||e[8]!==c?(P=async function(C,k){const{repository:v,createdFromTemplate:b}=C,B=b?c("common.createSite.agentDescription",{template:c(se(b))}):c("common.repositoryPicker.agentDescription",{path:v.path}),K=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:pe(v,k,{description:B})}}),V=(K.structuredContent??K).item?.id;if(!V)throw new Error(c("common.repositoryPicker.createAgentFailed"));return V},e[7]=j,e[8]=c,e[9]=P):P=e[9];const d=P;let _;e[10]!==d||e[11]!==l||e[12]!==h||e[13]!==o||e[14]!==n||e[15]!==p.id||e[16]!==u||e[17]!==c?(_=async function(C){const{repository:k}=C,v=le(k),b=l==="agent"?await d(C,v):null;Z(u,p.id),n(!1),o?o({virtualMcpId:b,repository:k}):b?(A.success(C.createdFromTemplate?c("common.createSite.created",{name:v.name}):c("common.repositoryPicker.importedRepo",{name:v.name})),h(b)):A.success(c("common.repositoryPicker.addedRepo",{name:v.name}))},e[10]=d,e[11]=l,e[12]=h,e[13]=o,e[14]=n,e[15]=p.id,e[16]=u,e[17]=c,e[18]=_):_=e[18];const w=_,R=l==="agent";let S;return e[19]!==w||e[20]!==n||e[21]!==s||e[22]!==y||e[23]!==R?(S=t.jsx(ce,{open:s,onOpenChange:n,title:y,onPicked:w,onError:ue,allowCreateSite:R}),e[19]=w,e[20]=n,e[21]=s,e[22]=y,e[23]=R,e[24]=S):S=e[24],S}function ue(i){return A.error(i)}const O={viewBox:"0 0 96 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},m={stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};function me(i){const e=g.c(9),{className:s}=i;let n,r,o,a,l,c,p;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{d:"M22 46V22",...m,opacity:.7}),r=t.jsx("circle",{cx:"22",cy:"18",r:"4",...m,opacity:.8}),o=t.jsx("circle",{cx:"22",cy:"50",r:"4",...m,opacity:.8}),a=t.jsx("path",{d:"M22 32h14a6 6 0 0 1 6 6v4",...m,opacity:.6}),l=t.jsx("circle",{cx:"42",cy:"46",r:"4",...m,opacity:.7}),c=t.jsx("path",{d:"M56 22h9l3 4h14a3 3 0 0 1 3 3v20a3 3 0 0 1-3 3H56a3 3 0 0 1-3-3V25a3 3 0 0 1 3-3Z",...m,opacity:.75}),p=t.jsx("path",{d:"M53 34h32",...m,opacity:.5}),e[0]=n,e[1]=r,e[2]=o,e[3]=a,e[4]=l,e[5]=c,e[6]=p):(n=e[0],r=e[1],o=e[2],a=e[3],l=e[4],c=e[5],p=e[6]);let u;return e[7]!==s?(u=t.jsxs("svg",{...O,className:s,children:[n,r,o,a,l,c,p]}),e[7]=s,e[8]=u):u=e[8],u}function he(i){const e=g.c(4),{className:s}=i;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{d:"M16 22a4 4 0 0 1 4-4h14l6 6h20a4 4 0 0 1 4 4v20a4 4 0 0 1-4 4H20a4 4 0 0 1-4-4V22Z",...m,opacity:.8}),r=t.jsx("path",{d:"M16 28h64",...m,opacity:.5}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let o;return e[2]!==s?(o=t.jsxs("svg",{...O,className:s,children:[n,r]}),e[2]=s,e[3]=o):o=e[3],o}function Ae(i){const e=g.c(5),{className:s}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:"46",y:"16",width:"128",height:"88",rx:"8",...m}),t.jsx("path",{d:"M46 34h128",...m,opacity:.6}),t.jsx("circle",{cx:"56",cy:"25",r:"2",fill:"currentColor",opacity:.6}),t.jsx("circle",{cx:"64",cy:"25",r:"2",fill:"currentColor",opacity:.45}),t.jsx("circle",{cx:"72",cy:"25",r:"2",fill:"currentColor",opacity:.3}),t.jsx("rect",{x:"58",y:"44",width:"104",height:"24",rx:"4",...m,opacity:.5}),t.jsx("rect",{x:"58",y:"76",width:"30",height:"16",rx:"3",...m,opacity:.4}),t.jsx("rect",{x:"95",y:"76",width:"30",height:"16",rx:"3",...m,opacity:.3}),t.jsx("rect",{x:"132",y:"76",width:"30",height:"16",rx:"3",...m,opacity:.22})]}),e[0]=n):n=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("g",{transform:"rotate(-8 44 92)",children:[t.jsx("rect",{x:"22",y:"52",width:"44",height:"76",rx:"8",...m,fill:"var(--color-background)"}),t.jsx("path",{d:"M37 60h14",...m,opacity:.5}),t.jsx("rect",{x:"29",y:"68",width:"30",height:"20",rx:"3",...m,opacity:.45}),t.jsx("path",{d:"M29 96h30M29 104h20",...m,opacity:.35}),t.jsx("rect",{x:"29",y:"112",width:"30",height:"8",rx:"4",...m,opacity:.5})]}),e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("g",{transform:"rotate(10 168 104)",children:[t.jsx("path",{d:"M150 92h30a6 6 0 0 1 6 6v26a6 6 0 0 1-6 6h-30a6 6 0 0 1-6-6V98a6 6 0 0 1 6-6Z",...m,fill:"var(--color-background)"}),t.jsx("circle",{cx:"165",cy:"104",r:"3.5",...m}),t.jsx("path",{d:"M152 116h26M152 124h16",...m,opacity:.45})]}),e[2]=o):o=e[2];let a;return e[3]!==s?(a=t.jsxs("svg",{viewBox:"0 0 220 140",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:s,children:[n,r,o]}),e[3]=s,e[4]=a):a=e[4],a}const M=new ie(!1);let $="unknown",I=null;function fe(i,e){$=i,I=e?.onCreated??null,T("project_create_clicked",{source:i}),M.set(!0)}function De(){const i=g.c(2),e=N.useSyncExternalStore(M.subscribe,M.get);let s;return i[0]!==e?(s=[e,M.set],i[0]=e,i[1]=s):s=i[1],s}function F(i){const e=I;I=null,e?.(i)}function Re(){return $}const xe={repository:{titleKey:"projects.new.path.repository",hintKey:"projects.new.path.repository.hint",art:me,plate:"bg-chart-5/10 group-hover:bg-chart-5/16",art_:"text-chart-5"},folder:{titleKey:"projects.new.path.folder",hintKey:"projects.new.path.folder.hint",art:he,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},je=["repository","folder"];function ye(i){const e=g.c(25),{path:s,onSelect:n}=i,r=D(),o=xe[s],a=o.art;let l;e[0]!==o.art_||e[1]!==o.plate?(l=ee("flex h-28 items-center justify-center rounded-lg transition-colors",o.plate,o.art_),e[0]=o.art_,e[1]=o.plate,e[2]=l):l=e[2];let c;e[3]!==a?(c=t.jsx(a,{className:"h-20"}),e[3]=a,e[4]=c):c=e[4];let p;e[5]!==l||e[6]!==c?(p=t.jsx("span",{className:l,children:c}),e[5]=l,e[6]=c,e[7]=p):p=e[7];let u;e[8]!==o.titleKey||e[9]!==r?(u=r(o.titleKey),e[8]=o.titleKey,e[9]=r,e[10]=u):u=e[10];let h;e[11]!==u?(h=t.jsx("span",{className:"text-sm font-medium text-foreground",children:u}),e[11]=u,e[12]=h):h=e[12];let f;e[13]!==o.hintKey||e[14]!==r?(f=r(o.hintKey),e[13]=o.hintKey,e[14]=r,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[16]=f,e[17]=j):j=e[17];let x;e[18]!==h||e[19]!==j?(x=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[h,j]}),e[18]=h,e[19]=j,e[20]=x):x=e[20];let y;return e[21]!==n||e[22]!==p||e[23]!==x?(y=t.jsxs("button",{type:"button",onClick:n,className:"group flex flex-col gap-3 surface p-3 text-left focus-ring transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent motion-reduce:transition-none motion-reduce:hover:translate-y-0",children:[p,x]}),e[21]=n,e[22]=p,e[23]=x,e[24]=y):y=e[24],y}function ge(i){const e=g.c(8),{label:s,children:n,hint:r}=i;let o;e[0]!==s?(o=t.jsx(ne,{children:s}),e[0]=s,e[1]=o):o=e[1];let a;e[2]!==r?(a=r&&t.jsx("p",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let l;return e[4]!==n||e[5]!==o||e[6]!==a?(l=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[o,n,a]}),e[4]=n,e[5]=o,e[6]=a,e[7]=l):l=e[7],l}function Te({open:i,onOpenChange:e,source:s="org_home"}){const n=D(),r=ae(),o=L(),[a,l]=N.useState(null),[c,p]=N.useState(""),[u,h]=N.useState(null),f=N.useRef(null),j=()=>{l(null),p(""),h(null)},x=()=>{e(!1),j()};if(a==="repository")return t.jsx(de,{open:!0,onOpenChange:d=>{d||x()},onImportComplete:({virtualMcpId:d})=>{d&&(F(d),o(d)),x()}});const y=async()=>{if(r.create.isPending)return;const d=c.trim();if(!d){h(n("projects.new.nameRequired"));return}try{const w=(await r.create.mutateAsync({title:d,description:null,status:"active",pinned:!1,connections:[],metadata:{instructions:null,project:{storeUrl:null},ui:{pinnedViews:null,layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}}}))?.id;T("project_created",{source:s,path:a}),x(),w&&(F(w),o(w)),A.success(n("projects.new.created",{title:d}))}catch{h(n("projects.new.failed"))}};return t.jsx(Q,{open:i,onOpenChange:d=>{d?e(!0):x()},children:t.jsxs(G,{className:"sm:max-w-3xl",ref:f,onOpenAutoFocus:d=>{d.preventDefault(),f.current?.focus()},children:[t.jsxs(W,{children:[t.jsx(J,{children:n("projects.new.title")}),t.jsx(X,{children:n(a?"projects.new.step.folder.title":"projects.new.subtitle")})]}),a===null?t.jsx("div",{className:"grid grid-cols-1 gap-3 animate-in fade-in-0 duration-200 sm:grid-cols-2 motion-reduce:animate-none",children:je.map(d=>t.jsx(ye,{path:d,onSelect:()=>{T("project_create_path_selected",{source:s,path:d}),l(d)}},d))}):t.jsxs("form",{className:"flex flex-col gap-4 animate-in fade-in-0 slide-in-from-right-2 duration-200 motion-reduce:animate-none",onSubmit:d=>{d.preventDefault(),h(null),y()},children:[t.jsx(ge,{label:n("projects.new.nameLabel"),children:t.jsx(Y,{autoFocus:!0,value:c,onChange:d=>p(d.target.value),placeholder:n("projects.new.namePlaceholder")})}),u&&t.jsx("p",{className:"text-sm text-destructive",children:u}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsxs(E,{type:"button",variant:"ghost",onClick:()=>j(),children:[t.jsx(te,{size:14}),n("projects.new.back")]}),t.jsx(E,{type:"submit",disabled:r.create.isPending,children:r.create.isPending?n("projects.new.creating"):n("projects.new.create")})]})]})]})})}function Ee(i){const e=g.c(11),{source:s,variant:n,size:r,label:o}=i,a=n===void 0?"default":n,l=r===void 0?"sm":r,c=D();let p;e[0]!==s?(p=()=>fe(s),e[0]=s,e[1]=p):p=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(oe,{size:14}),e[2]=u):u=e[2];let h;e[3]!==o||e[4]!==c?(h=o??c("projects.home.newProject"),e[3]=o,e[4]=c,e[5]=h):h=e[5];let f;return e[6]!==l||e[7]!==p||e[8]!==h||e[9]!==a?(f=t.jsxs(E,{size:l,variant:a,onClick:p,children:[u,h]}),e[6]=l,e[7]=p,e[8]=h,e[9]=a,e[10]=f):f=e[10],f}export{Ae as E,Ee as N,de as R,Te as a,Re as n,fe as o,De as u};
1
+ import{c as g,b as D,a4 as z,q,T as U,df as Z,t as A,j as t,r as N,E as T,B as E,D as Q,v as G,w as W,x as J,aS as X,I as Y,m as ee}from"./index-DWzXxNX7.js";import{i as te}from"./ArrowLeft-B14bIrz5.js";import{s as oe}from"./Plus-Bki9UHMX.js";import{L as ne}from"./label-CWhwsMTf.js";import{u as re}from"./use-mcp-client-C1kVArlZ.js";import{u as L}from"./use-navigate-to-agent-CtNID66l.js";import{t as se,R as ce}from"./repository-picker-CsVAueef.js";import{S as ie}from"./thread-intent-D3YJu4FC.js";import{c as ae}from"./repository-binding-iKwK7-Ti.js";function le(i){const e=i.path.split("/"),s=e[e.length-1]??i.path;return{owner:e.slice(0,-1).join("/"),name:s,url:i.webUrl}}function pe(i,e,s){return{title:e.name,description:s.description,pinned:!1,icon:null,metadata:{repository:{owner:e.owner,name:e.name,url:e.url,repositoryId:i.id},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[]}}function de(i){const e=g.c(25),{open:s,onOpenChange:n,title:r,onImportComplete:o,mode:a}=i,l=a===void 0?"agent":a,c=D(),{org:p}=z(),u=q(),h=L();let f;e[0]!==p.id||e[1]!==p.slug?(f={connectionId:U,orgId:p.id,orgSlug:p.slug},e[0]=p.id,e[1]=p.slug,e[2]=f):f=e[2];const j=re(f);let x;e[3]!==l||e[4]!==c||e[5]!==r?(x=r??c(l==="link"?"common.repositoryPicker.addRepo":"common.repositoryPicker.importFromGitHub"),e[3]=l,e[4]=c,e[5]=r,e[6]=x):x=e[6];const y=x;let P;e[7]!==j||e[8]!==c?(P=async function(C,k){const{repository:v,createdFromTemplate:b}=C,B=b?c("common.createSite.agentDescription",{template:c(se(b))}):c("common.repositoryPicker.agentDescription",{path:v.path}),K=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:pe(v,k,{description:B})}}),V=(K.structuredContent??K).item?.id;if(!V)throw new Error(c("common.repositoryPicker.createAgentFailed"));return V},e[7]=j,e[8]=c,e[9]=P):P=e[9];const d=P;let _;e[10]!==d||e[11]!==l||e[12]!==h||e[13]!==o||e[14]!==n||e[15]!==p.id||e[16]!==u||e[17]!==c?(_=async function(C){const{repository:k}=C,v=le(k),b=l==="agent"?await d(C,v):null;Z(u,p.id),n(!1),o?o({virtualMcpId:b,repository:k}):b?(A.success(C.createdFromTemplate?c("common.createSite.created",{name:v.name}):c("common.repositoryPicker.importedRepo",{name:v.name})),h(b)):A.success(c("common.repositoryPicker.addedRepo",{name:v.name}))},e[10]=d,e[11]=l,e[12]=h,e[13]=o,e[14]=n,e[15]=p.id,e[16]=u,e[17]=c,e[18]=_):_=e[18];const w=_,R=l==="agent";let S;return e[19]!==w||e[20]!==n||e[21]!==s||e[22]!==y||e[23]!==R?(S=t.jsx(ce,{open:s,onOpenChange:n,title:y,onPicked:w,onError:ue,allowCreateSite:R}),e[19]=w,e[20]=n,e[21]=s,e[22]=y,e[23]=R,e[24]=S):S=e[24],S}function ue(i){return A.error(i)}const O={viewBox:"0 0 96 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},m={stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};function me(i){const e=g.c(9),{className:s}=i;let n,r,o,a,l,c,p;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{d:"M22 46V22",...m,opacity:.7}),r=t.jsx("circle",{cx:"22",cy:"18",r:"4",...m,opacity:.8}),o=t.jsx("circle",{cx:"22",cy:"50",r:"4",...m,opacity:.8}),a=t.jsx("path",{d:"M22 32h14a6 6 0 0 1 6 6v4",...m,opacity:.6}),l=t.jsx("circle",{cx:"42",cy:"46",r:"4",...m,opacity:.7}),c=t.jsx("path",{d:"M56 22h9l3 4h14a3 3 0 0 1 3 3v20a3 3 0 0 1-3 3H56a3 3 0 0 1-3-3V25a3 3 0 0 1 3-3Z",...m,opacity:.75}),p=t.jsx("path",{d:"M53 34h32",...m,opacity:.5}),e[0]=n,e[1]=r,e[2]=o,e[3]=a,e[4]=l,e[5]=c,e[6]=p):(n=e[0],r=e[1],o=e[2],a=e[3],l=e[4],c=e[5],p=e[6]);let u;return e[7]!==s?(u=t.jsxs("svg",{...O,className:s,children:[n,r,o,a,l,c,p]}),e[7]=s,e[8]=u):u=e[8],u}function he(i){const e=g.c(4),{className:s}=i;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{d:"M16 22a4 4 0 0 1 4-4h14l6 6h20a4 4 0 0 1 4 4v20a4 4 0 0 1-4 4H20a4 4 0 0 1-4-4V22Z",...m,opacity:.8}),r=t.jsx("path",{d:"M16 28h64",...m,opacity:.5}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let o;return e[2]!==s?(o=t.jsxs("svg",{...O,className:s,children:[n,r]}),e[2]=s,e[3]=o):o=e[3],o}function Ae(i){const e=g.c(5),{className:s}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:"46",y:"16",width:"128",height:"88",rx:"8",...m}),t.jsx("path",{d:"M46 34h128",...m,opacity:.6}),t.jsx("circle",{cx:"56",cy:"25",r:"2",fill:"currentColor",opacity:.6}),t.jsx("circle",{cx:"64",cy:"25",r:"2",fill:"currentColor",opacity:.45}),t.jsx("circle",{cx:"72",cy:"25",r:"2",fill:"currentColor",opacity:.3}),t.jsx("rect",{x:"58",y:"44",width:"104",height:"24",rx:"4",...m,opacity:.5}),t.jsx("rect",{x:"58",y:"76",width:"30",height:"16",rx:"3",...m,opacity:.4}),t.jsx("rect",{x:"95",y:"76",width:"30",height:"16",rx:"3",...m,opacity:.3}),t.jsx("rect",{x:"132",y:"76",width:"30",height:"16",rx:"3",...m,opacity:.22})]}),e[0]=n):n=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("g",{transform:"rotate(-8 44 92)",children:[t.jsx("rect",{x:"22",y:"52",width:"44",height:"76",rx:"8",...m,fill:"var(--color-background)"}),t.jsx("path",{d:"M37 60h14",...m,opacity:.5}),t.jsx("rect",{x:"29",y:"68",width:"30",height:"20",rx:"3",...m,opacity:.45}),t.jsx("path",{d:"M29 96h30M29 104h20",...m,opacity:.35}),t.jsx("rect",{x:"29",y:"112",width:"30",height:"8",rx:"4",...m,opacity:.5})]}),e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("g",{transform:"rotate(10 168 104)",children:[t.jsx("path",{d:"M150 92h30a6 6 0 0 1 6 6v26a6 6 0 0 1-6 6h-30a6 6 0 0 1-6-6V98a6 6 0 0 1 6-6Z",...m,fill:"var(--color-background)"}),t.jsx("circle",{cx:"165",cy:"104",r:"3.5",...m}),t.jsx("path",{d:"M152 116h26M152 124h16",...m,opacity:.45})]}),e[2]=o):o=e[2];let a;return e[3]!==s?(a=t.jsxs("svg",{viewBox:"0 0 220 140",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:s,children:[n,r,o]}),e[3]=s,e[4]=a):a=e[4],a}const M=new ie(!1);let $="unknown",I=null;function fe(i,e){$=i,I=e?.onCreated??null,T("project_create_clicked",{source:i}),M.set(!0)}function De(){const i=g.c(2),e=N.useSyncExternalStore(M.subscribe,M.get);let s;return i[0]!==e?(s=[e,M.set],i[0]=e,i[1]=s):s=i[1],s}function F(i){const e=I;I=null,e?.(i)}function Re(){return $}const xe={repository:{titleKey:"projects.new.path.repository",hintKey:"projects.new.path.repository.hint",art:me,plate:"bg-chart-5/10 group-hover:bg-chart-5/16",art_:"text-chart-5"},folder:{titleKey:"projects.new.path.folder",hintKey:"projects.new.path.folder.hint",art:he,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},je=["repository","folder"];function ye(i){const e=g.c(25),{path:s,onSelect:n}=i,r=D(),o=xe[s],a=o.art;let l;e[0]!==o.art_||e[1]!==o.plate?(l=ee("flex h-28 items-center justify-center rounded-lg transition-colors",o.plate,o.art_),e[0]=o.art_,e[1]=o.plate,e[2]=l):l=e[2];let c;e[3]!==a?(c=t.jsx(a,{className:"h-20"}),e[3]=a,e[4]=c):c=e[4];let p;e[5]!==l||e[6]!==c?(p=t.jsx("span",{className:l,children:c}),e[5]=l,e[6]=c,e[7]=p):p=e[7];let u;e[8]!==o.titleKey||e[9]!==r?(u=r(o.titleKey),e[8]=o.titleKey,e[9]=r,e[10]=u):u=e[10];let h;e[11]!==u?(h=t.jsx("span",{className:"text-sm font-medium text-foreground",children:u}),e[11]=u,e[12]=h):h=e[12];let f;e[13]!==o.hintKey||e[14]!==r?(f=r(o.hintKey),e[13]=o.hintKey,e[14]=r,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[16]=f,e[17]=j):j=e[17];let x;e[18]!==h||e[19]!==j?(x=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[h,j]}),e[18]=h,e[19]=j,e[20]=x):x=e[20];let y;return e[21]!==n||e[22]!==p||e[23]!==x?(y=t.jsxs("button",{type:"button",onClick:n,className:"group flex flex-col gap-3 surface p-3 text-left focus-ring transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent motion-reduce:transition-none motion-reduce:hover:translate-y-0",children:[p,x]}),e[21]=n,e[22]=p,e[23]=x,e[24]=y):y=e[24],y}function ge(i){const e=g.c(8),{label:s,children:n,hint:r}=i;let o;e[0]!==s?(o=t.jsx(ne,{children:s}),e[0]=s,e[1]=o):o=e[1];let a;e[2]!==r?(a=r&&t.jsx("p",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let l;return e[4]!==n||e[5]!==o||e[6]!==a?(l=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[o,n,a]}),e[4]=n,e[5]=o,e[6]=a,e[7]=l):l=e[7],l}function Te({open:i,onOpenChange:e,source:s="org_home"}){const n=D(),r=ae(),o=L(),[a,l]=N.useState(null),[c,p]=N.useState(""),[u,h]=N.useState(null),f=N.useRef(null),j=()=>{l(null),p(""),h(null)},x=()=>{e(!1),j()};if(a==="repository")return t.jsx(de,{open:!0,onOpenChange:d=>{d||x()},onImportComplete:({virtualMcpId:d})=>{d&&(F(d),o(d)),x()}});const y=async()=>{if(r.create.isPending)return;const d=c.trim();if(!d){h(n("projects.new.nameRequired"));return}try{const w=(await r.create.mutateAsync({title:d,description:null,status:"active",pinned:!1,connections:[],metadata:{instructions:null,project:{storeUrl:null},ui:{pinnedViews:null,layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}}}))?.id;T("project_created",{source:s,path:a}),x(),w&&(F(w),o(w)),A.success(n("projects.new.created",{title:d}))}catch{h(n("projects.new.failed"))}};return t.jsx(Q,{open:i,onOpenChange:d=>{d?e(!0):x()},children:t.jsxs(G,{className:"sm:max-w-3xl",ref:f,onOpenAutoFocus:d=>{d.preventDefault(),f.current?.focus()},children:[t.jsxs(W,{children:[t.jsx(J,{children:n("projects.new.title")}),t.jsx(X,{children:n(a?"projects.new.step.folder.title":"projects.new.subtitle")})]}),a===null?t.jsx("div",{className:"grid grid-cols-1 gap-3 animate-in fade-in-0 duration-200 sm:grid-cols-2 motion-reduce:animate-none",children:je.map(d=>t.jsx(ye,{path:d,onSelect:()=>{T("project_create_path_selected",{source:s,path:d}),l(d)}},d))}):t.jsxs("form",{className:"flex flex-col gap-4 animate-in fade-in-0 slide-in-from-right-2 duration-200 motion-reduce:animate-none",onSubmit:d=>{d.preventDefault(),h(null),y()},children:[t.jsx(ge,{label:n("projects.new.nameLabel"),children:t.jsx(Y,{autoFocus:!0,value:c,onChange:d=>p(d.target.value),placeholder:n("projects.new.namePlaceholder")})}),u&&t.jsx("p",{className:"text-sm text-destructive",children:u}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsxs(E,{type:"button",variant:"ghost",onClick:()=>j(),children:[t.jsx(te,{size:14}),n("projects.new.back")]}),t.jsx(E,{type:"submit",disabled:r.create.isPending,children:r.create.isPending?n("projects.new.creating"):n("projects.new.create")})]})]})]})})}function Ee(i){const e=g.c(11),{source:s,variant:n,size:r,label:o}=i,a=n===void 0?"default":n,l=r===void 0?"sm":r,c=D();let p;e[0]!==s?(p=()=>fe(s),e[0]=s,e[1]=p):p=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(oe,{size:14}),e[2]=u):u=e[2];let h;e[3]!==o||e[4]!==c?(h=o??c("projects.home.newProject"),e[3]=o,e[4]=c,e[5]=h):h=e[5];let f;return e[6]!==l||e[7]!==p||e[8]!==h||e[9]!==a?(f=t.jsxs(E,{size:l,variant:a,onClick:p,children:[u,h]}),e[6]=l,e[7]=p,e[8]=h,e[9]=a,e[10]=f):f=e[10],f}export{Ae as E,Ee as N,de as R,Te as a,Re as n,fe as o,De as u};
@@ -1 +1 @@
1
- import{b as o,r as c,j as e,h as n}from"./index-XdUWZF5g.js";import{h as u}from"./mcp-oauth-L4CbK4hz.js";import"./auth-DeNsOsKX.js";function f(){const t=o(),[a,l]=c.useState(null),[r,i]=c.useState(!1);return c.useEffect(()=>{(async()=>{try{const s=await u();if(!s.success){l(s.error||t("routes.oauthCallback.authenticationFailed")),setTimeout(()=>{window.close()},3e3);return}i(!0),setTimeout(()=>{window.close()},1500)}catch(s){l(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!a&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{className:"size-8 text-primary"})}),a&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t(a?"routes.oauthCallback.authenticationFailedTitle":r?"routes.oauthCallback.authenticationSuccessfulTitle":"routes.oauthCallback.authenticationInProgressTitle")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:t("routes.oauthCallback.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:a}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]})]}):r?e.jsxs("p",{children:[t("routes.oauthCallback.authenticationComplete"),e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]}):e.jsx("p",{children:t("routes.oauthCallback.processingAuthentication")})})]})]})})}export{f as default};
1
+ import{b as o,r as c,j as e,h as n}from"./index-DWzXxNX7.js";import{h as u}from"./mcp-oauth-BGHnDVvZ.js";import"./auth-BR_-50-H.js";function f(){const t=o(),[a,l]=c.useState(null),[r,i]=c.useState(!1);return c.useEffect(()=>{(async()=>{try{const s=await u();if(!s.success){l(s.error||t("routes.oauthCallback.authenticationFailed")),setTimeout(()=>{window.close()},3e3);return}i(!0),setTimeout(()=>{window.close()},1500)}catch(s){l(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!a&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{className:"size-8 text-primary"})}),a&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t(a?"routes.oauthCallback.authenticationFailedTitle":r?"routes.oauthCallback.authenticationSuccessfulTitle":"routes.oauthCallback.authenticationInProgressTitle")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:t("routes.oauthCallback.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:a}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]})]}):r?e.jsxs("p",{children:[t("routes.oauthCallback.authenticationComplete"),e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]}):e.jsx("p",{children:t("routes.oauthCallback.processingAuthentication")})})]})]})})}export{f as default};
@@ -1 +1 @@
1
- import{b as d,r as a,j as e,h}from"./index-XdUWZF5g.js";function x(){const r=d(),[s,o]=a.useState("loading"),[l,u]=a.useState(null),c=a.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),i=t.get("code"),n=t.get("state");if(!i||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:i,stateToken:n},window.location.origin),o("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),u(t instanceof Error?t.message:String(t)),o("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(h,{className:"size-8 text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:r(s==="error"?"routes.oauthCallbackAiProvider.authFailed":s==="success"?"routes.oauthCallbackAiProvider.authSuccess":"routes.oauthCallbackAiProvider.authInProgress")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:r("routes.oauthCallbackAiProvider.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:l}),e.jsx("p",{className:"mt-2",children:r("routes.oauthCallbackAiProvider.windowCloseAuto")})]}):s==="success"?e.jsx("p",{children:r("routes.oauthCallbackAiProvider.authCompleteCloseAuto")}):e.jsx("p",{children:r("routes.oauthCallbackAiProvider.processingAuth")})})]})]})})}export{x as default};
1
+ import{b as d,r as a,j as e,h}from"./index-DWzXxNX7.js";function x(){const r=d(),[s,o]=a.useState("loading"),[l,u]=a.useState(null),c=a.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),i=t.get("code"),n=t.get("state");if(!i||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:i,stateToken:n},window.location.origin),o("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),u(t instanceof Error?t.message:String(t)),o("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(h,{className:"size-8 text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:r(s==="error"?"routes.oauthCallbackAiProvider.authFailed":s==="success"?"routes.oauthCallbackAiProvider.authSuccess":"routes.oauthCallbackAiProvider.authInProgress")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:r("routes.oauthCallbackAiProvider.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:l}),e.jsx("p",{className:"mt-2",children:r("routes.oauthCallbackAiProvider.windowCloseAuto")})]}):s==="success"?e.jsx("p",{children:r("routes.oauthCallbackAiProvider.authCompleteCloseAuto")}):e.jsx("p",{children:r("routes.oauthCallbackAiProvider.processingAuth")})})]})]})})}export{x as default};
@@ -1 +1 @@
1
- import{c as p,b as g,K as j,e as w,j as t,B as h,i as y}from"./index-XdUWZF5g.js";import{A as N}from"./auth-split-layout-CpPst90z.js";import{A as _}from"./auth-entry-BBIyDdU5.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";const f="/api/auth/custom/mcp-consent";function C(){const e=new URLSearchParams(window.location.search);return e.delete("prompt"),e}async function S(e){const n=new URLSearchParams({client_id:e.get("client_id")??"",redirect_uri:e.get("redirect_uri")??"",scope:e.get("scope")??""}),s=await fetch(`${f}?${n}`,{credentials:"include"});if(!s.ok)throw new Error(`consent request failed (${s.status})`);return await s.json()}function R(){const e=p.c(11),n=g();let s,i,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=C(),i=y,c={queryKey:j.mcpOAuthConsent(s.toString()),queryFn:()=>S(s),retry:!1},e[0]=s,e[1]=i,e[2]=c):(s=e[0],i=e[1],c=e[2]);const o=i(c);let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:async()=>{const a=await fetch(f,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:s.get("client_id"),scope:s.get("scope")??void 0})});if(!a.ok)throw new Error(`consent failed (${a.status})`)},onSuccess:()=>{window.location.href=`/api/auth/mcp/authorize?${s}`}},e[3]=l):l=e[3];const r=w(l);let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{const a=new URL(s.get("redirect_uri")??"/");a.searchParams.set("error","access_denied");const m=s.get("state");m&&a.searchParams.set("state",m),window.location.href=a.toString()},e[4]=d):d=e[4];const x=d;if(o.isPending){let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(_,{}),e[5]=a):a=e[5],a}let u;return e[6]!==r||e[7]!==o.data||e[8]!==o.isError||e[9]!==n?(u=t.jsx(N,{children:t.jsx("div",{className:"flex w-full max-w-sm flex-col gap-5",children:o.isError||r.isError||!o.data?t.jsx("p",{className:"text-sm text-muted-foreground",children:n("routes.oauthConsent.unavailable")}):t.jsxs(t.Fragment,{children:[t.jsx("h1",{className:"text-xl font-semibold",children:n("routes.oauthConsent.title")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:n("routes.oauthConsent.description",{client:o.data.clientName||n("routes.oauthConsent.unknownClient")})}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:n("routes.oauthConsent.redirectLabel")}),t.jsx("code",{className:"break-all text-sm font-medium",children:o.data.redirectTarget})]}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:n("routes.oauthConsent.scopesLabel")}),t.jsx("span",{className:"text-sm",children:o.data.scopes.join(", ")})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(h,{variant:"outline",className:"flex-1",onClick:x,disabled:r.isPending,children:n("routes.oauthConsent.deny")}),t.jsx(h,{className:"flex-1",onClick:()=>r.mutate(),disabled:r.isPending,children:n("routes.oauthConsent.allow")})]})]})})}),e[6]=r,e[7]=o.data,e[8]=o.isError,e[9]=n,e[10]=u):u=e[10],u}export{R as default};
1
+ import{c as p,b as g,K as j,e as w,j as t,B as h,i as y}from"./index-DWzXxNX7.js";import{A as N}from"./auth-split-layout-BIRuyBSf.js";import{A as _}from"./auth-entry-Bl1R5XwV.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";const f="/api/auth/custom/mcp-consent";function C(){const e=new URLSearchParams(window.location.search);return e.delete("prompt"),e}async function S(e){const n=new URLSearchParams({client_id:e.get("client_id")??"",redirect_uri:e.get("redirect_uri")??"",scope:e.get("scope")??""}),s=await fetch(`${f}?${n}`,{credentials:"include"});if(!s.ok)throw new Error(`consent request failed (${s.status})`);return await s.json()}function R(){const e=p.c(11),n=g();let s,i,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=C(),i=y,c={queryKey:j.mcpOAuthConsent(s.toString()),queryFn:()=>S(s),retry:!1},e[0]=s,e[1]=i,e[2]=c):(s=e[0],i=e[1],c=e[2]);const o=i(c);let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:async()=>{const a=await fetch(f,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:s.get("client_id"),scope:s.get("scope")??void 0})});if(!a.ok)throw new Error(`consent failed (${a.status})`)},onSuccess:()=>{window.location.href=`/api/auth/mcp/authorize?${s}`}},e[3]=l):l=e[3];const r=w(l);let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{const a=new URL(s.get("redirect_uri")??"/");a.searchParams.set("error","access_denied");const m=s.get("state");m&&a.searchParams.set("state",m),window.location.href=a.toString()},e[4]=d):d=e[4];const x=d;if(o.isPending){let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(_,{}),e[5]=a):a=e[5],a}let u;return e[6]!==r||e[7]!==o.data||e[8]!==o.isError||e[9]!==n?(u=t.jsx(N,{children:t.jsx("div",{className:"flex w-full max-w-sm flex-col gap-5",children:o.isError||r.isError||!o.data?t.jsx("p",{className:"text-sm text-muted-foreground",children:n("routes.oauthConsent.unavailable")}):t.jsxs(t.Fragment,{children:[t.jsx("h1",{className:"text-xl font-semibold",children:n("routes.oauthConsent.title")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:n("routes.oauthConsent.description",{client:o.data.clientName||n("routes.oauthConsent.unknownClient")})}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:n("routes.oauthConsent.redirectLabel")}),t.jsx("code",{className:"break-all text-sm font-medium",children:o.data.redirectTarget})]}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:n("routes.oauthConsent.scopesLabel")}),t.jsx("span",{className:"text-sm",children:o.data.scopes.join(", ")})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(h,{variant:"outline",className:"flex-1",onClick:x,disabled:r.isPending,children:n("routes.oauthConsent.deny")}),t.jsx(h,{className:"flex-1",onClick:()=>r.mutate(),disabled:r.isPending,children:n("routes.oauthConsent.allow")})]})]})})}),e[6]=r,e[7]=o.data,e[8]=o.isError,e[9]=n,e[10]=u):u=e[10],u}export{R as default};
@@ -1 +1 @@
1
- import{c as ie,j as t,a as ye,h as ce,b as de,i as Ce,K as Oe,r as P,B as Ne,e as pe,o as ve,C as ze,I as Le,m as ae,t as he}from"./index-XdUWZF5g.js";import{R as _e}from"./required-auth-layout-CRKzQVpv.js";import{A as oe}from"./auth-split-layout-CpPst90z.js";import{O as Ee}from"./organization-choice-1Lr2hM9B.js";import{L as Ae}from"./label-CUqIqnOS.js";import{S as De}from"./switch-CRe3xUPs.js";import{t as Pe,a as Re}from"./Globe04-1JEh9zst.js";import{i as Fe}from"./CheckCircle-BAqlx5xq.js";import{i as Me}from"./Upload01-C8pH3Rp-.js";import"./Plus-BhSB1FAc.js";const $e=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function xe(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function ot(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_e,{children:t.jsx(Te,{})}),i[0]=e):e=i[0],e}function fe(i){const e=ie.c(13),{title:b,description:m,logoUrl:n,logoFallback:o}=i;let a;e[0]!==o||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:o??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=o,e[1]=n,e[2]=a):a=e[2];let f;e[3]!==b?(f=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:b}),e[3]=b,e[4]=f):f=e[4];let l;e[5]!==m?(l=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=l):l=e[6];let s;e[7]!==f||e[8]!==l?(s=t.jsxs("div",{className:"space-y-2",children:[f,l]}),e[7]=f,e[8]=l,e[9]=s):s=e[9];let j;return e[10]!==a||e[11]!==s?(j=t.jsxs("div",{className:"grid gap-10",children:[a,s]}),e[10]=a,e[11]=s,e[12]=j):j=e[12],j}function Te(){const i=ie.c(4),{data:e,isPending:b}=ye.useSession();if(b){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(oe,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(ce,{className:"size-3.5 text-muted-foreground"})})}),i[0]=a):a=i[0],a}const m=e?.user?.email??"",n=e?.user?.name;let o;return i[1]!==n||i[2]!==m?(o=t.jsx(qe,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=o):o=i[3],o}function qe(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),o=b.split("@")[1]?.toLowerCase()??"",a=!!o&&!$e.has(o),f=o.split(".")[0]??"",l=f.charAt(0).toUpperCase()+f.slice(1);let s;e[0]!==l||e[1]!==a||e[2]!==m?(s=a?l:m?.split(" ")[0]??"",e[0]=l,e[1]=a,e[2]=m,e[3]=s):s=e[3];const j=s,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(o),queryFn:Be,enabled:a});let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=new Set,e[4]=g):g=e[4];const[_,M]=P.useState(g),[$,y]=P.useState(!1);if(v){let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=r):r=e[5],t.jsx(oe,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[r,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:o})})]})})}if(u){let r;e[6]!==w?(r=()=>w(),e[6]=w,e[7]=r):r=e[7];let d;e[8]!==n?(d=n("routes.onboarding.retry"),e[8]=n,e[9]=d):d=e[9];let h;return e[10]!==r||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:d}),e[10]=r,e[11]=d,e[12]=h):h=e[12],t.jsx(oe,{children:t.jsxs("div",{className:"flex flex-col items-start gap-3 py-4",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checkFailed",{domain:o})}),h]})})}let N,A;e[13]!==c?.organizations?(N=(c?.organizations??[]).flatMap(Ke),A=N.some(Ie),e[13]=c?.organizations,e[14]=N,e[15]=A):(N=e[14],A=e[15]);const p=A;if($){let r;e[16]!==m?(r=m?.split(" ")[0]??"",e[16]=m,e[17]=r):r=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==l||e[21]!==o||e[22]!==a||e[23]!==r||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:r,allowDomainClaim:!1,onBack:d}),e[20]=l,e[21]=o,e[22]=a,e[23]=r,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let r;e[26]!==p||e[27]!==N.length||e[28]!==n?(r=p?N.length===1?n("routes.onboarding.accessSingle"):n("routes.onboarding.accessMultiple"):n("routes.onboarding.requestAccess"),e[26]=p,e[27]=N.length,e[28]=n,e[29]=r):r=e[29];let d;e[30]!==p||e[31]!==n?(d=n(p?"routes.onboarding.emailMatchesOrg":"routes.onboarding.emailMatchesOrgApproval"),e[30]=p,e[31]=n,e[32]=d):d=e[32];let h;e[33]!==r||e[34]!==d?(h=t.jsx(fe,{title:r,description:d}),e[33]=r,e[34]=d,e[35]=h):h=e[35];let O;e[36]!==M?(O=R=>M(F=>new Set(F).add(R)),e[36]=M,e[37]=O):O=e[37];let C;e[38]!==N||e[39]!==o||e[40]!==_||e[41]!==O?(C=t.jsx(Ee,{organizations:N,domain:o,requestedSlugs:_,onRequestedSlug:O,onJoined:Ue}),e[38]=N,e[39]=o,e[40]=_,e[41]=O,e[42]=C):C=e[42];let z;e[43]!==y?(z=()=>y(!0),e[43]=y,e[44]=z):z=e[44];let E;e[45]!==n?(E=n("routes.onboarding.createNewOrg"),e[45]=n,e[46]=E):E=e[46];let k;e[47]!==E||e[48]!==z?(k=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:z,children:E}),e[47]=E,e[48]=z,e[49]=k):k=e[49];let L;return e[50]!==k||e[51]!==h||e[52]!==C?(L=t.jsx(oe,{children:t.jsxs("div",{className:"grid gap-10",children:[h,C,k]})}),e[50]=k,e[51]=h,e[52]=C,e[53]=L):L=e[53],L}let D;return e[54]!==j||e[55]!==l||e[56]!==o||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:j}),e[54]=j,e[55]=l,e[56]=o,e[57]=a,e[58]=D):D=e[58],D}function Ue(i,e){window.location.href=`/${e}`}function Ie(i){return i.joinMode==="auto"}function Ke(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Be(){const i=await fetch("/api/auth/custom/domain-lookup",{credentials:"include"});if(!i.ok)throw new Error(`Failed to look up domain (${i.status})`);return i.json()}function be(i){const e=ie.c(103),{isCorporateEmail:b,emailDomain:m,domainLabel:n,defaultName:o,allowDomainClaim:a,onBack:f}=i,l=a===void 0?!0:a,s=de(),j=b&&l?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(o),[u,w]=P.useState(j),[g,_]=P.useState(!0),[M,$]=P.useState(null);let y;e[0]!==g||e[1]!==u||e[2]!==c?(y=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.trim()||void 0,logo:u??void 0,claimDomain:g})}),S=await x.json();if(!x.ok||!S.success)throw new Error(S.error||"Failed to set up organization");return S},e[0]=g,e[1]=u,e[2]=c,e[3]=y):y=e[3];let N;e[4]!==g?(N=x=>{if(!x.slug)return;const S=we.filter(ke=>g||!ke.claimOnly).length,ne=Se*(S-1)+800;$(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},ne)},e[4]=g,e[5]=N):N=e[5];let A;e[6]!==y||e[7]!==N?(A={mutationFn:y,onSuccess:N},e[6]=y,e[7]=N,e[8]=A):A=e[8];const p=pe(A);let D;e[9]!==u||e[10]!==c?(D={mutationFn:async()=>{const x=c.trim(),S=xe(x);if(!S)throw new Error("Invalid organization name");const ne=await ye.organization.create({name:x,slug:S,...u?{logo:u}:{}});if(ne?.error)throw new Error(ne.error.message||"Failed to create organization");window.location.href=`/${ne?.data?.slug??S}`}},e[9]=u,e[10]=c,e[11]=D):D=e[11];const r=pe(D);if(p.isPending||M){let x;e[12]!==n||e[13]!==c?(x=c.trim()||n,e[12]=n,e[13]=c,e[14]=x):x=e[14];let S;return e[15]!==g||e[16]!==m||e[17]!==u||e[18]!==x?(S=t.jsx(oe,{children:t.jsx(Ge,{orgName:x,domain:m,claimDomain:g,logoUrl:u})}),e[15]=g,e[16]=m,e[17]=u,e[18]=x,e[19]=S):S=e[19],S}const d=r.isPending;let h;e[20]!==c?(h=xe(c.trim()),e[20]=c,e[21]=h):h=e[21];const O=!!h,C=p.error||r.error||null;let z;e[22]!==l||e[23]!==O||e[24]!==r||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&l?p.mutate():r.mutate())},e[22]=l,e[23]=O,e[24]=r,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==s?(k=s("routes.onboarding.welcomeTitle"),e[28]=s,e[29]=k):k=e[29];let L;e[30]!==s?(L=s("routes.onboarding.setupDescription"),e[30]=s,e[31]=L):L=e[31];let R;e[32]!==k||e[33]!==L?(R=t.jsx(fe,{title:k,description:L}),e[32]=k,e[33]=L,e[34]=R):R=e[34];let F;e[35]!==s?(F=s("routes.onboarding.orgAvatar"),e[35]=s,e[36]=F):F=e[36];let T;e[37]!==F?(T=t.jsx("p",{className:"text-sm font-medium",children:F}),e[37]=F,e[38]=T):T=e[38];let q;e[39]!==s?(q=s("routes.onboarding.optional"),e[39]=s,e[40]=q):q=e[40];let U;e[41]!==q?(U=t.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[41]=q,e[42]=U):U=e[42];let I;e[43]!==T||e[44]!==U?(I=t.jsxs("div",{className:"space-y-0.5",children:[T,U]}),e[43]=T,e[44]=U,e[45]=I):I=e[45];let K;e[46]!==o||e[47]!==c?(K=(c.trim()||o||"?").charAt(0).toUpperCase(),e[46]=o,e[47]=c,e[48]=K):K=e[48];const me=d||p.isPending;let B;e[49]!==u||e[50]!==K||e[51]!==me?(B=t.jsx(Je,{value:u,fallback:K,onChange:w,disabled:me}),e[49]=u,e[50]=K,e[51]=me,e[52]=B):B=e[52];let J;e[53]!==I||e[54]!==B?(J=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[I,B]}),e[53]=I,e[54]=B,e[55]=J):J=e[55];let G;e[56]!==s?(G=s("routes.onboarding.orgName"),e[56]=s,e[57]=G):G=e[57];let Y;e[58]!==G?(Y=t.jsx(Ae,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:G}),e[58]=G,e[59]=Y):Y=e[59];let le;e[60]===Symbol.for("react.memo_cache_sentinel")?(le=x=>v(x.target.value),e[60]=le):le=e[60];let H;e[61]!==o||e[62]!==s?(H=o||s("routes.onboarding.myOrganizationPlaceholder"),e[61]=o,e[62]=s,e[63]=H):H=e[63];const ue=d||p.isPending;let Q;e[64]!==c||e[65]!==H||e[66]!==ue?(Q=t.jsx(Le,{id:"org-name",value:c,onChange:le,placeholder:H,disabled:ue,className:"h-10 max-w-[220px]"}),e[64]=c,e[65]=H,e[66]=ue,e[67]=Q):Q=e[67];let W;e[68]!==Y||e[69]!==Q?(W=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[Y,Q]}),e[68]=Y,e[69]=Q,e[70]=W):W=e[70];let V;e[71]!==l||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==s?(V=b&&l&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:s("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(De,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=l,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=s,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"surface divide-y divide-border",children:[J,W,V]}),e[79]=J,e[80]=W,e[81]=V,e[82]=X):X=e[82];let Z;e[83]!==C||e[84]!==s?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:s("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=s,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==s?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",s("routes.onboarding.creating")]}):s("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=s,e[89]=ee):ee=e[89];let te;e[90]!==ge||e[91]!==ee?(te=t.jsx(Ne,{type:"submit",size:"xl",className:"w-full",disabled:ge,children:ee}),e[90]=ge,e[91]=ee,e[92]=te):te=e[92];let se;e[93]!==f||e[94]!==s?(se=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:s("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=s,e[95]=se):se=e[95];let re;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==se?(re=t.jsx(oe,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,se]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=se,e[102]=re):re=e[102],re}function Je(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:o}=i,a=de(),f=P.useRef(null);let l;e[0]!==n||e[1]!==a?(l=M=>{const $=M.target.files?.[0];if(!$)return;if($.size>2097152){he.error(a("routes.onboarding.imageTooLarge")),f.current&&(f.current.value="");return}const y=new FileReader;y.onerror=()=>he.error(a("routes.onboarding.failedReadImage")),y.onloadend=()=>{y.result&&n(y.result),f.current&&(f.current.value="")},y.readAsDataURL($)},e[0]=n,e[1]=a,e[2]=l):l=e[2];const s=l;let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f.current?.click(),e[3]=j):j=e[3];let c;e[4]!==a?(c=a("routes.onboarding.uploadOrgLogo"),e[4]=a,e[5]=c):c=e[5];let v;e[6]!==o||e[7]!==s?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:s,className:"hidden",disabled:o}),e[6]=o,e[7]=s,e[8]=v):v=e[8];const u=b??void 0;let w;e[9]!==m||e[10]!==u?(w=t.jsx(ve,{url:u,fallback:m,shape:"square",size:"base"}),e[9]=m,e[10]=u,e[11]=w):w=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(Me,{size:14,className:"text-white"})}),e[12]=g):g=e[12];let _;return e[13]!==o||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:o,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":c,children:[v,w,g]}),e[13]=o,e[14]=c,e[15]=v,e[16]=w,e[17]=_):_=e[17],_}const we=[{icon:Pe,labelKey:"routes.onboarding.step.creatingOrg",claimOnly:!1},{icon:Re,labelKey:"routes.onboarding.step.claimingDomain",claimOnly:!0},{icon:ze,labelKey:"routes.onboarding.step.enablingAutoJoin",claimOnly:!0}],Se=1500,je=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Ge({orgName:i,domain:e,claimDomain:b,logoUrl:m}){const n=de(),o=we.filter(s=>b||!s.claimOnly),[a,f]=P.useState(0),l=P.useRef(!1);if(!l.current){l.current=!0;for(let s=1;s<o.length;s++)setTimeout(()=>f(s),Se*s)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(fe,{title:n("routes.onboarding.settingUp",{orgName:i}),description:n("routes.onboarding.gettingReady",{domain:e}),logoUrl:m??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:o.map((s,j)=>{const c=s.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(s.labelKey);return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:u||v?1:.4},children:[t.jsxs("span",{className:ae("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!u&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:u?{backgroundColor:w.bg,color:w.fg}:void 0,children:[t.jsx(Fe,{size:16,className:ae("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",u?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(ce,{className:ae("absolute size-4","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0")}),t.jsx(c,{size:16,className:ae("absolute motion-safe:transition-opacity motion-safe:duration-200",!u&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:ae("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||u?"text-foreground":"text-muted-foreground"),children:g})]},s.labelKey)})})]})}export{ot as default};
1
+ import{c as ie,j as t,a as ye,h as ce,b as de,i as Ce,K as Oe,r as P,B as Ne,e as pe,o as ve,C as ze,I as Le,m as ae,t as he}from"./index-DWzXxNX7.js";import{R as _e}from"./required-auth-layout-ArdFAKbC.js";import{A as oe}from"./auth-split-layout-BIRuyBSf.js";import{O as Ee}from"./organization-choice-C8ztyWAj.js";import{L as Ae}from"./label-CWhwsMTf.js";import{S as De}from"./switch-DGJZecXh.js";import{t as Pe,a as Re}from"./Globe04-DZKfwJo_.js";import{i as Fe}from"./CheckCircle-DbgO7kVp.js";import{i as Me}from"./Upload01-BhfCOWsO.js";import"./Plus-Bki9UHMX.js";const $e=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function xe(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function ot(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_e,{children:t.jsx(Te,{})}),i[0]=e):e=i[0],e}function fe(i){const e=ie.c(13),{title:b,description:m,logoUrl:n,logoFallback:o}=i;let a;e[0]!==o||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:o??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=o,e[1]=n,e[2]=a):a=e[2];let f;e[3]!==b?(f=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:b}),e[3]=b,e[4]=f):f=e[4];let l;e[5]!==m?(l=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=l):l=e[6];let s;e[7]!==f||e[8]!==l?(s=t.jsxs("div",{className:"space-y-2",children:[f,l]}),e[7]=f,e[8]=l,e[9]=s):s=e[9];let j;return e[10]!==a||e[11]!==s?(j=t.jsxs("div",{className:"grid gap-10",children:[a,s]}),e[10]=a,e[11]=s,e[12]=j):j=e[12],j}function Te(){const i=ie.c(4),{data:e,isPending:b}=ye.useSession();if(b){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(oe,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(ce,{className:"size-3.5 text-muted-foreground"})})}),i[0]=a):a=i[0],a}const m=e?.user?.email??"",n=e?.user?.name;let o;return i[1]!==n||i[2]!==m?(o=t.jsx(qe,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=o):o=i[3],o}function qe(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),o=b.split("@")[1]?.toLowerCase()??"",a=!!o&&!$e.has(o),f=o.split(".")[0]??"",l=f.charAt(0).toUpperCase()+f.slice(1);let s;e[0]!==l||e[1]!==a||e[2]!==m?(s=a?l:m?.split(" ")[0]??"",e[0]=l,e[1]=a,e[2]=m,e[3]=s):s=e[3];const j=s,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(o),queryFn:Be,enabled:a});let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=new Set,e[4]=g):g=e[4];const[_,M]=P.useState(g),[$,y]=P.useState(!1);if(v){let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=r):r=e[5],t.jsx(oe,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[r,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:o})})]})})}if(u){let r;e[6]!==w?(r=()=>w(),e[6]=w,e[7]=r):r=e[7];let d;e[8]!==n?(d=n("routes.onboarding.retry"),e[8]=n,e[9]=d):d=e[9];let h;return e[10]!==r||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:d}),e[10]=r,e[11]=d,e[12]=h):h=e[12],t.jsx(oe,{children:t.jsxs("div",{className:"flex flex-col items-start gap-3 py-4",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checkFailed",{domain:o})}),h]})})}let N,A;e[13]!==c?.organizations?(N=(c?.organizations??[]).flatMap(Ke),A=N.some(Ie),e[13]=c?.organizations,e[14]=N,e[15]=A):(N=e[14],A=e[15]);const p=A;if($){let r;e[16]!==m?(r=m?.split(" ")[0]??"",e[16]=m,e[17]=r):r=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==l||e[21]!==o||e[22]!==a||e[23]!==r||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:r,allowDomainClaim:!1,onBack:d}),e[20]=l,e[21]=o,e[22]=a,e[23]=r,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let r;e[26]!==p||e[27]!==N.length||e[28]!==n?(r=p?N.length===1?n("routes.onboarding.accessSingle"):n("routes.onboarding.accessMultiple"):n("routes.onboarding.requestAccess"),e[26]=p,e[27]=N.length,e[28]=n,e[29]=r):r=e[29];let d;e[30]!==p||e[31]!==n?(d=n(p?"routes.onboarding.emailMatchesOrg":"routes.onboarding.emailMatchesOrgApproval"),e[30]=p,e[31]=n,e[32]=d):d=e[32];let h;e[33]!==r||e[34]!==d?(h=t.jsx(fe,{title:r,description:d}),e[33]=r,e[34]=d,e[35]=h):h=e[35];let O;e[36]!==M?(O=R=>M(F=>new Set(F).add(R)),e[36]=M,e[37]=O):O=e[37];let C;e[38]!==N||e[39]!==o||e[40]!==_||e[41]!==O?(C=t.jsx(Ee,{organizations:N,domain:o,requestedSlugs:_,onRequestedSlug:O,onJoined:Ue}),e[38]=N,e[39]=o,e[40]=_,e[41]=O,e[42]=C):C=e[42];let z;e[43]!==y?(z=()=>y(!0),e[43]=y,e[44]=z):z=e[44];let E;e[45]!==n?(E=n("routes.onboarding.createNewOrg"),e[45]=n,e[46]=E):E=e[46];let k;e[47]!==E||e[48]!==z?(k=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:z,children:E}),e[47]=E,e[48]=z,e[49]=k):k=e[49];let L;return e[50]!==k||e[51]!==h||e[52]!==C?(L=t.jsx(oe,{children:t.jsxs("div",{className:"grid gap-10",children:[h,C,k]})}),e[50]=k,e[51]=h,e[52]=C,e[53]=L):L=e[53],L}let D;return e[54]!==j||e[55]!==l||e[56]!==o||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:j}),e[54]=j,e[55]=l,e[56]=o,e[57]=a,e[58]=D):D=e[58],D}function Ue(i,e){window.location.href=`/${e}`}function Ie(i){return i.joinMode==="auto"}function Ke(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Be(){const i=await fetch("/api/auth/custom/domain-lookup",{credentials:"include"});if(!i.ok)throw new Error(`Failed to look up domain (${i.status})`);return i.json()}function be(i){const e=ie.c(103),{isCorporateEmail:b,emailDomain:m,domainLabel:n,defaultName:o,allowDomainClaim:a,onBack:f}=i,l=a===void 0?!0:a,s=de(),j=b&&l?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(o),[u,w]=P.useState(j),[g,_]=P.useState(!0),[M,$]=P.useState(null);let y;e[0]!==g||e[1]!==u||e[2]!==c?(y=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.trim()||void 0,logo:u??void 0,claimDomain:g})}),S=await x.json();if(!x.ok||!S.success)throw new Error(S.error||"Failed to set up organization");return S},e[0]=g,e[1]=u,e[2]=c,e[3]=y):y=e[3];let N;e[4]!==g?(N=x=>{if(!x.slug)return;const S=we.filter(ke=>g||!ke.claimOnly).length,ne=Se*(S-1)+800;$(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},ne)},e[4]=g,e[5]=N):N=e[5];let A;e[6]!==y||e[7]!==N?(A={mutationFn:y,onSuccess:N},e[6]=y,e[7]=N,e[8]=A):A=e[8];const p=pe(A);let D;e[9]!==u||e[10]!==c?(D={mutationFn:async()=>{const x=c.trim(),S=xe(x);if(!S)throw new Error("Invalid organization name");const ne=await ye.organization.create({name:x,slug:S,...u?{logo:u}:{}});if(ne?.error)throw new Error(ne.error.message||"Failed to create organization");window.location.href=`/${ne?.data?.slug??S}`}},e[9]=u,e[10]=c,e[11]=D):D=e[11];const r=pe(D);if(p.isPending||M){let x;e[12]!==n||e[13]!==c?(x=c.trim()||n,e[12]=n,e[13]=c,e[14]=x):x=e[14];let S;return e[15]!==g||e[16]!==m||e[17]!==u||e[18]!==x?(S=t.jsx(oe,{children:t.jsx(Ge,{orgName:x,domain:m,claimDomain:g,logoUrl:u})}),e[15]=g,e[16]=m,e[17]=u,e[18]=x,e[19]=S):S=e[19],S}const d=r.isPending;let h;e[20]!==c?(h=xe(c.trim()),e[20]=c,e[21]=h):h=e[21];const O=!!h,C=p.error||r.error||null;let z;e[22]!==l||e[23]!==O||e[24]!==r||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&l?p.mutate():r.mutate())},e[22]=l,e[23]=O,e[24]=r,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==s?(k=s("routes.onboarding.welcomeTitle"),e[28]=s,e[29]=k):k=e[29];let L;e[30]!==s?(L=s("routes.onboarding.setupDescription"),e[30]=s,e[31]=L):L=e[31];let R;e[32]!==k||e[33]!==L?(R=t.jsx(fe,{title:k,description:L}),e[32]=k,e[33]=L,e[34]=R):R=e[34];let F;e[35]!==s?(F=s("routes.onboarding.orgAvatar"),e[35]=s,e[36]=F):F=e[36];let T;e[37]!==F?(T=t.jsx("p",{className:"text-sm font-medium",children:F}),e[37]=F,e[38]=T):T=e[38];let q;e[39]!==s?(q=s("routes.onboarding.optional"),e[39]=s,e[40]=q):q=e[40];let U;e[41]!==q?(U=t.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[41]=q,e[42]=U):U=e[42];let I;e[43]!==T||e[44]!==U?(I=t.jsxs("div",{className:"space-y-0.5",children:[T,U]}),e[43]=T,e[44]=U,e[45]=I):I=e[45];let K;e[46]!==o||e[47]!==c?(K=(c.trim()||o||"?").charAt(0).toUpperCase(),e[46]=o,e[47]=c,e[48]=K):K=e[48];const me=d||p.isPending;let B;e[49]!==u||e[50]!==K||e[51]!==me?(B=t.jsx(Je,{value:u,fallback:K,onChange:w,disabled:me}),e[49]=u,e[50]=K,e[51]=me,e[52]=B):B=e[52];let J;e[53]!==I||e[54]!==B?(J=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[I,B]}),e[53]=I,e[54]=B,e[55]=J):J=e[55];let G;e[56]!==s?(G=s("routes.onboarding.orgName"),e[56]=s,e[57]=G):G=e[57];let Y;e[58]!==G?(Y=t.jsx(Ae,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:G}),e[58]=G,e[59]=Y):Y=e[59];let le;e[60]===Symbol.for("react.memo_cache_sentinel")?(le=x=>v(x.target.value),e[60]=le):le=e[60];let H;e[61]!==o||e[62]!==s?(H=o||s("routes.onboarding.myOrganizationPlaceholder"),e[61]=o,e[62]=s,e[63]=H):H=e[63];const ue=d||p.isPending;let Q;e[64]!==c||e[65]!==H||e[66]!==ue?(Q=t.jsx(Le,{id:"org-name",value:c,onChange:le,placeholder:H,disabled:ue,className:"h-10 max-w-[220px]"}),e[64]=c,e[65]=H,e[66]=ue,e[67]=Q):Q=e[67];let W;e[68]!==Y||e[69]!==Q?(W=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[Y,Q]}),e[68]=Y,e[69]=Q,e[70]=W):W=e[70];let V;e[71]!==l||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==s?(V=b&&l&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:s("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(De,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=l,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=s,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"surface divide-y divide-border",children:[J,W,V]}),e[79]=J,e[80]=W,e[81]=V,e[82]=X):X=e[82];let Z;e[83]!==C||e[84]!==s?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:s("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=s,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==s?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",s("routes.onboarding.creating")]}):s("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=s,e[89]=ee):ee=e[89];let te;e[90]!==ge||e[91]!==ee?(te=t.jsx(Ne,{type:"submit",size:"xl",className:"w-full",disabled:ge,children:ee}),e[90]=ge,e[91]=ee,e[92]=te):te=e[92];let se;e[93]!==f||e[94]!==s?(se=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:s("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=s,e[95]=se):se=e[95];let re;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==se?(re=t.jsx(oe,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,se]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=se,e[102]=re):re=e[102],re}function Je(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:o}=i,a=de(),f=P.useRef(null);let l;e[0]!==n||e[1]!==a?(l=M=>{const $=M.target.files?.[0];if(!$)return;if($.size>2097152){he.error(a("routes.onboarding.imageTooLarge")),f.current&&(f.current.value="");return}const y=new FileReader;y.onerror=()=>he.error(a("routes.onboarding.failedReadImage")),y.onloadend=()=>{y.result&&n(y.result),f.current&&(f.current.value="")},y.readAsDataURL($)},e[0]=n,e[1]=a,e[2]=l):l=e[2];const s=l;let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f.current?.click(),e[3]=j):j=e[3];let c;e[4]!==a?(c=a("routes.onboarding.uploadOrgLogo"),e[4]=a,e[5]=c):c=e[5];let v;e[6]!==o||e[7]!==s?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:s,className:"hidden",disabled:o}),e[6]=o,e[7]=s,e[8]=v):v=e[8];const u=b??void 0;let w;e[9]!==m||e[10]!==u?(w=t.jsx(ve,{url:u,fallback:m,shape:"square",size:"base"}),e[9]=m,e[10]=u,e[11]=w):w=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(Me,{size:14,className:"text-white"})}),e[12]=g):g=e[12];let _;return e[13]!==o||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:o,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":c,children:[v,w,g]}),e[13]=o,e[14]=c,e[15]=v,e[16]=w,e[17]=_):_=e[17],_}const we=[{icon:Pe,labelKey:"routes.onboarding.step.creatingOrg",claimOnly:!1},{icon:Re,labelKey:"routes.onboarding.step.claimingDomain",claimOnly:!0},{icon:ze,labelKey:"routes.onboarding.step.enablingAutoJoin",claimOnly:!0}],Se=1500,je=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Ge({orgName:i,domain:e,claimDomain:b,logoUrl:m}){const n=de(),o=we.filter(s=>b||!s.claimOnly),[a,f]=P.useState(0),l=P.useRef(!1);if(!l.current){l.current=!0;for(let s=1;s<o.length;s++)setTimeout(()=>f(s),Se*s)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(fe,{title:n("routes.onboarding.settingUp",{orgName:i}),description:n("routes.onboarding.gettingReady",{domain:e}),logoUrl:m??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:o.map((s,j)=>{const c=s.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(s.labelKey);return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:u||v?1:.4},children:[t.jsxs("span",{className:ae("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!u&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:u?{backgroundColor:w.bg,color:w.fg}:void 0,children:[t.jsx(Fe,{size:16,className:ae("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",u?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(ce,{className:ae("absolute size-4","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0")}),t.jsx(c,{size:16,className:ae("absolute motion-safe:transition-opacity motion-safe:duration-200",!u&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:ae("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||u?"text-foreground":"text-muted-foreground"),children:g})]},s.labelKey)})})]})}export{ot as default};
@@ -1,3 +1,3 @@
1
- import{e as J,f as B}from"./input-BneF5n5F.js";import{aE as A,aF as _,ec as C,b3 as U,cZ as W}from"./index-XdUWZF5g.js";import"./usage-stats-CkprzoQA.js";import"./tool-namespace-BskMFdfX.js";import"./form-Bhgzwnyp.js";import"./label-CUqIqnOS.js";import"./utils-CVEq3hMx.js";import"./markdown-A06Oe1_p.js";import"./use-copy-9wHvlEmg.js";import"./agent-icon-DmYd33Zd.js";import"./AlertCircle-CQW1P7_R.js";import"./Tool01-CE4RsL2T.js";import"./ArrowUp-VZphHDPw.js";import"./ArrowLeft-sSY9Zm-O.js";import"./LinkBroken01-ArAKWl5D.js";import"./ShoppingBag01-DEtqIAKG.js";import"./Globe04-1JEh9zst.js";import"./CheckCircle-BAqlx5xq.js";import"./ChevronUp-RQuomTlc.js";import"./ChevronSelectorVertical-CAw9AQRt.js";import"./UserSquare-DfCEdLMW.js";import"./CreditCard01-uW1Nq0L7.js";import"./SwitchHorizontal01-DTDSJnjG.js";import"./Key01-B-MK6puk.js";import"./Minus-y3rEkH4O.js";import"./Monitor01-DkdtFPE6.js";import"./Sun-DhrY2nq7.js";import"./Play-BtmesR9D.js";import"./Plus-BhSB1FAc.js";import"./SearchMd-CTCaP47C.js";import"./Trash01-DQCE9WJt.js";import"./Upload01-C8pH3Rp-.js";import"./Users01-RbJbPNL4.js";import"./XClose-B9seet19.js";import"./Zap-B2TeJ3jk.js";import"./chat-context-BwoQSegQ.js";import"./autosend-0p4cszrD.js";import"./thread-route-DSQLBJ4Y.js";import"./use-project-scope-C1eT4xwT.js";import"./repository-binding-Cfy_YQIZ.js";import"./use-mcp-client-B9_8tfCL.js";import"./auth-DeNsOsKX.js";import"./thread-intent-DnduoWYb.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BUtg06cI.js";import"./task-board-B-Jl-DnQ.js";import"./schema-CJ9UcSNs.js";import"./use-entitlements-DzfUP8ON.js";import"./use-ai-providers-BmwnG2L7.js";import"./use-decopilot-events-CR7NJgme.js";import"./use-organization-settings-B0lt5dXR.js";import"./use-mobile-DSmr8Fj3.js";import"./tooltip-C1oPRuFg.js";import"./index-DJy_S3Mn.js";import"./icon-button-Dls6AzVP.js";import"./file-type-icon-BZTtX6EK.js";import"./chat-draft-DH581p83.js";import"./use-voice-input-BVeAO01v.js";import"./popover-DmqBIPKi.js";import"./drawer-BiZQd3jF.js";import"./index-CJKJ4WN3.js";import"./checkbox-BYltfk17.js";import"./select-BABowMoY.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./tabs-CPwYT_wy.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-ChuCrYAR.js";import"./toggle-group-CO1s8gR-.js";import"./input-BBwM3ir1.js";import"./suggestion-C9bDFuOo.js";import"./use-mcp-prompts-NcFGfyZU.js";import"./use-org-fs-C57fsXyq.js";import"./useInfiniteQuery-BvhkDMwv.js";import"./infiniteQueryObserver-DgQQHW6Y.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-DWnzqDkt.js";import"./plan-ladder-LKl9l3TA.js";import"./add-connection-dialog-BZazlImL.js";import"./collection-search-DFoNgd1T.js";import"./extract-connection-data-lBAlP3pz.js";import"./metadata-D72DunRR.js";import"./connection-B4VgNpkK.js";import"./url-slug-kny4-Gd8.js";import"./connection-card-Cp7AJMDR.js";import"./connection-slug-CK9E8VRg.js";import"./integration-icon-DpoZYM7e.js";import"./textarea-DSiKrnTK.js";import"./use-connection-DFsrW4Mv.js";import"./schema-Dq7led26.js";import"./connection-form-helpers-DqULERyx.js";import"./authenticate-and-persist-oauth-Ca1G6bWy.js";import"./mcp-oauth-u5RBmpff.js";import"./mcp-oauth-L4CbK4hz.js";import"./collection-tabs-DTr38V1c.js";import"./badge-fJOJmdQG.js";import"./use-infinite-scroll-DdKcODzJ.js";import"./useSuspenseInfiniteQuery-CHeSvNyF.js";import"./use-task-board-events-CMb3Vjy2.js";import"./use-chat-layout-state-Ep7OkPup.js";class X{constructor(e,r=4e3){this.onDisconnect=e,this.graceMs=r}onDisconnect;graceMs;timer;report(e){if(e==="connected"){clearTimeout(this.timer),this.timer=void 0;return}if(e==="failed"||e==="closed"){clearTimeout(this.timer),this.timer=void 0,this.onDisconnect();return}e==="disconnected"&&!this.timer&&(this.timer=setTimeout(this.onDisconnect,this.graceMs))}dispose(){clearTimeout(this.timer),this.timer=void 0}}const F=A({type:W(["session.input_transcript.delta","session.output_transcript.delta"]),event_id:_(),delta:_(),start_ms:U().nonnegative(),end_ms:U().nonnegative()}),H=A({type:C("session.delegation.created"),offset_ms:U().nonnegative(),delegation:A({id:_(),target:C("client")})});class Z{constructor(e,r){this.send=e,this.callbacks=r}send;callbacks;closed=!1;fragments=[];seen=new Set;delegated=new Set;consumed=new Set;pending=new Map;contexts=new Map;awaitingContext=new Map;receive(e,r=Date.now()){if(this.closed)return;const n=F.safeParse(e);if(n.success){const t=n.data;if(this.seen.has(t.event_id))return;this.seen.add(t.event_id);const s=t.type==="session.input_transcript.delta"?"user":"agent";if(this.fragments.push({role:s,text:t.delta,start:t.start_ms,end:t.end_ms,arrivedAt:r,id:t.event_id}),this.fragments.sort((o,i)=>o.start-i.start),this.fragments.length>4e3){this.callbacks.onError();return}this.callbacks.onMessage({role:s,message:t.delta,event_id:t.event_id});return}const a=H.safeParse(e);if(a.success){const{id:t}=a.data.delegation;if(this.delegated.has(t)||this.pending.has(t))return;if(this.delegated.size+this.pending.size>=40){this.callbacks.onError();return}this.pending.set(t,{offset:a.data.offset_ms,receivedAt:r});return}const m=A({type:C("session.thinking.appended"),client_event_id:_()}).safeParse(e);if(m.success){const t=m.data.client_event_id,s=this.awaitingContext.get(t);this.awaitingContext.delete(t),s&&(s.remaining.delete(t),s.remaining.size===0&&this.send({type:"session.commentary.append",event_id:crypto.randomUUID(),delegation_id:s.delegationId??null,content:"Studio has supplied the complete background result as context for this request. Briefly explain that result, including any failure or required approval. Acceptance or task creation alone does not mean the work completed."}));return}const d=A({type:_()}).safeParse(e);d.success&&d.data.type==="error"&&this.callbacks.onError()}tick(e=Date.now()){if(!this.closed)for(const[r,n]of this.pending){const a=this.fragments.filter(o=>o.start<n.offset),m=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,n.receivedAt);if(e-m<500)continue;const d=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!d.length&&e-n.receivedAt<3e3)continue;if(this.pending.delete(r),this.delegated.add(r),!d.length){this.publishUpdate({delivery:"announce",delegationId:r,text:"No new transcribed request is available. No work was started. Ask the user to repeat the request."});continue}const t=d.map(o=>o.text).join("").trim(),s=[];for(const o of a){if(d.includes(o))continue;const i=s.at(-1);i?.role===o.role?i.text+=o.text:s.push({role:o.role,text:o.text})}if(t.length>J){this.publishUpdate({delivery:"announce",delegationId:r,text:"The spoken request is too long. No work was started. Ask the user to shorten it or continue in text."});continue}for(const o of d)this.consumed.add(o.id);this.callbacks.onDelegate({request:t,delegationId:r,transcript:B(s.map(({role:o,text:i})=>({role:o,text:i.trim()})).filter(({text:o})=>o))}).then(o=>{this.closed||this.publishUpdate({delivery:o.status==="rejected"?"announce":"context",delegationId:r,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:r,text:"Studio could not accept this request. Do not claim work started."})})}}publishUpdate(e){if(this.closed)return;if(e.contextId){if(this.contexts.get(e.contextId)===e.text)return;this.contexts.set(e.contextId,e.text)}const n=(e.contextId?`Updated ${e.contextId} data, superseding earlier values:
1
+ import{e as J,f as B}from"./input-BX2oSBO4.js";import{aE as A,aF as _,ec as C,b3 as U,cZ as W}from"./index-DWzXxNX7.js";import"./usage-stats-CjtMu5Zx.js";import"./tool-namespace-GXxgJjDC.js";import"./form-DxSJX34K.js";import"./label-CWhwsMTf.js";import"./utils-CVEq3hMx.js";import"./markdown-BdcV-XI9.js";import"./use-copy-D7ZZ3KMu.js";import"./agent-icon-C4wH6TqA.js";import"./AlertCircle-BGZ0JmbE.js";import"./Tool01-JPE_S_5w.js";import"./ArrowUp-DP5euuHF.js";import"./ArrowLeft-B14bIrz5.js";import"./LinkBroken01-DBe4JVRU.js";import"./ShoppingBag01-B_7M6ZMN.js";import"./Globe04-DZKfwJo_.js";import"./CheckCircle-DbgO7kVp.js";import"./ChevronUp-C7zL3mw4.js";import"./ChevronSelectorVertical-Cy067w0k.js";import"./UserSquare-okz5KCgc.js";import"./CreditCard01-BKUaIref.js";import"./SwitchHorizontal01-P8CzcCPk.js";import"./Key01-CNSpLGm4.js";import"./Minus-DF8ZH8rU.js";import"./Monitor01-BEGkS_TY.js";import"./Sun-BsibC9j3.js";import"./Play-AS-vXB2p.js";import"./Plus-Bki9UHMX.js";import"./SearchMd-OdGIG7dP.js";import"./Trash01-CC6cJr6C.js";import"./Upload01-BhfCOWsO.js";import"./Users01-tkZwiAma.js";import"./XClose-DMFJf5PD.js";import"./Zap-5B1zE-Cq.js";import"./chat-context-CbElEPZP.js";import"./autosend-JAeO1MO9.js";import"./thread-route-BAbyqgqJ.js";import"./use-project-scope-BScqgH6_.js";import"./repository-binding-iKwK7-Ti.js";import"./use-mcp-client-C1kVArlZ.js";import"./auth-BR_-50-H.js";import"./thread-intent-D3YJu4FC.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BqlJNCTB.js";import"./task-board-DFqxjiEI.js";import"./schema-B4KfFv9K.js";import"./use-entitlements-e6B2Hr8Z.js";import"./use-ai-providers-BDUElYx2.js";import"./use-decopilot-events-k-yjMTX4.js";import"./use-organization-settings-Cx5lerOS.js";import"./use-mobile-DQW_XOug.js";import"./tooltip-DRLrjg1Z.js";import"./index-_AW8aUhQ.js";import"./icon-button-CrVBEVIa.js";import"./file-type-icon-Bbyu2O2G.js";import"./chat-draft-Ws7vmGFP.js";import"./use-voice-input-D5EWzPOm.js";import"./popover-0QOAqVJk.js";import"./drawer-DYm_G94M.js";import"./index-DlMpGjHy.js";import"./checkbox-CxN3Fjiq.js";import"./select-C0xcPtOB.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./tabs-Drvd2w0d.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-CatOkC_w.js";import"./toggle-group-J_c3_HoS.js";import"./input-vhdOtqt2.js";import"./suggestion-CARH8w5s.js";import"./use-mcp-prompts-BNy6CE1f.js";import"./use-org-fs-7KKDVAQZ.js";import"./useInfiniteQuery-CHzLTZOu.js";import"./infiniteQueryObserver-BKza5thB.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-B8kSC1DC.js";import"./plan-ladder-Co_eK5AC.js";import"./add-connection-dialog-iKWxCDdu.js";import"./collection-search-Cpx7FdKh.js";import"./extract-connection-data-C3PHmvAg.js";import"./metadata-D72DunRR.js";import"./connection-D-9gmcf_.js";import"./url-slug-qoNh9b30.js";import"./connection-card-BkrffNnj.js";import"./connection-slug-qdewS16o.js";import"./integration-icon-DuegKJ2_.js";import"./textarea-BIef_B53.js";import"./use-connection-C_WGTEZq.js";import"./schema-C2wAdAKO.js";import"./connection-form-helpers-CkddBWFC.js";import"./authenticate-and-persist-oauth-Fn4MDzen.js";import"./mcp-oauth-D9q81Rer.js";import"./mcp-oauth-BGHnDVvZ.js";import"./collection-tabs-DD0XrMnx.js";import"./badge-B3JA5w4M.js";import"./use-infinite-scroll-DUONvrYP.js";import"./useSuspenseInfiniteQuery-_UZTXUPR.js";import"./use-task-board-events-DjlevGZD.js";import"./use-chat-layout-state-DjgvyXQQ.js";class X{constructor(e,r=4e3){this.onDisconnect=e,this.graceMs=r}onDisconnect;graceMs;timer;report(e){if(e==="connected"){clearTimeout(this.timer),this.timer=void 0;return}if(e==="failed"||e==="closed"){clearTimeout(this.timer),this.timer=void 0,this.onDisconnect();return}e==="disconnected"&&!this.timer&&(this.timer=setTimeout(this.onDisconnect,this.graceMs))}dispose(){clearTimeout(this.timer),this.timer=void 0}}const F=A({type:W(["session.input_transcript.delta","session.output_transcript.delta"]),event_id:_(),delta:_(),start_ms:U().nonnegative(),end_ms:U().nonnegative()}),H=A({type:C("session.delegation.created"),offset_ms:U().nonnegative(),delegation:A({id:_(),target:C("client")})});class Z{constructor(e,r){this.send=e,this.callbacks=r}send;callbacks;closed=!1;fragments=[];seen=new Set;delegated=new Set;consumed=new Set;pending=new Map;contexts=new Map;awaitingContext=new Map;receive(e,r=Date.now()){if(this.closed)return;const n=F.safeParse(e);if(n.success){const t=n.data;if(this.seen.has(t.event_id))return;this.seen.add(t.event_id);const s=t.type==="session.input_transcript.delta"?"user":"agent";if(this.fragments.push({role:s,text:t.delta,start:t.start_ms,end:t.end_ms,arrivedAt:r,id:t.event_id}),this.fragments.sort((o,i)=>o.start-i.start),this.fragments.length>4e3){this.callbacks.onError();return}this.callbacks.onMessage({role:s,message:t.delta,event_id:t.event_id});return}const a=H.safeParse(e);if(a.success){const{id:t}=a.data.delegation;if(this.delegated.has(t)||this.pending.has(t))return;if(this.delegated.size+this.pending.size>=40){this.callbacks.onError();return}this.pending.set(t,{offset:a.data.offset_ms,receivedAt:r});return}const m=A({type:C("session.thinking.appended"),client_event_id:_()}).safeParse(e);if(m.success){const t=m.data.client_event_id,s=this.awaitingContext.get(t);this.awaitingContext.delete(t),s&&(s.remaining.delete(t),s.remaining.size===0&&this.send({type:"session.commentary.append",event_id:crypto.randomUUID(),delegation_id:s.delegationId??null,content:"Studio has supplied the complete background result as context for this request. Briefly explain that result, including any failure or required approval. Acceptance or task creation alone does not mean the work completed."}));return}const d=A({type:_()}).safeParse(e);d.success&&d.data.type==="error"&&this.callbacks.onError()}tick(e=Date.now()){if(!this.closed)for(const[r,n]of this.pending){const a=this.fragments.filter(o=>o.start<n.offset),m=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,n.receivedAt);if(e-m<500)continue;const d=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!d.length&&e-n.receivedAt<3e3)continue;if(this.pending.delete(r),this.delegated.add(r),!d.length){this.publishUpdate({delivery:"announce",delegationId:r,text:"No new transcribed request is available. No work was started. Ask the user to repeat the request."});continue}const t=d.map(o=>o.text).join("").trim(),s=[];for(const o of a){if(d.includes(o))continue;const i=s.at(-1);i?.role===o.role?i.text+=o.text:s.push({role:o.role,text:o.text})}if(t.length>J){this.publishUpdate({delivery:"announce",delegationId:r,text:"The spoken request is too long. No work was started. Ask the user to shorten it or continue in text."});continue}for(const o of d)this.consumed.add(o.id);this.callbacks.onDelegate({request:t,delegationId:r,transcript:B(s.map(({role:o,text:i})=>({role:o,text:i.trim()})).filter(({text:o})=>o))}).then(o=>{this.closed||this.publishUpdate({delivery:o.status==="rejected"?"announce":"context",delegationId:r,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:r,text:"Studio could not accept this request. Do not claim work started."})})}}publishUpdate(e){if(this.closed)return;if(e.contextId){if(this.contexts.get(e.contextId)===e.text)return;this.contexts.set(e.contextId,e.text)}const n=(e.contextId?`Updated ${e.contextId} data, superseding earlier values:
2
2
  `:`Studio result data:
3
3
  `)+e.text,a=new TextEncoder,m=e.delivery==="announce"&&a.encode(n).length>480,d={remaining:new Set,delegationId:e.delegationId};let t="",s=0;const o=()=>{if(!t)return;const i=crypto.randomUUID();m&&(d.remaining.add(i),this.awaitingContext.set(i,d)),this.send({type:e.delivery==="announce"&&!m?"session.commentary.append":"session.thinking.append",event_id:i,delegation_id:e.delegationId??null,content:t}),t="",s=0};for(const i of n){const v=a.encode(i).length;s+v>480&&o(),t+=i,s+=v}o()}close(){this.closed=!0,this.pending.clear(),this.awaitingContext.clear()}}async function Bt(E,e,r){r.throwIfAborted();const n=new RTCPeerConnection,a=n.createDataChannel("oai-events"),m=document.createElement("audio");m.autoplay=!0;let d,t,s,o,i=!1,v=!1,h,O,L=0,P=0,g,w,y=!1;const I=Promise.withResolvers(),x=Promise.withResolvers();x.promise.catch(()=>{});const b=new Z(p=>{!i&&a.readyState==="open"&&a.send(JSON.stringify(p))},e),q=new X(()=>{i||e.onDisconnect()}),M=async()=>{if(!i){i=!0,q.dispose(),b.close(),clearInterval(O),r.removeEventListener("abort",T),a.close(),n.close();for(const p of d?.getTracks()??[])p.stop();m.pause(),m.srcObject=null,t&&t.state!=="closed"&&await t.close().catch(()=>{})}},T=()=>{M()};r.addEventListener("abort",T,{once:!0});const u=AbortSignal.any([r,AbortSignal.timeout(3e4)]),j=x.promise,z=()=>x.reject(u.reason);u.addEventListener("abort",z,{once:!0}),j.catch(()=>{}),a.onmessage=({data:p})=>{if(!(i||typeof p!="string"))try{const l=JSON.parse(p);typeof l=="object"&&l!==null&&"type"in l&&(l.type==="session.started"&&(v=!0,x.resolve()),l.type==="session.closed"&&(I.resolve(),h||e.onDisconnect())),h||b.receive(l)}catch{e.onError()}},a.onclose=()=>{x.reject(new Error("Voice connection closed")),I.resolve(),!i&&!h&&e.onDisconnect()},n.onconnectionstatechange=()=>{i||q.report(n.connectionState)},n.ontrack=({streams:p,track:l})=>{if(i)return;const D=p[0]??new MediaStream([l]);m.srcObject=D,t??=new AudioContext,s=t.createAnalyser(),s.fftSize=256,o=new Uint8Array(s.fftSize),t.createMediaStreamSource(D).connect(s),t.resume().catch(()=>e.onError()),m.play().catch(()=>e.onError())};function N(){if(!s||!o||i)return 0;s.getByteTimeDomainData(o);let p=0;for(const l of o)p+=((l-128)/128)**2;return Math.min(1,Math.sqrt(p/o.length)*4)}try{const p=navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}).then(c=>{if(i||u.aborted){for(const f of c.getTracks())f.stop();throw new DOMException("Voice connection cancelled","AbortError")}return d=c,c}),l=await Promise.race([p,new Promise((c,f)=>u.addEventListener("abort",()=>f(u.reason),{once:!0}))]);t??=new AudioContext,g=t.createAnalyser(),g.fftSize=256,w=new Uint8Array(g.fftSize),t.createMediaStreamSource(l).connect(g),await t.resume();for(const c of l.getAudioTracks())n.addTrack(c,l);const D=await n.createOffer();await n.setLocalDescription(D),u.throwIfAborted(),n.iceGatheringState!=="complete"&&await new Promise((c,f)=>{const S=()=>{n.iceGatheringState==="complete"&&(R(),c())},k=()=>{R(),f(u.reason)},R=()=>{n.removeEventListener("icegatheringstatechange",S),u.removeEventListener("abort",k)};n.addEventListener("icegatheringstatechange",S),u.addEventListener("abort",k,{once:!0}),S(),u.aborted&&k()});const V=n.localDescription?.sdp;if(!V)throw new Error("Missing voice offer");const G=await E(V,u);return await n.setRemoteDescription({type:"answer",sdp:G.sdp}),await j,r.throwIfAborted(),u.removeEventListener("abort",z),r.removeEventListener("abort",T),e.onConnect(),O=setInterval(()=>{if(i||h)return;if(b.tick(),g&&w&&!y){g.getByteTimeDomainData(w);const f=w.reduce((S,k)=>S+((k-128)/128)**2,0)/w.length;Math.sqrt(f)>.025&&(P=Date.now())}e.onUserSpeaking(!y&&Date.now()-P<400),N()>.02&&(L=Date.now()),e.onModeChange({mode:Date.now()-L<400?"speaking":"listening"})},100),{endSession:()=>(h??=(async()=>{b.close();for(const c of d?.getTracks()??[])c.stop();if(m.pause(),v&&a.readyState==="open"){a.send(JSON.stringify({type:"session.close"}));let c;await Promise.race([I.promise,new Promise(f=>{c=setTimeout(f,3e3)})]),clearTimeout(c)}await M()})(),h),publishUpdate:c=>b.publishUpdate(c),setMicMuted:c=>{y=c;for(const f of d?.getAudioTracks()??[])f.enabled=!y;y&&e.onUserSpeaking(!1)},getOutputVolume:N}}catch(p){throw await M(),p}}export{Bt as startOpenAIConversation};
@@ -1 +1 @@
1
- import{c as a,a4 as f,q as S,i as y,K as v}from"./index-XdUWZF5g.js";import{b as d}from"./use-project-native-view-presence-BBRyl28q.js";function c(e,i){return v.optimisticProjectSidebarViews(e,i)}function l(e){return typeof e=="object"&&e!==null}function b(e,i){return e[1]===i&&e[3]==="collection"&&e[4]==="VIRTUAL_MCP"}function P(e,i){if(!l(e))return e;if("item"in e&&l(e.item)&&e.item.id===i.id)return{...e,item:i};if(!("structuredContent"in e)||!l(e.structuredContent))return e;const s=e.structuredContent.items;if(!Array.isArray(s))return e;let r=!1;const t=s.map(n=>!l(n)||n.id!==i.id?n:(r=!0,i));return r?{...e,structuredContent:{...e.structuredContent,items:t}}:e}function x(e,i,s){e.setQueriesData({predicate:r=>b(r.queryKey,i)},r=>P(r,s))}function A(e,i,s){const r=e.getQueriesData({predicate:t=>b(t.queryKey,i)&&t.queryKey[5]===s});for(const[,t]of r)if(t?.item?.id===s)return t.item;return null}function V(e,i,s){return e.getQueryData(c(i,s))??null}function j(e,i){if(i)return{sidebarViews:[...i.views],sidebarViewsVersion:d};const s=e?.sidebarViews;return{sidebarViews:s===null?null:s?[...s]:void 0,sidebarViewsVersion:e?.sidebarViewsVersion}}function K(e,i,s){return i?{sidebarViews:[...i.views],sidebarViewsVersion:d}:s===void 0?{sidebarViews:e.sidebarViews===null?null:e.sidebarViews?[...e.sidebarViews]:void 0,sidebarViewsVersion:e.sidebarViewsVersion}:j(s,null)}function p(e,i,s,r,t){const n=V(e,i,s),o={revision:(n?.revision??0)+1,views:[...r],rollbackViews:n?[...n.rollbackViews]:[...t]};return e.setQueryData(c(i,s),o),{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}}function C(e,i,s){const r=V(e,i,s);return r?{revision:r.revision,views:[...r.views],persistedViews:[...r.rollbackViews]}:null}function m(e,i){const s=new Set(e),r=new Set(i);return s.size===r.size&&[...s].every(t=>r.has(t))}function R(e){return e?!m(e.views,e.persistedViews):!1}function k(e,i,s,{snapshot:r,saved:t,authoritativeViews:n}){if(!r)return{settledLatest:!1,reconciledViews:null};const o=V(e,i,s);if(!o||r.revision>o.revision)return{settledLatest:!1,reconciledViews:null};const u=n!==void 0?[...n]:t?[...r.views]:null,w={...o,rollbackViews:u??o.rollbackViews};return w.rollbackViews!==o.rollbackViews&&e.setQueryData(c(i,s),w),r.revision!==o.revision?{settledLatest:!1,reconciledViews:null}:(e.setQueryData(c(i,s),null),{settledLatest:!0,reconciledViews:t?u&&!m(u,r.views)?u:null:[...w.rollbackViews]})}function _(e){const i=a.c(5),{org:s}=f(),r=e??"";let t;i[0]!==s.id||i[1]!==r?(t=c(s.id,r),i[0]=s.id,i[1]=r,i[2]=t):t=i[2];let n;i[3]!==t?(n={queryKey:t,queryFn:O,enabled:!1,staleTime:Number.POSITIVE_INFINITY},i[3]=t,i[4]=n):n=i[4];const{data:o}=y(n);return o?.views}async function O(){return null}function L(e){const i=a.c(4),{org:s}=f(),r=S();let t;return i[0]!==s||i[1]!==r||i[2]!==e?(t={stage:(n,o)=>p(r,s.id,e,n,o),snapshot:()=>C(r,s.id,e),settle:n=>k(r,s.id,e,n)},i[0]=s,i[1]=r,i[2]=e,i[3]=t):t=i[3],t}export{L as a,b,j as i,R as o,K as p,A as r,_ as u,x as w};
1
+ import{c as a,a4 as f,q as S,i as y,K as v}from"./index-DWzXxNX7.js";import{b as d}from"./use-project-native-view-presence-CEs9QAB1.js";function c(e,i){return v.optimisticProjectSidebarViews(e,i)}function l(e){return typeof e=="object"&&e!==null}function b(e,i){return e[1]===i&&e[3]==="collection"&&e[4]==="VIRTUAL_MCP"}function P(e,i){if(!l(e))return e;if("item"in e&&l(e.item)&&e.item.id===i.id)return{...e,item:i};if(!("structuredContent"in e)||!l(e.structuredContent))return e;const s=e.structuredContent.items;if(!Array.isArray(s))return e;let r=!1;const t=s.map(n=>!l(n)||n.id!==i.id?n:(r=!0,i));return r?{...e,structuredContent:{...e.structuredContent,items:t}}:e}function x(e,i,s){e.setQueriesData({predicate:r=>b(r.queryKey,i)},r=>P(r,s))}function A(e,i,s){const r=e.getQueriesData({predicate:t=>b(t.queryKey,i)&&t.queryKey[5]===s});for(const[,t]of r)if(t?.item?.id===s)return t.item;return null}function V(e,i,s){return e.getQueryData(c(i,s))??null}function j(e,i){if(i)return{sidebarViews:[...i.views],sidebarViewsVersion:d};const s=e?.sidebarViews;return{sidebarViews:s===null?null:s?[...s]:void 0,sidebarViewsVersion:e?.sidebarViewsVersion}}function K(e,i,s){return i?{sidebarViews:[...i.views],sidebarViewsVersion:d}:s===void 0?{sidebarViews:e.sidebarViews===null?null:e.sidebarViews?[...e.sidebarViews]:void 0,sidebarViewsVersion:e.sidebarViewsVersion}:j(s,null)}function p(e,i,s,r,t){const n=V(e,i,s),o={revision:(n?.revision??0)+1,views:[...r],rollbackViews:n?[...n.rollbackViews]:[...t]};return e.setQueryData(c(i,s),o),{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}}function C(e,i,s){const r=V(e,i,s);return r?{revision:r.revision,views:[...r.views],persistedViews:[...r.rollbackViews]}:null}function m(e,i){const s=new Set(e),r=new Set(i);return s.size===r.size&&[...s].every(t=>r.has(t))}function R(e){return e?!m(e.views,e.persistedViews):!1}function k(e,i,s,{snapshot:r,saved:t,authoritativeViews:n}){if(!r)return{settledLatest:!1,reconciledViews:null};const o=V(e,i,s);if(!o||r.revision>o.revision)return{settledLatest:!1,reconciledViews:null};const u=n!==void 0?[...n]:t?[...r.views]:null,w={...o,rollbackViews:u??o.rollbackViews};return w.rollbackViews!==o.rollbackViews&&e.setQueryData(c(i,s),w),r.revision!==o.revision?{settledLatest:!1,reconciledViews:null}:(e.setQueryData(c(i,s),null),{settledLatest:!0,reconciledViews:t?u&&!m(u,r.views)?u:null:[...w.rollbackViews]})}function _(e){const i=a.c(5),{org:s}=f(),r=e??"";let t;i[0]!==s.id||i[1]!==r?(t=c(s.id,r),i[0]=s.id,i[1]=r,i[2]=t):t=i[2];let n;i[3]!==t?(n={queryKey:t,queryFn:O,enabled:!1,staleTime:Number.POSITIVE_INFINITY},i[3]=t,i[4]=n):n=i[4];const{data:o}=y(n);return o?.views}async function O(){return null}function L(e){const i=a.c(4),{org:s}=f(),r=S();let t;return i[0]!==s||i[1]!==r||i[2]!==e?(t={stage:(n,o)=>p(r,s.id,e,n,o),snapshot:()=>C(r,s.id,e),settle:n=>k(r,s.id,e,n)},i[0]=s,i[1]=r,i[2]=e,i[3]=t):t=i[3],t}export{L as a,b,j as i,R as o,K as p,A as r,_ as u,x as w};