cf 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/dist/_meta/agent-context.json +55 -55
  2. package/dist/_meta/commands.json +24282 -24542
  3. package/dist/_meta/hand-written-commands.json +53 -12
  4. package/dist/_meta/schemas.json +27680 -28212
  5. package/dist/abuse-reports-BbaHw4ST.mjs +8 -0
  6. package/dist/access-D6Xz892p.mjs +11 -0
  7. package/dist/account-DvxcqeaK.mjs +2 -0
  8. package/dist/account-tags-CeqfEWpz.mjs +9 -0
  9. package/dist/accounts-Bx-8BMH9.mjs +30 -0
  10. package/dist/acm--0opdSGE.mjs +3 -0
  11. package/dist/addressing-BS1ynzLA.mjs +13 -0
  12. package/dist/agent-context-BPhyrSns.mjs +8 -0
  13. package/dist/agent-memory-DczzpEw5.mjs +6 -0
  14. package/dist/ai-CDdCTcQl.mjs +5 -0
  15. package/dist/ai-audit-Bx9KMQYh.mjs +2 -0
  16. package/dist/ai-gateway-BSXJEaYS.mjs +13 -0
  17. package/dist/ai-search-DRQj1aMu.mjs +7 -0
  18. package/dist/ai-security-C_Rb0lGT.mjs +4 -0
  19. package/dist/alerting-BAR9eFs2.mjs +6 -0
  20. package/dist/analytics-BaUZwNc5.mjs +4 -0
  21. package/dist/analytics_engine-DkEzlhfT.mjs +2 -0
  22. package/dist/api-security-jA0lOk6a.mjs +50 -0
  23. package/dist/argo-Cz4pDagx.mjs +2 -0
  24. package/dist/artifacts-BcLTGfAv.mjs +5 -0
  25. package/dist/audit-logs-DbIv4n6u.mjs +2 -0
  26. package/dist/auth-rW5d3jtr.mjs +5 -0
  27. package/dist/auth-tvDdC1J-.mjs +8 -0
  28. package/dist/billing-Md87QjqW.mjs +3 -0
  29. package/dist/bot-management-VHMo4hpU.mjs +5 -0
  30. package/dist/botnet-feed-BHqfo3sa.mjs +3 -0
  31. package/dist/brand-protection-HUeR6Pof.mjs +3 -0
  32. package/dist/browser-extension-199oZg3X.mjs +3 -0
  33. package/dist/browser-run-DDasyux-.mjs +4 -0
  34. package/dist/build-0QlYUfFS.mjs +2 -0
  35. package/dist/builds-B-lXn6JR.mjs +9 -0
  36. package/dist/cache-CevKpiTM.mjs +9 -0
  37. package/dist/certificate-authorities-DAg-aO1B.mjs +2 -0
  38. package/dist/{cf-yPz_IqW6.mjs → cf-C11NGkjx.mjs} +1 -1
  39. package/dist/{chunk-LQW53VED-9MACsvSG.mjs → chunk-LQW53VED-CoECHA3R.mjs} +1 -1
  40. package/dist/{chunk-QBZBEHZB-yeyhVUeD.mjs → chunk-QBZBEHZB-BuiXJn8j.mjs} +1 -1
  41. package/dist/client-certificates-Bay7oPLE.mjs +3 -0
  42. package/dist/client-side-security-CbU9xn0k.mjs +37 -0
  43. package/dist/cloud-connector-AH2ClcSL.mjs +2 -0
  44. package/dist/cloudforce-one-DwOfS75V.mjs +32 -0
  45. package/dist/{command-BV87D4tR.mjs → command-CMzMsll4.mjs} +1 -1
  46. package/dist/{completions-BnD46cXe.mjs → completions-nPO9PdSu.mjs} +1 -1
  47. package/dist/config-B8lwPpVl.mjs +2 -0
  48. package/dist/config.mjs +1 -1
  49. package/dist/connector-interrupts-DcLrqM2V.mjs +2 -0
  50. package/dist/connector-telemetry-events-PrJWgNs9.mjs +2 -0
  51. package/dist/connector-telemetry-snapshots-CIjJm5yu.mjs +2 -0
  52. package/dist/connectors-CEAy30E-.mjs +3 -0
  53. package/dist/containers-BsbDqbSn.mjs +58 -0
  54. package/dist/content-scan-BdK936iO.mjs +4 -0
  55. package/dist/cps-oP97-qkm.mjs +2 -0
  56. package/dist/csamScanner-DUNN4INg.mjs +6 -0
  57. package/dist/ct-alerting-dV_gsV2w.mjs +3 -0
  58. package/dist/custom-certificates-DYspvjo4.mjs +5 -0
  59. package/dist/custom-csrs-DjSWLQRu.mjs +3 -0
  60. package/dist/custom-hostnames-df1lH6IY.mjs +5 -0
  61. package/dist/custom-nameservers-CLTbN-9R.mjs +3 -0
  62. package/dist/custom-pages-DzKnSgL3.mjs +3 -0
  63. package/dist/d1-JBEqjJoj.mjs +20 -0
  64. package/dist/data-security-CIktWnXt.mjs +7 -0
  65. package/dist/dcv-delegation-_r6Vc6VL.mjs +2 -0
  66. package/dist/{deploy-BUSz35vq.mjs → deploy-QTGENpOM.mjs} +1 -1
  67. package/dist/{deploy-input-BvD9aRP1.mjs → deploy-input-C7W1Bsji.mjs} +1 -1
  68. package/dist/{dev-DY_DquQx.mjs → dev-CAubuxCc.mjs} +1 -1
  69. package/dist/diagnostics-B0DRh714.mjs +3 -0
  70. package/dist/{dist-DV7LR38l.mjs → dist-12KzRsBM.mjs} +36 -36
  71. package/dist/{dist-BBx1io2f.mjs → dist-BCVqQpg2.mjs} +1 -1
  72. package/dist/dist-Cp3uJN1x.mjs +48 -0
  73. package/dist/dist-DW5BPGFs.mjs +57 -0
  74. package/dist/{dist-Cb9TJ2VV.mjs → dist-S9K_8gq9.mjs} +1 -1
  75. package/dist/dls-CFzTHcZM.mjs +3 -0
  76. package/dist/dns-Dw6u-NV1.mjs +29 -0
  77. package/dist/dns-firewall-CIPptslp.mjs +57 -0
  78. package/dist/{dot-prop-6SRZBKHT-wwGHcwAa.mjs → dot-prop-6SRZBKHT-wIVDg_fl.mjs} +1 -1
  79. package/dist/dry-run-DiVy1lVo.mjs +2 -0
  80. package/dist/durable-objects-CCkeqqBq.mjs +2 -0
  81. package/dist/email-auth-kdxO51Oz.mjs +2 -0
  82. package/dist/email-routing-BLggZdQq.mjs +6 -0
  83. package/dist/email-security-DjADlgdM.mjs +18 -0
  84. package/dist/email-sending-Cz7E7GoP.mjs +7 -0
  85. package/dist/error-sanitization-DfLijlBJ.mjs +2 -0
  86. package/dist/fieldExtractors-BWaMi6lD.mjs +3 -0
  87. package/dist/firewall-5t6OBIOl.mjs +8 -0
  88. package/dist/flagship-CzG_VoNR.mjs +4 -0
  89. package/dist/fraud-UOg_69Ob.mjs +20 -0
  90. package/dist/google-tag-gateway-DirkD-Q2.mjs +2 -0
  91. package/dist/healthchecks-BkHZGTp1.mjs +4 -0
  92. package/dist/hostnames-EUYOZm21.mjs +3 -0
  93. package/dist/hyperdrive-ZoLJlJCL.mjs +21 -0
  94. package/dist/iam-BQ2xSgYN.mjs +6 -0
  95. package/dist/images-CkEq6ScP.mjs +8 -0
  96. package/dist/index.mjs +1 -1
  97. package/dist/intel-DDWEdGyl.mjs +8 -0
  98. package/dist/interactive-B2E03Fs-.mjs +11 -0
  99. package/dist/interactive-_B-EqD0Y.mjs +23 -0
  100. package/dist/ips-54Qmy-Uw.mjs +2 -0
  101. package/dist/keyless-certificates-CXHLc3Qz.mjs +3 -0
  102. package/dist/keys-rvI4TC3Z.mjs +2 -0
  103. package/dist/kv-CAeN1zBy.mjs +5 -0
  104. package/dist/leaked-credential-checks-CbbwtG-p.mjs +4 -0
  105. package/dist/lifecycle-XswDq0ZB.mjs +2 -0
  106. package/dist/load-balancers-BFwdwAIU.mjs +6 -0
  107. package/dist/{local-DGiIS1uM.mjs → local-C6XsFD_W.mjs} +1 -1
  108. package/dist/{local-runtime--IQr44qq.mjs → local-runtime-BUGCbx8r.mjs} +1 -1
  109. package/dist/logexplorer-D8rOPB5I.mjs +17 -0
  110. package/dist/logo-matches-Y3PxVn7t.mjs +2 -0
  111. package/dist/logos-BN8SvJhS.mjs +3 -0
  112. package/dist/logpush-BnLA4WVm.mjs +4 -0
  113. package/dist/logs-CDo7Y5sA.mjs +3 -0
  114. package/dist/magic-cloud-networking-wPuLwu-F.mjs +5 -0
  115. package/dist/magic-network-monitoring-BNERUpxS.mjs +4 -0
  116. package/dist/magic-transit-6tvVOECW.mjs +111 -0
  117. package/dist/managed-defense-AYwBOYIH.mjs +2 -0
  118. package/dist/managed-transforms-HZZNrkC7.mjs +3 -0
  119. package/dist/matches-Dp91L3dL.mjs +2 -0
  120. package/dist/mcp-P7pcieiT.mjs +4 -0
  121. package/dist/mesh-DjFrk6PL.mjs +4 -0
  122. package/dist/mtls-certificates-DZMoef2H.mjs +3 -0
  123. package/dist/network-7cd1U6-I.mjs +6 -0
  124. package/dist/network-interconnects-CQ7cPZjK.mjs +41 -0
  125. package/dist/oauth-DH3kMXSs.mjs +14 -0
  126. package/dist/oauth-clients-P9t-eMnx.mjs +4 -0
  127. package/dist/oauth-scopes-C3r9Qh_y.mjs +2 -0
  128. package/dist/observability-M1DnLhMR.mjs +10 -0
  129. package/dist/{open-PBXRGS4R-DIiYQyU9.mjs → open-PBXRGS4R-DARSUDEI.mjs} +1 -1
  130. package/dist/organization-cUE7GDCt.mjs +45 -0
  131. package/dist/organizations-C-Hcpd0w.mjs +2 -0
  132. package/dist/origin-ca-certificates-C8cJMyQH.mjs +3 -0
  133. package/dist/origin-post-quantum-encryption-DjZJCk8M.mjs +2 -0
  134. package/dist/origin-tls-client-auth-BsjR5EAV.mjs +4 -0
  135. package/dist/{output-BqDR9h74.mjs → output-COcSQsfn.mjs} +1 -1
  136. package/dist/page-rules-B-zq1EUb.mjs +27 -0
  137. package/dist/pages-B6YpkPos.mjs +14 -0
  138. package/dist/pay-per-crawl-B4wx0lUb.mjs +4 -0
  139. package/dist/pipelines-BJc_RylD.mjs +6 -0
  140. package/dist/precursor-CLQu7suY.mjs +4 -0
  141. package/dist/progress-V6SZV3Ux.mjs +2 -0
  142. package/dist/prompt-DjRTpML4.mjs +3 -0
  143. package/dist/queries-DSrrket-.mjs +3 -0
  144. package/dist/queues-Tf7kPBpn.mjs +7 -0
  145. package/dist/r2-DmKNnxtC.mjs +25 -0
  146. package/dist/r2-data-catalog-DBxoifOq.mjs +16 -0
  147. package/dist/radar-Csk7Ab-b.mjs +2 -0
  148. package/dist/rate-limits-cdChIg_S.mjs +2 -0
  149. package/dist/raw-fetch-BVYQR6C5.mjs +2 -0
  150. package/dist/realtime-CDehZVhV.mjs +20 -0
  151. package/dist/registrar-sandbox-BxVdfnam.mjs +56 -0
  152. package/dist/registrar-vflzeNQ9.mjs +43 -0
  153. package/dist/{registry-5-I2XLwF.mjs → registry-CWUfXloz.mjs} +1 -1
  154. package/dist/reporting-BaPZ1PHN.mjs +2 -0
  155. package/dist/request-headers-CC4eHmI2.mjs +3 -0
  156. package/dist/request-tracers-C_UVBexV.mjs +2 -0
  157. package/dist/resource-sharing-CoB4S9j1.mjs +6 -0
  158. package/dist/resource-tagging-CUiUC5g4.mjs +2 -0
  159. package/dist/rules-4O8076_s.mjs +4 -0
  160. package/dist/rulesets-C84MxTYo.mjs +5 -0
  161. package/dist/rum-Bvwkrntx.mjs +4 -0
  162. package/dist/run-CRfinkSe.mjs +2 -0
  163. package/dist/schema-C8hU6G9R.mjs +2 -0
  164. package/dist/{schema-flags-CTfQVGCs.mjs → schema-flags-DC4c6dka.mjs} +1 -1
  165. package/dist/scim-BvxQmde6.mjs +4 -0
  166. package/dist/{sdk-ZctLa5jW.mjs → sdk-C12y5qCN.mjs} +2 -2
  167. package/dist/secrets-store-DOKWiC-j.mjs +7 -0
  168. package/dist/security-center-Bhy_aC-w.mjs +2 -0
  169. package/dist/security-txt-L7HJ9tq5.mjs +3 -0
  170. package/dist/{shared-DlKGNPiT.mjs → shared-YJtB5KZB.mjs} +17 -17
  171. package/dist/smart-shield-COMXuQ1S.mjs +4 -0
  172. package/dist/snippets-DffQhlKt.mjs +4 -0
  173. package/dist/{spawn-C3_tJ3RB.mjs → spawn-C1AISA2V.mjs} +3 -3
  174. package/dist/spectrum-Cmf7SqQE.mjs +63 -0
  175. package/dist/speed-m8cdhLFS.mjs +4 -0
  176. package/dist/src-C8phrg-8.mjs +109 -0
  177. package/dist/ssl-D4ffsdSw.mjs +15 -0
  178. package/dist/{startup-profile-Dpxg-MjV.mjs → startup-profile-Dx95Y5cl.mjs} +1 -1
  179. package/dist/state-CHif8Y5I.mjs +2 -0
  180. package/dist/stream-DPF5fojV.mjs +16 -0
  181. package/dist/submit-Br8hfP0_.mjs +2 -0
  182. package/dist/tags-Bnt4JuxQ.mjs +2 -0
  183. package/dist/telemetry-Ch1vCICm.mjs +2 -0
  184. package/dist/telemetry-DjGNSlkU.mjs +5 -0
  185. package/dist/tenant-D8u0CxoC.mjs +2 -0
  186. package/dist/tenant-custom-nameservers-BrWMyslZ.mjs +3 -0
  187. package/dist/{tools-j8UGEtP1.mjs → tools-D9RZkZRc.mjs} +1 -1
  188. package/dist/tunnels-BkNPpTHa.mjs +5 -0
  189. package/dist/turnstile-MgwRECJv.mjs +23 -0
  190. package/dist/ui-DQSZeaG5.mjs +5 -0
  191. package/dist/url-info-Ddp7MgcI.mjs +2 -0
  192. package/dist/url-normalization-3ptK9ntV.mjs +3 -0
  193. package/dist/url-scanner-Psb9ollR.mjs +2 -0
  194. package/dist/user-DWdshcIu.mjs +12 -0
  195. package/dist/values-CDKQL1z2.mjs +2 -0
  196. package/dist/vectorize-CTYYUyQj.mjs +4 -0
  197. package/dist/waiting-rooms-BUdmwXDY.mjs +11 -0
  198. package/dist/web-assets-CpDwDEx8.mjs +8 -0
  199. package/dist/web3-YsjDyAzH.mjs +4 -0
  200. package/dist/workers-BKKxaZcz.mjs +6 -0
  201. package/dist/workers-builds-BWo5vUA9.mjs +2 -0
  202. package/dist/workers-for-platforms-ASJsxYdM.mjs +5 -0
  203. package/dist/workers-vpc-RkTnRvA2.mjs +3 -0
  204. package/dist/workflows-KrIFI9ns.mjs +5 -0
  205. package/dist/zaraz-DglXbVzZ.mjs +2 -0
  206. package/dist/zero-trust-RilTdSjX.mjs +91 -0
  207. package/dist/zone-DsBtVkvT.mjs +2 -0
  208. package/dist/zones-BFxvWFQW.mjs +44 -0
  209. package/package.json +1 -1
  210. package/dist/abuse-reports-D40QFl-y.mjs +0 -8
  211. package/dist/access-Dl2IU1ID.mjs +0 -11
  212. package/dist/account-CPbieCZ4.mjs +0 -2
  213. package/dist/account-tags-skfP7H8k.mjs +0 -9
  214. package/dist/accounts-CSgR6909.mjs +0 -28
  215. package/dist/acm-CVvCTaNk.mjs +0 -3
  216. package/dist/addressing-Uq5hEDDP.mjs +0 -13
  217. package/dist/agent-context-BvuDdaJb.mjs +0 -8
  218. package/dist/agent-memory-BrHMIU0E.mjs +0 -6
  219. package/dist/ai-audit-BoZuL84i.mjs +0 -2
  220. package/dist/ai-gateway-DE50Jem1.mjs +0 -13
  221. package/dist/ai-search-Fx7NHCHB.mjs +0 -7
  222. package/dist/ai-security-DyLbY9kv.mjs +0 -4
  223. package/dist/ai-v2fP1r0s.mjs +0 -5
  224. package/dist/alerting-5mFZjTcD.mjs +0 -6
  225. package/dist/analytics-BygTfozw.mjs +0 -3
  226. package/dist/analytics_engine-4L-q362P.mjs +0 -2
  227. package/dist/api-security-DjFsRYWx.mjs +0 -50
  228. package/dist/argo-TzXPN7tz.mjs +0 -2
  229. package/dist/args-CDgWUP4J.mjs +0 -2
  230. package/dist/artifacts-dEw2UUBV.mjs +0 -4
  231. package/dist/audit-logs-CqY7zzwv.mjs +0 -2
  232. package/dist/auth-CPLdkOC7.mjs +0 -5
  233. package/dist/auth-DY_Y2bXC.mjs +0 -9
  234. package/dist/billing-DHQuRT8S.mjs +0 -3
  235. package/dist/bot-management-CfqG79hF.mjs +0 -5
  236. package/dist/botnet-feed-BOeNnDoH.mjs +0 -3
  237. package/dist/brand-protection-DYttrKIM.mjs +0 -3
  238. package/dist/browser-extension-CTUCdgfn.mjs +0 -3
  239. package/dist/browser-run-373D4e1i.mjs +0 -4
  240. package/dist/build-D0ir_S70.mjs +0 -2
  241. package/dist/cache-DJXBmc3w.mjs +0 -7
  242. package/dist/calls-COO0Eoz1.mjs +0 -4
  243. package/dist/certificate-authorities-DbHLmKbd.mjs +0 -2
  244. package/dist/client-certificates-RBRqYP3f.mjs +0 -3
  245. package/dist/client-side-security-HOmA37et.mjs +0 -37
  246. package/dist/cloud-connector-C7hw1c1f.mjs +0 -2
  247. package/dist/cloudforce-one-DLOj76q4.mjs +0 -36
  248. package/dist/connector-interrupts-DY-z_LrH.mjs +0 -2
  249. package/dist/connector-telemetry-events-DCXmcAc9.mjs +0 -2
  250. package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +0 -2
  251. package/dist/connectors-fEOn-J_i.mjs +0 -3
  252. package/dist/containers-BDBsEs7-.mjs +0 -58
  253. package/dist/content-scan-Cmj9--XY.mjs +0 -4
  254. package/dist/csamScanner-BRXyMCyH.mjs +0 -6
  255. package/dist/ct-alerting-9AvYys-f.mjs +0 -3
  256. package/dist/custom-certificates-C5qrlyhb.mjs +0 -5
  257. package/dist/custom-csrs-BgOnTbBW.mjs +0 -3
  258. package/dist/custom-hostnames-CbQD9aYo.mjs +0 -5
  259. package/dist/custom-nameservers-2ZajBkRC.mjs +0 -3
  260. package/dist/custom-pages-Buki_Cb8.mjs +0 -3
  261. package/dist/d1-n2in0cSF.mjs +0 -20
  262. package/dist/data-security-DzOQMkv3.mjs +0 -7
  263. package/dist/dcv-delegation-BTP9LCOm.mjs +0 -2
  264. package/dist/diagnostics-BvHV8kQb.mjs +0 -3
  265. package/dist/directory-BeiSyg8A.mjs +0 -3
  266. package/dist/dispatch-namespaces-Dp8Jjpwy.mjs +0 -7
  267. package/dist/dist-DvizctjW.mjs +0 -48
  268. package/dist/dls-BwoU29mS.mjs +0 -3
  269. package/dist/dns-DISAfuzj.mjs +0 -29
  270. package/dist/dns-firewall-wBcCx_ua.mjs +0 -57
  271. package/dist/dry-run-ILZRVpnp.mjs +0 -2
  272. package/dist/durable-objects-DhDL3San.mjs +0 -2
  273. package/dist/email-auth-BROqK6-C.mjs +0 -2
  274. package/dist/email-routing-BZXHDAOO.mjs +0 -6
  275. package/dist/email-security-DVumybrk.mjs +0 -18
  276. package/dist/email-sending-CDQ3_wyz.mjs +0 -7
  277. package/dist/fieldExtractors-Cy1rxHEF.mjs +0 -3
  278. package/dist/firewall-C0g5X7Zd.mjs +0 -11
  279. package/dist/flagship-fFBiZUz-.mjs +0 -4
  280. package/dist/fraud-CjIETOaM.mjs +0 -20
  281. package/dist/google-tag-gateway-hPa5IHUx.mjs +0 -2
  282. package/dist/healthchecks-CoycpTf9.mjs +0 -4
  283. package/dist/hostnames-x_Yezxpr.mjs +0 -3
  284. package/dist/hyperdrive-BlfrTwSq.mjs +0 -21
  285. package/dist/iam-Bk7K_PPO.mjs +0 -6
  286. package/dist/images-BAEFb9q1.mjs +0 -8
  287. package/dist/intel-DDkyJVaP.mjs +0 -8
  288. package/dist/interactive-CRnq-B5I.mjs +0 -11
  289. package/dist/interactive-cytQzL94.mjs +0 -78
  290. package/dist/ips-DU0ti0i0.mjs +0 -2
  291. package/dist/keyless-certificates-E1P9jBTb.mjs +0 -3
  292. package/dist/keys-DqldTZqH.mjs +0 -2
  293. package/dist/kv-CcfCfnwq.mjs +0 -5
  294. package/dist/leaked-credential-checks-CqmKaEbd.mjs +0 -4
  295. package/dist/load-balancers-Dg4pDad1.mjs +0 -6
  296. package/dist/logexplorer-Bu2mG5rh.mjs +0 -17
  297. package/dist/logo-matches-CWUzxY7G.mjs +0 -2
  298. package/dist/logos-BTfdkDPi.mjs +0 -3
  299. package/dist/logpush-BZyay3h2.mjs +0 -4
  300. package/dist/logs-BqF7jjQO.mjs +0 -3
  301. package/dist/magic-cloud-networking-Dhd8pTyM.mjs +0 -5
  302. package/dist/magic-network-monitoring-D0FnkjuN.mjs +0 -4
  303. package/dist/magic-transit-B5skt0G7.mjs +0 -111
  304. package/dist/managed-transforms-B6X_crcJ.mjs +0 -3
  305. package/dist/matches-DeYaB4I0.mjs +0 -2
  306. package/dist/mcp-ChjBiMx2.mjs +0 -4
  307. package/dist/mesh-DRVAFLBX.mjs +0 -4
  308. package/dist/moq-DE7VDEFS.mjs +0 -13
  309. package/dist/mtls-certificates-Cbc3uAkN.mjs +0 -3
  310. package/dist/network-CDPZNFbn.mjs +0 -6
  311. package/dist/network-interconnects-CMRs_chR.mjs +0 -41
  312. package/dist/oauth-DAa7SwkM.mjs +0 -14
  313. package/dist/oauth-clients-DAI_gcuL.mjs +0 -4
  314. package/dist/oauth-scopes-BE6xF4_h.mjs +0 -2
  315. package/dist/observability-DnyI8rPJ.mjs +0 -4
  316. package/dist/organization-yh0mSUdI.mjs +0 -41
  317. package/dist/organizations-B3aU-RCG.mjs +0 -2
  318. package/dist/origin-ca-certificates-BaNWfVqf.mjs +0 -3
  319. package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +0 -2
  320. package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +0 -4
  321. package/dist/page-rules-CzbyXbt6.mjs +0 -27
  322. package/dist/pages-CX8yefTI.mjs +0 -14
  323. package/dist/pay-per-crawl-v4vBOMWD.mjs +0 -4
  324. package/dist/pipelines-BZ1KGupx.mjs +0 -6
  325. package/dist/precursor-D42A9ay5.mjs +0 -4
  326. package/dist/progress-jYW64HY7.mjs +0 -2
  327. package/dist/project-settings-BN7tL0c7.mjs +0 -3
  328. package/dist/prompt-CyATfGUu.mjs +0 -3
  329. package/dist/queries-xvETUjUE.mjs +0 -3
  330. package/dist/queues-CpqHDtxF.mjs +0 -6
  331. package/dist/r2-data-catalog-DgKmlTKR.mjs +0 -16
  332. package/dist/r2-jhmLvD1z.mjs +0 -24
  333. package/dist/radar-C2J16wpX.mjs +0 -2
  334. package/dist/rate-limits-CoH9Xma0.mjs +0 -5
  335. package/dist/raw-fetch-CNKIypJ7.mjs +0 -2
  336. package/dist/realtimekit-CDs0Z5WW.mjs +0 -7
  337. package/dist/registrar-BI5ewTAk.mjs +0 -23
  338. package/dist/registrar-sandbox-al1znWMc.mjs +0 -61
  339. package/dist/reporting-CxsdHAH3.mjs +0 -2
  340. package/dist/request-tracers-DJJCncft.mjs +0 -2
  341. package/dist/resource-sharing-qQGn8AEn.mjs +0 -3
  342. package/dist/resource-tagging-aTtpX5e5.mjs +0 -2
  343. package/dist/rules-PpsDU89Q.mjs +0 -4
  344. package/dist/rulesets-DP12Aqik.mjs +0 -5
  345. package/dist/rum-DxvpzJYc.mjs +0 -4
  346. package/dist/schema-DlLbiOJj.mjs +0 -2
  347. package/dist/scim-DJ4AVU20.mjs +0 -4
  348. package/dist/secrets-store-D6KDNo_s.mjs +0 -7
  349. package/dist/security-center-008FMs_z.mjs +0 -2
  350. package/dist/security-txt-CqcfrhlN.mjs +0 -3
  351. package/dist/share-D5fzsVAJ.mjs +0 -5
  352. package/dist/smart-shield-DpFscIk8.mjs +0 -4
  353. package/dist/snippets-CCKgI2ZX.mjs +0 -4
  354. package/dist/spectrum-LmdqY3ki.mjs +0 -7
  355. package/dist/speed-CEK36h3A.mjs +0 -4
  356. package/dist/src-CEb2fgtT.mjs +0 -108
  357. package/dist/ssl-ChHUyaQm.mjs +0 -15
  358. package/dist/state-DeX23Kmg.mjs +0 -2
  359. package/dist/stream-DfUSELMX.mjs +0 -14
  360. package/dist/submit-DF2G5CIz.mjs +0 -2
  361. package/dist/tags-nFJJHlLJ.mjs +0 -2
  362. package/dist/tenant-CRLw1oRU.mjs +0 -2
  363. package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +0 -3
  364. package/dist/tunnel-CMQeBgmb.mjs +0 -5
  365. package/dist/tunnels-iVA3MrdS.mjs +0 -2
  366. package/dist/turnstile-DQHP6-_b.mjs +0 -23
  367. package/dist/ui-DJFcf61J.mjs +0 -5
  368. package/dist/url-info-BVgdb_pf.mjs +0 -2
  369. package/dist/url-normalization-BTcxLxIQ.mjs +0 -3
  370. package/dist/url-scanner-DwuDZLPk.mjs +0 -2
  371. package/dist/user-I_MbB_KX.mjs +0 -12
  372. package/dist/values-S-Q7-5o8.mjs +0 -2
  373. package/dist/vectorize-CNZdF_0A.mjs +0 -4
  374. package/dist/waiting-rooms-Bo-OSsxu.mjs +0 -11
  375. package/dist/web-assets-tlFzKdNL.mjs +0 -8
  376. package/dist/web3-CdbfoZ2x.mjs +0 -4
  377. package/dist/workers-DQ9Q7czn.mjs +0 -28
  378. package/dist/workers-builds-CGRhYx-x.mjs +0 -9
  379. package/dist/workflows-BhEy-crm.mjs +0 -5
  380. package/dist/zaraz-DbKvA_8C.mjs +0 -2
  381. package/dist/zero-trust-DrHCPVOc.mjs +0 -93
  382. package/dist/zone-D2zrbJI2.mjs +0 -2
  383. package/dist/zones-DrpxQ_-A.mjs +0 -21
  384. /package/dist/{Page-9ry_XAVC.mjs → Page-C-JHZnIy.mjs} +0 -0
  385. /package/dist/{alerts-9PR5sQ_z.mjs → alerts-B2SJO4nd.mjs} +0 -0
  386. /package/dist/{autorag-Bevo1kIH.mjs → autorag-iNjZXw1n.mjs} +0 -0
  387. /package/dist/{body-parser-BGVbwPeM.mjs → body-parser-DIlfApuJ.mjs} +0 -0
  388. /package/dist/{brands-C4M04Man.mjs → brands-BrVnNrT3.mjs} +0 -0
  389. /package/dist/{chunk-6EUZQHAF-C3w62dek.mjs → chunk-6EUZQHAF-B7bSMYLe.mjs} +0 -0
  390. /package/dist/{chunk-Q72B4Q5Z-DVMMVVEs.mjs → chunk-Q72B4Q5Z-CPy_WJKU.mjs} +0 -0
  391. /package/dist/{clear-DS0eRXOc.mjs → clear-an9o3dJ3.mjs} +0 -0
  392. /package/dist/{cli-types-C3nVfpSG.mjs → cli-types-CrSoSMPF.mjs} +0 -0
  393. /package/dist/{connector-telemetry-events-latest-CKKG6_pD.mjs → connector-telemetry-events-latest-BqWfopFc.mjs} +0 -0
  394. /package/dist/{connector-telemetry-snapshots-latest-Bv5OddJr.mjs → connector-telemetry-snapshots-latest-C1m9U1En.mjs} +0 -0
  395. /package/dist/{domain-info-BUiaGCEq.mjs → domain-info-B0Ykqv5l.mjs} +0 -0
  396. /package/dist/{health-vX6Ml2Na.mjs → health-CIUg1C5o.mjs} +0 -0
  397. /package/dist/{input-validation-1esLElok.mjs → input-validation-BxchZ9jE.mjs} +0 -0
  398. /package/dist/{internal-ROz7anul.mjs → internal-DmpATljO.mjs} +0 -0
  399. /package/dist/{live-CSxvigCS.mjs → live-B66u3_0g.mjs} +0 -0
  400. /package/dist/{metadata-DEqBUaSv.mjs → metadata-D062SVyy.mjs} +0 -0
  401. /package/dist/{public-BMg6-Hxh-DgIH5obr.mjs → public-BMg6-Hxh-BfUOZTDP.mjs} +0 -0
  402. /package/dist/{rate-limit-analytics-CgHgKjmV.mjs → rate-limit-analytics-BknoecoM.mjs} +0 -0
  403. /package/dist/{ready-6G9zVGPJ.mjs → ready-C-H2cwp_.mjs} +0 -0
  404. /package/dist/{recent-submissions-B3Smh-QM.mjs → recent-submissions-DyuH_n5u.mjs} +0 -0
  405. /package/dist/{refute-DjkmLSNe.mjs → refute-uSlzkQKq.mjs} +0 -0
  406. /package/dist/{resolve-DEvdeprv.mjs → resolve-B8CyM1mi.mjs} +0 -0
  407. /package/dist/{scan-logo-545qLcGs.mjs → scan-logo-DMk--WT7.mjs} +0 -0
  408. /package/dist/{scan-page-DRQiVufl.mjs → scan-page-DEHnAOJo.mjs} +0 -0
  409. /package/dist/{schemas-BFCBlp_W.mjs → schemas-O_ZNaF8R.mjs} +0 -0
  410. /package/dist/{search-CXbqFoqe.mjs → search-BlKeSfVD.mjs} +0 -0
  411. /package/dist/{signed-url-rU_nvgFA.mjs → signed-url-CiGmGkLQ.mjs} +0 -0
  412. /package/dist/{submission-info-D6PgXNQP.mjs → submission-info-DHlTHDrs.mjs} +0 -0
  413. /package/dist/{theme-CrIBazAF.mjs → theme-CeVf-5qG.mjs} +0 -0
  414. /package/dist/{total-queries-XkFyu8H5.mjs → total-queries-D5WvVfYi.mjs} +0 -0
  415. /package/dist/{tracked-domains-CmcRXHj_.mjs → tracked-domains-9deBK9bp.mjs} +0 -0
  416. /package/dist/{verify-CM1NakP0.mjs → verify-S-TmhUDr.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{r as e,t}from"./chunk-vbHwaUoU.mjs";import{a as n,i as r,n as i,r as a,t as o}from"./chunk-Q72B4Q5Z-DVMMVVEs.mjs";import s,{accessSync as c,appendFileSync as l,chmodSync as u,constants as d,existsSync as f,mkdirSync as p,readFileSync as m,renameSync as h,statSync as g,unlinkSync as _,writeFileSync as v}from"node:fs";import y from"node:assert";import{stripVTControlCharacters as b}from"node:util";import*as x from"node:path";import S,{basename as C,dirname as w,isAbsolute as T,join as E,resolve as D}from"node:path";import O,{arch as k}from"node:os";import A from"node:process";import j from"node:tty";import{URLSearchParams as M}from"node:url";import{createHash as N,randomBytes as P}from"node:crypto";import{execFileSync as ee,spawn as te}from"node:child_process";import*as ne from"node:timers/promises";import{setTimeout as re}from"node:timers/promises";function ie(e){var t=[...arguments].slice(1),n=Array.from(typeof e==`string`?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,``);var r=n.reduce(function(e,t){var n=t.match(/\n([\t ]+|(?!\s).)/g);return n?e.concat(n.map(function(e){return e.match(/[\t ]/g)?.length??0})):e},[]);if(r.length){var i=RegExp(`
2
+ import{r as e,t}from"./chunk-vbHwaUoU.mjs";import{a as n,i as r,n as i,r as a,t as o}from"./chunk-Q72B4Q5Z-CPy_WJKU.mjs";import*as s from"node:timers/promises";import{setTimeout as c}from"node:timers/promises";import l,{accessSync as u,appendFileSync as d,chmodSync as f,constants as p,existsSync as m,mkdirSync as h,readFileSync as g,renameSync as _,statSync as v,unlinkSync as y,writeFileSync as b}from"node:fs";import x from"node:assert";import{stripVTControlCharacters as S}from"node:util";import*as C from"node:path";import w,{basename as T,dirname as E,isAbsolute as D,join as O,resolve as k}from"node:path";import A,{arch as j}from"node:os";import M from"node:process";import N from"node:tty";import{URLSearchParams as P}from"node:url";import{createHash as ee,randomBytes as te}from"node:crypto";import{execFileSync as ne,spawn as re}from"node:child_process";function ie(e){var t=[...arguments].slice(1),n=Array.from(typeof e==`string`?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,``);var r=n.reduce(function(e,t){var n=t.match(/\n([\t ]+|(?!\s).)/g);return n?e.concat(n.map(function(e){return e.match(/[\t ]/g)?.length??0})):e},[]);if(r.length){var i=RegExp(`
3
3
  [ ]{`+Math.min.apply(Math,r)+`}`,`g`);n=n.map(function(e){return e.replace(i,`
4
4
  `)})}n[0]=n[0].replace(/^\r?\n/,``);var a=n[0];return t.forEach(function(e,t){var r=a.match(/(?:^|\n)( *)$/),i=r?r[1]:``,o=e;typeof e==`string`&&e.includes(`
5
5
  `)&&(o=String(e).split(`
@@ -46,27 +46,27 @@ ${o}`:a||o}a(Et,`stringifyTable`);function Dt(e,{maxDepth:t=1e3,numbersAsFloat:n
46
46
  `?r:r+`
47
47
  `}a(Dt,`stringify`);var Ot={parse:_t,stringify:Dt,TomlDate:nt,TomlError:Je},kt=class extends F{static{a(this,`ParseError`)}text;notes;location;kind;constructor({text:e,notes:t,location:n,kind:r,telemetryMessage:i}){super(e,{telemetryMessage:i}),this.name=this.constructor.name,this.text=e,this.notes=t??[],this.location=n,this.kind=r??`error`}},At=class extends kt{static{a(this,`APIError`)}#e;code;accountTag;meta;retryAfterMs;constructor({status:e,retryAfterMs:t,...n}){super(n),this.name=this.constructor.name,this.#e=e,this.retryAfterMs=t}get status(){return this.#e}isGatewayError(){return this.#e===void 0?!1:[502,503,504,524].includes(this.#e)}isRetryable(){return String(this.#e).startsWith(`5`)}#t=!0;get reportable(){return this.#t}preventReport(){this.#t=!1}};function jt(e,t){try{return Ot.parse(e)}catch(n){if(!(n instanceof Je))throw n;let r={lineText:e.split(`
48
48
  `)[n.line-1],line:n.line,column:n.column-1,file:t,fileText:e};throw new kt({text:n.message.substring(0,n.message.indexOf(`
49
- `)),location:r,telemetryMessage:`TOML parse error`})}}a(jt,`parseTOML`);function Mt(e,t){return Nt(e,t)}a(Mt,`parsePackageJSON`);function Nt(e,t){return Pt(e,t,{allowEmptyContent:!1,allowTrailingComma:!1,disallowComments:!0})}a(Nt,`parseJSON`);function Pt(e,t,n={allowTrailingComma:!0}){let r=[],i=Be(e,r,n);if(r.length)throw new kt({text:He(r[0].error),location:{...Lt({file:t,fileText:e},r[0].offset+1),length:r[0].length},telemetryMessage:`JSON(C) parse error`});return i}a(Pt,`parseJSONC`);function Ft(e){try{return m(e)}catch(t){let{message:n}=t;throw new kt({text:`Could not read file: ${e}`,notes:[{text:n.replace(e,D(e))}],telemetryMessage:!1})}}a(Ft,`readFileSyncToBuffer`);function It(e){try{return Wt(m(e),e)}catch(t){if(t instanceof kt)throw t;let{message:n}=t;throw new kt({text:`Could not read file: ${e}`,notes:[{text:n.replace(e,D(e))}],telemetryMessage:`Could not read file`})}}a(It,`readFileSync`);function Lt(e,t){let n,r=0,i=0,a=0,{fileText:o=``}=e;for(let e of o.split(`
49
+ `)),location:r,telemetryMessage:`TOML parse error`})}}a(jt,`parseTOML`);function Mt(e,t){return Nt(e,t)}a(Mt,`parsePackageJSON`);function Nt(e,t){return Pt(e,t,{allowEmptyContent:!1,allowTrailingComma:!1,disallowComments:!0})}a(Nt,`parseJSON`);function Pt(e,t,n={allowTrailingComma:!0}){let r=[],i=Be(e,r,n);if(r.length)throw new kt({text:He(r[0].error),location:{...Lt({file:t,fileText:e},r[0].offset+1),length:r[0].length},telemetryMessage:`JSON(C) parse error`});return i}a(Pt,`parseJSONC`);function Ft(e){try{return g(e)}catch(t){let{message:n}=t;throw new kt({text:`Could not read file: ${e}`,notes:[{text:n.replace(e,k(e))}],telemetryMessage:!1})}}a(Ft,`readFileSyncToBuffer`);function It(e){try{return Wt(g(e),e)}catch(t){if(t instanceof kt)throw t;let{message:n}=t;throw new kt({text:`Could not read file: ${e}`,notes:[{text:n.replace(e,k(e))}],telemetryMessage:`Could not read file`})}}a(It,`readFileSync`);function Lt(e,t){let n,r=0,i=0,a=0,{fileText:o=``}=e;for(let e of o.split(`
50
50
  `))if(r++,a+=e.length+1,a>=t){n=e,i=e.length-(a-t);break}return{lineText:n,line:r,column:i,...e}}a(Lt,`indexLocation`);function Rt(e,t){let n,r,i=0,a=0,o=String(t),{fileText:s=``}=e;for(let e of s.split(`
51
- `)){i++;let t=e.indexOf(o);if(t>=0){n=e,a=t,r=o.length;break}}return{lineText:n,line:i,column:a,length:r,...e}}a(Rt,`searchLocation`);var zt={nanoseconds:1e-9,nanosecond:1e-9,microseconds:1e-6,microsecond:1e-6,milliseconds:.001,millisecond:.001,seconds:1,second:1,minutes:60,minute:60,hours:3600,hour:3600,days:86400,day:86400,weeks:604800,week:604800,month:18144e3,year:220752e3,nsecs:1e-9,nsec:1e-9,usecs:1e-6,usec:1e-6,msecs:.001,msec:.001,secs:1,sec:1,mins:60,min:60,ns:1e-9,us:1e-6,ms:.001,mo:18144e3,yr:220752e3,s:1,m:60,h:3600,d:86400,w:604800,y:220752e3};function Bt(e){let t=new Map(Object.entries(zt));e=e.trim().toLowerCase();let n=1;for(let[r,i]of t)if(e.endsWith(r)){e=e.substring(0,e.length-r.length),n=t.get(r)||1;break}return Number(e)*n}a(Bt,`parseHumanDuration`);function Vt(e){if(e==null||e.includes(`-`))return e;if(e.length!=32)return null;let t=[];t.push(e.slice(0,8)),t.push(e.slice(8,12)),t.push(e.slice(12,16)),t.push(e.slice(16,20)),t.push(e.slice(20));let n=``;return t.forEach(e=>n+=e+`-`),n.slice(0,36)}a(Vt,`parseNonHyphenedUuid`);function Ht(e,t=void 0){let n=e.match(/^(\d*\.*\d*)\s*([kKmMgGtTpP]{0,1})([i]{0,1}[bB]{0,1})$/);if(!n)return NaN;let r=n[1];if(r.length===0||isNaN(Number(r)))return NaN;let i=n[2].toLowerCase(),a={k:1,m:2,g:3,t:4,p:5};if(i.length!==0&&!(i in a))return NaN;let o=n[3].toLowerCase()==`ib`;if(o&&i.length===0)return NaN;let s=a[i]||0;return Math.floor(Number(r)*(t??(o?1024:1e3))**+s)}a(Ht,`parseByteSize`);var Ut=[{buffer:Buffer.from([0,0,254,255]),encoding:`UTF-32 BE`},{buffer:Buffer.from([255,254,0,0]),encoding:`UTF-32 LE`},{buffer:Buffer.from([254,255]),encoding:`UTF-16 BE`},{buffer:Buffer.from([255,254]),encoding:`UTF-16 LE`}];function Wt(e,t){for(let n of Ut)if(e.length>=n.buffer.length&&e.subarray(0,n.buffer.length).equals(n.buffer))throw new kt({text:`Configuration file contains ${n.encoding} byte order marker`,notes:[{text:`The file "${t}" appears to be encoded as ${n.encoding}. Please save the file as UTF-8 without BOM.`}],location:{file:t,line:1,column:0},telemetryMessage:`${n.encoding} BOM detected`});let n=e.toString(`utf-8`);return n.charCodeAt(0)===65279?n.slice(1):n}a(Wt,`removeBOMAndValidate`);var Gt=Symbol.for(`inherit_binding`),Kt=`cf:service=`,qt=`cf:environment=`,Jt=`.wrangler/deploy/config.json`;function Yt(e,t){return T(e)?e:D(t||`.`,e)}a(Yt,`absolute`);function Xt(e,t){let{last:n,cwd:r}=t||{},i=Yt(e,r),a=Yt(n||`/`,r),o,s=[];for(;o!==a&&(s.push(i),i=w(o=i),i!==o););return s}a(Xt,`up`);function Zt(e,t){let n,r;for(n of Xt(t&&t.cwd||``,t))try{if(r=E(n,e),g(r).isFile())return r}catch{}}a(Zt,`file`);function Qt(e,t){let n,r;for(n of Xt(t&&t.cwd||``,t))try{if(r=E(n,e),g(r).isDirectory())return r}catch{}}a(Qt,`dir`);function $t({config:e,script:t},n){return e===void 0?en(t===void 0?process.cwd():S.dirname(t),n):{userConfigPath:e,configPath:e,deployConfigPath:void 0,redirected:!1}}a($t,`resolveWranglerConfigPath`);function en(e=process.cwd(),{useRedirectIfAvailable:t=!1}={}){let n=Zt(`wrangler.json`,{cwd:e})??Zt(`wrangler.jsonc`,{cwd:e})??Zt(`wrangler.toml`,{cwd:e});if(!t)return{userConfigPath:n,configPath:n,deployConfigPath:void 0,redirected:!1};let{configPath:r,deployConfigPath:i,redirected:a}=tn(e,n);return{userConfigPath:n,configPath:r,deployConfigPath:i,redirected:a}}a(en,`findWranglerConfig`);function tn(e,t){let n=Zt(Jt,{cwd:e});if(n===void 0)return{configPath:t,deployConfigPath:n,redirected:!1};let r,i=It(n);try{let e=Pt(i,n);r=e.configPath&&S.resolve(S.dirname(n),e.configPath)}catch(e){throw new F(`Failed to parse the deploy configuration file at ${S.relative(`.`,n)}`,{cause:e,telemetryMessage:!1})}if(!r)throw new F(ae`
52
- A deploy configuration file was found at "${S.relative(`.`,n)}".
51
+ `)){i++;let t=e.indexOf(o);if(t>=0){n=e,a=t,r=o.length;break}}return{lineText:n,line:i,column:a,length:r,...e}}a(Rt,`searchLocation`);var zt={nanoseconds:1e-9,nanosecond:1e-9,microseconds:1e-6,microsecond:1e-6,milliseconds:.001,millisecond:.001,seconds:1,second:1,minutes:60,minute:60,hours:3600,hour:3600,days:86400,day:86400,weeks:604800,week:604800,month:18144e3,year:220752e3,nsecs:1e-9,nsec:1e-9,usecs:1e-6,usec:1e-6,msecs:.001,msec:.001,secs:1,sec:1,mins:60,min:60,ns:1e-9,us:1e-6,ms:.001,mo:18144e3,yr:220752e3,s:1,m:60,h:3600,d:86400,w:604800,y:220752e3};function Bt(e){let t=new Map(Object.entries(zt));e=e.trim().toLowerCase();let n=1;for(let[r,i]of t)if(e.endsWith(r)){e=e.substring(0,e.length-r.length),n=t.get(r)||1;break}return Number(e)*n}a(Bt,`parseHumanDuration`);function Vt(e){if(e==null||e.includes(`-`))return e;if(e.length!=32)return null;let t=[];t.push(e.slice(0,8)),t.push(e.slice(8,12)),t.push(e.slice(12,16)),t.push(e.slice(16,20)),t.push(e.slice(20));let n=``;return t.forEach(e=>n+=e+`-`),n.slice(0,36)}a(Vt,`parseNonHyphenedUuid`);function Ht(e,t=void 0){let n=e.match(/^(\d*\.*\d*)\s*([kKmMgGtTpP]{0,1})([i]{0,1}[bB]{0,1})$/);if(!n)return NaN;let r=n[1];if(r.length===0||isNaN(Number(r)))return NaN;let i=n[2].toLowerCase(),a={k:1,m:2,g:3,t:4,p:5};if(i.length!==0&&!(i in a))return NaN;let o=n[3].toLowerCase()==`ib`;if(o&&i.length===0)return NaN;let s=a[i]||0;return Math.floor(Number(r)*(t??(o?1024:1e3))**+s)}a(Ht,`parseByteSize`);var Ut=[{buffer:Buffer.from([0,0,254,255]),encoding:`UTF-32 BE`},{buffer:Buffer.from([255,254,0,0]),encoding:`UTF-32 LE`},{buffer:Buffer.from([254,255]),encoding:`UTF-16 BE`},{buffer:Buffer.from([255,254]),encoding:`UTF-16 LE`}];function Wt(e,t){for(let n of Ut)if(e.length>=n.buffer.length&&e.subarray(0,n.buffer.length).equals(n.buffer))throw new kt({text:`Configuration file contains ${n.encoding} byte order marker`,notes:[{text:`The file "${t}" appears to be encoded as ${n.encoding}. Please save the file as UTF-8 without BOM.`}],location:{file:t,line:1,column:0},telemetryMessage:`${n.encoding} BOM detected`});let n=e.toString(`utf-8`);return n.charCodeAt(0)===65279?n.slice(1):n}a(Wt,`removeBOMAndValidate`);var Gt=Symbol.for(`inherit_binding`),Kt=`cf:service=`,qt=`cf:environment=`,Jt=`.wrangler/deploy/config.json`;function Yt(e,t){return D(e)?e:k(t||`.`,e)}a(Yt,`absolute`);function Xt(e,t){let{last:n,cwd:r}=t||{},i=Yt(e,r),a=Yt(n||`/`,r),o,s=[];for(;o!==a&&(s.push(i),i=E(o=i),i!==o););return s}a(Xt,`up`);function Zt(e,t){let n,r;for(n of Xt(t&&t.cwd||``,t))try{if(r=O(n,e),v(r).isFile())return r}catch{}}a(Zt,`file`);function Qt(e,t){let n,r;for(n of Xt(t&&t.cwd||``,t))try{if(r=O(n,e),v(r).isDirectory())return r}catch{}}a(Qt,`dir`);function $t({config:e,script:t},n){return e===void 0?en(t===void 0?process.cwd():w.dirname(t),n):{userConfigPath:e,configPath:e,deployConfigPath:void 0,redirected:!1}}a($t,`resolveWranglerConfigPath`);function en(e=process.cwd(),{useRedirectIfAvailable:t=!1}={}){let n=Zt(`wrangler.json`,{cwd:e})??Zt(`wrangler.jsonc`,{cwd:e})??Zt(`wrangler.toml`,{cwd:e});if(!t)return{userConfigPath:n,configPath:n,deployConfigPath:void 0,redirected:!1};let{configPath:r,deployConfigPath:i,redirected:a}=tn(e,n);return{userConfigPath:n,configPath:r,deployConfigPath:i,redirected:a}}a(en,`findWranglerConfig`);function tn(e,t){let n=Zt(Jt,{cwd:e});if(n===void 0)return{configPath:t,deployConfigPath:n,redirected:!1};let r,i=It(n);try{let e=Pt(i,n);r=e.configPath&&w.resolve(w.dirname(n),e.configPath)}catch(e){throw new F(`Failed to parse the deploy configuration file at ${w.relative(`.`,n)}`,{cause:e,telemetryMessage:!1})}if(!r)throw new F(ae`
52
+ A deploy configuration file was found at "${w.relative(`.`,n)}".
53
53
  But this is not valid - the required "configPath" property was not found.
54
54
  Instead this file contains:
55
55
  \`\`\`
56
56
  ${i}
57
57
  \`\`\`
58
- `,{telemetryMessage:!1});if(!f(r))throw new F(ae`
59
- There is a deploy configuration at "${S.relative(`.`,n)}".
60
- But the redirected configuration path it points to, "${S.relative(`.`,r)}", does not exist.
61
- `,{telemetryMessage:!1});if(t&&S.join(S.dirname(t),`.wrangler/deploy/config.json`)!==n)throw new F(ae`
62
- Found both a user configuration file at "${S.relative(`.`,t)}"
63
- and a deploy configuration file at "${S.relative(`.`,n)}".
58
+ `,{telemetryMessage:!1});if(!m(r))throw new F(ae`
59
+ There is a deploy configuration at "${w.relative(`.`,n)}".
60
+ But the redirected configuration path it points to, "${w.relative(`.`,r)}", does not exist.
61
+ `,{telemetryMessage:!1});if(t&&w.join(w.dirname(t),`.wrangler/deploy/config.json`)!==n)throw new F(ae`
62
+ Found both a user configuration file at "${w.relative(`.`,t)}"
63
+ and a deploy configuration file at "${w.relative(`.`,n)}".
64
64
  But these do not share the same base path so it is not clear which should be used.
65
- `,{telemetryMessage:!1});return{configPath:r,deployConfigPath:n,redirected:!0}}a(tn,`findRedirectedWranglerConfig`);function nn(e){return e.configPath!==void 0&&e.configPath!==e.userConfigPath}a(nn,`isRedirectedConfig`);function rn(e,t,n){return nn({configPath:t,userConfigPath:n})}a(rn,`isRedirectedRawConfig`);function an(e){return e?.endsWith(`toml`)?`toml`:e?.endsWith(`jsonc`)?`jsonc`:e?.endsWith(`json`)?`json`:`none`}a(an,`configFormat`);function on(e){switch(an(e)){case`toml`:return`wrangler.toml`;case`json`:return`wrangler.json`;case`jsonc`:return`wrangler.jsonc`;default:return`Wrangler configuration`}}a(on,`configFileName`);function sn(e,t,n=!0){return an(t)===`toml`?Ot.stringify(e):n?JSON.stringify(e,null,2):JSON.stringify(e)}a(sn,`formatConfigSnippet`);var cn=a(e=>e.endsWith(`.toml`)?jt(It(e),e):e.endsWith(`.json`)||e.endsWith(`.jsonc`)?Pt(It(e),e):{},`parseRawConfigFile`),ln=a((e,t={})=>{let{configPath:n,userConfigPath:r,deployConfigPath:i,redirected:a}=$t(e,t);return{rawConfig:cn(n??``),configPath:n,userConfigPath:r,deployConfigPath:i,redirected:a}},`experimental_readRawConfig`),un=`2026-09-21`;function dn(e){}a(dn,`assertNever`);function fn(e){return e.filter(e=>e.type!==`secret_text`).reduce((e,t)=>{switch(t.type){case`plain_text`:e.vars={...e.vars??{},[t.name]:t.text};break;case`json`:e.vars={...e.vars??{},[t.name]:t.json};break;case`kv_namespace`:e.kv_namespaces=[...e.kv_namespaces??[],{id:t.namespace_id,binding:t.name}];break;case`durable_object_namespace`:e.durable_objects={bindings:[...e.durable_objects?.bindings??[],{name:t.name,class_name:t.class_name,script_name:t.script_name,environment:t.environment}]};break;case`d1`:e.d1_databases=[...e.d1_databases??[],{binding:t.name,database_id:t.id}];break;case`browser`:e.browser={binding:t.name};break;case`ai`:e.ai={binding:t.name};break;case`images`:e.images={binding:t.name};break;case`stream`:e.stream={binding:t.name};break;case`media`:e.media={binding:t.name};break;case`r2_bucket`:e.r2_buckets=[...e.r2_buckets??[],{binding:t.name,bucket_name:t.bucket_name,jurisdiction:t.jurisdiction}];break;case`secrets_store_secret`:e.secrets_store_secrets=[...e.secrets_store_secrets??[],{binding:t.name,store_id:t.store_id,secret_name:t.secret_name}];break;case`artifacts`:e.artifacts=[...e.artifacts??[],{binding:t.name,namespace:t.namespace}];break;case`unsafe_hello_world`:e.unsafe_hello_world=[...e.unsafe_hello_world??[],{binding:t.name,enable_timer:t.enable_timer}];break;case`flagship`:e.flagship=[...e.flagship??[],{binding:t.name,app_id:t.app_id}];break;case`service`:e.services=[...e.services??[],{binding:t.name,service:t.service,environment:t.environment,entrypoint:t.entrypoint}];break;case`analytics_engine`:e.analytics_engine_datasets=[...e.analytics_engine_datasets??[],{binding:t.name,dataset:t.dataset}];break;case`dispatch_namespace`:e.dispatch_namespaces=[...e.dispatch_namespaces??[],{binding:t.name,namespace:t.namespace,...t.outbound&&{outbound:{service:t.outbound.worker.service,environment:t.outbound.worker.environment,parameters:t.outbound.params?.map(e=>e.name)??[]}}}];break;case`logfwdr`:e.logfwdr={bindings:[...e.logfwdr?.bindings??[],{name:t.name,destination:t.destination}]};break;case`wasm_module`:e.wasm_modules={...e.wasm_modules??{},[t.name]:t.part};break;case`text_blob`:e.text_blobs={...e.text_blobs??{},[t.name]:t.part};break;case`data_blob`:e.data_blobs={...e.data_blobs??{},[t.name]:t.part};break;case`secret_text`:break;case`version_metadata`:e.version_metadata={binding:t.name};break;case`send_email`:e.send_email=[...e.send_email??[],{name:t.name,destination_address:t.destination_address,allowed_destination_addresses:t.allowed_destination_addresses,allowed_sender_addresses:t.allowed_sender_addresses}];break;case`queue`:e.queues??={producers:[]},e.queues.producers=[...e.queues.producers??[],{binding:t.name,queue:t.queue_name,delivery_delay:t.delivery_delay}];break;case`vectorize`:e.vectorize=[...e.vectorize??[],{binding:t.name,index_name:t.index_name}];break;case`ai_search_namespace`:e.ai_search_namespaces=[...e.ai_search_namespaces??[],{binding:t.name,namespace:t.namespace}];break;case`ai_search`:e.ai_search=[...e.ai_search??[],{binding:t.name,instance_name:t.instance_name}];break;case`agent_memory`:e.agent_memory=[...e.agent_memory??[],{binding:t.name,namespace:t.namespace}];break;case`hyperdrive`:e.hyperdrive=[...e.hyperdrive??[],{binding:t.name,id:t.id}];break;case`mtls_certificate`:e.mtls_certificates=[...e.mtls_certificates??[],{binding:t.name,certificate_id:t.certificate_id}];break;case`pipelines`:e.pipelines=[...e.pipelines??[],{binding:t.name,...t.stream&&{stream:t.stream},...t.pipeline&&{pipeline:t.pipeline}}];break;case`assets`:e.assets={binding:t.name};break;case`inherit`:e.unsafe={bindings:[...e.unsafe?.bindings??[],t],metadata:e.unsafe?.metadata??void 0};break;case`workflow`:e.workflows=[...e.workflows??[],{binding:t.name,name:t.workflow_name,class_name:t.class_name,script_name:t.script_name}];break;case`worker_loader`:e.worker_loaders=[...e.worker_loaders??[],{binding:t.name}];break;case`ratelimit`:e.ratelimits=[...e.ratelimits??[],{name:t.name,namespace_id:t.namespace_id,simple:{limit:t.simple.limit,period:t.simple.period}}];break;case`vpc_service`:e.vpc_services=[...e.vpc_services??[],{binding:t.name,service_id:t.service_id}];break;case`vpc_network`:t.tunnel_id===void 0?t.network_id!==void 0&&(e.vpc_networks=[...e.vpc_networks??[],{binding:t.name,network_id:t.network_id}]):e.vpc_networks=[...e.vpc_networks??[],{binding:t.name,tunnel_id:t.tunnel_id}];break;default:e.unsafe={bindings:[...e.unsafe?.bindings??[],t],metadata:e.unsafe?.metadata??void 0}}return e},{})}a(fn,`mapWorkerMetadataBindings`);function pn(e){let t=fn(e.bindings),n=e.bindings.filter(t=>t.type===`durable_object_namespace`&&t.script_name===e.name).map(e=>e.class_name),r=[...e.routes.map(e=>({pattern:e.pattern,zone_name:e.zone_name})),...e.domains.map(e=>({pattern:e.hostname,zone_name:e.zone_name,custom_domain:!0,enabled:e.enabled,previews_enabled:e.previews_enabled}))];return{name:e.name,main:e.entrypoint,workers_dev:e.subdomain.enabled,preview_urls:e.subdomain.previews_enabled,compatibility_date:e.compatibility_date??`2026-09-21`,compatibility_flags:e.compatibility_flags,...r.length?{routes:r}:{},placement:e.placement?.mode===`smart`?{mode:`smart`}:void 0,limits:e.limits,...n.length&&e.migration_tag?{migrations:[{tag:e.migration_tag,new_classes:n}]}:{},...e.schedules.length?{triggers:{crons:e.schedules.map(e=>e.cron)}}:{},tail_consumers:e.tail_consumers??void 0,observability:e.observability,...t}}a(pn,`constructWranglerConfig`);function mn(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)}a(mn,`isCompatDate`);function hn(e){let t=e.toISOString().slice(0,10);return y(mn(t)),t}a(hn,`formatCompatibilityDate`);function gn(){return hn(new Date)}a(gn,`getTodaysCompatDate`);function _n(e){return e!==void 0&&e>=`2026-08-04`}a(_n,`isNodejsCompatDefaultOn`);function vn(e,t){let n=_n(e),r=t.includes(`nodejs_compat`)||n&&!t.includes(`no_nodejs_compat`);return{isNodejsCompatEnabled:r,isNodejsCompatV2Enabled:t.includes(`nodejs_compat_v2`)||!t.includes(`no_nodejs_compat_v2`)&&(n||r&&e>=`2024-09-23`)}}a(vn,`resolveNodejsCompat`);function yn(e,t){if(!_n(e))return t;let n=[`nodejs_compat`,`nodejs_compat_v2`].filter(e=>!t.includes(`no_${e}`));return t.filter(e=>!n.includes(e))}a(yn,`stripRedundantNodejsCompatFlags`);function bn(e){return()=>{if(!(e.variableName in process.env)||process.env[e.variableName]===void 0)return typeof e.defaultValue==`function`?e.defaultValue():e.defaultValue;switch(process.env[e.variableName]?.toLowerCase()){case`true`:return!0;case`false`:return!1;default:throw new F(`Expected ${e.variableName} to be "true" or "false", but got ${JSON.stringify(process.env[e.variableName])}`,{telemetryMessage:!1})}}}a(bn,`getBooleanEnvironmentVariableFactory`);function xn({variableName:e,deprecatedName:t,choices:n,defaultValue:r}){let i=!1;return()=>e in process.env?Sn(e,n):t&&t in process.env?(i||(i=!0,console.warn(`Using "${t}" environment variable. This is deprecated. Please use "${e}", instead.`)),Sn(t,n)):r?.()}a(xn,`getEnvironmentVariableFactory`);function Sn(e,t){return Cn(t,process.env[e]),process.env[e]}a(Sn,`getProcessEnv`);function Cn(e,t){if(Array.isArray(e)&&!e.includes(t))throw new F(`Expected ${JSON.stringify(t)} to be one of ${JSON.stringify(e)}`,{telemetryMessage:!1})}a(Cn,`assertOneOf`);var wn=xn({variableName:`WRANGLER_DOCKER_BIN`,defaultValue(){return`docker`}});function Tn(e){return s.statSync(e,{throwIfNoEntry:!1})?.isDirectory()??!1}a(Tn,`isDirectory`);function En(e,{fireAndForget:t=!1}={}){let n=s.promises.rm(e,{recursive:!0,force:!0,maxRetries:5,retryDelay:100});if(t)n.catch(()=>{});else return n}a(En,`removeDir`);function Dn(e){s.rmSync(e,{recursive:!0,force:!0,maxRetries:5,retryDelay:100})}a(Dn,`removeDirSync`);function On(){return/^win/i.test(process.platform)}a(On,`isWindows`);function kn(){return/^darwin$/i.test(process.platform)}a(kn,`isMacOS`);function An(e){return!!e}a(An,`isNonEmpty`);function jn(e){return process.env[e]}a(jn,`getEnv`);function Mn(e){return e?S.normalize(S.join(e,`.`)):void 0}a(Mn,`normalizePath`);function Nn(){return On()?Mn([O.homedir(),jn(`USERPROFILE`),jn(`HOME`),jn(`HOMEDRIVE`)||jn(`HOMEPATH`)?S.join(jn(`HOMEDRIVE`)??``,jn(`HOMEPATH`)??``):void 0].find(An)):Mn(O.homedir()||jn(`HOME`))}a(Nn,`homeDir`);function Pn(e,t){return e?S.join(e,...t):void 0}a(Pn,`joinToBase`);function Fn(){if(On()){let e=[()=>O.tmpdir(),()=>jn(`TEMP`),()=>jn(`TMP`),()=>Pn(jn(`LOCALAPPDATA`),[`Temp`]),()=>Pn(Nn(),[`AppData`,`Local`,`Temp`]),()=>Pn(jn(`ALLUSERSPROFILE`),[`Temp`]),()=>Pn(jn(`SystemRoot`),[`Temp`]),()=>Pn(jn(`windir`),[`Temp`]),()=>Pn(jn(`SystemDrive`),[`\\`,`Temp`])].find(e=>An(e()));return e&&Mn(e())||`C:\\Temp`}return Mn([O.tmpdir(),jn(`TMPDIR`),jn(`TEMP`),jn(`TMP`)].find(An))||`/tmp`}a(Fn,`tempDir`);function In(){return Nn()||Fn()}a(In,`baseDir`);function Ln(e,t){return e||S.join(...t)}a(Ln,`valOrPath`);function Rn(){return Ln(jn(`APPDATA`),[In(),`AppData`,`Roaming`])}a(Rn,`windowsAppData`);function zn(){return Ln(jn(`LOCALAPPDATA`),[In(),`AppData`,`Local`])}a(zn,`windowsLocalAppData`);function Bn(){return kn()?Ln(jn(`XDG_CONFIG_HOME`),[In(),`Library`,`Preferences`]):On()?Ln(jn(`XDG_CONFIG_HOME`),[Rn(),`xdg.config`]):Ln(jn(`XDG_CONFIG_HOME`),[In(),`.config`])}a(Bn,`xdgConfig`);function Vn(){return kn()?Ln(jn(`XDG_CACHE_HOME`),[In(),`Library`,`Caches`]):On()?Ln(jn(`XDG_CACHE_HOME`),[zn(),`xdg.cache`]):Ln(jn(`XDG_CACHE_HOME`),[In(),`.cache`])}a(Vn,`xdgCache`);function Hn(e){let t=S.parse(e).name;return{config:a(()=>S.join(Bn(),t),`config`),cache:a(()=>S.join(Vn(),t),`cache`)}}a(Hn,`xdgAppPaths`);function Un({appName:e=`wrangler`,leadingDot:t=!0,useLegacyHomeDir:n=!0}={}){let r=`${t?`.`:``}${e}`,i=Hn(r).config();if(n){let e=S.join(O.homedir(),r);if(Tn(e))return e}return i}a(Un,`getGlobalConfigPath`);function Wn(){return Hn(`.wrangler`).cache()}a(Wn,`getGlobalWranglerCachePath`),xn({variableName:`WRANGLER_C3_COMMAND`,defaultValue:a(()=>`create cloudflare`,`defaultValue`)});var Gn=xn({variableName:`DO_NOT_TRACK`});function Kn(){let e=Gn()?.toLowerCase();return e===`1`||e===`true`}a(Kn,`isDoNotTrackEnabled`);var qn=bn({variableName:`WRANGLER_SEND_METRICS`});function Jn(){return Kn()?!1:qn()}a(Jn,`getWranglerSendMetricsFromEnv`);var Yn=xn({variableName:`WRANGLER_API_ENVIRONMENT`,defaultValue:a(()=>`production`,`defaultValue`),choices:[`production`,`staging`]}),Xn={compliance_region:`public`},Zn={compliance_region:void 0},Qn=xn({variableName:`CLOUDFLARE_COMPLIANCE_REGION`,choices:[`public`,`fedramp_high`]}),$n=a(e=>{let t=Qn();if(t!==void 0&&e?.compliance_region!==void 0&&t!==e.compliance_region)throw new F(ie`
65
+ `,{telemetryMessage:!1});return{configPath:r,deployConfigPath:n,redirected:!0}}a(tn,`findRedirectedWranglerConfig`);function nn(e){return e.configPath!==void 0&&e.configPath!==e.userConfigPath}a(nn,`isRedirectedConfig`);function rn(e,t,n){return nn({configPath:t,userConfigPath:n})}a(rn,`isRedirectedRawConfig`);function an(e){return e?.endsWith(`toml`)?`toml`:e?.endsWith(`jsonc`)?`jsonc`:e?.endsWith(`json`)?`json`:`none`}a(an,`configFormat`);function on(e){switch(an(e)){case`toml`:return`wrangler.toml`;case`json`:return`wrangler.json`;case`jsonc`:return`wrangler.jsonc`;default:return`Wrangler configuration`}}a(on,`configFileName`);function sn(e,t,n=!0){return an(t)===`toml`?Ot.stringify(e):n?JSON.stringify(e,null,2):JSON.stringify(e)}a(sn,`formatConfigSnippet`);var cn=a(e=>e.endsWith(`.toml`)?jt(It(e),e):e.endsWith(`.json`)||e.endsWith(`.jsonc`)?Pt(It(e),e):{},`parseRawConfigFile`),ln=a((e,t={})=>{let{configPath:n,userConfigPath:r,deployConfigPath:i,redirected:a}=$t(e,t);return{rawConfig:cn(n??``),configPath:n,userConfigPath:r,deployConfigPath:i,redirected:a}},`experimental_readRawConfig`),un=`2026-09-21`;function dn(e){}a(dn,`assertNever`);function fn(e){return e.filter(e=>e.type!==`secret_text`).reduce((e,t)=>{switch(t.type){case`plain_text`:e.vars={...e.vars??{},[t.name]:t.text};break;case`json`:e.vars={...e.vars??{},[t.name]:t.json};break;case`kv_namespace`:e.kv_namespaces=[...e.kv_namespaces??[],{id:t.namespace_id,binding:t.name}];break;case`durable_object_namespace`:e.durable_objects={bindings:[...e.durable_objects?.bindings??[],{name:t.name,class_name:t.class_name,script_name:t.script_name,environment:t.environment}]};break;case`d1`:e.d1_databases=[...e.d1_databases??[],{binding:t.name,database_id:t.id}];break;case`browser`:e.browser={binding:t.name};break;case`ai`:e.ai={binding:t.name};break;case`images`:e.images={binding:t.name};break;case`stream`:e.stream={binding:t.name};break;case`media`:e.media={binding:t.name};break;case`r2_bucket`:e.r2_buckets=[...e.r2_buckets??[],{binding:t.name,bucket_name:t.bucket_name,jurisdiction:t.jurisdiction}];break;case`secrets_store_secret`:e.secrets_store_secrets=[...e.secrets_store_secrets??[],{binding:t.name,store_id:t.store_id,secret_name:t.secret_name}];break;case`artifacts`:e.artifacts=[...e.artifacts??[],{binding:t.name,namespace:t.namespace}];break;case`unsafe_hello_world`:e.unsafe_hello_world=[...e.unsafe_hello_world??[],{binding:t.name,enable_timer:t.enable_timer}];break;case`flagship`:e.flagship=[...e.flagship??[],{binding:t.name,app_id:t.app_id}];break;case`service`:e.services=[...e.services??[],{binding:t.name,service:t.service,environment:t.environment,entrypoint:t.entrypoint}];break;case`analytics_engine`:e.analytics_engine_datasets=[...e.analytics_engine_datasets??[],{binding:t.name,dataset:t.dataset}];break;case`dispatch_namespace`:e.dispatch_namespaces=[...e.dispatch_namespaces??[],{binding:t.name,namespace:t.namespace,...t.outbound&&{outbound:{service:t.outbound.worker.service,environment:t.outbound.worker.environment,parameters:t.outbound.params?.map(e=>e.name)??[]}}}];break;case`logfwdr`:e.logfwdr={bindings:[...e.logfwdr?.bindings??[],{name:t.name,destination:t.destination}]};break;case`wasm_module`:e.wasm_modules={...e.wasm_modules??{},[t.name]:t.part};break;case`text_blob`:e.text_blobs={...e.text_blobs??{},[t.name]:t.part};break;case`data_blob`:e.data_blobs={...e.data_blobs??{},[t.name]:t.part};break;case`secret_text`:break;case`version_metadata`:e.version_metadata={binding:t.name};break;case`send_email`:e.send_email=[...e.send_email??[],{name:t.name,destination_address:t.destination_address,allowed_destination_addresses:t.allowed_destination_addresses,allowed_sender_addresses:t.allowed_sender_addresses}];break;case`queue`:e.queues??={producers:[]},e.queues.producers=[...e.queues.producers??[],{binding:t.name,queue:t.queue_name,delivery_delay:t.delivery_delay}];break;case`vectorize`:e.vectorize=[...e.vectorize??[],{binding:t.name,index_name:t.index_name}];break;case`ai_search_namespace`:e.ai_search_namespaces=[...e.ai_search_namespaces??[],{binding:t.name,namespace:t.namespace}];break;case`ai_search`:e.ai_search=[...e.ai_search??[],{binding:t.name,instance_name:t.instance_name}];break;case`agent_memory`:e.agent_memory=[...e.agent_memory??[],{binding:t.name,namespace:t.namespace}];break;case`hyperdrive`:e.hyperdrive=[...e.hyperdrive??[],{binding:t.name,id:t.id}];break;case`mtls_certificate`:e.mtls_certificates=[...e.mtls_certificates??[],{binding:t.name,certificate_id:t.certificate_id}];break;case`pipelines`:e.pipelines=[...e.pipelines??[],{binding:t.name,...t.stream&&{stream:t.stream},...t.pipeline&&{pipeline:t.pipeline}}];break;case`assets`:e.assets={binding:t.name};break;case`inherit`:e.unsafe={bindings:[...e.unsafe?.bindings??[],t],metadata:e.unsafe?.metadata??void 0};break;case`workflow`:e.workflows=[...e.workflows??[],{binding:t.name,name:t.workflow_name,class_name:t.class_name,script_name:t.script_name}];break;case`worker_loader`:e.worker_loaders=[...e.worker_loaders??[],{binding:t.name}];break;case`ratelimit`:e.ratelimits=[...e.ratelimits??[],{name:t.name,namespace_id:t.namespace_id,simple:{limit:t.simple.limit,period:t.simple.period}}];break;case`vpc_service`:e.vpc_services=[...e.vpc_services??[],{binding:t.name,service_id:t.service_id}];break;case`vpc_network`:t.tunnel_id===void 0?t.network_id!==void 0&&(e.vpc_networks=[...e.vpc_networks??[],{binding:t.name,network_id:t.network_id}]):e.vpc_networks=[...e.vpc_networks??[],{binding:t.name,tunnel_id:t.tunnel_id}];break;default:e.unsafe={bindings:[...e.unsafe?.bindings??[],t],metadata:e.unsafe?.metadata??void 0}}return e},{})}a(fn,`mapWorkerMetadataBindings`);function pn(e){let t=fn(e.bindings),n=e.bindings.filter(t=>t.type===`durable_object_namespace`&&t.script_name===e.name).map(e=>e.class_name),r=[...e.routes.map(e=>({pattern:e.pattern,zone_name:e.zone_name})),...e.domains.map(e=>({pattern:e.hostname,zone_name:e.zone_name,custom_domain:!0,enabled:e.enabled,previews_enabled:e.previews_enabled}))];return{name:e.name,main:e.entrypoint,workers_dev:e.subdomain.enabled,preview_urls:e.subdomain.previews_enabled,compatibility_date:e.compatibility_date??`2026-09-21`,compatibility_flags:e.compatibility_flags,...r.length?{routes:r}:{},placement:e.placement?.mode===`smart`?{mode:`smart`}:void 0,limits:e.limits,...n.length&&e.migration_tag?{migrations:[{tag:e.migration_tag,new_classes:n}]}:{},...e.schedules.length?{triggers:{crons:e.schedules.map(e=>e.cron)}}:{},tail_consumers:e.tail_consumers??void 0,observability:e.observability,...t}}a(pn,`constructWranglerConfig`);function mn(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)}a(mn,`isCompatDate`);function hn(e){let t=e.toISOString().slice(0,10);return x(mn(t)),t}a(hn,`formatCompatibilityDate`);function gn(){return hn(new Date)}a(gn,`getTodaysCompatDate`);function _n(e){return e!==void 0&&e>=`2026-08-04`}a(_n,`isNodejsCompatDefaultOn`);function vn(e,t){let n=_n(e),r=t.includes(`nodejs_compat`)||n&&!t.includes(`no_nodejs_compat`);return{isNodejsCompatEnabled:r,isNodejsCompatV2Enabled:t.includes(`nodejs_compat_v2`)||!t.includes(`no_nodejs_compat_v2`)&&(n||r&&e>=`2024-09-23`)}}a(vn,`resolveNodejsCompat`);function yn(e,t){if(!_n(e))return t;let n=[`nodejs_compat`,`nodejs_compat_v2`].filter(e=>!t.includes(`no_${e}`));return t.filter(e=>!n.includes(e))}a(yn,`stripRedundantNodejsCompatFlags`);function bn(e){return()=>{if(!(e.variableName in process.env)||process.env[e.variableName]===void 0)return typeof e.defaultValue==`function`?e.defaultValue():e.defaultValue;switch(process.env[e.variableName]?.toLowerCase()){case`true`:return!0;case`false`:return!1;default:throw new F(`Expected ${e.variableName} to be "true" or "false", but got ${JSON.stringify(process.env[e.variableName])}`,{telemetryMessage:!1})}}}a(bn,`getBooleanEnvironmentVariableFactory`);function xn({variableName:e,deprecatedName:t,choices:n,defaultValue:r}){let i=!1;return()=>e in process.env?Sn(e,n):t&&t in process.env?(i||(i=!0,console.warn(`Using "${t}" environment variable. This is deprecated. Please use "${e}", instead.`)),Sn(t,n)):r?.()}a(xn,`getEnvironmentVariableFactory`);function Sn(e,t){return Cn(t,process.env[e]),process.env[e]}a(Sn,`getProcessEnv`);function Cn(e,t){if(Array.isArray(e)&&!e.includes(t))throw new F(`Expected ${JSON.stringify(t)} to be one of ${JSON.stringify(e)}`,{telemetryMessage:!1})}a(Cn,`assertOneOf`);var wn=xn({variableName:`WRANGLER_DOCKER_BIN`,defaultValue(){return`docker`}});function Tn(e){return l.statSync(e,{throwIfNoEntry:!1})?.isDirectory()??!1}a(Tn,`isDirectory`);function En(e,{fireAndForget:t=!1}={}){let n=l.promises.rm(e,{recursive:!0,force:!0,maxRetries:5,retryDelay:100});if(t)n.catch(()=>{});else return n}a(En,`removeDir`);function Dn(e){l.rmSync(e,{recursive:!0,force:!0,maxRetries:5,retryDelay:100})}a(Dn,`removeDirSync`);function On(){return/^win/i.test(process.platform)}a(On,`isWindows`);function kn(){return/^darwin$/i.test(process.platform)}a(kn,`isMacOS`);function An(e){return!!e}a(An,`isNonEmpty`);function jn(e){return process.env[e]}a(jn,`getEnv`);function Mn(e){return e?w.normalize(w.join(e,`.`)):void 0}a(Mn,`normalizePath`);function Nn(){return On()?Mn([A.homedir(),jn(`USERPROFILE`),jn(`HOME`),jn(`HOMEDRIVE`)||jn(`HOMEPATH`)?w.join(jn(`HOMEDRIVE`)??``,jn(`HOMEPATH`)??``):void 0].find(An)):Mn(A.homedir()||jn(`HOME`))}a(Nn,`homeDir`);function Pn(e,t){return e?w.join(e,...t):void 0}a(Pn,`joinToBase`);function Fn(){if(On()){let e=[()=>A.tmpdir(),()=>jn(`TEMP`),()=>jn(`TMP`),()=>Pn(jn(`LOCALAPPDATA`),[`Temp`]),()=>Pn(Nn(),[`AppData`,`Local`,`Temp`]),()=>Pn(jn(`ALLUSERSPROFILE`),[`Temp`]),()=>Pn(jn(`SystemRoot`),[`Temp`]),()=>Pn(jn(`windir`),[`Temp`]),()=>Pn(jn(`SystemDrive`),[`\\`,`Temp`])].find(e=>An(e()));return e&&Mn(e())||`C:\\Temp`}return Mn([A.tmpdir(),jn(`TMPDIR`),jn(`TEMP`),jn(`TMP`)].find(An))||`/tmp`}a(Fn,`tempDir`);function In(){return Nn()||Fn()}a(In,`baseDir`);function Ln(e,t){return e||w.join(...t)}a(Ln,`valOrPath`);function Rn(){return Ln(jn(`APPDATA`),[In(),`AppData`,`Roaming`])}a(Rn,`windowsAppData`);function zn(){return Ln(jn(`LOCALAPPDATA`),[In(),`AppData`,`Local`])}a(zn,`windowsLocalAppData`);function Bn(){return kn()?Ln(jn(`XDG_CONFIG_HOME`),[In(),`Library`,`Preferences`]):On()?Ln(jn(`XDG_CONFIG_HOME`),[Rn(),`xdg.config`]):Ln(jn(`XDG_CONFIG_HOME`),[In(),`.config`])}a(Bn,`xdgConfig`);function Vn(){return kn()?Ln(jn(`XDG_CACHE_HOME`),[In(),`Library`,`Caches`]):On()?Ln(jn(`XDG_CACHE_HOME`),[zn(),`xdg.cache`]):Ln(jn(`XDG_CACHE_HOME`),[In(),`.cache`])}a(Vn,`xdgCache`);function Hn(e){let t=w.parse(e).name;return{config:a(()=>w.join(Bn(),t),`config`),cache:a(()=>w.join(Vn(),t),`cache`)}}a(Hn,`xdgAppPaths`);function Un({appName:e=`wrangler`,leadingDot:t=!0,useLegacyHomeDir:n=!0}={}){let r=`${t?`.`:``}${e}`,i=Hn(r).config();if(n){let e=w.join(A.homedir(),r);if(Tn(e))return e}return i}a(Un,`getGlobalConfigPath`);function Wn(){return Hn(`.wrangler`).cache()}a(Wn,`getGlobalWranglerCachePath`),xn({variableName:`WRANGLER_C3_COMMAND`,defaultValue:a(()=>`create cloudflare`,`defaultValue`)});var Gn=xn({variableName:`DO_NOT_TRACK`});function Kn(){let e=Gn()?.toLowerCase();return e===`1`||e===`true`}a(Kn,`isDoNotTrackEnabled`);var qn=bn({variableName:`WRANGLER_SEND_METRICS`});function Jn(){return Kn()?!1:qn()}a(Jn,`getWranglerSendMetricsFromEnv`);var Yn=xn({variableName:`WRANGLER_API_ENVIRONMENT`,defaultValue:a(()=>`production`,`defaultValue`),choices:[`production`,`staging`]}),Xn={compliance_region:`public`},Zn={compliance_region:void 0},Qn=xn({variableName:`CLOUDFLARE_COMPLIANCE_REGION`,choices:[`public`,`fedramp_high`]}),$n=a(e=>{let t=Qn();if(t!==void 0&&e?.compliance_region!==void 0&&t!==e.compliance_region)throw new F(ie`
66
66
  The compliance region has been set to different values in two places:
67
67
  - \`CLOUDFLARE_COMPLIANCE_REGION\` environment variable: \`${t}\`
68
68
  - \`compliance_region\` configuration property: \`${e.compliance_region}\`
69
- `,{telemetryMessage:!1});return t||e?.compliance_region||`public`},`getCloudflareComplianceRegion`),er=xn({variableName:`CLOUDFLARE_API_BASE_URL`,deprecatedName:`CF_API_BASE_URL`}),tr=a(e=>er()??`https://api${nr(e)}${ir()}.cloudflare.com/client/v4`,`getCloudflareApiBaseUrl`);function nr(e){return $n(e)===`fedramp_high`?`.fed`:``}a(nr,`getComplianceRegionSubdomain`);function rr(e=Zn){return process.env.CLOUDFLARE_CONTAINER_REGISTRY?process.env.CLOUDFLARE_CONTAINER_REGISTRY:`${process.env.WRANGLER_API_ENVIRONMENT===`staging`?`staging.`:``}registry${nr(e)}.cloudflare.com`}a(rr,`getCloudflareContainerRegistry`);function ir(){return Yn()===`staging`?`.staging`:``}a(ir,`getStagingSubdomain`);var ar=bn({variableName:`WRANGLER_LOG_SANITIZE`,defaultValue:!0}),or=xn({variableName:`WRANGLER_OUTPUT_FILE_DIRECTORY`}),sr=xn({variableName:`WRANGLER_OUTPUT_FILE_PATH`}),cr=xn({variableName:`WRANGLER_CI_MATCH_TAG`}),lr=xn({variableName:`WRANGLER_CI_OVERRIDE_NAME`});xn({variableName:`WRANGLER_CI_OVERRIDE_NETWORK_MODE_HOST`}),xn({variableName:`WRANGLER_CI_GENERATE_PREVIEW_ALIAS`,defaultValue:a(()=>`false`,`defaultValue`),choices:[`true`,`false`]});var ur=xn({variableName:`WORKERS_CI_BRANCH`});xn({variableName:`WRANGLER_BUILD_CONDITIONS`}),xn({variableName:`WRANGLER_BUILD_PLATFORM`}),xn({variableName:`WRANGLER_REGISTRY_PATH`,defaultValue(){return S.join(Un(),`registry`)}}),xn({variableName:`WRANGLER_D1_EXTRA_LOCATION_CHOICES`});var dr=bn({variableName:`WRANGLER_DISABLE_SUBDOMAIN_MIXED_STATE_CHECK`,defaultValue:!1}),fr=xn({variableName:`WRANGLER_TRACE_ID`}),pr=xn({variableName:`CLOUDFLARE_ENV`});xn({variableName:`OPEN_NEXT_DEPLOY`}),xn({variableName:`CLOUDFLARE_CF_FETCH_PATH`});var mr=xn({variableName:`WRANGLER_CACHE_DIR`}),hr=xn({variableName:`CLOUDFLARED_PATH`});const gr=(e=0)=>t=>`\u001B[${t+e}m`,_r=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,vr=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,yr={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(yr.modifier);const br=Object.keys(yr.color),xr=Object.keys(yr.bgColor);[...br,...xr];function Sr(){let e=new Map;for(let[t,n]of Object.entries(yr)){for(let[t,r]of Object.entries(n))yr[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=yr[t],e.set(r[0],r[1]);Object.defineProperty(yr,t,{value:n,enumerable:!1})}return Object.defineProperty(yr,`codes`,{value:e,enumerable:!1}),yr.color.close=`\x1B[39m`,yr.bgColor.close=`\x1B[49m`,yr.color.ansi=gr(),yr.color.ansi256=_r(),yr.color.ansi16m=vr(),yr.bgColor.ansi=gr(10),yr.bgColor.ansi256=_r(10),yr.bgColor.ansi16m=vr(10),Object.defineProperties(yr,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>yr.rgbToAnsi256(...yr.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>yr.ansi256ToAnsi(yr.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>yr.ansi256ToAnsi(yr.hexToAnsi256(e)),enumerable:!1}}),yr}const Cr=Sr();function wr(e,t=globalThis.Deno?globalThis.Deno.args:A.argv){let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}const{env:Tr}=A;let Er;wr(`no-color`)||wr(`no-colors`)||wr(`color=false`)||wr(`color=never`)?Er=0:(wr(`color`)||wr(`colors`)||wr(`color=true`)||wr(`color=always`))&&(Er=1);function Dr(){if(`FORCE_COLOR`in Tr)return Tr.FORCE_COLOR===`true`?1:Tr.FORCE_COLOR===`false`?0:Tr.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Tr.FORCE_COLOR,10),3)}function Or(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function kr(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=Dr();r!==void 0&&(Er=r);let i=n?Er:r;if(i===0)return 0;if(n){if(wr(`color=16m`)||wr(`color=full`)||wr(`color=truecolor`))return 3;if(wr(`color=256`))return 2}if(`TF_BUILD`in Tr&&`AGENT_NAME`in Tr)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(Tr.TERM===`dumb`)return a;if(A.platform===`win32`){let e=O.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in Tr)return`GITHUB_ACTIONS`in Tr||`GITEA_ACTIONS`in Tr?3:[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in Tr)||Tr.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in Tr)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tr.TEAMCITY_VERSION);if(Tr.COLORTERM===`truecolor`||Tr.TERM===`xterm-kitty`)return 3;if(`TERM_PROGRAM`in Tr){let e=Number.parseInt((Tr.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(Tr.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(Tr.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Tr.TERM)||`COLORTERM`in Tr?1:a}function Ar(e,t={}){return Or(kr(e,{streamIsTTY:e&&e.isTTY,...t}))}const jr={stdout:Ar({isTTY:j.isatty(1)}),stderr:Ar({isTTY:j.isatty(2)})};function Mr(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.slice(a),o}function Nr(e,t,n,r){let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.slice(i,o?r-1:r)+t+(o?`\r
69
+ `,{telemetryMessage:!1});return t||e?.compliance_region||`public`},`getCloudflareComplianceRegion`),er=xn({variableName:`CLOUDFLARE_API_BASE_URL`,deprecatedName:`CF_API_BASE_URL`}),tr=a(e=>er()??`https://api${nr(e)}${ir()}.cloudflare.com/client/v4`,`getCloudflareApiBaseUrl`);function nr(e){return $n(e)===`fedramp_high`?`.fed`:``}a(nr,`getComplianceRegionSubdomain`);function rr(e=Zn){return process.env.CLOUDFLARE_CONTAINER_REGISTRY?process.env.CLOUDFLARE_CONTAINER_REGISTRY:`${process.env.WRANGLER_API_ENVIRONMENT===`staging`?`staging.`:``}registry${nr(e)}.cloudflare.com`}a(rr,`getCloudflareContainerRegistry`);function ir(){return Yn()===`staging`?`.staging`:``}a(ir,`getStagingSubdomain`);var ar=bn({variableName:`WRANGLER_LOG_SANITIZE`,defaultValue:!0}),or=xn({variableName:`WRANGLER_OUTPUT_FILE_DIRECTORY`}),sr=xn({variableName:`WRANGLER_OUTPUT_FILE_PATH`}),cr=xn({variableName:`WRANGLER_CI_MATCH_TAG`}),lr=xn({variableName:`WRANGLER_CI_OVERRIDE_NAME`});xn({variableName:`WRANGLER_CI_OVERRIDE_NETWORK_MODE_HOST`}),xn({variableName:`WRANGLER_CI_GENERATE_PREVIEW_ALIAS`,defaultValue:a(()=>`false`,`defaultValue`),choices:[`true`,`false`]});var ur=xn({variableName:`WORKERS_CI_BRANCH`});xn({variableName:`WRANGLER_BUILD_CONDITIONS`}),xn({variableName:`WRANGLER_BUILD_PLATFORM`}),xn({variableName:`WRANGLER_REGISTRY_PATH`,defaultValue(){return w.join(Un(),`registry`)}}),xn({variableName:`WRANGLER_D1_EXTRA_LOCATION_CHOICES`});var dr=bn({variableName:`WRANGLER_DISABLE_SUBDOMAIN_MIXED_STATE_CHECK`,defaultValue:!1}),fr=xn({variableName:`WRANGLER_TRACE_ID`}),pr=xn({variableName:`CLOUDFLARE_ENV`});xn({variableName:`OPEN_NEXT_DEPLOY`}),xn({variableName:`CLOUDFLARE_CF_FETCH_PATH`});var mr=xn({variableName:`WRANGLER_CACHE_DIR`}),hr=xn({variableName:`CLOUDFLARED_PATH`});const gr=(e=0)=>t=>`\u001B[${t+e}m`,_r=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,vr=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,yr={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(yr.modifier);const br=Object.keys(yr.color),xr=Object.keys(yr.bgColor);[...br,...xr];function Sr(){let e=new Map;for(let[t,n]of Object.entries(yr)){for(let[t,r]of Object.entries(n))yr[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=yr[t],e.set(r[0],r[1]);Object.defineProperty(yr,t,{value:n,enumerable:!1})}return Object.defineProperty(yr,`codes`,{value:e,enumerable:!1}),yr.color.close=`\x1B[39m`,yr.bgColor.close=`\x1B[49m`,yr.color.ansi=gr(),yr.color.ansi256=_r(),yr.color.ansi16m=vr(),yr.bgColor.ansi=gr(10),yr.bgColor.ansi256=_r(10),yr.bgColor.ansi16m=vr(10),Object.defineProperties(yr,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>yr.rgbToAnsi256(...yr.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>yr.ansi256ToAnsi(yr.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>yr.ansi256ToAnsi(yr.hexToAnsi256(e)),enumerable:!1}}),yr}const Cr=Sr();function wr(e,t=globalThis.Deno?globalThis.Deno.args:M.argv){let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}const{env:Tr}=M;let Er;wr(`no-color`)||wr(`no-colors`)||wr(`color=false`)||wr(`color=never`)?Er=0:(wr(`color`)||wr(`colors`)||wr(`color=true`)||wr(`color=always`))&&(Er=1);function Dr(){if(`FORCE_COLOR`in Tr)return Tr.FORCE_COLOR===`true`?1:Tr.FORCE_COLOR===`false`?0:Tr.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Tr.FORCE_COLOR,10),3)}function Or(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function kr(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=Dr();r!==void 0&&(Er=r);let i=n?Er:r;if(i===0)return 0;if(n){if(wr(`color=16m`)||wr(`color=full`)||wr(`color=truecolor`))return 3;if(wr(`color=256`))return 2}if(`TF_BUILD`in Tr&&`AGENT_NAME`in Tr)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(Tr.TERM===`dumb`)return a;if(M.platform===`win32`){let e=A.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in Tr)return`GITHUB_ACTIONS`in Tr||`GITEA_ACTIONS`in Tr?3:[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in Tr)||Tr.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in Tr)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tr.TEAMCITY_VERSION);if(Tr.COLORTERM===`truecolor`||Tr.TERM===`xterm-kitty`)return 3;if(`TERM_PROGRAM`in Tr){let e=Number.parseInt((Tr.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(Tr.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(Tr.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Tr.TERM)||`COLORTERM`in Tr?1:a}function Ar(e,t={}){return Or(kr(e,{streamIsTTY:e&&e.isTTY,...t}))}const jr={stdout:Ar({isTTY:N.isatty(1)}),stderr:Ar({isTTY:N.isatty(2)})};function Mr(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.slice(a),o}function Nr(e,t,n,r){let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.slice(i,o?r-1:r)+t+(o?`\r
70
70
  `:`
71
71
  `)+n,i=r+1,r=e.indexOf(`
72
72
  `,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:Pr,stderr:Fr}=jr,Ir=Symbol(`GENERATOR`),Lr=Symbol(`STYLER`),Rr=Symbol(`IS_EMPTY`),zr=[`ansi`,`ansi`,`ansi256`,`ansi16m`],Br=Object.create(null),Vr=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=Pr?Pr.level:0;e.level=t.level===void 0?n:t.level},Hr=e=>{let t=(...e)=>e.join(` `);return Vr(t,e),Object.setPrototypeOf(t,Ur.prototype),t};function Ur(e){return Hr(e)}Object.setPrototypeOf(Ur.prototype,Function.prototype);for(let[e,t]of Object.entries(Cr))Br[e]={get(){let n=qr(this,Kr(t.open,t.close,this[Lr]),this[Rr]);return Object.defineProperty(this,e,{value:n}),n}};Br.visible={get(){let e=qr(this,this[Lr],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const Wr=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?Cr[n].ansi16m(...r):t===`ansi256`?Cr[n].ansi256(Cr.rgbToAnsi256(...r)):Cr[n].ansi(Cr.rgbToAnsi(...r)):e===`hex`?Wr(`rgb`,t,n,...Cr.hexToRgb(...r)):Cr[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){Br[e]={get(){let{level:t}=this;return function(...n){let r=Kr(Wr(e,zr[t],`color`,...n),Cr.color.close,this[Lr]);return qr(this,r,this[Rr])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);Br[t]={get(){let{level:t}=this;return function(...n){let r=Kr(Wr(e,zr[t],`bgColor`,...n),Cr.bgColor.close,this[Lr]);return qr(this,r,this[Rr])}}}}const Gr=Object.defineProperties(()=>{},{...Br,level:{enumerable:!0,get(){return this[Ir].level},set(e){this[Ir].level=e}}}),Kr=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},qr=(e,t,n)=>{let r=(...e)=>Jr(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,Gr),r[Ir]=e,r[Lr]=t,r[Rr]=n,r},Jr=(e,t)=>{if(e.level<=0||!t)return e[Rr]?``:t;let n=e[Lr];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=Mr(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
@@ -172,7 +172,7 @@ Content-Type: ${s.type||`application/octet-stream`}\r\n\r\n`);a.push(e,s,o),type
172
172
  `)l=!1,d+=f(e,u,p),u=p;else if(!l&&a+s===`/*`){d+=e.slice(u,p),u=p,l=r,p++;continue}else if(l===r&&a+s===`*/`){p++,l=!1,d+=f(e,u,p+1),u=p+1;continue}}return d+(l?f(e.substr(u)):e.substr(u))}}}),ao=o({"../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(e){var t=r(`fs`),n=ro(),i=r(`path`),o=io(),s=e.parse=function(e){return/^\s*{/.test(e)?JSON.parse(o(e)):n.parse(e)},c=e.file=function(){var e=[].slice.call(arguments).filter(function(e){return e!=null});for(var n in e)if(typeof e[n]!=`string`)return;var r=i.join.apply(null,e);try{return t.readFileSync(r,`utf-8`)}catch{return}};e.json=function(){var e=c.apply(null,arguments);return e?s(e):null},e.env=function(e,t){t||=process.env;var n={},r=e.length;for(var i in t)if(i.toLowerCase().indexOf(e.toLowerCase())===0){for(var o=i.substring(r).split(`__`),s;(s=o.indexOf(``))>-1;)o.splice(s,1);var c=n;o.forEach(a(function(e,n){!e||typeof c!=`object`||(n===o.length-1&&(c[e]=t[i]),c[e]===void 0&&(c[e]={}),c=c[e])},`_buildSubObj`))}return n},e.find=function(){var e=i.join.apply(null,[].slice.call(arguments));function n(e,r){var a=i.join(e,r);try{return t.statSync(a),a}catch{if(i.dirname(e)!==e)return n(i.dirname(e),r)}}return a(n,`find`),n(process.cwd(),e)}}}),oo=o({"../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js"(e,t){function n(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp}a(n,`isSpecificValue`);function r(e){if(e instanceof Buffer){var t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);return e.copy(t),t}else if(e instanceof Date)return new Date(e.getTime());else if(e instanceof RegExp)return new RegExp(e);else throw Error(`Unexpected situation`)}a(r,`cloneSpecificValue`);function i(e){var t=[];return e.forEach(function(e,a){typeof e==`object`&&e?Array.isArray(e)?t[a]=i(e):n(e)?t[a]=r(e):t[a]=s({},e):t[a]=e}),t}a(i,`deepCloneArray`);function o(e,t){return t===`__proto__`?void 0:e[t]}a(o,`safeGetProperty`);var s=t.exports=function(){if(arguments.length<1||typeof arguments[0]!=`object`)return!1;if(arguments.length<2)return arguments[0];var e=arguments[0],t=Array.prototype.slice.call(arguments,1),a,c;return t.forEach(function(t){typeof t!=`object`||!t||Array.isArray(t)||Object.keys(t).forEach(function(l){if(c=o(e,l),a=o(t,l),a!==e)if(typeof a!=`object`||!a){e[l]=a;return}else if(Array.isArray(a)){e[l]=i(a);return}else if(n(a)){e[l]=r(a);return}else if(typeof c!=`object`||!c||Array.isArray(c)){e[l]=s({},a);return}else{e[l]=s(c,a);return}})}),e}}}),so=o({"../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js"(e,t){t.exports=function(e,t){t||={};var o={bools:{},strings:{},unknownFn:null};typeof t.unknown==`function`&&(o.unknownFn=t.unknown),typeof t.boolean==`boolean`&&t.boolean?o.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(e){o.bools[e]=!0});var s={};Object.keys(t.alias||{}).forEach(function(e){s[e]=[].concat(t.alias[e]),s[e].forEach(function(t){s[t]=[e].concat(s[e].filter(function(e){return t!==e}))})}),[].concat(t.string).filter(Boolean).forEach(function(e){o.strings[e]=!0,s[e]&&(o.strings[s[e]]=!0)});var c=t.default||{},l={_:[]};Object.keys(o.bools).forEach(function(e){f(e,c[e]===void 0?!1:c[e])});var u=[];e.indexOf(`--`)!==-1&&(u=e.slice(e.indexOf(`--`)+1),e=e.slice(0,e.indexOf(`--`)));function d(e,t){return o.allBools&&/^--[^=]+$/.test(t)||o.strings[e]||o.bools[e]||s[e]}a(d,`argDefined`);function f(e,t,n){if(!(n&&o.unknownFn&&!d(e,n)&&o.unknownFn(n)===!1)){var i=!o.strings[e]&&r(t)?Number(t):t;p(l,e.split(`.`),i),(s[e]||[]).forEach(function(e){p(l,e.split(`.`),i)})}}a(f,`setArg`);function p(e,t,n){for(var r=e,a=0;a<t.length-1;a++){var s=t[a];if(i(r,s))return;r[s]===void 0&&(r[s]={}),(r[s]===Object.prototype||r[s]===Number.prototype||r[s]===String.prototype)&&(r[s]={}),r[s]===Array.prototype&&(r[s]=[]),r=r[s]}var s=t[t.length-1];i(r,s)||((r===Object.prototype||r===Number.prototype||r===String.prototype)&&(r={}),r===Array.prototype&&(r=[]),r[s]===void 0||o.bools[s]||typeof r[s]==`boolean`?r[s]=n:Array.isArray(r[s])?r[s].push(n):r[s]=[r[s],n])}a(p,`setKey`);function m(e){return s[e].some(function(e){return o.bools[e]})}a(m,`aliasIsBoolean`);for(var h=0;h<e.length;h++){var g=e[h];if(/^--.+=/.test(g)){var _=g.match(/^--([^=]+)=([\s\S]*)$/),v=_[1],y=_[2];o.bools[v]&&(y=y!==`false`),f(v,y,g)}else if(/^--no-.+/.test(g)){var v=g.match(/^--no-(.+)/)[1];f(v,!1,g)}else if(/^--.+/.test(g)){var v=g.match(/^--(.+)/)[1],b=e[h+1];b!==void 0&&!/^-/.test(b)&&!o.bools[v]&&!o.allBools&&(!s[v]||!m(v))?(f(v,b,g),h++):/^(true|false)$/.test(b)?(f(v,b===`true`,g),h++):f(v,o.strings[v]?``:!0,g)}else if(/^-[^-]+/.test(g)){for(var x=g.slice(1,-1).split(``),S=!1,C=0;C<x.length;C++){var b=g.slice(C+2);if(b===`-`){f(x[C],b,g);continue}if(/[A-Za-z]/.test(x[C])&&/=/.test(b)){f(x[C],b.split(`=`)[1],g),S=!0;break}if(/[A-Za-z]/.test(x[C])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(b)){f(x[C],b,g),S=!0;break}if(x[C+1]&&x[C+1].match(/\W/)){f(x[C],g.slice(C+2),g),S=!0;break}else f(x[C],o.strings[x[C]]?``:!0,g)}var v=g.slice(-1)[0];!S&&v!==`-`&&(e[h+1]&&!/^(-|--)[^-]/.test(e[h+1])&&!o.bools[v]&&(!s[v]||!m(v))?(f(v,e[h+1],g),h++):e[h+1]&&/^(true|false)$/.test(e[h+1])?(f(v,e[h+1]===`true`,g),h++):f(v,o.strings[v]?``:!0,g))}else if((!o.unknownFn||o.unknownFn(g)!==!1)&&l._.push(o.strings._||!r(g)?g:Number(g)),t.stopEarly){l._.push.apply(l._,e.slice(h+1));break}}return Object.keys(c).forEach(function(e){n(l,e.split(`.`))||(p(l,e.split(`.`),c[e]),(s[e]||[]).forEach(function(t){p(l,t.split(`.`),c[e])}))}),t[`--`]?(l[`--`]=[],u.forEach(function(e){l[`--`].push(e)})):u.forEach(function(e){l._.push(e)}),l};function n(e,t){var n=e;return t.slice(0,-1).forEach(function(e){n=n[e]||{}}),t[t.length-1]in n}a(n,`hasKey`);function r(e){return typeof e==`number`||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}a(r,`isNumber`);function i(e,t){return t===`constructor`&&typeof e[t]==`function`||t===`__proto__`}a(i,`isConstructorOrProto`)}}),co=o({"../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js"(e,t){var n=ao(),i=r(`path`).join,o=oo(),s=`/etc`,c=process.platform===`win32`,l=c?process.env.USERPROFILE:process.env.HOME;t.exports=function(e,t,r,u){if(typeof e!=`string`)throw Error(`rc(name): name *must* be string`);r||=so()(process.argv.slice(2)),t=(typeof t==`string`?n.json(t):t)||{},u||=n.parse;var d=n.env(e+`_`),f=[t],p=[];function m(e){if(!(p.indexOf(e)>=0)){var t=n.file(e);t&&(f.push(u(t)),p.push(e))}}return a(m,`addConfigFile`),c||[i(s,e,`config`),i(s,e+`rc`)].forEach(m),l&&[i(l,`.config`,e,`config`),i(l,`.config`,e),i(l,`.`+e,`config`),i(l,`.`+e+`rc`)].forEach(m),m(n.find(`.`+e+`rc`)),d.config&&m(d.config),r.config&&m(r.config),o.apply(null,f.concat([d,r,p.length?{configs:p,config:p[p.length-1]}:void 0]))}}}),lo=o({"../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js"(e,t){t.exports=function(e){var t=co()(`npm`,{registry:`https://registry.npmjs.org/`}),n=t[e+`:registry`]||t.registry;return n.slice(-1)===`/`?n:n+`/`}}}),uo=o({"../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(e,t){var n=r(`buffer`),i=n.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}a(o,`copyProps`),i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s);function s(e,t,n){return i(e,t,n)}a(s,`SafeBuffer`),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return i(e,t,n)},s.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var r=i(e);return t===void 0?r.fill(0):typeof n==`string`?r.fill(t,n):r.fill(t),r},s.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return i(e)},s.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}}}),fo=o({"../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js"(e,t){var n=uo().Buffer;function r(e){return n.from(e,`base64`).toString(`utf8`)}a(r,`decodeBase64`);function i(e){return n.from(e,`utf8`).toString(`base64`)}a(i,`encodeBase64`),t.exports={decodeBase64:r,encodeBase64:i}}}),po=o({"../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js"(e,t){var n=r(`url`),i=fo(),o=i.decodeBase64,s=i.encodeBase64,c=`:_authToken`,l=`:username`,u=`:_password`;t.exports=function(){var e,t;return arguments.length>=2?(e=arguments[0],t=arguments[1]):typeof arguments[0]==`string`?e=arguments[0]:t=arguments[0],t||={},t.npmrc=t.npmrc||co()(`npm`,{registry:`https://registry.npmjs.org/`}),e||=t.npmrc.registry,d(e,t)||f(t.npmrc)};function d(e,t){for(var r=n.parse(e,!1,!0),i;i!==`/`&&r.pathname!==i;){i=r.pathname||`/`;var a=m(`//`+r.host+i.replace(/\/$/,``),t.npmrc);if(a)return a;if(!t.recursive)return/\/$/.test(e)?void 0:d(n.resolve(e,`.`),t);r.pathname=n.resolve(p(i),`..`)||`/`}}a(d,`getRegistryAuthInfo`);function f(e){if(e._auth)return{token:e._auth,type:`Basic`}}a(f,`getLegacyAuthInfo`);function p(e){return e[e.length-1]===`/`?e:e+`/`}a(p,`normalizePath`);function m(e,t){var n=h(t[e+c]||t[e+`/`+c]);if(n)return n;var r=g(t[e+l]||t[e+`/`+l],t[e+u]||t[e+`/`+u]);if(r)return r}a(m,`getAuthInfoForUrl`);function h(e){if(e)return{token:e.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]}),type:`Bearer`}}a(h,`getBearerToken`);function g(e,t){if(!(!e||!t)){var n=o(t.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]}));return{token:s(e+`:`+n),type:`Basic`,password:n,username:e}}}a(g,`getTokenForUsernameAndPassword`)}}),mo=o({"../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js"(e,t){var{URL:n}=r(`url`),{join:i}=r(`path`),o=r(`fs`),{promisify:s}=r(`util`),{tmpdir:c}=r(`os`),l=lo(),u=s(o.writeFile),d=s(o.mkdir),f=s(o.readFile),p=a((e,t)=>e.localeCompare(t,`en-US`,{numeric:!0}),`compareVersions`),m=a(e=>encodeURIComponent(e).replace(/^%40/,`@`),`encode`),h=a(async(e,t)=>{let n=i(c(),`update-check`);o.existsSync(n)||await d(n);let r=`${e.name}-${t}.json`;return e.scope&&(r=`${e.scope}-${r}`),i(n,r)},`getFile`),g=a(async(e,t,n)=>{if(o.existsSync(e)){let r=await f(e,`utf8`),{lastUpdate:i,latest:a}=JSON.parse(r);if(i+n>t)return{shouldCheck:!1,latest:a}}return{shouldCheck:!0,latest:null}},`evaluateCache`),_=a(async(e,t,n)=>{await u(e,JSON.stringify({latest:t,lastUpdate:n}),`utf8`)},`updateCache`),v=a((e,t)=>new Promise((n,i)=>{let a={host:e.hostname,path:e.pathname,port:e.port,headers:{accept:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`},timeout:2e3};t&&(a.headers.authorization=`${t.type} ${t.token}`);let{get:o}=e.protocol===`https:`?r(`https`):r(`http`);o(a,e=>{let{statusCode:t}=e;if(t!==200){let n=Error(`Request failed with code ${t}`);n.code=t,i(n),e.resume();return}let r=``;e.setEncoding(`utf8`),e.on(`data`,e=>{r+=e}),e.on(`end`,()=>{try{n(JSON.parse(r))}catch(e){i(e)}})}).on(`error`,i).on(`timeout`,i)}),`loadPackage`),y=a(async({full:e,scope:t},r)=>{let i=l(t),a=new n(e,i),o=null;try{o=await v(a)}catch(e){if(e.code&&String(e.code).startsWith(4))o=await v(a,po()(i,{recursive:!0}));else throw e}let s=o[`dist-tags`][r];if(!s)throw Error(`Distribution tag ${r} is not available`);return s},`getMostRecent`),b={interval:36e5,distTag:`latest`},x=a(e=>{let t={full:m(e)};if(e.includes(`/`)){let n=e.split(`/`);t.scope=n[0],t.name=n[1]}else t.scope=null,t.name=e;return t},`getDetails`);t.exports=async(e,t)=>{if(typeof e!=`object`)throw Error(`The first parameter should be your package.json file content`);let n=x(e.name),r=Date.now(),{distTag:i,interval:a}=Object.assign({},b,t),o=await h(n,i),s=null,c=!0;return{shouldCheck:c,latest:s}=await g(o,r,a),c&&(s=await y(n,i),await _(o,s,r)),p(e.version,s)===-1?{latest:s,fromCache:!c}:null}}}),ho=o({"../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js"(e,t){t.exports=typeof process==`object`&&process&&process.platform===`win32`?{sep:`\\`}:{sep:`/`}}}),go=o({"../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(e,t){t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}a(n,`balanced`);function r(e,t){var n=t.match(e);return n?n[0]:null}a(r,`maybeMatch`),n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}a(i,`range`)}}),_o=o({"../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(e,t){var n=go();t.exports=p;var r=`\0SLASH`+Math.random()+`\0`,i=`\0OPEN`+Math.random()+`\0`,o=`\0CLOSE`+Math.random()+`\0`,s=`\0COMMA`+Math.random()+`\0`,c=`\0PERIOD`+Math.random()+`\0`;function l(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}a(l,`numeric`);function u(e){return e.split(`\\\\`).join(r).split(`\\{`).join(i).split(`\\}`).join(o).split(`\\,`).join(s).split(`\\.`).join(c)}a(u,`escapeBraces`);function d(e){return e.split(r).join(`\\`).split(i).join(`{`).split(o).join(`}`).split(s).join(`,`).split(c).join(`.`)}a(d,`unescapeBraces`);function f(e){if(!e)return[``];var t=[],r=n(`{`,`}`,e);if(!r)return e.split(`,`);var i=r.pre,a=r.body,o=r.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=f(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}a(f,`parseCommaParts`);function p(e){return e?(e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),v(u(e),!0).map(d)):[]}a(p,`expandTop`);function m(e){return`{`+e+`}`}a(m,`embrace`);function h(e){return/^-?0\d/.test(e)}a(h,`isPadded`);function g(e,t){return e<=t}a(g,`lte`);function _(e,t){return e>=t}a(_,`gte`);function v(e,t){var r=[],i=n(`{`,`}`,e);if(!i)return[e];var a=i.pre,s=i.post.length?v(i.post,!1):[``];if(/\$$/.test(i.pre))for(var c=0;c<s.length;c++){var u=a+`{`+i.body+`}`+s[c];r.push(u)}else{var d=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),p=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),y=d||p,b=i.body.indexOf(`,`)>=0;if(!y&&!b)return i.post.match(/,.*\}/)?(e=i.pre+`{`+i.body+o+i.post,v(e)):[e];var x;if(y)x=i.body.split(/\.\./);else if(x=f(i.body),x.length===1&&(x=v(x[0],!1).map(m),x.length===1))return s.map(function(e){return i.pre+x[0]+e});var S;if(y){var C=l(x[0]),w=l(x[1]),T=Math.max(x[0].length,x[1].length),E=x.length==3?Math.abs(l(x[2])):1,D=g;w<C&&(E*=-1,D=_);var O=x.some(h);S=[];for(var k=C;D(k,w);k+=E){var A;if(p)A=String.fromCharCode(k),A===`\\`&&(A=``);else if(A=String(k),O){var j=T-A.length;if(j>0){var M=Array(j+1).join(`0`);A=k<0?`-`+M+A.slice(1):M+A}}S.push(A)}}else{S=[];for(var N=0;N<x.length;N++)S.push.apply(S,v(x[N],!1))}for(var N=0;N<S.length;N++)for(var c=0;c<s.length;c++){var u=a+S[N]+s[c];(!t||y||u)&&r.push(u)}}return r}a(v,`expand`)}}),vo=o({"../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js"(e,t){var n=t.exports=(e,t,n={})=>(y(t),!n.nocomment&&t.charAt(0)===`#`?!1:new T(t,n).match(e));t.exports=n;var r=ho();n.sep=r.sep;var i=Symbol(`globstar **`);n.GLOBSTAR=i;var o=_o(),s={"!":{open:`(?:(?!(?:`,close:`))[^/]*?)`},"?":{open:`(?:`,close:`)?`},"+":{open:`(?:`,close:`)+`},"*":{open:`(?:`,close:`)*`},"@":{open:`(?:`,close:`)`}},c=`[^/]`,l=c+`*?`,u=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,d=`(?:(?!(?:\\/|^)\\.).)*?`,f=a(e=>e.split(``).reduce((e,t)=>(e[t]=!0,e),{}),`charSet`),p=f(`().*{}+?[]^$\\!`),m=f(`[.(`),h=/\/+/;n.filter=(e,t={})=>(r,i,a)=>n(r,e,t);var g=a((e,t={})=>{let n={};return Object.keys(e).forEach(t=>n[t]=e[t]),Object.keys(t).forEach(e=>n[e]=t[e]),n},`ext`);n.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return n;let t=n,r=a((n,r,i)=>t(n,r,g(e,i)),`m`);return r.Minimatch=class extends t.Minimatch{static{a(this,`Minimatch`)}constructor(t,n){super(t,g(e,n))}},r.Minimatch.defaults=n=>t.defaults(g(e,n)).Minimatch,r.filter=(n,r)=>t.filter(n,g(e,r)),r.defaults=n=>t.defaults(g(e,n)),r.makeRe=(n,r)=>t.makeRe(n,g(e,r)),r.braceExpand=(n,r)=>t.braceExpand(n,g(e,r)),r.match=(n,r,i)=>t.match(n,r,g(e,i)),r},n.braceExpand=(e,t)=>_(e,t);var _=a((e,t={})=>(y(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:o(e)),`braceExpand`),v=1024*64,y=a(e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>v)throw TypeError(`pattern is too long`)},`assertValidPattern`),b=Symbol(`subparse`);n.makeRe=(e,t)=>new T(e,t||{}).makeRe(),n.match=(e,t,n={})=>{let r=new T(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};var x=a(e=>e.replace(/\\(.)/g,`$1`),`globUnescape`),S=a(e=>e.replace(/\\([^-\]])/g,`$1`),`charUnescape`),C=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),`regExpEscape`),w=a(e=>e.replace(/[[\]\\]/g,`\\$&`),`braExpEscape`),T=class{static{a(this,`Minimatch`)}constructor(e,t){y(e),t||={},this.options=t,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();let n=this.globSet=this.braceExpand();t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,n),n=this.globParts=n.map(e=>e.split(h)),this.debug(this.pattern,n),n=n.map((e,t,n)=>e.map(this.parse,this)),this.debug(this.pattern,n),n=n.filter(e=>e.indexOf(!1)===-1),this.debug(this.pattern,n),this.set=n}parseNegate(){if(this.options.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n){var r=this.options;this.debug(`matchOne`,{this:this,file:e,pattern:t}),this.debug(`matchOne`,e.length,t.length);for(var a=0,o=0,s=e.length,c=t.length;a<s&&o<c;a++,o++){this.debug(`matchOne loop`);var l=t[o],u=e[a];if(this.debug(t,l,u),l===!1)return!1;if(l===i){this.debug(`GLOBSTAR`,[t,l,u]);var d=a,f=o+1;if(f===c){for(this.debug(`** at the end`);a<s;a++)if(e[a]===`.`||e[a]===`..`||!r.dot&&e[a].charAt(0)===`.`)return!1;return!0}for(;d<s;){var p=e[d];if(this.debug(`
173
173
  globstar while`,e,d,t,f,p),this.matchOne(e.slice(d),t.slice(f),n))return this.debug(`globstar found match!`,d,s,p),!0;if(p===`.`||p===`..`||!r.dot&&p.charAt(0)===`.`){this.debug(`dot detected!`,e,d,t,f);break}this.debug(`globstar swallow a segment, and continue`),d++}return!!(n&&(this.debug(`
174
174
  >>> no match, partial?`,e,d,t,f),d===s))}var m;if(typeof l==`string`?(m=u===l,this.debug(`string match`,l,u,m)):(m=u.match(l),this.debug(`pattern match`,l,u,m)),!m)return!1}if(a===s&&o===c)return!0;if(a===s)return n;if(o===c)return a===s-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return _(this.pattern,this.options)}parse(e,t){y(e);let n=this.options;if(e===`**`)if(n.noglobstar)e=`*`;else return i;if(e===``)return``;let r=``,o=!1,u=!1,d=[],f=[],h,g=!1,_=-1,v=-1,C,T,E,D=e.charAt(0)===`.`,O=n.dot||D,k=a(()=>D?``:O?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,`patternStart`),A=a(e=>e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,`subPatternStart`),j=a(()=>{if(h){switch(h){case`*`:r+=l,o=!0;break;case`?`:r+=c,o=!0;break;default:r+=`\\`+h;break}this.debug(`clearStateChar %j %j`,h,r),h=!1}},`clearStateChar`);for(let t=0,i;t<e.length&&(i=e.charAt(t));t++){if(this.debug(`%s %s %s %j`,e,t,r,i),u){if(i===`/`)return!1;p[i]&&(r+=`\\`),r+=i,u=!1;continue}switch(i){case`/`:return!1;case`\\`:if(g&&e.charAt(t+1)===`-`){r+=i;continue}j(),u=!0;continue;case`?`:case`*`:case`+`:case`@`:case`!`:if(this.debug(`%s %s %s %j <-- stateChar`,e,t,r,i),g){this.debug(` in class`),i===`!`&&t===v+1&&(i=`^`),r+=i;continue}this.debug(`call clearStateChar %j`,h),j(),h=i,n.noext&&j();continue;case`(`:{if(g){r+=`(`;continue}if(!h){r+=`\\(`;continue}let n={type:h,start:t-1,reStart:r.length,open:s[h].open,close:s[h].close};this.debug(this.pattern,` `,n),d.push(n),r+=n.open,n.start===0&&n.type!==`!`&&(D=!0,r+=A(e.slice(t+1))),this.debug(`plType %j %j`,h,r),h=!1;continue}case`)`:{let e=d[d.length-1];if(g||!e){r+=`\\)`;continue}d.pop(),j(),o=!0,T=e,r+=T.close,T.type===`!`&&f.push(Object.assign(T,{reEnd:r.length}));continue}case`|`:{let n=d[d.length-1];if(g||!n){r+=`\\|`;continue}j(),r+=`|`,n.start===0&&n.type!==`!`&&(D=!0,r+=A(e.slice(t+1)));continue}case`[`:if(j(),g){r+=`\\`+i;continue}g=!0,v=t,_=r.length,r+=i;continue;case`]`:if(t===v+1||!g){r+=`\\`+i;continue}C=e.substring(v+1,t);try{RegExp(`[`+w(S(C))+`]`),r+=i}catch{r=r.substring(0,_)+`(?:$.)`}o=!0,g=!1;continue;default:j(),p[i]&&!(i===`^`&&g)&&(r+=`\\`),r+=i;break}}for(g&&(C=e.slice(v+1),E=this.parse(C,b),r=r.substring(0,_)+`\\[`+E[0],o||=E[1]),T=d.pop();T;T=d.pop()){let e;e=r.slice(T.reStart+T.open.length),this.debug(`setting tail`,r,T),e=e.replace(/((?:\\{2}){0,64})(\\?)\|/g,(e,t,n)=>(n||=`\\`,t+t+n+`|`)),this.debug(`tail=%j
175
- %s`,e,e,T,r);let t=T.type===`*`?l:T.type===`?`?c:`\\`+T.type;o=!0,r=r.slice(0,T.reStart)+t+`\\(`+e}j(),u&&(r+=`\\\\`);let M=m[r.charAt(0)];for(let e=f.length-1;e>-1;e--){let n=f[e],i=r.slice(0,n.reStart),a=r.slice(n.reStart,n.reEnd-8),o=r.slice(n.reEnd),s=r.slice(n.reEnd-8,n.reEnd)+o,c=i.split(`)`).length,l=i.split(`(`).length-c,u=o;for(let e=0;e<l;e++)u=u.replace(/\)[+*?]?/,``);o=u;let d=o===``&&t!==b?`(?:$|\\/)`:``;r=i+a+o+d+s}if(r!==``&&o&&(r=`(?=.)`+r),M&&(r=k()+r),t===b)return[r,o];if(n.nocase&&!o&&(o=e.toUpperCase()!==e.toLowerCase()),!o)return x(e);let N=n.nocase?`i`:``;try{return Object.assign(RegExp(`^`+r+`$`,N),{_glob:e,_src:r})}catch{return RegExp(`$.`)}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?l:t.dot?u:d,r=t.nocase?`i`:``,a=e.map(e=>(e=e.map(e=>typeof e==`string`?C(e):e===i?i:e._src).reduce((e,t)=>(e[e.length-1]===i&&t===i||e.push(t),e),[]),e.forEach((t,r)=>{t!==i||e[r-1]===i||(r===0?e.length>1?e[r+1]=`(?:\\/|`+n+`\\/)?`+e[r+1]:e[r]=n:r===e.length-1?e[r-1]+=`(?:\\/|`+n+`)?`:(e[r-1]+=`(?:\\/|\\/`+n+`\\/)`+e[r+1],e[r+1]=i))}),e.filter(e=>e!==i).join(`/`))).join(`|`);a=`^(?:`+a+`)$`,this.negate&&(a=`^(?!`+a+`).*$`);try{this.regexp=new RegExp(a,r)}catch{this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;r.sep!==`/`&&(e=e.split(r.sep).join(`/`)),e=e.split(h),this.debug(this.pattern,`split`,e);let i=this.set;this.debug(this.pattern,`set`,i);let a;for(let t=e.length-1;t>=0&&(a=e[t],!a);t--);for(let r=0;r<i.length;r++){let o=i[r],s=e;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return n.defaults(e).Minimatch}};n.Minimatch=T}}),yo=[`cf.artifacts.repo.created`,`cf.artifacts.repo.deleted`,`cf.artifacts.repo.forked`,`cf.artifacts.repo.imported`,`cf.artifacts.repo.pushed`,`cf.artifacts.repo.cloned`,`cf.artifacts.repo.fetched`,`cf.artifacts.repo.token.created`,`cf.artifacts.repo.token.revoked`],bo={configPath:void 0,userConfigPath:void 0,topLevelName:void 0,definedEnvironments:void 0,targetEnvironment:void 0,pages_build_output_dir:void 0,send_metrics:void 0,dependencies_instrumentation:void 0,dev:{ip:process.platform===`win32`?`127.0.0.1`:`localhost`,port:void 0,inspector_port:void 0,inspector_ip:void 0,local_protocol:`http`,upstream_protocol:`http`,host:void 0,enable_containers:!0,container_engine:void 0,generate_types:!1},name:void 0,compatibility_date:void 0,compatibility_flags:[],limits:void 0,placement:void 0,vars:{},durable_objects:{bindings:[]},kv_namespaces:[],queues:{producers:[],consumers:[]},connect:[],r2_buckets:[],d1_databases:[],vectorize:[],ai_search_namespaces:[],ai_search:[],agent_memory:[],hyperdrive:[],workflows:[],secrets_store_secrets:[],artifacts:[],services:[],analytics_engine_datasets:[],ai:void 0,images:void 0,stream:void 0,media:void 0,version_metadata:void 0,unsafe_hello_world:[],flagship:[],ratelimits:[],worker_loaders:[],site:void 0,wasm_modules:void 0,text_blobs:void 0,data_blobs:void 0,keep_vars:void 0,alias:void 0,addresses:void 0,account_id:void 0,main:void 0,find_additional_modules:void 0,preserve_file_names:void 0,base_dir:void 0,workers_dev:void 0,preview_urls:void 0,route:void 0,routes:void 0,tsconfig:void 0,jsx_factory:`React.createElement`,jsx_fragment:`React.Fragment`,migrations:[],exports:{},triggers:{crons:void 0},rules:[],build:{command:void 0,watch_dir:`./src`,cwd:void 0},no_bundle:void 0,minify:void 0,keep_names:void 0,dispatch_namespaces:[],first_party_worker:void 0,logfwdr:{bindings:[]},logpush:void 0,upload_source_maps:void 0,assets:void 0,observability:{enabled:!0},access:void 0,cache:void 0,compliance_region:void 0,python_modules:{exclude:[`**/*.pyc`]},previews:void 0,define:{},cloudchamber:{},containers:void 0,send_email:[],browser:void 0,unsafe:{},mtls_certificates:[],tail_consumers:void 0,streaming_tail_consumers:void 0,pipelines:[],vpc_services:[],vpc_networks:[]},xo=a((e,t,n=!0)=>{let r=It(e);if(e.endsWith(`toml`)){if(r.includes(`#`))throw new Co(`cannot patch .toml config if comments are present`);r=JSON.stringify(jt(r))}let i=[];So(t,i,n);for(let e of i){let t=e.pop(),i=We(r,e,t,{isArrayInsertion:n});r=Ge(r,i)}let a=Ue(r,void 0,{});return r=Ge(r,a),e.endsWith(`.toml`)&&(r=Ot.stringify(Pt(r))),v(e,r),r},`experimental_patchConfig`),So=a((e,t,n,r=[])=>{for(let[i,a]of Object.entries(e)){let e=[...r,i];Array.isArray(a)?(a.length===0&&!n&&t.push([...e,a]),a.forEach((r,i)=>{n?t.push([...e,-1,r]):typeof r==`object`&&r?So(r,t,n,[...e,i]):t.push([...e,i,r])})):typeof a==`object`&&a?Object.keys(a).length===0?n||t.push([...e,a]):So(a,t,n,e):t.push([...e,a])}},`getJSONPath`),Co=class extends Error{static{a(this,`PatchConfigError`)}},wo={};i(wo,{$brand:()=>Oo,$input:()=>Jp,$output:()=>qp,NEVER:()=>Do,TimePrecision:()=>Cm,ZodAny:()=>Xv,ZodArray:()=>oy,ZodBase64:()=>gv,ZodBase64URL:()=>vv,ZodBigInt:()=>zv,ZodBigIntFormat:()=>Vv,ZodBoolean:()=>Lv,ZodCIDRv4:()=>fv,ZodCIDRv6:()=>mv,ZodCUID:()=>X_,ZodCUID2:()=>Q_,ZodCatch:()=>tb,ZodCodec:()=>sb,ZodCustom:()=>xb,ZodCustomStringFormat:()=>wv,ZodDate:()=>iy,ZodDefault:()=>qy,ZodDiscriminatedUnion:()=>_y,ZodE164:()=>bv,ZodEmail:()=>P_,ZodEmoji:()=>K_,ZodEnum:()=>jy,ZodError:()=>m_,ZodExactOptional:()=>Hy,ZodFile:()=>Iy,ZodFirstPartyTypeKind:()=>Fb,ZodFunction:()=>yb,ZodGUID:()=>I_,ZodIPv4:()=>ov,ZodIPv6:()=>uv,ZodISODate:()=>s_,ZodISODateTime:()=>a_,ZodISODuration:()=>d_,ZodISOTime:()=>l_,ZodIntersection:()=>yy,ZodIssueCode:()=>Mb,ZodJWT:()=>Sv,ZodKSUID:()=>iv,ZodLazy:()=>hb,ZodLiteral:()=>Py,ZodMAC:()=>cv,ZodMap:()=>Dy,ZodNaN:()=>rb,ZodNanoID:()=>J_,ZodNever:()=>ey,ZodNonOptional:()=>Zy,ZodNull:()=>Jv,ZodNullable:()=>Wy,ZodNumber:()=>kv,ZodNumberFormat:()=>jv,ZodObject:()=>ly,ZodOptional:()=>By,ZodPipe:()=>ab,ZodPrefault:()=>Yy,ZodPreprocess:()=>ub,ZodPromise:()=>_b,ZodReadonly:()=>db,ZodRealError:()=>h_,ZodRecord:()=>Cy,ZodSet:()=>ky,ZodString:()=>j_,ZodStringFormat:()=>N_,ZodSuccess:()=>$y,ZodSymbol:()=>Wv,ZodTemplateLiteral:()=>pb,ZodTransform:()=>Ry,ZodTuple:()=>xy,ZodType:()=>K,ZodULID:()=>ev,ZodURL:()=>U_,ZodUUID:()=>R_,ZodUndefined:()=>Kv,ZodUnion:()=>py,ZodUnknown:()=>Qv,ZodVoid:()=>ny,ZodXID:()=>nv,ZodXor:()=>hy,_ZodString:()=>A_,_default:()=>Jy,_function:()=>bb,any:()=>Zv,array:()=>sy,base64:()=>_v,base64url:()=>yv,bigint:()=>Bv,boolean:()=>Rv,catch:()=>nb,check:()=>Sb,cidrv4:()=>pv,cidrv6:()=>hv,clone:()=>fs,codec:()=>cb,coerce:()=>Hb,config:()=>Mo,core:()=>To,cuid:()=>Z_,cuid2:()=>$_,custom:()=>Cb,date:()=>ay,decode:()=>x_,decodeAsync:()=>C_,describe:()=>Eb,discriminatedUnion:()=>vy,e164:()=>xv,email:()=>F_,emoji:()=>q_,encode:()=>b_,encodeAsync:()=>S_,endsWith:()=>_h,enum:()=>My,exactOptional:()=>Uy,file:()=>Ly,flattenError:()=>Us,float32:()=>Nv,float64:()=>Pv,formatError:()=>Ws,fromJSONSchema:()=>Vb,function:()=>bb,getErrorMap:()=>Pb,globalRegistry:()=>Zp,gt:()=>$m,gte:()=>eh,guid:()=>L_,hash:()=>Ov,hex:()=>Dv,hostname:()=>Ev,httpUrl:()=>G_,includes:()=>hh,instanceof:()=>Ob,int:()=>Mv,int32:()=>Fv,int64:()=>Hv,intersection:()=>by,invertCodec:()=>lb,ipv4:()=>sv,ipv6:()=>dv,iso:()=>i_,json:()=>Ab,jwt:()=>Cv,keyof:()=>cy,ksuid:()=>av,lazy:()=>gb,length:()=>dh,literal:()=>Fy,locales:()=>Wd,looseObject:()=>fy,looseRecord:()=>Ey,lowercase:()=>ph,lt:()=>Zm,lte:()=>Qm,mac:()=>lv,map:()=>Oy,maxLength:()=>lh,maxSize:()=>oh,meta:()=>Db,mime:()=>yh,minLength:()=>uh,minSize:()=>sh,multipleOf:()=>ah,nan:()=>ib,nanoid:()=>Y_,nativeEnum:()=>Ny,negative:()=>nh,never:()=>ty,nonnegative:()=>ih,nonoptional:()=>Qy,nonpositive:()=>rh,normalize:()=>xh,null:()=>Yv,nullable:()=>Gy,nullish:()=>Ky,number:()=>Av,object:()=>uy,optional:()=>Vy,overwrite:()=>bh,parse:()=>g_,parseAsync:()=>__,partialRecord:()=>Ty,pipe:()=>ob,positive:()=>th,prefault:()=>Xy,preprocess:()=>jb,prettifyError:()=>qs,promise:()=>vb,property:()=>vh,readonly:()=>fb,record:()=>wy,refine:()=>wb,regex:()=>fh,regexes:()=>vc,registry:()=>Xp,safeDecode:()=>T_,safeDecodeAsync:()=>D_,safeEncode:()=>w_,safeEncodeAsync:()=>E_,safeParse:()=>v_,safeParseAsync:()=>y_,set:()=>Ay,setErrorMap:()=>Nb,size:()=>ch,slugify:()=>Th,startsWith:()=>gh,strictObject:()=>dy,string:()=>M_,stringFormat:()=>Tv,stringbool:()=>kb,success:()=>eb,superRefine:()=>Tb,symbol:()=>Gv,templateLiteral:()=>mb,toJSONSchema:()=>$g,toLowerCase:()=>Ch,toUpperCase:()=>wh,transform:()=>zy,treeifyError:()=>Gs,trim:()=>Sh,tuple:()=>Sy,uint32:()=>Iv,uint64:()=>Uv,ulid:()=>tv,undefined:()=>qv,union:()=>my,unknown:()=>$v,uppercase:()=>mh,url:()=>W_,util:()=>No,uuid:()=>z_,uuidv4:()=>B_,uuidv6:()=>V_,uuidv7:()=>H_,void:()=>ry,xid:()=>rv,xor:()=>gy});var To={};i(To,{$ZodAny:()=>zu,$ZodArray:()=>Gu,$ZodAsyncError:()=>ko,$ZodBase64:()=>wu,$ZodBase64URL:()=>Eu,$ZodBigInt:()=>Pu,$ZodBigIntFormat:()=>Fu,$ZodBoolean:()=>Nu,$ZodCIDRv4:()=>xu,$ZodCIDRv6:()=>Su,$ZodCUID:()=>lu,$ZodCUID2:()=>uu,$ZodCatch:()=>Od,$ZodCheck:()=>kl,$ZodCheckBigIntFormat:()=>Fl,$ZodCheckEndsWith:()=>Jl,$ZodCheckGreaterThan:()=>Ml,$ZodCheckIncludes:()=>Kl,$ZodCheckLengthEquals:()=>Vl,$ZodCheckLessThan:()=>jl,$ZodCheckLowerCase:()=>Wl,$ZodCheckMaxLength:()=>zl,$ZodCheckMaxSize:()=>Il,$ZodCheckMimeType:()=>Zl,$ZodCheckMinLength:()=>Bl,$ZodCheckMinSize:()=>Ll,$ZodCheckMultipleOf:()=>Nl,$ZodCheckNumberFormat:()=>Pl,$ZodCheckOverwrite:()=>Ql,$ZodCheckProperty:()=>Xl,$ZodCheckRegex:()=>Ul,$ZodCheckSizeEquals:()=>Rl,$ZodCheckStartsWith:()=>ql,$ZodCheckStringFormat:()=>Hl,$ZodCheckUpperCase:()=>Gl,$ZodCodec:()=>Md,$ZodCustom:()=>Hd,$ZodCustomStringFormat:()=>Au,$ZodDate:()=>Uu,$ZodDefault:()=>Sd,$ZodDiscriminatedUnion:()=>td,$ZodE164:()=>Du,$ZodEmail:()=>au,$ZodEmoji:()=>su,$ZodEncodeError:()=>Ao,$ZodEnum:()=>md,$ZodError:()=>Vs,$ZodExactOptional:()=>bd,$ZodFile:()=>gd,$ZodFunction:()=>zd,$ZodGUID:()=>ru,$ZodIPv4:()=>vu,$ZodIPv6:()=>yu,$ZodISODate:()=>hu,$ZodISODateTime:()=>mu,$ZodISODuration:()=>_u,$ZodISOTime:()=>gu,$ZodIntersection:()=>nd,$ZodJWT:()=>ku,$ZodKSUID:()=>pu,$ZodLazy:()=>Vd,$ZodLiteral:()=>hd,$ZodMAC:()=>bu,$ZodMap:()=>ud,$ZodNaN:()=>kd,$ZodNanoID:()=>cu,$ZodNever:()=>Vu,$ZodNonOptional:()=>Td,$ZodNull:()=>Ru,$ZodNullable:()=>xd,$ZodNumber:()=>ju,$ZodNumberFormat:()=>Mu,$ZodObject:()=>Yu,$ZodObjectJIT:()=>Xu,$ZodOptional:()=>yd,$ZodPipe:()=>Ad,$ZodPrefault:()=>wd,$ZodPreprocess:()=>Fd,$ZodPromise:()=>Bd,$ZodReadonly:()=>Id,$ZodRealError:()=>Hs,$ZodRecord:()=>ld,$ZodRegistry:()=>Yp,$ZodSet:()=>fd,$ZodString:()=>tu,$ZodStringFormat:()=>nu,$ZodSuccess:()=>Dd,$ZodSymbol:()=>Iu,$ZodTemplateLiteral:()=>Rd,$ZodTransform:()=>_d,$ZodTuple:()=>ad,$ZodType:()=>G,$ZodULID:()=>du,$ZodURL:()=>ou,$ZodUUID:()=>iu,$ZodUndefined:()=>Lu,$ZodUnion:()=>Qu,$ZodUnknown:()=>Bu,$ZodVoid:()=>Hu,$ZodXID:()=>fu,$ZodXor:()=>ed,$brand:()=>Oo,$constructor:()=>B,$input:()=>Jp,$output:()=>qp,Doc:()=>$l,JSONSchema:()=>t_,JSONSchemaGenerator:()=>e_,NEVER:()=>Do,TimePrecision:()=>Cm,_any:()=>Wm,_array:()=>Eh,_base64:()=>ym,_base64url:()=>bm,_bigint:()=>Lm,_boolean:()=>Fm,_catch:()=>Gh,_check:()=>eg,_cidrv4:()=>_m,_cidrv6:()=>vm,_coercedBigint:()=>Rm,_coercedBoolean:()=>Im,_coercedDate:()=>Ym,_coercedNumber:()=>km,_coercedString:()=>$p,_cuid:()=>lm,_cuid2:()=>um,_custom:()=>Zh,_date:()=>Jm,_decode:()=>ic,_decodeAsync:()=>cc,_default:()=>Hh,_discriminatedUnion:()=>kh,_e164:()=>xm,_email:()=>em,_emoji:()=>sm,_encode:()=>nc,_encodeAsync:()=>oc,_endsWith:()=>_h,_enum:()=>Fh,_file:()=>Rh,_float32:()=>jm,_float64:()=>Mm,_gt:()=>$m,_gte:()=>eh,_guid:()=>tm,_includes:()=>hh,_int:()=>Am,_int32:()=>Nm,_int64:()=>zm,_intersection:()=>Ah,_ipv4:()=>mm,_ipv6:()=>hm,_isoDate:()=>Tm,_isoDateTime:()=>wm,_isoDuration:()=>Dm,_isoTime:()=>Em,_jwt:()=>Sm,_ksuid:()=>pm,_lazy:()=>Yh,_length:()=>dh,_literal:()=>Lh,_lowercase:()=>ph,_lt:()=>Zm,_lte:()=>Qm,_mac:()=>gm,_map:()=>Nh,_max:()=>Qm,_maxLength:()=>lh,_maxSize:()=>oh,_mime:()=>yh,_min:()=>eh,_minLength:()=>uh,_minSize:()=>sh,_multipleOf:()=>ah,_nan:()=>Xm,_nanoid:()=>cm,_nativeEnum:()=>Ih,_negative:()=>nh,_never:()=>Km,_nonnegative:()=>ih,_nonoptional:()=>Uh,_nonpositive:()=>rh,_normalize:()=>xh,_null:()=>Um,_nullable:()=>Vh,_number:()=>Om,_optional:()=>Bh,_overwrite:()=>bh,_parse:()=>Js,_parseAsync:()=>Xs,_pipe:()=>Kh,_positive:()=>th,_promise:()=>Xh,_property:()=>vh,_readonly:()=>qh,_record:()=>Mh,_refine:()=>Qh,_regex:()=>fh,_safeDecode:()=>fc,_safeDecodeAsync:()=>gc,_safeEncode:()=>uc,_safeEncodeAsync:()=>mc,_safeParse:()=>Qs,_safeParseAsync:()=>ec,_set:()=>Ph,_size:()=>ch,_slugify:()=>Th,_startsWith:()=>gh,_string:()=>Qp,_stringFormat:()=>ig,_stringbool:()=>rg,_success:()=>Wh,_superRefine:()=>$h,_symbol:()=>Vm,_templateLiteral:()=>Jh,_toLowerCase:()=>Ch,_toUpperCase:()=>wh,_transform:()=>zh,_trim:()=>Sh,_tuple:()=>jh,_uint32:()=>Pm,_uint64:()=>Bm,_ulid:()=>dm,_undefined:()=>Hm,_union:()=>Dh,_unknown:()=>Gm,_uppercase:()=>mh,_url:()=>om,_uuid:()=>nm,_uuidv4:()=>rm,_uuidv6:()=>im,_uuidv7:()=>am,_void:()=>qm,_xid:()=>fm,_xor:()=>Oh,clone:()=>fs,config:()=>Mo,createStandardJSONSchemaMethod:()=>dg,createToJSONSchemaMethod:()=>ug,decode:()=>ac,decodeAsync:()=>lc,describe:()=>tg,encode:()=>rc,encodeAsync:()=>sc,extractDefs:()=>sg,finalize:()=>cg,flattenError:()=>Us,formatError:()=>Ws,globalConfig:()=>jo,globalRegistry:()=>Zp,initializeContext:()=>ag,isValidBase64:()=>Cu,isValidBase64URL:()=>Tu,isValidJWT:()=>Ou,locales:()=>Wd,meta:()=>ng,parse:()=>Ys,parseAsync:()=>Zs,prettifyError:()=>qs,process:()=>og,regexes:()=>vc,registry:()=>Xp,safeDecode:()=>pc,safeDecodeAsync:()=>_c,safeEncode:()=>dc,safeEncodeAsync:()=>hc,safeParse:()=>$s,safeParseAsync:()=>tc,toDotPath:()=>Ks,toJSONSchema:()=>$g,treeifyError:()=>Gs,util:()=>No,version:()=>eu});var Eo,Do=Object.freeze({status:`aborted`});function B(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=s.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}a(r,`init`);let i=n?.Parent??Object;class o extends i{static{a(this,`Definition`)}}Object.defineProperty(o,`name`,{value:e});function s(e){var t;let i=n?.Parent?new o:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return a(s,`_`),Object.defineProperty(s,`init`,{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a(t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e),`value`)}),Object.defineProperty(s,`name`,{value:e}),s}a(B,`$constructor`);var Oo=Symbol(`zod_brand`),ko=class extends Error{static{a(this,`$ZodAsyncError`)}constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ao=class extends Error{static{a(this,`$ZodEncodeError`)}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Eo=globalThis).__zod_globalConfig??(Eo.__zod_globalConfig={});var jo=globalThis.__zod_globalConfig;function Mo(e){return e&&Object.assign(jo,e),jo}a(Mo,`config`);var No={};i(No,{BIGINT_FORMAT_RANGES:()=>gs,Class:()=>zs,NUMBER_FORMAT_RANGES:()=>hs,aborted:()=>ws,allowsEval:()=>is,assert:()=>Ro,assertEqual:()=>Po,assertIs:()=>Io,assertNever:()=>Lo,assertNotEqual:()=>Fo,assignProp:()=>Jo,base64ToUint8Array:()=>Ns,base64urlToUint8Array:()=>Fs,cached:()=>Vo,captureStackTrace:()=>ns,cleanEnum:()=>Ms,cleanRegex:()=>Uo,clone:()=>fs,cloneDef:()=>Xo,createTransparentProxy:()=>ps,defineLazy:()=>Ko,esc:()=>es,escapeRegex:()=>ds,explicitlyAborted:()=>Ts,extend:()=>ys,finalizeIssue:()=>Os,floatSafeRemainder:()=>Wo,getElementAtPath:()=>Zo,getEnumValues:()=>zo,getLengthableOrigin:()=>As,getParsedType:()=>cs,getSizableOrigin:()=>ks,hexToUint8Array:()=>Ls,isObject:()=>rs,isPlainObject:()=>as,issue:()=>js,joinValues:()=>V,jsonStringifyReplacer:()=>Bo,merge:()=>xs,mergeDefs:()=>Yo,normalizeParams:()=>H,nullish:()=>Ho,numKeys:()=>ss,objectClone:()=>qo,omit:()=>vs,optionalKeys:()=>ms,parsedType:()=>W,partial:()=>Ss,pick:()=>_s,prefixIssues:()=>Es,primitiveTypes:()=>us,promiseAllObject:()=>Qo,propertyKeyTypes:()=>ls,randomString:()=>$o,required:()=>Cs,safeExtend:()=>bs,shallowClone:()=>os,slugify:()=>ts,stringifyPrimitive:()=>U,uint8ArrayToBase64:()=>Ps,uint8ArrayToBase64url:()=>Is,uint8ArrayToHex:()=>Rs,unwrapMessage:()=>Ds});function Po(e){return e}a(Po,`assertEqual`);function Fo(e){return e}a(Fo,`assertNotEqual`);function Io(e){}a(Io,`assertIs`);function Lo(e){throw Error(`Unexpected value in exhaustive check`)}a(Lo,`assertNever`);function Ro(e){}a(Ro,`assert`);function zo(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}a(zo,`getEnumValues`);function V(e,t=`|`){return e.map(e=>U(e)).join(t)}a(V,`joinValues`);function Bo(e,t){return typeof t==`bigint`?t.toString():t}a(Bo,`jsonStringifyReplacer`);function Vo(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}}}}a(Vo,`cached`);function Ho(e){return e==null}a(Ho,`nullish`);function Uo(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}a(Uo,`cleanRegex`);function Wo(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}a(Wo,`floatSafeRemainder`);var Go=Symbol(`evaluating`);function Ko(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Go)return r===void 0&&(r=Go,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}a(Ko,`defineLazy`);function qo(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}a(qo,`objectClone`);function Jo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}a(Jo,`assignProp`);function Yo(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}a(Yo,`mergeDefs`);function Xo(e){return Yo(e._zod.def)}a(Xo,`cloneDef`);function Zo(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}a(Zo,`getElementAtPath`);function Qo(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}a(Qo,`promiseAllObject`);function $o(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}a($o,`randomString`);function es(e){return JSON.stringify(e)}a(es,`esc`);function ts(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}a(ts,`slugify`);var ns=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function rs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}a(rs,`isObject`);var is=Vo(()=>{if(jo.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function as(e){if(rs(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(rs(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}a(as,`isPlainObject`);function os(e){return as(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}a(os,`shallowClone`);function ss(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}a(ss,`numKeys`);var cs=a(e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},`getParsedType`),ls=new Set([`string`,`number`,`symbol`]),us=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function ds(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}a(ds,`escapeRegex`);function fs(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}a(fs,`clone`);function H(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:a(()=>t,`error`)};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:a(()=>t.error,`error`)}:t}a(H,`normalizeParams`);function ps(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}a(ps,`createTransparentProxy`);function U(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}a(U,`stringifyPrimitive`);function ms(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}a(ms,`optionalKeys`);var hs={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},gs={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function _s(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return fs(e,Yo(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Jo(this,`shape`,e),e},checks:[]}))}a(_s,`pick`);function vs(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return fs(e,Yo(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Jo(this,`shape`,r),r},checks:[]}))}a(vs,`omit`);function ys(e,t){if(!as(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return fs(e,Yo(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jo(this,`shape`,n),n}}))}a(ys,`extend`);function bs(e,t){if(!as(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return fs(e,Yo(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jo(this,`shape`,n),n}}))}a(bs,`safeExtend`);function xs(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return fs(e,Yo(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Jo(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}a(xs,`merge`);function Ss(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return fs(t,Yo(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Jo(this,`shape`,i),i},checks:[]}))}a(Ss,`partial`);function Cs(e,t,n){return fs(t,Yo(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Jo(this,`shape`,i),i}}))}a(Cs,`required`);function ws(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}a(ws,`aborted`);function Ts(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}a(Ts,`explicitlyAborted`);function Es(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}a(Es,`prefixIssues`);function Ds(e){return typeof e==`string`?e:e?.message}a(Ds,`unwrapMessage`);function Os(e,t,n){let r=e.message?e.message:Ds(e.inst?._zod.def?.error?.(e))??Ds(t?.error?.(e))??Ds(n.customError?.(e))??Ds(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}a(Os,`finalizeIssue`);function ks(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}a(ks,`getSizableOrigin`);function As(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}a(As,`getLengthableOrigin`);function W(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}a(W,`parsedType`);function js(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}a(js,`issue`);function Ms(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(Ms,`cleanEnum`);function Ns(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}a(Ns,`base64ToUint8Array`);function Ps(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}a(Ps,`uint8ArrayToBase64`);function Fs(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return Ns(t+`=`.repeat((4-t.length%4)%4))}a(Fs,`base64urlToUint8Array`);function Is(e){return Ps(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}a(Is,`uint8ArrayToBase64url`);function Ls(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}a(Ls,`hexToUint8Array`);function Rs(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}a(Rs,`uint8ArrayToHex`);var zs=class{static{a(this,`Class`)}constructor(...e){}},Bs=a((e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Bo,2),Object.defineProperty(e,`toString`,{value:a(()=>e.message,`value`),enumerable:!1})},`initializer`),Vs=B(`$ZodError`,Bs),Hs=B(`$ZodError`,Bs,{Parent:Error});function Us(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}a(Us,`flattenError`);function Ws(e,t=e=>e.message){let n={_errors:[]},r=a((e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}},`processError`);return r(e),n}a(Ws,`formatError`);function Gs(e,t=e=>e.message){let n={errors:[]},r=a((e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if(s.code===`invalid_key`)r({issues:s.issues},[...i,...s.path]);else if(s.code===`invalid_element`)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}},`processError`);return r(e),n}a(Gs,`treeifyError`);function Ks(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}a(Ks,`toDotPath`);function qs(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`\u2716 ${e.message}`),e.path?.length&&t.push(` \u2192 at ${Ks(e.path)}`);return t.join(`
175
+ %s`,e,e,T,r);let t=T.type===`*`?l:T.type===`?`?c:`\\`+T.type;o=!0,r=r.slice(0,T.reStart)+t+`\\(`+e}j(),u&&(r+=`\\\\`);let M=m[r.charAt(0)];for(let e=f.length-1;e>-1;e--){let n=f[e],i=r.slice(0,n.reStart),a=r.slice(n.reStart,n.reEnd-8),o=r.slice(n.reEnd),s=r.slice(n.reEnd-8,n.reEnd)+o,c=i.split(`)`).length,l=i.split(`(`).length-c,u=o;for(let e=0;e<l;e++)u=u.replace(/\)[+*?]?/,``);o=u;let d=o===``&&t!==b?`(?:$|\\/)`:``;r=i+a+o+d+s}if(r!==``&&o&&(r=`(?=.)`+r),M&&(r=k()+r),t===b)return[r,o];if(n.nocase&&!o&&(o=e.toUpperCase()!==e.toLowerCase()),!o)return x(e);let N=n.nocase?`i`:``;try{return Object.assign(RegExp(`^`+r+`$`,N),{_glob:e,_src:r})}catch{return RegExp(`$.`)}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?l:t.dot?u:d,r=t.nocase?`i`:``,a=e.map(e=>(e=e.map(e=>typeof e==`string`?C(e):e===i?i:e._src).reduce((e,t)=>(e[e.length-1]===i&&t===i||e.push(t),e),[]),e.forEach((t,r)=>{t!==i||e[r-1]===i||(r===0?e.length>1?e[r+1]=`(?:\\/|`+n+`\\/)?`+e[r+1]:e[r]=n:r===e.length-1?e[r-1]+=`(?:\\/|`+n+`)?`:(e[r-1]+=`(?:\\/|\\/`+n+`\\/)`+e[r+1],e[r+1]=i))}),e.filter(e=>e!==i).join(`/`))).join(`|`);a=`^(?:`+a+`)$`,this.negate&&(a=`^(?!`+a+`).*$`);try{this.regexp=new RegExp(a,r)}catch{this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;r.sep!==`/`&&(e=e.split(r.sep).join(`/`)),e=e.split(h),this.debug(this.pattern,`split`,e);let i=this.set;this.debug(this.pattern,`set`,i);let a;for(let t=e.length-1;t>=0&&(a=e[t],!a);t--);for(let r=0;r<i.length;r++){let o=i[r],s=e;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return n.defaults(e).Minimatch}};n.Minimatch=T}}),yo=[`cf.artifacts.repo.created`,`cf.artifacts.repo.deleted`,`cf.artifacts.repo.forked`,`cf.artifacts.repo.imported`,`cf.artifacts.repo.pushed`,`cf.artifacts.repo.cloned`,`cf.artifacts.repo.fetched`,`cf.artifacts.repo.token.created`,`cf.artifacts.repo.token.revoked`],bo={configPath:void 0,userConfigPath:void 0,topLevelName:void 0,definedEnvironments:void 0,targetEnvironment:void 0,pages_build_output_dir:void 0,send_metrics:void 0,dependencies_instrumentation:void 0,dev:{ip:process.platform===`win32`?`127.0.0.1`:`localhost`,port:void 0,inspector_port:void 0,inspector_ip:void 0,local_protocol:`http`,upstream_protocol:`http`,host:void 0,enable_containers:!0,container_engine:void 0,generate_types:!1},name:void 0,compatibility_date:void 0,compatibility_flags:[],limits:void 0,placement:void 0,vars:{},durable_objects:{bindings:[]},kv_namespaces:[],queues:{producers:[],consumers:[]},connect:[],r2_buckets:[],d1_databases:[],vectorize:[],ai_search_namespaces:[],ai_search:[],agent_memory:[],hyperdrive:[],workflows:[],secrets_store_secrets:[],artifacts:[],services:[],analytics_engine_datasets:[],ai:void 0,images:void 0,stream:void 0,media:void 0,version_metadata:void 0,unsafe_hello_world:[],flagship:[],ratelimits:[],worker_loaders:[],site:void 0,wasm_modules:void 0,text_blobs:void 0,data_blobs:void 0,keep_vars:void 0,alias:void 0,addresses:void 0,account_id:void 0,main:void 0,find_additional_modules:void 0,preserve_file_names:void 0,base_dir:void 0,workers_dev:void 0,preview_urls:void 0,route:void 0,routes:void 0,tsconfig:void 0,jsx_factory:`React.createElement`,jsx_fragment:`React.Fragment`,migrations:[],exports:{},triggers:{crons:void 0},rules:[],build:{command:void 0,watch_dir:`./src`,cwd:void 0},no_bundle:void 0,minify:void 0,keep_names:void 0,dispatch_namespaces:[],first_party_worker:void 0,logfwdr:{bindings:[]},logpush:void 0,upload_source_maps:void 0,assets:void 0,observability:{enabled:!0},access:void 0,cache:void 0,compliance_region:void 0,python_modules:{exclude:[`**/*.pyc`]},previews:void 0,define:{},cloudchamber:{},containers:void 0,send_email:[],browser:void 0,unsafe:{},mtls_certificates:[],tail_consumers:void 0,streaming_tail_consumers:void 0,pipelines:[],vpc_services:[],vpc_networks:[]},xo=a((e,t,n=!0)=>{let r=It(e);if(e.endsWith(`toml`)){if(r.includes(`#`))throw new Co(`cannot patch .toml config if comments are present`);r=JSON.stringify(jt(r))}let i=[];So(t,i,n);for(let e of i){let t=e.pop(),i=We(r,e,t,{isArrayInsertion:n});r=Ge(r,i)}let a=Ue(r,void 0,{});return r=Ge(r,a),e.endsWith(`.toml`)&&(r=Ot.stringify(Pt(r))),b(e,r),r},`experimental_patchConfig`),So=a((e,t,n,r=[])=>{for(let[i,a]of Object.entries(e)){let e=[...r,i];Array.isArray(a)?(a.length===0&&!n&&t.push([...e,a]),a.forEach((r,i)=>{n?t.push([...e,-1,r]):typeof r==`object`&&r?So(r,t,n,[...e,i]):t.push([...e,i,r])})):typeof a==`object`&&a?Object.keys(a).length===0?n||t.push([...e,a]):So(a,t,n,e):t.push([...e,a])}},`getJSONPath`),Co=class extends Error{static{a(this,`PatchConfigError`)}},wo={};i(wo,{$brand:()=>Oo,$input:()=>Jp,$output:()=>qp,NEVER:()=>Do,TimePrecision:()=>Cm,ZodAny:()=>Xv,ZodArray:()=>oy,ZodBase64:()=>gv,ZodBase64URL:()=>vv,ZodBigInt:()=>zv,ZodBigIntFormat:()=>Vv,ZodBoolean:()=>Lv,ZodCIDRv4:()=>fv,ZodCIDRv6:()=>mv,ZodCUID:()=>X_,ZodCUID2:()=>Q_,ZodCatch:()=>tb,ZodCodec:()=>sb,ZodCustom:()=>xb,ZodCustomStringFormat:()=>wv,ZodDate:()=>iy,ZodDefault:()=>qy,ZodDiscriminatedUnion:()=>_y,ZodE164:()=>bv,ZodEmail:()=>P_,ZodEmoji:()=>K_,ZodEnum:()=>jy,ZodError:()=>m_,ZodExactOptional:()=>Hy,ZodFile:()=>Iy,ZodFirstPartyTypeKind:()=>Fb,ZodFunction:()=>yb,ZodGUID:()=>I_,ZodIPv4:()=>ov,ZodIPv6:()=>uv,ZodISODate:()=>s_,ZodISODateTime:()=>a_,ZodISODuration:()=>d_,ZodISOTime:()=>l_,ZodIntersection:()=>yy,ZodIssueCode:()=>Mb,ZodJWT:()=>Sv,ZodKSUID:()=>iv,ZodLazy:()=>hb,ZodLiteral:()=>Py,ZodMAC:()=>cv,ZodMap:()=>Dy,ZodNaN:()=>rb,ZodNanoID:()=>J_,ZodNever:()=>ey,ZodNonOptional:()=>Zy,ZodNull:()=>Jv,ZodNullable:()=>Wy,ZodNumber:()=>kv,ZodNumberFormat:()=>jv,ZodObject:()=>ly,ZodOptional:()=>By,ZodPipe:()=>ab,ZodPrefault:()=>Yy,ZodPreprocess:()=>ub,ZodPromise:()=>_b,ZodReadonly:()=>db,ZodRealError:()=>h_,ZodRecord:()=>Cy,ZodSet:()=>ky,ZodString:()=>j_,ZodStringFormat:()=>N_,ZodSuccess:()=>$y,ZodSymbol:()=>Wv,ZodTemplateLiteral:()=>pb,ZodTransform:()=>Ry,ZodTuple:()=>xy,ZodType:()=>K,ZodULID:()=>ev,ZodURL:()=>U_,ZodUUID:()=>R_,ZodUndefined:()=>Kv,ZodUnion:()=>py,ZodUnknown:()=>Qv,ZodVoid:()=>ny,ZodXID:()=>nv,ZodXor:()=>hy,_ZodString:()=>A_,_default:()=>Jy,_function:()=>bb,any:()=>Zv,array:()=>sy,base64:()=>_v,base64url:()=>yv,bigint:()=>Bv,boolean:()=>Rv,catch:()=>nb,check:()=>Sb,cidrv4:()=>pv,cidrv6:()=>hv,clone:()=>fs,codec:()=>cb,coerce:()=>Hb,config:()=>Mo,core:()=>To,cuid:()=>Z_,cuid2:()=>$_,custom:()=>Cb,date:()=>ay,decode:()=>x_,decodeAsync:()=>C_,describe:()=>Eb,discriminatedUnion:()=>vy,e164:()=>xv,email:()=>F_,emoji:()=>q_,encode:()=>b_,encodeAsync:()=>S_,endsWith:()=>_h,enum:()=>My,exactOptional:()=>Uy,file:()=>Ly,flattenError:()=>Us,float32:()=>Nv,float64:()=>Pv,formatError:()=>Ws,fromJSONSchema:()=>Vb,function:()=>bb,getErrorMap:()=>Pb,globalRegistry:()=>Zp,gt:()=>$m,gte:()=>eh,guid:()=>L_,hash:()=>Ov,hex:()=>Dv,hostname:()=>Ev,httpUrl:()=>G_,includes:()=>hh,instanceof:()=>Ob,int:()=>Mv,int32:()=>Fv,int64:()=>Hv,intersection:()=>by,invertCodec:()=>lb,ipv4:()=>sv,ipv6:()=>dv,iso:()=>i_,json:()=>Ab,jwt:()=>Cv,keyof:()=>cy,ksuid:()=>av,lazy:()=>gb,length:()=>dh,literal:()=>Fy,locales:()=>Wd,looseObject:()=>fy,looseRecord:()=>Ey,lowercase:()=>ph,lt:()=>Zm,lte:()=>Qm,mac:()=>lv,map:()=>Oy,maxLength:()=>lh,maxSize:()=>oh,meta:()=>Db,mime:()=>yh,minLength:()=>uh,minSize:()=>sh,multipleOf:()=>ah,nan:()=>ib,nanoid:()=>Y_,nativeEnum:()=>Ny,negative:()=>nh,never:()=>ty,nonnegative:()=>ih,nonoptional:()=>Qy,nonpositive:()=>rh,normalize:()=>xh,null:()=>Yv,nullable:()=>Gy,nullish:()=>Ky,number:()=>Av,object:()=>uy,optional:()=>Vy,overwrite:()=>bh,parse:()=>g_,parseAsync:()=>__,partialRecord:()=>Ty,pipe:()=>ob,positive:()=>th,prefault:()=>Xy,preprocess:()=>jb,prettifyError:()=>qs,promise:()=>vb,property:()=>vh,readonly:()=>fb,record:()=>wy,refine:()=>wb,regex:()=>fh,regexes:()=>vc,registry:()=>Xp,safeDecode:()=>T_,safeDecodeAsync:()=>D_,safeEncode:()=>w_,safeEncodeAsync:()=>E_,safeParse:()=>v_,safeParseAsync:()=>y_,set:()=>Ay,setErrorMap:()=>Nb,size:()=>ch,slugify:()=>Th,startsWith:()=>gh,strictObject:()=>dy,string:()=>M_,stringFormat:()=>Tv,stringbool:()=>kb,success:()=>eb,superRefine:()=>Tb,symbol:()=>Gv,templateLiteral:()=>mb,toJSONSchema:()=>$g,toLowerCase:()=>Ch,toUpperCase:()=>wh,transform:()=>zy,treeifyError:()=>Gs,trim:()=>Sh,tuple:()=>Sy,uint32:()=>Iv,uint64:()=>Uv,ulid:()=>tv,undefined:()=>qv,union:()=>my,unknown:()=>$v,uppercase:()=>mh,url:()=>W_,util:()=>No,uuid:()=>z_,uuidv4:()=>B_,uuidv6:()=>V_,uuidv7:()=>H_,void:()=>ry,xid:()=>rv,xor:()=>gy});var To={};i(To,{$ZodAny:()=>zu,$ZodArray:()=>Gu,$ZodAsyncError:()=>ko,$ZodBase64:()=>wu,$ZodBase64URL:()=>Eu,$ZodBigInt:()=>Pu,$ZodBigIntFormat:()=>Fu,$ZodBoolean:()=>Nu,$ZodCIDRv4:()=>xu,$ZodCIDRv6:()=>Su,$ZodCUID:()=>lu,$ZodCUID2:()=>uu,$ZodCatch:()=>Od,$ZodCheck:()=>kl,$ZodCheckBigIntFormat:()=>Fl,$ZodCheckEndsWith:()=>Jl,$ZodCheckGreaterThan:()=>Ml,$ZodCheckIncludes:()=>Kl,$ZodCheckLengthEquals:()=>Vl,$ZodCheckLessThan:()=>jl,$ZodCheckLowerCase:()=>Wl,$ZodCheckMaxLength:()=>zl,$ZodCheckMaxSize:()=>Il,$ZodCheckMimeType:()=>Zl,$ZodCheckMinLength:()=>Bl,$ZodCheckMinSize:()=>Ll,$ZodCheckMultipleOf:()=>Nl,$ZodCheckNumberFormat:()=>Pl,$ZodCheckOverwrite:()=>Ql,$ZodCheckProperty:()=>Xl,$ZodCheckRegex:()=>Ul,$ZodCheckSizeEquals:()=>Rl,$ZodCheckStartsWith:()=>ql,$ZodCheckStringFormat:()=>Hl,$ZodCheckUpperCase:()=>Gl,$ZodCodec:()=>Md,$ZodCustom:()=>Hd,$ZodCustomStringFormat:()=>Au,$ZodDate:()=>Uu,$ZodDefault:()=>Sd,$ZodDiscriminatedUnion:()=>td,$ZodE164:()=>Du,$ZodEmail:()=>au,$ZodEmoji:()=>su,$ZodEncodeError:()=>Ao,$ZodEnum:()=>md,$ZodError:()=>Vs,$ZodExactOptional:()=>bd,$ZodFile:()=>gd,$ZodFunction:()=>zd,$ZodGUID:()=>ru,$ZodIPv4:()=>vu,$ZodIPv6:()=>yu,$ZodISODate:()=>hu,$ZodISODateTime:()=>mu,$ZodISODuration:()=>_u,$ZodISOTime:()=>gu,$ZodIntersection:()=>nd,$ZodJWT:()=>ku,$ZodKSUID:()=>pu,$ZodLazy:()=>Vd,$ZodLiteral:()=>hd,$ZodMAC:()=>bu,$ZodMap:()=>ud,$ZodNaN:()=>kd,$ZodNanoID:()=>cu,$ZodNever:()=>Vu,$ZodNonOptional:()=>Td,$ZodNull:()=>Ru,$ZodNullable:()=>xd,$ZodNumber:()=>ju,$ZodNumberFormat:()=>Mu,$ZodObject:()=>Yu,$ZodObjectJIT:()=>Xu,$ZodOptional:()=>yd,$ZodPipe:()=>Ad,$ZodPrefault:()=>wd,$ZodPreprocess:()=>Fd,$ZodPromise:()=>Bd,$ZodReadonly:()=>Id,$ZodRealError:()=>Hs,$ZodRecord:()=>ld,$ZodRegistry:()=>Yp,$ZodSet:()=>fd,$ZodString:()=>tu,$ZodStringFormat:()=>nu,$ZodSuccess:()=>Dd,$ZodSymbol:()=>Iu,$ZodTemplateLiteral:()=>Rd,$ZodTransform:()=>_d,$ZodTuple:()=>ad,$ZodType:()=>G,$ZodULID:()=>du,$ZodURL:()=>ou,$ZodUUID:()=>iu,$ZodUndefined:()=>Lu,$ZodUnion:()=>Qu,$ZodUnknown:()=>Bu,$ZodVoid:()=>Hu,$ZodXID:()=>fu,$ZodXor:()=>ed,$brand:()=>Oo,$constructor:()=>B,$input:()=>Jp,$output:()=>qp,Doc:()=>$l,JSONSchema:()=>t_,JSONSchemaGenerator:()=>e_,NEVER:()=>Do,TimePrecision:()=>Cm,_any:()=>Wm,_array:()=>Eh,_base64:()=>ym,_base64url:()=>bm,_bigint:()=>Lm,_boolean:()=>Fm,_catch:()=>Gh,_check:()=>eg,_cidrv4:()=>_m,_cidrv6:()=>vm,_coercedBigint:()=>Rm,_coercedBoolean:()=>Im,_coercedDate:()=>Ym,_coercedNumber:()=>km,_coercedString:()=>$p,_cuid:()=>lm,_cuid2:()=>um,_custom:()=>Zh,_date:()=>Jm,_decode:()=>ic,_decodeAsync:()=>cc,_default:()=>Hh,_discriminatedUnion:()=>kh,_e164:()=>xm,_email:()=>em,_emoji:()=>sm,_encode:()=>nc,_encodeAsync:()=>oc,_endsWith:()=>_h,_enum:()=>Fh,_file:()=>Rh,_float32:()=>jm,_float64:()=>Mm,_gt:()=>$m,_gte:()=>eh,_guid:()=>tm,_includes:()=>hh,_int:()=>Am,_int32:()=>Nm,_int64:()=>zm,_intersection:()=>Ah,_ipv4:()=>mm,_ipv6:()=>hm,_isoDate:()=>Tm,_isoDateTime:()=>wm,_isoDuration:()=>Dm,_isoTime:()=>Em,_jwt:()=>Sm,_ksuid:()=>pm,_lazy:()=>Yh,_length:()=>dh,_literal:()=>Lh,_lowercase:()=>ph,_lt:()=>Zm,_lte:()=>Qm,_mac:()=>gm,_map:()=>Nh,_max:()=>Qm,_maxLength:()=>lh,_maxSize:()=>oh,_mime:()=>yh,_min:()=>eh,_minLength:()=>uh,_minSize:()=>sh,_multipleOf:()=>ah,_nan:()=>Xm,_nanoid:()=>cm,_nativeEnum:()=>Ih,_negative:()=>nh,_never:()=>Km,_nonnegative:()=>ih,_nonoptional:()=>Uh,_nonpositive:()=>rh,_normalize:()=>xh,_null:()=>Um,_nullable:()=>Vh,_number:()=>Om,_optional:()=>Bh,_overwrite:()=>bh,_parse:()=>Js,_parseAsync:()=>Xs,_pipe:()=>Kh,_positive:()=>th,_promise:()=>Xh,_property:()=>vh,_readonly:()=>qh,_record:()=>Mh,_refine:()=>Qh,_regex:()=>fh,_safeDecode:()=>fc,_safeDecodeAsync:()=>gc,_safeEncode:()=>uc,_safeEncodeAsync:()=>mc,_safeParse:()=>Qs,_safeParseAsync:()=>ec,_set:()=>Ph,_size:()=>ch,_slugify:()=>Th,_startsWith:()=>gh,_string:()=>Qp,_stringFormat:()=>ig,_stringbool:()=>rg,_success:()=>Wh,_superRefine:()=>$h,_symbol:()=>Vm,_templateLiteral:()=>Jh,_toLowerCase:()=>Ch,_toUpperCase:()=>wh,_transform:()=>zh,_trim:()=>Sh,_tuple:()=>jh,_uint32:()=>Pm,_uint64:()=>Bm,_ulid:()=>dm,_undefined:()=>Hm,_union:()=>Dh,_unknown:()=>Gm,_uppercase:()=>mh,_url:()=>om,_uuid:()=>nm,_uuidv4:()=>rm,_uuidv6:()=>im,_uuidv7:()=>am,_void:()=>qm,_xid:()=>fm,_xor:()=>Oh,clone:()=>fs,config:()=>Mo,createStandardJSONSchemaMethod:()=>dg,createToJSONSchemaMethod:()=>ug,decode:()=>ac,decodeAsync:()=>lc,describe:()=>tg,encode:()=>rc,encodeAsync:()=>sc,extractDefs:()=>sg,finalize:()=>cg,flattenError:()=>Us,formatError:()=>Ws,globalConfig:()=>jo,globalRegistry:()=>Zp,initializeContext:()=>ag,isValidBase64:()=>Cu,isValidBase64URL:()=>Tu,isValidJWT:()=>Ou,locales:()=>Wd,meta:()=>ng,parse:()=>Ys,parseAsync:()=>Zs,prettifyError:()=>qs,process:()=>og,regexes:()=>vc,registry:()=>Xp,safeDecode:()=>pc,safeDecodeAsync:()=>_c,safeEncode:()=>dc,safeEncodeAsync:()=>hc,safeParse:()=>$s,safeParseAsync:()=>tc,toDotPath:()=>Ks,toJSONSchema:()=>$g,treeifyError:()=>Gs,util:()=>No,version:()=>eu});var Eo,Do=Object.freeze({status:`aborted`});function B(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=s.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}a(r,`init`);let i=n?.Parent??Object;class o extends i{static{a(this,`Definition`)}}Object.defineProperty(o,`name`,{value:e});function s(e){var t;let i=n?.Parent?new o:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return a(s,`_`),Object.defineProperty(s,`init`,{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a(t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e),`value`)}),Object.defineProperty(s,`name`,{value:e}),s}a(B,`$constructor`);var Oo=Symbol(`zod_brand`),ko=class extends Error{static{a(this,`$ZodAsyncError`)}constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ao=class extends Error{static{a(this,`$ZodEncodeError`)}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Eo=globalThis).__zod_globalConfig??(Eo.__zod_globalConfig={});var jo=globalThis.__zod_globalConfig;function Mo(e){return e&&Object.assign(jo,e),jo}a(Mo,`config`);var No={};i(No,{BIGINT_FORMAT_RANGES:()=>gs,Class:()=>zs,NUMBER_FORMAT_RANGES:()=>hs,aborted:()=>ws,allowsEval:()=>is,assert:()=>Ro,assertEqual:()=>Po,assertIs:()=>Io,assertNever:()=>Lo,assertNotEqual:()=>Fo,assignProp:()=>Jo,base64ToUint8Array:()=>Ns,base64urlToUint8Array:()=>Fs,cached:()=>Vo,captureStackTrace:()=>ns,cleanEnum:()=>Ms,cleanRegex:()=>Uo,clone:()=>fs,cloneDef:()=>Xo,createTransparentProxy:()=>ps,defineLazy:()=>Ko,esc:()=>es,escapeRegex:()=>ds,explicitlyAborted:()=>Ts,extend:()=>ys,finalizeIssue:()=>Os,floatSafeRemainder:()=>Wo,getElementAtPath:()=>Zo,getEnumValues:()=>zo,getLengthableOrigin:()=>As,getParsedType:()=>cs,getSizableOrigin:()=>ks,hexToUint8Array:()=>Ls,isObject:()=>rs,isPlainObject:()=>as,issue:()=>js,joinValues:()=>V,jsonStringifyReplacer:()=>Bo,merge:()=>xs,mergeDefs:()=>Yo,normalizeParams:()=>H,nullish:()=>Ho,numKeys:()=>ss,objectClone:()=>qo,omit:()=>vs,optionalKeys:()=>ms,parsedType:()=>W,partial:()=>Ss,pick:()=>_s,prefixIssues:()=>Es,primitiveTypes:()=>us,promiseAllObject:()=>Qo,propertyKeyTypes:()=>ls,randomString:()=>$o,required:()=>Cs,safeExtend:()=>bs,shallowClone:()=>os,slugify:()=>ts,stringifyPrimitive:()=>U,uint8ArrayToBase64:()=>Ps,uint8ArrayToBase64url:()=>Is,uint8ArrayToHex:()=>Rs,unwrapMessage:()=>Ds});function Po(e){return e}a(Po,`assertEqual`);function Fo(e){return e}a(Fo,`assertNotEqual`);function Io(e){}a(Io,`assertIs`);function Lo(e){throw Error(`Unexpected value in exhaustive check`)}a(Lo,`assertNever`);function Ro(e){}a(Ro,`assert`);function zo(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}a(zo,`getEnumValues`);function V(e,t=`|`){return e.map(e=>U(e)).join(t)}a(V,`joinValues`);function Bo(e,t){return typeof t==`bigint`?t.toString():t}a(Bo,`jsonStringifyReplacer`);function Vo(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}}}}a(Vo,`cached`);function Ho(e){return e==null}a(Ho,`nullish`);function Uo(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}a(Uo,`cleanRegex`);function Wo(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}a(Wo,`floatSafeRemainder`);var Go=Symbol(`evaluating`);function Ko(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Go)return r===void 0&&(r=Go,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}a(Ko,`defineLazy`);function qo(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}a(qo,`objectClone`);function Jo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}a(Jo,`assignProp`);function Yo(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}a(Yo,`mergeDefs`);function Xo(e){return Yo(e._zod.def)}a(Xo,`cloneDef`);function Zo(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}a(Zo,`getElementAtPath`);function Qo(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}a(Qo,`promiseAllObject`);function $o(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}a($o,`randomString`);function es(e){return JSON.stringify(e)}a(es,`esc`);function ts(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}a(ts,`slugify`);var ns=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function rs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}a(rs,`isObject`);var is=Vo(()=>{if(jo.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function as(e){if(rs(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(rs(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}a(as,`isPlainObject`);function os(e){return as(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}a(os,`shallowClone`);function ss(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}a(ss,`numKeys`);var cs=a(e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},`getParsedType`),ls=new Set([`string`,`number`,`symbol`]),us=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function ds(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}a(ds,`escapeRegex`);function fs(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}a(fs,`clone`);function H(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:a(()=>t,`error`)};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:a(()=>t.error,`error`)}:t}a(H,`normalizeParams`);function ps(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}a(ps,`createTransparentProxy`);function U(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}a(U,`stringifyPrimitive`);function ms(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}a(ms,`optionalKeys`);var hs={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},gs={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function _s(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return fs(e,Yo(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Jo(this,`shape`,e),e},checks:[]}))}a(_s,`pick`);function vs(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return fs(e,Yo(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Jo(this,`shape`,r),r},checks:[]}))}a(vs,`omit`);function ys(e,t){if(!as(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return fs(e,Yo(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jo(this,`shape`,n),n}}))}a(ys,`extend`);function bs(e,t){if(!as(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return fs(e,Yo(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jo(this,`shape`,n),n}}))}a(bs,`safeExtend`);function xs(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return fs(e,Yo(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Jo(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}a(xs,`merge`);function Ss(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return fs(t,Yo(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Jo(this,`shape`,i),i},checks:[]}))}a(Ss,`partial`);function Cs(e,t,n){return fs(t,Yo(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Jo(this,`shape`,i),i}}))}a(Cs,`required`);function ws(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}a(ws,`aborted`);function Ts(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}a(Ts,`explicitlyAborted`);function Es(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}a(Es,`prefixIssues`);function Ds(e){return typeof e==`string`?e:e?.message}a(Ds,`unwrapMessage`);function Os(e,t,n){let r=e.message?e.message:Ds(e.inst?._zod.def?.error?.(e))??Ds(t?.error?.(e))??Ds(n.customError?.(e))??Ds(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}a(Os,`finalizeIssue`);function ks(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}a(ks,`getSizableOrigin`);function As(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}a(As,`getLengthableOrigin`);function W(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}a(W,`parsedType`);function js(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}a(js,`issue`);function Ms(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(Ms,`cleanEnum`);function Ns(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}a(Ns,`base64ToUint8Array`);function Ps(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}a(Ps,`uint8ArrayToBase64`);function Fs(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return Ns(t+`=`.repeat((4-t.length%4)%4))}a(Fs,`base64urlToUint8Array`);function Is(e){return Ps(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}a(Is,`uint8ArrayToBase64url`);function Ls(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}a(Ls,`hexToUint8Array`);function Rs(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}a(Rs,`uint8ArrayToHex`);var zs=class{static{a(this,`Class`)}constructor(...e){}},Bs=a((e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Bo,2),Object.defineProperty(e,`toString`,{value:a(()=>e.message,`value`),enumerable:!1})},`initializer`),Vs=B(`$ZodError`,Bs),Hs=B(`$ZodError`,Bs,{Parent:Error});function Us(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}a(Us,`flattenError`);function Ws(e,t=e=>e.message){let n={_errors:[]},r=a((e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}},`processError`);return r(e),n}a(Ws,`formatError`);function Gs(e,t=e=>e.message){let n={errors:[]},r=a((e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if(s.code===`invalid_key`)r({issues:s.issues},[...i,...s.path]);else if(s.code===`invalid_element`)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}},`processError`);return r(e),n}a(Gs,`treeifyError`);function Ks(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}a(Ks,`toDotPath`);function qs(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`\u2716 ${e.message}`),e.path?.length&&t.push(` \u2192 at ${Ks(e.path)}`);return t.join(`
176
176
  `)}a(qs,`prettifyError`);var Js=a(e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new ko;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Os(e,a,Mo())));throw ns(t,i?.callee),t}return o.value},`_parse`),Ys=Js(Hs),Xs=a(e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Os(e,a,Mo())));throw ns(t,i?.callee),t}return o.value},`_parseAsync`),Zs=Xs(Hs),Qs=a(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ko;return a.issues.length?{success:!1,error:new(e??Vs)(a.issues.map(e=>Os(e,i,Mo())))}:{success:!0,data:a.value}},`_safeParse`),$s=Qs(Hs),ec=a(e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Os(e,i,Mo())))}:{success:!0,data:a.value}},`_safeParseAsync`),tc=ec(Hs),nc=a(e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Js(e)(t,n,i)},`_encode`),rc=nc(Hs),ic=a(e=>(t,n,r)=>Js(e)(t,n,r),`_decode`),ac=ic(Hs),oc=a(e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Xs(e)(t,n,i)},`_encodeAsync`),sc=oc(Hs),cc=a(e=>async(t,n,r)=>Xs(e)(t,n,r),`_decodeAsync`),lc=cc(Hs),uc=a(e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Qs(e)(t,n,i)},`_safeEncode`),dc=uc(Hs),fc=a(e=>(t,n,r)=>Qs(e)(t,n,r),`_safeDecode`),pc=fc(Hs),mc=a(e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ec(e)(t,n,i)},`_safeEncodeAsync`),hc=mc(Hs),gc=a(e=>async(t,n,r)=>ec(e)(t,n,r),`_safeDecodeAsync`),_c=gc(Hs),vc={};i(vc,{base64:()=>Gc,base64url:()=>Kc,bigint:()=>rl,boolean:()=>ol,browserEmail:()=>Lc,cidrv4:()=>Uc,cidrv6:()=>Wc,cuid:()=>yc,cuid2:()=>bc,date:()=>Qc,datetime:()=>tl,domain:()=>Jc,duration:()=>Tc,e164:()=>Xc,email:()=>Mc,emoji:()=>zc,extendedDuration:()=>Ec,guid:()=>Dc,hex:()=>dl,hostname:()=>qc,html5Email:()=>Nc,httpProtocol:()=>Yc,idnEmail:()=>Ic,integer:()=>il,ipv4:()=>Bc,ipv6:()=>Vc,ksuid:()=>Cc,lowercase:()=>ll,mac:()=>Hc,md5_base64:()=>hl,md5_base64url:()=>gl,md5_hex:()=>ml,nanoid:()=>wc,null:()=>sl,number:()=>al,rfc5322Email:()=>Pc,sha1_base64:()=>vl,sha1_base64url:()=>yl,sha1_hex:()=>_l,sha256_base64:()=>xl,sha256_base64url:()=>Sl,sha256_hex:()=>bl,sha384_base64:()=>wl,sha384_base64url:()=>Tl,sha384_hex:()=>Cl,sha512_base64:()=>Dl,sha512_base64url:()=>Ol,sha512_hex:()=>El,string:()=>nl,time:()=>el,ulid:()=>xc,undefined:()=>cl,unicodeEmail:()=>Fc,uppercase:()=>ul,uuid:()=>Oc,uuid4:()=>kc,uuid6:()=>Ac,uuid7:()=>jc,xid:()=>Sc});var yc=/^[cC][0-9a-z]{6,}$/,bc=/^[0-9a-z]+$/,xc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Sc=/^[0-9a-vA-V]{20}$/,Cc=/^[A-Za-z0-9]{27}$/,wc=/^[a-zA-Z0-9_-]{21}$/,Tc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ec=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Dc=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Oc=a(e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,`uuid`),kc=Oc(4),Ac=Oc(6),jc=Oc(7),Mc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Nc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Pc=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Fc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Ic=Fc,Lc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Rc=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function zc(){return new RegExp(Rc,`u`)}a(zc,`emoji`);var Bc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Hc=a(e=>{let t=ds(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},`mac`),Uc=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Wc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Gc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kc=/^[A-Za-z0-9_-]*$/,qc=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Jc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Yc=/^https?$/,Xc=/^\+[1-9]\d{6,14}$/,Zc=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Qc=RegExp(`^${Zc}$`);function $c(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}a($c,`timeSource`);function el(e){return RegExp(`^${$c(e)}$`)}a(el,`time`);function tl(e){let t=$c({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Zc}T(?:${r})$`)}a(tl,`datetime`);var nl=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},`string`),rl=/^-?\d+n?$/,il=/^-?\d+$/,al=/^-?\d+(?:\.\d+)?$/,ol=/^(?:true|false)$/i,sl=/^null$/i,cl=/^undefined$/i,ll=/^[^A-Z]*$/,ul=/^[^a-z]*$/,dl=/^[0-9a-fA-F]*$/;function fl(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}a(fl,`fixedBase64`);function pl(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}a(pl,`fixedBase64url`);var ml=/^[0-9a-fA-F]{32}$/,hl=fl(22,`==`),gl=pl(22),_l=/^[0-9a-fA-F]{40}$/,vl=fl(27,`=`),yl=pl(27),bl=/^[0-9a-fA-F]{64}$/,xl=fl(43,`=`),Sl=pl(43),Cl=/^[0-9a-fA-F]{96}$/,wl=fl(64,``),Tl=pl(64),El=/^[0-9a-fA-F]{128}$/,Dl=fl(86,`==`),Ol=pl(86),kl=B(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Al={number:`number`,bigint:`bigint`,object:`date`},jl=B(`$ZodCheckLessThan`,(e,t)=>{kl.init(e,t);let n=Al[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ml=B(`$ZodCheckGreaterThan`,(e,t)=>{kl.init(e,t);let n=Al[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nl=B(`$ZodCheckMultipleOf`,(e,t)=>{kl.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Wo(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Pl=B(`$ZodCheckNumberFormat`,(e,t)=>{kl.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=hs[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=il)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Fl=B(`$ZodCheckBigIntFormat`,(e,t)=>{kl.init(e,t);let[n,r]=gs[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Il=B(`$ZodCheckMaxSize`,(e,t)=>{var n;kl.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ho(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:ks(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ll=B(`$ZodCheckMinSize`,(e,t)=>{var n;kl.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ho(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:ks(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Rl=B(`$ZodCheckSizeEquals`,(e,t)=>{var n;kl.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ho(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:ks(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),zl=B(`$ZodCheckMaxLength`,(e,t)=>{var n;kl.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ho(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=As(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bl=B(`$ZodCheckMinLength`,(e,t)=>{var n;kl.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ho(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=As(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Vl=B(`$ZodCheckLengthEquals`,(e,t)=>{var n;kl.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ho(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=As(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Hl=B(`$ZodCheckStringFormat`,(e,t)=>{var n,r;kl.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ul=B(`$ZodCheckRegex`,(e,t)=>{Hl.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Wl=B(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ll,Hl.init(e,t)}),Gl=B(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=ul,Hl.init(e,t)}),Kl=B(`$ZodCheckIncludes`,(e,t)=>{kl.init(e,t);let n=ds(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ql=B(`$ZodCheckStartsWith`,(e,t)=>{kl.init(e,t);let n=RegExp(`^${ds(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Jl=B(`$ZodCheckEndsWith`,(e,t)=>{kl.init(e,t);let n=RegExp(`.*${ds(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function Yl(e,t,n){e.issues.length&&t.issues.push(...Es(n,e.issues))}a(Yl,`handleCheckPropertyResult`);var Xl=B(`$ZodCheckProperty`,(e,t)=>{kl.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>Yl(n,e,t.property));Yl(n,e,t.property)}}),Zl=B(`$ZodCheckMimeType`,(e,t)=>{kl.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Ql=B(`$ZodCheckOverwrite`,(e,t)=>{kl.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),$l=class{static{a(this,`Doc`)}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
177
177
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
178
178
  `))}},eu={major:4,minor:4,patch:3},G=B(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=eu;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=a((e,t,n)=>{let r=ws(e),i;for(let a of t){if(a._zod.def.when){if(Ts(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new ko;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=ws(e,t))});else{if(e.issues.length===t)continue;r||=ws(e,t)}}return i?i.then(()=>e):e},`runChecks`),n=a((n,i,a)=>{if(ws(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new ko;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)},`handleCanaryResult`);e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new ko;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Ko(e,`~standard`,()=>({validate:a(t=>{try{let n=$s(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return tc(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},`validate`),vendor:`zod`,version:1}))}),tu=B(`$ZodString`,(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??nl(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),nu=B(`$ZodStringFormat`,(e,t)=>{Hl.init(e,t),tu.init(e,t)}),ru=B(`$ZodGUID`,(e,t)=>{t.pattern??=Dc,nu.init(e,t)}),iu=B(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Oc(e)}else t.pattern??=Oc();nu.init(e,t)}),au=B(`$ZodEmail`,(e,t)=>{t.pattern??=Mc,nu.init(e,t)}),ou=B(`$ZodURL`,(e,t)=>{nu.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Yc.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),su=B(`$ZodEmoji`,(e,t)=>{t.pattern??=zc(),nu.init(e,t)}),cu=B(`$ZodNanoID`,(e,t)=>{t.pattern??=wc,nu.init(e,t)}),lu=B(`$ZodCUID`,(e,t)=>{t.pattern??=yc,nu.init(e,t)}),uu=B(`$ZodCUID2`,(e,t)=>{t.pattern??=bc,nu.init(e,t)}),du=B(`$ZodULID`,(e,t)=>{t.pattern??=xc,nu.init(e,t)}),fu=B(`$ZodXID`,(e,t)=>{t.pattern??=Sc,nu.init(e,t)}),pu=B(`$ZodKSUID`,(e,t)=>{t.pattern??=Cc,nu.init(e,t)}),mu=B(`$ZodISODateTime`,(e,t)=>{t.pattern??=tl(t),nu.init(e,t)}),hu=B(`$ZodISODate`,(e,t)=>{t.pattern??=Qc,nu.init(e,t)}),gu=B(`$ZodISOTime`,(e,t)=>{t.pattern??=el(t),nu.init(e,t)}),_u=B(`$ZodISODuration`,(e,t)=>{t.pattern??=Tc,nu.init(e,t)}),vu=B(`$ZodIPv4`,(e,t)=>{t.pattern??=Bc,nu.init(e,t),e._zod.bag.format=`ipv4`}),yu=B(`$ZodIPv6`,(e,t)=>{t.pattern??=Vc,nu.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),bu=B(`$ZodMAC`,(e,t)=>{t.pattern??=Hc(t.delimiter),nu.init(e,t),e._zod.bag.format=`mac`}),xu=B(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Uc,nu.init(e,t)}),Su=B(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Wc,nu.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Cu(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}a(Cu,`isValidBase64`);var wu=B(`$ZodBase64`,(e,t)=>{t.pattern??=Gc,nu.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Cu(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Tu(e){if(!Kc.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Cu(t.padEnd(Math.ceil(t.length/4)*4,`=`))}a(Tu,`isValidBase64URL`);var Eu=B(`$ZodBase64URL`,(e,t)=>{t.pattern??=Kc,nu.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Tu(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Du=B(`$ZodE164`,(e,t)=>{t.pattern??=Xc,nu.init(e,t)});function Ou(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}a(Ou,`isValidJWT`);var ku=B(`$ZodJWT`,(e,t)=>{nu.init(e,t),e._zod.check=n=>{Ou(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Au=B(`$ZodCustomStringFormat`,(e,t)=>{nu.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),ju=B(`$ZodNumber`,(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??al,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Mu=B(`$ZodNumberFormat`,(e,t)=>{Pl.init(e,t),ju.init(e,t)}),Nu=B(`$ZodBoolean`,(e,t)=>{G.init(e,t),e._zod.pattern=ol,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Pu=B(`$ZodBigInt`,(e,t)=>{G.init(e,t),e._zod.pattern=rl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),Fu=B(`$ZodBigIntFormat`,(e,t)=>{Fl.init(e,t),Pu.init(e,t)}),Iu=B(`$ZodSymbol`,(e,t)=>{G.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),Lu=B(`$ZodUndefined`,(e,t)=>{G.init(e,t),e._zod.pattern=cl,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Ru=B(`$ZodNull`,(e,t)=>{G.init(e,t),e._zod.pattern=sl,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),zu=B(`$ZodAny`,(e,t)=>{G.init(e,t),e._zod.parse=e=>e}),Bu=B(`$ZodUnknown`,(e,t)=>{G.init(e,t),e._zod.parse=e=>e}),Vu=B(`$ZodNever`,(e,t)=>{G.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Hu=B(`$ZodVoid`,(e,t)=>{G.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Uu=B(`$ZodDate`,(e,t)=>{G.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function Wu(e,t,n){e.issues.length&&t.issues.push(...Es(n,e.issues)),t.value[n]=e.value}a(Wu,`handleArrayResult`);var Gu=B(`$ZodArray`,(e,t)=>{G.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Wu(t,n,e))):Wu(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Ku(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Es(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}a(Ku,`handlePropertyResult`);function qu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ms(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}a(qu,`normalizeDef`);function Ju(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Ku(e,n,i,t,u,d))):Ku(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}a(Ju,`handleCatchall`);var Yu=B(`$ZodObject`,(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:a(()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n},`get`)})}let n=Vo(()=>qu(t));Ko(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=rs,i=t.catchall,o;e._zod.parse=(t,a)=>{o??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=o.shape;for(let e of o.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,o=n._zod.run({value:s[e],issues:[]},a);o instanceof Promise?c.push(o.then(n=>Ku(n,t,e,s,r,i))):Ku(o,t,e,s,r,i)}return i?Ju(c,s,t,a,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Xu=B(`$ZodObjectJIT`,(e,t)=>{Yu.init(e,t);let n=e._zod.parse,r=Vo(()=>qu(t)),i=a(e=>{let t=new $l([`shape`,`payload`,`ctx`]),n=r.value,i=a(e=>{let t=es(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`},`parseStr`);t.write(`const input = payload.value;`);let o=Object.create(null),s=0;for(let e of n.keys)o[e]=`key_${s++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=o[r],a=es(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
@@ -245,7 +245,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
245
245
  `)}a($b,`indentText`);function ex(e,t,n,r,i,a=`Deprecation`,o=`warning`){let s=`${a}: "${n}":
246
246
  ${r}`,c=ix(t,n);c!==void 0&&c.field in c.container&&(e[`${o}s`].push(s),i&&delete c.container[c.field])}a(ex,`deprecated`);function tx(e,t,n){let r=ix(t,n);r!==void 0&&r.field in r.container&&!(`WRANGLER_DISABLE_EXPERIMENTAL_WARNING`in process.env)&&e.warnings.push(`"${n}" fields are experimental and may change or break at any time.`)}a(tx,`experimental`);function nx(e,t,n,r,i,a,o=e=>e){return i(e,r,n[r],t),(n===t?void 0:n[r])??o(t?.[r])??a}a(nx,`inheritable`);var rx=a(e=>t=>t?`${t}-${e}`:void 0,`appendEnvName`);function J(e,t,n,r,i,a,o,s){return r[a]===void 0?n?.[a]!==void 0&&e.warnings.push(`"${a}" exists at the top level, but not on "env.${i}".
247
247
  This is not what you probably want, since "${a}" is not inherited by environments.
248
- Please add "${a}" to "env.${i}".`):o(e,a,r[a],t),r[a]??s}a(J,`notInheritable`);function ix(e,t){let n=e,r=t.split(`.`);for(let e=0;e<r.length-1;e++){if(!vx(n,r[e]))return;n=n[r[e]]}return{container:n,field:r[r.length-1]}}a(ix,`unwindPropertyPath`);var ax=a((e,t,n)=>n!==void 0&&typeof n!=`string`?(e.errors.push(`Expected "${t}" to be of type string but got ${JSON.stringify(n)}.`),!1):!0,`isString`),ox=a((e,t,n)=>typeof n==`string`&&/^$|^[a-z0-9_][a-z0-9-_]*$/.test(n)||n===void 0?!0:(e.errors.push(`Expected "${t}" to be of type string, alphanumeric and lowercase with dashes only but got ${JSON.stringify(n)}.`),!1),`isValidName`),sx=a((e,t,n)=>{let r=!0;(n.includes(`–`)||n.includes(`—`))&&(e.errors.push(`"${t}" field should use ISO-8601 accepted hyphens (-) rather than en-dashes (\u2013) or em-dashes (\u2014).`),r=!1);let i=new Date(n.replaceAll(/–|—/g,`-`));return isNaN(i.getTime())&&(e.errors.push(`"${t}" field should be a valid ISO-8601 date (YYYY-MM-DD), but got ${JSON.stringify(n)}.`),r=!1),r},`isValidDateTimeStringFormat`),cx=a((e,t,n)=>n!==void 0&&(!Array.isArray(n)||n.some(e=>typeof e!=`string`))?(e.errors.push(`Expected "${t}" to be of type string array but got ${JSON.stringify(n)}.`),!1):!0,`isStringArray`),lx=a((...e)=>(t,n,r)=>r!==void 0&&!e.some(e=>r===e)?(t.errors.push(`Expected "${n}" field to be one of ${JSON.stringify(e)} but got ${JSON.stringify(r)}.`),!1):!0,`isOneOf`),ux=a((...e)=>(t,n,r,i)=>{let a=!0;for(let o of e)o(t,n,r,i)||(a=!1);return a},`all`),dx=a((e,...t)=>(n,r,i)=>{if(i===void 0)return!0;for(let i of t)if(e[i]!==void 0)return n.errors.push(`Expected exactly one of the following fields ${JSON.stringify([r,...t])}.`),!1;return!0},`isMutuallyExclusiveWith`),fx=a((e,t,n)=>n!==void 0&&typeof n!=`boolean`?(e.errors.push(`Expected "${t}" to be of type boolean but got ${JSON.stringify(n)}.`),!1):!0,`isBoolean`),px=a((e,t,n,r,i,a)=>(t&&(t+=`.`),r===void 0?(e.errors.push(`"${t}${n}" is a required field.`),!1):typeof r===i?!(a&&!lx(...a)(e,`${t}${n}`,r,void 0)):(e.errors.push(`Expected "${t}${n}" to be of type ${i} but got ${JSON.stringify(r)}.`),!1)),`validateRequiredProperty`),mx=a((e,t,n)=>{let r=t?`${t}.`:``;if(n.every(e=>e.value===void 0))return e.errors.push(`${n.map(({key:e})=>`"${r}${e}"`).join(` or `)} is required.`),!1;let i=[];for(let e of n){if(typeof e.value===e.type)return!0;i.push(`Expected "${r}${e.key}" to be of type ${e.type} but got ${JSON.stringify(e.value)}.`)}return e.errors.push(...i),!1},`validateAtLeastOnePropertyRequired`),Y=a((e,t,n,r,i,a)=>r===void 0?!0:px(e,t,n,r,i,a),`validateOptionalProperty`),hx=a((e,t,n,r)=>{let i=!0;if(!Array.isArray(n))e.errors.push(`Expected "${t}" to be an array of ${r}s but got ${JSON.stringify(n)}`),i=!1;else for(let a=0;a<n.length;a++)i=px(e,t,`[${a}]`,n[a],r)&&i;return i},`validateTypedArray`),gx=a((e,t,n,r)=>n===void 0?!0:hx(e,t,n,r),`validateOptionalTypedArray`),X=a((e,t,n,r)=>vx(e,t)&&typeof e[t]===n&&(r===void 0||r.includes(e[t])),`isRequiredProperty`),_x=a((e,t,n)=>!vx(e,t)||typeof e[t]===n,`isOptionalProperty`),vx=a((e,t)=>t in e,`hasProperty`),Z=a((e,t,n,r)=>{let i=new Set(n);for(let e of r)i.delete(e);if(i.size>0){let n=Array.from(i.keys()).map(e=>`"${e}"`);return e.warnings.push(`Unexpected fields found in ${t} field: ${n}`),e.hasUnexpectedFields=!0,!1}return!0},`validateAdditionalProperties`),yx=a(e=>typeof e!=`object`||!e?[]:bx(e)?e.bindings.map(({name:e})=>e):xx(e)?e.map(({binding:e})=>e):Sx(e)?e.binding===void 0?Object.keys(e).filter(t=>e[t]!==void 0):[e.binding]:[],`getBindingNames`),bx=a(e=>Sx(e)&&`bindings`in e&&Array.isArray(e.bindings)&&e.bindings.every(e=>Sx(e)&&`name`in e&&typeof e.name==`string`),`isBindingList`),xx=a(e=>Array.isArray(e)&&e.every(e=>Sx(e)&&`binding`in e&&typeof e.binding==`string`),`isNamespaceList`),Sx=a(e=>typeof e==`object`&&!!e&&!Array.isArray(e),`isRecord`),Cx=a((e,t,n)=>{if(Array.isArray(n)){let r=new Map;Object.entries(n).forEach(([e,t])=>{r.set(t.name,(r.get(t.name)??0)+1)});let i=Array.from(r.entries()).filter(([e,t])=>t>1).map(([e])=>e);if(i.length>0){let n=i.join(`", "`);return e.errors.push(`"${t}" bindings must have unique "name" values; duplicate(s) found: "${n}"`),!1}}return!0},`validateUniqueNameProperty`);function wx(e){return typeof e==`string`&&/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/.test(e)}a(wx,`isValidR2BucketName`);var Tx=`Bucket names must begin and end with an alphanumeric character, only contain lowercase letters, numbers, and hyphens, and be between 3 and 63 characters long.`,Ex={data_blobs:`Data Blob`,durable_objects:`Durable Object`,kv_namespaces:`KV Namespace`,send_email:`Send Email`,queues:`Queue`,d1_databases:`D1 Database`,vectorize:`Vectorize Index`,ai_search_namespaces:`AI Search Namespace`,ai_search:`AI Search Instance`,agent_memory:`Agent Memory`,hyperdrive:`Hyperdrive Config`,r2_buckets:`R2 Bucket`,logfwdr:`logfwdr`,services:`Worker`,analytics_engine_datasets:`Analytics Engine Dataset`,text_blobs:`Text Blob`,browser:`Browser Run`,ai:`AI`,images:`Images`,stream:`Stream`,media:`Media`,version_metadata:`Worker Version Metadata`,unsafe:`Unsafe Metadata`,vars:`Environment Variable`,wasm_modules:`Wasm Module`,dispatch_namespaces:`Dispatch Namespace`,mtls_certificates:`mTLS Certificate`,workflows:`Workflow`,pipelines:`Pipeline`,secrets_store_secrets:`Secrets Store Secret`,artifacts:`Artifacts`,ratelimits:`Rate Limit`,assets:`Assets`,unsafe_hello_world:`Hello World`,flagship:`Flagship`,worker_loaders:`Worker Loader`,vpc_services:`VPC Service`,vpc_networks:`VPC Network`},Dx={plain_text:`Environment Variable`,secret_text:`Environment Variable`,json:`Environment Variable`,kv_namespace:`KV Namespace`,send_email:`Send Email`,wasm_module:`Wasm Module`,text_blob:`Text Blob`,browser:`Browser Run`,ai:`AI`,images:`Images`,stream:`Stream`,version_metadata:`Worker Version Metadata`,data_blob:`Data Blob`,durable_object_namespace:`Durable Object`,workflow:`Workflow`,queue:`Queue`,r2_bucket:`R2 Bucket`,d1:`D1 Database`,vectorize:`Vectorize Index`,ai_search_namespace:`AI Search Namespace`,ai_search:`AI Search Instance`,agent_memory:`Agent Memory`,hyperdrive:`Hyperdrive Config`,service:`Worker`,fetcher:`Service Binding`,analytics_engine:`Analytics Engine Dataset`,dispatch_namespace:`Dispatch Namespace`,mtls_certificate:`mTLS Certificate`,pipeline:`Pipeline`,secrets_store_secret:`Secrets Store Secret`,artifacts:`Artifacts`,logfwdr:`logfwdr`,unsafe_hello_world:`Hello World`,flagship:`Flagship`,ratelimit:`Rate Limit`,worker_loader:`Worker Loader`,vpc_service:`VPC Service`,vpc_network:`VPC Network`,media:`Media`,assets:`Assets`,inherit:`Inherited`};function Q(e){return e in Dx?Dx[e]:e.startsWith(`unsafe_`)?`Unsafe Metadata`:e}a(Q,`getBindingTypeFriendlyName`);var Ox=new Intl.ListFormat(`en-US`),kx=[`lite`,`basic`,`standard-1`,`standard-2`,`standard-3`,`standard-4`,`dev`,`standard`];function Ax(e){return e.pages_build_output_dir!==void 0}a(Ax,`isPagesConfig`);function jx(e,t,n,r,i=!1){let a=new Qb(`Processing ${t?S.relative(process.cwd(),t):`wrangler`} configuration:`),o=rn(e,t,n);`legacy_env`in e&&(o||a.errors.push(ie`
248
+ Please add "${a}" to "env.${i}".`):o(e,a,r[a],t),r[a]??s}a(J,`notInheritable`);function ix(e,t){let n=e,r=t.split(`.`);for(let e=0;e<r.length-1;e++){if(!vx(n,r[e]))return;n=n[r[e]]}return{container:n,field:r[r.length-1]}}a(ix,`unwindPropertyPath`);var ax=a((e,t,n)=>n!==void 0&&typeof n!=`string`?(e.errors.push(`Expected "${t}" to be of type string but got ${JSON.stringify(n)}.`),!1):!0,`isString`),ox=a((e,t,n)=>typeof n==`string`&&/^$|^[a-z0-9_][a-z0-9-_]*$/.test(n)||n===void 0?!0:(e.errors.push(`Expected "${t}" to be of type string, alphanumeric and lowercase with dashes only but got ${JSON.stringify(n)}.`),!1),`isValidName`),sx=a((e,t,n)=>{let r=!0;(n.includes(`–`)||n.includes(`—`))&&(e.errors.push(`"${t}" field should use ISO-8601 accepted hyphens (-) rather than en-dashes (\u2013) or em-dashes (\u2014).`),r=!1);let i=new Date(n.replaceAll(/–|—/g,`-`));return isNaN(i.getTime())&&(e.errors.push(`"${t}" field should be a valid ISO-8601 date (YYYY-MM-DD), but got ${JSON.stringify(n)}.`),r=!1),r},`isValidDateTimeStringFormat`),cx=a((e,t,n)=>n!==void 0&&(!Array.isArray(n)||n.some(e=>typeof e!=`string`))?(e.errors.push(`Expected "${t}" to be of type string array but got ${JSON.stringify(n)}.`),!1):!0,`isStringArray`),lx=a((...e)=>(t,n,r)=>r!==void 0&&!e.some(e=>r===e)?(t.errors.push(`Expected "${n}" field to be one of ${JSON.stringify(e)} but got ${JSON.stringify(r)}.`),!1):!0,`isOneOf`),ux=a((...e)=>(t,n,r,i)=>{let a=!0;for(let o of e)o(t,n,r,i)||(a=!1);return a},`all`),dx=a((e,...t)=>(n,r,i)=>{if(i===void 0)return!0;for(let i of t)if(e[i]!==void 0)return n.errors.push(`Expected exactly one of the following fields ${JSON.stringify([r,...t])}.`),!1;return!0},`isMutuallyExclusiveWith`),fx=a((e,t,n)=>n!==void 0&&typeof n!=`boolean`?(e.errors.push(`Expected "${t}" to be of type boolean but got ${JSON.stringify(n)}.`),!1):!0,`isBoolean`),px=a((e,t,n,r,i,a)=>(t&&(t+=`.`),r===void 0?(e.errors.push(`"${t}${n}" is a required field.`),!1):typeof r===i?!(a&&!lx(...a)(e,`${t}${n}`,r,void 0)):(e.errors.push(`Expected "${t}${n}" to be of type ${i} but got ${JSON.stringify(r)}.`),!1)),`validateRequiredProperty`),mx=a((e,t,n)=>{let r=t?`${t}.`:``;if(n.every(e=>e.value===void 0))return e.errors.push(`${n.map(({key:e})=>`"${r}${e}"`).join(` or `)} is required.`),!1;let i=[];for(let e of n){if(typeof e.value===e.type)return!0;i.push(`Expected "${r}${e.key}" to be of type ${e.type} but got ${JSON.stringify(e.value)}.`)}return e.errors.push(...i),!1},`validateAtLeastOnePropertyRequired`),Y=a((e,t,n,r,i,a)=>r===void 0?!0:px(e,t,n,r,i,a),`validateOptionalProperty`),hx=a((e,t,n,r)=>{let i=!0;if(!Array.isArray(n))e.errors.push(`Expected "${t}" to be an array of ${r}s but got ${JSON.stringify(n)}`),i=!1;else for(let a=0;a<n.length;a++)i=px(e,t,`[${a}]`,n[a],r)&&i;return i},`validateTypedArray`),gx=a((e,t,n,r)=>n===void 0?!0:hx(e,t,n,r),`validateOptionalTypedArray`),X=a((e,t,n,r)=>vx(e,t)&&typeof e[t]===n&&(r===void 0||r.includes(e[t])),`isRequiredProperty`),_x=a((e,t,n)=>!vx(e,t)||typeof e[t]===n,`isOptionalProperty`),vx=a((e,t)=>t in e,`hasProperty`),Z=a((e,t,n,r)=>{let i=new Set(n);for(let e of r)i.delete(e);if(i.size>0){let n=Array.from(i.keys()).map(e=>`"${e}"`);return e.warnings.push(`Unexpected fields found in ${t} field: ${n}`),e.hasUnexpectedFields=!0,!1}return!0},`validateAdditionalProperties`),yx=a(e=>typeof e!=`object`||!e?[]:bx(e)?e.bindings.map(({name:e})=>e):xx(e)?e.map(({binding:e})=>e):Sx(e)?e.binding===void 0?Object.keys(e).filter(t=>e[t]!==void 0):[e.binding]:[],`getBindingNames`),bx=a(e=>Sx(e)&&`bindings`in e&&Array.isArray(e.bindings)&&e.bindings.every(e=>Sx(e)&&`name`in e&&typeof e.name==`string`),`isBindingList`),xx=a(e=>Array.isArray(e)&&e.every(e=>Sx(e)&&`binding`in e&&typeof e.binding==`string`),`isNamespaceList`),Sx=a(e=>typeof e==`object`&&!!e&&!Array.isArray(e),`isRecord`),Cx=a((e,t,n)=>{if(Array.isArray(n)){let r=new Map;Object.entries(n).forEach(([e,t])=>{r.set(t.name,(r.get(t.name)??0)+1)});let i=Array.from(r.entries()).filter(([e,t])=>t>1).map(([e])=>e);if(i.length>0){let n=i.join(`", "`);return e.errors.push(`"${t}" bindings must have unique "name" values; duplicate(s) found: "${n}"`),!1}}return!0},`validateUniqueNameProperty`);function wx(e){return typeof e==`string`&&/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/.test(e)}a(wx,`isValidR2BucketName`);var Tx=`Bucket names must begin and end with an alphanumeric character, only contain lowercase letters, numbers, and hyphens, and be between 3 and 63 characters long.`,Ex={data_blobs:`Data Blob`,durable_objects:`Durable Object`,kv_namespaces:`KV Namespace`,send_email:`Send Email`,queues:`Queue`,d1_databases:`D1 Database`,vectorize:`Vectorize Index`,ai_search_namespaces:`AI Search Namespace`,ai_search:`AI Search Instance`,agent_memory:`Agent Memory`,hyperdrive:`Hyperdrive Config`,r2_buckets:`R2 Bucket`,logfwdr:`logfwdr`,services:`Worker`,analytics_engine_datasets:`Analytics Engine Dataset`,text_blobs:`Text Blob`,browser:`Browser Run`,ai:`AI`,images:`Images`,stream:`Stream`,media:`Media`,version_metadata:`Worker Version Metadata`,unsafe:`Unsafe Metadata`,vars:`Environment Variable`,wasm_modules:`Wasm Module`,dispatch_namespaces:`Dispatch Namespace`,mtls_certificates:`mTLS Certificate`,workflows:`Workflow`,pipelines:`Pipeline`,secrets_store_secrets:`Secrets Store Secret`,artifacts:`Artifacts`,ratelimits:`Rate Limit`,assets:`Assets`,unsafe_hello_world:`Hello World`,flagship:`Flagship`,worker_loaders:`Worker Loader`,vpc_services:`VPC Service`,vpc_networks:`VPC Network`},Dx={plain_text:`Environment Variable`,secret_text:`Environment Variable`,json:`Environment Variable`,kv_namespace:`KV Namespace`,send_email:`Send Email`,wasm_module:`Wasm Module`,text_blob:`Text Blob`,browser:`Browser Run`,ai:`AI`,images:`Images`,stream:`Stream`,version_metadata:`Worker Version Metadata`,data_blob:`Data Blob`,durable_object_namespace:`Durable Object`,workflow:`Workflow`,queue:`Queue`,r2_bucket:`R2 Bucket`,d1:`D1 Database`,vectorize:`Vectorize Index`,ai_search_namespace:`AI Search Namespace`,ai_search:`AI Search Instance`,agent_memory:`Agent Memory`,hyperdrive:`Hyperdrive Config`,service:`Worker`,fetcher:`Service Binding`,analytics_engine:`Analytics Engine Dataset`,dispatch_namespace:`Dispatch Namespace`,mtls_certificate:`mTLS Certificate`,pipeline:`Pipeline`,secrets_store_secret:`Secrets Store Secret`,artifacts:`Artifacts`,logfwdr:`logfwdr`,unsafe_hello_world:`Hello World`,flagship:`Flagship`,ratelimit:`Rate Limit`,worker_loader:`Worker Loader`,vpc_service:`VPC Service`,vpc_network:`VPC Network`,media:`Media`,assets:`Assets`,inherit:`Inherited`};function Q(e){return e in Dx?Dx[e]:e.startsWith(`unsafe_`)?`Unsafe Metadata`:e}a(Q,`getBindingTypeFriendlyName`);var Ox=new Intl.ListFormat(`en-US`),kx=[`lite`,`basic`,`standard-1`,`standard-2`,`standard-3`,`standard-4`,`dev`,`standard`];function Ax(e){return e.pages_build_output_dir!==void 0}a(Ax,`isPagesConfig`);function jx(e,t,n,r,i=!1){let a=new Qb(`Processing ${t?w.relative(process.cwd(),t):`wrangler`} configuration:`),o=rn(e,t,n);`legacy_env`in e&&(o||a.errors.push(ie`
249
249
  The "legacy_env" field is no longer supported, so please remove it from your configuration file.
250
250
  Service environments have been removed, and each environment is now deployed as its own Worker named "<name>-<environment>". This matches the behaviour of "legacy_env = true", which was the default, so removing the field will not change how your Worker is deployed.
251
251
  Refer to https://developers.cloudflare.com/workers/wrangler/environments/ for more information.
@@ -257,7 +257,7 @@ Please add "${a}" to "env.${i}".`):o(e,a,r[a],t),r[a]??s}a(J,`notInheritable`);f
257
257
  Such configurations are generated by tools, meaning that one of the tools
258
258
  your application is using is generating the incorrect configuration.
259
259
  Report this issue to the tool's author so that this can be fixed there.
260
- `);let u=r.env??pr();y(u===void 0||typeof u==`string`);let d=c;if(u)if(o){if(!Ax(e)&&e.targetEnvironment&&e.targetEnvironment!==u){let t=r.env===void 0?`via the CLOUDFLARE_ENV environment variable`:"via the `--env/-e` CLI argument";throw Error(ie`
260
+ `);let u=r.env??pr();x(u===void 0||typeof u==`string`);let d=c;if(u)if(o){if(!Ax(e)&&e.targetEnvironment&&e.targetEnvironment!==u){let t=r.env===void 0?`via the CLOUDFLARE_ENV environment variable`:"via the `--env/-e` CLI argument";throw Error(ie`
261
261
  You have specified the environment "${u}" ${t}.
262
262
  This does not match the target environment "${e.targetEnvironment}" that was used when building the application.
263
263
  Perhaps you need to re-run the custom build of the project with "${u}" as the selected environment?
@@ -267,12 +267,12 @@ Before using \`--env=${u}\` there should be an equivalent environment section in
267
267
  ${r}
268
268
  Consider adding an environment configuration section to the ${on(t)} file:
269
269
  \`\`\`
270
- [env.`+u+"]\n```\n";r.length>0?a.errors.push(o):a.warnings.push(o)}}let f={configPath:t,userConfigPath:n,topLevelName:o?e.topLevelName:e.name,definedEnvironments:o?e.definedEnvironments:l,targetEnvironment:o?e.targetEnvironment:u,pages_build_output_dir:Ix(t,e.pages_build_output_dir),send_metrics:e.send_metrics,dependencies_instrumentation:e.dependencies_instrumentation,keep_vars:e.keep_vars,addresses:e.addresses,...d,dev:Lx(a,e.dev??{},r),site:zx(a,t,e,d.main),alias:Bx(a,t,e),wasm_modules:Vx(a,t,`wasm_modules`,e.wasm_modules),text_blobs:Vx(a,t,`text_blobs`,e.text_blobs),data_blobs:Vx(a,t,`data_blobs`,e.data_blobs)};return VS(a,f),Z(a,`top-level`,Object.keys(e),[...Object.keys(f),`env`,`$schema`]),Mx(f,r),{config:f,diagnostics:a}}a(jx,`normalizeAndValidateConfig`);function Mx(e,t){let n=t.script??e.main;if(typeof n==`string`&&n.endsWith(`.py`)&&(e.no_bundle=!0,e.rules.some(e=>e.type===`PythonModule`)||e.rules.push({type:`PythonModule`,globs:[`**/*.py`]}),!e.compatibility_flags.includes(`python_workers`)))throw new F("The `python_workers` compatibility flag is required to use Python.",{telemetryMessage:!1})}a(Mx,`applyPythonConfig`);function Nx(e,t,n,r){let{command:i,cwd:a,watch_dir:o=`./src`,...s}=n;return Z(e,`build`,Object.keys(s),[]),Y(e,`build`,`command`,i,`string`),Y(e,`build`,`cwd`,a,`string`),Array.isArray(o)?hx(e,`build.watch_dir`,o,`string`):Y(e,`build`,`watch_dir`,o,`string`),{command:i,watch_dir:i&&r?Array.isArray(o)?o.map(e=>S.relative(process.cwd(),S.join(S.dirname(r),`${e}`))):S.relative(process.cwd(),S.join(S.dirname(r),`${o}`)):o,cwd:a}}a(Nx,`normalizeAndValidateBuild`);function Px(e,t){let n=S.dirname(e??`wrangler.toml`);if(t!==void 0)if(typeof t==`string`){let e=S.resolve(n);return S.resolve(e,t)}else return t;else return}a(Px,`normalizeAndValidateMainField`);function Fx(e,t){let n=S.dirname(e??`wrangler.toml`);if(t!==void 0)if(typeof t==`string`){let e=S.resolve(n);return S.resolve(e,t)}else return t;else return}a(Fx,`normalizeAndValidateBaseDirField`);function Ix(e,t){let n=S.dirname(e??`wrangler.toml`);if(t!==void 0)if(typeof t==`string`){let e=S.resolve(n);return S.resolve(e,t)}else return t;else return}a(Ix,`normalizeAndValidatePagesBuildOutputDir`);function Lx(e,t,n){y(typeof n==`object`&&!!n&&!Array.isArray(n));let{localProtocol:r,upstreamProtocol:i,remote:a,enableContainers:o,generateTypes:s}=n;y(r===void 0||r===`http`||r===`https`),y(i===void 0||i===`http`||i===`https`),y(a===void 0||typeof a==`boolean`),y(o===void 0||typeof o==`boolean`),y(s===void 0||typeof s==`boolean`);let{ip:c=process.platform===`win32`?`127.0.0.1`:`localhost`,port:l,inspector_port:u,inspector_ip:d,local_protocol:f=r??`http`,upstream_protocol:p=i??a?`https`:f,host:m,enable_containers:h=o??!0,container_engine:g,generate_types:_=s??!1,...v}=t;return Z(e,`dev`,Object.keys(v),[]),Y(e,`dev`,`ip`,c,`string`),Y(e,`dev`,`port`,l,`number`),Y(e,`dev`,`inspector_port`,u,`number`),Y(e,`dev`,`inspector_ip`,d,`string`),Y(e,`dev`,`local_protocol`,f,`string`,[`http`,`https`]),Y(e,`dev`,`upstream_protocol`,p,`string`,[`http`,`https`]),Y(e,`dev`,`host`,m,`string`),Y(e,`dev`,`enable_containers`,h,`boolean`),Y(e,`dev`,`container_engine`,g,`string`),Y(e,`dev`,`generate_types`,_,`boolean`),{ip:c,port:l,inspector_port:u,inspector_ip:d,local_protocol:f,upstream_protocol:p,host:m,enable_containers:h,container_engine:g,generate_types:_}}a(Lx,`normalizeAndValidateDev`);function Rx(e,t,n){return nx(e,t,n,`assets`,vS,void 0)}a(Rx,`normalizeAndValidateAssets`);function zx(e,t,n,r){if(n?.site!==void 0){let{bucket:i,include:a=[],exclude:o=[],...s}=n.site;Z(e,`site`,Object.keys(s),[`entry-point`]),px(e,`site`,`bucket`,i,`string`),hx(e,`sites.include`,a,`string`),hx(e,`sites.exclude`,o,`string`);let c=n.site[`entry-point`];Y(e,`site`,`entry-point`,c,`string`),ex(e,n,`site.entry-point`,`Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file:
270
+ [env.`+u+"]\n```\n";r.length>0?a.errors.push(o):a.warnings.push(o)}}let f={configPath:t,userConfigPath:n,topLevelName:o?e.topLevelName:e.name,definedEnvironments:o?e.definedEnvironments:l,targetEnvironment:o?e.targetEnvironment:u,pages_build_output_dir:Ix(t,e.pages_build_output_dir),send_metrics:e.send_metrics,dependencies_instrumentation:e.dependencies_instrumentation,keep_vars:e.keep_vars,addresses:e.addresses,...d,dev:Lx(a,e.dev??{},r),site:zx(a,t,e,d.main),alias:Bx(a,t,e),wasm_modules:Vx(a,t,`wasm_modules`,e.wasm_modules),text_blobs:Vx(a,t,`text_blobs`,e.text_blobs),data_blobs:Vx(a,t,`data_blobs`,e.data_blobs)};return VS(a,f),Z(a,`top-level`,Object.keys(e),[...Object.keys(f),`env`,`$schema`]),Mx(f,r),{config:f,diagnostics:a}}a(jx,`normalizeAndValidateConfig`);function Mx(e,t){let n=t.script??e.main;if(typeof n==`string`&&n.endsWith(`.py`)&&(e.no_bundle=!0,e.rules.some(e=>e.type===`PythonModule`)||e.rules.push({type:`PythonModule`,globs:[`**/*.py`]}),!e.compatibility_flags.includes(`python_workers`)))throw new F("The `python_workers` compatibility flag is required to use Python.",{telemetryMessage:!1})}a(Mx,`applyPythonConfig`);function Nx(e,t,n,r){let{command:i,cwd:a,watch_dir:o=`./src`,...s}=n;return Z(e,`build`,Object.keys(s),[]),Y(e,`build`,`command`,i,`string`),Y(e,`build`,`cwd`,a,`string`),Array.isArray(o)?hx(e,`build.watch_dir`,o,`string`):Y(e,`build`,`watch_dir`,o,`string`),{command:i,watch_dir:i&&r?Array.isArray(o)?o.map(e=>w.relative(process.cwd(),w.join(w.dirname(r),`${e}`))):w.relative(process.cwd(),w.join(w.dirname(r),`${o}`)):o,cwd:a}}a(Nx,`normalizeAndValidateBuild`);function Px(e,t){let n=w.dirname(e??`wrangler.toml`);if(t!==void 0)if(typeof t==`string`){let e=w.resolve(n);return w.resolve(e,t)}else return t;else return}a(Px,`normalizeAndValidateMainField`);function Fx(e,t){let n=w.dirname(e??`wrangler.toml`);if(t!==void 0)if(typeof t==`string`){let e=w.resolve(n);return w.resolve(e,t)}else return t;else return}a(Fx,`normalizeAndValidateBaseDirField`);function Ix(e,t){let n=w.dirname(e??`wrangler.toml`);if(t!==void 0)if(typeof t==`string`){let e=w.resolve(n);return w.resolve(e,t)}else return t;else return}a(Ix,`normalizeAndValidatePagesBuildOutputDir`);function Lx(e,t,n){x(typeof n==`object`&&!!n&&!Array.isArray(n));let{localProtocol:r,upstreamProtocol:i,remote:a,enableContainers:o,generateTypes:s}=n;x(r===void 0||r===`http`||r===`https`),x(i===void 0||i===`http`||i===`https`),x(a===void 0||typeof a==`boolean`),x(o===void 0||typeof o==`boolean`),x(s===void 0||typeof s==`boolean`);let{ip:c=process.platform===`win32`?`127.0.0.1`:`localhost`,port:l,inspector_port:u,inspector_ip:d,local_protocol:f=r??`http`,upstream_protocol:p=i??a?`https`:f,host:m,enable_containers:h=o??!0,container_engine:g,generate_types:_=s??!1,...v}=t;return Z(e,`dev`,Object.keys(v),[]),Y(e,`dev`,`ip`,c,`string`),Y(e,`dev`,`port`,l,`number`),Y(e,`dev`,`inspector_port`,u,`number`),Y(e,`dev`,`inspector_ip`,d,`string`),Y(e,`dev`,`local_protocol`,f,`string`,[`http`,`https`]),Y(e,`dev`,`upstream_protocol`,p,`string`,[`http`,`https`]),Y(e,`dev`,`host`,m,`string`),Y(e,`dev`,`enable_containers`,h,`boolean`),Y(e,`dev`,`container_engine`,g,`string`),Y(e,`dev`,`generate_types`,_,`boolean`),{ip:c,port:l,inspector_port:u,inspector_ip:d,local_protocol:f,upstream_protocol:p,host:m,enable_containers:h,container_engine:g,generate_types:_}}a(Lx,`normalizeAndValidateDev`);function Rx(e,t,n){return nx(e,t,n,`assets`,vS,void 0)}a(Rx,`normalizeAndValidateAssets`);function zx(e,t,n,r){if(n?.site!==void 0){let{bucket:i,include:a=[],exclude:o=[],...s}=n.site;Z(e,`site`,Object.keys(s),[`entry-point`]),px(e,`site`,`bucket`,i,`string`),hx(e,`sites.include`,a,`string`),hx(e,`sites.exclude`,o,`string`);let c=n.site[`entry-point`];Y(e,`site`,`entry-point`,c,`string`),ex(e,n,`site.entry-point`,`Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file:
271
271
  \`\`\`
272
- main = "${S.join(String(c)||`workers-site`,S.extname(String(c)||`workers-site`)?``:`index.js`)}"
273
- \`\`\``,!1,void 0,`warning`);let l=c;return!r&&!l?(e.warnings.push('Because you\'ve defined a [site] configuration, we\'re defaulting to "workers-site" for the deprecated `site.entry-point`field.\nAdd the top level `main` field to your configuration file:\n```\nmain = "workers-site/index.js"\n```'),l=`workers-site`):r&&l&&e.errors.push("Don't define both the `main` and `site.entry-point` fields in your configuration.\nThey serve the same purpose: to point to the entry-point of your worker.\nDelete the deprecated `site.entry-point` field from your config."),t&&l&&(l=S.relative(process.cwd(),S.join(S.dirname(t),l))),{bucket:i,"entry-point":l,include:a,exclude:o}}}a(zx,`normalizeAndValidateSite`);function Bx(e,t,n){if(n?.alias===void 0)return;if([`string`,`boolean`,`number`].includes(typeof n?.alias)||typeof n?.alias!=`object`){e.errors.push(`Expected alias to be an object, but got ${typeof n?.alias}`);return}let r=!0;for(let[t,i]of Object.entries(n?.alias))typeof i!=`string`&&(e.errors.push(`Expected alias["${t}"] to be a string, but got ${typeof i}`),r=!1);if(r)return n.alias}a(Bx,`normalizeAndValidateAliases`);function Vx(e,t,n,r){if(r===void 0)return;let i={};for(let[a,o]of Object.entries(r))ax(e,`${n}['${a}']`,o,void 0)&&t&&(i[a]=t?S.relative(process.cwd(),S.join(S.dirname(t),o)):o);return i}a(Vx,`normalizeAndValidateModulePaths`);function Hx(e){if(!e)return!1;if(typeof e==`string`)return!0;if(typeof e==`object`){if(!vx(e,`pattern`)||typeof e.pattern!=`string`)return!1;let t=vx(e,`zone_id`)&&typeof e.zone_id==`string`,n=vx(e,`zone_name`)&&typeof e.zone_name==`string`,r=vx(e,`custom_domain`)&&typeof e.custom_domain==`boolean`,i=vx(e,`enabled`)&&typeof e.enabled==`boolean`,a=vx(e,`previews_enabled`)&&typeof e.previews_enabled==`boolean`;if([t,n,r,i,a].filter(Boolean).length!==Object.keys(e).length-1||t&&n||(i||a)&&!r)return!1;if(t||n||r)return!0}return!1}a(Hx,`isValidRouteValue`);function Ux(e,t){return t.account_id===``&&(e.warnings.push(`The "account_id" field in your configuration is an empty string and will be ignored.
272
+ main = "${w.join(String(c)||`workers-site`,w.extname(String(c)||`workers-site`)?``:`index.js`)}"
273
+ \`\`\``,!1,void 0,`warning`);let l=c;return!r&&!l?(e.warnings.push('Because you\'ve defined a [site] configuration, we\'re defaulting to "workers-site" for the deprecated `site.entry-point`field.\nAdd the top level `main` field to your configuration file:\n```\nmain = "workers-site/index.js"\n```'),l=`workers-site`):r&&l&&e.errors.push("Don't define both the `main` and `site.entry-point` fields in your configuration.\nThey serve the same purpose: to point to the entry-point of your worker.\nDelete the deprecated `site.entry-point` field from your config."),t&&l&&(l=w.relative(process.cwd(),w.join(w.dirname(t),l))),{bucket:i,"entry-point":l,include:a,exclude:o}}}a(zx,`normalizeAndValidateSite`);function Bx(e,t,n){if(n?.alias===void 0)return;if([`string`,`boolean`,`number`].includes(typeof n?.alias)||typeof n?.alias!=`object`){e.errors.push(`Expected alias to be an object, but got ${typeof n?.alias}`);return}let r=!0;for(let[t,i]of Object.entries(n?.alias))typeof i!=`string`&&(e.errors.push(`Expected alias["${t}"] to be a string, but got ${typeof i}`),r=!1);if(r)return n.alias}a(Bx,`normalizeAndValidateAliases`);function Vx(e,t,n,r){if(r===void 0)return;let i={};for(let[a,o]of Object.entries(r))ax(e,`${n}['${a}']`,o,void 0)&&t&&(i[a]=t?w.relative(process.cwd(),w.join(w.dirname(t),o)):o);return i}a(Vx,`normalizeAndValidateModulePaths`);function Hx(e){if(!e)return!1;if(typeof e==`string`)return!0;if(typeof e==`object`){if(!vx(e,`pattern`)||typeof e.pattern!=`string`)return!1;let t=vx(e,`zone_id`)&&typeof e.zone_id==`string`,n=vx(e,`zone_name`)&&typeof e.zone_name==`string`,r=vx(e,`custom_domain`)&&typeof e.custom_domain==`boolean`,i=vx(e,`enabled`)&&typeof e.enabled==`boolean`,a=vx(e,`previews_enabled`)&&typeof e.previews_enabled==`boolean`;if([t,n,r,i,a].filter(Boolean).length!==Object.keys(e).length-1||t&&n||(i||a)&&!r)return!1;if(t||n||r)return!0}return!1}a(Hx,`isValidRouteValue`);function Ux(e,t){return t.account_id===``&&(e.warnings.push(`The "account_id" field in your configuration is an empty string and will be ignored.
274
274
  Please remove the "account_id" field from your configuration.`),t.account_id=void 0),t}a(Ux,`mutateEmptyStringAccountIDValue`);function Wx(e,t){return t.route===``&&(e.warnings.push(`The "route" field in your configuration is an empty string and will be ignored.
275
- Please remove the "route" field from your configuration.`),t.route=void 0),t}a(Wx,`mutateEmptyStringRouteValue`);var Gx=a((e,t,n)=>n!==void 0&&!Hx(n)?(e.errors.push(`Expected "${t}" to be either a string, or an object with shape { pattern, custom_domain, zone_id | zone_name, enabled, previews_enabled }, but got ${JSON.stringify(n)}.`),!1):!0,`isRoute`),Kx=a((e,t,n)=>{if(n===void 0)return!0;if(!Array.isArray(n))return e.errors.push(`Expected "${t}" to be an array but got ${JSON.stringify(n)}.`),!1;let r=[];for(let e of n)Hx(e)||r.push(e);return r.length>0&&e.errors.push(`Expected "${t}" to be an array of either strings or objects with the shape { pattern, custom_domain, zone_id | zone_name, enabled, previews_enabled }, but these weren't valid: ${JSON.stringify(r,null,2)}.`),r.length===0},`isRouteArray`);function qx(e,t,n){return nx(e,t,Wx(e,n),`route`,Gx,void 0)}a(qx,`normalizeAndValidateRoute`);function Jx(e,t,n,r){let i=nx(e,t,n,`routes`,ux(Kx,dx(n,`route`)),void 0);if(t!==void 0&&r!==void 0&&n.routes===void 0){let n=t.routes?.filter(e=>typeof e==`object`&&!!e&&e.custom_domain===!0);if(n&&n.length>0){let t=n.map(e=>e.pattern).join(`, `);e.warnings.push(`The "env.${r}" environment inherits the top-level \`routes\` configuration, which includes the custom domain(s): ${t}. Deploying this environment will reassign these custom domains away from the top-level Worker. Add \`"routes": []\` to "env.${r}" to prevent inheritance, or copy the route configuration from the top level to hide this warning.`)}}return i}a(Jx,`validateRoutes`);function Yx(e,t,n,r=`placement`){if(n.placement!==void 0){if(typeof n.placement!=`object`||n.placement===null||Array.isArray(n.placement))return e.errors.push(`The field "${r}" should be an object but got ${JSON.stringify(n.placement)}.`),nx(e,t,n,`placement`,()=>!0,void 0);let i=n.placement,a=`hint`in i,o=[`region`,`host`,`hostname`].filter(e=>e in i),s=o.length>0;if(a&&s)return e.errors.push(`"${r}" cannot have both "hint" (smart format) and "region"/"host"/"hostname" (targeted format) fields`),nx(e,t,n,`placement`,()=>!0,void 0);if(a){px(e,r,`mode`,i.mode,`string`,[`off`,`smart`]);let t=i.mode,n=i.hint;n!==void 0&&typeof n!=`string`&&e.errors.push(`"${r}.hint" must be a string when "${r}.mode" is "${t}"`),n&&t!==`smart`&&e.errors.push(`"${r}.hint" can only be set when "${r}.mode" is "smart"`)}else if(s){Y(e,r,`mode`,i.mode,`string`,[`targeted`]);for(let t of o)px(e,r,t,i[t],`string`),i[t]===``&&e.errors.push(`"${r}.${t}" must be a non-empty string.`);o.length>1&&e.errors.push(`"${r}" fields ${o.map(e=>`"${e}"`).join(`, `)} are mutually exclusive. Only one can be specified.`)}else px(e,r,`mode`,i.mode,`string`,[`off`,`smart`,`targeted`]),i.mode===`targeted`&&mx(e,r,[{key:`region`,value:i.region,type:`string`},{key:`host`,value:i.host,type:`string`},{key:`hostname`,value:i.hostname,type:`string`}])}return nx(e,t,n,`placement`,()=>!0,void 0)}a(Yx,`normalizeAndValidatePlacement`);function Xx(e,t,n){if(typeof n!=`object`||!n)return e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1;let r=!0;return r&&=px(e,t,`service`,n.service,`string`),r&&=Y(e,t,`environment`,n.environment,`string`),r}a(Xx,`validateTailConsumer`);var Zx=a((e,t,n)=>{if(!n)return!0;if(!Array.isArray(n))return e.errors.push(`Expected "${t}" to be an array but got ${JSON.stringify(n)}.`),!1;let r=!0;for(let i=0;i<n.length;i++)r=Xx(e,`${t}[${i}]`,n[i])&&r;return r},`validateTailConsumers`);function Qx(e,t,n){return typeof n!=`object`||!n||Array.isArray(n)?(e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1):px(e,t,`service`,n.service,`string`)}a(Qx,`validateStreamingTailConsumer`);var $x=a((e,t,n)=>{if(!n)return!0;if(!Array.isArray(n))return e.errors.push(`Expected "${t}" to be an array but got ${JSON.stringify(n)}.`),!1;let r=!0;for(let i=0;i<n.length;i++)r=Qx(e,`${t}[${i}]`,n[i])&&r;return r},`validateStreamingTailConsumers`);function eS(e,t,n,r,i,a=`top level`,o,s){ex(e,n,`node_compat`,'The "node_compat" field is no longer supported as of Wrangler v4. Instead, use the `nodejs_compat` compatibility flag. This includes the functionality from legacy `node_compat` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.',!0,`Removed`,`error`),(o===void 0||s?.unsafe===void 0)&&tx(e,n,`unsafe`);let c=qx(e,o,n),l=nx(e,o,Ux(e,n),`account_id`,ax,void 0),u=Jx(e,o,n,o===void 0?void 0:a),d=nx(e,o,n,`workers_dev`,fx,void 0),f=nx(e,o,n,`preview_urls`,fx,void 0),p=Nx(e,n,n.build??o?.build??{},t),m={account_id:l,compatibility_date:nx(e,o,n,`compatibility_date`,ZS,void 0),compatibility_flags:nx(e,o,n,`compatibility_flags`,cx,[]),jsx_factory:nx(e,o,n,`jsx_factory`,ax,`React.createElement`),jsx_fragment:nx(e,o,n,`jsx_fragment`,ax,`React.Fragment`),tsconfig:tS(e,o,n,t),rules:nS(e,o,n,a),name:nx(e,o,n,`name`,r?ax:ox,void 0,rx(a)),main:i?nx(e,o,n,`main`,ax,void 0):Px(t,nx(e,o,n,`main`,ax,void 0)),find_additional_modules:nx(e,o,n,`find_additional_modules`,fx,void 0),preserve_file_names:nx(e,o,n,`preserve_file_names`,fx,void 0),base_dir:Fx(t,nx(e,o,n,`base_dir`,ax,void 0)),route:c,routes:u,triggers:nx(e,o,n,`triggers`,iS,{crons:void 0}),assets:Rx(e,o,n),limits:aC(e,o,n),placement:Yx(e,o,n),build:p,workers_dev:d,preview_urls:f,vars:J(e,o,s,n,a,`vars`,cS(a),{}),secrets:J(e,o,s,n,a,`secrets`,lS(a),void 0),define:J(e,o,s,n,a,`define`,sS(a),{}),durable_objects:J(e,o,s,n,a,`durable_objects`,uS(a,fS),{bindings:[]}),workflows:J(e,o,s,n,a,`workflows`,ux($(a,hS),Cx),[]),migrations:nx(e,o,n,`migrations`,sC,[]),exports:nx(e,o,n,`exports`,hC,{}),kv_namespaces:J(e,o,s,n,a,`kv_namespaces`,$(a,kS),[]),cloudchamber:J(e,o,s,n,a,`cloudchamber`,OS,{}),containers:J(e,o,s,n,a,`containers`,DS(a,n.name??s?.name,t,{complianceConfig:{compliance_region:n.compliance_region??o?.compliance_region}}),void 0),send_email:J(e,o,s,n,a,`send_email`,$(a,AS),[]),queues:J(e,o,s,n,a,`queues`,qS(a),{producers:[],consumers:[]}),connect:J(e,o,s,n,a,`connect`,YS(a),[]),r2_buckets:J(e,o,s,n,a,`r2_buckets`,$(a,MS),[]),d1_databases:J(e,o,s,n,a,`d1_databases`,$(a,NS),[]),vectorize:J(e,o,s,n,a,`vectorize`,$(a,PS),[]),ai_search_namespaces:J(e,o,s,n,a,`ai_search_namespaces`,$(a,FS),[]),ai_search:J(e,o,s,n,a,`ai_search`,$(a,IS),[]),agent_memory:J(e,o,s,n,a,`agent_memory`,$(a,LS),[]),hyperdrive:J(e,o,s,n,a,`hyperdrive`,$(a,RS),[]),services:J(e,o,s,n,a,`services`,$(a,HS),[]),analytics_engine_datasets:J(e,o,s,n,a,`analytics_engine_datasets`,$(a,US),[]),dispatch_namespaces:J(e,o,s,n,a,`dispatch_namespaces`,$(a,WS),[]),mtls_certificates:J(e,o,s,n,a,`mtls_certificates`,$(a,KS),[]),tail_consumers:J(e,o,s,n,a,`tail_consumers`,Zx,void 0),streaming_tail_consumers:J(e,o,s,n,a,`streaming_tail_consumers`,$x,void 0),unsafe:J(e,o,s,n,a,`unsafe`,dS(a),{}),browser:J(e,o,s,n,a,`browser`,yS(a),void 0),ai:J(e,o,s,n,a,`ai`,bS(a),void 0),images:J(e,o,s,n,a,`images`,yS(a),void 0),stream:J(e,o,s,n,a,`stream`,yS(a),void 0),media:J(e,o,s,n,a,`media`,yS(a),void 0),pipelines:J(e,o,s,n,a,`pipelines`,$(a,QS),[]),secrets_store_secrets:J(e,o,s,n,a,`secrets_store_secrets`,$(a,$S),[]),artifacts:J(e,o,s,n,a,`artifacts`,$(a,eC),[]),unsafe_hello_world:J(e,o,s,n,a,`unsafe_hello_world`,$(a,tC),[]),flagship:J(e,o,s,n,a,`flagship`,$(a,nC),[]),worker_loaders:J(e,o,s,n,a,`worker_loaders`,$(a,rC),[]),ratelimits:J(e,o,s,n,a,`ratelimits`,$(a,iC),[]),vpc_services:J(e,o,s,n,a,`vpc_services`,$(a,zS),[]),vpc_networks:J(e,o,s,n,a,`vpc_networks`,$(a,BS),[]),version_metadata:J(e,o,s,n,a,`version_metadata`,xS(a),void 0),logfwdr:nx(e,o,n,`logfwdr`,gS(a),{bindings:[]}),no_bundle:nx(e,o,n,`no_bundle`,fx,void 0),minify:nx(e,o,n,`minify`,fx,void 0),keep_names:nx(e,o,n,`keep_names`,fx,void 0),first_party_worker:nx(e,o,n,`first_party_worker`,fx,void 0),logpush:nx(e,o,n,`logpush`,fx,void 0),upload_source_maps:nx(e,o,n,`upload_source_maps`,fx,void 0),observability:nx(e,o,n,`observability`,SC,void 0),access:nx(e,o,n,`access`,wC,void 0),cache:nx(e,o,n,`cache`,TC,void 0),compliance_region:nx(e,o,n,`compliance_region`,lx(`public`,`fedramp_high`),void 0),python_modules:nx(e,o,n,`python_modules`,kC,{exclude:[`**/*.pyc`]}),previews:nx(e,o,n,`previews`,oC(a,t),void 0)};EC(e,m.durable_objects,m.migrations,m.exports,t),DC(e,m.migrations,m.exports);let h=s===void 0?Object.values(`env`in n?n.env??{}:{}).some(e=>e?.containers!==void 0):s.containers!==void 0;return OC(e,m.containers,m.exports,h),a!==`top level`&&Z(e,`env.`+a,Object.keys(n),Object.keys(m)),m}a(eS,`normalizeAndValidateEnvironment`);function tS(e,t,n,r){let i=nx(e,t,n,`tsconfig`,ax,void 0);return r&&i?S.relative(process.cwd(),S.join(S.dirname(r),i)):i}a(tS,`validateAndNormalizeTsconfig`);var nS=a((e,t,n,r)=>nx(e,t,n,`rules`,aS(r),[]),`validateAndNormalizeRules`),rS=new Set(yo),iS=a((e,t,n)=>{if(n==null)return!0;if(typeof n!=`object`||Array.isArray(n))return e.errors.push(`Expected "${t}" to be of type object but got ${JSON.stringify(n)}.`),!1;let r=!0;if(`crons`in n&&!Array.isArray(n.crons)&&(e.errors.push(`Expected "${t}.crons" to be of type array, but got ${JSON.stringify(n)}.`),r=!1),vx(n,`events`)&&!Array.isArray(n.events))e.errors.push(`Expected "${t}.events" to be of type array, but got ${JSON.stringify(n)}.`),r=!1;else if(vx(n,`events`)&&Array.isArray(n.events))for(let[i,a]of n.events.entries()){let n=`${t}.events[${i}]`;if(typeof a!=`object`||!a||Array.isArray(a)){e.errors.push(`Expected "${n}" to be of type object, but got ${JSON.stringify(a)}.`),r=!1;continue}if((!X(a,`type`,`string`)||!rS.has(a.type))&&(e.errors.push(`Expected "${n}.type" to be a supported Artifacts event type, but got ${JSON.stringify(a.type)}.`),r=!1),vx(a,`filter`)&&a.filter!==void 0){if(typeof a.filter!=`object`||a.filter===null||Array.isArray(a.filter))e.errors.push(`Expected "${n}.filter" to be of type object, but got ${JSON.stringify(a.filter)}.`),r=!1;else for(let[t,i]of Object.entries(a.filter))if(t!==`namespace`&&t!==`repo_name`||typeof i!=`string`){e.errors.push(`Expected "${n}.filter" to contain only string "namespace" and "repo_name" fields, but got ${JSON.stringify(a.filter)}.`),r=!1;break}}if(!Array.isArray(a.targets)||a.targets.length===0)e.errors.push(`Expected "${n}.targets" to be a non-empty array, but got ${JSON.stringify(a.targets)}.`),r=!1;else for(let[t,i]of a.targets.entries()){let a=`${n}.targets[${t}]`;if(typeof i!=`object`||!i||Array.isArray(i)||i.type!==`workflow`||typeof i.workflow_name!=`string`||i.workflow_name.length===0){e.errors.push(`Expected "${a}" to be a workflow target with a non-empty "workflow_name", but got ${JSON.stringify(i)}.`),r=!1;continue}Z(e,a,Object.keys(i),[`type`,`workflow_name`])}Z(e,n,Object.keys(a),[`type`,`filter`,`targets`])}return r=Z(e,t,Object.keys(n),[`crons`,`events`])&&r,r},`validateTriggers`),aS=a(e=>(t,n,r,i)=>{if(!r)return!0;let a=i===void 0?`${n}`:`env.${e}.${n}`;if(!Array.isArray(r))return t.errors.push(`The field "${a}" should be an array but got ${JSON.stringify(r)}.`),!1;let o=!0;for(let e=0;e<r.length;e++)o=oS(t,`${a}[${e}]`,r[e],i)&&o;return o},`validateRules`),oS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1;let r=!0,i=n;return X(i,`type`,`string`,[`ESModule`,`CommonJS`,`CompiledWasm`,`Text`,`Data`])||(e.errors.push(`bindings should have a string "type" field, which contains one of "ESModule", "CommonJS", "CompiledWasm", "Text", or "Data".`),r=!1),r=hx(e,`${t}.globs`,i.globs,`string`)&&r,_x(i,`fallthrough`,`boolean`)||(e.errors.push(`the field "fallthrough", when present, should be a boolean.`),r=!1),r},`validateRule`),sS=a(e=>(t,n,r,i)=>{let a=!0,o=i===void 0?`${n}`:`env.${e}.${n}`;if(typeof r==`object`&&r)for(let e in r)typeof r[e]!=`string`&&(t.errors.push(`The field "${o}.${e}" should be a string but got ${JSON.stringify(r[e])}.`),a=!1);else r!==void 0&&(t.errors.push(`The field "${o}" should be an object but got ${JSON.stringify(r)}.
275
+ Please remove the "route" field from your configuration.`),t.route=void 0),t}a(Wx,`mutateEmptyStringRouteValue`);var Gx=a((e,t,n)=>n!==void 0&&!Hx(n)?(e.errors.push(`Expected "${t}" to be either a string, or an object with shape { pattern, custom_domain, zone_id | zone_name, enabled, previews_enabled }, but got ${JSON.stringify(n)}.`),!1):!0,`isRoute`),Kx=a((e,t,n)=>{if(n===void 0)return!0;if(!Array.isArray(n))return e.errors.push(`Expected "${t}" to be an array but got ${JSON.stringify(n)}.`),!1;let r=[];for(let e of n)Hx(e)||r.push(e);return r.length>0&&e.errors.push(`Expected "${t}" to be an array of either strings or objects with the shape { pattern, custom_domain, zone_id | zone_name, enabled, previews_enabled }, but these weren't valid: ${JSON.stringify(r,null,2)}.`),r.length===0},`isRouteArray`);function qx(e,t,n){return nx(e,t,Wx(e,n),`route`,Gx,void 0)}a(qx,`normalizeAndValidateRoute`);function Jx(e,t,n,r){let i=nx(e,t,n,`routes`,ux(Kx,dx(n,`route`)),void 0);if(t!==void 0&&r!==void 0&&n.routes===void 0){let n=t.routes?.filter(e=>typeof e==`object`&&!!e&&e.custom_domain===!0);if(n&&n.length>0){let t=n.map(e=>e.pattern).join(`, `);e.warnings.push(`The "env.${r}" environment inherits the top-level \`routes\` configuration, which includes the custom domain(s): ${t}. Deploying this environment will reassign these custom domains away from the top-level Worker. Add \`"routes": []\` to "env.${r}" to prevent inheritance, or copy the route configuration from the top level to hide this warning.`)}}return i}a(Jx,`validateRoutes`);function Yx(e,t,n,r=`placement`){if(n.placement!==void 0){if(typeof n.placement!=`object`||n.placement===null||Array.isArray(n.placement))return e.errors.push(`The field "${r}" should be an object but got ${JSON.stringify(n.placement)}.`),nx(e,t,n,`placement`,()=>!0,void 0);let i=n.placement,a=`hint`in i,o=[`region`,`host`,`hostname`].filter(e=>e in i),s=o.length>0;if(a&&s)return e.errors.push(`"${r}" cannot have both "hint" (smart format) and "region"/"host"/"hostname" (targeted format) fields`),nx(e,t,n,`placement`,()=>!0,void 0);if(a){px(e,r,`mode`,i.mode,`string`,[`off`,`smart`]);let t=i.mode,n=i.hint;n!==void 0&&typeof n!=`string`&&e.errors.push(`"${r}.hint" must be a string when "${r}.mode" is "${t}"`),n&&t!==`smart`&&e.errors.push(`"${r}.hint" can only be set when "${r}.mode" is "smart"`)}else if(s){Y(e,r,`mode`,i.mode,`string`,[`targeted`]);for(let t of o)px(e,r,t,i[t],`string`),i[t]===``&&e.errors.push(`"${r}.${t}" must be a non-empty string.`);o.length>1&&e.errors.push(`"${r}" fields ${o.map(e=>`"${e}"`).join(`, `)} are mutually exclusive. Only one can be specified.`)}else px(e,r,`mode`,i.mode,`string`,[`off`,`smart`,`targeted`]),i.mode===`targeted`&&mx(e,r,[{key:`region`,value:i.region,type:`string`},{key:`host`,value:i.host,type:`string`},{key:`hostname`,value:i.hostname,type:`string`}])}return nx(e,t,n,`placement`,()=>!0,void 0)}a(Yx,`normalizeAndValidatePlacement`);function Xx(e,t,n){if(typeof n!=`object`||!n)return e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1;let r=!0;return r&&=px(e,t,`service`,n.service,`string`),r&&=Y(e,t,`environment`,n.environment,`string`),r}a(Xx,`validateTailConsumer`);var Zx=a((e,t,n)=>{if(!n)return!0;if(!Array.isArray(n))return e.errors.push(`Expected "${t}" to be an array but got ${JSON.stringify(n)}.`),!1;let r=!0;for(let i=0;i<n.length;i++)r=Xx(e,`${t}[${i}]`,n[i])&&r;return r},`validateTailConsumers`);function Qx(e,t,n){return typeof n!=`object`||!n||Array.isArray(n)?(e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1):px(e,t,`service`,n.service,`string`)}a(Qx,`validateStreamingTailConsumer`);var $x=a((e,t,n)=>{if(!n)return!0;if(!Array.isArray(n))return e.errors.push(`Expected "${t}" to be an array but got ${JSON.stringify(n)}.`),!1;let r=!0;for(let i=0;i<n.length;i++)r=Qx(e,`${t}[${i}]`,n[i])&&r;return r},`validateStreamingTailConsumers`);function eS(e,t,n,r,i,a=`top level`,o,s){ex(e,n,`node_compat`,'The "node_compat" field is no longer supported as of Wrangler v4. Instead, use the `nodejs_compat` compatibility flag. This includes the functionality from legacy `node_compat` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.',!0,`Removed`,`error`),(o===void 0||s?.unsafe===void 0)&&tx(e,n,`unsafe`);let c=qx(e,o,n),l=nx(e,o,Ux(e,n),`account_id`,ax,void 0),u=Jx(e,o,n,o===void 0?void 0:a),d=nx(e,o,n,`workers_dev`,fx,void 0),f=nx(e,o,n,`preview_urls`,fx,void 0),p=Nx(e,n,n.build??o?.build??{},t),m={account_id:l,compatibility_date:nx(e,o,n,`compatibility_date`,ZS,void 0),compatibility_flags:nx(e,o,n,`compatibility_flags`,cx,[]),jsx_factory:nx(e,o,n,`jsx_factory`,ax,`React.createElement`),jsx_fragment:nx(e,o,n,`jsx_fragment`,ax,`React.Fragment`),tsconfig:tS(e,o,n,t),rules:nS(e,o,n,a),name:nx(e,o,n,`name`,r?ax:ox,void 0,rx(a)),main:i?nx(e,o,n,`main`,ax,void 0):Px(t,nx(e,o,n,`main`,ax,void 0)),find_additional_modules:nx(e,o,n,`find_additional_modules`,fx,void 0),preserve_file_names:nx(e,o,n,`preserve_file_names`,fx,void 0),base_dir:Fx(t,nx(e,o,n,`base_dir`,ax,void 0)),route:c,routes:u,triggers:nx(e,o,n,`triggers`,iS,{crons:void 0}),assets:Rx(e,o,n),limits:aC(e,o,n),placement:Yx(e,o,n),build:p,workers_dev:d,preview_urls:f,vars:J(e,o,s,n,a,`vars`,cS(a),{}),secrets:J(e,o,s,n,a,`secrets`,lS(a),void 0),define:J(e,o,s,n,a,`define`,sS(a),{}),durable_objects:J(e,o,s,n,a,`durable_objects`,uS(a,fS),{bindings:[]}),workflows:J(e,o,s,n,a,`workflows`,ux($(a,hS),Cx),[]),migrations:nx(e,o,n,`migrations`,sC,[]),exports:nx(e,o,n,`exports`,hC,{}),kv_namespaces:J(e,o,s,n,a,`kv_namespaces`,$(a,kS),[]),cloudchamber:J(e,o,s,n,a,`cloudchamber`,OS,{}),containers:J(e,o,s,n,a,`containers`,DS(a,n.name??s?.name,t,{complianceConfig:{compliance_region:n.compliance_region??o?.compliance_region}}),void 0),send_email:J(e,o,s,n,a,`send_email`,$(a,AS),[]),queues:J(e,o,s,n,a,`queues`,qS(a),{producers:[],consumers:[]}),connect:J(e,o,s,n,a,`connect`,YS(a),[]),r2_buckets:J(e,o,s,n,a,`r2_buckets`,$(a,MS),[]),d1_databases:J(e,o,s,n,a,`d1_databases`,$(a,NS),[]),vectorize:J(e,o,s,n,a,`vectorize`,$(a,PS),[]),ai_search_namespaces:J(e,o,s,n,a,`ai_search_namespaces`,$(a,FS),[]),ai_search:J(e,o,s,n,a,`ai_search`,$(a,IS),[]),agent_memory:J(e,o,s,n,a,`agent_memory`,$(a,LS),[]),hyperdrive:J(e,o,s,n,a,`hyperdrive`,$(a,RS),[]),services:J(e,o,s,n,a,`services`,$(a,HS),[]),analytics_engine_datasets:J(e,o,s,n,a,`analytics_engine_datasets`,$(a,US),[]),dispatch_namespaces:J(e,o,s,n,a,`dispatch_namespaces`,$(a,WS),[]),mtls_certificates:J(e,o,s,n,a,`mtls_certificates`,$(a,KS),[]),tail_consumers:J(e,o,s,n,a,`tail_consumers`,Zx,void 0),streaming_tail_consumers:J(e,o,s,n,a,`streaming_tail_consumers`,$x,void 0),unsafe:J(e,o,s,n,a,`unsafe`,dS(a),{}),browser:J(e,o,s,n,a,`browser`,yS(a),void 0),ai:J(e,o,s,n,a,`ai`,bS(a),void 0),images:J(e,o,s,n,a,`images`,yS(a),void 0),stream:J(e,o,s,n,a,`stream`,yS(a),void 0),media:J(e,o,s,n,a,`media`,yS(a),void 0),pipelines:J(e,o,s,n,a,`pipelines`,$(a,QS),[]),secrets_store_secrets:J(e,o,s,n,a,`secrets_store_secrets`,$(a,$S),[]),artifacts:J(e,o,s,n,a,`artifacts`,$(a,eC),[]),unsafe_hello_world:J(e,o,s,n,a,`unsafe_hello_world`,$(a,tC),[]),flagship:J(e,o,s,n,a,`flagship`,$(a,nC),[]),worker_loaders:J(e,o,s,n,a,`worker_loaders`,$(a,rC),[]),ratelimits:J(e,o,s,n,a,`ratelimits`,$(a,iC),[]),vpc_services:J(e,o,s,n,a,`vpc_services`,$(a,zS),[]),vpc_networks:J(e,o,s,n,a,`vpc_networks`,$(a,BS),[]),version_metadata:J(e,o,s,n,a,`version_metadata`,xS(a),void 0),logfwdr:nx(e,o,n,`logfwdr`,gS(a),{bindings:[]}),no_bundle:nx(e,o,n,`no_bundle`,fx,void 0),minify:nx(e,o,n,`minify`,fx,void 0),keep_names:nx(e,o,n,`keep_names`,fx,void 0),first_party_worker:nx(e,o,n,`first_party_worker`,fx,void 0),logpush:nx(e,o,n,`logpush`,fx,void 0),upload_source_maps:nx(e,o,n,`upload_source_maps`,fx,void 0),observability:nx(e,o,n,`observability`,SC,void 0),access:nx(e,o,n,`access`,wC,void 0),cache:nx(e,o,n,`cache`,TC,void 0),compliance_region:nx(e,o,n,`compliance_region`,lx(`public`,`fedramp_high`),void 0),python_modules:nx(e,o,n,`python_modules`,kC,{exclude:[`**/*.pyc`]}),previews:nx(e,o,n,`previews`,oC(a,t),void 0)};EC(e,m.durable_objects,m.migrations,m.exports,t),DC(e,m.migrations,m.exports);let h=s===void 0?Object.values(`env`in n?n.env??{}:{}).some(e=>e?.containers!==void 0):s.containers!==void 0;return OC(e,m.containers,m.exports,h),a!==`top level`&&Z(e,`env.`+a,Object.keys(n),Object.keys(m)),m}a(eS,`normalizeAndValidateEnvironment`);function tS(e,t,n,r){let i=nx(e,t,n,`tsconfig`,ax,void 0);return r&&i?w.relative(process.cwd(),w.join(w.dirname(r),i)):i}a(tS,`validateAndNormalizeTsconfig`);var nS=a((e,t,n,r)=>nx(e,t,n,`rules`,aS(r),[]),`validateAndNormalizeRules`),rS=new Set(yo),iS=a((e,t,n)=>{if(n==null)return!0;if(typeof n!=`object`||Array.isArray(n))return e.errors.push(`Expected "${t}" to be of type object but got ${JSON.stringify(n)}.`),!1;let r=!0;if(`crons`in n&&!Array.isArray(n.crons)&&(e.errors.push(`Expected "${t}.crons" to be of type array, but got ${JSON.stringify(n)}.`),r=!1),vx(n,`events`)&&!Array.isArray(n.events))e.errors.push(`Expected "${t}.events" to be of type array, but got ${JSON.stringify(n)}.`),r=!1;else if(vx(n,`events`)&&Array.isArray(n.events))for(let[i,a]of n.events.entries()){let n=`${t}.events[${i}]`;if(typeof a!=`object`||!a||Array.isArray(a)){e.errors.push(`Expected "${n}" to be of type object, but got ${JSON.stringify(a)}.`),r=!1;continue}if((!X(a,`type`,`string`)||!rS.has(a.type))&&(e.errors.push(`Expected "${n}.type" to be a supported Artifacts event type, but got ${JSON.stringify(a.type)}.`),r=!1),vx(a,`filter`)&&a.filter!==void 0){if(typeof a.filter!=`object`||a.filter===null||Array.isArray(a.filter))e.errors.push(`Expected "${n}.filter" to be of type object, but got ${JSON.stringify(a.filter)}.`),r=!1;else for(let[t,i]of Object.entries(a.filter))if(t!==`namespace`&&t!==`repo_name`||typeof i!=`string`){e.errors.push(`Expected "${n}.filter" to contain only string "namespace" and "repo_name" fields, but got ${JSON.stringify(a.filter)}.`),r=!1;break}}if(!Array.isArray(a.targets)||a.targets.length===0)e.errors.push(`Expected "${n}.targets" to be a non-empty array, but got ${JSON.stringify(a.targets)}.`),r=!1;else for(let[t,i]of a.targets.entries()){let a=`${n}.targets[${t}]`;if(typeof i!=`object`||!i||Array.isArray(i)||i.type!==`workflow`||typeof i.workflow_name!=`string`||i.workflow_name.length===0){e.errors.push(`Expected "${a}" to be a workflow target with a non-empty "workflow_name", but got ${JSON.stringify(i)}.`),r=!1;continue}Z(e,a,Object.keys(i),[`type`,`workflow_name`])}Z(e,n,Object.keys(a),[`type`,`filter`,`targets`])}return r=Z(e,t,Object.keys(n),[`crons`,`events`])&&r,r},`validateTriggers`),aS=a(e=>(t,n,r,i)=>{if(!r)return!0;let a=i===void 0?`${n}`:`env.${e}.${n}`;if(!Array.isArray(r))return t.errors.push(`The field "${a}" should be an array but got ${JSON.stringify(r)}.`),!1;let o=!0;for(let e=0;e<r.length;e++)o=oS(t,`${a}[${e}]`,r[e],i)&&o;return o},`validateRules`),oS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1;let r=!0,i=n;return X(i,`type`,`string`,[`ESModule`,`CommonJS`,`CompiledWasm`,`Text`,`Data`])||(e.errors.push(`bindings should have a string "type" field, which contains one of "ESModule", "CommonJS", "CompiledWasm", "Text", or "Data".`),r=!1),r=hx(e,`${t}.globs`,i.globs,`string`)&&r,_x(i,`fallthrough`,`boolean`)||(e.errors.push(`the field "fallthrough", when present, should be a boolean.`),r=!1),r},`validateRule`),sS=a(e=>(t,n,r,i)=>{let a=!0,o=i===void 0?`${n}`:`env.${e}.${n}`;if(typeof r==`object`&&r)for(let e in r)typeof r[e]!=`string`&&(t.errors.push(`The field "${o}.${e}" should be a string but got ${JSON.stringify(r[e])}.`),a=!1);else r!==void 0&&(t.errors.push(`The field "${o}" should be an object but got ${JSON.stringify(r)}.
276
276
  `),a=!1);let s=Object.keys(i?.define??{});if(s.length>0&&typeof r==`object`&&r){let n=i===void 0?[]:Object.keys(r),a=s.filter(e=>!(e in r));a.length>0&&t.warnings.push(`The following define entries exist at the top level, but not on "${o}".
277
277
  This is probably not what you want, since "define" configuration is not inherited by environments.
278
278
  Please add these entries to "env.${e}.define":
@@ -292,31 +292,31 @@ Please add a binding for each to "${s}.bindings":
292
292
  Consider migrating this unsafe binding to a format for '${n.type}' bindings that is supported by wrangler for optimal support.
293
293
  For more details, see https://developers.cloudflare.com/workers/cli-wrangler/configuration`),n.type===`metadata`&&X(n,`name`,`string`)&&e.warnings.push(`The deployment object in the metadata binding is now deprecated. Please switch using the version_metadata binding for access to version specific fields: https://developers.cloudflare.com/workers/runtime-apis/bindings/version-metadata`)):(e.errors.push(`binding should have a string "type" field.`),r=!1),r},`validateUnsafeBinding`),$=a((e,t)=>(n,r,i,a)=>{if(i===void 0)return!0;let o=a===void 0?`${r}`:`env.${e}.${r}`;if(!Array.isArray(i))return n.errors.push(`The field "${o}" should be an array but got ${JSON.stringify(i)}.`),!1;let s=!0;for(let e=0;e<i.length;e++)s=t(n,`${o}[${e}]`,i[e],a)&&s;let c=a?.[r];if(Array.isArray(c)){let t=c.map(e=>e.binding);if(t.length>0){let a=new Set(i.map(e=>e.binding));for(let i of t)a.has(i)||n.warnings.push(`There is a ${r} binding with name "${i}" at the top level, but not on "env.${e}".
294
294
  This is not what you probably want, since "${r}" configuration is not inherited by environments.
295
- Please add a binding for "${i}" to "env.${e}.${r}.bindings".`)}}return s},`validateBindingArray`);function CS(e,t,n,r){if(!Array.isArray(n)){e.errors.push(`${t} must be an array`);return}for(let[i,a]of n.entries()){let n=`${t}[${i}]`;if(typeof a!=`object`||!a||Array.isArray(a)){e.errors.push(`${n} must be an object`);continue}(r?X(a,`name`,`string`):_x(a,`name`,`string`))||e.errors.push(`${n}.name must be a string`),X(a,`public_key`,`string`)?a.public_key.toLowerCase().startsWith(`ssh-ed25519`)||e.errors.push(`${n}.public_key is an unsupported key type. Please provide an ED25519 public key.`):e.errors.push(`${n}.public_key must be a string`)}}a(CS,`validateSshPublicKeys`);function wS(e,t){let n=DS(e,void 0,t,{generateDefaultName:!1});return(e,t,r,i)=>{if(Array.isArray(r)){let n=[...r.entries()].filter(([,e])=>e&&typeof e==`object`&&e.scheduling_policy===`durable_object`).map(([e])=>`"${t}[${e}].scheduling_policy"`);if(n.length>0)return e.errors.push(`${n.join(`, `)} cannot be "durable_object". Durable Object-managed Containers are configured only in the top-level "containers" array.`),!1;let i=[...r.entries()].filter(([,e])=>e&&typeof e==`object`&&`name`in e).map(([e])=>`"${t}[${e}].name"`);if(i.length>0)return e.errors.push(`${i.join(`, `)} cannot be set. A preview container's application name is generated from the worker name, preview slug, and Durable Object class name, so that separate previews of the same Worker do not collide. Remove it and identify the container with "class_name".`),!1;let a=new Set,o=new Set;for(let e of r)!e||typeof e!=`object`||typeof e.class_name==`string`&&(a.has(e.class_name)&&o.add(e.class_name),a.add(e.class_name));if(o.size>0){let n=[...o].map(e=>`"${e}"`).join(`, `);return e.errors.push(`"${t}" declares more than one container for the Durable Object class ${n}; each Durable Object class may appear at most once.`),!1}}return n(e,t,r,i)}}a(wS,`validatePreviewsContainers`);function TS(e,t,n,r){if(n===void 0)return!0;if(typeof n!=`object`||!n||Array.isArray(n)||Object.keys(n).length===0)return e.errors.push(`"${t}" must be a non-empty object when present.`),!1;let i=!0,a=Object.entries(n);a.length>100&&(e.errors.push(`"${t}" must contain at most 100 images.`),i=!1);for(let[n,o]of a){let a=`${t}.${n}`;if((n.length===0||n.length>128)&&(e.errors.push(`"${t}" image names must be between 1 and 128 characters.`),i=!1),typeof o!=`object`||!o||Array.isArray(o)){e.errors.push(`"${a}" must be an object with either a "dockerfile" or "image" field.`),i=!1;continue}let s=o,c=s.dockerfile!==void 0,l=s.image!==void 0;if(c===l&&(e.errors.push(`"${a}" must specify exactly one of "dockerfile" or "image".`),i=!1),c&&(typeof s.dockerfile!=`string`||s.dockerfile.length===0)&&(e.errors.push(`"${a}.dockerfile" must be a non-empty string.`),i=!1),l&&(typeof s.image!=`string`||s.image.length===0)&&(e.errors.push(`"${a}.image" must be a non-empty string.`),i=!1),typeof s.image==`string`&&s.image.length>0){let t=rr(r),n=`${t}/`,o=s.image.slice(n.length),c=o.match(/^[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*)+@sha256:[a-f0-9]{64}$/);(!s.image.startsWith(n)||c?.[0]!==o)&&(e.errors.push(`"${a}.image" must be a digest-pinned image in the managed registry, in the form "${t}/<account-id>/<repository>@sha256:<64 lowercase hex characters>".`),i=!1)}let u=c&&!l;u&&(s.build_context!==void 0&&(typeof s.build_context!=`string`||s.build_context.length===0)&&(e.errors.push(`"${a}.build_context" must be a non-empty string.`),i=!1),s.build_vars!==void 0&&(typeof s.build_vars!=`object`||s.build_vars===null||Array.isArray(s.build_vars)||Object.values(s.build_vars).some(e=>typeof e!=`string`))&&(e.errors.push(`"${a}.build_vars" must be an object with string values.`),i=!1));let d=Object.keys(s).filter(e=>e!==`dockerfile`&&e!==`image`&&!(u&&(e===`build_context`||e===`build_vars`)));d.length>0&&(e.errors.push(`Unexpected fields found in ${a} field: ${d.map(e=>`"${e}"`).join(`, `)}`),i=!1)}return i}a(TS,`validateDurableObjectContainerImages`);function ES(e,t,n){if(n===void 0)return;if(typeof n!=`object`||!n||Array.isArray(n)){e.errors.push(`"${t}" should be an object.`);return}let r=n,i=r.configuration;if(Object.keys(r).some(e=>e!==`configuration`)||i!==void 0&&(typeof i!=`object`||!i||Array.isArray(i)||Object.keys(i).some(e=>e!==`experimental_flags`))){e.errors.push(`Only "${t}.configuration.experimental_flags" is supported for Durable Object-managed Containers.`);return}if(i!==void 0){let n=i.experimental_flags;n!==void 0&&(!Array.isArray(n)||n.some(e=>typeof e!=`string`))&&e.errors.push(`"${t}.configuration.experimental_flags" should be an array of strings.`)}}a(ES,`validateDurableObjectContainerUnsafe`);function DS(e,t,n,r={}){let{generateDefaultName:i=!0}=r;return(a,o,s,c)=>{if(!s)return!0;if(!Array.isArray(s))return a.errors.push(`"containers" field should be an array, but got ${JSON.stringify(s)}`),!1;for(let l of s){let s=l.scheduling_policy===`durable_object`,u=typeof l.class_name==`string`&&l.class_name.length>0;if(Y(a,o,`class_name`,l.class_name,`string`),s&&l.class_name===``&&a.errors.push(`"containers.class_name" must be a non-empty string when specified for a Durable Object-managed Container.`),Y(a,o,`name`,l.name,`string`),i&&!l.name&&(!s||l.class_name===void 0||u))if(l.class_name===void 0)a.errors.push('"containers.name" is required when "containers.class_name" is not defined, because there is no class name to derive a default name from. Either name this container and reference it from a Durable Object\'s `exports` entry, or set "containers.class_name".');else if(!t)a.errors.push(`Must have either a top level "name" and "containers.class_name" field defined, or have field "containers.name" defined.`);else{let n=`${t}-${l.class_name}`;n+=c===void 0?``:`-${e}`,l.name=n.toLowerCase().replace(/ /g,`-`)}if(s){TS(a,`${o}.images`,l.images,r.complianceConfig),xC(a,`${o}.observability`,l.observability,c),(l.observability?.target_instance_count!==void 0||l.observability?.target_instance_percentage!==void 0)&&a.errors.push(`"${o}.observability" only supports enabling or disabling logs for Durable Object-managed Containers; instance targeting is not supported.`),ES(a,`${o}.unsafe`,l.unsafe);let e=Object.keys(l).filter(e=>![`name`,`class_name`,`scheduling_policy`,`images`,`observability`,`unsafe`].includes(e));e.length>0&&a.errors.push(`Unsupported fields for Durable Object-managed Containers in ${o}: ${e.map(e=>`"${e}"`).join(`,`)}. Only "name", "class_name", "scheduling_policy", "images", "observability", and restricted "unsafe" settings are supported.`);continue}!l.configuration?.image&&!l.image&&a.errors.push(`"containers.image" field must be defined for each container app. This should be the path to your Dockerfile or an image URI pointing to the Cloudflare registry.`),`configuration`in l&&(a.warnings.push(`"containers.configuration" is deprecated. Use top level "containers" fields instead. "configuration.image" should be "image", limits should be set via "instance_type".`),typeof l.configuration!=`object`||l.configuration===null||Array.isArray(l.configuration)?a.errors.push(`"containers.configuration" should be an object`):l.instance_type&&(l.configuration.disk!==void 0||l.configuration.vcpu!==void 0||l.configuration.memory_mib!==void 0)&&a.errors.push(`Cannot set custom limits via "containers.configuration" and use preset "instance_type" limits at the same time.`)),Y(a,o,`image_build_context`,l.image_build_context,`string`);let d=l.image??l.configuration?.image,f;try{if(jC(d,n)){let e=n?S.dirname(n):process.cwd();d=S.resolve(e,d),f=l.image_build_context?S.resolve(e,l.image_build_context):S.dirname(d)}}catch(e){if(e instanceof Error&&e.message)a.errors.push(e.message);else throw e}if(l.image=d,l.image_build_context=f,l.rollout_step_percentage!==void 0){let e=l.rollout_step_percentage;if(typeof e==`number`)[5,10,20,25,50,100].includes(e)||a.errors.push(`"containers.rollout_step_percentage" must be one of [5, 10, 20, 25, 50, 100], but got ${e}`);else if(Array.isArray(e)){let t=[],n=[],r=0,i=!0;for(let o of e)typeof o==`number`?((o<10||o>100)&&n.push(o),i&&r>0&&o<e[r-1]&&(a.errors.push(`"containers.rollout_step_percentage" array elements must be in ascending order, but got "${e}"`),i=!1),r===e.length-1&&o!==100&&a.errors.push(`The final step in "containers.rollout_step_percentage" must be 100, but got "${o}"`),r++):t.push(o);t.length&&a.errors.push(`"containers.rollout_step_percentage" array elements must be numbers, but got "${t.join(`, `)}"`),n.length&&a.errors.push(`"containers.rollout_step_percentage" array elements must be between 10 and 100, but got "${n.join(`, `)}"`)}else a.errors.push(`"containers.rollout_step_percentage" must be a number or array of numbers, but got "${e}"`)}if(Y(a,o,`rollout_kind`,l.rollout_kind,`string`,[`full_auto`,`full_manual`,`none`]),(!_x(l,`rollout_active_grace_period`,`number`)||l.rollout_active_grace_period<0)&&a.errors.push(`"containers.rollout_active_grace_period" field should be a positive number but got "${l.rollout_active_grace_period}"`),Y(a,o,`max_instances`,l.max_instances,`number`),l.max_instances!==void 0&&l.max_instances<0&&a.errors.push(`"containers.max_instances" field should be a positive number, but got ${l.max_instances}`),l.rollout_step_percentage!==void 0&&l.max_instances!==void 0&&Array.isArray(l.rollout_step_percentage)){let e=l.rollout_step_percentage.length;e>l.max_instances&&a.errors.push(`"containers.rollout_step_percentage" cannot have more steps (${e}) than "max_instances" (${l.max_instances})`)}Y(a,o,`image_vars`,l.image_vars,`object`),xC(a,`${o}.observability`,l.observability,c),Y(a,o,`scheduling_policy`,l.scheduling_policy,`string`,[`regional`,`moon`,`default`]),`instances`in l&&a.warnings.push(`"containers.instances" is deprecated. Use "containers.max_instances" instead.`),`durable_objects`in l&&a.warnings.push(`"containers.durable_objects" is deprecated. Use the "class_name" field instead.`),`wrangler_ssh`in l&&a.warnings.push(`"containers.wrangler_ssh" is deprecated. Use "containers.ssh" instead.`),`unsafe`in l&&(l.unsafe&&typeof l.unsafe!=`object`||Array.isArray(l.unsafe))&&a.errors.push(`The field "containers.unsafe" should be an object but got ${JSON.stringify(typeof l.unsafe)}.`),Z(a,o,Object.keys(l),[`name`,`instances`,`max_instances`,`image`,`image_build_context`,`image_vars`,`observability`,`class_name`,`scheduling_policy`,`instance_type`,`ssh`,`wrangler_ssh`,`authorized_keys`,`trusted_user_ca_keys`,`configuration`,`constraints`,`affinities`,`rollout_step_percentage`,`rollout_kind`,`durable_objects`,`rollout_active_grace_period`,`unsafe`]),typeof l.configuration==`object`&&l.configuration!==null&&!Array.isArray(l.configuration)&&Z(a,`${o}.configuration`,Object.keys(l.configuration),[`image`,`secrets`,`labels`,`disk`,`vcpu`,`memory_mib`]);let p,m;if(`ssh`in l?(p=`ssh`,m=l.ssh,l.wrangler_ssh=l.ssh,delete l.ssh):`wrangler_ssh`in l&&(p=`wrangler_ssh`,m=l.wrangler_ssh),p!==void 0){let e=typeof m==`object`&&m?m:{};X(e,`enabled`,`boolean`)||a.errors.push(`${o}.${p}.enabled must be a boolean`);let t=`port`in e?e.port:void 0;(!_x(e,`port`,`number`)||typeof t==`number`&&(t<1||t>65535))&&a.errors.push(`${o}.${p}.port must be a number between 1 and 65535 inclusive`)}if(`authorized_keys`in l&&CS(a,`${o}.authorized_keys`,l.authorized_keys,!0),`trusted_user_ca_keys`in l&&CS(a,`${o}.trusted_user_ca_keys`,l.trusted_user_ca_keys,!1),Y(a,o,`constraints`,l.constraints,`object`)&&l.constraints){let e=l.constraints;if(`tier`in e&&(a.warnings.push(`"constraints.tier" has been deprecated in favor of "constraints.tiers". Please update your configuration to use "constraints.tiers" instead.`),`tiers`in e&&a.errors.push(`${o}.constraints.tier and ${o}.constraints.tiers cannot both be set`)),gx(a,`${o}.constraints.tiers`,e.tiers,`number`),Y(a,`${o}.constraints`,`jurisdiction`,e.jurisdiction,`string`),e.jurisdiction&&![`eu`,`fedramp`].includes(e.jurisdiction)&&a.errors.push(`${o}.constraints.jurisdiction must be one of: "eu", "fedramp"`),gx(a,`${o}.constraints.regions`,e.regions,`string`)&&e.regions&&Array.isArray(e.regions)){let t=[`ENAM`,`WNAM`,`EEUR`,`WEUR`,`APAC`,`SAM`,`ME`,`OC`,`AFR`];for(let n of e.regions)typeof n==`string`&&!t.includes(n.toUpperCase())&&a.errors.push(`${o}.constraints.regions contains invalid region "${n}". Valid regions are: ${t.join(`, `)}`)}}if(typeof l.instance_type==`string`)Y(a,o,`instance_type`,l.instance_type,`string`,kx),l.instance_type===`dev`&&a.warnings.push(`The "dev" instance_type has been renamed to "lite" and will be removed in a subsequent version. Please update your configuration to use "lite" instead.`),l.instance_type===`standard`&&a.warnings.push(`The "standard" instance_type has been renamed to "standard-1" and will be removed in a subsequent version. Please update your configuration to use "standard-1" instead.`);else if(Y(a,o,`instance_type`,l.instance_type,`object`)&&l.instance_type){let e=[`vcpu`,`memory_mib`,`disk_mb`];e.forEach(e=>{_x(l.instance_type,e,`number`)||a.errors.push(`"containers.instance_type.${e}", when present, should be a number.`)}),Z(a,`${o}.instance_type`,Object.keys(l.instance_type),e)}}return!(a.errors.length>0)}}a(DS,`validateContainerApp`);var OS=a((e,t,n)=>{if(typeof n!=`object`||!n||Array.isArray(n))return e.errors.push(`"cloudchamber" should be an object, but got ${JSON.stringify(n)}`),!1;let r={string:[`memory`,`image`,`location`],boolean:[`ipv4`],number:[`vcpu`]},i=!0;return Object.entries(r).forEach(([r,a])=>{a.forEach(a=>{_x(n,a,r)||(e.errors.push(`"${t}" bindings should, optionally, have a ${r} "${a}" field but got ${JSON.stringify(n)}.`),i=!1)})}),`instance_type`in n&&n.instance_type!==void 0&&((typeof n.instance_type!=`string`||!kx.includes(n.instance_type))&&e.errors.push(`"instance_type" should be one of 'lite', 'basic', 'standard-1', 'standard-2', 'standard-3', or 'standard-4', but got ${n.instance_type}`),(`memory`in n&&n.memory!==void 0||`vcpu`in n&&n.vcpu!==void 0)&&e.errors.push(`"${t}" configuration should not set either "memory" or "vcpu" with "instance_type"`)),i},`validateCloudchamberConfig`),kS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"kv_namespaces" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),(!_x(n,`id`,`string`)||n.id!==void 0&&n.id.length===0)&&(e.errors.push(`"${t}" bindings should have a string "id" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`preview_id`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "preview_id" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`binding`,`id`,`preview_id`,`remote`]),r},`validateKVBinding`),AS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"send_email" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`name`,`string`)||(e.errors.push(`"${t}" bindings should have a string "name" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`destination_address`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "destination_address" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`allowed_destination_addresses`,`object`)||(e.errors.push(`"${t}" bindings should, optionally, have a []string "allowed_destination_addresses" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`allowed_sender_addresses`,`object`)||(e.errors.push(`"${t}" bindings should, optionally, have a []string "allowed_sender_addresses" field but got ${JSON.stringify(n)}.`),r=!1),`destination_address`in n&&`allowed_destination_addresses`in n&&(e.errors.push(`"${t}" bindings should have either a "destination_address" or "allowed_destination_addresses" field, but not both.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`allowed_sender_addresses`,`allowed_destination_addresses`,`destination_address`,`name`,`binding`,`remote`]),r},`validateSendEmailBinding`),jS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"queue" bindings should be objects, but got ${JSON.stringify(n)}`),!1;if(!Z(e,t,Object.keys(n),[`binding`,`queue`,`delivery_delay`,`remote`]))return!1;let r=!0;X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),(!_x(n,`queue`,`string`)||vx(n,`queue`)&&n.queue===``)&&(e.errors.push(`"${t}" bindings should optionally have a non-empty string "queue" field but got ${JSON.stringify(n)}.`),r=!1);for(let i of[{key:`delivery_delay`,type:`number`}])_x(n,i.key,i.type)||(e.errors.push(`"${t}" should, optionally, have a ${i.type} "${i.key}" field but got ${JSON.stringify(n)}.`),r=!1);return vx(n,`delivery_delay`)&&n.delivery_delay!==void 0&&e.warnings.push(`The "delivery_delay" field in "${t}" is deprecated and has no effect. Queue-level settings should be configured using "wrangler queues update" instead. This setting will be removed in a future version.`),AC(n,t,e)||(r=!1),r},`validateQueueBinding`),MS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"r2_buckets" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;if(X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),(!_x(n,`bucket_name`,`string`)||n.bucket_name!==void 0&&n.bucket_name.length===0)&&(e.errors.push(`"${t}" bindings should have a string "bucket_name" field but got ${JSON.stringify(n)}.`),r=!1),r&&vx(n,`bucket_name`)&&!wx(n.bucket_name)&&(e.errors.push(`${t}.bucket_name=${JSON.stringify(n.bucket_name)} is invalid. ${Tx}`),r=!1),_x(n,`preview_bucket_name`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "preview_bucket_name" field but got ${JSON.stringify(n)}.`),r=!1),r&&vx(n,`preview_bucket_name`)&&!wx(n.preview_bucket_name)&&(e.errors.push(`${t}.preview_bucket_name= ${JSON.stringify(n.preview_bucket_name)} is invalid. ${Tx}`),r=!1),_x(n,`jurisdiction`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "jurisdiction" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),vx(n,`local_dev`)){let i=n.local_dev;if(typeof i!=`object`||!i)e.errors.push(`"${t}" bindings should, optionally, have an object "local_dev" field but got ${JSON.stringify(n)}.`),r=!1;else{if(tx(e,{local_dev:i},`local_dev.experimental_s3_credentials`),vx(i,`experimental_s3_credentials`)){let a=i.experimental_s3_credentials;(typeof a!=`object`||!a||!X(a,`accessKeyId`,`string`)||!X(a,`secretAccessKey`,`string`))&&(e.errors.push(`"${t}" bindings should, optionally, have a "local_dev.experimental_s3_credentials" field with string "accessKeyId" and "secretAccessKey" fields, but got ${JSON.stringify(n)}.`),r=!1)}Z(e,`${t}.local_dev`,Object.keys(i),[`experimental_s3_credentials`])}}return Z(e,t,Object.keys(n),[`binding`,`bucket_name`,`preview_bucket_name`,`jurisdiction`,`remote`,`local_dev`]),r},`validateR2Binding`),NS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"d1_databases" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`database_id`,`string`)||(e.errors.push(`"${t}" bindings must have a "database_id" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`preview_database_id`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "preview_database_id" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),_x(n,`migrations_pattern`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "migrations_pattern" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`database_name`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "database_name" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`migrations_dir`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "migrations_dir" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`migrations_table`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "migrations_table" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`database_internal_env`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "database_internal_env" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`database_id`,`database_internal_env`,`database_name`,`migrations_dir`,`migrations_pattern`,`migrations_table`,`preview_database_id`,`remote`]),r},`validateD1Binding`),PS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"vectorize" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`index_name`,`string`)||(e.errors.push(`"${t}" bindings must have an "index_name" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`binding`,`index_name`,`remote`]),r},`validateVectorizeBinding`),FS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"ai_search_namespaces" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`namespace`,`string`)||(e.errors.push(`"${t}" bindings must have a "namespace" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`binding`,`namespace`,`remote`]),r},`validateAISearchNamespaceBinding`),IS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"ai_search" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`instance_name`,`string`)||(e.errors.push(`"${t}" bindings must have an "instance_name" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`binding`,`instance_name`,`remote`]),r},`validateAISearchBinding`),LS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"agent_memory" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`namespace`,`string`)||(e.errors.push(`"${t}" bindings must have a "namespace" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`binding`,`namespace`,`remote`]),r},`validateAgentMemoryBinding`),RS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"hyperdrive" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`id`,`string`)||(e.errors.push(`"${t}" bindings must have a "id" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`id`,`localConnectionString`]),r},`validateHyperdriveBinding`),zS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"vpc_services" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`service_id`,`string`)||(e.errors.push(`"${t}" bindings must have a "service_id" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`service_id`,`remote`]),r},`validateVpcServiceBinding`),BS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"vpc_networks" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1);let i=vx(n,`tunnel_id`),a=vx(n,`network_id`);return i&&a?(e.errors.push(`"${t}" bindings must have either a "tunnel_id" or "network_id", but not both.`),r=!1):!i&&!a?(e.errors.push(`"${t}" bindings must have either a "tunnel_id" or "network_id" field but got ${JSON.stringify(n)}.`),r=!1):i&&typeof n.tunnel_id!=`string`?(e.errors.push(`"${t}" bindings must have a string "tunnel_id" field but got ${JSON.stringify(n)}.`),r=!1):a&&typeof n.network_id!=`string`&&(e.errors.push(`"${t}" bindings must have a string "network_id" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`tunnel_id`,`network_id`,`remote`]),r},`validateVpcNetworkBinding`),VS=a((e,t)=>{let n=!1,r=Object.entries(Ex),i=Object.fromEntries(r.map(([e,n])=>[n,yx(e===`queues`?t[e]?.producers:t[e])]));i.Secret=t.secrets?.required??[];let a={};for(let n in i){let r=i[n];for(let i of r)i in a||(a[i]=[]),i===`ASSETS`&&Ax(t)&&e.errors.push(`The name 'ASSETS' is reserved in Pages projects. Please use a different name for your ${n} binding.`),a[i].push(n)}for(let t in a){let r=a[t];if(r.length<2)continue;n=!0;let i=r.filter((e,t)=>r.indexOf(e)!==t).filter((e,t,n)=>n.indexOf(e)===t),o=r.filter((e,t)=>r.indexOf(e)===t);o.length>1&&e.errors.push(`${t} assigned to ${Ox.format(o)} bindings.`),i.forEach(n=>{e.errors.push(`${t} assigned to multiple ${n} bindings.`)})}return n&&e.errors.push(`Bindings must have unique names, so that they can all be referenced in the worker.
295
+ Please add a binding for "${i}" to "env.${e}.${r}.bindings".`)}}return s},`validateBindingArray`);function CS(e,t,n,r){if(!Array.isArray(n)){e.errors.push(`${t} must be an array`);return}for(let[i,a]of n.entries()){let n=`${t}[${i}]`;if(typeof a!=`object`||!a||Array.isArray(a)){e.errors.push(`${n} must be an object`);continue}(r?X(a,`name`,`string`):_x(a,`name`,`string`))||e.errors.push(`${n}.name must be a string`),X(a,`public_key`,`string`)?a.public_key.toLowerCase().startsWith(`ssh-ed25519`)||e.errors.push(`${n}.public_key is an unsupported key type. Please provide an ED25519 public key.`):e.errors.push(`${n}.public_key must be a string`)}}a(CS,`validateSshPublicKeys`);function wS(e,t){let n=DS(e,void 0,t,{generateDefaultName:!1});return(e,t,r,i)=>{if(Array.isArray(r)){let n=[...r.entries()].filter(([,e])=>e&&typeof e==`object`&&e.scheduling_policy===`durable_object`).map(([e])=>`"${t}[${e}].scheduling_policy"`);if(n.length>0)return e.errors.push(`${n.join(`, `)} cannot be "durable_object". Durable Object-managed Containers are configured only in the top-level "containers" array.`),!1;let i=[...r.entries()].filter(([,e])=>e&&typeof e==`object`&&`name`in e).map(([e])=>`"${t}[${e}].name"`);if(i.length>0)return e.errors.push(`${i.join(`, `)} cannot be set. A preview container's application name is generated from the worker name, preview slug, and Durable Object class name, so that separate previews of the same Worker do not collide. Remove it and identify the container with "class_name".`),!1;let a=new Set,o=new Set;for(let e of r)!e||typeof e!=`object`||typeof e.class_name==`string`&&(a.has(e.class_name)&&o.add(e.class_name),a.add(e.class_name));if(o.size>0){let n=[...o].map(e=>`"${e}"`).join(`, `);return e.errors.push(`"${t}" declares more than one container for the Durable Object class ${n}; each Durable Object class may appear at most once.`),!1}}return n(e,t,r,i)}}a(wS,`validatePreviewsContainers`);function TS(e,t,n,r){if(n===void 0)return!0;if(typeof n!=`object`||!n||Array.isArray(n)||Object.keys(n).length===0)return e.errors.push(`"${t}" must be a non-empty object when present.`),!1;let i=!0,a=Object.entries(n);a.length>100&&(e.errors.push(`"${t}" must contain at most 100 images.`),i=!1);for(let[n,o]of a){let a=`${t}.${n}`;if((n.length===0||n.length>128)&&(e.errors.push(`"${t}" image names must be between 1 and 128 characters.`),i=!1),typeof o!=`object`||!o||Array.isArray(o)){e.errors.push(`"${a}" must be an object with either a "dockerfile" or "image" field.`),i=!1;continue}let s=o,c=s.dockerfile!==void 0,l=s.image!==void 0;if(c===l&&(e.errors.push(`"${a}" must specify exactly one of "dockerfile" or "image".`),i=!1),c&&(typeof s.dockerfile!=`string`||s.dockerfile.length===0)&&(e.errors.push(`"${a}.dockerfile" must be a non-empty string.`),i=!1),l&&(typeof s.image!=`string`||s.image.length===0)&&(e.errors.push(`"${a}.image" must be a non-empty string.`),i=!1),typeof s.image==`string`&&s.image.length>0){let t=rr(r),n=`${t}/`,o=s.image.slice(n.length),c=o.match(/^[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*)+@sha256:[a-f0-9]{64}$/);(!s.image.startsWith(n)||c?.[0]!==o)&&(e.errors.push(`"${a}.image" must be a digest-pinned image in the managed registry, in the form "${t}/<account-id>/<repository>@sha256:<64 lowercase hex characters>".`),i=!1)}let u=c&&!l;u&&(s.build_context!==void 0&&(typeof s.build_context!=`string`||s.build_context.length===0)&&(e.errors.push(`"${a}.build_context" must be a non-empty string.`),i=!1),s.build_vars!==void 0&&(typeof s.build_vars!=`object`||s.build_vars===null||Array.isArray(s.build_vars)||Object.values(s.build_vars).some(e=>typeof e!=`string`))&&(e.errors.push(`"${a}.build_vars" must be an object with string values.`),i=!1));let d=Object.keys(s).filter(e=>e!==`dockerfile`&&e!==`image`&&!(u&&(e===`build_context`||e===`build_vars`)));d.length>0&&(e.errors.push(`Unexpected fields found in ${a} field: ${d.map(e=>`"${e}"`).join(`, `)}`),i=!1)}return i}a(TS,`validateDurableObjectContainerImages`);function ES(e,t,n){if(n===void 0)return;if(typeof n!=`object`||!n||Array.isArray(n)){e.errors.push(`"${t}" should be an object.`);return}let r=n,i=r.configuration;if(Object.keys(r).some(e=>e!==`configuration`)||i!==void 0&&(typeof i!=`object`||!i||Array.isArray(i)||Object.keys(i).some(e=>e!==`experimental_flags`))){e.errors.push(`Only "${t}.configuration.experimental_flags" is supported for Durable Object-managed Containers.`);return}if(i!==void 0){let n=i.experimental_flags;n!==void 0&&(!Array.isArray(n)||n.some(e=>typeof e!=`string`))&&e.errors.push(`"${t}.configuration.experimental_flags" should be an array of strings.`)}}a(ES,`validateDurableObjectContainerUnsafe`);function DS(e,t,n,r={}){let{generateDefaultName:i=!0}=r;return(a,o,s,c)=>{if(!s)return!0;if(!Array.isArray(s))return a.errors.push(`"containers" field should be an array, but got ${JSON.stringify(s)}`),!1;for(let l of s){let s=l.scheduling_policy===`durable_object`,u=typeof l.class_name==`string`&&l.class_name.length>0;if(Y(a,o,`class_name`,l.class_name,`string`),s&&l.class_name===``&&a.errors.push(`"containers.class_name" must be a non-empty string when specified for a Durable Object-managed Container.`),Y(a,o,`name`,l.name,`string`),i&&!l.name&&(!s||l.class_name===void 0||u))if(l.class_name===void 0)a.errors.push('"containers.name" is required when "containers.class_name" is not defined, because there is no class name to derive a default name from. Either name this container and reference it from a Durable Object\'s `exports` entry, or set "containers.class_name".');else if(!t)a.errors.push(`Must have either a top level "name" and "containers.class_name" field defined, or have field "containers.name" defined.`);else{let n=`${t}-${l.class_name}`;n+=c===void 0?``:`-${e}`,l.name=n.toLowerCase().replace(/ /g,`-`)}if(s){TS(a,`${o}.images`,l.images,r.complianceConfig),xC(a,`${o}.observability`,l.observability,c),(l.observability?.target_instance_count!==void 0||l.observability?.target_instance_percentage!==void 0)&&a.errors.push(`"${o}.observability" only supports enabling or disabling logs for Durable Object-managed Containers; instance targeting is not supported.`),ES(a,`${o}.unsafe`,l.unsafe);let e=Object.keys(l).filter(e=>![`name`,`class_name`,`scheduling_policy`,`images`,`observability`,`unsafe`].includes(e));e.length>0&&a.errors.push(`Unsupported fields for Durable Object-managed Containers in ${o}: ${e.map(e=>`"${e}"`).join(`,`)}. Only "name", "class_name", "scheduling_policy", "images", "observability", and restricted "unsafe" settings are supported.`);continue}!l.configuration?.image&&!l.image&&a.errors.push(`"containers.image" field must be defined for each container app. This should be the path to your Dockerfile or an image URI pointing to the Cloudflare registry.`),`configuration`in l&&(a.warnings.push(`"containers.configuration" is deprecated. Use top level "containers" fields instead. "configuration.image" should be "image", limits should be set via "instance_type".`),typeof l.configuration!=`object`||l.configuration===null||Array.isArray(l.configuration)?a.errors.push(`"containers.configuration" should be an object`):l.instance_type&&(l.configuration.disk!==void 0||l.configuration.vcpu!==void 0||l.configuration.memory_mib!==void 0)&&a.errors.push(`Cannot set custom limits via "containers.configuration" and use preset "instance_type" limits at the same time.`)),Y(a,o,`image_build_context`,l.image_build_context,`string`);let d=l.image??l.configuration?.image,f;try{if(jC(d,n)){let e=n?w.dirname(n):process.cwd();d=w.resolve(e,d),f=l.image_build_context?w.resolve(e,l.image_build_context):w.dirname(d)}}catch(e){if(e instanceof Error&&e.message)a.errors.push(e.message);else throw e}if(l.image=d,l.image_build_context=f,l.rollout_step_percentage!==void 0){let e=l.rollout_step_percentage;if(typeof e==`number`)[5,10,20,25,50,100].includes(e)||a.errors.push(`"containers.rollout_step_percentage" must be one of [5, 10, 20, 25, 50, 100], but got ${e}`);else if(Array.isArray(e)){let t=[],n=[],r=0,i=!0;for(let o of e)typeof o==`number`?((o<10||o>100)&&n.push(o),i&&r>0&&o<e[r-1]&&(a.errors.push(`"containers.rollout_step_percentage" array elements must be in ascending order, but got "${e}"`),i=!1),r===e.length-1&&o!==100&&a.errors.push(`The final step in "containers.rollout_step_percentage" must be 100, but got "${o}"`),r++):t.push(o);t.length&&a.errors.push(`"containers.rollout_step_percentage" array elements must be numbers, but got "${t.join(`, `)}"`),n.length&&a.errors.push(`"containers.rollout_step_percentage" array elements must be between 10 and 100, but got "${n.join(`, `)}"`)}else a.errors.push(`"containers.rollout_step_percentage" must be a number or array of numbers, but got "${e}"`)}if(Y(a,o,`rollout_kind`,l.rollout_kind,`string`,[`full_auto`,`full_manual`,`none`]),(!_x(l,`rollout_active_grace_period`,`number`)||l.rollout_active_grace_period<0)&&a.errors.push(`"containers.rollout_active_grace_period" field should be a positive number but got "${l.rollout_active_grace_period}"`),Y(a,o,`max_instances`,l.max_instances,`number`),l.max_instances!==void 0&&l.max_instances<0&&a.errors.push(`"containers.max_instances" field should be a positive number, but got ${l.max_instances}`),l.rollout_step_percentage!==void 0&&l.max_instances!==void 0&&Array.isArray(l.rollout_step_percentage)){let e=l.rollout_step_percentage.length;e>l.max_instances&&a.errors.push(`"containers.rollout_step_percentage" cannot have more steps (${e}) than "max_instances" (${l.max_instances})`)}Y(a,o,`image_vars`,l.image_vars,`object`),xC(a,`${o}.observability`,l.observability,c),Y(a,o,`scheduling_policy`,l.scheduling_policy,`string`,[`regional`,`moon`,`default`]),`instances`in l&&a.warnings.push(`"containers.instances" is deprecated. Use "containers.max_instances" instead.`),`durable_objects`in l&&a.warnings.push(`"containers.durable_objects" is deprecated. Use the "class_name" field instead.`),`wrangler_ssh`in l&&a.warnings.push(`"containers.wrangler_ssh" is deprecated. Use "containers.ssh" instead.`),`unsafe`in l&&(l.unsafe&&typeof l.unsafe!=`object`||Array.isArray(l.unsafe))&&a.errors.push(`The field "containers.unsafe" should be an object but got ${JSON.stringify(typeof l.unsafe)}.`),Z(a,o,Object.keys(l),[`name`,`instances`,`max_instances`,`image`,`image_build_context`,`image_vars`,`observability`,`class_name`,`scheduling_policy`,`instance_type`,`ssh`,`wrangler_ssh`,`authorized_keys`,`trusted_user_ca_keys`,`configuration`,`constraints`,`affinities`,`rollout_step_percentage`,`rollout_kind`,`durable_objects`,`rollout_active_grace_period`,`unsafe`]),typeof l.configuration==`object`&&l.configuration!==null&&!Array.isArray(l.configuration)&&Z(a,`${o}.configuration`,Object.keys(l.configuration),[`image`,`secrets`,`labels`,`disk`,`vcpu`,`memory_mib`]);let p,m;if(`ssh`in l?(p=`ssh`,m=l.ssh,l.wrangler_ssh=l.ssh,delete l.ssh):`wrangler_ssh`in l&&(p=`wrangler_ssh`,m=l.wrangler_ssh),p!==void 0){let e=typeof m==`object`&&m?m:{};X(e,`enabled`,`boolean`)||a.errors.push(`${o}.${p}.enabled must be a boolean`);let t=`port`in e?e.port:void 0;(!_x(e,`port`,`number`)||typeof t==`number`&&(t<1||t>65535))&&a.errors.push(`${o}.${p}.port must be a number between 1 and 65535 inclusive`)}if(`authorized_keys`in l&&CS(a,`${o}.authorized_keys`,l.authorized_keys,!0),`trusted_user_ca_keys`in l&&CS(a,`${o}.trusted_user_ca_keys`,l.trusted_user_ca_keys,!1),Y(a,o,`constraints`,l.constraints,`object`)&&l.constraints){let e=l.constraints;if(`tier`in e&&(a.warnings.push(`"constraints.tier" has been deprecated in favor of "constraints.tiers". Please update your configuration to use "constraints.tiers" instead.`),`tiers`in e&&a.errors.push(`${o}.constraints.tier and ${o}.constraints.tiers cannot both be set`)),gx(a,`${o}.constraints.tiers`,e.tiers,`number`),Y(a,`${o}.constraints`,`jurisdiction`,e.jurisdiction,`string`),e.jurisdiction&&![`eu`,`fedramp`].includes(e.jurisdiction)&&a.errors.push(`${o}.constraints.jurisdiction must be one of: "eu", "fedramp"`),gx(a,`${o}.constraints.regions`,e.regions,`string`)&&e.regions&&Array.isArray(e.regions)){let t=[`ENAM`,`WNAM`,`EEUR`,`WEUR`,`APAC`,`SAM`,`ME`,`OC`,`AFR`];for(let n of e.regions)typeof n==`string`&&!t.includes(n.toUpperCase())&&a.errors.push(`${o}.constraints.regions contains invalid region "${n}". Valid regions are: ${t.join(`, `)}`)}}if(typeof l.instance_type==`string`)Y(a,o,`instance_type`,l.instance_type,`string`,kx),l.instance_type===`dev`&&a.warnings.push(`The "dev" instance_type has been renamed to "lite" and will be removed in a subsequent version. Please update your configuration to use "lite" instead.`),l.instance_type===`standard`&&a.warnings.push(`The "standard" instance_type has been renamed to "standard-1" and will be removed in a subsequent version. Please update your configuration to use "standard-1" instead.`);else if(Y(a,o,`instance_type`,l.instance_type,`object`)&&l.instance_type){let e=[`vcpu`,`memory_mib`,`disk_mb`];e.forEach(e=>{_x(l.instance_type,e,`number`)||a.errors.push(`"containers.instance_type.${e}", when present, should be a number.`)}),Z(a,`${o}.instance_type`,Object.keys(l.instance_type),e)}}return!(a.errors.length>0)}}a(DS,`validateContainerApp`);var OS=a((e,t,n)=>{if(typeof n!=`object`||!n||Array.isArray(n))return e.errors.push(`"cloudchamber" should be an object, but got ${JSON.stringify(n)}`),!1;let r={string:[`memory`,`image`,`location`],boolean:[`ipv4`],number:[`vcpu`]},i=!0;return Object.entries(r).forEach(([r,a])=>{a.forEach(a=>{_x(n,a,r)||(e.errors.push(`"${t}" bindings should, optionally, have a ${r} "${a}" field but got ${JSON.stringify(n)}.`),i=!1)})}),`instance_type`in n&&n.instance_type!==void 0&&((typeof n.instance_type!=`string`||!kx.includes(n.instance_type))&&e.errors.push(`"instance_type" should be one of 'lite', 'basic', 'standard-1', 'standard-2', 'standard-3', or 'standard-4', but got ${n.instance_type}`),(`memory`in n&&n.memory!==void 0||`vcpu`in n&&n.vcpu!==void 0)&&e.errors.push(`"${t}" configuration should not set either "memory" or "vcpu" with "instance_type"`)),i},`validateCloudchamberConfig`),kS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"kv_namespaces" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),(!_x(n,`id`,`string`)||n.id!==void 0&&n.id.length===0)&&(e.errors.push(`"${t}" bindings should have a string "id" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`preview_id`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "preview_id" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`binding`,`id`,`preview_id`,`remote`]),r},`validateKVBinding`),AS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"send_email" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`name`,`string`)||(e.errors.push(`"${t}" bindings should have a string "name" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`destination_address`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "destination_address" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`allowed_destination_addresses`,`object`)||(e.errors.push(`"${t}" bindings should, optionally, have a []string "allowed_destination_addresses" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`allowed_sender_addresses`,`object`)||(e.errors.push(`"${t}" bindings should, optionally, have a []string "allowed_sender_addresses" field but got ${JSON.stringify(n)}.`),r=!1),`destination_address`in n&&`allowed_destination_addresses`in n&&(e.errors.push(`"${t}" bindings should have either a "destination_address" or "allowed_destination_addresses" field, but not both.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`allowed_sender_addresses`,`allowed_destination_addresses`,`destination_address`,`name`,`binding`,`remote`]),r},`validateSendEmailBinding`),jS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"queue" bindings should be objects, but got ${JSON.stringify(n)}`),!1;if(!Z(e,t,Object.keys(n),[`binding`,`queue`,`delivery_delay`,`remote`]))return!1;let r=!0;X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),(!_x(n,`queue`,`string`)||vx(n,`queue`)&&n.queue===``)&&(e.errors.push(`"${t}" bindings should optionally have a non-empty string "queue" field but got ${JSON.stringify(n)}.`),r=!1);for(let i of[{key:`delivery_delay`,type:`number`}])_x(n,i.key,i.type)||(e.errors.push(`"${t}" should, optionally, have a ${i.type} "${i.key}" field but got ${JSON.stringify(n)}.`),r=!1);return vx(n,`delivery_delay`)&&n.delivery_delay!==void 0&&e.warnings.push(`The "delivery_delay" field in "${t}" is deprecated and has no effect. Queue-level settings should be configured using "wrangler queues update" instead. This setting will be removed in a future version.`),AC(n,t,e)||(r=!1),r},`validateQueueBinding`),MS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"r2_buckets" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;if(X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),(!_x(n,`bucket_name`,`string`)||n.bucket_name!==void 0&&n.bucket_name.length===0)&&(e.errors.push(`"${t}" bindings should have a string "bucket_name" field but got ${JSON.stringify(n)}.`),r=!1),r&&vx(n,`bucket_name`)&&!wx(n.bucket_name)&&(e.errors.push(`${t}.bucket_name=${JSON.stringify(n.bucket_name)} is invalid. ${Tx}`),r=!1),_x(n,`preview_bucket_name`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "preview_bucket_name" field but got ${JSON.stringify(n)}.`),r=!1),r&&vx(n,`preview_bucket_name`)&&!wx(n.preview_bucket_name)&&(e.errors.push(`${t}.preview_bucket_name= ${JSON.stringify(n.preview_bucket_name)} is invalid. ${Tx}`),r=!1),_x(n,`jurisdiction`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "jurisdiction" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),vx(n,`local_dev`)){let i=n.local_dev;if(typeof i!=`object`||!i)e.errors.push(`"${t}" bindings should, optionally, have an object "local_dev" field but got ${JSON.stringify(n)}.`),r=!1;else{if(tx(e,{local_dev:i},`local_dev.experimental_s3_credentials`),vx(i,`experimental_s3_credentials`)){let a=i.experimental_s3_credentials;(typeof a!=`object`||!a||!X(a,`accessKeyId`,`string`)||!X(a,`secretAccessKey`,`string`))&&(e.errors.push(`"${t}" bindings should, optionally, have a "local_dev.experimental_s3_credentials" field with string "accessKeyId" and "secretAccessKey" fields, but got ${JSON.stringify(n)}.`),r=!1)}Z(e,`${t}.local_dev`,Object.keys(i),[`experimental_s3_credentials`])}}return Z(e,t,Object.keys(n),[`binding`,`bucket_name`,`preview_bucket_name`,`jurisdiction`,`remote`,`local_dev`]),r},`validateR2Binding`),NS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"d1_databases" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`database_id`,`string`)||(e.errors.push(`"${t}" bindings must have a "database_id" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`preview_database_id`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "preview_database_id" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),_x(n,`migrations_pattern`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "migrations_pattern" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`database_name`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "database_name" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`migrations_dir`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "migrations_dir" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`migrations_table`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "migrations_table" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`database_internal_env`,`string`)||(e.errors.push(`"${t}" bindings should, optionally, have a string "database_internal_env" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`database_id`,`database_internal_env`,`database_name`,`migrations_dir`,`migrations_pattern`,`migrations_table`,`preview_database_id`,`remote`]),r},`validateD1Binding`),PS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"vectorize" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`index_name`,`string`)||(e.errors.push(`"${t}" bindings must have an "index_name" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`binding`,`index_name`,`remote`]),r},`validateVectorizeBinding`),FS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"ai_search_namespaces" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`namespace`,`string`)||(e.errors.push(`"${t}" bindings must have a "namespace" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`binding`,`namespace`,`remote`]),r},`validateAISearchNamespaceBinding`),IS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"ai_search" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`instance_name`,`string`)||(e.errors.push(`"${t}" bindings must have an "instance_name" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`binding`,`instance_name`,`remote`]),r},`validateAISearchBinding`),LS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"agent_memory" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`namespace`,`string`)||(e.errors.push(`"${t}" bindings must have a "namespace" field but got ${JSON.stringify(n)}.`),r=!1),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`binding`,`namespace`,`remote`]),r},`validateAgentMemoryBinding`),RS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"hyperdrive" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`id`,`string`)||(e.errors.push(`"${t}" bindings must have a "id" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`id`,`localConnectionString`]),r},`validateHyperdriveBinding`),zS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"vpc_services" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`service_id`,`string`)||(e.errors.push(`"${t}" bindings must have a "service_id" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`service_id`,`remote`]),r},`validateVpcServiceBinding`),BS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"vpc_networks" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1);let i=vx(n,`tunnel_id`),a=vx(n,`network_id`);return i&&a?(e.errors.push(`"${t}" bindings must have either a "tunnel_id" or "network_id", but not both.`),r=!1):!i&&!a?(e.errors.push(`"${t}" bindings must have either a "tunnel_id" or "network_id" field but got ${JSON.stringify(n)}.`),r=!1):i&&typeof n.tunnel_id!=`string`?(e.errors.push(`"${t}" bindings must have a string "tunnel_id" field but got ${JSON.stringify(n)}.`),r=!1):a&&typeof n.network_id!=`string`&&(e.errors.push(`"${t}" bindings must have a string "network_id" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`tunnel_id`,`network_id`,`remote`]),r},`validateVpcNetworkBinding`),VS=a((e,t)=>{let n=!1,r=Object.entries(Ex),i=Object.fromEntries(r.map(([e,n])=>[n,yx(e===`queues`?t[e]?.producers:t[e])]));i.Secret=t.secrets?.required??[];let a={};for(let n in i){let r=i[n];for(let i of r)i in a||(a[i]=[]),i===`ASSETS`&&Ax(t)&&e.errors.push(`The name 'ASSETS' is reserved in Pages projects. Please use a different name for your ${n} binding.`),a[i].push(n)}for(let t in a){let r=a[t];if(r.length<2)continue;n=!0;let i=r.filter((e,t)=>r.indexOf(e)!==t).filter((e,t,n)=>n.indexOf(e)===t),o=r.filter((e,t)=>r.indexOf(e)===t);o.length>1&&e.errors.push(`${t} assigned to ${Ox.format(o)} bindings.`),i.forEach(n=>{e.errors.push(`${t} assigned to multiple ${n} bindings.`)})}return n&&e.errors.push(`Bindings must have unique names, so that they can all be referenced in the worker.
296
296
  Please change your bindings to have unique names.`),!n},`validateBindingsHaveUniqueNames`),HS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"services" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`service`,`string`)||(e.errors.push(`"${t}" bindings should have a string "service" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`environment`,`string`)||(e.errors.push(`"${t}" bindings should have a string "environment" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`entrypoint`,`string`)||(e.errors.push(`"${t}" bindings should have a string "entrypoint" field but got ${JSON.stringify(n)}.`),r=!1),vx(n,`dev`)&&n.dev!==void 0&&(typeof n.dev!=`object`||n.dev===null||Array.isArray(n.dev)?(e.errors.push(`"${t}" bindings should have an object "dev" field but got ${JSON.stringify(n.dev)}.`),r=!1):(!vx(n.dev,`plugin`)||typeof n.dev.plugin!=`object`||n.dev.plugin===null||Array.isArray(n.dev.plugin)?(e.errors.push(`"${t}.dev" should have an object "plugin" field but got ${JSON.stringify(n.dev.plugin)}.`),r=!1):(X(n.dev.plugin,`package`,`string`)||(e.errors.push(`"${t}.dev.plugin" should have a string "package" field but got ${JSON.stringify(n.dev.plugin.package)}.`),r=!1),X(n.dev.plugin,`name`,`string`)||(e.errors.push(`"${t}.dev.plugin" should have a string "name" field but got ${JSON.stringify(n.dev.plugin.name)}.`),r=!1)),vx(n.dev,`options`)&&n.dev.options!==void 0&&(typeof n.dev.options!=`object`||n.dev.options===null||Array.isArray(n.dev.options))&&(e.errors.push(`"${t}.dev.options" should be an object but got ${JSON.stringify(n.dev.options)}.`),r=!1)),n.remote===!0&&e.warnings.push(`"${t}" binding has both "dev" and "remote" set; "remote" is ignored when "dev" is present and the binding is routed through the local Miniflare plugin.`)),AC(n,t,e)||(r=!1),r},`validateServiceBinding`),US=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"analytics_engine" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),(!_x(n,`dataset`,`string`)||n.dataset?.length===0)&&(e.errors.push(`"${t}" bindings should, optionally, have a string "dataset" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`dataset`]),r},`validateAnalyticsEngineBinding`),WS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"${t}" binding should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`namespace`,`string`)||(e.errors.push(`"${t}" should optionally have a string "namespace" field but got ${JSON.stringify(n)}.`),r=!1),vx(n,`outbound`)&&(GS(e,`${t}.outbound`,n.outbound??{})||(e.errors.push(`"${t}" has an invalid outbound definition.`),r=!1)),AC(n,t,e)||(r=!1),r},`validateWorkerNamespaceBinding`);function GS(e,t,n){if(typeof n!=`object`||!n)return e.errors.push(`"${t}" should be an object, but got ${JSON.stringify(n)}`),!1;let r=!0;return r&&=px(e,t,`service`,n.service,`string`),r&&=Y(e,t,`environment`,n.environment,`string`),r&&=gx(e,`${t}.parameters`,n.parameters,`string`),r}a(GS,`validateWorkerNamespaceOutbound`);var KS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"mtls_certificates" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings should have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),(!X(n,`certificate_id`,`string`)||n.certificate_id.length===0)&&(e.errors.push(`"${t}" bindings should have a string "certificate_id" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`certificate_id`,`remote`]),AC(n,t,e)||(r=!1),r},`validateMTlsCertificateBinding`);function qS(e){return(t,n,r,i)=>{if(r===void 0)return!0;let a=i===void 0?`${n}`:`env.${e}.${n}`;if(typeof r!=`object`||Array.isArray(r)||r===null)return t.errors.push(`The field "${a}" should be an object but got ${JSON.stringify(r)}.`),!1;let o=!0;if(Z(t,a,Object.keys(r),[`consumers`,`producers`])||(o=!1),vx(r,`consumers`)){let e=r.consumers;if(!Array.isArray(e))t.errors.push(`The field "${a}.consumers" should be an array but got ${JSON.stringify(e)}.`),o=!1;else for(let n=0;n<e.length;n++){let r=e[n];JS(t,`${a}.consumers[${n}]`,r,i)||(o=!1)}}return vx(r,`producers`)&&($(e,jS)(t,`${n}.producers`,r.producers,i)||(o=!1)),o}}a(qS,`validateQueues`);var JS=a((e,t,n,r)=>{if(typeof n!=`object`||!n)return e.errors.push(`"${t}" should be a objects, but got ${JSON.stringify(n)}`),!1;let i=!0;Z(e,t,Object.keys(n),[`queue`,`type`,`max_batch_size`,`max_batch_timeout`,`max_retries`,`dead_letter_queue`,`max_concurrency`,`visibility_timeout_ms`,`retry_delay`])||(i=!1),X(n,`queue`,`string`)||e.errors.push(`"${t}" should have a string "queue" field but got ${JSON.stringify(n)}.`),`type`in n&&n.type!==void 0&&n.type!==`worker`&&(e.errors.push(`"${t}.type" has an invalid value "${n.type}". Only "worker" consumers can be configured in your Wrangler configuration.`),i=!1);for(let r of[{key:`type`,type:`string`},{key:`max_batch_size`,type:`number`},{key:`max_batch_timeout`,type:`number`},{key:`max_retries`,type:`number`},{key:`dead_letter_queue`,type:`string`},{key:`max_concurrency`,type:`number`},{key:`visibility_timeout_ms`,type:`number`},{key:`retry_delay`,type:`number`}])_x(n,r.key,r.type)||(e.errors.push(`"${t}" should, optionally, have a ${r.type} "${r.key}" field but got ${JSON.stringify(n)}.`),i=!1);return i},`validateConsumer`);function YS(e){return(t,n,r,i)=>{if(r===void 0)return!0;let a=i===void 0?`${n}`:`env.${e}.${n}`;if(!Array.isArray(r))return t.errors.push(`The field "${a}" should be an array but got ${JSON.stringify(r)}.`),!1;let o=!0;for(let e=0;e<r.length;e++)XS(t,`${a}[${e}]`,r[e],i)||(o=!1);let s=new Map;for(let e=0;e<r.length;e++){let n=r[e];if(typeof n!=`object`||!n||typeof n.port!=`number`||typeof n.protocol!=`string`)continue;let{protocol:i,port:c}=n,l=`${i}:${c}`,u=s.get(l);u===void 0?s.set(l,e):(t.errors.push(`"${a}[${e}]" has the same "protocol" (${i}) and "port" (${c}) as "${a}[${u}]". Each entry in "connect" must use a unique protocol/port combination.`),o=!1)}return o}}a(YS,`validateConnectHandlers`);var XS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"${t}" should be an object, but got ${JSON.stringify(n)}`),!1;let r=!0;return Z(e,t,Object.keys(n),[`protocol`,`port`,`address`])||(r=!1),`protocol`in n&&n.protocol!==`tcp`?(e.errors.push(`"${t}" should have a "protocol" field of "tcp" but got ${JSON.stringify(n.protocol)}.`),r=!1):`protocol`in n||(e.errors.push(`"${t}" should have a "protocol" field of "tcp" but got ${JSON.stringify(n)}.`),r=!1),X(n,`port`,`number`)?(!Number.isInteger(n.port)||n.port<1||n.port>65535)&&(e.errors.push(`"${t}" should have an integer "port" field between 1 and 65535 but got ${JSON.stringify(n)}.`),r=!1):(e.errors.push(`"${t}" should have a number "port" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`address`,`string`)||(e.errors.push(`"${t}" should, optionally, have a string "address" field but got ${JSON.stringify(n)}.`),r=!1),r},`validateConnectHandler`),ZS=a((e,t,n)=>n===void 0?!0:typeof n==`string`?sx(e,t,n):(e.errors.push(`Expected "${t}" to be of type string but got ${JSON.stringify(n)}.`),!1),`validateCompatibilityDate`),QS=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"pipeline" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings must have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1);let i=_x(n,`stream`,`string`),a=_x(n,`pipeline`,`string`),o=n;return i&&o.stream||(a&&o.pipeline?e.warnings.push(`The "pipeline" field in "${t}" bindings is deprecated. Use "stream" instead.`):(e.errors.push(`"${t}" bindings must have a string "stream" field but got ${JSON.stringify(n)}.`),r=!1)),AC(n,t,e)||(r=!1),Z(e,t,Object.keys(n),[`binding`,`stream`,`pipeline`,`remote`]),r},`validatePipelineBinding`),$S=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"secrets_store_secrets" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings must have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`store_id`,`string`)||(e.errors.push(`"${t}" bindings must have a string "store_id" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`secret_name`,`string`)||(e.errors.push(`"${t}" bindings must have a string "secret_name" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`store_id`,`secret_name`]),r},`validateSecretsStoreSecretBinding`),eC=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"artifacts" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings must have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`namespace`,`string`)||(e.errors.push(`"${t}" bindings must have a string "namespace" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`namespace`,`remote`]),AC(n,t,e)||(r=!1),r},`validateArtifactsBinding`),tC=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"unsafe_hello_world" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings must have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`enable_timer`,`boolean`)||(e.errors.push(`"${t}" bindings must have a boolean "enable_timer" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`enable_timer`]),r},`validateHelloWorldBinding`),nC=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"flagship" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings must have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),_x(n,`app_id`,`string`)||(e.errors.push(`"${t}" bindings may have a string "app_id" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`,`app_id`,`remote`]),AC(n,t,e)||(r=!1),r},`validateFlagshipBinding`),rC=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"worker_loader" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`binding`,`string`)||(e.errors.push(`"${t}" bindings must have a string "binding" field but got ${JSON.stringify(n)}.`),r=!1),Z(e,t,Object.keys(n),[`binding`]),r},`validateWorkerLoaderBinding`),iC=a((e,t,n)=>{if(typeof n!=`object`||!n)return e.errors.push(`"ratelimits" bindings should be objects, but got ${JSON.stringify(n)}`),!1;let r=!0;return X(n,`name`,`string`)||(e.errors.push(`"${t}" bindings must have a string "name" field but got ${JSON.stringify(n)}.`),r=!1),X(n,`namespace_id`,`string`)||(e.errors.push(`"${t}" bindings must have a string "namespace_id" field but got ${JSON.stringify(n)}.`),r=!1),!vx(n,`simple`)||typeof n.simple!=`object`||n.simple===null?(e.errors.push(`"${t}" bindings must have a "simple" configuration object but got ${JSON.stringify(n)}.`),r=!1):(X(n.simple,`limit`,`number`)||(e.errors.push(`"${t}" bindings "simple.limit" must be a number but got ${JSON.stringify(n.simple)}.`),r=!1),X(n.simple,`period`,`number`)?[10,60].includes(n.simple.period)||(e.errors.push(`"${t}" bindings "simple.period" must be either 10 or 60 but got ${JSON.stringify(n.simple.period)}.`),r=!1):(e.errors.push(`"${t}" bindings "simple.period" is required and must be a number but got ${JSON.stringify(n.simple)}.`),r=!1),Z(e,`${t}.simple`,Object.keys(n.simple),[`limit`,`period`])),Z(e,t,Object.keys(n),[`name`,`namespace_id`,`simple`]),r},`validateRateLimitBinding`);function aC(e,t,n){return n.limits&&(Y(e,`limits`,`cpu_ms`,n.limits.cpu_ms,`number`),Y(e,`limits`,`subrequests`,n.limits.subrequests,`number`)),nx(e,t,n,`limits`,()=>!0,void 0)}a(aC,`normalizeAndValidateLimits`);var oC=a((e,t)=>(n,r,i)=>{if(i===void 0)return!0;if(typeof i!=`object`||!i||Array.isArray(i))return n.errors.push(`The field "${r}" should be an object but got ${JSON.stringify(i)}.`),!1;let a=i,o=!0;return o=Z(n,r,Object.keys(a),`vars.define.durable_objects.workflows.kv_namespaces.send_email.queues.d1_databases.r2_buckets.vectorize.ai_search_namespaces.ai_search.hyperdrive.services.analytics_engine_datasets.dispatch_namespaces.mtls_certificates.tail_consumers.streaming_tail_consumers.unsafe.browser.ai.images.stream.media.pipelines.secrets_store_secrets.artifacts.unsafe_hello_world.flagship.worker_loaders.ratelimits.vpc_services.version_metadata.containers.logpush.observability.limits.placement.cache`.split(`.`))&&o,o=cS(e)(n,`${r}.vars`,a.vars,void 0)&&o,o=sS(e)(n,`${r}.define`,a.define,void 0)&&o,Yx(n,void 0,a,`${r}.placement`),o=uS(e,fS)(n,`${r}.durable_objects`,a.durable_objects,void 0)&&o,o=ux($(e,hS),Cx)(n,`${r}.workflows`,a.workflows,void 0)&&o,o=$(e,kS)(n,`${r}.kv_namespaces`,a.kv_namespaces,void 0)&&o,o=$(e,AS)(n,`${r}.send_email`,a.send_email,void 0)&&o,o=qS(e)(n,`${r}.queues`,a.queues,void 0)&&o,o=$(e,NS)(n,`${r}.d1_databases`,a.d1_databases,void 0)&&o,o=$(e,MS)(n,`${r}.r2_buckets`,a.r2_buckets,void 0)&&o,o=$(e,PS)(n,`${r}.vectorize`,a.vectorize,void 0)&&o,o=$(e,FS)(n,`${r}.ai_search_namespaces`,a.ai_search_namespaces,void 0)&&o,o=$(e,IS)(n,`${r}.ai_search`,a.ai_search,void 0)&&o,o=$(e,RS)(n,`${r}.hyperdrive`,a.hyperdrive,void 0)&&o,o=$(e,HS)(n,`${r}.services`,a.services,void 0)&&o,o=$(e,US)(n,`${r}.analytics_engine_datasets`,a.analytics_engine_datasets,void 0)&&o,o=$(e,WS)(n,`${r}.dispatch_namespaces`,a.dispatch_namespaces,void 0)&&o,o=$(e,KS)(n,`${r}.mtls_certificates`,a.mtls_certificates,void 0)&&o,o=Zx(n,`${r}.tail_consumers`,a.tail_consumers,void 0)&&o,o=$x(n,`${r}.streaming_tail_consumers`,a.streaming_tail_consumers,void 0)&&o,a.unsafe!==void 0&&(o=dS(e)(n,`${r}.unsafe`,a.unsafe,void 0)&&o),a.browser!==void 0&&(o=yS(e)(n,`${r}.browser`,a.browser,void 0)&&o),a.ai!==void 0&&(o=bS(e)(n,`${r}.ai`,a.ai,void 0)&&o),a.images!==void 0&&(o=yS(e)(n,`${r}.images`,a.images,void 0)&&o),a.stream!==void 0&&(o=yS(e)(n,`${r}.stream`,a.stream,void 0)&&o),a.media!==void 0&&(o=yS(e)(n,`${r}.media`,a.media,void 0)&&o),o=$(e,QS)(n,`${r}.pipelines`,a.pipelines,void 0)&&o,o=$(e,$S)(n,`${r}.secrets_store_secrets`,a.secrets_store_secrets,void 0)&&o,o=$(e,eC)(n,`${r}.artifacts`,a.artifacts,void 0)&&o,o=$(e,tC)(n,`${r}.unsafe_hello_world`,a.unsafe_hello_world,void 0)&&o,o=$(e,nC)(n,`${r}.flagship`,a.flagship,void 0)&&o,o=$(e,rC)(n,`${r}.worker_loaders`,a.worker_loaders,void 0)&&o,o=$(e,iC)(n,`${r}.ratelimits`,a.ratelimits,void 0)&&o,o=$(e,zS)(n,`${r}.vpc_services`,a.vpc_services,void 0)&&o,a.version_metadata!==void 0&&(o=xS(e)(n,`${r}.version_metadata`,a.version_metadata,void 0)&&o),a.containers!==void 0&&(o=wS(e,t)(n,`${r}.containers`,a.containers,void 0)&&o),o=fx(n,`${r}.logpush`,a.logpush,void 0)&&o,o=SC(n,`${r}.observability`,a.observability,void 0)&&o,a.limits&&(o=Y(n,`${r}.limits`,`cpu_ms`,a.limits.cpu_ms,`number`)&&o,o=Y(n,`${r}.limits`,`subrequests`,a.limits.subrequests,`number`)&&o),o=TC(n,`${r}.cache`,a.cache,void 0)&&o,o},`validatePreviewsConfig`),sC=a((e,t,n)=>{let r=n??[];if(!Array.isArray(r))return e.errors.push(`The optional "${t}" field should be an array, but got ${JSON.stringify(r)}`),!1;let i=!0;for(let t=0;t<r.length;t++){let{tag:n,new_classes:a,new_sqlite_classes:o,renamed_classes:s,deleted_classes:c,transferred_classes:l,...u}=r[t];i=Z(e,`migrations`,Object.keys(u),[])&&i,i=px(e,`migrations[${t}]`,`tag`,n,`string`)&&i,i=gx(e,`migrations[${t}].new_classes`,a,`string`)&&i,i=gx(e,`migrations[${t}].new_sqlite_classes`,o,`string`)&&i,s!==void 0&&(Array.isArray(s)?s.some(e=>typeof e!=`object`||!X(e,`from`,`string`)||!X(e,`to`,`string`))&&(e.errors.push(`Expected "migrations[${t}].renamed_classes" to be an array of "{from: string, to: string}" objects but got ${JSON.stringify(s)}.`),i=!1):(e.errors.push(`Expected "migrations[${t}].renamed_classes" to be an array of "{from: string, to: string}" objects but got ${JSON.stringify(s)}.`),i=!1)),l!==void 0&&(Array.isArray(l)?l.some(e=>typeof e!=`object`||!X(e,`from`,`string`)||!X(e,`from_script`,`string`)||!X(e,`to`,`string`))&&(e.errors.push(`Expected "migrations[${t}].transferred_classes" to be an array of "{from: string, from_script: string, to: string}" objects but got ${JSON.stringify(l)}.`),i=!1):(e.errors.push(`Expected "migrations[${t}].transferred_classes" to be an array of "{from: string, from_script: string, to: string}" objects but got ${JSON.stringify(l)}.`),i=!1)),i=gx(e,`migrations[${t}].deleted_classes`,c,`string`)&&i}return i},`validateMigrations`),cC=new Set([`sqlite`,`legacy-kv`]),lC=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function uC(e,t,n,r){let i=!0;for(let a of Object.keys(n))r.includes(a)||(e.errors.push(`"exports.${t}.${a}" is forbidden on state "${n.state??`created`}".`),i=!1);return i||e.errors.push(`Allowed properties are: ${Ox.format(r)}.`),i}a(uC,`validateDurableObjectExportProperties`);function dC(e,t,n){return n.container===void 0?!0:typeof n.container!=`string`||n.container===``?(e.errors.push(`"exports.${t}.container" must be a non-empty string naming a container in the "containers" array, but got ${JSON.stringify(n.container)}.`),!1):n.storage===`legacy-kv`?(e.errors.push(`"exports.${t}.container" requires "storage" to be "sqlite". Containers are not supported on Durable Objects using the "legacy-kv" storage backend.`),!1):!0}a(dC,`validateDurableObjectExportContainer`);function fC(e,t,n){let r=!0;switch(t===``&&(e.errors.push(`"export" keys cannot be the empty string.`),r=!1),n.state){case void 0:case`created`:(typeof n.storage!=`string`||!cC.has(n.storage))&&(e.errors.push(`"exports.${t}.storage" is required for state "created" and must be one of ${Ox.format(cC)}, but got ${JSON.stringify(n.storage)}`),r=!1),r=dC(e,t,n)&&r,r=uC(e,t,n,[`type`,`state`,`storage`,`container`])&&r;break;case`deleted`:r=uC(e,t,n,[`type`,`state`])&&r;break;case`renamed`:typeof n.renamed_to!=`string`||n.renamed_to===``?(e.errors.push(`"exports.${t}.renamed_to" is required for state "renamed" and must be a non-empty string.`),r=!1):(lC.test(n.renamed_to)||(e.errors.push(`"exports.${t}.renamed_to" must be a valid JavaScript identifier (got "${n.renamed_to}").`),r=!1),n.renamed_to===t&&(e.errors.push(`"exports.${t}.renamed_to" cannot equal the source class name "${t}".`),r=!1)),r=uC(e,t,n,[`type`,`state`,`renamed_to`])&&r;break;case`transferred`:(typeof n.transferred_to!=`string`||n.transferred_to===``)&&(e.errors.push(`"exports.${t}.transferred_to" is required for state "transferred" and must be a non-empty string.`),r=!1),r=uC(e,t,n,[`type`,`state`,`transferred_to`])&&r;break;case`expecting-transfer`:(typeof n.storage!=`string`||!cC.has(n.storage))&&(e.errors.push(`"exports.${t}.storage" is required for state "expecting-transfer" and must be one of ${Ox.format(cC)}, but got ${JSON.stringify(n.storage)}`),r=!1),(typeof n.transfer_from!=`string`||n.transfer_from===``)&&(e.errors.push(`"exports.${t}.transfer_from" is required for state "expecting-transfer" and must be a non-empty string.`),r=!1),r=dC(e,t,n)&&r,r=uC(e,t,n,[`type`,`state`,`storage`,`transfer_from`,`container`])&&r;break;default:{let i=n.state;e.errors.push(`"exports.${t}.state" must be one of "created", "deleted", "renamed", "transferred", or "expecting-transfer" but got ${JSON.stringify(i)}.`),r=!1}}return r}a(fC,`validateDurableObjectExport`);function pC(e,t,n){let r=!0;return r=Z(e,`exports.${t}`,Object.keys(n),[`type`,`cache`])&&r,r=mC(e,`exports.${t}.cache`,n.cache)&&r,r}a(pC,`validateWorkerExport`);function mC(e,t,n){if(n===void 0)return!0;if(typeof n!=`object`||!n||Array.isArray(n))return e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1;let r=n,i=!0;return i=px(e,t,`enabled`,r.enabled,`boolean`)&&i,i=Z(e,t,Object.keys(r),[`enabled`])&&i,i}a(mC,`validateWorkerExportCache`);var hC=a((e,t,n)=>{if(n==null)return!0;if(typeof n!=`object`||Array.isArray(n))return e.errors.push(`The optional "${t}" field should be an object keyed by class name, but got ${JSON.stringify(n)}`),!1;let r=!0;for(let[t,i]of Object.entries(n)){if(typeof i!=`object`||!i){e.errors.push(`"exports.${t}" should be an object but got ${JSON.stringify(i)}.`),r=!1;continue}i.type===`durable-object`?r=fC(e,t,i)&&r:i.type===`worker`?r=pC(e,t,i)&&r:(r=!1,e.errors.push(`"exports.${t}.type" must be "durable-object" or "worker", but got ${JSON.stringify(i.type)}.`))}return r},`validateExports`),gC=1,_C=99,vC=1;function yC(e){return e?.logs?.enabled===!0||e?.enabled===!0}a(yC,`isContainerObservabilityEnabled`);function bC(e){return typeof e.enabled==`boolean`&&typeof e.logs?.enabled==`boolean`&&e.enabled!==e.logs.enabled}a(bC,`hasConflictingContainerObservabilityEnabledValues`);var xC=a((e,t,n)=>{if(n===void 0)return!0;if(typeof n!=`object`||!n||Array.isArray(n))return e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1;let r=n,i=!0;i=Y(e,t,`enabled`,r.enabled,`boolean`)&&i,r.logs!==void 0&&(typeof r.logs!=`object`||r.logs===null||Array.isArray(r.logs)?(e.errors.push(`Expected "${t}.logs" to be of type object but got ${JSON.stringify(r.logs)}.`),i=!1):(i=Y(e,t,`logs.enabled`,r.logs.enabled,`boolean`)&&i,i=Z(e,`${t}.logs`,Object.keys(r.logs),[`enabled`])&&i)),r.enabled===void 0&&r.target_instance_percentage===void 0&&r.target_instance_count===void 0&&(r.logs===void 0||typeof r.logs==`object`&&r.logs!==null&&!Array.isArray(r.logs)&&r.logs.enabled===void 0)&&(i=mx(e,t,[{key:`enabled`,value:r.enabled,type:`boolean`},{key:`logs.enabled`,value:r.logs?.enabled,type:`boolean`}])&&i),i=Y(e,t,`target_instance_percentage`,r.target_instance_percentage,`number`)&&i,i=Y(e,t,`target_instance_count`,r.target_instance_count,`number`)&&i,i=Z(e,t,Object.keys(r),[`enabled`,`logs`,`target_instance_percentage`,`target_instance_count`])&&i,bC(r)&&(e.errors.push(`"${t}.enabled" and "${t}.logs.enabled" cannot be set to different values.`),i=!1),r.target_instance_percentage!==void 0&&r.target_instance_count!==void 0&&(e.errors.push(`"${t}.target_instance_percentage" and "${t}.target_instance_count" cannot both be set.`),i=!1),typeof r.target_instance_percentage==`number`&&(!Number.isInteger(r.target_instance_percentage)||r.target_instance_percentage<gC||r.target_instance_percentage>_C)&&(e.errors.push(`"${t}.target_instance_percentage" must be an integer between ${gC} and ${_C} inclusive.`),i=!1),typeof r.target_instance_count==`number`&&(!Number.isInteger(r.target_instance_count)||r.target_instance_count<vC)&&(e.errors.push(`"${t}.target_instance_count" must be a positive integer.`),i=!1);let a=yC(r);return r.target_instance_percentage!==void 0&&!a&&(e.errors.push(`"${t}.target_instance_percentage" requires "${t}.enabled" or "${t}.logs.enabled" to be true because container observability overrides root observability.`),i=!1),r.target_instance_count!==void 0&&!a&&(e.errors.push(`"${t}.target_instance_count" requires "${t}.enabled" or "${t}.logs.enabled" to be true because container observability overrides root observability.`),i=!1),i},`validateContainerObservability`),SC=a((e,t,n)=>{if(n===void 0)return!0;if(typeof n!=`object`||!n)return e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1;let r=n,i=!0;i=mx(e,t,[{key:`enabled`,value:r.enabled,type:`boolean`},{key:`logs.enabled`,value:r.logs?.enabled,type:`boolean`},{key:`traces.enabled`,value:r.traces?.enabled,type:`boolean`},{key:`issues.enabled`,value:r.issues?.enabled,type:`boolean`}])&&i,i=Y(e,t,`head_sampling_rate`,r.head_sampling_rate,`number`)&&i,i=Y(e,t,`redact_query_string`,r.redact_query_string,`boolean`)&&i;let a=r.issues===void 0||r.issues!==null&&typeof r.issues==`object`&&!Array.isArray(r.issues);return a||(e.errors.push(`"${t}.issues" should be an object but got ${JSON.stringify(r.issues)}.`),i=!1),i=Y(e,t,`logs`,r.logs,`object`)&&i,i=Y(e,t,`traces`,r.traces,`object`)&&i,i=Z(e,t,Object.keys(r),[`enabled`,`head_sampling_rate`,`redact_query_string`,`issues`,`logs`,`traces`])&&i,r.issues!==void 0&&a&&(i=Y(e,`${t}.issues`,`enabled`,r.issues.enabled,`boolean`)&&i,i=Z(e,`${t}.issues`,Object.keys(r.issues),[`enabled`])&&i),typeof r.logs==`object`&&(i=Y(e,t,`logs.enabled`,r.logs.enabled,`boolean`)&&i,i=Y(e,t,`logs.head_sampling_rate`,r.logs.head_sampling_rate,`number`)&&i,i=Y(e,t,`logs.invocation_logs`,r.logs.invocation_logs,`boolean`)&&i,i=gx(e,`logs.destinations`,r.logs?.destinations,`string`)&&i,i=Y(e,t,`logs.persist`,r.logs.persist,`boolean`)&&i,i=Z(e,t,Object.keys(r.logs),[`enabled`,`head_sampling_rate`,`invocation_logs`,`destinations`,`persist`])&&i),typeof r.traces==`object`&&(i=Y(e,t,`traces.enabled`,r.traces.enabled,`boolean`)&&i,i=Y(e,t,`traces.head_sampling_rate`,r.traces.head_sampling_rate,`number`)&&i,i=gx(e,`traces.destinations`,r.traces?.destinations,`string`)&&i,i=Y(e,t,`traces.persist`,r.traces.persist,`boolean`)&&i,i=Z(e,t,Object.keys(r.traces),[`enabled`,`head_sampling_rate`,`destinations`,`persist`])&&i),CC(e,t,`head_sampling_rate`,r?.head_sampling_rate),CC(e,t,`logs.head_sampling_rate`,r?.logs?.head_sampling_rate),CC(e,t,`traces.head_sampling_rate`,r?.traces?.head_sampling_rate),i},`validateObservability`);function CC(e,t,n,r){r&&(r<0||r>1)&&e.errors.push(`"${t}.${n}" must be a value between 0 and 1.`)}a(CC,`validateHeadSamplingRate`);var wC=a((e,t,n)=>{if(n===void 0)return!0;if(typeof n!=`object`||!n)return e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1;let r=n,i=!0;return i=Y(e,t,`dev`,r.dev,`object`)&&i,i=Z(e,t,Object.keys(r),[`dev`])&&i,typeof r.dev==`object`&&r.dev!==null&&(i=px(e,`${t}.dev`,`aud`,r.dev.aud,`string`)&&i,i=Y(e,`${t}.dev`,`identity`,r.dev.identity,`object`)&&i,i=Z(e,`${t}.dev`,Object.keys(r.dev),[`aud`,`identity`])&&i),i},`validateAccess`),TC=a((e,t,n)=>{if(n===void 0)return!0;if(typeof n!=`object`||!n)return e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1;let r=n,i=!0;return i=px(e,t,`enabled`,r.enabled,`boolean`)&&i,i=Y(e,t,`cross_version_cache`,r.cross_version_cache,`boolean`)&&i,i=Z(e,t,Object.keys(r),[`enabled`,`cross_version_cache`])&&i,i},`validateCache`);function EC(e,t,n,r,i){if(!Array.isArray(t.bindings)||t.bindings.length===0)return;let o=t.bindings.filter(e=>!e.script_name),s=a(e=>{let t=r?.[e];if(t===void 0||t.type!==`durable-object`)return!1;let n=t.state??`created`;return n===`created`||n===`expecting-transfer`},`exportsCovers`),c=o.filter(e=>typeof e.class_name!=`string`||!s(e.class_name));if(c.length===0||n.length>0||c.some(e=>typeof e.class_name!=`string`))return;let l=c.map(e=>e.class_name),u={};for(let e of l)u[e]={type:`durable-object`,storage:`sqlite`};e.warnings.push(ie`
297
297
  In your ${on(i)} file, you have configured \`durable_objects\` exported by this Worker (${l.join(`, `)}), but no live \`exports\` entry for them. This may not work as expected until you add a live \`durable-object\` entry to \`exports\` for each. Add the following configuration:
298
298
 
299
299
  \`\`\`
300
300
  ${sn({exports:u},i)}
301
- \`\`\``)}a(EC,`warnIfDurableObjectsHaveNoLifecycleConfig`);function DC(e,t,n){t.length>0&&n!==void 0&&Object.values(n).some(e=>e.type===`durable-object`)&&e.errors.push("`migrations` and `exports` are mutually exclusive. Choose one or the other to declare your Durable Object lifecycle, but not both.")}a(DC,`errorIfMigrationsAndExportsBothSet`);function OC(e,t,n,r){if(t!==void 0&&!Array.isArray(t)||t===void 0&&r)return;let i=new Map,a=new Set;for(let e of t??[])typeof e.name==`string`&&(i.has(e.name)?a.add(e.name):i.set(e.name,e));for(let t of[...a].sort())e.errors.push(`"containers" contains more than one container named "${t}". Container names must be unique.`);let o=new Map;for(let e of t??[])typeof e.class_name==`string`&&o.set(e.class_name,(o.get(e.class_name)??0)+1);let s=new Set([...o].filter(([,e])=>e>1).map(([e])=>e));for(let t of[...s].sort())e.errors.push(`More than one container is attached to the Durable Object "${t}". A Durable Object can only have one container attached to it.`);let c=de(n),l=new Set,u=new Map;for(let[t,n]of Object.entries(c))if(!(n.state!==void 0&&n.state!==`created`&&n.state!==`expecting-transfer`)&&(l.add(t),!(typeof n.container!=`string`||n.container===``))){if(!i.has(n.container)){e.errors.push(`"exports.${t}.container" references a container named "${n.container}", but no container with that name is defined in "containers".`);continue}u.set(n.container,[...u.get(n.container)??[],t])}for(let[t,n]of u)n.length>1&&e.errors.push(`The container "${t}" is referenced by more than one Durable Object export (${n.join(`, `)}). A container can only back a single Durable Object.`);let d=he(n),f=Object.keys(c).length>0;for(let n of t??[]){if(typeof n.name!=`string`)continue;if(n.class_name===void 0){d.has(n.name)||e.errors.push(`The container "${n.name}" is not linked to a Durable Object. Either set "containers.class_name", or reference this container from a Durable Object's \`exports\` entry via its "container" field.`);continue}if(s.has(n.class_name))continue;let t=c[n.class_name],r=t!==void 0&&`container`in t?t.container:void 0;if(typeof r==`string`&&r!==n.name){e.errors.push(`The container "${n.name}" sets "class_name" to "${n.class_name}", but "exports.${n.class_name}.container" is "${r}". A Durable Object and its container must reference each other consistently.`);continue}let i=u.get(n.name),a=i?.length===1?i[0]:void 0;if(a!==void 0&&a!==n.class_name){e.errors.push(`The container "${n.name}" sets "class_name" to "${n.class_name}", but "exports.${a}.container" references it. A Durable Object and its container must reference each other consistently.`);continue}if(f&&!l.has(n.class_name)){e.errors.push(`The container "${n.name}" sets "class_name" to "${n.class_name}", but "exports" has no live "durable-object" entry for "${n.class_name}".`);continue}r===void 0&&t!==void 0&&`storage`in t&&t.storage===`legacy-kv`&&e.errors.push(`The container "${n.name}" sets "class_name" to "${n.class_name}", but "exports.${n.class_name}.storage" is "legacy-kv". Containers are not supported on Durable Objects using the "legacy-kv" storage backend.`)}}a(OC,`validateContainerExportLinks`);var kC=a((e,t,n,r)=>{if(n===void 0)return!0;if(typeof n!=`object`||!n||Array.isArray(n))return e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1;let i=n;return!(!(`exclude`in i)||!cx(e,`${t}.exclude`,i.exclude,r))},`validatePythonModules`);function AC(e,t,n){return _x(e,`remote`,`boolean`)?!0:(n.errors.push(`"${t}" should, optionally, have a boolean "remote" field but got ${JSON.stringify(e)}.`),!1)}a(AC,`isRemoteValid`);function jC(e,t){let n=t?S.dirname(t):process.cwd(),r=S.resolve(n,e);if(s.existsSync(r)){if(Tn(r))throw new F(`${e} is a directory, you should specify a path to the Dockerfile`,{telemetryMessage:!1});return!0}let i=`The image "${e}" does not appear to be a valid path to a Dockerfile, or a valid image registry path:
301
+ \`\`\``)}a(EC,`warnIfDurableObjectsHaveNoLifecycleConfig`);function DC(e,t,n){t.length>0&&n!==void 0&&Object.values(n).some(e=>e.type===`durable-object`)&&e.errors.push("`migrations` and `exports` are mutually exclusive. Choose one or the other to declare your Durable Object lifecycle, but not both.")}a(DC,`errorIfMigrationsAndExportsBothSet`);function OC(e,t,n,r){if(t!==void 0&&!Array.isArray(t)||t===void 0&&r)return;let i=new Map,a=new Set;for(let e of t??[])typeof e.name==`string`&&(i.has(e.name)?a.add(e.name):i.set(e.name,e));for(let t of[...a].sort())e.errors.push(`"containers" contains more than one container named "${t}". Container names must be unique.`);let o=new Map;for(let e of t??[])typeof e.class_name==`string`&&o.set(e.class_name,(o.get(e.class_name)??0)+1);let s=new Set([...o].filter(([,e])=>e>1).map(([e])=>e));for(let t of[...s].sort())e.errors.push(`More than one container is attached to the Durable Object "${t}". A Durable Object can only have one container attached to it.`);let c=de(n),l=new Set,u=new Map;for(let[t,n]of Object.entries(c))if(!(n.state!==void 0&&n.state!==`created`&&n.state!==`expecting-transfer`)&&(l.add(t),!(typeof n.container!=`string`||n.container===``))){if(!i.has(n.container)){e.errors.push(`"exports.${t}.container" references a container named "${n.container}", but no container with that name is defined in "containers".`);continue}u.set(n.container,[...u.get(n.container)??[],t])}for(let[t,n]of u)n.length>1&&e.errors.push(`The container "${t}" is referenced by more than one Durable Object export (${n.join(`, `)}). A container can only back a single Durable Object.`);let d=he(n),f=Object.keys(c).length>0;for(let n of t??[]){if(typeof n.name!=`string`)continue;if(n.class_name===void 0){d.has(n.name)||e.errors.push(`The container "${n.name}" is not linked to a Durable Object. Either set "containers.class_name", or reference this container from a Durable Object's \`exports\` entry via its "container" field.`);continue}if(s.has(n.class_name))continue;let t=c[n.class_name],r=t!==void 0&&`container`in t?t.container:void 0;if(typeof r==`string`&&r!==n.name){e.errors.push(`The container "${n.name}" sets "class_name" to "${n.class_name}", but "exports.${n.class_name}.container" is "${r}". A Durable Object and its container must reference each other consistently.`);continue}let i=u.get(n.name),a=i?.length===1?i[0]:void 0;if(a!==void 0&&a!==n.class_name){e.errors.push(`The container "${n.name}" sets "class_name" to "${n.class_name}", but "exports.${a}.container" references it. A Durable Object and its container must reference each other consistently.`);continue}if(f&&!l.has(n.class_name)){e.errors.push(`The container "${n.name}" sets "class_name" to "${n.class_name}", but "exports" has no live "durable-object" entry for "${n.class_name}".`);continue}r===void 0&&t!==void 0&&`storage`in t&&t.storage===`legacy-kv`&&e.errors.push(`The container "${n.name}" sets "class_name" to "${n.class_name}", but "exports.${n.class_name}.storage" is "legacy-kv". Containers are not supported on Durable Objects using the "legacy-kv" storage backend.`)}}a(OC,`validateContainerExportLinks`);var kC=a((e,t,n,r)=>{if(n===void 0)return!0;if(typeof n!=`object`||!n||Array.isArray(n))return e.errors.push(`"${t}" should be an object but got ${JSON.stringify(n)}.`),!1;let i=n;return!(!(`exclude`in i)||!cx(e,`${t}.exclude`,i.exclude,r))},`validatePythonModules`);function AC(e,t,n){return _x(e,`remote`,`boolean`)?!0:(n.errors.push(`"${t}" should, optionally, have a boolean "remote" field but got ${JSON.stringify(e)}.`),!1)}a(AC,`isRemoteValid`);function jC(e,t){let n=t?w.dirname(t):process.cwd(),r=w.resolve(n,e);if(l.existsSync(r)){if(Tn(r))throw new F(`${e} is a directory, you should specify a path to the Dockerfile`,{telemetryMessage:!1});return!0}let i=`The image "${e}" does not appear to be a valid path to a Dockerfile, or a valid image registry path:
302
302
  `;try{new URL(`https://${e}`)}catch(e){throw e instanceof Error?new F(i+e.message,{telemetryMessage:!1}):e}let a=e.split(`/`);if(!a[a.length-1]?.includes(`:`))throw new F(i+`If this is an image registry path, it needs to include at least a tag ':' (e.g: docker.io/httpd:1)`,{telemetryMessage:!1});if(e.includes(`://`))throw new F(i+`Image reference should not include the protocol part (e.g: docker.io/httpd:1, not https://docker.io/httpd:1)`,{telemetryMessage:!1});return!1}a(jC,`isDockerfile`);var MC={plain_text:`local-only`,secret_text:`local-only`,json:`local-only`,wasm_module:`local-only`,text_blob:`local-only`,data_blob:`local-only`,version_metadata:`local-only`,inherit:`local-only`,logfwdr:`local-only`,assets:`local-only`,unsafe_hello_world:`local-only`,durable_object_namespace:`local-only`,hyperdrive:`local-only`,fetcher:`local-only`,analytics_engine:`local-only`,secrets_store_secret:`local-only`,ratelimit:`local-only`,worker_loader:`local-only`,kv_namespace:`local-and-remote`,r2_bucket:`local-and-remote`,d1:`local-and-remote`,workflow:`local-only`,browser:`local-and-remote`,images:`local-and-remote`,stream:`local-and-remote`,send_email:`local-and-remote`,pipeline:`local-and-remote`,service:`local-and-remote`,queue:`local-and-remote`,flagship:`local-and-remote`,vectorize:`remote`,mtls_certificate:`remote`,dispatch_namespace:`remote`,ai:`DO-NOT-USE-this-resource-will-never-have-a-local-simulator`,ai_search:`DO-NOT-USE-this-resource-will-never-have-a-local-simulator`,ai_search_namespace:`DO-NOT-USE-this-resource-will-never-have-a-local-simulator`,media:`DO-NOT-USE-this-resource-will-never-have-a-local-simulator`,artifacts:`DO-NOT-USE-this-resource-will-never-have-a-local-simulator`,vpc_service:`DO-NOT-USE-this-resource-will-never-have-a-local-simulator`,vpc_network:`DO-NOT-USE-this-resource-will-never-have-a-local-simulator`,agent_memory:`DO-NOT-USE-this-resource-will-never-have-a-local-simulator`};function NC(e){return e in MC?MC[e]:`local-only`}a(NC,`getBindingLocalSupport`);function PC(e,t,n){switch(NC(e)){case`local-and-remote`:return;case`local-only`:if(t===!0)throw new F(`${Q(e)} bindings do not support accessing remote resources.`,{telemetryMessage:`utils bindings unsupported remote resources`});return;case`remote`:if(t===!1)throw new F(`${Q(e)} bindings do not support local development. You can set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`,{telemetryMessage:`utils bindings unsupported local development`});t===void 0&&n(`${Q(e)} bindings do not support local development, and so parts of your Worker may not work correctly. You can set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`);return;case`DO-NOT-USE-this-resource-will-never-have-a-local-simulator`:if(t===!1)throw new F(`${Q(e)} bindings do not support local development. You can set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`,{telemetryMessage:`utils bindings unsupported local development always remote`});t===void 0&&n(`${Q(e)} bindings always access remote resources, and so may incur usage charges even in local dev. To suppress this warning, set \`remote: true\` for the binding definition in your configuration file.`);return;default:}}a(PC,`validateBindingRemoteSetting`);var FC=`pages_build_output_dir.name.compatibility_date.compatibility_flags.send_metrics.no_bundle.limits.placement.vars.durable_objects.kv_namespaces.queues.r2_buckets.d1_databases.vectorize.hyperdrive.services.analytics_engine_datasets.ai.version_metadata.dev.mtls_certificates.browser.upload_source_maps.configPath.userConfigPath.topLevelName.definedEnvironments.targetEnvironment`.split(`.`);function IC(e,t,n){if(!e.pages_build_output_dir)throw new oe(`Attempting to validate Pages configuration file, but "pages_build_output_dir" field was not found.
303
303
  "pages_build_output_dir" is required for Pages projects.`,{telemetryMessage:!1});let r=new Qb(`Running configuration file validation for Pages:`);return LC(e,r),RC(n,r),zC(t,r),BC(e,r),VC(e,r),r}a(IC,`validatePagesConfig`);function LC(e,t){e.main!==void 0&&t.errors.push(`Configuration file cannot contain both both "main" and "pages_build_output_dir" configuration keys.
304
304
  Please use "main" if you are deploying a Worker, or "pages_build_output_dir" if you are deploying a Pages project.`)}a(LC,`validateMainField`);function RC(e,t){(e===void 0||e.trim()===``)&&t.errors.push(`Missing top-level field "name" in configuration file.
305
305
  Pages requires the name of your project to be configured at the top-level of your Wrangler configuration file. This is because, in Pages, environments target the same project.`)}a(RC,`validateProjectName`);function zC(e,t){if(!e?.length)return;let n=e.filter(e=>e!==`preview`&&e!==`production`);n.length>0&&t.errors.push(`Configuration file contains the following environment names that are not supported by Pages projects:
306
306
  ${n.map(e=>`"${e}"`).join()}.
307
307
  The supported named-environments for Pages are "preview" and "production".`)}a(zC,`validatePagesEnvironmentNames`);function BC(e,t){let n=new Set(Object.keys(e));for(let t of FC)t===`queues`&&e.queues?.consumers?.length||n.delete(t);for(let t of n)(e[t]===void 0||JSON.stringify(e[t])===JSON.stringify(bo[t]))&&n.delete(t);n.size>0&&Array.from(n.keys()).forEach(n=>{n===`queues`&&e.queues?.consumers?.length?t.errors.push(`Configuration file for Pages projects does not support "queues.consumers"`):t.errors.push(`Configuration file for Pages projects does not support "${n}"`)})}a(BC,`validateUnsupportedFields`);function VC(e,t){e.durable_objects.bindings.length>0&&e.durable_objects.bindings.filter(e=>!X(e,`script_name`,`string`)).length>0&&t.errors.push(`Durable Objects bindings should specify a "script_name".
308
- Pages requires Durable Object bindings to specify the name of the Worker where the Durable Object is defined.`)}a(VC,`validateDurableObjectBinding`);function HC(e,t){try{return S.dirname(r.resolve(`${e}/package.json`,{paths:[t]}))}catch{}try{return S.dirname(r.resolve(e,{paths:[t]}))}catch{}try{let n=S.join(t,`node_modules`,e,`package.json`);if(g(n).isFile())return S.dirname(n)}catch{}}a(HC,`getPackagePath`);function UC(e,t){return!!HC(e,t)}a(UC,`isPackageInstalled`);function WC(e,t,n={}){try{let r=HC(e,t);if(!r)return;let i=GC(`package.json`,r,n.stopAtProjectPath===!0?t:void 0);if(!i)return;let a=Mt(It(i),i);if(a.name!==e){let t=a.bundledVersions?.[e];if(t!==void 0)return t}return a.version}catch{}}a(WC,`getInstalledPackageVersion`);function GC(e,t,n){let r=t,i=S.parse(r).root;for(;;){let t=S.join(r,e);try{if(g(t).isFile())return t}catch{}if(n!==void 0&&r===n)break;let a=S.dirname(r);if(a===r||r===i)break;r=a}}a(GC,`findFileUp`);function KC(e){}a(KC,`assertNever`);function qC(e,t){let{usePreviewIds:n=!1,pages:r=!1}=t??{},i={},a=Object.entries(e);for(let[e,t]of a)if(t!==void 0)switch(e){case`vars`:for(let[e,n]of Object.entries(t))typeof n==`string`?i[e]={type:`plain_text`,value:n}:i[e]={type:`json`,value:n};break;case`kv_namespaces`:for(let{binding:e,...r}of t)i[e]={type:`kv_namespace`,...r,id:n?r.preview_id??r.id:r.id};break;case`send_email`:if(r)break;for(let{name:e,destination_address:n,allowed_destination_addresses:r,allowed_sender_addresses:a,remote:o}of t){let t={type:`send_email`,allowed_sender_addresses:a,remote:o};n===void 0?r===void 0?i[e]=t:i[e]={...t,allowed_destination_addresses:r}:i[e]={...t,destination_address:n}}break;case`wasm_modules`:if(r)break;for(let[e,n]of Object.entries(t))typeof n==`string`?i[e]={type:`wasm_module`,source:{path:n}}:i[e]={type:`wasm_module`,source:{contents:n}};break;case`text_blobs`:if(r)break;for(let[e,n]of Object.entries(t))i[e]={type:`text_blob`,source:{path:n}};break;case`data_blobs`:if(r)break;for(let[e,n]of Object.entries(t))typeof n==`string`?i[e]={type:`data_blob`,source:{path:n}}:i[e]={type:`data_blob`,source:{contents:n}};break;case`browser`:{let{binding:e,...n}=t;i[e]={type:`browser`,...n};break}case`durable_objects`:for(let{name:e,...n}of t.bindings??[])i[e]={type:`durable_object_namespace`,...n};break;case`workflows`:for(let{binding:e,...n}of t)i[e]={type:`workflow`,...n};break;case`queues`:for(let{binding:e,...n}of t.producers??[])i[e]={type:`queue`,queue_name:n.queue,...n};break;case`r2_buckets`:for(let{binding:e,...r}of t)i[e]={type:`r2_bucket`,...r,bucket_name:n?r.preview_bucket_name??r.bucket_name:r.bucket_name};break;case`d1_databases`:for(let{binding:e,...r}of t)i[e]={type:`d1`,...r,database_id:n?r.preview_database_id??r.database_id:r.database_id};break;case`services`:for(let{binding:e,...n}of t)i[e]={type:`service`,...n};break;case`analytics_engine_datasets`:for(let{binding:e,...n}of t)i[e]={type:`analytics_engine`,...n};break;case`dispatch_namespaces`:if(r)break;for(let{binding:e,...n}of t)i[e]={type:`dispatch_namespace`,...n};break;case`mtls_certificates`:for(let{binding:e,...n}of t)i[e]={type:`mtls_certificate`,...n};break;case`logfwdr`:if(r)break;for(let{name:e,...n}of t.bindings??[])i[e]={type:`logfwdr`,...n};break;case`ai`:{let{binding:e,...n}=t;i[e]={type:`ai`,...n};break}case`images`:{let{binding:e,...n}=t;i[e]={type:`images`,...n};break}case`stream`:{let{binding:e,...n}=t;i[e]={type:`stream`,...n};break}case`version_metadata`:{let{binding:e,...n}=t;i[e]={type:`version_metadata`,...n};break}case`hyperdrive`:for(let{binding:e,...n}of t)i[e]={type:`hyperdrive`,...n};break;case`vectorize`:for(let{binding:e,...n}of t)i[e]={type:`vectorize`,...n};break;case`ai_search_namespaces`:for(let{binding:e,...n}of t)i[e]={type:`ai_search_namespace`,...n};break;case`ai_search`:for(let{binding:e,...n}of t)i[e]={type:`ai_search`,...n};break;case`agent_memory`:for(let{binding:e,...n}of t)i[e]={type:`agent_memory`,...n};break;case`unsafe`:if(r)break;for(let{type:e,name:n,...r}of t.bindings??[])i[n]={type:`unsafe_${e}`,...r};break;case`assets`:if(r)break;t.binding&&(i[t.binding]={type:`assets`});break;case`pipelines`:if(r)break;for(let{binding:e,...n}of t)i[e]={type:`pipeline`,...n};break;case`secrets_store_secrets`:for(let{binding:e,...n}of t)i[e]={type:`secrets_store_secret`,...n};break;case`artifacts`:for(let{binding:e,...n}of t)i[e]={type:`artifacts`,...n};break;case`unsafe_hello_world`:if(r)break;for(let{binding:e,...n}of t)i[e]={type:`unsafe_hello_world`,...n};break;case`flagship`:for(let{binding:e,...n}of t)i[e]={type:`flagship`,...n};break;case`ratelimits`:for(let{name:e,...n}of t)i[e]={type:`ratelimit`,...n};break;case`worker_loaders`:for(let{binding:e,...n}of t)i[e]={type:`worker_loader`,...n};break;case`vpc_services`:for(let{binding:e,...n}of t)i[e]={type:`vpc_service`,...n};break;case`vpc_networks`:for(let{binding:e,...n}of t)i[e]={type:`vpc_network`,...n};break;case`media`:{let{binding:e,...n}=t;i[e]={type:`media`,...n};break}}return i}a(qC,`convertConfigToBindings`);function JC(e){return e.startsWith(`unsafe_`)}a(JC,`isUnsafeBindingType`);var YC=[`durable_object_namespace`,`logfwdr`,`ratelimit`,`unsafe_ratelimit`,`send_email`];function XC(e){return YC.includes(e)?`name`:`binding`}a(XC,`getBindingKey`);function ZC(e,t){return Object.entries(t??{}).filter(t=>t[1].type===e).map(t=>({...t[1],[XC(e)]:t[0]}))}a(ZC,`extractBindingsOfType`);function QC(e,t){return e?qC(e,{usePreviewIds:!1,pages:t?.pages}):{}}a(QC,`getBindings`);var{dim:$C,white:ew}=Yr,tw=Yr.hex(`#BD5B08`),nw=!1;function rw(e,t){let{containers:n=[],log:r,streamingTailConsumers:i=[],tailConsumers:o=[]}=t,s=t,c=!1,l=s.isMultiWorker??!1,u=aw({isProvisioning:s.provisioning,isLocalDev:s.local}),d=a((e,t=40)=>{let n=typeof e==`string`?e:JSON.stringify(e);return n.length<t?n:`${n.substring(0,t-3)}...`},`truncate`),f=[],p=ZC(`data_blob`,e),m=ZC(`durable_object_namespace`,e),h=ZC(`workflow`,e),g=ZC(`kv_namespace`,e),_=ZC(`send_email`,e),v=ZC(`queue`,e),y=ZC(`d1`,e),x=ZC(`vectorize`,e),S=ZC(`ai_search_namespace`,e),C=ZC(`ai_search`,e),w=ZC(`agent_memory`,e),T=ZC(`hyperdrive`,e),E=ZC(`r2_bucket`,e),D=ZC(`logfwdr`,e),O=ZC(`secrets_store_secret`,e),k=ZC(`artifacts`,e),A=ZC(`service`,e),j=ZC(`vpc_service`,e),M=ZC(`vpc_network`,e),N=ZC(`analytics_engine`,e),P=ZC(`text_blob`,e),ee=ZC(`browser`,e),te=ZC(`images`,e),ne=ZC(`stream`,e),re=ZC(`ai`,e),ie=ZC(`version_metadata`,e),ae=Object.entries(e??{}).filter(([e,t])=>t.type===`plain_text`||t.type===`json`||t.type===`secret_text`).map(([e,t])=>({binding:e,...t})),F=ZC(`wasm_module`,e),oe=ZC(`dispatch_namespace`,e),se=ZC(`mtls_certificate`,e),ce=ZC(`pipeline`,e),le=ZC(`ratelimit`,e),ue=ZC(`assets`,e),de=ZC(`unsafe_hello_world`,e),fe=ZC(`flagship`,e),pe=ZC(`media`,e),I=ZC(`worker_loader`,e),me=Object.entries(e??{}).filter(([e,t])=>JC(t.type)&&t.type!==`unsafe_hello_world`).map(([e,t])=>({name:e,...t}));if(p.length>0&&f.push(...p.map(({binding:e,source:t})=>({name:e,type:Q(`data_blob`),value:`contents`in t?`<Buffer>`:d(t.path),mode:u({isSimulatedLocally:!0})}))),m.length>0&&f.push(...m.map(({name:e,class_name:t,script_name:n})=>{let r=t,i;if(n)if(s.local&&s.registry!==null){let e=s.registry?.[n];c=!0,e&&e.debugPortAddress?(r+=`, defined in ${n}`,i=u({isSimulatedLocally:!0,connected:!0})):(r+=`, defined in ${n}`,i=u({isSimulatedLocally:!0,connected:!1}))}else r+=`, defined in ${n}`,i=u({isSimulatedLocally:!0});else i=u({isSimulatedLocally:!0});return{name:e,type:Q(`durable_object_namespace`),value:r,mode:i}})),h.length>0&&f.push(...h.map(({class_name:e,script_name:t,binding:n})=>{let r=e;return t&&(r+=` (defined in ${t})`),{name:n,type:Q(`workflow`),value:r,mode:u({isSimulatedLocally:!0})}})),g.length>0&&f.push(...g.map(({binding:e,id:t,remote:n})=>({name:e,type:Q(`kv_namespace`),value:t,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!n})}))),_.length>0&&f.push(..._.map(e=>{let t=`destination_address`in e?e.destination_address:void 0,n=`allowed_destination_addresses`in e?e.allowed_destination_addresses:void 0,r=`allowed_sender_addresses`in e?e.allowed_sender_addresses:void 0,i=t||n?.join(`, `)||`unrestricted`;return r&&(i+=` - senders: ${r.join(`, `)}`),{name:e.name,type:Q(`send_email`),value:i,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!e.remote})}})),v.length>0&&f.push(...v.map(({binding:e,queue_name:t,remote:n})=>({name:e,type:Q(`queue`),value:t,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!n})}))),y.length>0&&f.push(...y.map(({binding:e,database_name:t,database_id:n,preview_database_id:r,remote:i})=>{let a=typeof n==`symbol`?n:r??t??n;return{name:e,type:Q(`d1`),mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!i}),value:a}})),x.length>0&&f.push(...x.map(({binding:e,index_name:t,remote:n})=>({name:e,type:Q(`vectorize`),value:t,mode:u({isSimulatedLocally:n&&!s.remoteBindingsDisabled?!1:void 0})}))),S.length>0&&f.push(...S.map(({binding:e,namespace:t})=>({name:e,type:Q(`ai_search_namespace`),value:t??void 0,mode:u({isSimulatedLocally:!1})}))),C.length>0&&f.push(...C.map(({binding:e,instance_name:t})=>({name:e,type:Q(`ai_search`),value:t?String(t):void 0,mode:u({isSimulatedLocally:!1})}))),w.length>0&&f.push(...w.map(({binding:e,namespace:t})=>({name:e,type:Q(`agent_memory`),value:t??void 0,mode:u({isSimulatedLocally:!1})}))),T.length>0&&f.push(...T.map(({binding:e,id:t})=>({name:e,type:Q(`hyperdrive`),value:t,mode:u({isSimulatedLocally:!0})}))),j.length>0&&f.push(...j.map(({binding:e,service_id:t,remote:n})=>({name:e,type:Q(`vpc_service`),value:t,mode:u({isSimulatedLocally:n&&!s.remoteBindingsDisabled?!1:void 0})}))),M.length>0&&f.push(...M.map(({binding:e,tunnel_id:t,network_id:n,remote:r})=>({name:e,type:Q(`vpc_network`),value:t??n,mode:u({isSimulatedLocally:r&&!s.remoteBindingsDisabled?!1:void 0})}))),E.length>0&&f.push(...E.map(({binding:e,bucket_name:t,jurisdiction:n,remote:r})=>{let i=typeof t==`symbol`?t:t?`${t}${n?` (${n})`:``}`:void 0;return{name:e,type:Q(`r2_bucket`),value:i,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!r})}})),D.length>0&&f.push(...D.map(({name:e,destination:t})=>({name:e,type:Q(`logfwdr`),value:t,mode:u()}))),O.length>0&&f.push(...O.map(({binding:e,store_id:t,secret_name:n})=>({name:e,type:Q(`secrets_store_secret`),value:`${t}/${n}`,mode:u({isSimulatedLocally:!0})}))),k.length>0&&f.push(...k.map(({binding:e,namespace:t})=>({name:e,type:Q(`artifacts`),value:t,mode:u({isSimulatedLocally:!1})}))),de.length>0&&f.push(...de.map(({binding:e,enable_timer:t})=>({name:e,type:Q(`unsafe_hello_world`),value:t?`Timer enabled`:`Timer disabled`,mode:u({isSimulatedLocally:!0})}))),fe.length>0&&f.push(...fe.map(({binding:e,app_id:t,remote:n})=>({name:e,type:Q(`flagship`),value:t,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!n})}))),A.length>0&&f.push(...A.map(({binding:e,service:t,entrypoint:n,remote:r,dev:i})=>{let a=t,o;if(n&&(a+=`#${n}`),i!==void 0&&s.local)o=u({isSimulatedLocally:!0});else if(r)o=u({isSimulatedLocally:!1});else if(s.local&&s.registry!==null)if(t===s.name)c=!0,o=u({isSimulatedLocally:!0,connected:!0});else{let e=s.registry?.[t];c=!0,o=e&&e.debugPortAddress?u({isSimulatedLocally:!0,connected:!0}):u({isSimulatedLocally:!0,connected:!1})}return{name:e,type:Q(`service`),value:a,mode:o}})),N.length>0&&f.push(...N.map(({binding:e,dataset:t})=>({name:e,type:Q(`analytics_engine`),value:t??e,mode:u({isSimulatedLocally:!0})}))),P.length>0&&f.push(...P.map(({binding:e,source:t})=>({name:e,type:Q(`text_blob`),value:`contents`in t?d(t.contents):`path`in t?d(t.path):void 0,mode:u({isSimulatedLocally:!0})}))),ee.length>0&&f.push(...ee.map(({binding:e,remote:t})=>({name:e,type:Q(`browser`),value:void 0,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!t})}))),te.length>0&&f.push(...te.map(({binding:e,remote:t})=>({name:e,type:Q(`images`),value:void 0,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!t})}))),ne.length>0&&f.push(...ne.map(({binding:e,remote:t})=>({name:e,type:Q(`stream`),value:void 0,mode:u({isSimulatedLocally:(t===!0||t===void 0)&&!s.remoteBindingsDisabled?!1:void 0})}))),pe.length>0&&f.push(...pe.map(({binding:e,remote:t})=>({name:e,type:Q(`media`),value:void 0,mode:u({isSimulatedLocally:(t===!0||t===void 0)&&!s.remoteBindingsDisabled?!1:void 0})}))),re.length>0&&f.push(...re.map(({binding:e,staging:t,remote:n})=>({name:e,type:Q(`ai`),value:t?`staging`:void 0,mode:u({isSimulatedLocally:(n===!0||n===void 0)&&!s.remoteBindingsDisabled?!1:void 0})}))),ce.length>0&&f.push(...ce.map(({binding:e,stream:t,pipeline:n,remote:r})=>({name:e,type:Q(`pipeline`),value:t||n,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!r})}))),le.length>0&&f.push(...le.map(({name:e,simple:t})=>({name:e,type:Q(`ratelimit`),value:`${t.limit} requests/${t.period}s`,mode:u({isSimulatedLocally:!0})}))),ue.length>0&&f.push(...ue.map(({binding:e})=>({name:e,type:Q(`assets`),value:void 0,mode:u({isSimulatedLocally:!0})}))),ie.length>0&&f.push(...ie.map(({binding:e})=>({name:e,type:Q(`version_metadata`),value:void 0,mode:u({isSimulatedLocally:!0})}))),me.length>0&&f.push(...me.map(e=>{let t=`dev`in e?e.dev:void 0,n=e.type.slice(7);return{name:e.name,type:t?t.plugin.name:Q(e.type),value:n,mode:u({isSimulatedLocally:!!t})}})),ae.length>0&&f.push(...ae.map(e=>{let{binding:t,type:n,value:r}=e,i;return i=n===`plain_text`&&e.hidden!==!0?`"${d(r)}"`:n===`json`?d(JSON.stringify(r)):`"(hidden)"`,{name:t,type:Q(n),value:i,mode:u({isSimulatedLocally:!0})}})),F.length>0&&f.push(...F.map(({binding:e,source:t})=>({name:e,type:Q(`wasm_module`),value:`contents`in t?`<Wasm>`:d(t.path),mode:u({isSimulatedLocally:!0})}))),oe.length>0&&f.push(...oe.map(({binding:e,namespace:t,outbound:n,remote:r})=>({name:e,type:Q(`dispatch_namespace`),value:typeof t==`symbol`?t:n?`${t} (outbound -> ${n.service})`:t,mode:u({isSimulatedLocally:r&&!s.remoteBindingsDisabled?!1:void 0})}))),se.length>0&&f.push(...se.map(({binding:e,certificate_id:t,remote:n})=>({name:e,type:Q(`mtls_certificate`),value:t,mode:u({isSimulatedLocally:n&&!s.remoteBindingsDisabled?!1:void 0})}))),I.length>0&&f.push(...I.map(({binding:e})=>({name:e,type:Q(`worker_loader`),value:void 0,mode:u({isSimulatedLocally:!0})}))),f.length===0)s.warnIfNoBindings&&(s.name&&l?r(`No bindings found for ${Yr.blue(s.name)}`):r(`No bindings found.`));else{let e;e=s.provisioning?`The following bindings need to be provisioned:`:s.name&&l?`${Yr.blue(s.name)} has access to the following bindings:`:`Your Worker has access to the following bindings:`;let t={binding:`Binding`,resource:`Resource`,mode:`Mode`},n=Math.max(...f.map(e=>typeof e.value==`symbol`?9:e.value?.length??0)),i=Math.max(...f.map(e=>e.name.length)),a=Math.max(...f.map(e=>e.type.length),t.resource.length),o=Math.max(...f.map(e=>e.mode?b(e.mode).length:t.mode.length)),c=f.some(e=>e.mode),u=4+i+2+n+1,d=u+6+a+6+o>=process.stdout.columns;r(e);let p=d?` `.repeat(4):` `.repeat(6);r(`${iw($C(t.binding),d?4+i:u)}${p}${iw($C(t.resource),a)}${p}${c?$C(t.mode):``}`);for(let e of f){let t=$C(typeof e.value==`symbol`?Yr.italic(`inherited`):e.value??``),n=iw(`${ew(`env.${e.name}`)}${e.value&&!d?` (${t})`:``}`,d?4+i:u),o=d&&e.value?`
308
+ Pages requires Durable Object bindings to specify the name of the Worker where the Durable Object is defined.`)}a(VC,`validateDurableObjectBinding`);function HC(e,t){try{return w.dirname(r.resolve(`${e}/package.json`,{paths:[t]}))}catch{}try{return w.dirname(r.resolve(e,{paths:[t]}))}catch{}try{let n=w.join(t,`node_modules`,e,`package.json`);if(v(n).isFile())return w.dirname(n)}catch{}}a(HC,`getPackagePath`);function UC(e,t){return!!HC(e,t)}a(UC,`isPackageInstalled`);function WC(e,t,n={}){try{let r=HC(e,t);if(!r)return;let i=GC(`package.json`,r,n.stopAtProjectPath===!0?t:void 0);if(!i)return;let a=Mt(It(i),i);if(a.name!==e){let t=a.bundledVersions?.[e];if(t!==void 0)return t}return a.version}catch{}}a(WC,`getInstalledPackageVersion`);function GC(e,t,n){let r=t,i=w.parse(r).root;for(;;){let t=w.join(r,e);try{if(v(t).isFile())return t}catch{}if(n!==void 0&&r===n)break;let a=w.dirname(r);if(a===r||r===i)break;r=a}}a(GC,`findFileUp`);function KC(e){}a(KC,`assertNever`);function qC(e,t){let{usePreviewIds:n=!1,pages:r=!1}=t??{},i={},a=Object.entries(e);for(let[e,t]of a)if(t!==void 0)switch(e){case`vars`:for(let[e,n]of Object.entries(t))typeof n==`string`?i[e]={type:`plain_text`,value:n}:i[e]={type:`json`,value:n};break;case`kv_namespaces`:for(let{binding:e,...r}of t)i[e]={type:`kv_namespace`,...r,id:n?r.preview_id??r.id:r.id};break;case`send_email`:if(r)break;for(let{name:e,destination_address:n,allowed_destination_addresses:r,allowed_sender_addresses:a,remote:o}of t){let t={type:`send_email`,allowed_sender_addresses:a,remote:o};n===void 0?r===void 0?i[e]=t:i[e]={...t,allowed_destination_addresses:r}:i[e]={...t,destination_address:n}}break;case`wasm_modules`:if(r)break;for(let[e,n]of Object.entries(t))typeof n==`string`?i[e]={type:`wasm_module`,source:{path:n}}:i[e]={type:`wasm_module`,source:{contents:n}};break;case`text_blobs`:if(r)break;for(let[e,n]of Object.entries(t))i[e]={type:`text_blob`,source:{path:n}};break;case`data_blobs`:if(r)break;for(let[e,n]of Object.entries(t))typeof n==`string`?i[e]={type:`data_blob`,source:{path:n}}:i[e]={type:`data_blob`,source:{contents:n}};break;case`browser`:{let{binding:e,...n}=t;i[e]={type:`browser`,...n};break}case`durable_objects`:for(let{name:e,...n}of t.bindings??[])i[e]={type:`durable_object_namespace`,...n};break;case`workflows`:for(let{binding:e,...n}of t)i[e]={type:`workflow`,...n};break;case`queues`:for(let{binding:e,...n}of t.producers??[])i[e]={type:`queue`,queue_name:n.queue,...n};break;case`r2_buckets`:for(let{binding:e,...r}of t)i[e]={type:`r2_bucket`,...r,bucket_name:n?r.preview_bucket_name??r.bucket_name:r.bucket_name};break;case`d1_databases`:for(let{binding:e,...r}of t)i[e]={type:`d1`,...r,database_id:n?r.preview_database_id??r.database_id:r.database_id};break;case`services`:for(let{binding:e,...n}of t)i[e]={type:`service`,...n};break;case`analytics_engine_datasets`:for(let{binding:e,...n}of t)i[e]={type:`analytics_engine`,...n};break;case`dispatch_namespaces`:if(r)break;for(let{binding:e,...n}of t)i[e]={type:`dispatch_namespace`,...n};break;case`mtls_certificates`:for(let{binding:e,...n}of t)i[e]={type:`mtls_certificate`,...n};break;case`logfwdr`:if(r)break;for(let{name:e,...n}of t.bindings??[])i[e]={type:`logfwdr`,...n};break;case`ai`:{let{binding:e,...n}=t;i[e]={type:`ai`,...n};break}case`images`:{let{binding:e,...n}=t;i[e]={type:`images`,...n};break}case`stream`:{let{binding:e,...n}=t;i[e]={type:`stream`,...n};break}case`version_metadata`:{let{binding:e,...n}=t;i[e]={type:`version_metadata`,...n};break}case`hyperdrive`:for(let{binding:e,...n}of t)i[e]={type:`hyperdrive`,...n};break;case`vectorize`:for(let{binding:e,...n}of t)i[e]={type:`vectorize`,...n};break;case`ai_search_namespaces`:for(let{binding:e,...n}of t)i[e]={type:`ai_search_namespace`,...n};break;case`ai_search`:for(let{binding:e,...n}of t)i[e]={type:`ai_search`,...n};break;case`agent_memory`:for(let{binding:e,...n}of t)i[e]={type:`agent_memory`,...n};break;case`unsafe`:if(r)break;for(let{type:e,name:n,...r}of t.bindings??[])i[n]={type:`unsafe_${e}`,...r};break;case`assets`:if(r)break;t.binding&&(i[t.binding]={type:`assets`});break;case`pipelines`:if(r)break;for(let{binding:e,...n}of t)i[e]={type:`pipeline`,...n};break;case`secrets_store_secrets`:for(let{binding:e,...n}of t)i[e]={type:`secrets_store_secret`,...n};break;case`artifacts`:for(let{binding:e,...n}of t)i[e]={type:`artifacts`,...n};break;case`unsafe_hello_world`:if(r)break;for(let{binding:e,...n}of t)i[e]={type:`unsafe_hello_world`,...n};break;case`flagship`:for(let{binding:e,...n}of t)i[e]={type:`flagship`,...n};break;case`ratelimits`:for(let{name:e,...n}of t)i[e]={type:`ratelimit`,...n};break;case`worker_loaders`:for(let{binding:e,...n}of t)i[e]={type:`worker_loader`,...n};break;case`vpc_services`:for(let{binding:e,...n}of t)i[e]={type:`vpc_service`,...n};break;case`vpc_networks`:for(let{binding:e,...n}of t)i[e]={type:`vpc_network`,...n};break;case`media`:{let{binding:e,...n}=t;i[e]={type:`media`,...n};break}}return i}a(qC,`convertConfigToBindings`);function JC(e){return e.startsWith(`unsafe_`)}a(JC,`isUnsafeBindingType`);var YC=[`durable_object_namespace`,`logfwdr`,`ratelimit`,`unsafe_ratelimit`,`send_email`];function XC(e){return YC.includes(e)?`name`:`binding`}a(XC,`getBindingKey`);function ZC(e,t){return Object.entries(t??{}).filter(t=>t[1].type===e).map(t=>({...t[1],[XC(e)]:t[0]}))}a(ZC,`extractBindingsOfType`);function QC(e,t){return e?qC(e,{usePreviewIds:!1,pages:t?.pages}):{}}a(QC,`getBindings`);var{dim:$C,white:ew}=Yr,tw=Yr.hex(`#BD5B08`),nw=!1;function rw(e,t){let{containers:n=[],log:r,streamingTailConsumers:i=[],tailConsumers:o=[]}=t,s=t,c=!1,l=s.isMultiWorker??!1,u=aw({isProvisioning:s.provisioning,isLocalDev:s.local}),d=a((e,t=40)=>{let n=typeof e==`string`?e:JSON.stringify(e);return n.length<t?n:`${n.substring(0,t-3)}...`},`truncate`),f=[],p=ZC(`data_blob`,e),m=ZC(`durable_object_namespace`,e),h=ZC(`workflow`,e),g=ZC(`kv_namespace`,e),_=ZC(`send_email`,e),v=ZC(`queue`,e),y=ZC(`d1`,e),b=ZC(`vectorize`,e),x=ZC(`ai_search_namespace`,e),C=ZC(`ai_search`,e),w=ZC(`agent_memory`,e),T=ZC(`hyperdrive`,e),E=ZC(`r2_bucket`,e),D=ZC(`logfwdr`,e),O=ZC(`secrets_store_secret`,e),k=ZC(`artifacts`,e),A=ZC(`service`,e),j=ZC(`vpc_service`,e),M=ZC(`vpc_network`,e),N=ZC(`analytics_engine`,e),P=ZC(`text_blob`,e),ee=ZC(`browser`,e),te=ZC(`images`,e),ne=ZC(`stream`,e),re=ZC(`ai`,e),ie=ZC(`version_metadata`,e),ae=Object.entries(e??{}).filter(([e,t])=>t.type===`plain_text`||t.type===`json`||t.type===`secret_text`).map(([e,t])=>({binding:e,...t})),F=ZC(`wasm_module`,e),oe=ZC(`dispatch_namespace`,e),se=ZC(`mtls_certificate`,e),ce=ZC(`pipeline`,e),le=ZC(`ratelimit`,e),ue=ZC(`assets`,e),de=ZC(`unsafe_hello_world`,e),fe=ZC(`flagship`,e),pe=ZC(`media`,e),I=ZC(`worker_loader`,e),me=Object.entries(e??{}).filter(([e,t])=>JC(t.type)&&t.type!==`unsafe_hello_world`).map(([e,t])=>({name:e,...t}));if(p.length>0&&f.push(...p.map(({binding:e,source:t})=>({name:e,type:Q(`data_blob`),value:`contents`in t?`<Buffer>`:d(t.path),mode:u({isSimulatedLocally:!0})}))),m.length>0&&f.push(...m.map(({name:e,class_name:t,script_name:n})=>{let r=t,i;if(n)if(s.local&&s.registry!==null){let e=s.registry?.[n];c=!0,e&&e.debugPortAddress?(r+=`, defined in ${n}`,i=u({isSimulatedLocally:!0,connected:!0})):(r+=`, defined in ${n}`,i=u({isSimulatedLocally:!0,connected:!1}))}else r+=`, defined in ${n}`,i=u({isSimulatedLocally:!0});else i=u({isSimulatedLocally:!0});return{name:e,type:Q(`durable_object_namespace`),value:r,mode:i}})),h.length>0&&f.push(...h.map(({class_name:e,script_name:t,binding:n})=>{let r=e;return t&&(r+=` (defined in ${t})`),{name:n,type:Q(`workflow`),value:r,mode:u({isSimulatedLocally:!0})}})),g.length>0&&f.push(...g.map(({binding:e,id:t,remote:n})=>({name:e,type:Q(`kv_namespace`),value:t,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!n})}))),_.length>0&&f.push(..._.map(e=>{let t=`destination_address`in e?e.destination_address:void 0,n=`allowed_destination_addresses`in e?e.allowed_destination_addresses:void 0,r=`allowed_sender_addresses`in e?e.allowed_sender_addresses:void 0,i=t||n?.join(`, `)||`unrestricted`;return r&&(i+=` - senders: ${r.join(`, `)}`),{name:e.name,type:Q(`send_email`),value:i,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!e.remote})}})),v.length>0&&f.push(...v.map(({binding:e,queue_name:t,remote:n})=>({name:e,type:Q(`queue`),value:t,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!n})}))),y.length>0&&f.push(...y.map(({binding:e,database_name:t,database_id:n,preview_database_id:r,remote:i})=>{let a=typeof n==`symbol`?n:r??t??n;return{name:e,type:Q(`d1`),mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!i}),value:a}})),b.length>0&&f.push(...b.map(({binding:e,index_name:t,remote:n})=>({name:e,type:Q(`vectorize`),value:t,mode:u({isSimulatedLocally:n&&!s.remoteBindingsDisabled?!1:void 0})}))),x.length>0&&f.push(...x.map(({binding:e,namespace:t})=>({name:e,type:Q(`ai_search_namespace`),value:t??void 0,mode:u({isSimulatedLocally:!1})}))),C.length>0&&f.push(...C.map(({binding:e,instance_name:t})=>({name:e,type:Q(`ai_search`),value:t?String(t):void 0,mode:u({isSimulatedLocally:!1})}))),w.length>0&&f.push(...w.map(({binding:e,namespace:t})=>({name:e,type:Q(`agent_memory`),value:t??void 0,mode:u({isSimulatedLocally:!1})}))),T.length>0&&f.push(...T.map(({binding:e,id:t})=>({name:e,type:Q(`hyperdrive`),value:t,mode:u({isSimulatedLocally:!0})}))),j.length>0&&f.push(...j.map(({binding:e,service_id:t,remote:n})=>({name:e,type:Q(`vpc_service`),value:t,mode:u({isSimulatedLocally:n&&!s.remoteBindingsDisabled?!1:void 0})}))),M.length>0&&f.push(...M.map(({binding:e,tunnel_id:t,network_id:n,remote:r})=>({name:e,type:Q(`vpc_network`),value:t??n,mode:u({isSimulatedLocally:r&&!s.remoteBindingsDisabled?!1:void 0})}))),E.length>0&&f.push(...E.map(({binding:e,bucket_name:t,jurisdiction:n,remote:r})=>{let i=typeof t==`symbol`?t:t?`${t}${n?` (${n})`:``}`:void 0;return{name:e,type:Q(`r2_bucket`),value:i,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!r})}})),D.length>0&&f.push(...D.map(({name:e,destination:t})=>({name:e,type:Q(`logfwdr`),value:t,mode:u()}))),O.length>0&&f.push(...O.map(({binding:e,store_id:t,secret_name:n})=>({name:e,type:Q(`secrets_store_secret`),value:`${t}/${n}`,mode:u({isSimulatedLocally:!0})}))),k.length>0&&f.push(...k.map(({binding:e,namespace:t})=>({name:e,type:Q(`artifacts`),value:t,mode:u({isSimulatedLocally:!1})}))),de.length>0&&f.push(...de.map(({binding:e,enable_timer:t})=>({name:e,type:Q(`unsafe_hello_world`),value:t?`Timer enabled`:`Timer disabled`,mode:u({isSimulatedLocally:!0})}))),fe.length>0&&f.push(...fe.map(({binding:e,app_id:t,remote:n})=>({name:e,type:Q(`flagship`),value:t,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!n})}))),A.length>0&&f.push(...A.map(({binding:e,service:t,entrypoint:n,remote:r,dev:i})=>{let a=t,o;if(n&&(a+=`#${n}`),i!==void 0&&s.local)o=u({isSimulatedLocally:!0});else if(r)o=u({isSimulatedLocally:!1});else if(s.local&&s.registry!==null)if(t===s.name)c=!0,o=u({isSimulatedLocally:!0,connected:!0});else{let e=s.registry?.[t];c=!0,o=e&&e.debugPortAddress?u({isSimulatedLocally:!0,connected:!0}):u({isSimulatedLocally:!0,connected:!1})}return{name:e,type:Q(`service`),value:a,mode:o}})),N.length>0&&f.push(...N.map(({binding:e,dataset:t})=>({name:e,type:Q(`analytics_engine`),value:t??e,mode:u({isSimulatedLocally:!0})}))),P.length>0&&f.push(...P.map(({binding:e,source:t})=>({name:e,type:Q(`text_blob`),value:`contents`in t?d(t.contents):`path`in t?d(t.path):void 0,mode:u({isSimulatedLocally:!0})}))),ee.length>0&&f.push(...ee.map(({binding:e,remote:t})=>({name:e,type:Q(`browser`),value:void 0,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!t})}))),te.length>0&&f.push(...te.map(({binding:e,remote:t})=>({name:e,type:Q(`images`),value:void 0,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!t})}))),ne.length>0&&f.push(...ne.map(({binding:e,remote:t})=>({name:e,type:Q(`stream`),value:void 0,mode:u({isSimulatedLocally:(t===!0||t===void 0)&&!s.remoteBindingsDisabled?!1:void 0})}))),pe.length>0&&f.push(...pe.map(({binding:e,remote:t})=>({name:e,type:Q(`media`),value:void 0,mode:u({isSimulatedLocally:(t===!0||t===void 0)&&!s.remoteBindingsDisabled?!1:void 0})}))),re.length>0&&f.push(...re.map(({binding:e,staging:t,remote:n})=>({name:e,type:Q(`ai`),value:t?`staging`:void 0,mode:u({isSimulatedLocally:(n===!0||n===void 0)&&!s.remoteBindingsDisabled?!1:void 0})}))),ce.length>0&&f.push(...ce.map(({binding:e,stream:t,pipeline:n,remote:r})=>({name:e,type:Q(`pipeline`),value:t||n,mode:u({isSimulatedLocally:s.remoteBindingsDisabled||!r})}))),le.length>0&&f.push(...le.map(({name:e,simple:t})=>({name:e,type:Q(`ratelimit`),value:`${t.limit} requests/${t.period}s`,mode:u({isSimulatedLocally:!0})}))),ue.length>0&&f.push(...ue.map(({binding:e})=>({name:e,type:Q(`assets`),value:void 0,mode:u({isSimulatedLocally:!0})}))),ie.length>0&&f.push(...ie.map(({binding:e})=>({name:e,type:Q(`version_metadata`),value:void 0,mode:u({isSimulatedLocally:!0})}))),me.length>0&&f.push(...me.map(e=>{let t=`dev`in e?e.dev:void 0,n=e.type.slice(7);return{name:e.name,type:t?t.plugin.name:Q(e.type),value:n,mode:u({isSimulatedLocally:!!t})}})),ae.length>0&&f.push(...ae.map(e=>{let{binding:t,type:n,value:r}=e,i;return i=n===`plain_text`&&e.hidden!==!0?`"${d(r)}"`:n===`json`?d(JSON.stringify(r)):`"(hidden)"`,{name:t,type:Q(n),value:i,mode:u({isSimulatedLocally:!0})}})),F.length>0&&f.push(...F.map(({binding:e,source:t})=>({name:e,type:Q(`wasm_module`),value:`contents`in t?`<Wasm>`:d(t.path),mode:u({isSimulatedLocally:!0})}))),oe.length>0&&f.push(...oe.map(({binding:e,namespace:t,outbound:n,remote:r})=>({name:e,type:Q(`dispatch_namespace`),value:typeof t==`symbol`?t:n?`${t} (outbound -> ${n.service})`:t,mode:u({isSimulatedLocally:r&&!s.remoteBindingsDisabled?!1:void 0})}))),se.length>0&&f.push(...se.map(({binding:e,certificate_id:t,remote:n})=>({name:e,type:Q(`mtls_certificate`),value:t,mode:u({isSimulatedLocally:n&&!s.remoteBindingsDisabled?!1:void 0})}))),I.length>0&&f.push(...I.map(({binding:e})=>({name:e,type:Q(`worker_loader`),value:void 0,mode:u({isSimulatedLocally:!0})}))),f.length===0)s.warnIfNoBindings&&(s.name&&l?r(`No bindings found for ${Yr.blue(s.name)}`):r(`No bindings found.`));else{let e;e=s.provisioning?`The following bindings need to be provisioned:`:s.name&&l?`${Yr.blue(s.name)} has access to the following bindings:`:`Your Worker has access to the following bindings:`;let t={binding:`Binding`,resource:`Resource`,mode:`Mode`},n=Math.max(...f.map(e=>typeof e.value==`symbol`?9:e.value?.length??0)),i=Math.max(...f.map(e=>e.name.length)),a=Math.max(...f.map(e=>e.type.length),t.resource.length),o=Math.max(...f.map(e=>e.mode?S(e.mode).length:t.mode.length)),c=f.some(e=>e.mode),u=4+i+2+n+1,d=u+6+a+6+o>=process.stdout.columns;r(e);let p=d?` `.repeat(4):` `.repeat(6);r(`${iw($C(t.binding),d?4+i:u)}${p}${iw($C(t.resource),a)}${p}${c?$C(t.mode):``}`);for(let e of f){let t=$C(typeof e.value==`symbol`?Yr.italic(`inherited`):e.value??``),n=iw(`${ew(`env.${e.name}`)}${e.value&&!d?` (${t})`:``}`,d?4+i:u),o=d&&e.value?`
309
309
  ${t}`:``;r(`${n}${p}${tw(e.type.padEnd(a))}${p}${c?e.mode:``}${o}`)}r(``)}let he;he=s.name&&l?`${Yr.blue(s.name)} is sending Tail events to the following Workers:`:`Your Worker is sending Tail events to the following Workers:`;let ge=[...(o??[]).map(e=>({service:e.service,streaming:!1})),...(i??[]).map(e=>({service:e.service,streaming:!0}))];if(ge.length>0&&r(`${he}
310
310
  ${ge.map(({service:e,streaming:t})=>{let n=`${e}${t?` (streaming)`:``}`;if(s.local&&s.registry!==null){let t=s.registry?.[e];return c=!0,t?`- ${n} ${Yr.green(`[connected]`)}`:`- ${n} ${Yr.red(`[not connected]`)}`}else return`- ${n}`}).join(`
311
311
  `)}`),n.length>0&&!s.provisioning){let e=`The following containers are available:`;s.name&&l&&(e=`The following containers are available from ${Yr.blue(s.name)}:`),r(`${e}
312
312
  ${n.map(e=>e.scheduling_policy===`durable_object`?`- ${e.class_name??e.name} (durable_object)`:`- ${e.name} (${e.image})`).join(`
313
313
  `)}`),r(``)}s.unsafeMetadata&&(r(`The following unsafe metadata will be attached to your Worker:`),r(JSON.stringify(s.unsafeMetadata,null,2))),c&&!nw&&(r($C(`
314
314
  Service bindings, Durable Object bindings, and Tail consumers connect to other Wrangler or Vite dev processes running locally, with their connection status indicated by ${Yr.green(`[connected]`)} or ${Yr.red(`[not connected]`)}. For more details, refer to https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/#local-development
315
- `)),nw=!0)}a(rw,`printBindings`);function iw(e,t){return e+` `.repeat(Math.max(0,t-b(e).length))}a(iw,`padEndAnsi`);function aw({isProvisioning:e=!1,isLocalDev:t=!1}){return a(function({isSimulatedLocally:n,connected:r}={}){if(!(e||!t))return n===void 0?$C(`not supported`):`${n?Yr.blue(`local`):Yr.yellow(`remote`)}${r===void 0?``:r?Yr.green(` [connected]`):Yr.red(` [not connected]`)}`},`bindingMode`)}a(aw,`createGetMode`);var ow=n(eo());function sw(){try{return!!(process.stdin.isTTY&&process.stdout.isTTY)}catch{return!1}}a(sw,`isTtyInteractive`);function cw(){return ow.default.CLOUDFLARE_PAGES||ow.default.CLOUDFLARE_WORKERS?!1:sw()}a(cw,`isInteractive`);function lw(){return!cw()||ow.default.isCI}a(lw,`isNonInteractiveOrCI`);function uw(){return ow.default.isCI}a(uw,`isCI`);var dw=new Intl.ListFormat(`en-US`,{style:`long`,type:`conjunction`});function fw(e,t){let n=!1,r=t?.namespace??`wrangler`;function i(){if(r===`wrangler`){let e=mr();if(e)return e}let e=Qt(`node_modules`),t=e?x.join(e,`.cache`,r):null,n=x.join(process.cwd(),`.${r}`,`cache`);return t&&f(t)?t:f(n)?n:t||n}a(i,`getCacheFolder`);function o(t,r){!n&&!lw()&&t.length>0&&(e.debug(`Retrieving cached values for ${dw.format(t)} from ${x.relative(process.cwd(),r)}`),n=!0)}a(o,`showCacheMessage`);function s(e){try{let t=i(),n=x.join(t,e),r=JSON.parse(m(n,`utf-8`));return o(Object.keys(r),t),r}catch{return{}}}a(s,`getConfigCache`);function c(t,n){let r=i();if(r){e.debug(`Saving to cache: ${JSON.stringify(n)}`);let i=x.join(r,t),a=s(t);p(x.dirname(i),{recursive:!0}),v(i,JSON.stringify({...a,...n},null,2))}}a(c,`saveToConfigCache`);function l(){let e=i();e&&Dn(e)}return a(l,`purgeConfigCaches`),{getCacheFolder:i,getConfigCache:s,saveToConfigCache:c,purgeConfigCaches:l}}a(fw,`createConfigCache`);var pw=[];pw.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&pw.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&pw.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);var mw=a(e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,`processOk`),hw=Symbol.for(`signal-exit emitter`),gw=globalThis,_w=Object.defineProperty.bind(Object),vw=class{static{a(this,`Emitter`)}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(gw[hw])return gw[hw];_w(gw,hw,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},yw=class{static{a(this,`SignalExitBase`)}},bw=a(e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),`signalExitWrap`),xw=class extends yw{static{a(this,`SignalExitFallback`)}onExit(){return()=>{}}load(){}unload(){}},Sw=class extends yw{static{a(this,`SignalExit`)}#e=Cw.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new vw;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of pw)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!mw(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of pw)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,pw.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return mw(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&mw(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}else return n.call(this.#n,e,...t)}},Cw=globalThis.process,{onExit:ww,load:Tw,unload:Ew}=bw(mw(Cw)?new Sw(Cw):new xw);function Dw(e){return e??=process.cwd(),S.join(e,`.wrangler`)}a(Dw,`getWranglerHiddenDirPath`);var Ow=1440*60*1e3,kw=new Set;function Aw(e){if(kw.has(e))return;kw.add(e);let t;try{t=s.readdirSync(e,{withFileTypes:!0})}catch{return}let n=Date.now()-Ow;for(let r of t){if(!r.isDirectory())continue;let t=S.join(e,r.name);try{s.statSync(t).mtimeMs<n&&Dn(t)}catch{}}}a(Aw,`sweepStaleWranglerTmpDirs`);function jw(e,t,n=!0){let r=S.join(Dw(e),`tmp`);s.mkdirSync(r,{recursive:!0}),Aw(r);let i=S.join(r,`${t}-`),o=s.realpathSync(s.mkdtempSync(i)),c=a(()=>{if(n)try{Dn(o)}catch{}},`cleanupDir`),l=ww(c);return{path:o,remove(){l(),c()}}}a(jw,`getWranglerTmpDir`);function Mw(e,...t){return new kt({text:e,notes:t.map(e=>({text:e})),telemetryMessage:!1})}a(Mw,`buildDetailedError`);function Nw(e){if(e.message===`workers.api.error.email_verification_required`)throw Mw(`Please verify your account's email address and try again.`,`Check your email for a verification link, or login to https://dash.cloudflare.com and request a new one.`)}a(Nw,`maybeThrowFriendlyError`);function Pw(e,t){let n=rT(e);n.delete(`Authorization`),t.debugWithSanitization?.(`HEADERS:`,JSON.stringify(Object.fromEntries(n),null,2))}a(Pw,`logHeaders`);async function Fw(e,t,n={},r,i,a,o,s){y(s,`credentials are required for performApiFetch`);let c=n.method??`GET`;y(t.startsWith(`/`),`CF API fetch - resource path must start with a "/" but got "${t}"`);let l=rT(new Qa.Headers(n.headers));qw(l,s),l.set(`User-Agent`,r),nT(l);let u=a?`?${a.toString()}`:``;return i.debug(`-- START CF API REQUEST: ${c} ${tr(e)}${t}`),i.debugWithSanitization?.(`QUERY STRING:`,u),Pw(l,i),i.debugWithSanitization?.(`INIT:`,JSON.stringify({...n},null,2)),n.body instanceof Qa.FormData&&i.debugWithSanitization?.(`BODY:`,await new Qa.Response(n.body).text(),null,2),i.debug(`-- END CF API REQUEST`),await(0,Qa.fetch)(`${tr(e)}${t}${u}`,{method:c,...n,headers:l,signal:o})}a(Fw,`performApiFetchBase`);async function Iw(e,t,n={},r,i,a,o,s){let c=n.method??`GET`,l=await Fw(e,t,n,r,i,a,o,s),u=await l.text();i.debug(`-- START CF API RESPONSE:`,l.statusText,l.status),Pw(l.headers,i),i.debugWithSanitization?.(`RESPONSE:`,u),i.debug(`-- END CF API RESPONSE`);let d=Hw(l.headers);if(!u&&(l.status===204||l.status===205))return{response:{result:{},success:!0,errors:[],messages:[]},status:l.status,retryAfterMs:d};Bw(l.headers)&&$w(l.headers,c,t,l.status,l.statusText,d);try{return{response:Nt(u),status:l.status,retryAfterMs:d}}catch{let e=Uw(l.headers);throw new At({text:`Received a malformed response from the API`,notes:[{text:zw(u,100)},{text:`${c} ${t} -> ${l.status} ${l.statusText}`},...e?[{text:`Cloudflare Ray ID: ${e}`}]:[]],status:l.status,retryAfterMs:d,telemetryMessage:!1})}}a(Iw,`fetchInternalBase`);async function Lw(e,t,n={},r,i,a,o,s){let{response:c,status:l,retryAfterMs:u}=await Iw(e,t,n,r,i,a,o,s);if(c.success)return c.result;Qw(t,c,l,u)}a(Lw,`fetchResultBase`);async function Rw(e,t,n={},r,i,a,o){let s=[],c=!0,l;for(;c;){l&&(a=new M(a),a.set(`cursor`,l));let{response:u,status:d,retryAfterMs:f}=await Iw(e,t,n,r,i,a,void 0,o);u.success?(s.push(...u.result),tT(u.result_info)?l=u.result_info?.cursor:c=!1):Qw(t,u,d,f)}return s}a(Rw,`fetchListResultBase`);function zw(e,t){let{length:n}=e;return n<=t?e:`${e.substring(0,t)}... (length = ${n})`}a(zw,`truncate`);function Bw(e){return e.get(`cf-mitigated`)===`challenge`}a(Bw,`isWAFBlockResponse`);function Vw(e){if(!e)return;if(/^\d+$/.test(e.trim()))return Number(e)*1e3;let t=new Date(e);if(!Number.isNaN(t.getTime()))return Math.max(0,t.getTime()-Date.now())}a(Vw,`parseRetryAfterValue`);function Hw(e){return Vw(e.get(`Retry-After`))}a(Hw,`parseRetryAfterMs`);function Uw(e){return e.get(`cf-ray`)??void 0}a(Uw,`extractWAFBlockRayId`);function Ww(e){return RegExp(`/accounts/([a-zA-Z0-9]+)/?`).exec(e)?.[1]}a(Ww,`extractAccountTag`);function Gw(e){let t=e?.page,n=e?.per_page,r=e?.total_count;return t!==void 0&&n!==void 0&&r!==void 0&&t*n<r}a(Gw,`hasMorePages`);function Kw(e,t=0){let n=` `.repeat(t),r=e.message??``,i=`error_chain`in e?e.error_chain?.map(e=>`
315
+ `)),nw=!0)}a(rw,`printBindings`);function iw(e,t){return e+` `.repeat(Math.max(0,t-S(e).length))}a(iw,`padEndAnsi`);function aw({isProvisioning:e=!1,isLocalDev:t=!1}){return a(function({isSimulatedLocally:n,connected:r}={}){if(!(e||!t))return n===void 0?$C(`not supported`):`${n?Yr.blue(`local`):Yr.yellow(`remote`)}${r===void 0?``:r?Yr.green(` [connected]`):Yr.red(` [not connected]`)}`},`bindingMode`)}a(aw,`createGetMode`);var ow=n(eo());function sw(){try{return!!(process.stdin.isTTY&&process.stdout.isTTY)}catch{return!1}}a(sw,`isTtyInteractive`);function cw(){return ow.default.CLOUDFLARE_PAGES||ow.default.CLOUDFLARE_WORKERS?!1:sw()}a(cw,`isInteractive`);function lw(){return!cw()||ow.default.isCI}a(lw,`isNonInteractiveOrCI`);function uw(){return ow.default.isCI}a(uw,`isCI`);var dw=new Intl.ListFormat(`en-US`,{style:`long`,type:`conjunction`});function fw(e,t){let n=!1,r=t?.namespace??`wrangler`;function i(){if(r===`wrangler`){let e=mr();if(e)return e}let e=Qt(`node_modules`),t=e?C.join(e,`.cache`,r):null,n=C.join(process.cwd(),`.${r}`,`cache`);return t&&m(t)?t:m(n)?n:t||n}a(i,`getCacheFolder`);function o(t,r){!n&&!lw()&&t.length>0&&(e.debug(`Retrieving cached values for ${dw.format(t)} from ${C.relative(process.cwd(),r)}`),n=!0)}a(o,`showCacheMessage`);function s(e){try{let t=i(),n=C.join(t,e),r=JSON.parse(g(n,`utf-8`));return o(Object.keys(r),t),r}catch{return{}}}a(s,`getConfigCache`);function c(t,n){let r=i();if(r){e.debug(`Saving to cache: ${JSON.stringify(n)}`);let i=C.join(r,t),a=s(t);h(C.dirname(i),{recursive:!0}),b(i,JSON.stringify({...a,...n},null,2))}}a(c,`saveToConfigCache`);function l(){let e=i();e&&Dn(e)}return a(l,`purgeConfigCaches`),{getCacheFolder:i,getConfigCache:s,saveToConfigCache:c,purgeConfigCaches:l}}a(fw,`createConfigCache`);var pw=[];pw.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&pw.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&pw.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);var mw=a(e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,`processOk`),hw=Symbol.for(`signal-exit emitter`),gw=globalThis,_w=Object.defineProperty.bind(Object),vw=class{static{a(this,`Emitter`)}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(gw[hw])return gw[hw];_w(gw,hw,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},yw=class{static{a(this,`SignalExitBase`)}},bw=a(e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),`signalExitWrap`),xw=class extends yw{static{a(this,`SignalExitFallback`)}onExit(){return()=>{}}load(){}unload(){}},Sw=class extends yw{static{a(this,`SignalExit`)}#e=Cw.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new vw;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of pw)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!mw(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of pw)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,pw.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return mw(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&mw(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}else return n.call(this.#n,e,...t)}},Cw=globalThis.process,{onExit:ww,load:Tw,unload:Ew}=bw(mw(Cw)?new Sw(Cw):new xw);function Dw(e){return e??=process.cwd(),w.join(e,`.wrangler`)}a(Dw,`getWranglerHiddenDirPath`);var Ow=1440*60*1e3,kw=new Set;function Aw(e){if(kw.has(e))return;kw.add(e);let t;try{t=l.readdirSync(e,{withFileTypes:!0})}catch{return}let n=Date.now()-Ow;for(let r of t){if(!r.isDirectory())continue;let t=w.join(e,r.name);try{l.statSync(t).mtimeMs<n&&Dn(t)}catch{}}}a(Aw,`sweepStaleWranglerTmpDirs`);function jw(e,t,n=!0){let r=w.join(Dw(e),`tmp`);l.mkdirSync(r,{recursive:!0}),Aw(r);let i=w.join(r,`${t}-`),o=l.realpathSync(l.mkdtempSync(i)),s=a(()=>{if(n)try{Dn(o)}catch{}},`cleanupDir`),c=ww(s);return{path:o,remove(){c(),s()}}}a(jw,`getWranglerTmpDir`);function Mw(e,...t){return new kt({text:e,notes:t.map(e=>({text:e})),telemetryMessage:!1})}a(Mw,`buildDetailedError`);function Nw(e){if(e.message===`workers.api.error.email_verification_required`)throw Mw(`Please verify your account's email address and try again.`,`Check your email for a verification link, or login to https://dash.cloudflare.com and request a new one.`)}a(Nw,`maybeThrowFriendlyError`);function Pw(e,t){let n=rT(e);n.delete(`Authorization`),t.debugWithSanitization?.(`HEADERS:`,JSON.stringify(Object.fromEntries(n),null,2))}a(Pw,`logHeaders`);async function Fw(e,t,n={},r,i,a,o,s){x(s,`credentials are required for performApiFetch`);let c=n.method??`GET`;x(t.startsWith(`/`),`CF API fetch - resource path must start with a "/" but got "${t}"`);let l=rT(new Qa.Headers(n.headers));qw(l,s),l.set(`User-Agent`,r),nT(l);let u=a?`?${a.toString()}`:``;return i.debug(`-- START CF API REQUEST: ${c} ${tr(e)}${t}`),i.debugWithSanitization?.(`QUERY STRING:`,u),Pw(l,i),i.debugWithSanitization?.(`INIT:`,JSON.stringify({...n},null,2)),n.body instanceof Qa.FormData&&i.debugWithSanitization?.(`BODY:`,await new Qa.Response(n.body).text(),null,2),i.debug(`-- END CF API REQUEST`),await(0,Qa.fetch)(`${tr(e)}${t}${u}`,{method:c,...n,headers:l,signal:o})}a(Fw,`performApiFetchBase`);async function Iw(e,t,n={},r,i,a,o,s){let c=n.method??`GET`,l=await Fw(e,t,n,r,i,a,o,s),u=await l.text();i.debug(`-- START CF API RESPONSE:`,l.statusText,l.status),Pw(l.headers,i),i.debugWithSanitization?.(`RESPONSE:`,u),i.debug(`-- END CF API RESPONSE`);let d=Hw(l.headers);if(!u&&(l.status===204||l.status===205))return{response:{result:{},success:!0,errors:[],messages:[]},status:l.status,retryAfterMs:d};Bw(l.headers)&&$w(l.headers,c,t,l.status,l.statusText,d);try{return{response:Nt(u),status:l.status,retryAfterMs:d}}catch{let e=Uw(l.headers);throw new At({text:`Received a malformed response from the API`,notes:[{text:zw(u,100)},{text:`${c} ${t} -> ${l.status} ${l.statusText}`},...e?[{text:`Cloudflare Ray ID: ${e}`}]:[]],status:l.status,retryAfterMs:d,telemetryMessage:!1})}}a(Iw,`fetchInternalBase`);async function Lw(e,t,n={},r,i,a,o,s){let{response:c,status:l,retryAfterMs:u}=await Iw(e,t,n,r,i,a,o,s);if(c.success)return c.result;Qw(t,c,l,u)}a(Lw,`fetchResultBase`);async function Rw(e,t,n={},r,i,a,o){let s=[],c=!0,l;for(;c;){l&&(a=new P(a),a.set(`cursor`,l));let{response:u,status:d,retryAfterMs:f}=await Iw(e,t,n,r,i,a,void 0,o);u.success?(s.push(...u.result),tT(u.result_info)?l=u.result_info?.cursor:c=!1):Qw(t,u,d,f)}return s}a(Rw,`fetchListResultBase`);function zw(e,t){let{length:n}=e;return n<=t?e:`${e.substring(0,t)}... (length = ${n})`}a(zw,`truncate`);function Bw(e){return e.get(`cf-mitigated`)===`challenge`}a(Bw,`isWAFBlockResponse`);function Vw(e){if(!e)return;if(/^\d+$/.test(e.trim()))return Number(e)*1e3;let t=new Date(e);if(!Number.isNaN(t.getTime()))return Math.max(0,t.getTime()-Date.now())}a(Vw,`parseRetryAfterValue`);function Hw(e){return Vw(e.get(`Retry-After`))}a(Hw,`parseRetryAfterMs`);function Uw(e){return e.get(`cf-ray`)??void 0}a(Uw,`extractWAFBlockRayId`);function Ww(e){return RegExp(`/accounts/([a-zA-Z0-9]+)/?`).exec(e)?.[1]}a(Ww,`extractAccountTag`);function Gw(e){let t=e?.page,n=e?.per_page,r=e?.total_count;return t!==void 0&&n!==void 0&&r!==void 0&&t*n<r}a(Gw,`hasMorePages`);function Kw(e,t=0){let n=` `.repeat(t),r=e.message??``,i=`error_chain`in e?e.error_chain?.map(e=>`
316
316
 
317
317
  ${n}- ${Kw(e,t+1)}`).join(`
318
318
  `)??``:``;return(e.code?`${r} [code: ${e.code}]`:r)+(e.documentation_url?`
319
- ${n}To learn more about this error, visit: ${e.documentation_url}`:``)+i}a(Kw,`renderError`);function qw(e,t,n=!1){if(!e.has(`Authorization`)||n)if(`apiToken`in t){let n=`Bearer ${t.apiToken}`;Jw(n),e.set(`Authorization`,n)}else e.set(`X-Auth-Key`,t.authKey),e.set(`X-Auth-Email`,t.authEmail)}a(qw,`addAuthorizationHeader`);function Jw(e){for(let t of e){let e=t.codePointAt(0);if(e===void 0||e>255)throw new F(`The configured Cloudflare API token contains a character that cannot be used in an HTTP Authorization header: ${Yw(t,e)}. Recreate or copy the token again, making sure it does not include characters such as ellipses.`,{telemetryMessage:`cfetch auth invalid authorization header`})}}a(Jw,`validateAuthorizationHeaderValue`);function Yw(e,t){if(t===void 0)return`"\\u{unknown}"`;let n=`U+${t.toString(16).toUpperCase().padStart(4,`0`)}`;return`${Xw(e)?`"${e}"`:`"${Zw(e)}"`} (${n})`}a(Yw,`formatAuthorizationHeaderCharacter`);function Xw(e){return!/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(e)}a(Xw,`isPrintableCharacter`);function Zw(e){return Array.from(e).map(e=>{let t=e.codePointAt(0);return t===void 0?``:t<=65535?`\\u${t.toString(16).toUpperCase().padStart(4,`0`)}`:`\\u{${t.toString(16).toUpperCase()}}`}).join(``)}a(Zw,`escapeCharacter`);function Qw(e,t,n,r){let i=t.errors??[];for(let e of i)Nw(e);let a=[...i.map(e=>({text:Kw(e)})),...t.messages?.map(e=>({text:typeof e==`string`?e:e.message??String(e)}))??[]];if(a.length===0){let e=t,n=typeof e.error==`string`?`${e.error}${e.code?` [code: ${e.code}]`:``}`:void 0;n&&a.push({text:n})}r!==void 0&&a.push({text:`The API responded with a "Retry-After" header indicating you should wait ${Math.ceil(r/1e3)} second(s) before retrying.`});let o=new At({text:`A request to the Cloudflare API (${e}) failed.`,notes:a,status:n,retryAfterMs:r,telemetryMessage:!1}),s=i[0]?.code;s&&(o.code=s);let c=i[0]?.meta;throw c&&(o.meta=c),o.accountTag=Ww(e),o}a(Qw,`throwFetchError`);function $w(e,t,n,r,i,a){let o=Uw(e);throw new At({text:`The Cloudflare API responded with a WAF block page instead of the expected JSON response`,notes:[{text:`Cloudflare's firewall (WAF) blocked this API request. This is usually a false positive.`},...o?[{text:`Cloudflare Ray ID: ${o}`}]:[],{text:o?`If the issue persists, please open a Cloudflare Support ticket and include the Ray ID above.`:`If the issue persists, please open a Cloudflare Support ticket. You can find the Cloudflare Ray ID on the block page in your browser.`},{text:`${t} ${n} -> ${r} ${i}`}],status:r,retryAfterMs:a,telemetryMessage:!1})}a($w,`throwWAFBlockError`);async function eT(e,t,n,r,i,a,o){let s=new Qa.Headers;qw(s,o),s.set(`User-Agent`,i),nT(s);let c=`${tr(e)}/accounts/${t}/storage/kv/namespaces/${n}/values/${r}`;a.debug(`-- START CF API REQUEST: GET ${c}`),a.debug(`-- END CF API REQUEST`);let l=await(0,Qa.fetch)(c,{method:`GET`,headers:s});if(l.ok)return await l.arrayBuffer();throw Error(`Failed to fetch ${c} - ${l.status}: ${l.statusText}`)}a(eT,`fetchKVGetValueBase`);function tT(e){let t=e?.cursor;return t!=null&&t!==``}a(tT,`hasCursor`);function nT(e){let t=fr();t&&e.set(`Cf-Trace-Id`,t)}a(nT,`maybeAddTraceHeader`);function rT(e){return new Qa.Headers(e)}a(rT,`cloneHeaders`);var iT=n(no()),aT=`https://update.argotunnel.com`,oT=/^\d{4}\.\d+\.\d+$/;function sT(e){return N(`sha256`).update(e).digest(`hex`)}a(sT,`sha256Hex`);function cT(){let e=k();switch(e){case`x64`:return`amd64`;case`arm64`:return`arm64`;case`arm`:return`arm`;default:throw new F(`Unsupported architecture for cloudflared: ${e}
319
+ ${n}To learn more about this error, visit: ${e.documentation_url}`:``)+i}a(Kw,`renderError`);function qw(e,t,n=!1){if(!e.has(`Authorization`)||n)if(`apiToken`in t){let n=`Bearer ${t.apiToken}`;Jw(n),e.set(`Authorization`,n)}else e.set(`X-Auth-Key`,t.authKey),e.set(`X-Auth-Email`,t.authEmail)}a(qw,`addAuthorizationHeader`);function Jw(e){for(let t of e){let e=t.codePointAt(0);if(e===void 0||e>255)throw new F(`The configured Cloudflare API token contains a character that cannot be used in an HTTP Authorization header: ${Yw(t,e)}. Recreate or copy the token again, making sure it does not include characters such as ellipses.`,{telemetryMessage:`cfetch auth invalid authorization header`})}}a(Jw,`validateAuthorizationHeaderValue`);function Yw(e,t){if(t===void 0)return`"\\u{unknown}"`;let n=`U+${t.toString(16).toUpperCase().padStart(4,`0`)}`;return`${Xw(e)?`"${e}"`:`"${Zw(e)}"`} (${n})`}a(Yw,`formatAuthorizationHeaderCharacter`);function Xw(e){return!/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(e)}a(Xw,`isPrintableCharacter`);function Zw(e){return Array.from(e).map(e=>{let t=e.codePointAt(0);return t===void 0?``:t<=65535?`\\u${t.toString(16).toUpperCase().padStart(4,`0`)}`:`\\u{${t.toString(16).toUpperCase()}}`}).join(``)}a(Zw,`escapeCharacter`);function Qw(e,t,n,r){let i=t.errors??[];for(let e of i)Nw(e);let a=[...i.map(e=>({text:Kw(e)})),...t.messages?.map(e=>({text:typeof e==`string`?e:e.message??String(e)}))??[]];if(a.length===0){let e=t,n=typeof e.error==`string`?`${e.error}${e.code?` [code: ${e.code}]`:``}`:void 0;n&&a.push({text:n})}r!==void 0&&a.push({text:`The API responded with a "Retry-After" header indicating you should wait ${Math.ceil(r/1e3)} second(s) before retrying.`});let o=new At({text:`A request to the Cloudflare API (${e}) failed.`,notes:a,status:n,retryAfterMs:r,telemetryMessage:!1}),s=i[0]?.code;s&&(o.code=s);let c=i[0]?.meta;throw c&&(o.meta=c),o.accountTag=Ww(e),o}a(Qw,`throwFetchError`);function $w(e,t,n,r,i,a){let o=Uw(e);throw new At({text:`The Cloudflare API responded with a WAF block page instead of the expected JSON response`,notes:[{text:`Cloudflare's firewall (WAF) blocked this API request. This is usually a false positive.`},...o?[{text:`Cloudflare Ray ID: ${o}`}]:[],{text:o?`If the issue persists, please open a Cloudflare Support ticket and include the Ray ID above.`:`If the issue persists, please open a Cloudflare Support ticket. You can find the Cloudflare Ray ID on the block page in your browser.`},{text:`${t} ${n} -> ${r} ${i}`}],status:r,retryAfterMs:a,telemetryMessage:!1})}a($w,`throwWAFBlockError`);async function eT(e,t,n,r,i,a,o){let s=new Qa.Headers;qw(s,o),s.set(`User-Agent`,i),nT(s);let c=`${tr(e)}/accounts/${t}/storage/kv/namespaces/${n}/values/${r}`;a.debug(`-- START CF API REQUEST: GET ${c}`),a.debug(`-- END CF API REQUEST`);let l=await(0,Qa.fetch)(c,{method:`GET`,headers:s});if(l.ok)return await l.arrayBuffer();throw Error(`Failed to fetch ${c} - ${l.status}: ${l.statusText}`)}a(eT,`fetchKVGetValueBase`);function tT(e){let t=e?.cursor;return t!=null&&t!==``}a(tT,`hasCursor`);function nT(e){let t=fr();t&&e.set(`Cf-Trace-Id`,t)}a(nT,`maybeAddTraceHeader`);function rT(e){return new Qa.Headers(e)}a(rT,`cloneHeaders`);var iT=n(no()),aT=`https://update.argotunnel.com`,oT=/^\d{4}\.\d+\.\d+$/;function sT(e){return ee(`sha256`).update(e).digest(`hex`)}a(sT,`sha256Hex`);function cT(){let e=j();switch(e){case`x64`:return`amd64`;case`arm64`:return`arm64`;case`arm`:return`arm`;default:throw new F(`Unsupported architecture for cloudflared: ${e}
320
320
 
321
321
  cloudflared supports: x64 (amd64), arm64, arm
322
322
 
@@ -332,7 +332,7 @@ The update service did not return results for ${n}/${r},
332
332
  and the fallback query also failed.
333
333
 
334
334
  You can manually install cloudflared from:
335
- https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/`,{telemetryMessage:`tunnel cloudflared version lookup failed`});let o=a.version,s=dT(n,r);return{url:`${uT}/${o}/${s}`,version:o,checksum:``,compressed:s.endsWith(`.tgz`),shouldUpdate:!0,userMessage:``,error:``}}a(pT,`getLatestVersionInfo`);function mT(e){return E(Un(),`cloudflared`,e)}a(mT,`getCacheDir`);function hT(e){let t=process.platform===`win32`?`cloudflared.exe`:`cloudflared`;return E(mT(e),t)}a(hT,`getCloudflaredBinPath`);function gT(e){try{return c(e,d.X_OK),!0}catch{return!1}}a(gT,`isBinaryExecutable`);function _T(e,t){let{logger:n}=t??{};try{let t=ee(e,[`--version`],{stdio:[`pipe`,`pipe`,`pipe`],timeout:1e4,encoding:`utf8`}).trim();n?.debug(`cloudflared version: ${t}`)}catch{let t=`[cloudflared] Failed to validate cloudflared binary at ${e}
335
+ https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/`,{telemetryMessage:`tunnel cloudflared version lookup failed`});let o=a.version,s=dT(n,r);return{url:`${uT}/${o}/${s}`,version:o,checksum:``,compressed:s.endsWith(`.tgz`),shouldUpdate:!0,userMessage:``,error:``}}a(pT,`getLatestVersionInfo`);function mT(e){return O(Un(),`cloudflared`,e)}a(mT,`getCacheDir`);function hT(e){let t=process.platform===`win32`?`cloudflared.exe`:`cloudflared`;return O(mT(e),t)}a(hT,`getCloudflaredBinPath`);function gT(e){try{return u(e,p.X_OK),!0}catch{return!1}}a(gT,`isBinaryExecutable`);function _T(e,t){let{logger:n}=t??{};try{let t=ne(e,[`--version`],{stdio:[`pipe`,`pipe`,`pipe`],timeout:1e4,encoding:`utf8`}).trim();n?.debug(`cloudflared version: ${t}`)}catch{let t=`[cloudflared] Failed to validate cloudflared binary at ${e}
336
336
 
337
337
  `;t+=`This usually means:
338
338
  `,t+=` - The binary is corrupted or incomplete
@@ -341,13 +341,13 @@ https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-
341
341
  On Linux, make sure you have the required dependencies:
342
342
  `,t+=` - glibc (GNU C Library)
343
343
  `,t+=` - For Debian/Ubuntu: sudo apt-get install libc6
344
- `);let n=E(Un(),`cloudflared`);throw t+=`
344
+ `);let n=O(Un(),`cloudflared`);throw t+=`
345
345
  You can try:
346
346
  `,t+=` 1. Deleting the cache directory: rm -rf ${n}
347
347
  `,t+=` 2. Running the command again to re-download
348
348
  `,t+=` 3. Manually installing cloudflared: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/
349
- `,t+=` 4. Setting CLOUDFLARED_PATH to point to your cloudflared binary`,new F(t,{telemetryMessage:`tunnel cloudflared validation failed`})}}a(_T,`validateBinary`);function vT(e){let t=[...e];for(let e=0;e<t.length;e++){let n=t[e];n===`--token`&&e+1<t.length&&(t[e+1]=`[REDACTED]`),n.startsWith(`--token=`)&&(t[e]=`--token=[REDACTED]`)}return t}a(vT,`redactCloudflaredArgsForLogging`);function yT(e){let{logger:t}=e??{};if(!(0,iT.sync)(`cloudflared`))return null;try{return _T(`cloudflared`,{logger:t}),`cloudflared`}catch(e){return t?.debug(`cloudflared found in PATH but failed validation`,e),null}}a(yT,`tryGetCloudflaredFromPath`);function bT(e){try{let t=ee(e,[`--version`],{stdio:[`pipe`,`pipe`,`pipe`],timeout:1e4,encoding:`utf8`}).match(/(\d+\.\d+\.\d+)/);return t?t[1]:null}catch{return null}}a(bT,`getInstalledVersion`);function xT(e,t){let n=a(e=>e.split(`.`).map(Number),`parse`),[r,i,o]=n(e),[s,c,l]=n(t);return r===s?i===c?o<l:i<c:r<s}a(xT,`isVersionOutdated`);async function ST(e,t){let{logger:n}=t??{};try{let t=bT(e);if(!t)return;let r=(await fT(lT(),cT(),{logger:n})??await fT(`linux`,`amd64`,{logger:n}))?.version;if(!r)return;xT(t,r)&&n?.warn(`Your cloudflared (${t}) is outdated. Latest version is ${r}.
350
- Update: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/`)}catch(e){n?.debug(`Failed to check cloudflared version`,e)}}a(ST,`warnIfOutdated`);function CT(e,t){let n=E(w(e),`.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`);try{v(n,t),h(n,e)}finally{try{f(n)&&_(n)}catch{}}}a(CT,`writeFileAtomic`);async function wT(e,t,n){let{logger:r}=n??{},{url:i,version:a,checksum:o,compressed:s}=e;r?.log(`Downloading cloudflared ${a}...`),r?.debug(`Download URL: ${i}`);let c=w(t);p(c,{recursive:!0});let l;try{l=await(0,Qa.fetch)(i,{headers:{"User-Agent":`wrangler`}})}catch(e){throw new F(`[cloudflared] Failed to download cloudflared from ${i}
349
+ `,t+=` 4. Setting CLOUDFLARED_PATH to point to your cloudflared binary`,new F(t,{telemetryMessage:`tunnel cloudflared validation failed`})}}a(_T,`validateBinary`);function vT(e){let t=[...e];for(let e=0;e<t.length;e++){let n=t[e];n===`--token`&&e+1<t.length&&(t[e+1]=`[REDACTED]`),n.startsWith(`--token=`)&&(t[e]=`--token=[REDACTED]`)}return t}a(vT,`redactCloudflaredArgsForLogging`);function yT(e){let{logger:t}=e??{};if(!(0,iT.sync)(`cloudflared`))return null;try{return _T(`cloudflared`,{logger:t}),`cloudflared`}catch(e){return t?.debug(`cloudflared found in PATH but failed validation`,e),null}}a(yT,`tryGetCloudflaredFromPath`);function bT(e){try{let t=ne(e,[`--version`],{stdio:[`pipe`,`pipe`,`pipe`],timeout:1e4,encoding:`utf8`}).match(/(\d+\.\d+\.\d+)/);return t?t[1]:null}catch{return null}}a(bT,`getInstalledVersion`);function xT(e,t){let n=a(e=>e.split(`.`).map(Number),`parse`),[r,i,o]=n(e),[s,c,l]=n(t);return r===s?i===c?o<l:i<c:r<s}a(xT,`isVersionOutdated`);async function ST(e,t){let{logger:n}=t??{};try{let t=bT(e);if(!t)return;let r=(await fT(lT(),cT(),{logger:n})??await fT(`linux`,`amd64`,{logger:n}))?.version;if(!r)return;xT(t,r)&&n?.warn(`Your cloudflared (${t}) is outdated. Latest version is ${r}.
350
+ Update: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/`)}catch(e){n?.debug(`Failed to check cloudflared version`,e)}}a(ST,`warnIfOutdated`);function CT(e,t){let n=O(E(e),`.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`);try{b(n,t),_(n,e)}finally{try{m(n)&&y(n)}catch{}}}a(CT,`writeFileAtomic`);async function wT(e,t,n){let{logger:r}=n??{},{url:i,version:a,checksum:o,compressed:s}=e;r?.log(`Downloading cloudflared ${a}...`),r?.debug(`Download URL: ${i}`);let c=E(t);h(c,{recursive:!0});let l;try{l=await(0,Qa.fetch)(i,{headers:{"User-Agent":`wrangler`}})}catch(e){throw new F(`[cloudflared] Failed to download cloudflared from ${i}
351
351
 
352
352
  Network error: ${e instanceof Error?e.message:String(e)}
353
353
 
@@ -357,31 +357,31 @@ If you're behind a proxy, make sure it's configured correctly.`,{telemetryMessag
357
357
  HTTP ${l.status}: ${l.statusText}
358
358
 
359
359
  You can manually download cloudflared from:
360
- https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/`,{telemetryMessage:`tunnel cloudflared download response failed`});try{s?await TT(l,o,t,c):await ET(l,o,t)}catch(e){try{f(t)&&_(t)}catch{}throw e instanceof F?e:new F(`[cloudflared] Failed to save cloudflared binary
360
+ https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/`,{telemetryMessage:`tunnel cloudflared download response failed`});try{s?await TT(l,o,t,c):await ET(l,o,t)}catch(e){try{m(t)&&y(t)}catch{}throw e instanceof F?e:new F(`[cloudflared] Failed to save cloudflared binary
361
361
 
362
362
  Error: ${e instanceof Error?e.message:String(e)}
363
363
 
364
- Please ensure you have write permissions to: ${c}`,{telemetryMessage:`tunnel cloudflared save failed`})}process.platform!==`win32`&&u(t,493),r?.log(`cloudflared ${a} installed`),r?.debug(`Binary location: ${t}`)}a(wT,`downloadCloudflared`);async function TT(e,t,n,r){let i=E(r,`cloudflared.tgz`);v(i,Buffer.from(await e.arrayBuffer()));try{ee(`tar`,[`-xzf`,i,`-C`,r],{stdio:`ignore`});let e=E(r,`cloudflared`);if(e!==n&&f(e)&&h(e,n),t){let e=sT(m(n));if(e!==t)throw new F(`[cloudflared] SHA256 mismatch for downloaded cloudflared binary.
364
+ Please ensure you have write permissions to: ${c}`,{telemetryMessage:`tunnel cloudflared save failed`})}process.platform!==`win32`&&f(t,493),r?.log(`cloudflared ${a} installed`),r?.debug(`Binary location: ${t}`)}a(wT,`downloadCloudflared`);async function TT(e,t,n,r){let i=O(r,`cloudflared.tgz`);b(i,Buffer.from(await e.arrayBuffer()));try{ne(`tar`,[`-xzf`,i,`-C`,r],{stdio:`ignore`});let e=O(r,`cloudflared`);if(e!==n&&m(e)&&_(e,n),t){let e=sT(g(n));if(e!==t)throw new F(`[cloudflared] SHA256 mismatch for downloaded cloudflared binary.
365
365
 
366
366
  Expected: ${t}
367
- Actual: ${e}`,{telemetryMessage:`tunnel cloudflared extracted binary checksum mismatch`})}}finally{try{f(i)&&_(i)}catch{}}}a(TT,`downloadAndExtractTarball`);async function ET(e,t,n){let r=Buffer.from(await e.arrayBuffer());if(t){let e=sT(r);if(e!==t)throw new F(`[cloudflared] SHA256 mismatch for downloaded cloudflared binary.
367
+ Actual: ${e}`,{telemetryMessage:`tunnel cloudflared extracted binary checksum mismatch`})}}finally{try{m(i)&&y(i)}catch{}}}a(TT,`downloadAndExtractTarball`);async function ET(e,t,n){let r=Buffer.from(await e.arrayBuffer());if(t){let e=sT(r);if(e!==t)throw new F(`[cloudflared] SHA256 mismatch for downloaded cloudflared binary.
368
368
 
369
369
  Expected: ${t}
370
- Actual: ${e}`,{telemetryMessage:`tunnel cloudflared binary checksum mismatch`})}CT(n,r)}a(ET,`downloadBinary`);async function DT(e){let t=e?.logger,n=hr();if(n){if(!f(n))throw new F(`CLOUDFLARED_PATH is set to "${n}" but the file does not exist.
370
+ Actual: ${e}`,{telemetryMessage:`tunnel cloudflared binary checksum mismatch`})}CT(n,r)}a(ET,`downloadBinary`);async function DT(e){let t=e?.logger,n=hr();if(n){if(!m(n))throw new F(`CLOUDFLARED_PATH is set to "${n}" but the file does not exist.
371
371
 
372
372
  Please ensure the path points to a valid cloudflared binary.`,{telemetryMessage:`tunnel cloudflared env path missing`});return t?.debug(`Using cloudflared from CLOUDFLARED_PATH: ${n}`),n}let r=yT({logger:t});if(r)return t?.debug(`Using cloudflared from PATH`),e?.skipVersionCheck||await ST(r,{logger:t}),r;let i=await pT({logger:t}),a=hT(i.version),o=!gT(a);if(!o)try{return _T(a,{logger:t}),t?.debug(`Using cached cloudflared ${i.version}: ${a}`),a}catch(e){t?.debug(`Cached cloudflared failed validation; re-downloading`,e),o=!0}if(!(await e?.confirmDownload?.(`cloudflared (${i.version}) is needed but not installed. Download to ${a}?`)??!0))throw new F(`cloudflared is required to run this command.
373
373
 
374
374
  You can install it manually from:
375
375
  https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/
376
376
 
377
- Then either add it to your PATH or set CLOUDFLARED_PATH.`,{telemetryMessage:`tunnel cloudflared download declined`});if(f(a)){let e=kT(i.version);e&&t?.log(`Removed cloudflared cache: ${e}`)}return await wT(i,a,{logger:t}),_T(a,{logger:t}),a}a(DT,`getCloudflaredPath`);async function OT(e,t){let n=t?.logger,r=await DT({skipVersionCheck:t?.skipVersionCheck,confirmDownload:t?.confirmDownload,logger:n});return n?.debug(`Spawning cloudflared: ${r} ${vT(e).join(` `)}`),te(r,e,{stdio:t?.stdio??`inherit`,env:t?.env?{...process.env,...t.env}:void 0})}a(OT,`spawnCloudflared`);function kT(e){let t=e?mT(e):E(Un(),`cloudflared`);return f(t)?(Dn(t),t):null}a(kT,`removeCloudflaredCache`);var AT=3e4,jT=6e4,MT=5e3,NT=3600*1e3,PT=3600*1e3,FT=10800*1e3,IT=600*1e3,LT=/https:\/\/[a-z0-9-]+\.trycloudflare\.com/,RT=new Set([`localhost`,`127.0.0.1`,`::1`,`0.0.0.0`,`::`]);async function zT(e,t,n){let{accountId:r,apiToken:i,complianceRegion:a,logger:o,userAgent:s,abortSignal:c}=n,l={compliance_region:a},u=`/accounts/${r}/cfd_tunnel`,d=(await Lw(l,u,void 0,s,o,new URLSearchParams({name:e,is_deleted:`false`}),HT(jT,c),i)).find(t=>t.name===e);if(!d)throw new F(`No Cloudflare Tunnel named "${e}" was found in this account. Use "wrangler tunnel list" to see available tunnels.`,{telemetryMessage:`tunnel resolve named missing tunnel`});let f=d.id;if(!f)throw new oe(`Tunnel "${e}" was found but has no ID. This is unexpected.`,{telemetryMessage:`tunnel resolve named missing tunnel id`});let p=(await Lw(l,`${u}/${f}/configurations`,void 0,s,o,void 0,HT(jT,c),i)).config?.ingress??[],m=BT(t,p);if(m.length===0)throw new F(UT(e,t,{dashboardUrl:`https://dash.cloudflare.com/${r}/tunnels/${f}`,ingress:p}),{telemetryMessage:`tunnel resolve named ingress mismatch`});let h=await Lw(l,`${u}/${f}/token`,void 0,s,o,void 0,HT(jT,c),i);return{hostnames:m,token:String(h)}}a(zT,`resolveNamedTunnel`);function BT(e,t){let n=new Set,r=VT(e);for(let e of t)try{let t=VT(e.service);e.hostname&&t.toString()===r.toString()&&n.add(e.hostname)}catch{}return[...n]}a(BT,`getMatchingIngressHostnames`);function VT(e){let t=new URL(e);if(RT.has(t.hostname)&&(t.hostname=`localhost`),!t.port)switch(t.protocol){case`http:`:t.port=`80`;break;case`https:`:t.port=`443`;break}return t}a(VT,`normalizeURL`);function HT(e,t){let n=AbortSignal.timeout(e);return t?AbortSignal.any([t,n]):n}a(HT,`createApiAbortSignal`);function UT(e,t,{dashboardUrl:n,ingress:r}){return r.length===0?[`Tunnel "${e}" has no routes configured.`,``,`Add a route for ${t} in the Cloudflare dashboard:`,n,``].join(`
377
+ Then either add it to your PATH or set CLOUDFLARED_PATH.`,{telemetryMessage:`tunnel cloudflared download declined`});if(m(a)){let e=kT(i.version);e&&t?.log(`Removed cloudflared cache: ${e}`)}return await wT(i,a,{logger:t}),_T(a,{logger:t}),a}a(DT,`getCloudflaredPath`);async function OT(e,t){let n=t?.logger,r=await DT({skipVersionCheck:t?.skipVersionCheck,confirmDownload:t?.confirmDownload,logger:n});return n?.debug(`Spawning cloudflared: ${r} ${vT(e).join(` `)}`),re(r,e,{stdio:t?.stdio??`inherit`,env:t?.env?{...process.env,...t.env}:void 0})}a(OT,`spawnCloudflared`);function kT(e){let t=e?mT(e):O(Un(),`cloudflared`);return m(t)?(Dn(t),t):null}a(kT,`removeCloudflaredCache`);var AT=3e4,jT=6e4,MT=5e3,NT=3600*1e3,PT=3600*1e3,FT=10800*1e3,IT=600*1e3,LT=/https:\/\/[a-z0-9-]+\.trycloudflare\.com/,RT=new Set([`localhost`,`127.0.0.1`,`::1`,`0.0.0.0`,`::`]);async function zT(e,t,n){let{accountId:r,apiToken:i,complianceRegion:a,logger:o,userAgent:s,abortSignal:c}=n,l={compliance_region:a},u=`/accounts/${r}/cfd_tunnel`,d=(await Lw(l,u,void 0,s,o,new URLSearchParams({name:e,is_deleted:`false`}),HT(jT,c),i)).find(t=>t.name===e);if(!d)throw new F(`No Cloudflare Tunnel named "${e}" was found in this account. Use "wrangler tunnel list" to see available tunnels.`,{telemetryMessage:`tunnel resolve named missing tunnel`});let f=d.id;if(!f)throw new oe(`Tunnel "${e}" was found but has no ID. This is unexpected.`,{telemetryMessage:`tunnel resolve named missing tunnel id`});let p=(await Lw(l,`${u}/${f}/configurations`,void 0,s,o,void 0,HT(jT,c),i)).config?.ingress??[],m=BT(t,p);if(m.length===0)throw new F(UT(e,t,{dashboardUrl:`https://dash.cloudflare.com/${r}/tunnels/${f}`,ingress:p}),{telemetryMessage:`tunnel resolve named ingress mismatch`});let h=await Lw(l,`${u}/${f}/token`,void 0,s,o,void 0,HT(jT,c),i);return{hostnames:m,token:String(h)}}a(zT,`resolveNamedTunnel`);function BT(e,t){let n=new Set,r=VT(e);for(let e of t)try{let t=VT(e.service);e.hostname&&t.toString()===r.toString()&&n.add(e.hostname)}catch{}return[...n]}a(BT,`getMatchingIngressHostnames`);function VT(e){let t=new URL(e);if(RT.has(t.hostname)&&(t.hostname=`localhost`),!t.port)switch(t.protocol){case`http:`:t.port=`80`;break;case`https:`:t.port=`443`;break}return t}a(VT,`normalizeURL`);function HT(e,t){let n=AbortSignal.timeout(e);return t?AbortSignal.any([t,n]):n}a(HT,`createApiAbortSignal`);function UT(e,t,{dashboardUrl:n,ingress:r}){return r.length===0?[`Tunnel "${e}" has no routes configured.`,``,`Add a route for ${t} in the Cloudflare dashboard:`,n,``].join(`
378
378
  `):[`Tunnel "${e}" has no route for ${t}`,``,`Resolved routes:`,...r.map(({hostname:e,service:t})=>` - ${e??`(no hostname)`} -> ${t}`),``,`Update your local server settings or the tunnel routes in the Cloudflare dashboard:`,n,``].join(`
379
379
  `)}a(UT,`createMissingIngressMessage`);function WT(e){let t=!1,n,r,i=0,o,s=e.logger,c=e.timeoutMs??AT,l=e.reminderIntervalMs??IT,u=e.expiryMs??NT,d=e.token!==void 0,f=new Intl.DateTimeFormat(void 0,{timeStyle:`short`}),p=OT(d?[`tunnel`,`--no-autoupdate`,`run`]:[`tunnel`,`--no-autoupdate`,`--url`,e.origin.href],{stdio:`pipe`,env:e.token?{TUNNEL_TOKEN:e.token}:void 0,skipVersionCheck:!0,logger:s}).then(e=>(o=e,t&&KT(e),e)).then(t=>d?{mode:`named`}:qT(t,c,{logger:s,origin:e.origin})).then(e=>(i=Date.now()+u,_(),g(e.mode===`quick`?e.publicUrl.origin:void 0),e));function m(){t=!0,h(),o&&KT(o)}a(m,`disposeTunnel`);function h(){r&&=(clearTimeout(r),void 0),n&&=(clearInterval(n),void 0)}a(h,`clearTunnelTimers`);function g(r){l>0&&(n=setInterval(()=>{if(t)return;let n=i-Date.now();n<=0||s?.log(`${r?`Tunnel still open, expires in ${GT(n)}: ${r}`:`The tunnel is still open. It expires in ${GT(n)}.`}${e.extendHint?` ${e.extendHint}`:``}`)},l),n.unref?.())}a(g,`scheduleReminder`);function _(){t||(r&&clearTimeout(r),r=setTimeout(()=>{t||(s?.log(`Tunnel expired. Closing tunnel.`),m())},Math.max(0,i-Date.now())),r.unref())}a(_,`scheduleExpiryTimeout`);function v(e=PT){if(t||!r||e<=0)return;let n=Date.now(),a=i;i=Math.min(n+FT,Math.max(i,n)+e);let o=i-a;if(o<e){s?.log(`Tunnel expiry extended to the ${GT(FT)} limit. It now expires at ${f.format(new Date(i))}.`),_();return}s?.log(`Tunnel expiry extended by ${GT(o)}. It now expires at ${f.format(new Date(i))}.`),_()}return a(v,`extendExpiry`),{ready:a(()=>p,`ready`),isOpen:a(()=>!t,`isOpen`),dispose:m,extendExpiry:v}}a(WT,`startTunnel`);function GT(e){let t=Math.max(1,Math.ceil(e/6e4)),n=Math.floor(t/60),r=t%60;return n===0?`${r}m`:r===0?`${n}h`:`${n}h ${r}m`}a(GT,`formatTunnelDuration`);function KT(e){e.killed||(e.unref(),e.kill(`SIGTERM`),setTimeout(()=>{e.killed||e.kill(`SIGKILL`)},MT).unref())}a(KT,`terminateCloudflared`);function qT(e,t,n){return new Promise((r,i)=>{let a=!1,o=``,s=n?.logger,c=n?.origin,l=setTimeout(()=>{a||(a=!0,KT(e),i(JT(`Timed out waiting for cloudflared to start (${t/1e3}s).`,o,c)))},t);l.unref(),e.stderr&&e.stderr.on(`data`,e=>{let t=e.toString();o+=t,s?.debug(`[cloudflared]`,t.trimEnd());let n=LT.exec(o);n&&!a&&(a=!0,clearTimeout(l),r({mode:`quick`,publicUrl:new URL(n[0])}))}),e.on(`error`,e=>{a||(a=!0,clearTimeout(l),i(Error(`Failed to start cloudflared: ${e.message}`)))}),e.on(`exit`,(e,t)=>{a||(a=!0,clearTimeout(l),i(JT(`cloudflared ${t?`terminated by signal ${t}`:`exited with code ${e}`} before the tunnel was ready.`,o,c)))})})}a(qT,`waitForQuickTunnelReady`);function JT(e,t,n){let r=t.includes(`429 Too Many Requests`),i=`${e}
380
380
  cloudflared output:
381
381
  ${t||`(no output)`}
382
382
 
383
383
  The local dev server started at ${n.href}
384
- `+(r?`Cloudflare Quick Tunnel creation was rate limited. Try again in a few minutes, or use a named tunnel if you need more reliable access.`:`Check the cloudflared output above for more details, and verify that ${n.href} is reachable from this machine if this keeps happening.`);return r?new F(i,{telemetryMessage:!1}):Error(i)}a(JT,`createTunnelStartupError`);var YT=n(mo()),XT=3e3,ZT=Symbol(`timed_out`);async function QT(e,t){let n=null;try{n=await Promise.race([(0,YT.default)({name:e,version:t},{distTag:t.startsWith(`0.0.0`)?`beta`:`latest`}),ne.setTimeout(XT,ZT,{ref:!1})])}catch{return{status:`failed`}}return n===ZT?{status:`failed`}:n===null?{status:`up-to-date`}:{status:`update-available`,latest:n.latest}}a(QT,`fetchLatestNpmVersion`);var $T={none:-1,error:0,warn:1,info:2,log:3,debug:4};async function eE(e,t){try{let{default:n}=await import(`./open-PBXRGS4R-DIiYQyU9.mjs`);(await n(e)).on(`error`,n=>{tE(e,n,t)})}catch(n){if(n.code===`ENOENT`)tE(e,n,t);else throw n}}a(eE,`openInBrowser`);function tE(e,t,n){let r=t.code===`ENOENT`,i=process.platform===`linux`&&r?" You may need to install `xdg-utils` (e.g. `apt install xdg-utils`) or set a default browser.":``;n.warn(`Failed to open a browser automatically.${i}
384
+ `+(r?`Cloudflare Quick Tunnel creation was rate limited. Try again in a few minutes, or use a named tunnel if you need more reliable access.`:`Check the cloudflared output above for more details, and verify that ${n.href} is reachable from this machine if this keeps happening.`);return r?new F(i,{telemetryMessage:!1}):Error(i)}a(JT,`createTunnelStartupError`);var YT=n(mo()),XT=3e3,ZT=Symbol(`timed_out`);async function QT(e,t){let n=null;try{n=await Promise.race([(0,YT.default)({name:e,version:t},{distTag:t.startsWith(`0.0.0`)?`beta`:`latest`}),s.setTimeout(XT,ZT,{ref:!1})])}catch{return{status:`failed`}}return n===ZT?{status:`failed`}:n===null?{status:`up-to-date`}:{status:`update-available`,latest:n.latest}}a(QT,`fetchLatestNpmVersion`);var $T={none:-1,error:0,warn:1,info:2,log:3,debug:4};async function eE(e,t){try{let{default:n}=await import(`./open-PBXRGS4R-DARSUDEI.mjs`);(await n(e)).on(`error`,n=>{tE(e,n,t)})}catch(n){if(n.code===`ENOENT`)tE(e,n,t);else throw n}}a(eE,`openInBrowser`);function tE(e,t,n){let r=t.code===`ENOENT`,i=process.platform===`linux`&&r?" You may need to install `xdg-utils` (e.g. `apt install xdg-utils`) or set a default browser.":``;n.warn(`Failed to open a browser automatically.${i}
385
385
  Please visit the following URL in your browser:
386
- ${e}`),n.debug(t instanceof Error?t.stack??String(t):String(t))}a(tE,`handleBrowserOpenError`);function nE(e){if(iE===void 0&&(iE=aE()),iE!==null){p(w(iE),{recursive:!0});let t=JSON.stringify({...e,timestamp:new Date().toISOString()});l(iE,t+`
387
- `)}}a(nE,`writeOutput`);function rE(){iE=void 0}a(rE,`clearOutputFilePath`);var iE=void 0;function aE(){let e=sr();if(e)return e;let t=or();return t?D(t,`wrangler-output-${new Date().toISOString().replaceAll(`:`,`-`).replace(`.`,`_`).replace(`T`,`_`).replace(`Z`,``)}-${P(3).toString(`hex`)}.json`):null}a(aE,`getOutputFilePath`);var oE=3,sE=6e4;async function cE(e,t,n=0,r=oE,i){try{return await e()}catch(a){if(a instanceof At){if(!a.isRetryable()&&a.status!==429)throw a}else if(!(a instanceof DOMException&&a.name===`TimeoutError`)&&!(a instanceof TypeError))throw a;let o=a instanceof At?a.retryAfterMs:void 0;if(o!==void 0&&o>sE||r<=1)throw a;let s=Math.random()*1e3,c=n;return o===void 0?a instanceof At&&a.status===429&&(c=Math.max(n,1e3)+s):c=o+s,o===void 0?(t.debug(`Retrying API call after error...`),t.debug(a)):t.info(`Received a "Retry-After" header from the Cloudflare API. Waiting ${Math.ceil(o/1e3)} second(s) before retrying...`),await re(c,void 0,{signal:i}),cE(e,t,n+1e3,r-1,i)}}a(cE,`retryOnAPIFailure`);function lE(e){return`(${(e/1e3).toFixed(2)} sec)`}a(lE,`formatTime`);function uE(e){let t;return typeof e==`string`?t=fE(e):typeof e==`object`&&(t=fE(e.pattern),t===void 0&&`zone_name`in e&&(t=fE(e.zone_name))),t}a(uE,`getHostFromRoute`);function dE(e){return typeof e==`object`&&`zone_name`in e&&e.zone_name?e.zone_name:uE(e)}a(dE,`getZoneFromRoute`);function fE(e){if(!(e.startsWith(`*/`)||e.startsWith(`http://*/`)||e.startsWith(`https://*/`))){e=e.replace(/\*(\.)?/g,``),e.startsWith(`http://`)||e.startsWith(`https://`)||(e=`http://`+e);try{return new URL(e).host}catch{return}}}a(fE,`getHostFromUrl`);var pE={type:`npm`,npx:`npx`,dlx:[`npx`],lockFiles:[`package-lock.json`]},mE={type:`pnpm`,npx:`pnpm`,lockFiles:[`pnpm-lock.yaml`],dlx:[`pnpm`,`dlx`]},hE={type:`yarn`,npx:`yarn`,dlx:[`yarn`,`dlx`],lockFiles:[`yarn.lock`]},gE={type:`bun`,npx:`bunx`,dlx:[`bunx`],lockFiles:[`bun.lockb`,`bun.lock`]},_E={type:`nub`,npx:`nubx`,dlx:[`nubx`],lockFiles:[`nub.lock`]},vE=/[^a-z0-9- ]/g,yE=/^(-+)|(-+)$/g,bE=63;function xE(e){return e?e.match(yE)?{valid:!1,cause:`Worker names cannot start or end with a dash.`}:e.match(vE)?{valid:!1,cause:`Project names must only contain lowercase characters, numbers, and dashes.`}:e.length>bE?{valid:!1,cause:`Project names must be less than 63 characters.`}:{valid:!0}:{valid:!1,cause:`Worker names cannot be empty.`}}a(xE,`checkWorkerNameValidity`);function SE(e){return xE(e).valid?e:(e=e.replaceAll(`_`,`-`).replace(vE,`-`).replace(yE,``).slice(0,bE),e.length?e:`my-worker`)}a(SE,`toValidWorkerName`);function CE(e=``,t){return SE(lr()??(e||C(t)))}a(CE,`getWorkerName`);function wE(e){let t=D(e,`package.json`),n;try{n=Mt(It(t),t).name}catch{}return CE(n,e)}a(wE,`getWorkerNameFromProject`);function TE(e){return y(!/^[a-z]:/i.test(e),`Tried to convert a Windows file path with a drive to a URL path.`),e.replace(/\\/g,`/`)}a(TE,`toUrlPath`);var EE=n(vo()),DE=`./migrations`;function OE(e){let t=kE(e.migrationsDir??DE),n=AE(kE(e.migrationsPattern??`${t}/*.sql`),t),r=S.resolve(e.projectPath,t);return jE(r,new EE.Minimatch(n,{dot:!1})).map(e=>({name:e,filePath:S.join(r,...e.split(`/`))}))}a(OE,`getD1MigrationFiles`);function kE(e){let t=e.replace(/\\/g,`/`),n=S.posix.normalize(t);return n.endsWith(`/`)?n.slice(0,-1):n}a(kE,`normalizeRelativePath`);function AE(e,t){if(t===`.`)return e;let n=`${t}/`;if(!e.startsWith(n))throw Error(`Expected migrations pattern ${JSON.stringify(e)} to start with ${JSON.stringify(n)}`);return e.slice(n.length)}a(AE,`stripDirPrefix`);function jE(e,t){let n=[],r=[{abs:e,rel:``}];for(;r.length>0;){let{abs:e,rel:i}=r.pop(),a;try{a=s.readdirSync(e,{withFileTypes:!0})}catch{continue}for(let o of a){let a=i===``?o.name:`${i}/${o.name}`;o.isDirectory()?t.match(a,!0)&&r.push({abs:S.join(e,o.name),rel:a}):o.isFile()&&t.match(a)&&n.push(a)}}return n.sort(ME)}a(jE,`listFilesRelative`);function ME(e,t){let n=e.split(`/`),r=t.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=n[e],i=r[e];if(t===void 0||i===void 0)break;let a=NE(t,i);if(a!==0)return a}return n.length-r.length}a(ME,`compareMigrationPaths`);function NE(e,t){let n=PE(e),r=PE(t);if(n!==r){if(Number.isFinite(n)&&Number.isFinite(r))return n-r;if(Number.isFinite(n))return-1;if(Number.isFinite(r))return 1}return e<t?-1:+(e>t)}a(NE,`compareSegments`);function PE(e){let t=e.split(`/`)[0];return parseInt(t.split(`_`)[0],10)}a(PE,`leadingMigrationNumber`);export{xn as $,jx as A,cr as B,jw as C,It as Ct,lw as D,F as Dt,jC as E,oe as Et,nE as F,nr as G,tr as H,Za as I,ur as J,ar as K,Yr as L,rw as M,cE as N,UC as O,Qw as P,wn as Q,Xn as R,CE as S,ue as St,uw as T,ye as Tt,Yn as U,lr as V,$n as W,Tn as X,Un as Y,bn as Z,lE as _,Nt as _t,Co as a,Gt as at,uE as b,Mt as bt,xE as c,on as ct,xo as d,ve as dt,_n as et,ZC as f,I as ft,Lw as g,pe as gt,Rw as h,fe as ht,_E as i,qt as it,eE as j,JC as k,fw as l,ln as lt,eT as m,me as mt,$T as n,pn as nt,mE as o,kt as ot,Iw as p,de as pt,dr as q,pE as r,At as rt,hE as s,Kt as st,gE as t,un as tt,bo as u,sn as ut,Q as v,Pt as vt,Gw as w,ge as wt,WC as x,jt as xt,QC as y,Vt as yt,Zn as z};
386
+ ${e}`),n.debug(t instanceof Error?t.stack??String(t):String(t))}a(tE,`handleBrowserOpenError`);function nE(e){if(iE===void 0&&(iE=aE()),iE!==null){h(E(iE),{recursive:!0});let t=JSON.stringify({...e,timestamp:new Date().toISOString()});d(iE,t+`
387
+ `)}}a(nE,`writeOutput`);function rE(){iE=void 0}a(rE,`clearOutputFilePath`);var iE=void 0;function aE(){let e=sr();if(e)return e;let t=or();return t?k(t,`wrangler-output-${new Date().toISOString().replaceAll(`:`,`-`).replace(`.`,`_`).replace(`T`,`_`).replace(`Z`,``)}-${te(3).toString(`hex`)}.json`):null}a(aE,`getOutputFilePath`);var oE=3,sE=6e4;async function cE(e,t,n=0,r=oE,i){try{return await e()}catch(a){if(a instanceof At){if(!a.isRetryable()&&a.status!==429)throw a}else if(!(a instanceof DOMException&&a.name===`TimeoutError`)&&!(a instanceof TypeError))throw a;let o=a instanceof At?a.retryAfterMs:void 0;if(o!==void 0&&o>sE||r<=1)throw a;let s=Math.random()*1e3,l=n;return o===void 0?a instanceof At&&a.status===429&&(l=Math.max(n,1e3)+s):l=o+s,o===void 0?(t.debug(`Retrying API call after error...`),t.debug(a)):t.info(`Received a "Retry-After" header from the Cloudflare API. Waiting ${Math.ceil(o/1e3)} second(s) before retrying...`),await c(l,void 0,{signal:i}),cE(e,t,n+1e3,r-1,i)}}a(cE,`retryOnAPIFailure`);function lE(e){return`(${(e/1e3).toFixed(2)} sec)`}a(lE,`formatTime`);function uE(e){let t;return typeof e==`string`?t=fE(e):typeof e==`object`&&(t=fE(e.pattern),t===void 0&&`zone_name`in e&&(t=fE(e.zone_name))),t}a(uE,`getHostFromRoute`);function dE(e){return typeof e==`object`&&`zone_name`in e&&e.zone_name?e.zone_name:uE(e)}a(dE,`getZoneFromRoute`);function fE(e){if(!(e.startsWith(`*/`)||e.startsWith(`http://*/`)||e.startsWith(`https://*/`))){e=e.replace(/\*(\.)?/g,``),e.startsWith(`http://`)||e.startsWith(`https://`)||(e=`http://`+e);try{return new URL(e).host}catch{return}}}a(fE,`getHostFromUrl`);var pE={type:`npm`,npx:`npx`,dlx:[`npx`],lockFiles:[`package-lock.json`]},mE={type:`pnpm`,npx:`pnpm`,lockFiles:[`pnpm-lock.yaml`],dlx:[`pnpm`,`dlx`]},hE={type:`yarn`,npx:`yarn`,dlx:[`yarn`,`dlx`],lockFiles:[`yarn.lock`]},gE={type:`bun`,npx:`bunx`,dlx:[`bunx`],lockFiles:[`bun.lockb`,`bun.lock`]},_E={type:`nub`,npx:`nubx`,dlx:[`nubx`],lockFiles:[`nub.lock`]},vE=/[^a-z0-9- ]/g,yE=/^(-+)|(-+)$/g,bE=63;function xE(e){return e?e.match(yE)?{valid:!1,cause:`Worker names cannot start or end with a dash.`}:e.match(vE)?{valid:!1,cause:`Project names must only contain lowercase characters, numbers, and dashes.`}:e.length>bE?{valid:!1,cause:`Project names must be less than 63 characters.`}:{valid:!0}:{valid:!1,cause:`Worker names cannot be empty.`}}a(xE,`checkWorkerNameValidity`);function SE(e){return xE(e).valid?e:(e=e.replaceAll(`_`,`-`).replace(vE,`-`).replace(yE,``).slice(0,bE),e.length?e:`my-worker`)}a(SE,`toValidWorkerName`);function CE(e=``,t){return SE(lr()??(e||T(t)))}a(CE,`getWorkerName`);function wE(e){let t=k(e,`package.json`),n;try{n=Mt(It(t),t).name}catch{}return CE(n,e)}a(wE,`getWorkerNameFromProject`);function TE(e){return x(!/^[a-z]:/i.test(e),`Tried to convert a Windows file path with a drive to a URL path.`),e.replace(/\\/g,`/`)}a(TE,`toUrlPath`);var EE=n(vo()),DE=`./migrations`;function OE(e){let t=kE(e.migrationsDir??DE),n=AE(kE(e.migrationsPattern??`${t}/*.sql`),t),r=w.resolve(e.projectPath,t);return jE(r,new EE.Minimatch(n,{dot:!1})).map(e=>({name:e,filePath:w.join(r,...e.split(`/`))}))}a(OE,`getD1MigrationFiles`);function kE(e){let t=e.replace(/\\/g,`/`),n=w.posix.normalize(t);return n.endsWith(`/`)?n.slice(0,-1):n}a(kE,`normalizeRelativePath`);function AE(e,t){if(t===`.`)return e;let n=`${t}/`;if(!e.startsWith(n))throw Error(`Expected migrations pattern ${JSON.stringify(e)} to start with ${JSON.stringify(n)}`);return e.slice(n.length)}a(AE,`stripDirPrefix`);function jE(e,t){let n=[],r=[{abs:e,rel:``}];for(;r.length>0;){let{abs:e,rel:i}=r.pop(),a;try{a=l.readdirSync(e,{withFileTypes:!0})}catch{continue}for(let o of a){let a=i===``?o.name:`${i}/${o.name}`;o.isDirectory()?t.match(a,!0)&&r.push({abs:w.join(e,o.name),rel:a}):o.isFile()&&t.match(a)&&n.push(a)}}return n.sort(ME)}a(jE,`listFilesRelative`);function ME(e,t){let n=e.split(`/`),r=t.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=n[e],i=r[e];if(t===void 0||i===void 0)break;let a=NE(t,i);if(a!==0)return a}return n.length-r.length}a(ME,`compareMigrationPaths`);function NE(e,t){let n=PE(e),r=PE(t);if(n!==r){if(Number.isFinite(n)&&Number.isFinite(r))return n-r;if(Number.isFinite(n))return-1;if(Number.isFinite(r))return 1}return e<t?-1:+(e>t)}a(NE,`compareSegments`);function PE(e){let t=e.split(`/`)[0];return parseInt(t.split(`_`)[0],10)}a(PE,`leadingMigrationNumber`);export{xn as $,jx as A,cr as B,jw as C,It as Ct,lw as D,F as Dt,jC as E,oe as Et,nE as F,nr as G,tr as H,Za as I,ur as J,ar as K,Yr as L,rw as M,cE as N,UC as O,Qw as P,wn as Q,Xn as R,CE as S,ue as St,uw as T,ye as Tt,Yn as U,lr as V,$n as W,Tn as X,Un as Y,bn as Z,lE as _,Nt as _t,Co as a,Gt as at,uE as b,Mt as bt,xE as c,on as ct,xo as d,ve as dt,_n as et,ZC as f,I as ft,Lw as g,pe as gt,Rw as h,fe as ht,_E as i,qt as it,eE as j,JC as k,fw as l,ln as lt,eT as m,me as mt,$T as n,pn as nt,mE as o,kt as ot,Iw as p,de as pt,dr as q,pE as r,At as rt,hE as s,Kt as st,gE as t,un as tt,bo as u,sn as ut,Q as v,Pt as vt,Gw as w,ge as wt,WC as x,jt as xt,QC as y,Vt as yt,Zn as z};