decocms 4.230.3 → 4.230.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/dist/client/assets/{AlertCircle-Bu6ExGrY.js → AlertCircle-D24NZ6JX.js} +1 -1
  2. package/dist/client/assets/{AreaChart-j_Vn5l3t.js → AreaChart-Df7T0xX9.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BMaVor0Q.js → ArrowLeft-ClSZrRnE.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CvqQDWHs.js → ArrowUp-D9kc1U6Q.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-Bzvhg_-n.js → ArrowUpRight-Yo-b5sty.js} +1 -1
  6. package/dist/client/assets/{Check-VVebrzt2.js → Check-DVNPIKeF.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BBu4m_da.js → CheckCircle-DO3PhkCs.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-EfAMK9pT.js → ChevronDown-Cum8U97F.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-D7aN5bxd.js → ChevronRight-D_F_Pz6f.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-DFedhyl_.js → ChevronUp-7kUtzNMs.js} +1 -1
  11. package/dist/client/assets/{Copy01-DrBVpl3W.js → Copy01-DSJE-8XG.js} +1 -1
  12. package/dist/client/assets/{CpuChip01-BKaJJ4m_.js → CpuChip01-DS5GiiRr.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-CEtuQD__.js → CreditCard01-CP8hfvYu.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-Cxyf682U.js → DotsVertical-C-XIkqp6.js} +1 -1
  15. package/dist/client/assets/{Eye-D6T7hv17.js → Eye-DfZwLLI4.js} +1 -1
  16. package/dist/client/assets/{FilterLines-D4tHcLuh.js → FilterLines-Df16keTM.js} +1 -1
  17. package/dist/client/assets/{Globe01-Cc6cPcFn.js → Globe01-CiZ6K50D.js} +1 -1
  18. package/dist/client/assets/{Globe04-ByCMDkAk.js → Globe04-BrjrYJgq.js} +1 -1
  19. package/dist/client/assets/{HardDrive-C3F3ymDY.js → HardDrive-DnMTXufl.js} +1 -1
  20. package/dist/client/assets/{Key01-CWx0IZ8t.js → Key01-CNYQAmjj.js} +1 -1
  21. package/dist/client/assets/{LayoutLeft-DDxzPTXc.js → LayoutLeft-Cp9do-jz.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-D28p3w5h.js → LinkExternal01-BbTXXd3j.js} +1 -1
  23. package/dist/client/assets/{LogOut01-Dc7EB7P7.js → LogOut01-D3edsFbW.js} +1 -1
  24. package/dist/client/assets/{Monitor01-DpVvm_dG.js → Monitor01-BpTHnMS3.js} +1 -1
  25. package/dist/client/assets/{Palette-CSIkZM9e.js → Palette-8dmJHRB1.js} +1 -1
  26. package/dist/client/assets/{Play-BKcW5Ltd.js → Play-Cc_YB2O_.js} +1 -1
  27. package/dist/client/assets/{Plus-lEDj1tD4.js → Plus-SpUv_Rja.js} +1 -1
  28. package/dist/client/assets/{SearchLg-BImfCif8.js → SearchLg-BuSZNu0R.js} +1 -1
  29. package/dist/client/assets/{SearchMd-Bp_SZoFd.js → SearchMd-DtiJ2SSN.js} +1 -1
  30. package/dist/client/assets/{Settings02-Ddmj-_rX.js → Settings02-By8r6TUi.js} +1 -1
  31. package/dist/client/assets/{Share07-Bz9filIw.js → Share07-Bo9wbkgC.js} +1 -1
  32. package/dist/client/assets/{Shield01-CalwrQWc.js → Shield01-CSwAKW6P.js} +1 -1
  33. package/dist/client/assets/{Star01-DdVllepq.js → Star01-C2x6hDQ7.js} +1 -1
  34. package/dist/client/assets/{Stars01-BEc8Zx1b.js → Stars01-DwAiRyu0.js} +1 -1
  35. package/dist/client/assets/{Stars02-BaCAMNCE.js → Stars02-DaZ3j-aR.js} +1 -1
  36. package/dist/client/assets/{Sun-BW6MD8X_.js → Sun-DDnC2msh.js} +1 -1
  37. package/dist/client/assets/{SwitchHorizontal01-B0jQBh1u.js → SwitchHorizontal01-BGM7r3Iy.js} +1 -1
  38. package/dist/client/assets/{Tool01-DBwwsjlM.js → Tool01-fl-TLnCB.js} +1 -1
  39. package/dist/client/assets/{Tool02-BDvmwXON.js → Tool02-Dqktxztf.js} +1 -1
  40. package/dist/client/assets/{Trash01-Bw199Lku.js → Trash01-D9H4R3uX.js} +1 -1
  41. package/dist/client/assets/{TrendUp01-BfZ8vdoS.js → TrendUp01-Cmr3WLDv.js} +1 -1
  42. package/dist/client/assets/{Upload01-OmSaIQJN.js → Upload01-DZ_c6TAy.js} +1 -1
  43. package/dist/client/assets/{User01-D31Gwa2x.js → User01-CYUgcf3V.js} +1 -1
  44. package/dist/client/assets/{Users01-CSb_wkLT.js → Users01-NeRTgKj0.js} +1 -1
  45. package/dist/client/assets/{Users03-ai5cefFL.js → Users03-D1XEEN16.js} +1 -1
  46. package/dist/client/assets/{X-C2d4nrvL.js → X-n0jXBeww.js} +1 -1
  47. package/dist/client/assets/{XCircle-ClA1zHL2.js → XCircle-BcNBYINC.js} +1 -1
  48. package/dist/client/assets/{XClose-BgxeMnjI.js → XClose-Cm8k6lmk.js} +1 -1
  49. package/dist/client/assets/{YAxis-Ik9cr_dn.js → YAxis-CdaxuQqA.js} +1 -1
  50. package/dist/client/assets/{Zap-S0uNkay8.js → Zap-Bh6p9Leq.js} +1 -1
  51. package/dist/client/assets/{ZapSquare-BMZtVSrf.js → ZapSquare-0gp8rcyd.js} +1 -1
  52. package/dist/client/assets/{access-gate-C0MvIMnD.js → access-gate-ChRHPxMb.js} +1 -1
  53. package/dist/client/assets/{agent-icon-DlY3-evM.js → agent-icon-CQnuWd-1.js} +1 -1
  54. package/dist/client/assets/{agents-list-BBwiFDAo.js → agents-list-CAm7qZXc.js} +1 -1
  55. package/dist/client/assets/{ai-providers-W5DTA57b.js → ai-providers-bPPlP3lc.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-GuGVjqJ3.js → alert-dialog-Br0MLuzi.js} +1 -1
  57. package/dist/client/assets/{alert-D-ckkM7h.js → alert-m_aktut6.js} +1 -1
  58. package/dist/client/assets/{api-keys-DknPmUI8.js → api-keys-0PguqXmL.js} +1 -1
  59. package/dist/client/assets/{app-editor-CFRy-_2I.js → app-editor-B8v76QMJ.js} +1 -1
  60. package/dist/client/assets/{auth-BZXTBNqo.js → auth-CLy6a0Q4.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-BkuCMYUF.js → auth-catchall-CWbVrByI.js} +1 -1
  62. package/dist/client/assets/{auth-entry-CcNg4Cmy.js → auth-entry-CjNLP4BX.js} +1 -1
  63. package/dist/client/assets/{auth-split-layout-BS8NdfHY.js → auth-split-layout-CudLEqBb.js} +1 -1
  64. package/dist/client/assets/{authenticate-and-persist-oauth-BpHQ1IZF.js → authenticate-and-persist-oauth-DPkUzRkh.js} +1 -1
  65. package/dist/client/assets/{automation-list-row-DdUXn40b.js → automation-list-row-DSifkYnG.js} +1 -1
  66. package/dist/client/assets/{automation-runs-DAYAGebQ.js → automation-runs-B614gUHd.js} +1 -1
  67. package/dist/client/assets/{automations-D-tNqPqt.js → automations-pXZ98JkB.js} +1 -1
  68. package/dist/client/assets/{avatar-C0LO_460.js → avatar-BdLqzSys.js} +1 -1
  69. package/dist/client/assets/{badge-CPggBa_r.js → badge-Ca4WNQdv.js} +1 -1
  70. package/dist/client/assets/{billing-Cz-TcpV2.js → billing-Cq6B8ave.js} +1 -1
  71. package/dist/client/assets/{block-document-Cxmz6AOT.js → block-document-C8bl3vez.js} +1 -1
  72. package/dist/client/assets/{brand-context-DKS8UmxM.js → brand-context-B0GOkkdH.js} +1 -1
  73. package/dist/client/assets/{buckets-ChTNkp_C.js → buckets-BHSlKT1V.js} +1 -1
  74. package/dist/client/assets/{bulk-category-panel-6JGCsRb7.js → bulk-category-panel-fSXgEcq2.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-B_kH3Gyo.js → capability-load-error-a4GExOlu.js} +1 -1
  76. package/dist/client/assets/{card-DjhPSLpN.js → card-DdnOP2GL.js} +1 -1
  77. package/dist/client/assets/{cards-C0fcTwuf.js → cards-D67as7_0.js} +1 -1
  78. package/dist/client/assets/{category-editor-DYOD_q3-.js → category-editor-BTzFr8xe.js} +1 -1
  79. package/dist/client/assets/{chart-jxdS1qw8.js → chart-BXj7UAF9.js} +1 -1
  80. package/dist/client/assets/{chat-context-CgsLZjf8.js → chat-context-BijaIXLm.js} +1 -1
  81. package/dist/client/assets/{checkbox-DHkDg8dA.js → checkbox-BeuiINmZ.js} +1 -1
  82. package/dist/client/assets/{cli-auth-success-DsRKOUtc.js → cli-auth-success-C_KQ2fRN.js} +1 -1
  83. package/dist/client/assets/{collection-detail-M8S5CsoM.js → collection-detail-Cd0f33Vj.js} +1 -1
  84. package/dist/client/assets/{collection-display-button-DNIaXmZQ.js → collection-display-button-BXeUC5O1.js} +1 -1
  85. package/dist/client/assets/{collection-search-JngJ2KYM.js → collection-search-DrDBe5Le.js} +1 -1
  86. package/dist/client/assets/{collection-table-wrapper-DxbVtOcQ.js → collection-table-wrapper-k1rwJHuk.js} +1 -1
  87. package/dist/client/assets/{collection-tabs-CoGc8WBU.js → collection-tabs-CtWVHyYQ.js} +1 -1
  88. package/dist/client/assets/{command-Dy8YUaoh.js → command-BboXbj7A.js} +1 -1
  89. package/dist/client/assets/{commerce-onboarding-Bca4_sKz.js → commerce-onboarding-D-0WZPXx.js} +1 -1
  90. package/dist/client/assets/{connect-DGVQXLNL.js → connect-Bx9gXvq2.js} +1 -1
  91. package/dist/client/assets/{connection-C1BWf2YZ.js → connection-DrwmgVAh.js} +1 -1
  92. package/dist/client/assets/{connection-card-C-ij5xJ_.js → connection-card-vSmkgw3v.js} +1 -1
  93. package/dist/client/assets/{connection-detail-D4uLqvdl.js → connection-detail-Ciuv-ikp.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-CIwwwP2Z.js → connection-form-helpers-iOwnCGIp.js} +1 -1
  95. package/dist/client/assets/{connections-CxtQXI8q.js → connections-BRHYmnZ8.js} +1 -1
  96. package/dist/client/assets/{decopilot-sse-pool-BsJkQ-Dq.js → decopilot-sse-pool-CuiSPfAg.js} +1 -1
  97. package/dist/client/assets/{dialog-CeWauzZ9.js → dialog-BuBE8RXK.js} +1 -1
  98. package/dist/client/assets/{domain-settings-CQubhroM.js → domain-settings-Cv7hJkX5.js} +1 -1
  99. package/dist/client/assets/{drawer-DFm1ZTc4.js → drawer-Coyu4wrg.js} +1 -1
  100. package/dist/client/assets/{dropdown-menu-BSfz8AHZ.js → dropdown-menu-CmldVswF.js} +1 -1
  101. package/dist/client/assets/{empty-state-CCaNIZkK.js → empty-state-CjvTDh-9.js} +1 -1
  102. package/dist/client/assets/{extract-connection-data-C1r7iMQz.js → extract-connection-data-Cnqnhzlx.js} +1 -1
  103. package/dist/client/assets/{file-explorer-BU9VKk8z.js → file-explorer-DdVmRFoH.js} +1 -1
  104. package/dist/client/assets/{file-type-icon-B6DLjqBQ.js → file-type-icon-B_J4Ih_m.js} +1 -1
  105. package/dist/client/assets/{form-B50Gp2pz.js → form-BzYBFO9S.js} +1 -1
  106. package/dist/client/assets/{general-Bor6pjeK.js → general-DjI9kVOX.js} +1 -1
  107. package/dist/client/assets/{github-repo-picker-BMAsYdt1.js → github-repo-picker-DAvnUoUV.js} +1 -1
  108. package/dist/client/assets/{hooks-CPXE8Vtq.js → hooks-CrtcRddV.js} +1 -1
  109. package/dist/client/assets/{index-CJTKBueg.js → index-BEM6Ktlq.js} +1 -1
  110. package/dist/client/assets/{index-Bd-2J4Za.js → index-BMI69eRM.js} +1 -1
  111. package/dist/client/assets/{index-X1QDIpgh.js → index-BOkgMIN6.js} +1 -1
  112. package/dist/client/assets/{index-C4Ven5LQ.js → index-BfVYqptD.js} +1 -1
  113. package/dist/client/assets/{index-kg-ZSOgA.js → index-Bq6VcTDr.js} +3 -3
  114. package/dist/client/assets/{index-Bh_Crwca.js → index-DOoH-GO6.js} +7 -7
  115. package/dist/client/assets/{index-DMesOYPd.js → index-DZ9lreXJ.js} +1 -1
  116. package/dist/client/assets/{index-RS3QupV9.js → index-DfLIoKd6.js} +1 -1
  117. package/dist/client/assets/{index-Dr7uuusf.js → index-Q0sM_0i9.js} +1 -1
  118. package/dist/client/assets/{index-Dd7D2VjQ.js → index-gUJ2hXhs.js} +1 -1
  119. package/dist/client/assets/{index-redirect-jbgZtBF-.js → index-redirect-B8eefvuA.js} +1 -1
  120. package/dist/client/assets/{infra-billing-CfwywWfv.js → infra-billing-DLRyDsZM.js} +1 -1
  121. package/dist/client/assets/{input-BnmfZog1.js → input-1vmmmkuD.js} +1 -1
  122. package/dist/client/assets/{integration-icon-CAW-qeo0.js → integration-icon-CNCw3lse.js} +1 -1
  123. package/dist/client/assets/{invite-member-dialog-RnnIPFGE.js → invite-member-dialog-BYYJe56n.js} +1 -1
  124. package/dist/client/assets/{label-OtmYS0fe.js → label-Bhq8k_-e.js} +1 -1
  125. package/dist/client/assets/{layout-BbaMYxBG.js → layout-BIT-cIL8.js} +1 -1
  126. package/dist/client/assets/{login-CEpRchkM.js → login-DGGQBeBj.js} +1 -1
  127. package/dist/client/assets/{mcp-oauth-pn21A40G.js → mcp-oauth-DmeRjgyR.js} +1 -1
  128. package/dist/client/assets/{members-6FjP_22b.js → members-BNcdwBCK.js} +1 -1
  129. package/dist/client/assets/{monaco-editor-CqNIzGE7.js → monaco-editor-CAjD4Tf5.js} +1 -1
  130. package/dist/client/assets/{monitoring-stats-row-CLTWTuQd.js → monitoring-stats-row-C3oFFf_q.js} +1 -1
  131. package/dist/client/assets/{multi-select-C7WKuKHJ.js → multi-select-C970vnvi.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-C9Ev3S5D.js → oauth-callback-DqEQK--r.js} +1 -1
  133. package/dist/client/assets/{oauth-callback-ai-provider-D33xaYKH.js → oauth-callback-ai-provider-C-HmbytH.js} +1 -1
  134. package/dist/client/assets/{onboarding-C6SvhSYs.js → onboarding-CZEfmobz.js} +1 -1
  135. package/dist/client/assets/{org-layout-BikI8aeC.js → org-layout-DxEFIO5-.js} +1 -1
  136. package/dist/client/assets/{organization-choice-B9LTF1LL.js → organization-choice-DGMzp_CZ.js} +1 -1
  137. package/dist/client/assets/{orgs-nwR--7s2.js → orgs-Dv3k6Vmy.js} +1 -1
  138. package/dist/client/assets/{page-seo-form-DeX63aDK.js → page-seo-form-BzXUzXrC.js} +1 -1
  139. package/dist/client/assets/{popover-DI-bB5ra.js → popover-Dgsvl9u9.js} +1 -1
  140. package/dist/client/assets/{post-editor-DZkFBVWJ.js → post-editor-BrUt7Wcm.js} +1 -1
  141. package/dist/client/assets/{primitives-BkBW30Z6.js → primitives-BWRFRtBL.js} +1 -1
  142. package/dist/client/assets/{profile-CwMkSgYt.js → profile-B3sEwiKK.js} +1 -1
  143. package/dist/client/assets/{project-app-view-DpP1Pxgj.js → project-app-view-Cxw9MGHS.js} +1 -1
  144. package/dist/client/assets/record-editor-DYBDin-q.js +1 -0
  145. package/dist/client/assets/{redirect-editor-BNUsBE-O.js → redirect-editor-Hfol_hze.js} +1 -1
  146. package/dist/client/assets/registry-DLTPriVD.js +2 -0
  147. package/dist/client/assets/{registry-layout-CgBRMI3h.js → registry-layout-Cc07RWpe.js} +1 -1
  148. package/dist/client/assets/{reports-DCjxZkZj.js → reports-BfjjK4-B.js} +1 -1
  149. package/dist/client/assets/{require-capability-Dq9ZpVA3.js → require-capability-BUkjJU1v.js} +1 -1
  150. package/dist/client/assets/{required-auth-layout-CBewHqYZ.js → required-auth-layout-Bp_FJmEJ.js} +1 -1
  151. package/dist/client/assets/{reset-password-CSmaVn2Z.js → reset-password-1lWiL3NM.js} +1 -1
  152. package/dist/client/assets/{roles-D_VqTIKy.js → roles-Cze3QnU7.js} +1 -1
  153. package/dist/client/assets/{search-input-Bf9e_uzs.js → search-input-BpFmjH6K.js} +1 -1
  154. package/dist/client/assets/{secrets-C6tn9bJ-.js → secrets-D13Kil-S.js} +1 -1
  155. package/dist/client/assets/{sections-editor-Deaqxa0h.js → sections-editor-BJeumTCx.js} +1 -1
  156. package/dist/client/assets/{select-model-CDmuWdr2.js → select-model-Ca6dO-aJ.js} +1 -1
  157. package/dist/client/assets/{select-BxkbK2eN.js → select-tWo5VlMc.js} +1 -1
  158. package/dist/client/assets/{self-tool-result-DZ5xhqTQ.js → self-tool-result-BOQw_tpA.js} +1 -1
  159. package/dist/client/assets/{seo-editor-DNqk_zlq.js → seo-editor-DmsAd4Xb.js} +1 -1
  160. package/dist/client/assets/{settings-layout-jsf-ZRBw.js → settings-layout-fcAYterg.js} +1 -1
  161. package/dist/client/assets/{settings-section-CDR865dm.js → settings-section-BEh0gl7O.js} +1 -1
  162. package/dist/client/assets/{shell-controls-CZ1W-7sn.js → shell-controls-D10LX9wJ.js} +1 -1
  163. package/dist/client/assets/{shell-layout-DE2uZR8l.js → shell-layout-H--bHJtv.js} +1 -1
  164. package/dist/client/assets/{sidebar-CgwL929s.js → sidebar-lEN4X0np.js} +1 -1
  165. package/dist/client/assets/{skeleton-DU9H9Rn8.js → skeleton-CxyBlRWq.js} +1 -1
  166. package/dist/client/assets/{spinner-bBcAZ-j4.js → spinner-COGMbDan.js} +1 -1
  167. package/dist/client/assets/{sso-C2_octZW.js → sso-j8yOVSfF.js} +1 -1
  168. package/dist/client/assets/store-registry-bLfJBpwL.js +2 -0
  169. package/dist/client/assets/{store-DwzX01Jy.js → store-v5iXMLHs.js} +1 -1
  170. package/dist/client/assets/{studio-tools-BmlJiF0x.js → studio-tools-BTpwQvwy.js} +1 -1
  171. package/dist/client/assets/{switch-C7yO858u.js → switch-DNRtZDbC.js} +1 -1
  172. package/dist/client/assets/{synced-repos-B18gp7ZA.js → synced-repos-CkbRcXeB.js} +1 -1
  173. package/dist/client/assets/{tab-id-D3yGqatB.js → tab-id-CqBvZfSB.js} +1 -1
  174. package/dist/client/assets/{table-CnNTL73E.js → table-C8RWKWiJ.js} +1 -1
  175. package/dist/client/assets/{tabs-CDW2HpKx.js → tabs-DzT0VTLd.js} +1 -1
  176. package/dist/client/assets/{textarea-BP7rD9j-.js → textarea-CQKL--HF.js} +1 -1
  177. package/dist/client/assets/{toggle-group-DA6H7I5f.js → toggle-group-iqvBivLq.js} +1 -1
  178. package/dist/client/assets/{toolbar-DptBHkfg.js → toolbar-FEPWtZlW.js} +1 -1
  179. package/dist/client/assets/{tooltip-DZJqdNvl.js → tooltip-BIUlyaT-.js} +1 -1
  180. package/dist/client/assets/{track-DxLXF40a.js → track-B98wUJgX.js} +1 -1
  181. package/dist/client/assets/{types-BLNmyFj6.js → types-C621MXjZ.js} +1 -1
  182. package/dist/client/assets/{use-ai-providers-DKF_51f7.js → use-ai-providers-B3OLr_7n.js} +1 -1
  183. package/dist/client/assets/{use-api-keys-Czup1KZK.js → use-api-keys-DSNzLtIK.js} +1 -1
  184. package/dist/client/assets/{use-automations-Dpx2oVoi.js → use-automations-C2ph3BF9.js} +1 -1
  185. package/dist/client/assets/{use-autosave-UZvYvwiP.js → use-autosave-f1RuEjsj.js} +1 -1
  186. package/dist/client/assets/{use-capability-COHQ5Lgh.js → use-capability-BDE9Sdwp.js} +1 -1
  187. package/dist/client/assets/{use-clock-tick-DSMY7npz.js → use-clock-tick-DJawD0B9.js} +1 -1
  188. package/dist/client/assets/{use-commerce-diagnostic-DO9Cm_Dg.js → use-commerce-diagnostic-DOS4QNYC.js} +1 -1
  189. package/dist/client/assets/{use-connection-Bfh8ZrSI.js → use-connection-BTpeO5DY.js} +1 -1
  190. package/dist/client/assets/{use-copy-DprVKicO.js → use-copy-iSR03vu2.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-CA-IadO2.js → use-create-virtual-mcp-0zTem60P.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-DTmY2t04.js → use-debounced-autosave-CXyQyws-.js} +1 -1
  193. package/dist/client/assets/{use-debounced-value-BFV6Wfmd.js → use-debounced-value-B2L9pP26.js} +1 -1
  194. package/dist/client/assets/{use-decopilot-events-DV0Z4Daq.js → use-decopilot-events-BEkepYaX.js} +1 -1
  195. package/dist/client/assets/{use-delete-connection-CEt39ndP.js → use-delete-connection-DL3PAt8k.js} +1 -1
  196. package/dist/client/assets/{use-deployment-admin-Dxr3TAWo.js → use-deployment-admin-BMsMcrIG.js} +1 -1
  197. package/dist/client/assets/{use-file-configs-CRHRg3Zc.js → use-file-configs-B5G3IJYE.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-h6ZXByHB.js → use-infinite-scroll-BqE_eY64.js} +1 -1
  199. package/dist/client/assets/{use-infra-billing-DpAiy2ec.js → use-infra-billing-BXLGyrFz.js} +1 -1
  200. package/dist/client/assets/{use-join-requests-Bv8IKVIq.js → use-join-requests-BkA7hcIc.js} +1 -1
  201. package/dist/client/assets/{use-mcp-client-EDB_37py.js → use-mcp-client-WnKNmVwt.js} +1 -1
  202. package/dist/client/assets/{use-mcp-tools-z_IP50QU.js → use-mcp-tools-DYHiKata.js} +1 -1
  203. package/dist/client/assets/{use-members-D4_18Dmo.js → use-members-D9X5lUWg.js} +1 -1
  204. package/dist/client/assets/{use-mobile-VYD32-4d.js → use-mobile-D1gX1FK-.js} +1 -1
  205. package/dist/client/assets/{use-navigate-to-agent-7p-eM9UE.js → use-navigate-to-agent-FaoHwIlm.js} +1 -1
  206. package/dist/client/assets/{use-open-billing-url-t7sDR_RF.js → use-open-billing-url-8coHWDFM.js} +1 -1
  207. package/dist/client/assets/{use-org-auth-client-Ddeyd0SK.js → use-org-auth-client-D6PZ3CAF.js} +1 -1
  208. package/dist/client/assets/{use-org-sso-Bn41W4kR.js → use-org-sso-B1hqNO9p.js} +1 -1
  209. package/dist/client/assets/{use-organization-roles-LmRXyzdK.js → use-organization-roles-CjOq_dr5.js} +1 -1
  210. package/dist/client/assets/{use-organization-settings-DHE23jmp.js → use-organization-settings-CwUg_Aat.js} +1 -1
  211. package/dist/client/assets/{use-registry-connections-ikmWVUtO.js → use-registry-connections-D5EbuWQu.js} +1 -1
  212. package/dist/client/assets/{use-secrets-C8b74Zmr.js → use-secrets-C-l2oRKq.js} +1 -1
  213. package/dist/client/assets/{use-section-preview-base-CqpGs8DG.js → use-section-preview-base-PwwtfHZm.js} +1 -1
  214. package/dist/client/assets/{use-status-sounds-BFAxTG8w.js → use-status-sounds-CJLXZaqg.js} +1 -1
  215. package/dist/client/assets/{use-tags-vcnhMois.js → use-tags-Tqn--kyL.js} +1 -1
  216. package/dist/client/assets/{use-view-mode-B5ly5ydP.js → use-view-mode-Cscqpbmo.js} +1 -1
  217. package/dist/client/assets/{use-virtual-mcp-DHXF-Pgh.js → use-virtual-mcp-Cpfnf8iu.js} +1 -1
  218. package/dist/client/assets/useInfiniteQuery-nUvwpEZ0.js +1 -0
  219. package/dist/client/assets/{useRouterState-hACiP0kP.js → useRouterState-lmuJjBkR.js} +1 -1
  220. package/dist/client/assets/useSuspenseInfiniteQuery-ZEBAbSvk.js +1 -0
  221. package/dist/client/assets/{users-Bc5jgwrz.js → users-CGpRrOXR.js} +1 -1
  222. package/dist/client/assets/{variant-calendar-y3NzHsoA.js → variant-calendar-B3cUFOkg.js} +1 -1
  223. package/dist/client/assets/{view-mode-toggle-CYceKIti.js → view-mode-toggle-DT-NlPdq.js} +1 -1
  224. package/dist/client/index.html +1 -1
  225. package/dist/server/cli.js +1 -1
  226. package/dist/server/server.js +1 -1
  227. package/package.json +1 -1
  228. package/dist/client/assets/record-editor-D1-sKCvC.js +0 -1
  229. package/dist/client/assets/registry-EdMrdjgS.js +0 -2
  230. package/dist/client/assets/store-registry-DenmkSS6.js +0 -2
  231. package/dist/client/assets/useInfiniteQuery-D-JYd4d5.js +0 -1
  232. package/dist/client/assets/useSuspenseInfiniteQuery-C_DdxgOB.js +0 -1
@@ -1 +1 @@
1
- import{c as G,b as tt,r as et,j as s,m as ot,B as nt}from"./index-kg-ZSOgA.js";import{w as vt,a7 as dt,aK as yt}from"./agent-icon-DlY3-evM.js";import{i as Tt}from"./ChevronRight-D7aN5bxd.js";import{L as jt}from"./label-OtmYS0fe.js";import{B as pt}from"./automation-runs-DAYAGebQ.js";import{S as wt}from"./switch-C7yO858u.js";import{T as Nt,c as kt,a as Mt}from"./tooltip-DZJqdNvl.js";import{V as _t}from"./view-mode-toggle-CYceKIti.js";import"./AlertCircle-Bu6ExGrY.js";import"./Tool01-DBwwsjlM.js";import"./ArrowUp-CvqQDWHs.js";import"./ArrowLeft-BMaVor0Q.js";import"./Tool02-BDvmwXON.js";import"./XCircle-ClA1zHL2.js";import"./ArrowUpRight-Bzvhg_-n.js";import"./TrendUp01-BfZ8vdoS.js";import"./ZapSquare-BMZtVSrf.js";import"./Users03-ai5cefFL.js";import"./CheckCircle-BBu4m_da.js";import"./Check-VVebrzt2.js";import"./ChevronDown-EfAMK9pT.js";import"./ChevronUp-DFedhyl_.js";import"./DotsVertical-Cxyf682U.js";import"./Stars02-BaCAMNCE.js";import"./Copy01-DrBVpl3W.js";import"./CpuChip01-BKaJJ4m_.js";import"./CreditCard01-CEtuQD__.js";import"./Globe01-Cc6cPcFn.js";import"./Settings02-Ddmj-_rX.js";import"./Eye-D6T7hv17.js";import"./FilterLines-D4tHcLuh.js";import"./Share07-Bz9filIw.js";import"./Star01-DdVllepq.js";import"./Globe04-ByCMDkAk.js";import"./SwitchHorizontal01-B0jQBh1u.js";import"./HardDrive-C3F3ymDY.js";import"./Key01-CWx0IZ8t.js";import"./LayoutLeft-DDxzPTXc.js";import"./LinkExternal01-D28p3w5h.js";import"./LogOut01-Dc7EB7P7.js";import"./Monitor01-DpVvm_dG.js";import"./Sun-BW6MD8X_.js";import"./Palette-CSIkZM9e.js";import"./Play-BKcW5Ltd.js";import"./Plus-lEDj1tD4.js";import"./SearchLg-BImfCif8.js";import"./SearchMd-Bp_SZoFd.js";import"./Shield01-CalwrQWc.js";import"./Stars01-BEc8Zx1b.js";import"./Trash01-Bw199Lku.js";import"./Upload01-OmSaIQJN.js";import"./User01-D31Gwa2x.js";import"./Users01-CSb_wkLT.js";import"./XClose-BgxeMnjI.js";import"./X-C2d4nrvL.js";import"./Zap-S0uNkay8.js";import"./select-BxkbK2eN.js";import"./useInfiniteQuery-D-JYd4d5.js";import"./use-infinite-scroll-h6ZXByHB.js";import"./use-connection-Bfh8ZrSI.js";import"./use-mcp-client-EDB_37py.js";import"./auth-BZXTBNqo.js";import"./use-virtual-mcp-DHXF-Pgh.js";import"./card-DjhPSLpN.js";import"./sidebar-CgwL929s.js";import"./use-mobile-VYD32-4d.js";import"./table-CnNTL73E.js";import"./empty-state-CCaNIZkK.js";import"./use-members-D4_18Dmo.js";import"./use-org-auth-client-Ddeyd0SK.js";import"./use-clock-tick-DSMY7npz.js";import"./use-automations-Dpx2oVoi.js";import"./studio-tools-BmlJiF0x.js";import"./useSuspenseInfiniteQuery-C_DdxgOB.js";import"./avatar-C0LO_460.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DprVKicO.js";import"./dialog-CeWauzZ9.js";import"./tab-id-D3yGqatB.js";import"./hooks-CPXE8Vtq.js";import"./decopilot-sse-pool-BsJkQ-Dq.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-CgsLZjf8.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-DKF_51f7.js";import"./use-decopilot-events-DV0Z4Daq.js";import"./use-organization-settings-DHE23jmp.js";import"./monaco-editor-CqNIzGE7.js";import"./spinner-bBcAZ-j4.js";import"./types-BLNmyFj6.js";import"./shell-layout-DE2uZR8l.js";import"./required-auth-layout-CBewHqYZ.js";import"./use-org-sso-Bn41W4kR.js";import"./integration-icon-CAW-qeo0.js";import"./use-navigate-to-agent-7p-eM9UE.js";import"./reusable-new-chat-CouMjkYR.js";import"./chart-jxdS1qw8.js";import"./index-DMesOYPd.js";import"./form-B50Gp2pz.js";import"./input-BnmfZog1.js";import"./file-type-icon-B6DLjqBQ.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Dt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:n}=e,r=typeof t=="string",i=typeof n=="string";if(!r&&!i)return null;const o=r?new Date(t):Ct,a=i?new Date(n):Dt;return Number.isNaN(o.getTime())||Number.isNaN(a.getTime())||r&&i&&a.getTime()<=o.getTime()?null:{start:o,end:a,openStart:!r,openEnd:!i}}function ft(e,t){if(!e||typeof e!="object")return;const n=e.__resolveType;if(typeof n=="string"){if(Et.has(n)){const r=Rt(e);r&&t.push(r);return}if(St.has(n)){const r=e.matchers;if(Array.isArray(r))for(const i of r)ft(i,t)}}}function Ot(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const n=e.variants;return Array.isArray(n)}function It(e){if(typeof e=="string"){const m=e.trim();if(m.length===0)return null;try{const c=new URL(m).pathname.split("/").filter(Boolean),d=c[c.length-1];if(d)return decodeURIComponent(d)}catch{}return m.length>80?`${m.slice(0,77)}…`:m}if(!e||typeof e!="object")return null;const t=e,n=t.config,i=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,n?.title,n?.name,n?.typeAlert?.message,i?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const m of o)if(typeof m=="string"&&m.trim().length>0)return m.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];typeof r=="number"?t.length>0?t[t.length-1]+=`[${r}]`:t.push(`[${r}]`):t.push(r)}return t.join(" · ")}function X(e,t,n,r,i){if(Ot(e)){const o=e.variants,a=e.__resolveType,m=$t.test(a)?"":Pt(r);o.forEach((l,c)=>{if(!l||typeof l!="object")return;const d=l,f=[];if(ft(d.rule,f),f.length===0)return;const x=It(d.value)??(m||n);for(const h of f)i.push({blockKey:t,blockLabel:n,innerPath:m,variantIndex:c,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:a})});for(let l=0;l<o.length;l++){const c=o[l];c&&typeof c=="object"&&X(c.value,t,n,[...r,"variants",l,"value"],i)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)X(e[o],t,n,[...r,o],i);return}if(e&&typeof e=="object")for(const[o,a]of Object.entries(e))o!=="__resolveType"&&X(a,t,n,[...r,o],i)}function Ft(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e))X(r,n,Lt(n),[],t);return t.sort((n,r)=>n.start.getTime()-r.start.getTime())}function Vt(e){const t=[...new Set(e)].sort(),n=new Map;return t.forEach((r,i)=>{const o=i*137.508%360;n.set(r,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),n}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function ut(e,t){return e.get(t)??Ht}const Bt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ht=["January","February","March","April","May","June","July","August","September","October","November","December"],gt=1440*60*1e3;function B(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function xt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Y(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function Z(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function st(e,t){return Math.round((B(e).getTime()-B(t).getTime())/gt)}function Wt(e){const t=(e.getTime()-B(e).getTime())/gt;return Math.min(Math.max(t,0),1)}function it(e,t){return st(e,t)+Wt(e)}function zt(e){const t=Z(e,-e.getDay()),n=[];for(let r=0;r<6;r++){const i=[];for(let o=0;o<7;o++)i.push(Z(t,r*7+o));n.push(i)}for(;n.length>0&&n[n.length-1].every(r=>r.getMonth()!==e.getMonth());)n.pop();return n}function Kt(e,t){const n=B(e[0]),r=Z(n,7),i=n.getTime(),o=r.getTime(),a=[];for(const c of t){const d=B(c.start),f=B(c.end);if(f.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=f.getTime()>=r.getTime()?Z(r,-1):f,h=st(u,n),g=st(x,u)+1;if(g<=0)continue;const b=Math.max(c.start.getTime(),i),j=Math.min(c.end.getTime(),o),v=it(new Date(b),n),p=Math.max(it(new Date(j),n)-v,0);p<=0||a.push({variant:c,startCol:h,span:g,leftUnits:v,widthUnits:p})}a.sort((c,d)=>c.startCol-d.startCol||d.span-c.span||c.variant.blockKey.localeCompare(d.variant.blockKey));const m=[],l=[];for(const c of a){let d=m.findIndex(f=>f<=c.startCol);d===-1&&(d=m.length,m.push(0)),m[d]=c.startCol+c.span,l.push({...c,lane:d})}return l}const at=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Ut(e,t){const n=e.openStart?t("sandbox.variantCalendar.always"):at.format(e.start),r=e.openEnd?t("sandbox.variantCalendar.ongoing"):at.format(e.end);return`${n} → ${r}`}function Yt(e){const t=G.c(18),{variant:n}=e,r=tt();let i;t[0]!==n.blockLabel?(i=s.jsx("div",{className:"font-semibold",children:n.blockLabel}),t[0]=n.blockLabel,t[1]=i):i=t[1];let o;t[2]!==n.innerPath?(o=n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.innerPath}),t[2]=n.innerPath,t[3]=o):o=t[3];let a;t[4]!==n.blockLabel||t[5]!==n.innerPath||t[6]!==n.label?(a=n.label!==n.blockLabel&&n.label!==n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.label}),t[4]=n.blockLabel,t[5]=n.innerPath,t[6]=n.label,t[7]=a):a=t[7];let m;t[8]!==r||t[9]!==n?(m=Ut(n,r),t[8]=r,t[9]=n,t[10]=m):m=t[10];let l;t[11]!==m?(l=s.jsx("div",{className:"mt-1",children:m}),t[11]=m,t[12]=l):l=t[12];let c;return t[13]!==i||t[14]!==o||t[15]!==a||t[16]!==l?(c=s.jsx(Mt,{children:s.jsxs("div",{className:"text-xs",children:[i,o,a,l]})}),t[13]=i,t[14]=o,t[15]=a,t[16]=l,t[17]=c):c=t[17],c}const lt=16;function Gt(e,t){const n=e?"transparent":"#000 0",r=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${n}, #000 ${lt}px, #000 calc(100% - ${lt}px), ${r})`}function bt(e){const t=G.c(26),{variant:n,color:r,style:i,children:o,fadeStart:a,fadeEnd:m}=e,l=a===void 0?!1:a,c=m===void 0?!1:m;let d;t[0]!==c||t[1]!==l?(d=Gt(l,c),t[0]=c,t[1]=l,t[2]=d):d=t[2];const f=d;let u;t[3]!==l?(u=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=u):u=t[4];let x;t[5]!==c?(x=c&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=c,t[6]=x):x=t[6];let h;t[7]!==f?(h=f&&{maskImage:f,WebkitMaskImage:f},t[7]=f,t[8]=h):h=t[8];let g;t[9]!==r.bg||t[10]!==r.text||t[11]!==i||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:r.bg,color:r.text,borderRadius:4,...u,...x,...h,...i},t[9]=r.bg,t[10]=r.text,t[11]=i,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==o?(b=s.jsx("span",{className:"truncate",children:o}),t[16]=o,t[17]=b):b=t[17];let j;t[18]!==g||t[19]!==b?(j=s.jsx(Nt,{asChild:!0,children:s.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=j):j=t[20];let v;t[21]!==n?(v=s.jsx(Yt,{variant:n}),t[21]=n,t[22]=v):v=t[22];let p;return t[23]!==v||t[24]!==j?(p=s.jsxs(kt,{children:[j,v]}),t[23]=v,t[24]=j,t[25]=p):p=t[25],p}function or(e){const t=G.c(72),{decofile:n}=e,r=tt(),[i,o]=et.useState("calendar"),[a,m]=et.useState(Xt),[l,c]=et.useState(!1);let d,f,u;if(t[0]!==n||t[1]!==l){const P=Ft(n);d=P.filter(Qt).length,u=l?P:P.filter(qt),f=Vt(u.map(Jt)),t[0]=n,t[1]=l,t[2]=d,t[3]=f,t[4]=u}else d=t[2],f=t[3],u=t[4];const x=f;let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>m(xt(new Date)),t[5]=h):h=t[5];const g=h;let b;t[6]!==i?(b=()=>m(P=>i==="calendar"?Y(P,-1):Y(P,-3)),t[6]=i,t[7]=b):b=t[7];const j=b;let v;t[8]!==i?(v=()=>m(P=>i==="calendar"?Y(P,1):Y(P,3)),t[8]=i,t[9]=v):v=t[9];const p=v;let y;t[10]!==r?(y=r("sandbox.variantCalendar.today"),t[10]=r,t[11]=y):y=t[11];let T;t[12]!==y?(T=s.jsx(nt,{variant:"outline",size:"sm",onClick:g,children:y}),t[12]=y,t[13]=T):T=t[13];let N;t[14]!==r?(N=r("sandbox.variantCalendar.previous"),t[14]=r,t[15]=N):N=t[15];let D;t[16]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(vt,{size:16}),t[16]=D):D=t[16];let k;t[17]!==j||t[18]!==N?(k=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:j,"aria-label":N,children:D}),t[17]=j,t[18]=N,t[19]=k):k=t[19];let M;t[20]!==r?(M=r("sandbox.variantCalendar.next"),t[20]=r,t[21]=M):M=t[21];let S;t[22]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Tt,{size:16}),t[22]=S):S=t[22];let A;t[23]!==p||t[24]!==M?(A=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:p,"aria-label":M,children:S}),t[23]=p,t[24]=M,t[25]=A):A=t[25];const $=ht[a.getMonth()];let C;t[26]!==a?(C=a.getFullYear(),t[26]=a,t[27]=C):C=t[27];let _;t[28]!==$||t[29]!==C?(_=s.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[$," ",C]}),t[28]=$,t[29]=C,t[30]=_):_=t[30];let w;t[31]!==A||t[32]!==_||t[33]!==T||t[34]!==k?(w=s.jsxs("div",{className:"flex items-center gap-2",children:[T,k,A,_]}),t[31]=A,t[32]=_,t[33]=T,t[34]=k,t[35]=w):w=t[35];let L;t[36]!==d||t[37]!==l||t[38]!==r?(L=d>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wt,{id:"show-ongoing",checked:l,onCheckedChange:c}),s.jsx(jt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:r("sandbox.variantCalendar.showOngoing",{count:d})})]}),t[36]=d,t[37]=l,t[38]=r,t[39]=L):L=t[39];let H;t[40]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(dt,{}),t[40]=H):H=t[40];let F;t[41]!==r?(F=r("sandbox.variantCalendar.calendarMode"),t[41]=r,t[42]=F):F=t[42];let E;t[43]!==F?(E={value:"calendar",icon:H,label:F},t[43]=F,t[44]=E):E=t[44];let W;t[45]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(yt,{}),t[45]=W):W=t[45];let R;t[46]!==r?(R=r("sandbox.variantCalendar.timelineMode"),t[46]=r,t[47]=R):R=t[47];let O;t[48]!==R?(O={value:"timeline",icon:W,label:R},t[48]=R,t[49]=O):O=t[49];let I;t[50]!==E||t[51]!==O?(I=[E,O],t[50]=E,t[51]=O,t[52]=I):I=t[52];let V;t[53]!==I||t[54]!==i?(V=s.jsx(_t,{value:i,onValueChange:o,options:I}),t[53]=I,t[54]=i,t[55]=V):V=t[55];let z;t[56]!==L||t[57]!==V?(z=s.jsxs("div",{className:"flex items-center gap-4",children:[L,V]}),t[56]=L,t[57]=V,t[58]=z):z=t[58];let K;t[59]!==w||t[60]!==z?(K=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[w,z]}),t[59]=w,t[60]=z,t[61]=K):K=t[61];let U;t[62]!==x||t[63]!==a||t[64]!==d||t[65]!==l||t[66]!==u||t[67]!==i?(U=u.length===0?s.jsx(Zt,{hiddenOngoing:l?0:d}):i==="calendar"?s.jsx(ee,{monthStart:a,variants:u,colorMap:x}):s.jsx(oe,{monthStart:a,variants:u,colorMap:x}),t[62]=x,t[63]=a,t[64]=d,t[65]=l,t[66]=u,t[67]=i,t[68]=U):U=t[68];let q;return t[69]!==K||t[70]!==U?(q=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[K,U]}),t[69]=K,t[70]=U,t[71]=q):q=t[71],q}function Jt(e){return e.blockKey}function qt(e){return!e.openEnd}function Qt(e){return e.openEnd}function Xt(){return xt(new Date)}function Zt(e){const t=G.c(4),{hiddenOngoing:n}=e,r=n===void 0?0:n,i=tt();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(dt,{size:24,className:"text-muted-foreground/60"}),t[0]=o):o=t[0];let a;return t[1]!==r||t[2]!==i?(a=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[o,r>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noDatedVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.hiddenOngoingVariants",{count:r})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noScheduledVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=r,t[2]=i,t[3]=a):a=t[3],a}const rt=20,ct=2,mt=28,te=6;function ee(e){const t=G.c(17),{monthStart:n,variants:r,colorMap:i}=e;let o,a,m,l,c;if(t[0]!==i||t[1]!==n||t[2]!==r){const u=zt(n),x=B(new Date);o=pt,c="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:Bt.map(re)}),t[8]=m):m=t[8],l=u.map((h,g)=>{const b=Kt(h,r),j=b.reduce(ne,0),v=mt+j*(rt+ct)+8;return s.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:v},children:[h.map((p,y)=>{const T=p.getMonth()===n.getMonth(),N=p.getTime()===x.getTime();return s.jsx("div",{className:ot("border-r last:border-r-0 px-2 pt-1.5 text-xs",T?"bg-background":"bg-muted/30 text-muted-foreground"),children:s.jsx("span",{className:ot("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:p.getDate()})},y)}),b.map((p,y)=>{const T=ut(i,p.variant.blockKey),N=mt+p.lane*(rt+ct),D=p.leftUnits/7*100,k=p.widthUnits/7*100,M=p.variant.openStart&&g===0,S=p.variant.openEnd&&g===u.length-1;return s.jsxs(bt,{variant:p.variant,color:T,fadeStart:M,fadeEnd:S,style:{top:N,left:`calc(${D}% + 2px)`,width:`calc(${k}% - 4px)`,minWidth:te,height:rt},children:[p.variant.blockLabel,p.variant.label!==p.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",p.variant.label]})]},`${g}-${y}`)})]},g)}),t[0]=i,t[1]=n,t[2]=r,t[3]=o,t[4]=a,t[5]=m,t[6]=l,t[7]=c}else o=t[3],a=t[4],m=t[5],l=t[6],c=t[7];let d;t[9]!==a||t[10]!==m||t[11]!==l?(d=s.jsxs("div",{className:a,children:[m,l]}),t[9]=a,t[10]=m,t[11]=l,t[12]=d):d=t[12];let f;return t[13]!==o||t[14]!==c||t[15]!==d?(f=s.jsx(o,{className:c,children:d}),t[13]=o,t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function ne(e,t){return Math.max(e,t.lane+1)}function re(e){return s.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const Q=4,se=32,J=240;function oe(e){const t=G.c(23),{monthStart:n,variants:r,colorMap:i}=e,o=n,a=Y(n,Q),m=new Date,l=new Map;for(const _ of r){const w=l.get(_.blockKey)??[];w.push(_),l.set(_.blockKey,w)}const c=Array.from(l.entries()).sort(le),d=a.getTime()-o.getTime(),f=_=>(Math.max(o.getTime(),Math.min(a.getTime(),_.getTime()))-o.getTime())/d*100;let u;t[0]!==o?(u=(_,w)=>Y(o,w),t[0]=o,t[1]=u):u=t[1];const x=Array.from({length:Q},u),h=m.getTime()>=o.getTime()&&m.getTime()<=a.getTime()?f(m):null,g=tt(),b=pt,j="flex-1 min-h-0",v="min-w-[900px] relative";let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p={width:J},t[2]=p):p=t[2];let y;t[3]!==g?(y=g("sandbox.variantCalendar.variantBlock"),t[3]=g,t[4]=y):y=t[4];let T;t[5]!==y?(T=s.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:p,children:y}),t[5]=y,t[6]=T):T=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const D=x.map(ae);let k;t[8]!==D?(k=s.jsx("div",{className:"flex-1 grid",style:N,children:D}),t[8]=D,t[9]=k):k=t[9];let M;t[10]!==T||t[11]!==k?(M=s.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[T,k]}),t[10]=T,t[11]=k,t[12]=M):M=t[12];let S;t[13]!==g||t[14]!==h?(S=h!==null&&s.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${J}px + (100% - ${J}px) * ${h} / 100)`},children:s.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:g("sandbox.variantCalendar.todayLabel")})}),t[13]=g,t[14]=h,t[15]=S):S=t[15];const A=c.map(_=>{const[w,L]=_,H=ut(i,w),F=L[0]?.blockLabel??w;return s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:s.jsx("div",{className:"px-3 truncate",style:{width:J},children:F})}),L.map((E,W)=>s.jsxs("div",{className:"flex border-b items-center",style:{height:se},children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:J},children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:H.bg}}),s.jsx("span",{className:"truncate text-foreground/80",children:E.label})]}),s.jsxs("div",{className:"relative flex-1 h-full",children:[s.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},children:x.map(ie)}),(()=>{const R=Math.max(E.start.getTime(),o.getTime()),O=Math.min(E.end.getTime(),a.getTime());if(O<=R)return null;const I=f(new Date(R)),V=f(new Date(O))-I;return s.jsx(bt,{variant:E,color:H,fadeStart:E.openStart,fadeEnd:E.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${I}%`,width:`calc(${V}% - 2px)`,height:22},children:E.label})})()]})]},W))]},w)});let $;t[16]!==M||t[17]!==S||t[18]!==A?($=s.jsxs("div",{className:v,children:[M,S,A]}),t[16]=M,t[17]=S,t[18]=A,t[19]=$):$=t[19];let C;return t[20]!==b||t[21]!==$?(C=s.jsx(b,{className:j,children:$}),t[20]=b,t[21]=$,t[22]=C):C=t[22],C}function ie(e,t){return s.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function ae(e,t){return s.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ht[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function le(e,t){return e[0].localeCompare(t[0])}export{or as VariantCalendar};
1
+ import{c as G,b as tt,r as et,j as s,m as ot,B as nt}from"./index-Bq6VcTDr.js";import{w as vt,a7 as dt,aK as yt}from"./agent-icon-CQnuWd-1.js";import{i as Tt}from"./ChevronRight-D_F_Pz6f.js";import{L as jt}from"./label-Bhq8k_-e.js";import{B as pt}from"./automation-runs-B614gUHd.js";import{S as wt}from"./switch-DNRtZDbC.js";import{T as Nt,c as kt,a as Mt}from"./tooltip-BIUlyaT-.js";import{V as _t}from"./view-mode-toggle-DT-NlPdq.js";import"./AlertCircle-D24NZ6JX.js";import"./Tool01-fl-TLnCB.js";import"./ArrowUp-D9kc1U6Q.js";import"./ArrowLeft-ClSZrRnE.js";import"./Tool02-Dqktxztf.js";import"./XCircle-BcNBYINC.js";import"./ArrowUpRight-Yo-b5sty.js";import"./TrendUp01-Cmr3WLDv.js";import"./ZapSquare-0gp8rcyd.js";import"./Users03-D1XEEN16.js";import"./CheckCircle-DO3PhkCs.js";import"./Check-DVNPIKeF.js";import"./ChevronDown-Cum8U97F.js";import"./ChevronUp-7kUtzNMs.js";import"./DotsVertical-C-XIkqp6.js";import"./Stars02-DaZ3j-aR.js";import"./Copy01-DSJE-8XG.js";import"./CpuChip01-DS5GiiRr.js";import"./CreditCard01-CP8hfvYu.js";import"./Globe01-CiZ6K50D.js";import"./Settings02-By8r6TUi.js";import"./Eye-DfZwLLI4.js";import"./FilterLines-Df16keTM.js";import"./Share07-Bo9wbkgC.js";import"./Star01-C2x6hDQ7.js";import"./Globe04-BrjrYJgq.js";import"./SwitchHorizontal01-BGM7r3Iy.js";import"./HardDrive-DnMTXufl.js";import"./Key01-CNYQAmjj.js";import"./LayoutLeft-Cp9do-jz.js";import"./LinkExternal01-BbTXXd3j.js";import"./LogOut01-D3edsFbW.js";import"./Monitor01-BpTHnMS3.js";import"./Sun-DDnC2msh.js";import"./Palette-8dmJHRB1.js";import"./Play-Cc_YB2O_.js";import"./Plus-SpUv_Rja.js";import"./SearchLg-BuSZNu0R.js";import"./SearchMd-DtiJ2SSN.js";import"./Shield01-CSwAKW6P.js";import"./Stars01-DwAiRyu0.js";import"./Trash01-D9H4R3uX.js";import"./Upload01-DZ_c6TAy.js";import"./User01-CYUgcf3V.js";import"./Users01-NeRTgKj0.js";import"./XClose-Cm8k6lmk.js";import"./X-n0jXBeww.js";import"./Zap-Bh6p9Leq.js";import"./select-tWo5VlMc.js";import"./useInfiniteQuery-nUvwpEZ0.js";import"./use-infinite-scroll-BqE_eY64.js";import"./use-connection-BTpeO5DY.js";import"./use-mcp-client-WnKNmVwt.js";import"./auth-CLy6a0Q4.js";import"./use-virtual-mcp-Cpfnf8iu.js";import"./card-DdnOP2GL.js";import"./sidebar-lEN4X0np.js";import"./use-mobile-D1gX1FK-.js";import"./table-C8RWKWiJ.js";import"./empty-state-CjvTDh-9.js";import"./use-members-D9X5lUWg.js";import"./use-org-auth-client-D6PZ3CAF.js";import"./use-clock-tick-DJawD0B9.js";import"./use-automations-C2ph3BF9.js";import"./studio-tools-BTpwQvwy.js";import"./useSuspenseInfiniteQuery-ZEBAbSvk.js";import"./avatar-BdLqzSys.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-iSR03vu2.js";import"./dialog-BuBE8RXK.js";import"./tab-id-CqBvZfSB.js";import"./hooks-CrtcRddV.js";import"./decopilot-sse-pool-CuiSPfAg.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-BijaIXLm.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-B3OLr_7n.js";import"./use-decopilot-events-BEkepYaX.js";import"./use-organization-settings-CwUg_Aat.js";import"./monaco-editor-CAjD4Tf5.js";import"./spinner-COGMbDan.js";import"./types-C621MXjZ.js";import"./shell-layout-H--bHJtv.js";import"./required-auth-layout-Bp_FJmEJ.js";import"./use-org-sso-B1hqNO9p.js";import"./integration-icon-CNCw3lse.js";import"./use-navigate-to-agent-FaoHwIlm.js";import"./reusable-new-chat-CouMjkYR.js";import"./chart-BXj7UAF9.js";import"./index-DZ9lreXJ.js";import"./form-BzYBFO9S.js";import"./input-1vmmmkuD.js";import"./file-type-icon-B_J4Ih_m.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Dt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:n}=e,r=typeof t=="string",i=typeof n=="string";if(!r&&!i)return null;const o=r?new Date(t):Ct,a=i?new Date(n):Dt;return Number.isNaN(o.getTime())||Number.isNaN(a.getTime())||r&&i&&a.getTime()<=o.getTime()?null:{start:o,end:a,openStart:!r,openEnd:!i}}function ft(e,t){if(!e||typeof e!="object")return;const n=e.__resolveType;if(typeof n=="string"){if(Et.has(n)){const r=Rt(e);r&&t.push(r);return}if(St.has(n)){const r=e.matchers;if(Array.isArray(r))for(const i of r)ft(i,t)}}}function Ot(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const n=e.variants;return Array.isArray(n)}function It(e){if(typeof e=="string"){const m=e.trim();if(m.length===0)return null;try{const c=new URL(m).pathname.split("/").filter(Boolean),d=c[c.length-1];if(d)return decodeURIComponent(d)}catch{}return m.length>80?`${m.slice(0,77)}…`:m}if(!e||typeof e!="object")return null;const t=e,n=t.config,i=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,n?.title,n?.name,n?.typeAlert?.message,i?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const m of o)if(typeof m=="string"&&m.trim().length>0)return m.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];typeof r=="number"?t.length>0?t[t.length-1]+=`[${r}]`:t.push(`[${r}]`):t.push(r)}return t.join(" · ")}function X(e,t,n,r,i){if(Ot(e)){const o=e.variants,a=e.__resolveType,m=$t.test(a)?"":Pt(r);o.forEach((l,c)=>{if(!l||typeof l!="object")return;const d=l,f=[];if(ft(d.rule,f),f.length===0)return;const x=It(d.value)??(m||n);for(const h of f)i.push({blockKey:t,blockLabel:n,innerPath:m,variantIndex:c,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:a})});for(let l=0;l<o.length;l++){const c=o[l];c&&typeof c=="object"&&X(c.value,t,n,[...r,"variants",l,"value"],i)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)X(e[o],t,n,[...r,o],i);return}if(e&&typeof e=="object")for(const[o,a]of Object.entries(e))o!=="__resolveType"&&X(a,t,n,[...r,o],i)}function Ft(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e))X(r,n,Lt(n),[],t);return t.sort((n,r)=>n.start.getTime()-r.start.getTime())}function Vt(e){const t=[...new Set(e)].sort(),n=new Map;return t.forEach((r,i)=>{const o=i*137.508%360;n.set(r,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),n}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function ut(e,t){return e.get(t)??Ht}const Bt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ht=["January","February","March","April","May","June","July","August","September","October","November","December"],gt=1440*60*1e3;function B(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function xt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Y(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function Z(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function st(e,t){return Math.round((B(e).getTime()-B(t).getTime())/gt)}function Wt(e){const t=(e.getTime()-B(e).getTime())/gt;return Math.min(Math.max(t,0),1)}function it(e,t){return st(e,t)+Wt(e)}function zt(e){const t=Z(e,-e.getDay()),n=[];for(let r=0;r<6;r++){const i=[];for(let o=0;o<7;o++)i.push(Z(t,r*7+o));n.push(i)}for(;n.length>0&&n[n.length-1].every(r=>r.getMonth()!==e.getMonth());)n.pop();return n}function Kt(e,t){const n=B(e[0]),r=Z(n,7),i=n.getTime(),o=r.getTime(),a=[];for(const c of t){const d=B(c.start),f=B(c.end);if(f.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=f.getTime()>=r.getTime()?Z(r,-1):f,h=st(u,n),g=st(x,u)+1;if(g<=0)continue;const b=Math.max(c.start.getTime(),i),j=Math.min(c.end.getTime(),o),v=it(new Date(b),n),p=Math.max(it(new Date(j),n)-v,0);p<=0||a.push({variant:c,startCol:h,span:g,leftUnits:v,widthUnits:p})}a.sort((c,d)=>c.startCol-d.startCol||d.span-c.span||c.variant.blockKey.localeCompare(d.variant.blockKey));const m=[],l=[];for(const c of a){let d=m.findIndex(f=>f<=c.startCol);d===-1&&(d=m.length,m.push(0)),m[d]=c.startCol+c.span,l.push({...c,lane:d})}return l}const at=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Ut(e,t){const n=e.openStart?t("sandbox.variantCalendar.always"):at.format(e.start),r=e.openEnd?t("sandbox.variantCalendar.ongoing"):at.format(e.end);return`${n} → ${r}`}function Yt(e){const t=G.c(18),{variant:n}=e,r=tt();let i;t[0]!==n.blockLabel?(i=s.jsx("div",{className:"font-semibold",children:n.blockLabel}),t[0]=n.blockLabel,t[1]=i):i=t[1];let o;t[2]!==n.innerPath?(o=n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.innerPath}),t[2]=n.innerPath,t[3]=o):o=t[3];let a;t[4]!==n.blockLabel||t[5]!==n.innerPath||t[6]!==n.label?(a=n.label!==n.blockLabel&&n.label!==n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.label}),t[4]=n.blockLabel,t[5]=n.innerPath,t[6]=n.label,t[7]=a):a=t[7];let m;t[8]!==r||t[9]!==n?(m=Ut(n,r),t[8]=r,t[9]=n,t[10]=m):m=t[10];let l;t[11]!==m?(l=s.jsx("div",{className:"mt-1",children:m}),t[11]=m,t[12]=l):l=t[12];let c;return t[13]!==i||t[14]!==o||t[15]!==a||t[16]!==l?(c=s.jsx(Mt,{children:s.jsxs("div",{className:"text-xs",children:[i,o,a,l]})}),t[13]=i,t[14]=o,t[15]=a,t[16]=l,t[17]=c):c=t[17],c}const lt=16;function Gt(e,t){const n=e?"transparent":"#000 0",r=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${n}, #000 ${lt}px, #000 calc(100% - ${lt}px), ${r})`}function bt(e){const t=G.c(26),{variant:n,color:r,style:i,children:o,fadeStart:a,fadeEnd:m}=e,l=a===void 0?!1:a,c=m===void 0?!1:m;let d;t[0]!==c||t[1]!==l?(d=Gt(l,c),t[0]=c,t[1]=l,t[2]=d):d=t[2];const f=d;let u;t[3]!==l?(u=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=u):u=t[4];let x;t[5]!==c?(x=c&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=c,t[6]=x):x=t[6];let h;t[7]!==f?(h=f&&{maskImage:f,WebkitMaskImage:f},t[7]=f,t[8]=h):h=t[8];let g;t[9]!==r.bg||t[10]!==r.text||t[11]!==i||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:r.bg,color:r.text,borderRadius:4,...u,...x,...h,...i},t[9]=r.bg,t[10]=r.text,t[11]=i,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==o?(b=s.jsx("span",{className:"truncate",children:o}),t[16]=o,t[17]=b):b=t[17];let j;t[18]!==g||t[19]!==b?(j=s.jsx(Nt,{asChild:!0,children:s.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=j):j=t[20];let v;t[21]!==n?(v=s.jsx(Yt,{variant:n}),t[21]=n,t[22]=v):v=t[22];let p;return t[23]!==v||t[24]!==j?(p=s.jsxs(kt,{children:[j,v]}),t[23]=v,t[24]=j,t[25]=p):p=t[25],p}function or(e){const t=G.c(72),{decofile:n}=e,r=tt(),[i,o]=et.useState("calendar"),[a,m]=et.useState(Xt),[l,c]=et.useState(!1);let d,f,u;if(t[0]!==n||t[1]!==l){const P=Ft(n);d=P.filter(Qt).length,u=l?P:P.filter(qt),f=Vt(u.map(Jt)),t[0]=n,t[1]=l,t[2]=d,t[3]=f,t[4]=u}else d=t[2],f=t[3],u=t[4];const x=f;let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>m(xt(new Date)),t[5]=h):h=t[5];const g=h;let b;t[6]!==i?(b=()=>m(P=>i==="calendar"?Y(P,-1):Y(P,-3)),t[6]=i,t[7]=b):b=t[7];const j=b;let v;t[8]!==i?(v=()=>m(P=>i==="calendar"?Y(P,1):Y(P,3)),t[8]=i,t[9]=v):v=t[9];const p=v;let y;t[10]!==r?(y=r("sandbox.variantCalendar.today"),t[10]=r,t[11]=y):y=t[11];let T;t[12]!==y?(T=s.jsx(nt,{variant:"outline",size:"sm",onClick:g,children:y}),t[12]=y,t[13]=T):T=t[13];let N;t[14]!==r?(N=r("sandbox.variantCalendar.previous"),t[14]=r,t[15]=N):N=t[15];let D;t[16]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(vt,{size:16}),t[16]=D):D=t[16];let k;t[17]!==j||t[18]!==N?(k=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:j,"aria-label":N,children:D}),t[17]=j,t[18]=N,t[19]=k):k=t[19];let M;t[20]!==r?(M=r("sandbox.variantCalendar.next"),t[20]=r,t[21]=M):M=t[21];let S;t[22]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Tt,{size:16}),t[22]=S):S=t[22];let A;t[23]!==p||t[24]!==M?(A=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:p,"aria-label":M,children:S}),t[23]=p,t[24]=M,t[25]=A):A=t[25];const $=ht[a.getMonth()];let C;t[26]!==a?(C=a.getFullYear(),t[26]=a,t[27]=C):C=t[27];let _;t[28]!==$||t[29]!==C?(_=s.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[$," ",C]}),t[28]=$,t[29]=C,t[30]=_):_=t[30];let w;t[31]!==A||t[32]!==_||t[33]!==T||t[34]!==k?(w=s.jsxs("div",{className:"flex items-center gap-2",children:[T,k,A,_]}),t[31]=A,t[32]=_,t[33]=T,t[34]=k,t[35]=w):w=t[35];let L;t[36]!==d||t[37]!==l||t[38]!==r?(L=d>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wt,{id:"show-ongoing",checked:l,onCheckedChange:c}),s.jsx(jt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:r("sandbox.variantCalendar.showOngoing",{count:d})})]}),t[36]=d,t[37]=l,t[38]=r,t[39]=L):L=t[39];let H;t[40]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(dt,{}),t[40]=H):H=t[40];let F;t[41]!==r?(F=r("sandbox.variantCalendar.calendarMode"),t[41]=r,t[42]=F):F=t[42];let E;t[43]!==F?(E={value:"calendar",icon:H,label:F},t[43]=F,t[44]=E):E=t[44];let W;t[45]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(yt,{}),t[45]=W):W=t[45];let R;t[46]!==r?(R=r("sandbox.variantCalendar.timelineMode"),t[46]=r,t[47]=R):R=t[47];let O;t[48]!==R?(O={value:"timeline",icon:W,label:R},t[48]=R,t[49]=O):O=t[49];let I;t[50]!==E||t[51]!==O?(I=[E,O],t[50]=E,t[51]=O,t[52]=I):I=t[52];let V;t[53]!==I||t[54]!==i?(V=s.jsx(_t,{value:i,onValueChange:o,options:I}),t[53]=I,t[54]=i,t[55]=V):V=t[55];let z;t[56]!==L||t[57]!==V?(z=s.jsxs("div",{className:"flex items-center gap-4",children:[L,V]}),t[56]=L,t[57]=V,t[58]=z):z=t[58];let K;t[59]!==w||t[60]!==z?(K=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[w,z]}),t[59]=w,t[60]=z,t[61]=K):K=t[61];let U;t[62]!==x||t[63]!==a||t[64]!==d||t[65]!==l||t[66]!==u||t[67]!==i?(U=u.length===0?s.jsx(Zt,{hiddenOngoing:l?0:d}):i==="calendar"?s.jsx(ee,{monthStart:a,variants:u,colorMap:x}):s.jsx(oe,{monthStart:a,variants:u,colorMap:x}),t[62]=x,t[63]=a,t[64]=d,t[65]=l,t[66]=u,t[67]=i,t[68]=U):U=t[68];let q;return t[69]!==K||t[70]!==U?(q=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[K,U]}),t[69]=K,t[70]=U,t[71]=q):q=t[71],q}function Jt(e){return e.blockKey}function qt(e){return!e.openEnd}function Qt(e){return e.openEnd}function Xt(){return xt(new Date)}function Zt(e){const t=G.c(4),{hiddenOngoing:n}=e,r=n===void 0?0:n,i=tt();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(dt,{size:24,className:"text-muted-foreground/60"}),t[0]=o):o=t[0];let a;return t[1]!==r||t[2]!==i?(a=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[o,r>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noDatedVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.hiddenOngoingVariants",{count:r})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noScheduledVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=r,t[2]=i,t[3]=a):a=t[3],a}const rt=20,ct=2,mt=28,te=6;function ee(e){const t=G.c(17),{monthStart:n,variants:r,colorMap:i}=e;let o,a,m,l,c;if(t[0]!==i||t[1]!==n||t[2]!==r){const u=zt(n),x=B(new Date);o=pt,c="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:Bt.map(re)}),t[8]=m):m=t[8],l=u.map((h,g)=>{const b=Kt(h,r),j=b.reduce(ne,0),v=mt+j*(rt+ct)+8;return s.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:v},children:[h.map((p,y)=>{const T=p.getMonth()===n.getMonth(),N=p.getTime()===x.getTime();return s.jsx("div",{className:ot("border-r last:border-r-0 px-2 pt-1.5 text-xs",T?"bg-background":"bg-muted/30 text-muted-foreground"),children:s.jsx("span",{className:ot("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:p.getDate()})},y)}),b.map((p,y)=>{const T=ut(i,p.variant.blockKey),N=mt+p.lane*(rt+ct),D=p.leftUnits/7*100,k=p.widthUnits/7*100,M=p.variant.openStart&&g===0,S=p.variant.openEnd&&g===u.length-1;return s.jsxs(bt,{variant:p.variant,color:T,fadeStart:M,fadeEnd:S,style:{top:N,left:`calc(${D}% + 2px)`,width:`calc(${k}% - 4px)`,minWidth:te,height:rt},children:[p.variant.blockLabel,p.variant.label!==p.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",p.variant.label]})]},`${g}-${y}`)})]},g)}),t[0]=i,t[1]=n,t[2]=r,t[3]=o,t[4]=a,t[5]=m,t[6]=l,t[7]=c}else o=t[3],a=t[4],m=t[5],l=t[6],c=t[7];let d;t[9]!==a||t[10]!==m||t[11]!==l?(d=s.jsxs("div",{className:a,children:[m,l]}),t[9]=a,t[10]=m,t[11]=l,t[12]=d):d=t[12];let f;return t[13]!==o||t[14]!==c||t[15]!==d?(f=s.jsx(o,{className:c,children:d}),t[13]=o,t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function ne(e,t){return Math.max(e,t.lane+1)}function re(e){return s.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const Q=4,se=32,J=240;function oe(e){const t=G.c(23),{monthStart:n,variants:r,colorMap:i}=e,o=n,a=Y(n,Q),m=new Date,l=new Map;for(const _ of r){const w=l.get(_.blockKey)??[];w.push(_),l.set(_.blockKey,w)}const c=Array.from(l.entries()).sort(le),d=a.getTime()-o.getTime(),f=_=>(Math.max(o.getTime(),Math.min(a.getTime(),_.getTime()))-o.getTime())/d*100;let u;t[0]!==o?(u=(_,w)=>Y(o,w),t[0]=o,t[1]=u):u=t[1];const x=Array.from({length:Q},u),h=m.getTime()>=o.getTime()&&m.getTime()<=a.getTime()?f(m):null,g=tt(),b=pt,j="flex-1 min-h-0",v="min-w-[900px] relative";let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p={width:J},t[2]=p):p=t[2];let y;t[3]!==g?(y=g("sandbox.variantCalendar.variantBlock"),t[3]=g,t[4]=y):y=t[4];let T;t[5]!==y?(T=s.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:p,children:y}),t[5]=y,t[6]=T):T=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const D=x.map(ae);let k;t[8]!==D?(k=s.jsx("div",{className:"flex-1 grid",style:N,children:D}),t[8]=D,t[9]=k):k=t[9];let M;t[10]!==T||t[11]!==k?(M=s.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[T,k]}),t[10]=T,t[11]=k,t[12]=M):M=t[12];let S;t[13]!==g||t[14]!==h?(S=h!==null&&s.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${J}px + (100% - ${J}px) * ${h} / 100)`},children:s.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:g("sandbox.variantCalendar.todayLabel")})}),t[13]=g,t[14]=h,t[15]=S):S=t[15];const A=c.map(_=>{const[w,L]=_,H=ut(i,w),F=L[0]?.blockLabel??w;return s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:s.jsx("div",{className:"px-3 truncate",style:{width:J},children:F})}),L.map((E,W)=>s.jsxs("div",{className:"flex border-b items-center",style:{height:se},children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:J},children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:H.bg}}),s.jsx("span",{className:"truncate text-foreground/80",children:E.label})]}),s.jsxs("div",{className:"relative flex-1 h-full",children:[s.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},children:x.map(ie)}),(()=>{const R=Math.max(E.start.getTime(),o.getTime()),O=Math.min(E.end.getTime(),a.getTime());if(O<=R)return null;const I=f(new Date(R)),V=f(new Date(O))-I;return s.jsx(bt,{variant:E,color:H,fadeStart:E.openStart,fadeEnd:E.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${I}%`,width:`calc(${V}% - 2px)`,height:22},children:E.label})})()]})]},W))]},w)});let $;t[16]!==M||t[17]!==S||t[18]!==A?($=s.jsxs("div",{className:v,children:[M,S,A]}),t[16]=M,t[17]=S,t[18]=A,t[19]=$):$=t[19];let C;return t[20]!==b||t[21]!==$?(C=s.jsx(b,{className:j,children:$}),t[20]=b,t[21]=$,t[22]=C):C=t[22],C}function ie(e,t){return s.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function ae(e,t){return s.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ht[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function le(e,t){return e[0].localeCompare(t[0])}export{or as VariantCalendar};
@@ -1 +1 @@
1
- import{c as $,r as T,m as f,j as i}from"./index-kg-ZSOgA.js";import{c as k,T as I,a as P}from"./tooltip-DZJqdNvl.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const l=M[_];let n;t[6]!==z?(n=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=n):n=t[7];let a;t[8]!==l||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?f(l.buttonWithLabel,"px-3"):l.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",l.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=l,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":l.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==n||t[25]!==a?(v=i.jsxs("div",{className:n,children:[a,u]}),t[23]=u,t[24]=n,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
1
+ import{c as $,r as T,m as f,j as i}from"./index-Bq6VcTDr.js";import{c as k,T as I,a as P}from"./tooltip-BIUlyaT-.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const l=M[_];let n;t[6]!==z?(n=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=n):n=t[7];let a;t[8]!==l||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?f(l.buttonWithLabel,"px-3"):l.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",l.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=l,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":l.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==n||t[25]!==a?(v=i.jsxs("div",{className:n,children:[a,u]}),t[23]=u,t[24]=n,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
@@ -50,7 +50,7 @@
50
50
  <meta name="twitter:description" content="Hire specialized agents, give them access to your tools, and let them deliver real projects — with planning, verification, and observability built in." />
51
51
  <meta name="twitter:image" content="/og-image.png" />
52
52
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
53
- <script type="module" crossorigin src="/assets/index-kg-ZSOgA.js"></script>
53
+ <script type="module" crossorigin src="/assets/index-Bq6VcTDr.js"></script>
54
54
  <link rel="stylesheet" crossorigin href="/assets/index-uptMkyg_.css">
55
55
  </head>
56
56
  <body>
@@ -1332,7 +1332,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var Vm1=O(()=>{ex()});f
1332
1332
  `.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${J}/${K}, keeping in old table`);continue}}await Mb`
1333
1333
  DELETE FROM kysely_migration WHERE name = ${X}
1334
1334
  `.execute($)}}async function it1($){await Yn6($),await Gn6($);let Z=new dt1({db:$,provider:{getMigrations:()=>Promise.resolve(tm0)}}),{error:X,results:Q}=await Z.migrateToLatest(),Y=0;if(Q?.forEach((G)=>{if(G.status==="Success")Y++;else if(G.status==="Error")console.error(`Failed to execute migration "${G.migrationName}"`)}),X)throw console.error("Failed to migrate"),console.error(X),X;return Y}async function Jn6($){let{keepOpen:Z=!1,database:X,skipBetterAuth:Q=!1}=$??{},Y="skipped";if(!Q&&!X)Y=await Ec0();let G=X??N6(),J=async()=>{if(!Z&&!X)await MB(G).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await it1(G.db);return await J(),{betterAuth:Y,kysely:K}}catch(K){throw await J(),K}}async function Kn6(){let $=N6(),Z=new dt1({db:$.db,provider:{getMigrations:()=>Promise.resolve(tm0)}}),{error:X,results:Q}=await Z.migrateDown();if(Q?.forEach((Y)=>{if(Y.status==="Success")console.log(`\u2705 Migration "${Y.migrationName}" rolled back successfully`);else if(Y.status==="Error")console.error(`\u274C Failed to rollback migration "${Y.migrationName}"`)}),X)throw console.error("Failed to rollback migration"),console.error(X),X}var pt1=O(()=>{lt1();zc0();ZX()});async function XZ0($){let Z={...process.env},X=p10($,Z);console.log(WO1(X.settings.encryptionKey));let Q=X.settings.betterAuthSecret||(X.settings.localMode?Yn1(X.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (U90(),H90)),{outputs:G,services:J}=await Y({home:X.settings.dataDir,externalDatabaseUrl:X.externalDatabaseUrl,externalNatsUrl:X.externalNatsUrl});if(!X.skipMigrations){let{migrateBetterAuth:W}=await Promise.resolve().then(() => (zc0(),Jn1));await W(G.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (ZX(),Ti1)),{migrateToLatest:U}=await Promise.resolve().then(() => (pt1(),nt1)),N=H(G.databaseUrl);await U({keepOpen:!0,database:N,skipBetterAuth:!0})}let K={...X.settings,betterAuthSecret:Q,databaseUrl:G.databaseUrl,natsUrls:G.natsUrls,...G.s3?{s3Endpoint:G.s3.endpoint,s3Bucket:G.s3.bucket,s3AccessKeyId:G.s3.accessKeyId,s3SecretAccessKey:G.s3.secretAccessKey,s3ForcePathStyle:G.s3.forcePathStyle}:{},...G.natsTunnel?{natsPublicUrl:G.natsTunnel.publicUrl,natsAccountJwt:G.natsTunnel.accountJwt,natsAccountSigningKey:G.natsTunnel.accountSigningKey,natsOperatorJwt:G.natsTunnel.operatorJwt,natsTunnelPublicEnabled:!0,natsCredsPath:G.natsTunnel.credsPath}:{}};return km1(K),{settings:K,services:J.map((W)=>({name:W.name==="PostgreSQL"?"Postgres":W.name,port:W.port})),managedServiceNames:J.filter((W)=>W.owner==="managed").map((W)=>W.name)}}var om0=O(()=>{ex();Gn1();q8()});var rt1={};w0(rt1,{updateService:()=>WE,subscribeCliState:()=>sm0,setTuiConsoleIntercepted:()=>QZ0,setServerUrl:()=>wi,setMigrationsDone:()=>Bi,setDevMode:()=>Un6,resetCliStateForTests:()=>Wn6,isTuiConsoleIntercepted:()=>YZ0,getCliState:()=>am0,addLogEntry:()=>_B});function tt1(){return{services:[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}],migrationsStatus:"pending",serverUrl:null,logs:[]}}function Wn6(){hQ=tt1()}function Hn6(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function Fi(){for(let $ of rm0)$()}function am0(){return hQ}function sm0($){return rm0.add($),()=>rm0.delete($)}function WE($){hQ={...hQ,services:hQ.services.map((Z)=>Z.name===$.name?$:Z)},Fi()}function Bi(){hQ={...hQ,migrationsStatus:"done"},Fi()}function wi($){hQ={...hQ,serverUrl:$},Fi()}function _B($){let Z=[...hQ.logs,$];hQ={...hQ,logs:Z.length>500?Z.slice(-500):Z},Fi()}function Un6(){hQ={...hQ,services:[...Hn6(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},Fi()}function QZ0($){ot1=$}function YZ0(){return ot1}var hQ,rm0,ot1=!1;var HE=O(()=>{hQ=tt1();rm0=new Set});import{createServer as at1}from"net";function Nn6($){return new Promise((Z)=>{let X=at1();X.once("error",()=>Z(!1)),X.listen($,"0.0.0.0",()=>{X.close(()=>Z(!0))})})}async function Oi($){if(await Nn6($))return $;let Z=await new Promise((X,Q)=>{let Y=at1();Y.once("error",Q),Y.listen(0,"0.0.0.0",()=>{let G=Y.address(),J=typeof G==="object"&&G?G.port:0;Y.close(()=>X(J))})});return console.warn(`Port ${$} is in use, using port ${Z} instead.`),Z}var em0=()=>{};function Li($){return $.replace(/\x1b\[[0-9;]*m/g,"")}var $i0={};w0($i0,{startDevServer:()=>Bn6});import{join as Fn6}from"path";function st1($){let Z=$.getReader(),X=new TextDecoder,Q="";function Y(){let G=Q.split(`
1335
- `);Q=G.pop()??"";for(let J of G){let K=Li(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;_B({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{for(;;){let{done:G,value:J}=await Z.read();if(G)break;Q+=X.decode(J,{stream:!0}),Y()}if(Q.trim()){let G=Li(Q).replace(/^\[\d+\]\s*/,"").trim();if(G)_B({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function Bn6($){let{baseUrl:Z,noTui:X}=$,Q=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=Q?process.env.PORT:$.vitePort,G=Z||`http://localhost:${Y}`,J=Q?await Oi(Number(Y)+1):await Oi(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await XZ0({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let L of W)WE({name:L.name,status:"ready",port:L.port});Bi();let U=Fn6(import.meta.dir,"..","..","..","..",".."),N=X===!0,F=Bun.spawn(["bun","run","dev:servers"],{cwd:U,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Y),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:G,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...K.betterAuthSecret?{BETTER_AUTH_SECRET:K.betterAuthSecret}:{},...K.s3Endpoint?{S3_ENDPOINT:K.s3Endpoint,S3_BUCKET:K.s3Bucket??"",S3_ACCESS_KEY_ID:K.s3AccessKeyId??"",S3_SECRET_ACCESS_KEY:K.s3SecretAccessKey??"",S3_FORCE_PATH_STYLE:String(K.s3ForcePathStyle)}:{},...K.natsPublicUrl&&K.natsAccountJwt&&K.natsAccountSigningKey?{NATS_PUBLIC_URL:K.natsPublicUrl,NATS_ACCOUNT_JWT:K.natsAccountJwt,NATS_ACCOUNT_SIGNING_KEY:K.natsAccountSigningKey,NATS_OPERATOR_JWT:K.natsOperatorJwt??"",NATS_TUNNEL_PUBLIC_ENABLED:"true",...K.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}}:{}},stdio:["inherit",N?"inherit":"pipe",N?"inherit":"pipe"]});if(!N)st1(F.stdout),st1(F.stderr);wi(G),WE({name:"Vite",status:"ready",port:Number(Y)}),WE({name:"API",status:"ready",port:Number(K.port)});let w=async(L)=>{if(F.kill(L),await F.exited,H.length>0){let{stopServices:D}=await Promise.resolve().then(() => (U90(),H90));await D(K.dataDir)}};return process.on("SIGINT",()=>w("SIGINT")),process.on("SIGTERM",()=>w("SIGTERM")),{port:Number(Y),process:F}}var Zi0=O(()=>{om0();HE();em0()});var GZ0;var Xi0=O(()=>{GZ0={name:"decocms",version:"4.230.3",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@inkjs/ui":"^2.0.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/shared":"workspace:*","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@nats-io/jwt":"0.0.10-5","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@types/bun":"^1.3.1","@types/google.maps":"^3.65.2","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@vercel/nft":"^1.1.1",ai:"^6.0.208","better-auth":"1.4.22",croner:"^9.1.0",degit:"^2.8.4",hono:"^4.10.7",jose:"^6.0.11",nanoid:"^5.1.6",pg:"^8.16.3",typescript:"^7.0.2",typescript5:"npm:typescript@^5.9.3",zod:"4.3.6"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as On6,Text as et1}from"ink";import{jsx as Ln6,jsxs as $o1}from"react/jsx-runtime";function Zo1({version:$}){return $o1(On6,{flexDirection:"column",marginTop:1,children:[v90.map((Z,X)=>Ln6(et1,{color:x90[X],children:Z},X)),$o1(et1,{dimColor:!0,children:[" v",$]})]})}var Xo1=O(()=>{Zi()});import{Box as UE,Text as vB}from"ink";import{Spinner as Dn6}from"@inkjs/ui";import{jsx as rY,jsxs as Vb}from"react/jsx-runtime";function Qo1({status:$}){if($==="pending")return rY(Dn6,{label:""});return rY(vB,{color:"green",children:"\u2713"})}function En6($){return`${$.name}: ${$.port||"...."}`}function Yo1({services:$,migrationsStatus:Z,home:X,serverUrl:Q}){return Vb(UE,{flexDirection:"column",paddingBottom:1,children:[rY(Zo1,{version:GZ0.version}),rY(UE,{marginBottom:1,children:rY(vB,{dimColor:!0,children:"\u2500".repeat(80)})}),rY(UE,{children:Vb(vB,{dimColor:!0,children:["Home: ",X]})}),Vb(UE,{gap:2,children:[$.map((Y)=>Vb(UE,{gap:1,children:[rY(vB,{children:En6(Y)}),rY(Qo1,{status:Y.status})]},Y.name)),Vb(UE,{gap:1,children:[rY(vB,{children:"Migrations"}),rY(Qo1,{status:Z})]})]}),rY(UE,{children:Q?Vb(vB,{children:["Open in browser: ",rY(vB,{color:"cyan",children:Q})]}):rY(vB,{dimColor:!0,children:"Starting..."})})]})}var Go1=O(()=>{Xi0();Xo1()});import{Box as zn6,Text as Di}from"ink";import{jsx as Qi0,jsxs as Yi0}from"react/jsx-runtime";function jn6($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function Jo1({logs:$}){return Qi0(zn6,{flexDirection:"column",children:$.map((Z,X)=>{if(Z.rawLine)return Qi0(Di,{dimColor:!0,children:Z.rawLine},X);let Q=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return Yi0(Di,{children:[Yi0(Di,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),Qi0(Di,{color:jn6(Z.status),children:Z.status}),Yi0(Di,{dimColor:!0,children:[" ",Q.padStart(8)]})]},X)})})}var Ko1=()=>{};var Gi0={};w0(Gi0,{App:()=>Tn6});import{Box as Pn6}from"ink";import{useSyncExternalStore as An6}from"react";import{jsx as Wo1,jsxs as Rn6}from"react/jsx-runtime";function Tn6({home:$}){let Z=An6(sm0,am0);return Rn6(Pn6,{flexDirection:"column",children:[Wo1(Yo1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Wo1(Jo1,{logs:Z.logs})]})}var Ji0=O(()=>{Go1();Ko1();HE()});var SJ="thread-gate",dU="decopilot-hosted-harness",H3="automations",xB="background-tools",NE="task-board-github-reads";var Ho1="7";function Uo1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:Ho1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var No1=()=>{};function In6(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function Ki0($,Z){for(let X=0;X<$.length;X++){let Q=$[X];if(Q===void 0)continue;if(Q===Z)return $[X+1];if(Q.startsWith(`${Z}=`))return Q.slice(Z.length+1)}return}function Fo1(){let $=In6();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:Ki0($,"--cpu-prof-dir")??process.cwd(),name:Ki0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(Ki0($,"--cpu-prof-interval")??1000),note:"profile is written on process exit"}));return}if(process.env.CPU_PROFILE)console.warn(JSON.stringify({msg:"cpu-profiling-requested-but-inactive",hint:'CPU profiling is a Bun launch flag. Set BUN_OPTIONS="--cpu-prof --cpu-prof-md --cpu-prof-dir=/tmp" before starting the process.'}))}function Bo1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let X=YE();if(!X)return;let Q={};try{let{heapStats:Y}=await import("bun:jsc"),G=Y(),J=Object.entries(G.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);Q={objectCount:G.objectCount,heapSize:G.heapSize,top:Object.fromEntries(J)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:X.rss,heapUsed:X.heapUsed,heapTotal:X.heapTotal,external:X.external,arrayBuffers:X.arrayBuffers,...Q}))};return Z().catch(()=>{}),JZ0=setInterval(()=>void Z().catch(()=>{}),$),JZ0.unref?.(),process.on("SIGUSR2",()=>{try{let X=Bun.generateHeapSnapshot("v8"),Q=typeof X==="string"?X:JSON.stringify(X),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,Q),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(X){console.error("[heap-watch] snapshot failed:",X)}}),()=>{if(JZ0)clearInterval(JZ0)}}var JZ0;var wo1=()=>{};import*as qn6 from"bun:jsc";function Oo1(){if(process.env.STALL_WATCHDOG!=="1")return()=>{};let $=Number(process.env.STALL_WATCHDOG_MS??100),Z=Number(process.env.STALL_WATCHDOG_TICK_MS??50);try{Mn6()}catch(G){return console.error("[stall-watchdog] failed to start sampling profiler:",G),()=>{}}let X,Q=performance.now()+Z,Y=()=>{let G=performance.now(),J=G-Q;Q=G+Z;let K=[];try{K=Vn6()?.traces??[]}catch{}if(J>$&&K.length>0){let W=new Map;for(let U of K){let N=U.frames.find((w)=>w.sourceURL&&!/Unknown Executable/.test(w.category??""))??U.frames[0];if(!N)continue;let F=(N.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${N.name??"?"} @ ${F}:${N.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((U,N)=>N[1]-U[1]).slice(0,8).map(([U,N])=>({frame:U,count:N}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(J),samplesInWindow:K.length,top:H}))}X=setTimeout(Y,Z),X.unref?.()};return X=setTimeout(Y,Z),X.unref?.(),()=>{if(X)clearTimeout(X)}}var Mn6,Vn6;var Lo1=O(()=>{({startSamplingProfiler:Mn6,samplingProfilerStackTraces:Vn6}=qn6)});function Do1(){Fo1();let $=[Bo1(),Oi1(),Oo1()];return()=>{for(let Z of $)Z()}}var Eo1=O(()=>{Wc0();wo1();Lo1()});var FE=_((zo1)=>{Object.defineProperty(zo1,"__esModule",{value:!0});zo1.RepublishHeaders=zo1.DirectMsgHeaders=zo1.JsHeaders=zo1.AdvisoryKind=void 0;zo1.isOrderedPushConsumerOptions=kn6;zo1.isPullConsumer=Sn6;zo1.isPushConsumer=Cn6;zo1.isBoundPushConsumerOptions=_n6;function kn6($){if($&&typeof $==="object")return"name_prefix"in $||"deliver_subject_prefix"in $||"filter_subjects"in $||"filter_subject"in $||"deliver_policy"in $||"opt_start_seq"in $||"opt_start_time"in $||"replay_policy"in $||"inactive_threshold"in $||"headers_only"in $||"deliver_prefix"in $;return!1}function Sn6($){return $.isPullConsumer()}function Cn6($){return $.isPushConsumer()}function _n6($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}zo1.AdvisoryKind={API:"api_audit",StreamAction:"stream_action",ConsumerAction:"consumer_action",SnapshotCreate:"snapshot_create",SnapshotComplete:"snapshot_complete",RestoreCreate:"restore_create",RestoreComplete:"restore_complete",MaxDeliver:"max_deliver",Terminated:"terminated",Ack:"consumer_ack",StreamLeaderElected:"stream_leader_elected",StreamQuorumLost:"stream_quorum_lost",ConsumerLeaderElected:"consumer_leader_elected",ConsumerQuorumLost:"consumer_quorum_lost"};zo1.JsHeaders={StreamSourceHdr:"Nats-Stream-Source",LastConsumerSeqHdr:"Nats-Last-Consumer",LastStreamSeqHdr:"Nats-Last-Stream",ConsumerStalledHdr:"Nats-Consumer-Stalled",MessageSizeHdr:"Nats-Msg-Size",RollupHdr:"Nats-Rollup",RollupValueSubject:"sub",RollupValueAll:"all",PendingMessagesHdr:"Nats-Pending-Messages",PendingBytesHdr:"Nats-Pending-Bytes",RequiredApiLevel:"Nats-Required-Api-Level"};zo1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};zo1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var aY=_((Po1)=>{Object.defineProperty(Po1,"__esModule",{value:!0});Po1.TD=Po1.TE=Po1.Empty=void 0;Po1.encode=cn6;Po1.decode=ln6;Po1.Empty=new Uint8Array(0);Po1.TE=new TextEncoder;Po1.TD=new TextDecoder;function un6(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}function cn6(...$){let Z=[];for(let X=0;X<$.length;X++)Z.push(Po1.TE.encode($[X]));if(Z.length===0)return Po1.Empty;if(Z.length===1)return Z[0];return un6(...Z)}function ln6($){if(!$||$.length===0)return"";return Po1.TD.decode($)}});var sY=_((Ro1)=>{Object.defineProperty(Ro1,"__esModule",{value:!0});Ro1.errors=Ro1.PermissionViolationError=Ro1.NoRespondersError=Ro1.TimeoutError=Ro1.RequestError=Ro1.ProtocolError=Ro1.ConnectionError=Ro1.DrainingConnectionError=Ro1.ClosedConnectionError=Ro1.AuthorizationError=Ro1.UserAuthenticationExpiredError=Ro1.InvalidOperationError=Ro1.InvalidArgumentError=Ro1.InvalidSubjectError=void 0;class Hi0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}Ro1.InvalidSubjectError=Hi0;class KZ0 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,X){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((Q)=>`'${Q}'`),$=$.join(",");else $=`'${$}'`;return new KZ0(`${$} ${Z}`,X)}}Ro1.InvalidArgumentError=KZ0;class Ui0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}Ro1.InvalidOperationError=Ui0;class WZ0 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new WZ0($);return null}}Ro1.UserAuthenticationExpiredError=WZ0;class HZ0 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],X=$.toLowerCase();for(let Q=0;Q<Z.length;Q++)if(X.indexOf(Z[Q])!==-1)return new HZ0($);return null}}Ro1.AuthorizationError=HZ0;class Ni0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}Ro1.ClosedConnectionError=Ni0;class Fi0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}Ro1.DrainingConnectionError=Fi0;class Bi0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}Ro1.ConnectionError=Bi0;class wi0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}Ro1.ProtocolError=wi0;class Oi0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof UZ0}}Ro1.RequestError=Oi0;class Li0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}Ro1.TimeoutError=Li0;class UZ0 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}Ro1.NoRespondersError=UZ0;class NZ0 extends Error{operation;subject;queue;constructor($,Z,X,Q,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=X,this.queue=Q}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let X="publish",Q="",Y=void 0,G=$.match(/(Publish|Subscription) to "(\S+)"/);if(G){if(X=G[1].toLowerCase(),Q=G[2],X==="subscription"){let J=$.match(/using queue "(\S+)"/);if(J)Y=J[1]}}return new NZ0($,X,Q,Y)}}Ro1.PermissionViolationError=NZ0;Ro1.errors={AuthorizationError:HZ0,ClosedConnectionError:Ni0,ConnectionError:Bi0,DrainingConnectionError:Fi0,InvalidArgumentError:KZ0,InvalidOperationError:Ui0,InvalidSubjectError:Hi0,NoRespondersError:UZ0,PermissionViolationError:NZ0,ProtocolError:wi0,RequestError:Oi0,TimeoutError:Li0,UserAuthenticationExpiredError:WZ0}});var CJ=_((ko1)=>{Object.defineProperty(ko1,"__esModule",{value:!0});ko1.SimpleMutex=ko1.Perf=void 0;ko1.extend=Gp6;ko1.render=Jp6;ko1.timeout=Kp6;ko1.delay=Wp6;ko1.deadline=Hp6;ko1.deferred=Ei0;ko1.debugDeferred=Up6;ko1.shuffle=Np6;ko1.collect=Fp6;ko1.jitter=Vo1;ko1.backoff=Bp6;ko1.nanos=wp6;ko1.millis=Op6;ko1.randomToken=Ep6;var Yp6=aY(),Di0=sY();function Gp6($,...Z){for(let X=0;X<Z.length;X++){let Q=Z[X];Object.keys(Q).forEach(function(Y){$[Y]=Q[Y]})}return $}function Jp6($){return Yp6.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function Kp6($,Z=!0){let X=Z?new Di0.TimeoutError:null,Q,Y,G=new Promise((J,K)=>{Q={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(X===null)K(new Di0.TimeoutError);else K(X)},$)});return Object.assign(G,Q)}function Wp6($=0){let Z,X=new Promise((Q)=>{let Y=setTimeout(()=>{Q()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),Q()}}});return Object.assign(X,Z)}async function Hp6($,Z=1000){let X=Ei0(),Q=setTimeout(()=>{X.reject(new Di0.TimeoutError)},Z);try{return await Promise.race([$,X])}finally{clearTimeout(Q)}}function Ei0(){let $={},Z=new Promise((X,Q)=>{$={resolve:X,reject:Q}});return Object.assign(Z,$)}function Up6(){let $={},Z=new Promise((X,Q)=>{$={resolve:(Y)=>{console.trace("resolve",Y),X(Y)},reject:(Y)=>{console.trace("reject"),Q(Y)}}});return Object.assign(Z,$)}function Np6($){for(let Z=$.length-1;Z>0;Z--){let X=Math.floor(Math.random()*(Z+1));[$[Z],$[X]]=[$[X],$[Z]]}return $}async function Fp6($){let Z=[];for await(let X of $)Z.push(X);return Z}class qo1{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,X){let Q=this.timers.get(Z);if(Q===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(X);if(Y===void 0)throw Error(`${X} is not defined`);this.measures.set($,Y-Q)}getEntries(){let $=[];return this.measures.forEach((Z,X)=>{$.push({name:X,duration:Z})}),$}}ko1.Perf=qo1;class Mo1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=Ei0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}ko1.SimpleMutex=Mo1;function Vo1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function Bp6($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(X){return Vo1(X>Z?$[Z]:$[X])}}}function wp6($){return $*1e6}function Op6($){return Math.floor($/1e6)}var Lp6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",mU=new Uint8Array(62);for(let $=0;$<62;$++)mU[$]=Lp6.charCodeAt($);var Dp6=218340105584896;function Ep6(){let $=Math.floor(Math.random()*Dp6),Z=$%62,X=mU[Z];$=($-Z)/62,Z=$%62;let Q=mU[Z];$=($-Z)/62,Z=$%62;let Y=mU[Z];$=($-Z)/62,Z=$%62;let G=mU[Z];$=($-Z)/62,Z=$%62;let J=mU[Z];$=($-Z)/62,Z=$%62;let K=mU[Z];$=($-Z)/62,Z=$%62;let W=mU[Z];$=($-Z)/62;let H=mU[$];return String.fromCharCode(X,Q,Y,G,J,K,W,H)}});var yo1=_((fo1)=>{Object.defineProperty(fo1,"__esModule",{value:!0});fo1.nuid=fo1.NuidImpl=void 0;var xp6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",fB=62,BZ0=12,vo1=10,Co1=33,fp6=333,_o1=BZ0+vo1,ji0=new Uint8Array(fB);for(let $=0;$<fB;$++)ji0[$]=xp6.charCodeAt($);var FZ0=4294967296,xo1=BigInt(fB)**BigInt(vo1),Ei=Number(xo1/(1n<<32n)),zi0=Number(xo1%(1n<<32n));function bp6($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function yp6($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else bp6($)}class Pi0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(_o1),this.cbuf=new Uint8Array(BZ0),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Ei+1)),this.seqLo=Math.floor(Math.random()*FZ0);while($++<8&&this.seqHi===Ei&&this.seqLo>=zi0);if(this.seqHi===Ei&&this.seqLo>=zi0)this.seqLo=0;this.inc=Math.random()*(fp6-Co1)+Co1|0}setPre(){yp6(this.cbuf);for(let $=0;$<BZ0;$++)this.buf[$]=ji0[this.cbuf[$]%fB]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let X=_o1-1;X>=BZ0;X--){let Q=Math.floor($/fB),G=($-Q*fB)*FZ0+Z,J=Math.floor(G/fB),K=G-J*fB;this.buf[X]=ji0[K],$=Q,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=FZ0)this.seqLo-=FZ0,this.seqHi+=1;if(this.seqHi>Ei||this.seqHi===Ei&&this.seqLo>=zi0)this.setPre(),this.initSeqAndInc();this.fillSeq();let $=this.buf;return String.fromCharCode($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],$[8],$[9],$[10],$[11],$[12],$[13],$[14],$[15],$[16],$[17],$[18],$[19],$[20],$[21])}reset(){this.init()}}fo1.NuidImpl=Pi0;fo1.nuid=new Pi0});var co1=_((ho1)=>{Object.defineProperty(ho1,"__esModule",{value:!0});ho1.nuid=ho1.Nuid=void 0;var go1=yo1();ho1.Nuid=go1.NuidImpl;ho1.nuid=go1.nuid});var OZ0=_((wZ0)=>{Object.defineProperty(wZ0,"__esModule",{value:!0});wZ0.nuid=wZ0.Nuid=void 0;var lo1=co1();Object.defineProperty(wZ0,"Nuid",{enumerable:!0,get:function(){return lo1.Nuid}});Object.defineProperty(wZ0,"nuid",{enumerable:!0,get:function(){return lo1.nuid}})});var bB=_((do1)=>{Object.defineProperty(do1,"__esModule",{value:!0});do1.DEFAULT_HOST=do1.DEFAULT_PORT=do1.Match=void 0;do1.syncIterator=dp6;do1.createInbox=mp6;var cp6=OZ0(),lp6=sY();do1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function dp6($){let Z=$[Symbol.asyncIterator]();return{async next(){let X=await Z.next();if(X.done)return Promise.resolve(null);return Promise.resolve(X.value)}}}function mp6($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw lp6.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${cp6.nuid.next()}`}do1.DEFAULT_PORT=4222;do1.DEFAULT_HOST="127.0.0.1"});var zi=_((po1)=>{Object.defineProperty(po1,"__esModule",{value:!0});po1.DataBuffer=void 0;var io1=aY();class no1{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}static fromAscii($){if(!$)$="";return io1.TE.encode($)}static toAscii($){return io1.TD.decode($)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let $=new Uint8Array(this.byteLength),Z=0;for(let X=0;X<this.buffers.length;X++)$.set(this.buffers[X],Z),Z+=this.buffers[X].length;this.buffers.length=0,this.buffers.push($)}}shift(){if(this.buffers.length){let $=this.buffers.shift();if($)return this.byteLength-=$.length,$}return new Uint8Array(0)}drain($){if(this.buffers.length){this.pack();let Z=this.buffers.pop();if(Z){let X=this.byteLength;if($===void 0||$>X)$=X;let Q=Z.subarray(0,$);if(X>$)this.buffers.push(Z.subarray($));return this.byteLength=X-$,Q}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let X=0;X<Z.length;X++)if(Z[X]&&Z[X].length)this.buffers.push(Z[X]),this.byteLength+=Z[X].length}peek(){if(this.buffers.length)return this.pack(),this.buffers[0];return new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}}po1.DataBuffer=no1});var BE=_((ro1)=>{Object.defineProperty(ro1,"__esModule",{value:!0});ro1.LF=ro1.CR=ro1.CRLF=ro1.CR_LF_LEN=ro1.CR_LF=void 0;ro1.setTransportFactory=sp6;ro1.defaultPort=ep6;ro1.getUrlParseFn=$t6;ro1.newTransport=Zt6;ro1.getResolveFn=Xt6;ro1.protoLen=oo1;ro1.extractProtocolMessage=Qt6;var op6=aY(),rp6=bB(),ap6=zi(),eY;function sp6($){eY=$}function ep6(){return eY!==void 0&&eY.defaultPort!==void 0?eY.defaultPort:rp6.DEFAULT_PORT}function $t6(){return eY!==void 0&&eY.urlParseFn?eY.urlParseFn:void 0}function Zt6(){if(!eY||typeof eY.factory!=="function")throw Error("transport fn is not set");return eY.factory()}function Xt6(){return eY!==void 0&&eY.dnsResolveFn?eY.dnsResolveFn:void 0}ro1.CR_LF=`\r
1335
+ `);Q=G.pop()??"";for(let J of G){let K=Li(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;_B({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{for(;;){let{done:G,value:J}=await Z.read();if(G)break;Q+=X.decode(J,{stream:!0}),Y()}if(Q.trim()){let G=Li(Q).replace(/^\[\d+\]\s*/,"").trim();if(G)_B({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function Bn6($){let{baseUrl:Z,noTui:X}=$,Q=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=Q?process.env.PORT:$.vitePort,G=Z||`http://localhost:${Y}`,J=Q?await Oi(Number(Y)+1):await Oi(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await XZ0({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let L of W)WE({name:L.name,status:"ready",port:L.port});Bi();let U=Fn6(import.meta.dir,"..","..","..","..",".."),N=X===!0,F=Bun.spawn(["bun","run","dev:servers"],{cwd:U,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Y),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:G,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...K.betterAuthSecret?{BETTER_AUTH_SECRET:K.betterAuthSecret}:{},...K.s3Endpoint?{S3_ENDPOINT:K.s3Endpoint,S3_BUCKET:K.s3Bucket??"",S3_ACCESS_KEY_ID:K.s3AccessKeyId??"",S3_SECRET_ACCESS_KEY:K.s3SecretAccessKey??"",S3_FORCE_PATH_STYLE:String(K.s3ForcePathStyle)}:{},...K.natsPublicUrl&&K.natsAccountJwt&&K.natsAccountSigningKey?{NATS_PUBLIC_URL:K.natsPublicUrl,NATS_ACCOUNT_JWT:K.natsAccountJwt,NATS_ACCOUNT_SIGNING_KEY:K.natsAccountSigningKey,NATS_OPERATOR_JWT:K.natsOperatorJwt??"",NATS_TUNNEL_PUBLIC_ENABLED:"true",...K.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}}:{}},stdio:["inherit",N?"inherit":"pipe",N?"inherit":"pipe"]});if(!N)st1(F.stdout),st1(F.stderr);wi(G),WE({name:"Vite",status:"ready",port:Number(Y)}),WE({name:"API",status:"ready",port:Number(K.port)});let w=async(L)=>{if(F.kill(L),await F.exited,H.length>0){let{stopServices:D}=await Promise.resolve().then(() => (U90(),H90));await D(K.dataDir)}};return process.on("SIGINT",()=>w("SIGINT")),process.on("SIGTERM",()=>w("SIGTERM")),{port:Number(Y),process:F}}var Zi0=O(()=>{om0();HE();em0()});var GZ0;var Xi0=O(()=>{GZ0={name:"decocms",version:"4.230.4",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@inkjs/ui":"^2.0.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/shared":"workspace:*","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@nats-io/jwt":"0.0.10-5","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@types/bun":"^1.3.1","@types/google.maps":"^3.65.2","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@vercel/nft":"^1.1.1",ai:"^6.0.208","better-auth":"1.4.22",croner:"^9.1.0",degit:"^2.8.4",hono:"^4.10.7",jose:"^6.0.11",nanoid:"^5.1.6",pg:"^8.16.3",typescript:"^7.0.2",typescript5:"npm:typescript@^5.9.3",zod:"4.3.6"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as On6,Text as et1}from"ink";import{jsx as Ln6,jsxs as $o1}from"react/jsx-runtime";function Zo1({version:$}){return $o1(On6,{flexDirection:"column",marginTop:1,children:[v90.map((Z,X)=>Ln6(et1,{color:x90[X],children:Z},X)),$o1(et1,{dimColor:!0,children:[" v",$]})]})}var Xo1=O(()=>{Zi()});import{Box as UE,Text as vB}from"ink";import{Spinner as Dn6}from"@inkjs/ui";import{jsx as rY,jsxs as Vb}from"react/jsx-runtime";function Qo1({status:$}){if($==="pending")return rY(Dn6,{label:""});return rY(vB,{color:"green",children:"\u2713"})}function En6($){return`${$.name}: ${$.port||"...."}`}function Yo1({services:$,migrationsStatus:Z,home:X,serverUrl:Q}){return Vb(UE,{flexDirection:"column",paddingBottom:1,children:[rY(Zo1,{version:GZ0.version}),rY(UE,{marginBottom:1,children:rY(vB,{dimColor:!0,children:"\u2500".repeat(80)})}),rY(UE,{children:Vb(vB,{dimColor:!0,children:["Home: ",X]})}),Vb(UE,{gap:2,children:[$.map((Y)=>Vb(UE,{gap:1,children:[rY(vB,{children:En6(Y)}),rY(Qo1,{status:Y.status})]},Y.name)),Vb(UE,{gap:1,children:[rY(vB,{children:"Migrations"}),rY(Qo1,{status:Z})]})]}),rY(UE,{children:Q?Vb(vB,{children:["Open in browser: ",rY(vB,{color:"cyan",children:Q})]}):rY(vB,{dimColor:!0,children:"Starting..."})})]})}var Go1=O(()=>{Xi0();Xo1()});import{Box as zn6,Text as Di}from"ink";import{jsx as Qi0,jsxs as Yi0}from"react/jsx-runtime";function jn6($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function Jo1({logs:$}){return Qi0(zn6,{flexDirection:"column",children:$.map((Z,X)=>{if(Z.rawLine)return Qi0(Di,{dimColor:!0,children:Z.rawLine},X);let Q=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return Yi0(Di,{children:[Yi0(Di,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),Qi0(Di,{color:jn6(Z.status),children:Z.status}),Yi0(Di,{dimColor:!0,children:[" ",Q.padStart(8)]})]},X)})})}var Ko1=()=>{};var Gi0={};w0(Gi0,{App:()=>Tn6});import{Box as Pn6}from"ink";import{useSyncExternalStore as An6}from"react";import{jsx as Wo1,jsxs as Rn6}from"react/jsx-runtime";function Tn6({home:$}){let Z=An6(sm0,am0);return Rn6(Pn6,{flexDirection:"column",children:[Wo1(Yo1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Wo1(Jo1,{logs:Z.logs})]})}var Ji0=O(()=>{Go1();Ko1();HE()});var SJ="thread-gate",dU="decopilot-hosted-harness",H3="automations",xB="background-tools",NE="task-board-github-reads";var Ho1="7";function Uo1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:Ho1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var No1=()=>{};function In6(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function Ki0($,Z){for(let X=0;X<$.length;X++){let Q=$[X];if(Q===void 0)continue;if(Q===Z)return $[X+1];if(Q.startsWith(`${Z}=`))return Q.slice(Z.length+1)}return}function Fo1(){let $=In6();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:Ki0($,"--cpu-prof-dir")??process.cwd(),name:Ki0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(Ki0($,"--cpu-prof-interval")??1000),note:"profile is written on process exit"}));return}if(process.env.CPU_PROFILE)console.warn(JSON.stringify({msg:"cpu-profiling-requested-but-inactive",hint:'CPU profiling is a Bun launch flag. Set BUN_OPTIONS="--cpu-prof --cpu-prof-md --cpu-prof-dir=/tmp" before starting the process.'}))}function Bo1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let X=YE();if(!X)return;let Q={};try{let{heapStats:Y}=await import("bun:jsc"),G=Y(),J=Object.entries(G.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);Q={objectCount:G.objectCount,heapSize:G.heapSize,top:Object.fromEntries(J)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:X.rss,heapUsed:X.heapUsed,heapTotal:X.heapTotal,external:X.external,arrayBuffers:X.arrayBuffers,...Q}))};return Z().catch(()=>{}),JZ0=setInterval(()=>void Z().catch(()=>{}),$),JZ0.unref?.(),process.on("SIGUSR2",()=>{try{let X=Bun.generateHeapSnapshot("v8"),Q=typeof X==="string"?X:JSON.stringify(X),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,Q),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(X){console.error("[heap-watch] snapshot failed:",X)}}),()=>{if(JZ0)clearInterval(JZ0)}}var JZ0;var wo1=()=>{};import*as qn6 from"bun:jsc";function Oo1(){if(process.env.STALL_WATCHDOG!=="1")return()=>{};let $=Number(process.env.STALL_WATCHDOG_MS??100),Z=Number(process.env.STALL_WATCHDOG_TICK_MS??50);try{Mn6()}catch(G){return console.error("[stall-watchdog] failed to start sampling profiler:",G),()=>{}}let X,Q=performance.now()+Z,Y=()=>{let G=performance.now(),J=G-Q;Q=G+Z;let K=[];try{K=Vn6()?.traces??[]}catch{}if(J>$&&K.length>0){let W=new Map;for(let U of K){let N=U.frames.find((w)=>w.sourceURL&&!/Unknown Executable/.test(w.category??""))??U.frames[0];if(!N)continue;let F=(N.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${N.name??"?"} @ ${F}:${N.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((U,N)=>N[1]-U[1]).slice(0,8).map(([U,N])=>({frame:U,count:N}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(J),samplesInWindow:K.length,top:H}))}X=setTimeout(Y,Z),X.unref?.()};return X=setTimeout(Y,Z),X.unref?.(),()=>{if(X)clearTimeout(X)}}var Mn6,Vn6;var Lo1=O(()=>{({startSamplingProfiler:Mn6,samplingProfilerStackTraces:Vn6}=qn6)});function Do1(){Fo1();let $=[Bo1(),Oi1(),Oo1()];return()=>{for(let Z of $)Z()}}var Eo1=O(()=>{Wc0();wo1();Lo1()});var FE=_((zo1)=>{Object.defineProperty(zo1,"__esModule",{value:!0});zo1.RepublishHeaders=zo1.DirectMsgHeaders=zo1.JsHeaders=zo1.AdvisoryKind=void 0;zo1.isOrderedPushConsumerOptions=kn6;zo1.isPullConsumer=Sn6;zo1.isPushConsumer=Cn6;zo1.isBoundPushConsumerOptions=_n6;function kn6($){if($&&typeof $==="object")return"name_prefix"in $||"deliver_subject_prefix"in $||"filter_subjects"in $||"filter_subject"in $||"deliver_policy"in $||"opt_start_seq"in $||"opt_start_time"in $||"replay_policy"in $||"inactive_threshold"in $||"headers_only"in $||"deliver_prefix"in $;return!1}function Sn6($){return $.isPullConsumer()}function Cn6($){return $.isPushConsumer()}function _n6($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}zo1.AdvisoryKind={API:"api_audit",StreamAction:"stream_action",ConsumerAction:"consumer_action",SnapshotCreate:"snapshot_create",SnapshotComplete:"snapshot_complete",RestoreCreate:"restore_create",RestoreComplete:"restore_complete",MaxDeliver:"max_deliver",Terminated:"terminated",Ack:"consumer_ack",StreamLeaderElected:"stream_leader_elected",StreamQuorumLost:"stream_quorum_lost",ConsumerLeaderElected:"consumer_leader_elected",ConsumerQuorumLost:"consumer_quorum_lost"};zo1.JsHeaders={StreamSourceHdr:"Nats-Stream-Source",LastConsumerSeqHdr:"Nats-Last-Consumer",LastStreamSeqHdr:"Nats-Last-Stream",ConsumerStalledHdr:"Nats-Consumer-Stalled",MessageSizeHdr:"Nats-Msg-Size",RollupHdr:"Nats-Rollup",RollupValueSubject:"sub",RollupValueAll:"all",PendingMessagesHdr:"Nats-Pending-Messages",PendingBytesHdr:"Nats-Pending-Bytes",RequiredApiLevel:"Nats-Required-Api-Level"};zo1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};zo1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var aY=_((Po1)=>{Object.defineProperty(Po1,"__esModule",{value:!0});Po1.TD=Po1.TE=Po1.Empty=void 0;Po1.encode=cn6;Po1.decode=ln6;Po1.Empty=new Uint8Array(0);Po1.TE=new TextEncoder;Po1.TD=new TextDecoder;function un6(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}function cn6(...$){let Z=[];for(let X=0;X<$.length;X++)Z.push(Po1.TE.encode($[X]));if(Z.length===0)return Po1.Empty;if(Z.length===1)return Z[0];return un6(...Z)}function ln6($){if(!$||$.length===0)return"";return Po1.TD.decode($)}});var sY=_((Ro1)=>{Object.defineProperty(Ro1,"__esModule",{value:!0});Ro1.errors=Ro1.PermissionViolationError=Ro1.NoRespondersError=Ro1.TimeoutError=Ro1.RequestError=Ro1.ProtocolError=Ro1.ConnectionError=Ro1.DrainingConnectionError=Ro1.ClosedConnectionError=Ro1.AuthorizationError=Ro1.UserAuthenticationExpiredError=Ro1.InvalidOperationError=Ro1.InvalidArgumentError=Ro1.InvalidSubjectError=void 0;class Hi0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}Ro1.InvalidSubjectError=Hi0;class KZ0 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,X){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((Q)=>`'${Q}'`),$=$.join(",");else $=`'${$}'`;return new KZ0(`${$} ${Z}`,X)}}Ro1.InvalidArgumentError=KZ0;class Ui0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}Ro1.InvalidOperationError=Ui0;class WZ0 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new WZ0($);return null}}Ro1.UserAuthenticationExpiredError=WZ0;class HZ0 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],X=$.toLowerCase();for(let Q=0;Q<Z.length;Q++)if(X.indexOf(Z[Q])!==-1)return new HZ0($);return null}}Ro1.AuthorizationError=HZ0;class Ni0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}Ro1.ClosedConnectionError=Ni0;class Fi0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}Ro1.DrainingConnectionError=Fi0;class Bi0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}Ro1.ConnectionError=Bi0;class wi0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}Ro1.ProtocolError=wi0;class Oi0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof UZ0}}Ro1.RequestError=Oi0;class Li0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}Ro1.TimeoutError=Li0;class UZ0 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}Ro1.NoRespondersError=UZ0;class NZ0 extends Error{operation;subject;queue;constructor($,Z,X,Q,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=X,this.queue=Q}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let X="publish",Q="",Y=void 0,G=$.match(/(Publish|Subscription) to "(\S+)"/);if(G){if(X=G[1].toLowerCase(),Q=G[2],X==="subscription"){let J=$.match(/using queue "(\S+)"/);if(J)Y=J[1]}}return new NZ0($,X,Q,Y)}}Ro1.PermissionViolationError=NZ0;Ro1.errors={AuthorizationError:HZ0,ClosedConnectionError:Ni0,ConnectionError:Bi0,DrainingConnectionError:Fi0,InvalidArgumentError:KZ0,InvalidOperationError:Ui0,InvalidSubjectError:Hi0,NoRespondersError:UZ0,PermissionViolationError:NZ0,ProtocolError:wi0,RequestError:Oi0,TimeoutError:Li0,UserAuthenticationExpiredError:WZ0}});var CJ=_((ko1)=>{Object.defineProperty(ko1,"__esModule",{value:!0});ko1.SimpleMutex=ko1.Perf=void 0;ko1.extend=Gp6;ko1.render=Jp6;ko1.timeout=Kp6;ko1.delay=Wp6;ko1.deadline=Hp6;ko1.deferred=Ei0;ko1.debugDeferred=Up6;ko1.shuffle=Np6;ko1.collect=Fp6;ko1.jitter=Vo1;ko1.backoff=Bp6;ko1.nanos=wp6;ko1.millis=Op6;ko1.randomToken=Ep6;var Yp6=aY(),Di0=sY();function Gp6($,...Z){for(let X=0;X<Z.length;X++){let Q=Z[X];Object.keys(Q).forEach(function(Y){$[Y]=Q[Y]})}return $}function Jp6($){return Yp6.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function Kp6($,Z=!0){let X=Z?new Di0.TimeoutError:null,Q,Y,G=new Promise((J,K)=>{Q={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(X===null)K(new Di0.TimeoutError);else K(X)},$)});return Object.assign(G,Q)}function Wp6($=0){let Z,X=new Promise((Q)=>{let Y=setTimeout(()=>{Q()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),Q()}}});return Object.assign(X,Z)}async function Hp6($,Z=1000){let X=Ei0(),Q=setTimeout(()=>{X.reject(new Di0.TimeoutError)},Z);try{return await Promise.race([$,X])}finally{clearTimeout(Q)}}function Ei0(){let $={},Z=new Promise((X,Q)=>{$={resolve:X,reject:Q}});return Object.assign(Z,$)}function Up6(){let $={},Z=new Promise((X,Q)=>{$={resolve:(Y)=>{console.trace("resolve",Y),X(Y)},reject:(Y)=>{console.trace("reject"),Q(Y)}}});return Object.assign(Z,$)}function Np6($){for(let Z=$.length-1;Z>0;Z--){let X=Math.floor(Math.random()*(Z+1));[$[Z],$[X]]=[$[X],$[Z]]}return $}async function Fp6($){let Z=[];for await(let X of $)Z.push(X);return Z}class qo1{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,X){let Q=this.timers.get(Z);if(Q===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(X);if(Y===void 0)throw Error(`${X} is not defined`);this.measures.set($,Y-Q)}getEntries(){let $=[];return this.measures.forEach((Z,X)=>{$.push({name:X,duration:Z})}),$}}ko1.Perf=qo1;class Mo1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=Ei0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}ko1.SimpleMutex=Mo1;function Vo1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function Bp6($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(X){return Vo1(X>Z?$[Z]:$[X])}}}function wp6($){return $*1e6}function Op6($){return Math.floor($/1e6)}var Lp6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",mU=new Uint8Array(62);for(let $=0;$<62;$++)mU[$]=Lp6.charCodeAt($);var Dp6=218340105584896;function Ep6(){let $=Math.floor(Math.random()*Dp6),Z=$%62,X=mU[Z];$=($-Z)/62,Z=$%62;let Q=mU[Z];$=($-Z)/62,Z=$%62;let Y=mU[Z];$=($-Z)/62,Z=$%62;let G=mU[Z];$=($-Z)/62,Z=$%62;let J=mU[Z];$=($-Z)/62,Z=$%62;let K=mU[Z];$=($-Z)/62,Z=$%62;let W=mU[Z];$=($-Z)/62;let H=mU[$];return String.fromCharCode(X,Q,Y,G,J,K,W,H)}});var yo1=_((fo1)=>{Object.defineProperty(fo1,"__esModule",{value:!0});fo1.nuid=fo1.NuidImpl=void 0;var xp6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",fB=62,BZ0=12,vo1=10,Co1=33,fp6=333,_o1=BZ0+vo1,ji0=new Uint8Array(fB);for(let $=0;$<fB;$++)ji0[$]=xp6.charCodeAt($);var FZ0=4294967296,xo1=BigInt(fB)**BigInt(vo1),Ei=Number(xo1/(1n<<32n)),zi0=Number(xo1%(1n<<32n));function bp6($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function yp6($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else bp6($)}class Pi0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(_o1),this.cbuf=new Uint8Array(BZ0),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Ei+1)),this.seqLo=Math.floor(Math.random()*FZ0);while($++<8&&this.seqHi===Ei&&this.seqLo>=zi0);if(this.seqHi===Ei&&this.seqLo>=zi0)this.seqLo=0;this.inc=Math.random()*(fp6-Co1)+Co1|0}setPre(){yp6(this.cbuf);for(let $=0;$<BZ0;$++)this.buf[$]=ji0[this.cbuf[$]%fB]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let X=_o1-1;X>=BZ0;X--){let Q=Math.floor($/fB),G=($-Q*fB)*FZ0+Z,J=Math.floor(G/fB),K=G-J*fB;this.buf[X]=ji0[K],$=Q,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=FZ0)this.seqLo-=FZ0,this.seqHi+=1;if(this.seqHi>Ei||this.seqHi===Ei&&this.seqLo>=zi0)this.setPre(),this.initSeqAndInc();this.fillSeq();let $=this.buf;return String.fromCharCode($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],$[8],$[9],$[10],$[11],$[12],$[13],$[14],$[15],$[16],$[17],$[18],$[19],$[20],$[21])}reset(){this.init()}}fo1.NuidImpl=Pi0;fo1.nuid=new Pi0});var co1=_((ho1)=>{Object.defineProperty(ho1,"__esModule",{value:!0});ho1.nuid=ho1.Nuid=void 0;var go1=yo1();ho1.Nuid=go1.NuidImpl;ho1.nuid=go1.nuid});var OZ0=_((wZ0)=>{Object.defineProperty(wZ0,"__esModule",{value:!0});wZ0.nuid=wZ0.Nuid=void 0;var lo1=co1();Object.defineProperty(wZ0,"Nuid",{enumerable:!0,get:function(){return lo1.Nuid}});Object.defineProperty(wZ0,"nuid",{enumerable:!0,get:function(){return lo1.nuid}})});var bB=_((do1)=>{Object.defineProperty(do1,"__esModule",{value:!0});do1.DEFAULT_HOST=do1.DEFAULT_PORT=do1.Match=void 0;do1.syncIterator=dp6;do1.createInbox=mp6;var cp6=OZ0(),lp6=sY();do1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function dp6($){let Z=$[Symbol.asyncIterator]();return{async next(){let X=await Z.next();if(X.done)return Promise.resolve(null);return Promise.resolve(X.value)}}}function mp6($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw lp6.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${cp6.nuid.next()}`}do1.DEFAULT_PORT=4222;do1.DEFAULT_HOST="127.0.0.1"});var zi=_((po1)=>{Object.defineProperty(po1,"__esModule",{value:!0});po1.DataBuffer=void 0;var io1=aY();class no1{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}static fromAscii($){if(!$)$="";return io1.TE.encode($)}static toAscii($){return io1.TD.decode($)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let $=new Uint8Array(this.byteLength),Z=0;for(let X=0;X<this.buffers.length;X++)$.set(this.buffers[X],Z),Z+=this.buffers[X].length;this.buffers.length=0,this.buffers.push($)}}shift(){if(this.buffers.length){let $=this.buffers.shift();if($)return this.byteLength-=$.length,$}return new Uint8Array(0)}drain($){if(this.buffers.length){this.pack();let Z=this.buffers.pop();if(Z){let X=this.byteLength;if($===void 0||$>X)$=X;let Q=Z.subarray(0,$);if(X>$)this.buffers.push(Z.subarray($));return this.byteLength=X-$,Q}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let X=0;X<Z.length;X++)if(Z[X]&&Z[X].length)this.buffers.push(Z[X]),this.byteLength+=Z[X].length}peek(){if(this.buffers.length)return this.pack(),this.buffers[0];return new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}}po1.DataBuffer=no1});var BE=_((ro1)=>{Object.defineProperty(ro1,"__esModule",{value:!0});ro1.LF=ro1.CR=ro1.CRLF=ro1.CR_LF_LEN=ro1.CR_LF=void 0;ro1.setTransportFactory=sp6;ro1.defaultPort=ep6;ro1.getUrlParseFn=$t6;ro1.newTransport=Zt6;ro1.getResolveFn=Xt6;ro1.protoLen=oo1;ro1.extractProtocolMessage=Qt6;var op6=aY(),rp6=bB(),ap6=zi(),eY;function sp6($){eY=$}function ep6(){return eY!==void 0&&eY.defaultPort!==void 0?eY.defaultPort:rp6.DEFAULT_PORT}function $t6(){return eY!==void 0&&eY.urlParseFn?eY.urlParseFn:void 0}function Zt6(){if(!eY||typeof eY.factory!=="function")throw Error("transport fn is not set");return eY.factory()}function Xt6(){return eY!==void 0&&eY.dnsResolveFn?eY.dnsResolveFn:void 0}ro1.CR_LF=`\r
1336
1336
  `;ro1.CR_LF_LEN=ro1.CR_LF.length;ro1.CRLF=ap6.DataBuffer.fromAscii(ro1.CR_LF);ro1.CR=new Uint8Array(ro1.CRLF)[0];ro1.LF=new Uint8Array(ro1.CRLF)[1];function oo1($){for(let Z=0;Z<$.length;Z++){let X=Z+1;if($.byteLength>X&&$[Z]===ro1.CR&&$[X]===ro1.LF)return X+1}return 0}function Qt6($){let Z=oo1($);if(Z>0){let Q=new Uint8Array($).slice(0,Z);return op6.TD.decode(Q)}return""}});var qi0=_((Yr1)=>{Object.defineProperty(Yr1,"__esModule",{value:!0});Yr1.ipV4=Zr1;Yr1.isIP=wt6;Yr1.parseIP=Xr1;var ji=4,wE=16,LZ0=48,$r1=57,so1=65,Ft6=70,eo1=97,Bt6=102,Ii0=16777215;function Zr1($,Z,X,Q){let Y=new Uint8Array(wE);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((J,K)=>{Y[K]=J}),Y[12]=$,Y[13]=Z,Y[14]=X,Y[15]=Q,Y}function wt6($){return Xr1($)!==void 0}function Xr1($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return Qr1($);case":":return Ot6($)}return}function Qr1($){let Z=new Uint8Array(ji);for(let X=0;X<ji;X++){if($.length===0)return;if(X>0){if($[0]!==".")return;$=$.substring(1)}let{n:Q,c:Y,ok:G}=Lt6($);if(!G||Q>255)return;$=$.substring(Y),Z[X]=Q}return Zr1(Z[0],Z[1],Z[2],Z[3])}function Ot6($){let Z=new Uint8Array(wE),X=-1;if($.length>=2&&$[0]===":"&&$[1]===":"){if(X=0,$=$.substring(2),$.length===0)return Z}let Q=0;while(Q<wE){let{n:Y,c:G,ok:J}=Dt6($);if(!J||Y>65535)return;if(G<$.length&&$[G]==="."){if(X<0&&Q!=wE-ji)return;if(Q+ji>wE)return;let K=Qr1($);if(K===void 0)return;Z[Q]=K[12],Z[Q+1]=K[13],Z[Q+2]=K[14],Z[Q+3]=K[15],$="",Q+=ji;break}if(Z[Q]=Y>>8,Z[Q+1]=Y,Q+=2,$=$.substring(G),$.length===0)break;if($[0]!==":"||$.length==1)return;if($=$.substring(1),$[0]===":"){if(X>=0)return;if(X=Q,$=$.substring(1),$.length===0)break}}if($.length!==0)return;if(Q<wE){if(X<0)return;let Y=wE-Q;for(let G=Q-1;G>=X;G--)Z[G+Y]=Z[G];for(let G=X+Y-1;G>=X;G--)Z[G]=0}else if(X>=0)return;return Z}function Lt6($){let Z=0,X=0;for(Z=0;Z<$.length&&LZ0<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=$r1;Z++)if(X=X*10+($.charCodeAt(Z)-LZ0),X>=Ii0)return{n:Ii0,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:X,c:Z,ok:!0}}function Dt6($){let Z=0,X=0;for(X=0;X<$.length;X++){if(LZ0<=$.charCodeAt(X)&&$.charCodeAt(X)<=$r1)Z*=16,Z+=$.charCodeAt(X)-LZ0;else if(eo1<=$.charCodeAt(X)&&$.charCodeAt(X)<=Bt6)Z*=16,Z+=$.charCodeAt(X)-eo1+10;else if(so1<=$.charCodeAt(X)&&$.charCodeAt(X)<=Ft6)Z*=16,Z+=$.charCodeAt(X)-so1+10;else break;if(Z>=Ii0)return{n:0,c:X,ok:!1}}if(X===0)return{n:0,c:X,ok:!1};return{n:Z,c:X,ok:!0}}});var _i0=_((Jr1)=>{Object.defineProperty(Jr1,"__esModule",{value:!0});Jr1.Servers=Jr1.ServerImpl=void 0;Jr1.isIPV4OrHostname=Gr1;Jr1.hostPort=Ci0;var Mi0=BE(),Vi0=CJ(),ki0=qi0(),Pt6=bB(),At6=sY();function Gr1($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function Si0($){return!Gr1($)}function Tt6($){let X=$.toUpperCase().indexOf("::FFFF:");if(X!==-1&&$.indexOf(".")!==-1){let Q=$.substring(X+7);return Q=Q.replace("[",""),Q.replace("]","")}return $}function Ci0($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=Tt6($),Si0($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=Si0($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),X=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):Pt6.DEFAULT_PORT,Y=new URL(`${X===80?"https":"http"}://${$}`);Y.port=`${X}`;let G=Y.hostname;if(G.charAt(0)==="[")G=G.substring(1,G.length-1);return{listen:Y.host,hostname:G,port:X}}class kb{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor($,Z=!1){this.src=$,this.tlsName="";let X=Ci0($);this.listen=X.listen,this.hostname=X.hostname,this.port=X.port,this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=Z}toString(){return this.listen}async resolve($){if(!$.fn||$.resolve===!1)return[this];let Z=[];if((0,ki0.isIP)(this.hostname))return[this];else{let X=await $.fn(this.hostname);if($.debug)console.log(`resolve ${this.hostname} = ${X.join(",")}`);for(let Q of X){let Y=this.port===80?"https":"http",G=new URL(`${Y}://${Si0(Q)?"["+Q+"]":Q}`);G.port=`${this.port}`;let J=new kb(G.host,!1);J.tlsName=this.hostname,Z.push(J)}}if($.randomize)(0,Vi0.shuffle)(Z);return this.resolves=Z,Z}}Jr1.ServerImpl=kb;class DZ0{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw At6.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,Mi0.getUrlParseFn)(),X=new Map;for(let Y of this.servers)X.set(Y.listen,Y);let Q=[];for(let Y of $){Y=Z?Z(Y):Y;let{listen:G}=Ci0(Y),J=X.get(G);if(J)J.gossiped=!1,Q.push(J);else Q.push(new kb(Y))}if(this.randomize)(0,Vi0.shuffle)(Q);if(this.servers=Q,this.currentServer===void 0||!Q.includes(this.currentServer))this.currentServer=Q[0],this.firstSelect=!0}clear(){this.servers.length=0}updateTLSName(){let $=this.getCurrentServer();if(!(0,ki0.isIP)($.hostname))this.tlsName=$.hostname,this.servers.forEach((Z)=>{if(Z.gossiped)Z.tlsName=this.tlsName})}getCurrentServer(){return this.currentServer}addServer($,Z=!1){let X=(0,Mi0.getUrlParseFn)();$=X?X($):$;let Q=new kb($,Z);if((0,ki0.isIP)(Q.hostname))Q.tlsName=this.tlsName;this.servers.push(Q)}selectServer(){if(this.firstSelect)return this.firstSelect=!1,this.currentServer;let $=this.servers.shift();if($)this.servers.push($),this.currentServer=$;return $}removeCurrentServer(){this.removeServer(this.currentServer)}removeServer($){if($){let Z=this.servers.indexOf($);this.servers.splice(Z,1)}}snapshot(){return DZ0.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return DZ0.freezeAll([$,...this.servers.slice(0,Z),...this.servers.slice(Z+1)])}static freezeAll($){return $.map((Z)=>Object.freeze({hostname:Z.hostname,port:Z.port,listen:Z.listen,src:Z.src,tlsName:Z.tlsName,reconnects:Z.reconnects,lastConnect:Z.lastConnect,gossiped:Z.gossiped,didConnect:Z.didConnect}))}find($){return this.servers.find((Z)=>Z.listen===$.listen)}setCurrent($){this.currentServer=$}length(){return this.servers.length}next(){return this.servers.length?this.servers[0]:void 0}getServers(){return this.servers}update($,Z){let X=[],Q=[],Y=(0,Mi0.getUrlParseFn)(),G=new Map;if($.connect_urls&&$.connect_urls.length>0)$.connect_urls.forEach((K)=>{K=Y?Y(K,Z):K;let W=new kb(K,!0);G.set(K,W)});let J=[];if(this.servers.forEach((K,W)=>{let H=K.listen;if(K.gossiped&&this.currentServer.listen!==H&&G.get(H)===void 0)J.push(W);G.delete(H)}),J.reverse(),J.forEach((K)=>{let W=this.servers.splice(K,1);Q=Q.concat(W[0].listen)}),G.forEach((K,W)=>{this.servers.push(K),X.push(W)}),this.randomize&&X.length>0){let K=this.currentServer,W=this.servers.filter((H)=>H!==K);(0,Vi0.shuffle)(W),this.servers=K?[K,...W]:W}return{added:X,deleted:Q}}}Jr1.Servers=DZ0});var EZ0=_((Ur1)=>{Object.defineProperty(Ur1,"__esModule",{value:!0});Ur1.QueuedIteratorImpl=void 0;var vi0=CJ(),Wr1=sY();class Hr1{inflight;processed;received;noIterator;iterClosed;done;signal;yields;filtered;pendingFiltered;ctx;_data;err;time;profile;yielding;didBreak;constructor(){this.inflight=0,this.filtered=0,this.pendingFiltered=0,this.processed=0,this.received=0,this.noIterator=!1,this.done=!1,this.signal=(0,vi0.deferred)(),this.yields=[],this.iterClosed=(0,vi0.deferred)(),this.time=0,this.yielding=!1,this.didBreak=!1,this.profile=!1}[Symbol.asyncIterator](){return this.iterate()}push($){if(this.done)return;if(this.didBreak){if(typeof $==="function"){let Z=$;try{Z()}catch(X){}}return}if(typeof $==="function")this.pendingFiltered++;this.yields.push($),this.signal.resolve()}async*iterate(){if(this.noIterator)throw new Wr1.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new Wr1.InvalidOperationError("iterator is already yielding");this.yielding=!0;try{while(!0){if(this.yields.length===0)await this.signal;if(this.err)throw this.err;let $=this.yields;this.inflight=$.length,this.yields=[];for(let Z=0;Z<$.length;Z++){if(typeof $[Z]==="function"){this.pendingFiltered--;let Q=$[Z];try{Q()}catch(Y){throw Y}if(this.err)throw this.err;continue}this.processed++,this.inflight--;let X=this.profile?Date.now():0;yield $[Z],this.time=this.profile?Date.now()-X:0}if(this.done)break;else if(this.yields.length===0)$.length=0,this.yields=$,this.signal=(0,vi0.deferred)()}}finally{this.didBreak=!0,this.stop()}}stop($){if(this.done)return;this.err=$,this.done=!0,this.signal.resolve(),this.iterClosed.resolve($)}getProcessed(){return this.noIterator?this.received:this.processed}getPending(){return this.yields.length+this.inflight-this.pendingFiltered}getReceived(){return this.received-this.filtered}}Ur1.QueuedIteratorImpl=Hr1});var xi0=_((wr1)=>{Object.defineProperty(wr1,"__esModule",{value:!0});wr1.MuxSubscription=void 0;var Mt6=bB(),Fr1=sY();class Br1{baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,Mt6.createInbox)($)}.`,this.baseInbox}add($){if(!isNaN($.received))$.received=0;this.reqs.set($.token,$)}get($){return this.reqs.get($)}cancel($){this.reqs.delete($.token)}getToken($){let Z=$.subject||"";if(Z.indexOf(this.baseInbox)===0)return Z.substring(this.baseInbox.length);return null}all(){return Array.from(this.reqs.values())}handleError($,Z){if($)return this.all().forEach((X)=>{X.resolver(Z,{})}),!0;if(Z.operation==="publish"){let X=this.all().find((Q)=>{return Q.requestSubject===Z.subject});if(X)return X.resolver(Z,{}),!0}return!1}dispatcher(){return($,Z)=>{let X=this.getToken(Z);if(X){let Q=this.get(X);if(Q){if($===null)$=Z?.data?.length===0&&Z.headers?.code===503?new Fr1.NoRespondersError(Q.requestSubject):null;Q.resolver($,Z)}}}}close(){let $=new Fr1.RequestError("connection closed");this.reqs.forEach((Z)=>{Z.resolver($,{})})}}wr1.MuxSubscription=Br1});var fi0=_((Dr1)=>{Object.defineProperty(Dr1,"__esModule",{value:!0});Dr1.Heartbeat=void 0;var Vt6=CJ();class Lr1{ph;interval;maxOut;timer;pendings;constructor($,Z,X){this.ph=$,this.interval=Z,this.maxOut=X,this.pendings=[]}start(){this.cancel(),this._schedule()}cancel($){if(this.timer)clearTimeout(this.timer),this.timer=void 0;if(this._reset(),$)this.ph.disconnect()}_schedule(){this.timer=setTimeout(()=>{if(this.ph.dispatchStatus({type:"ping",pendingPings:this.pendings.length+1}),this.pendings.length===this.maxOut){this.cancel(!0);return}let $=(0,Vt6.deferred)();this.ph.flush($).then(()=>{this._reset()}).catch(()=>{this.cancel()}),this.pendings.push($),this._schedule()},this.interval)}_reset(){this.pendings=this.pendings.filter(($)=>{return $.resolve(),!1})}}Dr1.Heartbeat=Lr1});var gi0=_((Ar1)=>{Object.defineProperty(Ar1,"__esModule",{value:!0});Ar1.DenoBuffer=Ar1.MAX_SIZE=Ar1.AssertionError=void 0;Ar1.assert=jr1;Ar1.concat=Pr1;Ar1.append=St6;Ar1.readAll=Ct6;Ar1.writeAll=_t6;var kt6=aY();class bi0 extends Error{constructor($){super($);this.name="AssertionError"}}Ar1.AssertionError=bi0;function jr1($,Z="Assertion failed."){if(!$)throw new bi0(Z)}var zr1=32768;Ar1.MAX_SIZE=4294967294;function zZ0($,Z,X=0){let Q=Z.byteLength-X;if($.byteLength>Q)$=$.subarray(0,Q);return Z.set($,X),$.byteLength}function Pr1($,Z){if($===void 0&&Z===void 0)return new Uint8Array(0);if($===void 0)return Z;if(Z===void 0)return $;let X=new Uint8Array($.length+Z.length);return X.set($,0),X.set(Z,$.length),X}function St6($,Z){return Pr1($,Uint8Array.of(Z))}class yi0{_buf;_off;constructor($){if(this._off=0,$==null){this._buf=new Uint8Array(0);return}this._buf=new Uint8Array($)}bytes($={copy:!0}){if($.copy===!1)return this._buf.subarray(this._off);return this._buf.slice(this._off)}empty(){return this._buf.byteLength<=this._off}get length(){return this._buf.byteLength-this._off}get capacity(){return this._buf.buffer.byteLength}truncate($){if($===0){this.reset();return}if($<0||$>this.length)throw Error("bytes.Buffer: truncation out of range");this._reslice(this._off+$)}reset(){this._reslice(0),this._off=0}_tryGrowByReslice($){let Z=this._buf.byteLength;if($<=this.capacity-Z)return this._reslice(Z+$),Z;return-1}_reslice($){jr1($<=this._buf.buffer.byteLength),this._buf=new Uint8Array(this._buf.buffer,0,$)}readByte(){let $=new Uint8Array(1);if(this.read($))return $[0];return null}read($){if(this.empty()){if(this.reset(),$.byteLength===0)return 0;return null}let Z=zZ0(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write(kt6.TE.encode($))}write($){let Z=this._grow($.byteLength);return zZ0($,this._buf,Z)}_grow($){let Z=this.length;if(Z===0&&this._off!==0)this.reset();let X=this._tryGrowByReslice($);if(X>=0)return X;let Q=this.capacity;if($<=Math.floor(Q/2)-Z)zZ0(this._buf.subarray(this._off),this._buf);else if(Q+$>Ar1.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Y=new Uint8Array(Math.min(2*Q+$,Ar1.MAX_SIZE));zZ0(this._buf.subarray(this._off),Y),this._buf=Y}return this._off=0,this._reslice(Math.min(Z+$,Ar1.MAX_SIZE)),Z}grow($){if($<0)throw Error("Buffer._grow: negative count");let Z=this._grow($);this._reslice(Z)}readFrom($){let Z=0,X=new Uint8Array(zr1);while(!0){let Q=this.capacity-this.length<zr1,Y=Q?X:new Uint8Array(this._buf.buffer,this.length),G=$.read(Y);if(G===null)return Z;if(Q)this.write(Y.subarray(0,G));else this._reslice(this.length+G);Z+=G}}}Ar1.DenoBuffer=yi0;function Ct6($){let Z=new yi0;return Z.readFrom($),Z.bytes()}function _t6($,Z){let X=0;while(X<Z.length)X+=$.write(Z.subarray(X))}});var ci0=_((Mr1)=>{Object.defineProperty(Mr1,"__esModule",{value:!0});Mr1.cc=Mr1.State=Mr1.Parser=Mr1.Kind=void 0;Mr1.describe=ht6;var hi0=gi0(),ui0=aY();Mr1.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function ht6($){let Z,X="";switch($.kind){case Mr1.Kind.MSG:Z="MSG";break;case Mr1.Kind.OK:Z="OK";break;case Mr1.Kind.ERR:Z="ERR",X=ui0.TD.decode($.data);break;case Mr1.Kind.PING:Z="PING";break;case Mr1.Kind.PONG:Z="PONG";break;case Mr1.Kind.INFO:Z="INFO",X=ui0.TD.decode($.data)}return`${Z}: ${X}`}function Rr1(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var Ir1=48,ut6=57,Sb=67108864;class qr1{dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor($){this.dispatcher=$,this.state=Mr1.State.OP_START,this.as=0,this.drop=0,this.hdr=0}parse($){let Z;for(Z=0;Z<$.length;Z++){let X=$[Z];switch(this.state){case Mr1.State.OP_START:switch(X){case Mr1.cc.M:case Mr1.cc.m:this.state=Mr1.State.OP_M,this.hdr=-1,this.ma=Rr1();break;case Mr1.cc.H:case Mr1.cc.h:this.state=Mr1.State.OP_H,this.hdr=0,this.ma=Rr1();break;case Mr1.cc.P:case Mr1.cc.p:this.state=Mr1.State.OP_P;break;case Mr1.cc.PLUS:this.state=Mr1.State.OP_PLUS;break;case Mr1.cc.MINUS:this.state=Mr1.State.OP_MINUS;break;case Mr1.cc.I:case Mr1.cc.i:this.state=Mr1.State.OP_I;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_H:switch(X){case Mr1.cc.M:case Mr1.cc.m:this.state=Mr1.State.OP_M;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_M:switch(X){case Mr1.cc.S:case Mr1.cc.s:this.state=Mr1.State.OP_MS;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_MS:switch(X){case Mr1.cc.G:case Mr1.cc.g:this.state=Mr1.State.OP_MSG;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_MSG:switch(X){case Mr1.cc.SPACE:case Mr1.cc.TAB:this.state=Mr1.State.OP_MSG_SPC;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_MSG_SPC:switch(X){case Mr1.cc.SPACE:case Mr1.cc.TAB:continue;default:this.state=Mr1.State.MSG_ARG,this.as=Z}break;case Mr1.State.MSG_ARG:switch(X){case Mr1.cc.CR:this.drop=1;break;case Mr1.cc.NL:{let Q=this.argBuf?this.argBuf.bytes():$.subarray(this.as,Z-this.drop);this.processMsgArgs(Q),this.drop=0,this.as=Z+1,this.state=Mr1.State.MSG_PAYLOAD,Z=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(X)}break;case Mr1.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let Q=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:Mr1.Kind.MSG,msg:this.ma,data:Q}),this.argBuf=void 0,this.msgBuf=void 0,this.state=Mr1.State.MSG_END}else{let Q=this.ma.size-this.msgBuf.length,Y=$.length-Z;if(Y<Q)Q=Y;if(Q>0)this.msgBuf.write($.subarray(Z,Z+Q)),Z=Z+Q-1;else this.msgBuf.writeByte(X)}else if(Z-this.as>=this.ma.size)this.dispatcher.push({kind:Mr1.Kind.MSG,msg:this.ma,data:$.subarray(this.as,Z)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=Mr1.State.MSG_END;break;case Mr1.State.MSG_END:switch(X){case Mr1.cc.NL:this.drop=0,this.as=Z+1,this.state=Mr1.State.OP_START;break;default:continue}break;case Mr1.State.OP_PLUS:switch(X){case Mr1.cc.O:case Mr1.cc.o:this.state=Mr1.State.OP_PLUS_O;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_PLUS_O:switch(X){case Mr1.cc.K:case Mr1.cc.k:this.state=Mr1.State.OP_PLUS_OK;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_PLUS_OK:switch(X){case Mr1.cc.NL:this.dispatcher.push({kind:Mr1.Kind.OK}),this.drop=0,this.state=Mr1.State.OP_START;break}break;case Mr1.State.OP_MINUS:switch(X){case Mr1.cc.E:case Mr1.cc.e:this.state=Mr1.State.OP_MINUS_E;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_MINUS_E:switch(X){case Mr1.cc.R:case Mr1.cc.r:this.state=Mr1.State.OP_MINUS_ER;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_MINUS_ER:switch(X){case Mr1.cc.R:case Mr1.cc.r:this.state=Mr1.State.OP_MINUS_ERR;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_MINUS_ERR:switch(X){case Mr1.cc.SPACE:case Mr1.cc.TAB:this.state=Mr1.State.OP_MINUS_ERR_SPC;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_MINUS_ERR_SPC:switch(X){case Mr1.cc.SPACE:case Mr1.cc.TAB:continue;default:this.state=Mr1.State.MINUS_ERR_ARG,this.as=Z}break;case Mr1.State.MINUS_ERR_ARG:switch(X){case Mr1.cc.CR:this.drop=1;break;case Mr1.cc.NL:{let Q;if(this.argBuf)Q=this.argBuf.bytes(),this.argBuf=void 0;else Q=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:Mr1.Kind.ERR,data:Q}),this.drop=0,this.as=Z+1,this.state=Mr1.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(X))}break;case Mr1.State.OP_P:switch(X){case Mr1.cc.I:case Mr1.cc.i:this.state=Mr1.State.OP_PI;break;case Mr1.cc.O:case Mr1.cc.o:this.state=Mr1.State.OP_PO;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_PO:switch(X){case Mr1.cc.N:case Mr1.cc.n:this.state=Mr1.State.OP_PON;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_PON:switch(X){case Mr1.cc.G:case Mr1.cc.g:this.state=Mr1.State.OP_PONG;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_PONG:switch(X){case Mr1.cc.NL:this.dispatcher.push({kind:Mr1.Kind.PONG}),this.drop=0,this.state=Mr1.State.OP_START;break}break;case Mr1.State.OP_PI:switch(X){case Mr1.cc.N:case Mr1.cc.n:this.state=Mr1.State.OP_PIN;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_PIN:switch(X){case Mr1.cc.G:case Mr1.cc.g:this.state=Mr1.State.OP_PING;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_PING:switch(X){case Mr1.cc.NL:this.dispatcher.push({kind:Mr1.Kind.PING}),this.drop=0,this.state=Mr1.State.OP_START;break}break;case Mr1.State.OP_I:switch(X){case Mr1.cc.N:case Mr1.cc.n:this.state=Mr1.State.OP_IN;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_IN:switch(X){case Mr1.cc.F:case Mr1.cc.f:this.state=Mr1.State.OP_INF;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_INF:switch(X){case Mr1.cc.O:case Mr1.cc.o:this.state=Mr1.State.OP_INFO;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_INFO:switch(X){case Mr1.cc.SPACE:case Mr1.cc.TAB:this.state=Mr1.State.OP_INFO_SPC;break;default:throw this.fail($.subarray(Z))}break;case Mr1.State.OP_INFO_SPC:switch(X){case Mr1.cc.SPACE:case Mr1.cc.TAB:continue;default:this.state=Mr1.State.INFO_ARG,this.as=Z}break;case Mr1.State.INFO_ARG:switch(X){case Mr1.cc.CR:this.drop=1;break;case Mr1.cc.NL:{let Q;if(this.argBuf)Q=this.argBuf.bytes(),this.argBuf=void 0;else Q=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:Mr1.Kind.INFO,data:Q}),this.drop=0,this.as=Z+1,this.state=Mr1.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(X)}break;default:throw this.fail($.subarray(Z))}}if((this.state===Mr1.State.MSG_ARG||this.state===Mr1.State.MINUS_ERR_ARG||this.state===Mr1.State.INFO_ARG)&&!this.argBuf)this.argBuf=new hi0.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===Mr1.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new hi0.DenoBuffer($.subarray(this.as))}}cloneMsgArg(){let $=this.ma.subject.length,Z=this.ma.reply?this.ma.reply.length:0,X=new Uint8Array($+Z);if(X.set(this.ma.subject),this.ma.reply)X.set(this.ma.reply,$);if(this.argBuf=new hi0.DenoBuffer(X),this.ma.subject=X.subarray(0,$),this.ma.reply)this.ma.reply=X.subarray($)}processMsgArgs($){if(this.hdr>=0)return this.processHeaderMsgArgs($);let Z=[],X=-1;for(let Q=0;Q<$.length;Q++)switch($[Q]){case Mr1.cc.SPACE:case Mr1.cc.TAB:case Mr1.cc.CR:case Mr1.cc.NL:if(X>=0)Z.push($.subarray(X,Q)),X=-1;break;default:if(X<0)X=Q}if(X>=0)Z.push($.subarray(X));switch(Z.length){case 3:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=void 0,this.ma.size=this.protoParseInt(Z[2],Sb);break;case 4:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=Z[2],this.ma.size=this.protoParseInt(Z[3],Sb);break;default:throw this.fail($,"processMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail($,"processMsgArgs Bad or Missing Sid Error");if(this.ma.size<0)throw this.fail($,"processMsgArgs Bad or Missing Size Error")}fail($,Z=""){if(!Z)Z=`parse error [${this.state}]`;else Z=`${Z} [${this.state}]`;return Error(`${Z}: ${ui0.TD.decode($)}`)}processHeaderMsgArgs($){let Z=[],X=-1;for(let Q=0;Q<$.length;Q++)switch($[Q]){case Mr1.cc.SPACE:case Mr1.cc.TAB:case Mr1.cc.CR:case Mr1.cc.NL:if(X>=0)Z.push($.subarray(X,Q)),X=-1;break;default:if(X<0)X=Q}if(X>=0)Z.push($.subarray(X));switch(Z.length){case 4:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=void 0,this.ma.hdr=this.protoParseInt(Z[2],Sb),this.ma.size=this.protoParseInt(Z[3],Sb);break;case 5:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=Z[2],this.ma.hdr=this.protoParseInt(Z[3],Sb),this.ma.size=this.protoParseInt(Z[4],Sb);break;default:throw this.fail($,"processHeaderMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail($,"processHeaderMsgArgs Bad or Missing Sid Error");if(this.ma.hdr<0||this.ma.hdr>this.ma.size)throw this.fail($,"processHeaderMsgArgs Bad or Missing Header Size Error");if(this.ma.size<0)throw this.fail($,"processHeaderMsgArgs Bad or Missing Size Error")}protoParseInt($,Z){if($.length===0||$.length>15)return-1;let X=0;for(let Q=0;Q<$.length;Q++){if($[Q]<Ir1||$[Q]>ut6)return-1;X=X*10+($[Q]-Ir1)}return Z!==void 0&&X>Z?-1:X}}Mr1.Parser=qr1;Mr1.State={OP_START:0,OP_PLUS:1,OP_PLUS_O:2,OP_PLUS_OK:3,OP_MINUS:4,OP_MINUS_E:5,OP_MINUS_ER:6,OP_MINUS_ERR:7,OP_MINUS_ERR_SPC:8,MINUS_ERR_ARG:9,OP_M:10,OP_MS:11,OP_MSG:12,OP_MSG_SPC:13,MSG_ARG:14,MSG_PAYLOAD:15,MSG_END:16,OP_H:17,OP_P:18,OP_PI:19,OP_PIN:20,OP_PING:21,OP_PO:22,OP_PON:23,OP_PONG:24,OP_I:25,OP_IN:26,OP_INF:27,OP_INFO:28,OP_INFO_SPC:29,INFO_ARG:30};Mr1.cc={CR:13,E:69,e:101,F:70,f:102,G:71,g:103,H:72,h:104,I:73,i:105,K:75,k:107,M:77,m:109,MINUS:45,N:78,n:110,NL:10,O:79,o:111,P:80,p:112,PLUS:43,R:82,r:114,S:83,s:115,SPACE:32,TAB:9}});var AZ0=_((kr1)=>{Object.defineProperty(kr1,"__esModule",{value:!0});kr1.MsgHdrsImpl=void 0;kr1.canonicalMIMEHeaderKey=di0;kr1.headers=dt6;var Vr1=aY(),_J=bB(),PZ0=sY();function di0($){let U=!0,N=Array($.length);for(let F=0;F<$.length;F++){let B=$.charCodeAt(F);if(B===58||B<33||B>126)throw PZ0.InvalidArgumentError.format("header",`'${$[F]}' is not a valid character in a header name`);if(U&&97<=B&&B<=122)B-=32;else if(!U&&65<=B&&B<=90)B+=32;N[F]=B,U=B==45}return String.fromCharCode(...N)}function dt6($=0,Z=""){if($===0&&Z!=="")throw PZ0.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw PZ0.InvalidArgumentError.format("description","is required");return new Cb($,Z)}var li0="NATS/1.0";class Cb{_code;headers;_description;constructor($=0,Z=""){this._code=$,this._description=Z,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals($){if($&&this.headers.size===$.headers.size&&this._code===$._code){for(let[Z,X]of this.headers){let Q=$.values(Z);if(X.length!==Q.length)return!1;let Y=[...X].sort(),G=[...Q].sort();for(let J=0;J<Y.length;J++)if(Y[J]!==G[J])return!1}return!0}return!1}static decode($){let Z=new Cb,Q=Vr1.TD.decode($).split(`\r
1337
1337
  `),Y=Q[0];if(Y!==li0){let G=Y.replace(li0,"").trim();if(G.length>0){if(Z._code=parseInt(G,10),isNaN(Z._code))Z._code=0;let J=Z._code.toString();G=G.replace(J,""),Z._description=G.trim()}}if(Q.length>=1)Q.slice(1).map((G)=>{if(G){let J=G.indexOf(":");if(J>-1){let K=G.slice(0,J),W=G.slice(J+1).trim();Z.append(K,W)}}});return Z}toString(){if(this.headers.size===0&&this._code===0)return"";let $=li0;if(this._code>0&&this._description!=="")$+=` ${this._code} ${this._description}`;for(let[Z,X]of this.headers)for(let Q=0;Q<X.length;Q++)$=`${$}\r
1338
1338
  ${Z}: ${X[Q]}`;return`${$}\r