PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.0
Elementor Website Builder – more than just a page builder v4.3.0
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
elementor / assets / js / packages / http-client / http-client.js

http-client.js in Elementor Website Builder – more than just a page builder 4.3.0, at assets/js/packages/http-client/http-client.js

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