cf 1.0.0-beta.27 → 1.0.0-beta.28

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 (267) hide show
  1. package/dist/_meta/commands.json +5787 -1914
  2. package/dist/_meta/hand-written-commands.json +2 -2
  3. package/dist/_meta/schemas.json +796 -557
  4. package/dist/{abuse-reports-RxXqfDEW.mjs → abuse-reports-D9edOyag.mjs} +5 -5
  5. package/dist/{access-BxEprr2f.mjs → access-CKCCSrrU.mjs} +1 -1
  6. package/dist/{accounts-DU2ZNYqP.mjs → accounts-CNb9U9bK.mjs} +22 -22
  7. package/dist/{acm-CBCIKBJ4.mjs → acm-CdKTAToZ.mjs} +3 -3
  8. package/dist/{addressing-BKxiLRHk.mjs → addressing-eZI_C-b0.mjs} +18 -18
  9. package/dist/{agent-memory-DkBpQYUL.mjs → agent-memory-BBHCEE7h.mjs} +7 -7
  10. package/dist/{ai-DqEN_hhg.mjs → ai-Csl_QNwv.mjs} +7 -7
  11. package/dist/ai-audit-DlqWsQi-.mjs +6 -0
  12. package/dist/{ai-gateway-B0uiYVHq.mjs → ai-gateway-Lj4On37s.mjs} +13 -13
  13. package/dist/{ai-search-DbZIxdio.mjs → ai-search-BxyhS3X7.mjs} +17 -17
  14. package/dist/{ai-security-CvZfP2JC.mjs → ai-security-DvU2iYkY.mjs} +3 -3
  15. package/dist/{alerting-BjGwBxZT.mjs → alerting-r0G2X9y9.mjs} +10 -10
  16. package/dist/{analytics-C7kT_H-W.mjs → analytics-C6bfqm-W.mjs} +7 -7
  17. package/dist/analytics-engine-BlIecoOe.mjs +4 -0
  18. package/dist/api-Dnt6lRJG.mjs +3 -0
  19. package/dist/{api-security-BbcvDtff.mjs → api-security-DZ7GWOqD.mjs} +26 -26
  20. package/dist/argo-Bh0_cj49.mjs +14 -0
  21. package/dist/{artifacts-2R2sxIKO.mjs → artifacts-VZJWVq_6.mjs} +16 -16
  22. package/dist/{audit-logs-LoBB1OO_.mjs → audit-logs-B8cGL4B9.mjs} +1 -1
  23. package/dist/auth-B-h0BHg7.mjs +2 -0
  24. package/dist/auth-B6tswVxH.mjs +2 -0
  25. package/dist/{auth-D499YE2n.mjs → auth-clmqFEWU.mjs} +3 -3
  26. package/dist/{auth-token-BwpERbnG.mjs → auth-token-DW4dJVdj.mjs} +1 -1
  27. package/dist/{autoconfig-B2w-woU0.mjs → autoconfig-C0ynlGHf.mjs} +47 -47
  28. package/dist/{basin-catalog-AgOHGiPI.mjs → basin-catalog-TehR1sKZ.mjs} +11 -11
  29. package/dist/billing-B2KusU6g.mjs +22 -0
  30. package/dist/{blocks-C8vyXIAT.mjs → blocks-BFulF68V.mjs} +1 -1
  31. package/dist/body-parser-DoewLePl.mjs +2 -0
  32. package/dist/{body-unions-CjpNjwSW.mjs → body-unions-DNs981Ia.mjs} +1 -1
  33. package/dist/{bot-management-fwxKIbaB.mjs → bot-management-CXHXgrQC.mjs} +2 -2
  34. package/dist/{botnet-feed-DCYB5kYZ.mjs → botnet-feed-UyK7Rfp6.mjs} +1 -1
  35. package/dist/brand-protection-kv1ba80i.mjs +14 -0
  36. package/dist/browser-run-D-vRoZmf.mjs +40 -0
  37. package/dist/build-BzJGqb2o.mjs +2 -0
  38. package/dist/build-FFxzigo4.mjs +2 -0
  39. package/dist/{builds-CoazxuN-.mjs → builds-BbxINHRP.mjs} +15 -15
  40. package/dist/cache-BacNNtLu.mjs +36 -0
  41. package/dist/{cf-hP0SOgC6.mjs → cf-BQ_LRiut.mjs} +2 -2
  42. package/dist/{chunk-DSGVRFIS-DQwKND2c.mjs → chunk-DSGVRFIS-BaNZNW-M.mjs} +1 -1
  43. package/dist/{chunk-SOBRPAPT-BKzUiNx_.mjs → chunk-SOBRPAPT-QTjnHSNs.mjs} +1 -1
  44. package/dist/{cli-Nqf58-1c.mjs → cli-B7vslRfu.mjs} +1 -1
  45. package/dist/{client-side-security-VmZzMy-m.mjs → client-side-security-bzB9JosR.mjs} +6 -6
  46. package/dist/{cloud-connector-bMlFnqP0.mjs → cloud-connector-BHtf37R5.mjs} +2 -2
  47. package/dist/{cloudflared-Ba4KWdTO.mjs → cloudflared-QDdHMUEY.mjs} +1 -1
  48. package/dist/{cloudforce-one-CCaIBOAo.mjs → cloudforce-one-DWBPQDA3.mjs} +71 -71
  49. package/dist/{command-C4OgtX_x.mjs → command-AVwd7XjE.mjs} +1 -1
  50. package/dist/{command-C5Kqc5Km.mjs → command-B87T_f2f.mjs} +1 -1
  51. package/dist/{command-CelQVrZL.mjs → command-CEHhi3t0.mjs} +1 -1
  52. package/dist/{command-ByYf12-8.mjs → command-CYmQE79n.mjs} +1 -1
  53. package/dist/{command-pMoNdd22.mjs → command-CbxXc5IW.mjs} +1 -1
  54. package/dist/{command-Bih1HLr3.mjs → command-Ce8CVLth.mjs} +1 -1
  55. package/dist/{command-MxFFWqMg.mjs → command-CqDudQZs.mjs} +1 -1
  56. package/dist/{command-BASaTmJc.mjs → command-D4YcwpVp.mjs} +1 -1
  57. package/dist/{command-BxZBNPxG.mjs → command-D895kdlh.mjs} +1 -1
  58. package/dist/{command-CrAlzysj.mjs → command-D9Qyi1B0.mjs} +1 -1
  59. package/dist/{command-BiIVclNA.mjs → command-DeutqL1n.mjs} +1 -1
  60. package/dist/{command-C0qCuw03.mjs → command-Dl9ICrRK.mjs} +1 -1
  61. package/dist/{command-CZAR85ba.mjs → command-DtCSe8Hy.mjs} +1 -1
  62. package/dist/{command-C2FVMd1b.mjs → command-DwzVtmb3.mjs} +1 -1
  63. package/dist/{command-CFxyp8Uo.mjs → command-wtBubtZ4.mjs} +1 -1
  64. package/dist/{completions-DRzBiqpv.mjs → completions-BvdKtzsX.mjs} +1 -1
  65. package/dist/{connector-interrupts-CrTeSyaM.mjs → connector-interrupts-dUPW6Ya_.mjs} +2 -2
  66. package/dist/{connector-telemetry-events-BbAOUt9h.mjs → connector-telemetry-events-DWVCqnhn.mjs} +1 -1
  67. package/dist/{connector-telemetry-snapshots-DcpBx7Qx.mjs → connector-telemetry-snapshots-CeMP3qeI.mjs} +1 -1
  68. package/dist/{connectors-D1WFLJoE.mjs → connectors-DZFGNw3i.mjs} +4 -4
  69. package/dist/containers-B06OGOEB.mjs +380 -0
  70. package/dist/{containers-BOBEs1Gk.mjs → containers-DCzQCo79.mjs} +8 -8
  71. package/dist/{content-scan-D1GfPSL0.mjs → content-scan-XhnNJqXf.mjs} +4 -4
  72. package/dist/{context-Dp4CXG22.mjs → context-BY1Eh_Qe.mjs} +1 -1
  73. package/dist/{cps-D4uhzg3k.mjs → cps-CohlxvuN.mjs} +2 -2
  74. package/dist/create-DmLDMvrj.mjs +2 -0
  75. package/dist/{csam-scanner-DOOUBeBM.mjs → csam-scanner-BV4bHq8v.mjs} +2 -2
  76. package/dist/{custom-csrs-DtdFo5YZ.mjs → custom-csrs-BVdMQjYq.mjs} +2 -2
  77. package/dist/{custom-hostnames-ccdlELaD.mjs → custom-hostnames-r-CxhSa1.mjs} +5 -5
  78. package/dist/{custom-nameservers-p3gDjfva.mjs → custom-nameservers-CapMDyly.mjs} +2 -2
  79. package/dist/{custom-pages-DAkKVzgR.mjs → custom-pages-BVIniWfq.mjs} +5 -5
  80. package/dist/{d1-CDIyRdh4.mjs → d1-nJCOJZb8.mjs} +20 -22
  81. package/dist/{delegate-B4bKqF7i.mjs → delegate-CcL6RoGw.mjs} +1 -1
  82. package/dist/delegate.mjs +1 -1
  83. package/dist/{deploy-BaC5Ty7F.mjs → deploy-DJMnWFNk.mjs} +1 -1
  84. package/dist/{deploy-context-DTTgNGro.mjs → deploy-context-YCW3eqP1.mjs} +15 -15
  85. package/dist/{deploy-input-mAy06fAI.mjs → deploy-input-CQLBXFEB.mjs} +1 -1
  86. package/dist/{dev-De-HszNT.mjs → dev-GsYHvMah.mjs} +1 -1
  87. package/dist/{diagnostics-D1CUs2o9.mjs → diagnostics-C3nqxsAO.mjs} +4 -4
  88. package/dist/{dist-D5qkmHhC.mjs → dist-D-ihn_mV.mjs} +42 -33
  89. package/dist/{dls-DWBiYzY1.mjs → dls-N1x8sAK3.mjs} +3 -3
  90. package/dist/{dns-wMjf1t6-.mjs → dns-DATWP-PF.mjs} +25 -25
  91. package/dist/{dns-firewall-DH9xIT5H.mjs → dns-firewall-n3Y2ui6W.mjs} +4 -4
  92. package/dist/{docs-BA7qslb2.mjs → docs-CRc_WOXh.mjs} +1 -1
  93. package/dist/{dry-run-gy0Hl9xo.mjs → dry-run-kJbjn4kG.mjs} +1 -1
  94. package/dist/{durable-objects-DF0MYpnV.mjs → durable-objects-DHK9w-vO.mjs} +2 -2
  95. package/dist/{email-auth-BShMFXn4.mjs → email-auth-ptdqNSTZ.mjs} +1 -1
  96. package/dist/{email-domains-CDSbVclP.mjs → email-domains-uL22-zRY.mjs} +2 -2
  97. package/dist/{email-routing-CBCkbg_F.mjs → email-routing-CV43rMJC.mjs} +12 -12
  98. package/dist/{email-security-CnNa1YON.mjs → email-security-DK_SJ0yi.mjs} +38 -38
  99. package/dist/{email-sending-CpDSw-Eb.mjs → email-sending-CTQafGec.mjs} +11 -11
  100. package/dist/{error-sanitization-DG8WSzHe.mjs → error-sanitization-BkgtZ0Vx.mjs} +1 -1
  101. package/dist/error-sanitization-D069tpKk.mjs +2 -0
  102. package/dist/{errors-DatLr-iR.mjs → errors-VG1mgwJl.mjs} +1 -1
  103. package/dist/{field-extractors-BwGdMnTr.mjs → field-extractors-jcZ_bAGc.mjs} +2 -2
  104. package/dist/{firewall-CY_oem-d.mjs → firewall-CW-fAI9m.mjs} +12 -12
  105. package/dist/{flagship-Bat5EZCk.mjs → flagship-RiLnDwfJ.mjs} +8 -8
  106. package/dist/{fraud-CSUKLh8X.mjs → fraud-DvfBBTe8.mjs} +2 -2
  107. package/dist/get-3XNn0upb.mjs +2 -0
  108. package/dist/{google-tag-gateway-C2skt6t-.mjs → google-tag-gateway-C5WYsSXv.mjs} +2 -2
  109. package/dist/{healthchecks-uC43QKQd.mjs → healthchecks-BA1fmzTm.mjs} +5 -5
  110. package/dist/{hyperdrive-FcBbpew4.mjs → hyperdrive-Ch6klUp3.mjs} +4 -4
  111. package/dist/{iam-8T74DNhH.mjs → iam-LlGEzRCq.mjs} +14 -14
  112. package/dist/{images-C3JUaf6b.mjs → images-C5WqUXkK.mjs} +11 -11
  113. package/dist/index.mjs +1 -1
  114. package/dist/{init-BEVVz4_P.mjs → init-EVsjBrOz.mjs} +2 -2
  115. package/dist/{intel-DRy4rHrt.mjs → intel-vcWyslaX.mjs} +14 -14
  116. package/dist/{interactive-CKHdGvkh.mjs → interactive-BCDFSPtq.mjs} +1 -1
  117. package/dist/{internal-CamuESs0.mjs → internal-BhV9WjLp.mjs} +1 -1
  118. package/dist/{ips-DinCNnWj.mjs → ips-CqHjVsqd.mjs} +1 -1
  119. package/dist/k2-CZT2Pd5J.mjs +10 -0
  120. package/dist/kv-Ipa7dnvF.mjs +12 -0
  121. package/dist/{lazy-command-WB1FOuew.mjs → lazy-command-DbKVgdGT.mjs} +1 -1
  122. package/dist/{leaked-credential-checks-CSZd9hBQ.mjs → leaked-credential-checks-EzT4TTjO.mjs} +4 -4
  123. package/dist/{live-B6AsI_E5.mjs → live-C9L1bNuE.mjs} +1 -1
  124. package/dist/{load-balancers-gap5u4b1.mjs → load-balancers-Cb3VkSfc.mjs} +21 -21
  125. package/dist/local-D5Vq6ooZ.mjs +2 -0
  126. package/dist/{local-CgBhtmON.mjs → local-DIJ7SIKC.mjs} +1 -1
  127. package/dist/{local-runtime-CmlJ20uJ.mjs → local-runtime-BZjgkacr.mjs} +1 -1
  128. package/dist/{login-BJHaTERg.mjs → login-DG5ebyab.mjs} +1 -1
  129. package/dist/login-DRJugxya.mjs +2 -0
  130. package/dist/{logpush-qhlxsioM.mjs → logpush-C5Gw7F_9.mjs} +16 -16
  131. package/dist/{logs-bI54CJ0w.mjs → logs-y3REfHbb.mjs} +8 -8
  132. package/dist/magic-network-monitoring-BZBGZB6M.mjs +34 -0
  133. package/dist/{magic-transit-BwDyySHJ.mjs → magic-transit-BPV_POf5.mjs} +129 -129
  134. package/dist/{managed-defense-CsBBkfeQ.mjs → managed-defense-BaUBSUcz.mjs} +3 -3
  135. package/dist/{managed-transforms-CUC-uAbW.mjs → managed-transforms-CjkjLzMC.mjs} +2 -2
  136. package/dist/{mcp-CyI0sDmL.mjs → mcp-RPtrISTy.mjs} +6 -6
  137. package/dist/{mesh-Czr0UCP4.mjs → mesh-DZ4QHBPE.mjs} +5 -5
  138. package/dist/{migrate-DKDWYrz2.mjs → migrate-CRIUqGi2.mjs} +1 -1
  139. package/dist/{monetization-NUgfDtSy.mjs → monetization-CVZqM8Xo.mjs} +4 -4
  140. package/dist/{network-B42zrBic.mjs → network-DLt2JUo1.mjs} +15 -15
  141. package/dist/{network-interconnects-DuIBe8fK.mjs → network-interconnects-9nS5jL__.mjs} +10 -10
  142. package/dist/{o11y-oEUpMC3O.mjs → o11y-ySxrnP1Z.mjs} +45 -43
  143. package/dist/{oauth-BmSFLp_s.mjs → oauth-CFVUl-Wv.mjs} +1 -1
  144. package/dist/{oauth-BLQ1-y3R.mjs → oauth-Cidoyxfp.mjs} +1 -1
  145. package/dist/{observability-BxhJQCgZ.mjs → observability-C-KNh__y.mjs} +1 -1
  146. package/dist/ohttp-gateway-B5nCl4s3.mjs +8 -0
  147. package/dist/organizations-DbeeWUL4.mjs +71 -0
  148. package/dist/output-BZQEl3mK.mjs +2 -0
  149. package/dist/package-B7RgwuFR.mjs +2 -0
  150. package/dist/{page-rules-J6LhwR-s.mjs → page-rules-DRw763O1.mjs} +4 -4
  151. package/dist/{pages-BksdnChs.mjs → pages-DfQnxiTk.mjs} +12 -12
  152. package/dist/{pay-per-crawl-BLcbHRoR.mjs → pay-per-crawl-EHYtSKxX.mjs} +13 -13
  153. package/dist/{pay-per-use-VatiU-Nt.mjs → pay-per-use-wdEhl8k4.mjs} +11 -11
  154. package/dist/{pipelines-B5AoB3f3.mjs → pipelines-DbyrI6F4.mjs} +11 -11
  155. package/dist/{precursor-D3VH2MXT.mjs → precursor-Dx8lN4UJ.mjs} +2 -2
  156. package/dist/previews-DEVNSip2.mjs +6 -0
  157. package/dist/{progress-DLri-rA7.mjs → progress-yvPscjYg.mjs} +1 -1
  158. package/dist/{prompt-D0dXwuME.mjs → prompt-CEpZ-lQZ.mjs} +1 -1
  159. package/dist/{queues-BsAck4To.mjs → queues-DgMc7Z6A.mjs} +18 -18
  160. package/dist/{r2-BYjdHDEZ.mjs → r2-BpTVicIq.mjs} +21 -21
  161. package/dist/{radar-CvLtu-Vr.mjs → radar-DW-S1VUh.mjs} +11 -11
  162. package/dist/{raw-fetch-DQeDx1wT.mjs → raw-fetch-Cl5spWC3.mjs} +1 -1
  163. package/dist/{ready-gsGEaWLL.mjs → ready-d0li0X6r.mjs} +1 -1
  164. package/dist/{realtime-DiCEgFTC.mjs → realtime-DMKHLYF4.mjs} +41 -41
  165. package/dist/{registrar-D4wdgWpo.mjs → registrar-D23gfKBi.mjs} +5 -5
  166. package/dist/{registrar-sandbox-B6yopzdG.mjs → registrar-sandbox-lVLB1-mC.mjs} +4 -4
  167. package/dist/{reporting-BiHgnT8L.mjs → reporting-WX8P3Y0k.mjs} +2 -2
  168. package/dist/{request-headers-CoxHUNcB.mjs → request-headers-C0FpeBhz.mjs} +1 -1
  169. package/dist/{request-tracers-817HTytF.mjs → request-tracers-qd7XOAka.mjs} +2 -2
  170. package/dist/resource-sharing-B2ZSt_cA.mjs +36 -0
  171. package/dist/{rules-CRhe_ca9.mjs → rules-CB0QQTB3.mjs} +5 -5
  172. package/dist/{rulesets-CKyc-Xlx.mjs → rulesets-DmqwixUC.mjs} +6 -6
  173. package/dist/{rum-BfnWHW_d.mjs → rum-BZ_24qZU.mjs} +9 -9
  174. package/dist/{run-Ciw_GIrC.mjs → run-BOKI1uWa.mjs} +1 -1
  175. package/dist/run-DBqOjD1P.mjs +2 -0
  176. package/dist/{schema-DuLIZRhA.mjs → schema-Dj9STsWI.mjs} +1 -1
  177. package/dist/{schema-cache-BIo0Gi2H.mjs → schema-cache-5NkOj7Y3.mjs} +1 -1
  178. package/dist/{schema-flags-DrqvwQNw.mjs → schema-flags-CXm9iIv6.mjs} +1 -1
  179. package/dist/{scim-C4iRWNYB.mjs → scim-DchxaJfE.mjs} +8 -8
  180. package/dist/{secrets-store-DgtzZRze.mjs → secrets-store-oAft1cFE.mjs} +5 -5
  181. package/dist/{security-insights-SlUGW3F_.mjs → security-insights-DMm0qg_m.mjs} +15 -15
  182. package/dist/{security-txt-C3YS0REz.mjs → security-txt-CIt0494b.mjs} +2 -2
  183. package/dist/{session-D2yuwO4i.mjs → session-vzNfUhPl.mjs} +1 -1
  184. package/dist/{shared--uVkAAd7.mjs → shared-MK-_lkbn.mjs} +1 -1
  185. package/dist/{signed-url-ClLk45_J.mjs → signed-url-gNangfwc.mjs} +1 -1
  186. package/dist/{smart-shield-Dn95hqUH.mjs → smart-shield-Boy_qbqd.mjs} +6 -6
  187. package/dist/{snippets-BNUKOajz.mjs → snippets-DdoDYXW-.mjs} +3 -3
  188. package/dist/{spawn-DuT4snxu.mjs → spawn-B5F4OIHG.mjs} +1 -1
  189. package/dist/{spectrum-Cj0BMtg2.mjs → spectrum-DLYIHelC.mjs} +3 -3
  190. package/dist/{speed-BrVeZRyX.mjs → speed-DugG9Tm9.mjs} +2 -2
  191. package/dist/{sql-BX1pBqj3.mjs → sql-Bb56llsb.mjs} +2 -2
  192. package/dist/src-BoSDeQ9m.mjs +133 -0
  193. package/dist/{ssl-Bx4LCutF.mjs → ssl-Bg4X3WGk.mjs} +24 -24
  194. package/dist/startup-profile-DQVkZZpb.mjs +2 -0
  195. package/dist/{startup-profile-DqaYNT0b.mjs → startup-profile-DZL2DC44.mjs} +1 -1
  196. package/dist/state-DW3QZtfh.mjs +2 -0
  197. package/dist/{state-BmzOLELo.mjs → state-mr5ux1Nb.mjs} +1 -1
  198. package/dist/{stream-BRzr6yh0.mjs → stream-BuZYDbNR.mjs} +21 -21
  199. package/dist/{tags-xVzjZxdt.mjs → tags-SKz2odE_.mjs} +3 -3
  200. package/dist/{telemetry-CJ9URio3.mjs → telemetry-B4zmCpT0.mjs} +1 -1
  201. package/dist/telemetry-DkDUr4KK.mjs +2 -0
  202. package/dist/{tenant-custom-nameservers-M7Fxqh2W.mjs → tenant-custom-nameservers-BhkhBerL.mjs} +2 -2
  203. package/dist/tenants-DD-GMq0K.mjs +13 -0
  204. package/dist/{tools-C-vmgYSv.mjs → tools-KW_4hvzY.mjs} +1 -1
  205. package/dist/{tunnels-DQVXKUKA.mjs → tunnels-D90ztENM.mjs} +6 -6
  206. package/dist/{turnstile-B_Ugzgom.mjs → turnstile-DhSU_Xar.mjs} +4 -4
  207. package/dist/ui-xjCox-gU.mjs +2 -0
  208. package/dist/{update-check-DHUo4FOJ.mjs → update-check-CRttabfu.mjs} +1 -1
  209. package/dist/{update-check-DRr0eRhB.mjs → update-check-HltjTMDE.mjs} +1 -1
  210. package/dist/update-check-worker.mjs +1 -1
  211. package/dist/{url-normalization-CZRQH_pJ.mjs → url-normalization-K7gkmPvG.mjs} +2 -2
  212. package/dist/{url-scanner-BH4PLy16.mjs → url-scanner-BRdWwka4.mjs} +3 -3
  213. package/dist/{user-Bn82Qw0Y.mjs → user-Cmb1_Wu5.mjs} +50 -50
  214. package/dist/{vectorize-DoVVz_sh.mjs → vectorize-BTBerJME.mjs} +11 -11
  215. package/dist/verify-B9ILCohg.mjs +2 -0
  216. package/dist/verify-BCuWaO-L.mjs +2 -0
  217. package/dist/version-6Bpy6Bgt.mjs +2 -0
  218. package/dist/{waiting-rooms-QUW131o3.mjs → waiting-rooms-LymmKIGr.mjs} +13 -13
  219. package/dist/{web-assets-CgQXsp8m.mjs → web-assets-LHPQsrnY.mjs} +21 -21
  220. package/dist/{web3-TY9s6Swn.mjs → web3-BsOio0Ae.mjs} +12 -12
  221. package/dist/workers-BnLiOjZf.mjs +39 -0
  222. package/dist/{workers-builds-BgGY0IGk.mjs → workers-builds-sKpITeRk.mjs} +4 -4
  223. package/dist/{workers-for-platforms-5RkV9MVp.mjs → workers-for-platforms-BGp6yr6P.mjs} +9 -9
  224. package/dist/{workers-vpc-Bt4OQbwM.mjs → workers-vpc-D8lefWDo.mjs} +3 -3
  225. package/dist/{workflows-6m85DdqF.mjs → workflows-B-ZIG3y7.mjs} +22 -22
  226. package/dist/{wrangler-migration-BbmGOu8l.mjs → wrangler-migration-6E6wT_LZ.mjs} +66 -57
  227. package/dist/{zaraz-8WSJ7l0L.mjs → zaraz-BBKki5WS.mjs} +11 -11
  228. package/dist/{zero-trust-DK0cqDZv.mjs → zero-trust-BZDXM5r6.mjs} +165 -165
  229. package/dist/{zones-DTAcguf6.mjs → zones-B-UV_DGE.mjs} +24 -24
  230. package/package.json +14 -14
  231. package/dist/ai-audit-BmzOgt6x.mjs +0 -6
  232. package/dist/analytics-engine-BHpcNSdD.mjs +0 -4
  233. package/dist/api-X3wKppsT.mjs +0 -3
  234. package/dist/argo-D1VONzu-.mjs +0 -14
  235. package/dist/auth-CspwoBlp.mjs +0 -2
  236. package/dist/auth-FK2eLQ02.mjs +0 -2
  237. package/dist/billing-DRNww0iC.mjs +0 -24
  238. package/dist/body-parser-BKcZS9iJ.mjs +0 -2
  239. package/dist/brand-protection-BVICLzBc.mjs +0 -26
  240. package/dist/browser-run-CEk-NIgP.mjs +0 -40
  241. package/dist/build-CRm2TQq8.mjs +0 -2
  242. package/dist/build-DO_GNhRl.mjs +0 -2
  243. package/dist/cache-jlLJLSu7.mjs +0 -36
  244. package/dist/containers-DINLx5_i.mjs +0 -380
  245. package/dist/create-BtmuVqVL.mjs +0 -2
  246. package/dist/error-sanitization-B025CygB.mjs +0 -2
  247. package/dist/get-Be821dio.mjs +0 -2
  248. package/dist/k2-wsanPL3y.mjs +0 -10
  249. package/dist/kv-BLSPcEnH.mjs +0 -12
  250. package/dist/local-CFsO9Tkg.mjs +0 -2
  251. package/dist/login-BfuOf-Yi.mjs +0 -2
  252. package/dist/magic-network-monitoring-CX3TaMTu.mjs +0 -34
  253. package/dist/organization-CEnlXwrl.mjs +0 -70
  254. package/dist/organizations-Dt86ToxE.mjs +0 -4
  255. package/dist/origin-post-quantum-encryption-lX-uaJSL.mjs +0 -6
  256. package/dist/output-BJEgbI0G.mjs +0 -2
  257. package/dist/package-CiRJBRHO.mjs +0 -2
  258. package/dist/previews-DzJ85fsr.mjs +0 -6
  259. package/dist/resource-sharing-CW9xxtq5.mjs +0 -36
  260. package/dist/run-DD45EQTm.mjs +0 -2
  261. package/dist/src-DPnUfK4c.mjs +0 -131
  262. package/dist/startup-profile-tZNb2HGz.mjs +0 -2
  263. package/dist/state-Uwfrmw5I.mjs +0 -2
  264. package/dist/telemetry-Pt5GpCKD.mjs +0 -2
  265. package/dist/ui-FYultowZ.mjs +0 -2
  266. package/dist/version-Zr2oF8mY.mjs +0 -2
  267. package/dist/workers-B3uJqJKc.mjs +0 -39
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,i,t as a}from"./context-Dp4CXG22.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-DLri-rA7.mjs";import{t as l}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{n as u,t as d}from"./body-parser-BKcZS9iJ.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-D0dXwuME.mjs";var g={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/custom_pages/assets`,body:`json`};function _(e){return e.usage(`$0 custom-pages account-assets create
2
+ import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-DIJ7SIKC.mjs";import{n}from"./auth-B-h0BHg7.mjs";import{a as r,i,t as a}from"./context-BY1Eh_Qe.mjs";import{t as o}from"./output-BZQEl3mK.mjs";import{t as s}from"./dry-run-kJbjn4kG.mjs";import{t as c}from"./progress-yvPscjYg.mjs";import{t as l}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{n as u,t as d}from"./body-parser-DoewLePl.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-CEpZ-lQZ.mjs";var g={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/custom_pages/assets`,body:`json`};function _(e){return e.usage(`$0 custom-pages account-assets create
3
3
 
4
4
  Creates a custom asset for an account or zone.
5
5
 
6
- Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).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 v={command:`create`,describe:`Create a custom asset`,builder:_,handler:async e=>l({command:`custom-pages account-assets create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf custom-pages account-assets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/custom_pages/assets`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`),name:f(e.name,`name`,`text`),url:f(e.url,`url`,`text`)}):u(e.body)});return}let l=await n(e),m=e.zone===void 0?`accounts`:`zones`,h=m===`zones`?await i({zone:e.zone},l,{quiet:e.quiet}):e.local?t:await a();if(m===`zones`?e.zoneId=h:e.accountId=h,e.body){let t=u(e.body),n=await c(`Creating`,async()=>l.send(g,{body:t,account_or_zone:m,account_or_zone_id:h}));o(n,{successLabel:`Created`});return}e.description===void 0&&(e.description=await p(`description`,`A short description of the custom asset.`)),e.name===void 0&&(e.name=await p(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),e.url===void 0&&(e.url=await p(`url`,`The URL where the asset content is fetched from.`));let _=d({description:f(e.description,`description`,`text`),name:f(e.name,`name`,`text`),url:f(e.url,`url`,`text`)}),v=await c(`Creating`,async()=>l.send(g,{body:_,account_or_zone:m,account_or_zone_id:h}));o(v,{successLabel:`Created`})})};var y={method:`DELETE`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/custom_pages/assets/${t.asset_name}`,response:!1};function b(e){return e.usage(`$0 custom-pages account-assets delete <asset-name>
6
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).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 v={command:`create`,describe:`Create a custom asset`,builder:_,handler:async e=>l({command:`custom-pages account-assets create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf custom-pages account-assets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/custom_pages/assets`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`),name:f(e.name,`name`,`text`),url:f(e.url,`url`,`text`)}):u(e.body)});return}let l=e.body===void 0?void 0:u(e.body),m=await n(e),h=e.zone===void 0?`accounts`:`zones`,_=h===`zones`?await i({zone:e.zone},m,{quiet:e.quiet}):e.local?t:await a();if(h===`zones`?e.zoneId=_:e.accountId=_,e.body!==void 0){let e=l,t=await c(`Creating`,async()=>m.send(g,{body:e,account_or_zone:h,account_or_zone_id:_}));o(t,{successLabel:`Created`});return}e.description===void 0&&(e.description=await p(`description`,`A short description of the custom asset.`)),e.name===void 0&&(e.name=await p(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),e.url===void 0&&(e.url=await p(`url`,`The URL where the asset content is fetched from.`));let v=d({description:f(e.description,`description`,`text`),name:f(e.name,`name`,`text`),url:f(e.url,`url`,`text`)}),y=await c(`Creating`,async()=>m.send(g,{body:v,account_or_zone:h,account_or_zone_id:_}));o(y,{successLabel:`Created`})})};var y={method:`DELETE`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/custom_pages/assets/${t.asset_name}`,response:!1};function b(e){return e.usage(`$0 custom-pages account-assets delete <asset-name>
7
7
 
8
8
  Deletes a custom asset from an account or zone.
9
9
 
@@ -19,7 +19,7 @@ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE
19
19
 
20
20
  Updates a custom asset for an account or zone.
21
21
 
22
- Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).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 A={command:`update <asset-name>`,describe:`Update a custom asset`,builder:k,handler:async e=>l({command:`custom-pages account-assets update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf custom-pages account-assets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),"asset-name":String(e[`asset-name`]??``)},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`),url:f(e.url,`url`,`text`)}):u(e.body)});return}let l=await n(e),m=e.zone===void 0?`accounts`:`zones`,h=m===`zones`?await i({zone:e.zone},l,{quiet:e.quiet}):e.local?t:await a();if(m===`zones`?e.zoneId=h:e.accountId=h,e.body){let t=u(e.body),n=await c(`Updating`,async()=>l.send(O,{body:t,account_or_zone:m,account_or_zone_id:h,asset_name:e[`asset-name`]}));o(n,{successLabel:`Updated`});return}e.description===void 0&&(e.description=await p(`description`,`A short description of the custom asset.`)),e.url===void 0&&(e.url=await p(`url`,`The URL where the asset content is fetched from.`));let g=d({description:f(e.description,`description`,`text`),url:f(e.url,`url`,`text`)}),_=await c(`Updating`,async()=>l.send(O,{body:g,account_or_zone:m,account_or_zone_id:h,asset_name:e[`asset-name`]}));o(_,{successLabel:`Updated`})})},j={command:`account-assets`,describe:`Manage account-level custom assets`,builder:e=>e.command(v).command(x).command(w).command(D).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var M={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/custom_pages/${t.identifier}`};function N(e){return e.usage(`$0 custom-pages account-custom-pages get <identifier>
22
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).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 A={command:`update <asset-name>`,describe:`Update a custom asset`,builder:k,handler:async e=>l({command:`custom-pages account-assets update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf custom-pages account-assets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),"asset-name":String(e[`asset-name`]??``)},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`),url:f(e.url,`url`,`text`)}):u(e.body)});return}let l=e.body===void 0?void 0:u(e.body),m=await n(e),h=e.zone===void 0?`accounts`:`zones`,g=h===`zones`?await i({zone:e.zone},m,{quiet:e.quiet}):e.local?t:await a();if(h===`zones`?e.zoneId=g:e.accountId=g,e.body!==void 0){let t=l,n=await c(`Updating`,async()=>m.send(O,{body:t,account_or_zone:h,account_or_zone_id:g,asset_name:e[`asset-name`]}));o(n,{successLabel:`Updated`});return}e.description===void 0&&(e.description=await p(`description`,`A short description of the custom asset.`)),e.url===void 0&&(e.url=await p(`url`,`The URL where the asset content is fetched from.`));let _=d({description:f(e.description,`description`,`text`),url:f(e.url,`url`,`text`)}),v=await c(`Updating`,async()=>m.send(O,{body:_,account_or_zone:h,account_or_zone_id:g,asset_name:e[`asset-name`]}));o(v,{successLabel:`Updated`})})},j={command:`account-assets`,describe:`Manage account-level custom assets`,builder:e=>e.command(v).command(x).command(w).command(D).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var M={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/custom_pages/${t.identifier}`};function N(e){return e.usage(`$0 custom-pages account-custom-pages get <identifier>
23
23
 
24
24
  Returns the configuration for a custom page type.
25
25
 
@@ -31,8 +31,8 @@ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE
31
31
 
32
32
  Creates a signed JWT for previewing an account or zone-level custom page before it is published.
33
33
 
34
- Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).option(`act`,{type:`string`,description:`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`}).option(`target`,{type:`string`,description:`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`}).option(`url`,{type:`string`,description:`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`}).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:`create`,describe:`Create a preview token`,builder:z,handler:async e=>l({command:`custom-pages account-custom-pages preview-tokens create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf custom-pages account-custom-pages preview-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/custom_pages/preview_tokens`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:e.body===void 0?d({act:f(e.act,`act`,`text`),target:f(e.target,`target`,`text`),url:f(e.url,`url`,`text`)}):u(e.body)});return}let l=await n(e),m=e.zone===void 0?`accounts`:`zones`,h=m===`zones`?await i({zone:e.zone},l,{quiet:e.quiet}):e.local?t:await a();if(m===`zones`?e.zoneId=h:e.accountId=h,e.body){let t=u(e.body),n=await c(`Creating`,async()=>l.send(R,{body:t,account_or_zone:m,account_or_zone_id:h}));o(n,{successLabel:`Created`});return}e.act===void 0&&(e.act=await p(`act`,`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`)),e.target===void 0&&(e.target=await p(`target`,`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`)),e.url===void 0&&(e.url=await p(`url`,`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`));let g=d({act:f(e.act,`act`,`text`),target:f(e.target,`target`,`text`),url:f(e.url,`url`,`text`)}),_=await c(`Creating`,async()=>l.send(R,{body:g,account_or_zone:m,account_or_zone_id:h}));o(_,{successLabel:`Created`})})},V={command:`preview-tokens`,describe:`Preview tokens for account-level custom pages`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var H={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/custom_pages/${t.identifier}`,body:`json`};function U(e){return e.usage(`$0 custom-pages account-custom-pages update <identifier>
34
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).option(`act`,{type:`string`,description:`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`}).option(`target`,{type:`string`,description:`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`}).option(`url`,{type:`string`,description:`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`}).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:`create`,describe:`Create a preview token`,builder:z,handler:async e=>l({command:`custom-pages account-custom-pages preview-tokens create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf custom-pages account-custom-pages preview-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/custom_pages/preview_tokens`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:e.body===void 0?d({act:f(e.act,`act`,`text`),target:f(e.target,`target`,`text`),url:f(e.url,`url`,`text`)}):u(e.body)});return}let l=e.body===void 0?void 0:u(e.body),m=await n(e),h=e.zone===void 0?`accounts`:`zones`,g=h===`zones`?await i({zone:e.zone},m,{quiet:e.quiet}):e.local?t:await a();if(h===`zones`?e.zoneId=g:e.accountId=g,e.body!==void 0){let e=l,t=await c(`Creating`,async()=>m.send(R,{body:e,account_or_zone:h,account_or_zone_id:g}));o(t,{successLabel:`Created`});return}e.act===void 0&&(e.act=await p(`act`,`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`)),e.target===void 0&&(e.target=await p(`target`,`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`)),e.url===void 0&&(e.url=await p(`url`,`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`));let _=d({act:f(e.act,`act`,`text`),target:f(e.target,`target`,`text`),url:f(e.url,`url`,`text`)}),v=await c(`Creating`,async()=>m.send(R,{body:_,account_or_zone:h,account_or_zone_id:g}));o(v,{successLabel:`Created`})})},V={command:`preview-tokens`,describe:`Preview tokens for account-level custom pages`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var H={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/custom_pages/${t.identifier}`,body:`json`};function U(e){return e.usage(`$0 custom-pages account-custom-pages update <identifier>
35
35
 
36
36
  Updates the configuration for a custom page type.
37
37
 
38
- Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).positional(`identifier`,{type:`string`,description:`Custom page type.`,demandOption:!0}).option(`state`,{type:`string`,description:`The custom page state.`,choices:[`default`,`customized`]}).coerce(`state`,e=>f(e,`state`,`text`)).option(`url`,{type:`string`,description:`The URL associated with the custom page.`}).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 W={command:`update <identifier>`,describe:`Update a custom page`,builder:U,handler:async e=>l({command:`custom-pages account-custom-pages update`,classification:{safeFlags:[`state`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf custom-pages account-custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/custom_pages/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),identifier:String(e.identifier??``)},bodyKind:`json`,body:e.body===void 0?d({state:e.state,url:f(e.url,`url`,`text`)}):u(e.body)});return}let l=await n(e),h=e.zone===void 0?`accounts`:`zones`,g=h===`zones`?await i({zone:e.zone},l,{quiet:e.quiet}):e.local?t:await a();if(h===`zones`?e.zoneId=g:e.accountId=g,e.body){let t=u(e.body),n=await c(`Updating`,async()=>l.send(H,{body:t,account_or_zone:h,account_or_zone_id:g,identifier:e.identifier}));o(n,{successLabel:`Updated`});return}e.state===void 0&&(e.state=await m(`state`,`The custom page state.`,[`default`,`customized`])),e.url===void 0&&(e.url=await p(`url`,`The URL associated with the custom page.`));let _=d({state:e.state,url:f(e.url,`url`,`text`)}),v=await c(`Updating`,async()=>l.send(H,{body:_,account_or_zone:h,account_or_zone_id:g,identifier:e.identifier}));o(v,{successLabel:`Updated`})})},G={command:`account-custom-pages`,describe:`Manage account-level custom pages`,builder:e=>e.command(P).command(L).command(W).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`custom-pages`,describe:`Manage custom error and challenge pages and their assets for accounts and zones`,builder:e=>e.command(j).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
38
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).positional(`identifier`,{type:`string`,description:`Custom page type.`,demandOption:!0}).option(`state`,{type:`string`,description:`The custom page state.`,choices:[`default`,`customized`]}).coerce(`state`,e=>f(e,`state`,`text`)).option(`url`,{type:`string`,description:`The URL associated with the custom page.`}).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 W={command:`update <identifier>`,describe:`Update a custom page`,builder:U,handler:async e=>l({command:`custom-pages account-custom-pages update`,classification:{safeFlags:[`state`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf custom-pages account-custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/custom_pages/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),identifier:String(e.identifier??``)},bodyKind:`json`,body:e.body===void 0?d({state:e.state,url:f(e.url,`url`,`text`)}):u(e.body)});return}let l=e.body===void 0?void 0:u(e.body),h=await n(e),g=e.zone===void 0?`accounts`:`zones`,_=g===`zones`?await i({zone:e.zone},h,{quiet:e.quiet}):e.local?t:await a();if(g===`zones`?e.zoneId=_:e.accountId=_,e.body!==void 0){let t=l,n=await c(`Updating`,async()=>h.send(H,{body:t,account_or_zone:g,account_or_zone_id:_,identifier:e.identifier}));o(n,{successLabel:`Updated`});return}e.state===void 0&&(e.state=await m(`state`,`The custom page state.`,[`default`,`customized`])),e.url===void 0&&(e.url=await p(`url`,`The URL associated with the custom page.`));let v=d({state:e.state,url:f(e.url,`url`,`text`)}),y=await c(`Updating`,async()=>h.send(H,{body:v,account_or_zone:g,account_or_zone_id:_,identifier:e.identifier}));o(y,{successLabel:`Updated`})})},G={command:`account-custom-pages`,describe:`Manage account-level custom pages`,builder:e=>e.command(P).command(L).command(W).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`custom-pages`,describe:`Manage custom error and challenge pages and their assets for accounts and zones`,builder:e=>e.command(j).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
@@ -1,52 +1,50 @@
1
1
  #!/usr/bin/env node
2
- import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./hand-written-dry-run-B82fRl2N.mjs";import{t as n}from"./local-CgBhtmON.mjs";import{n as r}from"./auth-FK2eLQ02.mjs";import{n as i}from"./resolve-C3FmNlSO.mjs";import{a,t as o}from"./context-Dp4CXG22.mjs";import{t as s}from"./output-BJEgbI0G.mjs";import{t as c}from"./dry-run-gy0Hl9xo.mjs";import{t as l}from"./progress-DLri-rA7.mjs";import{n as u,t as d}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as f,n as p,t as m}from"./body-parser-BKcZS9iJ.mjs";import{n as h}from"./input-validation-D7z60HJH.mjs";import{a as g,i as _,n as v,t as ee}from"./prompt-D0dXwuME.mjs";import y from"node:fs";import b from"node:path";var te={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database`,body:`json`};function ne(e){return e.usage(`$0 d1 create
2
+ import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./hand-written-dry-run-B82fRl2N.mjs";import{t as n}from"./local-DIJ7SIKC.mjs";import{n as r}from"./auth-B-h0BHg7.mjs";import{n as i}from"./resolve-C3FmNlSO.mjs";import{a,t as o}from"./context-BY1Eh_Qe.mjs";import{t as s}from"./output-BZQEl3mK.mjs";import{t as c}from"./dry-run-kJbjn4kG.mjs";import{t as l}from"./progress-yvPscjYg.mjs";import{n as u,t as d}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{a as f,n as p,t as m}from"./body-parser-DoewLePl.mjs";import{n as h}from"./input-validation-D7z60HJH.mjs";import{a as g,n as _,t as ee}from"./prompt-CEpZ-lQZ.mjs";import v from"node:fs";import y from"node:path";var te={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database`,body:`json`};function ne(e){return e.usage(`$0 d1 create
3
3
 
4
- Create a new D1 database in your account.`).option(`jurisdiction`,{type:`string`,description:`Specify the location to restrict the D1 database to run and store data. If this option is present, the location hint is ignored.`,choices:[`eu`,`fedramp`,`us`]}).coerce(`jurisdiction`,e=>h(e,`jurisdiction`,`text`)).option(`name`,{type:`string`,description:`D1 database name.`}).option(`primary-location-hint`,{type:`string`,description:`Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user.`,choices:[`wnam`,`enam`,`weur`,`eeur`,`apac`,`oc`]}).coerce(`primary-location-hint`,e=>h(e,`primary-location-hint`,`text`)).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).coerce(`read-replication-mode`,e=>h(e,`read-replication-mode`,`text`)).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 re={command:`create`,describe:`Create D1 Database`,builder:ne,handler:async e=>d({command:`d1 create`,classification:{safeFlags:[`jurisdiction`,`primary-location-hint`,`read-replication-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({jurisdiction:e.jurisdiction,name:h(e.name,`name`,`text`),primary_location_hint:e[`primary-location-hint`],read_replication:{mode:e[`read-replication-mode`]}}):p(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=p(e.body),r=await l(`Creating`,async()=>t.send(te,{body:n,account_id:i}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await g(`name`,`D1 database name.`));let u=m({jurisdiction:e.jurisdiction,name:h(e.name,`name`,`text`),primary_location_hint:e[`primary-location-hint`],read_replication:{mode:e[`read-replication-mode`]}}),d=await l(`Creating`,async()=>t.send(te,{body:u,account_id:i}));s(d,{successLabel:`Created`})})};var ie={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`};function ae(e){return e.usage(`$0 d1 delete <database-id>
4
+ Create a new D1 database in your account.`).option(`jurisdiction`,{type:`string`,description:`Specify the location to restrict the D1 database to run and store data. If this option is present, the location hint is ignored.`,choices:[`eu`,`fedramp`,`us`]}).coerce(`jurisdiction`,e=>h(e,`jurisdiction`,`text`)).option(`name`,{type:`string`,description:`D1 database name.`}).option(`primary-location-hint`,{type:`string`,description:`Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user.`,choices:[`wnam`,`enam`,`weur`,`eeur`,`apac`,`oc`]}).coerce(`primary-location-hint`,e=>h(e,`primary-location-hint`,`text`)).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).coerce(`read-replication-mode`,e=>h(e,`read-replication-mode`,`text`)).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 re={command:`create`,describe:`Create D1 Database`,builder:ne,handler:async e=>d({command:`d1 create`,classification:{safeFlags:[`jurisdiction`,`primary-location-hint`,`read-replication-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({jurisdiction:e.jurisdiction,name:h(e.name,`name`,`text`),primary_location_hint:e[`primary-location-hint`],read_replication:{mode:e[`read-replication-mode`]}}):p(e.body)});return}let t=e.body===void 0?void 0:p(e.body),i=await r(e),u=e.local?n:await o();if(e.accountId=u,e.body!==void 0){let e=t,n=await l(`Creating`,async()=>i.send(te,{body:e,account_id:u}));s(n,{successLabel:`Created`});return}e.name===void 0&&(e.name=await g(`name`,`D1 database name.`));let d=m({jurisdiction:e.jurisdiction,name:h(e.name,`name`,`text`),primary_location_hint:e[`primary-location-hint`],read_replication:{mode:e[`read-replication-mode`]}}),f=await l(`Creating`,async()=>i.send(te,{body:d,account_id:u}));s(f,{successLabel:`Created`})})};var ie={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`};function ae(e){return e.usage(`$0 d1 delete <database-id>
5
5
 
6
- Delete a D1 database.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,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 oe={command:`delete <database-id>`,describe:`Delete D1 Database`,builder:ae,handler:async e=>d({command:`d1 delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,!await v({force:!!e.force,message:`This permanently deletes the D1 database and all of its data.`}))return;let u=await l(`Deleting`,async()=>t.send(ie,{account_id:i,database_id:e[`database-id`]}));s(u,{successLabel:`Deleted`})})};var se={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`,body:`json`};function ce(e){return e.usage(`$0 d1 edit <database-id>
6
+ Delete a D1 database.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,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 oe={command:`delete <database-id>`,describe:`Delete D1 Database`,builder:ae,handler:async e=>d({command:`d1 delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,!await _({force:!!e.force,message:`This permanently deletes the D1 database and all of its data.`}))return;let u=await l(`Deleting`,async()=>t.send(ie,{account_id:i,database_id:e[`database-id`]}));s(u,{successLabel:`Deleted`})})};var se={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`,body:`json`};function ce(e){return e.usage(`$0 d1 edit <database-id>
7
7
 
8
- Partially update a D1 database's configuration.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).coerce(`read-replication-mode`,e=>h(e,`read-replication-mode`,`text`)).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 le={command:`edit <database-id>`,describe:`Update D1 Database partially`,builder:ce,handler:async e=>d({command:`d1 edit`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({read_replication:{mode:e[`read-replication-mode`]}}):p(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=p(e.body),r=await l(`Updating`,async()=>t.send(se,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Updated`});return}let u=m({read_replication:{mode:e[`read-replication-mode`]}}),d=await l(`Updating`,async()=>t.send(se,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Updated`})})};var ue={method:`GET`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`,query:[`fields`],joined:[`fields`]};function de(e){return e.usage(`$0 d1 get <database-id>
8
+ Partially update a D1 database's configuration.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).coerce(`read-replication-mode`,e=>h(e,`read-replication-mode`,`text`)).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 le={command:`edit <database-id>`,describe:`Update D1 Database partially`,builder:ce,handler:async e=>d({command:`d1 edit`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({read_replication:{mode:e[`read-replication-mode`]}}):p(e.body)});return}let t=e.body===void 0?void 0:p(e.body),i=await r(e),u=e.local?n:await o();if(e.accountId=u,e.body!==void 0){let n=t,r=await l(`Updating`,async()=>i.send(se,{body:n,account_id:u,database_id:e[`database-id`]}));s(r,{successLabel:`Updated`});return}let d=m({read_replication:{mode:e[`read-replication-mode`]}}),f=await l(`Updating`,async()=>i.send(se,{body:d,account_id:u,database_id:e[`database-id`]}));s(f,{successLabel:`Updated`})})};var ue={method:`GET`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`,query:[`fields`],joined:[`fields`]};function de(e){return e.usage(`$0 d1 get <database-id>
9
9
 
10
10
  Get details for a specific D1 database.`).positional(`database-id`,{type:`string`,description:`Database ID`,demandOption:!0}).option(`fields`,{type:`string`,array:!0,description:`Comma-separated list of fields to include in the response. When omitted,
11
11
  all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`get <database-id>`,describe:`Get D1 Database`,builder:de,handler:async e=>d({command:`d1 get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={fields:e.fields};if(e.dryRun){let n=await a();c({command:`cf d1 get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();e.accountId=u;let d=await l(`Loading`,async()=>i.send(ue,{account_id:u,database_id:e[`database-id`],...t}));s(d,{successLabel:`Loaded`})})};var pe={method:`GET`,path:t=>e`/accounts/${t.account_id}/d1/database`,query:[`name`,`page`,`per_page`]};function me(e){return e.usage(`$0 d1 list
12
12
 
13
- List D1 databases in your account.`).option(`name`,{type:`string`,description:`a database name to search for.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`list`,describe:`List D1 Databases`,builder:me,handler:async e=>d({command:`d1 list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={name:e.name,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await a();c({command:`cf d1 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/d1/database`,pathParams:{},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();e.accountId=u;let d=await l(`Loading`,async()=>i.send(pe,{account_id:u,...t}));s(d,{successLabel:`Loaded`})})};var x={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/query`,body:`json`};function ge(e){return e.usage(`$0 d1 query <database-id>
13
+ List D1 databases in your account.`).option(`name`,{type:`string`,description:`a database name to search for.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`list`,describe:`List D1 Databases`,builder:me,handler:async e=>d({command:`d1 list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={name:e.name,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await a();c({command:`cf d1 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/d1/database`,pathParams:{},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();e.accountId=u;let d=await l(`Loading`,async()=>i.send(pe,{account_id:u,...t}));s(d,{successLabel:`Loaded`})})};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/query`,body:`json`};function ge(e){return e.usage(`$0 d1 query <database-id>
14
14
 
15
- Execute a SQL query against a D1 database and return results as objects.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`params`,{type:`string`,array:!0,description:`The params field`}).option(`sql`,{type:`string`,description:`Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch.`}).option(`batch`,{type:`string`,description:`The batch field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A single query object or a batch query object`}).conflicts(`params`,[`batch`]).implies(`params`,[`sql`]).conflicts(`sql`,[`batch`]).conflicts(`batch`,[`params`,`sql`])}const _e={command:`query <database-id>`,describe:`Query D1 Database`,builder:ge,handler:async e=>d({command:`d1 query`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/query`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:f(e.batch,`batch`)}):p(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=p(e.body),r=await l(`Loading`,async()=>t.send(x,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Loaded`});return}let u=m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:f(e.batch,`batch`)}),d=await l(`Loading`,async()=>t.send(x,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Loaded`})})};var S={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/raw`,body:`json`};function ve(e){return e.usage(`$0 d1 raw <database-id>
15
+ Execute a SQL query against a D1 database and return results as objects.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`params`,{type:`string`,array:!0,description:`The params field`}).option(`sql`,{type:`string`,description:`Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch.`}).option(`batch`,{type:`string`,description:`The batch field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A single query object or a batch query object`}).conflicts(`params`,[`batch`]).implies(`params`,[`sql`]).conflicts(`sql`,[`batch`]).conflicts(`batch`,[`params`,`sql`])}const _e={command:`query <database-id>`,describe:`Query D1 Database`,builder:ge,handler:async e=>d({command:`d1 query`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/query`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:f(e.batch,`batch`)}):p(e.body)});return}let t=e.body===void 0?void 0:p(e.body),i=await r(e),u=e.local?n:await o();if(e.accountId=u,e.body!==void 0){let n=t,r=await l(`Loading`,async()=>i.send(b,{body:n,account_id:u,database_id:e[`database-id`]}));s(r,{successLabel:`Loaded`});return}let d=m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:f(e.batch,`batch`)}),g=await l(`Loading`,async()=>i.send(b,{body:d,account_id:u,database_id:e[`database-id`]}));s(g,{successLabel:`Loaded`})})};var x={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/raw`,body:`json`};function ve(e){return e.usage(`$0 d1 raw <database-id>
16
16
 
17
- Execute a SQL query against a D1 database and return result rows as arrays rather than objects. This is a performance-optimized version of the /query endpoint.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`params`,{type:`string`,array:!0,description:`The params field`}).option(`sql`,{type:`string`,description:`Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch.`}).option(`batch`,{type:`string`,description:`The batch field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A single query object or a batch query object`}).conflicts(`params`,[`batch`]).implies(`params`,[`sql`]).conflicts(`sql`,[`batch`]).conflicts(`batch`,[`params`,`sql`])}const ye={command:`raw <database-id>`,describe:`Raw D1 Database query`,builder:ve,handler:async e=>d({command:`d1 raw`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/raw`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:f(e.batch,`batch`)}):p(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=p(e.body),r=await l(`Loading`,async()=>t.send(S,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Loaded`});return}let u=m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:f(e.batch,`batch`)}),d=await l(`Loading`,async()=>t.send(S,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Loaded`})})};var be={method:`GET`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/time_travel/bookmark`,query:[`timestamp`]};function xe(e){return e.usage(`$0 d1 time-travel get-bookmark <database-id>
17
+ Execute a SQL query against a D1 database and return result rows as arrays rather than objects. This is a performance-optimized version of the /query endpoint.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`params`,{type:`string`,array:!0,description:`The params field`}).option(`sql`,{type:`string`,description:`Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch.`}).option(`batch`,{type:`string`,description:`The batch field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A single query object or a batch query object`}).conflicts(`params`,[`batch`]).implies(`params`,[`sql`]).conflicts(`sql`,[`batch`]).conflicts(`batch`,[`params`,`sql`])}const ye={command:`raw <database-id>`,describe:`Raw D1 Database query`,builder:ve,handler:async e=>d({command:`d1 raw`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/raw`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:f(e.batch,`batch`)}):p(e.body)});return}let t=e.body===void 0?void 0:p(e.body),i=await r(e),u=e.local?n:await o();if(e.accountId=u,e.body!==void 0){let n=t,r=await l(`Loading`,async()=>i.send(x,{body:n,account_id:u,database_id:e[`database-id`]}));s(r,{successLabel:`Loaded`});return}let d=m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:f(e.batch,`batch`)}),g=await l(`Loading`,async()=>i.send(x,{body:d,account_id:u,database_id:e[`database-id`]}));s(g,{successLabel:`Loaded`})})};var be={method:`GET`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/time_travel/bookmark`,query:[`timestamp`]};function xe(e){return e.usage(`$0 d1 time-travel get-bookmark <database-id>
18
18
 
19
19
  Retrieve the current bookmark, or the nearest bookmark at or before a provided timestamp. Bookmarks can be used with the restore endpoint to revert the database to a previous point in time.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`timestamp`,{type:`string`,description:`An optional ISO 8601 timestamp. If provided, returns the nearest available bookmark at or before this timestamp. If omitted, returns the current bookmark.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get-bookmark <database-id>`,describe:`Get D1 database bookmark`,builder:xe,handler:async e=>d({command:`d1 time-travel get-bookmark`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={timestamp:e.timestamp};if(e.dryRun){let n=await a();c({command:`cf d1 time-travel get-bookmark`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/time_travel/bookmark`,pathParams:{"database-id":String(e[`database-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();e.accountId=u;let d=await l(`Loading`,async()=>i.send(be,{account_id:u,database_id:e[`database-id`],...t}));s(d,{successLabel:`Loaded`})})};var Ce={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/time_travel/restore`,query:[`bookmark`,`timestamp`]};function we(e){return e.usage(`$0 d1 time-travel restore <database-id>
20
20
 
21
- Restore a D1 database to a previous point in time either via a bookmark or a timestamp.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`bookmark`,{type:`string`,description:"A bookmark to restore the database to. Required if `timestamp` is not provided."}).option(`timestamp`,{type:`string`,description:"An ISO 8601 timestamp to restore the database to. Required if `bookmark` is not provided."}).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 Te={command:`restore <database-id>`,describe:`Restore D1 Database to a bookmark or point in time`,builder:we,handler:async e=>d({command:`d1 time-travel restore`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={bookmark:e.bookmark,timestamp:e.timestamp};if(e.dryRun){let n=await a();c({command:`cf d1 time-travel restore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/time_travel/restore`,pathParams:{"database-id":String(e[`database-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();if(e.accountId=u,!await v({force:!!e.force,message:`This reverts the D1 database to a previous point in time. Data written after the bookmark will be lost.`}))return;let d=await l(`Deleting`,async()=>i.send(Ce,{account_id:u,database_id:e[`database-id`],...t}));s(d,{successLabel:`Deleted`})})},Ee={command:`time-travel`,describe:`use specific point-in-time backups of your D1 database`,builder:e=>e.command(Se).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var De={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/undelete`,body:`json`};function Oe(e){return e.usage("$0 d1 undelete <database-id>\n\nRestore a deleted D1 database. The database is restored with the name it had when it was deleted, unless `new_name` is provided. The restored database counts against the account's limits. Undeleting a database that is not deleted succeeds without changes, unless `new_name` differs from its current name which errors. A database can only be undeleted within 7 days (7 * 24 hours) of its deletion. Once a database is undeleted, Time Travel (point-in-time recovery) cannot restore it to a bookmark or timestamp at or before the undeletion. Only states after the undeletion can be restored.").positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`new-name`,{type:`string`,description:`Restore the database with this name instead of the name it had when it was deleted. Required if another database in the account already uses that name.`}).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 ke={command:`undelete <database-id>`,describe:`Undelete D1 Database`,builder:Oe,handler:async e=>d({command:`d1 undelete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 undelete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/undelete`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({new_name:h(e[`new-name`],`new-name`,`text`)}):p(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,!await v({force:!!e.force,message:`After undeleting, Time Travel cannot restore the D1 database to a point in time at or before the undeletion.`}))return;if(e.body){let n=p(e.body),r=await l(`Deleting`,async()=>t.send(De,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Deleted`});return}let u=m({new_name:h(e[`new-name`],`new-name`,`text`)}),d=await l(`Deleting`,async()=>t.send(De,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Deleted`})})};var Ae={method:`PUT`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`,body:`json`};function je(e){return e.usage(`$0 d1 update <database-id>
22
-
23
- Update a D1 database's configuration.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).coerce(`read-replication-mode`,e=>h(e,`read-replication-mode`,`text`)).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 Me={command:`update <database-id>`,describe:`Update D1 Database`,builder:je,handler:async e=>d({command:`d1 update`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({read_replication:{mode:e[`read-replication-mode`]}}):p(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=p(e.body),r=await l(`Updating`,async()=>t.send(Ae,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Updated`});return}e[`read-replication-mode`]===void 0&&(e[`read-replication-mode`]=await _(`read-replication-mode`,`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,[`auto`,`disabled`]));let u=m({read_replication:{mode:e[`read-replication-mode`]}}),d=await l(`Updating`,async()=>t.send(Ae,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Updated`})})},Ne=(e,t,n)=>{let r=e instanceof RegExp?Pe(e,n):e,i=t instanceof RegExp?Pe(t,n):t,a=r!==null&&i!=null&&Fe(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},Pe=(e,t)=>{let n=t.match(e);return n?n[0]:null},Fe=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},Ie=`\0SLASH`+Math.random()+`\0`,Le=`\0OPEN`+Math.random()+`\0`,C=`\0CLOSE`+Math.random()+`\0`,Re=`\0COMMA`+Math.random()+`\0`,ze=`\0PERIOD`+Math.random()+`\0`,Be=new RegExp(Ie,`g`),Ve=new RegExp(Le,`g`),He=new RegExp(C,`g`),Ue=new RegExp(Re,`g`),We=new RegExp(ze,`g`),Ge=/\\\\/g,Ke=/\\{/g,qe=/\\}/g,Je=/\\,/g,Ye=/\\\./g;function w(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function Xe(e){return e.replace(Ge,Ie).replace(Ke,Le).replace(qe,C).replace(Je,Re).replace(Ye,ze)}function Ze(e){return e.replace(Be,`\\`).replace(Ve,`{`).replace(He,`}`).replace(Ue,`,`).replace(We,`.`)}function T(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Qe(e){let t=[],n=``;for(;;){let r=Ne(`{`,`}`,e);if(!r){let r=e.split(`,`);return r[0]=n+r[0],T(t,r),t}let{pre:i,body:a,post:o}=r,s=i.split(`,`);if(s[0]=n+s[0],s[s.length-1]+=`{`+a+`}`,!o.length)return T(t,s),t;n=s.pop(),T(t,s),e=o}}function $e(e,t={}){if(!e)return[];let{max:n=1e5,maxLength:r=4e6,maxDepth:i=1e3,maxRewrites:a=1e3}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),D(Xe(e),n,r,i,0,a,!0).map(Ze)}function et(e){return`{`+e+`}`}function tt(e){return/^-?0\d/.test(e)}function nt(e,t){return e<=t}function rt(e,t){return e>=t}function E(e,t,n,r,i,a){let o=[],s=0;for(let c=0;c<e.length;c++)for(let l=0;l<n.length;l++){if(o.length>=r)return o;let u=e[c]+t+n[l];if(!a||u){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function it(e,t,n,r){let i=e.split(/\.\./),a=[];
21
+ Restore a D1 database to a previous point in time either via a bookmark or a timestamp.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`bookmark`,{type:`string`,description:"A bookmark to restore the database to. Required if `timestamp` is not provided."}).option(`timestamp`,{type:`string`,description:"An ISO 8601 timestamp to restore the database to. Required if `bookmark` is not provided."}).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 Te={command:`restore <database-id>`,describe:`Restore D1 Database to a bookmark or point in time`,builder:we,handler:async e=>d({command:`d1 time-travel restore`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={bookmark:e.bookmark,timestamp:e.timestamp};if(e.dryRun){let n=await a();c({command:`cf d1 time-travel restore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/time_travel/restore`,pathParams:{"database-id":String(e[`database-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();if(e.accountId=u,!await _({force:!!e.force,message:`This reverts the D1 database to a previous point in time. Data written after the bookmark will be lost.`}))return;let d=await l(`Processing`,async()=>i.send(Ce,{account_id:u,database_id:e[`database-id`],...t}));s(d,{successLabel:`Done`})})},Ee={command:`time-travel`,describe:`use specific point-in-time backups of your D1 database`,builder:e=>e.command(Se).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var De={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/undelete`,body:`json`};function Oe(e){return e.usage("$0 d1 undelete <database-id>\n\nRestore a deleted D1 database. The database is restored with the name it had when it was deleted, unless `new_name` is provided. The restored database counts against the account's limits. Undeleting a database that is not deleted succeeds without changes, unless `new_name` differs from its current name which errors. A database can only be undeleted within 7 days (7 * 24 hours) of its deletion. Once a database is undeleted, Time Travel (point-in-time recovery) cannot restore it to a bookmark or timestamp at or before the undeletion. Only states after the undeletion can be restored.").positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`new-name`,{type:`string`,description:`Restore the database with this name instead of the name it had when it was deleted. Required if another database in the account already uses that name.`}).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 ke={command:`undelete <database-id>`,describe:`Undelete D1 Database`,builder:Oe,handler:async e=>d({command:`d1 undelete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 undelete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/undelete`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({new_name:h(e[`new-name`],`new-name`,`text`)}):p(e.body)});return}let t=e.body===void 0?void 0:p(e.body),i=await r(e),u=e.local?n:await o();if(e.accountId=u,!await _({force:!!e.force,message:`After undeleting, Time Travel cannot restore the D1 database to a point in time at or before the undeletion.`}))return;if(e.body!==void 0){let n=t,r=await l(`Processing`,async()=>i.send(De,{body:n,account_id:u,database_id:e[`database-id`]}));s(r,{successLabel:`Done`});return}let d=m({new_name:h(e[`new-name`],`new-name`,`text`)}),f=await l(`Processing`,async()=>i.send(De,{body:d,account_id:u,database_id:e[`database-id`]}));s(f,{successLabel:`Done`})})},Ae=(e,t,n)=>{let r=e instanceof RegExp?je(e,n):e,i=t instanceof RegExp?je(t,n):t,a=r!==null&&i!=null&&Me(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},je=(e,t)=>{let n=t.match(e);return n?n[0]:null},Me=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},Ne=`\0SLASH`+Math.random()+`\0`,Pe=`\0OPEN`+Math.random()+`\0`,S=`\0CLOSE`+Math.random()+`\0`,Fe=`\0COMMA`+Math.random()+`\0`,Ie=`\0PERIOD`+Math.random()+`\0`,Le=new RegExp(Ne,`g`),Re=new RegExp(Pe,`g`),ze=new RegExp(S,`g`),Be=new RegExp(Fe,`g`),Ve=new RegExp(Ie,`g`),He=/\\\\/g,Ue=/\\{/g,We=/\\}/g,Ge=/\\,/g,Ke=/\\\./g;function C(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function qe(e){return e.replace(He,Ne).replace(Ue,Pe).replace(We,S).replace(Ge,Fe).replace(Ke,Ie)}function Je(e){return e.replace(Le,`\\`).replace(Re,`{`).replace(ze,`}`).replace(Be,`,`).replace(Ve,`.`)}function w(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Ye(e){let t=[],n=``;for(;;){let r=Ae(`{`,`}`,e);if(!r){let r=e.split(`,`);return r[0]=n+r[0],w(t,r),t}let{pre:i,body:a,post:o}=r,s=i.split(`,`);if(s[0]=n+s[0],s[s.length-1]+=`{`+a+`}`,!o.length)return w(t,s),t;n=s.pop(),w(t,s),e=o}}function Xe(e,t={}){if(!e)return[];let{max:n=1e5,maxLength:r=4e6,maxDepth:i=1e3,maxRewrites:a=1e3}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),E(qe(e),n,r,i,0,a,!0).map(Je)}function Ze(e){return`{`+e+`}`}function Qe(e){return/^-?0\d/.test(e)}function $e(e,t){return e<=t}function et(e,t){return e>=t}function T(e,t,n,r,i,a){let o=[],s=0;for(let c=0;c<e.length;c++)for(let l=0;l<n.length;l++){if(o.length>=r)return o;let u=e[c]+t+n[l];if(!a||u){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function tt(e,t,n,r){let i=e.split(/\.\./),a=[];
24
22
  /* c8 ignore start */
25
23
  if(i[0]===void 0||i[1]===void 0)return a;
26
24
  /* c8 ignore stop */
27
- let o=w(i[0]),s=w(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(w(i[2])),1):1,u=nt;s<o&&(l*=-1,u=rt);let d=i.some(tt),f=0;for(let e=o;u(e,s)&&a.length<n;e+=l){let n;if(t)n=String.fromCharCode(e),n===`\\`&&(n=``);else if(n=String(e),d){let t=c-n.length;if(t>0){let r=Array(t+1).join(`0`);n=e<0?`-`+r+n.slice(1):r+n}}if(f+n.length>r)break;a.push(n),f+=n.length}return a}function D(e,t,n,r,i,a,o){if(i>r)return[e];let s=[``],c=0,l=!1,u=!0;for(;;){let d=Ne(`{`,`}`,e);if(!d)return E(s,e,[``],t,n,l);let f=d.pre;if(/\$$/.test(f)){if(s=E(s,f+`{`+d.body+`}`,[``],t,n,l&&!d.post.length),u=!1,!d.post.length)break;e=d.post;continue}let p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),m=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),h=p||m,g=d.body.indexOf(`,`)>=0;if(!h&&!g){if(c<a&&d.post.match(/,(?!,).*\}/)){c++,e=d.pre+`{`+d.body+C+d.post,o=!0;continue}return E(s,f+`{`+d.body+`}`+d.post,[``],t,n,l)}u&&=(l=o&&!h,!1);let _;if(h)_=it(d.body,m,t,n);else{let o=Qe(d.body);if(o.length===1&&o[0]!==void 0&&(o=D(o[0],t,n,r,i+1,a,!1).map(et),o.length===1)){if(s=E(s,f+o[0],[``],t,n,l&&!d.post.length),!d.post.length)break;e=d.post;continue}let c=l&&!d.post.length&&!f;for(let e=0;c&&e<s.length;e++)s[e]&&(c=!1);_=[];let u=0;outer:for(let e=0;e<o.length;e++){let s=D(o[e],t,n,r,i+1,a,!1);for(let e=0;e<s.length;e++){let r=s[e];if(!c||r){if(_.length>=t||u+r.length>n)break outer;_.push(r),u+=r.length}}}}if(s=E(s,f,_,t,n,l&&!d.post.length),!d.post.length)break;e=d.post}return s}const at={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`],"[:alpha:]":[`\\p{L}\\p{Nl}`],"[:ascii:]":[`\\x00-\\x7f`],"[:blank:]":[`\\p{Zs}\\t`],"[:cntrl:]":[`\\p{Cc}`],"[:digit:]":[`\\p{Nd}`],"[:graph:]":[`\\p{Z}\\p{C}`,!0],"[:lower:]":[`\\p{Ll}`],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}\\p{S}`],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`],"[:upper:]":[`\\p{Lu}`],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`],"[:xdigit:]":[`A-Fa-f0-9`]},O=e=>e.replace(/[[\]\\-]/g,`\\$&`),k=/$./,ot=(e,t,n=!1,r)=>{let i=e=>{let t=r?e.normalize(r):e;return[...t].length===1?t:e},a=t;
25
+ let o=C(i[0]),s=C(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(C(i[2])),1):1,u=$e;s<o&&(l*=-1,u=et);let d=i.some(Qe),f=0;for(let e=o;u(e,s)&&a.length<n;e+=l){let n;if(t)n=String.fromCharCode(e),n===`\\`&&(n=``);else if(n=String(e),d){let t=c-n.length;if(t>0){let r=Array(t+1).join(`0`);n=e<0?`-`+r+n.slice(1):r+n}}if(f+n.length>r)break;a.push(n),f+=n.length}return a}function E(e,t,n,r,i,a,o){if(i>r)return[e];let s=[``],c=0,l=!1,u=!0;for(;;){let d=Ae(`{`,`}`,e);if(!d)return T(s,e,[``],t,n,l);let f=d.pre;if(/\$$/.test(f)){if(s=T(s,f+`{`+d.body+`}`,[``],t,n,l&&!d.post.length),u=!1,!d.post.length)break;e=d.post;continue}let p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),m=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),h=p||m,g=d.body.indexOf(`,`)>=0;if(!h&&!g){if(c<a&&d.post.match(/,(?!,).*\}/)){c++,e=d.pre+`{`+d.body+S+d.post,o=!0;continue}return T(s,f+`{`+d.body+`}`+d.post,[``],t,n,l)}u&&=(l=o&&!h,!1);let _;if(h)_=tt(d.body,m,t,n);else{let o=Ye(d.body);if(o.length===1&&o[0]!==void 0&&(o=E(o[0],t,n,r,i+1,a,!1).map(Ze),o.length===1)){if(s=T(s,f+o[0],[``],t,n,l&&!d.post.length),!d.post.length)break;e=d.post;continue}let c=l&&!d.post.length&&!f;for(let e=0;c&&e<s.length;e++)s[e]&&(c=!1);_=[];let u=0;outer:for(let e=0;e<o.length;e++){let s=E(o[e],t,n,r,i+1,a,!1);for(let e=0;e<s.length;e++){let r=s[e];if(!c||r){if(_.length>=t||u+r.length>n)break outer;_.push(r),u+=r.length}}}}if(s=T(s,f,_,t,n,l&&!d.post.length),!d.post.length)break;e=d.post}return s}const nt={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`],"[:alpha:]":[`\\p{L}\\p{Nl}`],"[:ascii:]":[`\\x00-\\x7f`],"[:blank:]":[`\\p{Zs}\\t`],"[:cntrl:]":[`\\p{Cc}`],"[:digit:]":[`\\p{Nd}`],"[:graph:]":[`\\p{Z}\\p{C}`,!0],"[:lower:]":[`\\p{Ll}`],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}\\p{S}`],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`],"[:upper:]":[`\\p{Lu}`],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`],"[:xdigit:]":[`A-Fa-f0-9`]},D=e=>e.replace(/[[\]\\-]/g,`\\$&`),O=/$./,rt=(e,t,n=!1,r)=>{let i=e=>{let t=r?e.normalize(r):e;return[...t].length===1?t:e},a=t;
28
26
  /* c8 ignore start */
29
27
  if(e.charAt(a)!==`[`)throw Error(`not in a brace expression`);
30
28
  /* c8 ignore stop */
31
- let o=[],s=[],c=a+1,l=!1,u=!1,d=!1,f=a,p=``;WHILE:for(;c<e.length;){let t=String.fromCodePoint(e.codePointAt(c));if((t===`!`||t===`^`)&&c===a+1){d=!0,c++;continue}if(t===`]`&&l&&!u){f=c+1;break}if(l=!0,t===`\\`&&!u){u=!0,c++;continue}if(t===`[`&&!u){for(let[t,[n,r]]of Object.entries(at))if(e.startsWith(t,c)){if(p)return[k,e.length-a];c+=t.length,r?s.push(n):o.push(n);continue WHILE}}u=!1;let n=i(t);p?(n.codePointAt(0)>p.codePointAt(0)?o.push(O(p)+`-`+O(n)):n===p&&o.push(O(n)),p=``,c+=t.length):e.startsWith(`-]`,c+t.length)?(o.push(O(n+`-`)),c+=t.length+1):e.startsWith(`-`,c+t.length)?(p=n,c+=t.length+1):(o.push(O(n)),c+=t.length)}if(f<c)return[k,0];if(!o.length&&!s.length)return[k,e.length-a];let m=`[`+(d?`^`:``)+o.join(``)+`]`,h=`[`+(d?``:`^`)+s.join(``)+`]`,g=`^`+(o.length&&s.length?`(`+m+`|`+h+`)`:o.length?m:h);return[new RegExp(g,n?`iu`:`u`),f-a]},A={t:`match`,id:0},j=e=>({t:`lit`,ch:e}),st=e=>e.replace(/[\\^$.*+?()[\]{}|/]/g,`\\$&`),ct=e=>RegExp(`^${st(e)}$`,`iu`),M=/* @__PURE__ */ new Map,lt=e=>{let t=M.get(e);return t||(t=ct(e),M.size>=1e3&&M.clear(),M.set(e,t)),t},N=(e,t)=>{if(t===e.ch)return!0;if(!e.re)return!1;let n=t.charCodeAt(0);if(n>=128)return e.re.test(t);let r=e.ascii??=/* @__PURE__ */ new Uint8Array(128);return r[n]||=e.re.test(t)?1:2,r[n]===1},ut=(e,t,n,r)=>{let i=[];for(let a=0;a<e.length;){let o=String.fromCodePoint(e.codePointAt(a));if(o===`\\`){let t=e.codePointAt(a+1),n=t===void 0?o:String.fromCodePoint(t);i.push(j(n)),a+=1+n.length}else{if(o===`[`){let[n,o]=ot(e,a,t,r);if(o){i.push({t:`class`,re:n}),a+=o;continue}}!n&&`!?+*@`.includes(o)&&e[a+1]===`(`?(i.push({t:`open`,type:o}),a+=2):(i.push(!n&&o===`|`?{t:`bar`}:!n&&o===`)`?{t:`close`}:o===`*`?{t:`star`}:o===`?`?{t:`any`}:j(o)),a+=o.length)}}return i},dt=e=>{let t=/* @__PURE__ */ new Map,n=[];return e.forEach((e,r)=>{e.t===`open`?n.push(r):e.t===`close`&&n.length&&t.set(n.pop(),r)}),t},ft=(e,t,n,r,i)=>{let a=[],o=[a];for(let s=n;s<r;s++){let n=e[s],r=t.get(s);if(n.t===`open`&&r!==void 0){let i=ft(e,t,s+1,r,!1);a.push({t:`ext`,type:n.type,alts:i}),s=r}else n.t===`bar`&&!i?o.push(a=[]):n.t===`open`?a.push(j(n.type),j(`(`)):n.t===`bar`?a.push(j(`|`)):n.t===`close`?a.push(j(`)`)):a.push(n)}return o},pt=(e,t)=>{let n=[],r=``,i=()=>{for(let e of r.normalize(t))n.push(j(e));r=``};for(let a of e)a.t===`lit`?r+=a.ch:(i(),n.push(a.t===`ext`?{...a,alts:a.alts.map(e=>pt(e,t))}:a));return i(),n},mt=(e,t)=>{let n=1,r=e=>({t:`split`,id:n++,out:e}),i=(e,t)=>e.reduceRight((e,t)=>a(t,e),t),a=(e,a)=>{switch(e.t){case`lit`:let r=t?lt(e.ch):void 0;return{t:`lit`,id:n++,ch:e.ch,re:r,next:a};case`any`:case`star`:return{t:e.t,id:n++,next:a};case`class`:return{t:`class`,id:n++,re:e.re,next:a}}let o=t=>e.alts.map(e=>i(e,t));switch(e.type){case`@`:return r(o(a));case`?`:return r([a,...o(a)]);case`!`:return{t:`neg`,id:n++,sub:r(o(A)),next:a}}let s=r([]),c=r(o(s));return s.out.push(a,c),e.type===`*`?s:c};return[i(e,A),n]},ht=e=>{let t=[],n=/* @__PURE__ */ new Set,r=e=>e.t===`match`?`match`:String(e.id),i=(e,a)=>{if(e.t===`match`||n.has(e))return;n.add(e);let o=n=>t.push(`${a}${e.id}: ${n}`);switch(e.t){case`split`:o(`split -> ${e.out.map(r).join(`, `)}`);for(let t of e.out)i(t,a);return;case`neg`:return o(`!(${r(e.sub)}) -> ${r(e.next)}`),i(e.sub,a+` `),i(e.next,a);case`lit`:o(`${JSON.stringify(e.ch)} -> ${r(e.next)}`);break;case`class`:o(`${e.re} -> ${r(e.next)}`);break;default:o(`${e.t===`any`?`?`:`*`} -> ${r(e.next)}`)}i(e.next,a)};return i(e,``),[`start -> ${r(e)}`,...t].join(`
32
- `)};var gt=class{gen;threads=[];match=!1;runs=[];ids=[];constructor(e){this.gen=e}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}};const _t=(e,t)=>e.ids.length!==t.ids.length||e.runs.length!==t.runs.length||e.ids.some((e,n)=>e!==t.ids[n])?!1:e.runs.every(e=>t.runs.some(t=>t.neg===e.neg&&_t(t.state,e.state))),vt=e=>({has:new Float64Array(e),seen:new Float64Array(e),gen:0});var P=class{dots;dotStart;#e;constructor(e,t,n){this.dots=e,this.dotStart=t,this.#e=n}state(){return new gt(++this.#e.gen)}done(e){return e.ids=e.threads.map(e=>e.id).sort((e,t)=>e-t),e.match&&e.ids.unshift(A.id),e}#t(e,t){let{seen:n}=this.#e;return n[t.id]!==e.gen&&(n[t.id]=e.gen,!0)}#n(e,t){let{has:n}=this.#e;return n[t.id]!==e.gen&&(n[t.id]=e.gen,e.threads.push(t),!0)}restricted(e,t){return t&&(this.dots||this.dotStart&&e===0)}add(e,t,n,r){switch(t.t){case`split`:if(!this.#t(e,t))return;for(let i of t.out)this.add(e,i,n,r);return;case`neg`:if(!this.#t(e,t))return;let i=this.state();return this.add(i,t.sub,n,!1),this.done(i),this.addRun(e,{t:`run`,neg:t,state:i},n,r);case`star`:if(this.restricted(n,r))return;this.#n(e,t)&&this.add(e,t.next,n,r);return;case`match`:e.match=!0;return;default:this.#n(e,t)}}addRun(e,t,n,r){for(let n of e.runs)if(n.neg===t.neg&&_t(n.state,t.state))return;e.runs.push(t),t.state.match||this.add(e,t.neg.next,n,r)}step(e,t,n,r){let i=this.state();for(let a of e.threads)switch(a.t){case`lit`:N(a,t)&&this.add(i,a.next,n+1,r);break;case`any`:this.restricted(n,r)||this.add(i,a.next,n+1,r);break;case`class`:!this.restricted(n,r)&&a.re.test(t)&&this.add(i,a.next,n+1,r);break;case`star`:this.restricted(n,r)||this.add(i,a,n+1,r)}if(!this.restricted(n,r))for(let a of e.runs){if(a.state.dead){this.addRun(i,a,n+1,r);continue}let e=this.step(a.state,t,n,!1);this.addRun(i,{t:`run`,neg:a.neg,state:e},n+1,r)}return this.done(i)}};const yt=e=>{let t=e.ids.join();return e.runs.length?`${t}|${e.runs.map(e=>`${e.neg.id}(${yt(e.state)})`).sort().join(`|`)}`:t};var bt=class{#e;#t=/* @__PURE__ */ new Map;#n=0;#r;#i;#a;#o;constructor(e,t){this.#e=e,this.#a=new P(!1,!1,t),this.#o=new P(!1,!0,t)}#s(e){return{state:e,match:e.match,dead:e.dead,next:/* @__PURE__ */ new Map}}#c(e){let t=yt(e),n=this.#t.get(t);if(n)return n;this.#n>262144&&this.#l();let r=this.#s(e);return this.#t.set(t,r),this.#n+=t.length+1,r}#l(){this.#t.clear(),this.#n=0,this.#r=void 0,this.#i=void 0}start(e){if(e){if(this.#i)return this.#i;let e=this.#o.state();return this.#o.add(e,this.#e,0,!0),this.#i=this.#s(this.#o.done(e))}if(this.#r)return this.#r;let t=this.#a.state();return this.#a.add(t,this.#e,0,!0),this.#r=this.#c(this.#a.done(t))}next(e,t){let n=t.charCodeAt(0),r=n<128?void 0:e.next.get(t);if(r)return r;let i=e===this.#i?this.#c(this.#o.step(e.state,t,0,!0)):this.#c(this.#a.step(e.state,t,1,!0));return n<128?(e.ascii||(e.ascii=Array(128),this.#n+=128),e.ascii[n]=i):e.next.set(t,i),this.#n++,i}};const xt=e=>{let t=[];for(let n=e;n.t!==`match`;n=n.next){if(n.t===`split`||n.t===`neg`)return;t.push(n)}return t},St=(e,t,n,r)=>{let i=0,a=n,o=-1,s=0;for(;a<r;){let n=e[i];if(n?.t===`star`){o=i++,s=a;continue}let r=t[a];if(n&&(n.t===`any`||n.t===`lit`&&N(n,r)||n.t===`class`&&n.re.test(r)))i++,a++;else{if(o===-1)return!1;i=o+1,a=++s}}for(;e[i]?.t===`star`;)i++;return i===e.length},Ct=e=>{let t=0,n=0;for(let r of e){let[e,i]=wt(r);t+=e,n+=i}return[t,n]},wt=e=>{if(e.t===`star`)return[0,1/0];if(e.t!==`ext`)return[1,1];if(e.type===`!`)return[0,1/0];let t=e.alts.map(Ct),n=Math.min(...t.map(e=>e[0])),r=Math.max(...t.map(e=>e[1])),i=r===0?0:1/0;return e.type===`@`?[n,r]:e.type===`?`?[0,r]:e.type===`*`?[0,i]:[n,i]},Tt=(e,t,n)=>{for(let r=0;r<e.length;r++)if(!N(e[r],t[n+r]))return!1;return!0},Et=/[/\ud800-\udfff]/,Dt=/[\ud800-\udfff]/,F=e=>Dt.test(e)?[...e]:e,Ot=e=>{if(e.includes(`/`))throw Error(`can only match a single path portion, got: `+e)};var kt=class{pattern;options;#e;#t;#n;#r;#i;#a=!1;#o;#s;#c=!1;#l=0;#u=1/0;#d=[];#f=[];#p;#m;#h=!1;#g;#_;constructor(e,t={}){if(e.includes(`/`))throw Error(`can only match a single path portion, got pattern: `+e);this.pattern=e,this.options=t;let{nocase:n=!1,noext:r=!1,normalize:i}=t;this.#_=i===!0?`NFC`:i||void 0;let a=/^[?*+@]\(\)$/.test(e),o=ut(e,n,r||a,this.#_),[s]=ft(o,dt(o),0,o.length,!0);this.#_&&(s=pt(s,this.#_));let[c,l]=mt(s,n);if(this.#e=c,this.#t=l,s.every(e=>e.t===`lit`))this.#i=s.map(e=>e.ch).join(``),this.#a=n;else{let e=e=>e.t===`lit`?n?{ch:e.ch,re:lt(e.ch)}:{ch:e.ch}:void 0;for(let t of s){let n=e(t);if(!n)break;this.#d.push(n)}for(let t=s.length-1;t>=0;t--){let n=e(s[t]);if(!n)break;this.#f.unshift(n)}this.#h=!!(this.#d.length||this.#f.length),n||(this.#p=this.#d.map(e=>e.ch).join(``),this.#m=this.#f.map(e=>e.ch).join(``)),this.#s=xt(this.#e)?.slice(this.#d.length,-this.#f.length||void 0),this.#c=!!this.#s?.every(e=>e.t===`star`||e.t===`any`);let[t,r]=Ct(s);this.#l=t,this.#u=r}}test(e){return this.#_?(Ot(e),this.#v(e.normalize(this.#_))):Et.test(e)?(Ot(e),this.#v(e,[...e])):this.#v(e,e)}testUnchecked(e){return this.#v(this.#_?e.normalize(this.#_):e)}#v(e,t){if(this.#i!==void 0)return this.#a?(this.#o??=ct(this.#i)).test(e):e===this.#i;let n=this.#l,r=this.#u;if(t===void 0){let i=e.length,a=i+1>>1;if(i<n||a>r)return!1;(a<n||i>r)&&(t=F(e))}if(t!==void 0&&(t.length<n||t.length>r))return!1;let i=this.#d.length;if(this.#h){if(this.#p!==void 0&&this.#m!==void 0){if(!e.startsWith(this.#p)||!e.endsWith(this.#m))return!1}else{t??=F(e);let n=t.length-this.#f.length;if(!Tt(this.#d,t,0)||!Tt(this.#f,t,n))return!1}}let a=!this.options.dot&&e.startsWith(`.`);if(this.#s){if(e===`.`||e===`..`||a&&!i)return!1;if(this.#c)return!0;t??=F(e);let n=t.length-this.#f.length;return St(this.#s,t,i,n)}if(t??=F(e),e===`.`||e===`..`){this.#n??=vt(this.#t);let e=this.#r??=new P(!0,!1,this.#n),n=e.state();e.add(n,this.#e,0,!0);let r=e.done(n);for(let n=0;n<t.length;n++)r=e.step(r,t[n],n,!0);return r.match}this.#n??=vt(this.#t);let o=this.#g??=new bt(this.#e,this.#n),s=o.start(a),c=t===e;for(let n=0;n<t.length;n++){if(s.dead)return!1;let r=c?e.charCodeAt(n):t[n].charCodeAt(0);s=s.ascii?.[r]??o.next(s,t[n])}return s.match}toString(){return ht(this.#e)}};const I=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},At=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),jt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`),L=(e,t,n={})=>(I(t),!n.nocomment&&t.charAt(0)===`#`?!1:Mt(t,n).match(e)),R=/* @__PURE__ */ new Map,Mt=(e,t)=>{let n=e+`\0`+JSON.stringify(t),r=R.get(n);return r?R.delete(n):(r=new Q(e,{...t}),R.size>=256&&R.delete(R.keys().next().value)),R.set(n,r),r},Nt=typeof process==`object`&&process?process.env?.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,Pt={win32:{sep:`\\`},posix:{sep:`/`}};L.sep=Nt===`win32`?Pt.win32.sep:Pt.posix.sep;const z=Symbol(`globstar **`);L.GLOBSTAR=z,L.filter=(e,t={})=>n=>L(n,e,t);const B=(e,t={})=>Object.assign({},e,t);L.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return L;let t=L;return Object.assign((n,r,i={})=>t(n,r,B(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,B(e,n))}static defaults(n){return t.defaults(B(e,n)).Minimatch}},unescape:(n,r={})=>t.unescape(n,B(e,r)),escape:(n,r={})=>t.escape(n,B(e,r)),filter:(n,r={})=>t.filter(n,B(e,r)),defaults:n=>t.defaults(B(e,n)),braceExpand:(n,r={})=>t.braceExpand(n,B(e,r)),match:(n,r,i={})=>t.match(n,r,B(e,i)),sep:t.sep,GLOBSTAR:z})};const Ft=(e,t={})=>(I(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:$e(e,{max:t.braceExpandMax}));L.braceExpand=Ft,L.match=(e,t,n={})=>{let r=new Q(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const It=/[?*]|[+@!]\(.*?\)|\[|\]/,Lt=(e,t)=>{let n=t+1;(e.charAt(n)===`!`||e.charAt(n)===`^`)&&n++;let r=!1;for(;n<e.length;n++){let t=e.charAt(n);if(t===`]`&&r)return n;r=!0,t===`\\`&&n++}return-1},Rt=(e,t)=>{if(!t&&(e===`+()`||e===`@()`))return e;let n=``;for(let r=0;r<e.length;r++){let i=e.charAt(r);if(i===`\\`)n+=e.charAt(++r)||i;else if(i===`*`||i===`?`)return;else if(i===`[`){let t=Lt(e,r);if(t===-1){n+=i;continue}let a=e.slice(r+1,t);if(a.startsWith(`\\`)&&(a=a.slice(1)),[...a].length!==1||`!^`.includes(e.charAt(r+1)))return;n+=a,r=t}else if(!t&&`+@!`.includes(i)&&e.charAt(r+1)===`(`&&e.includes(`)`,r+2))return;else n+=i}return n},zt=e=>{if(/^[?*+@]\(\)$/.test(e)||e.includes(`[:`))return!1;let t=0;for(let n=0;n<e.length;n++){let r=e.charAt(n);if(r===`\\`){if(++n===e.length)return!1}else if(r===`[`){let t=Lt(e,n);t!==-1&&(n=t)}else if(`+@!?*`.includes(r)&&e.charAt(n+1)===`(`)t++,n++;else if(r===`)`){if(!t--)return!1}else if(r===`|`&&!t)return!1}return!t};let V,Bt;const H=(e,t)=>typeof e==`string`?t===e:t!==``&&e.testUnchecked(t),Vt=(e,t,n,r,i)=>H(e,t)?n:r!==void 0&&H(e,r)?i:-1,U=e=>e===`.`||e===`..`,W=e=>typeof e==`string`&&/^[a-z]:$/i.test(e),G=e=>typeof e==`string`&&/^unc$/i.test(e),K=e=>{if(e[0]!==``||e[1]!==``)return-1;let t=e[2]===`?`?G(e[3])?4:-1:2,n=e[t],r=e[t+1];return t!==-1&&n!==void 0&&n!==``&&n!==z&&r!==void 0&&r!==``&&r!==z?t:-1},q=(e,t)=>!U(e)&&(t||!e.startsWith(`.`)),J=(e,t,n,r,i)=>{for(let a=t;a<n;){if(e.charCodeAt(a)===46){if(!r)return!0;let t=e.charCodeAt(a+1)===46?a+2:a+1;if(t>=n||Y(e.charCodeAt(t),i))return!0}let t=X(e,a,i);if(t===-1)return!1;for(a=t+1;a<n&&Y(e.charCodeAt(a),i);)a++}return!1},Y=(e,t)=>t===`/`?e===47:t===`\\`?e===92:e===47||e===92,X=(e,t,n)=>{if(n!==`both`)return e.indexOf(n,t);let r=e.indexOf(`/`,t),i=e.indexOf(`\\`,t);return r===-1?i:i===-1?r:Math.min(r,i)},Ht=(e,t,n)=>n===`both`?Math.max(e.lastIndexOf(`/`,t),e.lastIndexOf(`\\`,t)):e.lastIndexOf(n,t),Z={};var Q=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;#e;#t;#n;#r;#i=[];#a=[];#o=[];#s=/* @__PURE__ */ new Map;#c=!1;#l=/* @__PURE__ */ new WeakMap;constructor(e,t={}){I(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||Nt,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.#e=!this.preserveMultipleSlashes,this.#n=(t.optimizationLevel??1)>=2;let n=t.normalize;this.#r=n===!0?`NFC`:n||void 0,this.make();let r=this.set.map(e=>this.#d(e));this.#o=this.set.map((e,t)=>this.#e&&e.length-1>r[t]),this.#i=this.set.map((e,t)=>{let n=this.#o[t]?e.length-1:e.length,i=e.slice(r[t]+1,n).filter(e=>typeof e==`string`&&!!e);return[...new Set(i)]}),this.#t=this.#i.some(e=>e.length),this.#a=this.set.map((e,n)=>{let[i,a,o]=e;if(this.#o[n]&&e.length===2&&i===z&&a!==z)return`tail`;if(this.#o[n]&&t.matchBase&&e.length===1&&i!==z&&i!==``)return`base`;if(this.#e&&r[n]===-1){if(e.length===3&&i===z&&o===z&&a!==z&&a!==``&&this.maxGlobstarRecursion>0)return`mid`;if(e.length===2&&a===z&&i!==z&&i!==``)return`head`}})}#u(e){return this.#r?e.normalize(this.#r):e}#d(e){if(!this.isWindows)return-1;if(W(e[0]))return 0;if(e[0]===``&&e[1]===``&&e[2]===`?`&&W(e[3]))return 3;let t=K(e);return t===-1?-1:t+1}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())];let n=this.globSet.map(e=>this.#C(e));this.globParts=this.preprocess(n),this.#c=!0;let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[2]===`?`&&G(e[3])?6:4,n=e[0]===``&&e[1]===``&&(e[2]===`?`||!It.test(e[2]))&&e.slice(3,t).every(e=>!It.test(e)),r=/^[a-z]:/i.test(e[0]);if(n)return[...e.slice(0,t).map(e=>this.#u(e)),...e.slice(t).map(e=>this.parse(e))];if(r)return[this.#u(e[0]),...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&(W(t[3])||G(this.globParts[e][3]))&&(G(this.globParts[e][3])&&(t[3]=`UNC`),t[2]=`?`)}t.noext||this.mergeRows(),this.#c=!1,this.set.forEach((e,t)=>{for(let n=0;n<e.length;n++)e[n]===Z&&(e[n]=this.parse(this.globParts[t][n]))})}mergeRows(){let e=!0;for(;e;){e=!1;let t=Math.max(0,...this.set.map(e=>e.length));for(let n=0;n<t;n++){let t=/* @__PURE__ */ new Map;this.set.forEach((e,r)=>{if(!(e[n]instanceof kt||e[n]===Z)||!zt(this.globParts[r][n]))return;let i=[...this.globParts[r]];i[n]=``;let a=`${e.length}/${i.join(`/`)}`,o=t.get(a);o?o.push(r):t.set(a,[r])});let r=/* @__PURE__ */ new Set;for(let e of t.values()){if(e.length<2)continue;let[t,...i]=e,a=`@(${e.map(e=>this.globParts[e][n]).join(`|`)})`;this.globParts[t][n]=a,this.set[t][n]=this.parse(a);for(let e of i)r.add(e)}r.size&&(e=!0,this.set=this.set.filter((e,t)=>!r.has(t)),this.globParts=this.globParts.filter((e,t)=>!r.has(t)))}}}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>{let t=this.#d(e)+1;return e=e.reduce((e,n)=>{let r=e[e.length-1];return n===`**`&&r===`**`?e:n===`..`&&e.length>t&&r&&r!==`..`&&r!==`.`&&r!==`**`?(e.pop(),e):(e.push(n),e)},[]),e.length===0?[``]:e})}#f(e){let t=!this.isWindows||!e.includes(`\\`)?`/`:e.includes(`/`)?`both`:`\\`,n=this.#e?0:-1,r=``,i=0,a,o=0,s=!!this.options.dot;ROWS:for(let c=0;c<this.set.length;c++){let l=this.set[c],u=l[l.length-1],d=n!==-1&&this.#o[c]&&u!==z;if(d&&n===0){let s=Ht(e,e.length,t);if(i=s+1,r=e.slice(i),r===``&&s>=0){let n=s;for(;n>0&&Y(e.charCodeAt(n-1),t);)n--;o=n===0?0:Ht(e,n-1,t)+1,a=e.slice(o,n)}let c=this.#n&&(U(r)||r===``&&a!==void 0&&U(a));n=c?-1:1,d=!c}let f=-1;if(d&&typeof u==`string`&&(f=Vt(u,r,i,a,o),f===-1))continue;if(this.#t){for(let t of this.#i[c])if(!e.includes(t))continue ROWS}if(d&&typeof u==`object`&&(f=Vt(u,r,i,a,o),f===-1))continue;let p=this.#a[c];if(p===`base`&&d)return`yes`;if(p===`tail`&&d){if(this.#n&&J(e,0,f,!0,t))return`maybe`;if(!J(e,0,f,s,t))return`yes`}else if(p===`mid`||p===`head`){let n=this.#m(e,l,p===`head`,s,t);if(n!==`no`)return n}else return`maybe`}return`no`}#p(e,t,n){let r=!!this.options.dot,i=e.length;if(n===`head`){if(i<2||!H(t[0],e[0]))return!1;for(let t=1;t<i;t++)if(!q(e[t],r))return!1;return!0}let a=t[1];if(n===`tail`){let t=i-1;if(!H(a,e[t])&&(e[t]!==``||i===1||!H(a,e[--t])))return!1;for(let n=0;n<t;n++)if(!q(e[n],r))return!1;return!0}for(let t=0;t<i;t++){if(H(a,e[t])&&t+1<i){let n=t+1;for(;n<i&&q(e[n],r);)n++;if(n===i)return!0}if(!q(e[t],r))return!1}return!1}#m(e,t,n,r,i){if(this.#n&&J(e,0,e.length,!0,i))return`maybe`;let a=t[+!n],o=0;for(let t=X(e,o,i);t!==-1;t=X(e,o,i)){let s=t+1;for(;s<e.length&&Y(e.charCodeAt(s),i);)s++;if((typeof a==`string`?t-o===a.length&&e.startsWith(a,o):t>o&&a.testUnchecked(e.slice(o,t)))&&!J(e,s,e.length,r,i))return`yes`;if(n||J(e,o,s,r,i))return`no`;o=s}return`no`}#h(e){let t=V;return t?.f===e&&t.isWindows===this.isWindows&&t.preserveMultipleSlashes===this.preserveMultipleSlashes&&t.normalize===this.#r?t:void 0}#g(e){let{isWindows:t,preserveMultipleSlashes:n}=this,r=this.#C(t?e.split(`\\`).join(`/`):e),i=this.#r;return i&&(r=r.map(e=>e.normalize(i))),V={f:e,isWindows:t,preserveMultipleSlashes:n,normalize:i,parts:r},V}#_(e){let t=[...e],n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let e=1;e<t.length-1;e++){let r=t[e];e===1&&r===``&&t[0]===``||r!==`.`&&r!==``||(n=!0,t.splice(e,1),e--)}t[0]===`.`&&t.length===2&&(t[1]===`.`||t[1]===``)&&(n=!0,t.pop())}let e=this.#d(t)+1,r=e;for(;(r=t.indexOf(`..`,r+1))!==-1;){let i=t[r-1];i&&i!==`.`&&i!==`..`&&i!==`**`&&(n=!0,t.splice(r-1,2),r=Math.max(r-2,e))}}while(n);return t.length===0?[``]:t}firstPhasePreProcess(e){let{braceExpandMax:t=1e5}=this.options,n=!1;do{n=!1;for(let r of e){let i=-1;for(;(i=r.indexOf(`**`,i+1))!==-1;){let a=i;for(;r[a+1]===`**`;)a++;a>i&&r.splice(i+1,a-i);let o=r[i+1],s=r[i+2],c=r[i+3];if(o!==`..`||!s||s===`.`||s===`..`||!c||c===`.`||c===`..`||e.length>=t)continue;n=!0,r.splice(i,1);let l=r.slice(0);l[i]=`**`,e.push(l),i--}if(!this.preserveMultipleSlashes){for(let e=1;e<r.length-1;e++){let t=r[e];e===1&&t===``&&r[0]===``||t!==`.`&&t!==``||(n=!0,r.splice(e,1),e--)}r[0]===`.`&&r.length===2&&(r[1]===`.`||r[1]===``)&&(n=!0,r.pop())}let a=this.#d(r)+1,o=a;for(;(o=r.indexOf(`..`,o+1))!==-1;){let e=r[o-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){n=!0;let e=o===1&&r[o+1]===`**`?[`.`]:[];r.splice(o-1,2,...e),r.length===0&&r.push(``),o=Math.max(o-2,a)}}}}while(n);return e}secondPhasePreProcess(e){if(e.length>1e3)return e;for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}#v(e,t,n,r){let i=0,a=0,o=this.isWindows?K(t):-1,s=o===-1?-1:K(n);if(s!==-1){let e=n[s],r=n[s+1];typeof e!=`string`||typeof r!=`string`?(i=o,a=s):t[o].toLowerCase()===e.toLowerCase()&&t[o+1].toLowerCase()===r.toLowerCase()&&(i=o+2,a=s+2)}else if(this.isWindows){let t=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),r=!t&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof n[0]==`string`&&/^[a-z]:$/i.test(n[0]),s=!o&&n[0]===``&&n[1]===``&&n[2]===`?`&&typeof n[3]==`string`&&/^[a-z]:$/i.test(n[3]),c=r?3:t?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[t,r]=[e[c],n[l]];t.toLowerCase()===r.toLowerCase()&&(a=l+1,i=c+1)}}return e=t,n.includes(z)?this.#y(e,n,r,i,a):this.#S(e,n,r,i,a)}#y(e,t,n,r,i){let{head:a,body:o,tail:s,segments:c}=this.#b(t,n,i);if(a.length){let t=r+a.length;if(!this.#S(e,a,n,r,0,t))return!1;r+=a.length,i+=a.length}let l=0;if(s.length){if(s.length+r>e.length)return!1;let t=e.length-s.length;if(this.#S(e,s,n,t,0))l=s.length;else{if(e[e.length-1]!==``||r+s.length===e.length||(t--,!this.#S(e,s,n,t,0)))return!1;l=s.length+1}}if(!o.length){let t=!!l;for(let n=r;n<e.length-l;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}return!!this.#x(e,c,e.length-l,r,0,n,0,!!l,/* @__PURE__ */ new Set)}#b(e,t,n){let r=this.#l.get(e);r||(r=[],this.#l.set(e,r));let i=n*2+ +!!t,a=r[i];if(a)return a;let o=e.indexOf(z,n),s=e.lastIndexOf(z),c=e.slice(n,o),l=e.slice(o+1,t?void 0:s),u=t?[]:e.slice(s+1),d=[[[],0]],f=d[0],p=0,m=[0];for(let e of l)e===z?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);d.forEach((e,t)=>{e[1]=p-m[t]});let h={head:c,body:l,tail:u,segments:d};return r[i]=h,h}#x(e,t,n,r,i,a,o,s,c){let l=t[i];if(!l){if(a)return r>=n||r===n-1&&e[r]===``;for(let t=r;t<n;t++){s=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return s}let[u,d]=l,f=a?n:n-d;for(;r<=f;){let l=i*(e.length+1)+r;if(c.has(l))return!1;if(c.add(l),this.#S(e,u,a,r,0,r+u.length)&&o<this.maxGlobstarRecursion){let l=this.#x(e,t,n,r+u.length,i+1,a,o+1,s,c);if(l!==!1)return l}if(r===f)break;let d=e[r];if(d===`.`||d===`..`||!this.options.dot&&d.startsWith(`.`))return!1;r++}return a||null}#S(e,t,n,r,i,a=e.length){let o,s,c,l;for(o=r,s=i,l=Math.min(a,e.length),c=t.length;o<l&&s<c;o++,s++){let n=t[s],r=e[o];
29
+ let o=[],s=[],c=a+1,l=!1,u=!1,d=!1,f=a,p=``;WHILE:for(;c<e.length;){let t=String.fromCodePoint(e.codePointAt(c));if((t===`!`||t===`^`)&&c===a+1){d=!0,c++;continue}if(t===`]`&&l&&!u){f=c+1;break}if(l=!0,t===`\\`&&!u){u=!0,c++;continue}if(t===`[`&&!u){for(let[t,[n,r]]of Object.entries(nt))if(e.startsWith(t,c)){if(p)return[O,e.length-a];c+=t.length,r?s.push(n):o.push(n);continue WHILE}}u=!1;let n=i(t);p?(n.codePointAt(0)>p.codePointAt(0)?o.push(D(p)+`-`+D(n)):n===p&&o.push(D(n)),p=``,c+=t.length):e.startsWith(`-]`,c+t.length)?(o.push(D(n+`-`)),c+=t.length+1):e.startsWith(`-`,c+t.length)?(p=n,c+=t.length+1):(o.push(D(n)),c+=t.length)}if(f<c)return[O,0];if(!o.length&&!s.length)return[O,e.length-a];let m=`[`+(d?`^`:``)+o.join(``)+`]`,h=`[`+(d?``:`^`)+s.join(``)+`]`,g=`^`+(o.length&&s.length?`(`+m+`|`+h+`)`:o.length?m:h);return[new RegExp(g,n?`iu`:`u`),f-a]},k={t:`match`,id:0},A=e=>({t:`lit`,ch:e}),it=e=>e.replace(/[\\^$.*+?()[\]{}|/]/g,`\\$&`),at=e=>RegExp(`^${it(e)}$`,`iu`),j=/* @__PURE__ */ new Map,ot=e=>{let t=j.get(e);return t||(t=at(e),j.size>=1e3&&j.clear(),j.set(e,t)),t},M=(e,t)=>{if(t===e.ch)return!0;if(!e.re)return!1;let n=t.charCodeAt(0);if(n>=128)return e.re.test(t);let r=e.ascii??=/* @__PURE__ */ new Uint8Array(128);return r[n]||=e.re.test(t)?1:2,r[n]===1},st=(e,t,n,r)=>{let i=[];for(let a=0;a<e.length;){let o=String.fromCodePoint(e.codePointAt(a));if(o===`\\`){let t=e.codePointAt(a+1),n=t===void 0?o:String.fromCodePoint(t);i.push(A(n)),a+=1+n.length}else{if(o===`[`){let[n,o]=rt(e,a,t,r);if(o){i.push({t:`class`,re:n}),a+=o;continue}}!n&&`!?+*@`.includes(o)&&e[a+1]===`(`?(i.push({t:`open`,type:o}),a+=2):(i.push(!n&&o===`|`?{t:`bar`}:!n&&o===`)`?{t:`close`}:o===`*`?{t:`star`}:o===`?`?{t:`any`}:A(o)),a+=o.length)}}return i},ct=e=>{let t=/* @__PURE__ */ new Map,n=[];return e.forEach((e,r)=>{e.t===`open`?n.push(r):e.t===`close`&&n.length&&t.set(n.pop(),r)}),t},lt=(e,t,n,r,i)=>{let a=[],o=[a];for(let s=n;s<r;s++){let n=e[s],r=t.get(s);if(n.t===`open`&&r!==void 0){let i=lt(e,t,s+1,r,!1);a.push({t:`ext`,type:n.type,alts:i}),s=r}else n.t===`bar`&&!i?o.push(a=[]):n.t===`open`?a.push(A(n.type),A(`(`)):n.t===`bar`?a.push(A(`|`)):n.t===`close`?a.push(A(`)`)):a.push(n)}return o},ut=(e,t)=>{let n=[],r=``,i=()=>{for(let e of r.normalize(t))n.push(A(e));r=``};for(let a of e)a.t===`lit`?r+=a.ch:(i(),n.push(a.t===`ext`?{...a,alts:a.alts.map(e=>ut(e,t))}:a));return i(),n},dt=(e,t)=>{let n=1,r=e=>({t:`split`,id:n++,out:e}),i=(e,t)=>e.reduceRight((e,t)=>a(t,e),t),a=(e,a)=>{switch(e.t){case`lit`:let r=t?ot(e.ch):void 0;return{t:`lit`,id:n++,ch:e.ch,re:r,next:a};case`any`:case`star`:return{t:e.t,id:n++,next:a};case`class`:return{t:`class`,id:n++,re:e.re,next:a}}let o=t=>e.alts.map(e=>i(e,t));switch(e.type){case`@`:return r(o(a));case`?`:return r([a,...o(a)]);case`!`:return{t:`neg`,id:n++,sub:r(o(k)),next:a}}let s=r([]),c=r(o(s));return s.out.push(a,c),e.type===`*`?s:c};return[i(e,k),n]},ft=e=>{let t=[],n=/* @__PURE__ */ new Set,r=e=>e.t===`match`?`match`:String(e.id),i=(e,a)=>{if(e.t===`match`||n.has(e))return;n.add(e);let o=n=>t.push(`${a}${e.id}: ${n}`);switch(e.t){case`split`:o(`split -> ${e.out.map(r).join(`, `)}`);for(let t of e.out)i(t,a);return;case`neg`:return o(`!(${r(e.sub)}) -> ${r(e.next)}`),i(e.sub,a+` `),i(e.next,a);case`lit`:o(`${JSON.stringify(e.ch)} -> ${r(e.next)}`);break;case`class`:o(`${e.re} -> ${r(e.next)}`);break;default:o(`${e.t===`any`?`?`:`*`} -> ${r(e.next)}`)}i(e.next,a)};return i(e,``),[`start -> ${r(e)}`,...t].join(`
30
+ `)};var pt=class{gen;threads=[];match=!1;runs=[];ids=[];constructor(e){this.gen=e}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}};const mt=(e,t)=>e.ids.length!==t.ids.length||e.runs.length!==t.runs.length||e.ids.some((e,n)=>e!==t.ids[n])?!1:e.runs.every(e=>t.runs.some(t=>t.neg===e.neg&&mt(t.state,e.state))),ht=e=>({has:new Float64Array(e),seen:new Float64Array(e),gen:0});var N=class{dots;dotStart;#e;constructor(e,t,n){this.dots=e,this.dotStart=t,this.#e=n}state(){return new pt(++this.#e.gen)}done(e){return e.ids=e.threads.map(e=>e.id).sort((e,t)=>e-t),e.match&&e.ids.unshift(k.id),e}#t(e,t){let{seen:n}=this.#e;return n[t.id]!==e.gen&&(n[t.id]=e.gen,!0)}#n(e,t){let{has:n}=this.#e;return n[t.id]!==e.gen&&(n[t.id]=e.gen,e.threads.push(t),!0)}restricted(e,t){return t&&(this.dots||this.dotStart&&e===0)}add(e,t,n,r){switch(t.t){case`split`:if(!this.#t(e,t))return;for(let i of t.out)this.add(e,i,n,r);return;case`neg`:if(!this.#t(e,t))return;let i=this.state();return this.add(i,t.sub,n,!1),this.done(i),this.addRun(e,{t:`run`,neg:t,state:i},n,r);case`star`:if(this.restricted(n,r))return;this.#n(e,t)&&this.add(e,t.next,n,r);return;case`match`:e.match=!0;return;default:this.#n(e,t)}}addRun(e,t,n,r){for(let n of e.runs)if(n.neg===t.neg&&mt(n.state,t.state))return;e.runs.push(t),t.state.match||this.add(e,t.neg.next,n,r)}step(e,t,n,r){let i=this.state();for(let a of e.threads)switch(a.t){case`lit`:M(a,t)&&this.add(i,a.next,n+1,r);break;case`any`:this.restricted(n,r)||this.add(i,a.next,n+1,r);break;case`class`:!this.restricted(n,r)&&a.re.test(t)&&this.add(i,a.next,n+1,r);break;case`star`:this.restricted(n,r)||this.add(i,a,n+1,r)}if(!this.restricted(n,r))for(let a of e.runs){if(a.state.dead){this.addRun(i,a,n+1,r);continue}let e=this.step(a.state,t,n,!1);this.addRun(i,{t:`run`,neg:a.neg,state:e},n+1,r)}return this.done(i)}};const gt=e=>{let t=e.ids.join();return e.runs.length?`${t}|${e.runs.map(e=>`${e.neg.id}(${gt(e.state)})`).sort().join(`|`)}`:t};var _t=class{#e;#t=/* @__PURE__ */ new Map;#n=0;#r;#i;#a;#o;constructor(e,t){this.#e=e,this.#a=new N(!1,!1,t),this.#o=new N(!1,!0,t)}#s(e){return{state:e,match:e.match,dead:e.dead,next:/* @__PURE__ */ new Map}}#c(e){let t=gt(e),n=this.#t.get(t);if(n)return n;this.#n>262144&&this.#l();let r=this.#s(e);return this.#t.set(t,r),this.#n+=t.length+1,r}#l(){this.#t.clear(),this.#n=0,this.#r=void 0,this.#i=void 0}start(e){if(e){if(this.#i)return this.#i;let e=this.#o.state();return this.#o.add(e,this.#e,0,!0),this.#i=this.#s(this.#o.done(e))}if(this.#r)return this.#r;let t=this.#a.state();return this.#a.add(t,this.#e,0,!0),this.#r=this.#c(this.#a.done(t))}next(e,t){let n=t.charCodeAt(0),r=n<128?void 0:e.next.get(t);if(r)return r;let i=e===this.#i?this.#c(this.#o.step(e.state,t,0,!0)):this.#c(this.#a.step(e.state,t,1,!0));return n<128?(e.ascii||(e.ascii=Array(128),this.#n+=128),e.ascii[n]=i):e.next.set(t,i),this.#n++,i}};const vt=e=>{let t=[];for(let n=e;n.t!==`match`;n=n.next){if(n.t===`split`||n.t===`neg`)return;t.push(n)}return t},yt=(e,t,n,r)=>{let i=0,a=n,o=-1,s=0;for(;a<r;){let n=e[i];if(n?.t===`star`){o=i++,s=a;continue}let r=t[a];if(n&&(n.t===`any`||n.t===`lit`&&M(n,r)||n.t===`class`&&n.re.test(r)))i++,a++;else{if(o===-1)return!1;i=o+1,a=++s}}for(;e[i]?.t===`star`;)i++;return i===e.length},bt=e=>{let t=0,n=0;for(let r of e){let[e,i]=xt(r);t+=e,n+=i}return[t,n]},xt=e=>{if(e.t===`star`)return[0,1/0];if(e.t!==`ext`)return[1,1];if(e.type===`!`)return[0,1/0];let t=e.alts.map(bt),n=Math.min(...t.map(e=>e[0])),r=Math.max(...t.map(e=>e[1])),i=r===0?0:1/0;return e.type===`@`?[n,r]:e.type===`?`?[0,r]:e.type===`*`?[0,i]:[n,i]},St=(e,t,n)=>{for(let r=0;r<e.length;r++)if(!M(e[r],t[n+r]))return!1;return!0},Ct=/[/\ud800-\udfff]/,wt=/[\ud800-\udfff]/,P=e=>wt.test(e)?[...e]:e,Tt=e=>{if(e.includes(`/`))throw Error(`can only match a single path portion, got: `+e)};var Et=class{pattern;options;#e;#t;#n;#r;#i;#a=!1;#o;#s;#c=!1;#l=0;#u=1/0;#d=[];#f=[];#p;#m;#h=!1;#g;#_;constructor(e,t={}){if(e.includes(`/`))throw Error(`can only match a single path portion, got pattern: `+e);this.pattern=e,this.options=t;let{nocase:n=!1,noext:r=!1,normalize:i}=t;this.#_=i===!0?`NFC`:i||void 0;let a=/^[?*+@]\(\)$/.test(e),o=st(e,n,r||a,this.#_),[s]=lt(o,ct(o),0,o.length,!0);this.#_&&(s=ut(s,this.#_));let[c,l]=dt(s,n);if(this.#e=c,this.#t=l,s.every(e=>e.t===`lit`))this.#i=s.map(e=>e.ch).join(``),this.#a=n;else{let e=e=>e.t===`lit`?n?{ch:e.ch,re:ot(e.ch)}:{ch:e.ch}:void 0;for(let t of s){let n=e(t);if(!n)break;this.#d.push(n)}for(let t=s.length-1;t>=0;t--){let n=e(s[t]);if(!n)break;this.#f.unshift(n)}this.#h=!!(this.#d.length||this.#f.length),n||(this.#p=this.#d.map(e=>e.ch).join(``),this.#m=this.#f.map(e=>e.ch).join(``)),this.#s=vt(this.#e)?.slice(this.#d.length,-this.#f.length||void 0),this.#c=!!this.#s?.every(e=>e.t===`star`||e.t===`any`);let[t,r]=bt(s);this.#l=t,this.#u=r}}test(e){return this.#_?(Tt(e),this.#v(e.normalize(this.#_))):Ct.test(e)?(Tt(e),this.#v(e,[...e])):this.#v(e,e)}testUnchecked(e){return this.#v(this.#_?e.normalize(this.#_):e)}#v(e,t){if(this.#i!==void 0)return this.#a?(this.#o??=at(this.#i)).test(e):e===this.#i;let n=this.#l,r=this.#u;if(t===void 0){let i=e.length,a=i+1>>1;if(i<n||a>r)return!1;(a<n||i>r)&&(t=P(e))}if(t!==void 0&&(t.length<n||t.length>r))return!1;let i=this.#d.length;if(this.#h){if(this.#p!==void 0&&this.#m!==void 0){if(!e.startsWith(this.#p)||!e.endsWith(this.#m))return!1}else{t??=P(e);let n=t.length-this.#f.length;if(!St(this.#d,t,0)||!St(this.#f,t,n))return!1}}let a=!this.options.dot&&e.startsWith(`.`);if(this.#s){if(e===`.`||e===`..`||a&&!i)return!1;if(this.#c)return!0;t??=P(e);let n=t.length-this.#f.length;return yt(this.#s,t,i,n)}if(t??=P(e),e===`.`||e===`..`){this.#n??=ht(this.#t);let e=this.#r??=new N(!0,!1,this.#n),n=e.state();e.add(n,this.#e,0,!0);let r=e.done(n);for(let n=0;n<t.length;n++)r=e.step(r,t[n],n,!0);return r.match}this.#n??=ht(this.#t);let o=this.#g??=new _t(this.#e,this.#n),s=o.start(a),c=t===e;for(let n=0;n<t.length;n++){if(s.dead)return!1;let r=c?e.charCodeAt(n):t[n].charCodeAt(0);s=s.ascii?.[r]??o.next(s,t[n])}return s.match}toString(){return ft(this.#e)}};const F=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},Dt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),Ot=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`),I=(e,t,n={})=>(F(t),!n.nocomment&&t.charAt(0)===`#`?!1:kt(t,n).match(e)),L=/* @__PURE__ */ new Map,kt=(e,t)=>{let n=e+`\0`+JSON.stringify(t),r=L.get(n);return r?L.delete(n):(r=new Z(e,{...t}),L.size>=256&&L.delete(L.keys().next().value)),L.set(n,r),r},At=typeof process==`object`&&process?process.env?.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,jt={win32:{sep:`\\`},posix:{sep:`/`}};I.sep=At===`win32`?jt.win32.sep:jt.posix.sep;const R=Symbol(`globstar **`);I.GLOBSTAR=R,I.filter=(e,t={})=>n=>I(n,e,t);const z=(e,t={})=>Object.assign({},e,t);I.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return I;let t=I;return Object.assign((n,r,i={})=>t(n,r,z(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,z(e,n))}static defaults(n){return t.defaults(z(e,n)).Minimatch}},unescape:(n,r={})=>t.unescape(n,z(e,r)),escape:(n,r={})=>t.escape(n,z(e,r)),filter:(n,r={})=>t.filter(n,z(e,r)),defaults:n=>t.defaults(z(e,n)),braceExpand:(n,r={})=>t.braceExpand(n,z(e,r)),match:(n,r,i={})=>t.match(n,r,z(e,i)),sep:t.sep,GLOBSTAR:R})};const Mt=(e,t={})=>(F(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Xe(e,{max:t.braceExpandMax}));I.braceExpand=Mt,I.match=(e,t,n={})=>{let r=new Z(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const Nt=/[?*]|[+@!]\(.*?\)|\[|\]/,Pt=(e,t)=>{let n=t+1;(e.charAt(n)===`!`||e.charAt(n)===`^`)&&n++;let r=!1;for(;n<e.length;n++){let t=e.charAt(n);if(t===`]`&&r)return n;r=!0,t===`\\`&&n++}return-1},Ft=(e,t)=>{if(!t&&(e===`+()`||e===`@()`))return e;let n=``;for(let r=0;r<e.length;r++){let i=e.charAt(r);if(i===`\\`)n+=e.charAt(++r)||i;else if(i===`*`||i===`?`)return;else if(i===`[`){let t=Pt(e,r);if(t===-1){n+=i;continue}let a=e.slice(r+1,t);if(a.startsWith(`\\`)&&(a=a.slice(1)),[...a].length!==1||`!^`.includes(e.charAt(r+1)))return;n+=a,r=t}else if(!t&&`+@!`.includes(i)&&e.charAt(r+1)===`(`&&e.includes(`)`,r+2))return;else n+=i}return n},It=e=>{if(/^[?*+@]\(\)$/.test(e)||e.includes(`[:`))return!1;let t=0;for(let n=0;n<e.length;n++){let r=e.charAt(n);if(r===`\\`){if(++n===e.length)return!1}else if(r===`[`){let t=Pt(e,n);t!==-1&&(n=t)}else if(`+@!?*`.includes(r)&&e.charAt(n+1)===`(`)t++,n++;else if(r===`)`){if(!t--)return!1}else if(r===`|`&&!t)return!1}return!t};let B,Lt;const V=(e,t)=>typeof e==`string`?t===e:t!==``&&e.testUnchecked(t),Rt=(e,t,n,r,i)=>V(e,t)?n:r!==void 0&&V(e,r)?i:-1,H=e=>e===`.`||e===`..`,U=e=>typeof e==`string`&&/^[a-z]:$/i.test(e),W=e=>typeof e==`string`&&/^unc$/i.test(e),G=e=>{if(e[0]!==``||e[1]!==``)return-1;let t=e[2]===`?`?W(e[3])?4:-1:2,n=e[t],r=e[t+1];return t!==-1&&n!==void 0&&n!==``&&n!==R&&r!==void 0&&r!==``&&r!==R?t:-1},K=(e,t)=>!H(e)&&(t||!e.startsWith(`.`)),q=(e,t,n,r,i)=>{for(let a=t;a<n;){if(e.charCodeAt(a)===46){if(!r)return!0;let t=e.charCodeAt(a+1)===46?a+2:a+1;if(t>=n||J(e.charCodeAt(t),i))return!0}let t=Y(e,a,i);if(t===-1)return!1;for(a=t+1;a<n&&J(e.charCodeAt(a),i);)a++}return!1},J=(e,t)=>t===`/`?e===47:t===`\\`?e===92:e===47||e===92,Y=(e,t,n)=>{if(n!==`both`)return e.indexOf(n,t);let r=e.indexOf(`/`,t),i=e.indexOf(`\\`,t);return r===-1?i:i===-1?r:Math.min(r,i)},zt=(e,t,n)=>n===`both`?Math.max(e.lastIndexOf(`/`,t),e.lastIndexOf(`\\`,t)):e.lastIndexOf(n,t),X={};var Z=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;#e;#t;#n;#r;#i=[];#a=[];#o=[];#s=/* @__PURE__ */ new Map;#c=!1;#l=/* @__PURE__ */ new WeakMap;constructor(e,t={}){F(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||At,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.#e=!this.preserveMultipleSlashes,this.#n=(t.optimizationLevel??1)>=2;let n=t.normalize;this.#r=n===!0?`NFC`:n||void 0,this.make();let r=this.set.map(e=>this.#d(e));this.#o=this.set.map((e,t)=>this.#e&&e.length-1>r[t]),this.#i=this.set.map((e,t)=>{let n=this.#o[t]?e.length-1:e.length,i=e.slice(r[t]+1,n).filter(e=>typeof e==`string`&&!!e);return[...new Set(i)]}),this.#t=this.#i.some(e=>e.length),this.#a=this.set.map((e,n)=>{let[i,a,o]=e;if(this.#o[n]&&e.length===2&&i===R&&a!==R)return`tail`;if(this.#o[n]&&t.matchBase&&e.length===1&&i!==R&&i!==``)return`base`;if(this.#e&&r[n]===-1){if(e.length===3&&i===R&&o===R&&a!==R&&a!==``&&this.maxGlobstarRecursion>0)return`mid`;if(e.length===2&&a===R&&i!==R&&i!==``)return`head`}})}#u(e){return this.#r?e.normalize(this.#r):e}#d(e){if(!this.isWindows)return-1;if(U(e[0]))return 0;if(e[0]===``&&e[1]===``&&e[2]===`?`&&U(e[3]))return 3;let t=G(e);return t===-1?-1:t+1}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())];let n=this.globSet.map(e=>this.#C(e));this.globParts=this.preprocess(n),this.#c=!0;let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[2]===`?`&&W(e[3])?6:4,n=e[0]===``&&e[1]===``&&(e[2]===`?`||!Nt.test(e[2]))&&e.slice(3,t).every(e=>!Nt.test(e)),r=/^[a-z]:/i.test(e[0]);if(n)return[...e.slice(0,t).map(e=>this.#u(e)),...e.slice(t).map(e=>this.parse(e))];if(r)return[this.#u(e[0]),...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&(U(t[3])||W(this.globParts[e][3]))&&(W(this.globParts[e][3])&&(t[3]=`UNC`),t[2]=`?`)}t.noext||this.mergeRows(),this.#c=!1,this.set.forEach((e,t)=>{for(let n=0;n<e.length;n++)e[n]===X&&(e[n]=this.parse(this.globParts[t][n]))})}mergeRows(){let e=!0;for(;e;){e=!1;let t=Math.max(0,...this.set.map(e=>e.length));for(let n=0;n<t;n++){let t=/* @__PURE__ */ new Map;this.set.forEach((e,r)=>{if(!(e[n]instanceof Et||e[n]===X)||!It(this.globParts[r][n]))return;let i=[...this.globParts[r]];i[n]=``;let a=`${e.length}/${i.join(`/`)}`,o=t.get(a);o?o.push(r):t.set(a,[r])});let r=/* @__PURE__ */ new Set;for(let e of t.values()){if(e.length<2)continue;let[t,...i]=e,a=`@(${e.map(e=>this.globParts[e][n]).join(`|`)})`;this.globParts[t][n]=a,this.set[t][n]=this.parse(a);for(let e of i)r.add(e)}r.size&&(e=!0,this.set=this.set.filter((e,t)=>!r.has(t)),this.globParts=this.globParts.filter((e,t)=>!r.has(t)))}}}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>{let t=this.#d(e)+1;return e=e.reduce((e,n)=>{let r=e[e.length-1];return n===`**`&&r===`**`?e:n===`..`&&e.length>t&&r&&r!==`..`&&r!==`.`&&r!==`**`?(e.pop(),e):(e.push(n),e)},[]),e.length===0?[``]:e})}#f(e){let t=!this.isWindows||!e.includes(`\\`)?`/`:e.includes(`/`)?`both`:`\\`,n=this.#e?0:-1,r=``,i=0,a,o=0,s=!!this.options.dot;ROWS:for(let c=0;c<this.set.length;c++){let l=this.set[c],u=l[l.length-1],d=n!==-1&&this.#o[c]&&u!==R;if(d&&n===0){let s=zt(e,e.length,t);if(i=s+1,r=e.slice(i),r===``&&s>=0){let n=s;for(;n>0&&J(e.charCodeAt(n-1),t);)n--;o=n===0?0:zt(e,n-1,t)+1,a=e.slice(o,n)}let c=this.#n&&(H(r)||r===``&&a!==void 0&&H(a));n=c?-1:1,d=!c}let f=-1;if(d&&typeof u==`string`&&(f=Rt(u,r,i,a,o),f===-1))continue;if(this.#t){for(let t of this.#i[c])if(!e.includes(t))continue ROWS}if(d&&typeof u==`object`&&(f=Rt(u,r,i,a,o),f===-1))continue;let p=this.#a[c];if(p===`base`&&d)return`yes`;if(p===`tail`&&d){if(this.#n&&q(e,0,f,!0,t))return`maybe`;if(!q(e,0,f,s,t))return`yes`}else if(p===`mid`||p===`head`){let n=this.#m(e,l,p===`head`,s,t);if(n!==`no`)return n}else return`maybe`}return`no`}#p(e,t,n){let r=!!this.options.dot,i=e.length;if(n===`head`){if(i<2||!V(t[0],e[0]))return!1;for(let t=1;t<i;t++)if(!K(e[t],r))return!1;return!0}let a=t[1];if(n===`tail`){let t=i-1;if(!V(a,e[t])&&(e[t]!==``||i===1||!V(a,e[--t])))return!1;for(let n=0;n<t;n++)if(!K(e[n],r))return!1;return!0}for(let t=0;t<i;t++){if(V(a,e[t])&&t+1<i){let n=t+1;for(;n<i&&K(e[n],r);)n++;if(n===i)return!0}if(!K(e[t],r))return!1}return!1}#m(e,t,n,r,i){if(this.#n&&q(e,0,e.length,!0,i))return`maybe`;let a=t[+!n],o=0;for(let t=Y(e,o,i);t!==-1;t=Y(e,o,i)){let s=t+1;for(;s<e.length&&J(e.charCodeAt(s),i);)s++;if((typeof a==`string`?t-o===a.length&&e.startsWith(a,o):t>o&&a.testUnchecked(e.slice(o,t)))&&!q(e,s,e.length,r,i))return`yes`;if(n||q(e,o,s,r,i))return`no`;o=s}return`no`}#h(e){let t=B;return t?.f===e&&t.isWindows===this.isWindows&&t.preserveMultipleSlashes===this.preserveMultipleSlashes&&t.normalize===this.#r?t:void 0}#g(e){let{isWindows:t,preserveMultipleSlashes:n}=this,r=this.#C(t?e.split(`\\`).join(`/`):e),i=this.#r;return i&&(r=r.map(e=>e.normalize(i))),B={f:e,isWindows:t,preserveMultipleSlashes:n,normalize:i,parts:r},B}#_(e){let t=[...e],n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let e=1;e<t.length-1;e++){let r=t[e];e===1&&r===``&&t[0]===``||r!==`.`&&r!==``||(n=!0,t.splice(e,1),e--)}t[0]===`.`&&t.length===2&&(t[1]===`.`||t[1]===``)&&(n=!0,t.pop())}let e=this.#d(t)+1,r=e;for(;(r=t.indexOf(`..`,r+1))!==-1;){let i=t[r-1];i&&i!==`.`&&i!==`..`&&i!==`**`&&(n=!0,t.splice(r-1,2),r=Math.max(r-2,e))}}while(n);return t.length===0?[``]:t}firstPhasePreProcess(e){let{braceExpandMax:t=1e5}=this.options,n=!1;do{n=!1;for(let r of e){let i=-1;for(;(i=r.indexOf(`**`,i+1))!==-1;){let a=i;for(;r[a+1]===`**`;)a++;a>i&&r.splice(i+1,a-i);let o=r[i+1],s=r[i+2],c=r[i+3];if(o!==`..`||!s||s===`.`||s===`..`||!c||c===`.`||c===`..`||e.length>=t)continue;n=!0,r.splice(i,1);let l=r.slice(0);l[i]=`**`,e.push(l),i--}if(!this.preserveMultipleSlashes){for(let e=1;e<r.length-1;e++){let t=r[e];e===1&&t===``&&r[0]===``||t!==`.`&&t!==``||(n=!0,r.splice(e,1),e--)}r[0]===`.`&&r.length===2&&(r[1]===`.`||r[1]===``)&&(n=!0,r.pop())}let a=this.#d(r)+1,o=a;for(;(o=r.indexOf(`..`,o+1))!==-1;){let e=r[o-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){n=!0;let e=o===1&&r[o+1]===`**`?[`.`]:[];r.splice(o-1,2,...e),r.length===0&&r.push(``),o=Math.max(o-2,a)}}}}while(n);return e}secondPhasePreProcess(e){if(e.length>1e3)return e;for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}#v(e,t,n,r){let i=0,a=0,o=this.isWindows?G(t):-1,s=o===-1?-1:G(n);if(s!==-1){let e=n[s],r=n[s+1];typeof e!=`string`||typeof r!=`string`?(i=o,a=s):t[o].toLowerCase()===e.toLowerCase()&&t[o+1].toLowerCase()===r.toLowerCase()&&(i=o+2,a=s+2)}else if(this.isWindows){let t=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),r=!t&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof n[0]==`string`&&/^[a-z]:$/i.test(n[0]),s=!o&&n[0]===``&&n[1]===``&&n[2]===`?`&&typeof n[3]==`string`&&/^[a-z]:$/i.test(n[3]),c=r?3:t?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[t,r]=[e[c],n[l]];t.toLowerCase()===r.toLowerCase()&&(a=l+1,i=c+1)}}return e=t,n.includes(R)?this.#y(e,n,r,i,a):this.#S(e,n,r,i,a)}#y(e,t,n,r,i){let{head:a,body:o,tail:s,segments:c}=this.#b(t,n,i);if(a.length){let t=r+a.length;if(!this.#S(e,a,n,r,0,t))return!1;r+=a.length,i+=a.length}let l=0;if(s.length){if(s.length+r>e.length)return!1;let t=e.length-s.length;if(this.#S(e,s,n,t,0))l=s.length;else{if(e[e.length-1]!==``||r+s.length===e.length||(t--,!this.#S(e,s,n,t,0)))return!1;l=s.length+1}}if(!o.length){let t=!!l;for(let n=r;n<e.length-l;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}return!!this.#x(e,c,e.length-l,r,0,n,0,!!l,/* @__PURE__ */ new Set)}#b(e,t,n){let r=this.#l.get(e);r||(r=[],this.#l.set(e,r));let i=n*2+ +!!t,a=r[i];if(a)return a;let o=e.indexOf(R,n),s=e.lastIndexOf(R),c=e.slice(n,o),l=e.slice(o+1,t?void 0:s),u=t?[]:e.slice(s+1),d=[[[],0]],f=d[0],p=0,m=[0];for(let e of l)e===R?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);d.forEach((e,t)=>{e[1]=p-m[t]});let h={head:c,body:l,tail:u,segments:d};return r[i]=h,h}#x(e,t,n,r,i,a,o,s,c){let l=t[i];if(!l){if(a)return r>=n||r===n-1&&e[r]===``;for(let t=r;t<n;t++){s=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return s}let[u,d]=l,f=a?n:n-d;for(;r<=f;){let l=i*(e.length+1)+r;if(c.has(l))return!1;if(c.add(l),this.#S(e,u,a,r,0,r+u.length)&&o<this.maxGlobstarRecursion){let l=this.#x(e,t,n,r+u.length,i+1,a,o+1,s,c);if(l!==!1)return l}if(r===f)break;let d=e[r];if(d===`.`||d===`..`||!this.options.dot&&d.startsWith(`.`))return!1;r++}return a||null}#S(e,t,n,r,i,a=e.length){let o,s,c,l;for(o=r,s=i,l=Math.min(a,e.length),c=t.length;o<l&&s<c;o++,s++){let n=t[s],r=e[o];
33
31
  /* c8 ignore stop */
34
- if(n===!1||n===z||!H(n,r))return!1}if(o===l&&s===c)return!0;if(o===l)return n;if(s===c)return o===l-1&&e[o]===``;throw Error(`wtf?`)
32
+ if(n===!1||n===R||!V(n,r))return!1}if(o===l&&s===c)return!0;if(o===l)return n;if(s===c)return o===l-1&&e[o]===``;throw Error(`wtf?`)
35
33
  /* c8 ignore stop */
36
- }braceExpand(){return Ft(this.pattern,this.options)}parse(e){I(e);let t=this.options;if(e===`**`)return z;if(e===``)return``;let{nocase:n,nocaseMagicOnly:r,noext:i=!1,dot:a,normalize:o}=t,s=Rt(e,i);if(s!==void 0&&(!n||r||e.toUpperCase()===e.toLowerCase()))return this.#u(s);if(this.#c)return Z;let c=this.#s.get(e);return c||(c=new kt(e,{nocase:n,noext:i,dot:a,normalize:o}),this.#s.set(e,c)),c}#C(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options,r=this.#h(e);if(!r){if(!t&&!this.#r&&(this.#e||this.#t)&&Bt!==e){Bt=e;let t=this.#f(e);if(t===`no`)return!n.flipNegate&&this.negate;if(t===`yes`)return n.flipNegate?!0:!this.negate}r=this.#g(e)}let i=r.parts,a=this.#n?r.resolved??=this.#_(i):i,o=this.set,s=i[i.length-1];if(!s)for(let e=i.length-2;!s&&e>=0;e--)s=i[e];for(let e=0;e<o.length;e++){let r=o[e],c=t?void 0:this.#a[e];if(c===`base`?H(r[0],s):c?this.#p(a,r,c):n.matchBase&&r.length===1?this.#v([s],[s],r,t):this.#v(i,a,r,t))return n.flipNegate?!0:!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return L.defaults(e).Minimatch}};L.Minimatch=Q,L.escape=At,L.unescape=jt;function $(e){let t=e.replace(/\\/g,`/`),n=b.posix.normalize(t);return n.endsWith(`/`)?n.slice(0,-1):n}function Ut(e,t){if(t===`.`)return e;let n=`${t}/`;if(!e.startsWith(n))throw Error(`Expected migrations pattern ${JSON.stringify(e)} to start with ${JSON.stringify(n)}`);return e.slice(n.length)}function Wt(e){return`"${e.replace(/"/g,`""`)}"`}function Gt(e){return`CREATE TABLE IF NOT EXISTS ${Wt(e)}(
34
+ }braceExpand(){return Mt(this.pattern,this.options)}parse(e){F(e);let t=this.options;if(e===`**`)return R;if(e===``)return``;let{nocase:n,nocaseMagicOnly:r,noext:i=!1,dot:a,normalize:o}=t,s=Ft(e,i);if(s!==void 0&&(!n||r||e.toUpperCase()===e.toLowerCase()))return this.#u(s);if(this.#c)return X;let c=this.#s.get(e);return c||(c=new Et(e,{nocase:n,noext:i,dot:a,normalize:o}),this.#s.set(e,c)),c}#C(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options,r=this.#h(e);if(!r){if(!t&&!this.#r&&(this.#e||this.#t)&&Lt!==e){Lt=e;let t=this.#f(e);if(t===`no`)return!n.flipNegate&&this.negate;if(t===`yes`)return n.flipNegate?!0:!this.negate}r=this.#g(e)}let i=r.parts,a=this.#n?r.resolved??=this.#_(i):i,o=this.set,s=i[i.length-1];if(!s)for(let e=i.length-2;!s&&e>=0;e--)s=i[e];for(let e=0;e<o.length;e++){let r=o[e],c=t?void 0:this.#a[e];if(c===`base`?V(r[0],s):c?this.#p(a,r,c):n.matchBase&&r.length===1?this.#v([s],[s],r,t):this.#v(i,a,r,t))return n.flipNegate?!0:!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return I.defaults(e).Minimatch}};I.Minimatch=Z,I.escape=Dt,I.unescape=Ot;function Q(e){let t=e.replace(/\\/g,`/`),n=y.posix.normalize(t);return n.endsWith(`/`)?n.slice(0,-1):n}function Bt(e,t){if(t===`.`)return e;let n=`${t}/`;if(!e.startsWith(n))throw Error(`Expected migrations pattern ${JSON.stringify(e)} to start with ${JSON.stringify(n)}`);return e.slice(n.length)}function $(e){return`"${e.replace(/"/g,`""`)}"`}function Vt(e){return`CREATE TABLE IF NOT EXISTS ${$(e)}(
37
35
  id INTEGER PRIMARY KEY AUTOINCREMENT,
38
36
  name TEXT UNIQUE,
39
37
  applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
40
- );`}function Kt(e){return`SELECT *
41
- FROM ${Wt(e)}
42
- ORDER BY id`}function qt(e){if(e.pattern!==void 0&&e.dir===void 0)throw Error(`You have set --pattern "${e.pattern}" but have not set --dir.\n\nWhen --pattern is set, --dir must also be set, and --pattern must start with "<dir>/".`);let t=$(e.dir??`./migrations`),n=$(`${t}/*.sql`),r;if(e.pattern===void 0)r=n;else{r=$(e.pattern);try{Ut(r,t)}catch{throw Error(`--pattern "${e.pattern}" must start with "${t}/" to match --dir "${t}".\nEither change --pattern so it starts with "${t}/" (for example, "${n}"), or change --dir to match the start of your pattern.`)}}return{migrationsPath:b.resolve(e.cwd??process.cwd(),t),migrationsDir:t,migrationsPattern:r,migrationsTableName:e.table??`d1_migrations`}}function Jt(e,t){let n=[],r=[{abs:e,rel:``}];for(;r.length>0;){let{abs:e,rel:i}=r.pop(),a;try{a=y.readdirSync(e,{withFileTypes:!0})}catch{continue}for(let o of a){let a=i===``?o.name:`${i}/${o.name}`;o.isDirectory()?t.match(a,!0)&&r.push({abs:b.join(e,o.name),rel:a}):o.isFile()&&t.match(a)&&n.push(a)}}return n.sort(Zt)}function Yt(e){let t=e.split(`/`)[0]??``;return parseInt(t.split(`_`)[0]??``,10)}function Xt(e,t){let n=Yt(e),r=Yt(t);if(n!==r){if(Number.isFinite(n)&&Number.isFinite(r))return n-r;if(Number.isFinite(n))return-1;if(Number.isFinite(r))return 1}return e<t?-1:+(e>t)}function Zt(e,t){let n=e.split(`/`),r=t.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=Xt(n[e]??``,r[e]??``);if(t!==0)return t}return n.length-r.length}function Qt(e){let t=Ut(e.migrationsPattern,e.migrationsDir);return Jt(e.migrationsPath,new Q(t,{dot:!1}))}function $t(e,t){let n=[];for(let r of e)t.includes(r)||n.push(r);return n}function en(e){let t=Qt(e).map(e=>Yt(e)).filter(e=>Number.isFinite(e));return Math.max(...t,0)+1}function tn(e){if(Jt(e.migrationsPath,new Q(`*/migration.sql`,{dot:!1})).length!==0)return $(`${e.migrationsDir}/*/migration.sql`)}function nn(e){let t=``,n,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=e[a+1];n===void 0?r?o===`\r`&&s===`
38
+ );`}function Ht(e){return`SELECT *
39
+ FROM ${$(e)}
40
+ ORDER BY id`}function Ut(e){if(e.pattern!==void 0&&e.dir===void 0)throw Error(`You have set --pattern "${e.pattern}" but have not set --dir.\n\nWhen --pattern is set, --dir must also be set, and --pattern must start with "<dir>/".`);let t=Q(e.dir??`./migrations`),n=Q(`${t}/*.sql`),r;if(e.pattern===void 0)r=n;else{r=Q(e.pattern);try{Bt(r,t)}catch{throw Error(`--pattern "${e.pattern}" must start with "${t}/" to match --dir "${t}".\nEither change --pattern so it starts with "${t}/" (for example, "${n}"), or change --dir to match the start of your pattern.`)}}return{migrationsPath:y.resolve(e.cwd??process.cwd(),t),migrationsDir:t,migrationsPattern:r,migrationsTableName:e.table??`d1_migrations`}}function Wt(e,t){let n=[],r=[{abs:e,rel:``}];for(;r.length>0;){let{abs:e,rel:i}=r.pop(),a;try{a=v.readdirSync(e,{withFileTypes:!0})}catch{continue}for(let o of a){let a=i===``?o.name:`${i}/${o.name}`;o.isDirectory()?t.match(a,!0)&&r.push({abs:y.join(e,o.name),rel:a}):o.isFile()&&t.match(a)&&n.push(a)}}return n.sort(qt)}function Gt(e){let t=e.split(`/`)[0]??``;return parseInt(t.split(`_`)[0]??``,10)}function Kt(e,t){let n=Gt(e),r=Gt(t);if(n!==r){if(Number.isFinite(n)&&Number.isFinite(r))return n-r;if(Number.isFinite(n))return-1;if(Number.isFinite(r))return 1}return e<t?-1:+(e>t)}function qt(e,t){let n=e.split(`/`),r=t.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=Kt(n[e]??``,r[e]??``);if(t!==0)return t}return n.length-r.length}function Jt(e){let t=Bt(e.migrationsPattern,e.migrationsDir);return Wt(e.migrationsPath,new Z(t,{dot:!1}))}function Yt(e,t){let n=[];for(let r of e)t.includes(r)||n.push(r);return n}function Xt(e){let t=Jt(e).map(e=>Gt(e)).filter(e=>Number.isFinite(e));return Math.max(...t,0)+1}function Zt(e){if(Wt(e.migrationsPath,new Z(`*/migration.sql`,{dot:!1})).length!==0)return Q(`${e.migrationsDir}/*/migration.sql`)}function Qt(e){let t=``,n,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=e[a+1];n===void 0?r?o===`\r`&&s===`
43
41
  `?(t+=`
44
42
  `,a++,r=!1):(t+=o,r=o!==`
45
43
  `):i?o===`\r`&&s===`
46
44
  `?(t+=`
47
45
  `,a++):(t+=o,o===`*`&&s===`/`&&(t+=s,a++,i=!1)):o===`-`&&s===`-`?(t+=`--`,a++,r=!0):o===`/`&&s===`*`?(t+=`/*`,a++,i=!0):o===`'`||o===`"`||o==="`"?(t+=o,n=o):o===`[`?(t+=o,n=`]`):o===`\r`&&s===`
48
46
  `?(t+=`
49
- `,a++):t+=o:(t+=o,o===n&&(s===n?(t+=s,a++):n=void 0))}return t}function rn({migrationsPath:e,migrationName:t,migrationsTableName:n}){return`${y.readFileSync(b.join(e,t),`utf8`)}
50
- INSERT INTO ${Wt(n)} (name)
51
- values ('${t.replace(/'/g,`''`)}');`}function an(e){return e.option(`dir`,{type:`string`,description:`Directory containing migration files (default: ./migrations)`}).option(`pattern`,{type:`string`,description:`Glob for discovering migration files under --dir. Defaults to "<dir>/*.sql"; Drizzle's nested layout uses "<dir>/*/migration.sql"`})}function on(e){return an(e).option(`table`,{type:`string`,description:`Table recording applied migrations`,default:`d1_migrations`})}async function sn(e,t,n,r,i,a=!1){return l(i,async()=>{let i={account_id:t,database_id:n,body:{sql:nn(r)}};return a?((await e.send(S,i))?.result??[]).map(e=>{let t=e.results?.columns??[],n=e.results?.rows??[];return{...e,results:n.map(e=>Object.fromEntries(t.map((t,n)=>[t,e[n]])))}}):(await e.send(x,i))?.result??[]})}async function cn(e){if(!i(e.database))throw Error(`Expected a D1 database ID, but received <database>=${JSON.stringify(e.database)}. Database names and binding names are not accepted.`);let t=qt({dir:e.dir,pattern:e.pattern,table:e.table});if(!y.existsSync(t.migrationsPath))throw Error(`No migrations directory at ${t.migrationsPath}.`+(e.dir===void 0?` Pass --dir to point at one.`:``));return{client:await r(e),accountId:e.local?n:await o(),databaseId:e.database,config:t,local:e.local===!0}}async function ln(e){let{client:t,accountId:n,databaseId:r,config:i}=e;await sn(t,n,r,Gt(i.migrationsTableName),`Preparing`,e.local);let a=(await sn(t,n,r,Kt(i.migrationsTableName),`Loading`,e.local))[0].results.map(e=>e.name),o=Qt(i);if(o.length===0){let e=tn(i);e!==void 0&&process.stderr.write(`No files matched --pattern "${i.migrationsPattern}", but "${e}" does match. If an ORM such as drizzle manages your migrations, pass --pattern "${e}".\n`)}return{applied:a,all:o,unapplied:$t(o,a)}}function un(e){return on(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const dn={command:`apply <database>`,describe:`Apply any unapplied D1 migrations`,builder:un,handler:async e=>{let t=await cn(e),n=(await ln(t)).unapplied.map(e=>({name:e,status:`🕒️`}));if(n.length===0)s([],{successLabel:`No migrations to apply`,quiet:e.quiet});else if(await ee(`About to apply ${n.length} migration(s)\nYour database may not be available to serve requests during the migration, continue?`)){for(let e of n){let n=rn({migrationsPath:t.config.migrationsPath,migrationName:e.name,migrationsTableName:t.config.migrationsTableName}),r=!0,i=[];try{let i=await sn(t.client,t.accountId,t.databaseId,n,`Applying ${e.name}`,t.local);for(let e of i)e.success||(r=!1)}catch(e){r=!1,i=[e instanceof Error?e.message:String(e)]}if(e.status=r?`✅`:`❌`,i.length>0)throw Error(i.join(`
52
- `))}s(n,{quiet:e.quiet})}}};function fn(e){return an(e.positional(`message`,{type:`string`,description:`Describes what the migration does`,demandOption:!0}))}const pn={command:`create <message>`,describe:`Create a new empty D1 migration file`,builder:fn,handler:async e=>{if(e.local)throw Error("--local is not supported with `cf d1 migrations create`. This command only creates a migration file on your local filesystem, so you do not need --local.");let t=qt({dir:e.dir,pattern:e.pattern}),n=mn(en(t),4),r=e.message.replaceAll(` `,`_`);if(/[\\/]/.test(r))throw Error(`The migration name ${JSON.stringify(e.message)} contains a path separator ("/" or "\\"). Remove it and try again.`);if(/[:*?"<>|]/.test(r))throw Error(`The migration name ${JSON.stringify(e.message)} contains a character that cannot be used in a file name (: * ? " < > |). Remove it and try again.`);let i=`${n}_${r}.sql`,a=$(`${t.migrationsDir}/${i}`);if(!new Q(t.migrationsPattern,{dot:!1}).match(a))throw Error(`Would create "${a}", but --pattern "${t.migrationsPattern}" would not match it, so \`cf d1 migrations apply\` would skip it.\n\`cf d1 migrations create\` only writes top-level files inside --dir. If you are using an ORM like Drizzle, use \`drizzle-kit generate\` instead — it writes the nested layout your pattern expects.`);if(!y.existsSync(t.migrationsPath)){if(!await ee(`No migrations folder found.\nOk to create ${t.migrationsPath}?`))throw Error(`No migrations folder present at ${t.migrationsPath}.`);y.mkdirSync(t.migrationsPath,{recursive:!0})}let o=b.join(t.migrationsPath,i);y.writeFileSync(o,`-- Migration number: ${n} \t ${(/* @__PURE__ */ new Date()).toISOString()}\n`),s({name:i,path:o},{successLabel:`Created ${i}`,quiet:e.quiet})}};function mn(e,t){let n=e.toString();for(;n.length<t;)n=`0`+n;return n}function hn(e){return on(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const gn={command:`list <database>`,describe:`View a list of unapplied migration files`,builder:hn,handler:async e=>{let{unapplied:t}=await ln(await cn(e));s(t.map(e=>({Name:e})),{quiet:e.quiet})}},_n={command:`migrations`,describe:`Create, list, and apply D1 database migrations`,builder:e=>e.command(u(dn,{command:`d1 migrations apply`,classification:{safeFlags:[]}})).command(u(pn,{command:`d1 migrations create`,classification:{safeFlags:[]}})).command(u(gn,{command:`d1 migrations list`,classification:{safeFlags:[]}})).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},vn={command:`d1`,describe:`D1 is Cloudflare's managed, serverless database with SQLite's SQL semantics, built-in disaster recovery, and Worker and HTTP API access.`,builder:e=>e.command(re).command(oe).command(le).command(fe).command(he).command(_e).command(ye).command(ke).command(Me).command(t(_n,`preview`)).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{vn as default};
47
+ `,a++):t+=o:(t+=o,o===n&&(s===n?(t+=s,a++):n=void 0))}return t}function $t({migrationsPath:e,migrationName:t,migrationsTableName:n}){return`${v.readFileSync(y.join(e,t),`utf8`)}
48
+ INSERT INTO ${$(n)} (name)
49
+ values ('${t.replace(/'/g,`''`)}');`}function en(e){return e.option(`dir`,{type:`string`,description:`Directory containing migration files (default: ./migrations)`}).option(`pattern`,{type:`string`,description:`Glob for discovering migration files under --dir. Defaults to "<dir>/*.sql"; Drizzle's nested layout uses "<dir>/*/migration.sql"`})}function tn(e){return en(e).option(`table`,{type:`string`,description:`Table recording applied migrations`,default:`d1_migrations`})}async function nn(e,t,n,r,i,a=!1){return l(i,async()=>{let i={account_id:t,database_id:n,body:{sql:Qt(r)}};return a?((await e.send(x,i))?.result??[]).map(e=>{let t=e.results?.columns??[],n=e.results?.rows??[];return{...e,results:n.map(e=>Object.fromEntries(t.map((t,n)=>[t,e[n]])))}}):(await e.send(b,i))?.result??[]})}async function rn(e){if(!i(e.database))throw Error(`Expected a D1 database ID, but received <database>=${JSON.stringify(e.database)}. Database names and binding names are not accepted.`);let t=Ut({dir:e.dir,pattern:e.pattern,table:e.table});if(!v.existsSync(t.migrationsPath))throw Error(`No migrations directory at ${t.migrationsPath}.`+(e.dir===void 0?` Pass --dir to point at one.`:``));return{client:await r(e),accountId:e.local?n:await o(),databaseId:e.database,config:t,local:e.local===!0}}async function an(e){let{client:t,accountId:n,databaseId:r,config:i}=e;await nn(t,n,r,Vt(i.migrationsTableName),`Preparing`,e.local);let a=(await nn(t,n,r,Ht(i.migrationsTableName),`Loading`,e.local))[0].results.map(e=>e.name),o=Jt(i);if(o.length===0){let e=Zt(i);e!==void 0&&process.stderr.write(`No files matched --pattern "${i.migrationsPattern}", but "${e}" does match. If an ORM such as drizzle manages your migrations, pass --pattern "${e}".\n`)}return{applied:a,all:o,unapplied:Yt(o,a)}}function on(e){return tn(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const sn={command:`apply <database>`,describe:`Apply any unapplied D1 migrations`,builder:on,handler:async e=>{let t=await rn(e),n=(await an(t)).unapplied.map(e=>({name:e,status:`🕒️`}));if(n.length===0)s([],{successLabel:`No migrations to apply`,quiet:e.quiet});else if(await ee(`About to apply ${n.length} migration(s)\nYour database may not be available to serve requests during the migration, continue?`)){for(let e of n){let n=$t({migrationsPath:t.config.migrationsPath,migrationName:e.name,migrationsTableName:t.config.migrationsTableName}),r=!0,i=[];try{let i=await nn(t.client,t.accountId,t.databaseId,n,`Applying ${e.name}`,t.local);for(let e of i)e.success||(r=!1)}catch(e){r=!1,i=[e instanceof Error?e.message:String(e)]}if(e.status=r?`✅`:`❌`,i.length>0)throw Error(i.join(`
50
+ `))}s(n,{quiet:e.quiet})}}};function cn(e){return en(e.positional(`message`,{type:`string`,description:`Describes what the migration does`,demandOption:!0}))}const ln={command:`create <message>`,describe:`Create a new empty D1 migration file`,builder:cn,handler:async e=>{if(e.local)throw Error("--local is not supported with `cf d1 migrations create`. This command only creates a migration file on your local filesystem, so you do not need --local.");let t=Ut({dir:e.dir,pattern:e.pattern}),n=un(Xt(t),4),r=e.message.replaceAll(` `,`_`);if(/[\\/]/.test(r))throw Error(`The migration name ${JSON.stringify(e.message)} contains a path separator ("/" or "\\"). Remove it and try again.`);if(/[:*?"<>|]/.test(r))throw Error(`The migration name ${JSON.stringify(e.message)} contains a character that cannot be used in a file name (: * ? " < > |). Remove it and try again.`);let i=`${n}_${r}.sql`,a=Q(`${t.migrationsDir}/${i}`);if(!new Z(t.migrationsPattern,{dot:!1}).match(a))throw Error(`Would create "${a}", but --pattern "${t.migrationsPattern}" would not match it, so \`cf d1 migrations apply\` would skip it.\n\`cf d1 migrations create\` only writes top-level files inside --dir. If you are using an ORM like Drizzle, use \`drizzle-kit generate\` instead — it writes the nested layout your pattern expects.`);if(!v.existsSync(t.migrationsPath)){if(!await ee(`No migrations folder found.\nOk to create ${t.migrationsPath}?`))throw Error(`No migrations folder present at ${t.migrationsPath}.`);v.mkdirSync(t.migrationsPath,{recursive:!0})}let o=y.join(t.migrationsPath,i);v.writeFileSync(o,`-- Migration number: ${n} \t ${(/* @__PURE__ */ new Date()).toISOString()}\n`),s({name:i,path:o},{successLabel:`Created ${i}`,quiet:e.quiet})}};function un(e,t){let n=e.toString();for(;n.length<t;)n=`0`+n;return n}function dn(e){return tn(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const fn={command:`list <database>`,describe:`View a list of unapplied migration files`,builder:dn,handler:async e=>{let{unapplied:t}=await an(await rn(e));s(t.map(e=>({Name:e})),{quiet:e.quiet})}},pn={command:`migrations`,describe:`Create, list, and apply D1 database migrations`,builder:e=>e.command(u(sn,{command:`d1 migrations apply`,classification:{safeFlags:[]}})).command(u(ln,{command:`d1 migrations create`,classification:{safeFlags:[]}})).command(u(fn,{command:`d1 migrations list`,classification:{safeFlags:[]}})).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},mn={command:`d1`,describe:`D1 is Cloudflare's managed, serverless database with SQLite's SQL semantics, built-in disaster recovery, and Worker and HTTP API access.`,builder:e=>e.command(re).command(oe).command(le).command(fe).command(he).command(_e).command(ye).command(ke).command(t(pn,`preview`)).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{mn as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./package-CiRJBRHO.mjs";import{createRequire as t}from"node:module";import{existsSync as n,readFileSync as r,realpathSync as i}from"node:fs";import{dirname as a,resolve as o}from"node:path";import{fileURLToPath as s}from"node:url";import{constants as c}from"node:os";import{spawn as l}from"node:child_process";const u=`CF_DELEGATION`,d=`CF_DELEGATING_CLI_VERSION`,f=`CF_DELEGATION_PID`;function p(e){if(e.env.CF_DELEGATION||b(e.ownPackageJsonPath))return null;let i;try{i=t(o(e.cwd,`package.json`)).resolve(`cf/package.json`)}catch{return null}if(e.ownPackageJsonPath&&y(i,e.ownPackageJsonPath))return null;let s;try{s=JSON.parse(r(i,`utf-8`))}catch{return null}let c=v(s.bin);if(!c)return null;let l=o(a(i),c);return n(l)?{packageJsonPath:i,binPath:l,version:typeof s.version==`string`?s.version:`unknown`}:null}async function m(e={}){let t=e.cwd??process.cwd(),n=e.argv??process.argv.slice(2),r=e.env??process.env,i=p({cwd:t,ownPackageJsonPath:e.ownPackageJsonPath===void 0?S():e.ownPackageJsonPath,env:r});return i?{delegated:!0,exitCode:await _(i.binPath,n,r)}:{delegated:!1}}async function h(){let e=process.argv.slice(2);return g(e)?{delegated:!1}:m({argv:e})}function g(e){return e.find(e=>!e.startsWith(`-`))===`complete`}function _(t,n,r){return new Promise((i,a)=>{let o=l(process.execPath,[t,...n],{stdio:[`inherit`,`inherit`,`inherit`,`ipc`],env:{...r,[u]:`1`,[d]:e,[f]:String(process.pid)}});o.on(`message`,e=>{process.send&&process.send(e)});let s=e=>()=>{o.kill(e)},p=s(`SIGINT`),m=s(`SIGTERM`);process.on(`SIGINT`,p),process.on(`SIGTERM`,m);let h=()=>{process.off(`SIGINT`,p),process.off(`SIGTERM`,m)};o.once(`exit`,(e,t)=>{h(),i(e===null?t?128+(c.signals[t]??1):0:e)}),o.once(`error`,e=>{h(),a(e)})})}function v(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e,n=t.cf;if(typeof n==`string`)return n;for(let e of Object.values(t))if(typeof e==`string`)return e}return null}function y(e,t){try{return i(e)===i(t)}catch{return o(e)===o(t)}}function b(e){return e?e.split(/[\\/]/).some(e=>e===`_npx`||e===`dlx`||e.startsWith(`dlx-`)):!1}function x(){return b(S())}function S(){let e=a(s(import.meta.url));for(;;){let t=o(e,`package.json`);if(n(t))return t;let r=a(e);if(r===e)return null;e=r}}export{h as a,x as i,d as n,m as o,u as r,p as s,f as t};
2
+ import{t as e}from"./package-B7RgwuFR.mjs";import{createRequire as t}from"node:module";import{existsSync as n,readFileSync as r,realpathSync as i}from"node:fs";import{dirname as a,resolve as o}from"node:path";import{fileURLToPath as s}from"node:url";import{constants as c}from"node:os";import{spawn as l}from"node:child_process";const u=`CF_DELEGATION`,d=`CF_DELEGATING_CLI_VERSION`,f=`CF_DELEGATION_PID`;function p(e){if(e.env.CF_DELEGATION||b(e.ownPackageJsonPath))return null;let i;try{i=t(o(e.cwd,`package.json`)).resolve(`cf/package.json`)}catch{return null}if(e.ownPackageJsonPath&&y(i,e.ownPackageJsonPath))return null;let s;try{s=JSON.parse(r(i,`utf-8`))}catch{return null}let c=v(s.bin);if(!c)return null;let l=o(a(i),c);return n(l)?{packageJsonPath:i,binPath:l,version:typeof s.version==`string`?s.version:`unknown`}:null}async function m(e={}){let t=e.cwd??process.cwd(),n=e.argv??process.argv.slice(2),r=e.env??process.env,i=p({cwd:t,ownPackageJsonPath:e.ownPackageJsonPath===void 0?S():e.ownPackageJsonPath,env:r});return i?{delegated:!0,exitCode:await _(i.binPath,n,r)}:{delegated:!1}}async function h(){let e=process.argv.slice(2);return g(e)?{delegated:!1}:m({argv:e})}function g(e){return e.find(e=>!e.startsWith(`-`))===`complete`}function _(t,n,r){return new Promise((i,a)=>{let o=l(process.execPath,[t,...n],{stdio:[`inherit`,`inherit`,`inherit`,`ipc`],env:{...r,[u]:`1`,[d]:e,[f]:String(process.pid)}});o.on(`message`,e=>{process.send&&process.send(e)});let s=e=>()=>{o.kill(e)},p=s(`SIGINT`),m=s(`SIGTERM`);process.on(`SIGINT`,p),process.on(`SIGTERM`,m);let h=()=>{process.off(`SIGINT`,p),process.off(`SIGTERM`,m)};o.once(`exit`,(e,t)=>{h(),i(e===null?t?128+(c.signals[t]??1):0:e)}),o.once(`error`,e=>{h(),a(e)})})}function v(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e,n=t.cf;if(typeof n==`string`)return n;for(let e of Object.values(t))if(typeof e==`string`)return e}return null}function y(e,t){try{return i(e)===i(t)}catch{return o(e)===o(t)}}function b(e){return e?e.split(/[\\/]/).some(e=>e===`_npx`||e===`dlx`||e.startsWith(`dlx-`)):!1}function x(){return b(S())}function S(){let e=a(s(import.meta.url));for(;;){let t=o(e,`package.json`);if(n(t))return t;let r=a(e);if(r===e)return null;e=r}}export{h as a,x as i,d as n,m as o,u as r,p as s,f as t};
package/dist/delegate.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export{t as DELEGATING_PID_ENV,n as DELEGATING_VERSION_ENV,r as DELEGATION_SENTINEL,i as isEphemeralExecRun,a as maybeDelegateFromProcess,o as maybeDelegateToLocalInstall,s as resolveDelegateTarget}from"./delegate-B4bKqF7i.mjs";
2
+ export{t as DELEGATING_PID_ENV,n as DELEGATING_VERSION_ENV,r as DELEGATION_SENTINEL,i as isEphemeralExecRun,a as maybeDelegateFromProcess,o as maybeDelegateToLocalInstall,s as resolveDelegateTarget}from"./delegate-CcL6RoGw.mjs";
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{n as e,t}from"./shared--uVkAAd7.mjs";function n(t){return e(t).option(`provision`,{type:`boolean`,description:`Automatically provision resources for bindings that need them`,default:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of a dispatch namespace to deploy the Worker to (Workers for Platforms)`,requiresArg:!0}).option(`containers-rollout`,{description:`Rollout strategy for Container changes. Immediate rolls out to all instances in one step; none leaves deployed Containers unchanged.`,choices:[`immediate`,`gradual`,`none`]})}const r={command:`deploy`,describe:`Deploy a Worker, static site, or full-stack application to Cloudflare`,builder:n,handler:async e=>{await t(e,{command:`Deploy`})}};export{r as default};
2
+ import{n as e,t}from"./shared-MK-_lkbn.mjs";function n(t){return e(t).option(`provision`,{type:`boolean`,description:`Automatically provision resources for bindings that need them`,default:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of a dispatch namespace to deploy the Worker to (Workers for Platforms)`,requiresArg:!0}).option(`containers-rollout`,{description:`Rollout strategy for Container changes. Immediate rolls out to all instances in one step; none leaves deployed Containers unchanged.`,choices:[`immediate`,`gradual`,`none`]})}const r={command:`deploy`,describe:`Deploy a Worker, static site, or full-stack application to Cloudflare`,builder:n,handler:async e=>{await t(e,{command:`Deploy`})}};export{r as default};