@assembled-brands/frontend 0.1.0 → 0.2.3
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.
- package/dist/pages/account-recovery-complete/index.js +8 -2857
- package/dist/pages/account-recovery-complete/index.js.map +2 -2
- package/dist/pages/account-recovery-initiate/index.js +6 -2824
- package/dist/pages/account-recovery-initiate/index.js.map +2 -2
- package/dist/pages/account-setup-finish-verification/index.js +8 -2862
- package/dist/pages/account-setup-finish-verification/index.js.map +2 -2
- package/dist/pages/claim-account/index.js +6 -2931
- package/dist/pages/claim-account/index.js.map +2 -2
- package/dist/pages/cold-lead-register/index.js +6 -2837
- package/dist/pages/cold-lead-register/index.js.map +2 -2
- package/dist/pages/finance-docs-accounts-inventory/index.js +6 -3208
- package/dist/pages/finance-docs-accounts-inventory/index.js.map +2 -2
- package/dist/pages/finance-docs-ecommerce-performance/index.js +6 -3143
- package/dist/pages/finance-docs-ecommerce-performance/index.js.map +2 -2
- package/dist/pages/finance-docs-financial-reports/index.js +6 -3179
- package/dist/pages/finance-docs-financial-reports/index.js.map +2 -2
- package/dist/pages/finance-docs-team-ownership/index.js +6 -3208
- package/dist/pages/finance-docs-team-ownership/index.js.map +2 -2
- package/dist/pages/financial-company-profile/index.js +6 -3024
- package/dist/pages/financial-company-profile/index.js.map +2 -2
- package/dist/pages/financial-financial-overview/index.js +6 -2966
- package/dist/pages/financial-financial-overview/index.js.map +2 -2
- package/dist/pages/invite-team-members/index.js +6 -2978
- package/dist/pages/invite-team-members/index.js.map +2 -2
- package/dist/pages/login/index.js +8 -2873
- package/dist/pages/login/index.js.map +2 -2
- package/dist/pages/onboarding-step-1/index.js +6 -2868
- package/dist/pages/onboarding-step-1/index.js.map +2 -2
- package/dist/pages/onboarding-step-2/index.js +6 -2870
- package/dist/pages/onboarding-step-2/index.js.map +2 -2
- package/dist/pages/onboarding-step-3/index.js +6 -2888
- package/dist/pages/onboarding-step-3/index.js.map +2 -2
- package/dist/pages/team-acknowledge-invitation/index.js +6 -2812
- package/dist/pages/team-acknowledge-invitation/index.js.map +2 -2
- package/dist/pages/team-members/index.js +6 -2874
- package/dist/pages/team-members/index.js.map +2 -2
- package/package.json +4 -2
- package/dist/_headers +0 -17
|
@@ -1,3208 +1,6 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
for (var name in all3)
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// bin/live-reload.js
|
|
8
|
-
new EventSource(`${"http://localhost:3000"}/esbuild`).addEventListener("change", () => location.reload());
|
|
9
|
-
|
|
10
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/bind.js
|
|
11
|
-
function bind(fn, thisArg) {
|
|
12
|
-
return function wrap() {
|
|
13
|
-
return fn.apply(thisArg, arguments);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/utils.js
|
|
18
|
-
var { toString } = Object.prototype;
|
|
19
|
-
var { getPrototypeOf } = Object;
|
|
20
|
-
var { iterator, toStringTag } = Symbol;
|
|
21
|
-
var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
22
|
-
const str = toString.call(thing);
|
|
23
|
-
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
24
|
-
})(/* @__PURE__ */ Object.create(null));
|
|
25
|
-
var kindOfTest = (type) => {
|
|
26
|
-
type = type.toLowerCase();
|
|
27
|
-
return (thing) => kindOf(thing) === type;
|
|
28
|
-
};
|
|
29
|
-
var typeOfTest = (type) => (thing) => typeof thing === type;
|
|
30
|
-
var { isArray } = Array;
|
|
31
|
-
var isUndefined = typeOfTest("undefined");
|
|
32
|
-
function isBuffer(val) {
|
|
33
|
-
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
34
|
-
}
|
|
35
|
-
var isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
36
|
-
function isArrayBufferView(val) {
|
|
37
|
-
let result;
|
|
38
|
-
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
39
|
-
result = ArrayBuffer.isView(val);
|
|
40
|
-
} else {
|
|
41
|
-
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
42
|
-
}
|
|
43
|
-
return result;
|
|
44
|
-
}
|
|
45
|
-
var isString = typeOfTest("string");
|
|
46
|
-
var isFunction = typeOfTest("function");
|
|
47
|
-
var isNumber = typeOfTest("number");
|
|
48
|
-
var isObject = (thing) => thing !== null && typeof thing === "object";
|
|
49
|
-
var isBoolean = (thing) => thing === true || thing === false;
|
|
50
|
-
var isPlainObject = (val) => {
|
|
51
|
-
if (kindOf(val) !== "object") {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
const prototype3 = getPrototypeOf(val);
|
|
55
|
-
return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(toStringTag in val) && !(iterator in val);
|
|
56
|
-
};
|
|
57
|
-
var isEmptyObject = (val) => {
|
|
58
|
-
if (!isObject(val) || isBuffer(val)) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
try {
|
|
62
|
-
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
63
|
-
} catch (e) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
var isDate = kindOfTest("Date");
|
|
68
|
-
var isFile = kindOfTest("File");
|
|
69
|
-
var isBlob = kindOfTest("Blob");
|
|
70
|
-
var isFileList = kindOfTest("FileList");
|
|
71
|
-
var isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
72
|
-
var isFormData = (thing) => {
|
|
73
|
-
let kind;
|
|
74
|
-
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
|
|
75
|
-
kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
|
|
76
|
-
};
|
|
77
|
-
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
78
|
-
var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
|
|
79
|
-
var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
80
|
-
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
81
|
-
if (obj === null || typeof obj === "undefined") {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
let i;
|
|
85
|
-
let l;
|
|
86
|
-
if (typeof obj !== "object") {
|
|
87
|
-
obj = [obj];
|
|
88
|
-
}
|
|
89
|
-
if (isArray(obj)) {
|
|
90
|
-
for (i = 0, l = obj.length; i < l; i++) {
|
|
91
|
-
fn.call(null, obj[i], i, obj);
|
|
92
|
-
}
|
|
93
|
-
} else {
|
|
94
|
-
if (isBuffer(obj)) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
98
|
-
const len = keys.length;
|
|
99
|
-
let key;
|
|
100
|
-
for (i = 0; i < len; i++) {
|
|
101
|
-
key = keys[i];
|
|
102
|
-
fn.call(null, obj[key], key, obj);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function findKey(obj, key) {
|
|
107
|
-
if (isBuffer(obj)) {
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
key = key.toLowerCase();
|
|
111
|
-
const keys = Object.keys(obj);
|
|
112
|
-
let i = keys.length;
|
|
113
|
-
let _key;
|
|
114
|
-
while (i-- > 0) {
|
|
115
|
-
_key = keys[i];
|
|
116
|
-
if (key === _key.toLowerCase()) {
|
|
117
|
-
return _key;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
var _global = (() => {
|
|
123
|
-
if (typeof globalThis !== "undefined") return globalThis;
|
|
124
|
-
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
|
|
125
|
-
})();
|
|
126
|
-
var isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
127
|
-
function merge() {
|
|
128
|
-
const { caseless, skipUndefined } = isContextDefined(this) && this || {};
|
|
129
|
-
const result = {};
|
|
130
|
-
const assignValue = (val, key) => {
|
|
131
|
-
const targetKey = caseless && findKey(result, key) || key;
|
|
132
|
-
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
133
|
-
result[targetKey] = merge(result[targetKey], val);
|
|
134
|
-
} else if (isPlainObject(val)) {
|
|
135
|
-
result[targetKey] = merge({}, val);
|
|
136
|
-
} else if (isArray(val)) {
|
|
137
|
-
result[targetKey] = val.slice();
|
|
138
|
-
} else if (!skipUndefined || !isUndefined(val)) {
|
|
139
|
-
result[targetKey] = val;
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
143
|
-
arguments[i] && forEach(arguments[i], assignValue);
|
|
144
|
-
}
|
|
145
|
-
return result;
|
|
146
|
-
}
|
|
147
|
-
var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
148
|
-
forEach(b, (val, key) => {
|
|
149
|
-
if (thisArg && isFunction(val)) {
|
|
150
|
-
a[key] = bind(val, thisArg);
|
|
151
|
-
} else {
|
|
152
|
-
a[key] = val;
|
|
153
|
-
}
|
|
154
|
-
}, { allOwnKeys });
|
|
155
|
-
return a;
|
|
156
|
-
};
|
|
157
|
-
var stripBOM = (content) => {
|
|
158
|
-
if (content.charCodeAt(0) === 65279) {
|
|
159
|
-
content = content.slice(1);
|
|
160
|
-
}
|
|
161
|
-
return content;
|
|
162
|
-
};
|
|
163
|
-
var inherits = (constructor, superConstructor, props, descriptors2) => {
|
|
164
|
-
constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
|
|
165
|
-
constructor.prototype.constructor = constructor;
|
|
166
|
-
Object.defineProperty(constructor, "super", {
|
|
167
|
-
value: superConstructor.prototype
|
|
168
|
-
});
|
|
169
|
-
props && Object.assign(constructor.prototype, props);
|
|
170
|
-
};
|
|
171
|
-
var toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
|
|
172
|
-
let props;
|
|
173
|
-
let i;
|
|
174
|
-
let prop;
|
|
175
|
-
const merged = {};
|
|
176
|
-
destObj = destObj || {};
|
|
177
|
-
if (sourceObj == null) return destObj;
|
|
178
|
-
do {
|
|
179
|
-
props = Object.getOwnPropertyNames(sourceObj);
|
|
180
|
-
i = props.length;
|
|
181
|
-
while (i-- > 0) {
|
|
182
|
-
prop = props[i];
|
|
183
|
-
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
184
|
-
destObj[prop] = sourceObj[prop];
|
|
185
|
-
merged[prop] = true;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
|
|
189
|
-
} while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
190
|
-
return destObj;
|
|
191
|
-
};
|
|
192
|
-
var endsWith = (str, searchString, position) => {
|
|
193
|
-
str = String(str);
|
|
194
|
-
if (position === void 0 || position > str.length) {
|
|
195
|
-
position = str.length;
|
|
196
|
-
}
|
|
197
|
-
position -= searchString.length;
|
|
198
|
-
const lastIndex = str.indexOf(searchString, position);
|
|
199
|
-
return lastIndex !== -1 && lastIndex === position;
|
|
200
|
-
};
|
|
201
|
-
var toArray = (thing) => {
|
|
202
|
-
if (!thing) return null;
|
|
203
|
-
if (isArray(thing)) return thing;
|
|
204
|
-
let i = thing.length;
|
|
205
|
-
if (!isNumber(i)) return null;
|
|
206
|
-
const arr = new Array(i);
|
|
207
|
-
while (i-- > 0) {
|
|
208
|
-
arr[i] = thing[i];
|
|
209
|
-
}
|
|
210
|
-
return arr;
|
|
211
|
-
};
|
|
212
|
-
var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
|
|
213
|
-
return (thing) => {
|
|
214
|
-
return TypedArray && thing instanceof TypedArray;
|
|
215
|
-
};
|
|
216
|
-
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
217
|
-
var forEachEntry = (obj, fn) => {
|
|
218
|
-
const generator = obj && obj[iterator];
|
|
219
|
-
const _iterator = generator.call(obj);
|
|
220
|
-
let result;
|
|
221
|
-
while ((result = _iterator.next()) && !result.done) {
|
|
222
|
-
const pair = result.value;
|
|
223
|
-
fn.call(obj, pair[0], pair[1]);
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
var matchAll = (regExp, str) => {
|
|
227
|
-
let matches;
|
|
228
|
-
const arr = [];
|
|
229
|
-
while ((matches = regExp.exec(str)) !== null) {
|
|
230
|
-
arr.push(matches);
|
|
231
|
-
}
|
|
232
|
-
return arr;
|
|
233
|
-
};
|
|
234
|
-
var isHTMLForm = kindOfTest("HTMLFormElement");
|
|
235
|
-
var toCamelCase = (str) => {
|
|
236
|
-
return str.toLowerCase().replace(
|
|
237
|
-
/[-_\s]([a-z\d])(\w*)/g,
|
|
238
|
-
function replacer(m, p1, p2) {
|
|
239
|
-
return p1.toUpperCase() + p2;
|
|
240
|
-
}
|
|
241
|
-
);
|
|
242
|
-
};
|
|
243
|
-
var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
244
|
-
var isRegExp = kindOfTest("RegExp");
|
|
245
|
-
var reduceDescriptors = (obj, reducer) => {
|
|
246
|
-
const descriptors2 = Object.getOwnPropertyDescriptors(obj);
|
|
247
|
-
const reducedDescriptors = {};
|
|
248
|
-
forEach(descriptors2, (descriptor, name) => {
|
|
249
|
-
let ret;
|
|
250
|
-
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
251
|
-
reducedDescriptors[name] = ret || descriptor;
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
Object.defineProperties(obj, reducedDescriptors);
|
|
255
|
-
};
|
|
256
|
-
var freezeMethods = (obj) => {
|
|
257
|
-
reduceDescriptors(obj, (descriptor, name) => {
|
|
258
|
-
if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
259
|
-
return false;
|
|
260
|
-
}
|
|
261
|
-
const value = obj[name];
|
|
262
|
-
if (!isFunction(value)) return;
|
|
263
|
-
descriptor.enumerable = false;
|
|
264
|
-
if ("writable" in descriptor) {
|
|
265
|
-
descriptor.writable = false;
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
if (!descriptor.set) {
|
|
269
|
-
descriptor.set = () => {
|
|
270
|
-
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
};
|
|
275
|
-
var toObjectSet = (arrayOrString, delimiter) => {
|
|
276
|
-
const obj = {};
|
|
277
|
-
const define = (arr) => {
|
|
278
|
-
arr.forEach((value) => {
|
|
279
|
-
obj[value] = true;
|
|
280
|
-
});
|
|
281
|
-
};
|
|
282
|
-
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
283
|
-
return obj;
|
|
284
|
-
};
|
|
285
|
-
var noop = () => {
|
|
286
|
-
};
|
|
287
|
-
var toFiniteNumber = (value, defaultValue) => {
|
|
288
|
-
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
289
|
-
};
|
|
290
|
-
function isSpecCompliantForm(thing) {
|
|
291
|
-
return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
|
|
292
|
-
}
|
|
293
|
-
var toJSONObject = (obj) => {
|
|
294
|
-
const stack = new Array(10);
|
|
295
|
-
const visit = (source, i) => {
|
|
296
|
-
if (isObject(source)) {
|
|
297
|
-
if (stack.indexOf(source) >= 0) {
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
if (isBuffer(source)) {
|
|
301
|
-
return source;
|
|
302
|
-
}
|
|
303
|
-
if (!("toJSON" in source)) {
|
|
304
|
-
stack[i] = source;
|
|
305
|
-
const target = isArray(source) ? [] : {};
|
|
306
|
-
forEach(source, (value, key) => {
|
|
307
|
-
const reducedValue = visit(value, i + 1);
|
|
308
|
-
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
309
|
-
});
|
|
310
|
-
stack[i] = void 0;
|
|
311
|
-
return target;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return source;
|
|
315
|
-
};
|
|
316
|
-
return visit(obj, 0);
|
|
317
|
-
};
|
|
318
|
-
var isAsyncFn = kindOfTest("AsyncFunction");
|
|
319
|
-
var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
320
|
-
var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
321
|
-
if (setImmediateSupported) {
|
|
322
|
-
return setImmediate;
|
|
323
|
-
}
|
|
324
|
-
return postMessageSupported ? ((token, callbacks) => {
|
|
325
|
-
_global.addEventListener("message", ({ source, data }) => {
|
|
326
|
-
if (source === _global && data === token) {
|
|
327
|
-
callbacks.length && callbacks.shift()();
|
|
328
|
-
}
|
|
329
|
-
}, false);
|
|
330
|
-
return (cb) => {
|
|
331
|
-
callbacks.push(cb);
|
|
332
|
-
_global.postMessage(token, "*");
|
|
333
|
-
};
|
|
334
|
-
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
335
|
-
})(
|
|
336
|
-
typeof setImmediate === "function",
|
|
337
|
-
isFunction(_global.postMessage)
|
|
338
|
-
);
|
|
339
|
-
var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
340
|
-
var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
341
|
-
var utils_default = {
|
|
342
|
-
isArray,
|
|
343
|
-
isArrayBuffer,
|
|
344
|
-
isBuffer,
|
|
345
|
-
isFormData,
|
|
346
|
-
isArrayBufferView,
|
|
347
|
-
isString,
|
|
348
|
-
isNumber,
|
|
349
|
-
isBoolean,
|
|
350
|
-
isObject,
|
|
351
|
-
isPlainObject,
|
|
352
|
-
isEmptyObject,
|
|
353
|
-
isReadableStream,
|
|
354
|
-
isRequest,
|
|
355
|
-
isResponse,
|
|
356
|
-
isHeaders,
|
|
357
|
-
isUndefined,
|
|
358
|
-
isDate,
|
|
359
|
-
isFile,
|
|
360
|
-
isBlob,
|
|
361
|
-
isRegExp,
|
|
362
|
-
isFunction,
|
|
363
|
-
isStream,
|
|
364
|
-
isURLSearchParams,
|
|
365
|
-
isTypedArray,
|
|
366
|
-
isFileList,
|
|
367
|
-
forEach,
|
|
368
|
-
merge,
|
|
369
|
-
extend,
|
|
370
|
-
trim,
|
|
371
|
-
stripBOM,
|
|
372
|
-
inherits,
|
|
373
|
-
toFlatObject,
|
|
374
|
-
kindOf,
|
|
375
|
-
kindOfTest,
|
|
376
|
-
endsWith,
|
|
377
|
-
toArray,
|
|
378
|
-
forEachEntry,
|
|
379
|
-
matchAll,
|
|
380
|
-
isHTMLForm,
|
|
381
|
-
hasOwnProperty,
|
|
382
|
-
hasOwnProp: hasOwnProperty,
|
|
383
|
-
// an alias to avoid ESLint no-prototype-builtins detection
|
|
384
|
-
reduceDescriptors,
|
|
385
|
-
freezeMethods,
|
|
386
|
-
toObjectSet,
|
|
387
|
-
toCamelCase,
|
|
388
|
-
noop,
|
|
389
|
-
toFiniteNumber,
|
|
390
|
-
findKey,
|
|
391
|
-
global: _global,
|
|
392
|
-
isContextDefined,
|
|
393
|
-
isSpecCompliantForm,
|
|
394
|
-
toJSONObject,
|
|
395
|
-
isAsyncFn,
|
|
396
|
-
isThenable,
|
|
397
|
-
setImmediate: _setImmediate,
|
|
398
|
-
asap,
|
|
399
|
-
isIterable
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/AxiosError.js
|
|
403
|
-
function AxiosError(message, code, config, request, response) {
|
|
404
|
-
Error.call(this);
|
|
405
|
-
if (Error.captureStackTrace) {
|
|
406
|
-
Error.captureStackTrace(this, this.constructor);
|
|
407
|
-
} else {
|
|
408
|
-
this.stack = new Error().stack;
|
|
409
|
-
}
|
|
410
|
-
this.message = message;
|
|
411
|
-
this.name = "AxiosError";
|
|
412
|
-
code && (this.code = code);
|
|
413
|
-
config && (this.config = config);
|
|
414
|
-
request && (this.request = request);
|
|
415
|
-
if (response) {
|
|
416
|
-
this.response = response;
|
|
417
|
-
this.status = response.status ? response.status : null;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
utils_default.inherits(AxiosError, Error, {
|
|
421
|
-
toJSON: function toJSON() {
|
|
422
|
-
return {
|
|
423
|
-
// Standard
|
|
424
|
-
message: this.message,
|
|
425
|
-
name: this.name,
|
|
426
|
-
// Microsoft
|
|
427
|
-
description: this.description,
|
|
428
|
-
number: this.number,
|
|
429
|
-
// Mozilla
|
|
430
|
-
fileName: this.fileName,
|
|
431
|
-
lineNumber: this.lineNumber,
|
|
432
|
-
columnNumber: this.columnNumber,
|
|
433
|
-
stack: this.stack,
|
|
434
|
-
// Axios
|
|
435
|
-
config: utils_default.toJSONObject(this.config),
|
|
436
|
-
code: this.code,
|
|
437
|
-
status: this.status
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
var prototype = AxiosError.prototype;
|
|
442
|
-
var descriptors = {};
|
|
443
|
-
[
|
|
444
|
-
"ERR_BAD_OPTION_VALUE",
|
|
445
|
-
"ERR_BAD_OPTION",
|
|
446
|
-
"ECONNABORTED",
|
|
447
|
-
"ETIMEDOUT",
|
|
448
|
-
"ERR_NETWORK",
|
|
449
|
-
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
450
|
-
"ERR_DEPRECATED",
|
|
451
|
-
"ERR_BAD_RESPONSE",
|
|
452
|
-
"ERR_BAD_REQUEST",
|
|
453
|
-
"ERR_CANCELED",
|
|
454
|
-
"ERR_NOT_SUPPORT",
|
|
455
|
-
"ERR_INVALID_URL"
|
|
456
|
-
// eslint-disable-next-line func-names
|
|
457
|
-
].forEach((code) => {
|
|
458
|
-
descriptors[code] = { value: code };
|
|
459
|
-
});
|
|
460
|
-
Object.defineProperties(AxiosError, descriptors);
|
|
461
|
-
Object.defineProperty(prototype, "isAxiosError", { value: true });
|
|
462
|
-
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
463
|
-
const axiosError = Object.create(prototype);
|
|
464
|
-
utils_default.toFlatObject(error, axiosError, function filter2(obj) {
|
|
465
|
-
return obj !== Error.prototype;
|
|
466
|
-
}, (prop) => {
|
|
467
|
-
return prop !== "isAxiosError";
|
|
468
|
-
});
|
|
469
|
-
const msg = error && error.message ? error.message : "Error";
|
|
470
|
-
const errCode = code == null && error ? error.code : code;
|
|
471
|
-
AxiosError.call(axiosError, msg, errCode, config, request, response);
|
|
472
|
-
if (error && axiosError.cause == null) {
|
|
473
|
-
Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
|
|
474
|
-
}
|
|
475
|
-
axiosError.name = error && error.name || "Error";
|
|
476
|
-
customProps && Object.assign(axiosError, customProps);
|
|
477
|
-
return axiosError;
|
|
478
|
-
};
|
|
479
|
-
var AxiosError_default = AxiosError;
|
|
480
|
-
|
|
481
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/null.js
|
|
482
|
-
var null_default = null;
|
|
483
|
-
|
|
484
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/toFormData.js
|
|
485
|
-
function isVisitable(thing) {
|
|
486
|
-
return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
|
|
487
|
-
}
|
|
488
|
-
function removeBrackets(key) {
|
|
489
|
-
return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
490
|
-
}
|
|
491
|
-
function renderKey(path, key, dots) {
|
|
492
|
-
if (!path) return key;
|
|
493
|
-
return path.concat(key).map(function each(token, i) {
|
|
494
|
-
token = removeBrackets(token);
|
|
495
|
-
return !dots && i ? "[" + token + "]" : token;
|
|
496
|
-
}).join(dots ? "." : "");
|
|
497
|
-
}
|
|
498
|
-
function isFlatArray(arr) {
|
|
499
|
-
return utils_default.isArray(arr) && !arr.some(isVisitable);
|
|
500
|
-
}
|
|
501
|
-
var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
|
|
502
|
-
return /^is[A-Z]/.test(prop);
|
|
503
|
-
});
|
|
504
|
-
function toFormData(obj, formData, options) {
|
|
505
|
-
if (!utils_default.isObject(obj)) {
|
|
506
|
-
throw new TypeError("target must be an object");
|
|
507
|
-
}
|
|
508
|
-
formData = formData || new (null_default || FormData)();
|
|
509
|
-
options = utils_default.toFlatObject(options, {
|
|
510
|
-
metaTokens: true,
|
|
511
|
-
dots: false,
|
|
512
|
-
indexes: false
|
|
513
|
-
}, false, function defined(option, source) {
|
|
514
|
-
return !utils_default.isUndefined(source[option]);
|
|
515
|
-
});
|
|
516
|
-
const metaTokens = options.metaTokens;
|
|
517
|
-
const visitor = options.visitor || defaultVisitor;
|
|
518
|
-
const dots = options.dots;
|
|
519
|
-
const indexes = options.indexes;
|
|
520
|
-
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
521
|
-
const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
|
|
522
|
-
if (!utils_default.isFunction(visitor)) {
|
|
523
|
-
throw new TypeError("visitor must be a function");
|
|
524
|
-
}
|
|
525
|
-
function convertValue(value) {
|
|
526
|
-
if (value === null) return "";
|
|
527
|
-
if (utils_default.isDate(value)) {
|
|
528
|
-
return value.toISOString();
|
|
529
|
-
}
|
|
530
|
-
if (utils_default.isBoolean(value)) {
|
|
531
|
-
return value.toString();
|
|
532
|
-
}
|
|
533
|
-
if (!useBlob && utils_default.isBlob(value)) {
|
|
534
|
-
throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
|
|
535
|
-
}
|
|
536
|
-
if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
|
|
537
|
-
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
538
|
-
}
|
|
539
|
-
return value;
|
|
540
|
-
}
|
|
541
|
-
function defaultVisitor(value, key, path) {
|
|
542
|
-
let arr = value;
|
|
543
|
-
if (value && !path && typeof value === "object") {
|
|
544
|
-
if (utils_default.endsWith(key, "{}")) {
|
|
545
|
-
key = metaTokens ? key : key.slice(0, -2);
|
|
546
|
-
value = JSON.stringify(value);
|
|
547
|
-
} else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
|
|
548
|
-
key = removeBrackets(key);
|
|
549
|
-
arr.forEach(function each(el, index) {
|
|
550
|
-
!(utils_default.isUndefined(el) || el === null) && formData.append(
|
|
551
|
-
// eslint-disable-next-line no-nested-ternary
|
|
552
|
-
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
|
|
553
|
-
convertValue(el)
|
|
554
|
-
);
|
|
555
|
-
});
|
|
556
|
-
return false;
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
if (isVisitable(value)) {
|
|
560
|
-
return true;
|
|
561
|
-
}
|
|
562
|
-
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
563
|
-
return false;
|
|
564
|
-
}
|
|
565
|
-
const stack = [];
|
|
566
|
-
const exposedHelpers = Object.assign(predicates, {
|
|
567
|
-
defaultVisitor,
|
|
568
|
-
convertValue,
|
|
569
|
-
isVisitable
|
|
570
|
-
});
|
|
571
|
-
function build(value, path) {
|
|
572
|
-
if (utils_default.isUndefined(value)) return;
|
|
573
|
-
if (stack.indexOf(value) !== -1) {
|
|
574
|
-
throw Error("Circular reference detected in " + path.join("."));
|
|
575
|
-
}
|
|
576
|
-
stack.push(value);
|
|
577
|
-
utils_default.forEach(value, function each(el, key) {
|
|
578
|
-
const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(
|
|
579
|
-
formData,
|
|
580
|
-
el,
|
|
581
|
-
utils_default.isString(key) ? key.trim() : key,
|
|
582
|
-
path,
|
|
583
|
-
exposedHelpers
|
|
584
|
-
);
|
|
585
|
-
if (result === true) {
|
|
586
|
-
build(el, path ? path.concat(key) : [key]);
|
|
587
|
-
}
|
|
588
|
-
});
|
|
589
|
-
stack.pop();
|
|
590
|
-
}
|
|
591
|
-
if (!utils_default.isObject(obj)) {
|
|
592
|
-
throw new TypeError("data must be an object");
|
|
593
|
-
}
|
|
594
|
-
build(obj);
|
|
595
|
-
return formData;
|
|
596
|
-
}
|
|
597
|
-
var toFormData_default = toFormData;
|
|
598
|
-
|
|
599
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
|
|
600
|
-
function encode(str) {
|
|
601
|
-
const charMap = {
|
|
602
|
-
"!": "%21",
|
|
603
|
-
"'": "%27",
|
|
604
|
-
"(": "%28",
|
|
605
|
-
")": "%29",
|
|
606
|
-
"~": "%7E",
|
|
607
|
-
"%20": "+",
|
|
608
|
-
"%00": "\0"
|
|
609
|
-
};
|
|
610
|
-
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
611
|
-
return charMap[match];
|
|
612
|
-
});
|
|
613
|
-
}
|
|
614
|
-
function AxiosURLSearchParams(params, options) {
|
|
615
|
-
this._pairs = [];
|
|
616
|
-
params && toFormData_default(params, this, options);
|
|
617
|
-
}
|
|
618
|
-
var prototype2 = AxiosURLSearchParams.prototype;
|
|
619
|
-
prototype2.append = function append(name, value) {
|
|
620
|
-
this._pairs.push([name, value]);
|
|
621
|
-
};
|
|
622
|
-
prototype2.toString = function toString2(encoder) {
|
|
623
|
-
const _encode = encoder ? function(value) {
|
|
624
|
-
return encoder.call(this, value, encode);
|
|
625
|
-
} : encode;
|
|
626
|
-
return this._pairs.map(function each(pair) {
|
|
627
|
-
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
628
|
-
}, "").join("&");
|
|
629
|
-
};
|
|
630
|
-
var AxiosURLSearchParams_default = AxiosURLSearchParams;
|
|
631
|
-
|
|
632
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/buildURL.js
|
|
633
|
-
function encode2(val) {
|
|
634
|
-
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
635
|
-
}
|
|
636
|
-
function buildURL(url, params, options) {
|
|
637
|
-
if (!params) {
|
|
638
|
-
return url;
|
|
639
|
-
}
|
|
640
|
-
const _encode = options && options.encode || encode2;
|
|
641
|
-
if (utils_default.isFunction(options)) {
|
|
642
|
-
options = {
|
|
643
|
-
serialize: options
|
|
644
|
-
};
|
|
645
|
-
}
|
|
646
|
-
const serializeFn = options && options.serialize;
|
|
647
|
-
let serializedParams;
|
|
648
|
-
if (serializeFn) {
|
|
649
|
-
serializedParams = serializeFn(params, options);
|
|
650
|
-
} else {
|
|
651
|
-
serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, options).toString(_encode);
|
|
652
|
-
}
|
|
653
|
-
if (serializedParams) {
|
|
654
|
-
const hashmarkIndex = url.indexOf("#");
|
|
655
|
-
if (hashmarkIndex !== -1) {
|
|
656
|
-
url = url.slice(0, hashmarkIndex);
|
|
657
|
-
}
|
|
658
|
-
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
659
|
-
}
|
|
660
|
-
return url;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/InterceptorManager.js
|
|
664
|
-
var InterceptorManager = class {
|
|
665
|
-
constructor() {
|
|
666
|
-
this.handlers = [];
|
|
667
|
-
}
|
|
668
|
-
/**
|
|
669
|
-
* Add a new interceptor to the stack
|
|
670
|
-
*
|
|
671
|
-
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
672
|
-
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
673
|
-
*
|
|
674
|
-
* @return {Number} An ID used to remove interceptor later
|
|
675
|
-
*/
|
|
676
|
-
use(fulfilled, rejected, options) {
|
|
677
|
-
this.handlers.push({
|
|
678
|
-
fulfilled,
|
|
679
|
-
rejected,
|
|
680
|
-
synchronous: options ? options.synchronous : false,
|
|
681
|
-
runWhen: options ? options.runWhen : null
|
|
682
|
-
});
|
|
683
|
-
return this.handlers.length - 1;
|
|
684
|
-
}
|
|
685
|
-
/**
|
|
686
|
-
* Remove an interceptor from the stack
|
|
687
|
-
*
|
|
688
|
-
* @param {Number} id The ID that was returned by `use`
|
|
689
|
-
*
|
|
690
|
-
* @returns {void}
|
|
691
|
-
*/
|
|
692
|
-
eject(id) {
|
|
693
|
-
if (this.handlers[id]) {
|
|
694
|
-
this.handlers[id] = null;
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
/**
|
|
698
|
-
* Clear all interceptors from the stack
|
|
699
|
-
*
|
|
700
|
-
* @returns {void}
|
|
701
|
-
*/
|
|
702
|
-
clear() {
|
|
703
|
-
if (this.handlers) {
|
|
704
|
-
this.handlers = [];
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
/**
|
|
708
|
-
* Iterate over all the registered interceptors
|
|
709
|
-
*
|
|
710
|
-
* This method is particularly useful for skipping over any
|
|
711
|
-
* interceptors that may have become `null` calling `eject`.
|
|
712
|
-
*
|
|
713
|
-
* @param {Function} fn The function to call for each interceptor
|
|
714
|
-
*
|
|
715
|
-
* @returns {void}
|
|
716
|
-
*/
|
|
717
|
-
forEach(fn) {
|
|
718
|
-
utils_default.forEach(this.handlers, function forEachHandler(h) {
|
|
719
|
-
if (h !== null) {
|
|
720
|
-
fn(h);
|
|
721
|
-
}
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
};
|
|
725
|
-
var InterceptorManager_default = InterceptorManager;
|
|
726
|
-
|
|
727
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/defaults/transitional.js
|
|
728
|
-
var transitional_default = {
|
|
729
|
-
silentJSONParsing: true,
|
|
730
|
-
forcedJSONParsing: true,
|
|
731
|
-
clarifyTimeoutError: false
|
|
732
|
-
};
|
|
733
|
-
|
|
734
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
|
|
735
|
-
var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default;
|
|
736
|
-
|
|
737
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/browser/classes/FormData.js
|
|
738
|
-
var FormData_default = typeof FormData !== "undefined" ? FormData : null;
|
|
739
|
-
|
|
740
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/browser/classes/Blob.js
|
|
741
|
-
var Blob_default = typeof Blob !== "undefined" ? Blob : null;
|
|
742
|
-
|
|
743
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/browser/index.js
|
|
744
|
-
var browser_default = {
|
|
745
|
-
isBrowser: true,
|
|
746
|
-
classes: {
|
|
747
|
-
URLSearchParams: URLSearchParams_default,
|
|
748
|
-
FormData: FormData_default,
|
|
749
|
-
Blob: Blob_default
|
|
750
|
-
},
|
|
751
|
-
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
752
|
-
};
|
|
753
|
-
|
|
754
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/common/utils.js
|
|
755
|
-
var utils_exports = {};
|
|
756
|
-
__export(utils_exports, {
|
|
757
|
-
hasBrowserEnv: () => hasBrowserEnv,
|
|
758
|
-
hasStandardBrowserEnv: () => hasStandardBrowserEnv,
|
|
759
|
-
hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
|
|
760
|
-
navigator: () => _navigator,
|
|
761
|
-
origin: () => origin
|
|
762
|
-
});
|
|
763
|
-
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
764
|
-
var _navigator = typeof navigator === "object" && navigator || void 0;
|
|
765
|
-
var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
766
|
-
var hasStandardBrowserWebWorkerEnv = (() => {
|
|
767
|
-
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
768
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
769
|
-
})();
|
|
770
|
-
var origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
771
|
-
|
|
772
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/index.js
|
|
773
|
-
var platform_default = {
|
|
774
|
-
...utils_exports,
|
|
775
|
-
...browser_default
|
|
776
|
-
};
|
|
777
|
-
|
|
778
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
779
|
-
function toURLEncodedForm(data, options) {
|
|
780
|
-
return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
|
|
781
|
-
visitor: function(value, key, path, helpers) {
|
|
782
|
-
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
783
|
-
this.append(key, value.toString("base64"));
|
|
784
|
-
return false;
|
|
785
|
-
}
|
|
786
|
-
return helpers.defaultVisitor.apply(this, arguments);
|
|
787
|
-
},
|
|
788
|
-
...options
|
|
789
|
-
});
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/formDataToJSON.js
|
|
793
|
-
function parsePropPath(name) {
|
|
794
|
-
return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
795
|
-
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
function arrayToObject(arr) {
|
|
799
|
-
const obj = {};
|
|
800
|
-
const keys = Object.keys(arr);
|
|
801
|
-
let i;
|
|
802
|
-
const len = keys.length;
|
|
803
|
-
let key;
|
|
804
|
-
for (i = 0; i < len; i++) {
|
|
805
|
-
key = keys[i];
|
|
806
|
-
obj[key] = arr[key];
|
|
807
|
-
}
|
|
808
|
-
return obj;
|
|
809
|
-
}
|
|
810
|
-
function formDataToJSON(formData) {
|
|
811
|
-
function buildPath(path, value, target, index) {
|
|
812
|
-
let name = path[index++];
|
|
813
|
-
if (name === "__proto__") return true;
|
|
814
|
-
const isNumericKey = Number.isFinite(+name);
|
|
815
|
-
const isLast = index >= path.length;
|
|
816
|
-
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
817
|
-
if (isLast) {
|
|
818
|
-
if (utils_default.hasOwnProp(target, name)) {
|
|
819
|
-
target[name] = [target[name], value];
|
|
820
|
-
} else {
|
|
821
|
-
target[name] = value;
|
|
822
|
-
}
|
|
823
|
-
return !isNumericKey;
|
|
824
|
-
}
|
|
825
|
-
if (!target[name] || !utils_default.isObject(target[name])) {
|
|
826
|
-
target[name] = [];
|
|
827
|
-
}
|
|
828
|
-
const result = buildPath(path, value, target[name], index);
|
|
829
|
-
if (result && utils_default.isArray(target[name])) {
|
|
830
|
-
target[name] = arrayToObject(target[name]);
|
|
831
|
-
}
|
|
832
|
-
return !isNumericKey;
|
|
833
|
-
}
|
|
834
|
-
if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
|
|
835
|
-
const obj = {};
|
|
836
|
-
utils_default.forEachEntry(formData, (name, value) => {
|
|
837
|
-
buildPath(parsePropPath(name), value, obj, 0);
|
|
838
|
-
});
|
|
839
|
-
return obj;
|
|
840
|
-
}
|
|
841
|
-
return null;
|
|
842
|
-
}
|
|
843
|
-
var formDataToJSON_default = formDataToJSON;
|
|
844
|
-
|
|
845
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/defaults/index.js
|
|
846
|
-
function stringifySafely(rawValue, parser, encoder) {
|
|
847
|
-
if (utils_default.isString(rawValue)) {
|
|
848
|
-
try {
|
|
849
|
-
(parser || JSON.parse)(rawValue);
|
|
850
|
-
return utils_default.trim(rawValue);
|
|
851
|
-
} catch (e) {
|
|
852
|
-
if (e.name !== "SyntaxError") {
|
|
853
|
-
throw e;
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
return (encoder || JSON.stringify)(rawValue);
|
|
858
|
-
}
|
|
859
|
-
var defaults = {
|
|
860
|
-
transitional: transitional_default,
|
|
861
|
-
adapter: ["xhr", "http", "fetch"],
|
|
862
|
-
transformRequest: [function transformRequest(data, headers) {
|
|
863
|
-
const contentType = headers.getContentType() || "";
|
|
864
|
-
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
865
|
-
const isObjectPayload = utils_default.isObject(data);
|
|
866
|
-
if (isObjectPayload && utils_default.isHTMLForm(data)) {
|
|
867
|
-
data = new FormData(data);
|
|
868
|
-
}
|
|
869
|
-
const isFormData2 = utils_default.isFormData(data);
|
|
870
|
-
if (isFormData2) {
|
|
871
|
-
return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
|
|
872
|
-
}
|
|
873
|
-
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
|
|
874
|
-
return data;
|
|
875
|
-
}
|
|
876
|
-
if (utils_default.isArrayBufferView(data)) {
|
|
877
|
-
return data.buffer;
|
|
878
|
-
}
|
|
879
|
-
if (utils_default.isURLSearchParams(data)) {
|
|
880
|
-
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
881
|
-
return data.toString();
|
|
882
|
-
}
|
|
883
|
-
let isFileList2;
|
|
884
|
-
if (isObjectPayload) {
|
|
885
|
-
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
886
|
-
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
887
|
-
}
|
|
888
|
-
if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
889
|
-
const _FormData = this.env && this.env.FormData;
|
|
890
|
-
return toFormData_default(
|
|
891
|
-
isFileList2 ? { "files[]": data } : data,
|
|
892
|
-
_FormData && new _FormData(),
|
|
893
|
-
this.formSerializer
|
|
894
|
-
);
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
if (isObjectPayload || hasJSONContentType) {
|
|
898
|
-
headers.setContentType("application/json", false);
|
|
899
|
-
return stringifySafely(data);
|
|
900
|
-
}
|
|
901
|
-
return data;
|
|
902
|
-
}],
|
|
903
|
-
transformResponse: [function transformResponse(data) {
|
|
904
|
-
const transitional2 = this.transitional || defaults.transitional;
|
|
905
|
-
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
906
|
-
const JSONRequested = this.responseType === "json";
|
|
907
|
-
if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
|
|
908
|
-
return data;
|
|
909
|
-
}
|
|
910
|
-
if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
911
|
-
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
912
|
-
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
913
|
-
try {
|
|
914
|
-
return JSON.parse(data, this.parseReviver);
|
|
915
|
-
} catch (e) {
|
|
916
|
-
if (strictJSONParsing) {
|
|
917
|
-
if (e.name === "SyntaxError") {
|
|
918
|
-
throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
|
|
919
|
-
}
|
|
920
|
-
throw e;
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
return data;
|
|
925
|
-
}],
|
|
926
|
-
/**
|
|
927
|
-
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
928
|
-
* timeout is not created.
|
|
929
|
-
*/
|
|
930
|
-
timeout: 0,
|
|
931
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
932
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
933
|
-
maxContentLength: -1,
|
|
934
|
-
maxBodyLength: -1,
|
|
935
|
-
env: {
|
|
936
|
-
FormData: platform_default.classes.FormData,
|
|
937
|
-
Blob: platform_default.classes.Blob
|
|
938
|
-
},
|
|
939
|
-
validateStatus: function validateStatus(status) {
|
|
940
|
-
return status >= 200 && status < 300;
|
|
941
|
-
},
|
|
942
|
-
headers: {
|
|
943
|
-
common: {
|
|
944
|
-
"Accept": "application/json, text/plain, */*",
|
|
945
|
-
"Content-Type": void 0
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
|
|
950
|
-
defaults.headers[method] = {};
|
|
951
|
-
});
|
|
952
|
-
var defaults_default = defaults;
|
|
953
|
-
|
|
954
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/parseHeaders.js
|
|
955
|
-
var ignoreDuplicateOf = utils_default.toObjectSet([
|
|
956
|
-
"age",
|
|
957
|
-
"authorization",
|
|
958
|
-
"content-length",
|
|
959
|
-
"content-type",
|
|
960
|
-
"etag",
|
|
961
|
-
"expires",
|
|
962
|
-
"from",
|
|
963
|
-
"host",
|
|
964
|
-
"if-modified-since",
|
|
965
|
-
"if-unmodified-since",
|
|
966
|
-
"last-modified",
|
|
967
|
-
"location",
|
|
968
|
-
"max-forwards",
|
|
969
|
-
"proxy-authorization",
|
|
970
|
-
"referer",
|
|
971
|
-
"retry-after",
|
|
972
|
-
"user-agent"
|
|
973
|
-
]);
|
|
974
|
-
var parseHeaders_default = (rawHeaders) => {
|
|
975
|
-
const parsed = {};
|
|
976
|
-
let key;
|
|
977
|
-
let val;
|
|
978
|
-
let i;
|
|
979
|
-
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
|
|
980
|
-
i = line.indexOf(":");
|
|
981
|
-
key = line.substring(0, i).trim().toLowerCase();
|
|
982
|
-
val = line.substring(i + 1).trim();
|
|
983
|
-
if (!key || parsed[key] && ignoreDuplicateOf[key]) {
|
|
984
|
-
return;
|
|
985
|
-
}
|
|
986
|
-
if (key === "set-cookie") {
|
|
987
|
-
if (parsed[key]) {
|
|
988
|
-
parsed[key].push(val);
|
|
989
|
-
} else {
|
|
990
|
-
parsed[key] = [val];
|
|
991
|
-
}
|
|
992
|
-
} else {
|
|
993
|
-
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
994
|
-
}
|
|
995
|
-
});
|
|
996
|
-
return parsed;
|
|
997
|
-
};
|
|
998
|
-
|
|
999
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/AxiosHeaders.js
|
|
1000
|
-
var $internals = Symbol("internals");
|
|
1001
|
-
function normalizeHeader(header) {
|
|
1002
|
-
return header && String(header).trim().toLowerCase();
|
|
1003
|
-
}
|
|
1004
|
-
function normalizeValue(value) {
|
|
1005
|
-
if (value === false || value == null) {
|
|
1006
|
-
return value;
|
|
1007
|
-
}
|
|
1008
|
-
return utils_default.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
1009
|
-
}
|
|
1010
|
-
function parseTokens(str) {
|
|
1011
|
-
const tokens = /* @__PURE__ */ Object.create(null);
|
|
1012
|
-
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
1013
|
-
let match;
|
|
1014
|
-
while (match = tokensRE.exec(str)) {
|
|
1015
|
-
tokens[match[1]] = match[2];
|
|
1016
|
-
}
|
|
1017
|
-
return tokens;
|
|
1018
|
-
}
|
|
1019
|
-
var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
1020
|
-
function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
|
|
1021
|
-
if (utils_default.isFunction(filter2)) {
|
|
1022
|
-
return filter2.call(this, value, header);
|
|
1023
|
-
}
|
|
1024
|
-
if (isHeaderNameFilter) {
|
|
1025
|
-
value = header;
|
|
1026
|
-
}
|
|
1027
|
-
if (!utils_default.isString(value)) return;
|
|
1028
|
-
if (utils_default.isString(filter2)) {
|
|
1029
|
-
return value.indexOf(filter2) !== -1;
|
|
1030
|
-
}
|
|
1031
|
-
if (utils_default.isRegExp(filter2)) {
|
|
1032
|
-
return filter2.test(value);
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
function formatHeader(header) {
|
|
1036
|
-
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
1037
|
-
return char.toUpperCase() + str;
|
|
1038
|
-
});
|
|
1039
|
-
}
|
|
1040
|
-
function buildAccessors(obj, header) {
|
|
1041
|
-
const accessorName = utils_default.toCamelCase(" " + header);
|
|
1042
|
-
["get", "set", "has"].forEach((methodName) => {
|
|
1043
|
-
Object.defineProperty(obj, methodName + accessorName, {
|
|
1044
|
-
value: function(arg1, arg2, arg3) {
|
|
1045
|
-
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
1046
|
-
},
|
|
1047
|
-
configurable: true
|
|
1048
|
-
});
|
|
1049
|
-
});
|
|
1050
|
-
}
|
|
1051
|
-
var AxiosHeaders = class {
|
|
1052
|
-
constructor(headers) {
|
|
1053
|
-
headers && this.set(headers);
|
|
1054
|
-
}
|
|
1055
|
-
set(header, valueOrRewrite, rewrite) {
|
|
1056
|
-
const self2 = this;
|
|
1057
|
-
function setHeader(_value, _header, _rewrite) {
|
|
1058
|
-
const lHeader = normalizeHeader(_header);
|
|
1059
|
-
if (!lHeader) {
|
|
1060
|
-
throw new Error("header name must be a non-empty string");
|
|
1061
|
-
}
|
|
1062
|
-
const key = utils_default.findKey(self2, lHeader);
|
|
1063
|
-
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
|
|
1064
|
-
self2[key || _header] = normalizeValue(_value);
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
1068
|
-
if (utils_default.isPlainObject(header) || header instanceof this.constructor) {
|
|
1069
|
-
setHeaders(header, valueOrRewrite);
|
|
1070
|
-
} else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1071
|
-
setHeaders(parseHeaders_default(header), valueOrRewrite);
|
|
1072
|
-
} else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
|
|
1073
|
-
let obj = {}, dest, key;
|
|
1074
|
-
for (const entry of header) {
|
|
1075
|
-
if (!utils_default.isArray(entry)) {
|
|
1076
|
-
throw TypeError("Object iterator must return a key-value pair");
|
|
1077
|
-
}
|
|
1078
|
-
obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
|
|
1079
|
-
}
|
|
1080
|
-
setHeaders(obj, valueOrRewrite);
|
|
1081
|
-
} else {
|
|
1082
|
-
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
1083
|
-
}
|
|
1084
|
-
return this;
|
|
1085
|
-
}
|
|
1086
|
-
get(header, parser) {
|
|
1087
|
-
header = normalizeHeader(header);
|
|
1088
|
-
if (header) {
|
|
1089
|
-
const key = utils_default.findKey(this, header);
|
|
1090
|
-
if (key) {
|
|
1091
|
-
const value = this[key];
|
|
1092
|
-
if (!parser) {
|
|
1093
|
-
return value;
|
|
1094
|
-
}
|
|
1095
|
-
if (parser === true) {
|
|
1096
|
-
return parseTokens(value);
|
|
1097
|
-
}
|
|
1098
|
-
if (utils_default.isFunction(parser)) {
|
|
1099
|
-
return parser.call(this, value, key);
|
|
1100
|
-
}
|
|
1101
|
-
if (utils_default.isRegExp(parser)) {
|
|
1102
|
-
return parser.exec(value);
|
|
1103
|
-
}
|
|
1104
|
-
throw new TypeError("parser must be boolean|regexp|function");
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
has(header, matcher) {
|
|
1109
|
-
header = normalizeHeader(header);
|
|
1110
|
-
if (header) {
|
|
1111
|
-
const key = utils_default.findKey(this, header);
|
|
1112
|
-
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
1113
|
-
}
|
|
1114
|
-
return false;
|
|
1115
|
-
}
|
|
1116
|
-
delete(header, matcher) {
|
|
1117
|
-
const self2 = this;
|
|
1118
|
-
let deleted = false;
|
|
1119
|
-
function deleteHeader(_header) {
|
|
1120
|
-
_header = normalizeHeader(_header);
|
|
1121
|
-
if (_header) {
|
|
1122
|
-
const key = utils_default.findKey(self2, _header);
|
|
1123
|
-
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
|
|
1124
|
-
delete self2[key];
|
|
1125
|
-
deleted = true;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
if (utils_default.isArray(header)) {
|
|
1130
|
-
header.forEach(deleteHeader);
|
|
1131
|
-
} else {
|
|
1132
|
-
deleteHeader(header);
|
|
1133
|
-
}
|
|
1134
|
-
return deleted;
|
|
1135
|
-
}
|
|
1136
|
-
clear(matcher) {
|
|
1137
|
-
const keys = Object.keys(this);
|
|
1138
|
-
let i = keys.length;
|
|
1139
|
-
let deleted = false;
|
|
1140
|
-
while (i--) {
|
|
1141
|
-
const key = keys[i];
|
|
1142
|
-
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
1143
|
-
delete this[key];
|
|
1144
|
-
deleted = true;
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
return deleted;
|
|
1148
|
-
}
|
|
1149
|
-
normalize(format) {
|
|
1150
|
-
const self2 = this;
|
|
1151
|
-
const headers = {};
|
|
1152
|
-
utils_default.forEach(this, (value, header) => {
|
|
1153
|
-
const key = utils_default.findKey(headers, header);
|
|
1154
|
-
if (key) {
|
|
1155
|
-
self2[key] = normalizeValue(value);
|
|
1156
|
-
delete self2[header];
|
|
1157
|
-
return;
|
|
1158
|
-
}
|
|
1159
|
-
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
1160
|
-
if (normalized !== header) {
|
|
1161
|
-
delete self2[header];
|
|
1162
|
-
}
|
|
1163
|
-
self2[normalized] = normalizeValue(value);
|
|
1164
|
-
headers[normalized] = true;
|
|
1165
|
-
});
|
|
1166
|
-
return this;
|
|
1167
|
-
}
|
|
1168
|
-
concat(...targets) {
|
|
1169
|
-
return this.constructor.concat(this, ...targets);
|
|
1170
|
-
}
|
|
1171
|
-
toJSON(asStrings) {
|
|
1172
|
-
const obj = /* @__PURE__ */ Object.create(null);
|
|
1173
|
-
utils_default.forEach(this, (value, header) => {
|
|
1174
|
-
value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
|
|
1175
|
-
});
|
|
1176
|
-
return obj;
|
|
1177
|
-
}
|
|
1178
|
-
[Symbol.iterator]() {
|
|
1179
|
-
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
1180
|
-
}
|
|
1181
|
-
toString() {
|
|
1182
|
-
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
1183
|
-
}
|
|
1184
|
-
getSetCookie() {
|
|
1185
|
-
return this.get("set-cookie") || [];
|
|
1186
|
-
}
|
|
1187
|
-
get [Symbol.toStringTag]() {
|
|
1188
|
-
return "AxiosHeaders";
|
|
1189
|
-
}
|
|
1190
|
-
static from(thing) {
|
|
1191
|
-
return thing instanceof this ? thing : new this(thing);
|
|
1192
|
-
}
|
|
1193
|
-
static concat(first, ...targets) {
|
|
1194
|
-
const computed = new this(first);
|
|
1195
|
-
targets.forEach((target) => computed.set(target));
|
|
1196
|
-
return computed;
|
|
1197
|
-
}
|
|
1198
|
-
static accessor(header) {
|
|
1199
|
-
const internals = this[$internals] = this[$internals] = {
|
|
1200
|
-
accessors: {}
|
|
1201
|
-
};
|
|
1202
|
-
const accessors = internals.accessors;
|
|
1203
|
-
const prototype3 = this.prototype;
|
|
1204
|
-
function defineAccessor(_header) {
|
|
1205
|
-
const lHeader = normalizeHeader(_header);
|
|
1206
|
-
if (!accessors[lHeader]) {
|
|
1207
|
-
buildAccessors(prototype3, _header);
|
|
1208
|
-
accessors[lHeader] = true;
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
1212
|
-
return this;
|
|
1213
|
-
}
|
|
1214
|
-
};
|
|
1215
|
-
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1216
|
-
utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
1217
|
-
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
1218
|
-
return {
|
|
1219
|
-
get: () => value,
|
|
1220
|
-
set(headerValue) {
|
|
1221
|
-
this[mapped] = headerValue;
|
|
1222
|
-
}
|
|
1223
|
-
};
|
|
1224
|
-
});
|
|
1225
|
-
utils_default.freezeMethods(AxiosHeaders);
|
|
1226
|
-
var AxiosHeaders_default = AxiosHeaders;
|
|
1227
|
-
|
|
1228
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/transformData.js
|
|
1229
|
-
function transformData(fns, response) {
|
|
1230
|
-
const config = this || defaults_default;
|
|
1231
|
-
const context = response || config;
|
|
1232
|
-
const headers = AxiosHeaders_default.from(context.headers);
|
|
1233
|
-
let data = context.data;
|
|
1234
|
-
utils_default.forEach(fns, function transform(fn) {
|
|
1235
|
-
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
1236
|
-
});
|
|
1237
|
-
headers.normalize();
|
|
1238
|
-
return data;
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/cancel/isCancel.js
|
|
1242
|
-
function isCancel(value) {
|
|
1243
|
-
return !!(value && value.__CANCEL__);
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/cancel/CanceledError.js
|
|
1247
|
-
function CanceledError(message, config, request) {
|
|
1248
|
-
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
|
|
1249
|
-
this.name = "CanceledError";
|
|
1250
|
-
}
|
|
1251
|
-
utils_default.inherits(CanceledError, AxiosError_default, {
|
|
1252
|
-
__CANCEL__: true
|
|
1253
|
-
});
|
|
1254
|
-
var CanceledError_default = CanceledError;
|
|
1255
|
-
|
|
1256
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/settle.js
|
|
1257
|
-
function settle(resolve, reject, response) {
|
|
1258
|
-
const validateStatus2 = response.config.validateStatus;
|
|
1259
|
-
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
1260
|
-
resolve(response);
|
|
1261
|
-
} else {
|
|
1262
|
-
reject(new AxiosError_default(
|
|
1263
|
-
"Request failed with status code " + response.status,
|
|
1264
|
-
[AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
1265
|
-
response.config,
|
|
1266
|
-
response.request,
|
|
1267
|
-
response
|
|
1268
|
-
));
|
|
1269
|
-
}
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/parseProtocol.js
|
|
1273
|
-
function parseProtocol(url) {
|
|
1274
|
-
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
1275
|
-
return match && match[1] || "";
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/speedometer.js
|
|
1279
|
-
function speedometer(samplesCount, min) {
|
|
1280
|
-
samplesCount = samplesCount || 10;
|
|
1281
|
-
const bytes = new Array(samplesCount);
|
|
1282
|
-
const timestamps = new Array(samplesCount);
|
|
1283
|
-
let head = 0;
|
|
1284
|
-
let tail = 0;
|
|
1285
|
-
let firstSampleTS;
|
|
1286
|
-
min = min !== void 0 ? min : 1e3;
|
|
1287
|
-
return function push(chunkLength) {
|
|
1288
|
-
const now = Date.now();
|
|
1289
|
-
const startedAt = timestamps[tail];
|
|
1290
|
-
if (!firstSampleTS) {
|
|
1291
|
-
firstSampleTS = now;
|
|
1292
|
-
}
|
|
1293
|
-
bytes[head] = chunkLength;
|
|
1294
|
-
timestamps[head] = now;
|
|
1295
|
-
let i = tail;
|
|
1296
|
-
let bytesCount = 0;
|
|
1297
|
-
while (i !== head) {
|
|
1298
|
-
bytesCount += bytes[i++];
|
|
1299
|
-
i = i % samplesCount;
|
|
1300
|
-
}
|
|
1301
|
-
head = (head + 1) % samplesCount;
|
|
1302
|
-
if (head === tail) {
|
|
1303
|
-
tail = (tail + 1) % samplesCount;
|
|
1304
|
-
}
|
|
1305
|
-
if (now - firstSampleTS < min) {
|
|
1306
|
-
return;
|
|
1307
|
-
}
|
|
1308
|
-
const passed = startedAt && now - startedAt;
|
|
1309
|
-
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
1310
|
-
};
|
|
1311
|
-
}
|
|
1312
|
-
var speedometer_default = speedometer;
|
|
1313
|
-
|
|
1314
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/throttle.js
|
|
1315
|
-
function throttle(fn, freq) {
|
|
1316
|
-
let timestamp = 0;
|
|
1317
|
-
let threshold = 1e3 / freq;
|
|
1318
|
-
let lastArgs;
|
|
1319
|
-
let timer;
|
|
1320
|
-
const invoke = (args, now = Date.now()) => {
|
|
1321
|
-
timestamp = now;
|
|
1322
|
-
lastArgs = null;
|
|
1323
|
-
if (timer) {
|
|
1324
|
-
clearTimeout(timer);
|
|
1325
|
-
timer = null;
|
|
1326
|
-
}
|
|
1327
|
-
fn(...args);
|
|
1328
|
-
};
|
|
1329
|
-
const throttled = (...args) => {
|
|
1330
|
-
const now = Date.now();
|
|
1331
|
-
const passed = now - timestamp;
|
|
1332
|
-
if (passed >= threshold) {
|
|
1333
|
-
invoke(args, now);
|
|
1334
|
-
} else {
|
|
1335
|
-
lastArgs = args;
|
|
1336
|
-
if (!timer) {
|
|
1337
|
-
timer = setTimeout(() => {
|
|
1338
|
-
timer = null;
|
|
1339
|
-
invoke(lastArgs);
|
|
1340
|
-
}, threshold - passed);
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
};
|
|
1344
|
-
const flush = () => lastArgs && invoke(lastArgs);
|
|
1345
|
-
return [throttled, flush];
|
|
1346
|
-
}
|
|
1347
|
-
var throttle_default = throttle;
|
|
1348
|
-
|
|
1349
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/progressEventReducer.js
|
|
1350
|
-
var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
1351
|
-
let bytesNotified = 0;
|
|
1352
|
-
const _speedometer = speedometer_default(50, 250);
|
|
1353
|
-
return throttle_default((e) => {
|
|
1354
|
-
const loaded = e.loaded;
|
|
1355
|
-
const total = e.lengthComputable ? e.total : void 0;
|
|
1356
|
-
const progressBytes = loaded - bytesNotified;
|
|
1357
|
-
const rate = _speedometer(progressBytes);
|
|
1358
|
-
const inRange = loaded <= total;
|
|
1359
|
-
bytesNotified = loaded;
|
|
1360
|
-
const data = {
|
|
1361
|
-
loaded,
|
|
1362
|
-
total,
|
|
1363
|
-
progress: total ? loaded / total : void 0,
|
|
1364
|
-
bytes: progressBytes,
|
|
1365
|
-
rate: rate ? rate : void 0,
|
|
1366
|
-
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
1367
|
-
event: e,
|
|
1368
|
-
lengthComputable: total != null,
|
|
1369
|
-
[isDownloadStream ? "download" : "upload"]: true
|
|
1370
|
-
};
|
|
1371
|
-
listener(data);
|
|
1372
|
-
}, freq);
|
|
1373
|
-
};
|
|
1374
|
-
var progressEventDecorator = (total, throttled) => {
|
|
1375
|
-
const lengthComputable = total != null;
|
|
1376
|
-
return [(loaded) => throttled[0]({
|
|
1377
|
-
lengthComputable,
|
|
1378
|
-
total,
|
|
1379
|
-
loaded
|
|
1380
|
-
}), throttled[1]];
|
|
1381
|
-
};
|
|
1382
|
-
var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
|
|
1383
|
-
|
|
1384
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/isURLSameOrigin.js
|
|
1385
|
-
var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
|
|
1386
|
-
url = new URL(url, platform_default.origin);
|
|
1387
|
-
return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
|
|
1388
|
-
})(
|
|
1389
|
-
new URL(platform_default.origin),
|
|
1390
|
-
platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
|
|
1391
|
-
) : () => true;
|
|
1392
|
-
|
|
1393
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/cookies.js
|
|
1394
|
-
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
1395
|
-
// Standard browser envs support document.cookie
|
|
1396
|
-
{
|
|
1397
|
-
write(name, value, expires, path, domain, secure, sameSite) {
|
|
1398
|
-
if (typeof document === "undefined") return;
|
|
1399
|
-
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
1400
|
-
if (utils_default.isNumber(expires)) {
|
|
1401
|
-
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
1402
|
-
}
|
|
1403
|
-
if (utils_default.isString(path)) {
|
|
1404
|
-
cookie.push(`path=${path}`);
|
|
1405
|
-
}
|
|
1406
|
-
if (utils_default.isString(domain)) {
|
|
1407
|
-
cookie.push(`domain=${domain}`);
|
|
1408
|
-
}
|
|
1409
|
-
if (secure === true) {
|
|
1410
|
-
cookie.push("secure");
|
|
1411
|
-
}
|
|
1412
|
-
if (utils_default.isString(sameSite)) {
|
|
1413
|
-
cookie.push(`SameSite=${sameSite}`);
|
|
1414
|
-
}
|
|
1415
|
-
document.cookie = cookie.join("; ");
|
|
1416
|
-
},
|
|
1417
|
-
read(name) {
|
|
1418
|
-
if (typeof document === "undefined") return null;
|
|
1419
|
-
const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
|
|
1420
|
-
return match ? decodeURIComponent(match[1]) : null;
|
|
1421
|
-
},
|
|
1422
|
-
remove(name) {
|
|
1423
|
-
this.write(name, "", Date.now() - 864e5, "/");
|
|
1424
|
-
}
|
|
1425
|
-
}
|
|
1426
|
-
) : (
|
|
1427
|
-
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
1428
|
-
{
|
|
1429
|
-
write() {
|
|
1430
|
-
},
|
|
1431
|
-
read() {
|
|
1432
|
-
return null;
|
|
1433
|
-
},
|
|
1434
|
-
remove() {
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
);
|
|
1438
|
-
|
|
1439
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
1440
|
-
function isAbsoluteURL(url) {
|
|
1441
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/combineURLs.js
|
|
1445
|
-
function combineURLs(baseURL, relativeURL) {
|
|
1446
|
-
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/buildFullPath.js
|
|
1450
|
-
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
1451
|
-
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
1452
|
-
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
1453
|
-
return combineURLs(baseURL, requestedURL);
|
|
1454
|
-
}
|
|
1455
|
-
return requestedURL;
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/mergeConfig.js
|
|
1459
|
-
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
|
|
1460
|
-
function mergeConfig(config1, config2) {
|
|
1461
|
-
config2 = config2 || {};
|
|
1462
|
-
const config = {};
|
|
1463
|
-
function getMergedValue(target, source, prop, caseless) {
|
|
1464
|
-
if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
|
|
1465
|
-
return utils_default.merge.call({ caseless }, target, source);
|
|
1466
|
-
} else if (utils_default.isPlainObject(source)) {
|
|
1467
|
-
return utils_default.merge({}, source);
|
|
1468
|
-
} else if (utils_default.isArray(source)) {
|
|
1469
|
-
return source.slice();
|
|
1470
|
-
}
|
|
1471
|
-
return source;
|
|
1472
|
-
}
|
|
1473
|
-
function mergeDeepProperties(a, b, prop, caseless) {
|
|
1474
|
-
if (!utils_default.isUndefined(b)) {
|
|
1475
|
-
return getMergedValue(a, b, prop, caseless);
|
|
1476
|
-
} else if (!utils_default.isUndefined(a)) {
|
|
1477
|
-
return getMergedValue(void 0, a, prop, caseless);
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
function valueFromConfig2(a, b) {
|
|
1481
|
-
if (!utils_default.isUndefined(b)) {
|
|
1482
|
-
return getMergedValue(void 0, b);
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
function defaultToConfig2(a, b) {
|
|
1486
|
-
if (!utils_default.isUndefined(b)) {
|
|
1487
|
-
return getMergedValue(void 0, b);
|
|
1488
|
-
} else if (!utils_default.isUndefined(a)) {
|
|
1489
|
-
return getMergedValue(void 0, a);
|
|
1490
|
-
}
|
|
1491
|
-
}
|
|
1492
|
-
function mergeDirectKeys(a, b, prop) {
|
|
1493
|
-
if (prop in config2) {
|
|
1494
|
-
return getMergedValue(a, b);
|
|
1495
|
-
} else if (prop in config1) {
|
|
1496
|
-
return getMergedValue(void 0, a);
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
const mergeMap = {
|
|
1500
|
-
url: valueFromConfig2,
|
|
1501
|
-
method: valueFromConfig2,
|
|
1502
|
-
data: valueFromConfig2,
|
|
1503
|
-
baseURL: defaultToConfig2,
|
|
1504
|
-
transformRequest: defaultToConfig2,
|
|
1505
|
-
transformResponse: defaultToConfig2,
|
|
1506
|
-
paramsSerializer: defaultToConfig2,
|
|
1507
|
-
timeout: defaultToConfig2,
|
|
1508
|
-
timeoutMessage: defaultToConfig2,
|
|
1509
|
-
withCredentials: defaultToConfig2,
|
|
1510
|
-
withXSRFToken: defaultToConfig2,
|
|
1511
|
-
adapter: defaultToConfig2,
|
|
1512
|
-
responseType: defaultToConfig2,
|
|
1513
|
-
xsrfCookieName: defaultToConfig2,
|
|
1514
|
-
xsrfHeaderName: defaultToConfig2,
|
|
1515
|
-
onUploadProgress: defaultToConfig2,
|
|
1516
|
-
onDownloadProgress: defaultToConfig2,
|
|
1517
|
-
decompress: defaultToConfig2,
|
|
1518
|
-
maxContentLength: defaultToConfig2,
|
|
1519
|
-
maxBodyLength: defaultToConfig2,
|
|
1520
|
-
beforeRedirect: defaultToConfig2,
|
|
1521
|
-
transport: defaultToConfig2,
|
|
1522
|
-
httpAgent: defaultToConfig2,
|
|
1523
|
-
httpsAgent: defaultToConfig2,
|
|
1524
|
-
cancelToken: defaultToConfig2,
|
|
1525
|
-
socketPath: defaultToConfig2,
|
|
1526
|
-
responseEncoding: defaultToConfig2,
|
|
1527
|
-
validateStatus: mergeDirectKeys,
|
|
1528
|
-
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
1529
|
-
};
|
|
1530
|
-
utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
1531
|
-
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
1532
|
-
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
1533
|
-
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
1534
|
-
});
|
|
1535
|
-
return config;
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/resolveConfig.js
|
|
1539
|
-
var resolveConfig_default = (config) => {
|
|
1540
|
-
const newConfig = mergeConfig({}, config);
|
|
1541
|
-
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
1542
|
-
newConfig.headers = headers = AxiosHeaders_default.from(headers);
|
|
1543
|
-
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
1544
|
-
if (auth) {
|
|
1545
|
-
headers.set(
|
|
1546
|
-
"Authorization",
|
|
1547
|
-
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
|
|
1548
|
-
);
|
|
1549
|
-
}
|
|
1550
|
-
if (utils_default.isFormData(data)) {
|
|
1551
|
-
if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
|
|
1552
|
-
headers.setContentType(void 0);
|
|
1553
|
-
} else if (utils_default.isFunction(data.getHeaders)) {
|
|
1554
|
-
const formHeaders = data.getHeaders();
|
|
1555
|
-
const allowedHeaders = ["content-type", "content-length"];
|
|
1556
|
-
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
1557
|
-
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
1558
|
-
headers.set(key, val);
|
|
1559
|
-
}
|
|
1560
|
-
});
|
|
1561
|
-
}
|
|
1562
|
-
}
|
|
1563
|
-
if (platform_default.hasStandardBrowserEnv) {
|
|
1564
|
-
withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
1565
|
-
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
|
|
1566
|
-
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
|
|
1567
|
-
if (xsrfValue) {
|
|
1568
|
-
headers.set(xsrfHeaderName, xsrfValue);
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
}
|
|
1572
|
-
return newConfig;
|
|
1573
|
-
};
|
|
1574
|
-
|
|
1575
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/adapters/xhr.js
|
|
1576
|
-
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
1577
|
-
var xhr_default = isXHRAdapterSupported && function(config) {
|
|
1578
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
1579
|
-
const _config = resolveConfig_default(config);
|
|
1580
|
-
let requestData = _config.data;
|
|
1581
|
-
const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
|
|
1582
|
-
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
1583
|
-
let onCanceled;
|
|
1584
|
-
let uploadThrottled, downloadThrottled;
|
|
1585
|
-
let flushUpload, flushDownload;
|
|
1586
|
-
function done() {
|
|
1587
|
-
flushUpload && flushUpload();
|
|
1588
|
-
flushDownload && flushDownload();
|
|
1589
|
-
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
1590
|
-
_config.signal && _config.signal.removeEventListener("abort", onCanceled);
|
|
1591
|
-
}
|
|
1592
|
-
let request = new XMLHttpRequest();
|
|
1593
|
-
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
1594
|
-
request.timeout = _config.timeout;
|
|
1595
|
-
function onloadend() {
|
|
1596
|
-
if (!request) {
|
|
1597
|
-
return;
|
|
1598
|
-
}
|
|
1599
|
-
const responseHeaders = AxiosHeaders_default.from(
|
|
1600
|
-
"getAllResponseHeaders" in request && request.getAllResponseHeaders()
|
|
1601
|
-
);
|
|
1602
|
-
const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
|
|
1603
|
-
const response = {
|
|
1604
|
-
data: responseData,
|
|
1605
|
-
status: request.status,
|
|
1606
|
-
statusText: request.statusText,
|
|
1607
|
-
headers: responseHeaders,
|
|
1608
|
-
config,
|
|
1609
|
-
request
|
|
1610
|
-
};
|
|
1611
|
-
settle(function _resolve(value) {
|
|
1612
|
-
resolve(value);
|
|
1613
|
-
done();
|
|
1614
|
-
}, function _reject(err) {
|
|
1615
|
-
reject(err);
|
|
1616
|
-
done();
|
|
1617
|
-
}, response);
|
|
1618
|
-
request = null;
|
|
1619
|
-
}
|
|
1620
|
-
if ("onloadend" in request) {
|
|
1621
|
-
request.onloadend = onloadend;
|
|
1622
|
-
} else {
|
|
1623
|
-
request.onreadystatechange = function handleLoad() {
|
|
1624
|
-
if (!request || request.readyState !== 4) {
|
|
1625
|
-
return;
|
|
1626
|
-
}
|
|
1627
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
|
|
1628
|
-
return;
|
|
1629
|
-
}
|
|
1630
|
-
setTimeout(onloadend);
|
|
1631
|
-
};
|
|
1632
|
-
}
|
|
1633
|
-
request.onabort = function handleAbort() {
|
|
1634
|
-
if (!request) {
|
|
1635
|
-
return;
|
|
1636
|
-
}
|
|
1637
|
-
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
|
|
1638
|
-
request = null;
|
|
1639
|
-
};
|
|
1640
|
-
request.onerror = function handleError(event) {
|
|
1641
|
-
const msg = event && event.message ? event.message : "Network Error";
|
|
1642
|
-
const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
|
|
1643
|
-
err.event = event || null;
|
|
1644
|
-
reject(err);
|
|
1645
|
-
request = null;
|
|
1646
|
-
};
|
|
1647
|
-
request.ontimeout = function handleTimeout() {
|
|
1648
|
-
let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
|
|
1649
|
-
const transitional2 = _config.transitional || transitional_default;
|
|
1650
|
-
if (_config.timeoutErrorMessage) {
|
|
1651
|
-
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
1652
|
-
}
|
|
1653
|
-
reject(new AxiosError_default(
|
|
1654
|
-
timeoutErrorMessage,
|
|
1655
|
-
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
1656
|
-
config,
|
|
1657
|
-
request
|
|
1658
|
-
));
|
|
1659
|
-
request = null;
|
|
1660
|
-
};
|
|
1661
|
-
requestData === void 0 && requestHeaders.setContentType(null);
|
|
1662
|
-
if ("setRequestHeader" in request) {
|
|
1663
|
-
utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
1664
|
-
request.setRequestHeader(key, val);
|
|
1665
|
-
});
|
|
1666
|
-
}
|
|
1667
|
-
if (!utils_default.isUndefined(_config.withCredentials)) {
|
|
1668
|
-
request.withCredentials = !!_config.withCredentials;
|
|
1669
|
-
}
|
|
1670
|
-
if (responseType && responseType !== "json") {
|
|
1671
|
-
request.responseType = _config.responseType;
|
|
1672
|
-
}
|
|
1673
|
-
if (onDownloadProgress) {
|
|
1674
|
-
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
1675
|
-
request.addEventListener("progress", downloadThrottled);
|
|
1676
|
-
}
|
|
1677
|
-
if (onUploadProgress && request.upload) {
|
|
1678
|
-
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
1679
|
-
request.upload.addEventListener("progress", uploadThrottled);
|
|
1680
|
-
request.upload.addEventListener("loadend", flushUpload);
|
|
1681
|
-
}
|
|
1682
|
-
if (_config.cancelToken || _config.signal) {
|
|
1683
|
-
onCanceled = (cancel) => {
|
|
1684
|
-
if (!request) {
|
|
1685
|
-
return;
|
|
1686
|
-
}
|
|
1687
|
-
reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
|
|
1688
|
-
request.abort();
|
|
1689
|
-
request = null;
|
|
1690
|
-
};
|
|
1691
|
-
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
1692
|
-
if (_config.signal) {
|
|
1693
|
-
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
1694
|
-
}
|
|
1695
|
-
}
|
|
1696
|
-
const protocol = parseProtocol(_config.url);
|
|
1697
|
-
if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
|
|
1698
|
-
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
|
|
1699
|
-
return;
|
|
1700
|
-
}
|
|
1701
|
-
request.send(requestData || null);
|
|
1702
|
-
});
|
|
1703
|
-
};
|
|
1704
|
-
|
|
1705
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/composeSignals.js
|
|
1706
|
-
var composeSignals = (signals, timeout) => {
|
|
1707
|
-
const { length } = signals = signals ? signals.filter(Boolean) : [];
|
|
1708
|
-
if (timeout || length) {
|
|
1709
|
-
let controller = new AbortController();
|
|
1710
|
-
let aborted;
|
|
1711
|
-
const onabort = function(reason) {
|
|
1712
|
-
if (!aborted) {
|
|
1713
|
-
aborted = true;
|
|
1714
|
-
unsubscribe();
|
|
1715
|
-
const err = reason instanceof Error ? reason : this.reason;
|
|
1716
|
-
controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
|
|
1717
|
-
}
|
|
1718
|
-
};
|
|
1719
|
-
let timer = timeout && setTimeout(() => {
|
|
1720
|
-
timer = null;
|
|
1721
|
-
onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT));
|
|
1722
|
-
}, timeout);
|
|
1723
|
-
const unsubscribe = () => {
|
|
1724
|
-
if (signals) {
|
|
1725
|
-
timer && clearTimeout(timer);
|
|
1726
|
-
timer = null;
|
|
1727
|
-
signals.forEach((signal2) => {
|
|
1728
|
-
signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
|
|
1729
|
-
});
|
|
1730
|
-
signals = null;
|
|
1731
|
-
}
|
|
1732
|
-
};
|
|
1733
|
-
signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
|
|
1734
|
-
const { signal } = controller;
|
|
1735
|
-
signal.unsubscribe = () => utils_default.asap(unsubscribe);
|
|
1736
|
-
return signal;
|
|
1737
|
-
}
|
|
1738
|
-
};
|
|
1739
|
-
var composeSignals_default = composeSignals;
|
|
1740
|
-
|
|
1741
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/trackStream.js
|
|
1742
|
-
var streamChunk = function* (chunk, chunkSize) {
|
|
1743
|
-
let len = chunk.byteLength;
|
|
1744
|
-
if (!chunkSize || len < chunkSize) {
|
|
1745
|
-
yield chunk;
|
|
1746
|
-
return;
|
|
1747
|
-
}
|
|
1748
|
-
let pos = 0;
|
|
1749
|
-
let end;
|
|
1750
|
-
while (pos < len) {
|
|
1751
|
-
end = pos + chunkSize;
|
|
1752
|
-
yield chunk.slice(pos, end);
|
|
1753
|
-
pos = end;
|
|
1754
|
-
}
|
|
1755
|
-
};
|
|
1756
|
-
var readBytes = async function* (iterable, chunkSize) {
|
|
1757
|
-
for await (const chunk of readStream(iterable)) {
|
|
1758
|
-
yield* streamChunk(chunk, chunkSize);
|
|
1759
|
-
}
|
|
1760
|
-
};
|
|
1761
|
-
var readStream = async function* (stream) {
|
|
1762
|
-
if (stream[Symbol.asyncIterator]) {
|
|
1763
|
-
yield* stream;
|
|
1764
|
-
return;
|
|
1765
|
-
}
|
|
1766
|
-
const reader = stream.getReader();
|
|
1767
|
-
try {
|
|
1768
|
-
for (; ; ) {
|
|
1769
|
-
const { done, value } = await reader.read();
|
|
1770
|
-
if (done) {
|
|
1771
|
-
break;
|
|
1772
|
-
}
|
|
1773
|
-
yield value;
|
|
1774
|
-
}
|
|
1775
|
-
} finally {
|
|
1776
|
-
await reader.cancel();
|
|
1777
|
-
}
|
|
1778
|
-
};
|
|
1779
|
-
var trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
1780
|
-
const iterator2 = readBytes(stream, chunkSize);
|
|
1781
|
-
let bytes = 0;
|
|
1782
|
-
let done;
|
|
1783
|
-
let _onFinish = (e) => {
|
|
1784
|
-
if (!done) {
|
|
1785
|
-
done = true;
|
|
1786
|
-
onFinish && onFinish(e);
|
|
1787
|
-
}
|
|
1788
|
-
};
|
|
1789
|
-
return new ReadableStream({
|
|
1790
|
-
async pull(controller) {
|
|
1791
|
-
try {
|
|
1792
|
-
const { done: done2, value } = await iterator2.next();
|
|
1793
|
-
if (done2) {
|
|
1794
|
-
_onFinish();
|
|
1795
|
-
controller.close();
|
|
1796
|
-
return;
|
|
1797
|
-
}
|
|
1798
|
-
let len = value.byteLength;
|
|
1799
|
-
if (onProgress) {
|
|
1800
|
-
let loadedBytes = bytes += len;
|
|
1801
|
-
onProgress(loadedBytes);
|
|
1802
|
-
}
|
|
1803
|
-
controller.enqueue(new Uint8Array(value));
|
|
1804
|
-
} catch (err) {
|
|
1805
|
-
_onFinish(err);
|
|
1806
|
-
throw err;
|
|
1807
|
-
}
|
|
1808
|
-
},
|
|
1809
|
-
cancel(reason) {
|
|
1810
|
-
_onFinish(reason);
|
|
1811
|
-
return iterator2.return();
|
|
1812
|
-
}
|
|
1813
|
-
}, {
|
|
1814
|
-
highWaterMark: 2
|
|
1815
|
-
});
|
|
1816
|
-
};
|
|
1817
|
-
|
|
1818
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/adapters/fetch.js
|
|
1819
|
-
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
1820
|
-
var { isFunction: isFunction2 } = utils_default;
|
|
1821
|
-
var globalFetchAPI = (({ Request, Response }) => ({
|
|
1822
|
-
Request,
|
|
1823
|
-
Response
|
|
1824
|
-
}))(utils_default.global);
|
|
1825
|
-
var {
|
|
1826
|
-
ReadableStream: ReadableStream2,
|
|
1827
|
-
TextEncoder
|
|
1828
|
-
} = utils_default.global;
|
|
1829
|
-
var test = (fn, ...args) => {
|
|
1830
|
-
try {
|
|
1831
|
-
return !!fn(...args);
|
|
1832
|
-
} catch (e) {
|
|
1833
|
-
return false;
|
|
1834
|
-
}
|
|
1835
|
-
};
|
|
1836
|
-
var factory = (env) => {
|
|
1837
|
-
env = utils_default.merge.call({
|
|
1838
|
-
skipUndefined: true
|
|
1839
|
-
}, globalFetchAPI, env);
|
|
1840
|
-
const { fetch: envFetch, Request, Response } = env;
|
|
1841
|
-
const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
|
|
1842
|
-
const isRequestSupported = isFunction2(Request);
|
|
1843
|
-
const isResponseSupported = isFunction2(Response);
|
|
1844
|
-
if (!isFetchSupported) {
|
|
1845
|
-
return false;
|
|
1846
|
-
}
|
|
1847
|
-
const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
|
|
1848
|
-
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
1849
|
-
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
1850
|
-
let duplexAccessed = false;
|
|
1851
|
-
const hasContentType = new Request(platform_default.origin, {
|
|
1852
|
-
body: new ReadableStream2(),
|
|
1853
|
-
method: "POST",
|
|
1854
|
-
get duplex() {
|
|
1855
|
-
duplexAccessed = true;
|
|
1856
|
-
return "half";
|
|
1857
|
-
}
|
|
1858
|
-
}).headers.has("Content-Type");
|
|
1859
|
-
return duplexAccessed && !hasContentType;
|
|
1860
|
-
});
|
|
1861
|
-
const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
|
|
1862
|
-
const resolvers = {
|
|
1863
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
1864
|
-
};
|
|
1865
|
-
isFetchSupported && (() => {
|
|
1866
|
-
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
1867
|
-
!resolvers[type] && (resolvers[type] = (res, config) => {
|
|
1868
|
-
let method = res && res[type];
|
|
1869
|
-
if (method) {
|
|
1870
|
-
return method.call(res);
|
|
1871
|
-
}
|
|
1872
|
-
throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
|
|
1873
|
-
});
|
|
1874
|
-
});
|
|
1875
|
-
})();
|
|
1876
|
-
const getBodyLength = async (body) => {
|
|
1877
|
-
if (body == null) {
|
|
1878
|
-
return 0;
|
|
1879
|
-
}
|
|
1880
|
-
if (utils_default.isBlob(body)) {
|
|
1881
|
-
return body.size;
|
|
1882
|
-
}
|
|
1883
|
-
if (utils_default.isSpecCompliantForm(body)) {
|
|
1884
|
-
const _request = new Request(platform_default.origin, {
|
|
1885
|
-
method: "POST",
|
|
1886
|
-
body
|
|
1887
|
-
});
|
|
1888
|
-
return (await _request.arrayBuffer()).byteLength;
|
|
1889
|
-
}
|
|
1890
|
-
if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
|
|
1891
|
-
return body.byteLength;
|
|
1892
|
-
}
|
|
1893
|
-
if (utils_default.isURLSearchParams(body)) {
|
|
1894
|
-
body = body + "";
|
|
1895
|
-
}
|
|
1896
|
-
if (utils_default.isString(body)) {
|
|
1897
|
-
return (await encodeText(body)).byteLength;
|
|
1898
|
-
}
|
|
1899
|
-
};
|
|
1900
|
-
const resolveBodyLength = async (headers, body) => {
|
|
1901
|
-
const length = utils_default.toFiniteNumber(headers.getContentLength());
|
|
1902
|
-
return length == null ? getBodyLength(body) : length;
|
|
1903
|
-
};
|
|
1904
|
-
return async (config) => {
|
|
1905
|
-
let {
|
|
1906
|
-
url,
|
|
1907
|
-
method,
|
|
1908
|
-
data,
|
|
1909
|
-
signal,
|
|
1910
|
-
cancelToken,
|
|
1911
|
-
timeout,
|
|
1912
|
-
onDownloadProgress,
|
|
1913
|
-
onUploadProgress,
|
|
1914
|
-
responseType,
|
|
1915
|
-
headers,
|
|
1916
|
-
withCredentials = "same-origin",
|
|
1917
|
-
fetchOptions
|
|
1918
|
-
} = resolveConfig_default(config);
|
|
1919
|
-
let _fetch = envFetch || fetch;
|
|
1920
|
-
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
1921
|
-
let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
1922
|
-
let request = null;
|
|
1923
|
-
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
1924
|
-
composedSignal.unsubscribe();
|
|
1925
|
-
});
|
|
1926
|
-
let requestContentLength;
|
|
1927
|
-
try {
|
|
1928
|
-
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
1929
|
-
let _request = new Request(url, {
|
|
1930
|
-
method: "POST",
|
|
1931
|
-
body: data,
|
|
1932
|
-
duplex: "half"
|
|
1933
|
-
});
|
|
1934
|
-
let contentTypeHeader;
|
|
1935
|
-
if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
1936
|
-
headers.setContentType(contentTypeHeader);
|
|
1937
|
-
}
|
|
1938
|
-
if (_request.body) {
|
|
1939
|
-
const [onProgress, flush] = progressEventDecorator(
|
|
1940
|
-
requestContentLength,
|
|
1941
|
-
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
1942
|
-
);
|
|
1943
|
-
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
if (!utils_default.isString(withCredentials)) {
|
|
1947
|
-
withCredentials = withCredentials ? "include" : "omit";
|
|
1948
|
-
}
|
|
1949
|
-
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
1950
|
-
const resolvedOptions = {
|
|
1951
|
-
...fetchOptions,
|
|
1952
|
-
signal: composedSignal,
|
|
1953
|
-
method: method.toUpperCase(),
|
|
1954
|
-
headers: headers.normalize().toJSON(),
|
|
1955
|
-
body: data,
|
|
1956
|
-
duplex: "half",
|
|
1957
|
-
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
1958
|
-
};
|
|
1959
|
-
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
1960
|
-
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
1961
|
-
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
1962
|
-
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
1963
|
-
const options = {};
|
|
1964
|
-
["status", "statusText", "headers"].forEach((prop) => {
|
|
1965
|
-
options[prop] = response[prop];
|
|
1966
|
-
});
|
|
1967
|
-
const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
|
|
1968
|
-
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
1969
|
-
responseContentLength,
|
|
1970
|
-
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
1971
|
-
) || [];
|
|
1972
|
-
response = new Response(
|
|
1973
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
1974
|
-
flush && flush();
|
|
1975
|
-
unsubscribe && unsubscribe();
|
|
1976
|
-
}),
|
|
1977
|
-
options
|
|
1978
|
-
);
|
|
1979
|
-
}
|
|
1980
|
-
responseType = responseType || "text";
|
|
1981
|
-
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
|
|
1982
|
-
!isStreamResponse && unsubscribe && unsubscribe();
|
|
1983
|
-
return await new Promise((resolve, reject) => {
|
|
1984
|
-
settle(resolve, reject, {
|
|
1985
|
-
data: responseData,
|
|
1986
|
-
headers: AxiosHeaders_default.from(response.headers),
|
|
1987
|
-
status: response.status,
|
|
1988
|
-
statusText: response.statusText,
|
|
1989
|
-
config,
|
|
1990
|
-
request
|
|
1991
|
-
});
|
|
1992
|
-
});
|
|
1993
|
-
} catch (err) {
|
|
1994
|
-
unsubscribe && unsubscribe();
|
|
1995
|
-
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
1996
|
-
throw Object.assign(
|
|
1997
|
-
new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
|
|
1998
|
-
{
|
|
1999
|
-
cause: err.cause || err
|
|
2000
|
-
}
|
|
2001
|
-
);
|
|
2002
|
-
}
|
|
2003
|
-
throw AxiosError_default.from(err, err && err.code, config, request);
|
|
2004
|
-
}
|
|
2005
|
-
};
|
|
2006
|
-
};
|
|
2007
|
-
var seedCache = /* @__PURE__ */ new Map();
|
|
2008
|
-
var getFetch = (config) => {
|
|
2009
|
-
let env = config && config.env || {};
|
|
2010
|
-
const { fetch: fetch2, Request, Response } = env;
|
|
2011
|
-
const seeds = [
|
|
2012
|
-
Request,
|
|
2013
|
-
Response,
|
|
2014
|
-
fetch2
|
|
2015
|
-
];
|
|
2016
|
-
let len = seeds.length, i = len, seed, target, map = seedCache;
|
|
2017
|
-
while (i--) {
|
|
2018
|
-
seed = seeds[i];
|
|
2019
|
-
target = map.get(seed);
|
|
2020
|
-
target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
|
|
2021
|
-
map = target;
|
|
2022
|
-
}
|
|
2023
|
-
return target;
|
|
2024
|
-
};
|
|
2025
|
-
var adapter = getFetch();
|
|
2026
|
-
|
|
2027
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/adapters/adapters.js
|
|
2028
|
-
var knownAdapters = {
|
|
2029
|
-
http: null_default,
|
|
2030
|
-
xhr: xhr_default,
|
|
2031
|
-
fetch: {
|
|
2032
|
-
get: getFetch
|
|
2033
|
-
}
|
|
2034
|
-
};
|
|
2035
|
-
utils_default.forEach(knownAdapters, (fn, value) => {
|
|
2036
|
-
if (fn) {
|
|
2037
|
-
try {
|
|
2038
|
-
Object.defineProperty(fn, "name", { value });
|
|
2039
|
-
} catch (e) {
|
|
2040
|
-
}
|
|
2041
|
-
Object.defineProperty(fn, "adapterName", { value });
|
|
2042
|
-
}
|
|
2043
|
-
});
|
|
2044
|
-
var renderReason = (reason) => `- ${reason}`;
|
|
2045
|
-
var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
|
|
2046
|
-
function getAdapter(adapters, config) {
|
|
2047
|
-
adapters = utils_default.isArray(adapters) ? adapters : [adapters];
|
|
2048
|
-
const { length } = adapters;
|
|
2049
|
-
let nameOrAdapter;
|
|
2050
|
-
let adapter2;
|
|
2051
|
-
const rejectedReasons = {};
|
|
2052
|
-
for (let i = 0; i < length; i++) {
|
|
2053
|
-
nameOrAdapter = adapters[i];
|
|
2054
|
-
let id;
|
|
2055
|
-
adapter2 = nameOrAdapter;
|
|
2056
|
-
if (!isResolvedHandle(nameOrAdapter)) {
|
|
2057
|
-
adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
2058
|
-
if (adapter2 === void 0) {
|
|
2059
|
-
throw new AxiosError_default(`Unknown adapter '${id}'`);
|
|
2060
|
-
}
|
|
2061
|
-
}
|
|
2062
|
-
if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
|
|
2063
|
-
break;
|
|
2064
|
-
}
|
|
2065
|
-
rejectedReasons[id || "#" + i] = adapter2;
|
|
2066
|
-
}
|
|
2067
|
-
if (!adapter2) {
|
|
2068
|
-
const reasons = Object.entries(rejectedReasons).map(
|
|
2069
|
-
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
2070
|
-
);
|
|
2071
|
-
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
2072
|
-
throw new AxiosError_default(
|
|
2073
|
-
`There is no suitable adapter to dispatch the request ` + s,
|
|
2074
|
-
"ERR_NOT_SUPPORT"
|
|
2075
|
-
);
|
|
2076
|
-
}
|
|
2077
|
-
return adapter2;
|
|
2078
|
-
}
|
|
2079
|
-
var adapters_default = {
|
|
2080
|
-
/**
|
|
2081
|
-
* Resolve an adapter from a list of adapter names or functions.
|
|
2082
|
-
* @type {Function}
|
|
2083
|
-
*/
|
|
2084
|
-
getAdapter,
|
|
2085
|
-
/**
|
|
2086
|
-
* Exposes all known adapters
|
|
2087
|
-
* @type {Object<string, Function|Object>}
|
|
2088
|
-
*/
|
|
2089
|
-
adapters: knownAdapters
|
|
2090
|
-
};
|
|
2091
|
-
|
|
2092
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/dispatchRequest.js
|
|
2093
|
-
function throwIfCancellationRequested(config) {
|
|
2094
|
-
if (config.cancelToken) {
|
|
2095
|
-
config.cancelToken.throwIfRequested();
|
|
2096
|
-
}
|
|
2097
|
-
if (config.signal && config.signal.aborted) {
|
|
2098
|
-
throw new CanceledError_default(null, config);
|
|
2099
|
-
}
|
|
2100
|
-
}
|
|
2101
|
-
function dispatchRequest(config) {
|
|
2102
|
-
throwIfCancellationRequested(config);
|
|
2103
|
-
config.headers = AxiosHeaders_default.from(config.headers);
|
|
2104
|
-
config.data = transformData.call(
|
|
2105
|
-
config,
|
|
2106
|
-
config.transformRequest
|
|
2107
|
-
);
|
|
2108
|
-
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
2109
|
-
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
2110
|
-
}
|
|
2111
|
-
const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
|
|
2112
|
-
return adapter2(config).then(function onAdapterResolution(response) {
|
|
2113
|
-
throwIfCancellationRequested(config);
|
|
2114
|
-
response.data = transformData.call(
|
|
2115
|
-
config,
|
|
2116
|
-
config.transformResponse,
|
|
2117
|
-
response
|
|
2118
|
-
);
|
|
2119
|
-
response.headers = AxiosHeaders_default.from(response.headers);
|
|
2120
|
-
return response;
|
|
2121
|
-
}, function onAdapterRejection(reason) {
|
|
2122
|
-
if (!isCancel(reason)) {
|
|
2123
|
-
throwIfCancellationRequested(config);
|
|
2124
|
-
if (reason && reason.response) {
|
|
2125
|
-
reason.response.data = transformData.call(
|
|
2126
|
-
config,
|
|
2127
|
-
config.transformResponse,
|
|
2128
|
-
reason.response
|
|
2129
|
-
);
|
|
2130
|
-
reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
return Promise.reject(reason);
|
|
2134
|
-
});
|
|
2135
|
-
}
|
|
2136
|
-
|
|
2137
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/env/data.js
|
|
2138
|
-
var VERSION = "1.13.2";
|
|
2139
|
-
|
|
2140
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/validator.js
|
|
2141
|
-
var validators = {};
|
|
2142
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
2143
|
-
validators[type] = function validator(thing) {
|
|
2144
|
-
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
2145
|
-
};
|
|
2146
|
-
});
|
|
2147
|
-
var deprecatedWarnings = {};
|
|
2148
|
-
validators.transitional = function transitional(validator, version, message) {
|
|
2149
|
-
function formatMessage(opt, desc) {
|
|
2150
|
-
return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
2151
|
-
}
|
|
2152
|
-
return (value, opt, opts) => {
|
|
2153
|
-
if (validator === false) {
|
|
2154
|
-
throw new AxiosError_default(
|
|
2155
|
-
formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
|
|
2156
|
-
AxiosError_default.ERR_DEPRECATED
|
|
2157
|
-
);
|
|
2158
|
-
}
|
|
2159
|
-
if (version && !deprecatedWarnings[opt]) {
|
|
2160
|
-
deprecatedWarnings[opt] = true;
|
|
2161
|
-
console.warn(
|
|
2162
|
-
formatMessage(
|
|
2163
|
-
opt,
|
|
2164
|
-
" has been deprecated since v" + version + " and will be removed in the near future"
|
|
2165
|
-
)
|
|
2166
|
-
);
|
|
2167
|
-
}
|
|
2168
|
-
return validator ? validator(value, opt, opts) : true;
|
|
2169
|
-
};
|
|
2170
|
-
};
|
|
2171
|
-
validators.spelling = function spelling(correctSpelling) {
|
|
2172
|
-
return (value, opt) => {
|
|
2173
|
-
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
2174
|
-
return true;
|
|
2175
|
-
};
|
|
2176
|
-
};
|
|
2177
|
-
function assertOptions(options, schema, allowUnknown) {
|
|
2178
|
-
if (typeof options !== "object") {
|
|
2179
|
-
throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
|
|
2180
|
-
}
|
|
2181
|
-
const keys = Object.keys(options);
|
|
2182
|
-
let i = keys.length;
|
|
2183
|
-
while (i-- > 0) {
|
|
2184
|
-
const opt = keys[i];
|
|
2185
|
-
const validator = schema[opt];
|
|
2186
|
-
if (validator) {
|
|
2187
|
-
const value = options[opt];
|
|
2188
|
-
const result = value === void 0 || validator(value, opt, options);
|
|
2189
|
-
if (result !== true) {
|
|
2190
|
-
throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE);
|
|
2191
|
-
}
|
|
2192
|
-
continue;
|
|
2193
|
-
}
|
|
2194
|
-
if (allowUnknown !== true) {
|
|
2195
|
-
throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
|
|
2196
|
-
}
|
|
2197
|
-
}
|
|
2198
|
-
}
|
|
2199
|
-
var validator_default = {
|
|
2200
|
-
assertOptions,
|
|
2201
|
-
validators
|
|
2202
|
-
};
|
|
2203
|
-
|
|
2204
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/Axios.js
|
|
2205
|
-
var validators2 = validator_default.validators;
|
|
2206
|
-
var Axios = class {
|
|
2207
|
-
constructor(instanceConfig) {
|
|
2208
|
-
this.defaults = instanceConfig || {};
|
|
2209
|
-
this.interceptors = {
|
|
2210
|
-
request: new InterceptorManager_default(),
|
|
2211
|
-
response: new InterceptorManager_default()
|
|
2212
|
-
};
|
|
2213
|
-
}
|
|
2214
|
-
/**
|
|
2215
|
-
* Dispatch a request
|
|
2216
|
-
*
|
|
2217
|
-
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
2218
|
-
* @param {?Object} config
|
|
2219
|
-
*
|
|
2220
|
-
* @returns {Promise} The Promise to be fulfilled
|
|
2221
|
-
*/
|
|
2222
|
-
async request(configOrUrl, config) {
|
|
2223
|
-
try {
|
|
2224
|
-
return await this._request(configOrUrl, config);
|
|
2225
|
-
} catch (err) {
|
|
2226
|
-
if (err instanceof Error) {
|
|
2227
|
-
let dummy = {};
|
|
2228
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
2229
|
-
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
2230
|
-
try {
|
|
2231
|
-
if (!err.stack) {
|
|
2232
|
-
err.stack = stack;
|
|
2233
|
-
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
2234
|
-
err.stack += "\n" + stack;
|
|
2235
|
-
}
|
|
2236
|
-
} catch (e) {
|
|
2237
|
-
}
|
|
2238
|
-
}
|
|
2239
|
-
throw err;
|
|
2240
|
-
}
|
|
2241
|
-
}
|
|
2242
|
-
_request(configOrUrl, config) {
|
|
2243
|
-
if (typeof configOrUrl === "string") {
|
|
2244
|
-
config = config || {};
|
|
2245
|
-
config.url = configOrUrl;
|
|
2246
|
-
} else {
|
|
2247
|
-
config = configOrUrl || {};
|
|
2248
|
-
}
|
|
2249
|
-
config = mergeConfig(this.defaults, config);
|
|
2250
|
-
const { transitional: transitional2, paramsSerializer, headers } = config;
|
|
2251
|
-
if (transitional2 !== void 0) {
|
|
2252
|
-
validator_default.assertOptions(transitional2, {
|
|
2253
|
-
silentJSONParsing: validators2.transitional(validators2.boolean),
|
|
2254
|
-
forcedJSONParsing: validators2.transitional(validators2.boolean),
|
|
2255
|
-
clarifyTimeoutError: validators2.transitional(validators2.boolean)
|
|
2256
|
-
}, false);
|
|
2257
|
-
}
|
|
2258
|
-
if (paramsSerializer != null) {
|
|
2259
|
-
if (utils_default.isFunction(paramsSerializer)) {
|
|
2260
|
-
config.paramsSerializer = {
|
|
2261
|
-
serialize: paramsSerializer
|
|
2262
|
-
};
|
|
2263
|
-
} else {
|
|
2264
|
-
validator_default.assertOptions(paramsSerializer, {
|
|
2265
|
-
encode: validators2.function,
|
|
2266
|
-
serialize: validators2.function
|
|
2267
|
-
}, true);
|
|
2268
|
-
}
|
|
2269
|
-
}
|
|
2270
|
-
if (config.allowAbsoluteUrls !== void 0) {
|
|
2271
|
-
} else if (this.defaults.allowAbsoluteUrls !== void 0) {
|
|
2272
|
-
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
2273
|
-
} else {
|
|
2274
|
-
config.allowAbsoluteUrls = true;
|
|
2275
|
-
}
|
|
2276
|
-
validator_default.assertOptions(config, {
|
|
2277
|
-
baseUrl: validators2.spelling("baseURL"),
|
|
2278
|
-
withXsrfToken: validators2.spelling("withXSRFToken")
|
|
2279
|
-
}, true);
|
|
2280
|
-
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
2281
|
-
let contextHeaders = headers && utils_default.merge(
|
|
2282
|
-
headers.common,
|
|
2283
|
-
headers[config.method]
|
|
2284
|
-
);
|
|
2285
|
-
headers && utils_default.forEach(
|
|
2286
|
-
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
2287
|
-
(method) => {
|
|
2288
|
-
delete headers[method];
|
|
2289
|
-
}
|
|
2290
|
-
);
|
|
2291
|
-
config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
|
|
2292
|
-
const requestInterceptorChain = [];
|
|
2293
|
-
let synchronousRequestInterceptors = true;
|
|
2294
|
-
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
2295
|
-
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
2296
|
-
return;
|
|
2297
|
-
}
|
|
2298
|
-
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
2299
|
-
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
2300
|
-
});
|
|
2301
|
-
const responseInterceptorChain = [];
|
|
2302
|
-
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
2303
|
-
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
2304
|
-
});
|
|
2305
|
-
let promise;
|
|
2306
|
-
let i = 0;
|
|
2307
|
-
let len;
|
|
2308
|
-
if (!synchronousRequestInterceptors) {
|
|
2309
|
-
const chain = [dispatchRequest.bind(this), void 0];
|
|
2310
|
-
chain.unshift(...requestInterceptorChain);
|
|
2311
|
-
chain.push(...responseInterceptorChain);
|
|
2312
|
-
len = chain.length;
|
|
2313
|
-
promise = Promise.resolve(config);
|
|
2314
|
-
while (i < len) {
|
|
2315
|
-
promise = promise.then(chain[i++], chain[i++]);
|
|
2316
|
-
}
|
|
2317
|
-
return promise;
|
|
2318
|
-
}
|
|
2319
|
-
len = requestInterceptorChain.length;
|
|
2320
|
-
let newConfig = config;
|
|
2321
|
-
while (i < len) {
|
|
2322
|
-
const onFulfilled = requestInterceptorChain[i++];
|
|
2323
|
-
const onRejected = requestInterceptorChain[i++];
|
|
2324
|
-
try {
|
|
2325
|
-
newConfig = onFulfilled(newConfig);
|
|
2326
|
-
} catch (error) {
|
|
2327
|
-
onRejected.call(this, error);
|
|
2328
|
-
break;
|
|
2329
|
-
}
|
|
2330
|
-
}
|
|
2331
|
-
try {
|
|
2332
|
-
promise = dispatchRequest.call(this, newConfig);
|
|
2333
|
-
} catch (error) {
|
|
2334
|
-
return Promise.reject(error);
|
|
2335
|
-
}
|
|
2336
|
-
i = 0;
|
|
2337
|
-
len = responseInterceptorChain.length;
|
|
2338
|
-
while (i < len) {
|
|
2339
|
-
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
|
2340
|
-
}
|
|
2341
|
-
return promise;
|
|
2342
|
-
}
|
|
2343
|
-
getUri(config) {
|
|
2344
|
-
config = mergeConfig(this.defaults, config);
|
|
2345
|
-
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
2346
|
-
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
2347
|
-
}
|
|
2348
|
-
};
|
|
2349
|
-
utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
2350
|
-
Axios.prototype[method] = function(url, config) {
|
|
2351
|
-
return this.request(mergeConfig(config || {}, {
|
|
2352
|
-
method,
|
|
2353
|
-
url,
|
|
2354
|
-
data: (config || {}).data
|
|
2355
|
-
}));
|
|
2356
|
-
};
|
|
2357
|
-
});
|
|
2358
|
-
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
2359
|
-
function generateHTTPMethod(isForm) {
|
|
2360
|
-
return function httpMethod(url, data, config) {
|
|
2361
|
-
return this.request(mergeConfig(config || {}, {
|
|
2362
|
-
method,
|
|
2363
|
-
headers: isForm ? {
|
|
2364
|
-
"Content-Type": "multipart/form-data"
|
|
2365
|
-
} : {},
|
|
2366
|
-
url,
|
|
2367
|
-
data
|
|
2368
|
-
}));
|
|
2369
|
-
};
|
|
2370
|
-
}
|
|
2371
|
-
Axios.prototype[method] = generateHTTPMethod();
|
|
2372
|
-
Axios.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
2373
|
-
});
|
|
2374
|
-
var Axios_default = Axios;
|
|
2375
|
-
|
|
2376
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/cancel/CancelToken.js
|
|
2377
|
-
var CancelToken = class _CancelToken {
|
|
2378
|
-
constructor(executor) {
|
|
2379
|
-
if (typeof executor !== "function") {
|
|
2380
|
-
throw new TypeError("executor must be a function.");
|
|
2381
|
-
}
|
|
2382
|
-
let resolvePromise;
|
|
2383
|
-
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
2384
|
-
resolvePromise = resolve;
|
|
2385
|
-
});
|
|
2386
|
-
const token = this;
|
|
2387
|
-
this.promise.then((cancel) => {
|
|
2388
|
-
if (!token._listeners) return;
|
|
2389
|
-
let i = token._listeners.length;
|
|
2390
|
-
while (i-- > 0) {
|
|
2391
|
-
token._listeners[i](cancel);
|
|
2392
|
-
}
|
|
2393
|
-
token._listeners = null;
|
|
2394
|
-
});
|
|
2395
|
-
this.promise.then = (onfulfilled) => {
|
|
2396
|
-
let _resolve;
|
|
2397
|
-
const promise = new Promise((resolve) => {
|
|
2398
|
-
token.subscribe(resolve);
|
|
2399
|
-
_resolve = resolve;
|
|
2400
|
-
}).then(onfulfilled);
|
|
2401
|
-
promise.cancel = function reject() {
|
|
2402
|
-
token.unsubscribe(_resolve);
|
|
2403
|
-
};
|
|
2404
|
-
return promise;
|
|
2405
|
-
};
|
|
2406
|
-
executor(function cancel(message, config, request) {
|
|
2407
|
-
if (token.reason) {
|
|
2408
|
-
return;
|
|
2409
|
-
}
|
|
2410
|
-
token.reason = new CanceledError_default(message, config, request);
|
|
2411
|
-
resolvePromise(token.reason);
|
|
2412
|
-
});
|
|
2413
|
-
}
|
|
2414
|
-
/**
|
|
2415
|
-
* Throws a `CanceledError` if cancellation has been requested.
|
|
2416
|
-
*/
|
|
2417
|
-
throwIfRequested() {
|
|
2418
|
-
if (this.reason) {
|
|
2419
|
-
throw this.reason;
|
|
2420
|
-
}
|
|
2421
|
-
}
|
|
2422
|
-
/**
|
|
2423
|
-
* Subscribe to the cancel signal
|
|
2424
|
-
*/
|
|
2425
|
-
subscribe(listener) {
|
|
2426
|
-
if (this.reason) {
|
|
2427
|
-
listener(this.reason);
|
|
2428
|
-
return;
|
|
2429
|
-
}
|
|
2430
|
-
if (this._listeners) {
|
|
2431
|
-
this._listeners.push(listener);
|
|
2432
|
-
} else {
|
|
2433
|
-
this._listeners = [listener];
|
|
2434
|
-
}
|
|
2435
|
-
}
|
|
2436
|
-
/**
|
|
2437
|
-
* Unsubscribe from the cancel signal
|
|
2438
|
-
*/
|
|
2439
|
-
unsubscribe(listener) {
|
|
2440
|
-
if (!this._listeners) {
|
|
2441
|
-
return;
|
|
2442
|
-
}
|
|
2443
|
-
const index = this._listeners.indexOf(listener);
|
|
2444
|
-
if (index !== -1) {
|
|
2445
|
-
this._listeners.splice(index, 1);
|
|
2446
|
-
}
|
|
2447
|
-
}
|
|
2448
|
-
toAbortSignal() {
|
|
2449
|
-
const controller = new AbortController();
|
|
2450
|
-
const abort = (err) => {
|
|
2451
|
-
controller.abort(err);
|
|
2452
|
-
};
|
|
2453
|
-
this.subscribe(abort);
|
|
2454
|
-
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
2455
|
-
return controller.signal;
|
|
2456
|
-
}
|
|
2457
|
-
/**
|
|
2458
|
-
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
2459
|
-
* cancels the `CancelToken`.
|
|
2460
|
-
*/
|
|
2461
|
-
static source() {
|
|
2462
|
-
let cancel;
|
|
2463
|
-
const token = new _CancelToken(function executor(c) {
|
|
2464
|
-
cancel = c;
|
|
2465
|
-
});
|
|
2466
|
-
return {
|
|
2467
|
-
token,
|
|
2468
|
-
cancel
|
|
2469
|
-
};
|
|
2470
|
-
}
|
|
2471
|
-
};
|
|
2472
|
-
var CancelToken_default = CancelToken;
|
|
2473
|
-
|
|
2474
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/spread.js
|
|
2475
|
-
function spread(callback) {
|
|
2476
|
-
return function wrap(arr) {
|
|
2477
|
-
return callback.apply(null, arr);
|
|
2478
|
-
};
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/isAxiosError.js
|
|
2482
|
-
function isAxiosError(payload) {
|
|
2483
|
-
return utils_default.isObject(payload) && payload.isAxiosError === true;
|
|
2484
|
-
}
|
|
2485
|
-
|
|
2486
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/HttpStatusCode.js
|
|
2487
|
-
var HttpStatusCode = {
|
|
2488
|
-
Continue: 100,
|
|
2489
|
-
SwitchingProtocols: 101,
|
|
2490
|
-
Processing: 102,
|
|
2491
|
-
EarlyHints: 103,
|
|
2492
|
-
Ok: 200,
|
|
2493
|
-
Created: 201,
|
|
2494
|
-
Accepted: 202,
|
|
2495
|
-
NonAuthoritativeInformation: 203,
|
|
2496
|
-
NoContent: 204,
|
|
2497
|
-
ResetContent: 205,
|
|
2498
|
-
PartialContent: 206,
|
|
2499
|
-
MultiStatus: 207,
|
|
2500
|
-
AlreadyReported: 208,
|
|
2501
|
-
ImUsed: 226,
|
|
2502
|
-
MultipleChoices: 300,
|
|
2503
|
-
MovedPermanently: 301,
|
|
2504
|
-
Found: 302,
|
|
2505
|
-
SeeOther: 303,
|
|
2506
|
-
NotModified: 304,
|
|
2507
|
-
UseProxy: 305,
|
|
2508
|
-
Unused: 306,
|
|
2509
|
-
TemporaryRedirect: 307,
|
|
2510
|
-
PermanentRedirect: 308,
|
|
2511
|
-
BadRequest: 400,
|
|
2512
|
-
Unauthorized: 401,
|
|
2513
|
-
PaymentRequired: 402,
|
|
2514
|
-
Forbidden: 403,
|
|
2515
|
-
NotFound: 404,
|
|
2516
|
-
MethodNotAllowed: 405,
|
|
2517
|
-
NotAcceptable: 406,
|
|
2518
|
-
ProxyAuthenticationRequired: 407,
|
|
2519
|
-
RequestTimeout: 408,
|
|
2520
|
-
Conflict: 409,
|
|
2521
|
-
Gone: 410,
|
|
2522
|
-
LengthRequired: 411,
|
|
2523
|
-
PreconditionFailed: 412,
|
|
2524
|
-
PayloadTooLarge: 413,
|
|
2525
|
-
UriTooLong: 414,
|
|
2526
|
-
UnsupportedMediaType: 415,
|
|
2527
|
-
RangeNotSatisfiable: 416,
|
|
2528
|
-
ExpectationFailed: 417,
|
|
2529
|
-
ImATeapot: 418,
|
|
2530
|
-
MisdirectedRequest: 421,
|
|
2531
|
-
UnprocessableEntity: 422,
|
|
2532
|
-
Locked: 423,
|
|
2533
|
-
FailedDependency: 424,
|
|
2534
|
-
TooEarly: 425,
|
|
2535
|
-
UpgradeRequired: 426,
|
|
2536
|
-
PreconditionRequired: 428,
|
|
2537
|
-
TooManyRequests: 429,
|
|
2538
|
-
RequestHeaderFieldsTooLarge: 431,
|
|
2539
|
-
UnavailableForLegalReasons: 451,
|
|
2540
|
-
InternalServerError: 500,
|
|
2541
|
-
NotImplemented: 501,
|
|
2542
|
-
BadGateway: 502,
|
|
2543
|
-
ServiceUnavailable: 503,
|
|
2544
|
-
GatewayTimeout: 504,
|
|
2545
|
-
HttpVersionNotSupported: 505,
|
|
2546
|
-
VariantAlsoNegotiates: 506,
|
|
2547
|
-
InsufficientStorage: 507,
|
|
2548
|
-
LoopDetected: 508,
|
|
2549
|
-
NotExtended: 510,
|
|
2550
|
-
NetworkAuthenticationRequired: 511,
|
|
2551
|
-
WebServerIsDown: 521,
|
|
2552
|
-
ConnectionTimedOut: 522,
|
|
2553
|
-
OriginIsUnreachable: 523,
|
|
2554
|
-
TimeoutOccurred: 524,
|
|
2555
|
-
SslHandshakeFailed: 525,
|
|
2556
|
-
InvalidSslCertificate: 526
|
|
2557
|
-
};
|
|
2558
|
-
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
2559
|
-
HttpStatusCode[value] = key;
|
|
2560
|
-
});
|
|
2561
|
-
var HttpStatusCode_default = HttpStatusCode;
|
|
2562
|
-
|
|
2563
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/axios.js
|
|
2564
|
-
function createInstance(defaultConfig) {
|
|
2565
|
-
const context = new Axios_default(defaultConfig);
|
|
2566
|
-
const instance = bind(Axios_default.prototype.request, context);
|
|
2567
|
-
utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
|
|
2568
|
-
utils_default.extend(instance, context, null, { allOwnKeys: true });
|
|
2569
|
-
instance.create = function create(instanceConfig) {
|
|
2570
|
-
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
2571
|
-
};
|
|
2572
|
-
return instance;
|
|
2573
|
-
}
|
|
2574
|
-
var axios = createInstance(defaults_default);
|
|
2575
|
-
axios.Axios = Axios_default;
|
|
2576
|
-
axios.CanceledError = CanceledError_default;
|
|
2577
|
-
axios.CancelToken = CancelToken_default;
|
|
2578
|
-
axios.isCancel = isCancel;
|
|
2579
|
-
axios.VERSION = VERSION;
|
|
2580
|
-
axios.toFormData = toFormData_default;
|
|
2581
|
-
axios.AxiosError = AxiosError_default;
|
|
2582
|
-
axios.Cancel = axios.CanceledError;
|
|
2583
|
-
axios.all = function all(promises) {
|
|
2584
|
-
return Promise.all(promises);
|
|
2585
|
-
};
|
|
2586
|
-
axios.spread = spread;
|
|
2587
|
-
axios.isAxiosError = isAxiosError;
|
|
2588
|
-
axios.mergeConfig = mergeConfig;
|
|
2589
|
-
axios.AxiosHeaders = AxiosHeaders_default;
|
|
2590
|
-
axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
2591
|
-
axios.getAdapter = adapters_default.getAdapter;
|
|
2592
|
-
axios.HttpStatusCode = HttpStatusCode_default;
|
|
2593
|
-
axios.default = axios;
|
|
2594
|
-
var axios_default = axios;
|
|
2595
|
-
|
|
2596
|
-
// ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/index.js
|
|
2597
|
-
var {
|
|
2598
|
-
Axios: Axios2,
|
|
2599
|
-
AxiosError: AxiosError2,
|
|
2600
|
-
CanceledError: CanceledError2,
|
|
2601
|
-
isCancel: isCancel2,
|
|
2602
|
-
CancelToken: CancelToken2,
|
|
2603
|
-
VERSION: VERSION2,
|
|
2604
|
-
all: all2,
|
|
2605
|
-
Cancel,
|
|
2606
|
-
isAxiosError: isAxiosError2,
|
|
2607
|
-
spread: spread2,
|
|
2608
|
-
toFormData: toFormData2,
|
|
2609
|
-
AxiosHeaders: AxiosHeaders2,
|
|
2610
|
-
HttpStatusCode: HttpStatusCode2,
|
|
2611
|
-
formToJSON,
|
|
2612
|
-
getAdapter: getAdapter2,
|
|
2613
|
-
mergeConfig: mergeConfig2
|
|
2614
|
-
} = axios_default;
|
|
2615
|
-
|
|
2616
|
-
// shared/utils/config.ts
|
|
2617
|
-
var devMode = localStorage.getItem("api-mode");
|
|
2618
|
-
var API_LOCAL_DEV_URL = "http://127.0.0.1:8787";
|
|
2619
|
-
var API_REMOTE_DEV_URL = "https://assembled-brands-dev.crystal-e8a.workers.dev";
|
|
2620
|
-
var API_PROD_URL = "https://assembled-brands-prod.crystal-e8a.workers.dev";
|
|
2621
|
-
var appConfig = {
|
|
2622
|
-
apiBaseUrl: devMode === "local" ? API_LOCAL_DEV_URL : devMode === "remote-dev" ? API_REMOTE_DEV_URL : API_PROD_URL,
|
|
2623
|
-
apiVersion: "/api/v1",
|
|
2624
|
-
accessTokenPersistStrategy: "cookie",
|
|
2625
|
-
TOKEN_NAME_IN_STORAGE: "accessToken",
|
|
2626
|
-
TOKEN_TYPE: "Bearer",
|
|
2627
|
-
REQUEST_HEADER_AUTH_KEY: "Authorization"
|
|
2628
|
-
};
|
|
2629
|
-
var navigateToPath = (path, skipDevMode = false) => {
|
|
2630
|
-
let newPath = "";
|
|
2631
|
-
if (devMode === "local" && !skipDevMode) {
|
|
2632
|
-
newPath = `/dev${path}`;
|
|
2633
|
-
} else if (devMode === "remote-dev" && !skipDevMode) {
|
|
2634
|
-
newPath = `/dev${path}`;
|
|
2635
|
-
} else {
|
|
2636
|
-
newPath = `/${path}`;
|
|
2637
|
-
}
|
|
2638
|
-
window.location.assign(newPath);
|
|
2639
|
-
};
|
|
2640
|
-
|
|
2641
|
-
// shared/utils/auth.ts
|
|
2642
|
-
var setCookie = (name, value, days) => {
|
|
2643
|
-
const date = /* @__PURE__ */ new Date();
|
|
2644
|
-
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1e3);
|
|
2645
|
-
const expires = "expires=" + date.toUTCString();
|
|
2646
|
-
document.cookie = `${name}=${encodeURIComponent(value)}; ${expires}; path=/`;
|
|
2647
|
-
};
|
|
2648
|
-
var getCookie = (name) => {
|
|
2649
|
-
const cookies = document.cookie.split("; ");
|
|
2650
|
-
for (const c of cookies) {
|
|
2651
|
-
const [key, val] = c.split("=");
|
|
2652
|
-
if (key === name) return decodeURIComponent(val);
|
|
2653
|
-
}
|
|
2654
|
-
return null;
|
|
2655
|
-
};
|
|
2656
|
-
var deleteCookie = (name) => {
|
|
2657
|
-
setCookie(name, "", -1);
|
|
2658
|
-
};
|
|
2659
|
-
var processMiddleware = () => {
|
|
2660
|
-
const cookie = getCookie("accessToken");
|
|
2661
|
-
if (!cookie) {
|
|
2662
|
-
navigateToPath("/login?error=unauthorized", false);
|
|
2663
|
-
}
|
|
2664
|
-
return cookie;
|
|
2665
|
-
};
|
|
2666
|
-
var logoutUser = () => {
|
|
2667
|
-
deleteCookie("accessToken");
|
|
2668
|
-
navigateToPath("/login?error=logged-out", false);
|
|
2669
|
-
};
|
|
2670
|
-
|
|
2671
|
-
// shared/services/axios/AxiosRequestIntrceptorConfigCallback.ts
|
|
2672
|
-
var AxiosRequestIntrceptorConfigCallback = (config) => {
|
|
2673
|
-
const storage = appConfig.accessTokenPersistStrategy;
|
|
2674
|
-
if (storage === "localStorage" || storage === "sessionStorage" || storage === "cookie") {
|
|
2675
|
-
let accessToken = "";
|
|
2676
|
-
if (storage === "localStorage") {
|
|
2677
|
-
accessToken = localStorage.getItem(appConfig.TOKEN_NAME_IN_STORAGE) || "";
|
|
2678
|
-
}
|
|
2679
|
-
if (storage === "sessionStorage") {
|
|
2680
|
-
accessToken = sessionStorage.getItem(appConfig.TOKEN_NAME_IN_STORAGE) || "";
|
|
2681
|
-
}
|
|
2682
|
-
if (storage === "cookie") {
|
|
2683
|
-
accessToken = getCookie(appConfig.TOKEN_NAME_IN_STORAGE) || "";
|
|
2684
|
-
}
|
|
2685
|
-
if (accessToken) {
|
|
2686
|
-
config.headers[appConfig.REQUEST_HEADER_AUTH_KEY] = `${appConfig.TOKEN_TYPE} ${accessToken}`;
|
|
2687
|
-
}
|
|
2688
|
-
}
|
|
2689
|
-
const teamId = localStorage.getItem("team_id");
|
|
2690
|
-
if (teamId) {
|
|
2691
|
-
config.headers["X-Team-Id"] = teamId;
|
|
2692
|
-
}
|
|
2693
|
-
return config;
|
|
2694
|
-
};
|
|
2695
|
-
var AxiosRequestIntrceptorConfigCallback_default = AxiosRequestIntrceptorConfigCallback;
|
|
2696
|
-
|
|
2697
|
-
// shared/services/axios/AxiosResponseIntrceptorErrorCallback.ts
|
|
2698
|
-
var UNAUTHORIZED_CODES = [401, 419, 440];
|
|
2699
|
-
var AxiosResponseIntrceptorErrorCallback = (error) => {
|
|
2700
|
-
const { response } = error;
|
|
2701
|
-
if (window.location.pathname.includes("/login")) {
|
|
2702
|
-
return Promise.reject(error);
|
|
2703
|
-
}
|
|
2704
|
-
if (response && UNAUTHORIZED_CODES.includes(response.status)) {
|
|
2705
|
-
deleteCookie("accessToken");
|
|
2706
|
-
navigateToPath("/login?error=unauthorized", false);
|
|
2707
|
-
}
|
|
2708
|
-
};
|
|
2709
|
-
var AxiosResponseIntrceptorErrorCallback_default = AxiosResponseIntrceptorErrorCallback;
|
|
2710
|
-
|
|
2711
|
-
// shared/services/axios/AxiosBase.ts
|
|
2712
|
-
var AxiosBase = axios_default.create({
|
|
2713
|
-
timeout: 6e4,
|
|
2714
|
-
baseURL: appConfig.apiBaseUrl + appConfig.apiVersion
|
|
2715
|
-
});
|
|
2716
|
-
AxiosBase.interceptors.request.use(
|
|
2717
|
-
(config) => {
|
|
2718
|
-
return AxiosRequestIntrceptorConfigCallback_default(config);
|
|
2719
|
-
},
|
|
2720
|
-
(error) => {
|
|
2721
|
-
return Promise.reject(error);
|
|
2722
|
-
}
|
|
2723
|
-
);
|
|
2724
|
-
AxiosBase.interceptors.response.use(
|
|
2725
|
-
(response) => response,
|
|
2726
|
-
(error) => {
|
|
2727
|
-
AxiosResponseIntrceptorErrorCallback_default(error);
|
|
2728
|
-
return Promise.reject(error);
|
|
2729
|
-
}
|
|
2730
|
-
);
|
|
2731
|
-
var AxiosBase_default = AxiosBase;
|
|
2732
|
-
|
|
2733
|
-
// shared/services/ApiService.ts
|
|
2734
|
-
var ApiService = {
|
|
2735
|
-
fetchDataWithAxios(param) {
|
|
2736
|
-
return new Promise((resolve, reject) => {
|
|
2737
|
-
AxiosBase_default(param).then((response) => {
|
|
2738
|
-
resolve(response.data);
|
|
2739
|
-
}).catch((error) => {
|
|
2740
|
-
let message = "An unknown error occurred";
|
|
2741
|
-
if (error.response && error.response.data) {
|
|
2742
|
-
const data = error.response.data;
|
|
2743
|
-
if (typeof data.message === "string") {
|
|
2744
|
-
message = data.message;
|
|
2745
|
-
} else if (typeof data.error === "string") {
|
|
2746
|
-
message = data.error;
|
|
2747
|
-
} else {
|
|
2748
|
-
message = JSON.stringify(data);
|
|
2749
|
-
}
|
|
2750
|
-
} else if (error.message) {
|
|
2751
|
-
message = error.message;
|
|
2752
|
-
}
|
|
2753
|
-
reject({ ...error, message });
|
|
2754
|
-
});
|
|
2755
|
-
});
|
|
2756
|
-
}
|
|
2757
|
-
};
|
|
2758
|
-
var ApiService_default = ApiService;
|
|
2759
|
-
|
|
2760
|
-
// shared/services/AssetService.ts
|
|
2761
|
-
var apiCreateAssetPresignedUrl = (data) => {
|
|
2762
|
-
return ApiService_default.fetchDataWithAxios({
|
|
2763
|
-
url: "/asset",
|
|
2764
|
-
method: "post",
|
|
2765
|
-
data
|
|
2766
|
-
});
|
|
2767
|
-
};
|
|
2768
|
-
|
|
2769
|
-
// shared/services/FinancialWizardService.ts
|
|
2770
|
-
var apiUploadFinancialDocument = (data) => {
|
|
2771
|
-
return ApiService_default.fetchDataWithAxios({
|
|
2772
|
-
url: "/financial-wizard/document",
|
|
2773
|
-
method: "post",
|
|
2774
|
-
data
|
|
2775
|
-
});
|
|
2776
|
-
};
|
|
2777
|
-
var apiGetFinancialProgress = () => {
|
|
2778
|
-
return ApiService_default.fetchDataWithAxios({
|
|
2779
|
-
url: "/financial-wizard/progress",
|
|
2780
|
-
method: "get"
|
|
2781
|
-
});
|
|
2782
|
-
};
|
|
2783
|
-
|
|
2784
|
-
// shared/utils/selectors.ts
|
|
2785
|
-
var queryElement = (selector, scope = document) => {
|
|
2786
|
-
return scope.querySelector(selector);
|
|
2787
|
-
};
|
|
2788
|
-
|
|
2789
|
-
// shared/utils/helpers.ts
|
|
2790
|
-
var progressFinancialWizardPercentage = async () => {
|
|
2791
|
-
try {
|
|
2792
|
-
const response = await apiGetFinancialProgress();
|
|
2793
|
-
const percentage = response?.percentage || 0;
|
|
2794
|
-
const progressFill = queryElement('[dev-target="progress-percentage-fill"]');
|
|
2795
|
-
const progressLabel = queryElement('[dev-target="progress-percentage-label"]');
|
|
2796
|
-
const logout = queryElement('[dev-target="logout"]');
|
|
2797
|
-
if (!progressFill || !progressLabel || !logout) {
|
|
2798
|
-
console.error(
|
|
2799
|
-
'Ensure [dev-target="progress-percentage-fill"], [dev-target="progress-percentage-label"], and [dev-target="logout"] are present.'
|
|
2800
|
-
);
|
|
2801
|
-
return;
|
|
2802
|
-
}
|
|
2803
|
-
progressFill.style.width = `${percentage}%`;
|
|
2804
|
-
progressLabel.textContent = `Progress ${percentage}%`;
|
|
2805
|
-
logout.addEventListener("click", () => {
|
|
2806
|
-
logoutUser();
|
|
2807
|
-
});
|
|
2808
|
-
return response;
|
|
2809
|
-
} catch (error) {
|
|
2810
|
-
console.error("Failed to load financial wizard progress:", error);
|
|
2811
|
-
}
|
|
2812
|
-
};
|
|
2813
|
-
var constructNavBarClasses = () => {
|
|
2814
|
-
const sidebarMenu = queryElement('[dev-target="sidebar-menu"]');
|
|
2815
|
-
if (!sidebarMenu) {
|
|
2816
|
-
console.error('Ensure [dev-target="sidebar-menu"] is present.');
|
|
2817
|
-
return;
|
|
2818
|
-
}
|
|
2819
|
-
const currentPath = window.location.pathname;
|
|
2820
|
-
const routeMap = {
|
|
2821
|
-
"/dev/finance-company-profile": {
|
|
2822
|
-
nav_attr: "nav-company-profile-link",
|
|
2823
|
-
nav_class: "is-active"
|
|
2824
|
-
},
|
|
2825
|
-
"/finance-company-profile": {
|
|
2826
|
-
nav_attr: "nav-company-profile-link",
|
|
2827
|
-
nav_class: "is-active"
|
|
2828
|
-
},
|
|
2829
|
-
"/dev/finance-financial-overview": {
|
|
2830
|
-
nav_attr: "nav-financial-overview-link",
|
|
2831
|
-
nav_class: "is-active"
|
|
2832
|
-
},
|
|
2833
|
-
"/finance-financial-overview": {
|
|
2834
|
-
nav_attr: "nav-financial-overview-link",
|
|
2835
|
-
nav_class: "is-active"
|
|
2836
|
-
},
|
|
2837
|
-
"/dev/finance-docs-financial-reports": {
|
|
2838
|
-
nav_attr: "nav-financial-reports-link",
|
|
2839
|
-
nav_class: "is-active-financial"
|
|
2840
|
-
},
|
|
2841
|
-
"/finance-docs-financial-reports": {
|
|
2842
|
-
nav_attr: "nav-financial-reports-link",
|
|
2843
|
-
nav_class: "is-active-financial"
|
|
2844
|
-
},
|
|
2845
|
-
"/dev/finance-docs-accounts-and-inventory": {
|
|
2846
|
-
nav_attr: "nav-accounts-inventory-link",
|
|
2847
|
-
nav_class: "is-active-financial"
|
|
2848
|
-
},
|
|
2849
|
-
"/finance-docs-accounts-and-inventory": {
|
|
2850
|
-
nav_attr: "nav-accounts-inventory-link",
|
|
2851
|
-
nav_class: "is-active-financial"
|
|
2852
|
-
},
|
|
2853
|
-
"/dev/finance-docs-ecommerce-performance": {
|
|
2854
|
-
nav_attr: "nav-eccomerce-performance-link",
|
|
2855
|
-
nav_class: "is-active-financial"
|
|
2856
|
-
},
|
|
2857
|
-
"/finance-docs-ecommerce-performance": {
|
|
2858
|
-
nav_attr: "nav-eccomerce-performance-link",
|
|
2859
|
-
nav_class: "is-active-financial"
|
|
2860
|
-
},
|
|
2861
|
-
"/dev/finance-docs-team-and-ownership": {
|
|
2862
|
-
nav_attr: "nav-team-ownership-link",
|
|
2863
|
-
nav_class: "is-active-financial"
|
|
2864
|
-
},
|
|
2865
|
-
"/finance-docs-team-and-ownership": {
|
|
2866
|
-
nav_attr: "nav-team-ownership-link",
|
|
2867
|
-
nav_class: "is-active-financial"
|
|
2868
|
-
}
|
|
2869
|
-
};
|
|
2870
|
-
const activeTarget = routeMap[currentPath];
|
|
2871
|
-
if (activeTarget) {
|
|
2872
|
-
const allNavLinks = document.querySelectorAll('[dev-attr="nav"]');
|
|
2873
|
-
allNavLinks.forEach((link) => {
|
|
2874
|
-
link.classList.remove("is-active");
|
|
2875
|
-
link.classList.remove("is-active-financial");
|
|
2876
|
-
});
|
|
2877
|
-
const activeLink = queryElement(`[dev-target="${activeTarget.nav_attr}"]`);
|
|
2878
|
-
if (activeLink) {
|
|
2879
|
-
activeLink.classList.add(activeTarget.nav_class);
|
|
2880
|
-
}
|
|
2881
|
-
}
|
|
2882
|
-
};
|
|
2883
|
-
|
|
2884
|
-
// pages/finance-docs-accounts-inventory/index.ts
|
|
2885
|
-
var initAccountsInventoryPage = async () => {
|
|
2886
|
-
constructNavBarClasses();
|
|
2887
|
-
processMiddleware();
|
|
2888
|
-
const result = await progressFinancialWizardPercentage();
|
|
2889
|
-
const ALLOWED_FILE_TYPES = [
|
|
2890
|
-
"application/vnd.ms-excel",
|
|
2891
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
2892
|
-
];
|
|
2893
|
-
const form = document.querySelector('[dev-target="accounts-inventory-reports-form"]');
|
|
2894
|
-
if (!form) {
|
|
2895
|
-
console.error(
|
|
2896
|
-
'Accounts & Inventory form not found. Element: [dev-target="accounts-inventory-reports-form"] not found'
|
|
2897
|
-
);
|
|
2898
|
-
return;
|
|
2899
|
-
}
|
|
2900
|
-
const monthlyInventoryBox = queryElement(
|
|
2901
|
-
'[dev-target="monthly-inventory-upload-box"]',
|
|
2902
|
-
form
|
|
2903
|
-
);
|
|
2904
|
-
const monthlyInventoryInput = queryElement(
|
|
2905
|
-
'[dev-target="monthly-inventory-input"]',
|
|
2906
|
-
form
|
|
2907
|
-
);
|
|
2908
|
-
const monthlyInventoryHelpText = queryElement(
|
|
2909
|
-
'[dev-target="balance-sheet-helper"]',
|
|
2910
|
-
form
|
|
2911
|
-
);
|
|
2912
|
-
const accountsReceivableBox = queryElement(
|
|
2913
|
-
'[dev-target="accounts-receivable-upload-box"]',
|
|
2914
|
-
form
|
|
2915
|
-
);
|
|
2916
|
-
const accountsReceivableInput = queryElement(
|
|
2917
|
-
'[dev-target="accounts-receivable-input"]',
|
|
2918
|
-
form
|
|
2919
|
-
);
|
|
2920
|
-
const accountsReceivableHelpText = queryElement(
|
|
2921
|
-
'[dev-target="income-statement-helper"]',
|
|
2922
|
-
form
|
|
2923
|
-
);
|
|
2924
|
-
const accountsPayableBox = queryElement(
|
|
2925
|
-
'[dev-target="accounts-payable-upload-box"]',
|
|
2926
|
-
form
|
|
2927
|
-
);
|
|
2928
|
-
const accountsPayableInput = queryElement(
|
|
2929
|
-
'[dev-target="accounts-payable-input"]',
|
|
2930
|
-
form
|
|
2931
|
-
);
|
|
2932
|
-
const accountsPayableHelpText = queryElement(
|
|
2933
|
-
'[dev-target="income-forecast-helper"]',
|
|
2934
|
-
form
|
|
2935
|
-
);
|
|
2936
|
-
const submitButton = queryElement('[dev-target="submit-button"]', form);
|
|
2937
|
-
if (!monthlyInventoryBox || !monthlyInventoryInput || !monthlyInventoryHelpText) {
|
|
2938
|
-
console.error(
|
|
2939
|
-
'Ensure [dev-target="monthly-inventory-upload-box"] and [dev-target="monthly-inventory-input"] and [dev-target="balance-sheet-helper"] are present.'
|
|
2940
|
-
);
|
|
2941
|
-
return;
|
|
2942
|
-
}
|
|
2943
|
-
if (!accountsReceivableBox || !accountsReceivableInput || !accountsReceivableHelpText) {
|
|
2944
|
-
console.error(
|
|
2945
|
-
'Ensure [dev-target="accounts-receivable-upload-box"] and [dev-target="accounts-receivable-input"] and [dev-target="income-statement-helper"] are present.'
|
|
2946
|
-
);
|
|
2947
|
-
return;
|
|
2948
|
-
}
|
|
2949
|
-
if (!accountsPayableBox || !accountsPayableInput || !accountsPayableHelpText) {
|
|
2950
|
-
console.error(
|
|
2951
|
-
'Ensure [dev-target="accounts-payable-upload-box"] and [dev-target="accounts-payable-input"] and [dev-target="income-forecast-helper"] are present.'
|
|
2952
|
-
);
|
|
2953
|
-
return;
|
|
2954
|
-
}
|
|
2955
|
-
if (!submitButton) {
|
|
2956
|
-
console.error('Ensure [dev-target="submit-button"] is present.');
|
|
2957
|
-
return;
|
|
2958
|
-
}
|
|
2959
|
-
const updateHelperText = (input, helperText) => {
|
|
2960
|
-
if (input.files && input.files.length > 0) {
|
|
2961
|
-
const file = input.files[0];
|
|
2962
|
-
if (!ALLOWED_FILE_TYPES.includes(file.type)) {
|
|
2963
|
-
input.value = "";
|
|
2964
|
-
helperText.textContent = "Invalid file type. Please upload Excel (.xls or .xlsx) files only";
|
|
2965
|
-
helperText.classList.add("is-error");
|
|
2966
|
-
return;
|
|
2967
|
-
}
|
|
2968
|
-
helperText.textContent = file.name;
|
|
2969
|
-
helperText.classList.remove("is-error");
|
|
2970
|
-
} else {
|
|
2971
|
-
helperText.textContent = "";
|
|
2972
|
-
helperText.classList.remove("is-error");
|
|
2973
|
-
}
|
|
2974
|
-
};
|
|
2975
|
-
if (monthlyInventoryBox && monthlyInventoryInput && monthlyInventoryHelpText) {
|
|
2976
|
-
monthlyInventoryBox.addEventListener("click", () => monthlyInventoryInput.click());
|
|
2977
|
-
monthlyInventoryBox.addEventListener("dragover", (e) => {
|
|
2978
|
-
e.preventDefault();
|
|
2979
|
-
monthlyInventoryBox.classList.add("drag");
|
|
2980
|
-
});
|
|
2981
|
-
monthlyInventoryBox.addEventListener("dragleave", () => {
|
|
2982
|
-
monthlyInventoryBox.classList.remove("drag");
|
|
2983
|
-
});
|
|
2984
|
-
monthlyInventoryBox.addEventListener("drop", (e) => {
|
|
2985
|
-
e.preventDefault();
|
|
2986
|
-
monthlyInventoryBox.classList.remove("drag");
|
|
2987
|
-
if (e.dataTransfer && e.dataTransfer.files.length > 0) {
|
|
2988
|
-
monthlyInventoryInput.files = e.dataTransfer.files;
|
|
2989
|
-
updateHelperText(monthlyInventoryInput, monthlyInventoryHelpText);
|
|
2990
|
-
monthlyInventoryInput.dispatchEvent(new Event("change", { bubbles: true }));
|
|
2991
|
-
}
|
|
2992
|
-
});
|
|
2993
|
-
monthlyInventoryInput.addEventListener("change", () => {
|
|
2994
|
-
updateHelperText(monthlyInventoryInput, monthlyInventoryHelpText);
|
|
2995
|
-
});
|
|
2996
|
-
}
|
|
2997
|
-
if (accountsReceivableBox && accountsReceivableInput && accountsReceivableHelpText) {
|
|
2998
|
-
accountsReceivableBox.addEventListener("click", () => accountsReceivableInput.click());
|
|
2999
|
-
accountsReceivableBox.addEventListener("dragover", (e) => {
|
|
3000
|
-
e.preventDefault();
|
|
3001
|
-
accountsReceivableBox.classList.add("drag");
|
|
3002
|
-
});
|
|
3003
|
-
accountsReceivableBox.addEventListener("dragleave", () => {
|
|
3004
|
-
accountsReceivableBox.classList.remove("drag");
|
|
3005
|
-
});
|
|
3006
|
-
accountsReceivableBox.addEventListener("drop", (e) => {
|
|
3007
|
-
e.preventDefault();
|
|
3008
|
-
accountsReceivableBox.classList.remove("drag");
|
|
3009
|
-
if (e.dataTransfer && e.dataTransfer.files.length > 0) {
|
|
3010
|
-
accountsReceivableInput.files = e.dataTransfer.files;
|
|
3011
|
-
updateHelperText(accountsReceivableInput, accountsReceivableHelpText);
|
|
3012
|
-
accountsReceivableInput.dispatchEvent(new Event("change", { bubbles: true }));
|
|
3013
|
-
}
|
|
3014
|
-
});
|
|
3015
|
-
accountsReceivableInput.addEventListener("change", () => {
|
|
3016
|
-
updateHelperText(accountsReceivableInput, accountsReceivableHelpText);
|
|
3017
|
-
});
|
|
3018
|
-
}
|
|
3019
|
-
if (accountsPayableBox && accountsPayableInput && accountsPayableHelpText) {
|
|
3020
|
-
accountsPayableBox.addEventListener("click", () => accountsPayableInput.click());
|
|
3021
|
-
accountsPayableBox.addEventListener("dragover", (e) => {
|
|
3022
|
-
e.preventDefault();
|
|
3023
|
-
accountsPayableBox.classList.add("drag");
|
|
3024
|
-
});
|
|
3025
|
-
accountsPayableBox.addEventListener("dragleave", () => {
|
|
3026
|
-
accountsPayableBox.classList.remove("drag");
|
|
3027
|
-
});
|
|
3028
|
-
accountsPayableBox.addEventListener("drop", (e) => {
|
|
3029
|
-
e.preventDefault();
|
|
3030
|
-
accountsPayableBox.classList.remove("drag");
|
|
3031
|
-
if (e.dataTransfer && e.dataTransfer.files.length > 0) {
|
|
3032
|
-
accountsPayableInput.files = e.dataTransfer.files;
|
|
3033
|
-
updateHelperText(accountsPayableInput, accountsPayableHelpText);
|
|
3034
|
-
accountsPayableInput.dispatchEvent(new Event("change", { bubbles: true }));
|
|
3035
|
-
}
|
|
3036
|
-
});
|
|
3037
|
-
accountsPayableInput.addEventListener("change", () => {
|
|
3038
|
-
updateHelperText(accountsPayableInput, accountsPayableHelpText);
|
|
3039
|
-
});
|
|
3040
|
-
}
|
|
3041
|
-
const uploadFile = async (file, documentType) => {
|
|
3042
|
-
if (!ALLOWED_FILE_TYPES.includes(file.type)) {
|
|
3043
|
-
throw new Error("Invalid file type. Please upload Excel (.xls or .xlsx) files only");
|
|
3044
|
-
}
|
|
3045
|
-
const assetPayload = {
|
|
3046
|
-
fileName: file.name,
|
|
3047
|
-
contentType: file.type,
|
|
3048
|
-
assetType: "document",
|
|
3049
|
-
fileSize: file.size,
|
|
3050
|
-
duration: 0
|
|
3051
|
-
};
|
|
3052
|
-
const assetResponse = await apiCreateAssetPresignedUrl(assetPayload);
|
|
3053
|
-
const assetId = assetResponse.asset.id;
|
|
3054
|
-
const { presignedUrl } = assetResponse;
|
|
3055
|
-
if (!presignedUrl) {
|
|
3056
|
-
throw new Error("Presigned URL not received from server");
|
|
3057
|
-
}
|
|
3058
|
-
await new Promise((resolve, reject) => {
|
|
3059
|
-
const xhr = new XMLHttpRequest();
|
|
3060
|
-
xhr.upload.addEventListener("progress", (event) => {
|
|
3061
|
-
if (event.lengthComputable) {
|
|
3062
|
-
const percent = Math.round(event.loaded / event.total * 100);
|
|
3063
|
-
console.log(`Upload progress: ${percent}%`);
|
|
3064
|
-
}
|
|
3065
|
-
});
|
|
3066
|
-
xhr.addEventListener("load", () => {
|
|
3067
|
-
if (xhr.status >= 200 && xhr.status < 300) {
|
|
3068
|
-
resolve();
|
|
3069
|
-
} else {
|
|
3070
|
-
reject(new Error("Failed to upload file to S3"));
|
|
3071
|
-
}
|
|
3072
|
-
});
|
|
3073
|
-
xhr.addEventListener("error", (error) => {
|
|
3074
|
-
console.error(error);
|
|
3075
|
-
reject(new Error("Network error during upload"));
|
|
3076
|
-
});
|
|
3077
|
-
xhr.open("PUT", presignedUrl);
|
|
3078
|
-
xhr.setRequestHeader("Content-Type", file.type);
|
|
3079
|
-
xhr.send(file);
|
|
3080
|
-
});
|
|
3081
|
-
const documentPayload = {
|
|
3082
|
-
page: "accounts-inventory",
|
|
3083
|
-
document_type: documentType,
|
|
3084
|
-
asset_id: assetId
|
|
3085
|
-
};
|
|
3086
|
-
await apiUploadFinancialDocument(documentPayload);
|
|
3087
|
-
};
|
|
3088
|
-
form.addEventListener("submit", async (event) => {
|
|
3089
|
-
event.preventDefault();
|
|
3090
|
-
event.stopPropagation();
|
|
3091
|
-
const resetErrors = () => {
|
|
3092
|
-
monthlyInventoryBox?.classList.remove("is-error");
|
|
3093
|
-
accountsReceivableBox?.classList.remove("is-error");
|
|
3094
|
-
accountsPayableBox?.classList.remove("is-error");
|
|
3095
|
-
monthlyInventoryHelpText?.classList.remove("is-error");
|
|
3096
|
-
accountsReceivableHelpText?.classList.remove("is-error");
|
|
3097
|
-
accountsPayableHelpText?.classList.remove("is-error");
|
|
3098
|
-
submitButton.classList.remove("is-error");
|
|
3099
|
-
submitButton.value = "UPLOAD DOCUMENTS";
|
|
3100
|
-
};
|
|
3101
|
-
monthlyInventoryInput?.addEventListener("change", resetErrors, { once: true });
|
|
3102
|
-
accountsReceivableInput?.addEventListener("change", resetErrors, { once: true });
|
|
3103
|
-
accountsPayableInput?.addEventListener("change", resetErrors, { once: true });
|
|
3104
|
-
const filesToUpload = [];
|
|
3105
|
-
if (monthlyInventoryInput?.files && monthlyInventoryInput.files[0]) {
|
|
3106
|
-
const file = monthlyInventoryInput.files[0];
|
|
3107
|
-
if (ALLOWED_FILE_TYPES.includes(file.type)) {
|
|
3108
|
-
filesToUpload.push({
|
|
3109
|
-
file,
|
|
3110
|
-
documentType: "monthly_inventory_report"
|
|
3111
|
-
});
|
|
3112
|
-
} else {
|
|
3113
|
-
monthlyInventoryHelpText?.classList.add("is-error");
|
|
3114
|
-
}
|
|
3115
|
-
}
|
|
3116
|
-
if (accountsReceivableInput?.files && accountsReceivableInput.files[0]) {
|
|
3117
|
-
const file = accountsReceivableInput.files[0];
|
|
3118
|
-
if (ALLOWED_FILE_TYPES.includes(file.type)) {
|
|
3119
|
-
filesToUpload.push({
|
|
3120
|
-
file,
|
|
3121
|
-
documentType: "accounts_receivable_aging"
|
|
3122
|
-
});
|
|
3123
|
-
} else {
|
|
3124
|
-
accountsReceivableHelpText?.classList.add("is-error");
|
|
3125
|
-
}
|
|
3126
|
-
}
|
|
3127
|
-
if (accountsPayableInput?.files && accountsPayableInput.files[0]) {
|
|
3128
|
-
const file = accountsPayableInput.files[0];
|
|
3129
|
-
if (ALLOWED_FILE_TYPES.includes(file.type)) {
|
|
3130
|
-
filesToUpload.push({
|
|
3131
|
-
file,
|
|
3132
|
-
documentType: "accounts_payable_aging"
|
|
3133
|
-
});
|
|
3134
|
-
} else {
|
|
3135
|
-
accountsPayableHelpText?.classList.add("is-error");
|
|
3136
|
-
}
|
|
3137
|
-
}
|
|
3138
|
-
const hasInvalidFiles = monthlyInventoryInput?.files && monthlyInventoryInput.files[0] && !ALLOWED_FILE_TYPES.includes(monthlyInventoryInput.files[0].type) || accountsReceivableInput?.files && accountsReceivableInput.files[0] && !ALLOWED_FILE_TYPES.includes(accountsReceivableInput.files[0].type) || accountsPayableInput?.files && accountsPayableInput.files[0] && !ALLOWED_FILE_TYPES.includes(accountsPayableInput.files[0].type);
|
|
3139
|
-
if (hasInvalidFiles) {
|
|
3140
|
-
submitButton.classList.add("is-error");
|
|
3141
|
-
submitButton.value = "Please upload only Excel (.xls or .xlsx) files";
|
|
3142
|
-
return;
|
|
3143
|
-
}
|
|
3144
|
-
if (filesToUpload.length === 0) {
|
|
3145
|
-
submitButton.classList.add("is-error");
|
|
3146
|
-
submitButton.value = "Please select at least one file to upload";
|
|
3147
|
-
return;
|
|
3148
|
-
}
|
|
3149
|
-
try {
|
|
3150
|
-
submitButton.disabled = true;
|
|
3151
|
-
submitButton.value = "Uploading...";
|
|
3152
|
-
await Promise.all(
|
|
3153
|
-
filesToUpload.map(({ file, documentType }) => uploadFile(file, documentType))
|
|
3154
|
-
);
|
|
3155
|
-
submitButton.classList.add("is-success");
|
|
3156
|
-
submitButton.value = "Documents uploaded successfully!";
|
|
3157
|
-
if (monthlyInventoryInput) monthlyInventoryInput.value = "";
|
|
3158
|
-
if (accountsReceivableInput) accountsReceivableInput.value = "";
|
|
3159
|
-
if (accountsPayableInput) accountsPayableInput.value = "";
|
|
3160
|
-
if (monthlyInventoryHelpText) {
|
|
3161
|
-
monthlyInventoryHelpText.textContent = "";
|
|
3162
|
-
monthlyInventoryHelpText.classList.remove("is-error");
|
|
3163
|
-
}
|
|
3164
|
-
if (accountsReceivableHelpText) {
|
|
3165
|
-
accountsReceivableHelpText.textContent = "";
|
|
3166
|
-
accountsReceivableHelpText.classList.remove("is-error");
|
|
3167
|
-
}
|
|
3168
|
-
if (accountsPayableHelpText) {
|
|
3169
|
-
accountsPayableHelpText.textContent = "";
|
|
3170
|
-
accountsPayableHelpText.classList.remove("is-error");
|
|
3171
|
-
}
|
|
3172
|
-
setTimeout(() => {
|
|
3173
|
-
submitButton.classList.remove("is-success");
|
|
3174
|
-
submitButton.value = "UPLOAD DOCUMENTS";
|
|
3175
|
-
submitButton.disabled = false;
|
|
3176
|
-
navigateToPath("/finance-docs-ecommerce-performance");
|
|
3177
|
-
}, 900);
|
|
3178
|
-
} catch (error) {
|
|
3179
|
-
const { message } = error;
|
|
3180
|
-
console.error(message);
|
|
3181
|
-
submitButton.classList.add("is-error");
|
|
3182
|
-
submitButton.value = message || "There was a problem uploading the documents";
|
|
3183
|
-
submitButton.disabled = false;
|
|
3184
|
-
}
|
|
3185
|
-
});
|
|
3186
|
-
if (result?.accounts_inventory) {
|
|
3187
|
-
const monthlyInventory = result.accounts_inventory.find(
|
|
3188
|
-
(document2) => document2.document_type === "monthly_inventory_report"
|
|
3189
|
-
);
|
|
3190
|
-
if (monthlyInventory) {
|
|
3191
|
-
monthlyInventoryHelpText.textContent = monthlyInventory.asset_name || "";
|
|
3192
|
-
}
|
|
3193
|
-
const accountsReceivable = result.accounts_inventory.find(
|
|
3194
|
-
(document2) => document2.document_type === "accounts_receivable_aging"
|
|
3195
|
-
);
|
|
3196
|
-
if (accountsReceivable) {
|
|
3197
|
-
accountsReceivableHelpText.textContent = accountsReceivable.asset_name || "";
|
|
3198
|
-
}
|
|
3199
|
-
const accountsPayable = result.accounts_inventory.find(
|
|
3200
|
-
(document2) => document2.document_type === "accounts_payable_aging"
|
|
3201
|
-
);
|
|
3202
|
-
if (accountsPayable) {
|
|
3203
|
-
accountsPayableHelpText.textContent = accountsPayable.asset_name || "";
|
|
3204
|
-
}
|
|
3205
|
-
}
|
|
3206
|
-
};
|
|
3207
|
-
initAccountsInventoryPage();
|
|
3208
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
var ar=Object.defineProperty;var cr=(e,t)=>{for(var r in t)ar(e,r,{get:t[r],enumerable:!0})};function ee(e,t){return function(){return e.apply(t,arguments)}}var{toString:lr}=Object.prototype,{getPrototypeOf:Ne}=Object,{iterator:ye,toStringTag:pt}=Symbol,Ee=(e=>t=>{let r=lr.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>Ee(t)===e),be=e=>t=>typeof t===e,{isArray:V}=Array,J=be("undefined");function te(e){return e!==null&&!J(e)&&e.constructor!==null&&!J(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var mt=P("ArrayBuffer");function ur(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&mt(e.buffer),t}var fr=be("string"),O=be("function"),ht=be("number"),re=e=>e!==null&&typeof e=="object",dr=e=>e===!0||e===!1,ge=e=>{if(Ee(e)!=="object")return!1;let t=Ne(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(pt in e)&&!(ye in e)},pr=e=>{if(!re(e)||te(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},mr=P("Date"),hr=P("File"),gr=P("Blob"),yr=P("FileList"),Er=e=>re(e)&&O(e.pipe),br=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=Ee(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},xr=P("URLSearchParams"),[wr,vr,Rr,Ar]=["ReadableStream","Request","Response","Headers"].map(P),Sr=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ne(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),V(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(te(e))return;let i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length,c;for(n=0;n<s;n++)c=i[n],t.call(null,e[c],c,e)}}function gt(e,t){if(te(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}var z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,yt=e=>!J(e)&&e!==z;function Ue(){let{caseless:e,skipUndefined:t}=yt(this)&&this||{},r={},n=(o,i)=>{let s=e&>(r,i)||i;ge(r[s])&&ge(o)?r[s]=Ue(r[s],o):ge(o)?r[s]=Ue({},o):V(o)?r[s]=o.slice():(!t||!J(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ne(arguments[o],n);return r}var Tr=(e,t,r,{allOwnKeys:n}={})=>(ne(t,(o,i)=>{r&&O(o)?e[i]=ee(o,r):e[i]=o},{allOwnKeys:n}),e),Cr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Or=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Lr=(e,t,r,n)=>{let o,i,s,c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!c[s]&&(t[s]=e[s],c[s]=!0);e=r!==!1&&Ne(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},_r=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},Pr=e=>{if(!e)return null;if(V(e))return e;let t=e.length;if(!ht(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Dr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ne(Uint8Array)),Fr=(e,t)=>{let n=(e&&e[ye]).call(e),o;for(;(o=n.next())&&!o.done;){let i=o.value;t.call(e,i[0],i[1])}},Ur=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Nr=P("HTMLFormElement"),kr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),dt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Br=P("RegExp"),Et=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};ne(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},Mr=e=>{Et(e,(t,r)=>{if(O(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(O(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Hr=(e,t)=>{let r={},n=o=>{o.forEach(i=>{r[i]=!0})};return V(e)?n(e):n(String(e).split(t)),r},Ir=()=>{},qr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function jr(e){return!!(e&&O(e.append)&&e[pt]==="FormData"&&e[ye])}var zr=e=>{let t=new Array(10),r=(n,o)=>{if(re(n)){if(t.indexOf(n)>=0)return;if(te(n))return n;if(!("toJSON"in n)){t[o]=n;let i=V(n)?[]:{};return ne(n,(s,c)=>{let m=r(s,o+1);!J(m)&&(i[c]=m)}),t[o]=void 0,i}}return n};return r(e,0)},Wr=P("AsyncFunction"),$r=e=>e&&(re(e)||O(e))&&O(e.then)&&O(e.catch),bt=((e,t)=>e?setImmediate:t?((r,n)=>(z.addEventListener("message",({source:o,data:i})=>{o===z&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),z.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",O(z.postMessage)),Jr=typeof queueMicrotask<"u"?queueMicrotask.bind(z):typeof process<"u"&&process.nextTick||bt,Vr=e=>e!=null&&O(e[ye]),a={isArray:V,isArrayBuffer:mt,isBuffer:te,isFormData:br,isArrayBufferView:ur,isString:fr,isNumber:ht,isBoolean:dr,isObject:re,isPlainObject:ge,isEmptyObject:pr,isReadableStream:wr,isRequest:vr,isResponse:Rr,isHeaders:Ar,isUndefined:J,isDate:mr,isFile:hr,isBlob:gr,isRegExp:Br,isFunction:O,isStream:Er,isURLSearchParams:xr,isTypedArray:Dr,isFileList:yr,forEach:ne,merge:Ue,extend:Tr,trim:Sr,stripBOM:Cr,inherits:Or,toFlatObject:Lr,kindOf:Ee,kindOfTest:P,endsWith:_r,toArray:Pr,forEachEntry:Fr,matchAll:Ur,isHTMLForm:Nr,hasOwnProperty:dt,hasOwnProp:dt,reduceDescriptors:Et,freezeMethods:Mr,toObjectSet:Hr,toCamelCase:kr,noop:Ir,toFiniteNumber:qr,findKey:gt,global:z,isContextDefined:yt,isSpecCompliantForm:jr,toJSONObject:zr,isAsyncFn:Wr,isThenable:$r,setImmediate:bt,asap:Jr,isIterable:Vr};function K(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}a.inherits(K,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});var xt=K.prototype,wt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{wt[e]={value:e}});Object.defineProperties(K,wt);Object.defineProperty(xt,"isAxiosError",{value:!0});K.from=(e,t,r,n,o,i)=>{let s=Object.create(xt);a.toFlatObject(e,s,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");let c=e&&e.message?e.message:"Error",m=t==null&&e?e.code:t;return K.call(s,c,m,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};var g=K;var xe=null;function ke(e){return a.isPlainObject(e)||a.isArray(e)}function Rt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function vt(e,t,r){return e?e.concat(t).map(function(o,i){return o=Rt(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Kr(e){return a.isArray(e)&&!e.some(ke)}var Gr=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function Xr(e,t,r){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new(xe||FormData),r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,p){return!a.isUndefined(p[f])});let n=r.metaTokens,o=r.visitor||l,i=r.dots,s=r.indexes,m=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(o))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!m&&a.isBlob(d))throw new g("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?m&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,f,p){let E=d;if(d&&!p&&typeof d=="object"){if(a.endsWith(f,"{}"))f=n?f:f.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&Kr(d)||(a.isFileList(d)||a.endsWith(f,"[]"))&&(E=a.toArray(d)))return f=Rt(f),E.forEach(function(b,R){!(a.isUndefined(b)||b===null)&&t.append(s===!0?vt([f],R,i):s===null?f:f+"[]",u(b))}),!1}return ke(d)?!0:(t.append(vt(p,f,i),u(d)),!1)}let h=[],y=Object.assign(Gr,{defaultVisitor:l,convertValue:u,isVisitable:ke});function x(d,f){if(!a.isUndefined(d)){if(h.indexOf(d)!==-1)throw Error("Circular reference detected in "+f.join("."));h.push(d),a.forEach(d,function(E,v){(!(a.isUndefined(E)||E===null)&&o.call(t,E,a.isString(v)?v.trim():v,f,y))===!0&&x(E,f?f.concat(v):[v])}),h.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return x(e),t}var q=Xr;function At(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function St(e,t){this._pairs=[],e&&q(e,this,t)}var Tt=St.prototype;Tt.append=function(t,r){this._pairs.push([t,r])};Tt.toString=function(t){let r=t?function(n){return t.call(this,n,At)}:At;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};var we=St;function Qr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oe(e,t,r){if(!t)return e;let n=r&&r.encode||Qr;a.isFunction(r)&&(r={serialize:r});let o=r&&r.serialize,i;if(o?i=o(t,r):i=a.isURLSearchParams(t)?t.toString():new we(t,r).toString(n),i){let s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}var Be=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(n){n!==null&&t(n)})}},Me=Be;var ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Ct=typeof URLSearchParams<"u"?URLSearchParams:we;var Ot=typeof FormData<"u"?FormData:null;var Lt=typeof Blob<"u"?Blob:null;var _t={isBrowser:!0,classes:{URLSearchParams:Ct,FormData:Ot,Blob:Lt},protocols:["http","https","file","blob","url","data"]};var qe={};cr(qe,{hasBrowserEnv:()=>Ie,hasStandardBrowserEnv:()=>Yr,hasStandardBrowserWebWorkerEnv:()=>Zr,navigator:()=>He,origin:()=>en});var Ie=typeof window<"u"&&typeof document<"u",He=typeof navigator=="object"&&navigator||void 0,Yr=Ie&&(!He||["ReactNative","NativeScript","NS"].indexOf(He.product)<0),Zr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",en=Ie&&window.location.href||"http://localhost";var w={...qe,..._t};function je(e,t){return q(e,new w.classes.URLSearchParams,{visitor:function(r,n,o,i){return w.isNode&&a.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function tn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function rn(e){let t={},r=Object.keys(e),n,o=r.length,i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function nn(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;let c=Number.isFinite(+s),m=i>=r.length;return s=!s&&a.isArray(o)?o.length:s,m?(a.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!c):((!o[s]||!a.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&a.isArray(o[s])&&(o[s]=rn(o[s])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){let r={};return a.forEachEntry(e,(n,o)=>{t(tn(n),o,r,0)}),r}return null}var Re=nn;function on(e,t,r){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var ze={transitional:ve,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return o?JSON.stringify(Re(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return je(t,this.formSerializer).toString();if((c=a.isFileList(t))||n.indexOf("multipart/form-data")>-1){let m=this.env&&this.env.FormData;return q(c?{"files[]":t}:t,m&&new m,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),on(t)):t}],transformResponse:[function(t){let r=this.transitional||ze.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(n&&!this.responseType||o)){let s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(c){if(s)throw c.name==="SyntaxError"?g.from(c,g.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:w.classes.FormData,Blob:w.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ze.headers[e]={}});var G=ze;var sn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Pt=e=>{let t={},r,n,o;return e&&e.split(`
|
|
2
|
+
`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&sn[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};var Dt=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function Ae(e){return e===!1||e==null?e:a.isArray(e)?e.map(Ae):String(e)}function an(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}var cn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function We(e,t,r,n,o){if(a.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!a.isString(t)){if(a.isString(n))return t.indexOf(n)!==-1;if(a.isRegExp(n))return n.test(t)}}function ln(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function un(e,t){let r=a.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}var X=class{constructor(t){t&&this.set(t)}set(t,r,n){let o=this;function i(c,m,u){let l=se(m);if(!l)throw new Error("header name must be a non-empty string");let h=a.findKey(o,l);(!h||o[h]===void 0||u===!0||u===void 0&&o[h]!==!1)&&(o[h||m]=Ae(c))}let s=(c,m)=>a.forEach(c,(u,l)=>i(u,l,m));if(a.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(a.isString(t)&&(t=t.trim())&&!cn(t))s(Pt(t),r);else if(a.isObject(t)&&a.isIterable(t)){let c={},m,u;for(let l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(m=c[u])?a.isArray(m)?[...m,l[1]]:[m,l[1]]:l[1]}s(c,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=se(t),t){let n=a.findKey(this,t);if(n){let o=this[n];if(!r)return o;if(r===!0)return an(o);if(a.isFunction(r))return r.call(this,o,n);if(a.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=se(t),t){let n=a.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||We(this,this[n],n,r)))}return!1}delete(t,r){let n=this,o=!1;function i(s){if(s=se(s),s){let c=a.findKey(n,s);c&&(!r||We(n,n[c],c,r))&&(delete n[c],o=!0)}}return a.isArray(t)?t.forEach(i):i(t),o}clear(t){let r=Object.keys(this),n=r.length,o=!1;for(;n--;){let i=r[n];(!t||We(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){let r=this,n={};return a.forEach(this,(o,i)=>{let s=a.findKey(n,i);if(s){r[s]=Ae(o),delete r[i];return}let c=t?ln(i):String(i).trim();c!==i&&delete r[i],r[c]=Ae(o),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return a.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&a.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){let n=(this[Dt]=this[Dt]={accessors:{}}).accessors,o=this.prototype;function i(s){let c=se(s);n[c]||(un(o,s),n[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};X.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(X.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});a.freezeMethods(X);var S=X;function ie(e,t){let r=this||G,n=t||r,o=S.from(n.headers),i=n.data;return a.forEach(e,function(c){i=c.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function ae(e){return!!(e&&e.__CANCEL__)}function Ft(e,t,r){g.call(this,e??"canceled",g.ERR_CANCELED,t,r),this.name="CanceledError"}a.inherits(Ft,g,{__CANCEL__:!0});var N=Ft;function ce(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new g("Request failed with status code "+r.status,[g.ERR_BAD_REQUEST,g.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function $e(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function fn(e,t){e=e||10;let r=new Array(e),n=new Array(e),o=0,i=0,s;return t=t!==void 0?t:1e3,function(m){let u=Date.now(),l=n[i];s||(s=u),r[o]=m,n[o]=u;let h=i,y=0;for(;h!==o;)y+=r[h++],h=h%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-s<t)return;let x=l&&u-l;return x?Math.round(y*1e3/x):void 0}}var Ut=fn;function dn(e,t){let r=0,n=1e3/t,o,i,s=(u,l=Date.now())=>{r=l,o=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{let l=Date.now(),h=l-r;h>=n?s(u,l):(o=u,i||(i=setTimeout(()=>{i=null,s(o)},n-h)))},()=>o&&s(o)]}var Nt=dn;var Q=(e,t,r=3)=>{let n=0,o=Ut(50,250);return Nt(i=>{let s=i.loaded,c=i.lengthComputable?i.total:void 0,m=s-n,u=o(m),l=s<=c;n=s;let h={loaded:s,total:c,progress:c?s/c:void 0,bytes:m,rate:u||void 0,estimated:u&&c&&l?(c-s)/u:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},r)},Je=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ve=e=>(...t)=>a.asap(()=>e(...t));var kt=w.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,w.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(w.origin),w.navigator&&/(msie|trident)/i.test(w.navigator.userAgent)):()=>!0;var Bt=w.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;let c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(n)&&c.push(`path=${n}`),a.isString(o)&&c.push(`domain=${o}`),i===!0&&c.push("secure"),a.isString(s)&&c.push(`SameSite=${s}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;let t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ke(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ge(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function le(e,t,r){let n=!Ke(t);return e&&(n||r==!1)?Ge(e,t):t}var Mt=e=>e instanceof S?{...e}:e;function D(e,t){t=t||{};let r={};function n(u,l,h,y){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:y},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function o(u,l,h,y){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u,h,y)}else return n(u,l,h,y)}function i(u,l){if(!a.isUndefined(l))return n(void 0,l)}function s(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u)}else return n(void 0,l)}function c(u,l,h){if(h in t)return n(u,l);if(h in e)return n(void 0,u)}let m={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c,headers:(u,l,h)=>o(Mt(u),Mt(l),h,!0)};return a.forEach(Object.keys({...e,...t}),function(l){let h=m[l]||o,y=h(e[l],t[l],l);a.isUndefined(y)&&h!==c||(r[l]=y)}),r}var Se=e=>{let t=D({},e),{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:c}=t;if(t.headers=s=S.from(s),t.url=oe(le(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(w.hasStandardBrowserEnv||w.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(a.isFunction(r.getHeaders)){let m=r.getHeaders(),u=["content-type","content-length"];Object.entries(m).forEach(([l,h])=>{u.includes(l.toLowerCase())&&s.set(l,h)})}}if(w.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(t)),n||n!==!1&&kt(t.url))){let m=o&&i&&Bt.read(i);m&&s.set(o,m)}return t};var pn=typeof XMLHttpRequest<"u",Ht=pn&&function(e){return new Promise(function(r,n){let o=Se(e),i=o.data,s=S.from(o.headers).normalize(),{responseType:c,onUploadProgress:m,onDownloadProgress:u}=o,l,h,y,x,d;function f(){x&&x(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(l),o.signal&&o.signal.removeEventListener("abort",l)}let p=new XMLHttpRequest;p.open(o.method.toUpperCase(),o.url,!0),p.timeout=o.timeout;function E(){if(!p)return;let b=S.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),L={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:b,config:e,request:p};ce(function(C){r(C),f()},function(C){n(C),f()},L),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(n(new g("Request aborted",g.ECONNABORTED,e,p)),p=null)},p.onerror=function(R){let L=R&&R.message?R.message:"Network Error",M=new g(L,g.ERR_NETWORK,e,p);M.event=R||null,n(M),p=null},p.ontimeout=function(){let R=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",L=o.transitional||ve;o.timeoutErrorMessage&&(R=o.timeoutErrorMessage),n(new g(R,L.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,e,p)),p=null},i===void 0&&s.setContentType(null),"setRequestHeader"in p&&a.forEach(s.toJSON(),function(R,L){p.setRequestHeader(L,R)}),a.isUndefined(o.withCredentials)||(p.withCredentials=!!o.withCredentials),c&&c!=="json"&&(p.responseType=o.responseType),u&&([y,d]=Q(u,!0),p.addEventListener("progress",y)),m&&p.upload&&([h,x]=Q(m),p.upload.addEventListener("progress",h),p.upload.addEventListener("loadend",x)),(o.cancelToken||o.signal)&&(l=b=>{p&&(n(!b||b.type?new N(null,e,p):b),p.abort(),p=null)},o.cancelToken&&o.cancelToken.subscribe(l),o.signal&&(o.signal.aborted?l():o.signal.addEventListener("abort",l)));let v=$e(o.url);if(v&&w.protocols.indexOf(v)===-1){n(new g("Unsupported protocol "+v+":",g.ERR_BAD_REQUEST,e));return}p.send(i||null)})};var mn=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o,i=function(u){if(!o){o=!0,c();let l=u instanceof Error?u:this.reason;n.abort(l instanceof g?l:new N(l instanceof Error?l.message:l))}},s=t&&setTimeout(()=>{s=null,i(new g(`timeout ${t} of ms exceeded`,g.ETIMEDOUT))},t),c=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));let{signal:m}=n;return m.unsubscribe=()=>a.asap(c),m}},It=mn;var hn=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},gn=async function*(e,t){for await(let r of yn(e))yield*hn(r,t)},yn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Xe=(e,t,r,n)=>{let o=gn(e,t),i=0,s,c=m=>{s||(s=!0,n&&n(m))};return new ReadableStream({async pull(m){try{let{done:u,value:l}=await o.next();if(u){c(),m.close();return}let h=l.byteLength;if(r){let y=i+=h;r(y)}m.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(m){return c(m),o.return()}},{highWaterMark:2})};var qt=64*1024,{isFunction:Te}=a,En=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:jt,TextEncoder:zt}=a.global,Wt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},bn=e=>{e=a.merge.call({skipUndefined:!0},En,e);let{fetch:t,Request:r,Response:n}=e,o=t?Te(t):typeof fetch=="function",i=Te(r),s=Te(n);if(!o)return!1;let c=o&&Te(jt),m=o&&(typeof zt=="function"?(d=>f=>d.encode(f))(new zt):async d=>new Uint8Array(await new r(d).arrayBuffer())),u=i&&c&&Wt(()=>{let d=!1,f=new r(w.origin,{body:new jt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!f}),l=s&&c&&Wt(()=>a.isReadableStream(new n("").body)),h={stream:l&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!h[d]&&(h[d]=(f,p)=>{let E=f&&f[d];if(E)return E.call(f);throw new g(`Response type '${d}' is not supported`,g.ERR_NOT_SUPPORT,p)})});let y=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new r(w.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await m(d)).byteLength},x=async(d,f)=>{let p=a.toFiniteNumber(d.getContentLength());return p??y(f)};return async d=>{let{url:f,method:p,data:E,signal:v,cancelToken:b,timeout:R,onDownloadProgress:L,onUploadProgress:M,responseType:C,headers:_,withCredentials:F="same-origin",fetchOptions:pe}=Se(d),at=t||fetch;C=C?(C+"").toLowerCase():"text";let me=It([v,b&&b.toAbortSignal()],R),Z=null,j=me&&me.unsubscribe&&(()=>{me.unsubscribe()}),ct;try{if(M&&u&&p!=="get"&&p!=="head"&&(ct=await x(_,E))!==0){let I=new r(f,{method:"POST",body:E,duplex:"half"}),$;if(a.isFormData(E)&&($=I.headers.get("content-type"))&&_.setContentType($),I.body){let[Fe,he]=Je(ct,Q(Ve(M)));E=Xe(I.body,qt,Fe,he)}}a.isString(F)||(F=F?"include":"omit");let U=i&&"credentials"in r.prototype,lt={...pe,signal:me,method:p.toUpperCase(),headers:_.normalize().toJSON(),body:E,duplex:"half",credentials:U?F:void 0};Z=i&&new r(f,lt);let H=await(i?at(Z,pe):at(f,lt)),ut=l&&(C==="stream"||C==="response");if(l&&(L||ut&&j)){let I={};["status","statusText","headers"].forEach(ft=>{I[ft]=H[ft]});let $=a.toFiniteNumber(H.headers.get("content-length")),[Fe,he]=L&&Je($,Q(Ve(L),!0))||[];H=new n(Xe(H.body,qt,Fe,()=>{he&&he(),j&&j()}),I)}C=C||"text";let ir=await h[a.findKey(h,C)||"text"](H,d);return!ut&&j&&j(),await new Promise((I,$)=>{ce(I,$,{data:ir,headers:S.from(H.headers),status:H.status,statusText:H.statusText,config:d,request:Z})})}catch(U){throw j&&j(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new g("Network Error",g.ERR_NETWORK,d,Z),{cause:U.cause||U}):g.from(U,U&&U.code,d,Z)}}},xn=new Map,Qe=e=>{let t=e&&e.env||{},{fetch:r,Request:n,Response:o}=t,i=[n,o,r],s=i.length,c=s,m,u,l=xn;for(;c--;)m=i[c],u=l.get(m),u===void 0&&l.set(m,u=c?new Map:bn(t)),l=u;return u},Hs=Qe();var Ye={http:xe,xhr:Ht,fetch:{get:Qe}};a.forEach(Ye,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var $t=e=>`- ${e}`,vn=e=>a.isFunction(e)||e===null||e===!1;function Rn(e,t){e=a.isArray(e)?e:[e];let{length:r}=e,n,o,i={};for(let s=0;s<r;s++){n=e[s];let c;if(o=n,!vn(n)&&(o=Ye[(c=String(n)).toLowerCase()],o===void 0))throw new g(`Unknown adapter '${c}'`);if(o&&(a.isFunction(o)||(o=o.get(t))))break;i[c||"#"+s]=o}if(!o){let s=Object.entries(i).map(([m,u])=>`adapter ${m} `+(u===!1?"is not supported by the environment":"is not available in the build")),c=r?s.length>1?`since :
|
|
4
|
+
`+s.map($t).join(`
|
|
5
|
+
`):" "+$t(s[0]):"as no adapter specified";throw new g("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return o}var Ce={getAdapter:Rn,adapters:Ye};function Ze(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new N(null,e)}function Oe(e){return Ze(e),e.headers=S.from(e.headers),e.data=ie.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ce.getAdapter(e.adapter||G.adapter,e)(e).then(function(n){return Ze(e),n.data=ie.call(e,e.transformResponse,n),n.headers=S.from(n.headers),n},function(n){return ae(n)||(Ze(e),n&&n.response&&(n.response.data=ie.call(e,e.transformResponse,n.response),n.response.headers=S.from(n.response.headers))),Promise.reject(n)})}var Le="1.13.2";var _e={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_e[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var Jt={};_e.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Le+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,c)=>{if(t===!1)throw new g(o(s," has been removed"+(r?" in "+r:"")),g.ERR_DEPRECATED);return r&&!Jt[s]&&(Jt[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,c):!0}};_e.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function An(e,t,r){if(typeof e!="object")throw new g("options must be an object",g.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),o=n.length;for(;o-- >0;){let i=n[o],s=t[i];if(s){let c=e[i],m=c===void 0||s(c,i,e);if(m!==!0)throw new g("option "+i+" must be "+m,g.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new g("Unknown option "+i,g.ERR_BAD_OPTION)}}var ue={assertOptions:An,validators:_e};var k=ue.validators,Y=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Me,response:new Me}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;let i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
+
`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=D(this.defaults,r);let{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&ue.assertOptions(n,{silentJSONParsing:k.transitional(k.boolean),forcedJSONParsing:k.transitional(k.boolean),clarifyTimeoutError:k.transitional(k.boolean)},!1),o!=null&&(a.isFunction(o)?r.paramsSerializer={serialize:o}:ue.assertOptions(o,{encode:k.function,serialize:k.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ue.assertOptions(r,{baseUrl:k.spelling("baseURL"),withXsrfToken:k.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&a.merge(i.common,i[r.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=S.concat(s,i);let c=[],m=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(m=m&&f.synchronous,c.unshift(f.fulfilled,f.rejected))});let u=[];this.interceptors.response.forEach(function(f){u.push(f.fulfilled,f.rejected)});let l,h=0,y;if(!m){let d=[Oe.bind(this),void 0];for(d.unshift(...c),d.push(...u),y=d.length,l=Promise.resolve(r);h<y;)l=l.then(d[h++],d[h++]);return l}y=c.length;let x=r;for(;h<y;){let d=c[h++],f=c[h++];try{x=d(x)}catch(p){f.call(this,p);break}}try{l=Oe.call(this,x)}catch(d){return Promise.reject(d)}for(h=0,y=u.length;h<y;)l=l.then(u[h++],u[h++]);return l}getUri(t){t=D(this.defaults,t);let r=le(t.baseURL,t.url,t.allowAbsoluteUrls);return oe(r,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){Y.prototype[t]=function(r,n){return this.request(D(n||{},{method:t,url:r,data:(n||{}).data}))}});a.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,c){return this.request(D(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Y.prototype[t]=r(),Y.prototype[t+"Form"]=r(!0)});var fe=Y;var et=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});let n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i,s=new Promise(c=>{n.subscribe(c),i=c}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,c){n.reason||(n.reason=new N(i,s,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new e(function(o){t=o}),cancel:t}}},Vt=et;function tt(e){return function(r){return e.apply(null,r)}}function rt(e){return a.isObject(e)&&e.isAxiosError===!0}var nt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(nt).forEach(([e,t])=>{nt[t]=e});var Kt=nt;function Gt(e){let t=new fe(e),r=ee(fe.prototype.request,t);return a.extend(r,fe.prototype,t,{allOwnKeys:!0}),a.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Gt(D(e,o))},r}var A=Gt(G);A.Axios=fe;A.CanceledError=N;A.CancelToken=Vt;A.isCancel=ae;A.VERSION=Le;A.toFormData=q;A.AxiosError=g;A.Cancel=A.CanceledError;A.all=function(t){return Promise.all(t)};A.spread=tt;A.isAxiosError=rt;A.mergeConfig=D;A.AxiosHeaders=S;A.formToJSON=e=>Re(a.isHTMLForm(e)?new FormData(e):e);A.getAdapter=Ce.getAdapter;A.HttpStatusCode=Kt;A.default=A;var Pe=A;var{Axios:ki,AxiosError:Bi,CanceledError:Mi,isCancel:Hi,CancelToken:Ii,VERSION:qi,all:ji,Cancel:zi,isAxiosError:Wi,spread:$i,toFormData:Ji,AxiosHeaders:Vi,HttpStatusCode:Ki,formToJSON:Gi,getAdapter:Xi,mergeConfig:Qi}=Pe;var De=localStorage.getItem("api-mode"),Sn="http://127.0.0.1:8787",Tn="https://assembled-brands-dev.crystal-e8a.workers.dev",Cn="https://assembled-brands-prod.crystal-e8a.workers.dev",B={apiBaseUrl:De==="local"?Sn:De==="remote-dev"?Tn:Cn,apiVersion:"/api/v1",accessTokenPersistStrategy:"cookie",TOKEN_NAME_IN_STORAGE:"accessToken",TOKEN_TYPE:"Bearer",REQUEST_HEADER_AUTH_KEY:"Authorization"},W=(e,t=!1)=>{let r="";De==="local"&&!t?r=`/dev${e}`:De==="remote-dev"&&!t?r=`/dev${e}`:r=`/${e}`,window.location.assign(r)};var On=(e,t,r)=>{let n=new Date;n.setTime(n.getTime()+r*24*60*60*1e3);let o="expires="+n.toUTCString();document.cookie=`${e}=${encodeURIComponent(t)}; ${o}; path=/`},ot=e=>{let t=document.cookie.split("; ");for(let r of t){let[n,o]=r.split("=");if(n===e)return decodeURIComponent(o)}return null},st=e=>{On(e,"",-1)},Xt=()=>{let e=ot("accessToken");return e||W("/login?error=unauthorized",!1),e},Qt=()=>{st("accessToken"),W("/login?error=logged-out",!1)};var Ln=e=>{let t=B.accessTokenPersistStrategy;if(t==="localStorage"||t==="sessionStorage"||t==="cookie"){let n="";t==="localStorage"&&(n=localStorage.getItem(B.TOKEN_NAME_IN_STORAGE)||""),t==="sessionStorage"&&(n=sessionStorage.getItem(B.TOKEN_NAME_IN_STORAGE)||""),t==="cookie"&&(n=ot(B.TOKEN_NAME_IN_STORAGE)||""),n&&(e.headers[B.REQUEST_HEADER_AUTH_KEY]=`${B.TOKEN_TYPE} ${n}`)}let r=localStorage.getItem("team_id");return r&&(e.headers["X-Team-Id"]=r),e},Yt=Ln;var _n=[401,419,440],Pn=e=>{let{response:t}=e;if(window.location.pathname.includes("/login"))return Promise.reject(e);t&&_n.includes(t.status)&&(st("accessToken"),W("/login?error=unauthorized",!1))},Zt=Pn;var it=Pe.create({timeout:6e4,baseURL:B.apiBaseUrl+B.apiVersion});it.interceptors.request.use(e=>Yt(e),e=>Promise.reject(e));it.interceptors.response.use(e=>e,e=>(Zt(e),Promise.reject(e)));var er=it;var Dn={fetchDataWithAxios(e){return new Promise((t,r)=>{er(e).then(n=>{t(n.data)}).catch(n=>{let o="An unknown error occurred";if(n.response&&n.response.data){let i=n.response.data;typeof i.message=="string"?o=i.message:typeof i.error=="string"?o=i.error:o=JSON.stringify(i)}else n.message&&(o=n.message);r({...n,message:o})})})}},de=Dn;var tr=e=>de.fetchDataWithAxios({url:"/asset",method:"post",data:e});var rr=e=>de.fetchDataWithAxios({url:"/financial-wizard/document",method:"post",data:e}),nr=()=>de.fetchDataWithAxios({url:"/financial-wizard/progress",method:"get"});var T=(e,t=document)=>t.querySelector(e);var or=async()=>{try{let e=await nr(),t=e?.percentage||0,r=T('[dev-target="progress-percentage-fill"]'),n=T('[dev-target="progress-percentage-label"]'),o=T('[dev-target="logout"]');if(!r||!n||!o){console.error('Ensure [dev-target="progress-percentage-fill"], [dev-target="progress-percentage-label"], and [dev-target="logout"] are present.');return}return r.style.width=`${t}%`,n.textContent=`Progress ${t}%`,o.addEventListener("click",()=>{Qt()}),e}catch(e){console.error("Failed to load financial wizard progress:",e)}},sr=()=>{if(!T('[dev-target="sidebar-menu"]')){console.error('Ensure [dev-target="sidebar-menu"] is present.');return}let t=window.location.pathname,n={"/dev/finance-company-profile":{nav_attr:"nav-company-profile-link",nav_class:"is-active"},"/finance-company-profile":{nav_attr:"nav-company-profile-link",nav_class:"is-active"},"/dev/finance-financial-overview":{nav_attr:"nav-financial-overview-link",nav_class:"is-active"},"/finance-financial-overview":{nav_attr:"nav-financial-overview-link",nav_class:"is-active"},"/dev/finance-docs-financial-reports":{nav_attr:"nav-financial-reports-link",nav_class:"is-active-financial"},"/finance-docs-financial-reports":{nav_attr:"nav-financial-reports-link",nav_class:"is-active-financial"},"/dev/finance-docs-accounts-and-inventory":{nav_attr:"nav-accounts-inventory-link",nav_class:"is-active-financial"},"/finance-docs-accounts-and-inventory":{nav_attr:"nav-accounts-inventory-link",nav_class:"is-active-financial"},"/dev/finance-docs-ecommerce-performance":{nav_attr:"nav-eccomerce-performance-link",nav_class:"is-active-financial"},"/finance-docs-ecommerce-performance":{nav_attr:"nav-eccomerce-performance-link",nav_class:"is-active-financial"},"/dev/finance-docs-team-and-ownership":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"},"/finance-docs-team-and-ownership":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"}}[t];if(n){document.querySelectorAll('[dev-attr="nav"]').forEach(s=>{s.classList.remove("is-active"),s.classList.remove("is-active-financial")});let i=T(`[dev-target="${n.nav_attr}"]`);i&&i.classList.add(n.nav_class)}};var Fn=async()=>{sr(),Xt();let e=await or(),t=["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],r=document.querySelector('[dev-target="accounts-inventory-reports-form"]');if(!r){console.error('Accounts & Inventory form not found. Element: [dev-target="accounts-inventory-reports-form"] not found');return}let n=T('[dev-target="monthly-inventory-upload-box"]',r),o=T('[dev-target="monthly-inventory-input"]',r),i=T('[dev-target="balance-sheet-helper"]',r),s=T('[dev-target="accounts-receivable-upload-box"]',r),c=T('[dev-target="accounts-receivable-input"]',r),m=T('[dev-target="income-statement-helper"]',r),u=T('[dev-target="accounts-payable-upload-box"]',r),l=T('[dev-target="accounts-payable-input"]',r),h=T('[dev-target="income-forecast-helper"]',r),y=T('[dev-target="submit-button"]',r);if(!n||!o||!i){console.error('Ensure [dev-target="monthly-inventory-upload-box"] and [dev-target="monthly-inventory-input"] and [dev-target="balance-sheet-helper"] are present.');return}if(!s||!c||!m){console.error('Ensure [dev-target="accounts-receivable-upload-box"] and [dev-target="accounts-receivable-input"] and [dev-target="income-statement-helper"] are present.');return}if(!u||!l||!h){console.error('Ensure [dev-target="accounts-payable-upload-box"] and [dev-target="accounts-payable-input"] and [dev-target="income-forecast-helper"] are present.');return}if(!y){console.error('Ensure [dev-target="submit-button"] is present.');return}let x=(f,p)=>{if(f.files&&f.files.length>0){let E=f.files[0];if(!t.includes(E.type)){f.value="",p.textContent="Invalid file type. Please upload Excel (.xls or .xlsx) files only",p.classList.add("is-error");return}p.textContent=E.name,p.classList.remove("is-error")}else p.textContent="",p.classList.remove("is-error")};n&&o&&i&&(n.addEventListener("click",()=>o.click()),n.addEventListener("dragover",f=>{f.preventDefault(),n.classList.add("drag")}),n.addEventListener("dragleave",()=>{n.classList.remove("drag")}),n.addEventListener("drop",f=>{f.preventDefault(),n.classList.remove("drag"),f.dataTransfer&&f.dataTransfer.files.length>0&&(o.files=f.dataTransfer.files,x(o,i),o.dispatchEvent(new Event("change",{bubbles:!0})))}),o.addEventListener("change",()=>{x(o,i)})),s&&c&&m&&(s.addEventListener("click",()=>c.click()),s.addEventListener("dragover",f=>{f.preventDefault(),s.classList.add("drag")}),s.addEventListener("dragleave",()=>{s.classList.remove("drag")}),s.addEventListener("drop",f=>{f.preventDefault(),s.classList.remove("drag"),f.dataTransfer&&f.dataTransfer.files.length>0&&(c.files=f.dataTransfer.files,x(c,m),c.dispatchEvent(new Event("change",{bubbles:!0})))}),c.addEventListener("change",()=>{x(c,m)})),u&&l&&h&&(u.addEventListener("click",()=>l.click()),u.addEventListener("dragover",f=>{f.preventDefault(),u.classList.add("drag")}),u.addEventListener("dragleave",()=>{u.classList.remove("drag")}),u.addEventListener("drop",f=>{f.preventDefault(),u.classList.remove("drag"),f.dataTransfer&&f.dataTransfer.files.length>0&&(l.files=f.dataTransfer.files,x(l,h),l.dispatchEvent(new Event("change",{bubbles:!0})))}),l.addEventListener("change",()=>{x(l,h)}));let d=async(f,p)=>{if(!t.includes(f.type))throw new Error("Invalid file type. Please upload Excel (.xls or .xlsx) files only");let E={fileName:f.name,contentType:f.type,assetType:"document",fileSize:f.size,duration:0},v=await tr(E),b=v.asset.id,{presignedUrl:R}=v;if(!R)throw new Error("Presigned URL not received from server");await new Promise((M,C)=>{let _=new XMLHttpRequest;_.upload.addEventListener("progress",F=>{if(F.lengthComputable){let pe=Math.round(F.loaded/F.total*100);console.log(`Upload progress: ${pe}%`)}}),_.addEventListener("load",()=>{_.status>=200&&_.status<300?M():C(new Error("Failed to upload file to S3"))}),_.addEventListener("error",F=>{console.error(F),C(new Error("Network error during upload"))}),_.open("PUT",R),_.setRequestHeader("Content-Type",f.type),_.send(f)}),await rr({page:"accounts-inventory",document_type:p,asset_id:b})};if(r.addEventListener("submit",async f=>{f.preventDefault(),f.stopPropagation();let p=()=>{n?.classList.remove("is-error"),s?.classList.remove("is-error"),u?.classList.remove("is-error"),i?.classList.remove("is-error"),m?.classList.remove("is-error"),h?.classList.remove("is-error"),y.classList.remove("is-error"),y.value="UPLOAD DOCUMENTS"};o?.addEventListener("change",p,{once:!0}),c?.addEventListener("change",p,{once:!0}),l?.addEventListener("change",p,{once:!0});let E=[];if(o?.files&&o.files[0]){let b=o.files[0];t.includes(b.type)?E.push({file:b,documentType:"monthly_inventory_report"}):i?.classList.add("is-error")}if(c?.files&&c.files[0]){let b=c.files[0];t.includes(b.type)?E.push({file:b,documentType:"accounts_receivable_aging"}):m?.classList.add("is-error")}if(l?.files&&l.files[0]){let b=l.files[0];t.includes(b.type)?E.push({file:b,documentType:"accounts_payable_aging"}):h?.classList.add("is-error")}if(o?.files&&o.files[0]&&!t.includes(o.files[0].type)||c?.files&&c.files[0]&&!t.includes(c.files[0].type)||l?.files&&l.files[0]&&!t.includes(l.files[0].type)){y.classList.add("is-error"),y.value="Please upload only Excel (.xls or .xlsx) files";return}if(E.length===0){y.classList.add("is-error"),y.value="Please select at least one file to upload";return}try{y.disabled=!0,y.value="Uploading...",await Promise.all(E.map(({file:b,documentType:R})=>d(b,R))),y.classList.add("is-success"),y.value="Documents uploaded successfully!",o&&(o.value=""),c&&(c.value=""),l&&(l.value=""),i&&(i.textContent="",i.classList.remove("is-error")),m&&(m.textContent="",m.classList.remove("is-error")),h&&(h.textContent="",h.classList.remove("is-error")),setTimeout(()=>{y.classList.remove("is-success"),y.value="UPLOAD DOCUMENTS",y.disabled=!1,W("/finance-docs-ecommerce-performance")},900)}catch(b){let{message:R}=b;console.error(R),y.classList.add("is-error"),y.value=R||"There was a problem uploading the documents",y.disabled=!1}}),e?.accounts_inventory){let f=e.accounts_inventory.find(v=>v.document_type==="monthly_inventory_report");f&&(i.textContent=f.asset_name||"");let p=e.accounts_inventory.find(v=>v.document_type==="accounts_receivable_aging");p&&(m.textContent=p.asset_name||"");let E=e.accounts_inventory.find(v=>v.document_type==="accounts_payable_aging");E&&(h.textContent=E.asset_name||"")}};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{Fn()});
|