cf 0.4.0 → 0.5.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 (220) hide show
  1. package/README.md +7 -1
  2. package/dist/{abuse-reports-Dy76QPNP.mjs → abuse-reports-Ina5TlsU.mjs} +2 -2
  3. package/dist/{accounts-CjtZ8x1z.mjs → accounts-B_joQcMi.mjs} +9 -9
  4. package/dist/{acm-C2lYIWs1.mjs → acm-_kIHqYME.mjs} +2 -2
  5. package/dist/{addressing-CHFK6uxW.mjs → addressing-CaFlw8y1.mjs} +10 -10
  6. package/dist/{agent-context-CgGCT0xU.mjs → agent-context-DMPfi54f.mjs} +1 -1
  7. package/dist/ai-CqnhNb_c.mjs +2 -0
  8. package/dist/ai-gateway-pgYGI519.mjs +8 -0
  9. package/dist/ai-search-eqQMPQol.mjs +7 -0
  10. package/dist/ai_gateway--vuVLnOm.mjs +4 -0
  11. package/dist/{alerting-Bk85NNf5.mjs → alerting-CPxHiYHb.mjs} +5 -5
  12. package/dist/{analytics-CkhhhZWZ.mjs → analytics-DSSRDZz8.mjs} +1 -1
  13. package/dist/analytics_engine-gWyfnsCs.mjs +2 -0
  14. package/dist/{api-gateway-CWdR4Ne7.mjs → api-gateway-BXXGFCVR.mjs} +10 -10
  15. package/dist/argo-aC6A3JyX.mjs +2 -0
  16. package/dist/artifacts-HD4V2xpK.mjs +4 -0
  17. package/dist/audit-logs-BuExU_nz.mjs +2 -0
  18. package/dist/auth-CSC4yhEJ.mjs +9 -0
  19. package/dist/auth-D5hNsOFq.mjs +5 -0
  20. package/dist/billing-COaghyxl.mjs +2 -0
  21. package/dist/bot-management-DmEzeV1Y.mjs +5 -0
  22. package/dist/botnet-feed-ByEAXAkw.mjs +3 -0
  23. package/dist/brand-protection-dPrGe8sL.mjs +3 -0
  24. package/dist/{browser-rendering-Rae0AUt0.mjs → browser-rendering-BiSGnpBf.mjs} +3 -3
  25. package/dist/{build-BE4o4imx.mjs → build-HuS9-R0V.mjs} +2 -2
  26. package/dist/{cache-B7pRbpTy.mjs → cache-CY-7Lt71.mjs} +4 -4
  27. package/dist/{calls-DXRWsZ8n.mjs → calls-wOQGDWPl.mjs} +3 -3
  28. package/dist/certificate-authorities-CtqzAtxQ.mjs +2 -0
  29. package/dist/client-certificates-CRf41xLe.mjs +3 -0
  30. package/dist/cloud-connector-BA5IRZUP.mjs +2 -0
  31. package/dist/{cloudforce-one-B6HYfk5Z.mjs → cloudforce-one-Bq_qPAWs.mjs} +20 -20
  32. package/dist/{completions-D_9WsLG7.mjs → completions-DOeHPdCG.mjs} +2 -2
  33. package/dist/{config-7CBz8Xm0.mjs → config-B5k-XbwS.mjs} +1 -1
  34. package/dist/connectivity-Bx3MgTHX.mjs +3 -0
  35. package/dist/connector-interrupts-D7ylweJZ.mjs +2 -0
  36. package/dist/connector-telemetry-events-6izV1kbP.mjs +2 -0
  37. package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +2 -0
  38. package/dist/connectors-DRt4e6d_.mjs +3 -0
  39. package/dist/{content-scanning-CnW2A0pv.mjs → content-scanning-Cd2vy5Sz.mjs} +3 -3
  40. package/dist/context-jpewmual.mjs +2 -0
  41. package/dist/{custom-certificates-CnYh6Yi-.mjs → custom-certificates-DYE-9epx.mjs} +3 -3
  42. package/dist/{custom-hostnames-C2upqZso.mjs → custom-hostnames-CtuTdFcX.mjs} +4 -4
  43. package/dist/custom-nameservers-CWqA51in.mjs +3 -0
  44. package/dist/custom-pages-DeUKEFGe.mjs +4 -0
  45. package/dist/d1-DvWY9Gp4.mjs +4 -0
  46. package/dist/data-security-BPo6dIWu.mjs +6 -0
  47. package/dist/dcv-delegation-Bgf86J-r.mjs +2 -0
  48. package/dist/{deploy-KBRFIatG.mjs → deploy-dVrgDUOp.mjs} +1 -1
  49. package/dist/{dev-pPazzZvt.mjs → dev-C01_Lby6.mjs} +1 -1
  50. package/dist/diagnostics-6nKPmVgz.mjs +3 -0
  51. package/dist/{dispatch-namespaces-Cz2rajnP.mjs → dispatch-namespaces-64lXx2WJ.mjs} +6 -6
  52. package/dist/{dist-DpDjsWWn.mjs → dist-C6zxsVdY.mjs} +2 -2
  53. package/dist/{dist-DA54ZQu0.mjs → dist-t_YrL25p.mjs} +1 -1
  54. package/dist/{dns-62t95Xif.mjs → dns-ClciFGxx.mjs} +13 -13
  55. package/dist/dns-firewall-DfUmXDCe.mjs +57 -0
  56. package/dist/durable-objects-CMaYZ-YU.mjs +2 -0
  57. package/dist/{email-routing-BDUYYeV3.mjs → email-routing-CGXhFqF5.mjs} +9 -9
  58. package/dist/{email-security-ChHA6eqQ.mjs → email-security-D5viPq8S.mjs} +7 -7
  59. package/dist/email-sending-C2jpc3gh.mjs +3 -0
  60. package/dist/{filters-qJpU9uAS.mjs → filters-bzsFcWt0.mjs} +3 -3
  61. package/dist/{firewall-C3DDwfwh.mjs → firewall-DYZcTtIC.mjs} +10 -10
  62. package/dist/{fraud-DY3YXFVf.mjs → fraud-C03MtdZb.mjs} +1 -1
  63. package/dist/google-tag-gateway-Dfy887yA.mjs +2 -0
  64. package/dist/{healthchecks-Drvb79v0.mjs → healthchecks-DRoAlWgr.mjs} +3 -3
  65. package/dist/hostnames-CFgIVI3s.mjs +3 -0
  66. package/dist/hyperdrive-C7-gwTSV.mjs +18 -0
  67. package/dist/iam-DqVPzGrb.mjs +6 -0
  68. package/dist/{images-D1jI3r3O.mjs → images-BYfl4YgR.mjs} +6 -6
  69. package/dist/index.mjs +1 -1
  70. package/dist/intel-duTEPIHc.mjs +3 -0
  71. package/dist/{ips-B6JETVOY.mjs → ips-nv9INuWZ.mjs} +1 -1
  72. package/dist/keyless-certificates-CRCDVd3g.mjs +3 -0
  73. package/dist/{kv-CSWoD9ks.mjs → kv-CZoV4tiv.mjs} +4 -4
  74. package/dist/leaked-credential-checks-DNIBg7Pe.mjs +3 -0
  75. package/dist/{load-balancers-Du1tNuUt.mjs → load-balancers--OMg0HNt.mjs} +5 -5
  76. package/dist/{logpush-SuJyO-uX.mjs → logpush-C0_lZTyY.mjs} +3 -3
  77. package/dist/{logs-DcDNRPRl.mjs → logs-BtpWZQfV.mjs} +2 -2
  78. package/dist/magic-cloud-networking-u6rwYbGg.mjs +5 -0
  79. package/dist/{magic-network-monitoring-CqtvOePQ.mjs → magic-network-monitoring-CKgQyRj4.mjs} +3 -3
  80. package/dist/{magic-transit-BTbkhBtF.mjs → magic-transit-CLhMcJ_-.mjs} +32 -32
  81. package/dist/managed-transforms-D0Z2mlth.mjs +3 -0
  82. package/dist/mtls-certificates-BL65NK5T.mjs +3 -0
  83. package/dist/{network-interconnects-DsiNytOU.mjs → network-interconnects-Bgu9gmaG.mjs} +5 -5
  84. package/dist/oauth-Bk-F-tIO.mjs +52 -0
  85. package/dist/{observability-CLqZ7OSi.mjs → observability-BynRbTF4.mjs} +3 -3
  86. package/dist/{open-YWOUIZ5Y-BpqIuBsR.mjs → open-YWOUIZ5Y-3jqSKAB1.mjs} +1 -1
  87. package/dist/{organizations-aRi1bhFC.mjs → organizations-BqJHyvMK.mjs} +3 -3
  88. package/dist/origin-ca-certificates-BGvYwm3C.mjs +3 -0
  89. package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +2 -0
  90. package/dist/{origin-tls-client-auth-CnQNy9-l.mjs → origin-tls-client-auth-d3snC3vr.mjs} +3 -3
  91. package/dist/{output-CUxZRM5A.mjs → output-B6fBFRqe.mjs} +1 -1
  92. package/dist/{page-rules-CYqtPU1p.mjs → page-rules-EZHJePmn.mjs} +4 -4
  93. package/dist/{page-shield-D8l9ZMUl.mjs → page-shield-CXJioWPs.mjs} +5 -5
  94. package/dist/{pages-ChurJ2H7.mjs → pages-D4aYteKk.mjs} +8 -8
  95. package/dist/{pipelines-CeyujvRf.mjs → pipelines-G8Iusxq-.mjs} +5 -5
  96. package/dist/progress-DrDErV9w.mjs +2 -0
  97. package/dist/queues-DEkbKqZX.mjs +6 -0
  98. package/dist/{r2-BtuTO3vQ.mjs → r2-CV0IkCAW.mjs} +9 -9
  99. package/dist/r2-data-catalog-NtqGC_a_.mjs +14 -0
  100. package/dist/{radar-CzGM92uM.mjs → radar-D986zPJr.mjs} +1 -1
  101. package/dist/{rate-limits-Bbk7HxP7.mjs → rate-limits-B2wRsUX1.mjs} +3 -3
  102. package/dist/raw-fetch-_n0lMAnD.mjs +2 -0
  103. package/dist/{realtime-kit-CivLpkpg.mjs → realtime-kit-Ld3c5eU6.mjs} +9 -9
  104. package/dist/{registrar-8IeA5DKd.mjs → registrar-CDIwTz3G.mjs} +6 -6
  105. package/dist/request-tracers-D7SFMDik.mjs +2 -0
  106. package/dist/{resource-sharing-B-Pcto7-.mjs → resource-sharing-YIQ04jXE.mjs} +4 -4
  107. package/dist/{resource-tagging-Bpb6Qq1M.mjs → resource-tagging-Bd6Y03sg.mjs} +7 -7
  108. package/dist/rules-DHjLP5Kx.mjs +4 -0
  109. package/dist/{rulesets-lYczEcJp.mjs → rulesets-q4QABpKs.mjs} +7 -7
  110. package/dist/rum-SmT4HZmM.mjs +4 -0
  111. package/dist/{schema-hefO-tzo.mjs → schema-BR31o4P6.mjs} +1 -1
  112. package/dist/{schema-validation-DTq517Em.mjs → schema-validation-vVetgC_P.mjs} +5 -5
  113. package/dist/{scim-BiLfOQ89.mjs → scim-ChOkZpNx.mjs} +2 -2
  114. package/dist/{session-CsvPYFj8.mjs → sdk-DhIhH6GB.mjs} +4 -4
  115. package/dist/{secrets-store-CBX0dvHL.mjs → secrets-store-BAK9G12O.mjs} +12 -12
  116. package/dist/security-center-eScuYDKP.mjs +2 -0
  117. package/dist/security-txt-x7R4gmQu.mjs +3 -0
  118. package/dist/session-DHYCE-PM.mjs +93 -0
  119. package/dist/shared-BAjo72Lz.mjs +2 -0
  120. package/dist/{smart-shield-DblHIce0.mjs → smart-shield-CWlSsNi8.mjs} +2 -2
  121. package/dist/snippets-DrlgYJYp.mjs +4 -0
  122. package/dist/{spawn-DK7pott_.mjs → spawn-CCGzKlC4.mjs} +1 -1
  123. package/dist/{spectrum-CnrG0jIC.mjs → spectrum-pVGxb7u5.mjs} +6 -6
  124. package/dist/speed-ZFrMWDgd.mjs +4 -0
  125. package/dist/src-DU7FBCOX.mjs +108 -0
  126. package/dist/ssl-9JY05sYt.mjs +15 -0
  127. package/dist/{stream-CGTRN4ZN.mjs → stream-tRU39b8K.mjs} +13 -13
  128. package/dist/{tenants-o_M62Y1n.mjs → tenants-HLGUazms.mjs} +1 -1
  129. package/dist/{token-validation-Ca5AGEns.mjs → token-validation-_VdamKpz.mjs} +4 -4
  130. package/dist/{tools-DtNNmO6l.mjs → tools-D_hfUU_Z.mjs} +1 -1
  131. package/dist/{turnstile-l7mo9BWL.mjs → turnstile-BRzXd28B.mjs} +4 -4
  132. package/dist/{ui-B97lRnOv.mjs → ui-erjBdVKL.mjs} +1 -1
  133. package/dist/url-normalization-D-NxuLtN.mjs +3 -0
  134. package/dist/url-scanner-BzzR6iDx.mjs +2 -0
  135. package/dist/{user-CiyYZ69X.mjs → user-C4omq__w.mjs} +1 -1
  136. package/dist/vectorize-By6EqcNR.mjs +4 -0
  137. package/dist/{versions-B6E8WQyA.mjs → versions-CBHwWPAM.mjs} +1 -1
  138. package/dist/{waiting-rooms-Bhy_nuV3.mjs → waiting-rooms-u6KwrzWd.mjs} +6 -6
  139. package/dist/{web3-DlHE0CZc.mjs → web3-DQ5dmE9W.mjs} +3 -3
  140. package/dist/{workers-DRAkU6YR.mjs → workers-D8Be7_as.mjs} +14 -14
  141. package/dist/workers-builds-BE3W3qNk.mjs +7 -0
  142. package/dist/{workflows-z6oapEJs.mjs → workflows-BWWufqFA.mjs} +3 -3
  143. package/dist/zaraz-Bsa9AvVL.mjs +2 -0
  144. package/dist/{zero-trust-fyyIelWx.mjs → zero-trust-UNVZFnKu.mjs} +87 -87
  145. package/dist/zero_trust-B0_Rk4p2.mjs +3 -0
  146. package/dist/{zones-MSULnDwW.mjs → zones-BXtdwt6E.mjs} +6 -6
  147. package/package.json +1 -1
  148. package/dist/ai-DS3i-I1a.mjs +0 -2
  149. package/dist/ai-gateway-RIsegO2x.mjs +0 -8
  150. package/dist/ai-search-Dcj4BauG.mjs +0 -7
  151. package/dist/ai_gateway-w7YwfcPE.mjs +0 -4
  152. package/dist/analytics_engine-B7qgDJCA.mjs +0 -2
  153. package/dist/argo-DnJRVnGX.mjs +0 -2
  154. package/dist/artifacts-BVWKiJUl.mjs +0 -4
  155. package/dist/audit-logs-DjTstbzL.mjs +0 -2
  156. package/dist/auth-BqDOIrKX.mjs +0 -150
  157. package/dist/auth-DKkSwnxh.mjs +0 -5
  158. package/dist/billing-3rEqF83h.mjs +0 -2
  159. package/dist/bot-management-CJxD1pqi.mjs +0 -5
  160. package/dist/botnet-feed-MG91D7BR.mjs +0 -3
  161. package/dist/brand-protection-CK7gJi06.mjs +0 -3
  162. package/dist/certificate-authorities-BR3gXBLs.mjs +0 -2
  163. package/dist/client-certificates-B0ebLJdk.mjs +0 -3
  164. package/dist/cloud-connector-BOjaggJk.mjs +0 -2
  165. package/dist/connectivity-welFvZ7X.mjs +0 -3
  166. package/dist/connector-interrupts-DTV3F-50.mjs +0 -2
  167. package/dist/connector-telemetry-events-kDqb_AGm.mjs +0 -2
  168. package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +0 -2
  169. package/dist/connectors-3vjrdFLB.mjs +0 -3
  170. package/dist/context-CONbNKO-.mjs +0 -2
  171. package/dist/custom-nameservers-BGkAD_PZ.mjs +0 -3
  172. package/dist/custom-pages-5fCSP8in.mjs +0 -4
  173. package/dist/d1-CyiRbZZn.mjs +0 -4
  174. package/dist/data-security-Casx4OS_.mjs +0 -6
  175. package/dist/dcv-delegation-DVYO10oA.mjs +0 -2
  176. package/dist/diagnostics-BqYDoDfw.mjs +0 -3
  177. package/dist/dns-firewall-Coy8d47t.mjs +0 -57
  178. package/dist/durable-objects-BSuRERkw.mjs +0 -2
  179. package/dist/email-sending-CVrRqn6S.mjs +0 -3
  180. package/dist/google-tag-gateway-B00MHDfB.mjs +0 -2
  181. package/dist/hostnames-BdAQo1Mr.mjs +0 -3
  182. package/dist/hyperdrive-99OJV9nl.mjs +0 -18
  183. package/dist/iam-BRbpg3lN.mjs +0 -6
  184. package/dist/intel-C3ajLpXd.mjs +0 -3
  185. package/dist/keyless-certificates-C4MZ4xnf.mjs +0 -3
  186. package/dist/leaked-credential-checks-Dgs2oKm9.mjs +0 -3
  187. package/dist/magic-cloud-networking-D-T0RCvi.mjs +0 -5
  188. package/dist/managed-transforms-CfUBSz9p.mjs +0 -3
  189. package/dist/mtls-certificates-Cf1O8c2E.mjs +0 -3
  190. package/dist/origin-ca-certificates-BB4H89a_.mjs +0 -3
  191. package/dist/origin-post-quantum-encryption-DurP3PXG.mjs +0 -2
  192. package/dist/progress-Cent9Lsg.mjs +0 -2
  193. package/dist/queues-Rf_n11Cx.mjs +0 -6
  194. package/dist/r2-data-catalog-Debz38kv.mjs +0 -14
  195. package/dist/raw-fetch-DnbAMFBp.mjs +0 -2
  196. package/dist/request-tracers-D1aH4NmL.mjs +0 -2
  197. package/dist/rules-B10XWY10.mjs +0 -4
  198. package/dist/rum-B5GUKa4I.mjs +0 -4
  199. package/dist/security-center-AVpTOBK3.mjs +0 -2
  200. package/dist/security-txt-DVlh8y9l.mjs +0 -3
  201. package/dist/shared-0bwWVDLo.mjs +0 -2
  202. package/dist/snippets-DrpqSXYC.mjs +0 -4
  203. package/dist/speed-BzRY3Xlh.mjs +0 -4
  204. package/dist/src-D9_Gq68b.mjs +0 -108
  205. package/dist/ssl-Cp6tQkZH.mjs +0 -15
  206. package/dist/url-normalization-D1CogSIG.mjs +0 -3
  207. package/dist/url-scanner-BnJHJqcz.mjs +0 -2
  208. package/dist/vectorize-D3LgMLOn.mjs +0 -4
  209. package/dist/workers-builds-BmNjiHDZ.mjs +0 -7
  210. package/dist/zaraz-CyzfYOEU.mjs +0 -2
  211. package/dist/zero_trust-BAhlNkjo.mjs +0 -3
  212. /package/dist/{body-parser-CBpeIUns.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
  213. /package/dist/{chunk-6IEM75FG-U3L9fKgi.mjs → chunk-6IEM75FG-BEjRFMGh.mjs} +0 -0
  214. /package/dist/{cli-types-CMNMD1V7.mjs → cli-types-BeyOc81z.mjs} +0 -0
  215. /package/dist/{input-validation-CTqtyiY9.mjs → input-validation-_fMCApaH.mjs} +0 -0
  216. /package/dist/{lib-B6xvCJjc.mjs → lib-4PQI6yRW.mjs} +0 -0
  217. /package/dist/{local-D8bhHUMK.mjs → local-CYc9q7l2.mjs} +0 -0
  218. /package/dist/{metadata-jh2EIan8.mjs → metadata-OOwvpR8m.mjs} +0 -0
  219. /package/dist/{resolve-D1mG0REg.mjs → resolve-C3h-mwp7.mjs} +0 -0
  220. /package/dist/{theme-CFHr0Dh9.mjs → theme-DbNbIY4d.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{i as e,n as t,o as n,r,t as i}from"./chunk-DH-VkVmc.mjs";import{t as a}from"./src-D9_Gq68b.mjs";import{$ as o,B as s,C as c,D as l,E as u,F as d,G as f,H as p,J as m,K as h,L as g,M as _,N as v,O as y,Q as b,R as x,S,U as C,V as w,W as T,X as E,Y as D,b as O,d as k,f as ee,h as te,i as ne,k as re,n as ie,nt as A,o as ae,p as j,q as M,r as oe,rt as se,tt as ce,w as le,x as ue,y as de,z as fe}from"./dist-DpDjsWWn.mjs";import{a as pe,o as me}from"./theme-CFHr0Dh9.mjs";import"./ui-B97lRnOv.mjs";import{c as he,d as ge,f as _e,h as ve,l as ye,m as be,n as xe,p as Se,s as Ce,u as we}from"./dist-DA54ZQu0.mjs";import{n as Te,t as Ee}from"./spawn-DK7pott_.mjs";import{createRequire as De}from"node:module";import{extname as Oe}from"path";import{debuglog as ke,inspect as Ae}from"util";import{fileURLToPath as je}from"url";import Me,{createReadStream as Ne,existsSync as Pe,mkdirSync as Fe,readFileSync as Ie,readdirSync as Le,statSync as Re,writeFileSync as ze}from"node:fs";import Be from"node:assert";import Ve from"node:os";import*as He from"node:path";import Ue,{dirname as We,extname as Ge,isAbsolute as Ke,join as qe,resolve as Je,sep as Ye}from"node:path";import{execSync as Xe,spawn as Ze,spawnSync as Qe}from"node:child_process";import{createHash as $e}from"node:crypto";import{stripVTControlCharacters as et}from"node:util";import{Blob as tt}from"node:buffer";import{gzipSync as nt}from"node:zlib";import rt,{URLSearchParams as it}from"node:url";import{AsyncLocalStorage as at}from"node:async_hooks";import{access as ot,readFile as st,readdir as ct,stat as lt,writeFile as ut}from"node:fs/promises";import dt,{exit as ft}from"node:process";import pt from"node:tty";import mt from"node:readline";import{hash as ht}from"blake3-wasm";import{readFile as gt}from"fs/promises";var _t=Object.create,vt=Object.defineProperty,yt=Object.getOwnPropertyDescriptor,bt=Object.getOwnPropertyNames,xt=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty,N=(e,t)=>vt(e,`name`,{value:t,configurable:!0}),Ct=e===void 0?De(import.meta.url):e,wt=(e,t)=>function(){return t||(0,e[bt(e)[0]])((t={exports:{}}).exports,t),t.exports},Tt=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of bt(t))!St.call(e,i)&&i!==n&&vt(e,i,{get:()=>t[i],enumerable:!(r=yt(t,i))||r.enumerable});return e},Et=(e,t,n)=>(n=e==null?{}:_t(xt(e)),Tt(t||!e||!e.__esModule?vt(n,`default`,{value:e,enumerable:!0}):n,e)),P,Dt,Ot,kt,At,jt,Mt;function Nt(e){P=e.logger,Dt=e.fetchResult,Ot=e.fetchListResult,kt=e.fetchPagedListResult,e.fetchKVGetValue,At=e.confirm,jt=e.prompt,Mt=e.select}N(Nt,`initDeployHelpersContext`);var Pt;const Ft=Object.freeze({status:`aborted`});function F(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.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))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var It=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Lt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Pt=globalThis).__zod_globalConfig??(Pt.__zod_globalConfig={});const Rt=globalThis.__zod_globalConfig;function zt(e){return e&&Object.assign(Rt,e),Rt}function Bt(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)}function Vt(e,t){return typeof t==`bigint`?t.toString():t}function Ht(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Ut(e){return e==null}function Wt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Gt(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}const Kt=Symbol(`evaluating`);function qt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Kt)return r===void 0&&(r=Kt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Jt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yt(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Xt(e){return JSON.stringify(e)}function Zt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Qt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function $t(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const en=Ht(()=>{if(Rt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function tn(e){if($t(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!($t(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function nn(e){return tn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const rn=new Set([`string`,`number`,`symbol`]),an=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function on(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function sn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function cn(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};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:()=>t.error}:t}function ln(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const un={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function dn(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 sn(e,Yt(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 Jt(this,`shape`,e),e},checks:[]}))}function fn(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 sn(e,Yt(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 Jt(this,`shape`,r),r},checks:[]}))}function pn(e,t){if(!tn(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 sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jt(this,`shape`,n),n}}))}function mn(e,t){if(!tn(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jt(this,`shape`,n),n}}))}function hn(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Jt(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function gn(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 sn(t,Yt(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 Jt(this,`shape`,i),i},checks:[]}))}function _n(e,t,n){return sn(t,Yt(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 Jt(this,`shape`,i),i}}))}function vn(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}function yn(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}function bn(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function xn(e){return typeof e==`string`?e:e?.message}function Sn(e,t,n){let r=e.message?e.message:xn(e.inst?._zod.def?.error?.(e))??xn(t?.error?.(e))??xn(n.customError?.(e))??xn(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}function Cn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function wn(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const Tn=(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,Vt,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},En=F(`$ZodError`,Tn),Dn=F(`$ZodError`,Tn,{Parent:Error});function On(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}}function kn(e,t=e=>e.message){let n={_errors:[]},r=(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++}}}};return r(e),n}const An=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 It;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Sn(e,a,zt())));throw Qt(t,i?.callee),t}return o.value},jn=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=>Sn(e,a,zt())));throw Qt(t,i?.callee),t}return o.value},Mn=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 It;return a.issues.length?{success:!1,error:new(e??En)(a.issues.map(e=>Sn(e,i,zt())))}:{success:!0,data:a.value}},Nn=Mn(Dn),Pn=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=>Sn(e,i,zt())))}:{success:!0,data:a.value}},Fn=Pn(Dn),In=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return An(e)(t,n,i)},Ln=e=>(t,n,r)=>An(e)(t,n,r),Rn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return jn(e)(t,n,i)},zn=e=>async(t,n,r)=>jn(e)(t,n,r),Bn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Mn(e)(t,n,i)},Vn=e=>(t,n,r)=>Mn(e)(t,n,r),Hn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Pn(e)(t,n,i)},Un=e=>async(t,n,r)=>Pn(e)(t,n,r),Wn=/^[cC][0-9a-z]{6,}$/,Gn=/^[0-9a-z]+$/,Kn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qn=/^[0-9a-vA-V]{20}$/,Jn=/^[A-Za-z0-9]{27}$/,Yn=/^[a-zA-Z0-9_-]{21}$/,Xn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zn=/^([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})$/,Qn=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)$/,$n=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function er(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const tr=/^(?:(?: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])$/,nr=/^(([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}|:))$/,rr=/^((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])$/,ir=/^(([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])$/,ar=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,or=/^[A-Za-z0-9_-]*$/,sr=/^https?$/,cr=/^\+[1-9]\d{6,14}$/,lr=`(?:(?:\\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])))`,ur=RegExp(`^${lr}$`);function dr(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+)?)?`}function fr(e){return RegExp(`^${dr(e)}$`)}function pr(e){let t=dr({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(`^${lr}T(?:${r})$`)}const mr=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},hr=/^-?\d+$/,gr=/^-?\d+(?:\.\d+)?$/,_r=/^(?:true|false)$/i,vr=/^null$/i,yr=/^[^A-Z]*$/,br=/^[^a-z]*$/,xr=F(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Sr={number:`number`,bigint:`bigint`,object:`date`},Cr=F(`$ZodCheckLessThan`,(e,t)=>{xr.init(e,t);let n=Sr[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})}}),wr=F(`$ZodCheckGreaterThan`,(e,t)=>{xr.init(e,t);let n=Sr[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})}}),Tr=F(`$ZodCheckMultipleOf`,(e,t)=>{xr.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):Gt(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})}}),Er=F(`$ZodCheckNumberFormat`,(e,t)=>{xr.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=un[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=hr)}),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})}}),Dr=F(`$ZodCheckMaxLength`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(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=Cn(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Or=F(`$ZodCheckMinLength`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(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=Cn(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),kr=F(`$ZodCheckLengthEquals`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(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=Cn(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})}}),Ar=F(`$ZodCheckStringFormat`,(e,t)=>{var n,r;xr.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=()=>{})}),jr=F(`$ZodCheckRegex`,(e,t)=>{Ar.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})}}),Mr=F(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=yr,Ar.init(e,t)}),Nr=F(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=br,Ar.init(e,t)}),Pr=F(`$ZodCheckIncludes`,(e,t)=>{xr.init(e,t);let n=on(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})}}),Fr=F(`$ZodCheckStartsWith`,(e,t)=>{xr.init(e,t);let n=RegExp(`^${on(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})}}),Ir=F(`$ZodCheckEndsWith`,(e,t)=>{xr.init(e,t);let n=RegExp(`.*${on(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})}}),Lr=F(`$ZodCheckOverwrite`,(e,t)=>{xr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Rr=class{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(`
2
+ import{i as e,n as t,o as n,r,t as i}from"./chunk-DH-VkVmc.mjs";import{t as a}from"./src-DU7FBCOX.mjs";import{$ as o,B as s,C as c,D as l,E as u,F as d,G as f,H as p,J as m,K as h,L as g,M as _,N as v,O as y,Q as b,R as x,S,U as C,V as w,W as T,X as E,Y as D,b as O,d as k,f as ee,h as te,i as ne,k as re,n as ie,nt as A,o as ae,p as j,q as M,r as oe,rt as se,tt as ce,w as le,x as ue,y as de,z as fe}from"./dist-C6zxsVdY.mjs";import{a as pe,o as me}from"./theme-DbNbIY4d.mjs";import"./ui-erjBdVKL.mjs";import{c as he,d as ge,f as _e,h as ve,l as ye,m as be,n as xe,p as Se,s as Ce,u as we}from"./dist-t_YrL25p.mjs";import{n as Te,t as Ee}from"./spawn-CCGzKlC4.mjs";import{createRequire as De}from"node:module";import{extname as Oe}from"path";import{debuglog as ke,inspect as Ae}from"util";import{fileURLToPath as je}from"url";import Me,{createReadStream as Ne,existsSync as Pe,mkdirSync as Fe,readFileSync as Ie,readdirSync as Le,statSync as Re,writeFileSync as ze}from"node:fs";import Be from"node:assert";import Ve from"node:os";import*as He from"node:path";import Ue,{dirname as We,extname as Ge,isAbsolute as Ke,join as qe,resolve as Je,sep as Ye}from"node:path";import{execSync as Xe,spawn as Ze,spawnSync as Qe}from"node:child_process";import{createHash as $e}from"node:crypto";import{stripVTControlCharacters as et}from"node:util";import{Blob as tt}from"node:buffer";import{gzipSync as nt}from"node:zlib";import rt,{URLSearchParams as it}from"node:url";import{AsyncLocalStorage as at}from"node:async_hooks";import{access as ot,readFile as st,readdir as ct,stat as lt,writeFile as ut}from"node:fs/promises";import dt,{exit as ft}from"node:process";import pt from"node:tty";import mt from"node:readline";import{hash as ht}from"blake3-wasm";import{readFile as gt}from"fs/promises";var _t=Object.create,vt=Object.defineProperty,yt=Object.getOwnPropertyDescriptor,bt=Object.getOwnPropertyNames,xt=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty,N=(e,t)=>vt(e,`name`,{value:t,configurable:!0}),Ct=e===void 0?De(import.meta.url):e,wt=(e,t)=>function(){return t||(0,e[bt(e)[0]])((t={exports:{}}).exports,t),t.exports},Tt=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of bt(t))!St.call(e,i)&&i!==n&&vt(e,i,{get:()=>t[i],enumerable:!(r=yt(t,i))||r.enumerable});return e},Et=(e,t,n)=>(n=e==null?{}:_t(xt(e)),Tt(t||!e||!e.__esModule?vt(n,`default`,{value:e,enumerable:!0}):n,e)),P,Dt,Ot,kt,At,jt,Mt;function Nt(e){P=e.logger,Dt=e.fetchResult,Ot=e.fetchListResult,kt=e.fetchPagedListResult,e.fetchKVGetValue,At=e.confirm,jt=e.prompt,Mt=e.select}N(Nt,`initDeployHelpersContext`);var Pt;const Ft=Object.freeze({status:`aborted`});function F(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.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))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var It=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Lt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Pt=globalThis).__zod_globalConfig??(Pt.__zod_globalConfig={});const Rt=globalThis.__zod_globalConfig;function zt(e){return e&&Object.assign(Rt,e),Rt}function Bt(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)}function Vt(e,t){return typeof t==`bigint`?t.toString():t}function Ht(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Ut(e){return e==null}function Wt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Gt(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}const Kt=Symbol(`evaluating`);function qt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Kt)return r===void 0&&(r=Kt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Jt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yt(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Xt(e){return JSON.stringify(e)}function Zt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Qt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function $t(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const en=Ht(()=>{if(Rt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function tn(e){if($t(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!($t(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function nn(e){return tn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const rn=new Set([`string`,`number`,`symbol`]),an=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function on(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function sn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function cn(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};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:()=>t.error}:t}function ln(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const un={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function dn(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 sn(e,Yt(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 Jt(this,`shape`,e),e},checks:[]}))}function fn(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 sn(e,Yt(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 Jt(this,`shape`,r),r},checks:[]}))}function pn(e,t){if(!tn(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 sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jt(this,`shape`,n),n}}))}function mn(e,t){if(!tn(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jt(this,`shape`,n),n}}))}function hn(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Jt(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function gn(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 sn(t,Yt(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 Jt(this,`shape`,i),i},checks:[]}))}function _n(e,t,n){return sn(t,Yt(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 Jt(this,`shape`,i),i}}))}function vn(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}function yn(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}function bn(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function xn(e){return typeof e==`string`?e:e?.message}function Sn(e,t,n){let r=e.message?e.message:xn(e.inst?._zod.def?.error?.(e))??xn(t?.error?.(e))??xn(n.customError?.(e))??xn(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}function Cn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function wn(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const Tn=(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,Vt,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},En=F(`$ZodError`,Tn),Dn=F(`$ZodError`,Tn,{Parent:Error});function On(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}}function kn(e,t=e=>e.message){let n={_errors:[]},r=(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++}}}};return r(e),n}const An=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 It;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Sn(e,a,zt())));throw Qt(t,i?.callee),t}return o.value},jn=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=>Sn(e,a,zt())));throw Qt(t,i?.callee),t}return o.value},Mn=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 It;return a.issues.length?{success:!1,error:new(e??En)(a.issues.map(e=>Sn(e,i,zt())))}:{success:!0,data:a.value}},Nn=Mn(Dn),Pn=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=>Sn(e,i,zt())))}:{success:!0,data:a.value}},Fn=Pn(Dn),In=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return An(e)(t,n,i)},Ln=e=>(t,n,r)=>An(e)(t,n,r),Rn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return jn(e)(t,n,i)},zn=e=>async(t,n,r)=>jn(e)(t,n,r),Bn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Mn(e)(t,n,i)},Vn=e=>(t,n,r)=>Mn(e)(t,n,r),Hn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Pn(e)(t,n,i)},Un=e=>async(t,n,r)=>Pn(e)(t,n,r),Wn=/^[cC][0-9a-z]{6,}$/,Gn=/^[0-9a-z]+$/,Kn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qn=/^[0-9a-vA-V]{20}$/,Jn=/^[A-Za-z0-9]{27}$/,Yn=/^[a-zA-Z0-9_-]{21}$/,Xn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zn=/^([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})$/,Qn=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)$/,$n=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function er(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const tr=/^(?:(?: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])$/,nr=/^(([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}|:))$/,rr=/^((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])$/,ir=/^(([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])$/,ar=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,or=/^[A-Za-z0-9_-]*$/,sr=/^https?$/,cr=/^\+[1-9]\d{6,14}$/,lr=`(?:(?:\\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])))`,ur=RegExp(`^${lr}$`);function dr(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+)?)?`}function fr(e){return RegExp(`^${dr(e)}$`)}function pr(e){let t=dr({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(`^${lr}T(?:${r})$`)}const mr=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},hr=/^-?\d+$/,gr=/^-?\d+(?:\.\d+)?$/,_r=/^(?:true|false)$/i,vr=/^null$/i,yr=/^[^A-Z]*$/,br=/^[^a-z]*$/,xr=F(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Sr={number:`number`,bigint:`bigint`,object:`date`},Cr=F(`$ZodCheckLessThan`,(e,t)=>{xr.init(e,t);let n=Sr[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})}}),wr=F(`$ZodCheckGreaterThan`,(e,t)=>{xr.init(e,t);let n=Sr[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})}}),Tr=F(`$ZodCheckMultipleOf`,(e,t)=>{xr.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):Gt(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})}}),Er=F(`$ZodCheckNumberFormat`,(e,t)=>{xr.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=un[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=hr)}),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})}}),Dr=F(`$ZodCheckMaxLength`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(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=Cn(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Or=F(`$ZodCheckMinLength`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(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=Cn(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),kr=F(`$ZodCheckLengthEquals`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(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=Cn(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})}}),Ar=F(`$ZodCheckStringFormat`,(e,t)=>{var n,r;xr.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=()=>{})}),jr=F(`$ZodCheckRegex`,(e,t)=>{Ar.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})}}),Mr=F(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=yr,Ar.init(e,t)}),Nr=F(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=br,Ar.init(e,t)}),Pr=F(`$ZodCheckIncludes`,(e,t)=>{xr.init(e,t);let n=on(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})}}),Fr=F(`$ZodCheckStartsWith`,(e,t)=>{xr.init(e,t);let n=RegExp(`^${on(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})}}),Ir=F(`$ZodCheckEndsWith`,(e,t)=>{xr.init(e,t);let n=RegExp(`.*${on(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})}}),Lr=F(`$ZodCheckOverwrite`,(e,t)=>{xr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Rr=class{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(`
3
3
  `).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(`
4
4
  `))}};const zr={major:4,minor:4,patch:3},Br=F(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zr;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=(e,t,n)=>{let r=vn(e),i;for(let a of t){if(a._zod.def.when){if(yn(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 It;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=vn(e,t))});else{if(e.issues.length===t)continue;r||=vn(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(vn(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new It;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};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 It;return o.then(e=>t(e,r,a))}return t(o,r,a)}}qt(e,`~standard`,()=>({validate:t=>{try{let n=Nn(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Fn(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Vr=F(`$ZodString`,(e,t)=>{Br.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??mr(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}}),Hr=F(`$ZodStringFormat`,(e,t)=>{Ar.init(e,t),Vr.init(e,t)}),Ur=F(`$ZodGUID`,(e,t)=>{t.pattern??=Zn,Hr.init(e,t)}),Wr=F(`$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??=Qn(e)}else t.pattern??=Qn();Hr.init(e,t)}),Gr=F(`$ZodEmail`,(e,t)=>{t.pattern??=$n,Hr.init(e,t)}),Kr=F(`$ZodURL`,(e,t)=>{Hr.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===sr.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})}}}),qr=F(`$ZodEmoji`,(e,t)=>{t.pattern??=er(),Hr.init(e,t)}),Jr=F(`$ZodNanoID`,(e,t)=>{t.pattern??=Yn,Hr.init(e,t)}),Yr=F(`$ZodCUID`,(e,t)=>{t.pattern??=Wn,Hr.init(e,t)}),Xr=F(`$ZodCUID2`,(e,t)=>{t.pattern??=Gn,Hr.init(e,t)}),Zr=F(`$ZodULID`,(e,t)=>{t.pattern??=Kn,Hr.init(e,t)}),Qr=F(`$ZodXID`,(e,t)=>{t.pattern??=qn,Hr.init(e,t)}),$r=F(`$ZodKSUID`,(e,t)=>{t.pattern??=Jn,Hr.init(e,t)}),ei=F(`$ZodISODateTime`,(e,t)=>{t.pattern??=pr(t),Hr.init(e,t)}),ti=F(`$ZodISODate`,(e,t)=>{t.pattern??=ur,Hr.init(e,t)}),ni=F(`$ZodISOTime`,(e,t)=>{t.pattern??=fr(t),Hr.init(e,t)}),ri=F(`$ZodISODuration`,(e,t)=>{t.pattern??=Xn,Hr.init(e,t)}),ii=F(`$ZodIPv4`,(e,t)=>{t.pattern??=tr,Hr.init(e,t),e._zod.bag.format=`ipv4`}),ai=F(`$ZodIPv6`,(e,t)=>{t.pattern??=nr,Hr.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})}}}),oi=F(`$ZodCIDRv4`,(e,t)=>{t.pattern??=rr,Hr.init(e,t)}),si=F(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ir,Hr.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 ci(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const li=F(`$ZodBase64`,(e,t)=>{t.pattern??=ar,Hr.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{ci(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ui(e){if(!or.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ci(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const di=F(`$ZodBase64URL`,(e,t)=>{t.pattern??=or,Hr.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ui(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),fi=F(`$ZodE164`,(e,t)=>{t.pattern??=cr,Hr.init(e,t)});function pi(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}}const mi=F(`$ZodJWT`,(e,t)=>{Hr.init(e,t),e._zod.check=n=>{pi(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),hi=F(`$ZodNumber`,(e,t)=>{Br.init(e,t),e._zod.pattern=e._zod.bag.pattern??gr,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}}),gi=F(`$ZodNumberFormat`,(e,t)=>{Er.init(e,t),hi.init(e,t)}),_i=F(`$ZodBoolean`,(e,t)=>{Br.init(e,t),e._zod.pattern=_r,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}}),vi=F(`$ZodNull`,(e,t)=>{Br.init(e,t),e._zod.pattern=vr,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}}),yi=F(`$ZodUnknown`,(e,t)=>{Br.init(e,t),e._zod.parse=e=>e}),bi=F(`$ZodNever`,(e,t)=>{Br.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function xi(e,t,n){e.issues.length&&t.issues.push(...bn(n,e.issues)),t.value[n]=e.value}const Si=F(`$ZodArray`,(e,t)=>{Br.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=>xi(t,n,e))):xi(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Ci(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...bn(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}function wi(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=ln(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ti(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=>Ci(e,n,i,t,u,d))):Ci(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}const Ei=F(`$ZodObject`,(e,t)=>{if(Br.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Ht(()=>wi(t));qt(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=$t,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=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=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Ci(n,t,e,s,r,i))):Ci(a,t,e,s,r,i)}return i?Ti(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Di=F(`$ZodObjectJIT`,(e,t)=>{Ei.init(e,t);let n=e._zod.parse,r=Ht(()=>wi(t)),i=e=>{let t=new Rr([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Xt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Xt(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
5
5
  if (${n}.issues.length) {
@@ -810,7 +810,7 @@ This means that, on future Puppeteer launches, Puppeteer might not be able to la
810
810
  Please check your open processes and ensure that the browser processes that Puppeteer launched have been killed.
811
811
  If you think this is a bug, please report it on the Puppeteer issue tracker.`;function xU(e){try{return process.kill(e,0)}catch(e){if(CU(e)&&e.code&&e.code===`ESRCH`)return!1;throw e}}function SU(e){return typeof e==`object`&&!!e&&`name`in e&&`message`in e}function CU(e){return SU(e)&&(`errno`in e||`code`in e||`path`in e||`syscall`in e)}var wU=class extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor)}},TU=m(e(`node:assert`),1),EU=e(`node:child_process`),DU=e(`node:fs`),OU=e(`node:fs/promises`),kU=m(e(`node:os`),1),AU=m(e(`node:path`),1),jU=m(vi(),1),MU=e(`node:child_process`),NU=e(`node:fs`),PU=e(`node:fs/promises`),FU=m(e(`node:path`),1),IU=e(`node:stream`),LU=(0,m(lt(),1).default)(`puppeteer:browsers:fileUtil`);async function RU(e,t){if(FU.isAbsolute(t)||(t=FU.resolve(process.cwd(),t)),e.endsWith(`.zip`))await(await Promise.resolve().then(()=>m(ki(),1))).default(e,{dir:t});else if(e.endsWith(`.tar.bz2`))await VU(e,t,`bzip2`);else if(e.endsWith(`.dmg`))await(0,PU.mkdir)(t),await HU(e,t);else if(e.endsWith(`.exe`)){let n=(0,MU.spawnSync)(e,[`/ExtractDir=${t}`],{env:{__compat_layer:`RunAsInvoker`}});if(n.status!==0)throw Error(`Failed to extract ${e} to ${t}: ${n.output}`)}else if(e.endsWith(`.tar.xz`))await VU(e,t,`xz`);else throw Error(`Unsupported archive format: ${e}`)}function zU(e){let t=new IU.Stream.Transform({transform(t,n,r){e.stdin.write(t,n)?r():e.stdin.once(`drain`,r)},flush(t){e.stdout.destroyed?t():(e.stdin.end(),e.stdout.on(`close`,t))}});return e.stdin.on(`error`,e=>{`code`in e&&e.code===`EPIPE`?t.emit(`end`):t.destroy(e)}),e.stdout.on(`data`,e=>t.push(e)).on(`error`,e=>t.destroy(e)),e.once(`close`,()=>t.end()),t}var BU={xz:`xz`,bzip2:`bzip2`};async function VU(e,t,n){let r=await Promise.resolve().then(()=>m(Wi(),1));return await new Promise((i,a)=>{function o(e){return t=>{`code`in t&&t.code===`ENOENT`&&(t=Error(`\`${e}\` utility is required to unpack this archive`,{cause:t})),a(t)}}let s=(0,MU.spawn)(BU[n],[`-d`],{stdio:[`pipe`,`pipe`,`inherit`]}).once(`error`,o(n)).once(`exit`,e=>{LU(`${n} exited, code=${e}`)}),c=r.extract(t);c.once(`error`,o(`tar`)),c.once(`finish`,i),(0,NU.createReadStream)(e).pipe(zU(s)).pipe(c)})}async function HU(e,t){let{stdout:n}=(0,MU.spawnSync)(`hdiutil`,[`attach`,`-nobrowse`,`-noautoopen`,e]),r=n.toString(`utf8`).match(/\/Volumes\/(.*)/m);if(!r)throw Error(`Could not find volume path in ${n}`);let i=r[0];try{let e=(await(0,PU.readdir)(i)).find(e=>typeof e==`string`&&e.endsWith(`.app`));if(!e)throw Error(`Cannot find app in ${i}`);let n=FU.join(i,e);(0,MU.spawnSync)(`cp`,[`-R`,n,t])}finally{(0,MU.spawnSync)(`hdiutil`,[`detach`,i,`-quiet`])}}var UU=(0,dU.default)(`puppeteer:browsers:install`),WU=new Map;function GU(e){WU.set(e,process.hrtime())}function KU(e){let t=process.hrtime(),n=WU.get(e);n&&UU(`Duration for ${e}: ${t[0]*1e3+t[1]/1e6-(n[0]*1e3+n[1]/1e6)}ms`)}async function qU(e){if(e.platform??=aU(),e.unpack??=!0,!e.platform)throw Error(`Cannot download a binary for the provided platform: ${kU.default.platform()} (${kU.default.arch()})`);let t=ZU(e.browser,e.platform,e.buildId,e.baseUrl);try{return await YU(t,e)}catch(n){if(e.baseUrl&&!e.forceFallbackForTesting)throw n;switch(UU(`Error downloading from ${t}.`),e.browser){case XV.CHROME:case XV.CHROMEDRIVER:case XV.CHROMEHEADLESSSHELL:{UU(`Trying to find download URL via https://googlechromelabs.github.io/chrome-for-testing.`);let r=await cH(new URL(`https://googlechromelabs.github.io/chrome-for-testing/${e.buildId}.json`)),i=``;switch(e.platform){case $.LINUX:i=`linux64`;break;case $.MAC_ARM:i=`mac-arm64`;break;case $.MAC:i=`mac-x64`;break;case $.WIN32:i=`win32`;break;case $.WIN64:i=`win64`;break}let a=r.downloads[e.browser]?.find(e=>e.platform===i)?.url;if(a){if(a===t.toString())throw n;return UU(`Falling back to downloading from ${a}.`),await YU(new URL(a),e)}throw n}default:throw n}}}async function JU(e){if(process.platform!==`linux`||e.platform!==$.LINUX)return;let t=AU.default.join(AU.default.dirname(e.executablePath),`deb.deps`);if(!(0,DU.existsSync)(t)){UU(`deb.deps file was not found at ${t}`);return}let n=(0,DU.readFileSync)(t,`utf-8`).split(`
812
812
  `).join(`,`);if(process.getuid?.()!==0)throw Error(`Installing system dependencies requires root privileges`);let r=(0,EU.spawnSync)(`apt-get`,[`-v`]);if(r.status!==0)throw Error(`Failed to install system dependencies: apt-get does not seem to be available`);if(UU(`Trying to install dependencies: ${n}`),r=(0,EU.spawnSync)(`apt-get`,[`satisfy`,`-y`,n,`--no-install-recommends`]),r.status!==0)throw Error(`Failed to install system dependencies: status=${r.status},error=${r.error},stdout=${r.stdout.toString(`utf8`)},stderr=${r.stderr.toString(`utf8`)}`);UU(`Installed system dependencies ${n}`)}async function YU(e,t){if(t.platform??=aU(),!t.platform)throw Error(`Cannot download a binary for the provided platform: ${kU.default.platform()} (${kU.default.arch()})`);let n=t.downloadProgressCallback;n===`default`&&(n=await QU(t.browser,t.buildIdAlias??t.buildId));let r=decodeURIComponent(e.toString()).split(`/`).pop();(0,TU.default)(r,`A malformed download URL was found: ${e}.`);let i=new lU(t.cacheDir),a=i.browserRoot(t.browser),o=AU.default.join(a,`${t.buildId}-${r}`);if((0,DU.existsSync)(a)||await(0,OU.mkdir)(a,{recursive:!0}),!t.unpack)return(0,DU.existsSync)(o)?o:(UU(`Downloading binary from ${e}`),GU(`download`),await sH(e,o,n),KU(`download`),o);let s=i.installationDir(t.browser,t.platform,t.buildId);try{if((0,DU.existsSync)(s)){let e=new cU(i,t.browser,t.buildId,t.platform);if(!(0,DU.existsSync)(e.executablePath))throw Error(`The browser folder (${s}) exists but the executable (${e.executablePath}) is missing`);return await XU(e),t.installDeps&&await JU(e),e}UU(`Downloading binary from ${e}`);try{GU(`download`),await sH(e,o,n)}finally{KU(`download`)}UU(`Installing ${o} to ${s}`);try{GU(`extract`),await RU(o,s)}finally{KU(`extract`)}let r=new cU(i,t.browser,t.buildId,t.platform);if(t.buildIdAlias){let e=r.readMetadata();e.aliases[t.buildIdAlias]=t.buildId,r.writeMetadata(e)}return await XU(r),t.installDeps&&await JU(r),r}finally{(0,DU.existsSync)(o)&&await(0,OU.unlink)(o)}}async function XU(e){if((e.platform===$.WIN32||e.platform===$.WIN64)&&e.browser===XV.CHROME&&e.platform===aU())try{GU(`permissions`);let t=AU.default.dirname(e.executablePath),n=AU.default.join(t,`setup.exe`);if(!(0,DU.existsSync)(n))return;(0,EU.spawnSync)(AU.default.join(t,`setup.exe`),[`--configure-browser-in-directory=`+t],{shell:!0})}finally{KU(`permissions`)}}function ZU(e,t,n,r){return new URL(JH[e](t,n,r))}function QU(e,t){let n,r=0;return(i,a)=>{n||=new jU.default(`Downloading ${e} ${t} - ${$U(a)} [:bar] :percent :etas `,{complete:`=`,incomplete:` `,width:20,total:a});let o=i-r;r=i,n.tick(o)}}function $U(e){let t=e/1e3/1e3;return`${Math.round(t*10)/10} MB`}var eW=m(e(`fs`)),tW=m(e(`path`)),nW=m(e(`url`)),rW;function iW(){if(rW!==void 0)return rW;let e=tW.default.join(__dirname,`workers`,`browser-rendering/binding.worker.js`);return rW=eW.default.readFileSync(e,`utf8`)+`//# sourceURL=`+nW.default.pathToFileURL(e),rW}var aW=W.object({binding:W.string(),remoteProxyConnectionString:W.custom().optional(),headful:W.boolean().optional()}),oW=W.object({browserRendering:aW.optional()}),sW=`browser-rendering`,cW={options:oW,bindingTypeDescription:`Browser Rendering`,async getBindings(e){return e.browserRendering?[{name:e.browserRendering.binding,service:{name:mw(sW,`service`,e.browserRendering.remoteProxyConnectionString)}}]:[]},getNodeBindings(e){return e.browserRendering?{[e.browserRendering.binding]:new Y}:{}},async getServices({options:e}){return e.browserRendering?[{name:mw(sW,`service`,e.browserRendering.remoteProxyConnectionString),worker:e.browserRendering.remoteProxyConnectionString?QC(e.browserRendering.remoteProxyConnectionString,e.browserRendering.binding):{compatibilityDate:`2025-05-01`,compatibilityFlags:[`nodejs_compat`],modules:[{name:`index.worker.js`,esModule:iW()}],bindings:[GC,{name:`BrowserSession`,durableObjectNamespace:{className:`BrowserSession`}}],durableObjectNamespaces:[{className:`BrowserSession`,uniqueKey:`miniflare-BrowserSession`}],durableObjectStorage:{inMemory:SM}}}]:[]}};async function lW({browserVersion:e,headful:t,log:n,tmpPath:r}){let i=aU();if(!i)throw Error(`The current platform is not supported.`);let a=XV.CHROME,o=crypto.randomUUID(),s=GV(),c=!1,l={browser:a,platform:i,cacheDir:Wo(),buildId:await QH(a,i,e),downloadProgressCallback:(e,t)=>{c||=(s.start(`Downloading browser...`),!0);let n=Math.round(e/t*100);s.update(`Downloading browser... ${n}%`)}},u;try{({executablePath:u}=await dW(l,n))}catch(e){throw c&&s.stop(`${Qa(`failed`)} ${Wa(`browser download`)}`),e}c&&(s.stop(`${Ya(`downloaded`)} ${Wa(`browser`)}`),n.debug(`${a} ${e} available at ${u}`));let d=RB.default.join(r,`browser-rendering`,`profile-${o}`);await LB.default.promises.mkdir(d,{recursive:!0});let f=[`--allow-pre-commit-input`,`--disable-background-networking`,`--disable-background-timer-throttling`,`--disable-backgrounding-occluded-windows`,`--disable-breakpad`,`--disable-client-side-phishing-detection`,`--disable-component-extensions-with-background-pages`,`--disable-crash-reporter`,`--disable-default-apps`,`--disable-dev-shm-usage`,`--disable-hang-monitor`,`--disable-infobars`,`--disable-ipc-flooding-protection`,`--disable-popup-blocking`,`--disable-prompt-on-repost`,`--disable-renderer-backgrounding`,`--disable-search-engine-choice-screen`,`--disable-sync`,`--enable-automation`,`--export-tagged-pdf`,`--force-color-profile=srgb`,`--generate-pdf-document-outline`,`--metrics-recording-only`,`--no-first-run`,`--password-store=basic`,`--use-mock-keychain`,`--disable-features=${[`Translate`,`AcceptCHFrame`,`MediaRouter`,`OptimizationHints`,`ProcessPerSiteUpToMainFrameThreshold`,`IsolateSandboxedIframes`].join(`,`)}`,...t?[]:[`--headless=new`,`--hide-scrollbars`,`--mute-audio`],`--disable-extensions`,`about:blank`,`--remote-debugging-port=0`,`--user-data-dir=${d}`],p=pU({executablePath:u,args:process.env.CI?[...f,`--no-sandbox`]:f,handleSIGTERM:!1,dumpio:!1,pipe:!1,onExit:async()=>{try{await wo(d)}catch(e){n.debug(`Unable to remove Chrome user data directory: ${e}`)}}}),m=await p.waitForLineOutput(mU,300*1e3);return await fW(m,n),{sessionId:o,browserProcess:p,startTime:Date.now(),wsEndpoint:m}}var uW=/The browser folder \((.+?)\) exists but the executable .+? is missing/;async function dW(e,t){try{return await qU(e)}catch(n){let r=n?.message?.match(uW);if(!r)throw n;let i=r[1];t.warn(`Detected corrupted Chrome cache at ${i}; clearing and retrying install.`);try{await wo(i)}catch(e){throw Error(`Failed to clear corrupted Chrome cache at ${i} after detecting "${n.message}". Manual cleanup may be required.`,{cause:e})}try{return await qU(e)}catch(e){throw Error(`Chrome install failed after clearing corrupted cache at ${i}: ${e.message}`,{cause:e})}}}async function fW(e,t){let n=5e3,r=`${new URL(e.replace(`ws://`,`http://`)).origin}/json/version`,i=Date.now()+n,a=0,o;for(;Date.now()<i;){try{let e=await fetch(r,{signal:AbortSignal.timeout(500)});if(await e.arrayBuffer(),e.ok){a>0&&t.debug(`Chrome ready after ${a+1} attempt(s)`);return}o=Error(`Chrome readiness probe got status ${e.status}`)}catch(e){o=e}let e=Math.min(250,25*2**a);await new Promise(t=>setTimeout(t,e)),a++}throw Error(`Chrome readiness probe at ${r} timed out after ${n}ms`,{cause:o})}var pW=m(e(`node:assert`)),mW=m(e(`node:fs/promises`)),hW=m(e(`fs`)),gW=m(e(`path`)),_W=m(e(`url`)),vW;function yW(){if(vW!==void 0)return vW;let e=gW.default.join(__dirname,`workers`,`d1/database.worker.js`);return vW=hW.default.readFileSync(e,`utf8`)+`//# sourceURL=`+_W.default.pathToFileURL(e),vW}var bW=W.object({d1Databases:W.union([W.record(W.union([W.string(),W.object({id:W.string(),remoteProxyConnectionString:W.custom().optional()})])),W.string().array()]).optional()}),xW=W.object({d1Persist:aw}),SW=`d1`,CW=`${SW}:storage`,wW=`${SW}:db`,TW=`D1DatabaseObject`,EW={serviceName:wW,className:TW},DW={options:bW,sharedOptions:xW,bindingTypeDescription:`D1 database`,getBindings(e){return cw(e.d1Databases).map(([e,{id:t,remoteProxyConnectionString:n}])=>{(0,pW.default)(!(e.startsWith(`__D1_BETA__`)&&n),`Alpha D1 Databases cannot run remotely`);let r=mw(wW,t,n);return{name:e,...e.startsWith(`__D1_BETA__`)?{service:{name:r}}:{wrapped:{moduleName:`cloudflare-internal:d1-api`,innerBindings:[{name:`fetcher`,service:{name:r}}]}}}})},getNodeBindings(e){let t=sw(e.d1Databases);return Object.fromEntries(t.map(e=>[e,new Y]))},async getServices({options:e,sharedOptions:t,tmpPath:n,defaultPersistRoot:r,log:i,unsafeStickyBlobs:a}){let o=t.d1Persist,s=cw(e.d1Databases),c=s.map(([e,{id:t,remoteProxyConnectionString:n}])=>({name:mw(wW,t,n),worker:n?QC(n,e):ZC(EW,t)}));if(s.length>0){let e=`miniflare-${TW}`,t=uw(SW,n,r,o);await mW.default.mkdir(t,{recursive:!0});let l={name:CW,disk:{path:t,writable:!0}},u={name:wW,worker:{compatibilityDate:`2023-07-24`,compatibilityFlags:[`nodejs_compat`,`experimental`],modules:[{name:`database.worker.js`,esModule:yW()}],durableObjectNamespaces:[{className:TW,uniqueKey:e}],durableObjectStorage:{localDisk:CW},bindings:[{name:ex.MAYBE_SERVICE_BLOBS,service:{name:CW}},{name:ex.MAYBE_SERVICE_LOOPBACK,service:{name:HC}},...YC(a)]}};c.push(l,u);for(let n of s)await fw(i,e,t,n[1].id)}return c},getPersistPath({d1Persist:e},t){return uw(SW,t,void 0,e)}},OW=m(e(`fs`)),kW=m(e(`path`)),AW=m(e(`url`)),jW;function MW(){if(jW!==void 0)return jW;let e=kW.default.join(__dirname,`workers`,`dispatch-namespace/dispatch-namespace.worker.js`);return jW=OW.default.readFileSync(e,`utf8`)+`//# sourceURL=`+AW.default.pathToFileURL(e),jW}var NW=m(e(`fs`)),PW=m(e(`path`)),FW=m(e(`url`)),IW;function LW(){if(IW!==void 0)return IW;let e=PW.default.join(__dirname,`workers`,`dispatch-namespace/dispatch-namespace-proxy.worker.js`);return IW=NW.default.readFileSync(e,`utf8`)+`//# sourceURL=`+FW.default.pathToFileURL(e),IW}var RW=W.object({dispatchNamespaces:W.record(W.object({namespace:W.string(),remoteProxyConnectionString:W.custom().optional()})).optional()}),zW=`dispatch-namespace`;function BW(e,t){return mw(`${zW}-proxy`,e,t)}var VW={options:RW,bindingTypeDescription:`Dispatch namespace`,async getBindings(e){return e.dispatchNamespaces?Object.entries(e.dispatchNamespaces).map(([e,t])=>({name:e,wrapped:{moduleName:`${zW}:local-dispatch-namespace`,innerBindings:[{name:`proxyClient`,service:{name:BW(e,t.remoteProxyConnectionString)}}]}})):[]},getNodeBindings(e){return e.dispatchNamespaces?Object.fromEntries(Object.keys(e.dispatchNamespaces).map(e=>[e,new Y])):{}},async getServices({options:e}){return e.dispatchNamespaces?Object.entries(e.dispatchNamespaces).map(([e,t])=>({name:BW(e,t.remoteProxyConnectionString),worker:QC(t.remoteProxyConnectionString,e,LW)})):[]},getExtensions({options:e}){return e.some(e=>e.dispatchNamespaces)?[{modules:[{name:`${zW}:local-dispatch-namespace`,esModule:MW(),internal:!0}]}]:[]}},HW=e(`node:fs/promises`),UW=m(e(`node:path`)),WW=m(e(`fs`)),GW=m(e(`path`)),KW=m(e(`url`)),qW;function JW(){if(qW!==void 0)return qW;let e=GW.default.join(__dirname,`workers`,`email/email.worker.js`);return qW=WW.default.readFileSync(e,`utf8`)+`//# sourceURL=`+KW.default.pathToFileURL(e),qW}var YW=m(e(`fs`)),XW=m(e(`path`)),ZW=m(e(`url`)),QW;function $W(){if(QW!==void 0)return QW;let e=XW.default.join(__dirname,`workers`,`email/send_email.worker.js`);return QW=YW.default.readFileSync(e,`utf8`)+`//# sourceURL=`+ZW.default.pathToFileURL(e),QW}var eG=W.object({name:W.string(),remoteProxyConnectionString:W.custom().optional(),allowed_sender_addresses:W.array(W.string()).optional()}).and(W.union([W.object({destination_address:W.string().optional(),allowed_destination_addresses:W.never().optional()}),W.object({allowed_destination_addresses:W.array(W.string()).optional(),destination_address:W.never().optional()})])),tG=W.object({email:W.object({send_email:W.array(eG).optional()}).optional()}),nG=`email`,rG=`SEND-EMAIL-WORKER`,iG=`${nG}:disk`,aG=`MINIFLARE_EMAIL_DISK`;function oG(e){return Object.entries(e).map(([e,t])=>({name:e,json:JSON.stringify(t)}))}var sG={options:tG,bindingTypeDescription:`Email`,getBindings(e){return e.email?.send_email?e.email.send_email.map(({name:e,remoteProxyConnectionString:t})=>({name:e,service:{entrypoint:t?void 0:`SendEmailBinding`,name:mw(rG,e)}})):[]},getNodeBindings(e){return e.email?.send_email?Object.fromEntries(e.email.send_email.map(({name:e})=>[e,new Y])):{}},async getServices(e){if(!e.options.email?.send_email)return[];let t=UW.default.join(e.tmpPath,nG);await(0,HW.mkdir)(t,{recursive:!0});let n=[{name:iG,disk:{path:t,writable:!0}}];for(let{name:r,remoteProxyConnectionString:i,...a}of e.options.email?.send_email??[])n.push({name:mw(rG,r),worker:i?QC(i,r):{compatibilityDate:`2025-03-17`,modules:[{name:`send_email.mjs`,esModule:$W()}],bindings:[...oG(a),{name:aG,service:{name:iG}},{name:`email_directory`,json:JSON.stringify(t)}]}});return n},getExtensions(){return[{modules:[{name:`cloudflare-internal:email`,esModule:JW(),internal:!0}]}]}},cG=W.object({app_id:W.string(),remoteProxyConnectionString:W.custom().optional()}),lG=W.object({flagship:W.record(cG).optional()}),uG=`flagship`,dG={options:lG,bindingTypeDescription:`Flagship`,async getBindings(e){return e.flagship?Object.entries(e.flagship).map(([e,t])=>({name:e,service:{name:mw(uG,e,t.remoteProxyConnectionString)}})):[]},getNodeBindings(e){return e.flagship?Object.fromEntries(Object.keys(e.flagship).map(e=>[e,new Y])):{}},async getServices({options:e}){return e.flagship?Object.entries(e.flagship).map(([e,{remoteProxyConnectionString:t}])=>({name:mw(uG,e,t),worker:QC(t,e)})):[]}},fG=m(e(`node:fs/promises`)),pG=m(e(`fs`)),mG=m(e(`path`)),hG=m(e(`url`)),gG;function _G(){if(gG!==void 0)return gG;let e=mG.default.join(__dirname,`workers`,`hello-world/binding.worker.js`);return gG=pG.default.readFileSync(e,`utf8`)+`//# sourceURL=`+hG.default.pathToFileURL(e),gG}var vG=m(e(`fs`)),yG=m(e(`path`)),bG=m(e(`url`)),xG;function SG(){if(xG!==void 0)return xG;let e=yG.default.join(__dirname,`workers`,`hello-world/object.worker.js`);return xG=vG.default.readFileSync(e,`utf8`)+`//# sourceURL=`+bG.default.pathToFileURL(e),xG}var CG=`hello-world`,wG=W.object({helloWorld:W.record(W.object({enable_timer:W.boolean().optional()})).optional()}),TG=W.object({helloWorldPersist:aw}),EG={options:wG,sharedOptions:TG,bindingTypeDescription:`Hello World`,async getBindings(e){return e.helloWorld?Object.entries(e.helloWorld).map(([e,t])=>({name:e,service:{name:`${CG}:${JSON.stringify(t.enable_timer??!1)}`,entrypoint:`HelloWorldBinding`}})):[]},getNodeBindings(e){return e.helloWorld?Object.fromEntries(Object.keys(e.helloWorld).map(e=>[e,new Y])):{}},async getServices({options:e,sharedOptions:t,tmpPath:n,defaultPersistRoot:r,unsafeStickyBlobs:i}){let a=e.helloWorld?Object.values(e.helloWorld):[];if(a.length===0)return[];let o=uw(CG,n,r,t.helloWorldPersist);await fG.default.mkdir(o,{recursive:!0});let s={name:`${CG}:storage`,disk:{path:o,writable:!0}},c={name:`${CG}:object`,worker:{compatibilityDate:`2025-01-01`,modules:[{name:`object.worker.js`,esModule:SG()}],durableObjectNamespaces:[{className:`HelloWorldObject`,uniqueKey:`miniflare-hello-world-HelloWorldObject`}],durableObjectStorage:{localDisk:s.name},bindings:[{name:ex.MAYBE_SERVICE_BLOBS,service:{name:s.name}},{name:ex.MAYBE_SERVICE_LOOPBACK,service:{name:HC}},...YC(i)]}};return[...a.map(e=>({name:`${CG}:${JSON.stringify(e.enable_timer??!1)}`,worker:{compatibilityDate:`2025-01-01`,modules:[{name:`binding.worker.js`,esModule:_G()}],bindings:[{name:`config`,json:JSON.stringify(e)},{name:`store`,durableObjectNamespace:{className:`HelloWorldObject`,serviceName:c.name}}]}})),s,c]},getPersistPath(e,t){return uw(CG,t,void 0,e.helloWorldPersist)}},DG=m(e(`node:assert`)),OG=`hyperdrive`;function kG(e){return e.protocol===`postgresql:`||e.protocol===`postgres:`}function AG(e){return e.protocol===`mysql:`}function jG(e){if(e.port!==``)return e.port;if(kG(e))return`5432`;if(AG(e))return`3306`;DG.default.fail(`Expected known protocol, got ${e.protocol}`)}var MG=W.union([W.string().url(),W.instanceof(URL)]).transform((e,t)=>(typeof e==`string`&&(e=new URL(e)),e.protocol===``?t.addIssue({code:W.ZodIssueCode.custom,message:`You must specify the database protocol - e.g. 'postgresql'/'mysql'.`}):!kG(e)&&!AG(e)&&t.addIssue({code:W.ZodIssueCode.custom,message:`Only PostgreSQL-compatible or MySQL-compatible databases are currently supported.`}),e.host===``&&t.addIssue({code:W.ZodIssueCode.custom,message:`You must provide a hostname or IP address in your connection string - e.g. 'user:password@database-hostname.example.com:5432/databasename`}),e.pathname===``&&t.addIssue({code:W.ZodIssueCode.custom,message:`You must provide a database name as the path component - e.g. /postgres`}),e.username===``&&t.addIssue({code:W.ZodIssueCode.custom,message:`You must provide a username - e.g. 'user:password@database.example.com:port/databasename'`}),e.password===``&&t.addIssue({code:W.ZodIssueCode.custom,message:`You must provide a password - e.g. 'user:password@database.example.com:port/databasename' `}),e)),NG=W.object({hyperdrives:W.record(W.string(),MG).optional()}),PG={options:NG,bindingTypeDescription:`Hyperdrive`,getBindings(e){return Object.entries(e.hyperdrives??{}).map(([e,t])=>{let n=t.pathname.replace(`/`,``),r=t.protocol.replace(`:`,``);return{name:e,hyperdrive:{designator:{name:`${OG}:${e}`},database:decodeURIComponent(n),user:decodeURIComponent(t.username),password:decodeURIComponent(t.password),scheme:r}}})},getNodeBindings(e){return Object.fromEntries(Object.entries(e.hyperdrives??{}).map(([e,t])=>{let n={connectionString:`${t}`,port:Number.parseInt(t.port),host:t.hostname};return[e,new Y({get(e,t){return t in n?n[t]:e[t]}})]}))},async getServices({options:e,hyperdriveProxyController:t}){let n=[];for(let[r,i]of Object.entries(e.hyperdrives??{})){let e=i.protocol.replace(`:`,``),a=FG(i,e),o=jG(i),s;s=a===`disable`?`${i.hostname}:${o}`:`127.0.0.1:${await t.createProxyServer({name:r,targetHost:i.hostname,targetPort:o,scheme:e,sslmode:a,sslrootcert:IG(i)})}`,n.push({name:`${OG}:${r}`,external:{address:s,tcp:{}}})}return n}};function FG(e,t){let n=Object.fromEntries(Array.from(e.searchParams.entries()).map(([e,t])=>[e.toLowerCase(),t.toLowerCase()]));if(t===`postgres`||t===`postgresql`)return n.sslmode||`disable`;if(t===`mysql`)switch(n[`ssl-mode`]||n.ssl||n.sslmode){case`verify_identity`:return`verify-full`;case`verify_ca`:return`verify-ca`;case`required`:case`true`:case`1`:return`require`;case`preferred`:return`prefer`;case`disabled`:case`false`:case`0`:return`disable`}return`disable`}function IG(e){return Object.fromEntries(Array.from(e.searchParams.entries()).map(([e,t])=>[e.toLowerCase(),t])).sslrootcert||void 0}var LG=`media`,RG=W.object({binding:W.string(),remoteProxyConnectionString:W.custom().optional()}),zG=W.object({media:RG.optional()}),BG={options:zG,bindingTypeDescription:`Media`,async getBindings(e){return e.media?[{name:e.media.binding,service:{name:mw(LG,e.media.binding,e.media.remoteProxyConnectionString)}}]:[]},getNodeBindings(e){return e.media?{[e.media.binding]:new Y}:{}},async getServices({options:e}){return e.media?[{name:mw(LG,e.media.binding,e.media.remoteProxyConnectionString),worker:QC(e.media.remoteProxyConnectionString,e.media.binding)}]:[]}},VG=W.object({certificate_id:W.string(),remoteProxyConnectionString:W.custom().optional()}),HG=W.object({mtlsCertificates:W.record(VG).optional()}),UG=`mtls`,WG={options:HG,bindingTypeDescription:`mTLS certificate`,async getBindings(e){return e.mtlsCertificates?Object.entries(e.mtlsCertificates).map(([e,{certificate_id:t,remoteProxyConnectionString:n}])=>({name:e,service:{name:mw(UG,t,n)}})):[]},getNodeBindings(e){return e.mtlsCertificates?Object.fromEntries(Object.keys(e.mtlsCertificates).map(e=>[e,new Y])):{}},async getServices({options:e}){return e.mtlsCertificates?Object.entries(e.mtlsCertificates).map(([e,{certificate_id:t,remoteProxyConnectionString:n}])=>({name:mw(UG,t,n),worker:QC(n,e)})):[]}},GG=m(e(`fs`)),KG=m(e(`path`)),qG=m(e(`url`)),JG;function YG(){if(JG!==void 0)return JG;let e=KG.default.join(__dirname,`workers`,`pipelines/pipeline.worker.js`);return JG=GG.default.readFileSync(e,`utf8`)+`//# sourceURL=`+qG.default.pathToFileURL(e),JG}var XG=W.object({pipelines:W.union([W.record(W.union([W.string(),W.object({stream:W.string(),remoteProxyConnectionString:W.custom().optional()}),W.object({pipeline:W.string(),remoteProxyConnectionString:W.custom().optional()})])),W.string().array()]).optional()}),ZG=`pipelines`,QG=`${ZG}:pipeline`,$G={options:XG,bindingTypeDescription:`Pipeline`,getBindings(e){return eK(e.pipelines).map(([e,{id:t}])=>({name:e,service:{name:`${QG}:${t}`}}))},getNodeBindings(e){let t=sw(e.pipelines);return Object.fromEntries(t.map(e=>[e,new Y]))},async getServices({options:e}){let t=eK(e.pipelines),n=[];for(let[e,r]of t)n.push({name:`${QG}:${r.id}`,worker:r.remoteProxyConnectionString?QC(r.remoteProxyConnectionString,e):{compatibilityDate:`2024-12-30`,modules:[{name:`pipeline.worker.js`,esModule:YG()}]}});return n}};function eK(e){return Array.isArray(e)?e.map(e=>[e,{id:e}]):e===void 0?[]:Object.entries(e).map(([e,t])=>[e,typeof t==`string`?{id:t}:{id:t.stream??t.pipeline??``,remoteProxyConnectionString:t.remoteProxyConnectionString}])}var tK=m(e(`fs`)),nK=m(e(`path`)),rK=m(e(`url`)),iK;function aK(){if(iK!==void 0)return iK;let e=nK.default.join(__dirname,`workers`,`queues/broker.worker.js`);return iK=tK.default.readFileSync(e,`utf8`)+`//# sourceURL=`+rK.default.pathToFileURL(e),iK}var oK=class extends _S{},sK=W.object({queueProducers:W.union([W.record(Yx.merge(W.object({remoteProxyConnectionString:W.custom().optional()}))),W.string().array(),W.record(W.string())]).optional(),queueConsumers:W.union([W.record(Qx),W.string().array()]).optional()}),cK=`queues`,lK=`QueueBrokerObject`,uK={serviceName:Hx,className:lK},dK={options:sK,bindingTypeDescription:`Queue producer`,getBindings(e){return fK(e.queueProducers).map(([e,t])=>({name:e,queue:{name:Ux(t)}}))},getNodeBindings(e){let t=sw(e.queueProducers);return Object.fromEntries(t.map(e=>[e,new Y]))},async getServices({options:e,workerNames:t,queueProducers:n,queueConsumers:r,devRegistryEnabled:i,unsafeStickyBlobs:a}){let o=fK(e.queueProducers).map(([,e])=>e),s=sw(e.queueConsumers),c=new Set([...o,...s]);if(c.size===0)return[];let l=Array.from(c).map(e=>({name:Ux(e),worker:ZC(uK,e)})),u=`miniflare-${lK}`,d={name:Hx,worker:{compatibilityDate:`2023-07-24`,compatibilityFlags:[`nodejs_compat`,`experimental`,`service_binding_extra_handlers`],modules:[{name:`broker.worker.js`,esModule:aK()}],durableObjectNamespaces:[{className:lK,uniqueKey:u,preventEviction:!0}],durableObjectStorage:{inMemory:SM},bindings:[{name:ex.MAYBE_SERVICE_LOOPBACK,service:{name:HC}},...YC(a),{name:ex.DURABLE_OBJECT_NAMESPACE_OBJECT,durableObjectNamespace:{className:lK}},{name:Bx.MAYBE_JSON_QUEUE_PRODUCERS,json:JSON.stringify(Object.fromEntries(n))},{name:Bx.MAYBE_JSON_QUEUE_CONSUMERS,json:JSON.stringify(Object.fromEntries(r))},...t.map(e=>({name:Bx.SERVICE_WORKER_PREFIX+e,service:{name:sF(e)}})),...i?[{name:Bx.MAYBE_SERVICE_QUEUE_PROXY,service:{name:sF(UC),entrypoint:`ExternalQueueProxy`}}]:[]]}};return l.push(d),l}};function fK(e){return Array.isArray(e)?e.map(e=>[e,e]):e===void 0?[]:Object.entries(e).map(([e,t])=>[e,typeof t==`string`?t:t.queueName])}var pK=m(e(`fs`)),mK=m(e(`path`)),hK=m(e(`url`)),gK;function _K(){if(gK!==void 0)return gK;let e=mK.default.join(__dirname,`workers`,`ratelimit/ratelimit.worker.js`);return gK=pK.default.readFileSync(e,`utf8`)+`//# sourceURL=`+hK.default.pathToFileURL(e),gK}var vK=m(e(`fs`)),yK=m(e(`path`)),bK=m(e(`url`)),xK;function SK(){if(xK!==void 0)return xK;let e=yK.default.join(__dirname,`workers`,`ratelimit/ratelimit-object.worker.js`);return xK=vK.default.readFileSync(e,`utf8`)+`//# sourceURL=`+bK.default.pathToFileURL(e),xK}var CK=(e=>(e[e.TENSECONDS=10]=`TENSECONDS`,e[e.MINUTE=60]=`MINUTE`,e))(CK||{}),wK=W.object({namespace_id:W.string(),simple:W.object({limit:W.number().gt(0),period:W.nativeEnum(CK).optional().default(60)})}),TK=W.object({ratelimits:W.record(wK).optional()}),EK=`ratelimit`,DK=`cloudflare-internal:${`${EK}`}:module`,OK=`${EK}:ns`,kK=`RateLimiterObject`,AK={serviceName:OK,className:kK};function jK(e){return Object.entries(e).map(([e,t])=>({name:e,json:JSON.stringify(t)}))}var MK={options:TK,bindingTypeDescription:`Rate Limit`,getBindings(e){return e.ratelimits?Object.entries(e.ratelimits).map(([e,t])=>({name:e,wrapped:{moduleName:DK,innerBindings:[{name:`fetcher`,service:{name:mw(OK,t.namespace_id)}},...jK({limit:t.simple.limit,period:t.simple.period})]}})):[]},getNodeBindings(e){return e.ratelimits?Object.fromEntries(Object.keys(e.ratelimits).map(e=>[e,new Y])):{}},async getServices({options:e,unsafeStickyBlobs:t}){if(!e.ratelimits)return[];let n=[],r=new Set;for(let{namespace_id:t}of Object.values(e.ratelimits))r.has(t)||(r.add(t),n.push({name:mw(OK,t),worker:ZC(AK,t)}));let i=`miniflare-${kK}`;return n.push({name:OK,worker:{compatibilityDate:`2023-07-24`,compatibilityFlags:[`nodejs_compat`,`experimental`],modules:[{name:`ratelimit-object.worker.js`,esModule:SK()}],durableObjectNamespaces:[{className:kK,uniqueKey:i}],durableObjectStorage:{inMemory:SM},bindings:[{name:ex.MAYBE_SERVICE_LOOPBACK,service:{name:HC}},...YC(t)]}}),n},getExtensions({options:e}){return e.some(e=>e.ratelimits)?[{modules:[{name:DK,esModule:_K(),internal:!0}]}]:[]}},NK=m(e(`node:fs/promises`)),PK=m(e(`fs`)),FK=m(e(`path`)),IK=m(e(`url`)),LK;function RK(){if(LK!==void 0)return LK;let e=FK.default.join(__dirname,`workers`,`secrets-store/secret.worker.js`);return LK=PK.default.readFileSync(e,`utf8`)+`//# sourceURL=`+IK.default.pathToFileURL(e),LK}var zK=W.record(W.object({store_id:W.string(),secret_name:W.string()})),BK=W.object({secretsStoreSecrets:zK.optional()}),VK=W.object({secretsStorePersist:aw}),HK=`secrets-store`,UK={options:BK,sharedOptions:VK,bindingTypeDescription:`Secrets Store secret`,async getBindings(e){return e.secretsStoreSecrets?Object.entries(e.secretsStoreSecrets).map(([e,t])=>({name:e,service:{name:mw(HK,`${t.store_id}:${t.secret_name}`),entrypoint:`SecretsStoreSecret`}})):[]},getNodeBindings(e){return e.secretsStoreSecrets?Object.fromEntries(Object.keys(e.secretsStoreSecrets).map(e=>[e,new Y])):{}},async getServices({options:e,sharedOptions:t,tmpPath:n,defaultPersistRoot:r,unsafeStickyBlobs:i}){let a=e.secretsStoreSecrets?Object.values(e.secretsStoreSecrets):[];if(a.length===0)return[];let o=uw(HK,n,r,t.secretsStorePersist);await NK.default.mkdir(o,{recursive:!0});let s={name:`${HK}:storage`,disk:{path:o,writable:!0}},c={name:`${HK}:ns`,worker:{compatibilityDate:`2023-07-24`,compatibilityFlags:[`nodejs_compat`,`experimental`],modules:[{name:`namespace.worker.js`,esModule:PN()}],durableObjectNamespaces:[{className:rP,uniqueKey:`miniflare-secrets-store-${rP}`}],durableObjectStorage:{localDisk:s.name},bindings:[{name:ex.MAYBE_SERVICE_BLOBS,service:{name:s.name}},{name:ex.MAYBE_SERVICE_LOOPBACK,service:{name:HC}},...YC(i)]}};return[...a.flatMap(e=>{let t={name:`${HK}:ns:${e.store_id}`,worker:ZC({serviceName:c.name,className:rP},e.store_id)};return[t,{name:mw(HK,`${e.store_id}:${e.secret_name}`),worker:{compatibilityDate:`2025-01-01`,modules:[{name:`secret.worker.js`,esModule:RK()}],bindings:[{name:`store`,kvNamespace:{name:t.name}},{name:`secret_name`,json:JSON.stringify(e.secret_name)}]}}]}),s,c]},getPersistPath({secretsStorePersist:e},t){return uw(HK,t,void 0,e)}},WK=W.object({index_name:W.string(),remoteProxyConnectionString:W.custom().optional()}),GK=W.object({vectorize:W.record(WK).optional()}),KK=`vectorize`,qK={options:GK,bindingTypeDescription:`Vectorize index`,async getBindings(e){return e.vectorize?Object.entries(e.vectorize).map(([e,{index_name:t,remoteProxyConnectionString:n}])=>({name:e,wrapped:{moduleName:`cloudflare-internal:vectorize-api`,innerBindings:[{name:`fetcher`,service:{name:mw(KK,e,n)}},{name:`indexId`,text:t},{name:`indexVersion`,text:`v2`},{name:`useNdJson`,json:!0}]}})):[]},getNodeBindings(e){return e.vectorize?Object.fromEntries(Object.keys(e.vectorize).map(e=>[e,new Y])):{}},async getServices({options:e}){return e.vectorize?Object.entries(e.vectorize).map(([e,{remoteProxyConnectionString:t}])=>({name:mw(KK,e,t),worker:QC(t,e)})):[]}},JK=e(`node:crypto`),YK=`version-metadata`,XK=W.object({versionMetadata:W.string().optional()}),ZK={options:XK,async getBindings(e){if(!e.versionMetadata)return[];let t=(0,JK.randomUUID)(),n=new Date().toISOString();return[{name:e.versionMetadata,json:JSON.stringify({id:t,tag:``,timestamp:n})}]},getNodeBindings(e){if(!e.versionMetadata)return{};let t=(0,JK.randomUUID)(),n=new Date().toISOString();return{[e.versionMetadata]:{id:t,tag:``,timestamp:n}}},async getServices(){return[]}},QK=W.union([W.object({tunnel_id:W.string(),remoteProxyConnectionString:W.custom().optional()}),W.object({network_id:W.string(),remoteProxyConnectionString:W.custom().optional()})]),$K=W.object({vpcNetworks:W.record(QK).optional()}),eq=`vpc-networks`,tq={options:$K,bindingTypeDescription:`VPC network`,async getBindings(e){return e.vpcNetworks?Object.entries(e.vpcNetworks).map(([e,t])=>({name:e,service:{name:mw(eq,`tunnel_id`in t?t.tunnel_id:t.network_id,t.remoteProxyConnectionString)}})):[]},getNodeBindings(e){return e.vpcNetworks?Object.fromEntries(Object.keys(e.vpcNetworks).map(e=>[e,new Y])):{}},async getServices({options:e}){return e.vpcNetworks?Object.entries(e.vpcNetworks).map(([e,t])=>({name:mw(eq,`tunnel_id`in t?t.tunnel_id:t.network_id,t.remoteProxyConnectionString),worker:QC(t.remoteProxyConnectionString,e)})):[]}},nq=W.object({service_id:W.string(),remoteProxyConnectionString:W.custom().optional()}),rq=W.object({vpcServices:W.record(nq).optional()}),iq=`vpc-services`,aq={options:rq,bindingTypeDescription:`VPC service`,async getBindings(e){return e.vpcServices?Object.entries(e.vpcServices).map(([e,{service_id:t,remoteProxyConnectionString:n}])=>({name:e,service:{name:mw(iq,t,n)}})):[]},getNodeBindings(e){return e.vpcServices?Object.fromEntries(Object.keys(e.vpcServices).map(e=>[e,new Y])):{}},async getServices({options:e}){return e.vpcServices?Object.entries(e.vpcServices).map(([e,{service_id:t,remoteProxyConnectionString:n}])=>({name:mw(iq,t,n),worker:QC(n,e)})):[]}},oq=W.object({remoteProxyConnectionString:W.custom().optional()}),sq=W.object({websearch:W.record(oq).optional()}),cq=`websearch`,lq=`websearch`,uq={options:sq,bindingTypeDescription:`Web Search`,async getBindings(e){let t=[];for(let[n,r]of Object.entries(e.websearch??{}))t.push({name:n,service:{name:mw(lq,n,r.remoteProxyConnectionString)}});return t},getNodeBindings(e){let t={};for(let n of Object.keys(e.websearch??{}))t[n]=new Y;return t},async getServices({options:e}){let t=[];for(let[n,r]of Object.entries(e.websearch??{}))t.push({name:mw(lq,n,r.remoteProxyConnectionString),worker:QC(r.remoteProxyConnectionString,n)});return t}},dq=W.object({}),fq=W.object({workerLoaders:W.record(dq).optional()}),pq=`worker-loader`,mq={options:fq,getBindings(e){return e.workerLoaders?Object.entries(e.workerLoaders).map(([e])=>({name:e,workerLoader:{}})):[]},getNodeBindings(){return{}},async getServices(){return[]}},hq=m(e(`node:fs/promises`)),gq=m(e(`fs`)),_q=m(e(`path`)),vq=m(e(`url`)),yq;function bq(){if(yq!==void 0)return yq;let e=_q.default.join(__dirname,`workers`,`workflows/binding.worker.js`);return yq=gq.default.readFileSync(e,`utf8`)+`//# sourceURL=`+vq.default.pathToFileURL(e),yq}var xq=m(e(`fs`)),Sq=m(e(`path`)),Cq=m(e(`url`)),wq;function Tq(){if(wq!==void 0)return wq;let e=Sq.default.join(__dirname,`workers`,`workflows/wrapped-binding.worker.js`);return wq=xq.default.readFileSync(e,`utf8`)+`//# sourceURL=`+Cq.default.pathToFileURL(e),wq}var Eq=W.object({workflows:W.record(W.object({name:W.string(),className:W.string(),scriptName:W.string().optional(),external:W.boolean().optional(),remoteProxyConnectionString:W.custom().optional(),stepLimit:W.number().int().min(1).optional(),compatibilityFlags:W.string().array().optional()})).optional()}),Dq=W.object({workflowsPersist:aw}),Oq=`workflows`,kq=`${Oq}:storage`,Aq={options:Eq,sharedOptions:Dq,bindingTypeDescription:`Workflow`,async getBindings(e){return Object.entries(e.workflows??{}).map(([e,t])=>({name:e,wrapped:{moduleName:`${Oq}:local-wrapped-binding`,innerBindings:[{name:`binding`,service:{name:mw(Oq,t.name,t.remoteProxyConnectionString),entrypoint:`WorkflowBinding`}}]}}))},async getNodeBindings(e){return Object.fromEntries(Object.keys(e.workflows??{}).map(e=>[e,new Y]))},getExtensions(){return[{modules:[{name:`${Oq}:local-wrapped-binding`,esModule:Tq(),internal:!0}]}]},async getServices({options:e,sharedOptions:t,tmpPath:n,defaultPersistRoot:r}){let i=uw(Oq,n,r,t.workflowsPersist);await hq.default.mkdir(i,{recursive:!0});let a=Object.entries(e.workflows??{}).map(([e,t])=>({name:`${kq}-${t.name}`,disk:{path:i,writable:!0}})),o=Object.entries(e.workflows??{}).map(([e,t])=>{let n=`miniflare-workflows-${t.name}`;return{name:mw(Oq,t.name,t.remoteProxyConnectionString),worker:{compatibilityDate:`2024-10-22`,compatibilityFlags:Array.from(new Set([`experimental`,...t.compatibilityFlags??[]])),modules:[{name:`workflows.mjs`,esModule:bq()}],durableObjectNamespaces:[{className:`Engine`,enableSql:!0,uniqueKey:n,preventEviction:!0}],durableObjectStorage:{localDisk:`${kq}-${t.name}`},bindings:[{name:`ENGINE`,durableObjectNamespace:{className:`Engine`}},t.external&&t.scriptName?{name:`USER_WORKFLOW`,service:{name:sF(UC),entrypoint:`ExternalServiceProxy`,props:{json:JSON.stringify({service:t.scriptName,entrypoint:t.className})}}}:{name:`USER_WORKFLOW`,service:{name:sF(t.scriptName),entrypoint:t.className}},{name:`BINDING_NAME`,json:JSON.stringify(e)},{name:`WORKFLOW_NAME`,json:JSON.stringify(t.name)},...t.stepLimit===void 0?[]:[{name:`STEP_LIMIT`,json:JSON.stringify(t.stepLimit)}]]}}});return o.length===0?[]:[...a,...o]},getPersistPath({workflowsPersist:e},t){return uw(Oq,t,void 0,e)}},jq={[aB]:yB,[sN]:pN,[SW]:DW,[xN]:CN,[IN]:oP,[cK]:dK,[TP]:MP,[OG]:PG,[EK]:MK,[RM]:kB,[Oq]:Aq,[ZG]:$G,[HK]:UK,[nG]:sG,[Rw]:zw,[Sw]:Cw,[_w]:yw,[Ew]:kw,[cq]:uq,[sW]:cW,[zW]:VW,[uP]:dP,[qP]:QP,[KK]:qK,[eq]:tq,[iq]:aq,[UG]:WG,[CG]:EG,[uG]:dG,[Hw]:Uw,[pq]:mq,[LG]:BG,[YK]:ZK},Mq=Object.entries(jq),Nq=`126.0.6478.182`,Pq=m(e(`node:crypto`)),Fq=e(`node:http`),Iq=m(nu()),Lq=`4.20260708.1`,Rq=m(e(`node:assert`)),zq=m(nu());function Bq(e,t){return typeof e==`object`&&!!e&&`method`in e&&e.method===t}var Vq=class{#e;#t;#n;#r;#i=!1;constructor(e,t,n){this.#e=e,this.#t=t,this.#n=n,this.#n.once(`open`,()=>this.#c())}get workerName(){return this.#t}get path(){return`/${this.#t}`}onDevtoolsConnected(e,t){if(this.#r){e.close(1013,`Too many clients; only one can be connected at a time`);return}this.#r=e,this.#i=t,(0,Rq.default)(this.#r?.readyState===zq.default.OPEN),this.#r.on(`error`,e=>this.#e.error(e)),this.#r.once(`close`,()=>{this.#n?.OPEN&&this.#d({method:`Debugger.disable`,id:this.#o()}),this.#r=void 0}),this.#r.on(`message`,e=>{let t=JSON.parse(e.toString());(0,Rq.default)(this.#n?.OPEN),this.#d(t)})}#a=1e8;#o(){return++this.#a}#s;#c(){(0,Rq.default)(this.#n?.OPEN),this.#n.on(`message`,e=>{let t=JSON.parse(e.toString());if(this.#r)return Bq(t,`Debugger.scriptParsed`)?this.#l(t):this.#u(t)}),clearInterval(this.#s),this.#s=setInterval(()=>{this.#n?.OPEN&&this.#d({method:`Runtime.getIsolateId`,id:this.#o()})},1e4)}#l(e){if(!this.#i&&e.params.sourceMapURL!==void 0&&e.params.url.startsWith(`file:`)){let t=new URL(e.params.sourceMapURL,e.params.url);t.protocol===`file:`&&(e.params.sourceMapURL=t.href.replace(`file:`,`wrangler-file:`))}return this.#u(e)}#u(e){if((0,Rq.default)(this.#r),!this.#r.OPEN){this.#r.once(`open`,()=>this.#r?.send(JSON.stringify(e)));return}this.#r.send(JSON.stringify(e))}#d(e){(0,Rq.default)(this.#n?.OPEN),this.#n.send(JSON.stringify(e))}async dispose(){clearInterval(this.#s),this.#r?.close(),this.#n?.close()}},Hq=class{constructor(e,t=`127.0.0.1`,n,r){this.inspectorPortOption=e,this.inspectorHostOption=t,this.log=n,this.workerNamesToProxy=r,this.#n=this.#i()}inspectorPortOption;inspectorHostOption;log;workerNamesToProxy;#e=new yx;#t=[];#n;async#r(){let e=(await this.#n).address();if(e&&typeof e!=`string`)return e.port;throw Error(`Unable to acquire a port to listen on - address: "${e}"`)}async#i(){let e=(0,Fq.createServer)(async(e,t)=>{let n=await this.#f(e.headers.host??`localhost`,e.url??`/`);if(n!==null){t.setHeader(`Content-Type`,`application/json`),t.end(JSON.stringify(n));return}t.statusCode=404,t.end(null)});return this.#c(e),await this.#o(e),e}async#a(){let e=await this.#n;await this.#s(e),await this.#o(e)}async#o(e){return this.log.debug(`Trying to listen on ${this.inspectorHostOption}:${this.inspectorPortOption}`),new Promise((t,n)=>{e.once(`error`,n),e.listen(this.inspectorPortOption,this.inspectorHostOption,t)})}async#s(e){return e.closeAllConnections(),await new Promise(t=>{e.close(e=>{e&&this.log.error(e),t()})})}#c(e){new Iq.WebSocketServer({server:e}).on(`connection`,(e,t)=>{if(this.#l(t)!==null){e.close();return}let n=this.#t.find(({path:e})=>t.url===e);if(!n){this.log.warn(`Warning: An inspector connection was requested for the ${t.url} path but no such inspector exists`),e.close();return}n.onDevtoolsConnected(e,this.#u(t))})}#l(e){let t=e.headers.host;if(t==null)return{statusText:null,status:400};try{let e=new URL(`http://${t}`);if(![...Wq,this.inspectorHostOption].includes(e.hostname))return{statusText:"Disallowed `Host` header",status:401}}catch{return{statusText:"Expected `Host` header",status:400}}let n=e.headers.origin;if(!n&&!e.headers[`user-agent`]&&(n=`http://localhost`),!n)return{statusText:"Expected `Origin` header",status:400};try{let e=new URL(n);if(!Gq.some(t=>typeof t==`string`?e.hostname===t:t.test(e.hostname)))return{statusText:"Disallowed `Origin` header",status:401}}catch{return{statusText:"Expected `Origin` header",status:400}}return null}#u(e){let t=e.headers[`user-agent`]??``;return!/mozilla/i.test(t)}#d=Pq.default.randomUUID();async#f(e,t){return t===`/json/version`?{Browser:`miniflare/v${Lq}`,"Protocol-Version":`1.3`}:t===`/json`||t===`/json/list`?this.#t.map(({workerName:t})=>{let n=`${e}/${t}`,r=`https://devtools.devprod.cloudflare.dev/js_app?theme=systemPreferred&debugger=true&ws=${n}`;return{id:`${this.#d}-${t}`,type:`node`,description:`workers`,webSocketDebuggerUrl:`ws://${n}`,devtoolsFrontendUrl:r,devtoolsFrontendUrlCompat:r,title:t.length===0||this.#t.length===1?`Cloudflare Worker`:`Cloudflare Worker: ${t}`,faviconUrl:`https://workers.cloudflare.com/favicon.ico`}}):null}async getInspectorURL(){return Uq(this.inspectorHostOption,await this.#r())}async updateConnection(e,t,n,r){this.workerNamesToProxy=r,(this.inspectorPortOption!==e||this.inspectorHostOption!==t)&&(this.inspectorPortOption=e,this.inspectorHostOption=t,await this.#a());let i=await fetch(`http://127.0.0.1:${n}/json`).then(e=>e.json());await Promise.all(this.#t.map(e=>e.dispose())),this.#t=i.map(({id:e})=>{if(!e.startsWith(`core:user:`))return;let t=e.replace(/^core:user:/,``);if(this.workerNamesToProxy.has(t))return new Vq(this.log,t,new Iq.default(`ws://127.0.0.1:${n}/${e}`))}).filter(Boolean),this.#e.resolve()}async#p(){await this.#e}get ready(){return this.#p()}async dispose(){await Promise.all(this.#t.map(e=>e.dispose()));let e=await this.#n;return e.closeAllConnections(),new Promise((t,n)=>{e.close(e=>e?n(e):t())})}};function Uq(e,t){return new URL(`ws://${e}:${t}`)}var Wq=[`127.0.0.1`,`[::1]`,`localhost`],Gq=[`devtools.devprod.cloudflare.dev`,`cloudflare-devtools.devprod.workers.dev`,/^[a-z0-9]+-cloudflare-devtools\.devprod\.workers\.dev$/,`cloudflare-devtools.pages.dev`,/^[a-z0-9]+\.cloudflare-devtools\.pages\.dev$/,`127.0.0.1`,`[::1]`,`localhost`],Kq=m(e(`node:assert`));function qq(e){return!!(e.method===`GET`&&e.headers.has(`X-Resolve-Method`)||e.method===`POST`)}function Jq(e){(0,Kq.default)(typeof e==`object`&&!!e&&`specifier`in e)}async function Yq(e){if(e.method===`GET`&&e.headers.has(`X-Resolve-Method`)){let t=new URL(e.url),n=t.searchParams.get(`specifier`);return n?{protocol:`v1`,type:e.headers.get(`X-Resolve-Method`)===`require`?`require`:`import`,specifier:n,rawSpecifier:t.searchParams.get(`rawSpecifier`)??void 0,referrer:t.searchParams.get(`referrer`)??void 0}:null}if(e.method===`POST`)try{let t=await e.json();return Jq(t),{...t,protocol:`v2`}}catch{return null}return null}var Xq=m(e(`node:fs`)),Zq=m(e(`node:net`)),Qq=m(e(`node:tls`)),$q={postgresql:`postgresql`,postgres:`postgres`,mysql:`mysql`},eJ=Buffer.from([0,0,0,8,4,210,22,47]);function tJ(e,t,n){if(!e&&!t)return{rejectUnauthorized:!1};let r={rejectUnauthorized:!0};return n&&n!==`system`&&(r.ca=Xq.default.readFileSync(n)),t&&(r.checkServerIdentity=()=>void 0),r}function nJ(e,t,n,r){let i={socket:e,host:t,servername:Zq.default.isIP(t)===0?t:void 0,rejectUnauthorized:n.rejectUnauthorized,...r};return n.ca&&(i.ca=n.ca),n.checkServerIdentity&&(i.checkServerIdentity=n.checkServerIdentity),i}var rJ=class{#e=new Map;log;async createProxyServer(e){let{name:t,targetHost:n,targetPort:r,scheme:i,sslmode:a,sslrootcert:o}=e,s=Zq.default.createServer(e=>{this.#t(e,n,Number.parseInt(r),i,a,o)});s.on(`error`,e=>{this.log?.error(Error(`Hyperdrive proxy server error for binding "${t}": ${e.message}`))});let c=await new Promise((e,t)=>{s.once(`error`,t),s.listen(0,`127.0.0.1`,()=>{s.off(`error`,t);let n=s.address();n&&typeof n!=`string`?e(n.port):t(Error(`Invalid port`))})});return this.#e.set(t,s),c}async#t(e,t,n,r,i,a){let o=Zq.default.connect({host:t,port:n}),s=i===`require`,c=i===`prefer`,l=i===`verify-full`,u=i===`verify-ca`,d=l||u;if(c||s||d)try{let i=tJ(l,u,a);if(r===$q.postgres||r===$q.postgresql)return await iJ(o,e,t,n,s||d,i);if(r===$q.mysql)return await aJ(o,e,t,n,s||d,i)}catch(t){if(s||d){e.write(`${t}
813
- `),e.end(),o.destroy();return}}e.pipe(o),o.pipe(e)}dispose(){for(let e of this.#e.values())e.close();this.#e.clear()}};async function iJ(e,t,n,r,i,a){if(await cJ(e,eJ),(await lJ(e)).toString(`utf8`,0,1)===`S`){let r=nJ(e,n,a);try{sJ(t,await uJ(r));return}catch(e){if(i)throw e}}if(i)throw Error(`Server does not support SSL, but client requires SSL.`);e.destroy();let o=await oJ(n,r,t);t.pipe(o),o.pipe(t)}async function aJ(e,t,n,r,i,a){let o=await lJ(e),s=o[0]|o[1]<<8|o[2]<<16,c,l=o.length-4;if(l===s)c=Buffer.from(o.subarray(4));else if(l<s){let t=[o.subarray(4)],n=l;for(;n<s;){let r=await lJ(e);t.push(r),n+=r.length}c=Buffer.concat(t),n>s&&(c=c.subarray(0,s))}else throw Error(`Could not parse header properly.`);if(gJ(c)){await cJ(e,[32,0,0,1,0,10,0,0,0,0,0,0,33,...Array(23).fill(0)]);let r=nJ(e,n,a,{minVersion:`TLSv1.2`});try{let e=await uJ(r);await cJ(t,Buffer.concat([o.subarray(0,4),c]));let n=await lJ(t);n[3]++,await cJ(e,n);let i=await lJ(e);i[3]--,await cJ(t,i),sJ(t,e);return}catch(e){if(i)throw e}}if(i)throw Error(`Server SSL failed, but client requires SSL.`);e.destroy();let u=await oJ(n,r,t);t.pipe(u),u.pipe(t)}async function oJ(e,t,n){let r=Zq.default.connect({host:e,port:t});return await new Promise((e,t)=>{let n=()=>{r.off(`error`,i),e()},i=e=>{r.off(`data`,n),t(e)};r.once(`connect`,n),r.once(`error`,i)}),r.on(`error`,()=>{n.destroy()}),r}function sJ(e,t){t.on(`error`,()=>{e.destroy(),t.destroy()}),e.pipe(t),t.pipe(e)}function cJ(e,t){return new Promise((n,r)=>{let i=Buffer.isBuffer(t)?t:Buffer.from(t);e.write(i,e=>e?r(e):n())})}function lJ(e){return new Promise((t,n)=>{let r=n=>{e.off(`error`,i),t(n)},i=t=>{e.off(`data`,r),n(t)};e.once(`data`,r),e.once(`error`,i)})}function uJ(e){return new Promise((t,n)=>{let r=Qq.default.connect(e),i=()=>{r.off(`error`,a),t(r)},a=e=>{r.off(`secureConnect`,i),n(e)};r.once(`secureConnect`,i),r.once(`error`,a)})}var dJ=4,fJ=8,pJ=1,mJ=2,hJ=2048;function gJ(e){let t=e.length,n=1;for(;n<t&&e[n]!=0;)n++;return n++,n+=dJ,n+=fJ,n+=pJ,n+mJ>t?!1:((e[n]|e[n+1]<<8)&hJ)!=0}var _J=e(`node:buffer`);function vJ(e){if(!Array.isArray(e))return null;for(let t of e)for(let e of[`imageIndex`,`rotate`,`width`,`height`])if(t[e]!==void 0&&typeof t[e]!=`number`)return null;return e}async function yJ(e){let t;try{let{default:e}=await import(`./lib-B6xvCJjc.mjs`).then(e=>n(e.default));t=e}catch{return SJ(503,9523,`The Sharp library is not available, check your version of Node is compatible`)}let r=await e.formData(),i=r.get(`image`);if(!i||!(i instanceof _J.File))return SJ(400,9523,`ERROR: Internal Images binding error: expected image in request, got ${i}`);let a=t(await i.arrayBuffer(),{});if(new URL(e.url).pathname==`/info`)return bJ(a);{let e=SJ(400,9523,`ERROR: Internal Images binding error: Expected JSON array of valid transforms in transforms field`);try{let t=r.get(`transforms`);if(typeof t!=`string`)return e;let n=vJ(JSON.parse(t));if(n===null)return e;let i=r.get(`output_format`);return i!=null&&typeof i!=`string`?SJ(400,9523,`ERROR: Internal Images binding error: Expected output format to be a string if provided`):xJ(a,n,i)}catch{return e}}}async function bJ(e){let t=await e.metadata(),n=null;switch(t.format){case`jpeg`:n=`image/jpeg`;break;case`svg`:n=`image/svg+xml`;break;case`png`:n=`image/png`;break;case`webp`:n=`image/webp`;break;case`gif`:n=`image/gif`;break;case`avif`:n=`image/avif`;break;default:return SJ(415,9520,`ERROR: Unsupported image type ${t.format}, expected one of: JPEG, SVG, PNG, WebP, GIF or AVIF`)}let r;if(n==`image/svg+xml`)r={format:n};else{if(!t.size||!t.width||!t.height)return SJ(500,9523,`ERROR: Internal Images binding error: Expected size, width and height for bitmap input`);r={format:n,fileSize:t.size,width:t.width,height:t.height}}return Response.json(r)}async function xJ(e,t,n){for(let n of t)n.imageIndex!==void 0&&n.imageIndex!==0||(n.rotate!==void 0&&e.rotate(n.rotate),(n.width!==void 0||n.height!==void 0)&&e.resize(n.width||null,n.height||null,{fit:`contain`}));switch(n){case`image/avif`:e.avif();break;case`image/gif`:return SJ(415,9520,`ERROR: GIF output is not supported in local mode`);case`image/jpeg`:e.jpeg();break;case`image/png`:e.png();break;case`image/webp`:e.webp();break;case`rgb`:case`rgba`:return SJ(415,9520,`ERROR: RGB/RGBA output is not supported in local mode`);default:n=`image/jpeg`;break}return new Response(e,{headers:{"content-type":n}})}function SJ(e,t,n){return new Response(`ERROR ${t}: ${n}`,{status:e,headers:{"content-type":`text/plain`,"cf-images-binding":`err=${t}`}})}var CJ={low:35,"medium-low":50,"medium-high":70,high:90};function wJ(e){if(typeof e==`number`)return Math.min(100,Math.max(1,Math.round(e)));if(typeof e==`string`&&e in CJ)return CJ[e]}function TJ(e){switch(e){case`contain`:return{fit:`inside`};case`cover`:return{fit:`cover`};case`crop`:return{fit:`cover`,withoutEnlargement:!0};case`pad`:return{fit:`contain`};case`squeeze`:return{fit:`fill`};default:return{fit:`inside`,withoutEnlargement:!0}}}function EJ(e){switch(e){case`left`:case`right`:case`top`:case`bottom`:return e;case`center`:return`centre`;default:return}}function DJ(e){switch(e){case`jpeg`:return`image/jpeg`;case`svg`:return`image/svg+xml`;case`png`:return`image/png`;case`webp`:return`image/webp`;case`gif`:return`image/gif`;case`avif`:return`image/avif`;default:return null}}function OJ(e,t){typeof t.rotate==`number`&&e.rotate(t.rotate);let n=typeof t.dpr==`number`&&t.dpr>0?t.dpr:1,r=typeof t.width==`number`?Math.round(t.width*n):void 0,i=typeof t.height==`number`?Math.round(t.height*n):void 0;if(r!==void 0||i!==void 0){let{fit:n,withoutEnlargement:a}=TJ(t.fit);e.resize(r??null,i??null,{fit:n,withoutEnlargement:a,position:EJ(t.gravity),background:t.background??(t.fit===`pad`?`#ffffff`:void 0)})}}async function kJ(e){let t;try{let{default:e}=await import(`./lib-B6xvCJjc.mjs`).then(e=>n(e.default));t=e}catch{return AJ(`The Sharp library is not available, check your version of Node is compatible`)}let r,i;try{let t=await e.formData();r=t.get(`image`);let n=t.get(`options`);i=typeof n==`string`?JSON.parse(n):{}}catch{return AJ(`Could not parse cf.image transform request`)}if(!r||!(r instanceof _J.File))return AJ(`Expected an image in the cf.image transform request`);let a=await r.arrayBuffer();try{let e=await t(a).metadata();if(e.format===`svg`)return AJ(`SVG inputs are not transformed in local mode`);if(i.format===`json`){let n=t(a);OJ(n,i);let{info:r}=await n.toBuffer({resolveWithObject:!0});return Response.json({width:r.width,height:r.height,original:{file_size:e.size??a.byteLength,width:e.width,height:e.height,format:DJ(e.format)??`application/octet-stream`}})}let n=t(a);OJ(n,i);let r=wJ(i.quality),o;switch(i.format){case`avif`:n.avif(r===void 0?{}:{quality:r}),o=`image/avif`;break;case`webp`:n.webp(r===void 0?{}:{quality:r}),o=`image/webp`;break;case`jpeg`:case`baseline-jpeg`:n.jpeg(r===void 0?{}:{quality:r}),o=`image/jpeg`;break;case`png`:case`png-force`:n.png(),o=`image/png`;break;default:o=DJ(e.format)??`image/jpeg`;break}let s=await n.toBuffer();return new Response(s,{headers:{"content-type":o,"cf-resized":`internal=ok/m`}})}catch{return AJ(`Sharp failed to transform the image`)}}function AJ(e){return new Response(`cf.image local transform error: ${e}`,{status:422,headers:{"content-type":`text/plain`}})}var jJ=m(e(`node:assert`)),MJ=e(`node:fs`),NJ=m(e(`node:path`)),PJ=e(`fs`),FJ=e(`fs/promises`),IJ=e(`events`),LJ=m(e(`path`),1),RJ=e(`fs`),zJ=e(`fs/promises`),BJ=e(`stream`),VJ=e(`path`);function HJ(){return{root:`.`,fileFilter:e=>!0,directoryFilter:e=>!0,type:GJ,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096}}var UJ=`READDIRP_RECURSIVE_ERROR`,WJ=new Set([`ENOENT`,`EPERM`,`EACCES`,`ELOOP`,UJ]),GJ=`files`,KJ=`directories`,qJ=`files_directories`,JJ=`all`,YJ=[GJ,KJ,qJ,JJ],XJ=new Set([KJ,qJ,JJ]),ZJ=new Set([GJ,qJ,JJ]),QJ=e=>WJ.has(e.code),$J=process.platform===`win32`,eY=e=>!0,tY=e=>{if(e===void 0)return eY;if(typeof e==`function`)return e;if(typeof e==`string`){let t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){let t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return eY},nY=class extends BJ.Readable{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let t={...HJ(),...e},{root:n,type:r}=t;this._fileFilter=tY(t.fileFilter),this._directoryFilter=tY(t.directoryFilter);let i=t.lstat?RJ.lstatSync:RJ.statSync;$J?this._stat=e=>i(e,{bigint:!0}):this._stat=i,this._maxDepth=t.depth,this._wantsDir=XJ.has(r),this._wantsFile=ZJ.has(r),this._wantsEverything=r===JJ,this._root=(0,VJ.resolve)(n),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?`dirent`:`stats`,this._rdOptions={encoding:`utf8`,withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,n=t&&t.files;if(n&&n.length>0){let{path:r,depth:i}=t,a=n.splice(0,e).map(e=>this._formatEntry(e,r));for(let t of a){if(!t){e--;return}if(this.destroyed)return;let n=await this._getEntryType(t);n===`directory`&&this._directoryFilter(t)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,i+1)),this._wantsDir&&(this.push(t),e--)):(n===`file`||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{let e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await(0,zJ.readdir)(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}_formatEntry(e,t){let n,r=this._isDirent?e.name:e;try{let i=(0,VJ.resolve)((0,VJ.join)(t,r));n={path:(0,VJ.relative)(this._root,i),fullPath:i,basename:r},n[this._statsProp]=this._isDirent?e:this._stat(i)}catch(e){this._onError(e);return}return n}_onError(e){QJ(e)&&!this.destroyed?this.emit(`warn`,e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return``;let t=e[this._statsProp];if(t.isFile())return`file`;if(t.isDirectory())return`directory`;if(t&&t.isSymbolicLink()){let t=e.fullPath;try{let e=await(0,zJ.realpath)(t),n=(0,RJ.lstatSync)(e);if(n.isFile())return`file`;if(n.isDirectory()){let n=e.length;if(t.startsWith(e)&&t.substr(n,1)===VJ.sep){let n=Error(`Circular symlink detected: "${t}" points to "${e}"`);return n.code=UJ,this._onError(n)}return`directory`}}catch(e){return this._onError(e),``}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},rY=(e,t={})=>{let n=t.entryType||t.type;if(n===`both`&&(n=qJ),n&&(t.type=n),!e)throw Error(`readdirp: root argument is required. Usage: readdirp(root, options)`);if(typeof e!=`string`)throw TypeError(`readdirp: root argument must be a string. Usage: readdirp(root, options)`);if(n&&!YJ.includes(n))throw Error(`readdirp: Invalid type passed. Use one of ${YJ.join(`, `)}`);return t.root=e,new nY(t)},iY=e(`fs`),aY=e(`fs/promises`),oY=m(e(`path`),1),sY=e(`os`),cY=`data`,lY=`end`,uY=`close`,dY=()=>{},fY=process.platform,pY=fY===`win32`,mY=fY===`darwin`,hY=fY===`linux`,gY=(0,sY.type)()===`OS400`,_Y={ALL:`all`,READY:`ready`,ADD:`add`,CHANGE:`change`,ADD_DIR:`addDir`,UNLINK:`unlink`,UNLINK_DIR:`unlinkDir`,RAW:`raw`,ERROR:`error`},vY=_Y,yY=`watch`,bY={lstat:aY.lstat,stat:aY.stat},xY=`listeners`,SY=`errHandlers`,CY=`rawEmitters`,wY=[xY,SY,CY],TY=new Set(`3dm.3ds.3g2.3gp.7z.a.aac.adp.afdesign.afphoto.afpub.ai.aif.aiff.alz.ape.apk.appimage.ar.arj.asf.au.avi.bak.baml.bh.bin.bk.bmp.btif.bz2.bzip2.cab.caf.cgm.class.cmx.cpio.cr2.cur.dat.dcm.deb.dex.djvu.dll.dmg.dng.doc.docm.docx.dot.dotm.dra.DS_Store.dsk.dts.dtshd.dvb.dwg.dxf.ecelp4800.ecelp7470.ecelp9600.egg.eol.eot.epub.exe.f4v.fbs.fh.fla.flac.flatpak.fli.flv.fpx.fst.fvt.g3.gh.gif.graffle.gz.gzip.h261.h263.h264.icns.ico.ief.img.ipa.iso.jar.jpeg.jpg.jpgv.jpm.jxr.key.ktx.lha.lib.lvp.lz.lzh.lzma.lzo.m3u.m4a.m4v.mar.mdi.mht.mid.midi.mj2.mka.mkv.mmr.mng.mobi.mov.movie.mp3.mp4.mp4a.mpeg.mpg.mpga.mxu.nef.npx.numbers.nupkg.o.odp.ods.odt.oga.ogg.ogv.otf.ott.pages.pbm.pcx.pdb.pdf.pea.pgm.pic.png.pnm.pot.potm.potx.ppa.ppam.ppm.pps.ppsm.ppsx.ppt.pptm.pptx.psd.pya.pyc.pyo.pyv.qt.rar.ras.raw.resources.rgb.rip.rlc.rmf.rmvb.rpm.rtf.rz.s3m.s7z.scpt.sgi.shar.snap.sil.sketch.slk.smv.snk.so.stl.suo.sub.swf.tar.tbz.tbz2.tga.tgz.thmx.tif.tiff.tlz.ttc.ttf.txz.udf.uvh.uvi.uvm.uvp.uvs.uvu.viv.vob.war.wav.wax.wbmp.wdp.weba.webm.webp.whl.wim.wm.wma.wmv.wmx.woff.woff2.wrm.wvx.xbm.xif.xla.xlam.xls.xlsb.xlsm.xlsx.xlt.xltm.xltx.xm.xmind.xpi.xpm.xwd.xz.z.zip.zipx`.split(`.`)),EY=e=>TY.has(oY.extname(e).slice(1).toLowerCase()),DY=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},OY=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},kY=e=>t=>{let n=e[t];n instanceof Set?n.clear():delete e[t]},AY=(e,t,n)=>{let r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},jY=e=>e instanceof Set?e.size===0:!e,MY=new Map;function NY(e,t,n,r,i){let a=(t,r)=>{n(e),i(t,r,{watchedPath:e}),r&&e!==r&&PY(oY.resolve(e,r),xY,oY.join(e,r))};try{return(0,iY.watch)(e,{persistent:t.persistent},a)}catch(e){r(e);return}}var PY=(e,t,n,r,i)=>{let a=MY.get(e);a&&DY(a[t],e=>{e(n,r,i)})},FY=(e,t,n,r)=>{let{listener:i,errHandler:a,rawEmitter:o}=r,s=MY.get(t),c;if(!n.persistent)return c=NY(e,n,i,a,o),c?c.close.bind(c):void 0;if(s)OY(s,xY,i),OY(s,SY,a),OY(s,CY,o);else{if(c=NY(e,n,PY.bind(null,t,xY),a,PY.bind(null,t,CY)),!c)return;c.on(vY.ERROR,async n=>{let r=PY.bind(null,t,SY);if(s&&(s.watcherUnusable=!0),pY&&n.code===`EPERM`)try{await(await(0,aY.open)(e,`r`)).close(),r(n)}catch{}else r(n)}),s={listeners:i,errHandlers:a,rawEmitters:o,watcher:c},MY.set(t,s)}return()=>{AY(s,xY,i),AY(s,SY,a),AY(s,CY,o),jY(s.listeners)&&(s.watcher.close(),MY.delete(t),wY.forEach(kY(s)),s.watcher=void 0,Object.freeze(s))}},IY=new Map,LY=(e,t,n,r)=>{let{listener:i,rawEmitter:a}=r,o=IY.get(t),s=o&&o.options;return s&&(s.persistent<n.persistent||s.interval>n.interval)&&((0,iY.unwatchFile)(t),o=void 0),o?(OY(o,xY,i),OY(o,CY,a)):(o={listeners:i,rawEmitters:a,options:n,watcher:(0,iY.watchFile)(t,n,(n,r)=>{DY(o.rawEmitters,e=>{e(vY.CHANGE,t,{curr:n,prev:r})});let i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||i===0)&&DY(o.listeners,t=>t(e,n))})},IY.set(t,o)),()=>{AY(o,xY,i),AY(o,CY,a),jY(o.listeners)&&(IY.delete(t),(0,iY.unwatchFile)(t),o.options=o.watcher=void 0,Object.freeze(o))}},RY=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,r=oY.dirname(e),i=oY.basename(e);this.fsw._getWatchedDir(r).add(i);let a=oY.resolve(e),o={persistent:n.persistent};t||=dY;let s;return n.usePolling?(o.interval=n.interval!==n.binaryInterval&&EY(i)?n.binaryInterval:n.interval,s=LY(e,a,o,{listener:t,rawEmitter:this.fsw._emitRaw})):s=FY(e,a,o,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),s}_handleFile(e,t,n){if(this.fsw.closed)return;let r=oY.dirname(e),i=oY.basename(e),a=this.fsw._getWatchedDir(r),o=t;if(a.has(i))return;let s=async(t,n)=>{if(this.fsw._throttle(yY,e,5)){if(!n||n.mtimeMs===0)try{let n=await(0,aY.stat)(e);if(this.fsw.closed)return;let r=n.atimeMs,i=n.mtimeMs;if((!r||r<=i||i!==o.mtimeMs)&&this.fsw._emit(vY.CHANGE,e,n),(mY||hY)&&o.ino!==n.ino){this.fsw._closeFile(t),o=n;let r=this._watchWithNodeFs(e,s);r&&this.fsw._addPathCloser(t,r)}else o=n}catch{this.fsw._remove(r,i)}else if(a.has(i)){let t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==o.mtimeMs)&&this.fsw._emit(vY.CHANGE,e,n),o=n}}},c=this._watchWithNodeFs(e,s);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(vY.ADD,e,0))return;this.fsw._emit(vY.ADD,e,t)}return c}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;let i=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let t;try{t=await(0,aY.realpath)(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(vY.CHANGE,n,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(vY.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,t,n,r,i,a,o){if(e=oY.join(e,``),o=this.fsw._throttle(`readdir`,e,1e3),!o)return;let s=this.fsw._getWatchedDir(n.path),c=new Set,l=this.fsw._readdirp(e,{fileFilter:e=>n.filterPath(e),directoryFilter:e=>n.filterDir(e)});if(l)return l.on(cY,async o=>{if(this.fsw.closed){l=void 0;return}let u=o.path,d=oY.join(e,u);if(c.add(u),!(o.stats.isSymbolicLink()&&await this._handleSymlink(o,e,d,u))){if(this.fsw.closed){l=void 0;return}(u===r||!r&&!s.has(u))&&(this.fsw._incrReadyCount(),d=oY.join(i,oY.relative(i,d)),this._addToNodeFs(d,t,n,a+1))}}).on(vY.ERROR,this._boundHandleError),new Promise((t,u)=>{if(!l)return u();l.once(lY,()=>{if(this.fsw.closed){l=void 0;return}let u=o?o.clear():!1;t(void 0),s.getChildren().filter(t=>t!==e&&!c.has(t)).forEach(t=>{this.fsw._remove(e,t)}),l=void 0,u&&this._handleRead(e,!1,n,r,i,a,o)})})}async _handleDir(e,t,n,r,i,a,o){let s=this.fsw._getWatchedDir(oY.dirname(e)),c=s.has(oY.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!c&&this.fsw._emit(vY.ADD_DIR,e,t),s.add(oY.basename(e)),this.fsw._getWatchedDir(e);let l,u=this.fsw.options.depth;if((u==null||r<=u)&&!this.fsw._symlinkPaths.has(o)){if(!i&&(await this._handleRead(e,n,a,i,e,r,void 0),this.fsw.closed))return;l=this._watchWithNodeFs(e,(t,n)=>{n&&n.mtimeMs===0||this._handleRead(t,!1,a,i,e,r,void 0)})}return l}async _addToNodeFs(e,t,n,r,i){let a=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return a(),!1;let o=this.fsw._getWatchHelpers(e);n&&(o.filterPath=e=>n.filterPath(e),o.filterDir=e=>n.filterDir(e));try{let n=await bY[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,n))return a(),!1;let s=this.fsw.options.followSymlinks,c;if(n.isDirectory()){let a=oY.resolve(e),l=s?await(0,aY.realpath)(e):e;if(this.fsw.closed||(c=await this._handleDir(o.watchPath,n,t,r,i,o,l),this.fsw.closed))return;a!==l&&l!==void 0&&this.fsw._symlinkPaths.set(a,l)}else if(n.isSymbolicLink()){let i=s?await(0,aY.realpath)(e):e;if(this.fsw.closed)return;let a=oY.dirname(o.watchPath);if(this.fsw._getWatchedDir(a).add(o.watchPath),this.fsw._emit(vY.ADD,o.watchPath,n),c=await this._handleDir(a,n,t,r,e,o,i),this.fsw.closed)return;i!==void 0&&this.fsw._symlinkPaths.set(oY.resolve(e),i)}else c=this._handleFile(o.watchPath,n,t);return a(),c&&this.fsw._addPathCloser(e,c),!1}catch(t){if(this.fsw._handleError(t))return a(),e}}},zY=`/`,BY=`//`,VY=`.`,HY=`..`,UY=`string`,WY=/\\/g,GY=/\/\//,KY=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,qY=/^\.[/\\]/;function JY(e){return Array.isArray(e)?e:[e]}var YY=e=>typeof e==`object`&&!!e&&!(e instanceof RegExp);function XY(e){return typeof e==`function`?e:typeof e==`string`?t=>e===t:e instanceof RegExp?t=>e.test(t):typeof e==`object`&&e?t=>{if(e.path===t)return!0;if(e.recursive){let n=LJ.relative(e.path,t);return n?!n.startsWith(`..`)&&!LJ.isAbsolute(n):!1}return!1}:()=>!1}function ZY(e){if(typeof e!=`string`)throw Error(`string expected`);e=LJ.normalize(e),e=e.replace(/\\/g,`/`);let t=!1;e.startsWith(`//`)&&(t=!0);let n=/\/\//;for(;e.match(n);)e=e.replace(n,`/`);return t&&(e=`/`+e),e}function QY(e,t,n){let r=ZY(t);for(let t=0;t<e.length;t++){let i=e[t];if(i(r,n))return!0}return!1}function $Y(e,t){if(e==null)throw TypeError(`anymatch: specify first argument`);let n=JY(e).map(e=>XY(e));return t==null?(e,t)=>QY(n,e,t):QY(n,t)}var eX=e=>{let t=JY(e).flat();if(!t.every(e=>typeof e===UY))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(nX)},tX=e=>{let t=e.replace(WY,zY),n=!1;for(t.startsWith(BY)&&(n=!0);t.match(GY);)t=t.replace(GY,zY);return n&&(t=zY+t),t},nX=e=>tX(LJ.normalize(tX(e))),rX=(e=``)=>t=>typeof t==`string`?nX(LJ.isAbsolute(t)?t:LJ.join(e,t)):t,iX=(e,t)=>LJ.isAbsolute(e)?e:LJ.join(t,e),aX=Object.freeze(new Set),oX=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==VY&&e!==HY&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await(0,FJ.readdir)(n)}catch{this._removeWatcher&&this._removeWatcher(LJ.dirname(n),LJ.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path=``,this._removeWatcher=dY,this.items=aX,Object.freeze(this)}},sX=`stat`,cX=`lstat`,lX=class{constructor(e,t,n){this.fsw=n;let r=e;this.path=e=e.replace(qY,``),this.watchPath=r,this.fullWatchPath=LJ.resolve(r),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=t,this.statMethod=t?sX:cX}entryPath(e){return LJ.join(this.watchPath,LJ.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},uX=class extends IJ.EventEmitter{constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?JY(e.ignored):JY([]),awaitWriteFinish:t===!0?n:typeof t==`object`?{...n,...t}:!1};gY&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let e=i.toLowerCase();e===`false`||e===`0`?r.usePolling=!1:e===`true`||e===`1`?r.usePolling=!0:r.usePolling=!!e}let a=process.env.CHOKIDAR_INTERVAL;a&&(r.interval=Number.parseInt(a,10));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=dY,this._readyEmitted=!0,process.nextTick(()=>this.emit(_Y.READY)))},this._emitRaw=(...e)=>this.emit(_Y.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new RY(this),Object.freeze(r)}_addIgnoredPath(e){if(YY(e)){for(let t of this._ignoredPaths)if(YY(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e==`string`)for(let t of this._ignoredPaths)YY(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,n){let{cwd:r}=this.options;this.closed=!1,this._closePromise=void 0;let i=eX(e);return r&&(i=i.map(e=>iX(e,r))),i.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||=0,this._readyCount+=i.length,Promise.all(i.map(async e=>{let r=await this._nodeFsHandler._addToNodeFs(e,!n,void 0,0,t);return r&&this._emitReady(),r})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(LJ.dirname(e),LJ.basename(t||e))})}),this}unwatch(e){if(this.closed)return this;let t=eX(e),{cwd:n}=this.options;return t.forEach(e=>{!LJ.isAbsolute(e)&&!this._closers.has(e)&&(n&&(e=LJ.join(n,e)),e=LJ.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(t=>{let n=t();n instanceof Promise&&e.push(n)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let r=(this.options.cwd?LJ.relative(this.options.cwd,n):n)||VY;e[r]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==_Y.ERROR&&this.emit(_Y.ALL,...t)}async _emit(e,t,n){if(this.closed)return;let r=this.options;pY&&(t=LJ.normalize(t)),r.cwd&&(t=LJ.relative(r.cwd,t));let i=[e,t];n!=null&&i.push(n);let a=r.awaitWriteFinish,o;if(a&&(o=this._pendingWrites.get(t)))return o.lastChange=new Date,this;if(r.atomic){if(e===_Y.UNLINK)return this._pendingUnlinks.set(t,i),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(_Y.ALL,...e),this._pendingUnlinks.delete(t)})},typeof r.atomic==`number`?r.atomic:100),this;e===_Y.ADD&&this._pendingUnlinks.has(t)&&(e=i[0]=_Y.CHANGE,this._pendingUnlinks.delete(t))}if(a&&(e===_Y.ADD||e===_Y.CHANGE)&&this._readyEmitted)return this._awaitWriteFinish(t,a.stabilityThreshold,e,(t,n)=>{t?(e=i[0]=_Y.ERROR,i[1]=t,this.emitWithAll(e,i)):n&&(i.length>2?i[2]=n:i.push(n),this.emitWithAll(e,i))}),this;if(e===_Y.CHANGE&&!this._throttle(_Y.CHANGE,t,50))return this;if(r.alwaysStat&&n===void 0&&(e===_Y.ADD||e===_Y.ADD_DIR||e===_Y.CHANGE)){let e=r.cwd?LJ.join(r.cwd,t):t,n;try{n=await(0,FJ.stat)(e)}catch{}if(!n||this.closed)return;i.push(n)}return this.emitWithAll(e,i),this}_handleError(e){let t=e&&e.code;return e&&t!==`ENOENT`&&t!==`ENOTDIR`&&(!this.options.ignorePermissionErrors||t!==`EPERM`&&t!==`EACCES`)&&this.emit(_Y.ERROR,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw Error(`invalid throttle`);let i=r.get(t);if(i)return i.count++,!1;let a,o=()=>{let e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(a),e&&clearTimeout(e.timeoutObject),n};a=setTimeout(o,n);let s={timeoutObject:a,clear:o,count:0};return r.set(t,s),s}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,r){let i=this.options.awaitWriteFinish;if(typeof i!=`object`)return;let a=i.pollInterval,o,s=e;this.options.cwd&&!LJ.isAbsolute(e)&&(s=LJ.join(this.options.cwd,e));let c=new Date,l=this._pendingWrites;function u(n){(0,PJ.stat)(s,(i,s)=>{if(i||!l.has(e)){i&&i.code!==`ENOENT`&&r(i);return}let c=Number(new Date);n&&s.size!==n.size&&(l.get(e).lastChange=c),c-l.get(e).lastChange>=t?(l.delete(e),r(void 0,s)):o=setTimeout(u,a,s)})}l.has(e)||(l.set(e,{lastChange:c,cancelWait:()=>(l.delete(e),clearTimeout(o),n)}),o=setTimeout(u,a))}_isIgnored(e,t){if(this.options.atomic&&KY.test(e))return!0;if(!this._userIgnored){let{cwd:e}=this.options,t=(this.options.ignored||[]).map(rX(e)),n=[...[...this._ignoredPaths].map(rX(e)),...t];this._userIgnored=$Y(n,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new lX(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=LJ.resolve(e);return this._watched.has(t)||this._watched.set(t,new oX(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,t,n){let r=LJ.join(e,t),i=LJ.resolve(r);if(n??=this._watched.has(r)||this._watched.has(i),!this._throttle(`remove`,r,100))return;!n&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(r).getChildren().forEach(e=>this._remove(r,e));let a=this._getWatchedDir(e),o=a.has(t);a.remove(t),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let s=r;if(this.options.cwd&&(s=LJ.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(s)&&this._pendingWrites.get(s).cancelWait()===_Y.ADD)return;this._watched.delete(r),this._watched.delete(i);let c=n?_Y.UNLINK_DIR:_Y.UNLINK;o&&!this._isIgnored(r)&&this._emit(c,r),this._closePath(r)}_closePath(e){this._closeFile(e);let t=LJ.dirname(e);this._getWatchedDir(t).remove(LJ.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n=rY(e,{type:_Y.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(n),n.once(uY,()=>{n=void 0}),n.once(lY,()=>{n&&=(this._streams.delete(n),void 0)}),n}};function dX(e,t={}){let n=new uX(t);return n.add(e),n}var fX=class{constructor(e,t,n){this.registryPath=e,this.onUpdate=t,this.log=n}registryPath;onUpdate;log;heartbeats=new Map;registeredWorkers=new Set;watchQueueConsumers=!1;externalServices=new Map;watcher;watch(e,t=!1){e.size===0&&!t||!this.registryPath||(this.externalServices=new Map(e),this.watchQueueConsumers=t,(0,MJ.mkdirSync)(this.registryPath,{recursive:!0}),this.watcher||=dX(this.registryPath,{usePolling:process.platform===`win32`,interval:100}).on(`all`,()=>{this.refresh()}))}dispose(){return this.unregisterWorkers(),this.watcher?.close().finally(()=>{this.watcher=void 0})}unregisterWorkers(){for(let e of this.registeredWorkers)this.unregister(e);this.registeredWorkers.clear()}unregister(e){try{let t=this.heartbeats.get(e);t&&(this.heartbeats.delete(e),clearInterval(t)),this.registryPath&&(0,MJ.unlinkSync)(NJ.default.join(this.registryPath,e))}catch(t){this.log?.debug(`Failed to unregister worker "${e}": ${t}`)}}isEnabled(){return this.registryPath!==void 0&&this.registryPath!==``}getRegistry(){return this.registryPath?mX(this.registryPath):{}}getRegistryPath(){return this.registryPath}async updateRegistryPath(e,t){this.unregisterWorkers(),this.onUpdate=t,e!==this.registryPath&&(await this.watcher?.close(),this.watcher=void 0,this.registryPath=e)}register(e){if(this.registryPath){(0,MJ.mkdirSync)(this.registryPath,{recursive:!0});for(let[t,n]of Object.entries(e)){let e=NJ.default.join(this.registryPath,t),r=this.heartbeats.get(t);r&&clearInterval(r),(0,MJ.writeFileSync)(e,JSON.stringify(n,null,2)),this.registeredWorkers.add(t),this.heartbeats.set(t,setInterval(()=>{(0,MJ.existsSync)(e)&&(0,MJ.utimesSync)(e,new Date,new Date)},3e4))}this.refresh()}}previousJSON=`{}`;refresh(){if(!this.onUpdate)return;(0,jJ.default)(this.registryPath);let e=mX(this.registryPath),t=JSON.stringify(e);if(t===this.previousJSON)return;let n=JSON.parse(this.previousJSON);if(this.previousJSON=t,this.watchQueueConsumers&&pX(e)!==pX(n)){this.onUpdate(e);return}for(let[t]of this.externalServices)if(JSON.stringify(e[t])!==JSON.stringify(n[t])){this.onUpdate(e);break}}};function pX(e){return JSON.stringify(Object.entries(e).filter(([,e])=>e.queueConsumers!==void 0).map(([e,t])=>[e,t.debugPortAddress,t.queueConsumers]).sort(([e],[t])=>e.localeCompare(t)))}function mX(e){let t={};if(!(0,MJ.existsSync)(e))return t;for(let n of(0,MJ.readdirSync)(e))try{let r=NJ.default.join(e,n),i=(0,MJ.statSync)(r,{throwIfNoEntry:!1});if(i===void 0||i.mtime.getTime()<Date.now()-3e5){try{(0,MJ.unlinkSync)(r)}catch{}continue}let a=(0,MJ.readFileSync)(r,{encoding:`utf8`,flag:`r`});t[n]=JSON.parse(a)}catch{}return t}function hX(){return process.env.MINIFLARE_REGISTRY_PATH??NJ.default.join(Uo(),`registry`)}function gX(e){let t,n,r,i;return typeof e==`string`?t=e:typeof e==`object`&&`name`in e&&(t=e.name===Rz?void 0:e.name,n=e.entrypoint,r=e.props,i=e.remoteProxyConnectionString),{serviceName:t,entrypoint:n,props:r,remoteProxyConnectionString:i}}var _X=/[^0-9a-zA-Z_\$]/g;function vX(e,t){return`${e.replace(_X,`_`)}_${t}`}var yX=new Set(`text/html,text/richtext,text/plain,text/css,text/x-script,text/x-component,text/x-java-source,text/x-markdown,application/javascript,application/x-javascript,text/javascript,text/js,image/x-icon,image/vnd.microsoft.icon,application/x-perl,application/x-httpd-cgi,text/xml,application/xml,application/rss+xml,application/vnd.api+json,application/x-protobuf,application/json,multipart/bag,multipart/mixed,application/xhtml+xml,font/ttf,font/otf,font/x-woff,image/svg+xml,application/vnd.ms-fontobject,application/ttf,application/x-ttf,application/otf,application/x-otf,application/truetype,application/opentype,application/x-opentype,application/font-woff,application/eot,application/font,application/font-sfnt,application/wasm,application/javascript-binast,application/manifest+json,application/ld+json,application/graphql+json,application/geo+json`.split(`,`));function bX(e){if(!e)return!0;let[t]=e.split(`;`);return yX.has(t)}var xX=`SecretsStoreSecret::admin_api`,SX=m(e(`node:assert`)),CX=m(e(`node:util`)),wX=Symbol(`kMessages`),TX=Symbol(`kActual`),EX=Symbol(`kGroupId`),DX=[Ag,Ng,jg,Mg,kg],OX=Map;function kX(e){return typeof e==`object`&&!!e&&wX in e&&TX in e}function AX(e){return typeof e==`object`&&!!e}function jX(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function MX(e,t){return e.message===t.message&&jX(e.path,t.path)}function NX(e,t){let n;for(let r of e)if(!(r.path.length<t)){if(n===void 0)n=r;else if(!MX(n,r))return!0}return!1}function PX(e,t,n,r,i,a){if(i.length===0){if(r.code===`invalid_union`){let i=r.unionErrors.flatMap(({issues:e})=>e),a,o=NX(i,r.path.length+1);AX(n)&&o&&(a=e.size,e.set(a,0));for(let s of i){let i=s.path.slice(r.path.length);o&&i.length===0||(t=PX(e,t,n,s,i,a))}return t}let i=r.message;if(t!==void 0)return kX(t)&&!t[wX].includes(i)&&t[wX].push(i),t;if(a!==void 0){let t=e.get(a);(0,SX.default)(t!==void 0),e.set(a,t+1)}return{[wX]:[i],[TX]:n,[EX]:a}}let[o,...s]=i;if((0,SX.default)(AX(n),`Expected object/array input for nested issue`),t===void 0)if(Array.isArray(n))t=Array(n.length);else{let e=Object.keys(n).map(e=>[e,void 0]);t=Object.fromEntries(e)}return(0,SX.default)(AX(t),`Expected object/array for nested issue`),t[o]=PX(e,t[o],n[o],r,s,a),t}function FX(e,t,n,r=``,i){let a=i?.prefix??``,o=i?.suffix??``;if(kX(n)){let i=r+` `.repeat(a.length),s=CX.default.inspect(n[TX],e).split(`
813
+ `),e.end(),o.destroy();return}}e.pipe(o),o.pipe(e)}dispose(){for(let e of this.#e.values())e.close();this.#e.clear()}};async function iJ(e,t,n,r,i,a){if(await cJ(e,eJ),(await lJ(e)).toString(`utf8`,0,1)===`S`){let r=nJ(e,n,a);try{sJ(t,await uJ(r));return}catch(e){if(i)throw e}}if(i)throw Error(`Server does not support SSL, but client requires SSL.`);e.destroy();let o=await oJ(n,r,t);t.pipe(o),o.pipe(t)}async function aJ(e,t,n,r,i,a){let o=await lJ(e),s=o[0]|o[1]<<8|o[2]<<16,c,l=o.length-4;if(l===s)c=Buffer.from(o.subarray(4));else if(l<s){let t=[o.subarray(4)],n=l;for(;n<s;){let r=await lJ(e);t.push(r),n+=r.length}c=Buffer.concat(t),n>s&&(c=c.subarray(0,s))}else throw Error(`Could not parse header properly.`);if(gJ(c)){await cJ(e,[32,0,0,1,0,10,0,0,0,0,0,0,33,...Array(23).fill(0)]);let r=nJ(e,n,a,{minVersion:`TLSv1.2`});try{let e=await uJ(r);await cJ(t,Buffer.concat([o.subarray(0,4),c]));let n=await lJ(t);n[3]++,await cJ(e,n);let i=await lJ(e);i[3]--,await cJ(t,i),sJ(t,e);return}catch(e){if(i)throw e}}if(i)throw Error(`Server SSL failed, but client requires SSL.`);e.destroy();let u=await oJ(n,r,t);t.pipe(u),u.pipe(t)}async function oJ(e,t,n){let r=Zq.default.connect({host:e,port:t});return await new Promise((e,t)=>{let n=()=>{r.off(`error`,i),e()},i=e=>{r.off(`data`,n),t(e)};r.once(`connect`,n),r.once(`error`,i)}),r.on(`error`,()=>{n.destroy()}),r}function sJ(e,t){t.on(`error`,()=>{e.destroy(),t.destroy()}),e.pipe(t),t.pipe(e)}function cJ(e,t){return new Promise((n,r)=>{let i=Buffer.isBuffer(t)?t:Buffer.from(t);e.write(i,e=>e?r(e):n())})}function lJ(e){return new Promise((t,n)=>{let r=n=>{e.off(`error`,i),t(n)},i=t=>{e.off(`data`,r),n(t)};e.once(`data`,r),e.once(`error`,i)})}function uJ(e){return new Promise((t,n)=>{let r=Qq.default.connect(e),i=()=>{r.off(`error`,a),t(r)},a=e=>{r.off(`secureConnect`,i),n(e)};r.once(`secureConnect`,i),r.once(`error`,a)})}var dJ=4,fJ=8,pJ=1,mJ=2,hJ=2048;function gJ(e){let t=e.length,n=1;for(;n<t&&e[n]!=0;)n++;return n++,n+=dJ,n+=fJ,n+=pJ,n+mJ>t?!1:((e[n]|e[n+1]<<8)&hJ)!=0}var _J=e(`node:buffer`);function vJ(e){if(!Array.isArray(e))return null;for(let t of e)for(let e of[`imageIndex`,`rotate`,`width`,`height`])if(t[e]!==void 0&&typeof t[e]!=`number`)return null;return e}async function yJ(e){let t;try{let{default:e}=await import(`./lib-4PQI6yRW.mjs`).then(e=>n(e.default));t=e}catch{return SJ(503,9523,`The Sharp library is not available, check your version of Node is compatible`)}let r=await e.formData(),i=r.get(`image`);if(!i||!(i instanceof _J.File))return SJ(400,9523,`ERROR: Internal Images binding error: expected image in request, got ${i}`);let a=t(await i.arrayBuffer(),{});if(new URL(e.url).pathname==`/info`)return bJ(a);{let e=SJ(400,9523,`ERROR: Internal Images binding error: Expected JSON array of valid transforms in transforms field`);try{let t=r.get(`transforms`);if(typeof t!=`string`)return e;let n=vJ(JSON.parse(t));if(n===null)return e;let i=r.get(`output_format`);return i!=null&&typeof i!=`string`?SJ(400,9523,`ERROR: Internal Images binding error: Expected output format to be a string if provided`):xJ(a,n,i)}catch{return e}}}async function bJ(e){let t=await e.metadata(),n=null;switch(t.format){case`jpeg`:n=`image/jpeg`;break;case`svg`:n=`image/svg+xml`;break;case`png`:n=`image/png`;break;case`webp`:n=`image/webp`;break;case`gif`:n=`image/gif`;break;case`avif`:n=`image/avif`;break;default:return SJ(415,9520,`ERROR: Unsupported image type ${t.format}, expected one of: JPEG, SVG, PNG, WebP, GIF or AVIF`)}let r;if(n==`image/svg+xml`)r={format:n};else{if(!t.size||!t.width||!t.height)return SJ(500,9523,`ERROR: Internal Images binding error: Expected size, width and height for bitmap input`);r={format:n,fileSize:t.size,width:t.width,height:t.height}}return Response.json(r)}async function xJ(e,t,n){for(let n of t)n.imageIndex!==void 0&&n.imageIndex!==0||(n.rotate!==void 0&&e.rotate(n.rotate),(n.width!==void 0||n.height!==void 0)&&e.resize(n.width||null,n.height||null,{fit:`contain`}));switch(n){case`image/avif`:e.avif();break;case`image/gif`:return SJ(415,9520,`ERROR: GIF output is not supported in local mode`);case`image/jpeg`:e.jpeg();break;case`image/png`:e.png();break;case`image/webp`:e.webp();break;case`rgb`:case`rgba`:return SJ(415,9520,`ERROR: RGB/RGBA output is not supported in local mode`);default:n=`image/jpeg`;break}return new Response(e,{headers:{"content-type":n}})}function SJ(e,t,n){return new Response(`ERROR ${t}: ${n}`,{status:e,headers:{"content-type":`text/plain`,"cf-images-binding":`err=${t}`}})}var CJ={low:35,"medium-low":50,"medium-high":70,high:90};function wJ(e){if(typeof e==`number`)return Math.min(100,Math.max(1,Math.round(e)));if(typeof e==`string`&&e in CJ)return CJ[e]}function TJ(e){switch(e){case`contain`:return{fit:`inside`};case`cover`:return{fit:`cover`};case`crop`:return{fit:`cover`,withoutEnlargement:!0};case`pad`:return{fit:`contain`};case`squeeze`:return{fit:`fill`};default:return{fit:`inside`,withoutEnlargement:!0}}}function EJ(e){switch(e){case`left`:case`right`:case`top`:case`bottom`:return e;case`center`:return`centre`;default:return}}function DJ(e){switch(e){case`jpeg`:return`image/jpeg`;case`svg`:return`image/svg+xml`;case`png`:return`image/png`;case`webp`:return`image/webp`;case`gif`:return`image/gif`;case`avif`:return`image/avif`;default:return null}}function OJ(e,t){typeof t.rotate==`number`&&e.rotate(t.rotate);let n=typeof t.dpr==`number`&&t.dpr>0?t.dpr:1,r=typeof t.width==`number`?Math.round(t.width*n):void 0,i=typeof t.height==`number`?Math.round(t.height*n):void 0;if(r!==void 0||i!==void 0){let{fit:n,withoutEnlargement:a}=TJ(t.fit);e.resize(r??null,i??null,{fit:n,withoutEnlargement:a,position:EJ(t.gravity),background:t.background??(t.fit===`pad`?`#ffffff`:void 0)})}}async function kJ(e){let t;try{let{default:e}=await import(`./lib-4PQI6yRW.mjs`).then(e=>n(e.default));t=e}catch{return AJ(`The Sharp library is not available, check your version of Node is compatible`)}let r,i;try{let t=await e.formData();r=t.get(`image`);let n=t.get(`options`);i=typeof n==`string`?JSON.parse(n):{}}catch{return AJ(`Could not parse cf.image transform request`)}if(!r||!(r instanceof _J.File))return AJ(`Expected an image in the cf.image transform request`);let a=await r.arrayBuffer();try{let e=await t(a).metadata();if(e.format===`svg`)return AJ(`SVG inputs are not transformed in local mode`);if(i.format===`json`){let n=t(a);OJ(n,i);let{info:r}=await n.toBuffer({resolveWithObject:!0});return Response.json({width:r.width,height:r.height,original:{file_size:e.size??a.byteLength,width:e.width,height:e.height,format:DJ(e.format)??`application/octet-stream`}})}let n=t(a);OJ(n,i);let r=wJ(i.quality),o;switch(i.format){case`avif`:n.avif(r===void 0?{}:{quality:r}),o=`image/avif`;break;case`webp`:n.webp(r===void 0?{}:{quality:r}),o=`image/webp`;break;case`jpeg`:case`baseline-jpeg`:n.jpeg(r===void 0?{}:{quality:r}),o=`image/jpeg`;break;case`png`:case`png-force`:n.png(),o=`image/png`;break;default:o=DJ(e.format)??`image/jpeg`;break}let s=await n.toBuffer();return new Response(s,{headers:{"content-type":o,"cf-resized":`internal=ok/m`}})}catch{return AJ(`Sharp failed to transform the image`)}}function AJ(e){return new Response(`cf.image local transform error: ${e}`,{status:422,headers:{"content-type":`text/plain`}})}var jJ=m(e(`node:assert`)),MJ=e(`node:fs`),NJ=m(e(`node:path`)),PJ=e(`fs`),FJ=e(`fs/promises`),IJ=e(`events`),LJ=m(e(`path`),1),RJ=e(`fs`),zJ=e(`fs/promises`),BJ=e(`stream`),VJ=e(`path`);function HJ(){return{root:`.`,fileFilter:e=>!0,directoryFilter:e=>!0,type:GJ,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096}}var UJ=`READDIRP_RECURSIVE_ERROR`,WJ=new Set([`ENOENT`,`EPERM`,`EACCES`,`ELOOP`,UJ]),GJ=`files`,KJ=`directories`,qJ=`files_directories`,JJ=`all`,YJ=[GJ,KJ,qJ,JJ],XJ=new Set([KJ,qJ,JJ]),ZJ=new Set([GJ,qJ,JJ]),QJ=e=>WJ.has(e.code),$J=process.platform===`win32`,eY=e=>!0,tY=e=>{if(e===void 0)return eY;if(typeof e==`function`)return e;if(typeof e==`string`){let t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){let t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return eY},nY=class extends BJ.Readable{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let t={...HJ(),...e},{root:n,type:r}=t;this._fileFilter=tY(t.fileFilter),this._directoryFilter=tY(t.directoryFilter);let i=t.lstat?RJ.lstatSync:RJ.statSync;$J?this._stat=e=>i(e,{bigint:!0}):this._stat=i,this._maxDepth=t.depth,this._wantsDir=XJ.has(r),this._wantsFile=ZJ.has(r),this._wantsEverything=r===JJ,this._root=(0,VJ.resolve)(n),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?`dirent`:`stats`,this._rdOptions={encoding:`utf8`,withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,n=t&&t.files;if(n&&n.length>0){let{path:r,depth:i}=t,a=n.splice(0,e).map(e=>this._formatEntry(e,r));for(let t of a){if(!t){e--;return}if(this.destroyed)return;let n=await this._getEntryType(t);n===`directory`&&this._directoryFilter(t)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,i+1)),this._wantsDir&&(this.push(t),e--)):(n===`file`||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{let e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await(0,zJ.readdir)(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}_formatEntry(e,t){let n,r=this._isDirent?e.name:e;try{let i=(0,VJ.resolve)((0,VJ.join)(t,r));n={path:(0,VJ.relative)(this._root,i),fullPath:i,basename:r},n[this._statsProp]=this._isDirent?e:this._stat(i)}catch(e){this._onError(e);return}return n}_onError(e){QJ(e)&&!this.destroyed?this.emit(`warn`,e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return``;let t=e[this._statsProp];if(t.isFile())return`file`;if(t.isDirectory())return`directory`;if(t&&t.isSymbolicLink()){let t=e.fullPath;try{let e=await(0,zJ.realpath)(t),n=(0,RJ.lstatSync)(e);if(n.isFile())return`file`;if(n.isDirectory()){let n=e.length;if(t.startsWith(e)&&t.substr(n,1)===VJ.sep){let n=Error(`Circular symlink detected: "${t}" points to "${e}"`);return n.code=UJ,this._onError(n)}return`directory`}}catch(e){return this._onError(e),``}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},rY=(e,t={})=>{let n=t.entryType||t.type;if(n===`both`&&(n=qJ),n&&(t.type=n),!e)throw Error(`readdirp: root argument is required. Usage: readdirp(root, options)`);if(typeof e!=`string`)throw TypeError(`readdirp: root argument must be a string. Usage: readdirp(root, options)`);if(n&&!YJ.includes(n))throw Error(`readdirp: Invalid type passed. Use one of ${YJ.join(`, `)}`);return t.root=e,new nY(t)},iY=e(`fs`),aY=e(`fs/promises`),oY=m(e(`path`),1),sY=e(`os`),cY=`data`,lY=`end`,uY=`close`,dY=()=>{},fY=process.platform,pY=fY===`win32`,mY=fY===`darwin`,hY=fY===`linux`,gY=(0,sY.type)()===`OS400`,_Y={ALL:`all`,READY:`ready`,ADD:`add`,CHANGE:`change`,ADD_DIR:`addDir`,UNLINK:`unlink`,UNLINK_DIR:`unlinkDir`,RAW:`raw`,ERROR:`error`},vY=_Y,yY=`watch`,bY={lstat:aY.lstat,stat:aY.stat},xY=`listeners`,SY=`errHandlers`,CY=`rawEmitters`,wY=[xY,SY,CY],TY=new Set(`3dm.3ds.3g2.3gp.7z.a.aac.adp.afdesign.afphoto.afpub.ai.aif.aiff.alz.ape.apk.appimage.ar.arj.asf.au.avi.bak.baml.bh.bin.bk.bmp.btif.bz2.bzip2.cab.caf.cgm.class.cmx.cpio.cr2.cur.dat.dcm.deb.dex.djvu.dll.dmg.dng.doc.docm.docx.dot.dotm.dra.DS_Store.dsk.dts.dtshd.dvb.dwg.dxf.ecelp4800.ecelp7470.ecelp9600.egg.eol.eot.epub.exe.f4v.fbs.fh.fla.flac.flatpak.fli.flv.fpx.fst.fvt.g3.gh.gif.graffle.gz.gzip.h261.h263.h264.icns.ico.ief.img.ipa.iso.jar.jpeg.jpg.jpgv.jpm.jxr.key.ktx.lha.lib.lvp.lz.lzh.lzma.lzo.m3u.m4a.m4v.mar.mdi.mht.mid.midi.mj2.mka.mkv.mmr.mng.mobi.mov.movie.mp3.mp4.mp4a.mpeg.mpg.mpga.mxu.nef.npx.numbers.nupkg.o.odp.ods.odt.oga.ogg.ogv.otf.ott.pages.pbm.pcx.pdb.pdf.pea.pgm.pic.png.pnm.pot.potm.potx.ppa.ppam.ppm.pps.ppsm.ppsx.ppt.pptm.pptx.psd.pya.pyc.pyo.pyv.qt.rar.ras.raw.resources.rgb.rip.rlc.rmf.rmvb.rpm.rtf.rz.s3m.s7z.scpt.sgi.shar.snap.sil.sketch.slk.smv.snk.so.stl.suo.sub.swf.tar.tbz.tbz2.tga.tgz.thmx.tif.tiff.tlz.ttc.ttf.txz.udf.uvh.uvi.uvm.uvp.uvs.uvu.viv.vob.war.wav.wax.wbmp.wdp.weba.webm.webp.whl.wim.wm.wma.wmv.wmx.woff.woff2.wrm.wvx.xbm.xif.xla.xlam.xls.xlsb.xlsm.xlsx.xlt.xltm.xltx.xm.xmind.xpi.xpm.xwd.xz.z.zip.zipx`.split(`.`)),EY=e=>TY.has(oY.extname(e).slice(1).toLowerCase()),DY=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},OY=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},kY=e=>t=>{let n=e[t];n instanceof Set?n.clear():delete e[t]},AY=(e,t,n)=>{let r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},jY=e=>e instanceof Set?e.size===0:!e,MY=new Map;function NY(e,t,n,r,i){let a=(t,r)=>{n(e),i(t,r,{watchedPath:e}),r&&e!==r&&PY(oY.resolve(e,r),xY,oY.join(e,r))};try{return(0,iY.watch)(e,{persistent:t.persistent},a)}catch(e){r(e);return}}var PY=(e,t,n,r,i)=>{let a=MY.get(e);a&&DY(a[t],e=>{e(n,r,i)})},FY=(e,t,n,r)=>{let{listener:i,errHandler:a,rawEmitter:o}=r,s=MY.get(t),c;if(!n.persistent)return c=NY(e,n,i,a,o),c?c.close.bind(c):void 0;if(s)OY(s,xY,i),OY(s,SY,a),OY(s,CY,o);else{if(c=NY(e,n,PY.bind(null,t,xY),a,PY.bind(null,t,CY)),!c)return;c.on(vY.ERROR,async n=>{let r=PY.bind(null,t,SY);if(s&&(s.watcherUnusable=!0),pY&&n.code===`EPERM`)try{await(await(0,aY.open)(e,`r`)).close(),r(n)}catch{}else r(n)}),s={listeners:i,errHandlers:a,rawEmitters:o,watcher:c},MY.set(t,s)}return()=>{AY(s,xY,i),AY(s,SY,a),AY(s,CY,o),jY(s.listeners)&&(s.watcher.close(),MY.delete(t),wY.forEach(kY(s)),s.watcher=void 0,Object.freeze(s))}},IY=new Map,LY=(e,t,n,r)=>{let{listener:i,rawEmitter:a}=r,o=IY.get(t),s=o&&o.options;return s&&(s.persistent<n.persistent||s.interval>n.interval)&&((0,iY.unwatchFile)(t),o=void 0),o?(OY(o,xY,i),OY(o,CY,a)):(o={listeners:i,rawEmitters:a,options:n,watcher:(0,iY.watchFile)(t,n,(n,r)=>{DY(o.rawEmitters,e=>{e(vY.CHANGE,t,{curr:n,prev:r})});let i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||i===0)&&DY(o.listeners,t=>t(e,n))})},IY.set(t,o)),()=>{AY(o,xY,i),AY(o,CY,a),jY(o.listeners)&&(IY.delete(t),(0,iY.unwatchFile)(t),o.options=o.watcher=void 0,Object.freeze(o))}},RY=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,r=oY.dirname(e),i=oY.basename(e);this.fsw._getWatchedDir(r).add(i);let a=oY.resolve(e),o={persistent:n.persistent};t||=dY;let s;return n.usePolling?(o.interval=n.interval!==n.binaryInterval&&EY(i)?n.binaryInterval:n.interval,s=LY(e,a,o,{listener:t,rawEmitter:this.fsw._emitRaw})):s=FY(e,a,o,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),s}_handleFile(e,t,n){if(this.fsw.closed)return;let r=oY.dirname(e),i=oY.basename(e),a=this.fsw._getWatchedDir(r),o=t;if(a.has(i))return;let s=async(t,n)=>{if(this.fsw._throttle(yY,e,5)){if(!n||n.mtimeMs===0)try{let n=await(0,aY.stat)(e);if(this.fsw.closed)return;let r=n.atimeMs,i=n.mtimeMs;if((!r||r<=i||i!==o.mtimeMs)&&this.fsw._emit(vY.CHANGE,e,n),(mY||hY)&&o.ino!==n.ino){this.fsw._closeFile(t),o=n;let r=this._watchWithNodeFs(e,s);r&&this.fsw._addPathCloser(t,r)}else o=n}catch{this.fsw._remove(r,i)}else if(a.has(i)){let t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==o.mtimeMs)&&this.fsw._emit(vY.CHANGE,e,n),o=n}}},c=this._watchWithNodeFs(e,s);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(vY.ADD,e,0))return;this.fsw._emit(vY.ADD,e,t)}return c}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;let i=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let t;try{t=await(0,aY.realpath)(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(vY.CHANGE,n,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(vY.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,t,n,r,i,a,o){if(e=oY.join(e,``),o=this.fsw._throttle(`readdir`,e,1e3),!o)return;let s=this.fsw._getWatchedDir(n.path),c=new Set,l=this.fsw._readdirp(e,{fileFilter:e=>n.filterPath(e),directoryFilter:e=>n.filterDir(e)});if(l)return l.on(cY,async o=>{if(this.fsw.closed){l=void 0;return}let u=o.path,d=oY.join(e,u);if(c.add(u),!(o.stats.isSymbolicLink()&&await this._handleSymlink(o,e,d,u))){if(this.fsw.closed){l=void 0;return}(u===r||!r&&!s.has(u))&&(this.fsw._incrReadyCount(),d=oY.join(i,oY.relative(i,d)),this._addToNodeFs(d,t,n,a+1))}}).on(vY.ERROR,this._boundHandleError),new Promise((t,u)=>{if(!l)return u();l.once(lY,()=>{if(this.fsw.closed){l=void 0;return}let u=o?o.clear():!1;t(void 0),s.getChildren().filter(t=>t!==e&&!c.has(t)).forEach(t=>{this.fsw._remove(e,t)}),l=void 0,u&&this._handleRead(e,!1,n,r,i,a,o)})})}async _handleDir(e,t,n,r,i,a,o){let s=this.fsw._getWatchedDir(oY.dirname(e)),c=s.has(oY.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!c&&this.fsw._emit(vY.ADD_DIR,e,t),s.add(oY.basename(e)),this.fsw._getWatchedDir(e);let l,u=this.fsw.options.depth;if((u==null||r<=u)&&!this.fsw._symlinkPaths.has(o)){if(!i&&(await this._handleRead(e,n,a,i,e,r,void 0),this.fsw.closed))return;l=this._watchWithNodeFs(e,(t,n)=>{n&&n.mtimeMs===0||this._handleRead(t,!1,a,i,e,r,void 0)})}return l}async _addToNodeFs(e,t,n,r,i){let a=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return a(),!1;let o=this.fsw._getWatchHelpers(e);n&&(o.filterPath=e=>n.filterPath(e),o.filterDir=e=>n.filterDir(e));try{let n=await bY[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,n))return a(),!1;let s=this.fsw.options.followSymlinks,c;if(n.isDirectory()){let a=oY.resolve(e),l=s?await(0,aY.realpath)(e):e;if(this.fsw.closed||(c=await this._handleDir(o.watchPath,n,t,r,i,o,l),this.fsw.closed))return;a!==l&&l!==void 0&&this.fsw._symlinkPaths.set(a,l)}else if(n.isSymbolicLink()){let i=s?await(0,aY.realpath)(e):e;if(this.fsw.closed)return;let a=oY.dirname(o.watchPath);if(this.fsw._getWatchedDir(a).add(o.watchPath),this.fsw._emit(vY.ADD,o.watchPath,n),c=await this._handleDir(a,n,t,r,e,o,i),this.fsw.closed)return;i!==void 0&&this.fsw._symlinkPaths.set(oY.resolve(e),i)}else c=this._handleFile(o.watchPath,n,t);return a(),c&&this.fsw._addPathCloser(e,c),!1}catch(t){if(this.fsw._handleError(t))return a(),e}}},zY=`/`,BY=`//`,VY=`.`,HY=`..`,UY=`string`,WY=/\\/g,GY=/\/\//,KY=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,qY=/^\.[/\\]/;function JY(e){return Array.isArray(e)?e:[e]}var YY=e=>typeof e==`object`&&!!e&&!(e instanceof RegExp);function XY(e){return typeof e==`function`?e:typeof e==`string`?t=>e===t:e instanceof RegExp?t=>e.test(t):typeof e==`object`&&e?t=>{if(e.path===t)return!0;if(e.recursive){let n=LJ.relative(e.path,t);return n?!n.startsWith(`..`)&&!LJ.isAbsolute(n):!1}return!1}:()=>!1}function ZY(e){if(typeof e!=`string`)throw Error(`string expected`);e=LJ.normalize(e),e=e.replace(/\\/g,`/`);let t=!1;e.startsWith(`//`)&&(t=!0);let n=/\/\//;for(;e.match(n);)e=e.replace(n,`/`);return t&&(e=`/`+e),e}function QY(e,t,n){let r=ZY(t);for(let t=0;t<e.length;t++){let i=e[t];if(i(r,n))return!0}return!1}function $Y(e,t){if(e==null)throw TypeError(`anymatch: specify first argument`);let n=JY(e).map(e=>XY(e));return t==null?(e,t)=>QY(n,e,t):QY(n,t)}var eX=e=>{let t=JY(e).flat();if(!t.every(e=>typeof e===UY))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(nX)},tX=e=>{let t=e.replace(WY,zY),n=!1;for(t.startsWith(BY)&&(n=!0);t.match(GY);)t=t.replace(GY,zY);return n&&(t=zY+t),t},nX=e=>tX(LJ.normalize(tX(e))),rX=(e=``)=>t=>typeof t==`string`?nX(LJ.isAbsolute(t)?t:LJ.join(e,t)):t,iX=(e,t)=>LJ.isAbsolute(e)?e:LJ.join(t,e),aX=Object.freeze(new Set),oX=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==VY&&e!==HY&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await(0,FJ.readdir)(n)}catch{this._removeWatcher&&this._removeWatcher(LJ.dirname(n),LJ.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path=``,this._removeWatcher=dY,this.items=aX,Object.freeze(this)}},sX=`stat`,cX=`lstat`,lX=class{constructor(e,t,n){this.fsw=n;let r=e;this.path=e=e.replace(qY,``),this.watchPath=r,this.fullWatchPath=LJ.resolve(r),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=t,this.statMethod=t?sX:cX}entryPath(e){return LJ.join(this.watchPath,LJ.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},uX=class extends IJ.EventEmitter{constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?JY(e.ignored):JY([]),awaitWriteFinish:t===!0?n:typeof t==`object`?{...n,...t}:!1};gY&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let e=i.toLowerCase();e===`false`||e===`0`?r.usePolling=!1:e===`true`||e===`1`?r.usePolling=!0:r.usePolling=!!e}let a=process.env.CHOKIDAR_INTERVAL;a&&(r.interval=Number.parseInt(a,10));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=dY,this._readyEmitted=!0,process.nextTick(()=>this.emit(_Y.READY)))},this._emitRaw=(...e)=>this.emit(_Y.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new RY(this),Object.freeze(r)}_addIgnoredPath(e){if(YY(e)){for(let t of this._ignoredPaths)if(YY(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e==`string`)for(let t of this._ignoredPaths)YY(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,n){let{cwd:r}=this.options;this.closed=!1,this._closePromise=void 0;let i=eX(e);return r&&(i=i.map(e=>iX(e,r))),i.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||=0,this._readyCount+=i.length,Promise.all(i.map(async e=>{let r=await this._nodeFsHandler._addToNodeFs(e,!n,void 0,0,t);return r&&this._emitReady(),r})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(LJ.dirname(e),LJ.basename(t||e))})}),this}unwatch(e){if(this.closed)return this;let t=eX(e),{cwd:n}=this.options;return t.forEach(e=>{!LJ.isAbsolute(e)&&!this._closers.has(e)&&(n&&(e=LJ.join(n,e)),e=LJ.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(t=>{let n=t();n instanceof Promise&&e.push(n)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let r=(this.options.cwd?LJ.relative(this.options.cwd,n):n)||VY;e[r]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==_Y.ERROR&&this.emit(_Y.ALL,...t)}async _emit(e,t,n){if(this.closed)return;let r=this.options;pY&&(t=LJ.normalize(t)),r.cwd&&(t=LJ.relative(r.cwd,t));let i=[e,t];n!=null&&i.push(n);let a=r.awaitWriteFinish,o;if(a&&(o=this._pendingWrites.get(t)))return o.lastChange=new Date,this;if(r.atomic){if(e===_Y.UNLINK)return this._pendingUnlinks.set(t,i),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(_Y.ALL,...e),this._pendingUnlinks.delete(t)})},typeof r.atomic==`number`?r.atomic:100),this;e===_Y.ADD&&this._pendingUnlinks.has(t)&&(e=i[0]=_Y.CHANGE,this._pendingUnlinks.delete(t))}if(a&&(e===_Y.ADD||e===_Y.CHANGE)&&this._readyEmitted)return this._awaitWriteFinish(t,a.stabilityThreshold,e,(t,n)=>{t?(e=i[0]=_Y.ERROR,i[1]=t,this.emitWithAll(e,i)):n&&(i.length>2?i[2]=n:i.push(n),this.emitWithAll(e,i))}),this;if(e===_Y.CHANGE&&!this._throttle(_Y.CHANGE,t,50))return this;if(r.alwaysStat&&n===void 0&&(e===_Y.ADD||e===_Y.ADD_DIR||e===_Y.CHANGE)){let e=r.cwd?LJ.join(r.cwd,t):t,n;try{n=await(0,FJ.stat)(e)}catch{}if(!n||this.closed)return;i.push(n)}return this.emitWithAll(e,i),this}_handleError(e){let t=e&&e.code;return e&&t!==`ENOENT`&&t!==`ENOTDIR`&&(!this.options.ignorePermissionErrors||t!==`EPERM`&&t!==`EACCES`)&&this.emit(_Y.ERROR,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw Error(`invalid throttle`);let i=r.get(t);if(i)return i.count++,!1;let a,o=()=>{let e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(a),e&&clearTimeout(e.timeoutObject),n};a=setTimeout(o,n);let s={timeoutObject:a,clear:o,count:0};return r.set(t,s),s}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,r){let i=this.options.awaitWriteFinish;if(typeof i!=`object`)return;let a=i.pollInterval,o,s=e;this.options.cwd&&!LJ.isAbsolute(e)&&(s=LJ.join(this.options.cwd,e));let c=new Date,l=this._pendingWrites;function u(n){(0,PJ.stat)(s,(i,s)=>{if(i||!l.has(e)){i&&i.code!==`ENOENT`&&r(i);return}let c=Number(new Date);n&&s.size!==n.size&&(l.get(e).lastChange=c),c-l.get(e).lastChange>=t?(l.delete(e),r(void 0,s)):o=setTimeout(u,a,s)})}l.has(e)||(l.set(e,{lastChange:c,cancelWait:()=>(l.delete(e),clearTimeout(o),n)}),o=setTimeout(u,a))}_isIgnored(e,t){if(this.options.atomic&&KY.test(e))return!0;if(!this._userIgnored){let{cwd:e}=this.options,t=(this.options.ignored||[]).map(rX(e)),n=[...[...this._ignoredPaths].map(rX(e)),...t];this._userIgnored=$Y(n,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new lX(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=LJ.resolve(e);return this._watched.has(t)||this._watched.set(t,new oX(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,t,n){let r=LJ.join(e,t),i=LJ.resolve(r);if(n??=this._watched.has(r)||this._watched.has(i),!this._throttle(`remove`,r,100))return;!n&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(r).getChildren().forEach(e=>this._remove(r,e));let a=this._getWatchedDir(e),o=a.has(t);a.remove(t),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let s=r;if(this.options.cwd&&(s=LJ.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(s)&&this._pendingWrites.get(s).cancelWait()===_Y.ADD)return;this._watched.delete(r),this._watched.delete(i);let c=n?_Y.UNLINK_DIR:_Y.UNLINK;o&&!this._isIgnored(r)&&this._emit(c,r),this._closePath(r)}_closePath(e){this._closeFile(e);let t=LJ.dirname(e);this._getWatchedDir(t).remove(LJ.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n=rY(e,{type:_Y.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(n),n.once(uY,()=>{n=void 0}),n.once(lY,()=>{n&&=(this._streams.delete(n),void 0)}),n}};function dX(e,t={}){let n=new uX(t);return n.add(e),n}var fX=class{constructor(e,t,n){this.registryPath=e,this.onUpdate=t,this.log=n}registryPath;onUpdate;log;heartbeats=new Map;registeredWorkers=new Set;watchQueueConsumers=!1;externalServices=new Map;watcher;watch(e,t=!1){e.size===0&&!t||!this.registryPath||(this.externalServices=new Map(e),this.watchQueueConsumers=t,(0,MJ.mkdirSync)(this.registryPath,{recursive:!0}),this.watcher||=dX(this.registryPath,{usePolling:process.platform===`win32`,interval:100}).on(`all`,()=>{this.refresh()}))}dispose(){return this.unregisterWorkers(),this.watcher?.close().finally(()=>{this.watcher=void 0})}unregisterWorkers(){for(let e of this.registeredWorkers)this.unregister(e);this.registeredWorkers.clear()}unregister(e){try{let t=this.heartbeats.get(e);t&&(this.heartbeats.delete(e),clearInterval(t)),this.registryPath&&(0,MJ.unlinkSync)(NJ.default.join(this.registryPath,e))}catch(t){this.log?.debug(`Failed to unregister worker "${e}": ${t}`)}}isEnabled(){return this.registryPath!==void 0&&this.registryPath!==``}getRegistry(){return this.registryPath?mX(this.registryPath):{}}getRegistryPath(){return this.registryPath}async updateRegistryPath(e,t){this.unregisterWorkers(),this.onUpdate=t,e!==this.registryPath&&(await this.watcher?.close(),this.watcher=void 0,this.registryPath=e)}register(e){if(this.registryPath){(0,MJ.mkdirSync)(this.registryPath,{recursive:!0});for(let[t,n]of Object.entries(e)){let e=NJ.default.join(this.registryPath,t),r=this.heartbeats.get(t);r&&clearInterval(r),(0,MJ.writeFileSync)(e,JSON.stringify(n,null,2)),this.registeredWorkers.add(t),this.heartbeats.set(t,setInterval(()=>{(0,MJ.existsSync)(e)&&(0,MJ.utimesSync)(e,new Date,new Date)},3e4))}this.refresh()}}previousJSON=`{}`;refresh(){if(!this.onUpdate)return;(0,jJ.default)(this.registryPath);let e=mX(this.registryPath),t=JSON.stringify(e);if(t===this.previousJSON)return;let n=JSON.parse(this.previousJSON);if(this.previousJSON=t,this.watchQueueConsumers&&pX(e)!==pX(n)){this.onUpdate(e);return}for(let[t]of this.externalServices)if(JSON.stringify(e[t])!==JSON.stringify(n[t])){this.onUpdate(e);break}}};function pX(e){return JSON.stringify(Object.entries(e).filter(([,e])=>e.queueConsumers!==void 0).map(([e,t])=>[e,t.debugPortAddress,t.queueConsumers]).sort(([e],[t])=>e.localeCompare(t)))}function mX(e){let t={};if(!(0,MJ.existsSync)(e))return t;for(let n of(0,MJ.readdirSync)(e))try{let r=NJ.default.join(e,n),i=(0,MJ.statSync)(r,{throwIfNoEntry:!1});if(i===void 0||i.mtime.getTime()<Date.now()-3e5){try{(0,MJ.unlinkSync)(r)}catch{}continue}let a=(0,MJ.readFileSync)(r,{encoding:`utf8`,flag:`r`});t[n]=JSON.parse(a)}catch{}return t}function hX(){return process.env.MINIFLARE_REGISTRY_PATH??NJ.default.join(Uo(),`registry`)}function gX(e){let t,n,r,i;return typeof e==`string`?t=e:typeof e==`object`&&`name`in e&&(t=e.name===Rz?void 0:e.name,n=e.entrypoint,r=e.props,i=e.remoteProxyConnectionString),{serviceName:t,entrypoint:n,props:r,remoteProxyConnectionString:i}}var _X=/[^0-9a-zA-Z_\$]/g;function vX(e,t){return`${e.replace(_X,`_`)}_${t}`}var yX=new Set(`text/html,text/richtext,text/plain,text/css,text/x-script,text/x-component,text/x-java-source,text/x-markdown,application/javascript,application/x-javascript,text/javascript,text/js,image/x-icon,image/vnd.microsoft.icon,application/x-perl,application/x-httpd-cgi,text/xml,application/xml,application/rss+xml,application/vnd.api+json,application/x-protobuf,application/json,multipart/bag,multipart/mixed,application/xhtml+xml,font/ttf,font/otf,font/x-woff,image/svg+xml,application/vnd.ms-fontobject,application/ttf,application/x-ttf,application/otf,application/x-otf,application/truetype,application/opentype,application/x-opentype,application/font-woff,application/eot,application/font,application/font-sfnt,application/wasm,application/javascript-binast,application/manifest+json,application/ld+json,application/graphql+json,application/geo+json`.split(`,`));function bX(e){if(!e)return!0;let[t]=e.split(`;`);return yX.has(t)}var xX=`SecretsStoreSecret::admin_api`,SX=m(e(`node:assert`)),CX=m(e(`node:util`)),wX=Symbol(`kMessages`),TX=Symbol(`kActual`),EX=Symbol(`kGroupId`),DX=[Ag,Ng,jg,Mg,kg],OX=Map;function kX(e){return typeof e==`object`&&!!e&&wX in e&&TX in e}function AX(e){return typeof e==`object`&&!!e}function jX(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function MX(e,t){return e.message===t.message&&jX(e.path,t.path)}function NX(e,t){let n;for(let r of e)if(!(r.path.length<t)){if(n===void 0)n=r;else if(!MX(n,r))return!0}return!1}function PX(e,t,n,r,i,a){if(i.length===0){if(r.code===`invalid_union`){let i=r.unionErrors.flatMap(({issues:e})=>e),a,o=NX(i,r.path.length+1);AX(n)&&o&&(a=e.size,e.set(a,0));for(let s of i){let i=s.path.slice(r.path.length);o&&i.length===0||(t=PX(e,t,n,s,i,a))}return t}let i=r.message;if(t!==void 0)return kX(t)&&!t[wX].includes(i)&&t[wX].push(i),t;if(a!==void 0){let t=e.get(a);(0,SX.default)(t!==void 0),e.set(a,t+1)}return{[wX]:[i],[TX]:n,[EX]:a}}let[o,...s]=i;if((0,SX.default)(AX(n),`Expected object/array input for nested issue`),t===void 0)if(Array.isArray(n))t=Array(n.length);else{let e=Object.keys(n).map(e=>[e,void 0]);t=Object.fromEntries(e)}return(0,SX.default)(AX(t),`Expected object/array for nested issue`),t[o]=PX(e,t[o],n[o],r,s,a),t}function FX(e,t,n,r=``,i){let a=i?.prefix??``,o=i?.suffix??``;if(kX(n)){let i=r+` `.repeat(a.length),s=CX.default.inspect(n[TX],e).split(`
814
814
  `).map((e,t)=>t>0?i+e:e).join(`
815
815
  `),c=Og,l=i+`^`,u=``;if(n[EX]!==void 0){c=DX[n[EX]%DX.length],l+=n[EX]+1;let e=t.get(n[EX]);(0,SX.default)(e!==void 0),e>1&&(u=` *or*`),t.set(n[EX],e-1)}l+=` `;let d=` `.repeat(l.length),f=n[wX].flatMap(e=>e.split(`
816
816
  `)).map((e,t)=>t>0?d+e:e).join(`
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{E as e,S as t,T as n,i as r,n as i}from"./auth-BqDOIrKX.mjs";import{n as a,t as o}from"./body-parser-CBpeIUns.mjs";import{t as s}from"./output-CUxZRM5A.mjs";import{n as c,t as l}from"./progress-Cent9Lsg.mjs";import{n as u}from"./input-validation-CTqtyiY9.mjs";function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`clear`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:d,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Creating`,async()=>n.cache.cacheReserve.clear({zone_id:r})),{successLabel:`Created`})}};function p(e){return e.option(`value`,{type:`string`,description:`Value of the Cache Reserve zone setting.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`edit`,describe:`Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`,builder:p,handler:async n=>{if(n.dryRun){c({command:`cf cache cache-reserve edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({value:u(n.value,`value`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Updating`,async()=>r.cache.cacheReserve.edit({...e,zone_id:d})),{successLabel:`Updated`});return}n.value===void 0&&(n.value=await e(`value`,`Value of the Cache Reserve zone setting.`,[`on`,`off`]));let f=o({value:u(n.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.cacheReserve.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`,builder:h,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.cacheReserve.get({zone_id:r})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`status`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:_,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.cacheReserve.status({zone_id:r})),{successLabel:`Loaded`})}},y={command:`cache-reserve`,describe:`Persistent storage tier that keeps cached assets even after eviction from edge caches`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`purge`,describe:'### Purge All Cached Content Removes ALL files from Cloudflare\'s cache. All tiers can purge everything. ``` {"purge_everything": true} ``` ### Purge Cached Content by URL Granularly removes one or more files from Cloudflare\'s cache by specifying URLs. All tiers can purge by URL. To purge files with custom cache keys, include the headers used to compute the cache key as in the example. If you have a device type or geo in your cache key, you will need to include the CF-Device-Type or CF-IPCountry headers. If you have lang in your cache key, you will need to include the Accept-Language header. **NB:** When including the Origin header, be sure to include the **scheme** and **hostname**. The port number can be omitted if it is the default port (80 for http, 443 for https), but must be included otherwise. Single file purge example with files: ``` {"files": ["http://www.example.com/css/styles.css", "http://www.example.com/js/index.js"]} ``` Single file purge example with url and header pairs: ``` {"files": [{"url": "http://www.example.com/cat_picture.jpg", "headers": {"CF-IPCountry": "US", "CF-Device-Type": "desktop", "Accept-Language": "zh-CN"}}, {"url": "http://www.example.com/dog_picture.jpg", "headers": {"CF-IPCountry": "EU", "CF-Device-Type": "mobile", "Accept-Language": "en-US"}}]} ``` ### Purge Cached Content by Tag, Host or Prefix Granularly removes one or more files from Cloudflare\'s cache either by specifying the host, the associated Cache-Tag, or a Prefix. Flex purge with tags: ``` {"tags": ["a-cache-tag", "another-cache-tag"]} ``` Flex purge with hosts: ``` {"hosts": ["www.example.com", "images.example.com"]} ``` Flex purge with prefixes: ``` {"prefixes": ["www.example.com/foo", "images.example.com/bar/baz"]} ``` ### Availability and limits Please refer to [purge cache availability and limits documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).',builder:b,handler:async e=>{if(e.dryRun){c({command:`cf cache purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/purge_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let o=await i(e),u=await t({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=u,!await n({force:!!e.force,message:`This operation destroys cached content for a zone.`})){process.stderr.write(`Aborted.
3
- `);return}if(e.body){let t=a(e.body);s(await l(`Deleting`,async()=>o.cache.purge({body:t,zone_id:u})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>r(o,`POST`,`/zones/${e.zoneId}/purge_cache`)),{successLabel:`Deleted`})}};function S(e){return e.option(`value`,{type:`string`,description:`Value of the Regional Tiered Cache zone setting.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`edit`,describe:`Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`,builder:S,handler:async n=>{if(n.dryRun){c({command:`cf cache regional-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({value:u(n.value,`value`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Updating`,async()=>r.cache.regionalTieredCache.edit({...e,zone_id:d})),{successLabel:`Updated`});return}n.value===void 0&&(n.value=await e(`value`,`Value of the Regional Tiered Cache zone setting.`,[`on`,`off`]));let f=o({value:u(n.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.regionalTieredCache.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`,builder:w,handler:async e=>{if(e.dryRun){c({command:`cf cache regional-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.regionalTieredCache.get({zone_id:r})),{successLabel:`Loaded`})}},E={command:`regional-tiered-cache`,describe:`Restrict tiered cache topology to data centers within a specific geographic region`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:D,handler:async e=>{if(e.dryRun){c({command:`cf cache smart-tiered-cache delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
4
- `);return}s(await l(`Deleting`,async()=>r.cache.smartTieredCache.delete({zone_id:a})),{successLabel:`Deleted`})}};function k(e){return e.option(`value`,{type:`string`,description:`Enable or disable the Smart Tiered Cache.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Smart Tiered Cache.`})}const A={command:`edit`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:k,handler:async n=>{if(n.dryRun){c({command:`cf cache smart-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({value:u(n.value,`value`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Updating`,async()=>r.cache.smartTieredCache.edit({body:e,zone_id:d})),{successLabel:`Updated`});return}n.value===void 0&&(n.value=await e(`value`,`Enable or disable the Smart Tiered Cache.`,[`on`,`off`]));let f=o({value:u(n.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.smartTieredCache.edit({body:f,zone_id:d})),{successLabel:`Updated`})}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:j,handler:async e=>{if(e.dryRun){c({command:`cf cache smart-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.smartTieredCache.get({zone_id:r})),{successLabel:`Loaded`})}},N={command:`smart-tiered-cache`,describe:`Automatically determine the best upper-tier data centers for tiered cache topology`,builder:e=>e.command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`delete`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:P,handler:async e=>{if(e.dryRun){c({command:`cf cache variants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
5
- `);return}s(await l(`Deleting`,async()=>r.cache.variants.delete({zone_id:a})),{successLabel:`Deleted`})}};function I(e){return e.option(`value-avif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for avif.`}).option(`value-bmp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for bmp.`}).option(`value-gif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for gif.`}).option(`value-jp2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jp2.`}).option(`value-jpeg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpeg.`}).option(`value-jpg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg.`}).option(`value-jpg2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg2.`}).option(`value-png`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for png.`}).option(`value-tif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tif.`}).option(`value-tiff`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tiff.`}).option(`value-webp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for webp.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`edit`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:I,handler:async e=>{if(e.dryRun){c({command:`cf cache variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:{avif:e[`value-avif`],bmp:e[`value-bmp`],gif:e[`value-gif`],jp2:e[`value-jp2`],jpeg:e[`value-jpeg`],jpg:e[`value-jpg`],jpg2:e[`value-jpg2`],png:e[`value-png`],tif:e[`value-tif`],tiff:e[`value-tiff`],webp:e[`value-webp`]}}):a(e.body)});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=r,e.body){let t=a(e.body);s(await l(`Updating`,async()=>n.cache.variants.edit({...t,zone_id:r})),{successLabel:`Updated`});return}let u=o({value:{avif:e[`value-avif`],bmp:e[`value-bmp`],gif:e[`value-gif`],jp2:e[`value-jp2`],jpeg:e[`value-jpeg`],jpg:e[`value-jpg`],jpg2:e[`value-jpg2`],png:e[`value-png`],tif:e[`value-tif`],tiff:e[`value-tiff`],webp:e[`value-webp`]}});s(await l(`Updating`,async()=>n.cache.variants.edit({...u,zone_id:r})),{successLabel:`Updated`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:R,handler:async e=>{if(e.dryRun){c({command:`cf cache variants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.variants.get({zone_id:r})),{successLabel:`Loaded`})}},B={command:`variants`,describe:`Serve different cached versions of an image based on the Accept header (WebP, AVIF, etc.)`,builder:e=>e.command(F).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`cache`,describe:`Purge cached content and configure Cache Reserve, tiered caching, and variant serving`,builder:e=>e.command(x).command(y).command(E).command(N).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
2
+ import{T as e,w as t,x as n}from"./oauth-Bk-F-tIO.mjs";import{i as r,n as i}from"./auth-CSC4yhEJ.mjs";import{n as a,t as o}from"./body-parser-DWSy7uZ8.mjs";import{t as s}from"./output-B6fBFRqe.mjs";import{n as c,t as l}from"./progress-DrDErV9w.mjs";import{n as u}from"./input-validation-_fMCApaH.mjs";function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`clear`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:d,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Creating`,async()=>t.cache.cacheReserve.clear({zone_id:r})),{successLabel:`Created`})}};function p(e){return e.option(`value`,{type:`string`,description:`Value of the Cache Reserve zone setting.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`edit`,describe:`Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`,builder:p,handler:async t=>{if(t.dryRun){c({command:`cf cache cache-reserve edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({value:u(t.value,`value`,`text`)}):a(t.body)});return}let r=await i(t),d=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.cache.cacheReserve.edit({...e,zone_id:d})),{successLabel:`Updated`});return}t.value===void 0&&(t.value=await e(`value`,`Value of the Cache Reserve zone setting.`,[`on`,`off`]));let f=o({value:u(t.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.cacheReserve.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`,builder:h,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.cache.cacheReserve.get({zone_id:r})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`status`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:_,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.cache.cacheReserve.status({zone_id:r})),{successLabel:`Loaded`})}},y={command:`cache-reserve`,describe:`Persistent storage tier that keeps cached assets even after eviction from edge caches`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`purge`,describe:'### Purge All Cached Content Removes ALL files from Cloudflare\'s cache. All tiers can purge everything. ``` {"purge_everything": true} ``` ### Purge Cached Content by URL Granularly removes one or more files from Cloudflare\'s cache by specifying URLs. All tiers can purge by URL. To purge files with custom cache keys, include the headers used to compute the cache key as in the example. If you have a device type or geo in your cache key, you will need to include the CF-Device-Type or CF-IPCountry headers. If you have lang in your cache key, you will need to include the Accept-Language header. **NB:** When including the Origin header, be sure to include the **scheme** and **hostname**. The port number can be omitted if it is the default port (80 for http, 443 for https), but must be included otherwise. Single file purge example with files: ``` {"files": ["http://www.example.com/css/styles.css", "http://www.example.com/js/index.js"]} ``` Single file purge example with url and header pairs: ``` {"files": [{"url": "http://www.example.com/cat_picture.jpg", "headers": {"CF-IPCountry": "US", "CF-Device-Type": "desktop", "Accept-Language": "zh-CN"}}, {"url": "http://www.example.com/dog_picture.jpg", "headers": {"CF-IPCountry": "EU", "CF-Device-Type": "mobile", "Accept-Language": "en-US"}}]} ``` ### Purge Cached Content by Tag, Host or Prefix Granularly removes one or more files from Cloudflare\'s cache either by specifying the host, the associated Cache-Tag, or a Prefix. Flex purge with tags: ``` {"tags": ["a-cache-tag", "another-cache-tag"]} ``` Flex purge with hosts: ``` {"hosts": ["www.example.com", "images.example.com"]} ``` Flex purge with prefixes: ``` {"prefixes": ["www.example.com/foo", "images.example.com/bar/baz"]} ``` ### Availability and limits Please refer to [purge cache availability and limits documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).',builder:b,handler:async e=>{if(e.dryRun){c({command:`cf cache purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/purge_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let o=await i(e),u=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=u,!await t({force:!!e.force,message:`This operation destroys cached content for a zone.`})){process.stderr.write(`Aborted.
3
+ `);return}if(e.body){let t=a(e.body);s(await l(`Deleting`,async()=>o.cache.purge({body:t,zone_id:u})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>r(o,`POST`,`/zones/${e.zoneId}/purge_cache`)),{successLabel:`Deleted`})}};function S(e){return e.option(`value`,{type:`string`,description:`Value of the Regional Tiered Cache zone setting.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`edit`,describe:`Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`,builder:S,handler:async t=>{if(t.dryRun){c({command:`cf cache regional-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({value:u(t.value,`value`,`text`)}):a(t.body)});return}let r=await i(t),d=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.cache.regionalTieredCache.edit({...e,zone_id:d})),{successLabel:`Updated`});return}t.value===void 0&&(t.value=await e(`value`,`Value of the Regional Tiered Cache zone setting.`,[`on`,`off`]));let f=o({value:u(t.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.regionalTieredCache.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`,builder:w,handler:async e=>{if(e.dryRun){c({command:`cf cache regional-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.cache.regionalTieredCache.get({zone_id:r})),{successLabel:`Loaded`})}},E={command:`regional-tiered-cache`,describe:`Restrict tiered cache topology to data centers within a specific geographic region`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:D,handler:async e=>{if(e.dryRun){c({command:`cf cache smart-tiered-cache delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await t({force:!!e.force})){process.stderr.write(`Aborted.
4
+ `);return}s(await l(`Deleting`,async()=>r.cache.smartTieredCache.delete({zone_id:a})),{successLabel:`Deleted`})}};function k(e){return e.option(`value`,{type:`string`,description:`Enable or disable the Smart Tiered Cache.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Smart Tiered Cache.`})}const A={command:`edit`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:k,handler:async t=>{if(t.dryRun){c({command:`cf cache smart-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({value:u(t.value,`value`,`text`)}):a(t.body)});return}let r=await i(t),d=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.cache.smartTieredCache.edit({body:e,zone_id:d})),{successLabel:`Updated`});return}t.value===void 0&&(t.value=await e(`value`,`Enable or disable the Smart Tiered Cache.`,[`on`,`off`]));let f=o({value:u(t.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.smartTieredCache.edit({body:f,zone_id:d})),{successLabel:`Updated`})}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:j,handler:async e=>{if(e.dryRun){c({command:`cf cache smart-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.cache.smartTieredCache.get({zone_id:r})),{successLabel:`Loaded`})}},N={command:`smart-tiered-cache`,describe:`Automatically determine the best upper-tier data centers for tiered cache topology`,builder:e=>e.command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`delete`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:P,handler:async e=>{if(e.dryRun){c({command:`cf cache variants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await t({force:!!e.force})){process.stderr.write(`Aborted.
5
+ `);return}s(await l(`Deleting`,async()=>r.cache.variants.delete({zone_id:a})),{successLabel:`Deleted`})}};function I(e){return e.option(`value-avif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for avif.`}).option(`value-bmp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for bmp.`}).option(`value-gif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for gif.`}).option(`value-jp2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jp2.`}).option(`value-jpeg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpeg.`}).option(`value-jpg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg.`}).option(`value-jpg2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg2.`}).option(`value-png`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for png.`}).option(`value-tif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tif.`}).option(`value-tiff`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tiff.`}).option(`value-webp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for webp.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`edit`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:I,handler:async e=>{if(e.dryRun){c({command:`cf cache variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:{avif:e[`value-avif`],bmp:e[`value-bmp`],gif:e[`value-gif`],jp2:e[`value-jp2`],jpeg:e[`value-jpeg`],jpg:e[`value-jpg`],jpg2:e[`value-jpg2`],png:e[`value-png`],tif:e[`value-tif`],tiff:e[`value-tiff`],webp:e[`value-webp`]}}):a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.cache.variants.edit({...n,zone_id:r})),{successLabel:`Updated`});return}let u=o({value:{avif:e[`value-avif`],bmp:e[`value-bmp`],gif:e[`value-gif`],jp2:e[`value-jp2`],jpeg:e[`value-jpeg`],jpg:e[`value-jpg`],jpg2:e[`value-jpg2`],png:e[`value-png`],tif:e[`value-tif`],tiff:e[`value-tiff`],webp:e[`value-webp`]}});s(await l(`Updating`,async()=>t.cache.variants.edit({...u,zone_id:r})),{successLabel:`Updated`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:R,handler:async e=>{if(e.dryRun){c({command:`cf cache variants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.cache.variants.get({zone_id:r})),{successLabel:`Loaded`})}},B={command:`variants`,describe:`Serve different cached versions of an image based on the Accept header (WebP, AVIF, etc.)`,builder:e=>e.command(F).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`cache`,describe:`Purge cached content and configure Cache Reserve, tiered caching, and variant serving`,builder:e=>e.command(x).command(y).command(E).command(N).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,T as t,_ as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";import{t as u}from"./local-D8bhHUMK.mjs";function d(e){return e.option(`name`,{type:`string`,description:`A short description of Calls app, not shown to end users.`,default:``}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Creates a new Cloudflare calls app. An app is an unique enviroment where each Session can access all Tracks within the app.`,builder:d,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps`,pathParams:{},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.calls.sfu.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Creating`,async()=>d.calls.sfu.create({body:p,account_id:f})),{successLabel:`Created`})}};function p(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <app-id>`,describe:`Deletes an app from Cloudflare Calls`,builder:p,handler:async i=>{if(i.dryRun){s({command:`cf calls sfu delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}`,pathParams:{"app-id":String(i[`app-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>a.calls.sfu.delete({account_id:l,app_id:i[`app-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <app-id>`,describe:`Fetches details for a single Calls app.`,builder:h,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.sfu.get({account_id:a,app_id:t[`app-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`Lists all apps in the Cloudflare account`,builder:_,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps`,pathParams:{},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.sfu.list({account_id:a})),{successLabel:`Loaded`})}};function y(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`name`,{type:`string`,description:`A short description of Calls app, not shown to end users.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`update <app-id>`,describe:`Edit details for a single app.`,builder:y,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.calls.sfu.update({body:e,account_id:f,app_id:t[`app-id`]})),{successLabel:`Updated`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Updating`,async()=>d.calls.sfu.update({body:p,account_id:f,app_id:t[`app-id`]})),{successLabel:`Updated`})}},x={command:`sfu`,describe:`Operations for sfu`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`name`,{type:`string`,description:`A short description of a TURN key, not shown to end users.`,default:``}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`create`,describe:`Creates a new Cloudflare Calls TURN key.`,builder:S,handler:async t=>{if(t.dryRun){s({command:`cf calls turn create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys`,pathParams:{},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.calls.turn.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Creating`,async()=>d.calls.turn.create({body:p,account_id:f})),{successLabel:`Created`})}};function w(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`delete <key-id>`,describe:`Deletes a TURN key from Cloudflare Calls`,builder:w,handler:async i=>{if(i.dryRun){s({command:`cf calls turn delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${i[`key-id`]==null?`<key-id>`:encodeURIComponent(String(i[`key-id`]))}`,pathParams:{"key-id":String(i[`key-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
4
- `);return}o(await c(`Deleting`,async()=>a.calls.turn.delete({account_id:l,key_id:i[`key-id`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <key-id>`,describe:`Fetches details for a single TURN key.`,builder:E,handler:async t=>{if(t.dryRun){s({command:`cf calls turn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${t[`key-id`]==null?`<key-id>`:encodeURIComponent(String(t[`key-id`]))}`,pathParams:{"key-id":String(t[`key-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.turn.get({account_id:a,key_id:t[`key-id`]})),{successLabel:`Loaded`})}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Lists all TURN keys in the Cloudflare account`,builder:O,handler:async t=>{if(t.dryRun){s({command:`cf calls turn list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys`,pathParams:{},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.turn.list({account_id:a})),{successLabel:`Loaded`})}};function A(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`name`,{type:`string`,description:`A short description of a TURN key, not shown to end users.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`update <key-id>`,describe:`Edit details for a single TURN key.`,builder:A,handler:async t=>{if(t.dryRun){s({command:`cf calls turn update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${t[`key-id`]==null?`<key-id>`:encodeURIComponent(String(t[`key-id`]))}`,pathParams:{"key-id":String(t[`key-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.calls.turn.update({body:e,account_id:f,key_id:t[`key-id`]})),{successLabel:`Updated`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Updating`,async()=>d.calls.turn.update({body:p,account_id:f,key_id:t[`key-id`]})),{successLabel:`Updated`})}},M={command:`turn`,describe:`Operations for turn`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`calls`,describe:`calls`,builder:e=>e.command(x).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{N as default};
2
+ import{S as e,g as t,w as n}from"./oauth-Bk-F-tIO.mjs";import{n as r}from"./auth-CSC4yhEJ.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-DrDErV9w.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";import{t as u}from"./local-CYc9q7l2.mjs";function d(e){return e.option(`name`,{type:`string`,description:`A short description of Calls app, not shown to end users.`,default:``}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Creates a new Cloudflare calls app. An app is an unique enviroment where each Session can access all Tracks within the app.`,builder:d,handler:async n=>{if(n.dryRun){s({command:`cf calls sfu create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({name:l(n.name,`name`,`text`)}):i(n.body)});return}let d=await r(n),f=n.local?u:await t(d);if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Creating`,async()=>d.calls.sfu.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({name:l(n.name,`name`,`text`)});o(await c(`Creating`,async()=>d.calls.sfu.create({body:p,account_id:f})),{successLabel:`Created`})}};function p(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <app-id>`,describe:`Deletes an app from Cloudflare Calls`,builder:p,handler:async i=>{if(i.dryRun){s({command:`cf calls sfu delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}`,pathParams:{"app-id":String(i[`app-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await t(a);if(i.accountId=l,!await n({force:!!i.force})){process.stderr.write(`Aborted.
3
+ `);return}o(await c(`Deleting`,async()=>a.calls.sfu.delete({account_id:l,app_id:i[`app-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <app-id>`,describe:`Fetches details for a single Calls app.`,builder:h,handler:async n=>{if(n.dryRun){s({command:`cf calls sfu get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${n[`app-id`]==null?`<app-id>`:encodeURIComponent(String(n[`app-id`]))}`,pathParams:{"app-id":String(n[`app-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await t(i);n.accountId=a,o(await c(`Loading`,async()=>i.calls.sfu.get({account_id:a,app_id:n[`app-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`Lists all apps in the Cloudflare account`,builder:_,handler:async n=>{if(n.dryRun){s({command:`cf calls sfu list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps`,pathParams:{},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await t(i);n.accountId=a,o(await c(`Loading`,async()=>i.calls.sfu.list({account_id:a})),{successLabel:`Loaded`})}};function y(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`name`,{type:`string`,description:`A short description of Calls app, not shown to end users.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`update <app-id>`,describe:`Edit details for a single app.`,builder:y,handler:async n=>{if(n.dryRun){s({command:`cf calls sfu update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${n[`app-id`]==null?`<app-id>`:encodeURIComponent(String(n[`app-id`]))}`,pathParams:{"app-id":String(n[`app-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({name:l(n.name,`name`,`text`)}):i(n.body)});return}let d=await r(n),f=n.local?u:await t(d);if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Updating`,async()=>d.calls.sfu.update({body:e,account_id:f,app_id:n[`app-id`]})),{successLabel:`Updated`});return}let p=a({name:l(n.name,`name`,`text`)});o(await c(`Updating`,async()=>d.calls.sfu.update({body:p,account_id:f,app_id:n[`app-id`]})),{successLabel:`Updated`})}},x={command:`sfu`,describe:`Operations for sfu`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`name`,{type:`string`,description:`A short description of a TURN key, not shown to end users.`,default:``}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`create`,describe:`Creates a new Cloudflare Calls TURN key.`,builder:S,handler:async n=>{if(n.dryRun){s({command:`cf calls turn create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({name:l(n.name,`name`,`text`)}):i(n.body)});return}let d=await r(n),f=n.local?u:await t(d);if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Creating`,async()=>d.calls.turn.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({name:l(n.name,`name`,`text`)});o(await c(`Creating`,async()=>d.calls.turn.create({body:p,account_id:f})),{successLabel:`Created`})}};function w(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`delete <key-id>`,describe:`Deletes a TURN key from Cloudflare Calls`,builder:w,handler:async i=>{if(i.dryRun){s({command:`cf calls turn delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${i[`key-id`]==null?`<key-id>`:encodeURIComponent(String(i[`key-id`]))}`,pathParams:{"key-id":String(i[`key-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await t(a);if(i.accountId=l,!await n({force:!!i.force})){process.stderr.write(`Aborted.
4
+ `);return}o(await c(`Deleting`,async()=>a.calls.turn.delete({account_id:l,key_id:i[`key-id`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <key-id>`,describe:`Fetches details for a single TURN key.`,builder:E,handler:async n=>{if(n.dryRun){s({command:`cf calls turn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${n[`key-id`]==null?`<key-id>`:encodeURIComponent(String(n[`key-id`]))}`,pathParams:{"key-id":String(n[`key-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await t(i);n.accountId=a,o(await c(`Loading`,async()=>i.calls.turn.get({account_id:a,key_id:n[`key-id`]})),{successLabel:`Loaded`})}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Lists all TURN keys in the Cloudflare account`,builder:O,handler:async n=>{if(n.dryRun){s({command:`cf calls turn list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys`,pathParams:{},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await t(i);n.accountId=a,o(await c(`Loading`,async()=>i.calls.turn.list({account_id:a})),{successLabel:`Loaded`})}};function A(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`name`,{type:`string`,description:`A short description of a TURN key, not shown to end users.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`update <key-id>`,describe:`Edit details for a single TURN key.`,builder:A,handler:async n=>{if(n.dryRun){s({command:`cf calls turn update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${n[`key-id`]==null?`<key-id>`:encodeURIComponent(String(n[`key-id`]))}`,pathParams:{"key-id":String(n[`key-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({name:l(n.name,`name`,`text`)}):i(n.body)});return}let d=await r(n),f=n.local?u:await t(d);if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Updating`,async()=>d.calls.turn.update({body:e,account_id:f,key_id:n[`key-id`]})),{successLabel:`Updated`});return}let p=a({name:l(n.name,`name`,`text`)});o(await c(`Updating`,async()=>d.calls.turn.update({body:p,account_id:f,key_id:n[`key-id`]})),{successLabel:`Updated`})}},M={command:`turn`,describe:`Operations for turn`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`calls`,describe:`calls`,builder:e=>e.command(x).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{N as default};