decocms 4.160.2 → 4.160.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/client/assets/{AlertCircle-8y4OERSA.js → AlertCircle-DOfCMsFh.js} +1 -1
  2. package/dist/client/assets/{AreaChart-ZYewK7hC.js → AreaChart-B1ztj9L1.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-Cyc2lNPE.js → ArrowUp-xeN9sSQC.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-DB2QWxkL.js → ArrowUpRight-CCN9kBKT.js} +1 -1
  5. package/dist/client/assets/{Check-PYC78ebP.js → Check-CbrdHpvv.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-Cjv9HFQJ.js → CheckCircle-CYzV5xFz.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-B5_0x02X.js → ChevronDown-BuG2IPna.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-Dlc2ivdM.js → ChevronRight-BYTK_VZ4.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BUoY9Z_q.js → ChevronUp-BvrFEqD9.js} +1 -1
  10. package/dist/client/assets/{Copy01-DAExiPfa.js → Copy01-DZ9KJC5i.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-BS9rkd3J.js → CpuChip01-DevOwXeU.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DEWBiy2X.js → DotsVertical-CegtjIrk.js} +1 -1
  13. package/dist/client/assets/{Eye-B0_iy9b0.js → Eye-BCSFTxh2.js} +1 -1
  14. package/dist/client/assets/{FilterLines-1uKS3X8V.js → FilterLines-CzUnWSux.js} +1 -1
  15. package/dist/client/assets/{HardDrive-e3XtBhIu.js → HardDrive-Cx5Enuv5.js} +1 -1
  16. package/dist/client/assets/{Key01-BgCD4pBW.js → Key01-DZGVnpFz.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-Cz5Frdvf.js → LayoutLeft-DW3e9ncf.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-CFJ_4gPN.js → LinkExternal01-D3fijgPd.js} +1 -1
  19. package/dist/client/assets/{LogOut01-B7koOpzk.js → LogOut01-BsknXd8d.js} +1 -1
  20. package/dist/client/assets/{Monitor01-DZM2Wn0z.js → Monitor01-C375pc-7.js} +1 -1
  21. package/dist/client/assets/{Palette-CRSKI0zp.js → Palette-IWyV7Vnf.js} +1 -1
  22. package/dist/client/assets/{Play-B6YI7S_E.js → Play-BzD4jDZP.js} +1 -1
  23. package/dist/client/assets/{Plus-CRjF5ZrO.js → Plus-zO15HXtk.js} +1 -1
  24. package/dist/client/assets/{SearchLg-BTlkL2rW.js → SearchLg-n7Qi-N-0.js} +1 -1
  25. package/dist/client/assets/{SearchMd-YQxdwYOM.js → SearchMd-haqOaKnl.js} +1 -1
  26. package/dist/client/assets/{Settings02-DOMuFrys.js → Settings02-C49SjSLS.js} +1 -1
  27. package/dist/client/assets/{Shield01-CkaRCMUY.js → Shield01-DmxSUo0p.js} +1 -1
  28. package/dist/client/assets/{Star01-CZcD9lft.js → Star01-CFXFpvIt.js} +1 -1
  29. package/dist/client/assets/{Stars01-Cn5SeePJ.js → Stars01-DrzqcHWD.js} +1 -1
  30. package/dist/client/assets/{Stars02-BRu6qn_z.js → Stars02-BCP1mXyq.js} +1 -1
  31. package/dist/client/assets/{Sun-Cvwo9PpC.js → Sun-B2fZZfgK.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-CgBuvU82.js → SwitchHorizontal01-DF-1FC8z.js} +1 -1
  33. package/dist/client/assets/{Tool01-Uep3SEjO.js → Tool01-B1feCbMY.js} +1 -1
  34. package/dist/client/assets/{Tool02-C8biIp3u.js → Tool02-nN6ZHQY3.js} +1 -1
  35. package/dist/client/assets/{Trash01-B8WSaJL2.js → Trash01-CtBroGvB.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-Bdn4X-Un.js → TrendUp01-BhoL83KU.js} +1 -1
  37. package/dist/client/assets/{Upload01-DANSzhiN.js → Upload01-BxV00su7.js} +1 -1
  38. package/dist/client/assets/{User01-DPZhlbFh.js → User01-Cv24Iurg.js} +1 -1
  39. package/dist/client/assets/{Users01-DD6c7H7k.js → Users01-7eNaMB7_.js} +1 -1
  40. package/dist/client/assets/{Users03-CMlMC75Y.js → Users03-3pXlT9Dj.js} +1 -1
  41. package/dist/client/assets/{X-BlBGU8hs.js → X-BNCOarCM.js} +1 -1
  42. package/dist/client/assets/{XCircle-SAoR-qVk.js → XCircle-Cqy-RFjn.js} +1 -1
  43. package/dist/client/assets/{XClose-RD250CPb.js → XClose-Bn3Nnikg.js} +1 -1
  44. package/dist/client/assets/{Zap-C5MeTrEA.js → Zap-BIF24Csg.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-rytRMLFZ.js → ZapSquare-5SS41xyN.js} +1 -1
  46. package/dist/client/assets/{access-gate-CdTjn1ju.js → access-gate-BAZgNDXV.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-C9g6xXaN.js → add-section-modal-B15bg39S.js} +1 -1
  48. package/dist/client/assets/{agent-icon-FFo9TiY2.js → agent-icon-CcrLXGYK.js} +1 -1
  49. package/dist/client/assets/{agents-list-DK5KfLc2.js → agents-list-YhaFwP5r.js} +1 -1
  50. package/dist/client/assets/{ai-providers-R5nxbODp.js → ai-providers-BtFgtKB5.js} +1 -1
  51. package/dist/client/assets/{alert-dialog-DP78W4Vt.js → alert-dialog-fZSntFU0.js} +1 -1
  52. package/dist/client/assets/{alert-BiUR3pkU.js → alert-i_TiZfhc.js} +1 -1
  53. package/dist/client/assets/{app-editor-DZU_sdW3.js → app-editor-BY1bTlvX.js} +1 -1
  54. package/dist/client/assets/{auth-BIX18dPi.js → auth-CfoU_8o3.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-464czij1.js → auth-catchall-CP3mIPjs.js} +1 -1
  56. package/dist/client/assets/{auth-entry-BhxZn2Sh.js → auth-entry-DCawcHJY.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-lQLp-zmB.js → auth-split-layout-B845LE_s.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-CBxXT0hB.js → authenticate-and-persist-oauth-B4-0r75-.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-BVMbAK1a.js → automation-list-row-DdZXDlfn.js} +1 -1
  60. package/dist/client/assets/{automation-runs-z44C-WD7.js → automation-runs-BdD1SLFv.js} +1 -1
  61. package/dist/client/assets/{automations-Bx4X4oIF.js → automations-DnRHvdD-.js} +1 -1
  62. package/dist/client/assets/{avatar-MJs_lh8Y.js → avatar-BAHiG2sE.js} +1 -1
  63. package/dist/client/assets/{badge-CS_b3fdR.js → badge-Dq0xZ7rr.js} +1 -1
  64. package/dist/client/assets/{block-document-DIgz-okU.js → block-document-CacFySv4.js} +1 -1
  65. package/dist/client/assets/{brand-context-Bs7qKxdA.js → brand-context-Bxx6ICDC.js} +1 -1
  66. package/dist/client/assets/{buckets-CnJyp9Oe.js → buckets-C8EbHzSh.js} +1 -1
  67. package/dist/client/assets/{bulk-category-panel-CH5wZXgz.js → bulk-category-panel-BVRbqo0U.js} +1 -1
  68. package/dist/client/assets/{calendar-BHZiXvB9.js → calendar-CVBpFxZ2.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-eCvGj8Lu.js → capability-load-error-BC4d6Vds.js} +1 -1
  70. package/dist/client/assets/{card-DnN7MQgz.js → card-DjTuYxaW.js} +1 -1
  71. package/dist/client/assets/{category-editor-C_pRngsC.js → category-editor-DME1G3tA.js} +1 -1
  72. package/dist/client/assets/{chat-context-Da-7ez-W.js → chat-context-BuITnYOu.js} +1 -1
  73. package/dist/client/assets/{checkbox-Chxx3rlT.js → checkbox-BL9rMJjq.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-4D5cqXkI.js → cli-auth-success-DbFti59K.js} +1 -1
  75. package/dist/client/assets/{collection-detail-BcEjDqW_.js → collection-detail-Db5203me.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-DJvmILKJ.js → collection-display-button-Dxr1fsVi.js} +1 -1
  77. package/dist/client/assets/{collection-search-BUT_bQmo.js → collection-search-uj1gaM4-.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-DkuqucHS.js → collection-table-wrapper-C8tmCvLr.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-BGQrOSQ3.js → collection-tabs-BYhnU0zs.js} +1 -1
  80. package/dist/client/assets/{command-C9rogxz7.js → command-D0ITibop.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-BHJxQSWF.js → commerce-onboarding-AJTSTqsR.js} +1 -1
  82. package/dist/client/assets/{companions-core-C4miUU6q.js → companions-core-C1liCXoh.js} +1 -1
  83. package/dist/client/assets/{connect-af82JKAl.js → connect-CDXzlFSS.js} +1 -1
  84. package/dist/client/assets/{connection-BGx36b5q.js → connection-R8VELzRr.js} +1 -1
  85. package/dist/client/assets/{connection-card-HtzAz_A8.js → connection-card-DUknSERh.js} +1 -1
  86. package/dist/client/assets/{connection-detail-CDN1gNGK.js → connection-detail-CXYt6LI0.js} +1 -1
  87. package/dist/client/assets/{connection-form-helpers-DBfWPX0Y.js → connection-form-helpers-DuPypKDa.js} +1 -1
  88. package/dist/client/assets/{connections-CWGFjBGr.js → connections-CDgQ-RcY.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-D6OR_Y2O.js → decopilot-sse-pool-CyONAbr4.js} +1 -1
  90. package/dist/client/assets/{dialog-BzMnbY0y.js → dialog-CL_viuBY.js} +1 -1
  91. package/dist/client/assets/{domain-settings-B8Pje__5.js → domain-settings-DKDZPFSs.js} +1 -1
  92. package/dist/client/assets/{drawer-Betz0cqi.js → drawer-CiyJHlcF.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-D9PPKBun.js → dropdown-menu-BYTFWGhK.js} +1 -1
  94. package/dist/client/assets/{empty-state-DskAldEF.js → empty-state-B8nPdv_R.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-Bw-zB1Ar.js → extract-connection-data-CFRG7jjQ.js} +1 -1
  96. package/dist/client/assets/{file-explorer-C48eyWES.js → file-explorer-D4hQuWvn.js} +1 -1
  97. package/dist/client/assets/{form-nCYEFeTX.js → form-CTR5afhj.js} +1 -1
  98. package/dist/client/assets/{general-DSsCPbwO.js → general-B6kP7QyV.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-CWDwkoIY.js → github-repo-picker-aJz5egn8.js} +1 -1
  100. package/dist/client/assets/{hooks-7JU4nGqE.js → hooks-Fo1sGHql.js} +1 -1
  101. package/dist/client/assets/{index-Ba90eMAE.js → index-6--JkLce.js} +1 -1
  102. package/dist/client/assets/{index-weL-u6Ee.js → index-7f_IAbY0.js} +1 -1
  103. package/dist/client/assets/{index-iLlzzCFl.js → index-Bd-Zaxd1.js} +1 -1
  104. package/dist/client/assets/{index-ChMgVZkD.js → index-BdtuNWnu.js} +3 -3
  105. package/dist/client/assets/{index-Dukpacs4.js → index-CLNTtHX-.js} +1 -1
  106. package/dist/client/assets/{index-Bhg9KFf2.js → index-CSsl3pNU.js} +1 -1
  107. package/dist/client/assets/{index-DAF8zLJU.js → index-DNE7zGKZ.js} +1 -1
  108. package/dist/client/assets/{index-i969VkBs.js → index-DyheVxDV.js} +5 -5
  109. package/dist/client/assets/{index-DapTXAOT.js → index-TdznQK-4.js} +1 -1
  110. package/dist/client/assets/{index-DkwGWB0f.js → index-iWsHFGT2.js} +1 -1
  111. package/dist/client/assets/{index-redirect-BPH8gYxN.js → index-redirect-CGg_UbYk.js} +1 -1
  112. package/dist/client/assets/{index-zIjIdkLn.js → index-rv9sdPOE.js} +3 -3
  113. package/dist/client/assets/{input-B3sbKVA9.js → input-CHK7Y663.js} +1 -1
  114. package/dist/client/assets/{integration-icon-CO4aoJ91.js → integration-icon-CPVRJaWQ.js} +1 -1
  115. package/dist/client/assets/{invite-member-dialog-C91mFXNo.js → invite-member-dialog-B0Zdxbyv.js} +1 -1
  116. package/dist/client/assets/{label-BMJgRH7M.js → label-DxDX7fcN.js} +1 -1
  117. package/dist/client/assets/{layout-DAEmdbA0.js → layout-DwhqHmpo.js} +1 -1
  118. package/dist/client/assets/{login-CCcT7OLg.js → login-myWHqypv.js} +1 -1
  119. package/dist/client/assets/{mcp-oauth-DYUC1gDR.js → mcp-oauth-DAzBPpCV.js} +1 -1
  120. package/dist/client/assets/{members-Dxppzxxd.js → members-DNYGpmuk.js} +1 -1
  121. package/dist/client/assets/{monaco-editor-Dev-PS6i.js → monaco-editor-D8eeGrH6.js} +1 -1
  122. package/dist/client/assets/{monitoring-stats-row-BEB6r1lP.js → monitoring-stats-row-B5xRFf5y.js} +1 -1
  123. package/dist/client/assets/{multi-select-BnNqWpTO.js → multi-select-BfaQFKZL.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-rujxnxwe.js → oauth-callback-Cjlrywyi.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-ai-provider-CetxyDdJ.js → oauth-callback-ai-provider-BHsGINtN.js} +1 -1
  126. package/dist/client/assets/{onboarding-DUzcLfNr.js → onboarding-DojC5JaP.js} +1 -1
  127. package/dist/client/assets/{org-layout-B2r2p2yW.js → org-layout-jMoZbZnR.js} +1 -1
  128. package/dist/client/assets/{organization-choice-IjJKbal_.js → organization-choice-p1P5G-QX.js} +1 -1
  129. package/dist/client/assets/{orgs-Duu1Uklt.js → orgs-DP5LwWn_.js} +1 -1
  130. package/dist/client/assets/{page-seo-form-BAH5DmS_.js → page-seo-form-0qC7IeUm.js} +1 -1
  131. package/dist/client/assets/{popover-BFrRsm_m.js → popover-CA0pW1GJ.js} +1 -1
  132. package/dist/client/assets/{post-editor-BCgo9L0q.js → post-editor-BuJS2gNG.js} +1 -1
  133. package/dist/client/assets/{primitives-DwvQkJT5.js → primitives-Den-4qpl.js} +1 -1
  134. package/dist/client/assets/{profile-Au8IKhHg.js → profile-DKnHx22G.js} +1 -1
  135. package/dist/client/assets/project-app-view-DGGB7D2K.js +1 -0
  136. package/dist/client/assets/record-editor-AagynTUT.js +1 -0
  137. package/dist/client/assets/{redirect-editor-DrNjGjqG.js → redirect-editor-USukRuuz.js} +1 -1
  138. package/dist/client/assets/registry-C8RLCXQO.js +2 -0
  139. package/dist/client/assets/{registry-layout-DpKHRTKK.js → registry-layout-CoH4mVDF.js} +1 -1
  140. package/dist/client/assets/{reports-VCVe_jdH.js → reports-DGjt326U.js} +1 -1
  141. package/dist/client/assets/{require-capability-BG_pf6ig.js → require-capability-Db2xGYPf.js} +1 -1
  142. package/dist/client/assets/{required-auth-layout-BKi8OUrq.js → required-auth-layout-BrvGk7cE.js} +1 -1
  143. package/dist/client/assets/{reset-password-Br-XmQyy.js → reset-password-CWs8M_3A.js} +1 -1
  144. package/dist/client/assets/{roles-MHk4Zzub.js → roles-B9gNhLRu.js} +1 -1
  145. package/dist/client/assets/{search-input-DuTUAY5x.js → search-input-8VDv9Ujf.js} +1 -1
  146. package/dist/client/assets/{secrets-kkLzeRpG.js → secrets-BnAPexGH.js} +1 -1
  147. package/dist/client/assets/{sections-editor-B3vvjYzg.js → sections-editor-Dqnyig9J.js} +1 -1
  148. package/dist/client/assets/{select-BGWvnjAE.js → select-DC6l5J2F.js} +1 -1
  149. package/dist/client/assets/{select-model-DVhvGCUy.js → select-model-Bn41ksuL.js} +1 -1
  150. package/dist/client/assets/{self-tool-result-BP89aEBz.js → self-tool-result-8f4LnpZk.js} +1 -1
  151. package/dist/client/assets/{seo-editor-BZY1hGxI.js → seo-editor-DYa9wQGt.js} +1 -1
  152. package/dist/client/assets/{settings-layout-CbEFafMq.js → settings-layout-CXb1kjD0.js} +1 -1
  153. package/dist/client/assets/{settings-section-BYJ6_Dw0.js → settings-section-p3ZObGLY.js} +1 -1
  154. package/dist/client/assets/{shell-controls-D1NXuyNH.js → shell-controls-BYkImDSt.js} +1 -1
  155. package/dist/client/assets/{shell-layout-sFSj26fA.js → shell-layout-CXuIr4yi.js} +1 -1
  156. package/dist/client/assets/{sidebar-DLncAejG.js → sidebar-BbhBJmv9.js} +1 -1
  157. package/dist/client/assets/{skeleton-DU8UZn0r.js → skeleton-DMdwSzot.js} +1 -1
  158. package/dist/client/assets/{spinner-rIS0ABMP.js → spinner-DqBqwh6I.js} +1 -1
  159. package/dist/client/assets/{sso-D1t-0Iir.js → sso-B1t2d5FO.js} +1 -1
  160. package/dist/client/assets/{store-OylfZIBr.js → store-CdPONN5W.js} +1 -1
  161. package/dist/client/assets/store-registry-CTJJYPbB.js +2 -0
  162. package/dist/client/assets/{studio-tools-tD8_ZGRY.js → studio-tools-CE56SVLN.js} +1 -1
  163. package/dist/client/assets/{switch-ikrIxe3J.js → switch-Ci6Ll0Ol.js} +1 -1
  164. package/dist/client/assets/{tab-id-DTllZLmx.js → tab-id-BlbwGzq5.js} +1 -1
  165. package/dist/client/assets/{table-CqaQZ_2r.js → table-B9fRuiRi.js} +1 -1
  166. package/dist/client/assets/{tabs-CK29JuYS.js → tabs-DKppViko.js} +1 -1
  167. package/dist/client/assets/{textarea-DL7IKYY-.js → textarea-DjN9Kndu.js} +1 -1
  168. package/dist/client/assets/{toggle-group-CH32tsa3.js → toggle-group-Cxcr2lMG.js} +1 -1
  169. package/dist/client/assets/{toolbar-C7J4euUt.js → toolbar-C5VlFVjx.js} +1 -1
  170. package/dist/client/assets/{tooltip-DsmWOmDJ.js → tooltip-CtJZ5ibR.js} +1 -1
  171. package/dist/client/assets/{use-ai-providers-BSflXlCU.js → use-ai-providers-bwKBGQdw.js} +1 -1
  172. package/dist/client/assets/{use-automations-DGNoqHIJ.js → use-automations-7li7Tdry.js} +1 -1
  173. package/dist/client/assets/{use-autosave-Ca1PEmfd.js → use-autosave-B8QE9QvN.js} +1 -1
  174. package/dist/client/assets/{use-capability-CfWBCcId.js → use-capability-BKlrP2sh.js} +1 -1
  175. package/dist/client/assets/{use-clock-tick-BCEETnVe.js → use-clock-tick-bIKriOBF.js} +1 -1
  176. package/dist/client/assets/{use-connection-BtdpZocr.js → use-connection-DPRxD9o1.js} +1 -1
  177. package/dist/client/assets/{use-copy-D_Bxj49m.js → use-copy-BwrgioeX.js} +1 -1
  178. package/dist/client/assets/{use-create-virtual-mcp-DwjkzodM.js → use-create-virtual-mcp-D-TKwiKm.js} +1 -1
  179. package/dist/client/assets/{use-debounced-autosave-CCjPmjS6.js → use-debounced-autosave-C2Y3nuea.js} +1 -1
  180. package/dist/client/assets/{use-debounced-value-CNwM2YnA.js → use-debounced-value-Db3DLJwE.js} +1 -1
  181. package/dist/client/assets/{use-deco-credits-DPXsXoE5.js → use-deco-credits-CLT30SQF.js} +1 -1
  182. package/dist/client/assets/{use-decopilot-events-fX0gc0wo.js → use-decopilot-events-DnrMQj1u.js} +1 -1
  183. package/dist/client/assets/{use-delete-connection-ClDETq2s.js → use-delete-connection-OEKzezaX.js} +1 -1
  184. package/dist/client/assets/{use-deployment-admin-L2JDadkC.js → use-deployment-admin-DWr1mo7X.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-CeMBw_HW.js → use-file-configs-BQ4e4Wkh.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-6wMnauGa.js → use-infinite-scroll-AdCTPUwo.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-C0aIg3F1.js → use-join-requests-CU9MPOFV.js} +1 -1
  188. package/dist/client/assets/{use-mcp-auth-status-evboM2Ix.js → use-mcp-auth-status-B3IW4S4f.js} +1 -1
  189. package/dist/client/assets/{use-mcp-client-BIu-60Aj.js → use-mcp-client-S7JpxoLy.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-Dh2sgcn0.js → use-mcp-tools-iDmYG1tJ.js} +1 -1
  191. package/dist/client/assets/{use-members-CRgKWHwi.js → use-members-C2ZrYiX4.js} +1 -1
  192. package/dist/client/assets/{use-mobile-De4clCMR.js → use-mobile-ClAWSQ2p.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-avNdODKh.js → use-navigate-to-agent-7tORD7bY.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-SG2mclqB.js → use-org-auth-client-GpLX5qWN.js} +1 -1
  195. package/dist/client/assets/{use-org-sso-Dg-iwhyL.js → use-org-sso-DxWI4j2V.js} +1 -1
  196. package/dist/client/assets/{use-organization-roles-BI8xpEQc.js → use-organization-roles-aNyAQArs.js} +1 -1
  197. package/dist/client/assets/{use-organization-settings-DDfxk3TG.js → use-organization-settings-B-6AS5Dw.js} +1 -1
  198. package/dist/client/assets/{use-registry-connections-VVgQ-6vc.js → use-registry-connections-Czdh18ZA.js} +1 -1
  199. package/dist/client/assets/{use-secrets-D9w_mAbk.js → use-secrets-WW8cjmic.js} +1 -1
  200. package/dist/client/assets/{use-status-sounds-Dh7Mx4Ba.js → use-status-sounds-Bc6FIIHv.js} +1 -1
  201. package/dist/client/assets/{use-tags-Bqcvdo4W.js → use-tags-WgtZaBwa.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-ChG1pQ8o.js → use-view-mode-BzHYT9En.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-Bu_UqNaZ.js → use-virtual-mcp-CIgtLBad.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-BN8n4lgL.js +1 -0
  205. package/dist/client/assets/{useQueries-laoigcOm.js → useQueries-CFisHz6w.js} +1 -1
  206. package/dist/client/assets/{useRouterState-JlJnOUa5.js → useRouterState-B1MdiJRB.js} +1 -1
  207. package/dist/client/assets/useSuspenseInfiniteQuery-CjY1pbZE.js +1 -0
  208. package/dist/client/assets/{users-BTPAa-CI.js → users-8SjUnyep.js} +1 -1
  209. package/dist/client/assets/{variant-calendar-Cv5HqJyk.js → variant-calendar-BviJ7Rzd.js} +1 -1
  210. package/dist/client/assets/{view-mode-toggle-CkL5qH8D.js → view-mode-toggle-2ClAyKwH.js} +1 -1
  211. package/dist/client/index.html +1 -1
  212. package/dist/server/cli.js +1 -1
  213. package/dist/server/server.js +1 -1
  214. package/package.json +1 -1
  215. package/dist/client/assets/project-app-view-Bx8cV8TV.js +0 -1
  216. package/dist/client/assets/record-editor-BrJdugZS.js +0 -1
  217. package/dist/client/assets/registry-Drg7UK_L.js +0 -2
  218. package/dist/client/assets/store-registry-BYD6EfZc.js +0 -2
  219. package/dist/client/assets/useInfiniteQuery-CU6f6rac.js +0 -1
  220. package/dist/client/assets/useSuspenseInfiniteQuery-DxoKTUow.js +0 -1
@@ -1 +1 @@
1
- import{c as K,b as tt,r as et,j as s,m as ot,B as nt}from"./index-zIjIdkLn.js";import{x as vt,$ as dt,h as yt}from"./agent-icon-FFo9TiY2.js";import{i as Tt}from"./ChevronRight-Dlc2ivdM.js";import{L as jt}from"./label-BMJgRH7M.js";import{l as ft}from"./automation-runs-z44C-WD7.js";import{S as Nt}from"./switch-ikrIxe3J.js";import{T as wt,c as kt,a as Mt}from"./tooltip-DsmWOmDJ.js";import{V as _t}from"./view-mode-toggle-CkL5qH8D.js";import"./AlertCircle-8y4OERSA.js";import"./Tool01-Uep3SEjO.js";import"./ArrowUp-Cyc2lNPE.js";import"./Settings02-DOMuFrys.js";import"./Tool02-C8biIp3u.js";import"./XCircle-SAoR-qVk.js";import"./ArrowUpRight-DB2QWxkL.js";import"./TrendUp01-Bdn4X-Un.js";import"./ZapSquare-rytRMLFZ.js";import"./Users03-CMlMC75Y.js";import"./CheckCircle-Cjv9HFQJ.js";import"./Check-PYC78ebP.js";import"./ChevronDown-B5_0x02X.js";import"./ChevronUp-BUoY9Z_q.js";import"./DotsVertical-DEWBiy2X.js";import"./Stars02-BRu6qn_z.js";import"./Copy01-DAExiPfa.js";import"./CpuChip01-BS9rkd3J.js";import"./Eye-B0_iy9b0.js";import"./FilterLines-1uKS3X8V.js";import"./Star01-CZcD9lft.js";import"./Palette-CRSKI0zp.js";import"./SwitchHorizontal01-CgBuvU82.js";import"./HardDrive-e3XtBhIu.js";import"./Key01-BgCD4pBW.js";import"./LayoutLeft-Cz5Frdvf.js";import"./LinkExternal01-CFJ_4gPN.js";import"./LogOut01-B7koOpzk.js";import"./Monitor01-DZM2Wn0z.js";import"./Sun-Cvwo9PpC.js";import"./Play-B6YI7S_E.js";import"./Plus-CRjF5ZrO.js";import"./SearchLg-BTlkL2rW.js";import"./SearchMd-YQxdwYOM.js";import"./Shield01-CkaRCMUY.js";import"./Stars01-Cn5SeePJ.js";import"./Trash01-B8WSaJL2.js";import"./Upload01-DANSzhiN.js";import"./User01-DPZhlbFh.js";import"./Users01-DD6c7H7k.js";import"./XClose-RD250CPb.js";import"./X-BlBGU8hs.js";import"./Zap-C5MeTrEA.js";import"./select-BGWvnjAE.js";import"./useInfiniteQuery-CU6f6rac.js";import"./use-infinite-scroll-6wMnauGa.js";import"./use-connection-BtdpZocr.js";import"./use-mcp-client-BIu-60Aj.js";import"./auth-BIX18dPi.js";import"./use-virtual-mcp-Bu_UqNaZ.js";import"./card-DnN7MQgz.js";import"./sidebar-DLncAejG.js";import"./use-mobile-De4clCMR.js";import"./table-CqaQZ_2r.js";import"./empty-state-DskAldEF.js";import"./use-members-CRgKWHwi.js";import"./use-org-auth-client-SG2mclqB.js";import"./use-clock-tick-BCEETnVe.js";import"./use-automations-DGNoqHIJ.js";import"./studio-tools-tD8_ZGRY.js";import"./useSuspenseInfiniteQuery-DxoKTUow.js";import"./avatar-MJs_lh8Y.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D_Bxj49m.js";import"./calendar-BHZiXvB9.js";import"./dialog-BzMnbY0y.js";import"./tab-id-DTllZLmx.js";import"./hooks-7JU4nGqE.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-D6OR_Y2O.js";import"./chat-context-Da-7ez-W.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-BSflXlCU.js";import"./use-decopilot-events-fX0gc0wo.js";import"./use-organization-settings-DDfxk3TG.js";import"./monaco-editor-Dev-PS6i.js";import"./spinner-rIS0ABMP.js";import"./index-DapTXAOT.js";import"./shell-layout-sFSj26fA.js";import"./required-auth-layout-BKi8OUrq.js";import"./use-org-sso-Dg-iwhyL.js";import"./integration-icon-CO4aoJ91.js";import"./use-navigate-to-agent-avNdODKh.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-ZYewK7hC.js";import"./form-nCYEFeTX.js";import"./input-B3sbKVA9.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 pt(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)pt(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,p=[];if(pt(d.rule,p),p.length===0)return;const x=It(d.value)??(m||n);for(const h of p)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 G(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 Ut(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),p=B(c.end);if(p.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=p.getTime()>=r.getTime()?Z(r,-1):p,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),f=Math.max(it(new Date(j),n)-v,0);f<=0||a.push({variant:c,startCol:h,span:g,leftUnits:v,widthUnits:f})}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(p=>p<=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 Yt(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 Gt(e){const t=K.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=Yt(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 Kt(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=K.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=Kt(l,c),t[0]=c,t[1]=l,t[2]=d):d=t[2];const p=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]!==p?(h=p&&{maskImage:p,WebkitMaskImage:p},t[7]=p,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(wt,{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(Gt,{variant:n}),t[21]=n,t[22]=v):v=t[22];let f;return t[23]!==v||t[24]!==j?(f=s.jsxs(kt,{children:[j,v]}),t[23]=v,t[24]=j,t[25]=f):f=t[25],f}function Zn(e){const t=K.c(72),{decofile:n}=e,r=tt(),[i,o]=et.useState("calendar"),[a,m]=et.useState(Xt),[l,c]=et.useState(!1);let d,p,u;if(t[0]!==n||t[1]!==l){const P=Ft(n);d=P.filter(Qt).length,u=l?P:P.filter(qt),p=Vt(u.map(Jt)),t[0]=n,t[1]=l,t[2]=d,t[3]=p,t[4]=u}else d=t[2],p=t[3],u=t[4];const x=p;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"?G(P,-1):G(P,-3)),t[6]=i,t[7]=b):b=t[7];const j=b;let v;t[8]!==i?(v=()=>m(P=>i==="calendar"?G(P,1):G(P,3)),t[8]=i,t[9]=v):v=t[9];const f=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 w;t[14]!==r?(w=r("sandbox.variantCalendar.previous"),t[14]=r,t[15]=w):w=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]!==w?(k=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:j,"aria-label":w,children:D}),t[17]=j,t[18]=w,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]!==f||t[24]!==M?(A=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:f,"aria-label":M,children:S}),t[23]=f,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 N;t[31]!==A||t[32]!==_||t[33]!==T||t[34]!==k?(N=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]=N):N=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(Nt,{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 U;t[59]!==N||t[60]!==z?(U=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[N,z]}),t[59]=N,t[60]=z,t[61]=U):U=t[61];let Y;t[62]!==x||t[63]!==a||t[64]!==d||t[65]!==l||t[66]!==u||t[67]!==i?(Y=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]=Y):Y=t[68];let q;return t[69]!==U||t[70]!==Y?(q=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[U,Y]}),t[69]=U,t[70]=Y,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=K.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=K.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=ft,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=Ut(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((f,y)=>{const T=f.getMonth()===n.getMonth(),w=f.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",w&&"bg-primary text-primary-foreground font-semibold"),children:f.getDate()})},y)}),b.map((f,y)=>{const T=ut(i,f.variant.blockKey),w=mt+f.lane*(rt+ct),D=f.leftUnits/7*100,k=f.widthUnits/7*100,M=f.variant.openStart&&g===0,S=f.variant.openEnd&&g===u.length-1;return s.jsxs(bt,{variant:f.variant,color:T,fadeStart:M,fadeEnd:S,style:{top:w,left:`calc(${D}% + 2px)`,width:`calc(${k}% - 4px)`,minWidth:te,height:rt},children:[f.variant.blockLabel,f.variant.label!==f.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",f.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 p;return t[13]!==o||t[14]!==c||t[15]!==d?(p=s.jsx(o,{className:c,children:d}),t[13]=o,t[14]=c,t[15]=d,t[16]=p):p=t[16],p}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=K.c(23),{monthStart:n,variants:r,colorMap:i}=e,o=n,a=G(n,Q),m=new Date,l=new Map;for(const _ of r){const N=l.get(_.blockKey)??[];N.push(_),l.set(_.blockKey,N)}const c=Array.from(l.entries()).sort(le),d=a.getTime()-o.getTime(),p=_=>(Math.max(o.getTime(),Math.min(a.getTime(),_.getTime()))-o.getTime())/d*100;let u;t[0]!==o?(u=(_,N)=>G(o,N),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()?p(m):null,g=tt(),b=ft,j="flex-1 min-h-0",v="min-w-[900px] relative";let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f={width:J},t[2]=f):f=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:f,children:y}),t[5]=y,t[6]=T):T=t[6];let w;t[7]===Symbol.for("react.memo_cache_sentinel")?(w={gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},t[7]=w):w=t[7];const D=x.map(ae);let k;t[8]!==D?(k=s.jsx("div",{className:"flex-1 grid",style:w,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[N,L]=_,H=ut(i,N),F=L[0]?.blockLabel??N;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=p(new Date(R)),V=p(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))]},N)});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{Zn as VariantCalendar};
1
+ import{c as K,b as tt,r as et,j as s,m as ot,B as nt}from"./index-rv9sdPOE.js";import{x as vt,$ as dt,h as yt}from"./agent-icon-CcrLXGYK.js";import{i as Tt}from"./ChevronRight-BYTK_VZ4.js";import{L as jt}from"./label-DxDX7fcN.js";import{l as ft}from"./automation-runs-BdD1SLFv.js";import{S as Nt}from"./switch-Ci6Ll0Ol.js";import{T as wt,c as kt,a as Mt}from"./tooltip-CtJZ5ibR.js";import{V as _t}from"./view-mode-toggle-2ClAyKwH.js";import"./AlertCircle-DOfCMsFh.js";import"./Tool01-B1feCbMY.js";import"./ArrowUp-xeN9sSQC.js";import"./Settings02-C49SjSLS.js";import"./Tool02-nN6ZHQY3.js";import"./XCircle-Cqy-RFjn.js";import"./ArrowUpRight-CCN9kBKT.js";import"./TrendUp01-BhoL83KU.js";import"./ZapSquare-5SS41xyN.js";import"./Users03-3pXlT9Dj.js";import"./CheckCircle-CYzV5xFz.js";import"./Check-CbrdHpvv.js";import"./ChevronDown-BuG2IPna.js";import"./ChevronUp-BvrFEqD9.js";import"./DotsVertical-CegtjIrk.js";import"./Stars02-BCP1mXyq.js";import"./Copy01-DZ9KJC5i.js";import"./CpuChip01-DevOwXeU.js";import"./Eye-BCSFTxh2.js";import"./FilterLines-CzUnWSux.js";import"./Star01-CFXFpvIt.js";import"./Palette-IWyV7Vnf.js";import"./SwitchHorizontal01-DF-1FC8z.js";import"./HardDrive-Cx5Enuv5.js";import"./Key01-DZGVnpFz.js";import"./LayoutLeft-DW3e9ncf.js";import"./LinkExternal01-D3fijgPd.js";import"./LogOut01-BsknXd8d.js";import"./Monitor01-C375pc-7.js";import"./Sun-B2fZZfgK.js";import"./Play-BzD4jDZP.js";import"./Plus-zO15HXtk.js";import"./SearchLg-n7Qi-N-0.js";import"./SearchMd-haqOaKnl.js";import"./Shield01-DmxSUo0p.js";import"./Stars01-DrzqcHWD.js";import"./Trash01-CtBroGvB.js";import"./Upload01-BxV00su7.js";import"./User01-Cv24Iurg.js";import"./Users01-7eNaMB7_.js";import"./XClose-Bn3Nnikg.js";import"./X-BNCOarCM.js";import"./Zap-BIF24Csg.js";import"./select-DC6l5J2F.js";import"./useInfiniteQuery-BN8n4lgL.js";import"./use-infinite-scroll-AdCTPUwo.js";import"./use-connection-DPRxD9o1.js";import"./use-mcp-client-S7JpxoLy.js";import"./auth-CfoU_8o3.js";import"./use-virtual-mcp-CIgtLBad.js";import"./card-DjTuYxaW.js";import"./sidebar-BbhBJmv9.js";import"./use-mobile-ClAWSQ2p.js";import"./table-B9fRuiRi.js";import"./empty-state-B8nPdv_R.js";import"./use-members-C2ZrYiX4.js";import"./use-org-auth-client-GpLX5qWN.js";import"./use-clock-tick-bIKriOBF.js";import"./use-automations-7li7Tdry.js";import"./studio-tools-CE56SVLN.js";import"./useSuspenseInfiniteQuery-CjY1pbZE.js";import"./avatar-BAHiG2sE.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BwrgioeX.js";import"./calendar-CVBpFxZ2.js";import"./dialog-CL_viuBY.js";import"./tab-id-BlbwGzq5.js";import"./hooks-Fo1sGHql.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CyONAbr4.js";import"./chat-context-BuITnYOu.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-bwKBGQdw.js";import"./use-decopilot-events-DnrMQj1u.js";import"./use-organization-settings-B-6AS5Dw.js";import"./monaco-editor-D8eeGrH6.js";import"./spinner-DqBqwh6I.js";import"./index-TdznQK-4.js";import"./shell-layout-CXuIr4yi.js";import"./required-auth-layout-BrvGk7cE.js";import"./use-org-sso-DxWI4j2V.js";import"./integration-icon-CPVRJaWQ.js";import"./use-navigate-to-agent-7tORD7bY.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-B1ztj9L1.js";import"./form-CTR5afhj.js";import"./input-CHK7Y663.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 pt(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)pt(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,p=[];if(pt(d.rule,p),p.length===0)return;const x=It(d.value)??(m||n);for(const h of p)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 G(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 Ut(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),p=B(c.end);if(p.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=p.getTime()>=r.getTime()?Z(r,-1):p,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),f=Math.max(it(new Date(j),n)-v,0);f<=0||a.push({variant:c,startCol:h,span:g,leftUnits:v,widthUnits:f})}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(p=>p<=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 Yt(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 Gt(e){const t=K.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=Yt(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 Kt(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=K.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=Kt(l,c),t[0]=c,t[1]=l,t[2]=d):d=t[2];const p=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]!==p?(h=p&&{maskImage:p,WebkitMaskImage:p},t[7]=p,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(wt,{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(Gt,{variant:n}),t[21]=n,t[22]=v):v=t[22];let f;return t[23]!==v||t[24]!==j?(f=s.jsxs(kt,{children:[j,v]}),t[23]=v,t[24]=j,t[25]=f):f=t[25],f}function Zn(e){const t=K.c(72),{decofile:n}=e,r=tt(),[i,o]=et.useState("calendar"),[a,m]=et.useState(Xt),[l,c]=et.useState(!1);let d,p,u;if(t[0]!==n||t[1]!==l){const P=Ft(n);d=P.filter(Qt).length,u=l?P:P.filter(qt),p=Vt(u.map(Jt)),t[0]=n,t[1]=l,t[2]=d,t[3]=p,t[4]=u}else d=t[2],p=t[3],u=t[4];const x=p;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"?G(P,-1):G(P,-3)),t[6]=i,t[7]=b):b=t[7];const j=b;let v;t[8]!==i?(v=()=>m(P=>i==="calendar"?G(P,1):G(P,3)),t[8]=i,t[9]=v):v=t[9];const f=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 w;t[14]!==r?(w=r("sandbox.variantCalendar.previous"),t[14]=r,t[15]=w):w=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]!==w?(k=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:j,"aria-label":w,children:D}),t[17]=j,t[18]=w,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]!==f||t[24]!==M?(A=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:f,"aria-label":M,children:S}),t[23]=f,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 N;t[31]!==A||t[32]!==_||t[33]!==T||t[34]!==k?(N=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]=N):N=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(Nt,{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 U;t[59]!==N||t[60]!==z?(U=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[N,z]}),t[59]=N,t[60]=z,t[61]=U):U=t[61];let Y;t[62]!==x||t[63]!==a||t[64]!==d||t[65]!==l||t[66]!==u||t[67]!==i?(Y=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]=Y):Y=t[68];let q;return t[69]!==U||t[70]!==Y?(q=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[U,Y]}),t[69]=U,t[70]=Y,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=K.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=K.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=ft,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=Ut(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((f,y)=>{const T=f.getMonth()===n.getMonth(),w=f.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",w&&"bg-primary text-primary-foreground font-semibold"),children:f.getDate()})},y)}),b.map((f,y)=>{const T=ut(i,f.variant.blockKey),w=mt+f.lane*(rt+ct),D=f.leftUnits/7*100,k=f.widthUnits/7*100,M=f.variant.openStart&&g===0,S=f.variant.openEnd&&g===u.length-1;return s.jsxs(bt,{variant:f.variant,color:T,fadeStart:M,fadeEnd:S,style:{top:w,left:`calc(${D}% + 2px)`,width:`calc(${k}% - 4px)`,minWidth:te,height:rt},children:[f.variant.blockLabel,f.variant.label!==f.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",f.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 p;return t[13]!==o||t[14]!==c||t[15]!==d?(p=s.jsx(o,{className:c,children:d}),t[13]=o,t[14]=c,t[15]=d,t[16]=p):p=t[16],p}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=K.c(23),{monthStart:n,variants:r,colorMap:i}=e,o=n,a=G(n,Q),m=new Date,l=new Map;for(const _ of r){const N=l.get(_.blockKey)??[];N.push(_),l.set(_.blockKey,N)}const c=Array.from(l.entries()).sort(le),d=a.getTime()-o.getTime(),p=_=>(Math.max(o.getTime(),Math.min(a.getTime(),_.getTime()))-o.getTime())/d*100;let u;t[0]!==o?(u=(_,N)=>G(o,N),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()?p(m):null,g=tt(),b=ft,j="flex-1 min-h-0",v="min-w-[900px] relative";let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f={width:J},t[2]=f):f=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:f,children:y}),t[5]=y,t[6]=T):T=t[6];let w;t[7]===Symbol.for("react.memo_cache_sentinel")?(w={gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},t[7]=w):w=t[7];const D=x.map(ae);let k;t[8]!==D?(k=s.jsx("div",{className:"flex-1 grid",style:w,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[N,L]=_,H=ut(i,N),F=L[0]?.blockLabel??N;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=p(new Date(R)),V=p(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))]},N)});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{Zn as VariantCalendar};
@@ -1 +1 @@
1
- import{c as $,r as T,m as f,j as i}from"./index-zIjIdkLn.js";import{c as k,T as I,a as P}from"./tooltip-DsmWOmDJ.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-rv9sdPOE.js";import{c as k,T as I,a as P}from"./tooltip-CtJZ5ibR.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-zIjIdkLn.js"></script>
53
+ <script type="module" crossorigin src="/assets/index-rv9sdPOE.js"></script>
54
54
  <link rel="stylesheet" crossorigin href="/assets/index-DMFn6dNg.css">
55
55
  </head>
56
56
  <body>
@@ -1252,7 +1252,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var su1=O(()=>{U_()});f
1252
1252
  `.execute(Z);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${$}/${K}, keeping in old table`);continue}}await gf`
1253
1253
  DELETE FROM kysely_migration WHERE name = ${Y}
1254
1254
  `.execute(Z)}}async function om1(Z){await ph6(Z),await th6(Z);let X=new pm1({db:Z,provider:{getMigrations:()=>Promise.resolve(Fl0)}}),{error:Y,results:G}=await X.migrateToLatest(),Q=0;if(G?.forEach((J)=>{if(J.status==="Success")Q++;else if(J.status==="Error")console.error(`Failed to execute migration "${J.migrationName}"`)}),Y)throw console.error("Failed to migrate"),console.error(Y),Y;return Q}async function oh6(Z){let{keepOpen:X=!1,database:Y,skipBetterAuth:G=!1}=Z??{},Q="skipped";if(!G&&!Y)Q=await Xh0();let J=Y??J6(),$=async()=>{if(!X&&!Y)await Yw(J).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await om1(J.db);return await $(),{betterAuth:Q,kysely:K}}catch(K){throw await $(),K}}async function rh6(){let Z=J6(),X=new pm1({db:Z.db,provider:{getMigrations:()=>Promise.resolve(Fl0)}}),{error:Y,results:G}=await X.migrateDown();if(G?.forEach((Q)=>{if(Q.status==="Success")console.log(`\u2705 Migration "${Q.migrationName}" rolled back successfully`);else if(Q.status==="Error")console.error(`\u274C Failed to rollback migration "${Q.migrationName}"`)}),Y)throw console.error("Failed to rollback migration"),console.error(Y),Y}var am1=O(()=>{nm1();Yh0();KX()});async function I90(Z){let X={...process.env},Y=A00(Z,X);console.log(xU1(Y.settings.encryptionKey));let{ensureServices:G}=await Promise.resolve().then(() => (g50(),y50)),{outputs:Q,services:J}=await G({home:Y.settings.dataDir,externalDatabaseUrl:Y.externalDatabaseUrl,externalNatsUrl:Y.externalNatsUrl});if(!Y.skipMigrations){let{migrateBetterAuth:K}=await Promise.resolve().then(() => (Yh0(),kl1));await K(Q.databaseUrl);let{createDatabase:W}=await Promise.resolve().then(() => (KX(),pc1)),{migrateToLatest:H}=await Promise.resolve().then(() => (am1(),rm1)),N=W(Q.databaseUrl);await H({keepOpen:!0,database:N,skipBetterAuth:!0})}let $={...Y.settings,databaseUrl:Q.databaseUrl,natsUrls:Q.natsUrls,...Q.s3?{s3Endpoint:Q.s3.endpoint,s3Bucket:Q.s3.bucket,s3AccessKeyId:Q.s3.accessKeyId,s3SecretAccessKey:Q.s3.secretAccessKey,s3ForcePathStyle:Q.s3.forcePathStyle}:{},...Q.natsTunnel?{natsPublicUrl:Q.natsTunnel.publicUrl,natsAccountJwt:Q.natsTunnel.accountJwt,natsAccountSigningKey:Q.natsTunnel.accountSigningKey,natsOperatorJwt:Q.natsTunnel.operatorJwt,natsTunnelPublicEnabled:!0,natsCredsPath:Q.natsTunnel.credsPath}:{}};return eu1($),{settings:$,services:J.map((K)=>({name:K.name==="PostgreSQL"?"Postgres":K.name,port:K.port})),managedServiceNames:J.filter((K)=>K.owner==="managed").map((K)=>K.name)}}var wl0=O(()=>{U_();g8()});var Zi1={};M0(Zi1,{updateService:()=>kD,subscribeCliState:()=>Ll0,setTuiConsoleIntercepted:()=>q90,setServerUrl:()=>Om,setMigrationsDone:()=>Bm,setDevMode:()=>eh6,resetCliStateForTests:()=>ah6,isTuiConsoleIntercepted:()=>M90,getCliState:()=>Ol0,addLogEntry:()=>Kw});function sm1(){return{services:[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}],migrationsStatus:"pending",serverUrl:null,logs:[]}}function ah6(){MG=sm1()}function sh6(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function wm(){for(let Z of Bl0)Z()}function Ol0(){return MG}function Ll0(Z){return Bl0.add(Z),()=>Bl0.delete(Z)}function kD(Z){MG={...MG,services:MG.services.map((X)=>X.name===Z.name?Z:X)},wm()}function Bm(){MG={...MG,migrationsStatus:"done"},wm()}function Om(Z){MG={...MG,serverUrl:Z},wm()}function Kw(Z){let X=[...MG.logs,Z];MG={...MG,logs:X.length>500?X.slice(-500):X},wm()}function eh6(){MG={...MG,services:[...sh6(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},wm()}function q90(Z){em1=Z}function M90(){return em1}var MG,Bl0,em1=!1;var VD=O(()=>{MG=sm1();Bl0=new Set});import{createServer as Xi1}from"net";function Zu6(Z){return new Promise((X)=>{let Y=Xi1();Y.once("error",()=>X(!1)),Y.listen(Z,"0.0.0.0",()=>{Y.close(()=>X(!0))})})}async function Lm(Z){if(await Zu6(Z))return Z;let X=await new Promise((Y,G)=>{let Q=Xi1();Q.once("error",G),Q.listen(0,"0.0.0.0",()=>{let J=Q.address(),$=typeof J==="object"&&J?J.port:0;Q.close(()=>Y($))})});return console.warn(`Port ${Z} is in use, using port ${X} instead.`),X}var Dl0=()=>{};function Dm(Z){return Z.replace(/\x1b\[[0-9;]*m/g,"")}var El0={};M0(El0,{startDevServer:()=>Yu6});import{join as Xu6}from"path";function Yi1(Z){let X=Z.getReader(),Y=new TextDecoder,G="";function Q(){let J=G.split(`
1255
- `);G=J.pop()??"";for(let $ of J){let K=Dm($).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;Kw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{for(;;){let{done:J,value:$}=await X.read();if(J)break;G+=Y.decode($,{stream:!0}),Q()}if(G.trim()){let J=Dm(G).replace(/^\[\d+\]\s*/,"").trim();if(J)Kw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:J})}})()}async function Yu6(Z){let{baseUrl:X,noTui:Y}=Z,G=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Q=G?process.env.PORT:Z.vitePort,J=X||`http://localhost:${Q}`,$=G?await Lm(Number(Q)+1):await Lm(Number(Z.port)),{settings:K,services:W,managedServiceNames:H}=await I90({port:String($),home:Z.home,baseUrl:Z.baseUrl,localMode:Z.localMode,skipMigrations:Z.skipMigrations,noTui:Z.noTui,vitePort:Z.vitePort});for(let L of W)kD({name:L.name,status:"ready",port:L.port});Bm();let N=Xu6(import.meta.dir,"..","..","..","..",".."),U=Y===!0,F=Bun.spawn(["bun","run","dev:servers"],{cwd:N,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Q),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:J,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...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",U?"inherit":"pipe",U?"inherit":"pipe"]});if(!U)Yi1(F.stdout),Yi1(F.stderr);Om(J),kD({name:"Vite",status:"ready",port:Number(Q)}),kD({name:"API",status:"ready",port:Number(K.port)});let B=async(L)=>{if(F.kill(L),await F.exited,H.length>0){let{stopServices:D}=await Promise.resolve().then(() => (g50(),y50));await D(K.dataDir)}};return process.on("SIGINT",()=>B("SIGINT")),process.on("SIGTERM",()=>B("SIGTERM")),{port:Number(Q),process:F}}var zl0=O(()=>{wl0();VD();Dl0()});var k90;var jl0=O(()=>{k90={name:"decocms",version:"4.160.2",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",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.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:{"@anthropic-ai/claude-agent-sdk":"^0.3.181","@duckdb/node-api":"^1.5.0-r.1","@openai/codex":"0.144.3","@openai/codex-darwin-arm64":"npm:@openai/codex@0.144.3-darwin-arm64","@openai/codex-darwin-x64":"npm:@openai/codex@0.144.3-darwin-x64","@openai/codex-linux-arm64":"npm:@openai/codex@0.144.3-linux-arm64","@openai/codex-linux-x64":"npm:@openai/codex@0.144.3-linux-x64","@openai/codex-win32-arm64":"npm:@openai/codex@0.144.3-win32-arm64","@openai/codex-win32-x64":"npm:@openai/codex@0.144.3-win32-x64"},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","@resvg/resvg-js":"^2.6.2","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","node-pty":"^1.0.0","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6",satori:"^0.28.2"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/harness":"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 Qu6,Text as Gi1}from"ink";import{jsx as Ju6,jsxs as Qi1}from"react/jsx-runtime";function Ji1({version:Z}){return Qi1(Qu6,{flexDirection:"column",marginTop:1,children:[$90.map((X,Y)=>Ju6(Gi1,{color:K90[Y],children:X},Y)),Qi1(Gi1,{dimColor:!0,children:[" v",Z]})]})}var $i1=O(()=>{Gm()});import{Box as SD,Text as Ww}from"ink";import{Spinner as $u6}from"@inkjs/ui";import{jsx as fQ,jsxs as hf}from"react/jsx-runtime";function Ki1({status:Z}){if(Z==="pending")return fQ($u6,{label:""});return fQ(Ww,{color:"green",children:"\u2713"})}function Ku6(Z){return`${Z.name}: ${Z.port||"...."}`}function Wi1({services:Z,migrationsStatus:X,home:Y,serverUrl:G}){return hf(SD,{flexDirection:"column",paddingBottom:1,children:[fQ(Ji1,{version:k90.version}),fQ(SD,{marginBottom:1,children:fQ(Ww,{dimColor:!0,children:"\u2500".repeat(80)})}),fQ(SD,{children:hf(Ww,{dimColor:!0,children:["Home: ",Y]})}),hf(SD,{gap:2,children:[Z.map((Q)=>hf(SD,{gap:1,children:[fQ(Ww,{children:Ku6(Q)}),fQ(Ki1,{status:Q.status})]},Q.name)),hf(SD,{gap:1,children:[fQ(Ww,{children:"Migrations"}),fQ(Ki1,{status:X})]})]}),fQ(SD,{children:G?hf(Ww,{children:["Open in browser: ",fQ(Ww,{color:"cyan",children:G})]}):fQ(Ww,{dimColor:!0,children:"Starting..."})})]})}var Hi1=O(()=>{jl0();$i1()});import{Box as Wu6,Text as Em}from"ink";import{jsx as Al0,jsxs as Pl0}from"react/jsx-runtime";function Hu6(Z){if(Z>=500)return"red";if(Z>=400)return"yellow";if(Z>=300)return"cyan";return"green"}function Ni1({logs:Z}){return Al0(Wu6,{flexDirection:"column",children:Z.map((X,Y)=>{if(X.rawLine)return Al0(Em,{dimColor:!0,children:X.rawLine},Y);let G=X.duration<1000?`${X.duration}ms`:`${(X.duration/1000).toFixed(1)}s`;return Pl0(Em,{children:[Pl0(Em,{dimColor:!0,children:[X.method.padEnd(6)," ",X.path.padEnd(30)," "]}),Al0(Em,{color:Hu6(X.status),children:X.status}),Pl0(Em,{dimColor:!0,children:[" ",G.padStart(8)]})]},Y)})})}var Ui1=()=>{};var Tl0={};M0(Tl0,{App:()=>Fu6});import{Box as Nu6}from"ink";import{useSyncExternalStore as Uu6}from"react";import{jsx as Fi1,jsxs as wu6}from"react/jsx-runtime";function Fu6({home:Z}){let X=Uu6(Ll0,Ol0);return wu6(Nu6,{flexDirection:"column",children:[Fi1(Wi1,{services:X.services,migrationsStatus:X.migrationsStatus,home:Z,serverUrl:X.serverUrl}),Fi1(Ni1,{logs:X.logs})]})}var Rl0=O(()=>{Hi1();Ui1();VD()});var W$="thread-gate",EN="decopilot-hosted-harness",t3="automations",Hw="background-tools";var wi1="5";function Bi1(Z){return{name:"decocms",systemDatabaseUrl:Z.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:Z.poolSize,runAdminServer:!1,executorID:Z.executorID,applicationVersion:wi1,...Z.listenQueues!==void 0?{listenQueues:Z.listenQueues}:{}}}var Oi1=()=>{};function Bu6(){let Z=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...Z]}function Il0(Z,X){for(let Y=0;Y<Z.length;Y++){let G=Z[Y];if(G===void 0)continue;if(G===X)return Z[Y+1];if(G.startsWith(`${X}=`))return G.slice(X.length+1)}return}function Li1(){let Z=Bu6();if(Z.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:Il0(Z,"--cpu-prof-dir")??process.cwd(),name:Il0(Z,"--cpu-prof-name"),markdown:Z.includes("--cpu-prof-md"),intervalUs:Number(Il0(Z,"--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 Di1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let Z=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),X=async()=>{let Y=RD();if(!Y)return;let G={};try{let{heapStats:Q}=await import("bun:jsc"),J=Q(),$=Object.entries(J.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);G={objectCount:J.objectCount,heapSize:J.heapSize,top:Object.fromEntries($)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:Y.rss,heapUsed:Y.heapUsed,heapTotal:Y.heapTotal,external:Y.external,arrayBuffers:Y.arrayBuffers,...G}))};return X().catch(()=>{}),V90=setInterval(()=>void X().catch(()=>{}),Z),V90.unref?.(),process.on("SIGUSR2",()=>{try{let Y=Bun.generateHeapSnapshot("v8"),G=typeof Y==="string"?Y:JSON.stringify(Y),Q=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Q,G),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Q}))}catch(Y){console.error("[heap-watch] snapshot failed:",Y)}}),()=>{if(V90)clearInterval(V90)}}var V90;var Ei1=()=>{};import*as Ou6 from"bun:jsc";function zi1(){if(process.env.STALL_WATCHDOG!=="1")return()=>{};let Z=Number(process.env.STALL_WATCHDOG_MS??100),X=Number(process.env.STALL_WATCHDOG_TICK_MS??50);try{Lu6()}catch(J){return console.error("[stall-watchdog] failed to start sampling profiler:",J),()=>{}}let Y,G=performance.now()+X,Q=()=>{let J=performance.now(),$=J-G;G=J+X;let K=[];try{K=Du6()?.traces??[]}catch{}if($>Z&&K.length>0){let W=new Map;for(let N of K){let U=N.frames.find((B)=>B.sourceURL&&!/Unknown Executable/.test(B.category??""))??N.frames[0];if(!U)continue;let F=(U.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),w=`${U.name??"?"} @ ${F}:${U.line??"?"}`;W.set(w,(W.get(w)??0)+1)}let H=[...W.entries()].sort((N,U)=>U[1]-N[1]).slice(0,8).map(([N,U])=>({frame:N,count:U}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round($),samplesInWindow:K.length,top:H}))}Y=setTimeout(Q,X),Y.unref?.()};return Y=setTimeout(Q,X),Y.unref?.(),()=>{if(Y)clearTimeout(Y)}}var Lu6,Du6;var ji1=O(()=>{({startSamplingProfiler:Lu6,samplingProfilerStackTraces:Du6}=Ou6)});function Ai1(){Li1();let Z=[Di1(),hc1(),zi1()];return()=>{for(let X of Z)X()}}var Pi1=O(()=>{ig0();Ei1();ji1()});var CD=x((Ti1)=>{Object.defineProperty(Ti1,"__esModule",{value:!0});Ti1.RepublishHeaders=Ti1.DirectMsgHeaders=Ti1.JsHeaders=Ti1.AdvisoryKind=void 0;Ti1.isOrderedPushConsumerOptions=Eu6;Ti1.isPullConsumer=zu6;Ti1.isPushConsumer=ju6;Ti1.isBoundPushConsumerOptions=Au6;function Eu6(Z){if(Z&&typeof Z==="object")return"name_prefix"in Z||"deliver_subject_prefix"in Z||"filter_subjects"in Z||"filter_subject"in Z||"deliver_policy"in Z||"opt_start_seq"in Z||"opt_start_time"in Z||"replay_policy"in Z||"inactive_threshold"in Z||"headers_only"in Z||"deliver_prefix"in Z;return!1}function zu6(Z){return Z.isPullConsumer()}function ju6(Z){return Z.isPushConsumer()}function Au6(Z){if(Z&&typeof Z==="object")return"deliver_subject"in Z||"deliver_group"in Z||"idle_heartbeat"in Z;return!1}Ti1.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"};Ti1.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"};Ti1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Ti1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var bQ=x((Ii1)=>{Object.defineProperty(Ii1,"__esModule",{value:!0});Ii1.TD=Ii1.TE=Ii1.Empty=void 0;Ii1.encode=Su6;Ii1.decode=Cu6;Ii1.Empty=new Uint8Array(0);Ii1.TE=new TextEncoder;Ii1.TD=new TextDecoder;function Vu6(...Z){let X=0;for(let Q=0;Q<Z.length;Q++)X+=Z[Q].length;let Y=new Uint8Array(X),G=0;for(let Q=0;Q<Z.length;Q++)Y.set(Z[Q],G),G+=Z[Q].length;return Y}function Su6(...Z){let X=[];for(let Y=0;Y<Z.length;Y++)X.push(Ii1.TE.encode(Z[Y]));if(X.length===0)return Ii1.Empty;if(X.length===1)return X[0];return Vu6(...X)}function Cu6(Z){if(!Z||Z.length===0)return"";return Ii1.TD.decode(Z)}});var yQ=x((ki1)=>{Object.defineProperty(ki1,"__esModule",{value:!0});ki1.errors=ki1.PermissionViolationError=ki1.NoRespondersError=ki1.TimeoutError=ki1.RequestError=ki1.ProtocolError=ki1.ConnectionError=ki1.DrainingConnectionError=ki1.ClosedConnectionError=ki1.AuthorizationError=ki1.UserAuthenticationExpiredError=ki1.InvalidOperationError=ki1.InvalidArgumentError=ki1.InvalidSubjectError=void 0;class Ml0 extends Error{constructor(Z,X){super(`illegal subject: '${Z}'`,X);this.name="InvalidSubjectError"}}ki1.InvalidSubjectError=Ml0;class S90 extends Error{constructor(Z,X){super(Z,X);this.name="InvalidArgumentError"}static format(Z,X,Y){if(Array.isArray(X)&&X.length>1)X=X[0];if(Array.isArray(Z))Z=Z.map((G)=>`'${G}'`),Z=Z.join(",");else Z=`'${Z}'`;return new S90(`${Z} ${X}`,Y)}}ki1.InvalidArgumentError=S90;class kl0 extends Error{constructor(Z,X){super(Z,X);this.name="InvalidOperationError"}}ki1.InvalidOperationError=kl0;class C90 extends Error{constructor(Z,X){super(Z,X);this.name="UserAuthenticationExpiredError"}static parse(Z){if(Z.toLowerCase().indexOf("user authentication expired")!==-1)return new C90(Z);return null}}ki1.UserAuthenticationExpiredError=C90;class x90 extends Error{constructor(Z,X){super(Z,X);this.name="AuthorizationError"}static parse(Z){let X=["authorization violation","account authentication expired","authentication timeout"],Y=Z.toLowerCase();for(let G=0;G<X.length;G++)if(Y.indexOf(X[G])!==-1)return new x90(Z);return null}}ki1.AuthorizationError=x90;class Vl0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}ki1.ClosedConnectionError=Vl0;class Sl0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}ki1.DrainingConnectionError=Sl0;class Cl0 extends Error{constructor(Z,X){super(Z,X);this.name="ConnectionError"}}ki1.ConnectionError=Cl0;class xl0 extends Error{constructor(Z,X){super(Z,X);this.name="ProtocolError"}}ki1.ProtocolError=xl0;class vl0 extends Error{constructor(Z="",X){super(Z,X);this.name="RequestError"}isNoResponders(){return this.cause instanceof v90}}ki1.RequestError=vl0;class _l0 extends Error{constructor(Z){super("timeout",Z);this.name="TimeoutError"}}ki1.TimeoutError=_l0;class v90 extends Error{subject;constructor(Z,X){super(`no responders: '${Z}'`,X);this.subject=Z,this.name="NoResponders"}}ki1.NoRespondersError=v90;class _90 extends Error{operation;subject;queue;constructor(Z,X,Y,G,Q){super(Z,Q);this.name="PermissionViolationError",this.operation=X,this.subject=Y,this.queue=G}static parse(Z){if((Z?Z.toLowerCase():"").indexOf("permissions violation")===-1)return null;let Y="publish",G="",Q=void 0,J=Z.match(/(Publish|Subscription) to "(\S+)"/);if(J){if(Y=J[1].toLowerCase(),G=J[2],Y==="subscription"){let $=Z.match(/using queue "(\S+)"/);if($)Q=$[1]}}return new _90(Z,Y,G,Q)}}ki1.PermissionViolationError=_90;ki1.errors={AuthorizationError:x90,ClosedConnectionError:Vl0,ConnectionError:Cl0,DrainingConnectionError:Sl0,InvalidArgumentError:S90,InvalidOperationError:kl0,InvalidSubjectError:Ml0,NoRespondersError:v90,PermissionViolationError:_90,ProtocolError:xl0,RequestError:vl0,TimeoutError:_l0,UserAuthenticationExpiredError:C90}});var H$=x((vi1)=>{Object.defineProperty(vi1,"__esModule",{value:!0});vi1.SimpleMutex=vi1.Perf=void 0;vi1.extend=tu6;vi1.render=ou6;vi1.timeout=ru6;vi1.delay=au6;vi1.deadline=su6;vi1.deferred=bl0;vi1.debugDeferred=eu6;vi1.shuffle=Zc6;vi1.collect=Xc6;vi1.jitter=xi1;vi1.backoff=Yc6;vi1.nanos=Gc6;vi1.millis=Qc6;vi1.randomToken=Kc6;var pu6=bQ(),fl0=yQ();function tu6(Z,...X){for(let Y=0;Y<X.length;Y++){let G=X[Y];Object.keys(G).forEach(function(Q){Z[Q]=G[Q]})}return Z}function ou6(Z){return pu6.TD.decode(Z).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function ru6(Z,X=!0){let Y=X?new fl0.TimeoutError:null,G,Q,J=new Promise(($,K)=>{G={cancel:()=>{if(Q)clearTimeout(Q)}},Q=setTimeout(()=>{if(Y===null)K(new fl0.TimeoutError);else K(Y)},Z)});return Object.assign(J,G)}function au6(Z=0){let X,Y=new Promise((G)=>{let Q=setTimeout(()=>{G()},Z);X={cancel:()=>{if(Q)clearTimeout(Q),G()}}});return Object.assign(Y,X)}async function su6(Z,X=1000){let Y=bl0(),G=setTimeout(()=>{Y.reject(new fl0.TimeoutError)},X);try{return await Promise.race([Z,Y])}finally{clearTimeout(G)}}function bl0(){let Z={},X=new Promise((Y,G)=>{Z={resolve:Y,reject:G}});return Object.assign(X,Z)}function eu6(){let Z={},X=new Promise((Y,G)=>{Z={resolve:(Q)=>{console.trace("resolve",Q),Y(Q)},reject:(Q)=>{console.trace("reject"),G(Q)}}});return Object.assign(X,Z)}function Zc6(Z){for(let X=Z.length-1;X>0;X--){let Y=Math.floor(Math.random()*(X+1));[Z[X],Z[Y]]=[Z[Y],Z[X]]}return Z}async function Xc6(Z){let X=[];for await(let Y of Z)X.push(Y);return X}class Si1{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark(Z){this.timers.set(Z,performance.now())}measure(Z,X,Y){let G=this.timers.get(X);if(G===void 0)throw Error(`${X} is not defined`);let Q=this.timers.get(Y);if(Q===void 0)throw Error(`${Y} is not defined`);this.measures.set(Z,Q-G)}getEntries(){let Z=[];return this.measures.forEach((X,Y)=>{Z.push({name:Y,duration:X})}),Z}}vi1.Perf=Si1;class Ci1{max;current;waiting;constructor(Z=1){this.max=Z,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let Z=bl0();return this.waiting.push(Z),Z}unlock(){this.current--,this.waiting.pop()?.resolve()}}vi1.SimpleMutex=Ci1;function xi1(Z){if(Z===0)return 0;return Math.floor(Z/2+Math.random()*Z)}function Yc6(Z=[0,250,250,500,500,3000,5000]){if(!Array.isArray(Z))Z=[0,250,250,500,500,3000,5000];let X=Z.length-1;return{backoff(Y){return xi1(Y>X?Z[X]:Z[Y])}}}function Gc6(Z){return Z*1e6}function Qc6(Z){return Math.floor(Z/1e6)}var Jc6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",zN=new Uint8Array(62);for(let Z=0;Z<62;Z++)zN[Z]=Jc6.charCodeAt(Z);var $c6=218340105584896;function Kc6(){let Z=Math.floor(Math.random()*$c6),X=Z%62,Y=zN[X];Z=(Z-X)/62,X=Z%62;let G=zN[X];Z=(Z-X)/62,X=Z%62;let Q=zN[X];Z=(Z-X)/62,X=Z%62;let J=zN[X];Z=(Z-X)/62,X=Z%62;let $=zN[X];Z=(Z-X)/62,X=Z%62;let K=zN[X];Z=(Z-X)/62,X=Z%62;let W=zN[X];Z=(Z-X)/62;let H=zN[Z];return String.fromCharCode(Y,G,Q,J,$,K,W,H)}});var ci1=x((hi1)=>{Object.defineProperty(hi1,"__esModule",{value:!0});hi1.nuid=hi1.NuidImpl=void 0;var Tc6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Nw=62,b90=12,yi1=10,fi1=33,Rc6=333,bi1=b90+yi1,gl0=new Uint8Array(Nw);for(let Z=0;Z<Nw;Z++)gl0[Z]=Tc6.charCodeAt(Z);var f90=4294967296,gi1=BigInt(Nw)**BigInt(yi1),zm=Number(gi1/(1n<<32n)),yl0=Number(gi1%(1n<<32n));function Ic6(Z){for(let X=0;X<Z.length;X++)Z[X]=Math.floor(Math.random()*256)}function qc6(Z){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues(Z);else Ic6(Z)}class hl0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(bi1),this.cbuf=new Uint8Array(b90),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let Z=0;do this.seqHi=Math.floor(Math.random()*(zm+1)),this.seqLo=Math.floor(Math.random()*f90);while(Z++<8&&this.seqHi===zm&&this.seqLo>=yl0);if(this.seqHi===zm&&this.seqLo>=yl0)this.seqLo=0;this.inc=Math.random()*(Rc6-fi1)+fi1|0}setPre(){qc6(this.cbuf);for(let Z=0;Z<b90;Z++)this.buf[Z]=gl0[this.cbuf[Z]%Nw]}fillSeq(){let Z=this.seqHi,X=this.seqLo;for(let Y=bi1-1;Y>=b90;Y--){let G=Math.floor(Z/Nw),J=(Z-G*Nw)*f90+X,$=Math.floor(J/Nw),K=J-$*Nw;this.buf[Y]=gl0[K],Z=G,X=$}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=f90)this.seqLo-=f90,this.seqHi+=1;if(this.seqHi>zm||this.seqHi===zm&&this.seqLo>=yl0)this.setPre(),this.initSeqAndInc();this.fillSeq();let Z=this.buf;return String.fromCharCode(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5],Z[6],Z[7],Z[8],Z[9],Z[10],Z[11],Z[12],Z[13],Z[14],Z[15],Z[16],Z[17],Z[18],Z[19],Z[20],Z[21])}reset(){this.init()}}hi1.NuidImpl=hl0;hi1.nuid=new hl0});var ii1=x((di1)=>{Object.defineProperty(di1,"__esModule",{value:!0});di1.nuid=di1.Nuid=void 0;var li1=ci1();di1.Nuid=li1.NuidImpl;di1.nuid=li1.nuid});var g90=x((y90)=>{Object.defineProperty(y90,"__esModule",{value:!0});y90.nuid=y90.Nuid=void 0;var ni1=ii1();Object.defineProperty(y90,"Nuid",{enumerable:!0,get:function(){return ni1.Nuid}});Object.defineProperty(y90,"nuid",{enumerable:!0,get:function(){return ni1.nuid}})});var Uw=x((pi1)=>{Object.defineProperty(pi1,"__esModule",{value:!0});pi1.DEFAULT_HOST=pi1.DEFAULT_PORT=pi1.Match=void 0;pi1.syncIterator=xc6;pi1.createInbox=vc6;var Sc6=g90(),Cc6=yQ();pi1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function xc6(Z){let X=Z[Symbol.asyncIterator]();return{async next(){let Y=await X.next();if(Y.done)return Promise.resolve(null);return Promise.resolve(Y.value)}}}function vc6(Z=""){if(Z=Z||"_INBOX",typeof Z!=="string")throw TypeError("prefix must be a string");return Z.split(".").forEach((X)=>{if(X==="*"||X===">")throw Cc6.InvalidArgumentError.format("prefix",`cannot have wildcards ('${Z}')`)}),`${Z}.${Sc6.nuid.next()}`}pi1.DEFAULT_PORT=4222;pi1.DEFAULT_HOST="127.0.0.1"});var jm=x((ai1)=>{Object.defineProperty(ai1,"__esModule",{value:!0});ai1.DataBuffer=void 0;var oi1=bQ();class ri1{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...Z){let X=0;for(let Q=0;Q<Z.length;Q++)X+=Z[Q].length;let Y=new Uint8Array(X),G=0;for(let Q=0;Q<Z.length;Q++)Y.set(Z[Q],G),G+=Z[Q].length;return Y}static fromAscii(Z){if(!Z)Z="";return oi1.TE.encode(Z)}static toAscii(Z){return oi1.TD.decode(Z)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let Z=new Uint8Array(this.byteLength),X=0;for(let Y=0;Y<this.buffers.length;Y++)Z.set(this.buffers[Y],X),X+=this.buffers[Y].length;this.buffers.length=0,this.buffers.push(Z)}}shift(){if(this.buffers.length){let Z=this.buffers.shift();if(Z)return this.byteLength-=Z.length,Z}return new Uint8Array(0)}drain(Z){if(this.buffers.length){this.pack();let X=this.buffers.pop();if(X){let Y=this.byteLength;if(Z===void 0||Z>Y)Z=Y;let G=X.subarray(0,Z);if(Y>Z)this.buffers.push(X.subarray(Z));return this.byteLength=Y-Z,G}}return new Uint8Array(0)}fill(Z,...X){if(Z)this.buffers.push(Z),this.byteLength+=Z.length;for(let Y=0;Y<X.length;Y++)if(X[Y]&&X[Y].length)this.buffers.push(X[Y]),this.byteLength+=X[Y].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}}ai1.DataBuffer=ri1});var xD=x((Zn1)=>{Object.defineProperty(Zn1,"__esModule",{value:!0});Zn1.LF=Zn1.CR=Zn1.CRLF=Zn1.CR_LF_LEN=Zn1.CR_LF=void 0;Zn1.setTransportFactory=cc6;Zn1.defaultPort=lc6;Zn1.getUrlParseFn=dc6;Zn1.newTransport=mc6;Zn1.getResolveFn=ic6;Zn1.protoLen=ei1;Zn1.extractProtocolMessage=nc6;var gc6=bQ(),hc6=Uw(),uc6=jm(),gQ;function cc6(Z){gQ=Z}function lc6(){return gQ!==void 0&&gQ.defaultPort!==void 0?gQ.defaultPort:hc6.DEFAULT_PORT}function dc6(){return gQ!==void 0&&gQ.urlParseFn?gQ.urlParseFn:void 0}function mc6(){if(!gQ||typeof gQ.factory!=="function")throw Error("transport fn is not set");return gQ.factory()}function ic6(){return gQ!==void 0&&gQ.dnsResolveFn?gQ.dnsResolveFn:void 0}Zn1.CR_LF=`\r
1255
+ `);G=J.pop()??"";for(let $ of J){let K=Dm($).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;Kw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{for(;;){let{done:J,value:$}=await X.read();if(J)break;G+=Y.decode($,{stream:!0}),Q()}if(G.trim()){let J=Dm(G).replace(/^\[\d+\]\s*/,"").trim();if(J)Kw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:J})}})()}async function Yu6(Z){let{baseUrl:X,noTui:Y}=Z,G=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Q=G?process.env.PORT:Z.vitePort,J=X||`http://localhost:${Q}`,$=G?await Lm(Number(Q)+1):await Lm(Number(Z.port)),{settings:K,services:W,managedServiceNames:H}=await I90({port:String($),home:Z.home,baseUrl:Z.baseUrl,localMode:Z.localMode,skipMigrations:Z.skipMigrations,noTui:Z.noTui,vitePort:Z.vitePort});for(let L of W)kD({name:L.name,status:"ready",port:L.port});Bm();let N=Xu6(import.meta.dir,"..","..","..","..",".."),U=Y===!0,F=Bun.spawn(["bun","run","dev:servers"],{cwd:N,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Q),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:J,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...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",U?"inherit":"pipe",U?"inherit":"pipe"]});if(!U)Yi1(F.stdout),Yi1(F.stderr);Om(J),kD({name:"Vite",status:"ready",port:Number(Q)}),kD({name:"API",status:"ready",port:Number(K.port)});let B=async(L)=>{if(F.kill(L),await F.exited,H.length>0){let{stopServices:D}=await Promise.resolve().then(() => (g50(),y50));await D(K.dataDir)}};return process.on("SIGINT",()=>B("SIGINT")),process.on("SIGTERM",()=>B("SIGTERM")),{port:Number(Q),process:F}}var zl0=O(()=>{wl0();VD();Dl0()});var k90;var jl0=O(()=>{k90={name:"decocms",version:"4.160.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",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.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:{"@anthropic-ai/claude-agent-sdk":"^0.3.181","@duckdb/node-api":"^1.5.0-r.1","@openai/codex":"0.144.3","@openai/codex-darwin-arm64":"npm:@openai/codex@0.144.3-darwin-arm64","@openai/codex-darwin-x64":"npm:@openai/codex@0.144.3-darwin-x64","@openai/codex-linux-arm64":"npm:@openai/codex@0.144.3-linux-arm64","@openai/codex-linux-x64":"npm:@openai/codex@0.144.3-linux-x64","@openai/codex-win32-arm64":"npm:@openai/codex@0.144.3-win32-arm64","@openai/codex-win32-x64":"npm:@openai/codex@0.144.3-win32-x64"},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","@resvg/resvg-js":"^2.6.2","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","node-pty":"^1.0.0","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6",satori:"^0.28.2"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/harness":"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 Qu6,Text as Gi1}from"ink";import{jsx as Ju6,jsxs as Qi1}from"react/jsx-runtime";function Ji1({version:Z}){return Qi1(Qu6,{flexDirection:"column",marginTop:1,children:[$90.map((X,Y)=>Ju6(Gi1,{color:K90[Y],children:X},Y)),Qi1(Gi1,{dimColor:!0,children:[" v",Z]})]})}var $i1=O(()=>{Gm()});import{Box as SD,Text as Ww}from"ink";import{Spinner as $u6}from"@inkjs/ui";import{jsx as fQ,jsxs as hf}from"react/jsx-runtime";function Ki1({status:Z}){if(Z==="pending")return fQ($u6,{label:""});return fQ(Ww,{color:"green",children:"\u2713"})}function Ku6(Z){return`${Z.name}: ${Z.port||"...."}`}function Wi1({services:Z,migrationsStatus:X,home:Y,serverUrl:G}){return hf(SD,{flexDirection:"column",paddingBottom:1,children:[fQ(Ji1,{version:k90.version}),fQ(SD,{marginBottom:1,children:fQ(Ww,{dimColor:!0,children:"\u2500".repeat(80)})}),fQ(SD,{children:hf(Ww,{dimColor:!0,children:["Home: ",Y]})}),hf(SD,{gap:2,children:[Z.map((Q)=>hf(SD,{gap:1,children:[fQ(Ww,{children:Ku6(Q)}),fQ(Ki1,{status:Q.status})]},Q.name)),hf(SD,{gap:1,children:[fQ(Ww,{children:"Migrations"}),fQ(Ki1,{status:X})]})]}),fQ(SD,{children:G?hf(Ww,{children:["Open in browser: ",fQ(Ww,{color:"cyan",children:G})]}):fQ(Ww,{dimColor:!0,children:"Starting..."})})]})}var Hi1=O(()=>{jl0();$i1()});import{Box as Wu6,Text as Em}from"ink";import{jsx as Al0,jsxs as Pl0}from"react/jsx-runtime";function Hu6(Z){if(Z>=500)return"red";if(Z>=400)return"yellow";if(Z>=300)return"cyan";return"green"}function Ni1({logs:Z}){return Al0(Wu6,{flexDirection:"column",children:Z.map((X,Y)=>{if(X.rawLine)return Al0(Em,{dimColor:!0,children:X.rawLine},Y);let G=X.duration<1000?`${X.duration}ms`:`${(X.duration/1000).toFixed(1)}s`;return Pl0(Em,{children:[Pl0(Em,{dimColor:!0,children:[X.method.padEnd(6)," ",X.path.padEnd(30)," "]}),Al0(Em,{color:Hu6(X.status),children:X.status}),Pl0(Em,{dimColor:!0,children:[" ",G.padStart(8)]})]},Y)})})}var Ui1=()=>{};var Tl0={};M0(Tl0,{App:()=>Fu6});import{Box as Nu6}from"ink";import{useSyncExternalStore as Uu6}from"react";import{jsx as Fi1,jsxs as wu6}from"react/jsx-runtime";function Fu6({home:Z}){let X=Uu6(Ll0,Ol0);return wu6(Nu6,{flexDirection:"column",children:[Fi1(Wi1,{services:X.services,migrationsStatus:X.migrationsStatus,home:Z,serverUrl:X.serverUrl}),Fi1(Ni1,{logs:X.logs})]})}var Rl0=O(()=>{Hi1();Ui1();VD()});var W$="thread-gate",EN="decopilot-hosted-harness",t3="automations",Hw="background-tools";var wi1="5";function Bi1(Z){return{name:"decocms",systemDatabaseUrl:Z.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:Z.poolSize,runAdminServer:!1,executorID:Z.executorID,applicationVersion:wi1,...Z.listenQueues!==void 0?{listenQueues:Z.listenQueues}:{}}}var Oi1=()=>{};function Bu6(){let Z=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...Z]}function Il0(Z,X){for(let Y=0;Y<Z.length;Y++){let G=Z[Y];if(G===void 0)continue;if(G===X)return Z[Y+1];if(G.startsWith(`${X}=`))return G.slice(X.length+1)}return}function Li1(){let Z=Bu6();if(Z.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:Il0(Z,"--cpu-prof-dir")??process.cwd(),name:Il0(Z,"--cpu-prof-name"),markdown:Z.includes("--cpu-prof-md"),intervalUs:Number(Il0(Z,"--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 Di1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let Z=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),X=async()=>{let Y=RD();if(!Y)return;let G={};try{let{heapStats:Q}=await import("bun:jsc"),J=Q(),$=Object.entries(J.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);G={objectCount:J.objectCount,heapSize:J.heapSize,top:Object.fromEntries($)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:Y.rss,heapUsed:Y.heapUsed,heapTotal:Y.heapTotal,external:Y.external,arrayBuffers:Y.arrayBuffers,...G}))};return X().catch(()=>{}),V90=setInterval(()=>void X().catch(()=>{}),Z),V90.unref?.(),process.on("SIGUSR2",()=>{try{let Y=Bun.generateHeapSnapshot("v8"),G=typeof Y==="string"?Y:JSON.stringify(Y),Q=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Q,G),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Q}))}catch(Y){console.error("[heap-watch] snapshot failed:",Y)}}),()=>{if(V90)clearInterval(V90)}}var V90;var Ei1=()=>{};import*as Ou6 from"bun:jsc";function zi1(){if(process.env.STALL_WATCHDOG!=="1")return()=>{};let Z=Number(process.env.STALL_WATCHDOG_MS??100),X=Number(process.env.STALL_WATCHDOG_TICK_MS??50);try{Lu6()}catch(J){return console.error("[stall-watchdog] failed to start sampling profiler:",J),()=>{}}let Y,G=performance.now()+X,Q=()=>{let J=performance.now(),$=J-G;G=J+X;let K=[];try{K=Du6()?.traces??[]}catch{}if($>Z&&K.length>0){let W=new Map;for(let N of K){let U=N.frames.find((B)=>B.sourceURL&&!/Unknown Executable/.test(B.category??""))??N.frames[0];if(!U)continue;let F=(U.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),w=`${U.name??"?"} @ ${F}:${U.line??"?"}`;W.set(w,(W.get(w)??0)+1)}let H=[...W.entries()].sort((N,U)=>U[1]-N[1]).slice(0,8).map(([N,U])=>({frame:N,count:U}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round($),samplesInWindow:K.length,top:H}))}Y=setTimeout(Q,X),Y.unref?.()};return Y=setTimeout(Q,X),Y.unref?.(),()=>{if(Y)clearTimeout(Y)}}var Lu6,Du6;var ji1=O(()=>{({startSamplingProfiler:Lu6,samplingProfilerStackTraces:Du6}=Ou6)});function Ai1(){Li1();let Z=[Di1(),hc1(),zi1()];return()=>{for(let X of Z)X()}}var Pi1=O(()=>{ig0();Ei1();ji1()});var CD=x((Ti1)=>{Object.defineProperty(Ti1,"__esModule",{value:!0});Ti1.RepublishHeaders=Ti1.DirectMsgHeaders=Ti1.JsHeaders=Ti1.AdvisoryKind=void 0;Ti1.isOrderedPushConsumerOptions=Eu6;Ti1.isPullConsumer=zu6;Ti1.isPushConsumer=ju6;Ti1.isBoundPushConsumerOptions=Au6;function Eu6(Z){if(Z&&typeof Z==="object")return"name_prefix"in Z||"deliver_subject_prefix"in Z||"filter_subjects"in Z||"filter_subject"in Z||"deliver_policy"in Z||"opt_start_seq"in Z||"opt_start_time"in Z||"replay_policy"in Z||"inactive_threshold"in Z||"headers_only"in Z||"deliver_prefix"in Z;return!1}function zu6(Z){return Z.isPullConsumer()}function ju6(Z){return Z.isPushConsumer()}function Au6(Z){if(Z&&typeof Z==="object")return"deliver_subject"in Z||"deliver_group"in Z||"idle_heartbeat"in Z;return!1}Ti1.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"};Ti1.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"};Ti1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Ti1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var bQ=x((Ii1)=>{Object.defineProperty(Ii1,"__esModule",{value:!0});Ii1.TD=Ii1.TE=Ii1.Empty=void 0;Ii1.encode=Su6;Ii1.decode=Cu6;Ii1.Empty=new Uint8Array(0);Ii1.TE=new TextEncoder;Ii1.TD=new TextDecoder;function Vu6(...Z){let X=0;for(let Q=0;Q<Z.length;Q++)X+=Z[Q].length;let Y=new Uint8Array(X),G=0;for(let Q=0;Q<Z.length;Q++)Y.set(Z[Q],G),G+=Z[Q].length;return Y}function Su6(...Z){let X=[];for(let Y=0;Y<Z.length;Y++)X.push(Ii1.TE.encode(Z[Y]));if(X.length===0)return Ii1.Empty;if(X.length===1)return X[0];return Vu6(...X)}function Cu6(Z){if(!Z||Z.length===0)return"";return Ii1.TD.decode(Z)}});var yQ=x((ki1)=>{Object.defineProperty(ki1,"__esModule",{value:!0});ki1.errors=ki1.PermissionViolationError=ki1.NoRespondersError=ki1.TimeoutError=ki1.RequestError=ki1.ProtocolError=ki1.ConnectionError=ki1.DrainingConnectionError=ki1.ClosedConnectionError=ki1.AuthorizationError=ki1.UserAuthenticationExpiredError=ki1.InvalidOperationError=ki1.InvalidArgumentError=ki1.InvalidSubjectError=void 0;class Ml0 extends Error{constructor(Z,X){super(`illegal subject: '${Z}'`,X);this.name="InvalidSubjectError"}}ki1.InvalidSubjectError=Ml0;class S90 extends Error{constructor(Z,X){super(Z,X);this.name="InvalidArgumentError"}static format(Z,X,Y){if(Array.isArray(X)&&X.length>1)X=X[0];if(Array.isArray(Z))Z=Z.map((G)=>`'${G}'`),Z=Z.join(",");else Z=`'${Z}'`;return new S90(`${Z} ${X}`,Y)}}ki1.InvalidArgumentError=S90;class kl0 extends Error{constructor(Z,X){super(Z,X);this.name="InvalidOperationError"}}ki1.InvalidOperationError=kl0;class C90 extends Error{constructor(Z,X){super(Z,X);this.name="UserAuthenticationExpiredError"}static parse(Z){if(Z.toLowerCase().indexOf("user authentication expired")!==-1)return new C90(Z);return null}}ki1.UserAuthenticationExpiredError=C90;class x90 extends Error{constructor(Z,X){super(Z,X);this.name="AuthorizationError"}static parse(Z){let X=["authorization violation","account authentication expired","authentication timeout"],Y=Z.toLowerCase();for(let G=0;G<X.length;G++)if(Y.indexOf(X[G])!==-1)return new x90(Z);return null}}ki1.AuthorizationError=x90;class Vl0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}ki1.ClosedConnectionError=Vl0;class Sl0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}ki1.DrainingConnectionError=Sl0;class Cl0 extends Error{constructor(Z,X){super(Z,X);this.name="ConnectionError"}}ki1.ConnectionError=Cl0;class xl0 extends Error{constructor(Z,X){super(Z,X);this.name="ProtocolError"}}ki1.ProtocolError=xl0;class vl0 extends Error{constructor(Z="",X){super(Z,X);this.name="RequestError"}isNoResponders(){return this.cause instanceof v90}}ki1.RequestError=vl0;class _l0 extends Error{constructor(Z){super("timeout",Z);this.name="TimeoutError"}}ki1.TimeoutError=_l0;class v90 extends Error{subject;constructor(Z,X){super(`no responders: '${Z}'`,X);this.subject=Z,this.name="NoResponders"}}ki1.NoRespondersError=v90;class _90 extends Error{operation;subject;queue;constructor(Z,X,Y,G,Q){super(Z,Q);this.name="PermissionViolationError",this.operation=X,this.subject=Y,this.queue=G}static parse(Z){if((Z?Z.toLowerCase():"").indexOf("permissions violation")===-1)return null;let Y="publish",G="",Q=void 0,J=Z.match(/(Publish|Subscription) to "(\S+)"/);if(J){if(Y=J[1].toLowerCase(),G=J[2],Y==="subscription"){let $=Z.match(/using queue "(\S+)"/);if($)Q=$[1]}}return new _90(Z,Y,G,Q)}}ki1.PermissionViolationError=_90;ki1.errors={AuthorizationError:x90,ClosedConnectionError:Vl0,ConnectionError:Cl0,DrainingConnectionError:Sl0,InvalidArgumentError:S90,InvalidOperationError:kl0,InvalidSubjectError:Ml0,NoRespondersError:v90,PermissionViolationError:_90,ProtocolError:xl0,RequestError:vl0,TimeoutError:_l0,UserAuthenticationExpiredError:C90}});var H$=x((vi1)=>{Object.defineProperty(vi1,"__esModule",{value:!0});vi1.SimpleMutex=vi1.Perf=void 0;vi1.extend=tu6;vi1.render=ou6;vi1.timeout=ru6;vi1.delay=au6;vi1.deadline=su6;vi1.deferred=bl0;vi1.debugDeferred=eu6;vi1.shuffle=Zc6;vi1.collect=Xc6;vi1.jitter=xi1;vi1.backoff=Yc6;vi1.nanos=Gc6;vi1.millis=Qc6;vi1.randomToken=Kc6;var pu6=bQ(),fl0=yQ();function tu6(Z,...X){for(let Y=0;Y<X.length;Y++){let G=X[Y];Object.keys(G).forEach(function(Q){Z[Q]=G[Q]})}return Z}function ou6(Z){return pu6.TD.decode(Z).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function ru6(Z,X=!0){let Y=X?new fl0.TimeoutError:null,G,Q,J=new Promise(($,K)=>{G={cancel:()=>{if(Q)clearTimeout(Q)}},Q=setTimeout(()=>{if(Y===null)K(new fl0.TimeoutError);else K(Y)},Z)});return Object.assign(J,G)}function au6(Z=0){let X,Y=new Promise((G)=>{let Q=setTimeout(()=>{G()},Z);X={cancel:()=>{if(Q)clearTimeout(Q),G()}}});return Object.assign(Y,X)}async function su6(Z,X=1000){let Y=bl0(),G=setTimeout(()=>{Y.reject(new fl0.TimeoutError)},X);try{return await Promise.race([Z,Y])}finally{clearTimeout(G)}}function bl0(){let Z={},X=new Promise((Y,G)=>{Z={resolve:Y,reject:G}});return Object.assign(X,Z)}function eu6(){let Z={},X=new Promise((Y,G)=>{Z={resolve:(Q)=>{console.trace("resolve",Q),Y(Q)},reject:(Q)=>{console.trace("reject"),G(Q)}}});return Object.assign(X,Z)}function Zc6(Z){for(let X=Z.length-1;X>0;X--){let Y=Math.floor(Math.random()*(X+1));[Z[X],Z[Y]]=[Z[Y],Z[X]]}return Z}async function Xc6(Z){let X=[];for await(let Y of Z)X.push(Y);return X}class Si1{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark(Z){this.timers.set(Z,performance.now())}measure(Z,X,Y){let G=this.timers.get(X);if(G===void 0)throw Error(`${X} is not defined`);let Q=this.timers.get(Y);if(Q===void 0)throw Error(`${Y} is not defined`);this.measures.set(Z,Q-G)}getEntries(){let Z=[];return this.measures.forEach((X,Y)=>{Z.push({name:Y,duration:X})}),Z}}vi1.Perf=Si1;class Ci1{max;current;waiting;constructor(Z=1){this.max=Z,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let Z=bl0();return this.waiting.push(Z),Z}unlock(){this.current--,this.waiting.pop()?.resolve()}}vi1.SimpleMutex=Ci1;function xi1(Z){if(Z===0)return 0;return Math.floor(Z/2+Math.random()*Z)}function Yc6(Z=[0,250,250,500,500,3000,5000]){if(!Array.isArray(Z))Z=[0,250,250,500,500,3000,5000];let X=Z.length-1;return{backoff(Y){return xi1(Y>X?Z[X]:Z[Y])}}}function Gc6(Z){return Z*1e6}function Qc6(Z){return Math.floor(Z/1e6)}var Jc6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",zN=new Uint8Array(62);for(let Z=0;Z<62;Z++)zN[Z]=Jc6.charCodeAt(Z);var $c6=218340105584896;function Kc6(){let Z=Math.floor(Math.random()*$c6),X=Z%62,Y=zN[X];Z=(Z-X)/62,X=Z%62;let G=zN[X];Z=(Z-X)/62,X=Z%62;let Q=zN[X];Z=(Z-X)/62,X=Z%62;let J=zN[X];Z=(Z-X)/62,X=Z%62;let $=zN[X];Z=(Z-X)/62,X=Z%62;let K=zN[X];Z=(Z-X)/62,X=Z%62;let W=zN[X];Z=(Z-X)/62;let H=zN[Z];return String.fromCharCode(Y,G,Q,J,$,K,W,H)}});var ci1=x((hi1)=>{Object.defineProperty(hi1,"__esModule",{value:!0});hi1.nuid=hi1.NuidImpl=void 0;var Tc6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Nw=62,b90=12,yi1=10,fi1=33,Rc6=333,bi1=b90+yi1,gl0=new Uint8Array(Nw);for(let Z=0;Z<Nw;Z++)gl0[Z]=Tc6.charCodeAt(Z);var f90=4294967296,gi1=BigInt(Nw)**BigInt(yi1),zm=Number(gi1/(1n<<32n)),yl0=Number(gi1%(1n<<32n));function Ic6(Z){for(let X=0;X<Z.length;X++)Z[X]=Math.floor(Math.random()*256)}function qc6(Z){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues(Z);else Ic6(Z)}class hl0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(bi1),this.cbuf=new Uint8Array(b90),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let Z=0;do this.seqHi=Math.floor(Math.random()*(zm+1)),this.seqLo=Math.floor(Math.random()*f90);while(Z++<8&&this.seqHi===zm&&this.seqLo>=yl0);if(this.seqHi===zm&&this.seqLo>=yl0)this.seqLo=0;this.inc=Math.random()*(Rc6-fi1)+fi1|0}setPre(){qc6(this.cbuf);for(let Z=0;Z<b90;Z++)this.buf[Z]=gl0[this.cbuf[Z]%Nw]}fillSeq(){let Z=this.seqHi,X=this.seqLo;for(let Y=bi1-1;Y>=b90;Y--){let G=Math.floor(Z/Nw),J=(Z-G*Nw)*f90+X,$=Math.floor(J/Nw),K=J-$*Nw;this.buf[Y]=gl0[K],Z=G,X=$}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=f90)this.seqLo-=f90,this.seqHi+=1;if(this.seqHi>zm||this.seqHi===zm&&this.seqLo>=yl0)this.setPre(),this.initSeqAndInc();this.fillSeq();let Z=this.buf;return String.fromCharCode(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5],Z[6],Z[7],Z[8],Z[9],Z[10],Z[11],Z[12],Z[13],Z[14],Z[15],Z[16],Z[17],Z[18],Z[19],Z[20],Z[21])}reset(){this.init()}}hi1.NuidImpl=hl0;hi1.nuid=new hl0});var ii1=x((di1)=>{Object.defineProperty(di1,"__esModule",{value:!0});di1.nuid=di1.Nuid=void 0;var li1=ci1();di1.Nuid=li1.NuidImpl;di1.nuid=li1.nuid});var g90=x((y90)=>{Object.defineProperty(y90,"__esModule",{value:!0});y90.nuid=y90.Nuid=void 0;var ni1=ii1();Object.defineProperty(y90,"Nuid",{enumerable:!0,get:function(){return ni1.Nuid}});Object.defineProperty(y90,"nuid",{enumerable:!0,get:function(){return ni1.nuid}})});var Uw=x((pi1)=>{Object.defineProperty(pi1,"__esModule",{value:!0});pi1.DEFAULT_HOST=pi1.DEFAULT_PORT=pi1.Match=void 0;pi1.syncIterator=xc6;pi1.createInbox=vc6;var Sc6=g90(),Cc6=yQ();pi1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function xc6(Z){let X=Z[Symbol.asyncIterator]();return{async next(){let Y=await X.next();if(Y.done)return Promise.resolve(null);return Promise.resolve(Y.value)}}}function vc6(Z=""){if(Z=Z||"_INBOX",typeof Z!=="string")throw TypeError("prefix must be a string");return Z.split(".").forEach((X)=>{if(X==="*"||X===">")throw Cc6.InvalidArgumentError.format("prefix",`cannot have wildcards ('${Z}')`)}),`${Z}.${Sc6.nuid.next()}`}pi1.DEFAULT_PORT=4222;pi1.DEFAULT_HOST="127.0.0.1"});var jm=x((ai1)=>{Object.defineProperty(ai1,"__esModule",{value:!0});ai1.DataBuffer=void 0;var oi1=bQ();class ri1{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...Z){let X=0;for(let Q=0;Q<Z.length;Q++)X+=Z[Q].length;let Y=new Uint8Array(X),G=0;for(let Q=0;Q<Z.length;Q++)Y.set(Z[Q],G),G+=Z[Q].length;return Y}static fromAscii(Z){if(!Z)Z="";return oi1.TE.encode(Z)}static toAscii(Z){return oi1.TD.decode(Z)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let Z=new Uint8Array(this.byteLength),X=0;for(let Y=0;Y<this.buffers.length;Y++)Z.set(this.buffers[Y],X),X+=this.buffers[Y].length;this.buffers.length=0,this.buffers.push(Z)}}shift(){if(this.buffers.length){let Z=this.buffers.shift();if(Z)return this.byteLength-=Z.length,Z}return new Uint8Array(0)}drain(Z){if(this.buffers.length){this.pack();let X=this.buffers.pop();if(X){let Y=this.byteLength;if(Z===void 0||Z>Y)Z=Y;let G=X.subarray(0,Z);if(Y>Z)this.buffers.push(X.subarray(Z));return this.byteLength=Y-Z,G}}return new Uint8Array(0)}fill(Z,...X){if(Z)this.buffers.push(Z),this.byteLength+=Z.length;for(let Y=0;Y<X.length;Y++)if(X[Y]&&X[Y].length)this.buffers.push(X[Y]),this.byteLength+=X[Y].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}}ai1.DataBuffer=ri1});var xD=x((Zn1)=>{Object.defineProperty(Zn1,"__esModule",{value:!0});Zn1.LF=Zn1.CR=Zn1.CRLF=Zn1.CR_LF_LEN=Zn1.CR_LF=void 0;Zn1.setTransportFactory=cc6;Zn1.defaultPort=lc6;Zn1.getUrlParseFn=dc6;Zn1.newTransport=mc6;Zn1.getResolveFn=ic6;Zn1.protoLen=ei1;Zn1.extractProtocolMessage=nc6;var gc6=bQ(),hc6=Uw(),uc6=jm(),gQ;function cc6(Z){gQ=Z}function lc6(){return gQ!==void 0&&gQ.defaultPort!==void 0?gQ.defaultPort:hc6.DEFAULT_PORT}function dc6(){return gQ!==void 0&&gQ.urlParseFn?gQ.urlParseFn:void 0}function mc6(){if(!gQ||typeof gQ.factory!=="function")throw Error("transport fn is not set");return gQ.factory()}function ic6(){return gQ!==void 0&&gQ.dnsResolveFn?gQ.dnsResolveFn:void 0}Zn1.CR_LF=`\r
1256
1256
  `;Zn1.CR_LF_LEN=Zn1.CR_LF.length;Zn1.CRLF=uc6.DataBuffer.fromAscii(Zn1.CR_LF);Zn1.CR=new Uint8Array(Zn1.CRLF)[0];Zn1.LF=new Uint8Array(Zn1.CRLF)[1];function ei1(Z){for(let X=0;X<Z.length;X++){let Y=X+1;if(Z.byteLength>Y&&Z[X]===Zn1.CR&&Z[Y]===Zn1.LF)return Y+1}return 0}function nc6(Z){let X=ei1(Z);if(X>0){let G=new Uint8Array(Z).slice(0,X);return gc6.TD.decode(G)}return""}});var ml0=x((Wn1)=>{Object.defineProperty(Wn1,"__esModule",{value:!0});Wn1.ipV4=Jn1;Wn1.isIP=Gl6;Wn1.parseIP=$n1;var Am=4,vD=16,h90=48,Qn1=57,Yn1=65,Xl6=70,Gn1=97,Yl6=102,dl0=16777215;function Jn1(Z,X,Y,G){let Q=new Uint8Array(vD);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach(($,K)=>{Q[K]=$}),Q[12]=Z,Q[13]=X,Q[14]=Y,Q[15]=G,Q}function Gl6(Z){return $n1(Z)!==void 0}function $n1(Z){for(let X=0;X<Z.length;X++)switch(Z[X]){case".":return Kn1(Z);case":":return Ql6(Z)}return}function Kn1(Z){let X=new Uint8Array(Am);for(let Y=0;Y<Am;Y++){if(Z.length===0)return;if(Y>0){if(Z[0]!==".")return;Z=Z.substring(1)}let{n:G,c:Q,ok:J}=Jl6(Z);if(!J||G>255)return;Z=Z.substring(Q),X[Y]=G}return Jn1(X[0],X[1],X[2],X[3])}function Ql6(Z){let X=new Uint8Array(vD),Y=-1;if(Z.length>=2&&Z[0]===":"&&Z[1]===":"){if(Y=0,Z=Z.substring(2),Z.length===0)return X}let G=0;while(G<vD){let{n:Q,c:J,ok:$}=$l6(Z);if(!$||Q>65535)return;if(J<Z.length&&Z[J]==="."){if(Y<0&&G!=vD-Am)return;if(G+Am>vD)return;let K=Kn1(Z);if(K===void 0)return;X[G]=K[12],X[G+1]=K[13],X[G+2]=K[14],X[G+3]=K[15],Z="",G+=Am;break}if(X[G]=Q>>8,X[G+1]=Q,G+=2,Z=Z.substring(J),Z.length===0)break;if(Z[0]!==":"||Z.length==1)return;if(Z=Z.substring(1),Z[0]===":"){if(Y>=0)return;if(Y=G,Z=Z.substring(1),Z.length===0)break}}if(Z.length!==0)return;if(G<vD){if(Y<0)return;let Q=vD-G;for(let J=G-1;J>=Y;J--)X[J+Q]=X[J];for(let J=Y+Q-1;J>=Y;J--)X[J]=0}else if(Y>=0)return;return X}function Jl6(Z){let X=0,Y=0;for(X=0;X<Z.length&&h90<=Z.charCodeAt(X)&&Z.charCodeAt(X)<=Qn1;X++)if(Y=Y*10+(Z.charCodeAt(X)-h90),Y>=dl0)return{n:dl0,c:X,ok:!1};if(X===0)return{n:0,c:0,ok:!1};return{n:Y,c:X,ok:!0}}function $l6(Z){let X=0,Y=0;for(Y=0;Y<Z.length;Y++){if(h90<=Z.charCodeAt(Y)&&Z.charCodeAt(Y)<=Qn1)X*=16,X+=Z.charCodeAt(Y)-h90;else if(Gn1<=Z.charCodeAt(Y)&&Z.charCodeAt(Y)<=Yl6)X*=16,X+=Z.charCodeAt(Y)-Gn1+10;else if(Yn1<=Z.charCodeAt(Y)&&Z.charCodeAt(Y)<=Xl6)X*=16,X+=Z.charCodeAt(Y)-Yn1+10;else break;if(X>=dl0)return{n:0,c:Y,ok:!1}}if(Y===0)return{n:0,c:Y,ok:!1};return{n:X,c:Y,ok:!0}}});var rl0=x((Nn1)=>{Object.defineProperty(Nn1,"__esModule",{value:!0});Nn1.Servers=Nn1.ServerImpl=void 0;Nn1.isIPV4OrHostname=Hn1;Nn1.hostPort=ol0;var il0=xD(),nl0=H$(),pl0=ml0(),Nl6=Uw(),Ul6=yQ();function Hn1(Z){if(Z.indexOf("[")!==-1||Z.indexOf("::")!==-1)return!1;if(Z.indexOf(".")!==-1)return!0;if(Z.split(":").length<=2)return!0;return!1}function tl0(Z){return!Hn1(Z)}function Fl6(Z){let Y=Z.toUpperCase().indexOf("::FFFF:");if(Y!==-1&&Z.indexOf(".")!==-1){let G=Z.substring(Y+7);return G=G.replace("[",""),G.replace("]","")}return Z}function ol0(Z){if(Z=Z.trim(),Z.match(/^(.*:\/\/)(.*)/m))Z=Z.replace(/^(.*:\/\/)(.*)/gm,"$2");if(Z=Fl6(Z),tl0(Z)&&Z.indexOf("[")===-1)Z=`[${Z}]`;let X=tl0(Z)?Z.match(/(]:)(\d+)/):Z.match(/(:)(\d+)/),Y=X&&X.length===3&&X[1]&&X[2]?parseInt(X[2]):Nl6.DEFAULT_PORT,Q=new URL(`${Y===80?"https":"http"}://${Z}`);Q.port=`${Y}`;let J=Q.hostname;if(J.charAt(0)==="[")J=J.substring(1,J.length-1);return{listen:Q.host,hostname:J,port:Y}}class uf{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor(Z,X=!1){this.src=Z,this.tlsName="";let Y=ol0(Z);this.listen=Y.listen,this.hostname=Y.hostname,this.port=Y.port,this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=X}toString(){return this.listen}async resolve(Z){if(!Z.fn||Z.resolve===!1)return[this];let X=[];if((0,pl0.isIP)(this.hostname))return[this];else{let Y=await Z.fn(this.hostname);if(Z.debug)console.log(`resolve ${this.hostname} = ${Y.join(",")}`);for(let G of Y){let Q=this.port===80?"https":"http",J=new URL(`${Q}://${tl0(G)?"["+G+"]":G}`);J.port=`${this.port}`;let $=new uf(J.host,!1);$.tlsName=this.hostname,X.push($)}}if(Z.randomize)(0,nl0.shuffle)(X);return this.resolves=X,X}}Nn1.ServerImpl=uf;class u90{firstSelect;servers;currentServer;tlsName;randomize;constructor(Z={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=Z.randomize||!1}setServers(Z){if(!Array.isArray(Z)||Z.length===0)throw Ul6.InvalidArgumentError.format("servers","cannot be empty");let X=(0,il0.getUrlParseFn)(),Y=new Map;for(let Q of this.servers)Y.set(Q.listen,Q);let G=[];for(let Q of Z){Q=X?X(Q):Q;let{listen:J}=ol0(Q),$=Y.get(J);if($)$.gossiped=!1,G.push($);else G.push(new uf(Q))}if(this.randomize)(0,nl0.shuffle)(G);if(this.servers=G,this.currentServer===void 0||!G.includes(this.currentServer))this.currentServer=G[0],this.firstSelect=!0}clear(){this.servers.length=0}updateTLSName(){let Z=this.getCurrentServer();if(!(0,pl0.isIP)(Z.hostname))this.tlsName=Z.hostname,this.servers.forEach((X)=>{if(X.gossiped)X.tlsName=this.tlsName})}getCurrentServer(){return this.currentServer}addServer(Z,X=!1){let Y=(0,il0.getUrlParseFn)();Z=Y?Y(Z):Z;let G=new uf(Z,X);if((0,pl0.isIP)(G.hostname))G.tlsName=this.tlsName;this.servers.push(G)}selectServer(){if(this.firstSelect)return this.firstSelect=!1,this.currentServer;let Z=this.servers.shift();if(Z)this.servers.push(Z),this.currentServer=Z;return Z}removeCurrentServer(){this.removeServer(this.currentServer)}removeServer(Z){if(Z){let X=this.servers.indexOf(Z);this.servers.splice(X,1)}}snapshot(){return u90.freezeAll(this.servers)}snapshotForHandler(){let Z=this.currentServer;if(!Z)return this.snapshot();let X=this.servers.indexOf(Z);if(X<=0)return this.snapshot();return u90.freezeAll([Z,...this.servers.slice(0,X),...this.servers.slice(X+1)])}static freezeAll(Z){return Z.map((X)=>Object.freeze({hostname:X.hostname,port:X.port,listen:X.listen,src:X.src,tlsName:X.tlsName,reconnects:X.reconnects,lastConnect:X.lastConnect,gossiped:X.gossiped,didConnect:X.didConnect}))}find(Z){return this.servers.find((X)=>X.listen===Z.listen)}setCurrent(Z){this.currentServer=Z}length(){return this.servers.length}next(){return this.servers.length?this.servers[0]:void 0}getServers(){return this.servers}update(Z,X){let Y=[],G=[],Q=(0,il0.getUrlParseFn)(),J=new Map;if(Z.connect_urls&&Z.connect_urls.length>0)Z.connect_urls.forEach((K)=>{K=Q?Q(K,X):K;let W=new uf(K,!0);J.set(K,W)});let $=[];if(this.servers.forEach((K,W)=>{let H=K.listen;if(K.gossiped&&this.currentServer.listen!==H&&J.get(H)===void 0)$.push(W);J.delete(H)}),$.reverse(),$.forEach((K)=>{let W=this.servers.splice(K,1);G=G.concat(W[0].listen)}),J.forEach((K,W)=>{this.servers.push(K),Y.push(W)}),this.randomize&&Y.length>0){let K=this.currentServer,W=this.servers.filter((H)=>H!==K);(0,nl0.shuffle)(W),this.servers=K?[K,...W]:W}return{added:Y,deleted:G}}}Nn1.Servers=u90});var c90=x((Bn1)=>{Object.defineProperty(Bn1,"__esModule",{value:!0});Bn1.QueuedIteratorImpl=void 0;var al0=H$(),Fn1=yQ();class wn1{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,al0.deferred)(),this.yields=[],this.iterClosed=(0,al0.deferred)(),this.time=0,this.yielding=!1,this.didBreak=!1,this.profile=!1}[Symbol.asyncIterator](){return this.iterate()}push(Z){if(this.done)return;if(this.didBreak){if(typeof Z==="function"){let X=Z;try{X()}catch(Y){}}return}if(typeof Z==="function")this.pendingFiltered++;this.yields.push(Z),this.signal.resolve()}async*iterate(){if(this.noIterator)throw new Fn1.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new Fn1.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 Z=this.yields;this.inflight=Z.length,this.yields=[];for(let X=0;X<Z.length;X++){if(typeof Z[X]==="function"){this.pendingFiltered--;let G=Z[X];try{G()}catch(Q){throw Q}if(this.err)throw this.err;continue}this.processed++,this.inflight--;let Y=this.profile?Date.now():0;yield Z[X],this.time=this.profile?Date.now()-Y:0}if(this.done)break;else if(this.yields.length===0)Z.length=0,this.yields=Z,this.signal=(0,al0.deferred)()}}finally{this.didBreak=!0,this.stop()}}stop(Z){if(this.done)return;this.err=Z,this.done=!0,this.signal.resolve(),this.iterClosed.resolve(Z)}getProcessed(){return this.noIterator?this.received:this.processed}getPending(){return this.yields.length+this.inflight-this.pendingFiltered}getReceived(){return this.received-this.filtered}}Bn1.QueuedIteratorImpl=wn1});var sl0=x((En1)=>{Object.defineProperty(En1,"__esModule",{value:!0});En1.MuxSubscription=void 0;var Ll6=Uw(),Ln1=yQ();class Dn1{baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init(Z){return this.baseInbox=`${(0,Ll6.createInbox)(Z)}.`,this.baseInbox}add(Z){if(!isNaN(Z.received))Z.received=0;this.reqs.set(Z.token,Z)}get(Z){return this.reqs.get(Z)}cancel(Z){this.reqs.delete(Z.token)}getToken(Z){let X=Z.subject||"";if(X.indexOf(this.baseInbox)===0)return X.substring(this.baseInbox.length);return null}all(){return Array.from(this.reqs.values())}handleError(Z,X){if(Z)return this.all().forEach((Y)=>{Y.resolver(X,{})}),!0;if(X.operation==="publish"){let Y=this.all().find((G)=>{return G.requestSubject===X.subject});if(Y)return Y.resolver(X,{}),!0}return!1}dispatcher(){return(Z,X)=>{let Y=this.getToken(X);if(Y){let G=this.get(Y);if(G){if(Z===null)Z=X?.data?.length===0&&X.headers?.code===503?new Ln1.NoRespondersError(G.requestSubject):null;G.resolver(Z,X)}}}}close(){let Z=new Ln1.RequestError("connection closed");this.reqs.forEach((X)=>{X.resolver(Z,{})})}}En1.MuxSubscription=Dn1});var el0=x((An1)=>{Object.defineProperty(An1,"__esModule",{value:!0});An1.Heartbeat=void 0;var Dl6=H$();class jn1{ph;interval;maxOut;timer;pendings;constructor(Z,X,Y){this.ph=Z,this.interval=X,this.maxOut=Y,this.pendings=[]}start(){this.cancel(),this._schedule()}cancel(Z){if(this.timer)clearTimeout(this.timer),this.timer=void 0;if(this._reset(),Z)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 Z=(0,Dl6.deferred)();this.ph.flush(Z).then(()=>{this._reset()}).catch(()=>{this.cancel()}),this.pendings.push(Z),this._schedule()},this.interval)}_reset(){this.pendings=this.pendings.filter((Z)=>{return Z.resolve(),!1})}}An1.Heartbeat=jn1});var Yd0=x((qn1)=>{Object.defineProperty(qn1,"__esModule",{value:!0});qn1.DenoBuffer=qn1.MAX_SIZE=qn1.AssertionError=void 0;qn1.assert=Rn1;qn1.concat=In1;qn1.append=zl6;qn1.readAll=jl6;qn1.writeAll=Al6;var El6=bQ();class Zd0 extends Error{constructor(Z){super(Z);this.name="AssertionError"}}qn1.AssertionError=Zd0;function Rn1(Z,X="Assertion failed."){if(!Z)throw new Zd0(X)}var Tn1=32768;qn1.MAX_SIZE=4294967294;function l90(Z,X,Y=0){let G=X.byteLength-Y;if(Z.byteLength>G)Z=Z.subarray(0,G);return X.set(Z,Y),Z.byteLength}function In1(Z,X){if(Z===void 0&&X===void 0)return new Uint8Array(0);if(Z===void 0)return X;if(X===void 0)return Z;let Y=new Uint8Array(Z.length+X.length);return Y.set(Z,0),Y.set(X,Z.length),Y}function zl6(Z,X){return In1(Z,Uint8Array.of(X))}class Xd0{_buf;_off;constructor(Z){if(this._off=0,Z==null){this._buf=new Uint8Array(0);return}this._buf=new Uint8Array(Z)}bytes(Z={copy:!0}){if(Z.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(Z){if(Z===0){this.reset();return}if(Z<0||Z>this.length)throw Error("bytes.Buffer: truncation out of range");this._reslice(this._off+Z)}reset(){this._reslice(0),this._off=0}_tryGrowByReslice(Z){let X=this._buf.byteLength;if(Z<=this.capacity-X)return this._reslice(X+Z),X;return-1}_reslice(Z){Rn1(Z<=this._buf.buffer.byteLength),this._buf=new Uint8Array(this._buf.buffer,0,Z)}readByte(){let Z=new Uint8Array(1);if(this.read(Z))return Z[0];return null}read(Z){if(this.empty()){if(this.reset(),Z.byteLength===0)return 0;return null}let X=l90(this._buf.subarray(this._off),Z);return this._off+=X,X}writeByte(Z){return this.write(Uint8Array.of(Z))}writeString(Z){return this.write(El6.TE.encode(Z))}write(Z){let X=this._grow(Z.byteLength);return l90(Z,this._buf,X)}_grow(Z){let X=this.length;if(X===0&&this._off!==0)this.reset();let Y=this._tryGrowByReslice(Z);if(Y>=0)return Y;let G=this.capacity;if(Z<=Math.floor(G/2)-X)l90(this._buf.subarray(this._off),this._buf);else if(G+Z>qn1.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Q=new Uint8Array(Math.min(2*G+Z,qn1.MAX_SIZE));l90(this._buf.subarray(this._off),Q),this._buf=Q}return this._off=0,this._reslice(Math.min(X+Z,qn1.MAX_SIZE)),X}grow(Z){if(Z<0)throw Error("Buffer._grow: negative count");let X=this._grow(Z);this._reslice(X)}readFrom(Z){let X=0,Y=new Uint8Array(Tn1);while(!0){let G=this.capacity-this.length<Tn1,Q=G?Y:new Uint8Array(this._buf.buffer,this.length),J=Z.read(Q);if(J===null)return X;if(G)this.write(Q.subarray(0,J));else this._reslice(this.length+J);X+=J}}}qn1.DenoBuffer=Xd0;function jl6(Z){let X=new Xd0;return X.readFrom(Z),X.bytes()}function Al6(Z,X){let Y=0;while(Y<X.length)Y+=Z.write(X.subarray(Y))}});var Jd0=x((Cn1)=>{Object.defineProperty(Cn1,"__esModule",{value:!0});Cn1.cc=Cn1.State=Cn1.Parser=Cn1.Kind=void 0;Cn1.describe=kl6;var Gd0=Yd0(),Qd0=bQ();Cn1.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function kl6(Z){let X,Y="";switch(Z.kind){case Cn1.Kind.MSG:X="MSG";break;case Cn1.Kind.OK:X="OK";break;case Cn1.Kind.ERR:X="ERR",Y=Qd0.TD.decode(Z.data);break;case Cn1.Kind.PING:X="PING";break;case Cn1.Kind.PONG:X="PONG";break;case Cn1.Kind.INFO:X="INFO",Y=Qd0.TD.decode(Z.data)}return`${X}: ${Y}`}function kn1(){let Z={};return Z.sid=-1,Z.hdr=-1,Z.size=-1,Z}var Vn1=48,Vl6=57,cf=67108864;class Sn1{dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor(Z){this.dispatcher=Z,this.state=Cn1.State.OP_START,this.as=0,this.drop=0,this.hdr=0}parse(Z){let X;for(X=0;X<Z.length;X++){let Y=Z[X];switch(this.state){case Cn1.State.OP_START:switch(Y){case Cn1.cc.M:case Cn1.cc.m:this.state=Cn1.State.OP_M,this.hdr=-1,this.ma=kn1();break;case Cn1.cc.H:case Cn1.cc.h:this.state=Cn1.State.OP_H,this.hdr=0,this.ma=kn1();break;case Cn1.cc.P:case Cn1.cc.p:this.state=Cn1.State.OP_P;break;case Cn1.cc.PLUS:this.state=Cn1.State.OP_PLUS;break;case Cn1.cc.MINUS:this.state=Cn1.State.OP_MINUS;break;case Cn1.cc.I:case Cn1.cc.i:this.state=Cn1.State.OP_I;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_H:switch(Y){case Cn1.cc.M:case Cn1.cc.m:this.state=Cn1.State.OP_M;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_M:switch(Y){case Cn1.cc.S:case Cn1.cc.s:this.state=Cn1.State.OP_MS;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_MS:switch(Y){case Cn1.cc.G:case Cn1.cc.g:this.state=Cn1.State.OP_MSG;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_MSG:switch(Y){case Cn1.cc.SPACE:case Cn1.cc.TAB:this.state=Cn1.State.OP_MSG_SPC;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_MSG_SPC:switch(Y){case Cn1.cc.SPACE:case Cn1.cc.TAB:continue;default:this.state=Cn1.State.MSG_ARG,this.as=X}break;case Cn1.State.MSG_ARG:switch(Y){case Cn1.cc.CR:this.drop=1;break;case Cn1.cc.NL:{let G=this.argBuf?this.argBuf.bytes():Z.subarray(this.as,X-this.drop);this.processMsgArgs(G),this.drop=0,this.as=X+1,this.state=Cn1.State.MSG_PAYLOAD,X=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(Y)}break;case Cn1.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let G=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:Cn1.Kind.MSG,msg:this.ma,data:G}),this.argBuf=void 0,this.msgBuf=void 0,this.state=Cn1.State.MSG_END}else{let G=this.ma.size-this.msgBuf.length,Q=Z.length-X;if(Q<G)G=Q;if(G>0)this.msgBuf.write(Z.subarray(X,X+G)),X=X+G-1;else this.msgBuf.writeByte(Y)}else if(X-this.as>=this.ma.size)this.dispatcher.push({kind:Cn1.Kind.MSG,msg:this.ma,data:Z.subarray(this.as,X)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=Cn1.State.MSG_END;break;case Cn1.State.MSG_END:switch(Y){case Cn1.cc.NL:this.drop=0,this.as=X+1,this.state=Cn1.State.OP_START;break;default:continue}break;case Cn1.State.OP_PLUS:switch(Y){case Cn1.cc.O:case Cn1.cc.o:this.state=Cn1.State.OP_PLUS_O;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_PLUS_O:switch(Y){case Cn1.cc.K:case Cn1.cc.k:this.state=Cn1.State.OP_PLUS_OK;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_PLUS_OK:switch(Y){case Cn1.cc.NL:this.dispatcher.push({kind:Cn1.Kind.OK}),this.drop=0,this.state=Cn1.State.OP_START;break}break;case Cn1.State.OP_MINUS:switch(Y){case Cn1.cc.E:case Cn1.cc.e:this.state=Cn1.State.OP_MINUS_E;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_MINUS_E:switch(Y){case Cn1.cc.R:case Cn1.cc.r:this.state=Cn1.State.OP_MINUS_ER;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_MINUS_ER:switch(Y){case Cn1.cc.R:case Cn1.cc.r:this.state=Cn1.State.OP_MINUS_ERR;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_MINUS_ERR:switch(Y){case Cn1.cc.SPACE:case Cn1.cc.TAB:this.state=Cn1.State.OP_MINUS_ERR_SPC;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_MINUS_ERR_SPC:switch(Y){case Cn1.cc.SPACE:case Cn1.cc.TAB:continue;default:this.state=Cn1.State.MINUS_ERR_ARG,this.as=X}break;case Cn1.State.MINUS_ERR_ARG:switch(Y){case Cn1.cc.CR:this.drop=1;break;case Cn1.cc.NL:{let G;if(this.argBuf)G=this.argBuf.bytes(),this.argBuf=void 0;else G=Z.subarray(this.as,X-this.drop);this.dispatcher.push({kind:Cn1.Kind.ERR,data:G}),this.drop=0,this.as=X+1,this.state=Cn1.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(Y))}break;case Cn1.State.OP_P:switch(Y){case Cn1.cc.I:case Cn1.cc.i:this.state=Cn1.State.OP_PI;break;case Cn1.cc.O:case Cn1.cc.o:this.state=Cn1.State.OP_PO;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_PO:switch(Y){case Cn1.cc.N:case Cn1.cc.n:this.state=Cn1.State.OP_PON;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_PON:switch(Y){case Cn1.cc.G:case Cn1.cc.g:this.state=Cn1.State.OP_PONG;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_PONG:switch(Y){case Cn1.cc.NL:this.dispatcher.push({kind:Cn1.Kind.PONG}),this.drop=0,this.state=Cn1.State.OP_START;break}break;case Cn1.State.OP_PI:switch(Y){case Cn1.cc.N:case Cn1.cc.n:this.state=Cn1.State.OP_PIN;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_PIN:switch(Y){case Cn1.cc.G:case Cn1.cc.g:this.state=Cn1.State.OP_PING;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_PING:switch(Y){case Cn1.cc.NL:this.dispatcher.push({kind:Cn1.Kind.PING}),this.drop=0,this.state=Cn1.State.OP_START;break}break;case Cn1.State.OP_I:switch(Y){case Cn1.cc.N:case Cn1.cc.n:this.state=Cn1.State.OP_IN;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_IN:switch(Y){case Cn1.cc.F:case Cn1.cc.f:this.state=Cn1.State.OP_INF;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_INF:switch(Y){case Cn1.cc.O:case Cn1.cc.o:this.state=Cn1.State.OP_INFO;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_INFO:switch(Y){case Cn1.cc.SPACE:case Cn1.cc.TAB:this.state=Cn1.State.OP_INFO_SPC;break;default:throw this.fail(Z.subarray(X))}break;case Cn1.State.OP_INFO_SPC:switch(Y){case Cn1.cc.SPACE:case Cn1.cc.TAB:continue;default:this.state=Cn1.State.INFO_ARG,this.as=X}break;case Cn1.State.INFO_ARG:switch(Y){case Cn1.cc.CR:this.drop=1;break;case Cn1.cc.NL:{let G;if(this.argBuf)G=this.argBuf.bytes(),this.argBuf=void 0;else G=Z.subarray(this.as,X-this.drop);this.dispatcher.push({kind:Cn1.Kind.INFO,data:G}),this.drop=0,this.as=X+1,this.state=Cn1.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(Y)}break;default:throw this.fail(Z.subarray(X))}}if((this.state===Cn1.State.MSG_ARG||this.state===Cn1.State.MINUS_ERR_ARG||this.state===Cn1.State.INFO_ARG)&&!this.argBuf)this.argBuf=new Gd0.DenoBuffer(Z.subarray(this.as,X-this.drop));if(this.state===Cn1.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new Gd0.DenoBuffer(Z.subarray(this.as))}}cloneMsgArg(){let Z=this.ma.subject.length,X=this.ma.reply?this.ma.reply.length:0,Y=new Uint8Array(Z+X);if(Y.set(this.ma.subject),this.ma.reply)Y.set(this.ma.reply,Z);if(this.argBuf=new Gd0.DenoBuffer(Y),this.ma.subject=Y.subarray(0,Z),this.ma.reply)this.ma.reply=Y.subarray(Z)}processMsgArgs(Z){if(this.hdr>=0)return this.processHeaderMsgArgs(Z);let X=[],Y=-1;for(let G=0;G<Z.length;G++)switch(Z[G]){case Cn1.cc.SPACE:case Cn1.cc.TAB:case Cn1.cc.CR:case Cn1.cc.NL:if(Y>=0)X.push(Z.subarray(Y,G)),Y=-1;break;default:if(Y<0)Y=G}if(Y>=0)X.push(Z.subarray(Y));switch(X.length){case 3:this.ma.subject=X[0],this.ma.sid=this.protoParseInt(X[1]),this.ma.reply=void 0,this.ma.size=this.protoParseInt(X[2],cf);break;case 4:this.ma.subject=X[0],this.ma.sid=this.protoParseInt(X[1]),this.ma.reply=X[2],this.ma.size=this.protoParseInt(X[3],cf);break;default:throw this.fail(Z,"processMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(Z,"processMsgArgs Bad or Missing Sid Error");if(this.ma.size<0)throw this.fail(Z,"processMsgArgs Bad or Missing Size Error")}fail(Z,X=""){if(!X)X=`parse error [${this.state}]`;else X=`${X} [${this.state}]`;return Error(`${X}: ${Qd0.TD.decode(Z)}`)}processHeaderMsgArgs(Z){let X=[],Y=-1;for(let G=0;G<Z.length;G++)switch(Z[G]){case Cn1.cc.SPACE:case Cn1.cc.TAB:case Cn1.cc.CR:case Cn1.cc.NL:if(Y>=0)X.push(Z.subarray(Y,G)),Y=-1;break;default:if(Y<0)Y=G}if(Y>=0)X.push(Z.subarray(Y));switch(X.length){case 4:this.ma.subject=X[0],this.ma.sid=this.protoParseInt(X[1]),this.ma.reply=void 0,this.ma.hdr=this.protoParseInt(X[2],cf),this.ma.size=this.protoParseInt(X[3],cf);break;case 5:this.ma.subject=X[0],this.ma.sid=this.protoParseInt(X[1]),this.ma.reply=X[2],this.ma.hdr=this.protoParseInt(X[3],cf),this.ma.size=this.protoParseInt(X[4],cf);break;default:throw this.fail(Z,"processHeaderMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(Z,"processHeaderMsgArgs Bad or Missing Sid Error");if(this.ma.hdr<0||this.ma.hdr>this.ma.size)throw this.fail(Z,"processHeaderMsgArgs Bad or Missing Header Size Error");if(this.ma.size<0)throw this.fail(Z,"processHeaderMsgArgs Bad or Missing Size Error")}protoParseInt(Z,X){if(Z.length===0||Z.length>15)return-1;let Y=0;for(let G=0;G<Z.length;G++){if(Z[G]<Vn1||Z[G]>Vl6)return-1;Y=Y*10+(Z[G]-Vn1)}return X!==void 0&&Y>X?-1:Y}}Cn1.Parser=Sn1;Cn1.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};Cn1.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 i90=x((vn1)=>{Object.defineProperty(vn1,"__esModule",{value:!0});vn1.MsgHdrsImpl=void 0;vn1.canonicalMIMEHeaderKey=Kd0;vn1.headers=xl6;var xn1=bQ(),N$=Uw(),m90=yQ();function Kd0(Z){let N=!0,U=Array(Z.length);for(let F=0;F<Z.length;F++){let w=Z.charCodeAt(F);if(w===58||w<33||w>126)throw m90.InvalidArgumentError.format("header",`'${Z[F]}' is not a valid character in a header name`);if(N&&97<=w&&w<=122)w-=32;else if(!N&&65<=w&&w<=90)w+=32;U[F]=w,N=w==45}return String.fromCharCode(...U)}function xl6(Z=0,X=""){if(Z===0&&X!=="")throw m90.InvalidArgumentError.format("code","is required");else if(Z>0&&X==="")throw m90.InvalidArgumentError.format("description","is required");return new lf(Z,X)}var $d0="NATS/1.0";class lf{_code;headers;_description;constructor(Z=0,X=""){this._code=Z,this._description=X,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals(Z){if(Z&&this.headers.size===Z.headers.size&&this._code===Z._code){for(let[X,Y]of this.headers){let G=Z.values(X);if(Y.length!==G.length)return!1;let Q=[...Y].sort(),J=[...G].sort();for(let $=0;$<Q.length;$++)if(Q[$]!==J[$])return!1}return!0}return!1}static decode(Z){let X=new lf,G=xn1.TD.decode(Z).split(`\r
1257
1257
  `),Q=G[0];if(Q!==$d0){let J=Q.replace($d0,"").trim();if(J.length>0){if(X._code=parseInt(J,10),isNaN(X._code))X._code=0;let $=X._code.toString();J=J.replace($,""),X._description=J.trim()}}if(G.length>=1)G.slice(1).map((J)=>{if(J){let $=J.indexOf(":");if($>-1){let K=J.slice(0,$),W=J.slice($+1).trim();X.append(K,W)}}});return X}toString(){if(this.headers.size===0&&this._code===0)return"";let Z=$d0;if(this._code>0&&this._description!=="")Z+=` ${this._code} ${this._description}`;for(let[X,Y]of this.headers)for(let G=0;G<Y.length;G++)Z=`${Z}\r
1258
1258
  ${X}: ${Y[G]}`;return`${Z}\r