cf-workers-native 0.0.0-stage → 0.1.2-beta.local.sha2f5e4e6956f4

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 (629) hide show
  1. package/LICENSE +21 -0
  2. package/Package.swift +25 -0
  3. package/README.md +92 -2
  4. package/dist/android.d.ts +2 -0
  5. package/dist/android.js +1 -0
  6. package/dist/browser/abort/index.d.ts +13 -0
  7. package/dist/browser/abort/index.js +66 -0
  8. package/dist/browser/body/index.d.ts +24 -0
  9. package/dist/browser/body/index.js +116 -0
  10. package/dist/browser/body/stream-body.d.ts +13 -0
  11. package/dist/browser/body/stream-body.js +84 -0
  12. package/dist/browser/documents/body.d.ts +3 -0
  13. package/dist/browser/documents/body.js +48 -0
  14. package/dist/browser/documents/form-body.d.ts +1 -0
  15. package/dist/browser/documents/form-body.js +54 -0
  16. package/dist/browser/documents/host.d.ts +11 -0
  17. package/dist/browser/documents/host.js +256 -0
  18. package/dist/browser/documents/links-source.d.ts +1 -0
  19. package/dist/browser/documents/links-source.js +1 -0
  20. package/dist/browser/documents/links.d.ts +1 -0
  21. package/dist/browser/documents/links.js +33 -0
  22. package/dist/browser/documents/page-config.d.ts +5 -0
  23. package/dist/browser/documents/page-config.js +5 -0
  24. package/dist/browser/documents/page-source.d.ts +1 -0
  25. package/dist/browser/documents/page-source.js +1 -0
  26. package/dist/browser/documents/page.d.ts +2 -0
  27. package/dist/browser/documents/page.js +153 -0
  28. package/dist/browser/documents/registration.d.ts +5 -0
  29. package/dist/browser/documents/registration.js +75 -0
  30. package/dist/browser/documents/runtime.d.ts +7 -0
  31. package/dist/browser/documents/runtime.js +161 -0
  32. package/dist/browser/documents/service-worker.js +285 -0
  33. package/dist/browser/encoding/index.d.ts +7 -0
  34. package/dist/browser/encoding/index.js +3 -0
  35. package/dist/browser/fetch/LICENSE-3RD-PARTY.md +9 -0
  36. package/dist/browser/fetch/LICENSE-APACHE +177 -0
  37. package/dist/browser/fetch/host-call.d.ts +3 -0
  38. package/dist/browser/fetch/host-call.js +67 -0
  39. package/dist/browser/fetch/index.d.ts +5 -0
  40. package/dist/browser/fetch/index.js +96 -0
  41. package/dist/browser/fetch/interop.d.ts +6 -0
  42. package/dist/browser/fetch/interop.js +48 -0
  43. package/dist/browser/fetch/native-network.d.ts +20 -0
  44. package/dist/browser/fetch/native-network.js +233 -0
  45. package/dist/browser/fetch/outbound.d.ts +2 -0
  46. package/dist/browser/fetch/outbound.js +11 -0
  47. package/dist/browser/fetch/relay.d.ts +7 -0
  48. package/dist/browser/fetch/relay.js +100 -0
  49. package/dist/browser/fetch/scope.d.ts +8 -0
  50. package/dist/browser/fetch/scope.js +108 -0
  51. package/dist/browser/fetch/transport.d.ts +39 -0
  52. package/dist/browser/fetch/transport.js +136 -0
  53. package/dist/browser/headers/LICENSE-3RD-PARTY.md +9 -0
  54. package/dist/browser/headers/LICENSE-APACHE +177 -0
  55. package/dist/browser/headers/index.d.ts +20 -0
  56. package/dist/browser/headers/index.js +194 -0
  57. package/dist/browser/isolated/bridge.d.ts +8 -0
  58. package/dist/browser/isolated/bridge.js +267 -0
  59. package/dist/browser/isolated/protocol.d.ts +40 -0
  60. package/dist/browser/isolated/protocol.js +1 -0
  61. package/dist/browser/isolated/transport.d.ts +2 -0
  62. package/dist/browser/isolated/transport.js +157 -0
  63. package/dist/browser/request/LICENSE-3RD-PARTY.md +10 -0
  64. package/dist/browser/request/LICENSE-APACHE +177 -0
  65. package/dist/browser/request/index.d.ts +48 -0
  66. package/dist/browser/request/index.js +182 -0
  67. package/dist/browser/response/LICENSE-3RD-PARTY.md +10 -0
  68. package/dist/browser/response/LICENSE-APACHE +177 -0
  69. package/dist/browser/response/index.d.ts +43 -0
  70. package/dist/browser/response/index.js +192 -0
  71. package/dist/browser/response/status.d.ts +1 -0
  72. package/dist/browser/response/status.js +75 -0
  73. package/dist/browser/structured-clone/index.d.ts +1 -0
  74. package/dist/browser/structured-clone/index.js +479 -0
  75. package/dist/cloudflare/apis/cloudflare-node/index.d.ts +18 -0
  76. package/dist/cloudflare/apis/cloudflare-node/index.js +150 -0
  77. package/dist/cloudflare/apis/cloudflare-workers/index.d.ts +8 -0
  78. package/dist/cloudflare/apis/cloudflare-workers/index.js +37 -0
  79. package/dist/cloudflare/apis/types.d.ts +7 -0
  80. package/dist/cloudflare/apis/types.js +1 -0
  81. package/dist/cloudflare/bindings/config.d.ts +42 -0
  82. package/dist/cloudflare/bindings/config.js +280 -0
  83. package/dist/cloudflare/bindings/kv/contract.d.ts +6 -0
  84. package/dist/cloudflare/bindings/kv/contract.js +181 -0
  85. package/dist/cloudflare/bindings/kv/index.d.ts +18 -0
  86. package/dist/cloudflare/bindings/kv/index.js +61 -0
  87. package/dist/cloudflare/bindings/kv/storage.d.ts +25 -0
  88. package/dist/cloudflare/bindings/kv/storage.js +320 -0
  89. package/dist/cloudflare/bindings/kv/types.d.ts +50 -0
  90. package/dist/cloudflare/bindings/kv/types.js +1 -0
  91. package/dist/cloudflare/bindings/remote.d.ts +8 -0
  92. package/dist/cloudflare/bindings/remote.js +261 -0
  93. package/dist/cloudflare/workers/contract.d.ts +8 -0
  94. package/dist/cloudflare/workers/contract.js +65 -0
  95. package/dist/cloudflare/workers/feature.d.ts +10 -0
  96. package/dist/cloudflare/workers/feature.js +28 -0
  97. package/dist/cloudflare/workers/runtime.d.ts +23 -0
  98. package/dist/cloudflare/workers/runtime.js +121 -0
  99. package/dist/cloudflare/workers/types.d.ts +49 -0
  100. package/dist/cloudflare/workers/types.js +1 -0
  101. package/dist/cloudflare/workers/worker-runtime.d.ts +44 -0
  102. package/dist/cloudflare/workers/worker-runtime.js +267 -0
  103. package/dist/compat/assert/LICENSE-3RD-PARTY.md +5 -0
  104. package/dist/compat/assert/LICENSE-APACHE +177 -0
  105. package/dist/compat/assert/assertion-error.d.ts +26 -0
  106. package/dist/compat/assert/assertion-error.js +468 -0
  107. package/dist/compat/assert/diff.d.ts +26 -0
  108. package/dist/compat/assert/diff.js +329 -0
  109. package/dist/compat/assert/errors.d.ts +11 -0
  110. package/dist/compat/assert/errors.js +55 -0
  111. package/dist/compat/assert/index.cjs +24 -0
  112. package/dist/compat/assert/index.d.cts +43 -0
  113. package/dist/compat/assert/index.d.ts +50 -0
  114. package/dist/compat/assert/index.js +858 -0
  115. package/dist/compat/async-hooks/LICENSE-APACHE +177 -0
  116. package/dist/compat/async-hooks/NOTICE.md +8 -0
  117. package/dist/compat/async-hooks/callbacks.d.ts +7 -0
  118. package/dist/compat/async-hooks/callbacks.js +18 -0
  119. package/dist/compat/async-hooks/hooks.d.ts +10 -0
  120. package/dist/compat/async-hooks/hooks.js +111 -0
  121. package/dist/compat/async-hooks/index.d.ts +41 -0
  122. package/dist/compat/async-hooks/index.js +298 -0
  123. package/dist/compat/buffer/LICENSE-3RD-PARTY.md +15 -0
  124. package/dist/compat/buffer/LICENSE-APACHE +177 -0
  125. package/dist/compat/buffer/blob.d.ts +22 -0
  126. package/dist/compat/buffer/blob.js +210 -0
  127. package/dist/compat/buffer/bytes.d.ts +34 -0
  128. package/dist/compat/buffer/bytes.js +228 -0
  129. package/dist/compat/buffer/errors.d.ts +41 -0
  130. package/dist/compat/buffer/errors.js +265 -0
  131. package/dist/compat/buffer/index.d.ts +25 -0
  132. package/dist/compat/buffer/index.js +24 -0
  133. package/dist/compat/buffer/internal-buffer.d.ts +148 -0
  134. package/dist/compat/buffer/internal-buffer.js +1809 -0
  135. package/dist/compat/buffer/support.d.ts +13 -0
  136. package/dist/compat/buffer/support.js +65 -0
  137. package/dist/compat/child-process/LICENSE-3RD-PARTY.md +8 -0
  138. package/dist/compat/child-process/LICENSE-APACHE +177 -0
  139. package/dist/compat/child-process/errors.d.ts +4 -0
  140. package/dist/compat/child-process/errors.js +6 -0
  141. package/dist/compat/child-process/index.d.ts +49 -0
  142. package/dist/compat/child-process/index.js +96 -0
  143. package/dist/compat/cluster/LICENSE-3RD-PARTY.md +40 -0
  144. package/dist/compat/cluster/LICENSE-APACHE +177 -0
  145. package/dist/compat/cluster/errors.d.ts +4 -0
  146. package/dist/compat/cluster/errors.js +6 -0
  147. package/dist/compat/cluster/index.d.ts +47 -0
  148. package/dist/compat/cluster/index.js +88 -0
  149. package/dist/compat/constants/LICENSE-3RD-PARTY.md +6 -0
  150. package/dist/compat/constants/LICENSE-APACHE +177 -0
  151. package/dist/compat/constants/index.d.ts +481 -0
  152. package/dist/compat/constants/index.js +488 -0
  153. package/dist/compat/dgram/LICENSE-3RD-PARTY.md +8 -0
  154. package/dist/compat/dgram/LICENSE-APACHE +177 -0
  155. package/dist/compat/dgram/index.d.ts +10 -0
  156. package/dist/compat/dgram/index.js +132 -0
  157. package/dist/compat/diagnostics-channel/LICENSE-3RD-PARTY.md +13 -0
  158. package/dist/compat/diagnostics-channel/LICENSE-APACHE +177 -0
  159. package/dist/compat/diagnostics-channel/index.d.ts +73 -0
  160. package/dist/compat/diagnostics-channel/index.js +261 -0
  161. package/dist/compat/diagnostics-channel/native.d.ts +26 -0
  162. package/dist/compat/diagnostics-channel/native.js +154 -0
  163. package/dist/compat/dns/LICENSE-3RD-PARTY.md +5 -0
  164. package/dist/compat/dns/LICENSE-APACHE +177 -0
  165. package/dist/compat/dns/client.d.ts +72 -0
  166. package/dist/compat/dns/client.js +161 -0
  167. package/dist/compat/dns/constants.d.ts +27 -0
  168. package/dist/compat/dns/constants.js +31 -0
  169. package/dist/compat/dns/errors.d.ts +8 -0
  170. package/dist/compat/dns/errors.js +12 -0
  171. package/dist/compat/dns/index.d.ts +97 -0
  172. package/dist/compat/dns/index.js +127 -0
  173. package/dist/compat/dns/parser.d.ts +18 -0
  174. package/dist/compat/dns/parser.js +144 -0
  175. package/dist/compat/dns/promise-resolver.d.ts +82 -0
  176. package/dist/compat/dns/promise-resolver.js +113 -0
  177. package/dist/compat/dns/promises.d.ts +50 -0
  178. package/dist/compat/dns/promises.js +53 -0
  179. package/dist/compat/dns/resolver.d.ts +34 -0
  180. package/dist/compat/dns/resolver.js +415 -0
  181. package/dist/compat/domain/LICENSE-3RD-PARTY.md +5 -0
  182. package/dist/compat/domain/LICENSE-APACHE +177 -0
  183. package/dist/compat/domain/index.d.ts +22 -0
  184. package/dist/compat/domain/index.js +79 -0
  185. package/dist/compat/fs/index.d.ts +85 -0
  186. package/dist/compat/fs/index.js +255 -0
  187. package/dist/compat/fs/promises/index.d.ts +3 -0
  188. package/dist/compat/fs/promises/index.js +3 -0
  189. package/dist/compat/http/index.d.ts +322 -0
  190. package/dist/compat/http/index.js +1356 -0
  191. package/dist/compat/http/registry.d.ts +19 -0
  192. package/dist/compat/http/registry.js +13 -0
  193. package/dist/compat/http-agent/LICENSE-3RD-PARTY.md +5 -0
  194. package/dist/compat/http-agent/LICENSE-APACHE +177 -0
  195. package/dist/compat/http-agent/index.d.ts +7 -0
  196. package/dist/compat/http-agent/index.js +10 -0
  197. package/dist/compat/http-client/LICENSE-3RD-PARTY.md +5 -0
  198. package/dist/compat/http-client/LICENSE-APACHE +177 -0
  199. package/dist/compat/http-client/index.d.ts +6 -0
  200. package/dist/compat/http-client/index.js +7 -0
  201. package/dist/compat/http-incoming/LICENSE-3RD-PARTY.md +5 -0
  202. package/dist/compat/http-incoming/LICENSE-APACHE +177 -0
  203. package/dist/compat/http-incoming/index.d.ts +6 -0
  204. package/dist/compat/http-incoming/index.js +9 -0
  205. package/dist/compat/http2/LICENSE-3RD-PARTY.md +29 -0
  206. package/dist/compat/http2/LICENSE-APACHE +177 -0
  207. package/dist/compat/http2/constants.d.ts +255 -0
  208. package/dist/compat/http2/constants.js +515 -0
  209. package/dist/compat/http2/errors.d.ts +4 -0
  210. package/dist/compat/http2/errors.js +6 -0
  211. package/dist/compat/http2/index.d.ts +283 -0
  212. package/dist/compat/http2/index.js +68 -0
  213. package/dist/compat/https/LICENSE-3RD-PARTY.md +5 -0
  214. package/dist/compat/https/LICENSE-APACHE +177 -0
  215. package/dist/compat/https/agent.d.ts +10 -0
  216. package/dist/compat/https/agent.js +99 -0
  217. package/dist/compat/https/errors.d.ts +4 -0
  218. package/dist/compat/https/errors.js +6 -0
  219. package/dist/compat/https/index.d.ts +20 -0
  220. package/dist/compat/https/index.js +50 -0
  221. package/dist/compat/https/server.d.ts +8 -0
  222. package/dist/compat/https/server.js +27 -0
  223. package/dist/compat/immediate/index.d.ts +11 -0
  224. package/dist/compat/immediate/index.js +58 -0
  225. package/dist/compat/inspector/LICENSE-3RD-PARTY.md +34 -0
  226. package/dist/compat/inspector/LICENSE-APACHE +177 -0
  227. package/dist/compat/inspector/errors.d.ts +4 -0
  228. package/dist/compat/inspector/errors.js +6 -0
  229. package/dist/compat/inspector/index.d.ts +18 -0
  230. package/dist/compat/inspector/index.js +117 -0
  231. package/dist/compat/inspector/promises.d.ts +18 -0
  232. package/dist/compat/inspector/promises.js +114 -0
  233. package/dist/compat/module/index.cjs +2 -0
  234. package/dist/compat/module/index.d.cts +2 -0
  235. package/dist/compat/module/index.d.ts +11 -0
  236. package/dist/compat/module/index.js +44 -0
  237. package/dist/compat/module/resolve-unavailable.d.ts +1 -0
  238. package/dist/compat/module/resolve-unavailable.js +3 -0
  239. package/dist/compat/net/LICENSE-3RD-PARTY.md +15 -0
  240. package/dist/compat/net/LICENSE-APACHE +177 -0
  241. package/dist/compat/net/error-base.d.ts +14 -0
  242. package/dist/compat/net/error-base.js +62 -0
  243. package/dist/compat/net/errors.d.ts +76 -0
  244. package/dist/compat/net/errors.js +333 -0
  245. package/dist/compat/net/index.d.ts +23 -0
  246. package/dist/compat/net/index.js +46 -0
  247. package/dist/compat/net/internal-net.d.ts +236 -0
  248. package/dist/compat/net/internal-net.js +2292 -0
  249. package/dist/compat/net/ports.d.ts +32 -0
  250. package/dist/compat/net/ports.js +149 -0
  251. package/dist/compat/net/reader.d.ts +8 -0
  252. package/dist/compat/net/reader.js +36 -0
  253. package/dist/compat/net/sockets.d.ts +20 -0
  254. package/dist/compat/net/sockets.js +195 -0
  255. package/dist/compat/net/validators.d.ts +18 -0
  256. package/dist/compat/net/validators.js +154 -0
  257. package/dist/compat/os/LICENSE-3RD-PARTY.md +8 -0
  258. package/dist/compat/os/LICENSE-APACHE +177 -0
  259. package/dist/compat/os/index.d.ts +329 -0
  260. package/dist/compat/os/index.js +278 -0
  261. package/dist/compat/path/LICENSE-3RD-PARTY.md +35 -0
  262. package/dist/compat/path/LICENSE-APACHE +177 -0
  263. package/dist/compat/path/index.d.ts +4 -0
  264. package/dist/compat/path/index.js +11 -0
  265. package/dist/compat/path/internal-path.d.ts +95 -0
  266. package/dist/compat/path/internal-path.js +1542 -0
  267. package/dist/compat/path/posix/index.d.ts +4 -0
  268. package/dist/compat/path/posix/index.js +5 -0
  269. package/dist/compat/path/win32/index.d.ts +4 -0
  270. package/dist/compat/path/win32/index.js +5 -0
  271. package/dist/compat/perf-hooks/LICENSE-3RD-PARTY.md +5 -0
  272. package/dist/compat/perf-hooks/LICENSE-APACHE +177 -0
  273. package/dist/compat/perf-hooks/index.d.ts +85 -0
  274. package/dist/compat/perf-hooks/index.js +79 -0
  275. package/dist/compat/perf-hooks/performance.d.ts +96 -0
  276. package/dist/compat/perf-hooks/performance.js +445 -0
  277. package/dist/compat/punycode/LICENSE-3RD-PARTY.md +7 -0
  278. package/dist/compat/punycode/LICENSE-APACHE +177 -0
  279. package/dist/compat/punycode/index.d.ts +93 -0
  280. package/dist/compat/punycode/index.js +410 -0
  281. package/dist/compat/querystring/LICENSE-3RD-PARTY.md +35 -0
  282. package/dist/compat/querystring/LICENSE-APACHE +177 -0
  283. package/dist/compat/querystring/index.d.ts +14 -0
  284. package/dist/compat/querystring/index.js +18 -0
  285. package/dist/compat/querystring/internal-querystring.d.ts +22 -0
  286. package/dist/compat/querystring/internal-querystring.js +498 -0
  287. package/dist/compat/readline/LICENSE-3RD-PARTY.md +37 -0
  288. package/dist/compat/readline/LICENSE-APACHE +177 -0
  289. package/dist/compat/readline/index.d.ts +21 -0
  290. package/dist/compat/readline/index.js +56 -0
  291. package/dist/compat/readline/interface.d.ts +22 -0
  292. package/dist/compat/readline/interface.js +85 -0
  293. package/dist/compat/readline/internal-promises.d.ts +32 -0
  294. package/dist/compat/readline/internal-promises.js +104 -0
  295. package/dist/compat/readline/promises.d.ts +8 -0
  296. package/dist/compat/readline/promises.js +32 -0
  297. package/dist/compat/repl/LICENSE-3RD-PARTY.md +5 -0
  298. package/dist/compat/repl/LICENSE-APACHE +177 -0
  299. package/dist/compat/repl/builtin-modules.d.ts +1 -0
  300. package/dist/compat/repl/builtin-modules.js +101 -0
  301. package/dist/compat/repl/errors.d.ts +4 -0
  302. package/dist/compat/repl/errors.js +6 -0
  303. package/dist/compat/repl/index.d.ts +53 -0
  304. package/dist/compat/repl/index.js +106 -0
  305. package/dist/compat/sqlite/LICENSE-3RD-PARTY.md +6 -0
  306. package/dist/compat/sqlite/LICENSE-APACHE +177 -0
  307. package/dist/compat/sqlite/index.d.ts +12 -0
  308. package/dist/compat/sqlite/index.js +101 -0
  309. package/dist/compat/sqlite/native.d.ts +16 -0
  310. package/dist/compat/sqlite/native.js +33 -0
  311. package/dist/compat/stream/LICENSE-3RD-PARTY.md +13 -0
  312. package/dist/compat/stream/LICENSE-APACHE +177 -0
  313. package/dist/compat/stream/add-abort-signal.d.ts +4 -0
  314. package/dist/compat/stream/add-abort-signal.js +73 -0
  315. package/dist/compat/stream/compose.d.ts +1 -0
  316. package/dist/compat/stream/compose.js +313 -0
  317. package/dist/compat/stream/destroy.d.ts +5 -0
  318. package/dist/compat/stream/destroy.js +315 -0
  319. package/dist/compat/stream/duplex.d.ts +48 -0
  320. package/dist/compat/stream/duplex.js +789 -0
  321. package/dist/compat/stream/end-of-stream.d.ts +16 -0
  322. package/dist/compat/stream/end-of-stream.js +269 -0
  323. package/dist/compat/stream/errors.d.ts +40 -0
  324. package/dist/compat/stream/errors.js +86 -0
  325. package/dist/compat/stream/events.d.ts +6 -0
  326. package/dist/compat/stream/events.js +28 -0
  327. package/dist/compat/stream/index.cjs +27 -0
  328. package/dist/compat/stream/index.d.cts +25 -0
  329. package/dist/compat/stream/index.d.ts +20 -0
  330. package/dist/compat/stream/index.js +55 -0
  331. package/dist/compat/stream/legacy.d.ts +8 -0
  332. package/dist/compat/stream/legacy.js +105 -0
  333. package/dist/compat/stream/once.d.ts +7 -0
  334. package/dist/compat/stream/once.js +13 -0
  335. package/dist/compat/stream/pipeline.d.ts +5 -0
  336. package/dist/compat/stream/pipeline.js +567 -0
  337. package/dist/compat/stream/process.d.ts +1 -0
  338. package/dist/compat/stream/process.js +4 -0
  339. package/dist/compat/stream/promises.d.ts +7 -0
  340. package/dist/compat/stream/promises.js +60 -0
  341. package/dist/compat/stream/readable.d.ts +29 -0
  342. package/dist/compat/stream/readable.js +2267 -0
  343. package/dist/compat/stream/state.d.ts +8 -0
  344. package/dist/compat/stream/state.js +63 -0
  345. package/dist/compat/stream/transform.d.ts +2 -0
  346. package/dist/compat/stream/transform.js +202 -0
  347. package/dist/compat/stream/util.d.ts +55 -0
  348. package/dist/compat/stream/util.js +345 -0
  349. package/dist/compat/stream/validators.d.ts +2 -0
  350. package/dist/compat/stream/validators.js +14 -0
  351. package/dist/compat/stream/writable.d.ts +21 -0
  352. package/dist/compat/stream/writable.js +1325 -0
  353. package/dist/compat/stream-consumers/LICENSE-3RD-PARTY.md +5 -0
  354. package/dist/compat/stream-consumers/LICENSE-APACHE +177 -0
  355. package/dist/compat/stream-consumers/index.d.ts +14 -0
  356. package/dist/compat/stream-consumers/index.js +62 -0
  357. package/dist/compat/stream-consumers/iterable.d.ts +1 -0
  358. package/dist/compat/stream-consumers/iterable.js +34 -0
  359. package/dist/compat/stream-duplex/LICENSE-3RD-PARTY.md +13 -0
  360. package/dist/compat/stream-duplex/LICENSE-APACHE +177 -0
  361. package/dist/compat/stream-duplex/index.cjs +3 -0
  362. package/dist/compat/stream-duplex/index.d.cts +2 -0
  363. package/dist/compat/stream-duplex/index.d.ts +3 -0
  364. package/dist/compat/stream-duplex/index.js +8 -0
  365. package/dist/compat/stream-passthrough/LICENSE-3RD-PARTY.md +13 -0
  366. package/dist/compat/stream-passthrough/LICENSE-APACHE +177 -0
  367. package/dist/compat/stream-passthrough/index.cjs +3 -0
  368. package/dist/compat/stream-passthrough/index.d.cts +2 -0
  369. package/dist/compat/stream-passthrough/index.d.ts +3 -0
  370. package/dist/compat/stream-passthrough/index.js +8 -0
  371. package/dist/compat/stream-promises/LICENSE-3RD-PARTY.md +13 -0
  372. package/dist/compat/stream-promises/LICENSE-APACHE +177 -0
  373. package/dist/compat/stream-promises/index.d.ts +1 -0
  374. package/dist/compat/stream-promises/index.js +1 -0
  375. package/dist/compat/stream-readable/LICENSE-3RD-PARTY.md +13 -0
  376. package/dist/compat/stream-readable/LICENSE-APACHE +177 -0
  377. package/dist/compat/stream-readable/index.cjs +3 -0
  378. package/dist/compat/stream-readable/index.d.cts +2 -0
  379. package/dist/compat/stream-readable/index.d.ts +3 -0
  380. package/dist/compat/stream-readable/index.js +8 -0
  381. package/dist/compat/stream-transform/LICENSE-3RD-PARTY.md +13 -0
  382. package/dist/compat/stream-transform/LICENSE-APACHE +177 -0
  383. package/dist/compat/stream-transform/index.cjs +3 -0
  384. package/dist/compat/stream-transform/index.d.cts +2 -0
  385. package/dist/compat/stream-transform/index.d.ts +3 -0
  386. package/dist/compat/stream-transform/index.js +8 -0
  387. package/dist/compat/stream-web/LICENSE-MIT +22 -0
  388. package/dist/compat/stream-web/NOTICE.md +3 -0
  389. package/dist/compat/stream-web/context.d.ts +2 -0
  390. package/dist/compat/stream-web/context.js +35 -0
  391. package/dist/compat/stream-web/index.d.ts +80 -0
  392. package/dist/compat/stream-web/index.js +129 -0
  393. package/dist/compat/stream-web/interop.d.ts +6 -0
  394. package/dist/compat/stream-web/interop.js +72 -0
  395. package/dist/compat/stream-web/ponyfill.d.ts +1 -0
  396. package/dist/compat/stream-web/ponyfill.js +2093 -0
  397. package/dist/compat/stream-web/runtime.d.ts +16 -0
  398. package/dist/compat/stream-web/runtime.js +51 -0
  399. package/dist/compat/stream-writable/LICENSE-3RD-PARTY.md +13 -0
  400. package/dist/compat/stream-writable/LICENSE-APACHE +177 -0
  401. package/dist/compat/stream-writable/index.cjs +3 -0
  402. package/dist/compat/stream-writable/index.d.cts +2 -0
  403. package/dist/compat/stream-writable/index.d.ts +3 -0
  404. package/dist/compat/stream-writable/index.js +8 -0
  405. package/dist/compat/string-decoder/LICENSE-3RD-PARTY.md +38 -0
  406. package/dist/compat/string-decoder/LICENSE-APACHE +177 -0
  407. package/dist/compat/string-decoder/index.d.ts +33 -0
  408. package/dist/compat/string-decoder/index.js +518 -0
  409. package/dist/compat/test/LICENSE-3RD-PARTY.md +37 -0
  410. package/dist/compat/test/LICENSE-APACHE +177 -0
  411. package/dist/compat/test/index.d.ts +9 -0
  412. package/dist/compat/test/index.js +11 -0
  413. package/dist/compat/test/mock.d.ts +103 -0
  414. package/dist/compat/test/mock.js +397 -0
  415. package/dist/compat/test/validators.d.ts +2 -0
  416. package/dist/compat/test/validators.js +14 -0
  417. package/dist/compat/timers/LICENSE-3RD-PARTY.md +7 -0
  418. package/dist/compat/timers/LICENSE-APACHE +177 -0
  419. package/dist/compat/timers/errors.d.ts +28 -0
  420. package/dist/compat/timers/errors.js +206 -0
  421. package/dist/compat/timers/host.d.ts +11 -0
  422. package/dist/compat/timers/host.js +60 -0
  423. package/dist/compat/timers/index.cjs +3 -0
  424. package/dist/compat/timers/index.d.cts +23 -0
  425. package/dist/compat/timers/index.d.ts +36 -0
  426. package/dist/compat/timers/index.js +20 -0
  427. package/dist/compat/timers/installation.d.ts +4 -0
  428. package/dist/compat/timers/installation.js +61 -0
  429. package/dist/compat/timers/internal-promises.d.ts +19 -0
  430. package/dist/compat/timers/internal-promises.js +173 -0
  431. package/dist/compat/timers/promises.cjs +2 -0
  432. package/dist/compat/timers/promises.d.cts +12 -0
  433. package/dist/compat/timers/promises.d.ts +14 -0
  434. package/dist/compat/timers/promises.js +3 -0
  435. package/dist/compat/timers/timers.d.ts +32 -0
  436. package/dist/compat/timers/timers.js +147 -0
  437. package/dist/compat/timers/validation.d.ts +5 -0
  438. package/dist/compat/timers/validation.js +22 -0
  439. package/dist/compat/timers/wait.d.ts +4 -0
  440. package/dist/compat/timers/wait.js +91 -0
  441. package/dist/compat/tls-common/LICENSE-3RD-PARTY.md +11 -0
  442. package/dist/compat/tls-common/LICENSE-APACHE +177 -0
  443. package/dist/compat/tls-common/index.d.ts +14 -0
  444. package/dist/compat/tls-common/index.js +88 -0
  445. package/dist/compat/trace-events/LICENSE-3RD-PARTY.md +5 -0
  446. package/dist/compat/trace-events/LICENSE-APACHE +177 -0
  447. package/dist/compat/trace-events/index.d.ts +18 -0
  448. package/dist/compat/trace-events/index.js +88 -0
  449. package/dist/compat/tty/LICENSE-3RD-PARTY.md +8 -0
  450. package/dist/compat/tty/LICENSE-APACHE +177 -0
  451. package/dist/compat/tty/index.d.ts +17 -0
  452. package/dist/compat/tty/index.js +101 -0
  453. package/dist/compat/url/LICENSE-3RD-PARTY.md +63 -0
  454. package/dist/compat/url/LICENSE-ADA +18 -0
  455. package/dist/compat/url/LICENSE-APACHE +177 -0
  456. package/dist/compat/url/LICENSE-UNICODE +39 -0
  457. package/dist/compat/url/LICENSE-WHATWG-URL +21 -0
  458. package/dist/compat/url/brand.d.ts +4 -0
  459. package/dist/compat/url/brand.js +10 -0
  460. package/dist/compat/url/constants.d.ts +27 -0
  461. package/dist/compat/url/constants.js +28 -0
  462. package/dist/compat/url/errors.d.ts +44 -0
  463. package/dist/compat/url/errors.js +248 -0
  464. package/dist/compat/url/idna-data.d.ts +3958 -0
  465. package/dist/compat/url/idna-data.js +22 -0
  466. package/dist/compat/url/idna.d.ts +9 -0
  467. package/dist/compat/url/idna.js +47 -0
  468. package/dist/compat/url/index.d.ts +48 -0
  469. package/dist/compat/url/index.js +39 -0
  470. package/dist/compat/url/installation.d.ts +4 -0
  471. package/dist/compat/url/installation.js +61 -0
  472. package/dist/compat/url/internal-url.d.ts +34 -0
  473. package/dist/compat/url/internal-url.js +264 -0
  474. package/dist/compat/url/legacy-url.d.ts +28 -0
  475. package/dist/compat/url/legacy-url.js +870 -0
  476. package/dist/compat/url/parser-platform.d.ts +3 -0
  477. package/dist/compat/url/parser-platform.js +26 -0
  478. package/dist/compat/url/standard-url.d.ts +2 -0
  479. package/dist/compat/url/standard-url.js +3189 -0
  480. package/dist/compat/url/unicode.d.ts +2 -0
  481. package/dist/compat/url/unicode.js +119 -0
  482. package/dist/compat/url/validation.d.ts +2 -0
  483. package/dist/compat/url/validation.js +9 -0
  484. package/dist/compat/url/web-url.d.ts +27 -0
  485. package/dist/compat/url/web-url.js +119 -0
  486. package/dist/compat/util/LICENSE-3RD-PARTY.md +5 -0
  487. package/dist/compat/util/LICENSE-APACHE +177 -0
  488. package/dist/compat/util/additional.d.ts +11 -0
  489. package/dist/compat/util/additional.js +121 -0
  490. package/dist/compat/util/comparison-types.d.ts +16 -0
  491. package/dist/compat/util/comparison-types.js +50 -0
  492. package/dist/compat/util/comparisons.d.ts +1 -0
  493. package/dist/compat/util/comparisons.js +527 -0
  494. package/dist/compat/util/core.d.ts +18 -0
  495. package/dist/compat/util/core.js +265 -0
  496. package/dist/compat/util/debuglog.d.ts +1 -0
  497. package/dist/compat/util/debuglog.js +78 -0
  498. package/dist/compat/util/index.d.ts +35 -0
  499. package/dist/compat/util/index.js +77 -0
  500. package/dist/compat/util/inspect-binding.d.ts +13 -0
  501. package/dist/compat/util/inspect-binding.js +39 -0
  502. package/dist/compat/util/inspect-types.d.ts +13 -0
  503. package/dist/compat/util/inspect-types.js +30 -0
  504. package/dist/compat/util/inspect.d.ts +152 -0
  505. package/dist/compat/util/inspect.js +2503 -0
  506. package/dist/compat/util/mime.d.ts +24 -0
  507. package/dist/compat/util/mime.js +284 -0
  508. package/dist/compat/util/properties.d.ts +9 -0
  509. package/dist/compat/util/properties.js +76 -0
  510. package/dist/compat/v8/LICENSE-3RD-PARTY.md +6 -0
  511. package/dist/compat/v8/LICENSE-APACHE +177 -0
  512. package/dist/compat/v8/errors.d.ts +5 -0
  513. package/dist/compat/v8/errors.js +7 -0
  514. package/dist/compat/v8/index.d.ts +106 -0
  515. package/dist/compat/v8/index.js +280 -0
  516. package/dist/compat/vm/LICENSE-3RD-PARTY.md +39 -0
  517. package/dist/compat/vm/LICENSE-APACHE +177 -0
  518. package/dist/compat/vm/errors.d.ts +5 -0
  519. package/dist/compat/vm/errors.js +7 -0
  520. package/dist/compat/vm/index.d.ts +47 -0
  521. package/dist/compat/vm/index.js +231 -0
  522. package/dist/compat/vm/validation.d.ts +3 -0
  523. package/dist/compat/vm/validation.js +14 -0
  524. package/dist/compat/wasi/LICENSE-3RD-PARTY.md +8 -0
  525. package/dist/compat/wasi/LICENSE-APACHE +177 -0
  526. package/dist/compat/wasi/errors.d.ts +4 -0
  527. package/dist/compat/wasi/errors.js +6 -0
  528. package/dist/compat/wasi/index.d.ts +15 -0
  529. package/dist/compat/wasi/index.js +44 -0
  530. package/dist/compat/worker-threads/LICENSE-3RD-PARTY.md +5 -0
  531. package/dist/compat/worker-threads/LICENSE-APACHE +177 -0
  532. package/dist/compat/worker-threads/errors.d.ts +4 -0
  533. package/dist/compat/worker-threads/errors.js +6 -0
  534. package/dist/compat/worker-threads/index.d.ts +71 -0
  535. package/dist/compat/worker-threads/index.js +138 -0
  536. package/dist/compat/worker-threads/message-channel.d.ts +18 -0
  537. package/dist/compat/worker-threads/message-channel.js +157 -0
  538. package/dist/configured.d.ts +3 -0
  539. package/dist/configured.js +4 -0
  540. package/dist/environment.d.ts +4 -0
  541. package/dist/environment.js +18 -0
  542. package/dist/index.d.ts +11 -0
  543. package/dist/index.js +107 -0
  544. package/dist/ios.d.ts +2 -0
  545. package/dist/ios.js +1 -0
  546. package/dist/native-entry.d.ts +8 -0
  547. package/dist/native-entry.js +67 -0
  548. package/dist/shared/brotli/LICENSE-APACHE +201 -0
  549. package/dist/shared/brotli/LICENSE-MIT +9 -0
  550. package/dist/shared/brotli/NOTICE +3 -0
  551. package/dist/shared/brotli/index.d.ts +2 -0
  552. package/dist/shared/brotli/index.js +288 -0
  553. package/dist/shared/contracts/index.d.ts +42 -0
  554. package/dist/shared/contracts/index.js +88 -0
  555. package/dist/shared/contracts/testing.d.ts +22 -0
  556. package/dist/shared/contracts/testing.js +57 -0
  557. package/dist/shared/globals/index.d.ts +3 -0
  558. package/dist/shared/globals/index.js +87 -0
  559. package/dist/shared/globals/inject.d.ts +2 -0
  560. package/dist/shared/globals/inject.js +3 -0
  561. package/dist/shared/globals/install.d.ts +1 -0
  562. package/dist/shared/globals/install.js +15 -0
  563. package/dist/shared/globals/node-install.d.ts +1 -0
  564. package/dist/shared/globals/node-install.js +4 -0
  565. package/dist/shared/globals/platform.d.ts +104 -0
  566. package/dist/shared/globals/platform.js +37 -0
  567. package/dist/shared/globals/runtime.d.ts +6 -0
  568. package/dist/shared/globals/runtime.js +8 -0
  569. package/dist/shared/globals/symbols.d.ts +4 -0
  570. package/dist/shared/globals/symbols.js +35 -0
  571. package/dist/shared/globals/web.d.ts +4 -0
  572. package/dist/shared/globals/web.js +108 -0
  573. package/dist/shared/http-wire/LICENSE.llhttp +22 -0
  574. package/dist/shared/http-wire/LICENSE.undici +21 -0
  575. package/dist/shared/http-wire/NOTICE.md +14 -0
  576. package/dist/shared/http-wire/index.d.ts +27 -0
  577. package/dist/shared/http-wire/index.js +132 -0
  578. package/dist/shared/http-wire/wasm.d.ts +2 -0
  579. package/dist/shared/http-wire/wasm.js +2 -0
  580. package/dist/tooling/async.d.ts +7 -0
  581. package/dist/tooling/async.js +99 -0
  582. package/dist/tooling/build-isolation.d.ts +4 -0
  583. package/dist/tooling/build-isolation.js +34 -0
  584. package/dist/tooling/documents.d.ts +7 -0
  585. package/dist/tooling/documents.js +26 -0
  586. package/dist/tooling/esbuild.d.ts +15 -0
  587. package/dist/tooling/esbuild.js +193 -0
  588. package/dist/tooling/files.d.ts +2 -0
  589. package/dist/tooling/files.js +18 -0
  590. package/dist/tooling/opennext/build.d.ts +1 -0
  591. package/dist/tooling/opennext/build.js +121 -0
  592. package/dist/tooling/opennext/index.d.ts +3 -0
  593. package/dist/tooling/opennext/index.js +213 -0
  594. package/dist/tooling/opennext/plan.d.ts +9 -0
  595. package/dist/tooling/opennext/plan.js +36 -0
  596. package/dist/tooling/opennext/safety.d.ts +4 -0
  597. package/dist/tooling/opennext/safety.js +36 -0
  598. package/dist/tooling/route-permissions.d.ts +3 -0
  599. package/dist/tooling/route-permissions.js +15 -0
  600. package/dist/tooling/server-modules.d.ts +30 -0
  601. package/dist/tooling/server-modules.js +98 -0
  602. package/dist/tooling/server-only-html.d.ts +1 -0
  603. package/dist/tooling/server-only-html.js +66 -0
  604. package/dist/tooling/server-only.d.ts +6 -0
  605. package/dist/tooling/server-only.js +53 -0
  606. package/dist/tooling/server.d.ts +25 -0
  607. package/dist/tooling/server.js +981 -0
  608. package/dist/tooling/shared.d.ts +13 -0
  609. package/dist/tooling/shared.js +130 -0
  610. package/dist/tooling/vite.d.ts +18 -0
  611. package/dist/tooling/vite.js +448 -0
  612. package/dist/tooling/void/index.d.ts +3 -0
  613. package/dist/tooling/void/index.js +205 -0
  614. package/dist/tooling/void/plan.d.ts +17 -0
  615. package/dist/tooling/void/plan.js +288 -0
  616. package/native/android/build.gradle +68 -0
  617. package/native/android/consumer-rules.pro +2 -0
  618. package/native/android/src/main/AndroidManifest.xml +6 -0
  619. package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkerSockets.java +202 -0
  620. package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersCapacitorPlugin.java +256 -0
  621. package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNative.java +22 -0
  622. package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNativeActivity.java +178 -0
  623. package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNativeBridge.java +45 -0
  624. package/native/ios/DocumentBridge.swift +330 -0
  625. package/native/ios/NetworkBridge.swift +51 -0
  626. package/native/ios/SocketBridge.swift +180 -0
  627. package/native/ios/WorkersCapacitorPlugin.swift +152 -0
  628. package/native/ios-host/WorkersView.swift +194 -0
  629. package/package.json +154 -4
@@ -0,0 +1,3189 @@
1
+ // @ts-nocheck
2
+ // Generated by scripts/url-idna/bundle-url.mjs. See LICENSE-3RD-PARTY.md.
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __esm = (fn, res, err) => function __init() {
10
+ if (err)
11
+ throw err[0];
12
+ try {
13
+ return (fn && (res = (0, fn[__getOwnPropNames(fn)[0]])((fn = 0))), res);
14
+ }
15
+ catch (e) {
16
+ throw ((err = [e]), e);
17
+ }
18
+ };
19
+ var __commonJS = (cb, mod) => function __require() {
20
+ try {
21
+ return (mod ||
22
+ (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod),
23
+ mod.exports);
24
+ }
25
+ catch (e) {
26
+ throw ((mod = 0), e);
27
+ }
28
+ };
29
+ var __export = (target, all) => {
30
+ for (var name in all)
31
+ __defProp(target, name, { get: all[name], enumerable: true });
32
+ };
33
+ var __copyProps = (to, from, except, desc) => {
34
+ if ((from && typeof from === "object") || typeof from === "function") {
35
+ for (let key of __getOwnPropNames(from))
36
+ if (!__hasOwnProp.call(to, key) && key !== except)
37
+ __defProp(to, key, {
38
+ get: () => from[key],
39
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
40
+ });
41
+ }
42
+ return to;
43
+ };
44
+ var __toESM = (mod, isNodeMode, target) => ((target = mod != null ? __create(__getProtoOf(mod)) : {}),
45
+ __copyProps(
46
+ // If the importer is in node compatibility mode or this is not an ESM
47
+ // file that has been converted to a CommonJS file using a Babel-
48
+ // compatible transform (i.e. "__esModule" has not been set), then set
49
+ // "default" to the CommonJS "module.exports" for node compatibility.
50
+ isNodeMode || !mod || !mod.__esModule
51
+ ? __defProp(target, "default", { value: mod, enumerable: true })
52
+ : target, mod));
53
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
54
+ // platform:webidl-conversions
55
+ var webidl_conversions_exports = {};
56
+ __export(webidl_conversions_exports, {
57
+ USVString: () => USVString,
58
+ any: () => any,
59
+ });
60
+ import { USVString, any } from "./parser-platform.js";
61
+ var init_webidl_conversions = __esm({
62
+ "platform:webidl-conversions"() { },
63
+ });
64
+ // node_modules/whatwg-url/lib/utils.js
65
+ var require_utils = __commonJS({
66
+ "node_modules/whatwg-url/lib/utils.js"(exports, module) {
67
+ "use strict";
68
+ function isObject(value) {
69
+ return ((typeof value === "object" && value !== null) ||
70
+ typeof value === "function");
71
+ }
72
+ var call = Function.call.bind(Function.call);
73
+ function define(target, source) {
74
+ for (const key of Reflect.ownKeys(source)) {
75
+ const descriptor = Reflect.getOwnPropertyDescriptor(source, key);
76
+ if (descriptor && !Reflect.defineProperty(target, key, descriptor)) {
77
+ throw new TypeError(`Cannot redefine property: ${String(key)}`);
78
+ }
79
+ }
80
+ }
81
+ function newObjectInRealm(globalObject, object) {
82
+ const ctorRegistry = initCtorRegistry(globalObject);
83
+ return Object.defineProperties(Object.create(ctorRegistry["%Object.prototype%"]), Object.getOwnPropertyDescriptors(object));
84
+ }
85
+ var wrapperSymbol = /* @__PURE__ */ Symbol("wrapper");
86
+ var sameObjectCaches = /* @__PURE__ */ Symbol("SameObject caches");
87
+ var ctorRegistrySymbol = /* @__PURE__ */ Symbol.for("[webidl2js] constructor registry");
88
+ var AsyncIteratorPrototype = {
89
+ [Symbol.asyncIterator]() {
90
+ return this;
91
+ },
92
+ };
93
+ function initCtorRegistry(globalObject) {
94
+ if (Object.hasOwn(globalObject, ctorRegistrySymbol)) {
95
+ return globalObject[ctorRegistrySymbol];
96
+ }
97
+ const ctorRegistry = /* @__PURE__ */ Object.create(null);
98
+ ctorRegistry["%Object.prototype%"] = globalObject.Object.prototype;
99
+ ctorRegistry["%IteratorPrototype%"] = Object.getPrototypeOf(Object.getPrototypeOf(new globalObject.Array()[Symbol.iterator]()));
100
+ try {
101
+ ctorRegistry["%AsyncIteratorPrototype%"] = Object.getPrototypeOf(Object.getPrototypeOf(globalObject.eval("(async function* () {})").prototype));
102
+ }
103
+ catch {
104
+ ctorRegistry["%AsyncIteratorPrototype%"] = AsyncIteratorPrototype;
105
+ }
106
+ globalObject[ctorRegistrySymbol] = ctorRegistry;
107
+ return ctorRegistry;
108
+ }
109
+ function getSameObject(wrapper, prop, creator) {
110
+ if (!wrapper[sameObjectCaches]) {
111
+ wrapper[sameObjectCaches] = /* @__PURE__ */ Object.create(null);
112
+ }
113
+ if (prop in wrapper[sameObjectCaches]) {
114
+ return wrapper[sameObjectCaches][prop];
115
+ }
116
+ wrapper[sameObjectCaches][prop] = creator();
117
+ return wrapper[sameObjectCaches][prop];
118
+ }
119
+ function createInterfaceDescriptor(getParent) {
120
+ const descriptor = {
121
+ get inclusiveInheritedInterfaces() {
122
+ const interfaces = getParent
123
+ ? [...getParent().inclusiveInheritedInterfaces, descriptor]
124
+ : [descriptor];
125
+ Object.defineProperties(descriptor, {
126
+ inclusiveInheritedInterfaces: { value: interfaces },
127
+ inheritanceDepth: { value: interfaces.length - 1 },
128
+ });
129
+ return interfaces;
130
+ },
131
+ get inheritanceDepth() {
132
+ return descriptor.inclusiveInheritedInterfaces.length - 1;
133
+ },
134
+ };
135
+ return descriptor;
136
+ }
137
+ var ReturnValue = class {
138
+ constructor(value) {
139
+ return value;
140
+ }
141
+ };
142
+ var WrapperData = class _WrapperData extends ReturnValue {
143
+ #impl;
144
+ #interfaceDescriptor;
145
+ constructor(wrapper, impl, interfaceDescriptor) {
146
+ super(wrapper);
147
+ this.#impl = impl;
148
+ this.#interfaceDescriptor = interfaceDescriptor;
149
+ }
150
+ static registerWrapper(wrapper, impl, interfaceDescriptor) {
151
+ return new _WrapperData(wrapper, impl, interfaceDescriptor);
152
+ }
153
+ static implForWrapper(wrapper) {
154
+ if (!isObject(wrapper) || !(#impl in wrapper)) {
155
+ return null;
156
+ }
157
+ return wrapper.#impl;
158
+ }
159
+ static implForWrapperWithInterface(wrapper, interfaceDescriptor) {
160
+ if (!isObject(wrapper) || !(#impl in wrapper)) {
161
+ return null;
162
+ }
163
+ if (wrapper.#interfaceDescriptor?.inclusiveInheritedInterfaces[interfaceDescriptor.inheritanceDepth] !== interfaceDescriptor) {
164
+ return null;
165
+ }
166
+ return wrapper.#impl;
167
+ }
168
+ };
169
+ var { registerWrapper, implForWrapper, implForWrapperWithInterface } = WrapperData;
170
+ function requireImplForWrapper(wrapper, interfaceDescriptor, globalObject, interfaceName, context) {
171
+ const impl = implForWrapperWithInterface(wrapper, interfaceDescriptor);
172
+ if (impl === null) {
173
+ throw new globalObject.TypeError(`'${context}' called on an object that is not a valid instance of ${interfaceName}.`);
174
+ }
175
+ return impl;
176
+ }
177
+ function wrapperForImpl(impl) {
178
+ return impl?.[wrapperSymbol] ?? null;
179
+ }
180
+ function tryWrapperForImpl(impl) {
181
+ const wrapper = wrapperForImpl(impl);
182
+ return wrapper !== null ? wrapper : impl;
183
+ }
184
+ function tryImplForWrapper(wrapper) {
185
+ const impl = implForWrapper(wrapper);
186
+ return impl !== null ? impl : wrapper;
187
+ }
188
+ var iterInternalSymbol = /* @__PURE__ */ Symbol("internal");
189
+ function isArrayIndexPropName(P) {
190
+ if (typeof P !== "string") {
191
+ return false;
192
+ }
193
+ const i = P >>> 0;
194
+ if (i === 2 ** 32 - 1) {
195
+ return false;
196
+ }
197
+ const s = `${i}`;
198
+ if (P !== s) {
199
+ return false;
200
+ }
201
+ return true;
202
+ }
203
+ var arrayBufferByteLengthGetter = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
204
+ function isArrayBuffer(value) {
205
+ try {
206
+ arrayBufferByteLengthGetter.call(value);
207
+ return true;
208
+ }
209
+ catch {
210
+ return false;
211
+ }
212
+ }
213
+ var sharedArrayBufferByteLengthGetter = typeof SharedArrayBuffer === "function"
214
+ ? Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get
215
+ : () => {
216
+ throw new TypeError("SharedArrayBuffer is unavailable");
217
+ };
218
+ function isSharedArrayBuffer(value) {
219
+ try {
220
+ sharedArrayBufferByteLengthGetter.call(value);
221
+ return true;
222
+ }
223
+ catch {
224
+ return false;
225
+ }
226
+ }
227
+ function iteratorResult([key, value], kind) {
228
+ let result;
229
+ switch (kind) {
230
+ case "key":
231
+ result = key;
232
+ break;
233
+ case "value":
234
+ result = value;
235
+ break;
236
+ case "key+value":
237
+ result = [key, value];
238
+ break;
239
+ }
240
+ return { value: result, done: false };
241
+ }
242
+ function ordinarySetWithOwnDescriptor(target, property, value, receiver, ownDesc) {
243
+ if (ownDesc === void 0) {
244
+ const parent = Reflect.getPrototypeOf(target);
245
+ if (parent !== null) {
246
+ return Reflect.set(parent, property, value, receiver);
247
+ }
248
+ ownDesc = {
249
+ writable: true,
250
+ enumerable: true,
251
+ configurable: true,
252
+ value: void 0,
253
+ };
254
+ }
255
+ if (isDataDescriptor(ownDesc)) {
256
+ if (!ownDesc.writable) {
257
+ return false;
258
+ }
259
+ if (!isObject(receiver)) {
260
+ return false;
261
+ }
262
+ const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, property);
263
+ if (existingDesc !== void 0) {
264
+ if (isAccessorDescriptor(existingDesc)) {
265
+ return false;
266
+ }
267
+ if (existingDesc.writable === false) {
268
+ return false;
269
+ }
270
+ const valueDesc = { value };
271
+ return Reflect.defineProperty(receiver, property, valueDesc);
272
+ }
273
+ return Reflect.defineProperty(receiver, property, {
274
+ value,
275
+ writable: true,
276
+ enumerable: true,
277
+ configurable: true,
278
+ });
279
+ }
280
+ const setter = ownDesc.set;
281
+ if (setter === void 0) {
282
+ return false;
283
+ }
284
+ call(setter, receiver, value);
285
+ return true;
286
+ }
287
+ function isDataDescriptor(desc) {
288
+ return Object.hasOwn(desc, "value") || Object.hasOwn(desc, "writable");
289
+ }
290
+ function isAccessorDescriptor(desc) {
291
+ return Object.hasOwn(desc, "get") || Object.hasOwn(desc, "set");
292
+ }
293
+ function getMethod(value, property, errPrefix = "The provided value") {
294
+ const func = value[property];
295
+ if (func === void 0 || func === null) {
296
+ return void 0;
297
+ }
298
+ if (typeof func !== "function") {
299
+ throw new TypeError(`${errPrefix}'s ${property} property is not a function.`);
300
+ }
301
+ return func;
302
+ }
303
+ function createAsyncFromSyncIterator(syncIterator) {
304
+ const syncIterable = {
305
+ [Symbol.iterator]: () => syncIterator,
306
+ };
307
+ const asyncIterator = (async function* () {
308
+ return yield* syncIterable;
309
+ })();
310
+ return asyncIterator;
311
+ }
312
+ function convertAsyncSequence(object, itemConverter, errPrefix = "The provided value") {
313
+ if (!isObject(object)) {
314
+ throw new TypeError(`${errPrefix} is not an object.`);
315
+ }
316
+ let method = getMethod(object, Symbol.asyncIterator, errPrefix);
317
+ let type = "async";
318
+ if (method === void 0) {
319
+ method = getMethod(object, Symbol.iterator, errPrefix);
320
+ if (method === void 0) {
321
+ throw new TypeError(`${errPrefix} is not an async iterable object.`);
322
+ }
323
+ type = "sync";
324
+ }
325
+ return {
326
+ object,
327
+ method,
328
+ type,
329
+ // The wrapperSymbol ensures that if the async sequence is used as a return value,
330
+ // that it exposes the original JavaScript value.
331
+ // https://webidl.spec.whatwg.org/#js-async-iterable
332
+ [wrapperSymbol]: object,
333
+ // Implement the async iterator protocol, so users can iterate
334
+ // the async sequence directly (e.g. with for await...of)
335
+ // instead of needing to call a separate helper function to open the async sequence.
336
+ // https://webidl.spec.whatwg.org/#async-sequence-open
337
+ [Symbol.asyncIterator]() {
338
+ return openAsyncSequence(object, method, type, itemConverter, `${errPrefix}'s iterator`);
339
+ },
340
+ };
341
+ }
342
+ function openAsyncSequence(object, method, type, itemConverter, errPrefix = "The provided value") {
343
+ let iterator = call(method, object);
344
+ if (!isObject(iterator)) {
345
+ throw new TypeError(`${errPrefix}'s method must return an object`);
346
+ }
347
+ if (type === "sync") {
348
+ iterator = createAsyncFromSyncIterator(iterator);
349
+ }
350
+ const nextMethod = iterator.next;
351
+ return {
352
+ async next() {
353
+ const nextResult = await call(nextMethod, iterator);
354
+ if (!isObject(nextResult)) {
355
+ throw new TypeError(`${errPrefix}'s next method must return an object`);
356
+ }
357
+ const { done, value } = nextResult;
358
+ if (done) {
359
+ return { done: true, value: void 0 };
360
+ }
361
+ return { done: false, value: itemConverter(value) };
362
+ },
363
+ async return(reason) {
364
+ const returnMethod = getMethod(iterator, "return", errPrefix);
365
+ if (returnMethod === void 0) {
366
+ return { done: true, value: void 0 };
367
+ }
368
+ const returnResult = await call(returnMethod, iterator, reason);
369
+ if (!isObject(returnResult)) {
370
+ throw new TypeError(`${errPrefix}'s return method must return an object`);
371
+ }
372
+ return { done: true, value: void 0 };
373
+ },
374
+ [Symbol.asyncIterator]() {
375
+ return this;
376
+ },
377
+ };
378
+ }
379
+ var supportsPropertyIndex = /* @__PURE__ */ Symbol("supports property index");
380
+ var supportedPropertyIndices = /* @__PURE__ */ Symbol("supported property indices");
381
+ var supportsPropertyName = /* @__PURE__ */ Symbol("supports property name");
382
+ var supportedPropertyNames = /* @__PURE__ */ Symbol("supported property names");
383
+ var indexedGet = /* @__PURE__ */ Symbol("indexed property get");
384
+ var indexedSetNew = /* @__PURE__ */ Symbol("indexed property set new");
385
+ var indexedSetExisting = /* @__PURE__ */ Symbol("indexed property set existing");
386
+ var namedGet = /* @__PURE__ */ Symbol("named property get");
387
+ var namedSetNew = /* @__PURE__ */ Symbol("named property set new");
388
+ var namedSetExisting = /* @__PURE__ */ Symbol("named property set existing");
389
+ var namedDelete = /* @__PURE__ */ Symbol("named property delete");
390
+ var asyncIteratorNext = /* @__PURE__ */ Symbol("async iterator get the next iteration result");
391
+ var asyncIteratorReturn = /* @__PURE__ */ Symbol("async iterator return steps");
392
+ var asyncIteratorInit = /* @__PURE__ */ Symbol("async iterator initialization steps");
393
+ var asyncIteratorEOI = /* @__PURE__ */ Symbol("async iterator end of iteration");
394
+ module.exports = exports = {
395
+ isObject,
396
+ define,
397
+ newObjectInRealm,
398
+ wrapperSymbol,
399
+ createInterfaceDescriptor,
400
+ registerWrapper,
401
+ getSameObject,
402
+ ctorRegistrySymbol,
403
+ initCtorRegistry,
404
+ wrapperForImpl,
405
+ implForWrapper,
406
+ implForWrapperWithInterface,
407
+ requireImplForWrapper,
408
+ tryWrapperForImpl,
409
+ tryImplForWrapper,
410
+ iterInternalSymbol,
411
+ isArrayBuffer,
412
+ isSharedArrayBuffer,
413
+ isArrayIndexPropName,
414
+ getMethod,
415
+ convertAsyncSequence,
416
+ supportsPropertyIndex,
417
+ supportedPropertyIndices,
418
+ supportsPropertyName,
419
+ supportedPropertyNames,
420
+ indexedGet,
421
+ indexedSetNew,
422
+ indexedSetExisting,
423
+ namedGet,
424
+ namedSetNew,
425
+ namedSetExisting,
426
+ namedDelete,
427
+ asyncIteratorNext,
428
+ asyncIteratorReturn,
429
+ asyncIteratorInit,
430
+ asyncIteratorEOI,
431
+ iteratorResult,
432
+ ordinarySetWithOwnDescriptor,
433
+ };
434
+ },
435
+ });
436
+ // platform:@exodus/bytes/encoding.js
437
+ var encoding_exports = {};
438
+ var init_encoding = __esm({
439
+ "platform:@exodus/bytes/encoding.js"() { },
440
+ });
441
+ // platform:@exodus/bytes/whatwg.js
442
+ var whatwg_exports = {};
443
+ __export(whatwg_exports, {
444
+ percentEncodeAfterEncoding: () => percentEncodeAfterEncoding,
445
+ });
446
+ import { percentEncodeAfterEncoding } from "./parser-platform.js";
447
+ var init_whatwg = __esm({
448
+ "platform:@exodus/bytes/whatwg.js"() { },
449
+ });
450
+ // node_modules/whatwg-url/lib/infra.js
451
+ var require_infra = __commonJS({
452
+ "node_modules/whatwg-url/lib/infra.js"(exports, module) {
453
+ "use strict";
454
+ function isASCIIDigit(c) {
455
+ return c >= 48 && c <= 57;
456
+ }
457
+ function isASCIIAlpha(c) {
458
+ return (c >= 65 && c <= 90) || (c >= 97 && c <= 122);
459
+ }
460
+ function isASCIIAlphanumeric(c) {
461
+ return isASCIIAlpha(c) || isASCIIDigit(c);
462
+ }
463
+ function isASCIIHex(c) {
464
+ return isASCIIDigit(c) || (c >= 65 && c <= 70) || (c >= 97 && c <= 102);
465
+ }
466
+ function isASCIIString(string) {
467
+ return !/[^\u0000-\u007F]/u.test(string);
468
+ }
469
+ function isNoncharacter(c) {
470
+ return (c >= 64976 && c <= 65007) || (c & 65534) === 65534;
471
+ }
472
+ module.exports = {
473
+ isASCIIDigit,
474
+ isASCIIAlpha,
475
+ isASCIIAlphanumeric,
476
+ isASCIIHex,
477
+ isASCIIString,
478
+ isNoncharacter,
479
+ };
480
+ },
481
+ });
482
+ // node_modules/whatwg-url/lib/encoding.js
483
+ var require_encoding = __commonJS({
484
+ "node_modules/whatwg-url/lib/encoding.js"(exports, module) {
485
+ "use strict";
486
+ var utf8Encoder = new TextEncoder();
487
+ var utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true });
488
+ function utf8Encode(string) {
489
+ return utf8Encoder.encode(string);
490
+ }
491
+ function utf8DecodeWithoutBOM(bytes) {
492
+ return utf8Decoder.decode(bytes);
493
+ }
494
+ module.exports = {
495
+ utf8Encode,
496
+ utf8DecodeWithoutBOM,
497
+ };
498
+ },
499
+ });
500
+ // workers-idna:workers-idna
501
+ var workers_idna_exports = {};
502
+ __export(workers_idna_exports, {
503
+ toASCII: () => toASCII,
504
+ });
505
+ import { toASCII } from "./unicode.js";
506
+ var init_workers_idna = __esm({
507
+ "workers-idna:workers-idna"() { },
508
+ });
509
+ // node_modules/whatwg-url/lib/url-miscellaneous.js
510
+ var require_url_miscellaneous = __commonJS({
511
+ "node_modules/whatwg-url/lib/url-miscellaneous.js"(exports, module) {
512
+ "use strict";
513
+ var tr46 = (init_workers_idna(), __toCommonJS(workers_idna_exports));
514
+ var infra = require_infra();
515
+ function p(char) {
516
+ return char.codePointAt(0);
517
+ }
518
+ var failure = /* @__PURE__ */ Symbol("failure");
519
+ var specialSchemes = /* @__PURE__ */ new Map([
520
+ ["ftp", 21],
521
+ ["file", null],
522
+ ["http", 80],
523
+ ["https", 443],
524
+ ["ws", 80],
525
+ ["wss", 443],
526
+ ]);
527
+ var urlCodePoints = /* @__PURE__ */ new Set([
528
+ p("!"),
529
+ p("$"),
530
+ p("&"),
531
+ p("'"),
532
+ p("("),
533
+ p(")"),
534
+ p("*"),
535
+ p("+"),
536
+ p(","),
537
+ p("-"),
538
+ p("."),
539
+ p("/"),
540
+ p(":"),
541
+ p(";"),
542
+ p("="),
543
+ p("?"),
544
+ p("@"),
545
+ p("_"),
546
+ p("~"),
547
+ ]);
548
+ var forbiddenHostCodePoints = /* @__PURE__ */ new Set([
549
+ 0,
550
+ 9,
551
+ 10,
552
+ 13,
553
+ 32,
554
+ p("#"),
555
+ p("/"),
556
+ p(":"),
557
+ p("<"),
558
+ p(">"),
559
+ p("?"),
560
+ p("@"),
561
+ p("["),
562
+ p("\\"),
563
+ p("]"),
564
+ p("^"),
565
+ p("|"),
566
+ ]);
567
+ function isURLCodePoint(c) {
568
+ return (infra.isASCIIAlphanumeric(c) ||
569
+ urlCodePoints.has(c) ||
570
+ (c >= 160 &&
571
+ c <= 1114109 &&
572
+ (c < 55296 || c > 57343) &&
573
+ !infra.isNoncharacter(c)));
574
+ }
575
+ function isInvalidURLCodePoint(c) {
576
+ return !isURLCodePoint(c) && c !== p("%");
577
+ }
578
+ function isPercentEncodedByteAt(input, index) {
579
+ return (index + 2 < input.length &&
580
+ input[index] === "%" &&
581
+ infra.isASCIIHex(input.charCodeAt(index + 1)) &&
582
+ infra.isASCIIHex(input.charCodeAt(index + 2)));
583
+ }
584
+ function containsPercentEncodedByte(input) {
585
+ return /%[0-9A-Fa-f]{2}/u.test(input);
586
+ }
587
+ function containsForbiddenHostCodePoint(string) {
588
+ return [...string].some((c) => forbiddenHostCodePoints.has(c.codePointAt(0)));
589
+ }
590
+ function containsForbiddenDomainCodePoint(string) {
591
+ return [...string].some((c) => {
592
+ const cp = c.codePointAt(0);
593
+ return (forbiddenHostCodePoints.has(cp) ||
594
+ (cp >= 0 && cp <= 31) ||
595
+ cp === p("%") ||
596
+ cp === 127);
597
+ });
598
+ }
599
+ function domainParserToASCII(domain, beStrict) {
600
+ return tr46.toASCII(domain, {
601
+ checkHyphens: beStrict,
602
+ checkBidi: true,
603
+ checkJoiners: true,
604
+ useSTD3ASCIIRules: beStrict,
605
+ transitionalProcessing: false,
606
+ verifyDNSLength: beStrict,
607
+ ignoreInvalidPunycode: false,
608
+ });
609
+ }
610
+ function parseIPv4Number(input, validationErrors = null) {
611
+ if (input === "") {
612
+ return failure;
613
+ }
614
+ let validationErrorSeen = false;
615
+ let R = 10;
616
+ if (input.length >= 2 &&
617
+ input.charAt(0) === "0" &&
618
+ input.charAt(1).toLowerCase() === "x") {
619
+ validationErrorSeen = true;
620
+ input = input.substring(2);
621
+ R = 16;
622
+ }
623
+ else if (input.length >= 2 && input.charAt(0) === "0") {
624
+ validationErrorSeen = true;
625
+ input = input.substring(1);
626
+ R = 8;
627
+ }
628
+ if (input === "") {
629
+ validationErrors?.push("IPv4-non-decimal-part");
630
+ return 0;
631
+ }
632
+ let regex = /[^0-7]/u;
633
+ if (R === 10) {
634
+ regex = /[^0-9]/u;
635
+ }
636
+ if (R === 16) {
637
+ regex = /[^0-9A-Fa-f]/u;
638
+ }
639
+ if (regex.test(input)) {
640
+ return failure;
641
+ }
642
+ if (validationErrorSeen) {
643
+ validationErrors?.push("IPv4-non-decimal-part");
644
+ }
645
+ return parseInt(input, R);
646
+ }
647
+ function endsInANumber(input) {
648
+ const parts = input.split(".");
649
+ if (parts[parts.length - 1] === "") {
650
+ if (parts.length === 1) {
651
+ return false;
652
+ }
653
+ parts.pop();
654
+ }
655
+ const last = parts[parts.length - 1];
656
+ if (/^[0-9]+$/u.test(last)) {
657
+ return true;
658
+ }
659
+ if (parseIPv4Number(last) !== failure) {
660
+ return true;
661
+ }
662
+ return false;
663
+ }
664
+ function domainParser(domain, validationErrors = null, beStrict = false) {
665
+ if (beStrict || validationErrors) {
666
+ const strictResult = domainParserToASCII(domain, true);
667
+ if (strictResult === null) {
668
+ validationErrors?.push("domain-to-ASCII");
669
+ }
670
+ if (beStrict) {
671
+ return strictResult === null ? failure : strictResult;
672
+ }
673
+ }
674
+ let result;
675
+ if (infra.isASCIIString(domain)) {
676
+ result = domain.toLowerCase();
677
+ }
678
+ else {
679
+ result = domainParserToASCII(domain, false);
680
+ if (result === null) {
681
+ return failure;
682
+ }
683
+ }
684
+ if (result === "") {
685
+ return failure;
686
+ }
687
+ if (containsForbiddenDomainCodePoint(result)) {
688
+ return failure;
689
+ }
690
+ return result;
691
+ }
692
+ function isSpecialScheme(scheme) {
693
+ return specialSchemes.has(scheme.toLowerCase());
694
+ }
695
+ function isSpecialSchemeExceptFile(scheme) {
696
+ return isSpecialScheme(scheme) && scheme.toLowerCase() !== "file";
697
+ }
698
+ function defaultPort(scheme) {
699
+ return specialSchemes.get(scheme.toLowerCase());
700
+ }
701
+ function isWindowsDriveLetterCodePoints(cp1, cp2) {
702
+ return infra.isASCIIAlpha(cp1) && (cp2 === p(":") || cp2 === p("|"));
703
+ }
704
+ function isWindowsDriveLetterString(string) {
705
+ return (string.length === 2 &&
706
+ infra.isASCIIAlpha(string.codePointAt(0)) &&
707
+ (string[1] === ":" || string[1] === "|"));
708
+ }
709
+ function isNormalizedWindowsDriveLetterString(string) {
710
+ return (string.length === 2 &&
711
+ infra.isASCIIAlpha(string.codePointAt(0)) &&
712
+ string[1] === ":");
713
+ }
714
+ module.exports = {
715
+ containsForbiddenHostCodePoint,
716
+ containsPercentEncodedByte,
717
+ defaultPort,
718
+ domainParser,
719
+ endsInANumber,
720
+ failure,
721
+ forbiddenHostCodePoints,
722
+ isInvalidURLCodePoint,
723
+ isNormalizedWindowsDriveLetterString,
724
+ isPercentEncodedByteAt,
725
+ parseIPv4Number,
726
+ isSpecialScheme,
727
+ isSpecialSchemeExceptFile,
728
+ isURLCodePoint,
729
+ isWindowsDriveLetterCodePoints,
730
+ isWindowsDriveLetterString,
731
+ p,
732
+ };
733
+ },
734
+ });
735
+ // node_modules/whatwg-url/lib/percent-encoding.js
736
+ var require_percent_encoding = __commonJS({
737
+ "node_modules/whatwg-url/lib/percent-encoding.js"(exports, module) {
738
+ "use strict";
739
+ var { isASCIIHex } = require_infra();
740
+ var { utf8Encode } = require_encoding();
741
+ function p(char) {
742
+ return char.codePointAt(0);
743
+ }
744
+ function percentEncode(c) {
745
+ let hex = c.toString(16).toUpperCase();
746
+ if (hex.length === 1) {
747
+ hex = `0${hex}`;
748
+ }
749
+ return `%${hex}`;
750
+ }
751
+ function percentDecodeBytes(input) {
752
+ const output = new Uint8Array(input.byteLength);
753
+ let outputIndex = 0;
754
+ for (let i = 0; i < input.byteLength; ++i) {
755
+ const byte = input[i];
756
+ if (byte !== 37) {
757
+ output[outputIndex++] = byte;
758
+ }
759
+ else if (byte === 37 &&
760
+ (!isASCIIHex(input[i + 1]) || !isASCIIHex(input[i + 2]))) {
761
+ output[outputIndex++] = byte;
762
+ }
763
+ else {
764
+ const bytePoint = parseInt(String.fromCodePoint(input[i + 1], input[i + 2]), 16);
765
+ output[outputIndex++] = bytePoint;
766
+ i += 2;
767
+ }
768
+ }
769
+ return output.slice(0, outputIndex);
770
+ }
771
+ function percentDecodeString(input) {
772
+ const bytes = utf8Encode(input);
773
+ return percentDecodeBytes(bytes);
774
+ }
775
+ function isC0ControlPercentEncode(c) {
776
+ return c <= 31 || c > 126;
777
+ }
778
+ var extraFragmentPercentEncodeSet = /* @__PURE__ */ new Set([
779
+ p(" "),
780
+ p('"'),
781
+ p("<"),
782
+ p(">"),
783
+ p("`"),
784
+ ]);
785
+ function isFragmentPercentEncode(c) {
786
+ return (isC0ControlPercentEncode(c) || extraFragmentPercentEncodeSet.has(c));
787
+ }
788
+ var extraQueryPercentEncodeSet = /* @__PURE__ */ new Set([
789
+ p(" "),
790
+ p('"'),
791
+ p("#"),
792
+ p("<"),
793
+ p(">"),
794
+ ]);
795
+ var extraQueryPercentEncodeChars = String.fromCodePoint(...[...extraQueryPercentEncodeSet].sort());
796
+ function isQueryPercentEncode(c) {
797
+ return isC0ControlPercentEncode(c) || extraQueryPercentEncodeSet.has(c);
798
+ }
799
+ var extraSpecialQueryPercentEncodeSet = /* @__PURE__ */ new Set([
800
+ ...extraQueryPercentEncodeSet,
801
+ p("'"),
802
+ ]);
803
+ var extraSpecialQueryPercentEncodeChars = String.fromCodePoint(...[...extraSpecialQueryPercentEncodeSet].sort());
804
+ function isSpecialQueryPercentEncode(c) {
805
+ return (isC0ControlPercentEncode(c) || extraSpecialQueryPercentEncodeSet.has(c));
806
+ }
807
+ var extraPathPercentEncodeSet = /* @__PURE__ */ new Set([
808
+ p("?"),
809
+ p("`"),
810
+ p("{"),
811
+ p("}"),
812
+ p("^"),
813
+ ]);
814
+ function isPathPercentEncode(c) {
815
+ return isQueryPercentEncode(c) || extraPathPercentEncodeSet.has(c);
816
+ }
817
+ var extraUserinfoPercentEncodeSet = /* @__PURE__ */ new Set([
818
+ p("/"),
819
+ p(":"),
820
+ p(";"),
821
+ p("="),
822
+ p("@"),
823
+ p("["),
824
+ p("\\"),
825
+ p("]"),
826
+ p("|"),
827
+ ]);
828
+ function isUserinfoPercentEncode(c) {
829
+ return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);
830
+ }
831
+ var extraComponentPercentEncodeSet = /* @__PURE__ */ new Set([
832
+ p("$"),
833
+ p("%"),
834
+ p("&"),
835
+ p("+"),
836
+ p(","),
837
+ ]);
838
+ function isComponentPercentEncode(c) {
839
+ return (isUserinfoPercentEncode(c) || extraComponentPercentEncodeSet.has(c));
840
+ }
841
+ var extraURLEncodedPercentEncodeSet = /* @__PURE__ */ new Set([
842
+ p("!"),
843
+ p("'"),
844
+ p("("),
845
+ p(")"),
846
+ p("~"),
847
+ ]);
848
+ function isURLEncodedPercentEncode(c) {
849
+ return (isComponentPercentEncode(c) || extraURLEncodedPercentEncodeSet.has(c));
850
+ }
851
+ function utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate) {
852
+ const bytes = utf8Encode(codePoint);
853
+ let output = "";
854
+ for (const byte of bytes) {
855
+ if (!percentEncodePredicate(byte)) {
856
+ output += String.fromCharCode(byte);
857
+ }
858
+ else {
859
+ output += percentEncode(byte);
860
+ }
861
+ }
862
+ return output;
863
+ }
864
+ function utf8PercentEncodeCodePoint(codePoint, percentEncodePredicate) {
865
+ return utf8PercentEncodeCodePointInternal(String.fromCodePoint(codePoint), percentEncodePredicate);
866
+ }
867
+ function utf8PercentEncodeString(input, percentEncodePredicate, spaceAsPlus = false) {
868
+ let output = "";
869
+ for (const codePoint of input) {
870
+ if (spaceAsPlus && codePoint === " ") {
871
+ output += "+";
872
+ }
873
+ else {
874
+ output += utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate);
875
+ }
876
+ }
877
+ return output;
878
+ }
879
+ module.exports = {
880
+ isC0ControlPercentEncode,
881
+ isFragmentPercentEncode,
882
+ isQueryPercentEncode,
883
+ isSpecialQueryPercentEncode,
884
+ isPathPercentEncode,
885
+ isUserinfoPercentEncode,
886
+ isURLEncodedPercentEncode,
887
+ extraQueryPercentEncodeChars,
888
+ extraSpecialQueryPercentEncodeChars,
889
+ percentDecodeString,
890
+ percentDecodeBytes,
891
+ utf8PercentEncodeString,
892
+ utf8PercentEncodeCodePoint,
893
+ };
894
+ },
895
+ });
896
+ // node_modules/whatwg-url/lib/url-state-machine.js
897
+ var require_url_state_machine = __commonJS({
898
+ "node_modules/whatwg-url/lib/url-state-machine.js"(exports, module) {
899
+ "use strict";
900
+ init_encoding();
901
+ var { percentEncodeAfterEncoding: percentEncodeAfterEncoding2 } = (init_whatwg(), __toCommonJS(whatwg_exports));
902
+ var infra = require_infra();
903
+ var { utf8DecodeWithoutBOM } = require_encoding();
904
+ var { containsForbiddenHostCodePoint, containsPercentEncodedByte, defaultPort, domainParser, endsInANumber, failure, isInvalidURLCodePoint, isNormalizedWindowsDriveLetterString, isSpecialScheme, isWindowsDriveLetterCodePoints, isWindowsDriveLetterString, parseIPv4Number, p, } = require_url_miscellaneous();
905
+ var { percentDecodeString, utf8PercentEncodeCodePoint, utf8PercentEncodeString, isC0ControlPercentEncode, isFragmentPercentEncode, extraQueryPercentEncodeChars, extraSpecialQueryPercentEncodeChars, isPathPercentEncode, isUserinfoPercentEncode, } = require_percent_encoding();
906
+ function countSymbols(str) {
907
+ return [...str].length;
908
+ }
909
+ function at(input, idx) {
910
+ const c = input[idx];
911
+ return isNaN(c) ? void 0 : String.fromCodePoint(c);
912
+ }
913
+ function isSingleDot(buffer) {
914
+ return buffer === "." || buffer.toLowerCase() === "%2e";
915
+ }
916
+ function isDoubleDot(buffer) {
917
+ buffer = buffer.toLowerCase();
918
+ return (buffer === ".." ||
919
+ buffer === "%2e." ||
920
+ buffer === ".%2e" ||
921
+ buffer === "%2e%2e");
922
+ }
923
+ function isInvalidPercentEncoding(input, pointer) {
924
+ return (input[pointer] === p("%") &&
925
+ (!infra.isASCIIHex(input[pointer + 1]) ||
926
+ !infra.isASCIIHex(input[pointer + 2])));
927
+ }
928
+ function validateURLUnits(input, validationErrors = null) {
929
+ if (validationErrors === null) {
930
+ return;
931
+ }
932
+ const codePoints = Array.from(input, (c) => c.codePointAt(0));
933
+ if (codePoints.some(isInvalidURLCodePoint)) {
934
+ validationErrors.push("invalid-URL-unit");
935
+ }
936
+ if (codePoints.some((_, i) => isInvalidPercentEncoding(codePoints, i))) {
937
+ validationErrors.push("invalid-URL-unit");
938
+ }
939
+ }
940
+ function isSpecial(url) {
941
+ return isSpecialScheme(url.scheme);
942
+ }
943
+ function isNotSpecial(url) {
944
+ return !isSpecialScheme(url.scheme);
945
+ }
946
+ function parseIPv4(input, validationErrors = null) {
947
+ const parts = input.split(".");
948
+ if (parts[parts.length - 1] === "") {
949
+ validationErrors?.push("IPv4-empty-part");
950
+ if (parts.length > 1) {
951
+ parts.pop();
952
+ }
953
+ }
954
+ if (parts.length > 4) {
955
+ validationErrors?.push("IPv4-too-many-parts");
956
+ return failure;
957
+ }
958
+ if (parts.length < 4) {
959
+ validationErrors?.push("IPv4-too-few-parts");
960
+ }
961
+ const numbers = [];
962
+ for (const part of parts) {
963
+ const n = parseIPv4Number(part, validationErrors);
964
+ if (n === failure) {
965
+ validationErrors?.push("IPv4-non-numeric-part");
966
+ return failure;
967
+ }
968
+ numbers.push(n);
969
+ }
970
+ if (validationErrors !== null && numbers.some((n) => n > 255)) {
971
+ validationErrors.push("IPv4-out-of-range-part");
972
+ }
973
+ for (let i = 0; i < numbers.length - 1; ++i) {
974
+ if (numbers[i] > 255) {
975
+ return failure;
976
+ }
977
+ }
978
+ if (numbers[numbers.length - 1] >= 256 ** (5 - numbers.length)) {
979
+ return failure;
980
+ }
981
+ let ipv4 = numbers.pop();
982
+ let counter = 0;
983
+ for (const n of numbers) {
984
+ ipv4 += n * 256 ** (3 - counter);
985
+ ++counter;
986
+ }
987
+ return ipv4;
988
+ }
989
+ function serializeIPv4(address) {
990
+ let output = "";
991
+ let n = address;
992
+ for (let i = 1; i <= 4; ++i) {
993
+ output = String(n % 256) + output;
994
+ if (i !== 4) {
995
+ output = `.${output}`;
996
+ }
997
+ n = Math.floor(n / 256);
998
+ }
999
+ return output;
1000
+ }
1001
+ function parseIPv6(input, validationErrors = null) {
1002
+ const address = [0, 0, 0, 0, 0, 0, 0, 0];
1003
+ let pieceIndex = 0;
1004
+ let compress = null;
1005
+ let pointer = 0;
1006
+ input = Array.from(input, (c) => c.codePointAt(0));
1007
+ if (input[pointer] === p(":")) {
1008
+ if (input[pointer + 1] !== p(":")) {
1009
+ validationErrors?.push("IPv6-invalid-compression");
1010
+ return failure;
1011
+ }
1012
+ pointer += 2;
1013
+ ++pieceIndex;
1014
+ compress = pieceIndex;
1015
+ }
1016
+ while (pointer < input.length) {
1017
+ if (pieceIndex === 8) {
1018
+ validationErrors?.push("IPv6-too-many-pieces");
1019
+ return failure;
1020
+ }
1021
+ if (input[pointer] === p(":")) {
1022
+ if (compress !== null) {
1023
+ validationErrors?.push("IPv6-multiple-compression");
1024
+ return failure;
1025
+ }
1026
+ ++pointer;
1027
+ ++pieceIndex;
1028
+ compress = pieceIndex;
1029
+ continue;
1030
+ }
1031
+ let value = 0;
1032
+ let length = 0;
1033
+ while (length < 4 && infra.isASCIIHex(input[pointer])) {
1034
+ value = value * 16 + parseInt(at(input, pointer), 16);
1035
+ ++pointer;
1036
+ ++length;
1037
+ }
1038
+ if (input[pointer] === p(".")) {
1039
+ if (length === 0) {
1040
+ validationErrors?.push("IPv4-in-IPv6-invalid-code-point");
1041
+ return failure;
1042
+ }
1043
+ pointer -= length;
1044
+ if (pieceIndex > 6) {
1045
+ validationErrors?.push("IPv4-in-IPv6-too-many-pieces");
1046
+ return failure;
1047
+ }
1048
+ let numbersSeen = 0;
1049
+ while (input[pointer] !== void 0) {
1050
+ let ipv4Piece = null;
1051
+ if (numbersSeen > 0) {
1052
+ if (input[pointer] === p(".") && numbersSeen < 4) {
1053
+ ++pointer;
1054
+ }
1055
+ else {
1056
+ validationErrors?.push("IPv4-in-IPv6-invalid-code-point");
1057
+ return failure;
1058
+ }
1059
+ }
1060
+ if (!infra.isASCIIDigit(input[pointer])) {
1061
+ validationErrors?.push("IPv4-in-IPv6-invalid-code-point");
1062
+ return failure;
1063
+ }
1064
+ while (infra.isASCIIDigit(input[pointer])) {
1065
+ const number = parseInt(at(input, pointer), 10);
1066
+ if (ipv4Piece === null) {
1067
+ ipv4Piece = number;
1068
+ }
1069
+ else if (ipv4Piece === 0) {
1070
+ validationErrors?.push("IPv4-in-IPv6-invalid-code-point");
1071
+ return failure;
1072
+ }
1073
+ else {
1074
+ ipv4Piece = ipv4Piece * 10 + number;
1075
+ }
1076
+ if (ipv4Piece > 255) {
1077
+ validationErrors?.push("IPv4-in-IPv6-out-of-range-part");
1078
+ return failure;
1079
+ }
1080
+ ++pointer;
1081
+ }
1082
+ address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
1083
+ ++numbersSeen;
1084
+ if (numbersSeen === 2 || numbersSeen === 4) {
1085
+ ++pieceIndex;
1086
+ }
1087
+ }
1088
+ if (numbersSeen !== 4) {
1089
+ validationErrors?.push("IPv4-in-IPv6-too-few-parts");
1090
+ return failure;
1091
+ }
1092
+ break;
1093
+ }
1094
+ else if (input[pointer] === p(":")) {
1095
+ ++pointer;
1096
+ if (input[pointer] === void 0) {
1097
+ validationErrors?.push("IPv6-invalid-code-point");
1098
+ return failure;
1099
+ }
1100
+ }
1101
+ else if (input[pointer] !== void 0) {
1102
+ validationErrors?.push("IPv6-invalid-code-point");
1103
+ return failure;
1104
+ }
1105
+ if (length > 1 && value < 16 ** (length - 1)) {
1106
+ validationErrors?.push("IPv6-piece-leading-zero");
1107
+ }
1108
+ address[pieceIndex] = value;
1109
+ ++pieceIndex;
1110
+ }
1111
+ if (compress !== null) {
1112
+ let swaps = pieceIndex - compress;
1113
+ pieceIndex = 7;
1114
+ while (pieceIndex !== 0 && swaps > 0) {
1115
+ const temp = address[compress + swaps - 1];
1116
+ address[compress + swaps - 1] = address[pieceIndex];
1117
+ address[pieceIndex] = temp;
1118
+ --pieceIndex;
1119
+ --swaps;
1120
+ }
1121
+ }
1122
+ else if (compress === null && pieceIndex !== 8) {
1123
+ validationErrors?.push("IPv6-too-few-pieces");
1124
+ return failure;
1125
+ }
1126
+ return address;
1127
+ }
1128
+ function serializeIPv6(address) {
1129
+ let output = "";
1130
+ const compress = findTheIPv6AddressCompressedPieceIndex(address);
1131
+ let ignore0 = false;
1132
+ for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {
1133
+ if (ignore0 && address[pieceIndex] === 0) {
1134
+ continue;
1135
+ }
1136
+ else if (ignore0) {
1137
+ ignore0 = false;
1138
+ }
1139
+ if (compress === pieceIndex) {
1140
+ const separator = pieceIndex === 0 ? "::" : ":";
1141
+ output += separator;
1142
+ ignore0 = true;
1143
+ continue;
1144
+ }
1145
+ output += address[pieceIndex].toString(16);
1146
+ if (pieceIndex !== 7) {
1147
+ output += ":";
1148
+ }
1149
+ }
1150
+ return output;
1151
+ }
1152
+ function parseHost(input, validationErrors = null, isOpaque = false) {
1153
+ if (input[0] === "[") {
1154
+ if (input[input.length - 1] !== "]") {
1155
+ validationErrors?.push("IPv6-unclosed");
1156
+ return failure;
1157
+ }
1158
+ return parseIPv6(input.substring(1, input.length - 1), validationErrors);
1159
+ }
1160
+ if (isOpaque) {
1161
+ return parseOpaqueHost(input, validationErrors);
1162
+ }
1163
+ if (validationErrors && containsPercentEncodedByte(input)) {
1164
+ validationErrors.push("domain-percent-encoded");
1165
+ }
1166
+ const domain = utf8DecodeWithoutBOM(percentDecodeString(input));
1167
+ const asciiDomain = domainParser(domain, validationErrors);
1168
+ if (asciiDomain === failure) {
1169
+ return failure;
1170
+ }
1171
+ if (endsInANumber(asciiDomain)) {
1172
+ if (!infra.isASCIIString(domain)) {
1173
+ validationErrors?.push("IPv4-non-ASCII-input");
1174
+ }
1175
+ return parseIPv4(asciiDomain, validationErrors);
1176
+ }
1177
+ return asciiDomain;
1178
+ }
1179
+ function parseOpaqueHost(input, validationErrors) {
1180
+ if (containsForbiddenHostCodePoint(input)) {
1181
+ validationErrors?.push("host-invalid-code-point");
1182
+ return failure;
1183
+ }
1184
+ validateURLUnits(input, validationErrors);
1185
+ return utf8PercentEncodeString(input, isC0ControlPercentEncode);
1186
+ }
1187
+ function findTheIPv6AddressCompressedPieceIndex(address) {
1188
+ let longestIndex = null;
1189
+ let longestSize = 1;
1190
+ let foundIndex = null;
1191
+ let foundSize = 0;
1192
+ for (let pieceIndex = 0; pieceIndex < address.length; ++pieceIndex) {
1193
+ if (address[pieceIndex] !== 0) {
1194
+ if (foundSize > longestSize) {
1195
+ longestIndex = foundIndex;
1196
+ longestSize = foundSize;
1197
+ }
1198
+ foundIndex = null;
1199
+ foundSize = 0;
1200
+ }
1201
+ else {
1202
+ if (foundIndex === null) {
1203
+ foundIndex = pieceIndex;
1204
+ }
1205
+ ++foundSize;
1206
+ }
1207
+ }
1208
+ if (foundSize > longestSize) {
1209
+ return foundIndex;
1210
+ }
1211
+ return longestIndex;
1212
+ }
1213
+ function serializeHost(host) {
1214
+ if (typeof host === "number") {
1215
+ return serializeIPv4(host);
1216
+ }
1217
+ if (host instanceof Array) {
1218
+ return `[${serializeIPv6(host)}]`;
1219
+ }
1220
+ return host;
1221
+ }
1222
+ function trimControlChars(string) {
1223
+ let start = 0;
1224
+ let end = string.length;
1225
+ for (; start < end; ++start) {
1226
+ if (string.charCodeAt(start) > 32) {
1227
+ break;
1228
+ }
1229
+ }
1230
+ for (; end > start; --end) {
1231
+ if (string.charCodeAt(end - 1) > 32) {
1232
+ break;
1233
+ }
1234
+ }
1235
+ return string.substring(start, end);
1236
+ }
1237
+ function trimTabAndNewline(url) {
1238
+ return url.replace(/\u0009|\u000A|\u000D/gu, "");
1239
+ }
1240
+ function shortenPath(url) {
1241
+ const { path } = url;
1242
+ if (path.length === 0) {
1243
+ return;
1244
+ }
1245
+ if (url.scheme === "file" &&
1246
+ path.length === 1 &&
1247
+ isNormalizedWindowsDriveLetterString(path[0])) {
1248
+ return;
1249
+ }
1250
+ path.pop();
1251
+ }
1252
+ function includesCredentials(url) {
1253
+ return url.username !== "" || url.password !== "";
1254
+ }
1255
+ function cannotHaveAUsernamePasswordPort(url) {
1256
+ return url.host === null || url.host === "" || url.scheme === "file";
1257
+ }
1258
+ function hasAnOpaquePath(url) {
1259
+ return typeof url.path === "string";
1260
+ }
1261
+ function URLStateMachine(input, base, encoding, url, stateOverride, validationErrors = null) {
1262
+ this.pointer = 0;
1263
+ this.input = input;
1264
+ this.base = base || null;
1265
+ this.encoding = encoding || "utf-8";
1266
+ this.stateOverride = stateOverride;
1267
+ this.url = url;
1268
+ this.failure = false;
1269
+ this.validationErrors = validationErrors;
1270
+ if (!this.url) {
1271
+ this.url = {
1272
+ scheme: "",
1273
+ username: "",
1274
+ password: "",
1275
+ host: null,
1276
+ port: null,
1277
+ path: [],
1278
+ query: null,
1279
+ fragment: null,
1280
+ };
1281
+ const res2 = trimControlChars(this.input);
1282
+ if (res2 !== this.input) {
1283
+ this.validationErrors?.push("invalid-URL-unit");
1284
+ }
1285
+ this.input = res2;
1286
+ }
1287
+ const res = trimTabAndNewline(this.input);
1288
+ if (res !== this.input) {
1289
+ this.validationErrors?.push("invalid-URL-unit");
1290
+ }
1291
+ this.input = res;
1292
+ this.state = stateOverride || "scheme start";
1293
+ this.buffer = "";
1294
+ this.atSignSeen = false;
1295
+ this.insideBrackets = false;
1296
+ this.passwordTokenSeen = false;
1297
+ this.input = Array.from(this.input, (c) => c.codePointAt(0));
1298
+ for (; this.pointer <= this.input.length; ++this.pointer) {
1299
+ const c = this.input[this.pointer];
1300
+ const cStr = isNaN(c) ? void 0 : String.fromCodePoint(c);
1301
+ const ret = this[`parse ${this.state}`](c, cStr);
1302
+ if (!ret) {
1303
+ break;
1304
+ }
1305
+ else if (ret === failure) {
1306
+ this.failure = true;
1307
+ break;
1308
+ }
1309
+ }
1310
+ }
1311
+ URLStateMachine.prototype.validateURLUnit = function (c) {
1312
+ if (this.validationErrors === null) {
1313
+ return;
1314
+ }
1315
+ if (isInvalidURLCodePoint(c)) {
1316
+ this.validationErrors.push("invalid-URL-unit");
1317
+ }
1318
+ if (isInvalidPercentEncoding(this.input, this.pointer)) {
1319
+ this.validationErrors.push("invalid-URL-unit");
1320
+ }
1321
+ };
1322
+ URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) {
1323
+ if (infra.isASCIIAlpha(c)) {
1324
+ this.buffer += cStr.toLowerCase();
1325
+ this.state = "scheme";
1326
+ }
1327
+ else if (!this.stateOverride) {
1328
+ this.state = "no scheme";
1329
+ --this.pointer;
1330
+ }
1331
+ else {
1332
+ return failure;
1333
+ }
1334
+ return true;
1335
+ };
1336
+ URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) {
1337
+ if (infra.isASCIIAlphanumeric(c) ||
1338
+ c === p("+") ||
1339
+ c === p("-") ||
1340
+ c === p(".")) {
1341
+ this.buffer += cStr.toLowerCase();
1342
+ }
1343
+ else if (c === p(":")) {
1344
+ if (this.stateOverride) {
1345
+ if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {
1346
+ return false;
1347
+ }
1348
+ if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {
1349
+ return false;
1350
+ }
1351
+ if ((includesCredentials(this.url) || this.url.port !== null) &&
1352
+ this.buffer === "file") {
1353
+ return false;
1354
+ }
1355
+ if (this.url.scheme === "file" && this.url.host === "") {
1356
+ return false;
1357
+ }
1358
+ }
1359
+ this.url.scheme = this.buffer;
1360
+ if (this.stateOverride) {
1361
+ if (this.url.port === defaultPort(this.url.scheme)) {
1362
+ this.url.port = null;
1363
+ }
1364
+ return false;
1365
+ }
1366
+ this.buffer = "";
1367
+ if (this.url.scheme === "file") {
1368
+ if (this.input[this.pointer + 1] !== p("/") ||
1369
+ this.input[this.pointer + 2] !== p("/")) {
1370
+ this.validationErrors?.push("special-scheme-missing-following-solidus");
1371
+ }
1372
+ this.state = "file";
1373
+ }
1374
+ else if (isSpecial(this.url) &&
1375
+ this.base !== null &&
1376
+ this.base.scheme === this.url.scheme) {
1377
+ this.state = "special relative or authority";
1378
+ }
1379
+ else if (isSpecial(this.url)) {
1380
+ this.state = "special authority slashes";
1381
+ }
1382
+ else if (this.input[this.pointer + 1] === p("/")) {
1383
+ this.state = "path or authority";
1384
+ ++this.pointer;
1385
+ }
1386
+ else {
1387
+ this.url.path = "";
1388
+ this.state = "opaque path";
1389
+ }
1390
+ }
1391
+ else if (!this.stateOverride) {
1392
+ this.buffer = "";
1393
+ this.state = "no scheme";
1394
+ this.pointer = -1;
1395
+ }
1396
+ else {
1397
+ return failure;
1398
+ }
1399
+ return true;
1400
+ };
1401
+ URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) {
1402
+ if (this.base === null || (hasAnOpaquePath(this.base) && c !== p("#"))) {
1403
+ this.validationErrors?.push("missing-scheme-non-relative-URL");
1404
+ return failure;
1405
+ }
1406
+ else if (hasAnOpaquePath(this.base) && c === p("#")) {
1407
+ this.url.scheme = this.base.scheme;
1408
+ this.url.path = this.base.path;
1409
+ this.url.query = this.base.query;
1410
+ this.url.fragment = "";
1411
+ this.state = "fragment";
1412
+ }
1413
+ else if (this.base.scheme === "file") {
1414
+ this.state = "file";
1415
+ --this.pointer;
1416
+ }
1417
+ else {
1418
+ this.state = "relative";
1419
+ --this.pointer;
1420
+ }
1421
+ return true;
1422
+ };
1423
+ URLStateMachine.prototype["parse special relative or authority"] =
1424
+ function parseSpecialRelativeOrAuthority(c) {
1425
+ if (c === p("/") && this.input[this.pointer + 1] === p("/")) {
1426
+ this.state = "special authority ignore slashes";
1427
+ ++this.pointer;
1428
+ }
1429
+ else {
1430
+ this.validationErrors?.push("special-scheme-missing-following-solidus");
1431
+ this.state = "relative";
1432
+ --this.pointer;
1433
+ }
1434
+ return true;
1435
+ };
1436
+ URLStateMachine.prototype["parse path or authority"] =
1437
+ function parsePathOrAuthority(c) {
1438
+ if (c === p("/")) {
1439
+ this.state = "authority";
1440
+ }
1441
+ else {
1442
+ this.state = "path";
1443
+ --this.pointer;
1444
+ }
1445
+ return true;
1446
+ };
1447
+ URLStateMachine.prototype["parse relative"] = function parseRelative(c) {
1448
+ this.url.scheme = this.base.scheme;
1449
+ if (c === p("/")) {
1450
+ this.state = "relative slash";
1451
+ }
1452
+ else if (isSpecial(this.url) && c === p("\\")) {
1453
+ this.validationErrors?.push("invalid-reverse-solidus");
1454
+ this.state = "relative slash";
1455
+ }
1456
+ else {
1457
+ this.url.username = this.base.username;
1458
+ this.url.password = this.base.password;
1459
+ this.url.host = this.base.host;
1460
+ this.url.port = this.base.port;
1461
+ this.url.path = this.base.path.slice();
1462
+ this.url.query = this.base.query;
1463
+ if (c === p("?")) {
1464
+ this.url.query = "";
1465
+ this.state = "query";
1466
+ }
1467
+ else if (c === p("#")) {
1468
+ this.url.fragment = "";
1469
+ this.state = "fragment";
1470
+ }
1471
+ else if (!isNaN(c)) {
1472
+ this.url.query = null;
1473
+ this.url.path.pop();
1474
+ this.state = "path";
1475
+ --this.pointer;
1476
+ }
1477
+ }
1478
+ return true;
1479
+ };
1480
+ URLStateMachine.prototype["parse relative slash"] =
1481
+ function parseRelativeSlash(c) {
1482
+ if (isSpecial(this.url) && (c === p("/") || c === p("\\"))) {
1483
+ if (c === p("\\")) {
1484
+ this.validationErrors?.push("invalid-reverse-solidus");
1485
+ }
1486
+ this.state = "special authority ignore slashes";
1487
+ }
1488
+ else if (c === p("/")) {
1489
+ this.state = "authority";
1490
+ }
1491
+ else {
1492
+ this.url.username = this.base.username;
1493
+ this.url.password = this.base.password;
1494
+ this.url.host = this.base.host;
1495
+ this.url.port = this.base.port;
1496
+ this.state = "path";
1497
+ --this.pointer;
1498
+ }
1499
+ return true;
1500
+ };
1501
+ URLStateMachine.prototype["parse special authority slashes"] =
1502
+ function parseSpecialAuthoritySlashes(c) {
1503
+ if (c === p("/") && this.input[this.pointer + 1] === p("/")) {
1504
+ this.state = "special authority ignore slashes";
1505
+ ++this.pointer;
1506
+ }
1507
+ else {
1508
+ this.validationErrors?.push("special-scheme-missing-following-solidus");
1509
+ this.state = "special authority ignore slashes";
1510
+ --this.pointer;
1511
+ }
1512
+ return true;
1513
+ };
1514
+ URLStateMachine.prototype["parse special authority ignore slashes"] =
1515
+ function parseSpecialAuthorityIgnoreSlashes(c) {
1516
+ if (c !== p("/") && c !== p("\\")) {
1517
+ this.state = "authority";
1518
+ --this.pointer;
1519
+ }
1520
+ else {
1521
+ this.validationErrors?.push("special-scheme-missing-following-solidus");
1522
+ }
1523
+ return true;
1524
+ };
1525
+ URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) {
1526
+ if (c === p("@")) {
1527
+ this.validationErrors?.push("invalid-credentials");
1528
+ if (this.atSignSeen) {
1529
+ this.buffer = `%40${this.buffer}`;
1530
+ }
1531
+ this.atSignSeen = true;
1532
+ for (const codePointStr of this.buffer) {
1533
+ const codePoint = codePointStr.codePointAt(0);
1534
+ if (codePoint === p(":") && !this.passwordTokenSeen) {
1535
+ this.passwordTokenSeen = true;
1536
+ continue;
1537
+ }
1538
+ const encodedCodePoints = utf8PercentEncodeCodePoint(codePoint, isUserinfoPercentEncode);
1539
+ if (this.passwordTokenSeen) {
1540
+ this.url.password += encodedCodePoints;
1541
+ }
1542
+ else {
1543
+ this.url.username += encodedCodePoints;
1544
+ }
1545
+ }
1546
+ this.buffer = "";
1547
+ }
1548
+ else if (isNaN(c) ||
1549
+ c === p("/") ||
1550
+ c === p("?") ||
1551
+ c === p("#") ||
1552
+ (isSpecial(this.url) && c === p("\\"))) {
1553
+ if (this.atSignSeen && this.buffer === "") {
1554
+ this.validationErrors?.push("host-missing");
1555
+ return failure;
1556
+ }
1557
+ this.pointer -= countSymbols(this.buffer) + 1;
1558
+ this.buffer = "";
1559
+ this.state = "host";
1560
+ }
1561
+ else {
1562
+ this.buffer += cStr;
1563
+ }
1564
+ return true;
1565
+ };
1566
+ URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) {
1567
+ if (this.stateOverride && this.url.scheme === "file") {
1568
+ --this.pointer;
1569
+ this.state = "file host";
1570
+ }
1571
+ else if (c === p(":") && !this.insideBrackets) {
1572
+ if (this.buffer === "") {
1573
+ this.validationErrors?.push("host-missing");
1574
+ return failure;
1575
+ }
1576
+ if (this.stateOverride === "hostname") {
1577
+ return failure;
1578
+ }
1579
+ const host = parseHost(this.buffer, this.validationErrors, isNotSpecial(this.url));
1580
+ if (host === failure) {
1581
+ return failure;
1582
+ }
1583
+ this.url.host = host;
1584
+ this.buffer = "";
1585
+ this.state = "port";
1586
+ }
1587
+ else if (isNaN(c) ||
1588
+ c === p("/") ||
1589
+ c === p("?") ||
1590
+ c === p("#") ||
1591
+ (isSpecial(this.url) && c === p("\\"))) {
1592
+ --this.pointer;
1593
+ if (isSpecial(this.url) && this.buffer === "") {
1594
+ this.validationErrors?.push("host-missing");
1595
+ return failure;
1596
+ }
1597
+ else if (this.stateOverride &&
1598
+ this.buffer === "" &&
1599
+ (includesCredentials(this.url) || this.url.port !== null)) {
1600
+ return failure;
1601
+ }
1602
+ const host = parseHost(this.buffer, this.validationErrors, isNotSpecial(this.url));
1603
+ if (host === failure) {
1604
+ return failure;
1605
+ }
1606
+ this.url.host = host;
1607
+ this.buffer = "";
1608
+ this.state = "path start";
1609
+ if (this.stateOverride) {
1610
+ return false;
1611
+ }
1612
+ }
1613
+ else {
1614
+ if (c === p("[")) {
1615
+ this.insideBrackets = true;
1616
+ }
1617
+ else if (c === p("]")) {
1618
+ this.insideBrackets = false;
1619
+ }
1620
+ this.buffer += cStr;
1621
+ }
1622
+ return true;
1623
+ };
1624
+ URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) {
1625
+ if (infra.isASCIIDigit(c)) {
1626
+ this.buffer += cStr;
1627
+ }
1628
+ else if (isNaN(c) ||
1629
+ c === p("/") ||
1630
+ c === p("?") ||
1631
+ c === p("#") ||
1632
+ (isSpecial(this.url) && c === p("\\")) ||
1633
+ this.stateOverride) {
1634
+ if (this.buffer !== "") {
1635
+ const port = parseInt(this.buffer, 10);
1636
+ if (port > 2 ** 16 - 1) {
1637
+ this.validationErrors?.push("port-out-of-range");
1638
+ return failure;
1639
+ }
1640
+ this.url.port = port === defaultPort(this.url.scheme) ? null : port;
1641
+ this.buffer = "";
1642
+ if (this.stateOverride) {
1643
+ return false;
1644
+ }
1645
+ }
1646
+ if (this.stateOverride) {
1647
+ return failure;
1648
+ }
1649
+ this.state = "path start";
1650
+ --this.pointer;
1651
+ }
1652
+ else {
1653
+ this.validationErrors?.push("port-invalid");
1654
+ return failure;
1655
+ }
1656
+ return true;
1657
+ };
1658
+ var fileOtherwiseCodePoints = /* @__PURE__ */ new Set([
1659
+ p("/"),
1660
+ p("\\"),
1661
+ p("?"),
1662
+ p("#"),
1663
+ ]);
1664
+ function startsWithWindowsDriveLetter(input, pointer) {
1665
+ const length = input.length - pointer;
1666
+ return (length >= 2 &&
1667
+ isWindowsDriveLetterCodePoints(input[pointer], input[pointer + 1]) &&
1668
+ (length === 2 || fileOtherwiseCodePoints.has(input[pointer + 2])));
1669
+ }
1670
+ URLStateMachine.prototype["parse file"] = function parseFile(c) {
1671
+ this.url.scheme = "file";
1672
+ this.url.host = "";
1673
+ if (c === p("/") || c === p("\\")) {
1674
+ if (c === p("\\")) {
1675
+ this.validationErrors?.push("invalid-reverse-solidus");
1676
+ }
1677
+ this.state = "file slash";
1678
+ }
1679
+ else if (this.base !== null && this.base.scheme === "file") {
1680
+ this.url.host = this.base.host;
1681
+ this.url.path = this.base.path.slice();
1682
+ this.url.query = this.base.query;
1683
+ if (c === p("?")) {
1684
+ this.url.query = "";
1685
+ this.state = "query";
1686
+ }
1687
+ else if (c === p("#")) {
1688
+ this.url.fragment = "";
1689
+ this.state = "fragment";
1690
+ }
1691
+ else if (!isNaN(c)) {
1692
+ this.url.query = null;
1693
+ if (!startsWithWindowsDriveLetter(this.input, this.pointer)) {
1694
+ shortenPath(this.url);
1695
+ }
1696
+ else {
1697
+ this.validationErrors?.push("file-invalid-Windows-drive-letter");
1698
+ this.url.path = [];
1699
+ }
1700
+ this.state = "path";
1701
+ --this.pointer;
1702
+ }
1703
+ }
1704
+ else {
1705
+ this.state = "path";
1706
+ --this.pointer;
1707
+ }
1708
+ return true;
1709
+ };
1710
+ URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) {
1711
+ if (c === p("/") || c === p("\\")) {
1712
+ if (c === p("\\")) {
1713
+ this.validationErrors?.push("invalid-reverse-solidus");
1714
+ }
1715
+ this.state = "file host";
1716
+ }
1717
+ else {
1718
+ if (this.base !== null && this.base.scheme === "file") {
1719
+ if (!startsWithWindowsDriveLetter(this.input, this.pointer) &&
1720
+ isNormalizedWindowsDriveLetterString(this.base.path[0])) {
1721
+ this.url.path.push(this.base.path[0]);
1722
+ }
1723
+ this.url.host = this.base.host;
1724
+ }
1725
+ this.state = "path";
1726
+ --this.pointer;
1727
+ }
1728
+ return true;
1729
+ };
1730
+ URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) {
1731
+ if (isNaN(c) ||
1732
+ c === p("/") ||
1733
+ c === p("\\") ||
1734
+ c === p("?") ||
1735
+ c === p("#")) {
1736
+ --this.pointer;
1737
+ if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {
1738
+ this.validationErrors?.push("file-invalid-Windows-drive-letter-host");
1739
+ this.state = "path";
1740
+ }
1741
+ else if (this.buffer === "") {
1742
+ this.url.host = "";
1743
+ if (this.stateOverride) {
1744
+ return false;
1745
+ }
1746
+ this.state = "path start";
1747
+ }
1748
+ else {
1749
+ let host = parseHost(this.buffer, this.validationErrors, isNotSpecial(this.url));
1750
+ if (host === failure) {
1751
+ return failure;
1752
+ }
1753
+ if (host === "localhost") {
1754
+ host = "";
1755
+ }
1756
+ this.url.host = host;
1757
+ if (this.stateOverride) {
1758
+ return false;
1759
+ }
1760
+ this.buffer = "";
1761
+ this.state = "path start";
1762
+ }
1763
+ }
1764
+ else {
1765
+ this.buffer += cStr;
1766
+ }
1767
+ return true;
1768
+ };
1769
+ URLStateMachine.prototype["parse path start"] = function parsePathStart(c) {
1770
+ if (isSpecial(this.url)) {
1771
+ if (c === p("\\")) {
1772
+ this.validationErrors?.push("invalid-reverse-solidus");
1773
+ }
1774
+ this.state = "path";
1775
+ if (c !== p("/") && c !== p("\\")) {
1776
+ --this.pointer;
1777
+ }
1778
+ }
1779
+ else if (!this.stateOverride && c === p("?")) {
1780
+ this.url.query = "";
1781
+ this.state = "query";
1782
+ }
1783
+ else if (!this.stateOverride && c === p("#")) {
1784
+ this.url.fragment = "";
1785
+ this.state = "fragment";
1786
+ }
1787
+ else if (c !== void 0) {
1788
+ this.state = "path";
1789
+ if (c !== p("/")) {
1790
+ --this.pointer;
1791
+ }
1792
+ }
1793
+ else if (this.stateOverride && this.url.host === null) {
1794
+ this.url.path.push("");
1795
+ }
1796
+ return true;
1797
+ };
1798
+ URLStateMachine.prototype["parse path"] = function parsePath(c) {
1799
+ if (isNaN(c) ||
1800
+ c === p("/") ||
1801
+ (isSpecial(this.url) && c === p("\\")) ||
1802
+ (!this.stateOverride && (c === p("?") || c === p("#")))) {
1803
+ if (isSpecial(this.url) && c === p("\\")) {
1804
+ this.validationErrors?.push("invalid-reverse-solidus");
1805
+ }
1806
+ if (isDoubleDot(this.buffer)) {
1807
+ shortenPath(this.url);
1808
+ if (c !== p("/") && !(isSpecial(this.url) && c === p("\\"))) {
1809
+ this.url.path.push("");
1810
+ }
1811
+ }
1812
+ else if (isSingleDot(this.buffer) &&
1813
+ c !== p("/") &&
1814
+ !(isSpecial(this.url) && c === p("\\"))) {
1815
+ this.url.path.push("");
1816
+ }
1817
+ else if (!isSingleDot(this.buffer)) {
1818
+ if (this.url.scheme === "file" &&
1819
+ this.url.path.length === 0 &&
1820
+ isWindowsDriveLetterString(this.buffer)) {
1821
+ this.buffer = `${this.buffer[0]}:`;
1822
+ }
1823
+ this.url.path.push(this.buffer);
1824
+ }
1825
+ this.buffer = "";
1826
+ if (c === p("?")) {
1827
+ this.url.query = "";
1828
+ this.state = "query";
1829
+ }
1830
+ if (c === p("#")) {
1831
+ this.url.fragment = "";
1832
+ this.state = "fragment";
1833
+ }
1834
+ }
1835
+ else {
1836
+ this.validateURLUnit(c);
1837
+ this.buffer += utf8PercentEncodeCodePoint(c, isPathPercentEncode);
1838
+ }
1839
+ return true;
1840
+ };
1841
+ URLStateMachine.prototype["parse opaque path"] = function parseOpaquePath(c) {
1842
+ if (c === p("?")) {
1843
+ this.url.query = "";
1844
+ this.state = "query";
1845
+ }
1846
+ else if (c === p("#")) {
1847
+ this.url.fragment = "";
1848
+ this.state = "fragment";
1849
+ }
1850
+ else if (c === p(" ")) {
1851
+ this.validationErrors?.push("invalid-URL-unit");
1852
+ const remaining = this.input[this.pointer + 1];
1853
+ if (remaining === p("?") || remaining === p("#")) {
1854
+ this.url.path += "%20";
1855
+ }
1856
+ else {
1857
+ this.url.path += " ";
1858
+ }
1859
+ }
1860
+ else if (!isNaN(c)) {
1861
+ this.validateURLUnit(c);
1862
+ this.url.path += utf8PercentEncodeCodePoint(c, isC0ControlPercentEncode);
1863
+ }
1864
+ return true;
1865
+ };
1866
+ URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) {
1867
+ if (!isSpecial(this.url) ||
1868
+ this.url.scheme === "ws" ||
1869
+ this.url.scheme === "wss") {
1870
+ this.encoding = "utf-8";
1871
+ }
1872
+ if ((!this.stateOverride && c === p("#")) || isNaN(c)) {
1873
+ const percentEncodeSet = isSpecial(this.url)
1874
+ ? extraSpecialQueryPercentEncodeChars
1875
+ : extraQueryPercentEncodeChars;
1876
+ this.url.query += percentEncodeAfterEncoding2(this.encoding, this.buffer, percentEncodeSet);
1877
+ this.buffer = "";
1878
+ if (c === p("#")) {
1879
+ this.url.fragment = "";
1880
+ this.state = "fragment";
1881
+ }
1882
+ }
1883
+ else if (!isNaN(c)) {
1884
+ this.validateURLUnit(c);
1885
+ this.buffer += cStr;
1886
+ }
1887
+ return true;
1888
+ };
1889
+ URLStateMachine.prototype["parse fragment"] = function parseFragment(c) {
1890
+ if (!isNaN(c)) {
1891
+ this.validateURLUnit(c);
1892
+ this.url.fragment += utf8PercentEncodeCodePoint(c, isFragmentPercentEncode);
1893
+ }
1894
+ return true;
1895
+ };
1896
+ function serializeURL(url, excludeFragment) {
1897
+ let output = `${url.scheme}:`;
1898
+ if (url.host !== null) {
1899
+ output += "//";
1900
+ if (url.username !== "" || url.password !== "") {
1901
+ output += url.username;
1902
+ if (url.password !== "") {
1903
+ output += `:${url.password}`;
1904
+ }
1905
+ output += "@";
1906
+ }
1907
+ output += serializeHost(url.host);
1908
+ if (url.port !== null) {
1909
+ output += `:${url.port}`;
1910
+ }
1911
+ }
1912
+ if (url.host === null &&
1913
+ !hasAnOpaquePath(url) &&
1914
+ url.path.length > 1 &&
1915
+ url.path[0] === "") {
1916
+ output += "/.";
1917
+ }
1918
+ output += serializePath(url);
1919
+ if (url.query !== null) {
1920
+ output += `?${url.query}`;
1921
+ }
1922
+ if (!excludeFragment && url.fragment !== null) {
1923
+ output += `#${url.fragment}`;
1924
+ }
1925
+ return output;
1926
+ }
1927
+ function serializeOrigin(tuple) {
1928
+ let result = `${tuple.scheme}://`;
1929
+ result += serializeHost(tuple.host);
1930
+ if (tuple.port !== null) {
1931
+ result += `:${tuple.port}`;
1932
+ }
1933
+ return result;
1934
+ }
1935
+ function serializePath(url) {
1936
+ if (hasAnOpaquePath(url)) {
1937
+ return url.path;
1938
+ }
1939
+ let output = "";
1940
+ for (const segment of url.path) {
1941
+ output += `/${segment}`;
1942
+ }
1943
+ return output;
1944
+ }
1945
+ module.exports.serializeURL = serializeURL;
1946
+ module.exports.serializePath = serializePath;
1947
+ module.exports.serializeURLOrigin = function (url) {
1948
+ switch (url.scheme) {
1949
+ case "blob": {
1950
+ const pathURL = module.exports.parseURL(serializePath(url));
1951
+ if (pathURL === null) {
1952
+ return "null";
1953
+ }
1954
+ if (pathURL.scheme !== "http" && pathURL.scheme !== "https") {
1955
+ return "null";
1956
+ }
1957
+ return module.exports.serializeURLOrigin(pathURL);
1958
+ }
1959
+ case "ftp":
1960
+ case "http":
1961
+ case "https":
1962
+ case "ws":
1963
+ case "wss":
1964
+ return serializeOrigin({
1965
+ scheme: url.scheme,
1966
+ host: url.host,
1967
+ port: url.port,
1968
+ });
1969
+ case "file":
1970
+ return "null";
1971
+ default:
1972
+ return "null";
1973
+ }
1974
+ };
1975
+ function basicURLParse(input, options = {}, validationErrors = null) {
1976
+ const usm = new URLStateMachine(input, options.baseURL, options.encoding, options.url, options.stateOverride, validationErrors);
1977
+ if (usm.failure) {
1978
+ return null;
1979
+ }
1980
+ return usm.url;
1981
+ }
1982
+ module.exports.basicURLParse = function (input, options = {}) {
1983
+ return basicURLParse(input, options);
1984
+ };
1985
+ module.exports.setTheUsername = function (url, username) {
1986
+ url.username = utf8PercentEncodeString(username, isUserinfoPercentEncode);
1987
+ };
1988
+ module.exports.setThePassword = function (url, password) {
1989
+ url.password = utf8PercentEncodeString(password, isUserinfoPercentEncode);
1990
+ };
1991
+ module.exports.serializeHost = serializeHost;
1992
+ module.exports.cannotHaveAUsernamePasswordPort =
1993
+ cannotHaveAUsernamePasswordPort;
1994
+ module.exports.hasAnOpaquePath = hasAnOpaquePath;
1995
+ module.exports.serializeInteger = function (integer) {
1996
+ return String(integer);
1997
+ };
1998
+ module.exports.parseURL = function (input, options = {}) {
1999
+ return module.exports.basicURLParse(input, {
2000
+ baseURL: options.baseURL,
2001
+ encoding: options.encoding,
2002
+ });
2003
+ };
2004
+ module.exports.parseURLWithValidationErrors = function (input, options = {}) {
2005
+ const validationErrors = [];
2006
+ const url = basicURLParse(input, {
2007
+ baseURL: options.baseURL,
2008
+ encoding: options.encoding,
2009
+ }, validationErrors);
2010
+ return { url, validationErrors };
2011
+ };
2012
+ },
2013
+ });
2014
+ // node_modules/whatwg-url/lib/urlencoded.js
2015
+ var require_urlencoded = __commonJS({
2016
+ "node_modules/whatwg-url/lib/urlencoded.js"(exports, module) {
2017
+ "use strict";
2018
+ var { utf8Encode, utf8DecodeWithoutBOM } = require_encoding();
2019
+ var { percentDecodeBytes, utf8PercentEncodeString, isURLEncodedPercentEncode, } = require_percent_encoding();
2020
+ function p(char) {
2021
+ return char.codePointAt(0);
2022
+ }
2023
+ function parseUrlencoded(input) {
2024
+ const sequences = strictlySplitByteSequence(input, p("&"));
2025
+ const output = [];
2026
+ for (const bytes of sequences) {
2027
+ if (bytes.length === 0) {
2028
+ continue;
2029
+ }
2030
+ let name, value;
2031
+ const indexOfEqual = bytes.indexOf(p("="));
2032
+ if (indexOfEqual >= 0) {
2033
+ name = bytes.slice(0, indexOfEqual);
2034
+ value = bytes.slice(indexOfEqual + 1);
2035
+ }
2036
+ else {
2037
+ name = bytes;
2038
+ value = new Uint8Array(0);
2039
+ }
2040
+ name = replaceByteInByteSequence(name, 43, 32);
2041
+ value = replaceByteInByteSequence(value, 43, 32);
2042
+ const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name));
2043
+ const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value));
2044
+ output.push([nameString, valueString]);
2045
+ }
2046
+ return output;
2047
+ }
2048
+ function parseUrlencodedString(input) {
2049
+ return parseUrlencoded(utf8Encode(input));
2050
+ }
2051
+ function serializeUrlencoded(tuples) {
2052
+ let output = "";
2053
+ for (const [i, tuple] of tuples.entries()) {
2054
+ const name = utf8PercentEncodeString(tuple[0], isURLEncodedPercentEncode, true);
2055
+ const value = utf8PercentEncodeString(tuple[1], isURLEncodedPercentEncode, true);
2056
+ if (i !== 0) {
2057
+ output += "&";
2058
+ }
2059
+ output += `${name}=${value}`;
2060
+ }
2061
+ return output;
2062
+ }
2063
+ function strictlySplitByteSequence(buf, cp) {
2064
+ const list = [];
2065
+ let last = 0;
2066
+ let i = buf.indexOf(cp);
2067
+ while (i >= 0) {
2068
+ list.push(buf.slice(last, i));
2069
+ last = i + 1;
2070
+ i = buf.indexOf(cp, last);
2071
+ }
2072
+ if (last !== buf.length) {
2073
+ list.push(buf.slice(last));
2074
+ }
2075
+ return list;
2076
+ }
2077
+ function replaceByteInByteSequence(buf, from, to) {
2078
+ let i = buf.indexOf(from);
2079
+ while (i >= 0) {
2080
+ buf[i] = to;
2081
+ i = buf.indexOf(from, i + 1);
2082
+ }
2083
+ return buf;
2084
+ }
2085
+ module.exports = {
2086
+ parseUrlencodedString,
2087
+ serializeUrlencoded,
2088
+ };
2089
+ },
2090
+ });
2091
+ // node_modules/whatwg-url/lib/Function.js
2092
+ var require_Function = __commonJS({
2093
+ "node_modules/whatwg-url/lib/Function.js"(exports) {
2094
+ "use strict";
2095
+ var conversions = (init_webidl_conversions(), __toCommonJS(webidl_conversions_exports));
2096
+ var utils = require_utils();
2097
+ exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
2098
+ if (typeof value !== "function") {
2099
+ throw new globalObject.TypeError(context + " is not a function");
2100
+ }
2101
+ function invokeTheCallbackFunction(...args) {
2102
+ const thisArg = utils.tryWrapperForImpl(this);
2103
+ let callResult;
2104
+ for (let i = 0; i < args.length; i++) {
2105
+ args[i] = utils.tryWrapperForImpl(args[i]);
2106
+ }
2107
+ callResult = Reflect.apply(value, thisArg, args);
2108
+ callResult = conversions["any"](callResult, {
2109
+ context,
2110
+ globals: globalObject,
2111
+ });
2112
+ return callResult;
2113
+ }
2114
+ invokeTheCallbackFunction.construct = (...args) => {
2115
+ for (let i = 0; i < args.length; i++) {
2116
+ args[i] = utils.tryWrapperForImpl(args[i]);
2117
+ }
2118
+ let callResult = Reflect.construct(value, args);
2119
+ callResult = conversions["any"](callResult, {
2120
+ context,
2121
+ globals: globalObject,
2122
+ });
2123
+ return callResult;
2124
+ };
2125
+ invokeTheCallbackFunction[utils.wrapperSymbol] = value;
2126
+ invokeTheCallbackFunction.objectReference = value;
2127
+ return invokeTheCallbackFunction;
2128
+ };
2129
+ },
2130
+ });
2131
+ // node_modules/whatwg-url/lib/URLSearchParams-impl.js
2132
+ var require_URLSearchParams_impl = __commonJS({
2133
+ "node_modules/whatwg-url/lib/URLSearchParams-impl.js"(exports) {
2134
+ "use strict";
2135
+ var urlencoded = require_urlencoded();
2136
+ exports.implementation = class URLSearchParamsImpl {
2137
+ constructor(globalObject, constructorArgs, { doNotStripQMark = false }) {
2138
+ let init = constructorArgs[0];
2139
+ this._list = [];
2140
+ this._url = null;
2141
+ if (!doNotStripQMark && typeof init === "string" && init[0] === "?") {
2142
+ init = init.slice(1);
2143
+ }
2144
+ if (Array.isArray(init)) {
2145
+ for (const pair of init) {
2146
+ if (pair.length !== 2) {
2147
+ throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not contain exactly two elements.");
2148
+ }
2149
+ this._list.push([pair[0], pair[1]]);
2150
+ }
2151
+ }
2152
+ else if (typeof init === "object" &&
2153
+ Object.getPrototypeOf(init) === null) {
2154
+ for (const name of Object.keys(init)) {
2155
+ const value = init[name];
2156
+ this._list.push([name, value]);
2157
+ }
2158
+ }
2159
+ else {
2160
+ this._list = urlencoded.parseUrlencodedString(init);
2161
+ }
2162
+ }
2163
+ _updateSteps() {
2164
+ if (this._url !== null) {
2165
+ let serializedQuery = urlencoded.serializeUrlencoded(this._list);
2166
+ if (serializedQuery === "") {
2167
+ serializedQuery = null;
2168
+ }
2169
+ this._url._url.query = serializedQuery;
2170
+ }
2171
+ }
2172
+ get size() {
2173
+ return this._list.length;
2174
+ }
2175
+ append(name, value) {
2176
+ this._list.push([name, value]);
2177
+ this._updateSteps();
2178
+ }
2179
+ delete(name, value) {
2180
+ let i = 0;
2181
+ while (i < this._list.length) {
2182
+ if (this._list[i][0] === name &&
2183
+ (value === void 0 || this._list[i][1] === value)) {
2184
+ this._list.splice(i, 1);
2185
+ }
2186
+ else {
2187
+ i++;
2188
+ }
2189
+ }
2190
+ this._updateSteps();
2191
+ }
2192
+ get(name) {
2193
+ for (const tuple of this._list) {
2194
+ if (tuple[0] === name) {
2195
+ return tuple[1];
2196
+ }
2197
+ }
2198
+ return null;
2199
+ }
2200
+ getAll(name) {
2201
+ const output = [];
2202
+ for (const tuple of this._list) {
2203
+ if (tuple[0] === name) {
2204
+ output.push(tuple[1]);
2205
+ }
2206
+ }
2207
+ return output;
2208
+ }
2209
+ has(name, value) {
2210
+ for (const tuple of this._list) {
2211
+ if (tuple[0] === name && (value === void 0 || tuple[1] === value)) {
2212
+ return true;
2213
+ }
2214
+ }
2215
+ return false;
2216
+ }
2217
+ set(name, value) {
2218
+ let found = false;
2219
+ let i = 0;
2220
+ while (i < this._list.length) {
2221
+ if (this._list[i][0] === name) {
2222
+ if (found) {
2223
+ this._list.splice(i, 1);
2224
+ }
2225
+ else {
2226
+ found = true;
2227
+ this._list[i][1] = value;
2228
+ i++;
2229
+ }
2230
+ }
2231
+ else {
2232
+ i++;
2233
+ }
2234
+ }
2235
+ if (!found) {
2236
+ this._list.push([name, value]);
2237
+ }
2238
+ this._updateSteps();
2239
+ }
2240
+ sort() {
2241
+ this._list.sort((a, b) => {
2242
+ if (a[0] < b[0]) {
2243
+ return -1;
2244
+ }
2245
+ if (a[0] > b[0]) {
2246
+ return 1;
2247
+ }
2248
+ return 0;
2249
+ });
2250
+ this._updateSteps();
2251
+ }
2252
+ [Symbol.iterator]() {
2253
+ return this._list[Symbol.iterator]();
2254
+ }
2255
+ toString() {
2256
+ return urlencoded.serializeUrlencoded(this._list);
2257
+ }
2258
+ };
2259
+ },
2260
+ });
2261
+ // node_modules/whatwg-url/lib/URLSearchParams.js
2262
+ var require_URLSearchParams = __commonJS({
2263
+ "node_modules/whatwg-url/lib/URLSearchParams.js"(exports) {
2264
+ "use strict";
2265
+ var conversions = (init_webidl_conversions(), __toCommonJS(webidl_conversions_exports));
2266
+ var utils = require_utils();
2267
+ var Function2 = require_Function();
2268
+ var newObjectInRealm = utils.newObjectInRealm;
2269
+ var ctorRegistrySymbol = utils.ctorRegistrySymbol;
2270
+ var interfaceName = "URLSearchParams";
2271
+ var $interfaceDescriptor = utils.createInterfaceDescriptor();
2272
+ exports.interfaceDescriptor = $interfaceDescriptor;
2273
+ function $requireImpl(wrapper, globalObject, context) {
2274
+ return utils.requireImplForWrapper(wrapper, $interfaceDescriptor, globalObject, interfaceName, context);
2275
+ }
2276
+ exports.is = (value) => {
2277
+ return (utils.implForWrapperWithInterface(value, $interfaceDescriptor) !== null);
2278
+ };
2279
+ exports.isImpl = (value) => {
2280
+ return utils.isObject(value) && value instanceof Impl.implementation;
2281
+ };
2282
+ exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
2283
+ const impl = utils.implForWrapperWithInterface(value, $interfaceDescriptor);
2284
+ if (impl !== null) {
2285
+ return impl;
2286
+ }
2287
+ throw new globalObject.TypeError(`${context} is not of type 'URLSearchParams'.`);
2288
+ };
2289
+ exports.createDefaultIterator = (globalObject, target, kind) => {
2290
+ const ctorRegistry = globalObject[ctorRegistrySymbol];
2291
+ const iteratorPrototype = ctorRegistry["URLSearchParams Iterator"];
2292
+ const iterator = Object.create(iteratorPrototype);
2293
+ Object.defineProperty(iterator, utils.iterInternalSymbol, {
2294
+ value: { target, kind, index: 0 },
2295
+ configurable: true,
2296
+ });
2297
+ return iterator;
2298
+ };
2299
+ function makeWrapper(globalObject, newTarget) {
2300
+ let proto;
2301
+ if (newTarget !== void 0) {
2302
+ proto = newTarget.prototype;
2303
+ }
2304
+ if (!utils.isObject(proto)) {
2305
+ proto = globalObject[ctorRegistrySymbol]["URLSearchParams"].prototype;
2306
+ }
2307
+ return Object.create(proto);
2308
+ }
2309
+ exports.create = (globalObject, constructorArgs, privateData) => {
2310
+ const wrapper = makeWrapper(globalObject);
2311
+ return exports.setup(wrapper, globalObject, constructorArgs, privateData);
2312
+ };
2313
+ exports.createImpl = (globalObject, constructorArgs, privateData) => {
2314
+ const wrapper = exports.create(globalObject, constructorArgs, privateData);
2315
+ return utils.implForWrapper(wrapper);
2316
+ };
2317
+ exports._internalSetup = (wrapper, globalObject) => { };
2318
+ exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
2319
+ privateData.wrapper = wrapper;
2320
+ exports._internalSetup(wrapper, globalObject);
2321
+ const impl = new Impl.implementation(globalObject, constructorArgs, privateData);
2322
+ utils.registerWrapper(wrapper, impl, $interfaceDescriptor);
2323
+ impl[utils.wrapperSymbol] = wrapper;
2324
+ if (Impl.init) {
2325
+ Impl.init(impl);
2326
+ }
2327
+ return wrapper;
2328
+ };
2329
+ exports.new = (globalObject, newTarget) => {
2330
+ const wrapper = makeWrapper(globalObject, newTarget);
2331
+ exports._internalSetup(wrapper, globalObject);
2332
+ const impl = Object.create(Impl.implementation.prototype);
2333
+ utils.registerWrapper(wrapper, impl, $interfaceDescriptor);
2334
+ impl[utils.wrapperSymbol] = wrapper;
2335
+ if (Impl.init) {
2336
+ Impl.init(impl);
2337
+ }
2338
+ return impl;
2339
+ };
2340
+ var exposed = /* @__PURE__ */ new Set(["Window", "Worker"]);
2341
+ exports.install = (globalObject, globalNames) => {
2342
+ if (!globalNames.some((globalName) => exposed.has(globalName))) {
2343
+ return;
2344
+ }
2345
+ const ctorRegistry = utils.initCtorRegistry(globalObject);
2346
+ class URLSearchParams2 {
2347
+ constructor() {
2348
+ const args = [];
2349
+ {
2350
+ let curArg = arguments[0];
2351
+ if (curArg !== void 0) {
2352
+ if (utils.isObject(curArg)) {
2353
+ if (utils.getMethod(curArg, Symbol.iterator, "Failed to construct 'URLSearchParams': parameter 1") !== void 0) {
2354
+ if (!utils.isObject(curArg)) {
2355
+ throw new globalObject.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");
2356
+ }
2357
+ else {
2358
+ const V = [];
2359
+ const tmp = curArg;
2360
+ for (let nextItem of tmp) {
2361
+ if (!utils.isObject(nextItem)) {
2362
+ throw new globalObject.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");
2363
+ }
2364
+ else {
2365
+ const V2 = [];
2366
+ const tmp2 = nextItem;
2367
+ for (let nextItem2 of tmp2) {
2368
+ nextItem2 = conversions["USVString"](nextItem2, {
2369
+ context: "Failed to construct 'URLSearchParams': parameter 1 sequence's element's element",
2370
+ globals: globalObject,
2371
+ });
2372
+ V2.push(nextItem2);
2373
+ }
2374
+ nextItem = V2;
2375
+ }
2376
+ V.push(nextItem);
2377
+ }
2378
+ curArg = V;
2379
+ }
2380
+ }
2381
+ else {
2382
+ if (!utils.isObject(curArg)) {
2383
+ throw new globalObject.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");
2384
+ }
2385
+ else {
2386
+ const result = /* @__PURE__ */ Object.create(null);
2387
+ for (const key of Reflect.ownKeys(curArg)) {
2388
+ const desc = Object.getOwnPropertyDescriptor(curArg, key);
2389
+ if (desc && desc.enumerable) {
2390
+ let typedKey = key;
2391
+ typedKey = conversions["USVString"](typedKey, {
2392
+ context: "Failed to construct 'URLSearchParams': parameter 1 record's key",
2393
+ globals: globalObject,
2394
+ });
2395
+ let typedValue = curArg[key];
2396
+ typedValue = conversions["USVString"](typedValue, {
2397
+ context: "Failed to construct 'URLSearchParams': parameter 1 record's value",
2398
+ globals: globalObject,
2399
+ });
2400
+ result[typedKey] = typedValue;
2401
+ }
2402
+ }
2403
+ curArg = result;
2404
+ }
2405
+ }
2406
+ }
2407
+ else {
2408
+ curArg = conversions["USVString"](curArg, {
2409
+ context: "Failed to construct 'URLSearchParams': parameter 1",
2410
+ globals: globalObject,
2411
+ });
2412
+ }
2413
+ }
2414
+ else {
2415
+ curArg = "";
2416
+ }
2417
+ args.push(curArg);
2418
+ }
2419
+ return exports.setup(Object.create(new.target.prototype), globalObject, args);
2420
+ }
2421
+ append(name, value) {
2422
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "append");
2423
+ if (arguments.length < 2) {
2424
+ throw new globalObject.TypeError(`Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);
2425
+ }
2426
+ const args = [];
2427
+ {
2428
+ let curArg = arguments[0];
2429
+ curArg = conversions["USVString"](curArg, {
2430
+ context: "Failed to execute 'append' on 'URLSearchParams': parameter 1",
2431
+ globals: globalObject,
2432
+ });
2433
+ args.push(curArg);
2434
+ }
2435
+ {
2436
+ let curArg = arguments[1];
2437
+ curArg = conversions["USVString"](curArg, {
2438
+ context: "Failed to execute 'append' on 'URLSearchParams': parameter 2",
2439
+ globals: globalObject,
2440
+ });
2441
+ args.push(curArg);
2442
+ }
2443
+ return utils.tryWrapperForImpl($impl.append(...args));
2444
+ }
2445
+ delete(name) {
2446
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "delete");
2447
+ if (arguments.length < 1) {
2448
+ throw new globalObject.TypeError(`Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);
2449
+ }
2450
+ const args = [];
2451
+ {
2452
+ let curArg = arguments[0];
2453
+ curArg = conversions["USVString"](curArg, {
2454
+ context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1",
2455
+ globals: globalObject,
2456
+ });
2457
+ args.push(curArg);
2458
+ }
2459
+ {
2460
+ let curArg = arguments[1];
2461
+ if (curArg !== void 0) {
2462
+ curArg = conversions["USVString"](curArg, {
2463
+ context: "Failed to execute 'delete' on 'URLSearchParams': parameter 2",
2464
+ globals: globalObject,
2465
+ });
2466
+ }
2467
+ args.push(curArg);
2468
+ }
2469
+ return utils.tryWrapperForImpl($impl.delete(...args));
2470
+ }
2471
+ get(name) {
2472
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get");
2473
+ if (arguments.length < 1) {
2474
+ throw new globalObject.TypeError(`Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);
2475
+ }
2476
+ const args = [];
2477
+ {
2478
+ let curArg = arguments[0];
2479
+ curArg = conversions["USVString"](curArg, {
2480
+ context: "Failed to execute 'get' on 'URLSearchParams': parameter 1",
2481
+ globals: globalObject,
2482
+ });
2483
+ args.push(curArg);
2484
+ }
2485
+ return $impl.get(...args);
2486
+ }
2487
+ getAll(name) {
2488
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "getAll");
2489
+ if (arguments.length < 1) {
2490
+ throw new globalObject.TypeError(`Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);
2491
+ }
2492
+ const args = [];
2493
+ {
2494
+ let curArg = arguments[0];
2495
+ curArg = conversions["USVString"](curArg, {
2496
+ context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1",
2497
+ globals: globalObject,
2498
+ });
2499
+ args.push(curArg);
2500
+ }
2501
+ return utils.tryWrapperForImpl($impl.getAll(...args));
2502
+ }
2503
+ has(name) {
2504
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "has");
2505
+ if (arguments.length < 1) {
2506
+ throw new globalObject.TypeError(`Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);
2507
+ }
2508
+ const args = [];
2509
+ {
2510
+ let curArg = arguments[0];
2511
+ curArg = conversions["USVString"](curArg, {
2512
+ context: "Failed to execute 'has' on 'URLSearchParams': parameter 1",
2513
+ globals: globalObject,
2514
+ });
2515
+ args.push(curArg);
2516
+ }
2517
+ {
2518
+ let curArg = arguments[1];
2519
+ if (curArg !== void 0) {
2520
+ curArg = conversions["USVString"](curArg, {
2521
+ context: "Failed to execute 'has' on 'URLSearchParams': parameter 2",
2522
+ globals: globalObject,
2523
+ });
2524
+ }
2525
+ args.push(curArg);
2526
+ }
2527
+ return $impl.has(...args);
2528
+ }
2529
+ set(name, value) {
2530
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "set");
2531
+ if (arguments.length < 2) {
2532
+ throw new globalObject.TypeError(`Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);
2533
+ }
2534
+ const args = [];
2535
+ {
2536
+ let curArg = arguments[0];
2537
+ curArg = conversions["USVString"](curArg, {
2538
+ context: "Failed to execute 'set' on 'URLSearchParams': parameter 1",
2539
+ globals: globalObject,
2540
+ });
2541
+ args.push(curArg);
2542
+ }
2543
+ {
2544
+ let curArg = arguments[1];
2545
+ curArg = conversions["USVString"](curArg, {
2546
+ context: "Failed to execute 'set' on 'URLSearchParams': parameter 2",
2547
+ globals: globalObject,
2548
+ });
2549
+ args.push(curArg);
2550
+ }
2551
+ return utils.tryWrapperForImpl($impl.set(...args));
2552
+ }
2553
+ sort() {
2554
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "sort");
2555
+ return utils.tryWrapperForImpl($impl.sort());
2556
+ }
2557
+ toString() {
2558
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "toString");
2559
+ return $impl.toString();
2560
+ }
2561
+ keys() {
2562
+ const $impl = $requireImpl(this, globalObject, "keys");
2563
+ return exports.createDefaultIterator(globalObject, $impl, "key");
2564
+ }
2565
+ values() {
2566
+ const $impl = $requireImpl(this, globalObject, "values");
2567
+ return exports.createDefaultIterator(globalObject, $impl, "value");
2568
+ }
2569
+ entries() {
2570
+ const $impl = $requireImpl(this, globalObject, "entries");
2571
+ return exports.createDefaultIterator(globalObject, $impl, "key+value");
2572
+ }
2573
+ forEach(callback) {
2574
+ const $impl = $requireImpl(this, globalObject, "forEach");
2575
+ if (arguments.length < 1) {
2576
+ throw new globalObject.TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.");
2577
+ }
2578
+ callback = Function2.convert(globalObject, callback, {
2579
+ context: "Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1",
2580
+ });
2581
+ const thisArg = arguments[1];
2582
+ let pairs = Array.from($impl);
2583
+ let i = 0;
2584
+ while (i < pairs.length) {
2585
+ const [key, value] = pairs[i].map(utils.tryWrapperForImpl);
2586
+ callback.call(thisArg, value, key, this);
2587
+ pairs = Array.from($impl);
2588
+ i++;
2589
+ }
2590
+ }
2591
+ get size() {
2592
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get size");
2593
+ return $impl["size"];
2594
+ }
2595
+ }
2596
+ Object.defineProperties(URLSearchParams2.prototype, {
2597
+ append: { enumerable: true },
2598
+ delete: { enumerable: true },
2599
+ get: { enumerable: true },
2600
+ getAll: { enumerable: true },
2601
+ has: { enumerable: true },
2602
+ set: { enumerable: true },
2603
+ sort: { enumerable: true },
2604
+ toString: { enumerable: true },
2605
+ keys: { enumerable: true },
2606
+ values: { enumerable: true },
2607
+ entries: { enumerable: true },
2608
+ forEach: { enumerable: true },
2609
+ size: { enumerable: true },
2610
+ [Symbol.toStringTag]: { value: "URLSearchParams", configurable: true },
2611
+ [Symbol.iterator]: {
2612
+ value: URLSearchParams2.prototype.entries,
2613
+ configurable: true,
2614
+ writable: true,
2615
+ },
2616
+ });
2617
+ ctorRegistry[interfaceName] = URLSearchParams2;
2618
+ ctorRegistry["URLSearchParams Iterator"] = Object.create(ctorRegistry["%IteratorPrototype%"], {
2619
+ [Symbol.toStringTag]: {
2620
+ configurable: true,
2621
+ value: "URLSearchParams Iterator",
2622
+ },
2623
+ });
2624
+ utils.define(ctorRegistry["URLSearchParams Iterator"], {
2625
+ next() {
2626
+ const internal = this && this[utils.iterInternalSymbol];
2627
+ if (!internal) {
2628
+ throw new globalObject.TypeError("next() called on a value that is not a URLSearchParams iterator object");
2629
+ }
2630
+ const { target, kind, index } = internal;
2631
+ const values = Array.from(target);
2632
+ const len = values.length;
2633
+ if (index >= len) {
2634
+ return newObjectInRealm(globalObject, {
2635
+ value: void 0,
2636
+ done: true,
2637
+ });
2638
+ }
2639
+ const pair = values[index];
2640
+ internal.index = index + 1;
2641
+ return newObjectInRealm(globalObject, utils.iteratorResult(pair.map(utils.tryWrapperForImpl), kind));
2642
+ },
2643
+ });
2644
+ Object.defineProperty(globalObject, interfaceName, {
2645
+ configurable: true,
2646
+ writable: true,
2647
+ value: URLSearchParams2,
2648
+ });
2649
+ };
2650
+ var Impl = require_URLSearchParams_impl();
2651
+ },
2652
+ });
2653
+ // node_modules/whatwg-url/lib/URL-impl.js
2654
+ var require_URL_impl = __commonJS({
2655
+ "node_modules/whatwg-url/lib/URL-impl.js"(exports) {
2656
+ "use strict";
2657
+ var usm = require_url_state_machine();
2658
+ var urlencoded = require_urlencoded();
2659
+ var URLSearchParams2 = require_URLSearchParams();
2660
+ var URL3 = require_URL();
2661
+ exports.implementation = class URLImpl {
2662
+ // Unlike the spec, we duplicate some code between the constructor and canParse, because we want to give useful error
2663
+ // messages in the constructor that distinguish between the different causes of failure.
2664
+ constructor(globalObject, [url, base]) {
2665
+ let parsedBase = null;
2666
+ if (base !== void 0) {
2667
+ parsedBase = usm.basicURLParse(base);
2668
+ if (parsedBase === null) {
2669
+ throw new TypeError(`Invalid base URL: ${base}`);
2670
+ }
2671
+ }
2672
+ const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });
2673
+ if (parsedURL === null) {
2674
+ throw new TypeError(`Invalid URL: ${url}`);
2675
+ }
2676
+ const query = parsedURL.query !== null ? parsedURL.query : "";
2677
+ this._url = parsedURL;
2678
+ this._query = URLSearchParams2.createImpl(globalObject, [query], {
2679
+ doNotStripQMark: true,
2680
+ });
2681
+ this._query._url = this;
2682
+ }
2683
+ static parse(globalObject, input, base) {
2684
+ try {
2685
+ return URL3.createImpl(globalObject, [input, base]);
2686
+ }
2687
+ catch {
2688
+ return null;
2689
+ }
2690
+ }
2691
+ static canParse(url, base) {
2692
+ let parsedBase = null;
2693
+ if (base !== void 0) {
2694
+ parsedBase = usm.basicURLParse(base);
2695
+ if (parsedBase === null) {
2696
+ return false;
2697
+ }
2698
+ }
2699
+ const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });
2700
+ if (parsedURL === null) {
2701
+ return false;
2702
+ }
2703
+ return true;
2704
+ }
2705
+ get href() {
2706
+ return usm.serializeURL(this._url);
2707
+ }
2708
+ set href(v) {
2709
+ const parsedURL = usm.basicURLParse(v);
2710
+ if (parsedURL === null) {
2711
+ throw new TypeError(`Invalid URL: ${v}`);
2712
+ }
2713
+ this._url = parsedURL;
2714
+ this._query._list.splice(0);
2715
+ const { query } = parsedURL;
2716
+ if (query !== null) {
2717
+ this._query._list = urlencoded.parseUrlencodedString(query);
2718
+ }
2719
+ }
2720
+ get origin() {
2721
+ return usm.serializeURLOrigin(this._url);
2722
+ }
2723
+ get protocol() {
2724
+ return `${this._url.scheme}:`;
2725
+ }
2726
+ set protocol(v) {
2727
+ usm.basicURLParse(`${v}:`, {
2728
+ url: this._url,
2729
+ stateOverride: "scheme start",
2730
+ });
2731
+ }
2732
+ get username() {
2733
+ return this._url.username;
2734
+ }
2735
+ set username(v) {
2736
+ if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
2737
+ return;
2738
+ }
2739
+ usm.setTheUsername(this._url, v);
2740
+ }
2741
+ get password() {
2742
+ return this._url.password;
2743
+ }
2744
+ set password(v) {
2745
+ if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
2746
+ return;
2747
+ }
2748
+ usm.setThePassword(this._url, v);
2749
+ }
2750
+ get host() {
2751
+ const url = this._url;
2752
+ if (url.host === null) {
2753
+ return "";
2754
+ }
2755
+ if (url.port === null) {
2756
+ return usm.serializeHost(url.host);
2757
+ }
2758
+ return `${usm.serializeHost(url.host)}:${usm.serializeInteger(url.port)}`;
2759
+ }
2760
+ set host(v) {
2761
+ if (usm.hasAnOpaquePath(this._url)) {
2762
+ return;
2763
+ }
2764
+ usm.basicURLParse(v, { url: this._url, stateOverride: "host" });
2765
+ }
2766
+ get hostname() {
2767
+ if (this._url.host === null) {
2768
+ return "";
2769
+ }
2770
+ return usm.serializeHost(this._url.host);
2771
+ }
2772
+ set hostname(v) {
2773
+ if (usm.hasAnOpaquePath(this._url)) {
2774
+ return;
2775
+ }
2776
+ usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" });
2777
+ }
2778
+ get port() {
2779
+ if (this._url.port === null) {
2780
+ return "";
2781
+ }
2782
+ return usm.serializeInteger(this._url.port);
2783
+ }
2784
+ set port(v) {
2785
+ if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
2786
+ return;
2787
+ }
2788
+ if (v === "") {
2789
+ this._url.port = null;
2790
+ }
2791
+ else {
2792
+ usm.basicURLParse(v, { url: this._url, stateOverride: "port" });
2793
+ }
2794
+ }
2795
+ get pathname() {
2796
+ return usm.serializePath(this._url);
2797
+ }
2798
+ set pathname(v) {
2799
+ if (usm.hasAnOpaquePath(this._url)) {
2800
+ return;
2801
+ }
2802
+ this._url.path = [];
2803
+ usm.basicURLParse(v, { url: this._url, stateOverride: "path start" });
2804
+ }
2805
+ get search() {
2806
+ if (this._url.query === null || this._url.query === "") {
2807
+ return "";
2808
+ }
2809
+ return `?${this._url.query}`;
2810
+ }
2811
+ set search(v) {
2812
+ const url = this._url;
2813
+ if (v === "") {
2814
+ url.query = null;
2815
+ this._query._list = [];
2816
+ return;
2817
+ }
2818
+ const input = v[0] === "?" ? v.substring(1) : v;
2819
+ url.query = "";
2820
+ usm.basicURLParse(input, { url, stateOverride: "query" });
2821
+ this._query._list = urlencoded.parseUrlencodedString(url.query);
2822
+ }
2823
+ get searchParams() {
2824
+ return this._query;
2825
+ }
2826
+ get hash() {
2827
+ if (this._url.fragment === null || this._url.fragment === "") {
2828
+ return "";
2829
+ }
2830
+ return `#${this._url.fragment}`;
2831
+ }
2832
+ set hash(v) {
2833
+ if (v === "") {
2834
+ this._url.fragment = null;
2835
+ return;
2836
+ }
2837
+ const input = v[0] === "#" ? v.substring(1) : v;
2838
+ this._url.fragment = "";
2839
+ usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" });
2840
+ }
2841
+ toJSON() {
2842
+ return this.href;
2843
+ }
2844
+ };
2845
+ },
2846
+ });
2847
+ // node_modules/whatwg-url/lib/URL.js
2848
+ var require_URL = __commonJS({
2849
+ "node_modules/whatwg-url/lib/URL.js"(exports) {
2850
+ "use strict";
2851
+ var conversions = (init_webidl_conversions(), __toCommonJS(webidl_conversions_exports));
2852
+ var utils = require_utils();
2853
+ var ctorRegistrySymbol = utils.ctorRegistrySymbol;
2854
+ var interfaceName = "URL";
2855
+ var $interfaceDescriptor = utils.createInterfaceDescriptor();
2856
+ exports.interfaceDescriptor = $interfaceDescriptor;
2857
+ function $requireImpl(wrapper, globalObject, context) {
2858
+ return utils.requireImplForWrapper(wrapper, $interfaceDescriptor, globalObject, interfaceName, context);
2859
+ }
2860
+ exports.is = (value) => {
2861
+ return (utils.implForWrapperWithInterface(value, $interfaceDescriptor) !== null);
2862
+ };
2863
+ exports.isImpl = (value) => {
2864
+ return utils.isObject(value) && value instanceof Impl.implementation;
2865
+ };
2866
+ exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
2867
+ const impl = utils.implForWrapperWithInterface(value, $interfaceDescriptor);
2868
+ if (impl !== null) {
2869
+ return impl;
2870
+ }
2871
+ throw new globalObject.TypeError(`${context} is not of type 'URL'.`);
2872
+ };
2873
+ function makeWrapper(globalObject, newTarget) {
2874
+ let proto;
2875
+ if (newTarget !== void 0) {
2876
+ proto = newTarget.prototype;
2877
+ }
2878
+ if (!utils.isObject(proto)) {
2879
+ proto = globalObject[ctorRegistrySymbol]["URL"].prototype;
2880
+ }
2881
+ return Object.create(proto);
2882
+ }
2883
+ exports.create = (globalObject, constructorArgs, privateData) => {
2884
+ const wrapper = makeWrapper(globalObject);
2885
+ return exports.setup(wrapper, globalObject, constructorArgs, privateData);
2886
+ };
2887
+ exports.createImpl = (globalObject, constructorArgs, privateData) => {
2888
+ const wrapper = exports.create(globalObject, constructorArgs, privateData);
2889
+ return utils.implForWrapper(wrapper);
2890
+ };
2891
+ exports._internalSetup = (wrapper, globalObject) => { };
2892
+ exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
2893
+ privateData.wrapper = wrapper;
2894
+ exports._internalSetup(wrapper, globalObject);
2895
+ const impl = new Impl.implementation(globalObject, constructorArgs, privateData);
2896
+ utils.registerWrapper(wrapper, impl, $interfaceDescriptor);
2897
+ impl[utils.wrapperSymbol] = wrapper;
2898
+ if (Impl.init) {
2899
+ Impl.init(impl);
2900
+ }
2901
+ return wrapper;
2902
+ };
2903
+ exports.new = (globalObject, newTarget) => {
2904
+ const wrapper = makeWrapper(globalObject, newTarget);
2905
+ exports._internalSetup(wrapper, globalObject);
2906
+ const impl = Object.create(Impl.implementation.prototype);
2907
+ utils.registerWrapper(wrapper, impl, $interfaceDescriptor);
2908
+ impl[utils.wrapperSymbol] = wrapper;
2909
+ if (Impl.init) {
2910
+ Impl.init(impl);
2911
+ }
2912
+ return impl;
2913
+ };
2914
+ var exposed = /* @__PURE__ */ new Set(["Window", "Worker"]);
2915
+ exports.install = (globalObject, globalNames) => {
2916
+ if (!globalNames.some((globalName) => exposed.has(globalName))) {
2917
+ return;
2918
+ }
2919
+ const ctorRegistry = utils.initCtorRegistry(globalObject);
2920
+ class URL3 {
2921
+ constructor(url) {
2922
+ if (arguments.length < 1) {
2923
+ throw new globalObject.TypeError(`Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`);
2924
+ }
2925
+ const args = [];
2926
+ {
2927
+ let curArg = arguments[0];
2928
+ curArg = conversions["USVString"](curArg, {
2929
+ context: "Failed to construct 'URL': parameter 1",
2930
+ globals: globalObject,
2931
+ });
2932
+ args.push(curArg);
2933
+ }
2934
+ {
2935
+ let curArg = arguments[1];
2936
+ if (curArg !== void 0) {
2937
+ curArg = conversions["USVString"](curArg, {
2938
+ context: "Failed to construct 'URL': parameter 2",
2939
+ globals: globalObject,
2940
+ });
2941
+ }
2942
+ args.push(curArg);
2943
+ }
2944
+ return exports.setup(Object.create(new.target.prototype), globalObject, args);
2945
+ }
2946
+ toJSON() {
2947
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "toJSON");
2948
+ return $impl.toJSON();
2949
+ }
2950
+ get href() {
2951
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get href");
2952
+ return $impl["href"];
2953
+ }
2954
+ set href(V) {
2955
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "set href");
2956
+ V = conversions["USVString"](V, {
2957
+ context: "Failed to set the 'href' property on 'URL': The provided value",
2958
+ globals: globalObject,
2959
+ });
2960
+ $impl["href"] = V;
2961
+ }
2962
+ toString() {
2963
+ const $impl = $requireImpl(this, globalObject, "toString");
2964
+ return $impl["href"];
2965
+ }
2966
+ get origin() {
2967
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get origin");
2968
+ return $impl["origin"];
2969
+ }
2970
+ get protocol() {
2971
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get protocol");
2972
+ return $impl["protocol"];
2973
+ }
2974
+ set protocol(V) {
2975
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "set protocol");
2976
+ V = conversions["USVString"](V, {
2977
+ context: "Failed to set the 'protocol' property on 'URL': The provided value",
2978
+ globals: globalObject,
2979
+ });
2980
+ $impl["protocol"] = V;
2981
+ }
2982
+ get username() {
2983
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get username");
2984
+ return $impl["username"];
2985
+ }
2986
+ set username(V) {
2987
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "set username");
2988
+ V = conversions["USVString"](V, {
2989
+ context: "Failed to set the 'username' property on 'URL': The provided value",
2990
+ globals: globalObject,
2991
+ });
2992
+ $impl["username"] = V;
2993
+ }
2994
+ get password() {
2995
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get password");
2996
+ return $impl["password"];
2997
+ }
2998
+ set password(V) {
2999
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "set password");
3000
+ V = conversions["USVString"](V, {
3001
+ context: "Failed to set the 'password' property on 'URL': The provided value",
3002
+ globals: globalObject,
3003
+ });
3004
+ $impl["password"] = V;
3005
+ }
3006
+ get host() {
3007
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get host");
3008
+ return $impl["host"];
3009
+ }
3010
+ set host(V) {
3011
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "set host");
3012
+ V = conversions["USVString"](V, {
3013
+ context: "Failed to set the 'host' property on 'URL': The provided value",
3014
+ globals: globalObject,
3015
+ });
3016
+ $impl["host"] = V;
3017
+ }
3018
+ get hostname() {
3019
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get hostname");
3020
+ return $impl["hostname"];
3021
+ }
3022
+ set hostname(V) {
3023
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "set hostname");
3024
+ V = conversions["USVString"](V, {
3025
+ context: "Failed to set the 'hostname' property on 'URL': The provided value",
3026
+ globals: globalObject,
3027
+ });
3028
+ $impl["hostname"] = V;
3029
+ }
3030
+ get port() {
3031
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get port");
3032
+ return $impl["port"];
3033
+ }
3034
+ set port(V) {
3035
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "set port");
3036
+ V = conversions["USVString"](V, {
3037
+ context: "Failed to set the 'port' property on 'URL': The provided value",
3038
+ globals: globalObject,
3039
+ });
3040
+ $impl["port"] = V;
3041
+ }
3042
+ get pathname() {
3043
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get pathname");
3044
+ return $impl["pathname"];
3045
+ }
3046
+ set pathname(V) {
3047
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "set pathname");
3048
+ V = conversions["USVString"](V, {
3049
+ context: "Failed to set the 'pathname' property on 'URL': The provided value",
3050
+ globals: globalObject,
3051
+ });
3052
+ $impl["pathname"] = V;
3053
+ }
3054
+ get search() {
3055
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get search");
3056
+ return $impl["search"];
3057
+ }
3058
+ set search(V) {
3059
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "set search");
3060
+ V = conversions["USVString"](V, {
3061
+ context: "Failed to set the 'search' property on 'URL': The provided value",
3062
+ globals: globalObject,
3063
+ });
3064
+ $impl["search"] = V;
3065
+ }
3066
+ get searchParams() {
3067
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get searchParams");
3068
+ return utils.getSameObject(this, "searchParams", () => {
3069
+ return utils.tryWrapperForImpl($impl["searchParams"]);
3070
+ });
3071
+ }
3072
+ get hash() {
3073
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "get hash");
3074
+ return $impl["hash"];
3075
+ }
3076
+ set hash(V) {
3077
+ const $impl = $requireImpl(this ?? globalObject, globalObject, "set hash");
3078
+ V = conversions["USVString"](V, {
3079
+ context: "Failed to set the 'hash' property on 'URL': The provided value",
3080
+ globals: globalObject,
3081
+ });
3082
+ $impl["hash"] = V;
3083
+ }
3084
+ static parse(url) {
3085
+ if (arguments.length < 1) {
3086
+ throw new globalObject.TypeError(`Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.`);
3087
+ }
3088
+ const args = [];
3089
+ {
3090
+ let curArg = arguments[0];
3091
+ curArg = conversions["USVString"](curArg, {
3092
+ context: "Failed to execute 'parse' on 'URL': parameter 1",
3093
+ globals: globalObject,
3094
+ });
3095
+ args.push(curArg);
3096
+ }
3097
+ {
3098
+ let curArg = arguments[1];
3099
+ if (curArg !== void 0) {
3100
+ curArg = conversions["USVString"](curArg, {
3101
+ context: "Failed to execute 'parse' on 'URL': parameter 2",
3102
+ globals: globalObject,
3103
+ });
3104
+ }
3105
+ args.push(curArg);
3106
+ }
3107
+ return utils.tryWrapperForImpl(Impl.implementation.parse(globalObject, ...args));
3108
+ }
3109
+ static canParse(url) {
3110
+ if (arguments.length < 1) {
3111
+ throw new globalObject.TypeError(`Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.`);
3112
+ }
3113
+ const args = [];
3114
+ {
3115
+ let curArg = arguments[0];
3116
+ curArg = conversions["USVString"](curArg, {
3117
+ context: "Failed to execute 'canParse' on 'URL': parameter 1",
3118
+ globals: globalObject,
3119
+ });
3120
+ args.push(curArg);
3121
+ }
3122
+ {
3123
+ let curArg = arguments[1];
3124
+ if (curArg !== void 0) {
3125
+ curArg = conversions["USVString"](curArg, {
3126
+ context: "Failed to execute 'canParse' on 'URL': parameter 2",
3127
+ globals: globalObject,
3128
+ });
3129
+ }
3130
+ args.push(curArg);
3131
+ }
3132
+ return Impl.implementation.canParse(...args);
3133
+ }
3134
+ }
3135
+ Object.defineProperties(URL3.prototype, {
3136
+ toJSON: { enumerable: true },
3137
+ href: { enumerable: true },
3138
+ toString: { enumerable: true },
3139
+ origin: { enumerable: true },
3140
+ protocol: { enumerable: true },
3141
+ username: { enumerable: true },
3142
+ password: { enumerable: true },
3143
+ host: { enumerable: true },
3144
+ hostname: { enumerable: true },
3145
+ port: { enumerable: true },
3146
+ pathname: { enumerable: true },
3147
+ search: { enumerable: true },
3148
+ searchParams: { enumerable: true },
3149
+ hash: { enumerable: true },
3150
+ [Symbol.toStringTag]: { value: "URL", configurable: true },
3151
+ });
3152
+ Object.defineProperties(URL3, {
3153
+ parse: { enumerable: true },
3154
+ canParse: { enumerable: true },
3155
+ });
3156
+ ctorRegistry[interfaceName] = URL3;
3157
+ Object.defineProperty(globalObject, interfaceName, {
3158
+ configurable: true,
3159
+ writable: true,
3160
+ value: URL3,
3161
+ });
3162
+ if (globalNames.includes("Window")) {
3163
+ Object.defineProperty(globalObject, "webkitURL", {
3164
+ configurable: true,
3165
+ writable: true,
3166
+ value: URL3,
3167
+ });
3168
+ }
3169
+ };
3170
+ var Impl = require_URL_impl();
3171
+ },
3172
+ });
3173
+ // node_modules/whatwg-url/webidl2js-wrapper.js
3174
+ var require_webidl2js_wrapper = __commonJS({
3175
+ "node_modules/whatwg-url/webidl2js-wrapper.js"(exports) {
3176
+ "use strict";
3177
+ var URL3 = require_URL();
3178
+ var URLSearchParams2 = require_URLSearchParams();
3179
+ exports.URL = URL3;
3180
+ exports.URLSearchParams = URLSearchParams2;
3181
+ },
3182
+ });
3183
+ // <stdin>
3184
+ var wrappers = __toESM(require_webidl2js_wrapper());
3185
+ var scope = { Array, Object, Promise, String, TypeError };
3186
+ wrappers.URL.install(scope, ["Window"]);
3187
+ wrappers.URLSearchParams.install(scope, ["Window"]);
3188
+ var URL2 = scope.URL;
3189
+ export { URL2 as URL };