@wopee-io/wopee.wdio 4.0.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/build/adapter/fullPageScreenshotAdapter/default.d.ts +4 -0
  2. package/build/adapter/fullPageScreenshotAdapter/default.d.ts.map +1 -0
  3. package/build/adapter/fullPageScreenshotAdapter/default.js +13 -0
  4. package/build/adapter/fullPageScreenshotAdapter/default.js.map +1 -0
  5. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.d.ts +1 -9
  6. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.d.ts.map +1 -1
  7. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.interface.d.ts +24 -0
  8. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.interface.d.ts.map +1 -0
  9. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.interface.js +2 -0
  10. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.interface.js.map +1 -0
  11. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.js +8 -18
  12. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.js.map +1 -1
  13. package/build/adapter/fullPageScreenshotAdapter/swipe.d.ts +4 -0
  14. package/build/adapter/fullPageScreenshotAdapter/swipe.d.ts.map +1 -0
  15. package/build/adapter/fullPageScreenshotAdapter/swipe.js +19 -0
  16. package/build/adapter/fullPageScreenshotAdapter/swipe.js.map +1 -0
  17. package/build/core/domain/valueObjects/track.interface.d.ts +7 -3
  18. package/build/core/domain/valueObjects/track.interface.d.ts.map +1 -1
  19. package/build/core/domain/valueObjects/track.interface.js.map +1 -1
  20. package/build/{port/clientSideOperationPort → core/ports}/clientSideOperationPort.d.ts +1 -1
  21. package/build/core/ports/clientSideOperationPort.d.ts.map +1 -0
  22. package/build/core/ports/clientSideOperationPort.js.map +1 -0
  23. package/build/domain/model/config.interface.d.ts +2 -2
  24. package/build/domain/model/config.interface.d.ts.map +1 -1
  25. package/build/domain/model/config.interface.js.map +1 -1
  26. package/build/domain/model/instances.interface.d.ts +2 -2
  27. package/build/domain/model/instances.interface.d.ts.map +1 -1
  28. package/build/domain/model/instances.interface.js.map +1 -1
  29. package/build/domain/model/screenshotOutput.interface.d.ts +2 -2
  30. package/build/domain/model/screenshotOutput.interface.d.ts.map +1 -1
  31. package/build/domain/model/screenshotOutput.interface.js.map +1 -1
  32. package/build/domain/model/service.interface.d.ts +2 -2
  33. package/build/domain/model/service.interface.d.ts.map +1 -1
  34. package/build/domain/model/service.interface.js.map +1 -1
  35. package/build/domain/service/afterScreenshot.js.map +1 -1
  36. package/build/domain/service/wopeeService.d.ts +5 -5
  37. package/build/domain/service/wopeeService.d.ts.map +1 -1
  38. package/build/domain/service/wopeeService.js +17 -14
  39. package/build/domain/service/wopeeService.js.map +1 -1
  40. package/build/index.d.ts +3 -0
  41. package/build/index.d.ts.map +1 -1
  42. package/build/index.js +3 -0
  43. package/build/index.js.map +1 -1
  44. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.d.ts.map +1 -0
  45. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.js.map +1 -0
  46. package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.d.ts +1 -1
  47. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.d.ts.map +1 -0
  48. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.js.map +1 -0
  49. package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.d.ts +1 -1
  50. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.d.ts.map +1 -0
  51. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.js.map +1 -0
  52. package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.d.ts +1 -1
  53. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.d.ts.map +1 -0
  54. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.js.map +1 -0
  55. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.d.ts.map +1 -0
  56. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.js.map +1 -0
  57. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.d.ts.map +1 -0
  58. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.js.map +1 -0
  59. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.d.ts.map +1 -0
  60. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.js.map +1 -0
  61. package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.d.ts +4 -4
  62. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.d.ts.map +1 -0
  63. package/build/infrastructure/adapters/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.js.map +1 -0
  64. package/build/{adapter/driven → infrastructure/adapters}/wdioLoggerAdapter/wdioLoggerAdapter.d.ts +1 -1
  65. package/build/infrastructure/adapters/wdioLoggerAdapter/wdioLoggerAdapter.d.ts.map +1 -0
  66. package/build/{adapter → infrastructure/adapters}/wdioLoggerAdapter/wdioLoggerAdapter.js +1 -1
  67. package/build/infrastructure/adapters/wdioLoggerAdapter/wdioLoggerAdapter.js.map +1 -0
  68. package/build/utils/versionMetadata.js +2 -2
  69. package/docs/mobile_native.md +14 -1
  70. package/node_modules/@autonomous-testing/sdk/.commit.hbs +71 -0
  71. package/node_modules/@autonomous-testing/sdk/.github/workflows/ci_cd.yaml +12 -0
  72. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationScenarioPayload.interface.d.ts +14 -0
  73. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationScenarioPayload.interface.js +10 -0
  74. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationStepPayload.interface.d.ts +32 -0
  75. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationStepPayload.interface.js +16 -0
  76. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationSuitePayload.interface.d.ts +11 -0
  77. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationSuitePayload.interface.js +9 -0
  78. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/index.d.ts +14 -0
  79. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/index.js +16 -0
  80. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationScenario.interface.d.ts +14 -0
  81. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationScenario.interface.js +10 -0
  82. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationStep.interface.d.ts +24 -0
  83. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationStep.interface.js +20 -0
  84. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationSuite.interface.d.ts +14 -0
  85. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationSuite.interface.js +10 -0
  86. package/node_modules/@autonomous-testing/sdk/build/core/domain/index.d.ts +1 -1
  87. package/node_modules/@autonomous-testing/sdk/build/core/domain/index.js +1 -1
  88. package/node_modules/@autonomous-testing/sdk/build/core/index.d.ts +2 -2
  89. package/node_modules/@autonomous-testing/sdk/build/core/index.js +2 -2
  90. package/node_modules/@autonomous-testing/sdk/build/core/ports/api.d.ts +16 -0
  91. package/node_modules/@autonomous-testing/sdk/build/core/ports/api.js +7 -0
  92. package/node_modules/@autonomous-testing/sdk/build/core/ports/index.d.ts +3 -3
  93. package/node_modules/@autonomous-testing/sdk/build/core/ports/index.js +5 -5
  94. package/node_modules/@autonomous-testing/sdk/build/index.d.ts +4 -3
  95. package/node_modules/@autonomous-testing/sdk/build/index.js +5 -3
  96. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/adapter.d.ts +19 -0
  97. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/adapter.js +123 -0
  98. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/factories.d.ts +9 -0
  99. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/factories.js +144 -0
  100. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/index.d.ts +4 -0
  101. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/index.js +8 -0
  102. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/interface.d.ts +235 -0
  103. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/interface.js +82 -0
  104. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/mutations.d.ts +5 -0
  105. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/{apolloTrackAdapter/apolloTrackAdapterQueries.js → apolloAdapter/mutations.js} +19 -36
  106. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/consoleLogger/consoleLogger.d.ts +1 -1
  107. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/consoleLogger/index.d.ts +1 -1
  108. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/consoleLogger/index.js +2 -2
  109. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/index.d.ts +3 -3
  110. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/index.js +3 -3
  111. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/noLogger/index.d.ts +1 -1
  112. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/noLogger/index.js +2 -2
  113. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/noLogger/noLogger.d.ts +1 -1
  114. package/node_modules/@autonomous-testing/sdk/build/infrastructure/index.d.ts +2 -2
  115. package/node_modules/@autonomous-testing/sdk/build/infrastructure/index.js +2 -2
  116. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloAdapterService/apolloAdapterService.d.ts +4 -0
  117. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloAdapterService/apolloAdapterService.js +12 -0
  118. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloAdapterService/apolloService.interface.d.ts +7 -0
  119. package/node_modules/@autonomous-testing/sdk/build/{core/domain/valueObjects/index.js → infrastructure/services/apolloAdapterService/apolloService.interface.js} +1 -1
  120. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloAdapterService/index.d.ts +4 -0
  121. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloAdapterService/index.js +6 -0
  122. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/index.d.ts +2 -2
  123. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/index.js +2 -2
  124. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerOptions.interface.d.ts +16 -2
  125. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerOptions.interface.js +12 -0
  126. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerService.d.ts +2 -2
  127. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerService.js +17 -9
  128. package/node_modules/@autonomous-testing/sdk/build/shared/index.d.ts +2 -2
  129. package/node_modules/@autonomous-testing/sdk/build/shared/index.js +2 -2
  130. package/node_modules/@autonomous-testing/sdk/build/shared/metadata/versionMetadata.js +2 -2
  131. package/node_modules/@autonomous-testing/sdk/build/shared/utils/index.d.ts +3 -2
  132. package/node_modules/@autonomous-testing/sdk/build/shared/utils/index.js +4 -3
  133. package/node_modules/@autonomous-testing/sdk/build/shared/utils/mergeDicts/index.d.ts +3 -0
  134. package/node_modules/@autonomous-testing/sdk/build/shared/utils/mergeDicts/index.js +7 -0
  135. package/node_modules/@autonomous-testing/sdk/build/shared/utils/mergeDicts/mergeDicts.d.ts +17 -0
  136. package/node_modules/@autonomous-testing/sdk/build/shared/utils/mergeDicts/mergeDicts.js +29 -0
  137. package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/index.d.ts +1 -1
  138. package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/index.js +2 -2
  139. package/node_modules/@autonomous-testing/sdk/package.json +5 -8
  140. package/node_modules/@autonomous-testing/sdk/release.config.mjs +55 -0
  141. package/node_modules/axios/CHANGELOG.md +941 -950
  142. package/node_modules/axios/LICENSE +16 -4
  143. package/node_modules/axios/README.md +124 -828
  144. package/node_modules/axios/SECURITY.md +3 -4
  145. package/node_modules/axios/UPGRADE_GUIDE.md +168 -0
  146. package/node_modules/axios/dist/axios.js +2343 -3920
  147. package/node_modules/axios/dist/axios.map +1 -0
  148. package/node_modules/axios/dist/axios.min.js +3 -2
  149. package/node_modules/axios/dist/axios.min.map +1 -0
  150. package/node_modules/axios/index.d.ts +83 -391
  151. package/node_modules/axios/index.js +1 -43
  152. package/node_modules/axios/lib/adapters/http.js +219 -480
  153. package/node_modules/axios/lib/adapters/xhr.js +93 -61
  154. package/node_modules/axios/lib/axios.js +22 -47
  155. package/node_modules/axios/lib/cancel/CancelToken.js +89 -91
  156. package/node_modules/axios/lib/cancel/CanceledError.js +6 -9
  157. package/node_modules/axios/lib/cancel/isCancel.js +2 -2
  158. package/node_modules/axios/lib/core/Axios.js +98 -166
  159. package/node_modules/axios/lib/core/AxiosError.js +9 -23
  160. package/node_modules/axios/lib/core/InterceptorManager.js +45 -62
  161. package/node_modules/axios/lib/core/buildFullPath.js +4 -5
  162. package/node_modules/axios/lib/core/dispatchRequest.js +32 -26
  163. package/node_modules/axios/lib/core/mergeConfig.js +53 -59
  164. package/node_modules/axios/lib/core/settle.js +4 -6
  165. package/node_modules/axios/lib/core/transformData.js +9 -15
  166. package/node_modules/axios/lib/defaults/env/FormData.js +2 -0
  167. package/node_modules/axios/lib/defaults/index.js +57 -72
  168. package/node_modules/axios/lib/defaults/transitional.js +1 -1
  169. package/node_modules/axios/lib/env/data.js +3 -1
  170. package/node_modules/axios/lib/helpers/bind.js +7 -3
  171. package/node_modules/axios/lib/helpers/buildURL.js +33 -26
  172. package/node_modules/axios/lib/helpers/combineURLs.js +3 -4
  173. package/node_modules/axios/lib/helpers/cookies.js +50 -39
  174. package/node_modules/axios/lib/helpers/deprecatedMethod.js +2 -4
  175. package/node_modules/axios/lib/helpers/isAbsoluteURL.js +2 -3
  176. package/node_modules/axios/lib/helpers/isAxiosError.js +3 -4
  177. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +46 -45
  178. package/node_modules/axios/lib/helpers/normalizeHeaderName.js +12 -0
  179. package/node_modules/axios/lib/helpers/null.js +1 -1
  180. package/node_modules/axios/lib/helpers/parseHeaders.js +22 -24
  181. package/node_modules/axios/lib/helpers/parseProtocol.js +3 -3
  182. package/node_modules/axios/lib/helpers/spread.js +2 -3
  183. package/node_modules/axios/lib/helpers/toFormData.js +36 -183
  184. package/node_modules/axios/lib/helpers/validator.js +15 -20
  185. package/node_modules/axios/lib/utils.js +187 -445
  186. package/node_modules/axios/package.json +33 -165
  187. package/node_modules/axios/tsconfig.json +14 -0
  188. package/node_modules/axios/tslint.json +6 -0
  189. package/node_modules/process/.eslintrc +21 -0
  190. package/node_modules/process/LICENSE +22 -0
  191. package/node_modules/process/README.md +26 -0
  192. package/node_modules/process/browser.js +184 -0
  193. package/node_modules/process/index.js +2 -0
  194. package/node_modules/process/package.json +27 -0
  195. package/node_modules/process/test.js +199 -0
  196. package/package.json +2 -2
  197. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.d.ts.map +0 -1
  198. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.js.map +0 -1
  199. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.d.ts.map +0 -1
  200. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.js.map +0 -1
  201. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.d.ts.map +0 -1
  202. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.js.map +0 -1
  203. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.d.ts.map +0 -1
  204. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.js.map +0 -1
  205. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.d.ts.map +0 -1
  206. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.js.map +0 -1
  207. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.d.ts.map +0 -1
  208. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.js.map +0 -1
  209. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.d.ts.map +0 -1
  210. package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.js.map +0 -1
  211. package/build/adapter/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.d.ts.map +0 -1
  212. package/build/adapter/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.js.map +0 -1
  213. package/build/adapter/driven/wdioLoggerAdapter/wdioLoggerAdapter.d.ts.map +0 -1
  214. package/build/adapter/driven/wdioLoggerAdapter/wdioLoggerAdapter.js +0 -20
  215. package/build/adapter/driven/wdioLoggerAdapter/wdioLoggerAdapter.js.map +0 -1
  216. package/build/adapter/wdioLoggerAdapter/wdioLoggerAdapter.d.ts +0 -10
  217. package/build/adapter/wdioLoggerAdapter/wdioLoggerAdapter.d.ts.map +0 -1
  218. package/build/adapter/wdioLoggerAdapter/wdioLoggerAdapter.js.map +0 -1
  219. package/build/port/clientSideOperationPort/clientSideOperationPort.d.ts.map +0 -1
  220. package/build/port/clientSideOperationPort/clientSideOperationPort.js.map +0 -1
  221. package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/imageTrackingResult.interface.d.ts +0 -3
  222. package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/imageTrackingResult.interface.js +0 -3
  223. package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/index.d.ts +0 -4
  224. package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/trackPayload.interface.d.ts +0 -3
  225. package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/trackPayload.interface.js +0 -3
  226. package/node_modules/@autonomous-testing/sdk/build/core/ports/imageTracker.d.ts +0 -6
  227. package/node_modules/@autonomous-testing/sdk/build/core/ports/imageTracker.js +0 -7
  228. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.d.ts +0 -39
  229. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.default.d.ts +0 -16
  230. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.default.js +0 -31
  231. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.interface.d.ts +0 -93
  232. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.interface.js +0 -14
  233. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.js +0 -153
  234. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapterQueries.d.ts +0 -5
  235. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapterUtils.d.ts +0 -9
  236. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapterUtils.js +0 -26
  237. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/index.d.ts +0 -7
  238. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/index.js +0 -8
  239. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.d.ts +0 -4
  240. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.interface.d.ts +0 -51
  241. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.interface.js +0 -24
  242. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.js +0 -13
  243. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/index.d.ts +0 -4
  244. package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/index.js +0 -6
  245. package/node_modules/axios/MIGRATION_GUIDE.md +0 -3
  246. package/node_modules/axios/dist/axios.js.map +0 -1
  247. package/node_modules/axios/dist/axios.min.js.map +0 -1
  248. package/node_modules/axios/dist/browser/axios.cjs +0 -3638
  249. package/node_modules/axios/dist/browser/axios.cjs.map +0 -1
  250. package/node_modules/axios/dist/esm/axios.js +0 -3661
  251. package/node_modules/axios/dist/esm/axios.js.map +0 -1
  252. package/node_modules/axios/dist/esm/axios.min.js +0 -2
  253. package/node_modules/axios/dist/esm/axios.min.js.map +0 -1
  254. package/node_modules/axios/dist/node/axios.cjs +0 -4705
  255. package/node_modules/axios/dist/node/axios.cjs.map +0 -1
  256. package/node_modules/axios/index.d.cts +0 -545
  257. package/node_modules/axios/lib/adapters/adapters.js +0 -79
  258. package/node_modules/axios/lib/adapters/fetch.js +0 -227
  259. package/node_modules/axios/lib/core/AxiosHeaders.js +0 -302
  260. package/node_modules/axios/lib/env/classes/FormData.js +0 -2
  261. package/node_modules/axios/lib/helpers/AxiosTransformStream.js +0 -192
  262. package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -58
  263. package/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -71
  264. package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +0 -28
  265. package/node_modules/axios/lib/helpers/callbackify.js +0 -16
  266. package/node_modules/axios/lib/helpers/composeSignals.js +0 -46
  267. package/node_modules/axios/lib/helpers/formDataToJSON.js +0 -95
  268. package/node_modules/axios/lib/helpers/formDataToStream.js +0 -111
  269. package/node_modules/axios/lib/helpers/fromDataURI.js +0 -53
  270. package/node_modules/axios/lib/helpers/progressEventReducer.js +0 -32
  271. package/node_modules/axios/lib/helpers/readBlob.js +0 -15
  272. package/node_modules/axios/lib/helpers/resolveConfig.js +0 -57
  273. package/node_modules/axios/lib/helpers/speedometer.js +0 -55
  274. package/node_modules/axios/lib/helpers/throttle.js +0 -35
  275. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -18
  276. package/node_modules/axios/lib/helpers/trackStream.js +0 -55
  277. package/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
  278. package/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
  279. package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -4
  280. package/node_modules/axios/lib/platform/browser/index.js +0 -13
  281. package/node_modules/axios/lib/platform/common/utils.js +0 -50
  282. package/node_modules/axios/lib/platform/index.js +0 -7
  283. package/node_modules/axios/lib/platform/node/classes/FormData.js +0 -3
  284. package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +0 -4
  285. package/node_modules/axios/lib/platform/node/index.js +0 -12
  286. package/node_modules/proxy-from-env/.eslintrc +0 -29
  287. package/node_modules/proxy-from-env/.travis.yml +0 -10
  288. package/node_modules/proxy-from-env/LICENSE +0 -20
  289. package/node_modules/proxy-from-env/README.md +0 -131
  290. package/node_modules/proxy-from-env/index.js +0 -108
  291. package/node_modules/proxy-from-env/package.json +0 -34
  292. package/node_modules/proxy-from-env/test.js +0 -483
  293. /package/build/{port/clientSideOperationPort → core/ports}/clientSideOperationPort.js +0 -0
  294. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.d.ts +0 -0
  295. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.js +0 -0
  296. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.js +0 -0
  297. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.js +0 -0
  298. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.js +0 -0
  299. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.d.ts +0 -0
  300. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.js +0 -0
  301. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.d.ts +0 -0
  302. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.js +0 -0
  303. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.d.ts +0 -0
  304. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.js +0 -0
  305. /package/build/{adapter → infrastructure/adapters}/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.js +0 -0
  306. /package/node_modules/{mime-db → mime-types/node_modules/mime-db}/HISTORY.md +0 -0
  307. /package/node_modules/{mime-db → mime-types/node_modules/mime-db}/LICENSE +0 -0
  308. /package/node_modules/{mime-db → mime-types/node_modules/mime-db}/README.md +0 -0
  309. /package/node_modules/{mime-db → mime-types/node_modules/mime-db}/db.json +0 -0
  310. /package/node_modules/{mime-db → mime-types/node_modules/mime-db}/index.js +0 -0
  311. /package/node_modules/{mime-db → mime-types/node_modules/mime-db}/package.json +0 -0
@@ -1,3661 +0,0 @@
1
- // Axios v1.7.2 Copyright (c) 2024 Matt Zabriskie and contributors
2
- function bind(fn, thisArg) {
3
- return function wrap() {
4
- return fn.apply(thisArg, arguments);
5
- };
6
- }
7
-
8
- // utils is a library of generic helper functions non-specific to axios
9
-
10
- const {toString} = Object.prototype;
11
- const {getPrototypeOf} = Object;
12
-
13
- const kindOf = (cache => thing => {
14
- const str = toString.call(thing);
15
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
16
- })(Object.create(null));
17
-
18
- const kindOfTest = (type) => {
19
- type = type.toLowerCase();
20
- return (thing) => kindOf(thing) === type
21
- };
22
-
23
- const typeOfTest = type => thing => typeof thing === type;
24
-
25
- /**
26
- * Determine if a value is an Array
27
- *
28
- * @param {Object} val The value to test
29
- *
30
- * @returns {boolean} True if value is an Array, otherwise false
31
- */
32
- const {isArray} = Array;
33
-
34
- /**
35
- * Determine if a value is undefined
36
- *
37
- * @param {*} val The value to test
38
- *
39
- * @returns {boolean} True if the value is undefined, otherwise false
40
- */
41
- const isUndefined = typeOfTest('undefined');
42
-
43
- /**
44
- * Determine if a value is a Buffer
45
- *
46
- * @param {*} val The value to test
47
- *
48
- * @returns {boolean} True if value is a Buffer, otherwise false
49
- */
50
- function isBuffer(val) {
51
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
52
- && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
53
- }
54
-
55
- /**
56
- * Determine if a value is an ArrayBuffer
57
- *
58
- * @param {*} val The value to test
59
- *
60
- * @returns {boolean} True if value is an ArrayBuffer, otherwise false
61
- */
62
- const isArrayBuffer = kindOfTest('ArrayBuffer');
63
-
64
-
65
- /**
66
- * Determine if a value is a view on an ArrayBuffer
67
- *
68
- * @param {*} val The value to test
69
- *
70
- * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
71
- */
72
- function isArrayBufferView(val) {
73
- let result;
74
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
75
- result = ArrayBuffer.isView(val);
76
- } else {
77
- result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
78
- }
79
- return result;
80
- }
81
-
82
- /**
83
- * Determine if a value is a String
84
- *
85
- * @param {*} val The value to test
86
- *
87
- * @returns {boolean} True if value is a String, otherwise false
88
- */
89
- const isString = typeOfTest('string');
90
-
91
- /**
92
- * Determine if a value is a Function
93
- *
94
- * @param {*} val The value to test
95
- * @returns {boolean} True if value is a Function, otherwise false
96
- */
97
- const isFunction = typeOfTest('function');
98
-
99
- /**
100
- * Determine if a value is a Number
101
- *
102
- * @param {*} val The value to test
103
- *
104
- * @returns {boolean} True if value is a Number, otherwise false
105
- */
106
- const isNumber = typeOfTest('number');
107
-
108
- /**
109
- * Determine if a value is an Object
110
- *
111
- * @param {*} thing The value to test
112
- *
113
- * @returns {boolean} True if value is an Object, otherwise false
114
- */
115
- const isObject = (thing) => thing !== null && typeof thing === 'object';
116
-
117
- /**
118
- * Determine if a value is a Boolean
119
- *
120
- * @param {*} thing The value to test
121
- * @returns {boolean} True if value is a Boolean, otherwise false
122
- */
123
- const isBoolean = thing => thing === true || thing === false;
124
-
125
- /**
126
- * Determine if a value is a plain Object
127
- *
128
- * @param {*} val The value to test
129
- *
130
- * @returns {boolean} True if value is a plain Object, otherwise false
131
- */
132
- const isPlainObject = (val) => {
133
- if (kindOf(val) !== 'object') {
134
- return false;
135
- }
136
-
137
- const prototype = getPrototypeOf(val);
138
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
139
- };
140
-
141
- /**
142
- * Determine if a value is a Date
143
- *
144
- * @param {*} val The value to test
145
- *
146
- * @returns {boolean} True if value is a Date, otherwise false
147
- */
148
- const isDate = kindOfTest('Date');
149
-
150
- /**
151
- * Determine if a value is a File
152
- *
153
- * @param {*} val The value to test
154
- *
155
- * @returns {boolean} True if value is a File, otherwise false
156
- */
157
- const isFile = kindOfTest('File');
158
-
159
- /**
160
- * Determine if a value is a Blob
161
- *
162
- * @param {*} val The value to test
163
- *
164
- * @returns {boolean} True if value is a Blob, otherwise false
165
- */
166
- const isBlob = kindOfTest('Blob');
167
-
168
- /**
169
- * Determine if a value is a FileList
170
- *
171
- * @param {*} val The value to test
172
- *
173
- * @returns {boolean} True if value is a File, otherwise false
174
- */
175
- const isFileList = kindOfTest('FileList');
176
-
177
- /**
178
- * Determine if a value is a Stream
179
- *
180
- * @param {*} val The value to test
181
- *
182
- * @returns {boolean} True if value is a Stream, otherwise false
183
- */
184
- const isStream = (val) => isObject(val) && isFunction(val.pipe);
185
-
186
- /**
187
- * Determine if a value is a FormData
188
- *
189
- * @param {*} thing The value to test
190
- *
191
- * @returns {boolean} True if value is an FormData, otherwise false
192
- */
193
- const isFormData = (thing) => {
194
- let kind;
195
- return thing && (
196
- (typeof FormData === 'function' && thing instanceof FormData) || (
197
- isFunction(thing.append) && (
198
- (kind = kindOf(thing)) === 'formdata' ||
199
- // detect form-data instance
200
- (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
201
- )
202
- )
203
- )
204
- };
205
-
206
- /**
207
- * Determine if a value is a URLSearchParams object
208
- *
209
- * @param {*} val The value to test
210
- *
211
- * @returns {boolean} True if value is a URLSearchParams object, otherwise false
212
- */
213
- const isURLSearchParams = kindOfTest('URLSearchParams');
214
-
215
- const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
216
-
217
- /**
218
- * Trim excess whitespace off the beginning and end of a string
219
- *
220
- * @param {String} str The String to trim
221
- *
222
- * @returns {String} The String freed of excess whitespace
223
- */
224
- const trim = (str) => str.trim ?
225
- str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
226
-
227
- /**
228
- * Iterate over an Array or an Object invoking a function for each item.
229
- *
230
- * If `obj` is an Array callback will be called passing
231
- * the value, index, and complete array for each item.
232
- *
233
- * If 'obj' is an Object callback will be called passing
234
- * the value, key, and complete object for each property.
235
- *
236
- * @param {Object|Array} obj The object to iterate
237
- * @param {Function} fn The callback to invoke for each item
238
- *
239
- * @param {Boolean} [allOwnKeys = false]
240
- * @returns {any}
241
- */
242
- function forEach(obj, fn, {allOwnKeys = false} = {}) {
243
- // Don't bother if no value provided
244
- if (obj === null || typeof obj === 'undefined') {
245
- return;
246
- }
247
-
248
- let i;
249
- let l;
250
-
251
- // Force an array if not already something iterable
252
- if (typeof obj !== 'object') {
253
- /*eslint no-param-reassign:0*/
254
- obj = [obj];
255
- }
256
-
257
- if (isArray(obj)) {
258
- // Iterate over array values
259
- for (i = 0, l = obj.length; i < l; i++) {
260
- fn.call(null, obj[i], i, obj);
261
- }
262
- } else {
263
- // Iterate over object keys
264
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
265
- const len = keys.length;
266
- let key;
267
-
268
- for (i = 0; i < len; i++) {
269
- key = keys[i];
270
- fn.call(null, obj[key], key, obj);
271
- }
272
- }
273
- }
274
-
275
- function findKey(obj, key) {
276
- key = key.toLowerCase();
277
- const keys = Object.keys(obj);
278
- let i = keys.length;
279
- let _key;
280
- while (i-- > 0) {
281
- _key = keys[i];
282
- if (key === _key.toLowerCase()) {
283
- return _key;
284
- }
285
- }
286
- return null;
287
- }
288
-
289
- const _global = (() => {
290
- /*eslint no-undef:0*/
291
- if (typeof globalThis !== "undefined") return globalThis;
292
- return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
293
- })();
294
-
295
- const isContextDefined = (context) => !isUndefined(context) && context !== _global;
296
-
297
- /**
298
- * Accepts varargs expecting each argument to be an object, then
299
- * immutably merges the properties of each object and returns result.
300
- *
301
- * When multiple objects contain the same key the later object in
302
- * the arguments list will take precedence.
303
- *
304
- * Example:
305
- *
306
- * ```js
307
- * var result = merge({foo: 123}, {foo: 456});
308
- * console.log(result.foo); // outputs 456
309
- * ```
310
- *
311
- * @param {Object} obj1 Object to merge
312
- *
313
- * @returns {Object} Result of all merge properties
314
- */
315
- function merge(/* obj1, obj2, obj3, ... */) {
316
- const {caseless} = isContextDefined(this) && this || {};
317
- const result = {};
318
- const assignValue = (val, key) => {
319
- const targetKey = caseless && findKey(result, key) || key;
320
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
321
- result[targetKey] = merge(result[targetKey], val);
322
- } else if (isPlainObject(val)) {
323
- result[targetKey] = merge({}, val);
324
- } else if (isArray(val)) {
325
- result[targetKey] = val.slice();
326
- } else {
327
- result[targetKey] = val;
328
- }
329
- };
330
-
331
- for (let i = 0, l = arguments.length; i < l; i++) {
332
- arguments[i] && forEach(arguments[i], assignValue);
333
- }
334
- return result;
335
- }
336
-
337
- /**
338
- * Extends object a by mutably adding to it the properties of object b.
339
- *
340
- * @param {Object} a The object to be extended
341
- * @param {Object} b The object to copy properties from
342
- * @param {Object} thisArg The object to bind function to
343
- *
344
- * @param {Boolean} [allOwnKeys]
345
- * @returns {Object} The resulting value of object a
346
- */
347
- const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
348
- forEach(b, (val, key) => {
349
- if (thisArg && isFunction(val)) {
350
- a[key] = bind(val, thisArg);
351
- } else {
352
- a[key] = val;
353
- }
354
- }, {allOwnKeys});
355
- return a;
356
- };
357
-
358
- /**
359
- * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
360
- *
361
- * @param {string} content with BOM
362
- *
363
- * @returns {string} content value without BOM
364
- */
365
- const stripBOM = (content) => {
366
- if (content.charCodeAt(0) === 0xFEFF) {
367
- content = content.slice(1);
368
- }
369
- return content;
370
- };
371
-
372
- /**
373
- * Inherit the prototype methods from one constructor into another
374
- * @param {function} constructor
375
- * @param {function} superConstructor
376
- * @param {object} [props]
377
- * @param {object} [descriptors]
378
- *
379
- * @returns {void}
380
- */
381
- const inherits = (constructor, superConstructor, props, descriptors) => {
382
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
383
- constructor.prototype.constructor = constructor;
384
- Object.defineProperty(constructor, 'super', {
385
- value: superConstructor.prototype
386
- });
387
- props && Object.assign(constructor.prototype, props);
388
- };
389
-
390
- /**
391
- * Resolve object with deep prototype chain to a flat object
392
- * @param {Object} sourceObj source object
393
- * @param {Object} [destObj]
394
- * @param {Function|Boolean} [filter]
395
- * @param {Function} [propFilter]
396
- *
397
- * @returns {Object}
398
- */
399
- const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
400
- let props;
401
- let i;
402
- let prop;
403
- const merged = {};
404
-
405
- destObj = destObj || {};
406
- // eslint-disable-next-line no-eq-null,eqeqeq
407
- if (sourceObj == null) return destObj;
408
-
409
- do {
410
- props = Object.getOwnPropertyNames(sourceObj);
411
- i = props.length;
412
- while (i-- > 0) {
413
- prop = props[i];
414
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
415
- destObj[prop] = sourceObj[prop];
416
- merged[prop] = true;
417
- }
418
- }
419
- sourceObj = filter !== false && getPrototypeOf(sourceObj);
420
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
421
-
422
- return destObj;
423
- };
424
-
425
- /**
426
- * Determines whether a string ends with the characters of a specified string
427
- *
428
- * @param {String} str
429
- * @param {String} searchString
430
- * @param {Number} [position= 0]
431
- *
432
- * @returns {boolean}
433
- */
434
- const endsWith = (str, searchString, position) => {
435
- str = String(str);
436
- if (position === undefined || position > str.length) {
437
- position = str.length;
438
- }
439
- position -= searchString.length;
440
- const lastIndex = str.indexOf(searchString, position);
441
- return lastIndex !== -1 && lastIndex === position;
442
- };
443
-
444
-
445
- /**
446
- * Returns new array from array like object or null if failed
447
- *
448
- * @param {*} [thing]
449
- *
450
- * @returns {?Array}
451
- */
452
- const toArray = (thing) => {
453
- if (!thing) return null;
454
- if (isArray(thing)) return thing;
455
- let i = thing.length;
456
- if (!isNumber(i)) return null;
457
- const arr = new Array(i);
458
- while (i-- > 0) {
459
- arr[i] = thing[i];
460
- }
461
- return arr;
462
- };
463
-
464
- /**
465
- * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
466
- * thing passed in is an instance of Uint8Array
467
- *
468
- * @param {TypedArray}
469
- *
470
- * @returns {Array}
471
- */
472
- // eslint-disable-next-line func-names
473
- const isTypedArray = (TypedArray => {
474
- // eslint-disable-next-line func-names
475
- return thing => {
476
- return TypedArray && thing instanceof TypedArray;
477
- };
478
- })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
479
-
480
- /**
481
- * For each entry in the object, call the function with the key and value.
482
- *
483
- * @param {Object<any, any>} obj - The object to iterate over.
484
- * @param {Function} fn - The function to call for each entry.
485
- *
486
- * @returns {void}
487
- */
488
- const forEachEntry = (obj, fn) => {
489
- const generator = obj && obj[Symbol.iterator];
490
-
491
- const iterator = generator.call(obj);
492
-
493
- let result;
494
-
495
- while ((result = iterator.next()) && !result.done) {
496
- const pair = result.value;
497
- fn.call(obj, pair[0], pair[1]);
498
- }
499
- };
500
-
501
- /**
502
- * It takes a regular expression and a string, and returns an array of all the matches
503
- *
504
- * @param {string} regExp - The regular expression to match against.
505
- * @param {string} str - The string to search.
506
- *
507
- * @returns {Array<boolean>}
508
- */
509
- const matchAll = (regExp, str) => {
510
- let matches;
511
- const arr = [];
512
-
513
- while ((matches = regExp.exec(str)) !== null) {
514
- arr.push(matches);
515
- }
516
-
517
- return arr;
518
- };
519
-
520
- /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
521
- const isHTMLForm = kindOfTest('HTMLFormElement');
522
-
523
- const toCamelCase = str => {
524
- return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
525
- function replacer(m, p1, p2) {
526
- return p1.toUpperCase() + p2;
527
- }
528
- );
529
- };
530
-
531
- /* Creating a function that will check if an object has a property. */
532
- const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
533
-
534
- /**
535
- * Determine if a value is a RegExp object
536
- *
537
- * @param {*} val The value to test
538
- *
539
- * @returns {boolean} True if value is a RegExp object, otherwise false
540
- */
541
- const isRegExp = kindOfTest('RegExp');
542
-
543
- const reduceDescriptors = (obj, reducer) => {
544
- const descriptors = Object.getOwnPropertyDescriptors(obj);
545
- const reducedDescriptors = {};
546
-
547
- forEach(descriptors, (descriptor, name) => {
548
- let ret;
549
- if ((ret = reducer(descriptor, name, obj)) !== false) {
550
- reducedDescriptors[name] = ret || descriptor;
551
- }
552
- });
553
-
554
- Object.defineProperties(obj, reducedDescriptors);
555
- };
556
-
557
- /**
558
- * Makes all methods read-only
559
- * @param {Object} obj
560
- */
561
-
562
- const freezeMethods = (obj) => {
563
- reduceDescriptors(obj, (descriptor, name) => {
564
- // skip restricted props in strict mode
565
- if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
566
- return false;
567
- }
568
-
569
- const value = obj[name];
570
-
571
- if (!isFunction(value)) return;
572
-
573
- descriptor.enumerable = false;
574
-
575
- if ('writable' in descriptor) {
576
- descriptor.writable = false;
577
- return;
578
- }
579
-
580
- if (!descriptor.set) {
581
- descriptor.set = () => {
582
- throw Error('Can not rewrite read-only method \'' + name + '\'');
583
- };
584
- }
585
- });
586
- };
587
-
588
- const toObjectSet = (arrayOrString, delimiter) => {
589
- const obj = {};
590
-
591
- const define = (arr) => {
592
- arr.forEach(value => {
593
- obj[value] = true;
594
- });
595
- };
596
-
597
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
598
-
599
- return obj;
600
- };
601
-
602
- const noop = () => {};
603
-
604
- const toFiniteNumber = (value, defaultValue) => {
605
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
606
- };
607
-
608
- const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
609
-
610
- const DIGIT = '0123456789';
611
-
612
- const ALPHABET = {
613
- DIGIT,
614
- ALPHA,
615
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
616
- };
617
-
618
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
619
- let str = '';
620
- const {length} = alphabet;
621
- while (size--) {
622
- str += alphabet[Math.random() * length|0];
623
- }
624
-
625
- return str;
626
- };
627
-
628
- /**
629
- * If the thing is a FormData object, return true, otherwise return false.
630
- *
631
- * @param {unknown} thing - The thing to check.
632
- *
633
- * @returns {boolean}
634
- */
635
- function isSpecCompliantForm(thing) {
636
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
637
- }
638
-
639
- const toJSONObject = (obj) => {
640
- const stack = new Array(10);
641
-
642
- const visit = (source, i) => {
643
-
644
- if (isObject(source)) {
645
- if (stack.indexOf(source) >= 0) {
646
- return;
647
- }
648
-
649
- if(!('toJSON' in source)) {
650
- stack[i] = source;
651
- const target = isArray(source) ? [] : {};
652
-
653
- forEach(source, (value, key) => {
654
- const reducedValue = visit(value, i + 1);
655
- !isUndefined(reducedValue) && (target[key] = reducedValue);
656
- });
657
-
658
- stack[i] = undefined;
659
-
660
- return target;
661
- }
662
- }
663
-
664
- return source;
665
- };
666
-
667
- return visit(obj, 0);
668
- };
669
-
670
- const isAsyncFn = kindOfTest('AsyncFunction');
671
-
672
- const isThenable = (thing) =>
673
- thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
674
-
675
- const utils$1 = {
676
- isArray,
677
- isArrayBuffer,
678
- isBuffer,
679
- isFormData,
680
- isArrayBufferView,
681
- isString,
682
- isNumber,
683
- isBoolean,
684
- isObject,
685
- isPlainObject,
686
- isReadableStream,
687
- isRequest,
688
- isResponse,
689
- isHeaders,
690
- isUndefined,
691
- isDate,
692
- isFile,
693
- isBlob,
694
- isRegExp,
695
- isFunction,
696
- isStream,
697
- isURLSearchParams,
698
- isTypedArray,
699
- isFileList,
700
- forEach,
701
- merge,
702
- extend,
703
- trim,
704
- stripBOM,
705
- inherits,
706
- toFlatObject,
707
- kindOf,
708
- kindOfTest,
709
- endsWith,
710
- toArray,
711
- forEachEntry,
712
- matchAll,
713
- isHTMLForm,
714
- hasOwnProperty,
715
- hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
716
- reduceDescriptors,
717
- freezeMethods,
718
- toObjectSet,
719
- toCamelCase,
720
- noop,
721
- toFiniteNumber,
722
- findKey,
723
- global: _global,
724
- isContextDefined,
725
- ALPHABET,
726
- generateString,
727
- isSpecCompliantForm,
728
- toJSONObject,
729
- isAsyncFn,
730
- isThenable
731
- };
732
-
733
- /**
734
- * Create an Error with the specified message, config, error code, request and response.
735
- *
736
- * @param {string} message The error message.
737
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
738
- * @param {Object} [config] The config.
739
- * @param {Object} [request] The request.
740
- * @param {Object} [response] The response.
741
- *
742
- * @returns {Error} The created error.
743
- */
744
- function AxiosError$1(message, code, config, request, response) {
745
- Error.call(this);
746
-
747
- if (Error.captureStackTrace) {
748
- Error.captureStackTrace(this, this.constructor);
749
- } else {
750
- this.stack = (new Error()).stack;
751
- }
752
-
753
- this.message = message;
754
- this.name = 'AxiosError';
755
- code && (this.code = code);
756
- config && (this.config = config);
757
- request && (this.request = request);
758
- response && (this.response = response);
759
- }
760
-
761
- utils$1.inherits(AxiosError$1, Error, {
762
- toJSON: function toJSON() {
763
- return {
764
- // Standard
765
- message: this.message,
766
- name: this.name,
767
- // Microsoft
768
- description: this.description,
769
- number: this.number,
770
- // Mozilla
771
- fileName: this.fileName,
772
- lineNumber: this.lineNumber,
773
- columnNumber: this.columnNumber,
774
- stack: this.stack,
775
- // Axios
776
- config: utils$1.toJSONObject(this.config),
777
- code: this.code,
778
- status: this.response && this.response.status ? this.response.status : null
779
- };
780
- }
781
- });
782
-
783
- const prototype$1 = AxiosError$1.prototype;
784
- const descriptors = {};
785
-
786
- [
787
- 'ERR_BAD_OPTION_VALUE',
788
- 'ERR_BAD_OPTION',
789
- 'ECONNABORTED',
790
- 'ETIMEDOUT',
791
- 'ERR_NETWORK',
792
- 'ERR_FR_TOO_MANY_REDIRECTS',
793
- 'ERR_DEPRECATED',
794
- 'ERR_BAD_RESPONSE',
795
- 'ERR_BAD_REQUEST',
796
- 'ERR_CANCELED',
797
- 'ERR_NOT_SUPPORT',
798
- 'ERR_INVALID_URL'
799
- // eslint-disable-next-line func-names
800
- ].forEach(code => {
801
- descriptors[code] = {value: code};
802
- });
803
-
804
- Object.defineProperties(AxiosError$1, descriptors);
805
- Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
806
-
807
- // eslint-disable-next-line func-names
808
- AxiosError$1.from = (error, code, config, request, response, customProps) => {
809
- const axiosError = Object.create(prototype$1);
810
-
811
- utils$1.toFlatObject(error, axiosError, function filter(obj) {
812
- return obj !== Error.prototype;
813
- }, prop => {
814
- return prop !== 'isAxiosError';
815
- });
816
-
817
- AxiosError$1.call(axiosError, error.message, code, config, request, response);
818
-
819
- axiosError.cause = error;
820
-
821
- axiosError.name = error.name;
822
-
823
- customProps && Object.assign(axiosError, customProps);
824
-
825
- return axiosError;
826
- };
827
-
828
- // eslint-disable-next-line strict
829
- const httpAdapter = null;
830
-
831
- /**
832
- * Determines if the given thing is a array or js object.
833
- *
834
- * @param {string} thing - The object or array to be visited.
835
- *
836
- * @returns {boolean}
837
- */
838
- function isVisitable(thing) {
839
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
840
- }
841
-
842
- /**
843
- * It removes the brackets from the end of a string
844
- *
845
- * @param {string} key - The key of the parameter.
846
- *
847
- * @returns {string} the key without the brackets.
848
- */
849
- function removeBrackets(key) {
850
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
851
- }
852
-
853
- /**
854
- * It takes a path, a key, and a boolean, and returns a string
855
- *
856
- * @param {string} path - The path to the current key.
857
- * @param {string} key - The key of the current object being iterated over.
858
- * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
859
- *
860
- * @returns {string} The path to the current key.
861
- */
862
- function renderKey(path, key, dots) {
863
- if (!path) return key;
864
- return path.concat(key).map(function each(token, i) {
865
- // eslint-disable-next-line no-param-reassign
866
- token = removeBrackets(token);
867
- return !dots && i ? '[' + token + ']' : token;
868
- }).join(dots ? '.' : '');
869
- }
870
-
871
- /**
872
- * If the array is an array and none of its elements are visitable, then it's a flat array.
873
- *
874
- * @param {Array<any>} arr - The array to check
875
- *
876
- * @returns {boolean}
877
- */
878
- function isFlatArray(arr) {
879
- return utils$1.isArray(arr) && !arr.some(isVisitable);
880
- }
881
-
882
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
883
- return /^is[A-Z]/.test(prop);
884
- });
885
-
886
- /**
887
- * Convert a data object to FormData
888
- *
889
- * @param {Object} obj
890
- * @param {?Object} [formData]
891
- * @param {?Object} [options]
892
- * @param {Function} [options.visitor]
893
- * @param {Boolean} [options.metaTokens = true]
894
- * @param {Boolean} [options.dots = false]
895
- * @param {?Boolean} [options.indexes = false]
896
- *
897
- * @returns {Object}
898
- **/
899
-
900
- /**
901
- * It converts an object into a FormData object
902
- *
903
- * @param {Object<any, any>} obj - The object to convert to form data.
904
- * @param {string} formData - The FormData object to append to.
905
- * @param {Object<string, any>} options
906
- *
907
- * @returns
908
- */
909
- function toFormData$1(obj, formData, options) {
910
- if (!utils$1.isObject(obj)) {
911
- throw new TypeError('target must be an object');
912
- }
913
-
914
- // eslint-disable-next-line no-param-reassign
915
- formData = formData || new (FormData)();
916
-
917
- // eslint-disable-next-line no-param-reassign
918
- options = utils$1.toFlatObject(options, {
919
- metaTokens: true,
920
- dots: false,
921
- indexes: false
922
- }, false, function defined(option, source) {
923
- // eslint-disable-next-line no-eq-null,eqeqeq
924
- return !utils$1.isUndefined(source[option]);
925
- });
926
-
927
- const metaTokens = options.metaTokens;
928
- // eslint-disable-next-line no-use-before-define
929
- const visitor = options.visitor || defaultVisitor;
930
- const dots = options.dots;
931
- const indexes = options.indexes;
932
- const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
933
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
934
-
935
- if (!utils$1.isFunction(visitor)) {
936
- throw new TypeError('visitor must be a function');
937
- }
938
-
939
- function convertValue(value) {
940
- if (value === null) return '';
941
-
942
- if (utils$1.isDate(value)) {
943
- return value.toISOString();
944
- }
945
-
946
- if (!useBlob && utils$1.isBlob(value)) {
947
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
948
- }
949
-
950
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
951
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
952
- }
953
-
954
- return value;
955
- }
956
-
957
- /**
958
- * Default visitor.
959
- *
960
- * @param {*} value
961
- * @param {String|Number} key
962
- * @param {Array<String|Number>} path
963
- * @this {FormData}
964
- *
965
- * @returns {boolean} return true to visit the each prop of the value recursively
966
- */
967
- function defaultVisitor(value, key, path) {
968
- let arr = value;
969
-
970
- if (value && !path && typeof value === 'object') {
971
- if (utils$1.endsWith(key, '{}')) {
972
- // eslint-disable-next-line no-param-reassign
973
- key = metaTokens ? key : key.slice(0, -2);
974
- // eslint-disable-next-line no-param-reassign
975
- value = JSON.stringify(value);
976
- } else if (
977
- (utils$1.isArray(value) && isFlatArray(value)) ||
978
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
979
- )) {
980
- // eslint-disable-next-line no-param-reassign
981
- key = removeBrackets(key);
982
-
983
- arr.forEach(function each(el, index) {
984
- !(utils$1.isUndefined(el) || el === null) && formData.append(
985
- // eslint-disable-next-line no-nested-ternary
986
- indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
987
- convertValue(el)
988
- );
989
- });
990
- return false;
991
- }
992
- }
993
-
994
- if (isVisitable(value)) {
995
- return true;
996
- }
997
-
998
- formData.append(renderKey(path, key, dots), convertValue(value));
999
-
1000
- return false;
1001
- }
1002
-
1003
- const stack = [];
1004
-
1005
- const exposedHelpers = Object.assign(predicates, {
1006
- defaultVisitor,
1007
- convertValue,
1008
- isVisitable
1009
- });
1010
-
1011
- function build(value, path) {
1012
- if (utils$1.isUndefined(value)) return;
1013
-
1014
- if (stack.indexOf(value) !== -1) {
1015
- throw Error('Circular reference detected in ' + path.join('.'));
1016
- }
1017
-
1018
- stack.push(value);
1019
-
1020
- utils$1.forEach(value, function each(el, key) {
1021
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
1022
- formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
1023
- );
1024
-
1025
- if (result === true) {
1026
- build(el, path ? path.concat(key) : [key]);
1027
- }
1028
- });
1029
-
1030
- stack.pop();
1031
- }
1032
-
1033
- if (!utils$1.isObject(obj)) {
1034
- throw new TypeError('data must be an object');
1035
- }
1036
-
1037
- build(obj);
1038
-
1039
- return formData;
1040
- }
1041
-
1042
- /**
1043
- * It encodes a string by replacing all characters that are not in the unreserved set with
1044
- * their percent-encoded equivalents
1045
- *
1046
- * @param {string} str - The string to encode.
1047
- *
1048
- * @returns {string} The encoded string.
1049
- */
1050
- function encode$1(str) {
1051
- const charMap = {
1052
- '!': '%21',
1053
- "'": '%27',
1054
- '(': '%28',
1055
- ')': '%29',
1056
- '~': '%7E',
1057
- '%20': '+',
1058
- '%00': '\x00'
1059
- };
1060
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
1061
- return charMap[match];
1062
- });
1063
- }
1064
-
1065
- /**
1066
- * It takes a params object and converts it to a FormData object
1067
- *
1068
- * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1069
- * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1070
- *
1071
- * @returns {void}
1072
- */
1073
- function AxiosURLSearchParams(params, options) {
1074
- this._pairs = [];
1075
-
1076
- params && toFormData$1(params, this, options);
1077
- }
1078
-
1079
- const prototype = AxiosURLSearchParams.prototype;
1080
-
1081
- prototype.append = function append(name, value) {
1082
- this._pairs.push([name, value]);
1083
- };
1084
-
1085
- prototype.toString = function toString(encoder) {
1086
- const _encode = encoder ? function(value) {
1087
- return encoder.call(this, value, encode$1);
1088
- } : encode$1;
1089
-
1090
- return this._pairs.map(function each(pair) {
1091
- return _encode(pair[0]) + '=' + _encode(pair[1]);
1092
- }, '').join('&');
1093
- };
1094
-
1095
- /**
1096
- * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
1097
- * URI encoded counterparts
1098
- *
1099
- * @param {string} val The value to be encoded.
1100
- *
1101
- * @returns {string} The encoded value.
1102
- */
1103
- function encode(val) {
1104
- return encodeURIComponent(val).
1105
- replace(/%3A/gi, ':').
1106
- replace(/%24/g, '$').
1107
- replace(/%2C/gi, ',').
1108
- replace(/%20/g, '+').
1109
- replace(/%5B/gi, '[').
1110
- replace(/%5D/gi, ']');
1111
- }
1112
-
1113
- /**
1114
- * Build a URL by appending params to the end
1115
- *
1116
- * @param {string} url The base of the url (e.g., http://www.google.com)
1117
- * @param {object} [params] The params to be appended
1118
- * @param {?object} options
1119
- *
1120
- * @returns {string} The formatted url
1121
- */
1122
- function buildURL(url, params, options) {
1123
- /*eslint no-param-reassign:0*/
1124
- if (!params) {
1125
- return url;
1126
- }
1127
-
1128
- const _encode = options && options.encode || encode;
1129
-
1130
- const serializeFn = options && options.serialize;
1131
-
1132
- let serializedParams;
1133
-
1134
- if (serializeFn) {
1135
- serializedParams = serializeFn(params, options);
1136
- } else {
1137
- serializedParams = utils$1.isURLSearchParams(params) ?
1138
- params.toString() :
1139
- new AxiosURLSearchParams(params, options).toString(_encode);
1140
- }
1141
-
1142
- if (serializedParams) {
1143
- const hashmarkIndex = url.indexOf("#");
1144
-
1145
- if (hashmarkIndex !== -1) {
1146
- url = url.slice(0, hashmarkIndex);
1147
- }
1148
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1149
- }
1150
-
1151
- return url;
1152
- }
1153
-
1154
- class InterceptorManager {
1155
- constructor() {
1156
- this.handlers = [];
1157
- }
1158
-
1159
- /**
1160
- * Add a new interceptor to the stack
1161
- *
1162
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1163
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1164
- *
1165
- * @return {Number} An ID used to remove interceptor later
1166
- */
1167
- use(fulfilled, rejected, options) {
1168
- this.handlers.push({
1169
- fulfilled,
1170
- rejected,
1171
- synchronous: options ? options.synchronous : false,
1172
- runWhen: options ? options.runWhen : null
1173
- });
1174
- return this.handlers.length - 1;
1175
- }
1176
-
1177
- /**
1178
- * Remove an interceptor from the stack
1179
- *
1180
- * @param {Number} id The ID that was returned by `use`
1181
- *
1182
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1183
- */
1184
- eject(id) {
1185
- if (this.handlers[id]) {
1186
- this.handlers[id] = null;
1187
- }
1188
- }
1189
-
1190
- /**
1191
- * Clear all interceptors from the stack
1192
- *
1193
- * @returns {void}
1194
- */
1195
- clear() {
1196
- if (this.handlers) {
1197
- this.handlers = [];
1198
- }
1199
- }
1200
-
1201
- /**
1202
- * Iterate over all the registered interceptors
1203
- *
1204
- * This method is particularly useful for skipping over any
1205
- * interceptors that may have become `null` calling `eject`.
1206
- *
1207
- * @param {Function} fn The function to call for each interceptor
1208
- *
1209
- * @returns {void}
1210
- */
1211
- forEach(fn) {
1212
- utils$1.forEach(this.handlers, function forEachHandler(h) {
1213
- if (h !== null) {
1214
- fn(h);
1215
- }
1216
- });
1217
- }
1218
- }
1219
-
1220
- const InterceptorManager$1 = InterceptorManager;
1221
-
1222
- const transitionalDefaults = {
1223
- silentJSONParsing: true,
1224
- forcedJSONParsing: true,
1225
- clarifyTimeoutError: false
1226
- };
1227
-
1228
- const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
1229
-
1230
- const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
1231
-
1232
- const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
1233
-
1234
- const platform$1 = {
1235
- isBrowser: true,
1236
- classes: {
1237
- URLSearchParams: URLSearchParams$1,
1238
- FormData: FormData$1,
1239
- Blob: Blob$1
1240
- },
1241
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
1242
- };
1243
-
1244
- const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1245
-
1246
- /**
1247
- * Determine if we're running in a standard browser environment
1248
- *
1249
- * This allows axios to run in a web worker, and react-native.
1250
- * Both environments support XMLHttpRequest, but not fully standard globals.
1251
- *
1252
- * web workers:
1253
- * typeof window -> undefined
1254
- * typeof document -> undefined
1255
- *
1256
- * react-native:
1257
- * navigator.product -> 'ReactNative'
1258
- * nativescript
1259
- * navigator.product -> 'NativeScript' or 'NS'
1260
- *
1261
- * @returns {boolean}
1262
- */
1263
- const hasStandardBrowserEnv = (
1264
- (product) => {
1265
- return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
1266
- })(typeof navigator !== 'undefined' && navigator.product);
1267
-
1268
- /**
1269
- * Determine if we're running in a standard browser webWorker environment
1270
- *
1271
- * Although the `isStandardBrowserEnv` method indicates that
1272
- * `allows axios to run in a web worker`, the WebWorker will still be
1273
- * filtered out due to its judgment standard
1274
- * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
1275
- * This leads to a problem when axios post `FormData` in webWorker
1276
- */
1277
- const hasStandardBrowserWebWorkerEnv = (() => {
1278
- return (
1279
- typeof WorkerGlobalScope !== 'undefined' &&
1280
- // eslint-disable-next-line no-undef
1281
- self instanceof WorkerGlobalScope &&
1282
- typeof self.importScripts === 'function'
1283
- );
1284
- })();
1285
-
1286
- const origin = hasBrowserEnv && window.location.href || 'http://localhost';
1287
-
1288
- const utils = /*#__PURE__*/Object.freeze({
1289
- __proto__: null,
1290
- hasBrowserEnv: hasBrowserEnv,
1291
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1292
- hasStandardBrowserEnv: hasStandardBrowserEnv,
1293
- origin: origin
1294
- });
1295
-
1296
- const platform = {
1297
- ...utils,
1298
- ...platform$1
1299
- };
1300
-
1301
- function toURLEncodedForm(data, options) {
1302
- return toFormData$1(data, new platform.classes.URLSearchParams(), Object.assign({
1303
- visitor: function(value, key, path, helpers) {
1304
- if (platform.isNode && utils$1.isBuffer(value)) {
1305
- this.append(key, value.toString('base64'));
1306
- return false;
1307
- }
1308
-
1309
- return helpers.defaultVisitor.apply(this, arguments);
1310
- }
1311
- }, options));
1312
- }
1313
-
1314
- /**
1315
- * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
1316
- *
1317
- * @param {string} name - The name of the property to get.
1318
- *
1319
- * @returns An array of strings.
1320
- */
1321
- function parsePropPath(name) {
1322
- // foo[x][y][z]
1323
- // foo.x.y.z
1324
- // foo-x-y-z
1325
- // foo x y z
1326
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
1327
- return match[0] === '[]' ? '' : match[1] || match[0];
1328
- });
1329
- }
1330
-
1331
- /**
1332
- * Convert an array to an object.
1333
- *
1334
- * @param {Array<any>} arr - The array to convert to an object.
1335
- *
1336
- * @returns An object with the same keys and values as the array.
1337
- */
1338
- function arrayToObject(arr) {
1339
- const obj = {};
1340
- const keys = Object.keys(arr);
1341
- let i;
1342
- const len = keys.length;
1343
- let key;
1344
- for (i = 0; i < len; i++) {
1345
- key = keys[i];
1346
- obj[key] = arr[key];
1347
- }
1348
- return obj;
1349
- }
1350
-
1351
- /**
1352
- * It takes a FormData object and returns a JavaScript object
1353
- *
1354
- * @param {string} formData The FormData object to convert to JSON.
1355
- *
1356
- * @returns {Object<string, any> | null} The converted object.
1357
- */
1358
- function formDataToJSON(formData) {
1359
- function buildPath(path, value, target, index) {
1360
- let name = path[index++];
1361
-
1362
- if (name === '__proto__') return true;
1363
-
1364
- const isNumericKey = Number.isFinite(+name);
1365
- const isLast = index >= path.length;
1366
- name = !name && utils$1.isArray(target) ? target.length : name;
1367
-
1368
- if (isLast) {
1369
- if (utils$1.hasOwnProp(target, name)) {
1370
- target[name] = [target[name], value];
1371
- } else {
1372
- target[name] = value;
1373
- }
1374
-
1375
- return !isNumericKey;
1376
- }
1377
-
1378
- if (!target[name] || !utils$1.isObject(target[name])) {
1379
- target[name] = [];
1380
- }
1381
-
1382
- const result = buildPath(path, value, target[name], index);
1383
-
1384
- if (result && utils$1.isArray(target[name])) {
1385
- target[name] = arrayToObject(target[name]);
1386
- }
1387
-
1388
- return !isNumericKey;
1389
- }
1390
-
1391
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
1392
- const obj = {};
1393
-
1394
- utils$1.forEachEntry(formData, (name, value) => {
1395
- buildPath(parsePropPath(name), value, obj, 0);
1396
- });
1397
-
1398
- return obj;
1399
- }
1400
-
1401
- return null;
1402
- }
1403
-
1404
- /**
1405
- * It takes a string, tries to parse it, and if it fails, it returns the stringified version
1406
- * of the input
1407
- *
1408
- * @param {any} rawValue - The value to be stringified.
1409
- * @param {Function} parser - A function that parses a string into a JavaScript object.
1410
- * @param {Function} encoder - A function that takes a value and returns a string.
1411
- *
1412
- * @returns {string} A stringified version of the rawValue.
1413
- */
1414
- function stringifySafely(rawValue, parser, encoder) {
1415
- if (utils$1.isString(rawValue)) {
1416
- try {
1417
- (parser || JSON.parse)(rawValue);
1418
- return utils$1.trim(rawValue);
1419
- } catch (e) {
1420
- if (e.name !== 'SyntaxError') {
1421
- throw e;
1422
- }
1423
- }
1424
- }
1425
-
1426
- return (encoder || JSON.stringify)(rawValue);
1427
- }
1428
-
1429
- const defaults = {
1430
-
1431
- transitional: transitionalDefaults,
1432
-
1433
- adapter: ['xhr', 'http', 'fetch'],
1434
-
1435
- transformRequest: [function transformRequest(data, headers) {
1436
- const contentType = headers.getContentType() || '';
1437
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
1438
- const isObjectPayload = utils$1.isObject(data);
1439
-
1440
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
1441
- data = new FormData(data);
1442
- }
1443
-
1444
- const isFormData = utils$1.isFormData(data);
1445
-
1446
- if (isFormData) {
1447
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1448
- }
1449
-
1450
- if (utils$1.isArrayBuffer(data) ||
1451
- utils$1.isBuffer(data) ||
1452
- utils$1.isStream(data) ||
1453
- utils$1.isFile(data) ||
1454
- utils$1.isBlob(data) ||
1455
- utils$1.isReadableStream(data)
1456
- ) {
1457
- return data;
1458
- }
1459
- if (utils$1.isArrayBufferView(data)) {
1460
- return data.buffer;
1461
- }
1462
- if (utils$1.isURLSearchParams(data)) {
1463
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
1464
- return data.toString();
1465
- }
1466
-
1467
- let isFileList;
1468
-
1469
- if (isObjectPayload) {
1470
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
1471
- return toURLEncodedForm(data, this.formSerializer).toString();
1472
- }
1473
-
1474
- if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1475
- const _FormData = this.env && this.env.FormData;
1476
-
1477
- return toFormData$1(
1478
- isFileList ? {'files[]': data} : data,
1479
- _FormData && new _FormData(),
1480
- this.formSerializer
1481
- );
1482
- }
1483
- }
1484
-
1485
- if (isObjectPayload || hasJSONContentType ) {
1486
- headers.setContentType('application/json', false);
1487
- return stringifySafely(data);
1488
- }
1489
-
1490
- return data;
1491
- }],
1492
-
1493
- transformResponse: [function transformResponse(data) {
1494
- const transitional = this.transitional || defaults.transitional;
1495
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1496
- const JSONRequested = this.responseType === 'json';
1497
-
1498
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
1499
- return data;
1500
- }
1501
-
1502
- if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
1503
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
1504
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
1505
-
1506
- try {
1507
- return JSON.parse(data);
1508
- } catch (e) {
1509
- if (strictJSONParsing) {
1510
- if (e.name === 'SyntaxError') {
1511
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
1512
- }
1513
- throw e;
1514
- }
1515
- }
1516
- }
1517
-
1518
- return data;
1519
- }],
1520
-
1521
- /**
1522
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
1523
- * timeout is not created.
1524
- */
1525
- timeout: 0,
1526
-
1527
- xsrfCookieName: 'XSRF-TOKEN',
1528
- xsrfHeaderName: 'X-XSRF-TOKEN',
1529
-
1530
- maxContentLength: -1,
1531
- maxBodyLength: -1,
1532
-
1533
- env: {
1534
- FormData: platform.classes.FormData,
1535
- Blob: platform.classes.Blob
1536
- },
1537
-
1538
- validateStatus: function validateStatus(status) {
1539
- return status >= 200 && status < 300;
1540
- },
1541
-
1542
- headers: {
1543
- common: {
1544
- 'Accept': 'application/json, text/plain, */*',
1545
- 'Content-Type': undefined
1546
- }
1547
- }
1548
- };
1549
-
1550
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
1551
- defaults.headers[method] = {};
1552
- });
1553
-
1554
- const defaults$1 = defaults;
1555
-
1556
- // RawAxiosHeaders whose duplicates are ignored by node
1557
- // c.f. https://nodejs.org/api/http.html#http_message_headers
1558
- const ignoreDuplicateOf = utils$1.toObjectSet([
1559
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
1560
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
1561
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
1562
- 'referer', 'retry-after', 'user-agent'
1563
- ]);
1564
-
1565
- /**
1566
- * Parse headers into an object
1567
- *
1568
- * ```
1569
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
1570
- * Content-Type: application/json
1571
- * Connection: keep-alive
1572
- * Transfer-Encoding: chunked
1573
- * ```
1574
- *
1575
- * @param {String} rawHeaders Headers needing to be parsed
1576
- *
1577
- * @returns {Object} Headers parsed into an object
1578
- */
1579
- const parseHeaders = rawHeaders => {
1580
- const parsed = {};
1581
- let key;
1582
- let val;
1583
- let i;
1584
-
1585
- rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
1586
- i = line.indexOf(':');
1587
- key = line.substring(0, i).trim().toLowerCase();
1588
- val = line.substring(i + 1).trim();
1589
-
1590
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
1591
- return;
1592
- }
1593
-
1594
- if (key === 'set-cookie') {
1595
- if (parsed[key]) {
1596
- parsed[key].push(val);
1597
- } else {
1598
- parsed[key] = [val];
1599
- }
1600
- } else {
1601
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1602
- }
1603
- });
1604
-
1605
- return parsed;
1606
- };
1607
-
1608
- const $internals = Symbol('internals');
1609
-
1610
- function normalizeHeader(header) {
1611
- return header && String(header).trim().toLowerCase();
1612
- }
1613
-
1614
- function normalizeValue(value) {
1615
- if (value === false || value == null) {
1616
- return value;
1617
- }
1618
-
1619
- return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
1620
- }
1621
-
1622
- function parseTokens(str) {
1623
- const tokens = Object.create(null);
1624
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1625
- let match;
1626
-
1627
- while ((match = tokensRE.exec(str))) {
1628
- tokens[match[1]] = match[2];
1629
- }
1630
-
1631
- return tokens;
1632
- }
1633
-
1634
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1635
-
1636
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1637
- if (utils$1.isFunction(filter)) {
1638
- return filter.call(this, value, header);
1639
- }
1640
-
1641
- if (isHeaderNameFilter) {
1642
- value = header;
1643
- }
1644
-
1645
- if (!utils$1.isString(value)) return;
1646
-
1647
- if (utils$1.isString(filter)) {
1648
- return value.indexOf(filter) !== -1;
1649
- }
1650
-
1651
- if (utils$1.isRegExp(filter)) {
1652
- return filter.test(value);
1653
- }
1654
- }
1655
-
1656
- function formatHeader(header) {
1657
- return header.trim()
1658
- .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1659
- return char.toUpperCase() + str;
1660
- });
1661
- }
1662
-
1663
- function buildAccessors(obj, header) {
1664
- const accessorName = utils$1.toCamelCase(' ' + header);
1665
-
1666
- ['get', 'set', 'has'].forEach(methodName => {
1667
- Object.defineProperty(obj, methodName + accessorName, {
1668
- value: function(arg1, arg2, arg3) {
1669
- return this[methodName].call(this, header, arg1, arg2, arg3);
1670
- },
1671
- configurable: true
1672
- });
1673
- });
1674
- }
1675
-
1676
- class AxiosHeaders$1 {
1677
- constructor(headers) {
1678
- headers && this.set(headers);
1679
- }
1680
-
1681
- set(header, valueOrRewrite, rewrite) {
1682
- const self = this;
1683
-
1684
- function setHeader(_value, _header, _rewrite) {
1685
- const lHeader = normalizeHeader(_header);
1686
-
1687
- if (!lHeader) {
1688
- throw new Error('header name must be a non-empty string');
1689
- }
1690
-
1691
- const key = utils$1.findKey(self, lHeader);
1692
-
1693
- if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
1694
- self[key || _header] = normalizeValue(_value);
1695
- }
1696
- }
1697
-
1698
- const setHeaders = (headers, _rewrite) =>
1699
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1700
-
1701
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1702
- setHeaders(header, valueOrRewrite);
1703
- } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1704
- setHeaders(parseHeaders(header), valueOrRewrite);
1705
- } else if (utils$1.isHeaders(header)) {
1706
- for (const [key, value] of header.entries()) {
1707
- setHeader(value, key, rewrite);
1708
- }
1709
- } else {
1710
- header != null && setHeader(valueOrRewrite, header, rewrite);
1711
- }
1712
-
1713
- return this;
1714
- }
1715
-
1716
- get(header, parser) {
1717
- header = normalizeHeader(header);
1718
-
1719
- if (header) {
1720
- const key = utils$1.findKey(this, header);
1721
-
1722
- if (key) {
1723
- const value = this[key];
1724
-
1725
- if (!parser) {
1726
- return value;
1727
- }
1728
-
1729
- if (parser === true) {
1730
- return parseTokens(value);
1731
- }
1732
-
1733
- if (utils$1.isFunction(parser)) {
1734
- return parser.call(this, value, key);
1735
- }
1736
-
1737
- if (utils$1.isRegExp(parser)) {
1738
- return parser.exec(value);
1739
- }
1740
-
1741
- throw new TypeError('parser must be boolean|regexp|function');
1742
- }
1743
- }
1744
- }
1745
-
1746
- has(header, matcher) {
1747
- header = normalizeHeader(header);
1748
-
1749
- if (header) {
1750
- const key = utils$1.findKey(this, header);
1751
-
1752
- return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1753
- }
1754
-
1755
- return false;
1756
- }
1757
-
1758
- delete(header, matcher) {
1759
- const self = this;
1760
- let deleted = false;
1761
-
1762
- function deleteHeader(_header) {
1763
- _header = normalizeHeader(_header);
1764
-
1765
- if (_header) {
1766
- const key = utils$1.findKey(self, _header);
1767
-
1768
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
1769
- delete self[key];
1770
-
1771
- deleted = true;
1772
- }
1773
- }
1774
- }
1775
-
1776
- if (utils$1.isArray(header)) {
1777
- header.forEach(deleteHeader);
1778
- } else {
1779
- deleteHeader(header);
1780
- }
1781
-
1782
- return deleted;
1783
- }
1784
-
1785
- clear(matcher) {
1786
- const keys = Object.keys(this);
1787
- let i = keys.length;
1788
- let deleted = false;
1789
-
1790
- while (i--) {
1791
- const key = keys[i];
1792
- if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1793
- delete this[key];
1794
- deleted = true;
1795
- }
1796
- }
1797
-
1798
- return deleted;
1799
- }
1800
-
1801
- normalize(format) {
1802
- const self = this;
1803
- const headers = {};
1804
-
1805
- utils$1.forEach(this, (value, header) => {
1806
- const key = utils$1.findKey(headers, header);
1807
-
1808
- if (key) {
1809
- self[key] = normalizeValue(value);
1810
- delete self[header];
1811
- return;
1812
- }
1813
-
1814
- const normalized = format ? formatHeader(header) : String(header).trim();
1815
-
1816
- if (normalized !== header) {
1817
- delete self[header];
1818
- }
1819
-
1820
- self[normalized] = normalizeValue(value);
1821
-
1822
- headers[normalized] = true;
1823
- });
1824
-
1825
- return this;
1826
- }
1827
-
1828
- concat(...targets) {
1829
- return this.constructor.concat(this, ...targets);
1830
- }
1831
-
1832
- toJSON(asStrings) {
1833
- const obj = Object.create(null);
1834
-
1835
- utils$1.forEach(this, (value, header) => {
1836
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
1837
- });
1838
-
1839
- return obj;
1840
- }
1841
-
1842
- [Symbol.iterator]() {
1843
- return Object.entries(this.toJSON())[Symbol.iterator]();
1844
- }
1845
-
1846
- toString() {
1847
- return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
1848
- }
1849
-
1850
- get [Symbol.toStringTag]() {
1851
- return 'AxiosHeaders';
1852
- }
1853
-
1854
- static from(thing) {
1855
- return thing instanceof this ? thing : new this(thing);
1856
- }
1857
-
1858
- static concat(first, ...targets) {
1859
- const computed = new this(first);
1860
-
1861
- targets.forEach((target) => computed.set(target));
1862
-
1863
- return computed;
1864
- }
1865
-
1866
- static accessor(header) {
1867
- const internals = this[$internals] = (this[$internals] = {
1868
- accessors: {}
1869
- });
1870
-
1871
- const accessors = internals.accessors;
1872
- const prototype = this.prototype;
1873
-
1874
- function defineAccessor(_header) {
1875
- const lHeader = normalizeHeader(_header);
1876
-
1877
- if (!accessors[lHeader]) {
1878
- buildAccessors(prototype, _header);
1879
- accessors[lHeader] = true;
1880
- }
1881
- }
1882
-
1883
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1884
-
1885
- return this;
1886
- }
1887
- }
1888
-
1889
- AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
1890
-
1891
- // reserved names hotfix
1892
- utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
1893
- let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
1894
- return {
1895
- get: () => value,
1896
- set(headerValue) {
1897
- this[mapped] = headerValue;
1898
- }
1899
- }
1900
- });
1901
-
1902
- utils$1.freezeMethods(AxiosHeaders$1);
1903
-
1904
- const AxiosHeaders$2 = AxiosHeaders$1;
1905
-
1906
- /**
1907
- * Transform the data for a request or a response
1908
- *
1909
- * @param {Array|Function} fns A single function or Array of functions
1910
- * @param {?Object} response The response object
1911
- *
1912
- * @returns {*} The resulting transformed data
1913
- */
1914
- function transformData(fns, response) {
1915
- const config = this || defaults$1;
1916
- const context = response || config;
1917
- const headers = AxiosHeaders$2.from(context.headers);
1918
- let data = context.data;
1919
-
1920
- utils$1.forEach(fns, function transform(fn) {
1921
- data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
1922
- });
1923
-
1924
- headers.normalize();
1925
-
1926
- return data;
1927
- }
1928
-
1929
- function isCancel$1(value) {
1930
- return !!(value && value.__CANCEL__);
1931
- }
1932
-
1933
- /**
1934
- * A `CanceledError` is an object that is thrown when an operation is canceled.
1935
- *
1936
- * @param {string=} message The message.
1937
- * @param {Object=} config The config.
1938
- * @param {Object=} request The request.
1939
- *
1940
- * @returns {CanceledError} The created error.
1941
- */
1942
- function CanceledError$1(message, config, request) {
1943
- // eslint-disable-next-line no-eq-null,eqeqeq
1944
- AxiosError$1.call(this, message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
1945
- this.name = 'CanceledError';
1946
- }
1947
-
1948
- utils$1.inherits(CanceledError$1, AxiosError$1, {
1949
- __CANCEL__: true
1950
- });
1951
-
1952
- /**
1953
- * Resolve or reject a Promise based on response status.
1954
- *
1955
- * @param {Function} resolve A function that resolves the promise.
1956
- * @param {Function} reject A function that rejects the promise.
1957
- * @param {object} response The response.
1958
- *
1959
- * @returns {object} The response.
1960
- */
1961
- function settle(resolve, reject, response) {
1962
- const validateStatus = response.config.validateStatus;
1963
- if (!response.status || !validateStatus || validateStatus(response.status)) {
1964
- resolve(response);
1965
- } else {
1966
- reject(new AxiosError$1(
1967
- 'Request failed with status code ' + response.status,
1968
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
1969
- response.config,
1970
- response.request,
1971
- response
1972
- ));
1973
- }
1974
- }
1975
-
1976
- function parseProtocol(url) {
1977
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
1978
- return match && match[1] || '';
1979
- }
1980
-
1981
- /**
1982
- * Calculate data maxRate
1983
- * @param {Number} [samplesCount= 10]
1984
- * @param {Number} [min= 1000]
1985
- * @returns {Function}
1986
- */
1987
- function speedometer(samplesCount, min) {
1988
- samplesCount = samplesCount || 10;
1989
- const bytes = new Array(samplesCount);
1990
- const timestamps = new Array(samplesCount);
1991
- let head = 0;
1992
- let tail = 0;
1993
- let firstSampleTS;
1994
-
1995
- min = min !== undefined ? min : 1000;
1996
-
1997
- return function push(chunkLength) {
1998
- const now = Date.now();
1999
-
2000
- const startedAt = timestamps[tail];
2001
-
2002
- if (!firstSampleTS) {
2003
- firstSampleTS = now;
2004
- }
2005
-
2006
- bytes[head] = chunkLength;
2007
- timestamps[head] = now;
2008
-
2009
- let i = tail;
2010
- let bytesCount = 0;
2011
-
2012
- while (i !== head) {
2013
- bytesCount += bytes[i++];
2014
- i = i % samplesCount;
2015
- }
2016
-
2017
- head = (head + 1) % samplesCount;
2018
-
2019
- if (head === tail) {
2020
- tail = (tail + 1) % samplesCount;
2021
- }
2022
-
2023
- if (now - firstSampleTS < min) {
2024
- return;
2025
- }
2026
-
2027
- const passed = startedAt && now - startedAt;
2028
-
2029
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
2030
- };
2031
- }
2032
-
2033
- /**
2034
- * Throttle decorator
2035
- * @param {Function} fn
2036
- * @param {Number} freq
2037
- * @return {Function}
2038
- */
2039
- function throttle(fn, freq) {
2040
- let timestamp = 0;
2041
- const threshold = 1000 / freq;
2042
- let timer = null;
2043
- return function throttled() {
2044
- const force = this === true;
2045
-
2046
- const now = Date.now();
2047
- if (force || now - timestamp > threshold) {
2048
- if (timer) {
2049
- clearTimeout(timer);
2050
- timer = null;
2051
- }
2052
- timestamp = now;
2053
- return fn.apply(null, arguments);
2054
- }
2055
- if (!timer) {
2056
- timer = setTimeout(() => {
2057
- timer = null;
2058
- timestamp = Date.now();
2059
- return fn.apply(null, arguments);
2060
- }, threshold - (now - timestamp));
2061
- }
2062
- };
2063
- }
2064
-
2065
- const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
2066
- let bytesNotified = 0;
2067
- const _speedometer = speedometer(50, 250);
2068
-
2069
- return throttle(e => {
2070
- const loaded = e.loaded;
2071
- const total = e.lengthComputable ? e.total : undefined;
2072
- const progressBytes = loaded - bytesNotified;
2073
- const rate = _speedometer(progressBytes);
2074
- const inRange = loaded <= total;
2075
-
2076
- bytesNotified = loaded;
2077
-
2078
- const data = {
2079
- loaded,
2080
- total,
2081
- progress: total ? (loaded / total) : undefined,
2082
- bytes: progressBytes,
2083
- rate: rate ? rate : undefined,
2084
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
2085
- event: e,
2086
- lengthComputable: total != null
2087
- };
2088
-
2089
- data[isDownloadStream ? 'download' : 'upload'] = true;
2090
-
2091
- listener(data);
2092
- }, freq);
2093
- };
2094
-
2095
- const isURLSameOrigin = platform.hasStandardBrowserEnv ?
2096
-
2097
- // Standard browser envs have full support of the APIs needed to test
2098
- // whether the request URL is of the same origin as current location.
2099
- (function standardBrowserEnv() {
2100
- const msie = /(msie|trident)/i.test(navigator.userAgent);
2101
- const urlParsingNode = document.createElement('a');
2102
- let originURL;
2103
-
2104
- /**
2105
- * Parse a URL to discover its components
2106
- *
2107
- * @param {String} url The URL to be parsed
2108
- * @returns {Object}
2109
- */
2110
- function resolveURL(url) {
2111
- let href = url;
2112
-
2113
- if (msie) {
2114
- // IE needs attribute set twice to normalize properties
2115
- urlParsingNode.setAttribute('href', href);
2116
- href = urlParsingNode.href;
2117
- }
2118
-
2119
- urlParsingNode.setAttribute('href', href);
2120
-
2121
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
2122
- return {
2123
- href: urlParsingNode.href,
2124
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
2125
- host: urlParsingNode.host,
2126
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
2127
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
2128
- hostname: urlParsingNode.hostname,
2129
- port: urlParsingNode.port,
2130
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
2131
- urlParsingNode.pathname :
2132
- '/' + urlParsingNode.pathname
2133
- };
2134
- }
2135
-
2136
- originURL = resolveURL(window.location.href);
2137
-
2138
- /**
2139
- * Determine if a URL shares the same origin as the current location
2140
- *
2141
- * @param {String} requestURL The URL to test
2142
- * @returns {boolean} True if URL shares the same origin, otherwise false
2143
- */
2144
- return function isURLSameOrigin(requestURL) {
2145
- const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2146
- return (parsed.protocol === originURL.protocol &&
2147
- parsed.host === originURL.host);
2148
- };
2149
- })() :
2150
-
2151
- // Non standard browser envs (web workers, react-native) lack needed support.
2152
- (function nonStandardBrowserEnv() {
2153
- return function isURLSameOrigin() {
2154
- return true;
2155
- };
2156
- })();
2157
-
2158
- const cookies = platform.hasStandardBrowserEnv ?
2159
-
2160
- // Standard browser envs support document.cookie
2161
- {
2162
- write(name, value, expires, path, domain, secure) {
2163
- const cookie = [name + '=' + encodeURIComponent(value)];
2164
-
2165
- utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
2166
-
2167
- utils$1.isString(path) && cookie.push('path=' + path);
2168
-
2169
- utils$1.isString(domain) && cookie.push('domain=' + domain);
2170
-
2171
- secure === true && cookie.push('secure');
2172
-
2173
- document.cookie = cookie.join('; ');
2174
- },
2175
-
2176
- read(name) {
2177
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
2178
- return (match ? decodeURIComponent(match[3]) : null);
2179
- },
2180
-
2181
- remove(name) {
2182
- this.write(name, '', Date.now() - 86400000);
2183
- }
2184
- }
2185
-
2186
- :
2187
-
2188
- // Non-standard browser env (web workers, react-native) lack needed support.
2189
- {
2190
- write() {},
2191
- read() {
2192
- return null;
2193
- },
2194
- remove() {}
2195
- };
2196
-
2197
- /**
2198
- * Determines whether the specified URL is absolute
2199
- *
2200
- * @param {string} url The URL to test
2201
- *
2202
- * @returns {boolean} True if the specified URL is absolute, otherwise false
2203
- */
2204
- function isAbsoluteURL(url) {
2205
- // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2206
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2207
- // by any combination of letters, digits, plus, period, or hyphen.
2208
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2209
- }
2210
-
2211
- /**
2212
- * Creates a new URL by combining the specified URLs
2213
- *
2214
- * @param {string} baseURL The base URL
2215
- * @param {string} relativeURL The relative URL
2216
- *
2217
- * @returns {string} The combined URL
2218
- */
2219
- function combineURLs(baseURL, relativeURL) {
2220
- return relativeURL
2221
- ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
2222
- : baseURL;
2223
- }
2224
-
2225
- /**
2226
- * Creates a new URL by combining the baseURL with the requestedURL,
2227
- * only when the requestedURL is not already an absolute URL.
2228
- * If the requestURL is absolute, this function returns the requestedURL untouched.
2229
- *
2230
- * @param {string} baseURL The base URL
2231
- * @param {string} requestedURL Absolute or relative URL to combine
2232
- *
2233
- * @returns {string} The combined full path
2234
- */
2235
- function buildFullPath(baseURL, requestedURL) {
2236
- if (baseURL && !isAbsoluteURL(requestedURL)) {
2237
- return combineURLs(baseURL, requestedURL);
2238
- }
2239
- return requestedURL;
2240
- }
2241
-
2242
- const headersToObject = (thing) => thing instanceof AxiosHeaders$2 ? { ...thing } : thing;
2243
-
2244
- /**
2245
- * Config-specific merge-function which creates a new config-object
2246
- * by merging two configuration objects together.
2247
- *
2248
- * @param {Object} config1
2249
- * @param {Object} config2
2250
- *
2251
- * @returns {Object} New object resulting from merging config2 to config1
2252
- */
2253
- function mergeConfig$1(config1, config2) {
2254
- // eslint-disable-next-line no-param-reassign
2255
- config2 = config2 || {};
2256
- const config = {};
2257
-
2258
- function getMergedValue(target, source, caseless) {
2259
- if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
2260
- return utils$1.merge.call({caseless}, target, source);
2261
- } else if (utils$1.isPlainObject(source)) {
2262
- return utils$1.merge({}, source);
2263
- } else if (utils$1.isArray(source)) {
2264
- return source.slice();
2265
- }
2266
- return source;
2267
- }
2268
-
2269
- // eslint-disable-next-line consistent-return
2270
- function mergeDeepProperties(a, b, caseless) {
2271
- if (!utils$1.isUndefined(b)) {
2272
- return getMergedValue(a, b, caseless);
2273
- } else if (!utils$1.isUndefined(a)) {
2274
- return getMergedValue(undefined, a, caseless);
2275
- }
2276
- }
2277
-
2278
- // eslint-disable-next-line consistent-return
2279
- function valueFromConfig2(a, b) {
2280
- if (!utils$1.isUndefined(b)) {
2281
- return getMergedValue(undefined, b);
2282
- }
2283
- }
2284
-
2285
- // eslint-disable-next-line consistent-return
2286
- function defaultToConfig2(a, b) {
2287
- if (!utils$1.isUndefined(b)) {
2288
- return getMergedValue(undefined, b);
2289
- } else if (!utils$1.isUndefined(a)) {
2290
- return getMergedValue(undefined, a);
2291
- }
2292
- }
2293
-
2294
- // eslint-disable-next-line consistent-return
2295
- function mergeDirectKeys(a, b, prop) {
2296
- if (prop in config2) {
2297
- return getMergedValue(a, b);
2298
- } else if (prop in config1) {
2299
- return getMergedValue(undefined, a);
2300
- }
2301
- }
2302
-
2303
- const mergeMap = {
2304
- url: valueFromConfig2,
2305
- method: valueFromConfig2,
2306
- data: valueFromConfig2,
2307
- baseURL: defaultToConfig2,
2308
- transformRequest: defaultToConfig2,
2309
- transformResponse: defaultToConfig2,
2310
- paramsSerializer: defaultToConfig2,
2311
- timeout: defaultToConfig2,
2312
- timeoutMessage: defaultToConfig2,
2313
- withCredentials: defaultToConfig2,
2314
- withXSRFToken: defaultToConfig2,
2315
- adapter: defaultToConfig2,
2316
- responseType: defaultToConfig2,
2317
- xsrfCookieName: defaultToConfig2,
2318
- xsrfHeaderName: defaultToConfig2,
2319
- onUploadProgress: defaultToConfig2,
2320
- onDownloadProgress: defaultToConfig2,
2321
- decompress: defaultToConfig2,
2322
- maxContentLength: defaultToConfig2,
2323
- maxBodyLength: defaultToConfig2,
2324
- beforeRedirect: defaultToConfig2,
2325
- transport: defaultToConfig2,
2326
- httpAgent: defaultToConfig2,
2327
- httpsAgent: defaultToConfig2,
2328
- cancelToken: defaultToConfig2,
2329
- socketPath: defaultToConfig2,
2330
- responseEncoding: defaultToConfig2,
2331
- validateStatus: mergeDirectKeys,
2332
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2333
- };
2334
-
2335
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2336
- const merge = mergeMap[prop] || mergeDeepProperties;
2337
- const configValue = merge(config1[prop], config2[prop], prop);
2338
- (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2339
- });
2340
-
2341
- return config;
2342
- }
2343
-
2344
- const resolveConfig = (config) => {
2345
- const newConfig = mergeConfig$1({}, config);
2346
-
2347
- let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
2348
-
2349
- newConfig.headers = headers = AxiosHeaders$2.from(headers);
2350
-
2351
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
2352
-
2353
- // HTTP basic authentication
2354
- if (auth) {
2355
- headers.set('Authorization', 'Basic ' +
2356
- btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
2357
- );
2358
- }
2359
-
2360
- let contentType;
2361
-
2362
- if (utils$1.isFormData(data)) {
2363
- if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
2364
- headers.setContentType(undefined); // Let the browser set it
2365
- } else if ((contentType = headers.getContentType()) !== false) {
2366
- // fix semicolon duplication issue for ReactNative FormData implementation
2367
- const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
2368
- headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
2369
- }
2370
- }
2371
-
2372
- // Add xsrf header
2373
- // This is only done if running in a standard browser environment.
2374
- // Specifically not if we're in a web worker, or react-native.
2375
-
2376
- if (platform.hasStandardBrowserEnv) {
2377
- withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
2378
-
2379
- if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
2380
- // Add xsrf header
2381
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
2382
-
2383
- if (xsrfValue) {
2384
- headers.set(xsrfHeaderName, xsrfValue);
2385
- }
2386
- }
2387
- }
2388
-
2389
- return newConfig;
2390
- };
2391
-
2392
- const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
2393
-
2394
- const xhrAdapter = isXHRAdapterSupported && function (config) {
2395
- return new Promise(function dispatchXhrRequest(resolve, reject) {
2396
- const _config = resolveConfig(config);
2397
- let requestData = _config.data;
2398
- const requestHeaders = AxiosHeaders$2.from(_config.headers).normalize();
2399
- let {responseType} = _config;
2400
- let onCanceled;
2401
- function done() {
2402
- if (_config.cancelToken) {
2403
- _config.cancelToken.unsubscribe(onCanceled);
2404
- }
2405
-
2406
- if (_config.signal) {
2407
- _config.signal.removeEventListener('abort', onCanceled);
2408
- }
2409
- }
2410
-
2411
- let request = new XMLHttpRequest();
2412
-
2413
- request.open(_config.method.toUpperCase(), _config.url, true);
2414
-
2415
- // Set the request timeout in MS
2416
- request.timeout = _config.timeout;
2417
-
2418
- function onloadend() {
2419
- if (!request) {
2420
- return;
2421
- }
2422
- // Prepare the response
2423
- const responseHeaders = AxiosHeaders$2.from(
2424
- 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
2425
- );
2426
- const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
2427
- request.responseText : request.response;
2428
- const response = {
2429
- data: responseData,
2430
- status: request.status,
2431
- statusText: request.statusText,
2432
- headers: responseHeaders,
2433
- config,
2434
- request
2435
- };
2436
-
2437
- settle(function _resolve(value) {
2438
- resolve(value);
2439
- done();
2440
- }, function _reject(err) {
2441
- reject(err);
2442
- done();
2443
- }, response);
2444
-
2445
- // Clean up request
2446
- request = null;
2447
- }
2448
-
2449
- if ('onloadend' in request) {
2450
- // Use onloadend if available
2451
- request.onloadend = onloadend;
2452
- } else {
2453
- // Listen for ready state to emulate onloadend
2454
- request.onreadystatechange = function handleLoad() {
2455
- if (!request || request.readyState !== 4) {
2456
- return;
2457
- }
2458
-
2459
- // The request errored out and we didn't get a response, this will be
2460
- // handled by onerror instead
2461
- // With one exception: request that using file: protocol, most browsers
2462
- // will return status as 0 even though it's a successful request
2463
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
2464
- return;
2465
- }
2466
- // readystate handler is calling before onerror or ontimeout handlers,
2467
- // so we should call onloadend on the next 'tick'
2468
- setTimeout(onloadend);
2469
- };
2470
- }
2471
-
2472
- // Handle browser request cancellation (as opposed to a manual cancellation)
2473
- request.onabort = function handleAbort() {
2474
- if (!request) {
2475
- return;
2476
- }
2477
-
2478
- reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, _config, request));
2479
-
2480
- // Clean up request
2481
- request = null;
2482
- };
2483
-
2484
- // Handle low level network errors
2485
- request.onerror = function handleError() {
2486
- // Real errors are hidden from us by the browser
2487
- // onerror should only fire if it's a network error
2488
- reject(new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, _config, request));
2489
-
2490
- // Clean up request
2491
- request = null;
2492
- };
2493
-
2494
- // Handle timeout
2495
- request.ontimeout = function handleTimeout() {
2496
- let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
2497
- const transitional = _config.transitional || transitionalDefaults;
2498
- if (_config.timeoutErrorMessage) {
2499
- timeoutErrorMessage = _config.timeoutErrorMessage;
2500
- }
2501
- reject(new AxiosError$1(
2502
- timeoutErrorMessage,
2503
- transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
2504
- _config,
2505
- request));
2506
-
2507
- // Clean up request
2508
- request = null;
2509
- };
2510
-
2511
- // Remove Content-Type if data is undefined
2512
- requestData === undefined && requestHeaders.setContentType(null);
2513
-
2514
- // Add headers to the request
2515
- if ('setRequestHeader' in request) {
2516
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2517
- request.setRequestHeader(key, val);
2518
- });
2519
- }
2520
-
2521
- // Add withCredentials to request if needed
2522
- if (!utils$1.isUndefined(_config.withCredentials)) {
2523
- request.withCredentials = !!_config.withCredentials;
2524
- }
2525
-
2526
- // Add responseType to request if needed
2527
- if (responseType && responseType !== 'json') {
2528
- request.responseType = _config.responseType;
2529
- }
2530
-
2531
- // Handle progress if needed
2532
- if (typeof _config.onDownloadProgress === 'function') {
2533
- request.addEventListener('progress', progressEventReducer(_config.onDownloadProgress, true));
2534
- }
2535
-
2536
- // Not all browsers support upload events
2537
- if (typeof _config.onUploadProgress === 'function' && request.upload) {
2538
- request.upload.addEventListener('progress', progressEventReducer(_config.onUploadProgress));
2539
- }
2540
-
2541
- if (_config.cancelToken || _config.signal) {
2542
- // Handle cancellation
2543
- // eslint-disable-next-line func-names
2544
- onCanceled = cancel => {
2545
- if (!request) {
2546
- return;
2547
- }
2548
- reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
2549
- request.abort();
2550
- request = null;
2551
- };
2552
-
2553
- _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
2554
- if (_config.signal) {
2555
- _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
2556
- }
2557
- }
2558
-
2559
- const protocol = parseProtocol(_config.url);
2560
-
2561
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
2562
- reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
2563
- return;
2564
- }
2565
-
2566
-
2567
- // Send the request
2568
- request.send(requestData || null);
2569
- });
2570
- };
2571
-
2572
- const composeSignals = (signals, timeout) => {
2573
- let controller = new AbortController();
2574
-
2575
- let aborted;
2576
-
2577
- const onabort = function (cancel) {
2578
- if (!aborted) {
2579
- aborted = true;
2580
- unsubscribe();
2581
- const err = cancel instanceof Error ? cancel : this.reason;
2582
- controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
2583
- }
2584
- };
2585
-
2586
- let timer = timeout && setTimeout(() => {
2587
- onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
2588
- }, timeout);
2589
-
2590
- const unsubscribe = () => {
2591
- if (signals) {
2592
- timer && clearTimeout(timer);
2593
- timer = null;
2594
- signals.forEach(signal => {
2595
- signal &&
2596
- (signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
2597
- });
2598
- signals = null;
2599
- }
2600
- };
2601
-
2602
- signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
2603
-
2604
- const {signal} = controller;
2605
-
2606
- signal.unsubscribe = unsubscribe;
2607
-
2608
- return [signal, () => {
2609
- timer && clearTimeout(timer);
2610
- timer = null;
2611
- }];
2612
- };
2613
-
2614
- const composeSignals$1 = composeSignals;
2615
-
2616
- const streamChunk = function* (chunk, chunkSize) {
2617
- let len = chunk.byteLength;
2618
-
2619
- if (!chunkSize || len < chunkSize) {
2620
- yield chunk;
2621
- return;
2622
- }
2623
-
2624
- let pos = 0;
2625
- let end;
2626
-
2627
- while (pos < len) {
2628
- end = pos + chunkSize;
2629
- yield chunk.slice(pos, end);
2630
- pos = end;
2631
- }
2632
- };
2633
-
2634
- const readBytes = async function* (iterable, chunkSize, encode) {
2635
- for await (const chunk of iterable) {
2636
- yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
2637
- }
2638
- };
2639
-
2640
- const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
2641
- const iterator = readBytes(stream, chunkSize, encode);
2642
-
2643
- let bytes = 0;
2644
-
2645
- return new ReadableStream({
2646
- type: 'bytes',
2647
-
2648
- async pull(controller) {
2649
- const {done, value} = await iterator.next();
2650
-
2651
- if (done) {
2652
- controller.close();
2653
- onFinish();
2654
- return;
2655
- }
2656
-
2657
- let len = value.byteLength;
2658
- onProgress && onProgress(bytes += len);
2659
- controller.enqueue(new Uint8Array(value));
2660
- },
2661
- cancel(reason) {
2662
- onFinish(reason);
2663
- return iterator.return();
2664
- }
2665
- }, {
2666
- highWaterMark: 2
2667
- })
2668
- };
2669
-
2670
- const fetchProgressDecorator = (total, fn) => {
2671
- const lengthComputable = total != null;
2672
- return (loaded) => setTimeout(() => fn({
2673
- lengthComputable,
2674
- total,
2675
- loaded
2676
- }));
2677
- };
2678
-
2679
- const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
2680
- const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
2681
-
2682
- // used only inside the fetch adapter
2683
- const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
2684
- ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
2685
- async (str) => new Uint8Array(await new Response(str).arrayBuffer())
2686
- );
2687
-
2688
- const supportsRequestStream = isReadableStreamSupported && (() => {
2689
- let duplexAccessed = false;
2690
-
2691
- const hasContentType = new Request(platform.origin, {
2692
- body: new ReadableStream(),
2693
- method: 'POST',
2694
- get duplex() {
2695
- duplexAccessed = true;
2696
- return 'half';
2697
- },
2698
- }).headers.has('Content-Type');
2699
-
2700
- return duplexAccessed && !hasContentType;
2701
- })();
2702
-
2703
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
2704
-
2705
- const supportsResponseStream = isReadableStreamSupported && !!(()=> {
2706
- try {
2707
- return utils$1.isReadableStream(new Response('').body);
2708
- } catch(err) {
2709
- // return undefined
2710
- }
2711
- })();
2712
-
2713
- const resolvers = {
2714
- stream: supportsResponseStream && ((res) => res.body)
2715
- };
2716
-
2717
- isFetchSupported && (((res) => {
2718
- ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
2719
- !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
2720
- (_, config) => {
2721
- throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
2722
- });
2723
- });
2724
- })(new Response));
2725
-
2726
- const getBodyLength = async (body) => {
2727
- if (body == null) {
2728
- return 0;
2729
- }
2730
-
2731
- if(utils$1.isBlob(body)) {
2732
- return body.size;
2733
- }
2734
-
2735
- if(utils$1.isSpecCompliantForm(body)) {
2736
- return (await new Request(body).arrayBuffer()).byteLength;
2737
- }
2738
-
2739
- if(utils$1.isArrayBufferView(body)) {
2740
- return body.byteLength;
2741
- }
2742
-
2743
- if(utils$1.isURLSearchParams(body)) {
2744
- body = body + '';
2745
- }
2746
-
2747
- if(utils$1.isString(body)) {
2748
- return (await encodeText(body)).byteLength;
2749
- }
2750
- };
2751
-
2752
- const resolveBodyLength = async (headers, body) => {
2753
- const length = utils$1.toFiniteNumber(headers.getContentLength());
2754
-
2755
- return length == null ? getBodyLength(body) : length;
2756
- };
2757
-
2758
- const fetchAdapter = isFetchSupported && (async (config) => {
2759
- let {
2760
- url,
2761
- method,
2762
- data,
2763
- signal,
2764
- cancelToken,
2765
- timeout,
2766
- onDownloadProgress,
2767
- onUploadProgress,
2768
- responseType,
2769
- headers,
2770
- withCredentials = 'same-origin',
2771
- fetchOptions
2772
- } = resolveConfig(config);
2773
-
2774
- responseType = responseType ? (responseType + '').toLowerCase() : 'text';
2775
-
2776
- let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
2777
- composeSignals$1([signal, cancelToken], timeout) : [];
2778
-
2779
- let finished, request;
2780
-
2781
- const onFinish = () => {
2782
- !finished && setTimeout(() => {
2783
- composedSignal && composedSignal.unsubscribe();
2784
- });
2785
-
2786
- finished = true;
2787
- };
2788
-
2789
- let requestContentLength;
2790
-
2791
- try {
2792
- if (
2793
- onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
2794
- (requestContentLength = await resolveBodyLength(headers, data)) !== 0
2795
- ) {
2796
- let _request = new Request(url, {
2797
- method: 'POST',
2798
- body: data,
2799
- duplex: "half"
2800
- });
2801
-
2802
- let contentTypeHeader;
2803
-
2804
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
2805
- headers.setContentType(contentTypeHeader);
2806
- }
2807
-
2808
- if (_request.body) {
2809
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, fetchProgressDecorator(
2810
- requestContentLength,
2811
- progressEventReducer(onUploadProgress)
2812
- ), null, encodeText);
2813
- }
2814
- }
2815
-
2816
- if (!utils$1.isString(withCredentials)) {
2817
- withCredentials = withCredentials ? 'cors' : 'omit';
2818
- }
2819
-
2820
- request = new Request(url, {
2821
- ...fetchOptions,
2822
- signal: composedSignal,
2823
- method: method.toUpperCase(),
2824
- headers: headers.normalize().toJSON(),
2825
- body: data,
2826
- duplex: "half",
2827
- withCredentials
2828
- });
2829
-
2830
- let response = await fetch(request);
2831
-
2832
- const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
2833
-
2834
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
2835
- const options = {};
2836
-
2837
- ['status', 'statusText', 'headers'].forEach(prop => {
2838
- options[prop] = response[prop];
2839
- });
2840
-
2841
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
2842
-
2843
- response = new Response(
2844
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onDownloadProgress && fetchProgressDecorator(
2845
- responseContentLength,
2846
- progressEventReducer(onDownloadProgress, true)
2847
- ), isStreamResponse && onFinish, encodeText),
2848
- options
2849
- );
2850
- }
2851
-
2852
- responseType = responseType || 'text';
2853
-
2854
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
2855
-
2856
- !isStreamResponse && onFinish();
2857
-
2858
- stopTimeout && stopTimeout();
2859
-
2860
- return await new Promise((resolve, reject) => {
2861
- settle(resolve, reject, {
2862
- data: responseData,
2863
- headers: AxiosHeaders$2.from(response.headers),
2864
- status: response.status,
2865
- statusText: response.statusText,
2866
- config,
2867
- request
2868
- });
2869
- })
2870
- } catch (err) {
2871
- onFinish();
2872
-
2873
- if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
2874
- throw Object.assign(
2875
- new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
2876
- {
2877
- cause: err.cause || err
2878
- }
2879
- )
2880
- }
2881
-
2882
- throw AxiosError$1.from(err, err && err.code, config, request);
2883
- }
2884
- });
2885
-
2886
- const knownAdapters = {
2887
- http: httpAdapter,
2888
- xhr: xhrAdapter,
2889
- fetch: fetchAdapter
2890
- };
2891
-
2892
- utils$1.forEach(knownAdapters, (fn, value) => {
2893
- if (fn) {
2894
- try {
2895
- Object.defineProperty(fn, 'name', {value});
2896
- } catch (e) {
2897
- // eslint-disable-next-line no-empty
2898
- }
2899
- Object.defineProperty(fn, 'adapterName', {value});
2900
- }
2901
- });
2902
-
2903
- const renderReason = (reason) => `- ${reason}`;
2904
-
2905
- const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
2906
-
2907
- const adapters = {
2908
- getAdapter: (adapters) => {
2909
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
2910
-
2911
- const {length} = adapters;
2912
- let nameOrAdapter;
2913
- let adapter;
2914
-
2915
- const rejectedReasons = {};
2916
-
2917
- for (let i = 0; i < length; i++) {
2918
- nameOrAdapter = adapters[i];
2919
- let id;
2920
-
2921
- adapter = nameOrAdapter;
2922
-
2923
- if (!isResolvedHandle(nameOrAdapter)) {
2924
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
2925
-
2926
- if (adapter === undefined) {
2927
- throw new AxiosError$1(`Unknown adapter '${id}'`);
2928
- }
2929
- }
2930
-
2931
- if (adapter) {
2932
- break;
2933
- }
2934
-
2935
- rejectedReasons[id || '#' + i] = adapter;
2936
- }
2937
-
2938
- if (!adapter) {
2939
-
2940
- const reasons = Object.entries(rejectedReasons)
2941
- .map(([id, state]) => `adapter ${id} ` +
2942
- (state === false ? 'is not supported by the environment' : 'is not available in the build')
2943
- );
2944
-
2945
- let s = length ?
2946
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
2947
- 'as no adapter specified';
2948
-
2949
- throw new AxiosError$1(
2950
- `There is no suitable adapter to dispatch the request ` + s,
2951
- 'ERR_NOT_SUPPORT'
2952
- );
2953
- }
2954
-
2955
- return adapter;
2956
- },
2957
- adapters: knownAdapters
2958
- };
2959
-
2960
- /**
2961
- * Throws a `CanceledError` if cancellation has been requested.
2962
- *
2963
- * @param {Object} config The config that is to be used for the request
2964
- *
2965
- * @returns {void}
2966
- */
2967
- function throwIfCancellationRequested(config) {
2968
- if (config.cancelToken) {
2969
- config.cancelToken.throwIfRequested();
2970
- }
2971
-
2972
- if (config.signal && config.signal.aborted) {
2973
- throw new CanceledError$1(null, config);
2974
- }
2975
- }
2976
-
2977
- /**
2978
- * Dispatch a request to the server using the configured adapter.
2979
- *
2980
- * @param {object} config The config that is to be used for the request
2981
- *
2982
- * @returns {Promise} The Promise to be fulfilled
2983
- */
2984
- function dispatchRequest(config) {
2985
- throwIfCancellationRequested(config);
2986
-
2987
- config.headers = AxiosHeaders$2.from(config.headers);
2988
-
2989
- // Transform request data
2990
- config.data = transformData.call(
2991
- config,
2992
- config.transformRequest
2993
- );
2994
-
2995
- if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
2996
- config.headers.setContentType('application/x-www-form-urlencoded', false);
2997
- }
2998
-
2999
- const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
3000
-
3001
- return adapter(config).then(function onAdapterResolution(response) {
3002
- throwIfCancellationRequested(config);
3003
-
3004
- // Transform response data
3005
- response.data = transformData.call(
3006
- config,
3007
- config.transformResponse,
3008
- response
3009
- );
3010
-
3011
- response.headers = AxiosHeaders$2.from(response.headers);
3012
-
3013
- return response;
3014
- }, function onAdapterRejection(reason) {
3015
- if (!isCancel$1(reason)) {
3016
- throwIfCancellationRequested(config);
3017
-
3018
- // Transform response data
3019
- if (reason && reason.response) {
3020
- reason.response.data = transformData.call(
3021
- config,
3022
- config.transformResponse,
3023
- reason.response
3024
- );
3025
- reason.response.headers = AxiosHeaders$2.from(reason.response.headers);
3026
- }
3027
- }
3028
-
3029
- return Promise.reject(reason);
3030
- });
3031
- }
3032
-
3033
- const VERSION$1 = "1.7.2";
3034
-
3035
- const validators$1 = {};
3036
-
3037
- // eslint-disable-next-line func-names
3038
- ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
3039
- validators$1[type] = function validator(thing) {
3040
- return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
3041
- };
3042
- });
3043
-
3044
- const deprecatedWarnings = {};
3045
-
3046
- /**
3047
- * Transitional option validator
3048
- *
3049
- * @param {function|boolean?} validator - set to false if the transitional option has been removed
3050
- * @param {string?} version - deprecated version / removed since version
3051
- * @param {string?} message - some message with additional info
3052
- *
3053
- * @returns {function}
3054
- */
3055
- validators$1.transitional = function transitional(validator, version, message) {
3056
- function formatMessage(opt, desc) {
3057
- return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
3058
- }
3059
-
3060
- // eslint-disable-next-line func-names
3061
- return (value, opt, opts) => {
3062
- if (validator === false) {
3063
- throw new AxiosError$1(
3064
- formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
3065
- AxiosError$1.ERR_DEPRECATED
3066
- );
3067
- }
3068
-
3069
- if (version && !deprecatedWarnings[opt]) {
3070
- deprecatedWarnings[opt] = true;
3071
- // eslint-disable-next-line no-console
3072
- console.warn(
3073
- formatMessage(
3074
- opt,
3075
- ' has been deprecated since v' + version + ' and will be removed in the near future'
3076
- )
3077
- );
3078
- }
3079
-
3080
- return validator ? validator(value, opt, opts) : true;
3081
- };
3082
- };
3083
-
3084
- /**
3085
- * Assert object's properties type
3086
- *
3087
- * @param {object} options
3088
- * @param {object} schema
3089
- * @param {boolean?} allowUnknown
3090
- *
3091
- * @returns {object}
3092
- */
3093
-
3094
- function assertOptions(options, schema, allowUnknown) {
3095
- if (typeof options !== 'object') {
3096
- throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
3097
- }
3098
- const keys = Object.keys(options);
3099
- let i = keys.length;
3100
- while (i-- > 0) {
3101
- const opt = keys[i];
3102
- const validator = schema[opt];
3103
- if (validator) {
3104
- const value = options[opt];
3105
- const result = value === undefined || validator(value, opt, options);
3106
- if (result !== true) {
3107
- throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
3108
- }
3109
- continue;
3110
- }
3111
- if (allowUnknown !== true) {
3112
- throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
3113
- }
3114
- }
3115
- }
3116
-
3117
- const validator = {
3118
- assertOptions,
3119
- validators: validators$1
3120
- };
3121
-
3122
- const validators = validator.validators;
3123
-
3124
- /**
3125
- * Create a new instance of Axios
3126
- *
3127
- * @param {Object} instanceConfig The default config for the instance
3128
- *
3129
- * @return {Axios} A new instance of Axios
3130
- */
3131
- class Axios$1 {
3132
- constructor(instanceConfig) {
3133
- this.defaults = instanceConfig;
3134
- this.interceptors = {
3135
- request: new InterceptorManager$1(),
3136
- response: new InterceptorManager$1()
3137
- };
3138
- }
3139
-
3140
- /**
3141
- * Dispatch a request
3142
- *
3143
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
3144
- * @param {?Object} config
3145
- *
3146
- * @returns {Promise} The Promise to be fulfilled
3147
- */
3148
- async request(configOrUrl, config) {
3149
- try {
3150
- return await this._request(configOrUrl, config);
3151
- } catch (err) {
3152
- if (err instanceof Error) {
3153
- let dummy;
3154
-
3155
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
3156
-
3157
- // slice off the Error: ... line
3158
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
3159
- try {
3160
- if (!err.stack) {
3161
- err.stack = stack;
3162
- // match without the 2 top stack lines
3163
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
3164
- err.stack += '\n' + stack;
3165
- }
3166
- } catch (e) {
3167
- // ignore the case where "stack" is an un-writable property
3168
- }
3169
- }
3170
-
3171
- throw err;
3172
- }
3173
- }
3174
-
3175
- _request(configOrUrl, config) {
3176
- /*eslint no-param-reassign:0*/
3177
- // Allow for axios('example/url'[, config]) a la fetch API
3178
- if (typeof configOrUrl === 'string') {
3179
- config = config || {};
3180
- config.url = configOrUrl;
3181
- } else {
3182
- config = configOrUrl || {};
3183
- }
3184
-
3185
- config = mergeConfig$1(this.defaults, config);
3186
-
3187
- const {transitional, paramsSerializer, headers} = config;
3188
-
3189
- if (transitional !== undefined) {
3190
- validator.assertOptions(transitional, {
3191
- silentJSONParsing: validators.transitional(validators.boolean),
3192
- forcedJSONParsing: validators.transitional(validators.boolean),
3193
- clarifyTimeoutError: validators.transitional(validators.boolean)
3194
- }, false);
3195
- }
3196
-
3197
- if (paramsSerializer != null) {
3198
- if (utils$1.isFunction(paramsSerializer)) {
3199
- config.paramsSerializer = {
3200
- serialize: paramsSerializer
3201
- };
3202
- } else {
3203
- validator.assertOptions(paramsSerializer, {
3204
- encode: validators.function,
3205
- serialize: validators.function
3206
- }, true);
3207
- }
3208
- }
3209
-
3210
- // Set config.method
3211
- config.method = (config.method || this.defaults.method || 'get').toLowerCase();
3212
-
3213
- // Flatten headers
3214
- let contextHeaders = headers && utils$1.merge(
3215
- headers.common,
3216
- headers[config.method]
3217
- );
3218
-
3219
- headers && utils$1.forEach(
3220
- ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
3221
- (method) => {
3222
- delete headers[method];
3223
- }
3224
- );
3225
-
3226
- config.headers = AxiosHeaders$2.concat(contextHeaders, headers);
3227
-
3228
- // filter out skipped interceptors
3229
- const requestInterceptorChain = [];
3230
- let synchronousRequestInterceptors = true;
3231
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
3232
- if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
3233
- return;
3234
- }
3235
-
3236
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
3237
-
3238
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
3239
- });
3240
-
3241
- const responseInterceptorChain = [];
3242
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
3243
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
3244
- });
3245
-
3246
- let promise;
3247
- let i = 0;
3248
- let len;
3249
-
3250
- if (!synchronousRequestInterceptors) {
3251
- const chain = [dispatchRequest.bind(this), undefined];
3252
- chain.unshift.apply(chain, requestInterceptorChain);
3253
- chain.push.apply(chain, responseInterceptorChain);
3254
- len = chain.length;
3255
-
3256
- promise = Promise.resolve(config);
3257
-
3258
- while (i < len) {
3259
- promise = promise.then(chain[i++], chain[i++]);
3260
- }
3261
-
3262
- return promise;
3263
- }
3264
-
3265
- len = requestInterceptorChain.length;
3266
-
3267
- let newConfig = config;
3268
-
3269
- i = 0;
3270
-
3271
- while (i < len) {
3272
- const onFulfilled = requestInterceptorChain[i++];
3273
- const onRejected = requestInterceptorChain[i++];
3274
- try {
3275
- newConfig = onFulfilled(newConfig);
3276
- } catch (error) {
3277
- onRejected.call(this, error);
3278
- break;
3279
- }
3280
- }
3281
-
3282
- try {
3283
- promise = dispatchRequest.call(this, newConfig);
3284
- } catch (error) {
3285
- return Promise.reject(error);
3286
- }
3287
-
3288
- i = 0;
3289
- len = responseInterceptorChain.length;
3290
-
3291
- while (i < len) {
3292
- promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
3293
- }
3294
-
3295
- return promise;
3296
- }
3297
-
3298
- getUri(config) {
3299
- config = mergeConfig$1(this.defaults, config);
3300
- const fullPath = buildFullPath(config.baseURL, config.url);
3301
- return buildURL(fullPath, config.params, config.paramsSerializer);
3302
- }
3303
- }
3304
-
3305
- // Provide aliases for supported request methods
3306
- utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
3307
- /*eslint func-names:0*/
3308
- Axios$1.prototype[method] = function(url, config) {
3309
- return this.request(mergeConfig$1(config || {}, {
3310
- method,
3311
- url,
3312
- data: (config || {}).data
3313
- }));
3314
- };
3315
- });
3316
-
3317
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
3318
- /*eslint func-names:0*/
3319
-
3320
- function generateHTTPMethod(isForm) {
3321
- return function httpMethod(url, data, config) {
3322
- return this.request(mergeConfig$1(config || {}, {
3323
- method,
3324
- headers: isForm ? {
3325
- 'Content-Type': 'multipart/form-data'
3326
- } : {},
3327
- url,
3328
- data
3329
- }));
3330
- };
3331
- }
3332
-
3333
- Axios$1.prototype[method] = generateHTTPMethod();
3334
-
3335
- Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
3336
- });
3337
-
3338
- const Axios$2 = Axios$1;
3339
-
3340
- /**
3341
- * A `CancelToken` is an object that can be used to request cancellation of an operation.
3342
- *
3343
- * @param {Function} executor The executor function.
3344
- *
3345
- * @returns {CancelToken}
3346
- */
3347
- class CancelToken$1 {
3348
- constructor(executor) {
3349
- if (typeof executor !== 'function') {
3350
- throw new TypeError('executor must be a function.');
3351
- }
3352
-
3353
- let resolvePromise;
3354
-
3355
- this.promise = new Promise(function promiseExecutor(resolve) {
3356
- resolvePromise = resolve;
3357
- });
3358
-
3359
- const token = this;
3360
-
3361
- // eslint-disable-next-line func-names
3362
- this.promise.then(cancel => {
3363
- if (!token._listeners) return;
3364
-
3365
- let i = token._listeners.length;
3366
-
3367
- while (i-- > 0) {
3368
- token._listeners[i](cancel);
3369
- }
3370
- token._listeners = null;
3371
- });
3372
-
3373
- // eslint-disable-next-line func-names
3374
- this.promise.then = onfulfilled => {
3375
- let _resolve;
3376
- // eslint-disable-next-line func-names
3377
- const promise = new Promise(resolve => {
3378
- token.subscribe(resolve);
3379
- _resolve = resolve;
3380
- }).then(onfulfilled);
3381
-
3382
- promise.cancel = function reject() {
3383
- token.unsubscribe(_resolve);
3384
- };
3385
-
3386
- return promise;
3387
- };
3388
-
3389
- executor(function cancel(message, config, request) {
3390
- if (token.reason) {
3391
- // Cancellation has already been requested
3392
- return;
3393
- }
3394
-
3395
- token.reason = new CanceledError$1(message, config, request);
3396
- resolvePromise(token.reason);
3397
- });
3398
- }
3399
-
3400
- /**
3401
- * Throws a `CanceledError` if cancellation has been requested.
3402
- */
3403
- throwIfRequested() {
3404
- if (this.reason) {
3405
- throw this.reason;
3406
- }
3407
- }
3408
-
3409
- /**
3410
- * Subscribe to the cancel signal
3411
- */
3412
-
3413
- subscribe(listener) {
3414
- if (this.reason) {
3415
- listener(this.reason);
3416
- return;
3417
- }
3418
-
3419
- if (this._listeners) {
3420
- this._listeners.push(listener);
3421
- } else {
3422
- this._listeners = [listener];
3423
- }
3424
- }
3425
-
3426
- /**
3427
- * Unsubscribe from the cancel signal
3428
- */
3429
-
3430
- unsubscribe(listener) {
3431
- if (!this._listeners) {
3432
- return;
3433
- }
3434
- const index = this._listeners.indexOf(listener);
3435
- if (index !== -1) {
3436
- this._listeners.splice(index, 1);
3437
- }
3438
- }
3439
-
3440
- /**
3441
- * Returns an object that contains a new `CancelToken` and a function that, when called,
3442
- * cancels the `CancelToken`.
3443
- */
3444
- static source() {
3445
- let cancel;
3446
- const token = new CancelToken$1(function executor(c) {
3447
- cancel = c;
3448
- });
3449
- return {
3450
- token,
3451
- cancel
3452
- };
3453
- }
3454
- }
3455
-
3456
- const CancelToken$2 = CancelToken$1;
3457
-
3458
- /**
3459
- * Syntactic sugar for invoking a function and expanding an array for arguments.
3460
- *
3461
- * Common use case would be to use `Function.prototype.apply`.
3462
- *
3463
- * ```js
3464
- * function f(x, y, z) {}
3465
- * var args = [1, 2, 3];
3466
- * f.apply(null, args);
3467
- * ```
3468
- *
3469
- * With `spread` this example can be re-written.
3470
- *
3471
- * ```js
3472
- * spread(function(x, y, z) {})([1, 2, 3]);
3473
- * ```
3474
- *
3475
- * @param {Function} callback
3476
- *
3477
- * @returns {Function}
3478
- */
3479
- function spread$1(callback) {
3480
- return function wrap(arr) {
3481
- return callback.apply(null, arr);
3482
- };
3483
- }
3484
-
3485
- /**
3486
- * Determines whether the payload is an error thrown by Axios
3487
- *
3488
- * @param {*} payload The value to test
3489
- *
3490
- * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
3491
- */
3492
- function isAxiosError$1(payload) {
3493
- return utils$1.isObject(payload) && (payload.isAxiosError === true);
3494
- }
3495
-
3496
- const HttpStatusCode$1 = {
3497
- Continue: 100,
3498
- SwitchingProtocols: 101,
3499
- Processing: 102,
3500
- EarlyHints: 103,
3501
- Ok: 200,
3502
- Created: 201,
3503
- Accepted: 202,
3504
- NonAuthoritativeInformation: 203,
3505
- NoContent: 204,
3506
- ResetContent: 205,
3507
- PartialContent: 206,
3508
- MultiStatus: 207,
3509
- AlreadyReported: 208,
3510
- ImUsed: 226,
3511
- MultipleChoices: 300,
3512
- MovedPermanently: 301,
3513
- Found: 302,
3514
- SeeOther: 303,
3515
- NotModified: 304,
3516
- UseProxy: 305,
3517
- Unused: 306,
3518
- TemporaryRedirect: 307,
3519
- PermanentRedirect: 308,
3520
- BadRequest: 400,
3521
- Unauthorized: 401,
3522
- PaymentRequired: 402,
3523
- Forbidden: 403,
3524
- NotFound: 404,
3525
- MethodNotAllowed: 405,
3526
- NotAcceptable: 406,
3527
- ProxyAuthenticationRequired: 407,
3528
- RequestTimeout: 408,
3529
- Conflict: 409,
3530
- Gone: 410,
3531
- LengthRequired: 411,
3532
- PreconditionFailed: 412,
3533
- PayloadTooLarge: 413,
3534
- UriTooLong: 414,
3535
- UnsupportedMediaType: 415,
3536
- RangeNotSatisfiable: 416,
3537
- ExpectationFailed: 417,
3538
- ImATeapot: 418,
3539
- MisdirectedRequest: 421,
3540
- UnprocessableEntity: 422,
3541
- Locked: 423,
3542
- FailedDependency: 424,
3543
- TooEarly: 425,
3544
- UpgradeRequired: 426,
3545
- PreconditionRequired: 428,
3546
- TooManyRequests: 429,
3547
- RequestHeaderFieldsTooLarge: 431,
3548
- UnavailableForLegalReasons: 451,
3549
- InternalServerError: 500,
3550
- NotImplemented: 501,
3551
- BadGateway: 502,
3552
- ServiceUnavailable: 503,
3553
- GatewayTimeout: 504,
3554
- HttpVersionNotSupported: 505,
3555
- VariantAlsoNegotiates: 506,
3556
- InsufficientStorage: 507,
3557
- LoopDetected: 508,
3558
- NotExtended: 510,
3559
- NetworkAuthenticationRequired: 511,
3560
- };
3561
-
3562
- Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
3563
- HttpStatusCode$1[value] = key;
3564
- });
3565
-
3566
- const HttpStatusCode$2 = HttpStatusCode$1;
3567
-
3568
- /**
3569
- * Create an instance of Axios
3570
- *
3571
- * @param {Object} defaultConfig The default config for the instance
3572
- *
3573
- * @returns {Axios} A new instance of Axios
3574
- */
3575
- function createInstance(defaultConfig) {
3576
- const context = new Axios$2(defaultConfig);
3577
- const instance = bind(Axios$2.prototype.request, context);
3578
-
3579
- // Copy axios.prototype to instance
3580
- utils$1.extend(instance, Axios$2.prototype, context, {allOwnKeys: true});
3581
-
3582
- // Copy context to instance
3583
- utils$1.extend(instance, context, null, {allOwnKeys: true});
3584
-
3585
- // Factory for creating new instances
3586
- instance.create = function create(instanceConfig) {
3587
- return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
3588
- };
3589
-
3590
- return instance;
3591
- }
3592
-
3593
- // Create the default instance to be exported
3594
- const axios = createInstance(defaults$1);
3595
-
3596
- // Expose Axios class to allow class inheritance
3597
- axios.Axios = Axios$2;
3598
-
3599
- // Expose Cancel & CancelToken
3600
- axios.CanceledError = CanceledError$1;
3601
- axios.CancelToken = CancelToken$2;
3602
- axios.isCancel = isCancel$1;
3603
- axios.VERSION = VERSION$1;
3604
- axios.toFormData = toFormData$1;
3605
-
3606
- // Expose AxiosError class
3607
- axios.AxiosError = AxiosError$1;
3608
-
3609
- // alias for CanceledError for backward compatibility
3610
- axios.Cancel = axios.CanceledError;
3611
-
3612
- // Expose all/spread
3613
- axios.all = function all(promises) {
3614
- return Promise.all(promises);
3615
- };
3616
-
3617
- axios.spread = spread$1;
3618
-
3619
- // Expose isAxiosError
3620
- axios.isAxiosError = isAxiosError$1;
3621
-
3622
- // Expose mergeConfig
3623
- axios.mergeConfig = mergeConfig$1;
3624
-
3625
- axios.AxiosHeaders = AxiosHeaders$2;
3626
-
3627
- axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
3628
-
3629
- axios.getAdapter = adapters.getAdapter;
3630
-
3631
- axios.HttpStatusCode = HttpStatusCode$2;
3632
-
3633
- axios.default = axios;
3634
-
3635
- // this module should only have a default export
3636
- const axios$1 = axios;
3637
-
3638
- // This module is intended to unwrap Axios default export as named.
3639
- // Keep top-level export same with static properties
3640
- // so that it can keep same with es module or cjs
3641
- const {
3642
- Axios,
3643
- AxiosError,
3644
- CanceledError,
3645
- isCancel,
3646
- CancelToken,
3647
- VERSION,
3648
- all,
3649
- Cancel,
3650
- isAxiosError,
3651
- spread,
3652
- toFormData,
3653
- AxiosHeaders,
3654
- HttpStatusCode,
3655
- formToJSON,
3656
- getAdapter,
3657
- mergeConfig
3658
- } = axios$1;
3659
-
3660
- export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, axios$1 as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };
3661
- //# sourceMappingURL=axios.js.map