n8n-editor-ui 1.63.2 → 1.64.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 (137) hide show
  1. package/dist/assets/{AnnotationTagsDropdown.ee-BrHzX0gM.js → AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-D3L0Zqex.js} +2 -3
  2. package/dist/assets/{AuthView-DBTpAWBR.js → AuthView-Bc_d9TU4.js} +3 -6
  3. package/dist/assets/{AuthView-BnHKMYu_.css → AuthView-Cnr31xHM.css} +6 -5
  4. package/dist/assets/{CanvasControls-DJjSv7Wo.js → CanvasControls-BZZ5xUA4.js} +1 -31
  5. package/dist/assets/{ChangePasswordView-4HfufusV.js → ChangePasswordView-BmKDYqVl.js} +2 -32
  6. package/dist/assets/CollectionParameter-CZX6_SwN.js +4 -0
  7. package/dist/assets/{CredentialsView-ChVc0kqb.js → CredentialsView-BERKB9pX.js} +5 -35
  8. package/dist/assets/{ErrorView-C3MNpu-h.js → ErrorView-CGHYke1h.js} +1 -31
  9. package/dist/assets/{ExecutionsFilter-C71cMIbt.js → ExecutionsFilter-DgmpIaxp.js} +2 -5
  10. package/dist/assets/{ExecutionsView-CyfD2AaP.js → ExecutionsView-BVJE03N7.js} +18 -54
  11. package/dist/assets/{file-saver-Dbfm4l4I.js → FileSaver.min-vFM8HBH6.js} +5 -12
  12. package/dist/assets/{FixedCollectionParameter-DjS7zdm4.js → FixedCollectionParameter-Cu1pUHaU.js} +1 -32
  13. package/dist/assets/{ForgotMyPasswordView-BThu5AzW.js → ForgotMyPasswordView-CA1z31op.js} +2 -32
  14. package/dist/assets/{MainHeader-BonioYN5.js → MainHeader-lphq3_C7.js} +8 -47
  15. package/dist/assets/{MainSidebar-NOlas3VF.js → MainSidebar-CkmsLAKw.js} +5 -44
  16. package/dist/assets/{NodeCreation-ByUlHR8c.js → NodeCreation-CDKKeIJl.js} +4 -7
  17. package/dist/assets/{NodeCreator-DE9FRbnS.js → NodeCreator-vrcCon6T.js} +20 -64
  18. package/dist/assets/{NodeViewSwitcher-D7fdLnF1.js → NodeViewSwitcher-CebfwLIC.js} +17198 -4326
  19. package/dist/assets/{NodeViewSwitcher-BMWd0Gm9.css → NodeViewSwitcher-DFIa0RPL.css} +136 -135
  20. package/dist/assets/{ProjectCardBadge-f4baniz3.js → ProjectCardBadge.vue_vue_type_script_setup_true_lang-FPZVaoxg.js} +1 -12
  21. package/dist/assets/{ProjectSettings-CeJUMGSQ.js → ProjectSettings-CGPWNP7C.js} +6 -38
  22. package/dist/assets/{ProjectTabs-dq7a740r.js → ProjectTabs-D-UxAFWq.js} +1 -3
  23. package/dist/assets/{PushConnectionTracker-Bs_UzKPJ.js → PushConnectionTracker-dMPKSiLd.js} +1 -4
  24. package/dist/assets/{ResourcesListLayout-B1XBsMRy.js → ResourcesListLayout-BmEYzLen.js} +2 -7
  25. package/dist/assets/{RunDataAi-DdGO06st.js → RunDataAi-iy_LiKYx.js} +51 -13
  26. package/dist/assets/{RunDataJson-DTKvzLZz.js → RunDataJson-30CwTvxp.js} +11 -34
  27. package/dist/assets/{jsonpath--XXuA3UN.js → RunDataJsonActions-DM8Iegu4.js} +272 -73
  28. package/dist/assets/{RunDataSearch-CW0connN.js → RunDataSearch-BBZyQz1l.js} +1 -31
  29. package/dist/assets/{RunDataTable-C-mEq2dD.js → RunDataTable-DlYCaRmD.js} +43 -70
  30. package/dist/assets/{SamlOnboarding-BfsNvcA1.js → SamlOnboarding-YPyqQAED.js} +2 -32
  31. package/dist/assets/{SettingsApiView--aIfdlDF.js → SettingsApiView-DM8-r2vC.js} +11 -42
  32. package/dist/assets/{SettingsCommunityNodesView-DdyT-sgu.js → SettingsCommunityNodesView-CKUSvNJA.js} +3 -35
  33. package/dist/assets/{SettingsExternalSecrets-DTMX68vp.js → SettingsExternalSecrets-rn0Uon3J.js} +2 -32
  34. package/dist/assets/SettingsFakeDoorView-DRt2eUs1.js +44 -0
  35. package/dist/assets/{humanize-duration-DdvB4QXM.js → SettingsLdapView-BkNvZbuP.js} +827 -12
  36. package/dist/assets/{SettingsLogStreamingView-lQvw760T.js → SettingsLogStreamingView-DJgGrIQ1.js} +1 -31
  37. package/dist/assets/{SettingsPersonalView-2vlxeSgj.js → SettingsPersonalView-B2bLHSrL.js} +1 -31
  38. package/dist/assets/{SettingsSourceControl-1Z-AF1Yv.js → SettingsSourceControl-B_iPYBUX.js} +4 -35
  39. package/dist/assets/{SettingsSso-Bp82V4Mw.js → SettingsSso-Bo8ktz1t.js} +1 -31
  40. package/dist/assets/{SettingsUsageAndPlan-CDXY25ax.js → SettingsUsageAndPlan-C9jiEOqE.js} +1 -32
  41. package/dist/assets/{SettingsUsersView-3sIYeb4A.js → SettingsUsersView-Do-E2R-M.js} +1 -31
  42. package/dist/assets/{SettingsView-BNNArsIx.js → SettingsView-DK-_ao4_.js} +25 -34
  43. package/dist/assets/{SetupView-pspJi2at.js → SetupView-ZFKQKIJD.js} +2 -32
  44. package/dist/assets/{SetupWorkflowCredentialsButton-SC5-MI0D.js → SetupWorkflowCredentialsButton-BaMJBfk2.js} +1 -31
  45. package/dist/assets/{SetupWorkflowFromTemplateView-CU3grpvN.js → SetupWorkflowFromTemplateView-BvmNbGYh.js} +3 -33
  46. package/dist/assets/{SigninView-CZdE2LU3.js → SigninView-k_FnQgNC.js} +2 -32
  47. package/dist/assets/SignoutView-DTgJmCun.js +27 -0
  48. package/dist/assets/{SignupView-BPlt_Lbh.js → SignupView-GFIqKxQ1.js} +2 -32
  49. package/dist/assets/{TemplateDetails-CdRKYWL6.js → TemplateDetails-CrE5d8Z2.js} +1 -4
  50. package/dist/assets/{TemplateList-BYq50eQG.js → TemplateList-DugVXLa6.js} +1 -3
  51. package/dist/assets/{TemplatesCollectionView-D-N6pD00.js → TemplatesCollectionView-BulzRTVk.js} +5 -35
  52. package/dist/assets/{TemplatesSearchView-CaRL_LUd.js → TemplatesSearchView--aU9JJ_A.js} +738 -41
  53. package/dist/assets/{TemplatesSearchView-BYNWZYGm.css → TemplatesSearchView-BiokbeYf.css} +94 -1
  54. package/dist/assets/{TemplatesView-C5HnqMFU.js → TemplatesView-VxuSLtRB.js} +1 -3
  55. package/dist/assets/{TemplatesWorkflowView-XV_mNcau.js → TemplatesWorkflowView-DEOmoGFU.js} +5 -35
  56. package/dist/assets/{VariablesView-CDacoelY.js → VariablesView-D0qaiG35.js} +2 -33
  57. package/dist/assets/{WorkerView-DciBUDzM.js → WorkerView-BQWPVPCG.js} +159 -43
  58. package/dist/assets/{WorkflowActivator-GHyUbwAO.js → WorkflowActivator-CFE8HnEQ.js} +3 -7
  59. package/dist/assets/{WorkflowExecutionsInfoAccordion-Dez7kHwM.js → WorkflowExecutionsInfoAccordion-j1oBChRL.js} +1 -3
  60. package/dist/assets/{WorkflowExecutionsLandingPage-j7sS9stL.js → WorkflowExecutionsLandingPage-7PqoziUe.js} +2 -32
  61. package/dist/assets/{WorkflowExecutionsPreview-DLogApYK.js → WorkflowExecutionsPreview-BCKc44DY.js} +10 -42
  62. package/dist/assets/{WorkflowExecutionsView-CZ0E-5CZ.js → WorkflowExecutionsView-De-rqjwc.js} +6 -37
  63. package/dist/assets/{WorkflowHistory-D6BLJ_QX.js → WorkflowHistory-BQHDI-k-.js} +8 -45
  64. package/dist/assets/{WorkflowOnboardingView-7Z0s7yrd.js → WorkflowOnboardingView-B3aKS1PJ.js} +1 -31
  65. package/dist/assets/{WorkflowPreview-C2zFAYYi.js → WorkflowPreview-jblZXN9D.js} +1 -3
  66. package/dist/assets/{WorkflowsView-CLNYtnzv.js → WorkflowsView-DQqwovww.js} +19 -37
  67. package/dist/assets/cloud-ChkMgrsu.js +37 -0
  68. package/dist/assets/{dateFormatter-B-oph3V5.js → dateFormatter-BOFH7hQn.js} +1 -1
  69. package/dist/assets/index-B5Li9oNe.js +331713 -0
  70. package/dist/assets/{index-B5Pl_Rdy.css → index-BGyoJ6bM.css} +3941 -8
  71. package/dist/assets/{pushConnection.store-C38m0a4q.js → pushConnection.store-Cp0wdk-m.js} +3 -3
  72. package/dist/assets/{templateActions-BDzt5tYG.js → templateActions-DbRugCSY.js} +1 -1
  73. package/dist/assets/{useBeforeUnload-DAuWtScP.js → useBeforeUnload-HSb2Wsej.js} +1 -2
  74. package/dist/assets/{useExecutionDebugging-DjezN4ny.js → useExecutionDebugging-Czs7eCHy.js} +1 -2
  75. package/dist/assets/{usePushConnection-C-AngCFB.js → usePushConnection-CLr2QrgA.js} +12 -17
  76. package/dist/assets/{useWorkflowActivate-CgGEceEs.js → useWorkflowActivate-D9OoUkBo.js} +1 -2
  77. package/dist/index.html +2 -33
  78. package/package.json +1 -1
  79. package/vite.config.mts +0 -41
  80. package/dist/assets/@jsplumb/browser-ui-D3WTv2iL.js +0 -5431
  81. package/dist/assets/@jsplumb/common-Cn2WooAp.js +0 -142
  82. package/dist/assets/@jsplumb/connector-bezier-BsoOTqok.js +0 -1019
  83. package/dist/assets/@jsplumb/core-DLCSr9D4.js +0 -7317
  84. package/dist/assets/@jsplumb/util-DggqnqQo.js +0 -936
  85. package/dist/assets/@lezer/common-Bs5t-XhT.js +0 -1988
  86. package/dist/assets/@n8n/api-types-Clq_Leox.js +0 -1
  87. package/dist/assets/@n8n/codemirror-lang-Bizw8G99.js +0 -20928
  88. package/dist/assets/@n8n/codemirror-lang-sql-C9sfSTUi.js +0 -14443
  89. package/dist/assets/@n8n/permissions-BxSXRD9U.js +0 -52
  90. package/dist/assets/@sentry/vue-By9cUXYj.js +0 -23618
  91. package/dist/assets/@vue-flow/background-B1J8rodd.js +0 -123
  92. package/dist/assets/@vue-flow/controls-B4bXJQnK.js +0 -204
  93. package/dist/assets/@vue-flow/core-tETEFGtP.js +0 -9818
  94. package/dist/assets/@vue-flow/minimap-CGW7BbeH.js +0 -2951
  95. package/dist/assets/@vue-flow/node-resizer-C7hxX6Ea.js +0 -1398
  96. package/dist/assets/@vueuse/core-BTO0AmLR.js +0 -8894
  97. package/dist/assets/RunDataJsonActions-0J53luAF.js +0 -270
  98. package/dist/assets/SettingsFakeDoorView-CpouiCJM.js +0 -74
  99. package/dist/assets/SettingsLdapView-DtUi0T-K.js +0 -746
  100. package/dist/assets/SignoutView-DN2qdM5U.js +0 -57
  101. package/dist/assets/aws-secrets-manager-NwVFybsa.svg +0 -18
  102. package/dist/assets/axios-BW6T4tHC.js +0 -2403
  103. package/dist/assets/azure-key-vault-DTTl_IR7.svg +0 -23
  104. package/dist/assets/bowser-CDCHPFWD.js +0 -1931
  105. package/dist/assets/change-case-Dux1iW35.js +0 -137
  106. package/dist/assets/chart.js-BYpPl_l4.js +0 -14318
  107. package/dist/assets/cloud-DJUTi_f-.js +0 -95
  108. package/dist/assets/codemirror-lang-html-n8n-BElKE4vf.js +0 -2498
  109. package/dist/assets/dateformat-BevCJF2z.js +0 -208
  110. package/dist/assets/email-providers-Brdpqw-Z.js +0 -1
  111. package/dist/assets/esprima-next-DUEu30kB.js +0 -6712
  112. package/dist/assets/fast-json-stable-stringify-D9R5x91P.js +0 -55
  113. package/dist/assets/flatted-BLlNkUR-.js +0 -76
  114. package/dist/assets/gcp-secrets-manager-BcK0Zj6Y.svg +0 -9
  115. package/dist/assets/hashicorp-5zlHdJCj.webp +0 -0
  116. package/dist/assets/highlight.js-Brdpqw-Z.js +0 -1
  117. package/dist/assets/index-DOjaKjUd.js +0 -87778
  118. package/dist/assets/infisical-Db7VXgLp.webp +0 -0
  119. package/dist/assets/lodash-es-DCRmYdQ5.js +0 -6061
  120. package/dist/assets/luxon-N8mghSWH.js +0 -6159
  121. package/dist/assets/n8n-C6KBCWah.css +0 -4973
  122. package/dist/assets/n8n-o-6nV4eX.js +0 -163925
  123. package/dist/assets/pinia-BWzoPyXU.js +0 -1650
  124. package/dist/assets/prettier-eWLVZldr.js +0 -2294
  125. package/dist/assets/qrcode.vue-BavVPFUM.js +0 -1132
  126. package/dist/assets/timeago.js-CgQus8nl.js +0 -116
  127. package/dist/assets/useUserHelpers-nsswfS_i.js +0 -27
  128. package/dist/assets/uuid-DRDfXVM2.js +0 -542
  129. package/dist/assets/v3-infinite-loading-CHlSsXAy.js +0 -114
  130. package/dist/assets/vendor-D8YCjNHu.js +0 -14463
  131. package/dist/assets/vue-agile-B2NGbzqY.css +0 -93
  132. package/dist/assets/vue-agile-Busf3nxn.js +0 -727
  133. package/dist/assets/vue-chartjs-DBNEiLG-.js +0 -203
  134. package/dist/assets/vue-i18n-CeifA_Nk.js +0 -5329
  135. package/dist/assets/vue-json-pretty-DHS8nWi_.js +0 -340
  136. package/dist/assets/vue3-touch-events-DVOgU3fI.js +0 -301
  137. package/dist/assets/xss-Brdpqw-Z.js +0 -1
@@ -1,2403 +0,0 @@
1
- function bind(fn, thisArg) {
2
- return function wrap() {
3
- return fn.apply(thisArg, arguments);
4
- };
5
- }
6
- "use strict";
7
- const { toString } = Object.prototype;
8
- const { getPrototypeOf } = Object;
9
- const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
10
- const str = toString.call(thing);
11
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
12
- })(/* @__PURE__ */ Object.create(null));
13
- const kindOfTest = (type) => {
14
- type = type.toLowerCase();
15
- return (thing) => kindOf(thing) === type;
16
- };
17
- const typeOfTest = (type) => (thing) => typeof thing === type;
18
- const { isArray } = Array;
19
- const isUndefined = typeOfTest("undefined");
20
- function isBuffer(val) {
21
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
22
- }
23
- const isArrayBuffer = kindOfTest("ArrayBuffer");
24
- function isArrayBufferView(val) {
25
- let result;
26
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
27
- result = ArrayBuffer.isView(val);
28
- } else {
29
- result = val && val.buffer && isArrayBuffer(val.buffer);
30
- }
31
- return result;
32
- }
33
- const isString = typeOfTest("string");
34
- const isFunction = typeOfTest("function");
35
- const isNumber = typeOfTest("number");
36
- const isObject = (thing) => thing !== null && typeof thing === "object";
37
- const isBoolean = (thing) => thing === true || thing === false;
38
- const isPlainObject = (val) => {
39
- if (kindOf(val) !== "object") {
40
- return false;
41
- }
42
- const prototype2 = getPrototypeOf(val);
43
- return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
44
- };
45
- const isDate = kindOfTest("Date");
46
- const isFile = kindOfTest("File");
47
- const isBlob = kindOfTest("Blob");
48
- const isFileList = kindOfTest("FileList");
49
- const isStream = (val) => isObject(val) && isFunction(val.pipe);
50
- const isFormData = (thing) => {
51
- let kind;
52
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
53
- kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
54
- };
55
- const isURLSearchParams = kindOfTest("URLSearchParams");
56
- const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
57
- const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
58
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
59
- if (obj === null || typeof obj === "undefined") {
60
- return;
61
- }
62
- let i;
63
- let l;
64
- if (typeof obj !== "object") {
65
- obj = [obj];
66
- }
67
- if (isArray(obj)) {
68
- for (i = 0, l = obj.length; i < l; i++) {
69
- fn.call(null, obj[i], i, obj);
70
- }
71
- } else {
72
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
73
- const len = keys.length;
74
- let key;
75
- for (i = 0; i < len; i++) {
76
- key = keys[i];
77
- fn.call(null, obj[key], key, obj);
78
- }
79
- }
80
- }
81
- function findKey(obj, key) {
82
- key = key.toLowerCase();
83
- const keys = Object.keys(obj);
84
- let i = keys.length;
85
- let _key;
86
- while (i-- > 0) {
87
- _key = keys[i];
88
- if (key === _key.toLowerCase()) {
89
- return _key;
90
- }
91
- }
92
- return null;
93
- }
94
- const _global = (() => {
95
- if (typeof globalThis !== "undefined") return globalThis;
96
- return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
97
- })();
98
- const isContextDefined = (context) => !isUndefined(context) && context !== _global;
99
- function merge() {
100
- const { caseless } = isContextDefined(this) && this || {};
101
- const result = {};
102
- const assignValue = (val, key) => {
103
- const targetKey = caseless && findKey(result, key) || key;
104
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
105
- result[targetKey] = merge(result[targetKey], val);
106
- } else if (isPlainObject(val)) {
107
- result[targetKey] = merge({}, val);
108
- } else if (isArray(val)) {
109
- result[targetKey] = val.slice();
110
- } else {
111
- result[targetKey] = val;
112
- }
113
- };
114
- for (let i = 0, l = arguments.length; i < l; i++) {
115
- arguments[i] && forEach(arguments[i], assignValue);
116
- }
117
- return result;
118
- }
119
- const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
120
- forEach(b, (val, key) => {
121
- if (thisArg && isFunction(val)) {
122
- a[key] = bind(val, thisArg);
123
- } else {
124
- a[key] = val;
125
- }
126
- }, { allOwnKeys });
127
- return a;
128
- };
129
- const stripBOM = (content) => {
130
- if (content.charCodeAt(0) === 65279) {
131
- content = content.slice(1);
132
- }
133
- return content;
134
- };
135
- const inherits = (constructor, superConstructor, props, descriptors2) => {
136
- constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
137
- constructor.prototype.constructor = constructor;
138
- Object.defineProperty(constructor, "super", {
139
- value: superConstructor.prototype
140
- });
141
- props && Object.assign(constructor.prototype, props);
142
- };
143
- const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
144
- let props;
145
- let i;
146
- let prop;
147
- const merged = {};
148
- destObj = destObj || {};
149
- if (sourceObj == null) return destObj;
150
- do {
151
- props = Object.getOwnPropertyNames(sourceObj);
152
- i = props.length;
153
- while (i-- > 0) {
154
- prop = props[i];
155
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
156
- destObj[prop] = sourceObj[prop];
157
- merged[prop] = true;
158
- }
159
- }
160
- sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
161
- } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
162
- return destObj;
163
- };
164
- const endsWith = (str, searchString, position) => {
165
- str = String(str);
166
- if (position === void 0 || position > str.length) {
167
- position = str.length;
168
- }
169
- position -= searchString.length;
170
- const lastIndex = str.indexOf(searchString, position);
171
- return lastIndex !== -1 && lastIndex === position;
172
- };
173
- const toArray = (thing) => {
174
- if (!thing) return null;
175
- if (isArray(thing)) return thing;
176
- let i = thing.length;
177
- if (!isNumber(i)) return null;
178
- const arr = new Array(i);
179
- while (i-- > 0) {
180
- arr[i] = thing[i];
181
- }
182
- return arr;
183
- };
184
- const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
185
- return (thing) => {
186
- return TypedArray && thing instanceof TypedArray;
187
- };
188
- })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
189
- const forEachEntry = (obj, fn) => {
190
- const generator = obj && obj[Symbol.iterator];
191
- const iterator = generator.call(obj);
192
- let result;
193
- while ((result = iterator.next()) && !result.done) {
194
- const pair = result.value;
195
- fn.call(obj, pair[0], pair[1]);
196
- }
197
- };
198
- const matchAll = (regExp, str) => {
199
- let matches;
200
- const arr = [];
201
- while ((matches = regExp.exec(str)) !== null) {
202
- arr.push(matches);
203
- }
204
- return arr;
205
- };
206
- const isHTMLForm = kindOfTest("HTMLFormElement");
207
- const toCamelCase = (str) => {
208
- return str.toLowerCase().replace(
209
- /[-_\s]([a-z\d])(\w*)/g,
210
- function replacer(m, p1, p2) {
211
- return p1.toUpperCase() + p2;
212
- }
213
- );
214
- };
215
- const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
216
- const isRegExp = kindOfTest("RegExp");
217
- const reduceDescriptors = (obj, reducer) => {
218
- const descriptors2 = Object.getOwnPropertyDescriptors(obj);
219
- const reducedDescriptors = {};
220
- forEach(descriptors2, (descriptor, name) => {
221
- let ret;
222
- if ((ret = reducer(descriptor, name, obj)) !== false) {
223
- reducedDescriptors[name] = ret || descriptor;
224
- }
225
- });
226
- Object.defineProperties(obj, reducedDescriptors);
227
- };
228
- const freezeMethods = (obj) => {
229
- reduceDescriptors(obj, (descriptor, name) => {
230
- if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
231
- return false;
232
- }
233
- const value = obj[name];
234
- if (!isFunction(value)) return;
235
- descriptor.enumerable = false;
236
- if ("writable" in descriptor) {
237
- descriptor.writable = false;
238
- return;
239
- }
240
- if (!descriptor.set) {
241
- descriptor.set = () => {
242
- throw Error("Can not rewrite read-only method '" + name + "'");
243
- };
244
- }
245
- });
246
- };
247
- const toObjectSet = (arrayOrString, delimiter) => {
248
- const obj = {};
249
- const define = (arr) => {
250
- arr.forEach((value) => {
251
- obj[value] = true;
252
- });
253
- };
254
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
255
- return obj;
256
- };
257
- const noop = () => {
258
- };
259
- const toFiniteNumber = (value, defaultValue) => {
260
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
261
- };
262
- const ALPHA = "abcdefghijklmnopqrstuvwxyz";
263
- const DIGIT = "0123456789";
264
- const ALPHABET = {
265
- DIGIT,
266
- ALPHA,
267
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
268
- };
269
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
270
- let str = "";
271
- const { length } = alphabet;
272
- while (size--) {
273
- str += alphabet[Math.random() * length | 0];
274
- }
275
- return str;
276
- };
277
- function isSpecCompliantForm(thing) {
278
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
279
- }
280
- const toJSONObject = (obj) => {
281
- const stack = new Array(10);
282
- const visit = (source, i) => {
283
- if (isObject(source)) {
284
- if (stack.indexOf(source) >= 0) {
285
- return;
286
- }
287
- if (!("toJSON" in source)) {
288
- stack[i] = source;
289
- const target = isArray(source) ? [] : {};
290
- forEach(source, (value, key) => {
291
- const reducedValue = visit(value, i + 1);
292
- !isUndefined(reducedValue) && (target[key] = reducedValue);
293
- });
294
- stack[i] = void 0;
295
- return target;
296
- }
297
- }
298
- return source;
299
- };
300
- return visit(obj, 0);
301
- };
302
- const isAsyncFn = kindOfTest("AsyncFunction");
303
- const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
304
- const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
305
- if (setImmediateSupported) {
306
- return setImmediate;
307
- }
308
- return postMessageSupported ? ((token, callbacks) => {
309
- _global.addEventListener("message", ({ source, data }) => {
310
- if (source === _global && data === token) {
311
- callbacks.length && callbacks.shift()();
312
- }
313
- }, false);
314
- return (cb) => {
315
- callbacks.push(cb);
316
- _global.postMessage(token, "*");
317
- };
318
- })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
319
- })(
320
- typeof setImmediate === "function",
321
- isFunction(_global.postMessage)
322
- );
323
- const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
324
- const utils$1 = {
325
- isArray,
326
- isArrayBuffer,
327
- isBuffer,
328
- isFormData,
329
- isArrayBufferView,
330
- isString,
331
- isNumber,
332
- isBoolean,
333
- isObject,
334
- isPlainObject,
335
- isReadableStream,
336
- isRequest,
337
- isResponse,
338
- isHeaders,
339
- isUndefined,
340
- isDate,
341
- isFile,
342
- isBlob,
343
- isRegExp,
344
- isFunction,
345
- isStream,
346
- isURLSearchParams,
347
- isTypedArray,
348
- isFileList,
349
- forEach,
350
- merge,
351
- extend,
352
- trim,
353
- stripBOM,
354
- inherits,
355
- toFlatObject,
356
- kindOf,
357
- kindOfTest,
358
- endsWith,
359
- toArray,
360
- forEachEntry,
361
- matchAll,
362
- isHTMLForm,
363
- hasOwnProperty,
364
- hasOwnProp: hasOwnProperty,
365
- // an alias to avoid ESLint no-prototype-builtins detection
366
- reduceDescriptors,
367
- freezeMethods,
368
- toObjectSet,
369
- toCamelCase,
370
- noop,
371
- toFiniteNumber,
372
- findKey,
373
- global: _global,
374
- isContextDefined,
375
- ALPHABET,
376
- generateString,
377
- isSpecCompliantForm,
378
- toJSONObject,
379
- isAsyncFn,
380
- isThenable,
381
- setImmediate: _setImmediate,
382
- asap
383
- };
384
- "use strict";
385
- function AxiosError$1(message, code, config, request, response) {
386
- Error.call(this);
387
- if (Error.captureStackTrace) {
388
- Error.captureStackTrace(this, this.constructor);
389
- } else {
390
- this.stack = new Error().stack;
391
- }
392
- this.message = message;
393
- this.name = "AxiosError";
394
- code && (this.code = code);
395
- config && (this.config = config);
396
- request && (this.request = request);
397
- response && (this.response = response);
398
- }
399
- utils$1.inherits(AxiosError$1, Error, {
400
- toJSON: function toJSON() {
401
- return {
402
- // Standard
403
- message: this.message,
404
- name: this.name,
405
- // Microsoft
406
- description: this.description,
407
- number: this.number,
408
- // Mozilla
409
- fileName: this.fileName,
410
- lineNumber: this.lineNumber,
411
- columnNumber: this.columnNumber,
412
- stack: this.stack,
413
- // Axios
414
- config: utils$1.toJSONObject(this.config),
415
- code: this.code,
416
- status: this.response && this.response.status ? this.response.status : null
417
- };
418
- }
419
- });
420
- const prototype$1 = AxiosError$1.prototype;
421
- const descriptors = {};
422
- [
423
- "ERR_BAD_OPTION_VALUE",
424
- "ERR_BAD_OPTION",
425
- "ECONNABORTED",
426
- "ETIMEDOUT",
427
- "ERR_NETWORK",
428
- "ERR_FR_TOO_MANY_REDIRECTS",
429
- "ERR_DEPRECATED",
430
- "ERR_BAD_RESPONSE",
431
- "ERR_BAD_REQUEST",
432
- "ERR_CANCELED",
433
- "ERR_NOT_SUPPORT",
434
- "ERR_INVALID_URL"
435
- // eslint-disable-next-line func-names
436
- ].forEach((code) => {
437
- descriptors[code] = { value: code };
438
- });
439
- Object.defineProperties(AxiosError$1, descriptors);
440
- Object.defineProperty(prototype$1, "isAxiosError", { value: true });
441
- AxiosError$1.from = (error, code, config, request, response, customProps) => {
442
- const axiosError = Object.create(prototype$1);
443
- utils$1.toFlatObject(error, axiosError, function filter2(obj) {
444
- return obj !== Error.prototype;
445
- }, (prop) => {
446
- return prop !== "isAxiosError";
447
- });
448
- AxiosError$1.call(axiosError, error.message, code, config, request, response);
449
- axiosError.cause = error;
450
- axiosError.name = error.name;
451
- customProps && Object.assign(axiosError, customProps);
452
- return axiosError;
453
- };
454
- const httpAdapter = null;
455
- "use strict";
456
- function isVisitable(thing) {
457
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
458
- }
459
- function removeBrackets(key) {
460
- return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
461
- }
462
- function renderKey(path, key, dots) {
463
- if (!path) return key;
464
- return path.concat(key).map(function each(token, i) {
465
- token = removeBrackets(token);
466
- return !dots && i ? "[" + token + "]" : token;
467
- }).join(dots ? "." : "");
468
- }
469
- function isFlatArray(arr) {
470
- return utils$1.isArray(arr) && !arr.some(isVisitable);
471
- }
472
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
473
- return /^is[A-Z]/.test(prop);
474
- });
475
- function toFormData$1(obj, formData, options) {
476
- if (!utils$1.isObject(obj)) {
477
- throw new TypeError("target must be an object");
478
- }
479
- formData = formData || new (httpAdapter || FormData)();
480
- options = utils$1.toFlatObject(options, {
481
- metaTokens: true,
482
- dots: false,
483
- indexes: false
484
- }, false, function defined(option, source) {
485
- return !utils$1.isUndefined(source[option]);
486
- });
487
- const metaTokens = options.metaTokens;
488
- const visitor = options.visitor || defaultVisitor;
489
- const dots = options.dots;
490
- const indexes = options.indexes;
491
- const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
492
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
493
- if (!utils$1.isFunction(visitor)) {
494
- throw new TypeError("visitor must be a function");
495
- }
496
- function convertValue(value) {
497
- if (value === null) return "";
498
- if (utils$1.isDate(value)) {
499
- return value.toISOString();
500
- }
501
- if (!useBlob && utils$1.isBlob(value)) {
502
- throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
503
- }
504
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
505
- return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
506
- }
507
- return value;
508
- }
509
- function defaultVisitor(value, key, path) {
510
- let arr = value;
511
- if (value && !path && typeof value === "object") {
512
- if (utils$1.endsWith(key, "{}")) {
513
- key = metaTokens ? key : key.slice(0, -2);
514
- value = JSON.stringify(value);
515
- } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
516
- key = removeBrackets(key);
517
- arr.forEach(function each(el, index) {
518
- !(utils$1.isUndefined(el) || el === null) && formData.append(
519
- // eslint-disable-next-line no-nested-ternary
520
- indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
521
- convertValue(el)
522
- );
523
- });
524
- return false;
525
- }
526
- }
527
- if (isVisitable(value)) {
528
- return true;
529
- }
530
- formData.append(renderKey(path, key, dots), convertValue(value));
531
- return false;
532
- }
533
- const stack = [];
534
- const exposedHelpers = Object.assign(predicates, {
535
- defaultVisitor,
536
- convertValue,
537
- isVisitable
538
- });
539
- function build(value, path) {
540
- if (utils$1.isUndefined(value)) return;
541
- if (stack.indexOf(value) !== -1) {
542
- throw Error("Circular reference detected in " + path.join("."));
543
- }
544
- stack.push(value);
545
- utils$1.forEach(value, function each(el, key) {
546
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
547
- formData,
548
- el,
549
- utils$1.isString(key) ? key.trim() : key,
550
- path,
551
- exposedHelpers
552
- );
553
- if (result === true) {
554
- build(el, path ? path.concat(key) : [key]);
555
- }
556
- });
557
- stack.pop();
558
- }
559
- if (!utils$1.isObject(obj)) {
560
- throw new TypeError("data must be an object");
561
- }
562
- build(obj);
563
- return formData;
564
- }
565
- "use strict";
566
- function encode$1(str) {
567
- const charMap = {
568
- "!": "%21",
569
- "'": "%27",
570
- "(": "%28",
571
- ")": "%29",
572
- "~": "%7E",
573
- "%20": "+",
574
- "%00": "\0"
575
- };
576
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
577
- return charMap[match];
578
- });
579
- }
580
- function AxiosURLSearchParams(params, options) {
581
- this._pairs = [];
582
- params && toFormData$1(params, this, options);
583
- }
584
- const prototype = AxiosURLSearchParams.prototype;
585
- prototype.append = function append(name, value) {
586
- this._pairs.push([name, value]);
587
- };
588
- prototype.toString = function toString2(encoder) {
589
- const _encode = encoder ? function(value) {
590
- return encoder.call(this, value, encode$1);
591
- } : encode$1;
592
- return this._pairs.map(function each(pair) {
593
- return _encode(pair[0]) + "=" + _encode(pair[1]);
594
- }, "").join("&");
595
- };
596
- "use strict";
597
- function encode(val) {
598
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
599
- }
600
- function buildURL(url, params, options) {
601
- if (!params) {
602
- return url;
603
- }
604
- const _encode = options && options.encode || encode;
605
- const serializeFn = options && options.serialize;
606
- let serializedParams;
607
- if (serializeFn) {
608
- serializedParams = serializeFn(params, options);
609
- } else {
610
- serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
611
- }
612
- if (serializedParams) {
613
- const hashmarkIndex = url.indexOf("#");
614
- if (hashmarkIndex !== -1) {
615
- url = url.slice(0, hashmarkIndex);
616
- }
617
- url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
618
- }
619
- return url;
620
- }
621
- "use strict";
622
- class InterceptorManager {
623
- constructor() {
624
- this.handlers = [];
625
- }
626
- /**
627
- * Add a new interceptor to the stack
628
- *
629
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
630
- * @param {Function} rejected The function to handle `reject` for a `Promise`
631
- *
632
- * @return {Number} An ID used to remove interceptor later
633
- */
634
- use(fulfilled, rejected, options) {
635
- this.handlers.push({
636
- fulfilled,
637
- rejected,
638
- synchronous: options ? options.synchronous : false,
639
- runWhen: options ? options.runWhen : null
640
- });
641
- return this.handlers.length - 1;
642
- }
643
- /**
644
- * Remove an interceptor from the stack
645
- *
646
- * @param {Number} id The ID that was returned by `use`
647
- *
648
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
649
- */
650
- eject(id) {
651
- if (this.handlers[id]) {
652
- this.handlers[id] = null;
653
- }
654
- }
655
- /**
656
- * Clear all interceptors from the stack
657
- *
658
- * @returns {void}
659
- */
660
- clear() {
661
- if (this.handlers) {
662
- this.handlers = [];
663
- }
664
- }
665
- /**
666
- * Iterate over all the registered interceptors
667
- *
668
- * This method is particularly useful for skipping over any
669
- * interceptors that may have become `null` calling `eject`.
670
- *
671
- * @param {Function} fn The function to call for each interceptor
672
- *
673
- * @returns {void}
674
- */
675
- forEach(fn) {
676
- utils$1.forEach(this.handlers, function forEachHandler(h) {
677
- if (h !== null) {
678
- fn(h);
679
- }
680
- });
681
- }
682
- }
683
- "use strict";
684
- const transitionalDefaults = {
685
- silentJSONParsing: true,
686
- forcedJSONParsing: true,
687
- clarifyTimeoutError: false
688
- };
689
- "use strict";
690
- const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
691
- "use strict";
692
- const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
693
- "use strict";
694
- const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
695
- const platform$1 = {
696
- isBrowser: true,
697
- classes: {
698
- URLSearchParams: URLSearchParams$1,
699
- FormData: FormData$1,
700
- Blob: Blob$1
701
- },
702
- protocols: ["http", "https", "file", "blob", "url", "data"]
703
- };
704
- const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
705
- const hasStandardBrowserEnv = ((product) => {
706
- return hasBrowserEnv && ["ReactNative", "NativeScript", "NS"].indexOf(product) < 0;
707
- })(typeof navigator !== "undefined" && navigator.product);
708
- const hasStandardBrowserWebWorkerEnv = (() => {
709
- return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
710
- self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
711
- })();
712
- const origin = hasBrowserEnv && window.location.href || "http://localhost";
713
- const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
714
- __proto__: null,
715
- hasBrowserEnv,
716
- hasStandardBrowserEnv,
717
- hasStandardBrowserWebWorkerEnv,
718
- origin
719
- }, Symbol.toStringTag, { value: "Module" }));
720
- const platform = {
721
- ...utils,
722
- ...platform$1
723
- };
724
- "use strict";
725
- function toURLEncodedForm(data, options) {
726
- return toFormData$1(data, new platform.classes.URLSearchParams(), Object.assign({
727
- visitor: function(value, key, path, helpers) {
728
- if (platform.isNode && utils$1.isBuffer(value)) {
729
- this.append(key, value.toString("base64"));
730
- return false;
731
- }
732
- return helpers.defaultVisitor.apply(this, arguments);
733
- }
734
- }, options));
735
- }
736
- "use strict";
737
- function parsePropPath(name) {
738
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
739
- return match[0] === "[]" ? "" : match[1] || match[0];
740
- });
741
- }
742
- function arrayToObject(arr) {
743
- const obj = {};
744
- const keys = Object.keys(arr);
745
- let i;
746
- const len = keys.length;
747
- let key;
748
- for (i = 0; i < len; i++) {
749
- key = keys[i];
750
- obj[key] = arr[key];
751
- }
752
- return obj;
753
- }
754
- function formDataToJSON(formData) {
755
- function buildPath(path, value, target, index) {
756
- let name = path[index++];
757
- if (name === "__proto__") return true;
758
- const isNumericKey = Number.isFinite(+name);
759
- const isLast = index >= path.length;
760
- name = !name && utils$1.isArray(target) ? target.length : name;
761
- if (isLast) {
762
- if (utils$1.hasOwnProp(target, name)) {
763
- target[name] = [target[name], value];
764
- } else {
765
- target[name] = value;
766
- }
767
- return !isNumericKey;
768
- }
769
- if (!target[name] || !utils$1.isObject(target[name])) {
770
- target[name] = [];
771
- }
772
- const result = buildPath(path, value, target[name], index);
773
- if (result && utils$1.isArray(target[name])) {
774
- target[name] = arrayToObject(target[name]);
775
- }
776
- return !isNumericKey;
777
- }
778
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
779
- const obj = {};
780
- utils$1.forEachEntry(formData, (name, value) => {
781
- buildPath(parsePropPath(name), value, obj, 0);
782
- });
783
- return obj;
784
- }
785
- return null;
786
- }
787
- "use strict";
788
- function stringifySafely(rawValue, parser, encoder) {
789
- if (utils$1.isString(rawValue)) {
790
- try {
791
- (parser || JSON.parse)(rawValue);
792
- return utils$1.trim(rawValue);
793
- } catch (e) {
794
- if (e.name !== "SyntaxError") {
795
- throw e;
796
- }
797
- }
798
- }
799
- return (encoder || JSON.stringify)(rawValue);
800
- }
801
- const defaults = {
802
- transitional: transitionalDefaults,
803
- adapter: ["xhr", "http", "fetch"],
804
- transformRequest: [function transformRequest(data, headers) {
805
- const contentType = headers.getContentType() || "";
806
- const hasJSONContentType = contentType.indexOf("application/json") > -1;
807
- const isObjectPayload = utils$1.isObject(data);
808
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
809
- data = new FormData(data);
810
- }
811
- const isFormData2 = utils$1.isFormData(data);
812
- if (isFormData2) {
813
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
814
- }
815
- if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
816
- return data;
817
- }
818
- if (utils$1.isArrayBufferView(data)) {
819
- return data.buffer;
820
- }
821
- if (utils$1.isURLSearchParams(data)) {
822
- headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
823
- return data.toString();
824
- }
825
- let isFileList2;
826
- if (isObjectPayload) {
827
- if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
828
- return toURLEncodedForm(data, this.formSerializer).toString();
829
- }
830
- if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
831
- const _FormData = this.env && this.env.FormData;
832
- return toFormData$1(
833
- isFileList2 ? { "files[]": data } : data,
834
- _FormData && new _FormData(),
835
- this.formSerializer
836
- );
837
- }
838
- }
839
- if (isObjectPayload || hasJSONContentType) {
840
- headers.setContentType("application/json", false);
841
- return stringifySafely(data);
842
- }
843
- return data;
844
- }],
845
- transformResponse: [function transformResponse(data) {
846
- const transitional2 = this.transitional || defaults.transitional;
847
- const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
848
- const JSONRequested = this.responseType === "json";
849
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
850
- return data;
851
- }
852
- if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
853
- const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
854
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
855
- try {
856
- return JSON.parse(data);
857
- } catch (e) {
858
- if (strictJSONParsing) {
859
- if (e.name === "SyntaxError") {
860
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
861
- }
862
- throw e;
863
- }
864
- }
865
- }
866
- return data;
867
- }],
868
- /**
869
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
870
- * timeout is not created.
871
- */
872
- timeout: 0,
873
- xsrfCookieName: "XSRF-TOKEN",
874
- xsrfHeaderName: "X-XSRF-TOKEN",
875
- maxContentLength: -1,
876
- maxBodyLength: -1,
877
- env: {
878
- FormData: platform.classes.FormData,
879
- Blob: platform.classes.Blob
880
- },
881
- validateStatus: function validateStatus(status) {
882
- return status >= 200 && status < 300;
883
- },
884
- headers: {
885
- common: {
886
- "Accept": "application/json, text/plain, */*",
887
- "Content-Type": void 0
888
- }
889
- }
890
- };
891
- utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
892
- defaults.headers[method] = {};
893
- });
894
- "use strict";
895
- const ignoreDuplicateOf = utils$1.toObjectSet([
896
- "age",
897
- "authorization",
898
- "content-length",
899
- "content-type",
900
- "etag",
901
- "expires",
902
- "from",
903
- "host",
904
- "if-modified-since",
905
- "if-unmodified-since",
906
- "last-modified",
907
- "location",
908
- "max-forwards",
909
- "proxy-authorization",
910
- "referer",
911
- "retry-after",
912
- "user-agent"
913
- ]);
914
- const parseHeaders = (rawHeaders) => {
915
- const parsed = {};
916
- let key;
917
- let val;
918
- let i;
919
- rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
920
- i = line.indexOf(":");
921
- key = line.substring(0, i).trim().toLowerCase();
922
- val = line.substring(i + 1).trim();
923
- if (!key || parsed[key] && ignoreDuplicateOf[key]) {
924
- return;
925
- }
926
- if (key === "set-cookie") {
927
- if (parsed[key]) {
928
- parsed[key].push(val);
929
- } else {
930
- parsed[key] = [val];
931
- }
932
- } else {
933
- parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
934
- }
935
- });
936
- return parsed;
937
- };
938
- "use strict";
939
- const $internals = Symbol("internals");
940
- function normalizeHeader(header) {
941
- return header && String(header).trim().toLowerCase();
942
- }
943
- function normalizeValue(value) {
944
- if (value === false || value == null) {
945
- return value;
946
- }
947
- return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
948
- }
949
- function parseTokens(str) {
950
- const tokens = /* @__PURE__ */ Object.create(null);
951
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
952
- let match;
953
- while (match = tokensRE.exec(str)) {
954
- tokens[match[1]] = match[2];
955
- }
956
- return tokens;
957
- }
958
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
959
- function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
960
- if (utils$1.isFunction(filter2)) {
961
- return filter2.call(this, value, header);
962
- }
963
- if (isHeaderNameFilter) {
964
- value = header;
965
- }
966
- if (!utils$1.isString(value)) return;
967
- if (utils$1.isString(filter2)) {
968
- return value.indexOf(filter2) !== -1;
969
- }
970
- if (utils$1.isRegExp(filter2)) {
971
- return filter2.test(value);
972
- }
973
- }
974
- function formatHeader(header) {
975
- return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
976
- return char.toUpperCase() + str;
977
- });
978
- }
979
- function buildAccessors(obj, header) {
980
- const accessorName = utils$1.toCamelCase(" " + header);
981
- ["get", "set", "has"].forEach((methodName) => {
982
- Object.defineProperty(obj, methodName + accessorName, {
983
- value: function(arg1, arg2, arg3) {
984
- return this[methodName].call(this, header, arg1, arg2, arg3);
985
- },
986
- configurable: true
987
- });
988
- });
989
- }
990
- let AxiosHeaders$1 = class AxiosHeaders {
991
- constructor(headers) {
992
- headers && this.set(headers);
993
- }
994
- set(header, valueOrRewrite, rewrite) {
995
- const self2 = this;
996
- function setHeader(_value, _header, _rewrite) {
997
- const lHeader = normalizeHeader(_header);
998
- if (!lHeader) {
999
- throw new Error("header name must be a non-empty string");
1000
- }
1001
- const key = utils$1.findKey(self2, lHeader);
1002
- if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
1003
- self2[key || _header] = normalizeValue(_value);
1004
- }
1005
- }
1006
- const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1007
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1008
- setHeaders(header, valueOrRewrite);
1009
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1010
- setHeaders(parseHeaders(header), valueOrRewrite);
1011
- } else if (utils$1.isHeaders(header)) {
1012
- for (const [key, value] of header.entries()) {
1013
- setHeader(value, key, rewrite);
1014
- }
1015
- } else {
1016
- header != null && setHeader(valueOrRewrite, header, rewrite);
1017
- }
1018
- return this;
1019
- }
1020
- get(header, parser) {
1021
- header = normalizeHeader(header);
1022
- if (header) {
1023
- const key = utils$1.findKey(this, header);
1024
- if (key) {
1025
- const value = this[key];
1026
- if (!parser) {
1027
- return value;
1028
- }
1029
- if (parser === true) {
1030
- return parseTokens(value);
1031
- }
1032
- if (utils$1.isFunction(parser)) {
1033
- return parser.call(this, value, key);
1034
- }
1035
- if (utils$1.isRegExp(parser)) {
1036
- return parser.exec(value);
1037
- }
1038
- throw new TypeError("parser must be boolean|regexp|function");
1039
- }
1040
- }
1041
- }
1042
- has(header, matcher) {
1043
- header = normalizeHeader(header);
1044
- if (header) {
1045
- const key = utils$1.findKey(this, header);
1046
- return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1047
- }
1048
- return false;
1049
- }
1050
- delete(header, matcher) {
1051
- const self2 = this;
1052
- let deleted = false;
1053
- function deleteHeader(_header) {
1054
- _header = normalizeHeader(_header);
1055
- if (_header) {
1056
- const key = utils$1.findKey(self2, _header);
1057
- if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
1058
- delete self2[key];
1059
- deleted = true;
1060
- }
1061
- }
1062
- }
1063
- if (utils$1.isArray(header)) {
1064
- header.forEach(deleteHeader);
1065
- } else {
1066
- deleteHeader(header);
1067
- }
1068
- return deleted;
1069
- }
1070
- clear(matcher) {
1071
- const keys = Object.keys(this);
1072
- let i = keys.length;
1073
- let deleted = false;
1074
- while (i--) {
1075
- const key = keys[i];
1076
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1077
- delete this[key];
1078
- deleted = true;
1079
- }
1080
- }
1081
- return deleted;
1082
- }
1083
- normalize(format) {
1084
- const self2 = this;
1085
- const headers = {};
1086
- utils$1.forEach(this, (value, header) => {
1087
- const key = utils$1.findKey(headers, header);
1088
- if (key) {
1089
- self2[key] = normalizeValue(value);
1090
- delete self2[header];
1091
- return;
1092
- }
1093
- const normalized = format ? formatHeader(header) : String(header).trim();
1094
- if (normalized !== header) {
1095
- delete self2[header];
1096
- }
1097
- self2[normalized] = normalizeValue(value);
1098
- headers[normalized] = true;
1099
- });
1100
- return this;
1101
- }
1102
- concat(...targets) {
1103
- return this.constructor.concat(this, ...targets);
1104
- }
1105
- toJSON(asStrings) {
1106
- const obj = /* @__PURE__ */ Object.create(null);
1107
- utils$1.forEach(this, (value, header) => {
1108
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
1109
- });
1110
- return obj;
1111
- }
1112
- [Symbol.iterator]() {
1113
- return Object.entries(this.toJSON())[Symbol.iterator]();
1114
- }
1115
- toString() {
1116
- return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
1117
- }
1118
- get [Symbol.toStringTag]() {
1119
- return "AxiosHeaders";
1120
- }
1121
- static from(thing) {
1122
- return thing instanceof this ? thing : new this(thing);
1123
- }
1124
- static concat(first, ...targets) {
1125
- const computed = new this(first);
1126
- targets.forEach((target) => computed.set(target));
1127
- return computed;
1128
- }
1129
- static accessor(header) {
1130
- const internals = this[$internals] = this[$internals] = {
1131
- accessors: {}
1132
- };
1133
- const accessors = internals.accessors;
1134
- const prototype2 = this.prototype;
1135
- function defineAccessor(_header) {
1136
- const lHeader = normalizeHeader(_header);
1137
- if (!accessors[lHeader]) {
1138
- buildAccessors(prototype2, _header);
1139
- accessors[lHeader] = true;
1140
- }
1141
- }
1142
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1143
- return this;
1144
- }
1145
- };
1146
- AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1147
- utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
1148
- let mapped = key[0].toUpperCase() + key.slice(1);
1149
- return {
1150
- get: () => value,
1151
- set(headerValue) {
1152
- this[mapped] = headerValue;
1153
- }
1154
- };
1155
- });
1156
- utils$1.freezeMethods(AxiosHeaders$1);
1157
- "use strict";
1158
- function transformData(fns, response) {
1159
- const config = this || defaults;
1160
- const context = response || config;
1161
- const headers = AxiosHeaders$1.from(context.headers);
1162
- let data = context.data;
1163
- utils$1.forEach(fns, function transform(fn) {
1164
- data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
1165
- });
1166
- headers.normalize();
1167
- return data;
1168
- }
1169
- "use strict";
1170
- function isCancel$1(value) {
1171
- return !!(value && value.__CANCEL__);
1172
- }
1173
- "use strict";
1174
- function CanceledError$1(message, config, request) {
1175
- AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
1176
- this.name = "CanceledError";
1177
- }
1178
- utils$1.inherits(CanceledError$1, AxiosError$1, {
1179
- __CANCEL__: true
1180
- });
1181
- "use strict";
1182
- function settle(resolve, reject, response) {
1183
- const validateStatus2 = response.config.validateStatus;
1184
- if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
1185
- resolve(response);
1186
- } else {
1187
- reject(new AxiosError$1(
1188
- "Request failed with status code " + response.status,
1189
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
1190
- response.config,
1191
- response.request,
1192
- response
1193
- ));
1194
- }
1195
- }
1196
- "use strict";
1197
- function parseProtocol(url) {
1198
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
1199
- return match && match[1] || "";
1200
- }
1201
- "use strict";
1202
- function speedometer(samplesCount, min) {
1203
- samplesCount = samplesCount || 10;
1204
- const bytes = new Array(samplesCount);
1205
- const timestamps = new Array(samplesCount);
1206
- let head = 0;
1207
- let tail = 0;
1208
- let firstSampleTS;
1209
- min = min !== void 0 ? min : 1e3;
1210
- return function push(chunkLength) {
1211
- const now = Date.now();
1212
- const startedAt = timestamps[tail];
1213
- if (!firstSampleTS) {
1214
- firstSampleTS = now;
1215
- }
1216
- bytes[head] = chunkLength;
1217
- timestamps[head] = now;
1218
- let i = tail;
1219
- let bytesCount = 0;
1220
- while (i !== head) {
1221
- bytesCount += bytes[i++];
1222
- i = i % samplesCount;
1223
- }
1224
- head = (head + 1) % samplesCount;
1225
- if (head === tail) {
1226
- tail = (tail + 1) % samplesCount;
1227
- }
1228
- if (now - firstSampleTS < min) {
1229
- return;
1230
- }
1231
- const passed = startedAt && now - startedAt;
1232
- return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
1233
- };
1234
- }
1235
- function throttle(fn, freq) {
1236
- let timestamp = 0;
1237
- let threshold = 1e3 / freq;
1238
- let lastArgs;
1239
- let timer;
1240
- const invoke = (args, now = Date.now()) => {
1241
- timestamp = now;
1242
- lastArgs = null;
1243
- if (timer) {
1244
- clearTimeout(timer);
1245
- timer = null;
1246
- }
1247
- fn.apply(null, args);
1248
- };
1249
- const throttled = (...args) => {
1250
- const now = Date.now();
1251
- const passed = now - timestamp;
1252
- if (passed >= threshold) {
1253
- invoke(args, now);
1254
- } else {
1255
- lastArgs = args;
1256
- if (!timer) {
1257
- timer = setTimeout(() => {
1258
- timer = null;
1259
- invoke(lastArgs);
1260
- }, threshold - passed);
1261
- }
1262
- }
1263
- };
1264
- const flush = () => lastArgs && invoke(lastArgs);
1265
- return [throttled, flush];
1266
- }
1267
- const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
1268
- let bytesNotified = 0;
1269
- const _speedometer = speedometer(50, 250);
1270
- return throttle((e) => {
1271
- const loaded = e.loaded;
1272
- const total = e.lengthComputable ? e.total : void 0;
1273
- const progressBytes = loaded - bytesNotified;
1274
- const rate = _speedometer(progressBytes);
1275
- const inRange = loaded <= total;
1276
- bytesNotified = loaded;
1277
- const data = {
1278
- loaded,
1279
- total,
1280
- progress: total ? loaded / total : void 0,
1281
- bytes: progressBytes,
1282
- rate: rate ? rate : void 0,
1283
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
1284
- event: e,
1285
- lengthComputable: total != null,
1286
- [isDownloadStream ? "download" : "upload"]: true
1287
- };
1288
- listener(data);
1289
- }, freq);
1290
- };
1291
- const progressEventDecorator = (total, throttled) => {
1292
- const lengthComputable = total != null;
1293
- return [(loaded) => throttled[0]({
1294
- lengthComputable,
1295
- total,
1296
- loaded
1297
- }), throttled[1]];
1298
- };
1299
- const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
1300
- "use strict";
1301
- const isURLSameOrigin = platform.hasStandardBrowserEnv ? (
1302
- // Standard browser envs have full support of the APIs needed to test
1303
- // whether the request URL is of the same origin as current location.
1304
- function standardBrowserEnv() {
1305
- const msie = /(msie|trident)/i.test(navigator.userAgent);
1306
- const urlParsingNode = document.createElement("a");
1307
- let originURL;
1308
- function resolveURL(url) {
1309
- let href = url;
1310
- if (msie) {
1311
- urlParsingNode.setAttribute("href", href);
1312
- href = urlParsingNode.href;
1313
- }
1314
- urlParsingNode.setAttribute("href", href);
1315
- return {
1316
- href: urlParsingNode.href,
1317
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
1318
- host: urlParsingNode.host,
1319
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
1320
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
1321
- hostname: urlParsingNode.hostname,
1322
- port: urlParsingNode.port,
1323
- pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
1324
- };
1325
- }
1326
- originURL = resolveURL(window.location.href);
1327
- return function isURLSameOrigin2(requestURL) {
1328
- const parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
1329
- return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
1330
- };
1331
- }()
1332
- ) : (
1333
- // Non standard browser envs (web workers, react-native) lack needed support.
1334
- /* @__PURE__ */ function nonStandardBrowserEnv() {
1335
- return function isURLSameOrigin2() {
1336
- return true;
1337
- };
1338
- }()
1339
- );
1340
- const cookies = platform.hasStandardBrowserEnv ? (
1341
- // Standard browser envs support document.cookie
1342
- {
1343
- write(name, value, expires, path, domain, secure) {
1344
- const cookie = [name + "=" + encodeURIComponent(value)];
1345
- utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
1346
- utils$1.isString(path) && cookie.push("path=" + path);
1347
- utils$1.isString(domain) && cookie.push("domain=" + domain);
1348
- secure === true && cookie.push("secure");
1349
- document.cookie = cookie.join("; ");
1350
- },
1351
- read(name) {
1352
- const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
1353
- return match ? decodeURIComponent(match[3]) : null;
1354
- },
1355
- remove(name) {
1356
- this.write(name, "", Date.now() - 864e5);
1357
- }
1358
- }
1359
- ) : (
1360
- // Non-standard browser env (web workers, react-native) lack needed support.
1361
- {
1362
- write() {
1363
- },
1364
- read() {
1365
- return null;
1366
- },
1367
- remove() {
1368
- }
1369
- }
1370
- );
1371
- "use strict";
1372
- function isAbsoluteURL(url) {
1373
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
1374
- }
1375
- "use strict";
1376
- function combineURLs(baseURL, relativeURL) {
1377
- return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
1378
- }
1379
- "use strict";
1380
- function buildFullPath(baseURL, requestedURL) {
1381
- if (baseURL && !isAbsoluteURL(requestedURL)) {
1382
- return combineURLs(baseURL, requestedURL);
1383
- }
1384
- return requestedURL;
1385
- }
1386
- "use strict";
1387
- const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
1388
- function mergeConfig$1(config1, config2) {
1389
- config2 = config2 || {};
1390
- const config = {};
1391
- function getMergedValue(target, source, caseless) {
1392
- if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
1393
- return utils$1.merge.call({ caseless }, target, source);
1394
- } else if (utils$1.isPlainObject(source)) {
1395
- return utils$1.merge({}, source);
1396
- } else if (utils$1.isArray(source)) {
1397
- return source.slice();
1398
- }
1399
- return source;
1400
- }
1401
- function mergeDeepProperties(a, b, caseless) {
1402
- if (!utils$1.isUndefined(b)) {
1403
- return getMergedValue(a, b, caseless);
1404
- } else if (!utils$1.isUndefined(a)) {
1405
- return getMergedValue(void 0, a, caseless);
1406
- }
1407
- }
1408
- function valueFromConfig2(a, b) {
1409
- if (!utils$1.isUndefined(b)) {
1410
- return getMergedValue(void 0, b);
1411
- }
1412
- }
1413
- function defaultToConfig2(a, b) {
1414
- if (!utils$1.isUndefined(b)) {
1415
- return getMergedValue(void 0, b);
1416
- } else if (!utils$1.isUndefined(a)) {
1417
- return getMergedValue(void 0, a);
1418
- }
1419
- }
1420
- function mergeDirectKeys(a, b, prop) {
1421
- if (prop in config2) {
1422
- return getMergedValue(a, b);
1423
- } else if (prop in config1) {
1424
- return getMergedValue(void 0, a);
1425
- }
1426
- }
1427
- const mergeMap = {
1428
- url: valueFromConfig2,
1429
- method: valueFromConfig2,
1430
- data: valueFromConfig2,
1431
- baseURL: defaultToConfig2,
1432
- transformRequest: defaultToConfig2,
1433
- transformResponse: defaultToConfig2,
1434
- paramsSerializer: defaultToConfig2,
1435
- timeout: defaultToConfig2,
1436
- timeoutMessage: defaultToConfig2,
1437
- withCredentials: defaultToConfig2,
1438
- withXSRFToken: defaultToConfig2,
1439
- adapter: defaultToConfig2,
1440
- responseType: defaultToConfig2,
1441
- xsrfCookieName: defaultToConfig2,
1442
- xsrfHeaderName: defaultToConfig2,
1443
- onUploadProgress: defaultToConfig2,
1444
- onDownloadProgress: defaultToConfig2,
1445
- decompress: defaultToConfig2,
1446
- maxContentLength: defaultToConfig2,
1447
- maxBodyLength: defaultToConfig2,
1448
- beforeRedirect: defaultToConfig2,
1449
- transport: defaultToConfig2,
1450
- httpAgent: defaultToConfig2,
1451
- httpsAgent: defaultToConfig2,
1452
- cancelToken: defaultToConfig2,
1453
- socketPath: defaultToConfig2,
1454
- responseEncoding: defaultToConfig2,
1455
- validateStatus: mergeDirectKeys,
1456
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
1457
- };
1458
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
1459
- const merge2 = mergeMap[prop] || mergeDeepProperties;
1460
- const configValue = merge2(config1[prop], config2[prop], prop);
1461
- utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
1462
- });
1463
- return config;
1464
- }
1465
- const resolveConfig = (config) => {
1466
- const newConfig = mergeConfig$1({}, config);
1467
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
1468
- newConfig.headers = headers = AxiosHeaders$1.from(headers);
1469
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
1470
- if (auth) {
1471
- headers.set(
1472
- "Authorization",
1473
- "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
1474
- );
1475
- }
1476
- let contentType;
1477
- if (utils$1.isFormData(data)) {
1478
- if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
1479
- headers.setContentType(void 0);
1480
- } else if ((contentType = headers.getContentType()) !== false) {
1481
- const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
1482
- headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
1483
- }
1484
- }
1485
- if (platform.hasStandardBrowserEnv) {
1486
- withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
1487
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
1488
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
1489
- if (xsrfValue) {
1490
- headers.set(xsrfHeaderName, xsrfValue);
1491
- }
1492
- }
1493
- }
1494
- return newConfig;
1495
- };
1496
- const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
1497
- const xhrAdapter = isXHRAdapterSupported && function(config) {
1498
- return new Promise(function dispatchXhrRequest(resolve, reject) {
1499
- const _config = resolveConfig(config);
1500
- let requestData = _config.data;
1501
- const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
1502
- let { responseType, onUploadProgress, onDownloadProgress } = _config;
1503
- let onCanceled;
1504
- let uploadThrottled, downloadThrottled;
1505
- let flushUpload, flushDownload;
1506
- function done() {
1507
- flushUpload && flushUpload();
1508
- flushDownload && flushDownload();
1509
- _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
1510
- _config.signal && _config.signal.removeEventListener("abort", onCanceled);
1511
- }
1512
- let request = new XMLHttpRequest();
1513
- request.open(_config.method.toUpperCase(), _config.url, true);
1514
- request.timeout = _config.timeout;
1515
- function onloadend() {
1516
- if (!request) {
1517
- return;
1518
- }
1519
- const responseHeaders = AxiosHeaders$1.from(
1520
- "getAllResponseHeaders" in request && request.getAllResponseHeaders()
1521
- );
1522
- const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
1523
- const response = {
1524
- data: responseData,
1525
- status: request.status,
1526
- statusText: request.statusText,
1527
- headers: responseHeaders,
1528
- config,
1529
- request
1530
- };
1531
- settle(function _resolve(value) {
1532
- resolve(value);
1533
- done();
1534
- }, function _reject(err) {
1535
- reject(err);
1536
- done();
1537
- }, response);
1538
- request = null;
1539
- }
1540
- if ("onloadend" in request) {
1541
- request.onloadend = onloadend;
1542
- } else {
1543
- request.onreadystatechange = function handleLoad() {
1544
- if (!request || request.readyState !== 4) {
1545
- return;
1546
- }
1547
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
1548
- return;
1549
- }
1550
- setTimeout(onloadend);
1551
- };
1552
- }
1553
- request.onabort = function handleAbort() {
1554
- if (!request) {
1555
- return;
1556
- }
1557
- reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
1558
- request = null;
1559
- };
1560
- request.onerror = function handleError() {
1561
- reject(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request));
1562
- request = null;
1563
- };
1564
- request.ontimeout = function handleTimeout() {
1565
- let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
1566
- const transitional2 = _config.transitional || transitionalDefaults;
1567
- if (_config.timeoutErrorMessage) {
1568
- timeoutErrorMessage = _config.timeoutErrorMessage;
1569
- }
1570
- reject(new AxiosError$1(
1571
- timeoutErrorMessage,
1572
- transitional2.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
1573
- config,
1574
- request
1575
- ));
1576
- request = null;
1577
- };
1578
- requestData === void 0 && requestHeaders.setContentType(null);
1579
- if ("setRequestHeader" in request) {
1580
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
1581
- request.setRequestHeader(key, val);
1582
- });
1583
- }
1584
- if (!utils$1.isUndefined(_config.withCredentials)) {
1585
- request.withCredentials = !!_config.withCredentials;
1586
- }
1587
- if (responseType && responseType !== "json") {
1588
- request.responseType = _config.responseType;
1589
- }
1590
- if (onDownloadProgress) {
1591
- [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
1592
- request.addEventListener("progress", downloadThrottled);
1593
- }
1594
- if (onUploadProgress && request.upload) {
1595
- [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
1596
- request.upload.addEventListener("progress", uploadThrottled);
1597
- request.upload.addEventListener("loadend", flushUpload);
1598
- }
1599
- if (_config.cancelToken || _config.signal) {
1600
- onCanceled = (cancel) => {
1601
- if (!request) {
1602
- return;
1603
- }
1604
- reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
1605
- request.abort();
1606
- request = null;
1607
- };
1608
- _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
1609
- if (_config.signal) {
1610
- _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
1611
- }
1612
- }
1613
- const protocol = parseProtocol(_config.url);
1614
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
1615
- reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config));
1616
- return;
1617
- }
1618
- request.send(requestData || null);
1619
- });
1620
- };
1621
- const composeSignals = (signals, timeout) => {
1622
- let controller = new AbortController();
1623
- let aborted;
1624
- const onabort = function(cancel) {
1625
- if (!aborted) {
1626
- aborted = true;
1627
- unsubscribe();
1628
- const err = cancel instanceof Error ? cancel : this.reason;
1629
- controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
1630
- }
1631
- };
1632
- let timer = timeout && setTimeout(() => {
1633
- onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
1634
- }, timeout);
1635
- const unsubscribe = () => {
1636
- if (signals) {
1637
- timer && clearTimeout(timer);
1638
- timer = null;
1639
- signals.forEach((signal2) => {
1640
- signal2 && (signal2.removeEventListener ? signal2.removeEventListener("abort", onabort) : signal2.unsubscribe(onabort));
1641
- });
1642
- signals = null;
1643
- }
1644
- };
1645
- signals.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort));
1646
- const { signal } = controller;
1647
- signal.unsubscribe = unsubscribe;
1648
- return [signal, () => {
1649
- timer && clearTimeout(timer);
1650
- timer = null;
1651
- }];
1652
- };
1653
- const streamChunk = function* (chunk, chunkSize) {
1654
- let len = chunk.byteLength;
1655
- if (!chunkSize || len < chunkSize) {
1656
- yield chunk;
1657
- return;
1658
- }
1659
- let pos = 0;
1660
- let end;
1661
- while (pos < len) {
1662
- end = pos + chunkSize;
1663
- yield chunk.slice(pos, end);
1664
- pos = end;
1665
- }
1666
- };
1667
- const readBytes = async function* (iterable, chunkSize, encode2) {
1668
- for await (const chunk of iterable) {
1669
- yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : await encode2(String(chunk)), chunkSize);
1670
- }
1671
- };
1672
- const trackStream = (stream, chunkSize, onProgress, onFinish, encode2) => {
1673
- const iterator = readBytes(stream, chunkSize, encode2);
1674
- let bytes = 0;
1675
- let done;
1676
- let _onFinish = (e) => {
1677
- if (!done) {
1678
- done = true;
1679
- onFinish && onFinish(e);
1680
- }
1681
- };
1682
- return new ReadableStream({
1683
- async pull(controller) {
1684
- try {
1685
- const { done: done2, value } = await iterator.next();
1686
- if (done2) {
1687
- _onFinish();
1688
- controller.close();
1689
- return;
1690
- }
1691
- let len = value.byteLength;
1692
- if (onProgress) {
1693
- let loadedBytes = bytes += len;
1694
- onProgress(loadedBytes);
1695
- }
1696
- controller.enqueue(new Uint8Array(value));
1697
- } catch (err) {
1698
- _onFinish(err);
1699
- throw err;
1700
- }
1701
- },
1702
- cancel(reason) {
1703
- _onFinish(reason);
1704
- return iterator.return();
1705
- }
1706
- }, {
1707
- highWaterMark: 2
1708
- });
1709
- };
1710
- const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
1711
- const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
1712
- const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
1713
- const test = (fn, ...args) => {
1714
- try {
1715
- return !!fn(...args);
1716
- } catch (e) {
1717
- return false;
1718
- }
1719
- };
1720
- const supportsRequestStream = isReadableStreamSupported && test(() => {
1721
- let duplexAccessed = false;
1722
- const hasContentType = new Request(platform.origin, {
1723
- body: new ReadableStream(),
1724
- method: "POST",
1725
- get duplex() {
1726
- duplexAccessed = true;
1727
- return "half";
1728
- }
1729
- }).headers.has("Content-Type");
1730
- return duplexAccessed && !hasContentType;
1731
- });
1732
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
1733
- const supportsResponseStream = isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
1734
- const resolvers = {
1735
- stream: supportsResponseStream && ((res) => res.body)
1736
- };
1737
- isFetchSupported && ((res) => {
1738
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
1739
- !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
1740
- throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
1741
- });
1742
- });
1743
- })(new Response());
1744
- const getBodyLength = async (body) => {
1745
- if (body == null) {
1746
- return 0;
1747
- }
1748
- if (utils$1.isBlob(body)) {
1749
- return body.size;
1750
- }
1751
- if (utils$1.isSpecCompliantForm(body)) {
1752
- return (await new Request(body).arrayBuffer()).byteLength;
1753
- }
1754
- if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
1755
- return body.byteLength;
1756
- }
1757
- if (utils$1.isURLSearchParams(body)) {
1758
- body = body + "";
1759
- }
1760
- if (utils$1.isString(body)) {
1761
- return (await encodeText(body)).byteLength;
1762
- }
1763
- };
1764
- const resolveBodyLength = async (headers, body) => {
1765
- const length = utils$1.toFiniteNumber(headers.getContentLength());
1766
- return length == null ? getBodyLength(body) : length;
1767
- };
1768
- const fetchAdapter = isFetchSupported && (async (config) => {
1769
- let {
1770
- url,
1771
- method,
1772
- data,
1773
- signal,
1774
- cancelToken,
1775
- timeout,
1776
- onDownloadProgress,
1777
- onUploadProgress,
1778
- responseType,
1779
- headers,
1780
- withCredentials = "same-origin",
1781
- fetchOptions
1782
- } = resolveConfig(config);
1783
- responseType = responseType ? (responseType + "").toLowerCase() : "text";
1784
- let [composedSignal, stopTimeout] = signal || cancelToken || timeout ? composeSignals([signal, cancelToken], timeout) : [];
1785
- let finished, request;
1786
- const onFinish = () => {
1787
- !finished && setTimeout(() => {
1788
- composedSignal && composedSignal.unsubscribe();
1789
- });
1790
- finished = true;
1791
- };
1792
- let requestContentLength;
1793
- try {
1794
- if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
1795
- let _request = new Request(url, {
1796
- method: "POST",
1797
- body: data,
1798
- duplex: "half"
1799
- });
1800
- let contentTypeHeader;
1801
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
1802
- headers.setContentType(contentTypeHeader);
1803
- }
1804
- if (_request.body) {
1805
- const [onProgress, flush] = progressEventDecorator(
1806
- requestContentLength,
1807
- progressEventReducer(asyncDecorator(onUploadProgress))
1808
- );
1809
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
1810
- }
1811
- }
1812
- if (!utils$1.isString(withCredentials)) {
1813
- withCredentials = withCredentials ? "include" : "omit";
1814
- }
1815
- request = new Request(url, {
1816
- ...fetchOptions,
1817
- signal: composedSignal,
1818
- method: method.toUpperCase(),
1819
- headers: headers.normalize().toJSON(),
1820
- body: data,
1821
- duplex: "half",
1822
- credentials: withCredentials
1823
- });
1824
- let response = await fetch(request);
1825
- const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
1826
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
1827
- const options = {};
1828
- ["status", "statusText", "headers"].forEach((prop) => {
1829
- options[prop] = response[prop];
1830
- });
1831
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
1832
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
1833
- responseContentLength,
1834
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
1835
- ) || [];
1836
- response = new Response(
1837
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
1838
- flush && flush();
1839
- isStreamResponse && onFinish();
1840
- }, encodeText),
1841
- options
1842
- );
1843
- }
1844
- responseType = responseType || "text";
1845
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
1846
- !isStreamResponse && onFinish();
1847
- stopTimeout && stopTimeout();
1848
- return await new Promise((resolve, reject) => {
1849
- settle(resolve, reject, {
1850
- data: responseData,
1851
- headers: AxiosHeaders$1.from(response.headers),
1852
- status: response.status,
1853
- statusText: response.statusText,
1854
- config,
1855
- request
1856
- });
1857
- });
1858
- } catch (err) {
1859
- onFinish();
1860
- if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
1861
- throw Object.assign(
1862
- new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request),
1863
- {
1864
- cause: err.cause || err
1865
- }
1866
- );
1867
- }
1868
- throw AxiosError$1.from(err, err && err.code, config, request);
1869
- }
1870
- });
1871
- const knownAdapters = {
1872
- http: httpAdapter,
1873
- xhr: xhrAdapter,
1874
- fetch: fetchAdapter
1875
- };
1876
- utils$1.forEach(knownAdapters, (fn, value) => {
1877
- if (fn) {
1878
- try {
1879
- Object.defineProperty(fn, "name", { value });
1880
- } catch (e) {
1881
- }
1882
- Object.defineProperty(fn, "adapterName", { value });
1883
- }
1884
- });
1885
- const renderReason = (reason) => `- ${reason}`;
1886
- const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
1887
- const adapters = {
1888
- getAdapter: (adapters2) => {
1889
- adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
1890
- const { length } = adapters2;
1891
- let nameOrAdapter;
1892
- let adapter;
1893
- const rejectedReasons = {};
1894
- for (let i = 0; i < length; i++) {
1895
- nameOrAdapter = adapters2[i];
1896
- let id;
1897
- adapter = nameOrAdapter;
1898
- if (!isResolvedHandle(nameOrAdapter)) {
1899
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
1900
- if (adapter === void 0) {
1901
- throw new AxiosError$1(`Unknown adapter '${id}'`);
1902
- }
1903
- }
1904
- if (adapter) {
1905
- break;
1906
- }
1907
- rejectedReasons[id || "#" + i] = adapter;
1908
- }
1909
- if (!adapter) {
1910
- const reasons = Object.entries(rejectedReasons).map(
1911
- ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
1912
- );
1913
- let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
1914
- throw new AxiosError$1(
1915
- `There is no suitable adapter to dispatch the request ` + s,
1916
- "ERR_NOT_SUPPORT"
1917
- );
1918
- }
1919
- return adapter;
1920
- },
1921
- adapters: knownAdapters
1922
- };
1923
- "use strict";
1924
- function throwIfCancellationRequested(config) {
1925
- if (config.cancelToken) {
1926
- config.cancelToken.throwIfRequested();
1927
- }
1928
- if (config.signal && config.signal.aborted) {
1929
- throw new CanceledError$1(null, config);
1930
- }
1931
- }
1932
- function dispatchRequest(config) {
1933
- throwIfCancellationRequested(config);
1934
- config.headers = AxiosHeaders$1.from(config.headers);
1935
- config.data = transformData.call(
1936
- config,
1937
- config.transformRequest
1938
- );
1939
- if (["post", "put", "patch"].indexOf(config.method) !== -1) {
1940
- config.headers.setContentType("application/x-www-form-urlencoded", false);
1941
- }
1942
- const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
1943
- return adapter(config).then(function onAdapterResolution(response) {
1944
- throwIfCancellationRequested(config);
1945
- response.data = transformData.call(
1946
- config,
1947
- config.transformResponse,
1948
- response
1949
- );
1950
- response.headers = AxiosHeaders$1.from(response.headers);
1951
- return response;
1952
- }, function onAdapterRejection(reason) {
1953
- if (!isCancel$1(reason)) {
1954
- throwIfCancellationRequested(config);
1955
- if (reason && reason.response) {
1956
- reason.response.data = transformData.call(
1957
- config,
1958
- config.transformResponse,
1959
- reason.response
1960
- );
1961
- reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
1962
- }
1963
- }
1964
- return Promise.reject(reason);
1965
- });
1966
- }
1967
- const VERSION$1 = "1.7.4";
1968
- "use strict";
1969
- const validators$1 = {};
1970
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
1971
- validators$1[type] = function validator2(thing) {
1972
- return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
1973
- };
1974
- });
1975
- const deprecatedWarnings = {};
1976
- validators$1.transitional = function transitional(validator2, version, message) {
1977
- function formatMessage(opt, desc) {
1978
- return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
1979
- }
1980
- return (value, opt, opts) => {
1981
- if (validator2 === false) {
1982
- throw new AxiosError$1(
1983
- formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
1984
- AxiosError$1.ERR_DEPRECATED
1985
- );
1986
- }
1987
- if (version && !deprecatedWarnings[opt]) {
1988
- deprecatedWarnings[opt] = true;
1989
- console.warn(
1990
- formatMessage(
1991
- opt,
1992
- " has been deprecated since v" + version + " and will be removed in the near future"
1993
- )
1994
- );
1995
- }
1996
- return validator2 ? validator2(value, opt, opts) : true;
1997
- };
1998
- };
1999
- function assertOptions(options, schema, allowUnknown) {
2000
- if (typeof options !== "object") {
2001
- throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
2002
- }
2003
- const keys = Object.keys(options);
2004
- let i = keys.length;
2005
- while (i-- > 0) {
2006
- const opt = keys[i];
2007
- const validator2 = schema[opt];
2008
- if (validator2) {
2009
- const value = options[opt];
2010
- const result = value === void 0 || validator2(value, opt, options);
2011
- if (result !== true) {
2012
- throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
2013
- }
2014
- continue;
2015
- }
2016
- if (allowUnknown !== true) {
2017
- throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
2018
- }
2019
- }
2020
- }
2021
- const validator = {
2022
- assertOptions,
2023
- validators: validators$1
2024
- };
2025
- "use strict";
2026
- const validators = validator.validators;
2027
- let Axios$1 = class Axios {
2028
- constructor(instanceConfig) {
2029
- this.defaults = instanceConfig;
2030
- this.interceptors = {
2031
- request: new InterceptorManager(),
2032
- response: new InterceptorManager()
2033
- };
2034
- }
2035
- /**
2036
- * Dispatch a request
2037
- *
2038
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2039
- * @param {?Object} config
2040
- *
2041
- * @returns {Promise} The Promise to be fulfilled
2042
- */
2043
- async request(configOrUrl, config) {
2044
- try {
2045
- return await this._request(configOrUrl, config);
2046
- } catch (err) {
2047
- if (err instanceof Error) {
2048
- let dummy;
2049
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
2050
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
2051
- try {
2052
- if (!err.stack) {
2053
- err.stack = stack;
2054
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
2055
- err.stack += "\n" + stack;
2056
- }
2057
- } catch (e) {
2058
- }
2059
- }
2060
- throw err;
2061
- }
2062
- }
2063
- _request(configOrUrl, config) {
2064
- if (typeof configOrUrl === "string") {
2065
- config = config || {};
2066
- config.url = configOrUrl;
2067
- } else {
2068
- config = configOrUrl || {};
2069
- }
2070
- config = mergeConfig$1(this.defaults, config);
2071
- const { transitional: transitional2, paramsSerializer, headers } = config;
2072
- if (transitional2 !== void 0) {
2073
- validator.assertOptions(transitional2, {
2074
- silentJSONParsing: validators.transitional(validators.boolean),
2075
- forcedJSONParsing: validators.transitional(validators.boolean),
2076
- clarifyTimeoutError: validators.transitional(validators.boolean)
2077
- }, false);
2078
- }
2079
- if (paramsSerializer != null) {
2080
- if (utils$1.isFunction(paramsSerializer)) {
2081
- config.paramsSerializer = {
2082
- serialize: paramsSerializer
2083
- };
2084
- } else {
2085
- validator.assertOptions(paramsSerializer, {
2086
- encode: validators.function,
2087
- serialize: validators.function
2088
- }, true);
2089
- }
2090
- }
2091
- config.method = (config.method || this.defaults.method || "get").toLowerCase();
2092
- let contextHeaders = headers && utils$1.merge(
2093
- headers.common,
2094
- headers[config.method]
2095
- );
2096
- headers && utils$1.forEach(
2097
- ["delete", "get", "head", "post", "put", "patch", "common"],
2098
- (method) => {
2099
- delete headers[method];
2100
- }
2101
- );
2102
- config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
2103
- const requestInterceptorChain = [];
2104
- let synchronousRequestInterceptors = true;
2105
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
2106
- if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
2107
- return;
2108
- }
2109
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
2110
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
2111
- });
2112
- const responseInterceptorChain = [];
2113
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
2114
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
2115
- });
2116
- let promise;
2117
- let i = 0;
2118
- let len;
2119
- if (!synchronousRequestInterceptors) {
2120
- const chain = [dispatchRequest.bind(this), void 0];
2121
- chain.unshift.apply(chain, requestInterceptorChain);
2122
- chain.push.apply(chain, responseInterceptorChain);
2123
- len = chain.length;
2124
- promise = Promise.resolve(config);
2125
- while (i < len) {
2126
- promise = promise.then(chain[i++], chain[i++]);
2127
- }
2128
- return promise;
2129
- }
2130
- len = requestInterceptorChain.length;
2131
- let newConfig = config;
2132
- i = 0;
2133
- while (i < len) {
2134
- const onFulfilled = requestInterceptorChain[i++];
2135
- const onRejected = requestInterceptorChain[i++];
2136
- try {
2137
- newConfig = onFulfilled(newConfig);
2138
- } catch (error) {
2139
- onRejected.call(this, error);
2140
- break;
2141
- }
2142
- }
2143
- try {
2144
- promise = dispatchRequest.call(this, newConfig);
2145
- } catch (error) {
2146
- return Promise.reject(error);
2147
- }
2148
- i = 0;
2149
- len = responseInterceptorChain.length;
2150
- while (i < len) {
2151
- promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
2152
- }
2153
- return promise;
2154
- }
2155
- getUri(config) {
2156
- config = mergeConfig$1(this.defaults, config);
2157
- const fullPath = buildFullPath(config.baseURL, config.url);
2158
- return buildURL(fullPath, config.params, config.paramsSerializer);
2159
- }
2160
- };
2161
- utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
2162
- Axios$1.prototype[method] = function(url, config) {
2163
- return this.request(mergeConfig$1(config || {}, {
2164
- method,
2165
- url,
2166
- data: (config || {}).data
2167
- }));
2168
- };
2169
- });
2170
- utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
2171
- function generateHTTPMethod(isForm) {
2172
- return function httpMethod(url, data, config) {
2173
- return this.request(mergeConfig$1(config || {}, {
2174
- method,
2175
- headers: isForm ? {
2176
- "Content-Type": "multipart/form-data"
2177
- } : {},
2178
- url,
2179
- data
2180
- }));
2181
- };
2182
- }
2183
- Axios$1.prototype[method] = generateHTTPMethod();
2184
- Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
2185
- });
2186
- "use strict";
2187
- let CancelToken$1 = class CancelToken {
2188
- constructor(executor) {
2189
- if (typeof executor !== "function") {
2190
- throw new TypeError("executor must be a function.");
2191
- }
2192
- let resolvePromise;
2193
- this.promise = new Promise(function promiseExecutor(resolve) {
2194
- resolvePromise = resolve;
2195
- });
2196
- const token = this;
2197
- this.promise.then((cancel) => {
2198
- if (!token._listeners) return;
2199
- let i = token._listeners.length;
2200
- while (i-- > 0) {
2201
- token._listeners[i](cancel);
2202
- }
2203
- token._listeners = null;
2204
- });
2205
- this.promise.then = (onfulfilled) => {
2206
- let _resolve;
2207
- const promise = new Promise((resolve) => {
2208
- token.subscribe(resolve);
2209
- _resolve = resolve;
2210
- }).then(onfulfilled);
2211
- promise.cancel = function reject() {
2212
- token.unsubscribe(_resolve);
2213
- };
2214
- return promise;
2215
- };
2216
- executor(function cancel(message, config, request) {
2217
- if (token.reason) {
2218
- return;
2219
- }
2220
- token.reason = new CanceledError$1(message, config, request);
2221
- resolvePromise(token.reason);
2222
- });
2223
- }
2224
- /**
2225
- * Throws a `CanceledError` if cancellation has been requested.
2226
- */
2227
- throwIfRequested() {
2228
- if (this.reason) {
2229
- throw this.reason;
2230
- }
2231
- }
2232
- /**
2233
- * Subscribe to the cancel signal
2234
- */
2235
- subscribe(listener) {
2236
- if (this.reason) {
2237
- listener(this.reason);
2238
- return;
2239
- }
2240
- if (this._listeners) {
2241
- this._listeners.push(listener);
2242
- } else {
2243
- this._listeners = [listener];
2244
- }
2245
- }
2246
- /**
2247
- * Unsubscribe from the cancel signal
2248
- */
2249
- unsubscribe(listener) {
2250
- if (!this._listeners) {
2251
- return;
2252
- }
2253
- const index = this._listeners.indexOf(listener);
2254
- if (index !== -1) {
2255
- this._listeners.splice(index, 1);
2256
- }
2257
- }
2258
- /**
2259
- * Returns an object that contains a new `CancelToken` and a function that, when called,
2260
- * cancels the `CancelToken`.
2261
- */
2262
- static source() {
2263
- let cancel;
2264
- const token = new CancelToken(function executor(c) {
2265
- cancel = c;
2266
- });
2267
- return {
2268
- token,
2269
- cancel
2270
- };
2271
- }
2272
- };
2273
- "use strict";
2274
- function spread$1(callback) {
2275
- return function wrap(arr) {
2276
- return callback.apply(null, arr);
2277
- };
2278
- }
2279
- "use strict";
2280
- function isAxiosError$1(payload) {
2281
- return utils$1.isObject(payload) && payload.isAxiosError === true;
2282
- }
2283
- const HttpStatusCode$1 = {
2284
- Continue: 100,
2285
- SwitchingProtocols: 101,
2286
- Processing: 102,
2287
- EarlyHints: 103,
2288
- Ok: 200,
2289
- Created: 201,
2290
- Accepted: 202,
2291
- NonAuthoritativeInformation: 203,
2292
- NoContent: 204,
2293
- ResetContent: 205,
2294
- PartialContent: 206,
2295
- MultiStatus: 207,
2296
- AlreadyReported: 208,
2297
- ImUsed: 226,
2298
- MultipleChoices: 300,
2299
- MovedPermanently: 301,
2300
- Found: 302,
2301
- SeeOther: 303,
2302
- NotModified: 304,
2303
- UseProxy: 305,
2304
- Unused: 306,
2305
- TemporaryRedirect: 307,
2306
- PermanentRedirect: 308,
2307
- BadRequest: 400,
2308
- Unauthorized: 401,
2309
- PaymentRequired: 402,
2310
- Forbidden: 403,
2311
- NotFound: 404,
2312
- MethodNotAllowed: 405,
2313
- NotAcceptable: 406,
2314
- ProxyAuthenticationRequired: 407,
2315
- RequestTimeout: 408,
2316
- Conflict: 409,
2317
- Gone: 410,
2318
- LengthRequired: 411,
2319
- PreconditionFailed: 412,
2320
- PayloadTooLarge: 413,
2321
- UriTooLong: 414,
2322
- UnsupportedMediaType: 415,
2323
- RangeNotSatisfiable: 416,
2324
- ExpectationFailed: 417,
2325
- ImATeapot: 418,
2326
- MisdirectedRequest: 421,
2327
- UnprocessableEntity: 422,
2328
- Locked: 423,
2329
- FailedDependency: 424,
2330
- TooEarly: 425,
2331
- UpgradeRequired: 426,
2332
- PreconditionRequired: 428,
2333
- TooManyRequests: 429,
2334
- RequestHeaderFieldsTooLarge: 431,
2335
- UnavailableForLegalReasons: 451,
2336
- InternalServerError: 500,
2337
- NotImplemented: 501,
2338
- BadGateway: 502,
2339
- ServiceUnavailable: 503,
2340
- GatewayTimeout: 504,
2341
- HttpVersionNotSupported: 505,
2342
- VariantAlsoNegotiates: 506,
2343
- InsufficientStorage: 507,
2344
- LoopDetected: 508,
2345
- NotExtended: 510,
2346
- NetworkAuthenticationRequired: 511
2347
- };
2348
- Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
2349
- HttpStatusCode$1[value] = key;
2350
- });
2351
- "use strict";
2352
- function createInstance(defaultConfig) {
2353
- const context = new Axios$1(defaultConfig);
2354
- const instance = bind(Axios$1.prototype.request, context);
2355
- utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
2356
- utils$1.extend(instance, context, null, { allOwnKeys: true });
2357
- instance.create = function create(instanceConfig) {
2358
- return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
2359
- };
2360
- return instance;
2361
- }
2362
- const axios = createInstance(defaults);
2363
- axios.Axios = Axios$1;
2364
- axios.CanceledError = CanceledError$1;
2365
- axios.CancelToken = CancelToken$1;
2366
- axios.isCancel = isCancel$1;
2367
- axios.VERSION = VERSION$1;
2368
- axios.toFormData = toFormData$1;
2369
- axios.AxiosError = AxiosError$1;
2370
- axios.Cancel = axios.CanceledError;
2371
- axios.all = function all(promises) {
2372
- return Promise.all(promises);
2373
- };
2374
- axios.spread = spread$1;
2375
- axios.isAxiosError = isAxiosError$1;
2376
- axios.mergeConfig = mergeConfig$1;
2377
- axios.AxiosHeaders = AxiosHeaders$1;
2378
- axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
2379
- axios.getAdapter = adapters.getAdapter;
2380
- axios.HttpStatusCode = HttpStatusCode$1;
2381
- axios.default = axios;
2382
- const {
2383
- Axios: Axios2,
2384
- AxiosError,
2385
- CanceledError,
2386
- isCancel,
2387
- CancelToken: CancelToken2,
2388
- VERSION,
2389
- all: all2,
2390
- Cancel,
2391
- isAxiosError,
2392
- spread,
2393
- toFormData,
2394
- AxiosHeaders: AxiosHeaders2,
2395
- HttpStatusCode,
2396
- formToJSON,
2397
- getAdapter,
2398
- mergeConfig
2399
- } = axios;
2400
- export {
2401
- AxiosError as A,
2402
- axios as a
2403
- };