@zuplo/cli 6.69.4 → 6.69.5

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 (333) hide show
  1. package/dist/__tests__/integration/jest-mocks-setup.js +29 -10
  2. package/dist/__tests__/integration/jest-mocks-setup.js.map +1 -1
  3. package/dist/cmds/custom-domain/index.d.ts.map +1 -1
  4. package/dist/cmds/custom-domain/index.js +6 -10
  5. package/dist/cmds/custom-domain/index.js.map +1 -1
  6. package/dist/cmds/mtls-certificates/index.d.ts.map +1 -1
  7. package/dist/cmds/mtls-certificates/index.js +8 -12
  8. package/dist/cmds/mtls-certificates/index.js.map +1 -1
  9. package/dist/cmds/open-api/index.d.ts.map +1 -1
  10. package/dist/cmds/open-api/index.js +2 -5
  11. package/dist/cmds/open-api/index.js.map +1 -1
  12. package/dist/cmds/project/index.d.ts.map +1 -1
  13. package/dist/cmds/project/index.js +2 -5
  14. package/dist/cmds/project/index.js.map +1 -1
  15. package/dist/cmds/proxies/index.d.ts +4 -4
  16. package/dist/cmds/proxies/index.d.ts.map +1 -1
  17. package/dist/cmds/proxies/index.js +6 -10
  18. package/dist/cmds/proxies/index.js.map +1 -1
  19. package/dist/cmds/source/index.d.ts.map +1 -1
  20. package/dist/cmds/source/index.js +2 -9
  21. package/dist/cmds/source/index.js.map +1 -1
  22. package/dist/cmds/source/migrate.d.ts +4 -4
  23. package/dist/cmds/source/migrate.d.ts.map +1 -1
  24. package/dist/cmds/source/migrate.js +3 -6
  25. package/dist/cmds/source/migrate.js.map +1 -1
  26. package/dist/cmds/tunnel/index.d.ts.map +1 -1
  27. package/dist/cmds/tunnel/index.js +8 -12
  28. package/dist/cmds/tunnel/index.js.map +1 -1
  29. package/dist/cmds/tunnel/services/index.d.ts.map +1 -1
  30. package/dist/cmds/tunnel/services/index.js +2 -5
  31. package/dist/cmds/tunnel/services/index.js.map +1 -1
  32. package/dist/cmds/variable/index.d.ts.map +1 -1
  33. package/dist/cmds/variable/index.js +2 -5
  34. package/dist/cmds/variable/index.js.map +1 -1
  35. package/dist/common/handler.d.ts +4 -1
  36. package/dist/common/handler.d.ts.map +1 -1
  37. package/dist/common/handler.js +11 -2
  38. package/dist/common/handler.js.map +1 -1
  39. package/dist/common/middleware/get-environment-param.d.ts.map +1 -1
  40. package/dist/common/middleware/get-environment-param.js +2 -18
  41. package/dist/common/middleware/get-environment-param.js.map +1 -1
  42. package/dist/common/utils/build-environment-prompt-choices.d.ts +13 -0
  43. package/dist/common/utils/build-environment-prompt-choices.d.ts.map +1 -0
  44. package/dist/common/utils/build-environment-prompt-choices.js +66 -0
  45. package/dist/common/utils/build-environment-prompt-choices.js.map +1 -0
  46. package/dist/common/utils/build-environment-prompt-choices.test.d.ts +2 -0
  47. package/dist/common/utils/build-environment-prompt-choices.test.d.ts.map +1 -0
  48. package/dist/common/utils/build-environment-prompt-choices.test.js +97 -0
  49. package/dist/common/utils/build-environment-prompt-choices.test.js.map +1 -0
  50. package/dist/common/utils/pretty-print-environment-prompt.d.ts +1 -4
  51. package/dist/common/utils/pretty-print-environment-prompt.d.ts.map +1 -1
  52. package/dist/common/utils/pretty-print-environment-prompt.js +3 -8
  53. package/dist/common/utils/pretty-print-environment-prompt.js.map +1 -1
  54. package/dist/common/utils/pretty-print-environment-prompt.test.js +15 -17
  55. package/dist/common/utils/pretty-print-environment-prompt.test.js.map +1 -1
  56. package/dist/common/utils/sort-environments-for-prompt.d.ts +5 -0
  57. package/dist/common/utils/sort-environments-for-prompt.d.ts.map +1 -0
  58. package/dist/common/utils/sort-environments-for-prompt.js +27 -0
  59. package/dist/common/utils/sort-environments-for-prompt.js.map +1 -0
  60. package/dist/common/utils/sort-environments-for-prompt.test.d.ts +2 -0
  61. package/dist/common/utils/sort-environments-for-prompt.test.d.ts.map +1 -0
  62. package/dist/common/utils/sort-environments-for-prompt.test.js +82 -0
  63. package/dist/common/utils/sort-environments-for-prompt.test.js.map +1 -0
  64. package/dist/tsconfig.tsbuildinfo +1 -1
  65. package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/README.md +1 -5
  66. package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/ipaddr.min.js +1 -1
  67. package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/lib/ipaddr.js +21 -6
  68. package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/package.json +1 -1
  69. package/node_modules/@zuplo/core/index.minified.js +141 -137
  70. package/node_modules/@zuplo/core/package.json +1 -1
  71. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/workflows/ci.yml +1 -1
  72. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/workflows/lock-threads.yml +19 -0
  73. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/LICENSE +1 -3
  74. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/benchmark/bench-cmp-lib.js +60 -44
  75. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/index.js +2 -2
  76. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/package.json +7 -7
  77. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/anyof.test.js +20 -0
  78. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/array.test.js +22 -0
  79. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/debug-mode.test.js +21 -0
  80. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/if-then-else.test.js +72 -0
  81. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/invalidSchema.test.js +20 -0
  82. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/issue-836.test.js +183 -0
  83. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/json-add-comma.test.js +57 -57
  84. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/oneof.test.js +20 -0
  85. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/ref.test.js +31 -0
  86. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/typebox.test.js +1 -1
  87. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/types/{index.test-d.ts → index.tst.ts} +17 -17
  88. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +1 -0
  89. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +1 -0
  90. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +5 -0
  91. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
  92. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +1380 -0
  93. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -0
  94. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js +1686 -0
  95. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -0
  96. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
  97. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +7 -0
  98. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +12 -0
  99. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -0
  100. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js +11 -0
  101. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -0
  102. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +1 -0
  103. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
  104. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +2 -2
  105. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +4 -7
  106. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts +2 -3
  107. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
  108. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js +10 -16
  109. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
  110. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
  111. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js.map +4 -4
  112. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +1 -0
  113. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +1 -0
  114. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +5 -0
  115. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
  116. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts +1380 -0
  117. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -0
  118. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js +1686 -0
  119. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -0
  120. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
  121. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +7 -0
  122. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +12 -0
  123. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -0
  124. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js +11 -0
  125. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -0
  126. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts +12 -0
  127. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -0
  128. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js +11 -0
  129. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -0
  130. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +1 -0
  131. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +1 -0
  132. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +1 -1
  133. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +1 -1
  134. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts +2 -3
  135. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
  136. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js +9 -15
  137. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
  138. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
  139. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js.map +4 -4
  140. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts +12 -0
  141. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -0
  142. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js +8 -0
  143. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -0
  144. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -1
  145. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +1 -1
  146. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts +2 -3
  147. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
  148. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js +9 -15
  149. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js.map +1 -1
  150. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js +1 -1
  151. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js.map +4 -4
  152. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +1 -0
  153. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +1 -0
  154. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +1 -1
  155. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +2 -3
  156. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts +2 -3
  157. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
  158. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js +9 -15
  159. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
  160. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
  161. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js.map +4 -4
  162. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts +12 -0
  163. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -0
  164. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js +8 -0
  165. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -0
  166. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts +12 -0
  167. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -0
  168. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js +8 -0
  169. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js.map +1 -0
  170. package/node_modules/@zuplo/editor/node_modules/lru-cache/package.json +44 -16
  171. package/node_modules/@zuplo/graphql/package.json +1 -1
  172. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  173. package/node_modules/@zuplo/otel/package.json +1 -1
  174. package/node_modules/@zuplo/runtime/out/esm/index.js +54 -54
  175. package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
  176. package/node_modules/@zuplo/runtime/out/types/index.d.ts +4 -0
  177. package/node_modules/@zuplo/runtime/package.json +1 -1
  178. package/node_modules/axios/CHANGELOG.md +32 -6
  179. package/node_modules/axios/README.md +356 -20
  180. package/node_modules/axios/dist/axios.js +1389 -1071
  181. package/node_modules/axios/dist/axios.js.map +1 -1
  182. package/node_modules/axios/dist/axios.min.js +3 -3
  183. package/node_modules/axios/dist/axios.min.js.map +1 -1
  184. package/node_modules/axios/dist/browser/axios.cjs +1486 -1123
  185. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  186. package/node_modules/axios/dist/esm/axios.js +1488 -1124
  187. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  188. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  189. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  190. package/node_modules/axios/dist/node/axios.cjs +1230 -871
  191. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  192. package/node_modules/axios/index.d.cts +25 -13
  193. package/node_modules/axios/index.d.ts +21 -4
  194. package/node_modules/axios/index.js +2 -0
  195. package/node_modules/axios/lib/adapters/adapters.js +4 -2
  196. package/node_modules/axios/lib/adapters/fetch.js +126 -10
  197. package/node_modules/axios/lib/adapters/http.js +178 -59
  198. package/node_modules/axios/lib/adapters/xhr.js +6 -2
  199. package/node_modules/axios/lib/core/Axios.js +7 -3
  200. package/node_modules/axios/lib/core/AxiosError.js +86 -1
  201. package/node_modules/axios/lib/core/AxiosHeaders.js +3 -0
  202. package/node_modules/axios/lib/core/dispatchRequest.js +19 -7
  203. package/node_modules/axios/lib/core/mergeConfig.js +6 -3
  204. package/node_modules/axios/lib/core/settle.js +7 -11
  205. package/node_modules/axios/lib/defaults/index.js +1 -1
  206. package/node_modules/axios/lib/env/data.js +1 -1
  207. package/node_modules/axios/lib/helpers/buildURL.js +1 -1
  208. package/node_modules/axios/lib/helpers/cookies.js +14 -2
  209. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +28 -1
  210. package/node_modules/axios/lib/helpers/formDataToStream.js +1 -1
  211. package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
  212. package/node_modules/axios/lib/helpers/resolveConfig.js +33 -17
  213. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +26 -1
  214. package/node_modules/axios/lib/helpers/validator.js +1 -1
  215. package/node_modules/axios/lib/utils.js +27 -15
  216. package/node_modules/axios/package.json +17 -24
  217. package/node_modules/fast-uri/.github/workflows/ci.yml +12 -7
  218. package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
  219. package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +1 -1
  220. package/node_modules/fast-uri/LICENSE +1 -3
  221. package/node_modules/fast-uri/README.md +13 -4
  222. package/node_modules/fast-uri/index.js +90 -24
  223. package/node_modules/fast-uri/lib/utils.js +129 -22
  224. package/node_modules/fast-uri/package.json +3 -4
  225. package/node_modules/fast-uri/test/equal.test.js +9 -0
  226. package/node_modules/fast-uri/test/parse.test.js +5 -0
  227. package/node_modules/fast-uri/test/resolve.test.js +9 -0
  228. package/node_modules/fast-uri/test/security-normalization.test.js +39 -0
  229. package/node_modules/fast-uri/test/security.test.js +133 -0
  230. package/node_modules/is-core-module/CHANGELOG.md +244 -113
  231. package/node_modules/is-core-module/README.md +1 -1
  232. package/node_modules/is-core-module/core.json +12 -12
  233. package/node_modules/is-core-module/package.json +5 -5
  234. package/node_modules/is-core-module/test/index.js +101 -0
  235. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +1 -0
  236. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +1 -0
  237. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +5 -0
  238. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
  239. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +1380 -0
  240. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -0
  241. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js +1686 -0
  242. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -0
  243. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
  244. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +7 -0
  245. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +12 -0
  246. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -0
  247. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js +11 -0
  248. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -0
  249. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +1 -0
  250. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
  251. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +2 -2
  252. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +4 -7
  253. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts +2 -3
  254. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
  255. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js +10 -16
  256. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
  257. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
  258. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js.map +4 -4
  259. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +1 -0
  260. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +1 -0
  261. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +5 -0
  262. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
  263. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts +1380 -0
  264. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -0
  265. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js +1686 -0
  266. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -0
  267. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
  268. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +7 -0
  269. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +12 -0
  270. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -0
  271. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js +11 -0
  272. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -0
  273. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts +12 -0
  274. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -0
  275. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js +11 -0
  276. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -0
  277. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +1 -0
  278. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +1 -0
  279. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +1 -1
  280. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +1 -1
  281. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts +2 -3
  282. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
  283. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js +9 -15
  284. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
  285. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
  286. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js.map +4 -4
  287. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts +12 -0
  288. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -0
  289. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js +8 -0
  290. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -0
  291. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -1
  292. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +1 -1
  293. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts +2 -3
  294. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
  295. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js +9 -15
  296. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js.map +1 -1
  297. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js +1 -1
  298. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js.map +4 -4
  299. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +1 -0
  300. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +1 -0
  301. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +1 -1
  302. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +2 -3
  303. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts +2 -3
  304. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
  305. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js +9 -15
  306. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
  307. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
  308. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js.map +4 -4
  309. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts +12 -0
  310. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -0
  311. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js +8 -0
  312. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -0
  313. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts +12 -0
  314. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -0
  315. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js +8 -0
  316. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js.map +1 -0
  317. package/node_modules/rimraf/node_modules/lru-cache/package.json +44 -16
  318. package/package.json +6 -6
  319. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/stale.yml +0 -21
  320. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts.map +0 -1
  321. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js.map +0 -1
  322. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.mts.map +0 -1
  323. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.mjs.map +0 -1
  324. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.mts.map +0 -1
  325. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.mjs.map +0 -1
  326. package/node_modules/fast-uri/.github/.stale.yml +0 -21
  327. package/node_modules/fast-uri/.github/tests_checker.yml +0 -8
  328. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts.map +0 -1
  329. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js.map +0 -1
  330. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.mts.map +0 -1
  331. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.mjs.map +0 -1
  332. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.mts.map +0 -1
  333. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- /*! Axios v1.15.2 Copyright (c) 2026 Matt Zabriskie and contributors */
1
+ /*! Axios v1.16.0 Copyright (c) 2026 Matt Zabriskie and contributors */
2
2
  'use strict';
3
3
 
4
4
  /**
@@ -204,9 +204,9 @@ const isFile = kindOfTest('File');
204
204
  * also have a `name` and `type` attribute to specify filename and content type
205
205
  *
206
206
  * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
207
- *
207
+ *
208
208
  * @param {*} value The value to test
209
- *
209
+ *
210
210
  * @returns {boolean} True if value is a React Native Blob, otherwise false
211
211
  */
212
212
  const isReactNativeBlob = (value) => {
@@ -216,9 +216,9 @@ const isReactNativeBlob = (value) => {
216
216
  /**
217
217
  * Determine if environment is React Native
218
218
  * ReactNative `FormData` has a non-standard `getParts()` method
219
- *
219
+ *
220
220
  * @param {*} formData The formData to test
221
- *
221
+ *
222
222
  * @returns {boolean} True if environment is React Native, otherwise false
223
223
  */
224
224
  const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
@@ -237,7 +237,7 @@ const isBlob = kindOfTest('Blob');
237
237
  *
238
238
  * @param {*} val The value to test
239
239
  *
240
- * @returns {boolean} True if value is a File, otherwise false
240
+ * @returns {boolean} True if value is a FileList, otherwise false
241
241
  */
242
242
  const isFileList = kindOfTest('FileList');
243
243
 
@@ -271,14 +271,16 @@ const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
271
271
  const isFormData = (thing) => {
272
272
  if (!thing) return false;
273
273
  if (FormDataCtor && thing instanceof FormDataCtor) return true;
274
- // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
274
+ // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
275
275
  const proto = getPrototypeOf(thing);
276
276
  if (!proto || proto === Object.prototype) return false;
277
277
  if (!isFunction$1(thing.append)) return false;
278
278
  const kind = kindOf(thing);
279
- return kind === 'formdata' ||
279
+ return (
280
+ kind === 'formdata' ||
280
281
  // detect form-data instance
281
- (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
282
+ (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
283
+ );
282
284
  };
283
285
 
284
286
  /**
@@ -413,7 +415,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
413
415
  *
414
416
  * @returns {Object} Result of all merge properties
415
417
  */
416
- function merge(/* obj1, obj2, obj3, ... */) {
418
+ function merge(...objs) {
417
419
  const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
418
420
  const result = {};
419
421
  const assignValue = (val, key) => {
@@ -423,8 +425,12 @@ function merge(/* obj1, obj2, obj3, ... */) {
423
425
  }
424
426
 
425
427
  const targetKey = (caseless && findKey(result, key)) || key;
426
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
427
- result[targetKey] = merge(result[targetKey], val);
428
+ // Read via own-prop only — a bare `result[targetKey]` walks the prototype
429
+ // chain, so a polluted Object.prototype value could surface here and get
430
+ // copied into the merged result.
431
+ const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
432
+ if (isPlainObject(existing) && isPlainObject(val)) {
433
+ result[targetKey] = merge(existing, val);
428
434
  } else if (isPlainObject(val)) {
429
435
  result[targetKey] = merge({}, val);
430
436
  } else if (isArray(val)) {
@@ -434,8 +440,8 @@ function merge(/* obj1, obj2, obj3, ... */) {
434
440
  }
435
441
  };
436
442
 
437
- for (let i = 0, l = arguments.length; i < l; i++) {
438
- arguments[i] && forEach(arguments[i], assignValue);
443
+ for (let i = 0, l = objs.length; i < l; i++) {
444
+ objs[i] && forEach(objs[i], assignValue);
439
445
  }
440
446
  return result;
441
447
  }
@@ -457,6 +463,9 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
457
463
  (val, key) => {
458
464
  if (thisArg && isFunction$1(val)) {
459
465
  Object.defineProperty(a, key, {
466
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
467
+ // hijack defineProperty's accessor-vs-data resolution.
468
+ __proto__: null,
460
469
  value: bind(val, thisArg),
461
470
  writable: true,
462
471
  enumerable: true,
@@ -464,6 +473,7 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
464
473
  });
465
474
  } else {
466
475
  Object.defineProperty(a, key, {
476
+ __proto__: null,
467
477
  value: val,
468
478
  writable: true,
469
479
  enumerable: true,
@@ -502,12 +512,14 @@ const stripBOM = (content) => {
502
512
  const inherits = (constructor, superConstructor, props, descriptors) => {
503
513
  constructor.prototype = Object.create(superConstructor.prototype, descriptors);
504
514
  Object.defineProperty(constructor.prototype, 'constructor', {
515
+ __proto__: null,
505
516
  value: constructor,
506
517
  writable: true,
507
518
  enumerable: false,
508
519
  configurable: true,
509
520
  });
510
521
  Object.defineProperty(constructor, 'super', {
522
+ __proto__: null,
511
523
  value: superConstructor.prototype,
512
524
  });
513
525
  props && Object.assign(constructor.prototype, props);
@@ -689,7 +701,7 @@ const reduceDescriptors = (obj, reducer) => {
689
701
  const freezeMethods = (obj) => {
690
702
  reduceDescriptors(obj, (descriptor, name) => {
691
703
  // skip restricted props in strict mode
692
- if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
704
+ if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
693
705
  return false;
694
706
  }
695
707
 
@@ -930,1311 +942,1398 @@ var utils$1 = {
930
942
  isIterable,
931
943
  };
932
944
 
933
- class AxiosError extends Error {
934
- static from(error, code, config, request, response, customProps) {
935
- const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
936
- axiosError.cause = error;
937
- axiosError.name = error.name;
945
+ // RawAxiosHeaders whose duplicates are ignored by node
946
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
947
+ const ignoreDuplicateOf = utils$1.toObjectSet([
948
+ 'age',
949
+ 'authorization',
950
+ 'content-length',
951
+ 'content-type',
952
+ 'etag',
953
+ 'expires',
954
+ 'from',
955
+ 'host',
956
+ 'if-modified-since',
957
+ 'if-unmodified-since',
958
+ 'last-modified',
959
+ 'location',
960
+ 'max-forwards',
961
+ 'proxy-authorization',
962
+ 'referer',
963
+ 'retry-after',
964
+ 'user-agent',
965
+ ]);
938
966
 
939
- // Preserve status from the original error if not already set from response
940
- if (error.status != null && axiosError.status == null) {
941
- axiosError.status = error.status;
942
- }
967
+ /**
968
+ * Parse headers into an object
969
+ *
970
+ * ```
971
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
972
+ * Content-Type: application/json
973
+ * Connection: keep-alive
974
+ * Transfer-Encoding: chunked
975
+ * ```
976
+ *
977
+ * @param {String} rawHeaders Headers needing to be parsed
978
+ *
979
+ * @returns {Object} Headers parsed into an object
980
+ */
981
+ var parseHeaders = (rawHeaders) => {
982
+ const parsed = {};
983
+ let key;
984
+ let val;
985
+ let i;
943
986
 
944
- customProps && Object.assign(axiosError, customProps);
945
- return axiosError;
946
- }
987
+ rawHeaders &&
988
+ rawHeaders.split('\n').forEach(function parser(line) {
989
+ i = line.indexOf(':');
990
+ key = line.substring(0, i).trim().toLowerCase();
991
+ val = line.substring(i + 1).trim();
947
992
 
948
- /**
949
- * Create an Error with the specified message, config, error code, request and response.
950
- *
951
- * @param {string} message The error message.
952
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
953
- * @param {Object} [config] The config.
954
- * @param {Object} [request] The request.
955
- * @param {Object} [response] The response.
956
- *
957
- * @returns {Error} The created error.
958
- */
959
- constructor(message, code, config, request, response) {
960
- super(message);
993
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
994
+ return;
995
+ }
961
996
 
962
- // Make message enumerable to maintain backward compatibility
963
- // The native Error constructor sets message as non-enumerable,
964
- // but axios < v1.13.3 had it as enumerable
965
- Object.defineProperty(this, 'message', {
966
- value: message,
967
- enumerable: true,
968
- writable: true,
969
- configurable: true,
997
+ if (key === 'set-cookie') {
998
+ if (parsed[key]) {
999
+ parsed[key].push(val);
1000
+ } else {
1001
+ parsed[key] = [val];
1002
+ }
1003
+ } else {
1004
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1005
+ }
970
1006
  });
971
1007
 
972
- this.name = 'AxiosError';
973
- this.isAxiosError = true;
974
- code && (this.code = code);
975
- config && (this.config = config);
976
- request && (this.request = request);
977
- if (response) {
978
- this.response = response;
979
- this.status = response.status;
1008
+ return parsed;
1009
+ };
1010
+
1011
+ const $internals = Symbol('internals');
1012
+
1013
+ const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
1014
+
1015
+ function trimSPorHTAB(str) {
1016
+ let start = 0;
1017
+ let end = str.length;
1018
+
1019
+ while (start < end) {
1020
+ const code = str.charCodeAt(start);
1021
+
1022
+ if (code !== 0x09 && code !== 0x20) {
1023
+ break;
980
1024
  }
981
- }
982
1025
 
983
- toJSON() {
984
- return {
985
- // Standard
986
- message: this.message,
987
- name: this.name,
988
- // Microsoft
989
- description: this.description,
990
- number: this.number,
991
- // Mozilla
992
- fileName: this.fileName,
993
- lineNumber: this.lineNumber,
994
- columnNumber: this.columnNumber,
995
- stack: this.stack,
996
- // Axios
997
- config: utils$1.toJSONObject(this.config),
998
- code: this.code,
999
- status: this.status,
1000
- };
1026
+ start += 1;
1001
1027
  }
1002
- }
1003
1028
 
1004
- // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
1005
- AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1006
- AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1007
- AxiosError.ECONNABORTED = 'ECONNABORTED';
1008
- AxiosError.ETIMEDOUT = 'ETIMEDOUT';
1009
- AxiosError.ERR_NETWORK = 'ERR_NETWORK';
1010
- AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1011
- AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
1012
- AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1013
- AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1014
- AxiosError.ERR_CANCELED = 'ERR_CANCELED';
1015
- AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1016
- AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
1017
- AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
1029
+ while (end > start) {
1030
+ const code = str.charCodeAt(end - 1);
1018
1031
 
1019
- // eslint-disable-next-line strict
1020
- var httpAdapter = null;
1032
+ if (code !== 0x09 && code !== 0x20) {
1033
+ break;
1034
+ }
1021
1035
 
1022
- /**
1023
- * Determines if the given thing is a array or js object.
1024
- *
1025
- * @param {string} thing - The object or array to be visited.
1026
- *
1027
- * @returns {boolean}
1028
- */
1029
- function isVisitable(thing) {
1030
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
1031
- }
1036
+ end -= 1;
1037
+ }
1032
1038
 
1033
- /**
1034
- * It removes the brackets from the end of a string
1035
- *
1036
- * @param {string} key - The key of the parameter.
1037
- *
1038
- * @returns {string} the key without the brackets.
1039
- */
1040
- function removeBrackets(key) {
1041
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
1039
+ return start === 0 && end === str.length ? str : str.slice(start, end);
1042
1040
  }
1043
1041
 
1044
- /**
1045
- * It takes a path, a key, and a boolean, and returns a string
1046
- *
1047
- * @param {string} path - The path to the current key.
1048
- * @param {string} key - The key of the current object being iterated over.
1049
- * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
1050
- *
1051
- * @returns {string} The path to the current key.
1052
- */
1053
- function renderKey(path, key, dots) {
1054
- if (!path) return key;
1055
- return path
1056
- .concat(key)
1057
- .map(function each(token, i) {
1058
- // eslint-disable-next-line no-param-reassign
1059
- token = removeBrackets(token);
1060
- return !dots && i ? '[' + token + ']' : token;
1061
- })
1062
- .join(dots ? '.' : '');
1042
+ function normalizeHeader(header) {
1043
+ return header && String(header).trim().toLowerCase();
1063
1044
  }
1064
1045
 
1065
- /**
1066
- * If the array is an array and none of its elements are visitable, then it's a flat array.
1067
- *
1068
- * @param {Array<any>} arr - The array to check
1069
- *
1070
- * @returns {boolean}
1071
- */
1072
- function isFlatArray(arr) {
1073
- return utils$1.isArray(arr) && !arr.some(isVisitable);
1046
+ function sanitizeHeaderValue(str) {
1047
+ return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
1074
1048
  }
1075
1049
 
1076
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
1077
- return /^is[A-Z]/.test(prop);
1078
- });
1079
-
1080
- /**
1081
- * Convert a data object to FormData
1082
- *
1083
- * @param {Object} obj
1084
- * @param {?Object} [formData]
1085
- * @param {?Object} [options]
1086
- * @param {Function} [options.visitor]
1087
- * @param {Boolean} [options.metaTokens = true]
1088
- * @param {Boolean} [options.dots = false]
1089
- * @param {?Boolean} [options.indexes = false]
1090
- *
1091
- * @returns {Object}
1092
- **/
1093
-
1094
- /**
1095
- * It converts an object into a FormData object
1096
- *
1097
- * @param {Object<any, any>} obj - The object to convert to form data.
1098
- * @param {string} formData - The FormData object to append to.
1099
- * @param {Object<string, any>} options
1100
- *
1101
- * @returns
1102
- */
1103
- function toFormData(obj, formData, options) {
1104
- if (!utils$1.isObject(obj)) {
1105
- throw new TypeError('target must be an object');
1050
+ function normalizeValue(value) {
1051
+ if (value === false || value == null) {
1052
+ return value;
1106
1053
  }
1107
1054
 
1108
- // eslint-disable-next-line no-param-reassign
1109
- formData = formData || new (FormData)();
1055
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
1056
+ }
1110
1057
 
1111
- // eslint-disable-next-line no-param-reassign
1112
- options = utils$1.toFlatObject(
1113
- options,
1114
- {
1115
- metaTokens: true,
1116
- dots: false,
1117
- indexes: false,
1118
- },
1119
- false,
1120
- function defined(option, source) {
1121
- // eslint-disable-next-line no-eq-null,eqeqeq
1122
- return !utils$1.isUndefined(source[option]);
1123
- }
1124
- );
1125
-
1126
- const metaTokens = options.metaTokens;
1127
- // eslint-disable-next-line no-use-before-define
1128
- const visitor = options.visitor || defaultVisitor;
1129
- const dots = options.dots;
1130
- const indexes = options.indexes;
1131
- const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
1132
- const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
1133
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
1058
+ function parseTokens(str) {
1059
+ const tokens = Object.create(null);
1060
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1061
+ let match;
1134
1062
 
1135
- if (!utils$1.isFunction(visitor)) {
1136
- throw new TypeError('visitor must be a function');
1063
+ while ((match = tokensRE.exec(str))) {
1064
+ tokens[match[1]] = match[2];
1137
1065
  }
1138
1066
 
1139
- function convertValue(value) {
1140
- if (value === null) return '';
1141
-
1142
- if (utils$1.isDate(value)) {
1143
- return value.toISOString();
1144
- }
1145
-
1146
- if (utils$1.isBoolean(value)) {
1147
- return value.toString();
1148
- }
1067
+ return tokens;
1068
+ }
1149
1069
 
1150
- if (!useBlob && utils$1.isBlob(value)) {
1151
- throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1152
- }
1070
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1153
1071
 
1154
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
1155
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1156
- }
1072
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1073
+ if (utils$1.isFunction(filter)) {
1074
+ return filter.call(this, value, header);
1075
+ }
1157
1076
 
1158
- return value;
1077
+ if (isHeaderNameFilter) {
1078
+ value = header;
1159
1079
  }
1160
1080
 
1161
- /**
1162
- * Default visitor.
1163
- *
1164
- * @param {*} value
1165
- * @param {String|Number} key
1166
- * @param {Array<String|Number>} path
1167
- * @this {FormData}
1168
- *
1169
- * @returns {boolean} return true to visit the each prop of the value recursively
1170
- */
1171
- function defaultVisitor(value, key, path) {
1172
- let arr = value;
1081
+ if (!utils$1.isString(value)) return;
1173
1082
 
1174
- if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
1175
- formData.append(renderKey(path, key, dots), convertValue(value));
1176
- return false;
1177
- }
1083
+ if (utils$1.isString(filter)) {
1084
+ return value.indexOf(filter) !== -1;
1085
+ }
1178
1086
 
1179
- if (value && !path && typeof value === 'object') {
1180
- if (utils$1.endsWith(key, '{}')) {
1181
- // eslint-disable-next-line no-param-reassign
1182
- key = metaTokens ? key : key.slice(0, -2);
1183
- // eslint-disable-next-line no-param-reassign
1184
- value = JSON.stringify(value);
1185
- } else if (
1186
- (utils$1.isArray(value) && isFlatArray(value)) ||
1187
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
1188
- ) {
1189
- // eslint-disable-next-line no-param-reassign
1190
- key = removeBrackets(key);
1087
+ if (utils$1.isRegExp(filter)) {
1088
+ return filter.test(value);
1089
+ }
1090
+ }
1191
1091
 
1192
- arr.forEach(function each(el, index) {
1193
- !(utils$1.isUndefined(el) || el === null) &&
1194
- formData.append(
1195
- // eslint-disable-next-line no-nested-ternary
1196
- indexes === true
1197
- ? renderKey([key], index, dots)
1198
- : indexes === null
1199
- ? key
1200
- : key + '[]',
1201
- convertValue(el)
1202
- );
1203
- });
1204
- return false;
1205
- }
1206
- }
1092
+ function formatHeader(header) {
1093
+ return header
1094
+ .trim()
1095
+ .toLowerCase()
1096
+ .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1097
+ return char.toUpperCase() + str;
1098
+ });
1099
+ }
1207
1100
 
1208
- if (isVisitable(value)) {
1209
- return true;
1210
- }
1101
+ function buildAccessors(obj, header) {
1102
+ const accessorName = utils$1.toCamelCase(' ' + header);
1211
1103
 
1212
- formData.append(renderKey(path, key, dots), convertValue(value));
1104
+ ['get', 'set', 'has'].forEach((methodName) => {
1105
+ Object.defineProperty(obj, methodName + accessorName, {
1106
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
1107
+ // this data descriptor into an accessor descriptor on the way in.
1108
+ __proto__: null,
1109
+ value: function (arg1, arg2, arg3) {
1110
+ return this[methodName].call(this, header, arg1, arg2, arg3);
1111
+ },
1112
+ configurable: true,
1113
+ });
1114
+ });
1115
+ }
1213
1116
 
1214
- return false;
1117
+ class AxiosHeaders {
1118
+ constructor(headers) {
1119
+ headers && this.set(headers);
1215
1120
  }
1216
1121
 
1217
- const stack = [];
1122
+ set(header, valueOrRewrite, rewrite) {
1123
+ const self = this;
1218
1124
 
1219
- const exposedHelpers = Object.assign(predicates, {
1220
- defaultVisitor,
1221
- convertValue,
1222
- isVisitable,
1223
- });
1125
+ function setHeader(_value, _header, _rewrite) {
1126
+ const lHeader = normalizeHeader(_header);
1224
1127
 
1225
- function build(value, path, depth = 0) {
1226
- if (utils$1.isUndefined(value)) return;
1128
+ if (!lHeader) {
1129
+ throw new Error('header name must be a non-empty string');
1130
+ }
1227
1131
 
1228
- if (depth > maxDepth) {
1229
- throw new AxiosError(
1230
- 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
1231
- AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
1232
- );
1233
- }
1132
+ const key = utils$1.findKey(self, lHeader);
1234
1133
 
1235
- if (stack.indexOf(value) !== -1) {
1236
- throw Error('Circular reference detected in ' + path.join('.'));
1134
+ if (
1135
+ !key ||
1136
+ self[key] === undefined ||
1137
+ _rewrite === true ||
1138
+ (_rewrite === undefined && self[key] !== false)
1139
+ ) {
1140
+ self[key || _header] = normalizeValue(_value);
1141
+ }
1237
1142
  }
1238
1143
 
1239
- stack.push(value);
1144
+ const setHeaders = (headers, _rewrite) =>
1145
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1240
1146
 
1241
- utils$1.forEach(value, function each(el, key) {
1242
- const result =
1243
- !(utils$1.isUndefined(el) || el === null) &&
1244
- visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
1147
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1148
+ setHeaders(header, valueOrRewrite);
1149
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1150
+ setHeaders(parseHeaders(header), valueOrRewrite);
1151
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
1152
+ let obj = {},
1153
+ dest,
1154
+ key;
1155
+ for (const entry of header) {
1156
+ if (!utils$1.isArray(entry)) {
1157
+ throw TypeError('Object iterator must return a key-value pair');
1158
+ }
1245
1159
 
1246
- if (result === true) {
1247
- build(el, path ? path.concat(key) : [key], depth + 1);
1160
+ obj[(key = entry[0])] = (dest = obj[key])
1161
+ ? utils$1.isArray(dest)
1162
+ ? [...dest, entry[1]]
1163
+ : [dest, entry[1]]
1164
+ : entry[1];
1248
1165
  }
1249
- });
1250
1166
 
1251
- stack.pop();
1252
- }
1167
+ setHeaders(obj, valueOrRewrite);
1168
+ } else {
1169
+ header != null && setHeader(valueOrRewrite, header, rewrite);
1170
+ }
1253
1171
 
1254
- if (!utils$1.isObject(obj)) {
1255
- throw new TypeError('data must be an object');
1172
+ return this;
1256
1173
  }
1257
1174
 
1258
- build(obj);
1259
-
1260
- return formData;
1261
- }
1175
+ get(header, parser) {
1176
+ header = normalizeHeader(header);
1262
1177
 
1263
- /**
1264
- * It encodes a string by replacing all characters that are not in the unreserved set with
1265
- * their percent-encoded equivalents
1266
- *
1267
- * @param {string} str - The string to encode.
1268
- *
1269
- * @returns {string} The encoded string.
1270
- */
1271
- function encode$1(str) {
1272
- const charMap = {
1273
- '!': '%21',
1274
- "'": '%27',
1275
- '(': '%28',
1276
- ')': '%29',
1277
- '~': '%7E',
1278
- '%20': '+',
1279
- };
1280
- return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
1281
- return charMap[match];
1282
- });
1283
- }
1178
+ if (header) {
1179
+ const key = utils$1.findKey(this, header);
1284
1180
 
1285
- /**
1286
- * It takes a params object and converts it to a FormData object
1287
- *
1288
- * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1289
- * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1290
- *
1291
- * @returns {void}
1292
- */
1293
- function AxiosURLSearchParams(params, options) {
1294
- this._pairs = [];
1181
+ if (key) {
1182
+ const value = this[key];
1295
1183
 
1296
- params && toFormData(params, this, options);
1297
- }
1184
+ if (!parser) {
1185
+ return value;
1186
+ }
1298
1187
 
1299
- const prototype = AxiosURLSearchParams.prototype;
1188
+ if (parser === true) {
1189
+ return parseTokens(value);
1190
+ }
1300
1191
 
1301
- prototype.append = function append(name, value) {
1302
- this._pairs.push([name, value]);
1303
- };
1192
+ if (utils$1.isFunction(parser)) {
1193
+ return parser.call(this, value, key);
1194
+ }
1304
1195
 
1305
- prototype.toString = function toString(encoder) {
1306
- const _encode = encoder
1307
- ? function (value) {
1308
- return encoder.call(this, value, encode$1);
1196
+ if (utils$1.isRegExp(parser)) {
1197
+ return parser.exec(value);
1198
+ }
1199
+
1200
+ throw new TypeError('parser must be boolean|regexp|function');
1309
1201
  }
1310
- : encode$1;
1202
+ }
1203
+ }
1311
1204
 
1312
- return this._pairs
1313
- .map(function each(pair) {
1314
- return _encode(pair[0]) + '=' + _encode(pair[1]);
1315
- }, '')
1316
- .join('&');
1317
- };
1205
+ has(header, matcher) {
1206
+ header = normalizeHeader(header);
1318
1207
 
1319
- /**
1320
- * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
1321
- * their plain counterparts (`:`, `$`, `,`, `+`).
1322
- *
1323
- * @param {string} val The value to be encoded.
1324
- *
1325
- * @returns {string} The encoded value.
1326
- */
1327
- function encode(val) {
1328
- return encodeURIComponent(val)
1329
- .replace(/%3A/gi, ':')
1330
- .replace(/%24/g, '$')
1331
- .replace(/%2C/gi, ',')
1332
- .replace(/%20/g, '+');
1333
- }
1208
+ if (header) {
1209
+ const key = utils$1.findKey(this, header);
1334
1210
 
1335
- /**
1336
- * Build a URL by appending params to the end
1337
- *
1338
- * @param {string} url The base of the url (e.g., http://www.google.com)
1339
- * @param {object} [params] The params to be appended
1340
- * @param {?(object|Function)} options
1341
- *
1342
- * @returns {string} The formatted url
1343
- */
1344
- function buildURL(url, params, options) {
1345
- if (!params) {
1346
- return url;
1211
+ return !!(
1212
+ key &&
1213
+ this[key] !== undefined &&
1214
+ (!matcher || matchHeaderValue(this, this[key], key, matcher))
1215
+ );
1216
+ }
1217
+
1218
+ return false;
1347
1219
  }
1348
1220
 
1349
- const _encode = (options && options.encode) || encode;
1221
+ delete(header, matcher) {
1222
+ const self = this;
1223
+ let deleted = false;
1350
1224
 
1351
- const _options = utils$1.isFunction(options)
1352
- ? {
1353
- serialize: options,
1354
- }
1355
- : options;
1225
+ function deleteHeader(_header) {
1226
+ _header = normalizeHeader(_header);
1356
1227
 
1357
- const serializeFn = _options && _options.serialize;
1228
+ if (_header) {
1229
+ const key = utils$1.findKey(self, _header);
1358
1230
 
1359
- let serializedParams;
1231
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
1232
+ delete self[key];
1360
1233
 
1361
- if (serializeFn) {
1362
- serializedParams = serializeFn(params, _options);
1363
- } else {
1364
- serializedParams = utils$1.isURLSearchParams(params)
1365
- ? params.toString()
1366
- : new AxiosURLSearchParams(params, _options).toString(_encode);
1234
+ deleted = true;
1235
+ }
1236
+ }
1237
+ }
1238
+
1239
+ if (utils$1.isArray(header)) {
1240
+ header.forEach(deleteHeader);
1241
+ } else {
1242
+ deleteHeader(header);
1243
+ }
1244
+
1245
+ return deleted;
1367
1246
  }
1368
1247
 
1369
- if (serializedParams) {
1370
- const hashmarkIndex = url.indexOf('#');
1248
+ clear(matcher) {
1249
+ const keys = Object.keys(this);
1250
+ let i = keys.length;
1251
+ let deleted = false;
1371
1252
 
1372
- if (hashmarkIndex !== -1) {
1373
- url = url.slice(0, hashmarkIndex);
1253
+ while (i--) {
1254
+ const key = keys[i];
1255
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1256
+ delete this[key];
1257
+ deleted = true;
1258
+ }
1374
1259
  }
1375
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1260
+
1261
+ return deleted;
1376
1262
  }
1377
1263
 
1378
- return url;
1379
- }
1264
+ normalize(format) {
1265
+ const self = this;
1266
+ const headers = {};
1380
1267
 
1381
- class InterceptorManager {
1382
- constructor() {
1383
- this.handlers = [];
1268
+ utils$1.forEach(this, (value, header) => {
1269
+ const key = utils$1.findKey(headers, header);
1270
+
1271
+ if (key) {
1272
+ self[key] = normalizeValue(value);
1273
+ delete self[header];
1274
+ return;
1275
+ }
1276
+
1277
+ const normalized = format ? formatHeader(header) : String(header).trim();
1278
+
1279
+ if (normalized !== header) {
1280
+ delete self[header];
1281
+ }
1282
+
1283
+ self[normalized] = normalizeValue(value);
1284
+
1285
+ headers[normalized] = true;
1286
+ });
1287
+
1288
+ return this;
1384
1289
  }
1385
1290
 
1386
- /**
1387
- * Add a new interceptor to the stack
1388
- *
1389
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1390
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1391
- * @param {Object} options The options for the interceptor, synchronous and runWhen
1392
- *
1393
- * @return {Number} An ID used to remove interceptor later
1394
- */
1395
- use(fulfilled, rejected, options) {
1396
- this.handlers.push({
1397
- fulfilled,
1398
- rejected,
1399
- synchronous: options ? options.synchronous : false,
1400
- runWhen: options ? options.runWhen : null,
1291
+ concat(...targets) {
1292
+ return this.constructor.concat(this, ...targets);
1293
+ }
1294
+
1295
+ toJSON(asStrings) {
1296
+ const obj = Object.create(null);
1297
+
1298
+ utils$1.forEach(this, (value, header) => {
1299
+ value != null &&
1300
+ value !== false &&
1301
+ (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
1401
1302
  });
1402
- return this.handlers.length - 1;
1303
+
1304
+ return obj;
1403
1305
  }
1404
1306
 
1405
- /**
1406
- * Remove an interceptor from the stack
1407
- *
1408
- * @param {Number} id The ID that was returned by `use`
1409
- *
1410
- * @returns {void}
1411
- */
1412
- eject(id) {
1413
- if (this.handlers[id]) {
1414
- this.handlers[id] = null;
1415
- }
1307
+ [Symbol.iterator]() {
1308
+ return Object.entries(this.toJSON())[Symbol.iterator]();
1416
1309
  }
1417
1310
 
1418
- /**
1419
- * Clear all interceptors from the stack
1420
- *
1421
- * @returns {void}
1422
- */
1423
- clear() {
1424
- if (this.handlers) {
1425
- this.handlers = [];
1426
- }
1311
+ toString() {
1312
+ return Object.entries(this.toJSON())
1313
+ .map(([header, value]) => header + ': ' + value)
1314
+ .join('\n');
1427
1315
  }
1428
1316
 
1429
- /**
1430
- * Iterate over all the registered interceptors
1431
- *
1432
- * This method is particularly useful for skipping over any
1433
- * interceptors that may have become `null` calling `eject`.
1434
- *
1435
- * @param {Function} fn The function to call for each interceptor
1436
- *
1437
- * @returns {void}
1438
- */
1439
- forEach(fn) {
1440
- utils$1.forEach(this.handlers, function forEachHandler(h) {
1441
- if (h !== null) {
1442
- fn(h);
1443
- }
1444
- });
1317
+ getSetCookie() {
1318
+ return this.get('set-cookie') || [];
1445
1319
  }
1446
- }
1447
1320
 
1448
- var transitionalDefaults = {
1449
- silentJSONParsing: true,
1450
- forcedJSONParsing: true,
1451
- clarifyTimeoutError: false,
1452
- legacyInterceptorReqResOrdering: true,
1453
- };
1321
+ get [Symbol.toStringTag]() {
1322
+ return 'AxiosHeaders';
1323
+ }
1454
1324
 
1455
- var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
1325
+ static from(thing) {
1326
+ return thing instanceof this ? thing : new this(thing);
1327
+ }
1456
1328
 
1457
- var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
1329
+ static concat(first, ...targets) {
1330
+ const computed = new this(first);
1458
1331
 
1459
- var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
1332
+ targets.forEach((target) => computed.set(target));
1460
1333
 
1461
- var platform$1 = {
1462
- isBrowser: true,
1463
- classes: {
1464
- URLSearchParams: URLSearchParams$1,
1465
- FormData: FormData$1,
1466
- Blob: Blob$1,
1467
- },
1468
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
1469
- };
1334
+ return computed;
1335
+ }
1470
1336
 
1471
- const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1337
+ static accessor(header) {
1338
+ const internals =
1339
+ (this[$internals] =
1340
+ this[$internals] =
1341
+ {
1342
+ accessors: {},
1343
+ });
1472
1344
 
1473
- const _navigator = (typeof navigator === 'object' && navigator) || undefined;
1345
+ const accessors = internals.accessors;
1346
+ const prototype = this.prototype;
1474
1347
 
1475
- /**
1476
- * Determine if we're running in a standard browser environment
1477
- *
1478
- * This allows axios to run in a web worker, and react-native.
1479
- * Both environments support XMLHttpRequest, but not fully standard globals.
1480
- *
1481
- * web workers:
1482
- * typeof window -> undefined
1483
- * typeof document -> undefined
1484
- *
1485
- * react-native:
1486
- * navigator.product -> 'ReactNative'
1487
- * nativescript
1488
- * navigator.product -> 'NativeScript' or 'NS'
1489
- *
1490
- * @returns {boolean}
1491
- */
1492
- const hasStandardBrowserEnv =
1493
- hasBrowserEnv &&
1494
- (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
1348
+ function defineAccessor(_header) {
1349
+ const lHeader = normalizeHeader(_header);
1495
1350
 
1496
- /**
1497
- * Determine if we're running in a standard browser webWorker environment
1498
- *
1499
- * Although the `isStandardBrowserEnv` method indicates that
1500
- * `allows axios to run in a web worker`, the WebWorker will still be
1501
- * filtered out due to its judgment standard
1502
- * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
1503
- * This leads to a problem when axios post `FormData` in webWorker
1504
- */
1505
- const hasStandardBrowserWebWorkerEnv = (() => {
1506
- return (
1507
- typeof WorkerGlobalScope !== 'undefined' &&
1508
- // eslint-disable-next-line no-undef
1509
- self instanceof WorkerGlobalScope &&
1510
- typeof self.importScripts === 'function'
1511
- );
1512
- })();
1351
+ if (!accessors[lHeader]) {
1352
+ buildAccessors(prototype, _header);
1353
+ accessors[lHeader] = true;
1354
+ }
1355
+ }
1513
1356
 
1514
- const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
1357
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1515
1358
 
1516
- var utils = /*#__PURE__*/Object.freeze({
1517
- __proto__: null,
1518
- hasBrowserEnv: hasBrowserEnv,
1519
- hasStandardBrowserEnv: hasStandardBrowserEnv,
1520
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1521
- navigator: _navigator,
1522
- origin: origin
1359
+ return this;
1360
+ }
1361
+ }
1362
+
1363
+ AxiosHeaders.accessor([
1364
+ 'Content-Type',
1365
+ 'Content-Length',
1366
+ 'Accept',
1367
+ 'Accept-Encoding',
1368
+ 'User-Agent',
1369
+ 'Authorization',
1370
+ ]);
1371
+
1372
+ // reserved names hotfix
1373
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
1374
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
1375
+ return {
1376
+ get: () => value,
1377
+ set(headerValue) {
1378
+ this[mapped] = headerValue;
1379
+ },
1380
+ };
1523
1381
  });
1524
1382
 
1525
- var platform = {
1526
- ...utils,
1527
- ...platform$1,
1528
- };
1383
+ utils$1.freezeMethods(AxiosHeaders);
1529
1384
 
1530
- function toURLEncodedForm(data, options) {
1531
- return toFormData(data, new platform.classes.URLSearchParams(), {
1532
- visitor: function (value, key, path, helpers) {
1533
- if (platform.isNode && utils$1.isBuffer(value)) {
1534
- this.append(key, value.toString('base64'));
1535
- return false;
1536
- }
1385
+ const REDACTED = '[REDACTED ****]';
1537
1386
 
1538
- return helpers.defaultVisitor.apply(this, arguments);
1539
- },
1540
- ...options,
1541
- });
1542
- }
1387
+ function hasOwnOrPrototypeToJSON(source) {
1388
+ if (utils$1.hasOwnProp(source, 'toJSON')) {
1389
+ return true;
1390
+ }
1543
1391
 
1544
- /**
1545
- * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
1546
- *
1547
- * @param {string} name - The name of the property to get.
1548
- *
1549
- * @returns An array of strings.
1550
- */
1551
- function parsePropPath(name) {
1552
- // foo[x][y][z]
1553
- // foo.x.y.z
1554
- // foo-x-y-z
1555
- // foo x y z
1556
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
1557
- return match[0] === '[]' ? '' : match[1] || match[0];
1558
- });
1559
- }
1392
+ let prototype = Object.getPrototypeOf(source);
1560
1393
 
1561
- /**
1562
- * Convert an array to an object.
1563
- *
1564
- * @param {Array<any>} arr - The array to convert to an object.
1565
- *
1566
- * @returns An object with the same keys and values as the array.
1567
- */
1568
- function arrayToObject(arr) {
1569
- const obj = {};
1570
- const keys = Object.keys(arr);
1571
- let i;
1572
- const len = keys.length;
1573
- let key;
1574
- for (i = 0; i < len; i++) {
1575
- key = keys[i];
1576
- obj[key] = arr[key];
1394
+ while (prototype && prototype !== Object.prototype) {
1395
+ if (utils$1.hasOwnProp(prototype, 'toJSON')) {
1396
+ return true;
1397
+ }
1398
+
1399
+ prototype = Object.getPrototypeOf(prototype);
1577
1400
  }
1578
- return obj;
1401
+
1402
+ return false;
1579
1403
  }
1580
1404
 
1581
- /**
1582
- * It takes a FormData object and returns a JavaScript object
1583
- *
1584
- * @param {string} formData The FormData object to convert to JSON.
1585
- *
1586
- * @returns {Object<string, any> | null} The converted object.
1587
- */
1588
- function formDataToJSON(formData) {
1589
- function buildPath(path, value, target, index) {
1590
- let name = path[index++];
1405
+ // Build a plain-object snapshot of `config` and replace the value of any key
1406
+ // (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
1407
+ // and AxiosHeaders, and short-circuits on circular references.
1408
+ function redactConfig(config, redactKeys) {
1409
+ const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
1410
+ const seen = [];
1591
1411
 
1592
- if (name === '__proto__') return true;
1412
+ const visit = (source) => {
1413
+ if (source === null || typeof source !== 'object') return source;
1414
+ if (utils$1.isBuffer(source)) return source;
1415
+ if (seen.indexOf(source) !== -1) return undefined;
1593
1416
 
1594
- const isNumericKey = Number.isFinite(+name);
1595
- const isLast = index >= path.length;
1596
- name = !name && utils$1.isArray(target) ? target.length : name;
1417
+ if (source instanceof AxiosHeaders) {
1418
+ source = source.toJSON();
1419
+ }
1597
1420
 
1598
- if (isLast) {
1599
- if (utils$1.hasOwnProp(target, name)) {
1600
- target[name] = utils$1.isArray(target[name])
1601
- ? target[name].concat(value)
1602
- : [target[name], value];
1603
- } else {
1604
- target[name] = value;
1421
+ seen.push(source);
1422
+
1423
+ let result;
1424
+ if (utils$1.isArray(source)) {
1425
+ result = [];
1426
+ source.forEach((v, i) => {
1427
+ const reducedValue = visit(v);
1428
+ if (!utils$1.isUndefined(reducedValue)) {
1429
+ result[i] = reducedValue;
1430
+ }
1431
+ });
1432
+ } else {
1433
+ if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
1434
+ seen.pop();
1435
+ return source;
1605
1436
  }
1606
1437
 
1607
- return !isNumericKey;
1438
+ result = Object.create(null);
1439
+ for (const [key, value] of Object.entries(source)) {
1440
+ const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
1441
+ if (!utils$1.isUndefined(reducedValue)) {
1442
+ result[key] = reducedValue;
1443
+ }
1444
+ }
1608
1445
  }
1609
1446
 
1610
- if (!target[name] || !utils$1.isObject(target[name])) {
1611
- target[name] = [];
1612
- }
1447
+ seen.pop();
1448
+ return result;
1449
+ };
1613
1450
 
1614
- const result = buildPath(path, value, target[name], index);
1451
+ return visit(config);
1452
+ }
1615
1453
 
1616
- if (result && utils$1.isArray(target[name])) {
1617
- target[name] = arrayToObject(target[name]);
1454
+ class AxiosError extends Error {
1455
+ static from(error, code, config, request, response, customProps) {
1456
+ const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
1457
+ axiosError.cause = error;
1458
+ axiosError.name = error.name;
1459
+
1460
+ // Preserve status from the original error if not already set from response
1461
+ if (error.status != null && axiosError.status == null) {
1462
+ axiosError.status = error.status;
1618
1463
  }
1619
1464
 
1620
- return !isNumericKey;
1465
+ customProps && Object.assign(axiosError, customProps);
1466
+ return axiosError;
1621
1467
  }
1622
1468
 
1623
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
1624
- const obj = {};
1469
+ /**
1470
+ * Create an Error with the specified message, config, error code, request and response.
1471
+ *
1472
+ * @param {string} message The error message.
1473
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
1474
+ * @param {Object} [config] The config.
1475
+ * @param {Object} [request] The request.
1476
+ * @param {Object} [response] The response.
1477
+ *
1478
+ * @returns {Error} The created error.
1479
+ */
1480
+ constructor(message, code, config, request, response) {
1481
+ super(message);
1625
1482
 
1626
- utils$1.forEachEntry(formData, (name, value) => {
1627
- buildPath(parsePropPath(name), value, obj, 0);
1483
+ // Make message enumerable to maintain backward compatibility
1484
+ // The native Error constructor sets message as non-enumerable,
1485
+ // but axios < v1.13.3 had it as enumerable
1486
+ Object.defineProperty(this, 'message', {
1487
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
1488
+ // this data descriptor into an accessor descriptor on the way in.
1489
+ __proto__: null,
1490
+ value: message,
1491
+ enumerable: true,
1492
+ writable: true,
1493
+ configurable: true,
1628
1494
  });
1629
1495
 
1630
- return obj;
1496
+ this.name = 'AxiosError';
1497
+ this.isAxiosError = true;
1498
+ code && (this.code = code);
1499
+ config && (this.config = config);
1500
+ request && (this.request = request);
1501
+ if (response) {
1502
+ this.response = response;
1503
+ this.status = response.status;
1504
+ }
1631
1505
  }
1632
1506
 
1633
- return null;
1507
+ toJSON() {
1508
+ // Opt-in redaction: when the request config carries a `redact` array, the
1509
+ // value of any matching key (case-insensitive, at any depth) is replaced
1510
+ // with REDACTED in the serialized snapshot. Undefined or empty leaves the
1511
+ // existing serialization behavior unchanged.
1512
+ const config = this.config;
1513
+ const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined;
1514
+ const serializedConfig =
1515
+ utils$1.isArray(redactKeys) && redactKeys.length > 0
1516
+ ? redactConfig(config, redactKeys)
1517
+ : utils$1.toJSONObject(config);
1518
+
1519
+ return {
1520
+ // Standard
1521
+ message: this.message,
1522
+ name: this.name,
1523
+ // Microsoft
1524
+ description: this.description,
1525
+ number: this.number,
1526
+ // Mozilla
1527
+ fileName: this.fileName,
1528
+ lineNumber: this.lineNumber,
1529
+ columnNumber: this.columnNumber,
1530
+ stack: this.stack,
1531
+ // Axios
1532
+ config: serializedConfig,
1533
+ code: this.code,
1534
+ status: this.status,
1535
+ };
1536
+ }
1634
1537
  }
1635
1538
 
1636
- const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
1539
+ // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
1540
+ AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1541
+ AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1542
+ AxiosError.ECONNABORTED = 'ECONNABORTED';
1543
+ AxiosError.ETIMEDOUT = 'ETIMEDOUT';
1544
+ AxiosError.ECONNREFUSED = 'ECONNREFUSED';
1545
+ AxiosError.ERR_NETWORK = 'ERR_NETWORK';
1546
+ AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1547
+ AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
1548
+ AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1549
+ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1550
+ AxiosError.ERR_CANCELED = 'ERR_CANCELED';
1551
+ AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1552
+ AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
1553
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
1554
+
1555
+ // eslint-disable-next-line strict
1556
+ var httpAdapter = null;
1637
1557
 
1638
1558
  /**
1639
- * It takes a string, tries to parse it, and if it fails, it returns the stringified version
1640
- * of the input
1559
+ * Determines if the given thing is a array or js object.
1641
1560
  *
1642
- * @param {any} rawValue - The value to be stringified.
1643
- * @param {Function} parser - A function that parses a string into a JavaScript object.
1644
- * @param {Function} encoder - A function that takes a value and returns a string.
1561
+ * @param {string} thing - The object or array to be visited.
1645
1562
  *
1646
- * @returns {string} A stringified version of the rawValue.
1563
+ * @returns {boolean}
1647
1564
  */
1648
- function stringifySafely(rawValue, parser, encoder) {
1649
- if (utils$1.isString(rawValue)) {
1650
- try {
1651
- (parser || JSON.parse)(rawValue);
1652
- return utils$1.trim(rawValue);
1653
- } catch (e) {
1654
- if (e.name !== 'SyntaxError') {
1655
- throw e;
1656
- }
1657
- }
1658
- }
1565
+ function isVisitable(thing) {
1566
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
1567
+ }
1659
1568
 
1660
- return (encoder || JSON.stringify)(rawValue);
1569
+ /**
1570
+ * It removes the brackets from the end of a string
1571
+ *
1572
+ * @param {string} key - The key of the parameter.
1573
+ *
1574
+ * @returns {string} the key without the brackets.
1575
+ */
1576
+ function removeBrackets(key) {
1577
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
1661
1578
  }
1662
1579
 
1663
- const defaults = {
1664
- transitional: transitionalDefaults,
1580
+ /**
1581
+ * It takes a path, a key, and a boolean, and returns a string
1582
+ *
1583
+ * @param {string} path - The path to the current key.
1584
+ * @param {string} key - The key of the current object being iterated over.
1585
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
1586
+ *
1587
+ * @returns {string} The path to the current key.
1588
+ */
1589
+ function renderKey(path, key, dots) {
1590
+ if (!path) return key;
1591
+ return path
1592
+ .concat(key)
1593
+ .map(function each(token, i) {
1594
+ // eslint-disable-next-line no-param-reassign
1595
+ token = removeBrackets(token);
1596
+ return !dots && i ? '[' + token + ']' : token;
1597
+ })
1598
+ .join(dots ? '.' : '');
1599
+ }
1665
1600
 
1666
- adapter: ['xhr', 'http', 'fetch'],
1601
+ /**
1602
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
1603
+ *
1604
+ * @param {Array<any>} arr - The array to check
1605
+ *
1606
+ * @returns {boolean}
1607
+ */
1608
+ function isFlatArray(arr) {
1609
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
1610
+ }
1667
1611
 
1668
- transformRequest: [
1669
- function transformRequest(data, headers) {
1670
- const contentType = headers.getContentType() || '';
1671
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
1672
- const isObjectPayload = utils$1.isObject(data);
1612
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
1613
+ return /^is[A-Z]/.test(prop);
1614
+ });
1673
1615
 
1674
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
1675
- data = new FormData(data);
1676
- }
1616
+ /**
1617
+ * Convert a data object to FormData
1618
+ *
1619
+ * @param {Object} obj
1620
+ * @param {?Object} [formData]
1621
+ * @param {?Object} [options]
1622
+ * @param {Function} [options.visitor]
1623
+ * @param {Boolean} [options.metaTokens = true]
1624
+ * @param {Boolean} [options.dots = false]
1625
+ * @param {?Boolean} [options.indexes = false]
1626
+ *
1627
+ * @returns {Object}
1628
+ **/
1677
1629
 
1678
- const isFormData = utils$1.isFormData(data);
1630
+ /**
1631
+ * It converts an object into a FormData object
1632
+ *
1633
+ * @param {Object<any, any>} obj - The object to convert to form data.
1634
+ * @param {string} formData - The FormData object to append to.
1635
+ * @param {Object<string, any>} options
1636
+ *
1637
+ * @returns
1638
+ */
1639
+ function toFormData(obj, formData, options) {
1640
+ if (!utils$1.isObject(obj)) {
1641
+ throw new TypeError('target must be an object');
1642
+ }
1679
1643
 
1680
- if (isFormData) {
1681
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1682
- }
1644
+ // eslint-disable-next-line no-param-reassign
1645
+ formData = formData || new (FormData)();
1683
1646
 
1684
- if (
1685
- utils$1.isArrayBuffer(data) ||
1686
- utils$1.isBuffer(data) ||
1687
- utils$1.isStream(data) ||
1688
- utils$1.isFile(data) ||
1689
- utils$1.isBlob(data) ||
1690
- utils$1.isReadableStream(data)
1691
- ) {
1692
- return data;
1693
- }
1694
- if (utils$1.isArrayBufferView(data)) {
1695
- return data.buffer;
1696
- }
1697
- if (utils$1.isURLSearchParams(data)) {
1698
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
1699
- return data.toString();
1700
- }
1647
+ // eslint-disable-next-line no-param-reassign
1648
+ options = utils$1.toFlatObject(
1649
+ options,
1650
+ {
1651
+ metaTokens: true,
1652
+ dots: false,
1653
+ indexes: false,
1654
+ },
1655
+ false,
1656
+ function defined(option, source) {
1657
+ // eslint-disable-next-line no-eq-null,eqeqeq
1658
+ return !utils$1.isUndefined(source[option]);
1659
+ }
1660
+ );
1701
1661
 
1702
- let isFileList;
1662
+ const metaTokens = options.metaTokens;
1663
+ // eslint-disable-next-line no-use-before-define
1664
+ const visitor = options.visitor || defaultVisitor;
1665
+ const dots = options.dots;
1666
+ const indexes = options.indexes;
1667
+ const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
1668
+ const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
1669
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
1703
1670
 
1704
- if (isObjectPayload) {
1705
- const formSerializer = own(this, 'formSerializer');
1706
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
1707
- return toURLEncodedForm(data, formSerializer).toString();
1708
- }
1671
+ if (!utils$1.isFunction(visitor)) {
1672
+ throw new TypeError('visitor must be a function');
1673
+ }
1709
1674
 
1710
- if (
1711
- (isFileList = utils$1.isFileList(data)) ||
1712
- contentType.indexOf('multipart/form-data') > -1
1713
- ) {
1714
- const env = own(this, 'env');
1715
- const _FormData = env && env.FormData;
1675
+ function convertValue(value) {
1676
+ if (value === null) return '';
1716
1677
 
1717
- return toFormData(
1718
- isFileList ? { 'files[]': data } : data,
1719
- _FormData && new _FormData(),
1720
- formSerializer
1721
- );
1722
- }
1723
- }
1678
+ if (utils$1.isDate(value)) {
1679
+ return value.toISOString();
1680
+ }
1724
1681
 
1725
- if (isObjectPayload || hasJSONContentType) {
1726
- headers.setContentType('application/json', false);
1727
- return stringifySafely(data);
1728
- }
1682
+ if (utils$1.isBoolean(value)) {
1683
+ return value.toString();
1684
+ }
1729
1685
 
1730
- return data;
1731
- },
1732
- ],
1686
+ if (!useBlob && utils$1.isBlob(value)) {
1687
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1688
+ }
1733
1689
 
1734
- transformResponse: [
1735
- function transformResponse(data) {
1736
- const transitional = own(this, 'transitional') || defaults.transitional;
1737
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1738
- const responseType = own(this, 'responseType');
1739
- const JSONRequested = responseType === 'json';
1690
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
1691
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1692
+ }
1740
1693
 
1741
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
1742
- return data;
1743
- }
1694
+ return value;
1695
+ }
1744
1696
 
1745
- if (
1746
- data &&
1747
- utils$1.isString(data) &&
1748
- ((forcedJSONParsing && !responseType) || JSONRequested)
1749
- ) {
1750
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
1751
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
1697
+ /**
1698
+ * Default visitor.
1699
+ *
1700
+ * @param {*} value
1701
+ * @param {String|Number} key
1702
+ * @param {Array<String|Number>} path
1703
+ * @this {FormData}
1704
+ *
1705
+ * @returns {boolean} return true to visit the each prop of the value recursively
1706
+ */
1707
+ function defaultVisitor(value, key, path) {
1708
+ let arr = value;
1752
1709
 
1753
- try {
1754
- return JSON.parse(data, own(this, 'parseReviver'));
1755
- } catch (e) {
1756
- if (strictJSONParsing) {
1757
- if (e.name === 'SyntaxError') {
1758
- throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
1759
- }
1760
- throw e;
1761
- }
1762
- }
1763
- }
1710
+ if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
1711
+ formData.append(renderKey(path, key, dots), convertValue(value));
1712
+ return false;
1713
+ }
1764
1714
 
1765
- return data;
1766
- },
1767
- ],
1715
+ if (value && !path && typeof value === 'object') {
1716
+ if (utils$1.endsWith(key, '{}')) {
1717
+ // eslint-disable-next-line no-param-reassign
1718
+ key = metaTokens ? key : key.slice(0, -2);
1719
+ // eslint-disable-next-line no-param-reassign
1720
+ value = JSON.stringify(value);
1721
+ } else if (
1722
+ (utils$1.isArray(value) && isFlatArray(value)) ||
1723
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
1724
+ ) {
1725
+ // eslint-disable-next-line no-param-reassign
1726
+ key = removeBrackets(key);
1768
1727
 
1769
- /**
1770
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
1771
- * timeout is not created.
1772
- */
1773
- timeout: 0,
1728
+ arr.forEach(function each(el, index) {
1729
+ !(utils$1.isUndefined(el) || el === null) &&
1730
+ formData.append(
1731
+ // eslint-disable-next-line no-nested-ternary
1732
+ indexes === true
1733
+ ? renderKey([key], index, dots)
1734
+ : indexes === null
1735
+ ? key
1736
+ : key + '[]',
1737
+ convertValue(el)
1738
+ );
1739
+ });
1740
+ return false;
1741
+ }
1742
+ }
1774
1743
 
1775
- xsrfCookieName: 'XSRF-TOKEN',
1776
- xsrfHeaderName: 'X-XSRF-TOKEN',
1744
+ if (isVisitable(value)) {
1745
+ return true;
1746
+ }
1777
1747
 
1778
- maxContentLength: -1,
1779
- maxBodyLength: -1,
1748
+ formData.append(renderKey(path, key, dots), convertValue(value));
1780
1749
 
1781
- env: {
1782
- FormData: platform.classes.FormData,
1783
- Blob: platform.classes.Blob,
1784
- },
1750
+ return false;
1751
+ }
1785
1752
 
1786
- validateStatus: function validateStatus(status) {
1787
- return status >= 200 && status < 300;
1788
- },
1753
+ const stack = [];
1789
1754
 
1790
- headers: {
1791
- common: {
1792
- Accept: 'application/json, text/plain, */*',
1793
- 'Content-Type': undefined,
1794
- },
1795
- },
1796
- };
1755
+ const exposedHelpers = Object.assign(predicates, {
1756
+ defaultVisitor,
1757
+ convertValue,
1758
+ isVisitable,
1759
+ });
1797
1760
 
1798
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
1799
- defaults.headers[method] = {};
1800
- });
1761
+ function build(value, path, depth = 0) {
1762
+ if (utils$1.isUndefined(value)) return;
1801
1763
 
1802
- // RawAxiosHeaders whose duplicates are ignored by node
1803
- // c.f. https://nodejs.org/api/http.html#http_message_headers
1804
- const ignoreDuplicateOf = utils$1.toObjectSet([
1805
- 'age',
1806
- 'authorization',
1807
- 'content-length',
1808
- 'content-type',
1809
- 'etag',
1810
- 'expires',
1811
- 'from',
1812
- 'host',
1813
- 'if-modified-since',
1814
- 'if-unmodified-since',
1815
- 'last-modified',
1816
- 'location',
1817
- 'max-forwards',
1818
- 'proxy-authorization',
1819
- 'referer',
1820
- 'retry-after',
1821
- 'user-agent',
1822
- ]);
1764
+ if (depth > maxDepth) {
1765
+ throw new AxiosError(
1766
+ 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
1767
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
1768
+ );
1769
+ }
1823
1770
 
1824
- /**
1825
- * Parse headers into an object
1826
- *
1827
- * ```
1828
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
1829
- * Content-Type: application/json
1830
- * Connection: keep-alive
1831
- * Transfer-Encoding: chunked
1832
- * ```
1833
- *
1834
- * @param {String} rawHeaders Headers needing to be parsed
1835
- *
1836
- * @returns {Object} Headers parsed into an object
1837
- */
1838
- var parseHeaders = (rawHeaders) => {
1839
- const parsed = {};
1840
- let key;
1841
- let val;
1842
- let i;
1771
+ if (stack.indexOf(value) !== -1) {
1772
+ throw Error('Circular reference detected in ' + path.join('.'));
1773
+ }
1843
1774
 
1844
- rawHeaders &&
1845
- rawHeaders.split('\n').forEach(function parser(line) {
1846
- i = line.indexOf(':');
1847
- key = line.substring(0, i).trim().toLowerCase();
1848
- val = line.substring(i + 1).trim();
1775
+ stack.push(value);
1849
1776
 
1850
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
1851
- return;
1852
- }
1777
+ utils$1.forEach(value, function each(el, key) {
1778
+ const result =
1779
+ !(utils$1.isUndefined(el) || el === null) &&
1780
+ visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
1853
1781
 
1854
- if (key === 'set-cookie') {
1855
- if (parsed[key]) {
1856
- parsed[key].push(val);
1857
- } else {
1858
- parsed[key] = [val];
1859
- }
1860
- } else {
1861
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1782
+ if (result === true) {
1783
+ build(el, path ? path.concat(key) : [key], depth + 1);
1862
1784
  }
1863
1785
  });
1864
1786
 
1865
- return parsed;
1866
- };
1787
+ stack.pop();
1788
+ }
1867
1789
 
1868
- const $internals = Symbol('internals');
1790
+ if (!utils$1.isObject(obj)) {
1791
+ throw new TypeError('data must be an object');
1792
+ }
1869
1793
 
1870
- const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
1794
+ build(obj);
1871
1795
 
1872
- function trimSPorHTAB(str) {
1873
- let start = 0;
1874
- let end = str.length;
1796
+ return formData;
1797
+ }
1875
1798
 
1876
- while (start < end) {
1877
- const code = str.charCodeAt(start);
1799
+ /**
1800
+ * It encodes a string by replacing all characters that are not in the unreserved set with
1801
+ * their percent-encoded equivalents
1802
+ *
1803
+ * @param {string} str - The string to encode.
1804
+ *
1805
+ * @returns {string} The encoded string.
1806
+ */
1807
+ function encode$1(str) {
1808
+ const charMap = {
1809
+ '!': '%21',
1810
+ "'": '%27',
1811
+ '(': '%28',
1812
+ ')': '%29',
1813
+ '~': '%7E',
1814
+ '%20': '+',
1815
+ };
1816
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
1817
+ return charMap[match];
1818
+ });
1819
+ }
1878
1820
 
1879
- if (code !== 0x09 && code !== 0x20) {
1880
- break;
1881
- }
1821
+ /**
1822
+ * It takes a params object and converts it to a FormData object
1823
+ *
1824
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1825
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1826
+ *
1827
+ * @returns {void}
1828
+ */
1829
+ function AxiosURLSearchParams(params, options) {
1830
+ this._pairs = [];
1882
1831
 
1883
- start += 1;
1884
- }
1832
+ params && toFormData(params, this, options);
1833
+ }
1834
+
1835
+ const prototype = AxiosURLSearchParams.prototype;
1836
+
1837
+ prototype.append = function append(name, value) {
1838
+ this._pairs.push([name, value]);
1839
+ };
1885
1840
 
1886
- while (end > start) {
1887
- const code = str.charCodeAt(end - 1);
1841
+ prototype.toString = function toString(encoder) {
1842
+ const _encode = encoder
1843
+ ? function (value) {
1844
+ return encoder.call(this, value, encode$1);
1845
+ }
1846
+ : encode$1;
1888
1847
 
1889
- if (code !== 0x09 && code !== 0x20) {
1890
- break;
1891
- }
1848
+ return this._pairs
1849
+ .map(function each(pair) {
1850
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
1851
+ }, '')
1852
+ .join('&');
1853
+ };
1892
1854
 
1893
- end -= 1;
1855
+ /**
1856
+ * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
1857
+ * their plain counterparts (`:`, `$`, `,`, `+`).
1858
+ *
1859
+ * @param {string} val The value to be encoded.
1860
+ *
1861
+ * @returns {string} The encoded value.
1862
+ */
1863
+ function encode(val) {
1864
+ return encodeURIComponent(val)
1865
+ .replace(/%3A/gi, ':')
1866
+ .replace(/%24/g, '$')
1867
+ .replace(/%2C/gi, ',')
1868
+ .replace(/%20/g, '+');
1869
+ }
1870
+
1871
+ /**
1872
+ * Build a URL by appending params to the end
1873
+ *
1874
+ * @param {string} url The base of the url (e.g., http://www.google.com)
1875
+ * @param {object} [params] The params to be appended
1876
+ * @param {?(object|Function)} options
1877
+ *
1878
+ * @returns {string} The formatted url
1879
+ */
1880
+ function buildURL(url, params, options) {
1881
+ if (!params) {
1882
+ return url;
1894
1883
  }
1895
1884
 
1896
- return start === 0 && end === str.length ? str : str.slice(start, end);
1897
- }
1885
+ const _encode = (options && options.encode) || encode;
1898
1886
 
1899
- function normalizeHeader(header) {
1900
- return header && String(header).trim().toLowerCase();
1901
- }
1887
+ const _options = utils$1.isFunction(options)
1888
+ ? {
1889
+ serialize: options,
1890
+ }
1891
+ : options;
1902
1892
 
1903
- function sanitizeHeaderValue(str) {
1904
- return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
1905
- }
1893
+ const serializeFn = _options && _options.serialize;
1906
1894
 
1907
- function normalizeValue(value) {
1908
- if (value === false || value == null) {
1909
- return value;
1910
- }
1895
+ let serializedParams;
1911
1896
 
1912
- return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
1913
- }
1897
+ if (serializeFn) {
1898
+ serializedParams = serializeFn(params, _options);
1899
+ } else {
1900
+ serializedParams = utils$1.isURLSearchParams(params)
1901
+ ? params.toString()
1902
+ : new AxiosURLSearchParams(params, _options).toString(_encode);
1903
+ }
1914
1904
 
1915
- function parseTokens(str) {
1916
- const tokens = Object.create(null);
1917
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1918
- let match;
1905
+ if (serializedParams) {
1906
+ const hashmarkIndex = url.indexOf('#');
1919
1907
 
1920
- while ((match = tokensRE.exec(str))) {
1921
- tokens[match[1]] = match[2];
1908
+ if (hashmarkIndex !== -1) {
1909
+ url = url.slice(0, hashmarkIndex);
1910
+ }
1911
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1922
1912
  }
1923
1913
 
1924
- return tokens;
1914
+ return url;
1925
1915
  }
1926
1916
 
1927
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1928
-
1929
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1930
- if (utils$1.isFunction(filter)) {
1931
- return filter.call(this, value, header);
1917
+ class InterceptorManager {
1918
+ constructor() {
1919
+ this.handlers = [];
1932
1920
  }
1933
1921
 
1934
- if (isHeaderNameFilter) {
1935
- value = header;
1922
+ /**
1923
+ * Add a new interceptor to the stack
1924
+ *
1925
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
1926
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
1927
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
1928
+ *
1929
+ * @return {Number} An ID used to remove interceptor later
1930
+ */
1931
+ use(fulfilled, rejected, options) {
1932
+ this.handlers.push({
1933
+ fulfilled,
1934
+ rejected,
1935
+ synchronous: options ? options.synchronous : false,
1936
+ runWhen: options ? options.runWhen : null,
1937
+ });
1938
+ return this.handlers.length - 1;
1936
1939
  }
1937
1940
 
1938
- if (!utils$1.isString(value)) return;
1939
-
1940
- if (utils$1.isString(filter)) {
1941
- return value.indexOf(filter) !== -1;
1941
+ /**
1942
+ * Remove an interceptor from the stack
1943
+ *
1944
+ * @param {Number} id The ID that was returned by `use`
1945
+ *
1946
+ * @returns {void}
1947
+ */
1948
+ eject(id) {
1949
+ if (this.handlers[id]) {
1950
+ this.handlers[id] = null;
1951
+ }
1942
1952
  }
1943
1953
 
1944
- if (utils$1.isRegExp(filter)) {
1945
- return filter.test(value);
1954
+ /**
1955
+ * Clear all interceptors from the stack
1956
+ *
1957
+ * @returns {void}
1958
+ */
1959
+ clear() {
1960
+ if (this.handlers) {
1961
+ this.handlers = [];
1962
+ }
1946
1963
  }
1947
- }
1948
1964
 
1949
- function formatHeader(header) {
1950
- return header
1951
- .trim()
1952
- .toLowerCase()
1953
- .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1954
- return char.toUpperCase() + str;
1965
+ /**
1966
+ * Iterate over all the registered interceptors
1967
+ *
1968
+ * This method is particularly useful for skipping over any
1969
+ * interceptors that may have become `null` calling `eject`.
1970
+ *
1971
+ * @param {Function} fn The function to call for each interceptor
1972
+ *
1973
+ * @returns {void}
1974
+ */
1975
+ forEach(fn) {
1976
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
1977
+ if (h !== null) {
1978
+ fn(h);
1979
+ }
1955
1980
  });
1981
+ }
1956
1982
  }
1957
1983
 
1958
- function buildAccessors(obj, header) {
1959
- const accessorName = utils$1.toCamelCase(' ' + header);
1960
-
1961
- ['get', 'set', 'has'].forEach((methodName) => {
1962
- Object.defineProperty(obj, methodName + accessorName, {
1963
- value: function (arg1, arg2, arg3) {
1964
- return this[methodName].call(this, header, arg1, arg2, arg3);
1965
- },
1966
- configurable: true,
1967
- });
1968
- });
1969
- }
1984
+ var transitionalDefaults = {
1985
+ silentJSONParsing: true,
1986
+ forcedJSONParsing: true,
1987
+ clarifyTimeoutError: false,
1988
+ legacyInterceptorReqResOrdering: true,
1989
+ };
1970
1990
 
1971
- class AxiosHeaders {
1972
- constructor(headers) {
1973
- headers && this.set(headers);
1974
- }
1991
+ var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
1975
1992
 
1976
- set(header, valueOrRewrite, rewrite) {
1977
- const self = this;
1993
+ var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
1978
1994
 
1979
- function setHeader(_value, _header, _rewrite) {
1980
- const lHeader = normalizeHeader(_header);
1995
+ var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
1981
1996
 
1982
- if (!lHeader) {
1983
- throw new Error('header name must be a non-empty string');
1984
- }
1997
+ var platform$1 = {
1998
+ isBrowser: true,
1999
+ classes: {
2000
+ URLSearchParams: URLSearchParams$1,
2001
+ FormData: FormData$1,
2002
+ Blob: Blob$1,
2003
+ },
2004
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
2005
+ };
1985
2006
 
1986
- const key = utils$1.findKey(self, lHeader);
2007
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1987
2008
 
1988
- if (
1989
- !key ||
1990
- self[key] === undefined ||
1991
- _rewrite === true ||
1992
- (_rewrite === undefined && self[key] !== false)
1993
- ) {
1994
- self[key || _header] = normalizeValue(_value);
1995
- }
1996
- }
2009
+ const _navigator = (typeof navigator === 'object' && navigator) || undefined;
1997
2010
 
1998
- const setHeaders = (headers, _rewrite) =>
1999
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
2011
+ /**
2012
+ * Determine if we're running in a standard browser environment
2013
+ *
2014
+ * This allows axios to run in a web worker, and react-native.
2015
+ * Both environments support XMLHttpRequest, but not fully standard globals.
2016
+ *
2017
+ * web workers:
2018
+ * typeof window -> undefined
2019
+ * typeof document -> undefined
2020
+ *
2021
+ * react-native:
2022
+ * navigator.product -> 'ReactNative'
2023
+ * nativescript
2024
+ * navigator.product -> 'NativeScript' or 'NS'
2025
+ *
2026
+ * @returns {boolean}
2027
+ */
2028
+ const hasStandardBrowserEnv =
2029
+ hasBrowserEnv &&
2030
+ (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
2000
2031
 
2001
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
2002
- setHeaders(header, valueOrRewrite);
2003
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
2004
- setHeaders(parseHeaders(header), valueOrRewrite);
2005
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
2006
- let obj = {},
2007
- dest,
2008
- key;
2009
- for (const entry of header) {
2010
- if (!utils$1.isArray(entry)) {
2011
- throw TypeError('Object iterator must return a key-value pair');
2012
- }
2032
+ /**
2033
+ * Determine if we're running in a standard browser webWorker environment
2034
+ *
2035
+ * Although the `isStandardBrowserEnv` method indicates that
2036
+ * `allows axios to run in a web worker`, the WebWorker will still be
2037
+ * filtered out due to its judgment standard
2038
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
2039
+ * This leads to a problem when axios post `FormData` in webWorker
2040
+ */
2041
+ const hasStandardBrowserWebWorkerEnv = (() => {
2042
+ return (
2043
+ typeof WorkerGlobalScope !== 'undefined' &&
2044
+ // eslint-disable-next-line no-undef
2045
+ self instanceof WorkerGlobalScope &&
2046
+ typeof self.importScripts === 'function'
2047
+ );
2048
+ })();
2013
2049
 
2014
- obj[(key = entry[0])] = (dest = obj[key])
2015
- ? utils$1.isArray(dest)
2016
- ? [...dest, entry[1]]
2017
- : [dest, entry[1]]
2018
- : entry[1];
2019
- }
2050
+ const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
2020
2051
 
2021
- setHeaders(obj, valueOrRewrite);
2022
- } else {
2023
- header != null && setHeader(valueOrRewrite, header, rewrite);
2024
- }
2052
+ var utils = /*#__PURE__*/Object.freeze({
2053
+ __proto__: null,
2054
+ hasBrowserEnv: hasBrowserEnv,
2055
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
2056
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
2057
+ navigator: _navigator,
2058
+ origin: origin
2059
+ });
2025
2060
 
2026
- return this;
2027
- }
2061
+ var platform = {
2062
+ ...utils,
2063
+ ...platform$1,
2064
+ };
2028
2065
 
2029
- get(header, parser) {
2030
- header = normalizeHeader(header);
2066
+ function toURLEncodedForm(data, options) {
2067
+ return toFormData(data, new platform.classes.URLSearchParams(), {
2068
+ visitor: function (value, key, path, helpers) {
2069
+ if (platform.isNode && utils$1.isBuffer(value)) {
2070
+ this.append(key, value.toString('base64'));
2071
+ return false;
2072
+ }
2031
2073
 
2032
- if (header) {
2033
- const key = utils$1.findKey(this, header);
2074
+ return helpers.defaultVisitor.apply(this, arguments);
2075
+ },
2076
+ ...options,
2077
+ });
2078
+ }
2034
2079
 
2035
- if (key) {
2036
- const value = this[key];
2080
+ /**
2081
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
2082
+ *
2083
+ * @param {string} name - The name of the property to get.
2084
+ *
2085
+ * @returns An array of strings.
2086
+ */
2087
+ function parsePropPath(name) {
2088
+ // foo[x][y][z]
2089
+ // foo.x.y.z
2090
+ // foo-x-y-z
2091
+ // foo x y z
2092
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
2093
+ return match[0] === '[]' ? '' : match[1] || match[0];
2094
+ });
2095
+ }
2037
2096
 
2038
- if (!parser) {
2039
- return value;
2040
- }
2097
+ /**
2098
+ * Convert an array to an object.
2099
+ *
2100
+ * @param {Array<any>} arr - The array to convert to an object.
2101
+ *
2102
+ * @returns An object with the same keys and values as the array.
2103
+ */
2104
+ function arrayToObject(arr) {
2105
+ const obj = {};
2106
+ const keys = Object.keys(arr);
2107
+ let i;
2108
+ const len = keys.length;
2109
+ let key;
2110
+ for (i = 0; i < len; i++) {
2111
+ key = keys[i];
2112
+ obj[key] = arr[key];
2113
+ }
2114
+ return obj;
2115
+ }
2041
2116
 
2042
- if (parser === true) {
2043
- return parseTokens(value);
2044
- }
2117
+ /**
2118
+ * It takes a FormData object and returns a JavaScript object
2119
+ *
2120
+ * @param {string} formData The FormData object to convert to JSON.
2121
+ *
2122
+ * @returns {Object<string, any> | null} The converted object.
2123
+ */
2124
+ function formDataToJSON(formData) {
2125
+ function buildPath(path, value, target, index) {
2126
+ let name = path[index++];
2045
2127
 
2046
- if (utils$1.isFunction(parser)) {
2047
- return parser.call(this, value, key);
2048
- }
2128
+ if (name === '__proto__') return true;
2049
2129
 
2050
- if (utils$1.isRegExp(parser)) {
2051
- return parser.exec(value);
2052
- }
2130
+ const isNumericKey = Number.isFinite(+name);
2131
+ const isLast = index >= path.length;
2132
+ name = !name && utils$1.isArray(target) ? target.length : name;
2053
2133
 
2054
- throw new TypeError('parser must be boolean|regexp|function');
2134
+ if (isLast) {
2135
+ if (utils$1.hasOwnProp(target, name)) {
2136
+ target[name] = utils$1.isArray(target[name])
2137
+ ? target[name].concat(value)
2138
+ : [target[name], value];
2139
+ } else {
2140
+ target[name] = value;
2055
2141
  }
2142
+
2143
+ return !isNumericKey;
2056
2144
  }
2057
- }
2058
2145
 
2059
- has(header, matcher) {
2060
- header = normalizeHeader(header);
2146
+ if (!target[name] || !utils$1.isObject(target[name])) {
2147
+ target[name] = [];
2148
+ }
2061
2149
 
2062
- if (header) {
2063
- const key = utils$1.findKey(this, header);
2150
+ const result = buildPath(path, value, target[name], index);
2064
2151
 
2065
- return !!(
2066
- key &&
2067
- this[key] !== undefined &&
2068
- (!matcher || matchHeaderValue(this, this[key], key, matcher))
2069
- );
2152
+ if (result && utils$1.isArray(target[name])) {
2153
+ target[name] = arrayToObject(target[name]);
2070
2154
  }
2071
2155
 
2072
- return false;
2156
+ return !isNumericKey;
2073
2157
  }
2074
2158
 
2075
- delete(header, matcher) {
2076
- const self = this;
2077
- let deleted = false;
2078
-
2079
- function deleteHeader(_header) {
2080
- _header = normalizeHeader(_header);
2081
-
2082
- if (_header) {
2083
- const key = utils$1.findKey(self, _header);
2084
-
2085
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
2086
- delete self[key];
2087
-
2088
- deleted = true;
2089
- }
2090
- }
2091
- }
2159
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
2160
+ const obj = {};
2092
2161
 
2093
- if (utils$1.isArray(header)) {
2094
- header.forEach(deleteHeader);
2095
- } else {
2096
- deleteHeader(header);
2097
- }
2162
+ utils$1.forEachEntry(formData, (name, value) => {
2163
+ buildPath(parsePropPath(name), value, obj, 0);
2164
+ });
2098
2165
 
2099
- return deleted;
2166
+ return obj;
2100
2167
  }
2101
2168
 
2102
- clear(matcher) {
2103
- const keys = Object.keys(this);
2104
- let i = keys.length;
2105
- let deleted = false;
2169
+ return null;
2170
+ }
2106
2171
 
2107
- while (i--) {
2108
- const key = keys[i];
2109
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
2110
- delete this[key];
2111
- deleted = true;
2172
+ const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
2173
+
2174
+ /**
2175
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
2176
+ * of the input
2177
+ *
2178
+ * @param {any} rawValue - The value to be stringified.
2179
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
2180
+ * @param {Function} encoder - A function that takes a value and returns a string.
2181
+ *
2182
+ * @returns {string} A stringified version of the rawValue.
2183
+ */
2184
+ function stringifySafely(rawValue, parser, encoder) {
2185
+ if (utils$1.isString(rawValue)) {
2186
+ try {
2187
+ (parser || JSON.parse)(rawValue);
2188
+ return utils$1.trim(rawValue);
2189
+ } catch (e) {
2190
+ if (e.name !== 'SyntaxError') {
2191
+ throw e;
2112
2192
  }
2113
2193
  }
2114
-
2115
- return deleted;
2116
2194
  }
2117
2195
 
2118
- normalize(format) {
2119
- const self = this;
2120
- const headers = {};
2196
+ return (encoder || JSON.stringify)(rawValue);
2197
+ }
2121
2198
 
2122
- utils$1.forEach(this, (value, header) => {
2123
- const key = utils$1.findKey(headers, header);
2199
+ const defaults = {
2200
+ transitional: transitionalDefaults,
2124
2201
 
2125
- if (key) {
2126
- self[key] = normalizeValue(value);
2127
- delete self[header];
2128
- return;
2129
- }
2202
+ adapter: ['xhr', 'http', 'fetch'],
2130
2203
 
2131
- const normalized = format ? formatHeader(header) : String(header).trim();
2204
+ transformRequest: [
2205
+ function transformRequest(data, headers) {
2206
+ const contentType = headers.getContentType() || '';
2207
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
2208
+ const isObjectPayload = utils$1.isObject(data);
2132
2209
 
2133
- if (normalized !== header) {
2134
- delete self[header];
2210
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
2211
+ data = new FormData(data);
2135
2212
  }
2136
2213
 
2137
- self[normalized] = normalizeValue(value);
2138
-
2139
- headers[normalized] = true;
2140
- });
2141
-
2142
- return this;
2143
- }
2144
-
2145
- concat(...targets) {
2146
- return this.constructor.concat(this, ...targets);
2147
- }
2214
+ const isFormData = utils$1.isFormData(data);
2148
2215
 
2149
- toJSON(asStrings) {
2150
- const obj = Object.create(null);
2216
+ if (isFormData) {
2217
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
2218
+ }
2151
2219
 
2152
- utils$1.forEach(this, (value, header) => {
2153
- value != null &&
2154
- value !== false &&
2155
- (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
2156
- });
2220
+ if (
2221
+ utils$1.isArrayBuffer(data) ||
2222
+ utils$1.isBuffer(data) ||
2223
+ utils$1.isStream(data) ||
2224
+ utils$1.isFile(data) ||
2225
+ utils$1.isBlob(data) ||
2226
+ utils$1.isReadableStream(data)
2227
+ ) {
2228
+ return data;
2229
+ }
2230
+ if (utils$1.isArrayBufferView(data)) {
2231
+ return data.buffer;
2232
+ }
2233
+ if (utils$1.isURLSearchParams(data)) {
2234
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
2235
+ return data.toString();
2236
+ }
2157
2237
 
2158
- return obj;
2159
- }
2238
+ let isFileList;
2160
2239
 
2161
- [Symbol.iterator]() {
2162
- return Object.entries(this.toJSON())[Symbol.iterator]();
2163
- }
2240
+ if (isObjectPayload) {
2241
+ const formSerializer = own(this, 'formSerializer');
2242
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
2243
+ return toURLEncodedForm(data, formSerializer).toString();
2244
+ }
2164
2245
 
2165
- toString() {
2166
- return Object.entries(this.toJSON())
2167
- .map(([header, value]) => header + ': ' + value)
2168
- .join('\n');
2169
- }
2246
+ if (
2247
+ (isFileList = utils$1.isFileList(data)) ||
2248
+ contentType.indexOf('multipart/form-data') > -1
2249
+ ) {
2250
+ const env = own(this, 'env');
2251
+ const _FormData = env && env.FormData;
2170
2252
 
2171
- getSetCookie() {
2172
- return this.get('set-cookie') || [];
2173
- }
2253
+ return toFormData(
2254
+ isFileList ? { 'files[]': data } : data,
2255
+ _FormData && new _FormData(),
2256
+ formSerializer
2257
+ );
2258
+ }
2259
+ }
2174
2260
 
2175
- get [Symbol.toStringTag]() {
2176
- return 'AxiosHeaders';
2177
- }
2261
+ if (isObjectPayload || hasJSONContentType) {
2262
+ headers.setContentType('application/json', false);
2263
+ return stringifySafely(data);
2264
+ }
2178
2265
 
2179
- static from(thing) {
2180
- return thing instanceof this ? thing : new this(thing);
2181
- }
2266
+ return data;
2267
+ },
2268
+ ],
2182
2269
 
2183
- static concat(first, ...targets) {
2184
- const computed = new this(first);
2270
+ transformResponse: [
2271
+ function transformResponse(data) {
2272
+ const transitional = own(this, 'transitional') || defaults.transitional;
2273
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
2274
+ const responseType = own(this, 'responseType');
2275
+ const JSONRequested = responseType === 'json';
2185
2276
 
2186
- targets.forEach((target) => computed.set(target));
2277
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
2278
+ return data;
2279
+ }
2187
2280
 
2188
- return computed;
2189
- }
2281
+ if (
2282
+ data &&
2283
+ utils$1.isString(data) &&
2284
+ ((forcedJSONParsing && !responseType) || JSONRequested)
2285
+ ) {
2286
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
2287
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
2190
2288
 
2191
- static accessor(header) {
2192
- const internals =
2193
- (this[$internals] =
2194
- this[$internals] =
2195
- {
2196
- accessors: {},
2197
- });
2289
+ try {
2290
+ return JSON.parse(data, own(this, 'parseReviver'));
2291
+ } catch (e) {
2292
+ if (strictJSONParsing) {
2293
+ if (e.name === 'SyntaxError') {
2294
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
2295
+ }
2296
+ throw e;
2297
+ }
2298
+ }
2299
+ }
2198
2300
 
2199
- const accessors = internals.accessors;
2200
- const prototype = this.prototype;
2301
+ return data;
2302
+ },
2303
+ ],
2201
2304
 
2202
- function defineAccessor(_header) {
2203
- const lHeader = normalizeHeader(_header);
2305
+ /**
2306
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
2307
+ * timeout is not created.
2308
+ */
2309
+ timeout: 0,
2204
2310
 
2205
- if (!accessors[lHeader]) {
2206
- buildAccessors(prototype, _header);
2207
- accessors[lHeader] = true;
2208
- }
2209
- }
2311
+ xsrfCookieName: 'XSRF-TOKEN',
2312
+ xsrfHeaderName: 'X-XSRF-TOKEN',
2210
2313
 
2211
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2314
+ maxContentLength: -1,
2315
+ maxBodyLength: -1,
2212
2316
 
2213
- return this;
2214
- }
2215
- }
2317
+ env: {
2318
+ FormData: platform.classes.FormData,
2319
+ Blob: platform.classes.Blob,
2320
+ },
2216
2321
 
2217
- AxiosHeaders.accessor([
2218
- 'Content-Type',
2219
- 'Content-Length',
2220
- 'Accept',
2221
- 'Accept-Encoding',
2222
- 'User-Agent',
2223
- 'Authorization',
2224
- ]);
2322
+ validateStatus: function validateStatus(status) {
2323
+ return status >= 200 && status < 300;
2324
+ },
2225
2325
 
2226
- // reserved names hotfix
2227
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
2228
- let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
2229
- return {
2230
- get: () => value,
2231
- set(headerValue) {
2232
- this[mapped] = headerValue;
2326
+ headers: {
2327
+ common: {
2328
+ Accept: 'application/json, text/plain, */*',
2329
+ 'Content-Type': undefined,
2233
2330
  },
2234
- };
2235
- });
2331
+ },
2332
+ };
2236
2333
 
2237
- utils$1.freezeMethods(AxiosHeaders);
2334
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => {
2335
+ defaults.headers[method] = {};
2336
+ });
2238
2337
 
2239
2338
  /**
2240
2339
  * Transform the data for a request or a response
@@ -2294,22 +2393,18 @@ function settle(resolve, reject, response) {
2294
2393
  if (!response.status || !validateStatus || validateStatus(response.status)) {
2295
2394
  resolve(response);
2296
2395
  } else {
2297
- reject(
2298
- new AxiosError(
2299
- 'Request failed with status code ' + response.status,
2300
- [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][
2301
- Math.floor(response.status / 100) - 4
2302
- ],
2303
- response.config,
2304
- response.request,
2305
- response
2306
- )
2307
- );
2396
+ reject(new AxiosError(
2397
+ 'Request failed with status code ' + response.status,
2398
+ response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE,
2399
+ response.config,
2400
+ response.request,
2401
+ response
2402
+ ));
2308
2403
  }
2309
2404
  }
2310
2405
 
2311
2406
  function parseProtocol(url) {
2312
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2407
+ const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
2313
2408
  return (match && match[1]) || '';
2314
2409
  }
2315
2410
 
@@ -2500,8 +2595,20 @@ var cookies = platform.hasStandardBrowserEnv
2500
2595
 
2501
2596
  read(name) {
2502
2597
  if (typeof document === 'undefined') return null;
2503
- const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
2504
- return match ? decodeURIComponent(match[1]) : null;
2598
+ // Match name=value by splitting on the semicolon separator instead of building a
2599
+ // RegExp from `name` interpolating an unescaped string into a RegExp would let
2600
+ // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
2601
+ // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
2602
+ // "; ", so ignore optional whitespace before each cookie name.
2603
+ const cookies = document.cookie.split(';');
2604
+ for (let i = 0; i < cookies.length; i++) {
2605
+ const cookie = cookies[i].replace(/^\s+/, '');
2606
+ const eq = cookie.indexOf('=');
2607
+ if (eq !== -1 && cookie.slice(0, eq) === name) {
2608
+ return decodeURIComponent(cookie.slice(eq + 1));
2609
+ }
2610
+ }
2611
+ return null;
2505
2612
  },
2506
2613
 
2507
2614
  remove(name) {
@@ -2583,11 +2690,14 @@ function mergeConfig(config1, config2) {
2583
2690
  config2 = config2 || {};
2584
2691
 
2585
2692
  // Use a null-prototype object so that downstream reads such as `config.auth`
2586
- // or `config.baseURL` cannot inherit polluted values from Object.prototype
2587
- // (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
2588
- // own slot to preserve ergonomics for user code that relies on it.
2693
+ // or `config.baseURL` cannot inherit polluted values from Object.prototype.
2694
+ // `hasOwnProperty` is restored as a non-enumerable own slot to preserve
2695
+ // ergonomics for user code that relies on it.
2589
2696
  const config = Object.create(null);
2590
2697
  Object.defineProperty(config, 'hasOwnProperty', {
2698
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
2699
+ // this data descriptor into an accessor descriptor on the way in.
2700
+ __proto__: null,
2591
2701
  value: Object.prototype.hasOwnProperty,
2592
2702
  enumerable: false,
2593
2703
  writable: true,
@@ -2684,11 +2794,39 @@ function mergeConfig(config1, config2) {
2684
2794
  return config;
2685
2795
  }
2686
2796
 
2797
+ const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
2798
+
2799
+ function setFormDataHeaders(headers, formHeaders, policy) {
2800
+ if (policy !== 'content-only') {
2801
+ headers.set(formHeaders);
2802
+ return;
2803
+ }
2804
+
2805
+ Object.entries(formHeaders).forEach(([key, val]) => {
2806
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
2807
+ headers.set(key, val);
2808
+ }
2809
+ });
2810
+ }
2811
+
2812
+ /**
2813
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
2814
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
2815
+ *
2816
+ * @param {string} str The string to encode
2817
+ *
2818
+ * @returns {string} UTF-8 bytes as a Latin-1 string
2819
+ */
2820
+ const encodeUTF8 = (str) =>
2821
+ encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
2822
+ String.fromCharCode(parseInt(hex, 16))
2823
+ );
2824
+
2687
2825
  var resolveConfig = (config) => {
2688
2826
  const newConfig = mergeConfig({}, config);
2689
2827
 
2690
2828
  // Read only own properties to prevent prototype pollution gadgets
2691
- // (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
2829
+ // (e.g. Object.prototype.baseURL = 'https://evil.com').
2692
2830
  const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
2693
2831
 
2694
2832
  const data = own('data');
@@ -2714,11 +2852,7 @@ var resolveConfig = (config) => {
2714
2852
  headers.set(
2715
2853
  'Authorization',
2716
2854
  'Basic ' +
2717
- btoa(
2718
- (auth.username || '') +
2719
- ':' +
2720
- (auth.password ? unescape(encodeURIComponent(auth.password)) : '')
2721
- )
2855
+ btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8(auth.password) : ''))
2722
2856
  );
2723
2857
  }
2724
2858
 
@@ -2727,14 +2861,7 @@ var resolveConfig = (config) => {
2727
2861
  headers.setContentType(undefined); // browser handles it
2728
2862
  } else if (utils$1.isFunction(data.getHeaders)) {
2729
2863
  // Node.js FormData (like form-data package)
2730
- const formHeaders = data.getHeaders();
2731
- // Only set safe headers to avoid overwriting security headers
2732
- const allowedHeaders = ['content-type', 'content-length'];
2733
- Object.entries(formHeaders).forEach(([key, val]) => {
2734
- if (allowedHeaders.includes(key.toLowerCase())) {
2735
- headers.set(key, val);
2736
- }
2737
- });
2864
+ setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
2738
2865
  }
2739
2866
  }
2740
2867
 
@@ -2749,10 +2876,9 @@ var resolveConfig = (config) => {
2749
2876
 
2750
2877
  // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
2751
2878
  // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
2752
- // the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
2879
+ // the XSRF token cross-origin.
2753
2880
  const shouldSendXSRF =
2754
- withXSRFToken === true ||
2755
- (withXSRFToken == null && isURLSameOrigin(newConfig.url));
2881
+ withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
2756
2882
 
2757
2883
  if (shouldSendXSRF) {
2758
2884
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
@@ -2848,7 +2974,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2848
2974
  // will return status as 0 even though it's a successful request
2849
2975
  if (
2850
2976
  request.status === 0 &&
2851
- !(request.responseURL && request.responseURL.indexOf('file:') === 0)
2977
+ !(request.responseURL && request.responseURL.startsWith('file:'))
2852
2978
  ) {
2853
2979
  return;
2854
2980
  }
@@ -2865,6 +2991,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2865
2991
  }
2866
2992
 
2867
2993
  reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
2994
+ done();
2868
2995
 
2869
2996
  // Clean up request
2870
2997
  request = null;
@@ -2880,6 +3007,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2880
3007
  // attach the underlying event for consumers who want details
2881
3008
  err.event = event || null;
2882
3009
  reject(err);
3010
+ done();
2883
3011
  request = null;
2884
3012
  };
2885
3013
 
@@ -2900,6 +3028,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2900
3028
  request
2901
3029
  )
2902
3030
  );
3031
+ done();
2903
3032
 
2904
3033
  // Clean up request
2905
3034
  request = null;
@@ -2949,6 +3078,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2949
3078
  }
2950
3079
  reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
2951
3080
  request.abort();
3081
+ done();
2952
3082
  request = null;
2953
3083
  };
2954
3084
 
@@ -2962,7 +3092,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2962
3092
 
2963
3093
  const protocol = parseProtocol(_config.url);
2964
3094
 
2965
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
3095
+ if (protocol && !platform.protocols.includes(protocol)) {
2966
3096
  reject(
2967
3097
  new AxiosError(
2968
3098
  'Unsupported protocol ' + protocol + ':',
@@ -3119,16 +3249,112 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
3119
3249
  );
3120
3250
  };
3121
3251
 
3122
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
3252
+ /**
3253
+ * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
3254
+ * - For base64: compute exact decoded size using length and padding;
3255
+ * handle %XX at the character-count level (no string allocation).
3256
+ * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
3257
+ *
3258
+ * @param {string} url
3259
+ * @returns {number}
3260
+ */
3261
+ function estimateDataURLDecodedBytes(url) {
3262
+ if (!url || typeof url !== 'string') return 0;
3263
+ if (!url.startsWith('data:')) return 0;
3264
+
3265
+ const comma = url.indexOf(',');
3266
+ if (comma < 0) return 0;
3267
+
3268
+ const meta = url.slice(5, comma);
3269
+ const body = url.slice(comma + 1);
3270
+ const isBase64 = /;base64/i.test(meta);
3271
+
3272
+ if (isBase64) {
3273
+ let effectiveLen = body.length;
3274
+ const len = body.length; // cache length
3275
+
3276
+ for (let i = 0; i < len; i++) {
3277
+ if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
3278
+ const a = body.charCodeAt(i + 1);
3279
+ const b = body.charCodeAt(i + 2);
3280
+ const isHex =
3281
+ ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
3282
+ ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
3283
+
3284
+ if (isHex) {
3285
+ effectiveLen -= 2;
3286
+ i += 2;
3287
+ }
3288
+ }
3289
+ }
3123
3290
 
3124
- const { isFunction } = utils$1;
3291
+ let pad = 0;
3292
+ let idx = len - 1;
3293
+
3294
+ const tailIsPct3D = (j) =>
3295
+ j >= 2 &&
3296
+ body.charCodeAt(j - 2) === 37 && // '%'
3297
+ body.charCodeAt(j - 1) === 51 && // '3'
3298
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
3299
+
3300
+ if (idx >= 0) {
3301
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
3302
+ pad++;
3303
+ idx--;
3304
+ } else if (tailIsPct3D(idx)) {
3305
+ pad++;
3306
+ idx -= 3;
3307
+ }
3308
+ }
3309
+
3310
+ if (pad === 1 && idx >= 0) {
3311
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
3312
+ pad++;
3313
+ } else if (tailIsPct3D(idx)) {
3314
+ pad++;
3315
+ }
3316
+ }
3317
+
3318
+ const groups = Math.floor(effectiveLen / 4);
3319
+ const bytes = groups * 3 - (pad || 0);
3320
+ return bytes > 0 ? bytes : 0;
3321
+ }
3322
+
3323
+ if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') {
3324
+ return Buffer.byteLength(body, 'utf8');
3325
+ }
3326
+
3327
+ // Compute UTF-8 byte length directly from UTF-16 code units without allocating
3328
+ // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
3329
+ // Using body.length here would undercount non-ASCII (e.g. '€' is 1 code unit
3330
+ // but 3 UTF-8 bytes).
3331
+ let bytes = 0;
3332
+ for (let i = 0, len = body.length; i < len; i++) {
3333
+ const c = body.charCodeAt(i);
3334
+ if (c < 0x80) {
3335
+ bytes += 1;
3336
+ } else if (c < 0x800) {
3337
+ bytes += 2;
3338
+ } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
3339
+ const next = body.charCodeAt(i + 1);
3340
+ if (next >= 0xdc00 && next <= 0xdfff) {
3341
+ bytes += 4;
3342
+ i++;
3343
+ } else {
3344
+ bytes += 3;
3345
+ }
3346
+ } else {
3347
+ bytes += 3;
3348
+ }
3349
+ }
3350
+ return bytes;
3351
+ }
3352
+
3353
+ const VERSION = "1.16.0";
3125
3354
 
3126
- const globalFetchAPI = (({ Request, Response }) => ({
3127
- Request,
3128
- Response,
3129
- }))(utils$1.global);
3355
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
3130
3356
 
3131
- const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
3357
+ const { isFunction } = utils$1;
3132
3358
 
3133
3359
  const test = (fn, ...args) => {
3134
3360
  try {
@@ -3139,11 +3365,17 @@ const test = (fn, ...args) => {
3139
3365
  };
3140
3366
 
3141
3367
  const factory = (env) => {
3368
+ const globalObject = utils$1.global ?? globalThis;
3369
+ const { ReadableStream, TextEncoder } = globalObject;
3370
+
3142
3371
  env = utils$1.merge.call(
3143
3372
  {
3144
3373
  skipUndefined: true,
3145
3374
  },
3146
- globalFetchAPI,
3375
+ {
3376
+ Request: globalObject.Request,
3377
+ Response: globalObject.Response,
3378
+ },
3147
3379
  env
3148
3380
  );
3149
3381
 
@@ -3156,7 +3388,7 @@ const factory = (env) => {
3156
3388
  return false;
3157
3389
  }
3158
3390
 
3159
- const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
3391
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
3160
3392
 
3161
3393
  const encodeText =
3162
3394
  isFetchSupported &&
@@ -3174,7 +3406,7 @@ const factory = (env) => {
3174
3406
  let duplexAccessed = false;
3175
3407
 
3176
3408
  const request = new Request(platform.origin, {
3177
- body: new ReadableStream$1(),
3409
+ body: new ReadableStream(),
3178
3410
  method: 'POST',
3179
3411
  get duplex() {
3180
3412
  duplexAccessed = true;
@@ -3270,8 +3502,13 @@ const factory = (env) => {
3270
3502
  headers,
3271
3503
  withCredentials = 'same-origin',
3272
3504
  fetchOptions,
3505
+ maxContentLength,
3506
+ maxBodyLength,
3273
3507
  } = resolveConfig(config);
3274
3508
 
3509
+ const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
3510
+ const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
3511
+
3275
3512
  let _fetch = envFetch || fetch;
3276
3513
 
3277
3514
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
@@ -3293,6 +3530,41 @@ const factory = (env) => {
3293
3530
  let requestContentLength;
3294
3531
 
3295
3532
  try {
3533
+ // Enforce maxContentLength for data: URLs up-front so we never materialize
3534
+ // an oversized payload. The HTTP adapter applies the same check (see http.js
3535
+ // "if (protocol === 'data:')" branch).
3536
+ if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
3537
+ const estimated = estimateDataURLDecodedBytes(url);
3538
+ if (estimated > maxContentLength) {
3539
+ throw new AxiosError(
3540
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
3541
+ AxiosError.ERR_BAD_RESPONSE,
3542
+ config,
3543
+ request
3544
+ );
3545
+ }
3546
+ }
3547
+
3548
+ // Enforce maxBodyLength against the outbound request body before dispatch.
3549
+ // Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than
3550
+ // maxBodyLength limit'). Skip when the body length cannot be determined
3551
+ // (e.g. a live ReadableStream supplied by the caller).
3552
+ if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
3553
+ const outboundLength = await resolveBodyLength(headers, data);
3554
+ if (
3555
+ typeof outboundLength === 'number' &&
3556
+ isFinite(outboundLength) &&
3557
+ outboundLength > maxBodyLength
3558
+ ) {
3559
+ throw new AxiosError(
3560
+ 'Request body larger than maxBodyLength limit',
3561
+ AxiosError.ERR_BAD_REQUEST,
3562
+ config,
3563
+ request
3564
+ );
3565
+ }
3566
+ }
3567
+
3296
3568
  if (
3297
3569
  onUploadProgress &&
3298
3570
  supportsRequestStream &&
@@ -3343,6 +3615,9 @@ const factory = (env) => {
3343
3615
  }
3344
3616
  }
3345
3617
 
3618
+ // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
3619
+ headers.set('User-Agent', 'axios/' + VERSION, false);
3620
+
3346
3621
  const resolvedOptions = {
3347
3622
  ...fetchOptions,
3348
3623
  signal: composedSignal,
@@ -3359,10 +3634,28 @@ const factory = (env) => {
3359
3634
  ? _fetch(request, fetchOptions)
3360
3635
  : _fetch(url, resolvedOptions));
3361
3636
 
3637
+ // Cheap pre-check: if the server honestly declares a content-length that
3638
+ // already exceeds the cap, reject before we start streaming.
3639
+ if (hasMaxContentLength) {
3640
+ const declaredLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
3641
+ if (declaredLength != null && declaredLength > maxContentLength) {
3642
+ throw new AxiosError(
3643
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
3644
+ AxiosError.ERR_BAD_RESPONSE,
3645
+ config,
3646
+ request
3647
+ );
3648
+ }
3649
+ }
3650
+
3362
3651
  const isStreamResponse =
3363
3652
  supportsResponseStream && (responseType === 'stream' || responseType === 'response');
3364
3653
 
3365
- if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
3654
+ if (
3655
+ supportsResponseStream &&
3656
+ response.body &&
3657
+ (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))
3658
+ ) {
3366
3659
  const options = {};
3367
3660
 
3368
3661
  ['status', 'statusText', 'headers'].forEach((prop) => {
@@ -3379,8 +3672,24 @@ const factory = (env) => {
3379
3672
  )) ||
3380
3673
  [];
3381
3674
 
3675
+ let bytesRead = 0;
3676
+ const onChunkProgress = (loadedBytes) => {
3677
+ if (hasMaxContentLength) {
3678
+ bytesRead = loadedBytes;
3679
+ if (bytesRead > maxContentLength) {
3680
+ throw new AxiosError(
3681
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
3682
+ AxiosError.ERR_BAD_RESPONSE,
3683
+ config,
3684
+ request
3685
+ );
3686
+ }
3687
+ }
3688
+ onProgress && onProgress(loadedBytes);
3689
+ };
3690
+
3382
3691
  response = new Response(
3383
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
3692
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
3384
3693
  flush && flush();
3385
3694
  unsubscribe && unsubscribe();
3386
3695
  }),
@@ -3395,6 +3704,33 @@ const factory = (env) => {
3395
3704
  config
3396
3705
  );
3397
3706
 
3707
+ // Fallback enforcement for environments without ReadableStream support
3708
+ // (legacy runtimes). Detect materialized size from typed output; skip
3709
+ // streams/Response passthrough since the user will read those themselves.
3710
+ if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
3711
+ let materializedSize;
3712
+ if (responseData != null) {
3713
+ if (typeof responseData.byteLength === 'number') {
3714
+ materializedSize = responseData.byteLength;
3715
+ } else if (typeof responseData.size === 'number') {
3716
+ materializedSize = responseData.size;
3717
+ } else if (typeof responseData === 'string') {
3718
+ materializedSize =
3719
+ typeof TextEncoder === 'function'
3720
+ ? new TextEncoder().encode(responseData).byteLength
3721
+ : responseData.length;
3722
+ }
3723
+ }
3724
+ if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
3725
+ throw new AxiosError(
3726
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
3727
+ AxiosError.ERR_BAD_RESPONSE,
3728
+ config,
3729
+ request
3730
+ );
3731
+ }
3732
+ }
3733
+
3398
3734
  !isStreamResponse && unsubscribe && unsubscribe();
3399
3735
 
3400
3736
  return await new Promise((resolve, reject) => {
@@ -3410,6 +3746,17 @@ const factory = (env) => {
3410
3746
  } catch (err) {
3411
3747
  unsubscribe && unsubscribe();
3412
3748
 
3749
+ // Safari can surface fetch aborts as a DOMException-like object whose
3750
+ // branded getters throw. Prefer our composed signal reason before reading
3751
+ // the caught error, preserving timeout vs cancellation semantics.
3752
+ if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {
3753
+ const canceledError = composedSignal.reason;
3754
+ canceledError.config = config;
3755
+ request && (canceledError.request = request);
3756
+ err !== canceledError && (canceledError.cause = err);
3757
+ throw canceledError;
3758
+ }
3759
+
3413
3760
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
3414
3761
  throw Object.assign(
3415
3762
  new AxiosError(
@@ -3478,11 +3825,13 @@ const knownAdapters = {
3478
3825
  utils$1.forEach(knownAdapters, (fn, value) => {
3479
3826
  if (fn) {
3480
3827
  try {
3481
- Object.defineProperty(fn, 'name', { value });
3828
+ // Null-proto descriptors so a polluted Object.prototype.get cannot turn
3829
+ // these data descriptors into accessor descriptors on the way in.
3830
+ Object.defineProperty(fn, 'name', { __proto__: null, value });
3482
3831
  } catch (e) {
3483
3832
  // eslint-disable-next-line no-empty
3484
3833
  }
3485
- Object.defineProperty(fn, 'adapterName', { value });
3834
+ Object.defineProperty(fn, 'adapterName', { __proto__: null, value });
3486
3835
  }
3487
3836
  });
3488
3837
 
@@ -3624,8 +3973,15 @@ function dispatchRequest(config) {
3624
3973
  function onAdapterResolution(response) {
3625
3974
  throwIfCancellationRequested(config);
3626
3975
 
3627
- // Transform response data
3628
- response.data = transformData.call(config, config.transformResponse, response);
3976
+ // Expose the current response on config so that transformResponse can
3977
+ // attach it to any AxiosError it throws (e.g. on JSON parse failure).
3978
+ // We clean it up afterwards to avoid polluting the config object.
3979
+ config.response = response;
3980
+ try {
3981
+ response.data = transformData.call(config, config.transformResponse, response);
3982
+ } finally {
3983
+ delete config.response;
3984
+ }
3629
3985
 
3630
3986
  response.headers = AxiosHeaders.from(response.headers);
3631
3987
 
@@ -3637,11 +3993,16 @@ function dispatchRequest(config) {
3637
3993
 
3638
3994
  // Transform response data
3639
3995
  if (reason && reason.response) {
3640
- reason.response.data = transformData.call(
3641
- config,
3642
- config.transformResponse,
3643
- reason.response
3644
- );
3996
+ config.response = reason.response;
3997
+ try {
3998
+ reason.response.data = transformData.call(
3999
+ config,
4000
+ config.transformResponse,
4001
+ reason.response
4002
+ );
4003
+ } finally {
4004
+ delete config.response;
4005
+ }
3645
4006
  reason.response.headers = AxiosHeaders.from(reason.response.headers);
3646
4007
  }
3647
4008
  }
@@ -3651,8 +4012,6 @@ function dispatchRequest(config) {
3651
4012
  );
3652
4013
  }
3653
4014
 
3654
- const VERSION = "1.15.2";
3655
-
3656
4015
  const validators$1 = {};
3657
4016
 
3658
4017
  // eslint-disable-next-line func-names
@@ -3737,7 +4096,7 @@ function assertOptions(options, schema, allowUnknown) {
3737
4096
  while (i-- > 0) {
3738
4097
  const opt = keys[i];
3739
4098
  // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
3740
- // a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
4099
+ // a non-function validator and cause a TypeError.
3741
4100
  const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
3742
4101
  if (validator) {
3743
4102
  const value = options[opt];
@@ -3897,7 +4256,7 @@ class Axios {
3897
4256
  let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
3898
4257
 
3899
4258
  headers &&
3900
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
4259
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {
3901
4260
  delete headers[method];
3902
4261
  });
3903
4262
 
@@ -4000,7 +4359,7 @@ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa
4000
4359
  };
4001
4360
  });
4002
4361
 
4003
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
4362
+ utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
4004
4363
  function generateHTTPMethod(isForm) {
4005
4364
  return function httpMethod(url, data, config) {
4006
4365
  return this.request(
@@ -4020,7 +4379,11 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
4020
4379
 
4021
4380
  Axios.prototype[method] = generateHTTPMethod();
4022
4381
 
4023
- Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
4382
+ // QUERY is a safe/idempotent read method; multipart form bodies don't fit
4383
+ // its semantics, so no queryForm shorthand is generated.
4384
+ if (method !== 'query') {
4385
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
4386
+ }
4024
4387
  });
4025
4388
 
4026
4389
  /**