fdb2 1.0.18 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4873 +0,0 @@
1
- import { a as __toESM, i as __require, n as __esmMin, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime.js";
2
- import { $ as toDisplayString, C as createTextVNode, D as hasInjectionContext, E as getCurrentInstance, F as renderSlot, G as markRaw, H as getCurrentScope, J as ref, K as onScopeDispose, L as resolveDynamicComponent, M as onUnmounted, N as openBlock, O as inject, P as renderList, Q as normalizeStyle, R as watch, T as defineComponent, U as isReactive, V as effectScope, W as isRef, X as toRefs, Y as toRaw, Z as normalizeClass, _ as createBaseVNode, b as createElementBlock, c as init_vue_runtime_esm_bundler, g as computed, h as Fragment, j as onMounted, k as nextTick, l as createApp, m as withModifiers, q as reactive, v as createBlock, w as createVNode, y as createCommentVNode } from "./vue.js";
3
- import { n as init__plugin_vue_export_helper, t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
4
- import { n as init_bootstrap_esm, t as Modal } from "./bootstrap.js";
5
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/bind.js
6
- /**
7
- * Create a bound version of a function with a specified `this` context
8
- *
9
- * @param {Function} fn - The function to bind
10
- * @param {*} thisArg - The value to be passed as the `this` parameter
11
- * @returns {Function} A new function that will call the original function with the specified `this` context
12
- */
13
- function bind(fn, thisArg) {
14
- return function wrap() {
15
- return fn.apply(thisArg, arguments);
16
- };
17
- }
18
- var init_bind = __esmMin((() => {}));
19
- //#endregion
20
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/utils.js
21
- /**
22
- * Determine if a value is a Buffer
23
- *
24
- * @param {*} val The value to test
25
- *
26
- * @returns {boolean} True if value is a Buffer, otherwise false
27
- */
28
- function isBuffer(val) {
29
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
30
- }
31
- /**
32
- * Determine if a value is a view on an ArrayBuffer
33
- *
34
- * @param {*} val The value to test
35
- *
36
- * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
37
- */
38
- function isArrayBufferView(val) {
39
- let result;
40
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) result = ArrayBuffer.isView(val);
41
- else result = val && val.buffer && isArrayBuffer(val.buffer);
42
- return result;
43
- }
44
- /**
45
- * Determine if a value is a FormData
46
- *
47
- * @param {*} thing The value to test
48
- *
49
- * @returns {boolean} True if value is an FormData, otherwise false
50
- */
51
- function getGlobal() {
52
- if (typeof globalThis !== "undefined") return globalThis;
53
- if (typeof self !== "undefined") return self;
54
- if (typeof window !== "undefined") return window;
55
- if (typeof global !== "undefined") return global;
56
- return {};
57
- }
58
- /**
59
- * Iterate over an Array or an Object invoking a function for each item.
60
- *
61
- * If `obj` is an Array callback will be called passing
62
- * the value, index, and complete array for each item.
63
- *
64
- * If 'obj' is an Object callback will be called passing
65
- * the value, key, and complete object for each property.
66
- *
67
- * @param {Object|Array<unknown>} obj The object to iterate
68
- * @param {Function} fn The callback to invoke for each item
69
- *
70
- * @param {Object} [options]
71
- * @param {Boolean} [options.allOwnKeys = false]
72
- * @returns {any}
73
- */
74
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
75
- if (obj === null || typeof obj === "undefined") return;
76
- let i;
77
- let l;
78
- if (typeof obj !== "object") obj = [obj];
79
- if (isArray(obj)) for (i = 0, l = obj.length; i < l; i++) fn.call(null, obj[i], i, obj);
80
- else {
81
- if (isBuffer(obj)) return;
82
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
83
- const len = keys.length;
84
- let key;
85
- for (i = 0; i < len; i++) {
86
- key = keys[i];
87
- fn.call(null, obj[key], key, obj);
88
- }
89
- }
90
- }
91
- /**
92
- * Finds a key in an object, case-insensitive, returning the actual key name.
93
- * Returns null if the object is a Buffer or if no match is found.
94
- *
95
- * @param {Object} obj - The object to search.
96
- * @param {string} key - The key to find (case-insensitive).
97
- * @returns {?string} The actual key name if found, otherwise null.
98
- */
99
- function findKey(obj, key) {
100
- if (isBuffer(obj)) return null;
101
- key = key.toLowerCase();
102
- const keys = Object.keys(obj);
103
- let i = keys.length;
104
- let _key;
105
- while (i-- > 0) {
106
- _key = keys[i];
107
- if (key === _key.toLowerCase()) return _key;
108
- }
109
- return null;
110
- }
111
- /**
112
- * Accepts varargs expecting each argument to be an object, then
113
- * immutably merges the properties of each object and returns result.
114
- *
115
- * When multiple objects contain the same key the later object in
116
- * the arguments list will take precedence.
117
- *
118
- * Example:
119
- *
120
- * ```js
121
- * const result = merge({foo: 123}, {foo: 456});
122
- * console.log(result.foo); // outputs 456
123
- * ```
124
- *
125
- * @param {Object} obj1 Object to merge
126
- *
127
- * @returns {Object} Result of all merge properties
128
- */
129
- function merge() {
130
- const { caseless, skipUndefined } = isContextDefined(this) && this || {};
131
- const result = {};
132
- const assignValue = (val, key) => {
133
- if (key === "__proto__" || key === "constructor" || key === "prototype") return;
134
- const targetKey = caseless && findKey(result, key) || key;
135
- if (isPlainObject$1(result[targetKey]) && isPlainObject$1(val)) result[targetKey] = merge(result[targetKey], val);
136
- else if (isPlainObject$1(val)) result[targetKey] = merge({}, val);
137
- else if (isArray(val)) result[targetKey] = val.slice();
138
- else if (!skipUndefined || !isUndefined(val)) result[targetKey] = val;
139
- };
140
- for (let i = 0, l = arguments.length; i < l; i++) arguments[i] && forEach(arguments[i], assignValue);
141
- return result;
142
- }
143
- /**
144
- * If the thing is a FormData object, return true, otherwise return false.
145
- *
146
- * @param {unknown} thing - The thing to check.
147
- *
148
- * @returns {boolean}
149
- */
150
- function isSpecCompliantForm(thing) {
151
- return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
152
- }
153
- var toString, getPrototypeOf, iterator, toStringTag, kindOf, kindOfTest, typeOfTest, isArray, isUndefined, isArrayBuffer, isString, isFunction$1, isNumber, isObject, isBoolean, isPlainObject$1, isEmptyObject, isDate, isFile, isReactNativeBlob, isReactNative, isBlob, isFileList, isStream, G, FormDataCtor, isFormData, isURLSearchParams, isReadableStream, isRequest, isResponse, isHeaders, trim, _global$1, isContextDefined, extend, stripBOM, inherits, toFlatObject, endsWith, toArray, isTypedArray, forEachEntry, matchAll, isHTMLForm, toCamelCase, hasOwnProperty, isRegExp, reduceDescriptors, freezeMethods, toObjectSet, noop$1, toFiniteNumber, toJSONObject, isAsyncFn, isThenable, _setImmediate, asap, isIterable, utils_default;
154
- var init_utils$1 = __esmMin((() => {
155
- init_bind();
156
- ({toString} = Object.prototype);
157
- ({getPrototypeOf} = Object);
158
- ({iterator, toStringTag} = Symbol);
159
- kindOf = ((cache) => (thing) => {
160
- const str = toString.call(thing);
161
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
162
- })(Object.create(null));
163
- kindOfTest = (type) => {
164
- type = type.toLowerCase();
165
- return (thing) => kindOf(thing) === type;
166
- };
167
- typeOfTest = (type) => (thing) => typeof thing === type;
168
- ({isArray} = Array);
169
- isUndefined = typeOfTest("undefined");
170
- isArrayBuffer = kindOfTest("ArrayBuffer");
171
- isString = typeOfTest("string");
172
- isFunction$1 = typeOfTest("function");
173
- isNumber = typeOfTest("number");
174
- isObject = (thing) => thing !== null && typeof thing === "object";
175
- isBoolean = (thing) => thing === true || thing === false;
176
- isPlainObject$1 = (val) => {
177
- if (kindOf(val) !== "object") return false;
178
- const prototype = getPrototypeOf(val);
179
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
180
- };
181
- isEmptyObject = (val) => {
182
- if (!isObject(val) || isBuffer(val)) return false;
183
- try {
184
- return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
185
- } catch (e) {
186
- return false;
187
- }
188
- };
189
- isDate = kindOfTest("Date");
190
- isFile = kindOfTest("File");
191
- isReactNativeBlob = (value) => {
192
- return !!(value && typeof value.uri !== "undefined");
193
- };
194
- isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
195
- isBlob = kindOfTest("Blob");
196
- isFileList = kindOfTest("FileList");
197
- isStream = (val) => isObject(val) && isFunction$1(val.pipe);
198
- G = getGlobal();
199
- FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
200
- isFormData = (thing) => {
201
- let kind;
202
- return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
203
- };
204
- isURLSearchParams = kindOfTest("URLSearchParams");
205
- [isReadableStream, isRequest, isResponse, isHeaders] = [
206
- "ReadableStream",
207
- "Request",
208
- "Response",
209
- "Headers"
210
- ].map(kindOfTest);
211
- trim = (str) => {
212
- return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
213
- };
214
- _global$1 = (() => {
215
- if (typeof globalThis !== "undefined") return globalThis;
216
- return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
217
- })();
218
- isContextDefined = (context) => !isUndefined(context) && context !== _global$1;
219
- extend = (a, b, thisArg, { allOwnKeys } = {}) => {
220
- forEach(b, (val, key) => {
221
- if (thisArg && isFunction$1(val)) Object.defineProperty(a, key, {
222
- value: bind(val, thisArg),
223
- writable: true,
224
- enumerable: true,
225
- configurable: true
226
- });
227
- else Object.defineProperty(a, key, {
228
- value: val,
229
- writable: true,
230
- enumerable: true,
231
- configurable: true
232
- });
233
- }, { allOwnKeys });
234
- return a;
235
- };
236
- stripBOM = (content) => {
237
- if (content.charCodeAt(0) === 65279) content = content.slice(1);
238
- return content;
239
- };
240
- inherits = (constructor, superConstructor, props, descriptors) => {
241
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
242
- Object.defineProperty(constructor.prototype, "constructor", {
243
- value: constructor,
244
- writable: true,
245
- enumerable: false,
246
- configurable: true
247
- });
248
- Object.defineProperty(constructor, "super", { value: superConstructor.prototype });
249
- props && Object.assign(constructor.prototype, props);
250
- };
251
- toFlatObject = (sourceObj, destObj, filter, propFilter) => {
252
- let props;
253
- let i;
254
- let prop;
255
- const merged = {};
256
- destObj = destObj || {};
257
- if (sourceObj == null) return destObj;
258
- do {
259
- props = Object.getOwnPropertyNames(sourceObj);
260
- i = props.length;
261
- while (i-- > 0) {
262
- prop = props[i];
263
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
264
- destObj[prop] = sourceObj[prop];
265
- merged[prop] = true;
266
- }
267
- }
268
- sourceObj = filter !== false && getPrototypeOf(sourceObj);
269
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
270
- return destObj;
271
- };
272
- endsWith = (str, searchString, position) => {
273
- str = String(str);
274
- if (position === void 0 || position > str.length) position = str.length;
275
- position -= searchString.length;
276
- const lastIndex = str.indexOf(searchString, position);
277
- return lastIndex !== -1 && lastIndex === position;
278
- };
279
- toArray = (thing) => {
280
- if (!thing) return null;
281
- if (isArray(thing)) return thing;
282
- let i = thing.length;
283
- if (!isNumber(i)) return null;
284
- const arr = new Array(i);
285
- while (i-- > 0) arr[i] = thing[i];
286
- return arr;
287
- };
288
- isTypedArray = ((TypedArray) => {
289
- return (thing) => {
290
- return TypedArray && thing instanceof TypedArray;
291
- };
292
- })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
293
- forEachEntry = (obj, fn) => {
294
- const _iterator = (obj && obj[iterator]).call(obj);
295
- let result;
296
- while ((result = _iterator.next()) && !result.done) {
297
- const pair = result.value;
298
- fn.call(obj, pair[0], pair[1]);
299
- }
300
- };
301
- matchAll = (regExp, str) => {
302
- let matches;
303
- const arr = [];
304
- while ((matches = regExp.exec(str)) !== null) arr.push(matches);
305
- return arr;
306
- };
307
- isHTMLForm = kindOfTest("HTMLFormElement");
308
- toCamelCase = (str) => {
309
- return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
310
- return p1.toUpperCase() + p2;
311
- });
312
- };
313
- hasOwnProperty = (({ hasOwnProperty }) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
314
- isRegExp = kindOfTest("RegExp");
315
- reduceDescriptors = (obj, reducer) => {
316
- const descriptors = Object.getOwnPropertyDescriptors(obj);
317
- const reducedDescriptors = {};
318
- forEach(descriptors, (descriptor, name) => {
319
- let ret;
320
- if ((ret = reducer(descriptor, name, obj)) !== false) reducedDescriptors[name] = ret || descriptor;
321
- });
322
- Object.defineProperties(obj, reducedDescriptors);
323
- };
324
- freezeMethods = (obj) => {
325
- reduceDescriptors(obj, (descriptor, name) => {
326
- if (isFunction$1(obj) && [
327
- "arguments",
328
- "caller",
329
- "callee"
330
- ].indexOf(name) !== -1) return false;
331
- const value = obj[name];
332
- if (!isFunction$1(value)) return;
333
- descriptor.enumerable = false;
334
- if ("writable" in descriptor) {
335
- descriptor.writable = false;
336
- return;
337
- }
338
- if (!descriptor.set) descriptor.set = () => {
339
- throw Error("Can not rewrite read-only method '" + name + "'");
340
- };
341
- });
342
- };
343
- toObjectSet = (arrayOrString, delimiter) => {
344
- const obj = {};
345
- const define = (arr) => {
346
- arr.forEach((value) => {
347
- obj[value] = true;
348
- });
349
- };
350
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
351
- return obj;
352
- };
353
- noop$1 = () => {};
354
- toFiniteNumber = (value, defaultValue) => {
355
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
356
- };
357
- toJSONObject = (obj) => {
358
- const stack = new Array(10);
359
- const visit = (source, i) => {
360
- if (isObject(source)) {
361
- if (stack.indexOf(source) >= 0) return;
362
- if (isBuffer(source)) return source;
363
- if (!("toJSON" in source)) {
364
- stack[i] = source;
365
- const target = isArray(source) ? [] : {};
366
- forEach(source, (value, key) => {
367
- const reducedValue = visit(value, i + 1);
368
- !isUndefined(reducedValue) && (target[key] = reducedValue);
369
- });
370
- stack[i] = void 0;
371
- return target;
372
- }
373
- }
374
- return source;
375
- };
376
- return visit(obj, 0);
377
- };
378
- isAsyncFn = kindOfTest("AsyncFunction");
379
- isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
380
- _setImmediate = ((setImmediateSupported, postMessageSupported) => {
381
- if (setImmediateSupported) return setImmediate;
382
- return postMessageSupported ? ((token, callbacks) => {
383
- _global$1.addEventListener("message", ({ source, data }) => {
384
- if (source === _global$1 && data === token) callbacks.length && callbacks.shift()();
385
- }, false);
386
- return (cb) => {
387
- callbacks.push(cb);
388
- _global$1.postMessage(token, "*");
389
- };
390
- })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
391
- })(typeof setImmediate === "function", isFunction$1(_global$1.postMessage));
392
- asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global$1) : typeof process !== "undefined" && process.nextTick || _setImmediate;
393
- isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
394
- utils_default = {
395
- isArray,
396
- isArrayBuffer,
397
- isBuffer,
398
- isFormData,
399
- isArrayBufferView,
400
- isString,
401
- isNumber,
402
- isBoolean,
403
- isObject,
404
- isPlainObject: isPlainObject$1,
405
- isEmptyObject,
406
- isReadableStream,
407
- isRequest,
408
- isResponse,
409
- isHeaders,
410
- isUndefined,
411
- isDate,
412
- isFile,
413
- isReactNativeBlob,
414
- isReactNative,
415
- isBlob,
416
- isRegExp,
417
- isFunction: isFunction$1,
418
- isStream,
419
- isURLSearchParams,
420
- isTypedArray,
421
- isFileList,
422
- forEach,
423
- merge,
424
- extend,
425
- trim,
426
- stripBOM,
427
- inherits,
428
- toFlatObject,
429
- kindOf,
430
- kindOfTest,
431
- endsWith,
432
- toArray,
433
- forEachEntry,
434
- matchAll,
435
- isHTMLForm,
436
- hasOwnProperty,
437
- hasOwnProp: hasOwnProperty,
438
- reduceDescriptors,
439
- freezeMethods,
440
- toObjectSet,
441
- toCamelCase,
442
- noop: noop$1,
443
- toFiniteNumber,
444
- findKey,
445
- global: _global$1,
446
- isContextDefined,
447
- isSpecCompliantForm,
448
- toJSONObject,
449
- isAsyncFn,
450
- isThenable,
451
- setImmediate: _setImmediate,
452
- asap,
453
- isIterable
454
- };
455
- }));
456
- //#endregion
457
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/AxiosError.js
458
- var AxiosError$1;
459
- var init_AxiosError = __esmMin((() => {
460
- init_utils$1();
461
- AxiosError$1 = class AxiosError$1 extends Error {
462
- static from(error, code, config, request, response, customProps) {
463
- const axiosError = new AxiosError$1(error.message, code || error.code, config, request, response);
464
- axiosError.cause = error;
465
- axiosError.name = error.name;
466
- if (error.status != null && axiosError.status == null) axiosError.status = error.status;
467
- customProps && Object.assign(axiosError, customProps);
468
- return axiosError;
469
- }
470
- /**
471
- * Create an Error with the specified message, config, error code, request and response.
472
- *
473
- * @param {string} message The error message.
474
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
475
- * @param {Object} [config] The config.
476
- * @param {Object} [request] The request.
477
- * @param {Object} [response] The response.
478
- *
479
- * @returns {Error} The created error.
480
- */
481
- constructor(message, code, config, request, response) {
482
- super(message);
483
- Object.defineProperty(this, "message", {
484
- value: message,
485
- enumerable: true,
486
- writable: true,
487
- configurable: true
488
- });
489
- this.name = "AxiosError";
490
- this.isAxiosError = true;
491
- code && (this.code = code);
492
- config && (this.config = config);
493
- request && (this.request = request);
494
- if (response) {
495
- this.response = response;
496
- this.status = response.status;
497
- }
498
- }
499
- toJSON() {
500
- return {
501
- message: this.message,
502
- name: this.name,
503
- description: this.description,
504
- number: this.number,
505
- fileName: this.fileName,
506
- lineNumber: this.lineNumber,
507
- columnNumber: this.columnNumber,
508
- stack: this.stack,
509
- config: utils_default.toJSONObject(this.config),
510
- code: this.code,
511
- status: this.status
512
- };
513
- }
514
- };
515
- AxiosError$1.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
516
- AxiosError$1.ERR_BAD_OPTION = "ERR_BAD_OPTION";
517
- AxiosError$1.ECONNABORTED = "ECONNABORTED";
518
- AxiosError$1.ETIMEDOUT = "ETIMEDOUT";
519
- AxiosError$1.ERR_NETWORK = "ERR_NETWORK";
520
- AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
521
- AxiosError$1.ERR_DEPRECATED = "ERR_DEPRECATED";
522
- AxiosError$1.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
523
- AxiosError$1.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
524
- AxiosError$1.ERR_CANCELED = "ERR_CANCELED";
525
- AxiosError$1.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
526
- AxiosError$1.ERR_INVALID_URL = "ERR_INVALID_URL";
527
- }));
528
- //#endregion
529
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/null.js
530
- var init_null = __esmMin((() => {}));
531
- //#endregion
532
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/toFormData.js
533
- /**
534
- * Determines if the given thing is a array or js object.
535
- *
536
- * @param {string} thing - The object or array to be visited.
537
- *
538
- * @returns {boolean}
539
- */
540
- function isVisitable(thing) {
541
- return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
542
- }
543
- /**
544
- * It removes the brackets from the end of a string
545
- *
546
- * @param {string} key - The key of the parameter.
547
- *
548
- * @returns {string} the key without the brackets.
549
- */
550
- function removeBrackets(key) {
551
- return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
552
- }
553
- /**
554
- * It takes a path, a key, and a boolean, and returns a string
555
- *
556
- * @param {string} path - The path to the current key.
557
- * @param {string} key - The key of the current object being iterated over.
558
- * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
559
- *
560
- * @returns {string} The path to the current key.
561
- */
562
- function renderKey(path, key, dots) {
563
- if (!path) return key;
564
- return path.concat(key).map(function each(token, i) {
565
- token = removeBrackets(token);
566
- return !dots && i ? "[" + token + "]" : token;
567
- }).join(dots ? "." : "");
568
- }
569
- /**
570
- * If the array is an array and none of its elements are visitable, then it's a flat array.
571
- *
572
- * @param {Array<any>} arr - The array to check
573
- *
574
- * @returns {boolean}
575
- */
576
- function isFlatArray(arr) {
577
- return utils_default.isArray(arr) && !arr.some(isVisitable);
578
- }
579
- /**
580
- * Convert a data object to FormData
581
- *
582
- * @param {Object} obj
583
- * @param {?Object} [formData]
584
- * @param {?Object} [options]
585
- * @param {Function} [options.visitor]
586
- * @param {Boolean} [options.metaTokens = true]
587
- * @param {Boolean} [options.dots = false]
588
- * @param {?Boolean} [options.indexes = false]
589
- *
590
- * @returns {Object}
591
- **/
592
- /**
593
- * It converts an object into a FormData object
594
- *
595
- * @param {Object<any, any>} obj - The object to convert to form data.
596
- * @param {string} formData - The FormData object to append to.
597
- * @param {Object<string, any>} options
598
- *
599
- * @returns
600
- */
601
- function toFormData$1(obj, formData, options) {
602
- if (!utils_default.isObject(obj)) throw new TypeError("target must be an object");
603
- formData = formData || new FormData();
604
- options = utils_default.toFlatObject(options, {
605
- metaTokens: true,
606
- dots: false,
607
- indexes: false
608
- }, false, function defined(option, source) {
609
- return !utils_default.isUndefined(source[option]);
610
- });
611
- const metaTokens = options.metaTokens;
612
- const visitor = options.visitor || defaultVisitor;
613
- const dots = options.dots;
614
- const indexes = options.indexes;
615
- const useBlob = (options.Blob || typeof Blob !== "undefined" && Blob) && utils_default.isSpecCompliantForm(formData);
616
- if (!utils_default.isFunction(visitor)) throw new TypeError("visitor must be a function");
617
- function convertValue(value) {
618
- if (value === null) return "";
619
- if (utils_default.isDate(value)) return value.toISOString();
620
- if (utils_default.isBoolean(value)) return value.toString();
621
- if (!useBlob && utils_default.isBlob(value)) throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
622
- if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
623
- return value;
624
- }
625
- /**
626
- * Default visitor.
627
- *
628
- * @param {*} value
629
- * @param {String|Number} key
630
- * @param {Array<String|Number>} path
631
- * @this {FormData}
632
- *
633
- * @returns {boolean} return true to visit the each prop of the value recursively
634
- */
635
- function defaultVisitor(value, key, path) {
636
- let arr = value;
637
- if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) {
638
- formData.append(renderKey(path, key, dots), convertValue(value));
639
- return false;
640
- }
641
- if (value && !path && typeof value === "object") {
642
- if (utils_default.endsWith(key, "{}")) {
643
- key = metaTokens ? key : key.slice(0, -2);
644
- value = JSON.stringify(value);
645
- } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
646
- key = removeBrackets(key);
647
- arr.forEach(function each(el, index) {
648
- !(utils_default.isUndefined(el) || el === null) && formData.append(indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", convertValue(el));
649
- });
650
- return false;
651
- }
652
- }
653
- if (isVisitable(value)) return true;
654
- formData.append(renderKey(path, key, dots), convertValue(value));
655
- return false;
656
- }
657
- const stack = [];
658
- const exposedHelpers = Object.assign(predicates, {
659
- defaultVisitor,
660
- convertValue,
661
- isVisitable
662
- });
663
- function build(value, path) {
664
- if (utils_default.isUndefined(value)) return;
665
- if (stack.indexOf(value) !== -1) throw Error("Circular reference detected in " + path.join("."));
666
- stack.push(value);
667
- utils_default.forEach(value, function each(el, key) {
668
- 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]);
669
- });
670
- stack.pop();
671
- }
672
- if (!utils_default.isObject(obj)) throw new TypeError("data must be an object");
673
- build(obj);
674
- return formData;
675
- }
676
- var predicates;
677
- var init_toFormData = __esmMin((() => {
678
- init_utils$1();
679
- init_AxiosError();
680
- init_null();
681
- predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
682
- return /^is[A-Z]/.test(prop);
683
- });
684
- }));
685
- //#endregion
686
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
687
- /**
688
- * It encodes a string by replacing all characters that are not in the unreserved set with
689
- * their percent-encoded equivalents
690
- *
691
- * @param {string} str - The string to encode.
692
- *
693
- * @returns {string} The encoded string.
694
- */
695
- function encode$1(str) {
696
- const charMap = {
697
- "!": "%21",
698
- "'": "%27",
699
- "(": "%28",
700
- ")": "%29",
701
- "~": "%7E",
702
- "%20": "+",
703
- "%00": "\0"
704
- };
705
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
706
- return charMap[match];
707
- });
708
- }
709
- /**
710
- * It takes a params object and converts it to a FormData object
711
- *
712
- * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
713
- * @param {Object<string, any>} options - The options object passed to the Axios constructor.
714
- *
715
- * @returns {void}
716
- */
717
- function AxiosURLSearchParams(params, options) {
718
- this._pairs = [];
719
- params && toFormData$1(params, this, options);
720
- }
721
- var prototype;
722
- var init_AxiosURLSearchParams = __esmMin((() => {
723
- init_toFormData();
724
- prototype = AxiosURLSearchParams.prototype;
725
- prototype.append = function append(name, value) {
726
- this._pairs.push([name, value]);
727
- };
728
- prototype.toString = function toString(encoder) {
729
- const _encode = encoder ? function(value) {
730
- return encoder.call(this, value, encode$1);
731
- } : encode$1;
732
- return this._pairs.map(function each(pair) {
733
- return _encode(pair[0]) + "=" + _encode(pair[1]);
734
- }, "").join("&");
735
- };
736
- }));
737
- //#endregion
738
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/buildURL.js
739
- /**
740
- * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
741
- * their plain counterparts (`:`, `$`, `,`, `+`).
742
- *
743
- * @param {string} val The value to be encoded.
744
- *
745
- * @returns {string} The encoded value.
746
- */
747
- function encode(val) {
748
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
749
- }
750
- /**
751
- * Build a URL by appending params to the end
752
- *
753
- * @param {string} url The base of the url (e.g., http://www.google.com)
754
- * @param {object} [params] The params to be appended
755
- * @param {?(object|Function)} options
756
- *
757
- * @returns {string} The formatted url
758
- */
759
- function buildURL(url, params, options) {
760
- if (!params) return url;
761
- const _encode = options && options.encode || encode;
762
- const _options = utils_default.isFunction(options) ? { serialize: options } : options;
763
- const serializeFn = _options && _options.serialize;
764
- let serializedParams;
765
- if (serializeFn) serializedParams = serializeFn(params, _options);
766
- else serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
767
- if (serializedParams) {
768
- const hashmarkIndex = url.indexOf("#");
769
- if (hashmarkIndex !== -1) url = url.slice(0, hashmarkIndex);
770
- url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
771
- }
772
- return url;
773
- }
774
- var init_buildURL = __esmMin((() => {
775
- init_utils$1();
776
- init_AxiosURLSearchParams();
777
- }));
778
- //#endregion
779
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/InterceptorManager.js
780
- var InterceptorManager;
781
- var init_InterceptorManager = __esmMin((() => {
782
- init_utils$1();
783
- InterceptorManager = class {
784
- constructor() {
785
- this.handlers = [];
786
- }
787
- /**
788
- * Add a new interceptor to the stack
789
- *
790
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
791
- * @param {Function} rejected The function to handle `reject` for a `Promise`
792
- * @param {Object} options The options for the interceptor, synchronous and runWhen
793
- *
794
- * @return {Number} An ID used to remove interceptor later
795
- */
796
- use(fulfilled, rejected, options) {
797
- this.handlers.push({
798
- fulfilled,
799
- rejected,
800
- synchronous: options ? options.synchronous : false,
801
- runWhen: options ? options.runWhen : null
802
- });
803
- return this.handlers.length - 1;
804
- }
805
- /**
806
- * Remove an interceptor from the stack
807
- *
808
- * @param {Number} id The ID that was returned by `use`
809
- *
810
- * @returns {void}
811
- */
812
- eject(id) {
813
- if (this.handlers[id]) this.handlers[id] = null;
814
- }
815
- /**
816
- * Clear all interceptors from the stack
817
- *
818
- * @returns {void}
819
- */
820
- clear() {
821
- if (this.handlers) this.handlers = [];
822
- }
823
- /**
824
- * Iterate over all the registered interceptors
825
- *
826
- * This method is particularly useful for skipping over any
827
- * interceptors that may have become `null` calling `eject`.
828
- *
829
- * @param {Function} fn The function to call for each interceptor
830
- *
831
- * @returns {void}
832
- */
833
- forEach(fn) {
834
- utils_default.forEach(this.handlers, function forEachHandler(h) {
835
- if (h !== null) fn(h);
836
- });
837
- }
838
- };
839
- }));
840
- //#endregion
841
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/defaults/transitional.js
842
- var transitional_default;
843
- var init_transitional = __esmMin((() => {
844
- transitional_default = {
845
- silentJSONParsing: true,
846
- forcedJSONParsing: true,
847
- clarifyTimeoutError: false,
848
- legacyInterceptorReqResOrdering: true
849
- };
850
- }));
851
- //#endregion
852
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
853
- var URLSearchParams_default;
854
- var init_URLSearchParams = __esmMin((() => {
855
- init_AxiosURLSearchParams();
856
- URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
857
- }));
858
- //#endregion
859
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/browser/classes/FormData.js
860
- var FormData_default;
861
- var init_FormData = __esmMin((() => {
862
- FormData_default = typeof FormData !== "undefined" ? FormData : null;
863
- }));
864
- //#endregion
865
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/browser/classes/Blob.js
866
- var Blob_default;
867
- var init_Blob = __esmMin((() => {
868
- Blob_default = typeof Blob !== "undefined" ? Blob : null;
869
- }));
870
- //#endregion
871
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/browser/index.js
872
- var browser_default;
873
- var init_browser = __esmMin((() => {
874
- init_URLSearchParams();
875
- init_FormData();
876
- init_Blob();
877
- browser_default = {
878
- isBrowser: true,
879
- classes: {
880
- URLSearchParams: URLSearchParams_default,
881
- FormData: FormData_default,
882
- Blob: Blob_default
883
- },
884
- protocols: [
885
- "http",
886
- "https",
887
- "file",
888
- "blob",
889
- "url",
890
- "data"
891
- ]
892
- };
893
- }));
894
- //#endregion
895
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/common/utils.js
896
- var utils_exports = /* @__PURE__ */ __exportAll({
897
- hasBrowserEnv: () => hasBrowserEnv,
898
- hasStandardBrowserEnv: () => hasStandardBrowserEnv,
899
- hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
900
- navigator: () => _navigator$1,
901
- origin: () => origin
902
- });
903
- var hasBrowserEnv, _navigator$1, hasStandardBrowserEnv, hasStandardBrowserWebWorkerEnv, origin;
904
- var init_utils = __esmMin((() => {
905
- hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
906
- _navigator$1 = typeof navigator === "object" && navigator || void 0;
907
- hasStandardBrowserEnv = hasBrowserEnv && (!_navigator$1 || [
908
- "ReactNative",
909
- "NativeScript",
910
- "NS"
911
- ].indexOf(_navigator$1.product) < 0);
912
- hasStandardBrowserWebWorkerEnv = typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
913
- origin = hasBrowserEnv && window.location.href || "http://localhost";
914
- }));
915
- //#endregion
916
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/index.js
917
- var platform_default;
918
- var init_platform = __esmMin((() => {
919
- init_browser();
920
- init_utils();
921
- platform_default = {
922
- ...utils_exports,
923
- ...browser_default
924
- };
925
- }));
926
- //#endregion
927
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/toURLEncodedForm.js
928
- function toURLEncodedForm(data, options) {
929
- return toFormData$1(data, new platform_default.classes.URLSearchParams(), {
930
- visitor: function(value, key, path, helpers) {
931
- if (platform_default.isNode && utils_default.isBuffer(value)) {
932
- this.append(key, value.toString("base64"));
933
- return false;
934
- }
935
- return helpers.defaultVisitor.apply(this, arguments);
936
- },
937
- ...options
938
- });
939
- }
940
- var init_toURLEncodedForm = __esmMin((() => {
941
- init_utils$1();
942
- init_toFormData();
943
- init_platform();
944
- }));
945
- //#endregion
946
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/formDataToJSON.js
947
- /**
948
- * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
949
- *
950
- * @param {string} name - The name of the property to get.
951
- *
952
- * @returns An array of strings.
953
- */
954
- function parsePropPath(name) {
955
- return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
956
- return match[0] === "[]" ? "" : match[1] || match[0];
957
- });
958
- }
959
- /**
960
- * Convert an array to an object.
961
- *
962
- * @param {Array<any>} arr - The array to convert to an object.
963
- *
964
- * @returns An object with the same keys and values as the array.
965
- */
966
- function arrayToObject(arr) {
967
- const obj = {};
968
- const keys = Object.keys(arr);
969
- let i;
970
- const len = keys.length;
971
- let key;
972
- for (i = 0; i < len; i++) {
973
- key = keys[i];
974
- obj[key] = arr[key];
975
- }
976
- return obj;
977
- }
978
- /**
979
- * It takes a FormData object and returns a JavaScript object
980
- *
981
- * @param {string} formData The FormData object to convert to JSON.
982
- *
983
- * @returns {Object<string, any> | null} The converted object.
984
- */
985
- function formDataToJSON(formData) {
986
- function buildPath(path, value, target, index) {
987
- let name = path[index++];
988
- if (name === "__proto__") return true;
989
- const isNumericKey = Number.isFinite(+name);
990
- const isLast = index >= path.length;
991
- name = !name && utils_default.isArray(target) ? target.length : name;
992
- if (isLast) {
993
- if (utils_default.hasOwnProp(target, name)) target[name] = [target[name], value];
994
- else target[name] = value;
995
- return !isNumericKey;
996
- }
997
- if (!target[name] || !utils_default.isObject(target[name])) target[name] = [];
998
- if (buildPath(path, value, target[name], index) && utils_default.isArray(target[name])) target[name] = arrayToObject(target[name]);
999
- return !isNumericKey;
1000
- }
1001
- if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
1002
- const obj = {};
1003
- utils_default.forEachEntry(formData, (name, value) => {
1004
- buildPath(parsePropPath(name), value, obj, 0);
1005
- });
1006
- return obj;
1007
- }
1008
- return null;
1009
- }
1010
- var init_formDataToJSON = __esmMin((() => {
1011
- init_utils$1();
1012
- }));
1013
- //#endregion
1014
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/defaults/index.js
1015
- /**
1016
- * It takes a string, tries to parse it, and if it fails, it returns the stringified version
1017
- * of the input
1018
- *
1019
- * @param {any} rawValue - The value to be stringified.
1020
- * @param {Function} parser - A function that parses a string into a JavaScript object.
1021
- * @param {Function} encoder - A function that takes a value and returns a string.
1022
- *
1023
- * @returns {string} A stringified version of the rawValue.
1024
- */
1025
- function stringifySafely(rawValue, parser, encoder) {
1026
- if (utils_default.isString(rawValue)) try {
1027
- (parser || JSON.parse)(rawValue);
1028
- return utils_default.trim(rawValue);
1029
- } catch (e) {
1030
- if (e.name !== "SyntaxError") throw e;
1031
- }
1032
- return (encoder || JSON.stringify)(rawValue);
1033
- }
1034
- var defaults;
1035
- var init_defaults = __esmMin((() => {
1036
- init_utils$1();
1037
- init_AxiosError();
1038
- init_transitional();
1039
- init_toFormData();
1040
- init_toURLEncodedForm();
1041
- init_platform();
1042
- init_formDataToJSON();
1043
- defaults = {
1044
- transitional: transitional_default,
1045
- adapter: [
1046
- "xhr",
1047
- "http",
1048
- "fetch"
1049
- ],
1050
- transformRequest: [function transformRequest(data, headers) {
1051
- const contentType = headers.getContentType() || "";
1052
- const hasJSONContentType = contentType.indexOf("application/json") > -1;
1053
- const isObjectPayload = utils_default.isObject(data);
1054
- if (isObjectPayload && utils_default.isHTMLForm(data)) data = new FormData(data);
1055
- if (utils_default.isFormData(data)) return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1056
- 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;
1057
- if (utils_default.isArrayBufferView(data)) return data.buffer;
1058
- if (utils_default.isURLSearchParams(data)) {
1059
- headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
1060
- return data.toString();
1061
- }
1062
- let isFileList;
1063
- if (isObjectPayload) {
1064
- if (contentType.indexOf("application/x-www-form-urlencoded") > -1) return toURLEncodedForm(data, this.formSerializer).toString();
1065
- if ((isFileList = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
1066
- const _FormData = this.env && this.env.FormData;
1067
- return toFormData$1(isFileList ? { "files[]": data } : data, _FormData && new _FormData(), this.formSerializer);
1068
- }
1069
- }
1070
- if (isObjectPayload || hasJSONContentType) {
1071
- headers.setContentType("application/json", false);
1072
- return stringifySafely(data);
1073
- }
1074
- return data;
1075
- }],
1076
- transformResponse: [function transformResponse(data) {
1077
- const transitional = this.transitional || defaults.transitional;
1078
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1079
- const JSONRequested = this.responseType === "json";
1080
- if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) return data;
1081
- if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
1082
- const strictJSONParsing = !(transitional && transitional.silentJSONParsing) && JSONRequested;
1083
- try {
1084
- return JSON.parse(data, this.parseReviver);
1085
- } catch (e) {
1086
- if (strictJSONParsing) {
1087
- if (e.name === "SyntaxError") throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
1088
- throw e;
1089
- }
1090
- }
1091
- }
1092
- return data;
1093
- }],
1094
- timeout: 0,
1095
- xsrfCookieName: "XSRF-TOKEN",
1096
- xsrfHeaderName: "X-XSRF-TOKEN",
1097
- maxContentLength: -1,
1098
- maxBodyLength: -1,
1099
- env: {
1100
- FormData: platform_default.classes.FormData,
1101
- Blob: platform_default.classes.Blob
1102
- },
1103
- validateStatus: function validateStatus(status) {
1104
- return status >= 200 && status < 300;
1105
- },
1106
- headers: { common: {
1107
- Accept: "application/json, text/plain, */*",
1108
- "Content-Type": void 0
1109
- } }
1110
- };
1111
- utils_default.forEach([
1112
- "delete",
1113
- "get",
1114
- "head",
1115
- "post",
1116
- "put",
1117
- "patch"
1118
- ], (method) => {
1119
- defaults.headers[method] = {};
1120
- });
1121
- }));
1122
- //#endregion
1123
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/parseHeaders.js
1124
- var ignoreDuplicateOf, parseHeaders_default;
1125
- var init_parseHeaders = __esmMin((() => {
1126
- init_utils$1();
1127
- ignoreDuplicateOf = utils_default.toObjectSet([
1128
- "age",
1129
- "authorization",
1130
- "content-length",
1131
- "content-type",
1132
- "etag",
1133
- "expires",
1134
- "from",
1135
- "host",
1136
- "if-modified-since",
1137
- "if-unmodified-since",
1138
- "last-modified",
1139
- "location",
1140
- "max-forwards",
1141
- "proxy-authorization",
1142
- "referer",
1143
- "retry-after",
1144
- "user-agent"
1145
- ]);
1146
- parseHeaders_default = (rawHeaders) => {
1147
- const parsed = {};
1148
- let key;
1149
- let val;
1150
- let i;
1151
- rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
1152
- i = line.indexOf(":");
1153
- key = line.substring(0, i).trim().toLowerCase();
1154
- val = line.substring(i + 1).trim();
1155
- if (!key || parsed[key] && ignoreDuplicateOf[key]) return;
1156
- if (key === "set-cookie") if (parsed[key]) parsed[key].push(val);
1157
- else parsed[key] = [val];
1158
- else parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
1159
- });
1160
- return parsed;
1161
- };
1162
- }));
1163
- //#endregion
1164
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/AxiosHeaders.js
1165
- function assertValidHeaderValue(value, header) {
1166
- if (value === false || value == null) return;
1167
- if (utils_default.isArray(value)) {
1168
- value.forEach((v) => assertValidHeaderValue(v, header));
1169
- return;
1170
- }
1171
- if (!isValidHeaderValue(String(value))) throw new Error(`Invalid character in header content ["${header}"]`);
1172
- }
1173
- function normalizeHeader(header) {
1174
- return header && String(header).trim().toLowerCase();
1175
- }
1176
- function stripTrailingCRLF(str) {
1177
- let end = str.length;
1178
- while (end > 0) {
1179
- const charCode = str.charCodeAt(end - 1);
1180
- if (charCode !== 10 && charCode !== 13) break;
1181
- end -= 1;
1182
- }
1183
- return end === str.length ? str : str.slice(0, end);
1184
- }
1185
- function normalizeValue(value) {
1186
- if (value === false || value == null) return value;
1187
- return utils_default.isArray(value) ? value.map(normalizeValue) : stripTrailingCRLF(String(value));
1188
- }
1189
- function parseTokens(str) {
1190
- const tokens = Object.create(null);
1191
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1192
- let match;
1193
- while (match = tokensRE.exec(str)) tokens[match[1]] = match[2];
1194
- return tokens;
1195
- }
1196
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1197
- if (utils_default.isFunction(filter)) return filter.call(this, value, header);
1198
- if (isHeaderNameFilter) value = header;
1199
- if (!utils_default.isString(value)) return;
1200
- if (utils_default.isString(filter)) return value.indexOf(filter) !== -1;
1201
- if (utils_default.isRegExp(filter)) return filter.test(value);
1202
- }
1203
- function formatHeader(header) {
1204
- return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1205
- return char.toUpperCase() + str;
1206
- });
1207
- }
1208
- function buildAccessors(obj, header) {
1209
- const accessorName = utils_default.toCamelCase(" " + header);
1210
- [
1211
- "get",
1212
- "set",
1213
- "has"
1214
- ].forEach((methodName) => {
1215
- Object.defineProperty(obj, methodName + accessorName, {
1216
- value: function(arg1, arg2, arg3) {
1217
- return this[methodName].call(this, header, arg1, arg2, arg3);
1218
- },
1219
- configurable: true
1220
- });
1221
- });
1222
- }
1223
- var $internals, isValidHeaderValue, isValidHeaderName, AxiosHeaders$1;
1224
- var init_AxiosHeaders = __esmMin((() => {
1225
- init_utils$1();
1226
- init_parseHeaders();
1227
- $internals = Symbol("internals");
1228
- isValidHeaderValue = (value) => !/[\r\n]/.test(value);
1229
- isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1230
- AxiosHeaders$1 = class {
1231
- constructor(headers) {
1232
- headers && this.set(headers);
1233
- }
1234
- set(header, valueOrRewrite, rewrite) {
1235
- const self = this;
1236
- function setHeader(_value, _header, _rewrite) {
1237
- const lHeader = normalizeHeader(_header);
1238
- if (!lHeader) throw new Error("header name must be a non-empty string");
1239
- const key = utils_default.findKey(self, lHeader);
1240
- if (!key || self[key] === void 0 || _rewrite === true || _rewrite === void 0 && self[key] !== false) {
1241
- assertValidHeaderValue(_value, _header);
1242
- self[key || _header] = normalizeValue(_value);
1243
- }
1244
- }
1245
- const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1246
- if (utils_default.isPlainObject(header) || header instanceof this.constructor) setHeaders(header, valueOrRewrite);
1247
- else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) setHeaders(parseHeaders_default(header), valueOrRewrite);
1248
- else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
1249
- let obj = {}, dest, key;
1250
- for (const entry of header) {
1251
- if (!utils_default.isArray(entry)) throw TypeError("Object iterator must return a key-value pair");
1252
- obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
1253
- }
1254
- setHeaders(obj, valueOrRewrite);
1255
- } else header != null && setHeader(valueOrRewrite, header, rewrite);
1256
- return this;
1257
- }
1258
- get(header, parser) {
1259
- header = normalizeHeader(header);
1260
- if (header) {
1261
- const key = utils_default.findKey(this, header);
1262
- if (key) {
1263
- const value = this[key];
1264
- if (!parser) return value;
1265
- if (parser === true) return parseTokens(value);
1266
- if (utils_default.isFunction(parser)) return parser.call(this, value, key);
1267
- if (utils_default.isRegExp(parser)) return parser.exec(value);
1268
- throw new TypeError("parser must be boolean|regexp|function");
1269
- }
1270
- }
1271
- }
1272
- has(header, matcher) {
1273
- header = normalizeHeader(header);
1274
- if (header) {
1275
- const key = utils_default.findKey(this, header);
1276
- return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1277
- }
1278
- return false;
1279
- }
1280
- delete(header, matcher) {
1281
- const self = this;
1282
- let deleted = false;
1283
- function deleteHeader(_header) {
1284
- _header = normalizeHeader(_header);
1285
- if (_header) {
1286
- const key = utils_default.findKey(self, _header);
1287
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
1288
- delete self[key];
1289
- deleted = true;
1290
- }
1291
- }
1292
- }
1293
- if (utils_default.isArray(header)) header.forEach(deleteHeader);
1294
- else deleteHeader(header);
1295
- return deleted;
1296
- }
1297
- clear(matcher) {
1298
- const keys = Object.keys(this);
1299
- let i = keys.length;
1300
- let deleted = false;
1301
- while (i--) {
1302
- const key = keys[i];
1303
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1304
- delete this[key];
1305
- deleted = true;
1306
- }
1307
- }
1308
- return deleted;
1309
- }
1310
- normalize(format) {
1311
- const self = this;
1312
- const headers = {};
1313
- utils_default.forEach(this, (value, header) => {
1314
- const key = utils_default.findKey(headers, header);
1315
- if (key) {
1316
- self[key] = normalizeValue(value);
1317
- delete self[header];
1318
- return;
1319
- }
1320
- const normalized = format ? formatHeader(header) : String(header).trim();
1321
- if (normalized !== header) delete self[header];
1322
- self[normalized] = normalizeValue(value);
1323
- headers[normalized] = true;
1324
- });
1325
- return this;
1326
- }
1327
- concat(...targets) {
1328
- return this.constructor.concat(this, ...targets);
1329
- }
1330
- toJSON(asStrings) {
1331
- const obj = Object.create(null);
1332
- utils_default.forEach(this, (value, header) => {
1333
- value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
1334
- });
1335
- return obj;
1336
- }
1337
- [Symbol.iterator]() {
1338
- return Object.entries(this.toJSON())[Symbol.iterator]();
1339
- }
1340
- toString() {
1341
- return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
1342
- }
1343
- getSetCookie() {
1344
- return this.get("set-cookie") || [];
1345
- }
1346
- get [Symbol.toStringTag]() {
1347
- return "AxiosHeaders";
1348
- }
1349
- static from(thing) {
1350
- return thing instanceof this ? thing : new this(thing);
1351
- }
1352
- static concat(first, ...targets) {
1353
- const computed = new this(first);
1354
- targets.forEach((target) => computed.set(target));
1355
- return computed;
1356
- }
1357
- static accessor(header) {
1358
- const accessors = (this[$internals] = this[$internals] = { accessors: {} }).accessors;
1359
- const prototype = this.prototype;
1360
- function defineAccessor(_header) {
1361
- const lHeader = normalizeHeader(_header);
1362
- if (!accessors[lHeader]) {
1363
- buildAccessors(prototype, _header);
1364
- accessors[lHeader] = true;
1365
- }
1366
- }
1367
- utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1368
- return this;
1369
- }
1370
- };
1371
- AxiosHeaders$1.accessor([
1372
- "Content-Type",
1373
- "Content-Length",
1374
- "Accept",
1375
- "Accept-Encoding",
1376
- "User-Agent",
1377
- "Authorization"
1378
- ]);
1379
- utils_default.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
1380
- let mapped = key[0].toUpperCase() + key.slice(1);
1381
- return {
1382
- get: () => value,
1383
- set(headerValue) {
1384
- this[mapped] = headerValue;
1385
- }
1386
- };
1387
- });
1388
- utils_default.freezeMethods(AxiosHeaders$1);
1389
- }));
1390
- //#endregion
1391
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/transformData.js
1392
- /**
1393
- * Transform the data for a request or a response
1394
- *
1395
- * @param {Array|Function} fns A single function or Array of functions
1396
- * @param {?Object} response The response object
1397
- *
1398
- * @returns {*} The resulting transformed data
1399
- */
1400
- function transformData(fns, response) {
1401
- const config = this || defaults;
1402
- const context = response || config;
1403
- const headers = AxiosHeaders$1.from(context.headers);
1404
- let data = context.data;
1405
- utils_default.forEach(fns, function transform(fn) {
1406
- data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
1407
- });
1408
- headers.normalize();
1409
- return data;
1410
- }
1411
- var init_transformData = __esmMin((() => {
1412
- init_utils$1();
1413
- init_defaults();
1414
- init_AxiosHeaders();
1415
- }));
1416
- //#endregion
1417
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/cancel/isCancel.js
1418
- function isCancel$1(value) {
1419
- return !!(value && value.__CANCEL__);
1420
- }
1421
- var init_isCancel = __esmMin((() => {}));
1422
- //#endregion
1423
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/cancel/CanceledError.js
1424
- var CanceledError$1;
1425
- var init_CanceledError = __esmMin((() => {
1426
- init_AxiosError();
1427
- CanceledError$1 = class extends AxiosError$1 {
1428
- /**
1429
- * A `CanceledError` is an object that is thrown when an operation is canceled.
1430
- *
1431
- * @param {string=} message The message.
1432
- * @param {Object=} config The config.
1433
- * @param {Object=} request The request.
1434
- *
1435
- * @returns {CanceledError} The created error.
1436
- */
1437
- constructor(message, config, request) {
1438
- super(message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
1439
- this.name = "CanceledError";
1440
- this.__CANCEL__ = true;
1441
- }
1442
- };
1443
- }));
1444
- //#endregion
1445
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/settle.js
1446
- /**
1447
- * Resolve or reject a Promise based on response status.
1448
- *
1449
- * @param {Function} resolve A function that resolves the promise.
1450
- * @param {Function} reject A function that rejects the promise.
1451
- * @param {object} response The response.
1452
- *
1453
- * @returns {object} The response.
1454
- */
1455
- function settle(resolve, reject, response) {
1456
- const validateStatus = response.config.validateStatus;
1457
- if (!response.status || !validateStatus || validateStatus(response.status)) resolve(response);
1458
- 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));
1459
- }
1460
- var init_settle = __esmMin((() => {
1461
- init_AxiosError();
1462
- }));
1463
- //#endregion
1464
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/parseProtocol.js
1465
- function parseProtocol(url) {
1466
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
1467
- return match && match[1] || "";
1468
- }
1469
- var init_parseProtocol = __esmMin((() => {}));
1470
- //#endregion
1471
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/speedometer.js
1472
- /**
1473
- * Calculate data maxRate
1474
- * @param {Number} [samplesCount= 10]
1475
- * @param {Number} [min= 1000]
1476
- * @returns {Function}
1477
- */
1478
- function speedometer(samplesCount, min) {
1479
- samplesCount = samplesCount || 10;
1480
- const bytes = new Array(samplesCount);
1481
- const timestamps = new Array(samplesCount);
1482
- let head = 0;
1483
- let tail = 0;
1484
- let firstSampleTS;
1485
- min = min !== void 0 ? min : 1e3;
1486
- return function push(chunkLength) {
1487
- const now = Date.now();
1488
- const startedAt = timestamps[tail];
1489
- if (!firstSampleTS) firstSampleTS = now;
1490
- bytes[head] = chunkLength;
1491
- timestamps[head] = now;
1492
- let i = tail;
1493
- let bytesCount = 0;
1494
- while (i !== head) {
1495
- bytesCount += bytes[i++];
1496
- i = i % samplesCount;
1497
- }
1498
- head = (head + 1) % samplesCount;
1499
- if (head === tail) tail = (tail + 1) % samplesCount;
1500
- if (now - firstSampleTS < min) return;
1501
- const passed = startedAt && now - startedAt;
1502
- return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
1503
- };
1504
- }
1505
- var init_speedometer = __esmMin((() => {}));
1506
- //#endregion
1507
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/throttle.js
1508
- /**
1509
- * Throttle decorator
1510
- * @param {Function} fn
1511
- * @param {Number} freq
1512
- * @return {Function}
1513
- */
1514
- function throttle(fn, freq) {
1515
- let timestamp = 0;
1516
- let threshold = 1e3 / freq;
1517
- let lastArgs;
1518
- let timer;
1519
- const invoke = (args, now = Date.now()) => {
1520
- timestamp = now;
1521
- lastArgs = null;
1522
- if (timer) {
1523
- clearTimeout(timer);
1524
- timer = null;
1525
- }
1526
- fn(...args);
1527
- };
1528
- const throttled = (...args) => {
1529
- const now = Date.now();
1530
- const passed = now - timestamp;
1531
- if (passed >= threshold) invoke(args, now);
1532
- else {
1533
- lastArgs = args;
1534
- if (!timer) timer = setTimeout(() => {
1535
- timer = null;
1536
- invoke(lastArgs);
1537
- }, threshold - passed);
1538
- }
1539
- };
1540
- const flush = () => lastArgs && invoke(lastArgs);
1541
- return [throttled, flush];
1542
- }
1543
- var init_throttle = __esmMin((() => {}));
1544
- //#endregion
1545
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/progressEventReducer.js
1546
- var progressEventReducer, progressEventDecorator, asyncDecorator;
1547
- var init_progressEventReducer = __esmMin((() => {
1548
- init_speedometer();
1549
- init_throttle();
1550
- init_utils$1();
1551
- progressEventReducer = (listener, isDownloadStream, freq = 3) => {
1552
- let bytesNotified = 0;
1553
- const _speedometer = speedometer(50, 250);
1554
- return throttle((e) => {
1555
- const loaded = e.loaded;
1556
- const total = e.lengthComputable ? e.total : void 0;
1557
- const progressBytes = loaded - bytesNotified;
1558
- const rate = _speedometer(progressBytes);
1559
- const inRange = loaded <= total;
1560
- bytesNotified = loaded;
1561
- listener({
1562
- loaded,
1563
- total,
1564
- progress: total ? loaded / total : void 0,
1565
- bytes: progressBytes,
1566
- rate: rate ? rate : void 0,
1567
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
1568
- event: e,
1569
- lengthComputable: total != null,
1570
- [isDownloadStream ? "download" : "upload"]: true
1571
- });
1572
- }, freq);
1573
- };
1574
- progressEventDecorator = (total, throttled) => {
1575
- const lengthComputable = total != null;
1576
- return [(loaded) => throttled[0]({
1577
- lengthComputable,
1578
- total,
1579
- loaded
1580
- }), throttled[1]];
1581
- };
1582
- asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
1583
- }));
1584
- //#endregion
1585
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/isURLSameOrigin.js
1586
- var isURLSameOrigin_default;
1587
- var init_isURLSameOrigin = __esmMin((() => {
1588
- init_platform();
1589
- isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
1590
- url = new URL(url, platform_default.origin);
1591
- return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
1592
- })(new URL(platform_default.origin), platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)) : () => true;
1593
- }));
1594
- //#endregion
1595
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/cookies.js
1596
- var cookies_default;
1597
- var init_cookies = __esmMin((() => {
1598
- init_utils$1();
1599
- init_platform();
1600
- cookies_default = platform_default.hasStandardBrowserEnv ? {
1601
- write(name, value, expires, path, domain, secure, sameSite) {
1602
- if (typeof document === "undefined") return;
1603
- const cookie = [`${name}=${encodeURIComponent(value)}`];
1604
- if (utils_default.isNumber(expires)) cookie.push(`expires=${new Date(expires).toUTCString()}`);
1605
- if (utils_default.isString(path)) cookie.push(`path=${path}`);
1606
- if (utils_default.isString(domain)) cookie.push(`domain=${domain}`);
1607
- if (secure === true) cookie.push("secure");
1608
- if (utils_default.isString(sameSite)) cookie.push(`SameSite=${sameSite}`);
1609
- document.cookie = cookie.join("; ");
1610
- },
1611
- read(name) {
1612
- if (typeof document === "undefined") return null;
1613
- const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
1614
- return match ? decodeURIComponent(match[1]) : null;
1615
- },
1616
- remove(name) {
1617
- this.write(name, "", Date.now() - 864e5, "/");
1618
- }
1619
- } : {
1620
- write() {},
1621
- read() {
1622
- return null;
1623
- },
1624
- remove() {}
1625
- };
1626
- }));
1627
- //#endregion
1628
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/isAbsoluteURL.js
1629
- /**
1630
- * Determines whether the specified URL is absolute
1631
- *
1632
- * @param {string} url The URL to test
1633
- *
1634
- * @returns {boolean} True if the specified URL is absolute, otherwise false
1635
- */
1636
- function isAbsoluteURL(url) {
1637
- if (typeof url !== "string") return false;
1638
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
1639
- }
1640
- var init_isAbsoluteURL = __esmMin((() => {}));
1641
- //#endregion
1642
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/combineURLs.js
1643
- /**
1644
- * Creates a new URL by combining the specified URLs
1645
- *
1646
- * @param {string} baseURL The base URL
1647
- * @param {string} relativeURL The relative URL
1648
- *
1649
- * @returns {string} The combined URL
1650
- */
1651
- function combineURLs(baseURL, relativeURL) {
1652
- return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
1653
- }
1654
- var init_combineURLs = __esmMin((() => {}));
1655
- //#endregion
1656
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/buildFullPath.js
1657
- /**
1658
- * Creates a new URL by combining the baseURL with the requestedURL,
1659
- * only when the requestedURL is not already an absolute URL.
1660
- * If the requestURL is absolute, this function returns the requestedURL untouched.
1661
- *
1662
- * @param {string} baseURL The base URL
1663
- * @param {string} requestedURL Absolute or relative URL to combine
1664
- *
1665
- * @returns {string} The combined full path
1666
- */
1667
- function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
1668
- let isRelativeUrl = !isAbsoluteURL(requestedURL);
1669
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) return combineURLs(baseURL, requestedURL);
1670
- return requestedURL;
1671
- }
1672
- var init_buildFullPath = __esmMin((() => {
1673
- init_isAbsoluteURL();
1674
- init_combineURLs();
1675
- }));
1676
- //#endregion
1677
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/mergeConfig.js
1678
- /**
1679
- * Config-specific merge-function which creates a new config-object
1680
- * by merging two configuration objects together.
1681
- *
1682
- * @param {Object} config1
1683
- * @param {Object} config2
1684
- *
1685
- * @returns {Object} New object resulting from merging config2 to config1
1686
- */
1687
- function mergeConfig$1(config1, config2) {
1688
- config2 = config2 || {};
1689
- const config = {};
1690
- function getMergedValue(target, source, prop, caseless) {
1691
- if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) return utils_default.merge.call({ caseless }, target, source);
1692
- else if (utils_default.isPlainObject(source)) return utils_default.merge({}, source);
1693
- else if (utils_default.isArray(source)) return source.slice();
1694
- return source;
1695
- }
1696
- function mergeDeepProperties(a, b, prop, caseless) {
1697
- if (!utils_default.isUndefined(b)) return getMergedValue(a, b, prop, caseless);
1698
- else if (!utils_default.isUndefined(a)) return getMergedValue(void 0, a, prop, caseless);
1699
- }
1700
- function valueFromConfig2(a, b) {
1701
- if (!utils_default.isUndefined(b)) return getMergedValue(void 0, b);
1702
- }
1703
- function defaultToConfig2(a, b) {
1704
- if (!utils_default.isUndefined(b)) return getMergedValue(void 0, b);
1705
- else if (!utils_default.isUndefined(a)) return getMergedValue(void 0, a);
1706
- }
1707
- function mergeDirectKeys(a, b, prop) {
1708
- if (prop in config2) return getMergedValue(a, b);
1709
- else if (prop in config1) return getMergedValue(void 0, a);
1710
- }
1711
- const mergeMap = {
1712
- url: valueFromConfig2,
1713
- method: valueFromConfig2,
1714
- data: valueFromConfig2,
1715
- baseURL: defaultToConfig2,
1716
- transformRequest: defaultToConfig2,
1717
- transformResponse: defaultToConfig2,
1718
- paramsSerializer: defaultToConfig2,
1719
- timeout: defaultToConfig2,
1720
- timeoutMessage: defaultToConfig2,
1721
- withCredentials: defaultToConfig2,
1722
- withXSRFToken: defaultToConfig2,
1723
- adapter: defaultToConfig2,
1724
- responseType: defaultToConfig2,
1725
- xsrfCookieName: defaultToConfig2,
1726
- xsrfHeaderName: defaultToConfig2,
1727
- onUploadProgress: defaultToConfig2,
1728
- onDownloadProgress: defaultToConfig2,
1729
- decompress: defaultToConfig2,
1730
- maxContentLength: defaultToConfig2,
1731
- maxBodyLength: defaultToConfig2,
1732
- beforeRedirect: defaultToConfig2,
1733
- transport: defaultToConfig2,
1734
- httpAgent: defaultToConfig2,
1735
- httpsAgent: defaultToConfig2,
1736
- cancelToken: defaultToConfig2,
1737
- socketPath: defaultToConfig2,
1738
- responseEncoding: defaultToConfig2,
1739
- validateStatus: mergeDirectKeys,
1740
- headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
1741
- };
1742
- utils_default.forEach(Object.keys({
1743
- ...config1,
1744
- ...config2
1745
- }), function computeConfigValue(prop) {
1746
- if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
1747
- const merge = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
1748
- const configValue = merge(config1[prop], config2[prop], prop);
1749
- utils_default.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
1750
- });
1751
- return config;
1752
- }
1753
- var headersToObject;
1754
- var init_mergeConfig = __esmMin((() => {
1755
- init_utils$1();
1756
- init_AxiosHeaders();
1757
- headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
1758
- }));
1759
- //#endregion
1760
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/resolveConfig.js
1761
- var resolveConfig_default;
1762
- var init_resolveConfig = __esmMin((() => {
1763
- init_platform();
1764
- init_utils$1();
1765
- init_isURLSameOrigin();
1766
- init_cookies();
1767
- init_buildFullPath();
1768
- init_mergeConfig();
1769
- init_AxiosHeaders();
1770
- init_buildURL();
1771
- resolveConfig_default = (config) => {
1772
- const newConfig = mergeConfig$1({}, config);
1773
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
1774
- newConfig.headers = headers = AxiosHeaders$1.from(headers);
1775
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
1776
- if (auth) headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")));
1777
- if (utils_default.isFormData(data)) {
1778
- if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) headers.setContentType(void 0);
1779
- else if (utils_default.isFunction(data.getHeaders)) {
1780
- const formHeaders = data.getHeaders();
1781
- const allowedHeaders = ["content-type", "content-length"];
1782
- Object.entries(formHeaders).forEach(([key, val]) => {
1783
- if (allowedHeaders.includes(key.toLowerCase())) headers.set(key, val);
1784
- });
1785
- }
1786
- }
1787
- if (platform_default.hasStandardBrowserEnv) {
1788
- withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
1789
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
1790
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
1791
- if (xsrfValue) headers.set(xsrfHeaderName, xsrfValue);
1792
- }
1793
- }
1794
- return newConfig;
1795
- };
1796
- }));
1797
- //#endregion
1798
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/adapters/xhr.js
1799
- var isXHRAdapterSupported, xhr_default;
1800
- var init_xhr = __esmMin((() => {
1801
- init_utils$1();
1802
- init_settle();
1803
- init_transitional();
1804
- init_AxiosError();
1805
- init_CanceledError();
1806
- init_parseProtocol();
1807
- init_platform();
1808
- init_AxiosHeaders();
1809
- init_progressEventReducer();
1810
- init_resolveConfig();
1811
- isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
1812
- xhr_default = isXHRAdapterSupported && function(config) {
1813
- return new Promise(function dispatchXhrRequest(resolve, reject) {
1814
- const _config = resolveConfig_default(config);
1815
- let requestData = _config.data;
1816
- const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
1817
- let { responseType, onUploadProgress, onDownloadProgress } = _config;
1818
- let onCanceled;
1819
- let uploadThrottled, downloadThrottled;
1820
- let flushUpload, flushDownload;
1821
- function done() {
1822
- flushUpload && flushUpload();
1823
- flushDownload && flushDownload();
1824
- _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
1825
- _config.signal && _config.signal.removeEventListener("abort", onCanceled);
1826
- }
1827
- let request = new XMLHttpRequest();
1828
- request.open(_config.method.toUpperCase(), _config.url, true);
1829
- request.timeout = _config.timeout;
1830
- function onloadend() {
1831
- if (!request) return;
1832
- const responseHeaders = AxiosHeaders$1.from("getAllResponseHeaders" in request && request.getAllResponseHeaders());
1833
- settle(function _resolve(value) {
1834
- resolve(value);
1835
- done();
1836
- }, function _reject(err) {
1837
- reject(err);
1838
- done();
1839
- }, {
1840
- data: !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response,
1841
- status: request.status,
1842
- statusText: request.statusText,
1843
- headers: responseHeaders,
1844
- config,
1845
- request
1846
- });
1847
- request = null;
1848
- }
1849
- if ("onloadend" in request) request.onloadend = onloadend;
1850
- else request.onreadystatechange = function handleLoad() {
1851
- if (!request || request.readyState !== 4) return;
1852
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) return;
1853
- setTimeout(onloadend);
1854
- };
1855
- request.onabort = function handleAbort() {
1856
- if (!request) return;
1857
- reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
1858
- request = null;
1859
- };
1860
- request.onerror = function handleError(event) {
1861
- const err = new AxiosError$1(event && event.message ? event.message : "Network Error", AxiosError$1.ERR_NETWORK, config, request);
1862
- err.event = event || null;
1863
- reject(err);
1864
- request = null;
1865
- };
1866
- request.ontimeout = function handleTimeout() {
1867
- let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
1868
- const transitional = _config.transitional || transitional_default;
1869
- if (_config.timeoutErrorMessage) timeoutErrorMessage = _config.timeoutErrorMessage;
1870
- reject(new AxiosError$1(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, config, request));
1871
- request = null;
1872
- };
1873
- requestData === void 0 && requestHeaders.setContentType(null);
1874
- if ("setRequestHeader" in request) utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
1875
- request.setRequestHeader(key, val);
1876
- });
1877
- if (!utils_default.isUndefined(_config.withCredentials)) request.withCredentials = !!_config.withCredentials;
1878
- if (responseType && responseType !== "json") request.responseType = _config.responseType;
1879
- if (onDownloadProgress) {
1880
- [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
1881
- request.addEventListener("progress", downloadThrottled);
1882
- }
1883
- if (onUploadProgress && request.upload) {
1884
- [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
1885
- request.upload.addEventListener("progress", uploadThrottled);
1886
- request.upload.addEventListener("loadend", flushUpload);
1887
- }
1888
- if (_config.cancelToken || _config.signal) {
1889
- onCanceled = (cancel) => {
1890
- if (!request) return;
1891
- reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
1892
- request.abort();
1893
- request = null;
1894
- };
1895
- _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
1896
- if (_config.signal) _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
1897
- }
1898
- const protocol = parseProtocol(_config.url);
1899
- if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
1900
- reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config));
1901
- return;
1902
- }
1903
- request.send(requestData || null);
1904
- });
1905
- };
1906
- }));
1907
- //#endregion
1908
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/composeSignals.js
1909
- var composeSignals;
1910
- var init_composeSignals = __esmMin((() => {
1911
- init_CanceledError();
1912
- init_AxiosError();
1913
- init_utils$1();
1914
- composeSignals = (signals, timeout) => {
1915
- const { length } = signals = signals ? signals.filter(Boolean) : [];
1916
- if (timeout || length) {
1917
- let controller = new AbortController();
1918
- let aborted;
1919
- const onabort = function(reason) {
1920
- if (!aborted) {
1921
- aborted = true;
1922
- unsubscribe();
1923
- const err = reason instanceof Error ? reason : this.reason;
1924
- controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
1925
- }
1926
- };
1927
- let timer = timeout && setTimeout(() => {
1928
- timer = null;
1929
- onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
1930
- }, timeout);
1931
- const unsubscribe = () => {
1932
- if (signals) {
1933
- timer && clearTimeout(timer);
1934
- timer = null;
1935
- signals.forEach((signal) => {
1936
- signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener("abort", onabort);
1937
- });
1938
- signals = null;
1939
- }
1940
- };
1941
- signals.forEach((signal) => signal.addEventListener("abort", onabort));
1942
- const { signal } = controller;
1943
- signal.unsubscribe = () => utils_default.asap(unsubscribe);
1944
- return signal;
1945
- }
1946
- };
1947
- }));
1948
- //#endregion
1949
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/trackStream.js
1950
- var streamChunk, readBytes, readStream, trackStream;
1951
- var init_trackStream = __esmMin((() => {
1952
- streamChunk = function* (chunk, chunkSize) {
1953
- let len = chunk.byteLength;
1954
- if (!chunkSize || len < chunkSize) {
1955
- yield chunk;
1956
- return;
1957
- }
1958
- let pos = 0;
1959
- let end;
1960
- while (pos < len) {
1961
- end = pos + chunkSize;
1962
- yield chunk.slice(pos, end);
1963
- pos = end;
1964
- }
1965
- };
1966
- readBytes = async function* (iterable, chunkSize) {
1967
- for await (const chunk of readStream(iterable)) yield* streamChunk(chunk, chunkSize);
1968
- };
1969
- readStream = async function* (stream) {
1970
- if (stream[Symbol.asyncIterator]) {
1971
- yield* stream;
1972
- return;
1973
- }
1974
- const reader = stream.getReader();
1975
- try {
1976
- for (;;) {
1977
- const { done, value } = await reader.read();
1978
- if (done) break;
1979
- yield value;
1980
- }
1981
- } finally {
1982
- await reader.cancel();
1983
- }
1984
- };
1985
- trackStream = (stream, chunkSize, onProgress, onFinish) => {
1986
- const iterator = readBytes(stream, chunkSize);
1987
- let bytes = 0;
1988
- let done;
1989
- let _onFinish = (e) => {
1990
- if (!done) {
1991
- done = true;
1992
- onFinish && onFinish(e);
1993
- }
1994
- };
1995
- return new ReadableStream({
1996
- async pull(controller) {
1997
- try {
1998
- const { done, value } = await iterator.next();
1999
- if (done) {
2000
- _onFinish();
2001
- controller.close();
2002
- return;
2003
- }
2004
- let len = value.byteLength;
2005
- if (onProgress) onProgress(bytes += len);
2006
- controller.enqueue(new Uint8Array(value));
2007
- } catch (err) {
2008
- _onFinish(err);
2009
- throw err;
2010
- }
2011
- },
2012
- cancel(reason) {
2013
- _onFinish(reason);
2014
- return iterator.return();
2015
- }
2016
- }, { highWaterMark: 2 });
2017
- };
2018
- })), DEFAULT_CHUNK_SIZE, isFunction, globalFetchAPI, ReadableStream$1, TextEncoder, test, factory, seedCache, getFetch;
2019
- var init_fetch = __esmMin((() => {
2020
- init_platform();
2021
- init_utils$1();
2022
- init_AxiosError();
2023
- init_composeSignals();
2024
- init_trackStream();
2025
- init_AxiosHeaders();
2026
- init_progressEventReducer();
2027
- init_resolveConfig();
2028
- init_settle();
2029
- DEFAULT_CHUNK_SIZE = 64 * 1024;
2030
- ({isFunction} = utils_default);
2031
- globalFetchAPI = (({ Request, Response }) => ({
2032
- Request,
2033
- Response
2034
- }))(utils_default.global);
2035
- ({ReadableStream: ReadableStream$1, TextEncoder} = utils_default.global);
2036
- test = (fn, ...args) => {
2037
- try {
2038
- return !!fn(...args);
2039
- } catch (e) {
2040
- return false;
2041
- }
2042
- };
2043
- factory = (env) => {
2044
- env = utils_default.merge.call({ skipUndefined: true }, globalFetchAPI, env);
2045
- const { fetch: envFetch, Request, Response } = env;
2046
- const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
2047
- const isRequestSupported = isFunction(Request);
2048
- const isResponseSupported = isFunction(Response);
2049
- if (!isFetchSupported) return false;
2050
- const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
2051
- const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
2052
- const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
2053
- let duplexAccessed = false;
2054
- const body = new ReadableStream$1();
2055
- const hasContentType = new Request(platform_default.origin, {
2056
- body,
2057
- method: "POST",
2058
- get duplex() {
2059
- duplexAccessed = true;
2060
- return "half";
2061
- }
2062
- }).headers.has("Content-Type");
2063
- body.cancel();
2064
- return duplexAccessed && !hasContentType;
2065
- });
2066
- const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
2067
- const resolvers = { stream: supportsResponseStream && ((res) => res.body) };
2068
- isFetchSupported && [
2069
- "text",
2070
- "arrayBuffer",
2071
- "blob",
2072
- "formData",
2073
- "stream"
2074
- ].forEach((type) => {
2075
- !resolvers[type] && (resolvers[type] = (res, config) => {
2076
- let method = res && res[type];
2077
- if (method) return method.call(res);
2078
- throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
2079
- });
2080
- });
2081
- const getBodyLength = async (body) => {
2082
- if (body == null) return 0;
2083
- if (utils_default.isBlob(body)) return body.size;
2084
- if (utils_default.isSpecCompliantForm(body)) return (await new Request(platform_default.origin, {
2085
- method: "POST",
2086
- body
2087
- }).arrayBuffer()).byteLength;
2088
- if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) return body.byteLength;
2089
- if (utils_default.isURLSearchParams(body)) body = body + "";
2090
- if (utils_default.isString(body)) return (await encodeText(body)).byteLength;
2091
- };
2092
- const resolveBodyLength = async (headers, body) => {
2093
- const length = utils_default.toFiniteNumber(headers.getContentLength());
2094
- return length == null ? getBodyLength(body) : length;
2095
- };
2096
- return async (config) => {
2097
- let { url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = "same-origin", fetchOptions } = resolveConfig_default(config);
2098
- let _fetch = envFetch || fetch;
2099
- responseType = responseType ? (responseType + "").toLowerCase() : "text";
2100
- let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
2101
- let request = null;
2102
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
2103
- composedSignal.unsubscribe();
2104
- });
2105
- let requestContentLength;
2106
- try {
2107
- if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
2108
- let _request = new Request(url, {
2109
- method: "POST",
2110
- body: data,
2111
- duplex: "half"
2112
- });
2113
- let contentTypeHeader;
2114
- if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) headers.setContentType(contentTypeHeader);
2115
- if (_request.body) {
2116
- const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)));
2117
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
2118
- }
2119
- }
2120
- if (!utils_default.isString(withCredentials)) withCredentials = withCredentials ? "include" : "omit";
2121
- const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
2122
- const resolvedOptions = {
2123
- ...fetchOptions,
2124
- signal: composedSignal,
2125
- method: method.toUpperCase(),
2126
- headers: headers.normalize().toJSON(),
2127
- body: data,
2128
- duplex: "half",
2129
- credentials: isCredentialsSupported ? withCredentials : void 0
2130
- };
2131
- request = isRequestSupported && new Request(url, resolvedOptions);
2132
- let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
2133
- const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
2134
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
2135
- const options = {};
2136
- [
2137
- "status",
2138
- "statusText",
2139
- "headers"
2140
- ].forEach((prop) => {
2141
- options[prop] = response[prop];
2142
- });
2143
- const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
2144
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
2145
- response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
2146
- flush && flush();
2147
- unsubscribe && unsubscribe();
2148
- }), options);
2149
- }
2150
- responseType = responseType || "text";
2151
- let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
2152
- !isStreamResponse && unsubscribe && unsubscribe();
2153
- return await new Promise((resolve, reject) => {
2154
- settle(resolve, reject, {
2155
- data: responseData,
2156
- headers: AxiosHeaders$1.from(response.headers),
2157
- status: response.status,
2158
- statusText: response.statusText,
2159
- config,
2160
- request
2161
- });
2162
- });
2163
- } catch (err) {
2164
- unsubscribe && unsubscribe();
2165
- 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, err && err.response), { cause: err.cause || err });
2166
- throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
2167
- }
2168
- };
2169
- };
2170
- seedCache = /* @__PURE__ */ new Map();
2171
- getFetch = (config) => {
2172
- let env = config && config.env || {};
2173
- const { fetch, Request, Response } = env;
2174
- const seeds = [
2175
- Request,
2176
- Response,
2177
- fetch
2178
- ];
2179
- let i = seeds.length, seed, target, map = seedCache;
2180
- while (i--) {
2181
- seed = seeds[i];
2182
- target = map.get(seed);
2183
- target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
2184
- map = target;
2185
- }
2186
- return target;
2187
- };
2188
- getFetch();
2189
- }));
2190
- //#endregion
2191
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/adapters/adapters.js
2192
- /**
2193
- * Get the first suitable adapter from the provided list.
2194
- * Tries each adapter in order until a supported one is found.
2195
- * Throws an AxiosError if no adapter is suitable.
2196
- *
2197
- * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
2198
- * @param {Object} config - Axios request configuration
2199
- * @throws {AxiosError} If no suitable adapter is available
2200
- * @returns {Function} The resolved adapter function
2201
- */
2202
- function getAdapter$1(adapters, config) {
2203
- adapters = utils_default.isArray(adapters) ? adapters : [adapters];
2204
- const { length } = adapters;
2205
- let nameOrAdapter;
2206
- let adapter;
2207
- const rejectedReasons = {};
2208
- for (let i = 0; i < length; i++) {
2209
- nameOrAdapter = adapters[i];
2210
- let id;
2211
- adapter = nameOrAdapter;
2212
- if (!isResolvedHandle(nameOrAdapter)) {
2213
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
2214
- if (adapter === void 0) throw new AxiosError$1(`Unknown adapter '${id}'`);
2215
- }
2216
- if (adapter && (utils_default.isFunction(adapter) || (adapter = adapter.get(config)))) break;
2217
- rejectedReasons[id || "#" + i] = adapter;
2218
- }
2219
- if (!adapter) {
2220
- const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build"));
2221
- 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");
2222
- }
2223
- return adapter;
2224
- }
2225
- var knownAdapters, renderReason, isResolvedHandle, adapters_default;
2226
- var init_adapters = __esmMin((() => {
2227
- init_utils$1();
2228
- init_null();
2229
- init_xhr();
2230
- init_fetch();
2231
- init_AxiosError();
2232
- knownAdapters = {
2233
- http: null,
2234
- xhr: xhr_default,
2235
- fetch: { get: getFetch }
2236
- };
2237
- utils_default.forEach(knownAdapters, (fn, value) => {
2238
- if (fn) {
2239
- try {
2240
- Object.defineProperty(fn, "name", { value });
2241
- } catch (e) {}
2242
- Object.defineProperty(fn, "adapterName", { value });
2243
- }
2244
- });
2245
- renderReason = (reason) => `- ${reason}`;
2246
- isResolvedHandle = (adapter) => utils_default.isFunction(adapter) || adapter === null || adapter === false;
2247
- adapters_default = {
2248
- getAdapter: getAdapter$1,
2249
- adapters: knownAdapters
2250
- };
2251
- }));
2252
- //#endregion
2253
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/dispatchRequest.js
2254
- /**
2255
- * Throws a `CanceledError` if cancellation has been requested.
2256
- *
2257
- * @param {Object} config The config that is to be used for the request
2258
- *
2259
- * @returns {void}
2260
- */
2261
- function throwIfCancellationRequested(config) {
2262
- if (config.cancelToken) config.cancelToken.throwIfRequested();
2263
- if (config.signal && config.signal.aborted) throw new CanceledError$1(null, config);
2264
- }
2265
- /**
2266
- * Dispatch a request to the server using the configured adapter.
2267
- *
2268
- * @param {object} config The config that is to be used for the request
2269
- *
2270
- * @returns {Promise} The Promise to be fulfilled
2271
- */
2272
- function dispatchRequest(config) {
2273
- throwIfCancellationRequested(config);
2274
- config.headers = AxiosHeaders$1.from(config.headers);
2275
- config.data = transformData.call(config, config.transformRequest);
2276
- if ([
2277
- "post",
2278
- "put",
2279
- "patch"
2280
- ].indexOf(config.method) !== -1) config.headers.setContentType("application/x-www-form-urlencoded", false);
2281
- return adapters_default.getAdapter(config.adapter || defaults.adapter, config)(config).then(function onAdapterResolution(response) {
2282
- throwIfCancellationRequested(config);
2283
- response.data = transformData.call(config, config.transformResponse, response);
2284
- response.headers = AxiosHeaders$1.from(response.headers);
2285
- return response;
2286
- }, function onAdapterRejection(reason) {
2287
- if (!isCancel$1(reason)) {
2288
- throwIfCancellationRequested(config);
2289
- if (reason && reason.response) {
2290
- reason.response.data = transformData.call(config, config.transformResponse, reason.response);
2291
- reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
2292
- }
2293
- }
2294
- return Promise.reject(reason);
2295
- });
2296
- }
2297
- var init_dispatchRequest = __esmMin((() => {
2298
- init_transformData();
2299
- init_isCancel();
2300
- init_defaults();
2301
- init_CanceledError();
2302
- init_AxiosHeaders();
2303
- init_adapters();
2304
- }));
2305
- //#endregion
2306
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/env/data.js
2307
- var VERSION$1;
2308
- var init_data = __esmMin((() => {
2309
- VERSION$1 = "1.15.0";
2310
- }));
2311
- //#endregion
2312
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/validator.js
2313
- /**
2314
- * Assert object's properties type
2315
- *
2316
- * @param {object} options
2317
- * @param {object} schema
2318
- * @param {boolean?} allowUnknown
2319
- *
2320
- * @returns {object}
2321
- */
2322
- function assertOptions(options, schema, allowUnknown) {
2323
- if (typeof options !== "object") throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
2324
- const keys = Object.keys(options);
2325
- let i = keys.length;
2326
- while (i-- > 0) {
2327
- const opt = keys[i];
2328
- const validator = schema[opt];
2329
- if (validator) {
2330
- const value = options[opt];
2331
- const result = value === void 0 || validator(value, opt, options);
2332
- if (result !== true) throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
2333
- continue;
2334
- }
2335
- if (allowUnknown !== true) throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
2336
- }
2337
- }
2338
- var validators$1, deprecatedWarnings, validator_default;
2339
- var init_validator = __esmMin((() => {
2340
- init_data();
2341
- init_AxiosError();
2342
- validators$1 = {};
2343
- [
2344
- "object",
2345
- "boolean",
2346
- "number",
2347
- "function",
2348
- "string",
2349
- "symbol"
2350
- ].forEach((type, i) => {
2351
- validators$1[type] = function validator(thing) {
2352
- return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
2353
- };
2354
- });
2355
- deprecatedWarnings = {};
2356
- /**
2357
- * Transitional option validator
2358
- *
2359
- * @param {function|boolean?} validator - set to false if the transitional option has been removed
2360
- * @param {string?} version - deprecated version / removed since version
2361
- * @param {string?} message - some message with additional info
2362
- *
2363
- * @returns {function}
2364
- */
2365
- validators$1.transitional = function transitional(validator, version, message) {
2366
- function formatMessage(opt, desc) {
2367
- return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
2368
- }
2369
- return (value, opt, opts) => {
2370
- if (validator === false) throw new AxiosError$1(formatMessage(opt, " has been removed" + (version ? " in " + version : "")), AxiosError$1.ERR_DEPRECATED);
2371
- if (version && !deprecatedWarnings[opt]) {
2372
- deprecatedWarnings[opt] = true;
2373
- console.warn(formatMessage(opt, " has been deprecated since v" + version + " and will be removed in the near future"));
2374
- }
2375
- return validator ? validator(value, opt, opts) : true;
2376
- };
2377
- };
2378
- validators$1.spelling = function spelling(correctSpelling) {
2379
- return (value, opt) => {
2380
- console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
2381
- return true;
2382
- };
2383
- };
2384
- validator_default = {
2385
- assertOptions,
2386
- validators: validators$1
2387
- };
2388
- }));
2389
- //#endregion
2390
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/Axios.js
2391
- var validators, Axios$1;
2392
- var init_Axios = __esmMin((() => {
2393
- init_utils$1();
2394
- init_buildURL();
2395
- init_InterceptorManager();
2396
- init_dispatchRequest();
2397
- init_mergeConfig();
2398
- init_buildFullPath();
2399
- init_validator();
2400
- init_AxiosHeaders();
2401
- init_transitional();
2402
- validators = validator_default.validators;
2403
- Axios$1 = class {
2404
- constructor(instanceConfig) {
2405
- this.defaults = instanceConfig || {};
2406
- this.interceptors = {
2407
- request: new InterceptorManager(),
2408
- response: new InterceptorManager()
2409
- };
2410
- }
2411
- /**
2412
- * Dispatch a request
2413
- *
2414
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2415
- * @param {?Object} config
2416
- *
2417
- * @returns {Promise} The Promise to be fulfilled
2418
- */
2419
- async request(configOrUrl, config) {
2420
- try {
2421
- return await this._request(configOrUrl, config);
2422
- } catch (err) {
2423
- if (err instanceof Error) {
2424
- let dummy = {};
2425
- Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = /* @__PURE__ */ new Error();
2426
- const stack = (() => {
2427
- if (!dummy.stack) return "";
2428
- const firstNewlineIndex = dummy.stack.indexOf("\n");
2429
- return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
2430
- })();
2431
- try {
2432
- if (!err.stack) err.stack = stack;
2433
- else if (stack) {
2434
- const firstNewlineIndex = stack.indexOf("\n");
2435
- const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf("\n", firstNewlineIndex + 1);
2436
- const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1);
2437
- if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) err.stack += "\n" + stack;
2438
- }
2439
- } catch (e) {}
2440
- }
2441
- throw err;
2442
- }
2443
- }
2444
- _request(configOrUrl, config) {
2445
- if (typeof configOrUrl === "string") {
2446
- config = config || {};
2447
- config.url = configOrUrl;
2448
- } else config = configOrUrl || {};
2449
- config = mergeConfig$1(this.defaults, config);
2450
- const { transitional, paramsSerializer, headers } = config;
2451
- if (transitional !== void 0) validator_default.assertOptions(transitional, {
2452
- silentJSONParsing: validators.transitional(validators.boolean),
2453
- forcedJSONParsing: validators.transitional(validators.boolean),
2454
- clarifyTimeoutError: validators.transitional(validators.boolean),
2455
- legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
2456
- }, false);
2457
- if (paramsSerializer != null) if (utils_default.isFunction(paramsSerializer)) config.paramsSerializer = { serialize: paramsSerializer };
2458
- else validator_default.assertOptions(paramsSerializer, {
2459
- encode: validators.function,
2460
- serialize: validators.function
2461
- }, true);
2462
- if (config.allowAbsoluteUrls !== void 0) {} else if (this.defaults.allowAbsoluteUrls !== void 0) config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
2463
- else config.allowAbsoluteUrls = true;
2464
- validator_default.assertOptions(config, {
2465
- baseUrl: validators.spelling("baseURL"),
2466
- withXsrfToken: validators.spelling("withXSRFToken")
2467
- }, true);
2468
- config.method = (config.method || this.defaults.method || "get").toLowerCase();
2469
- let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]);
2470
- headers && utils_default.forEach([
2471
- "delete",
2472
- "get",
2473
- "head",
2474
- "post",
2475
- "put",
2476
- "patch",
2477
- "common"
2478
- ], (method) => {
2479
- delete headers[method];
2480
- });
2481
- config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
2482
- const requestInterceptorChain = [];
2483
- let synchronousRequestInterceptors = true;
2484
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
2485
- if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) return;
2486
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
2487
- const transitional = config.transitional || transitional_default;
2488
- if (transitional && transitional.legacyInterceptorReqResOrdering) requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
2489
- else requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
2490
- });
2491
- const responseInterceptorChain = [];
2492
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
2493
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
2494
- });
2495
- let promise;
2496
- let i = 0;
2497
- let len;
2498
- if (!synchronousRequestInterceptors) {
2499
- const chain = [dispatchRequest.bind(this), void 0];
2500
- chain.unshift(...requestInterceptorChain);
2501
- chain.push(...responseInterceptorChain);
2502
- len = chain.length;
2503
- promise = Promise.resolve(config);
2504
- while (i < len) promise = promise.then(chain[i++], chain[i++]);
2505
- return promise;
2506
- }
2507
- len = requestInterceptorChain.length;
2508
- let newConfig = config;
2509
- while (i < len) {
2510
- const onFulfilled = requestInterceptorChain[i++];
2511
- const onRejected = requestInterceptorChain[i++];
2512
- try {
2513
- newConfig = onFulfilled(newConfig);
2514
- } catch (error) {
2515
- onRejected.call(this, error);
2516
- break;
2517
- }
2518
- }
2519
- try {
2520
- promise = dispatchRequest.call(this, newConfig);
2521
- } catch (error) {
2522
- return Promise.reject(error);
2523
- }
2524
- i = 0;
2525
- len = responseInterceptorChain.length;
2526
- while (i < len) promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
2527
- return promise;
2528
- }
2529
- getUri(config) {
2530
- config = mergeConfig$1(this.defaults, config);
2531
- return buildURL(buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls), config.params, config.paramsSerializer);
2532
- }
2533
- };
2534
- utils_default.forEach([
2535
- "delete",
2536
- "get",
2537
- "head",
2538
- "options"
2539
- ], function forEachMethodNoData(method) {
2540
- Axios$1.prototype[method] = function(url, config) {
2541
- return this.request(mergeConfig$1(config || {}, {
2542
- method,
2543
- url,
2544
- data: (config || {}).data
2545
- }));
2546
- };
2547
- });
2548
- utils_default.forEach([
2549
- "post",
2550
- "put",
2551
- "patch"
2552
- ], function forEachMethodWithData(method) {
2553
- function generateHTTPMethod(isForm) {
2554
- return function httpMethod(url, data, config) {
2555
- return this.request(mergeConfig$1(config || {}, {
2556
- method,
2557
- headers: isForm ? { "Content-Type": "multipart/form-data" } : {},
2558
- url,
2559
- data
2560
- }));
2561
- };
2562
- }
2563
- Axios$1.prototype[method] = generateHTTPMethod();
2564
- Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
2565
- });
2566
- }));
2567
- //#endregion
2568
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/cancel/CancelToken.js
2569
- var CancelToken$1;
2570
- var init_CancelToken = __esmMin((() => {
2571
- init_CanceledError();
2572
- CancelToken$1 = class CancelToken$1 {
2573
- constructor(executor) {
2574
- if (typeof executor !== "function") throw new TypeError("executor must be a function.");
2575
- let resolvePromise;
2576
- this.promise = new Promise(function promiseExecutor(resolve) {
2577
- resolvePromise = resolve;
2578
- });
2579
- const token = this;
2580
- this.promise.then((cancel) => {
2581
- if (!token._listeners) return;
2582
- let i = token._listeners.length;
2583
- while (i-- > 0) token._listeners[i](cancel);
2584
- token._listeners = null;
2585
- });
2586
- this.promise.then = (onfulfilled) => {
2587
- let _resolve;
2588
- const promise = new Promise((resolve) => {
2589
- token.subscribe(resolve);
2590
- _resolve = resolve;
2591
- }).then(onfulfilled);
2592
- promise.cancel = function reject() {
2593
- token.unsubscribe(_resolve);
2594
- };
2595
- return promise;
2596
- };
2597
- executor(function cancel(message, config, request) {
2598
- if (token.reason) return;
2599
- token.reason = new CanceledError$1(message, config, request);
2600
- resolvePromise(token.reason);
2601
- });
2602
- }
2603
- /**
2604
- * Throws a `CanceledError` if cancellation has been requested.
2605
- */
2606
- throwIfRequested() {
2607
- if (this.reason) throw this.reason;
2608
- }
2609
- /**
2610
- * Subscribe to the cancel signal
2611
- */
2612
- subscribe(listener) {
2613
- if (this.reason) {
2614
- listener(this.reason);
2615
- return;
2616
- }
2617
- if (this._listeners) this._listeners.push(listener);
2618
- else this._listeners = [listener];
2619
- }
2620
- /**
2621
- * Unsubscribe from the cancel signal
2622
- */
2623
- unsubscribe(listener) {
2624
- if (!this._listeners) return;
2625
- const index = this._listeners.indexOf(listener);
2626
- if (index !== -1) this._listeners.splice(index, 1);
2627
- }
2628
- toAbortSignal() {
2629
- const controller = new AbortController();
2630
- const abort = (err) => {
2631
- controller.abort(err);
2632
- };
2633
- this.subscribe(abort);
2634
- controller.signal.unsubscribe = () => this.unsubscribe(abort);
2635
- return controller.signal;
2636
- }
2637
- /**
2638
- * Returns an object that contains a new `CancelToken` and a function that, when called,
2639
- * cancels the `CancelToken`.
2640
- */
2641
- static source() {
2642
- let cancel;
2643
- return {
2644
- token: new CancelToken$1(function executor(c) {
2645
- cancel = c;
2646
- }),
2647
- cancel
2648
- };
2649
- }
2650
- };
2651
- }));
2652
- //#endregion
2653
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/spread.js
2654
- /**
2655
- * Syntactic sugar for invoking a function and expanding an array for arguments.
2656
- *
2657
- * Common use case would be to use `Function.prototype.apply`.
2658
- *
2659
- * ```js
2660
- * function f(x, y, z) {}
2661
- * const args = [1, 2, 3];
2662
- * f.apply(null, args);
2663
- * ```
2664
- *
2665
- * With `spread` this example can be re-written.
2666
- *
2667
- * ```js
2668
- * spread(function(x, y, z) {})([1, 2, 3]);
2669
- * ```
2670
- *
2671
- * @param {Function} callback
2672
- *
2673
- * @returns {Function}
2674
- */
2675
- function spread$1(callback) {
2676
- return function wrap(arr) {
2677
- return callback.apply(null, arr);
2678
- };
2679
- }
2680
- var init_spread = __esmMin((() => {}));
2681
- //#endregion
2682
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/isAxiosError.js
2683
- /**
2684
- * Determines whether the payload is an error thrown by Axios
2685
- *
2686
- * @param {*} payload The value to test
2687
- *
2688
- * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
2689
- */
2690
- function isAxiosError$1(payload) {
2691
- return utils_default.isObject(payload) && payload.isAxiosError === true;
2692
- }
2693
- var init_isAxiosError = __esmMin((() => {
2694
- init_utils$1();
2695
- }));
2696
- //#endregion
2697
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/HttpStatusCode.js
2698
- var HttpStatusCode$1;
2699
- var init_HttpStatusCode = __esmMin((() => {
2700
- HttpStatusCode$1 = {
2701
- Continue: 100,
2702
- SwitchingProtocols: 101,
2703
- Processing: 102,
2704
- EarlyHints: 103,
2705
- Ok: 200,
2706
- Created: 201,
2707
- Accepted: 202,
2708
- NonAuthoritativeInformation: 203,
2709
- NoContent: 204,
2710
- ResetContent: 205,
2711
- PartialContent: 206,
2712
- MultiStatus: 207,
2713
- AlreadyReported: 208,
2714
- ImUsed: 226,
2715
- MultipleChoices: 300,
2716
- MovedPermanently: 301,
2717
- Found: 302,
2718
- SeeOther: 303,
2719
- NotModified: 304,
2720
- UseProxy: 305,
2721
- Unused: 306,
2722
- TemporaryRedirect: 307,
2723
- PermanentRedirect: 308,
2724
- BadRequest: 400,
2725
- Unauthorized: 401,
2726
- PaymentRequired: 402,
2727
- Forbidden: 403,
2728
- NotFound: 404,
2729
- MethodNotAllowed: 405,
2730
- NotAcceptable: 406,
2731
- ProxyAuthenticationRequired: 407,
2732
- RequestTimeout: 408,
2733
- Conflict: 409,
2734
- Gone: 410,
2735
- LengthRequired: 411,
2736
- PreconditionFailed: 412,
2737
- PayloadTooLarge: 413,
2738
- UriTooLong: 414,
2739
- UnsupportedMediaType: 415,
2740
- RangeNotSatisfiable: 416,
2741
- ExpectationFailed: 417,
2742
- ImATeapot: 418,
2743
- MisdirectedRequest: 421,
2744
- UnprocessableEntity: 422,
2745
- Locked: 423,
2746
- FailedDependency: 424,
2747
- TooEarly: 425,
2748
- UpgradeRequired: 426,
2749
- PreconditionRequired: 428,
2750
- TooManyRequests: 429,
2751
- RequestHeaderFieldsTooLarge: 431,
2752
- UnavailableForLegalReasons: 451,
2753
- InternalServerError: 500,
2754
- NotImplemented: 501,
2755
- BadGateway: 502,
2756
- ServiceUnavailable: 503,
2757
- GatewayTimeout: 504,
2758
- HttpVersionNotSupported: 505,
2759
- VariantAlsoNegotiates: 506,
2760
- InsufficientStorage: 507,
2761
- LoopDetected: 508,
2762
- NotExtended: 510,
2763
- NetworkAuthenticationRequired: 511,
2764
- WebServerIsDown: 521,
2765
- ConnectionTimedOut: 522,
2766
- OriginIsUnreachable: 523,
2767
- TimeoutOccurred: 524,
2768
- SslHandshakeFailed: 525,
2769
- InvalidSslCertificate: 526
2770
- };
2771
- Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
2772
- HttpStatusCode$1[value] = key;
2773
- });
2774
- }));
2775
- //#endregion
2776
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/axios.js
2777
- /**
2778
- * Create an instance of Axios
2779
- *
2780
- * @param {Object} defaultConfig The default config for the instance
2781
- *
2782
- * @returns {Axios} A new instance of Axios
2783
- */
2784
- function createInstance(defaultConfig) {
2785
- const context = new Axios$1(defaultConfig);
2786
- const instance = bind(Axios$1.prototype.request, context);
2787
- utils_default.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
2788
- utils_default.extend(instance, context, null, { allOwnKeys: true });
2789
- instance.create = function create(instanceConfig) {
2790
- return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
2791
- };
2792
- return instance;
2793
- }
2794
- var axios$1;
2795
- var init_axios$1 = __esmMin((() => {
2796
- init_utils$1();
2797
- init_bind();
2798
- init_Axios();
2799
- init_mergeConfig();
2800
- init_defaults();
2801
- init_formDataToJSON();
2802
- init_CanceledError();
2803
- init_CancelToken();
2804
- init_isCancel();
2805
- init_data();
2806
- init_toFormData();
2807
- init_AxiosError();
2808
- init_spread();
2809
- init_isAxiosError();
2810
- init_AxiosHeaders();
2811
- init_adapters();
2812
- init_HttpStatusCode();
2813
- axios$1 = createInstance(defaults);
2814
- axios$1.Axios = Axios$1;
2815
- axios$1.CanceledError = CanceledError$1;
2816
- axios$1.CancelToken = CancelToken$1;
2817
- axios$1.isCancel = isCancel$1;
2818
- axios$1.VERSION = VERSION$1;
2819
- axios$1.toFormData = toFormData$1;
2820
- axios$1.AxiosError = AxiosError$1;
2821
- axios$1.Cancel = axios$1.CanceledError;
2822
- axios$1.all = function all(promises) {
2823
- return Promise.all(promises);
2824
- };
2825
- axios$1.spread = spread$1;
2826
- axios$1.isAxiosError = isAxiosError$1;
2827
- axios$1.mergeConfig = mergeConfig$1;
2828
- axios$1.AxiosHeaders = AxiosHeaders$1;
2829
- axios$1.formToJSON = (thing) => formDataToJSON(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
2830
- axios$1.getAdapter = adapters_default.getAdapter;
2831
- axios$1.HttpStatusCode = HttpStatusCode$1;
2832
- axios$1.default = axios$1;
2833
- }));
2834
- //#endregion
2835
- //#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/index.js
2836
- var Axios, AxiosError, CanceledError, isCancel, CancelToken, VERSION, all, Cancel, isAxiosError, spread, toFormData, AxiosHeaders, HttpStatusCode, formToJSON, getAdapter, mergeConfig;
2837
- var init_axios = __esmMin((() => {
2838
- init_axios$1();
2839
- ({Axios, AxiosError, CanceledError, isCancel, CancelToken, VERSION, all, Cancel, isAxiosError, spread, toFormData, AxiosHeaders, HttpStatusCode, formToJSON, getAdapter, mergeConfig} = axios$1);
2840
- }));
2841
- //#endregion
2842
- //#region src/base/config.ts
2843
- var state, config, prefix, apiUrl, config_default;
2844
- var init_config = __esmMin((() => {
2845
- state = window.__INITIAL_STATE__ || {};
2846
- config = state.config || {};
2847
- prefix = config.prefix || "";
2848
- apiUrl = config.apiUrl || "";
2849
- config_default = {
2850
- ...config,
2851
- state,
2852
- prefix,
2853
- apiUrl,
2854
- baseURL: `${location.origin}` + prefix,
2855
- timeout: 3e4,
2856
- logUrl: prefix + "/api/monitor/log"
2857
- };
2858
- }));
2859
- //#endregion
2860
- //#region node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.js
2861
- var require_eventemitter3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2862
- var has = Object.prototype.hasOwnProperty, prefix = "~";
2863
- /**
2864
- * Constructor to create a storage for our `EE` objects.
2865
- * An `Events` instance is a plain object whose properties are event names.
2866
- *
2867
- * @constructor
2868
- * @private
2869
- */
2870
- function Events() {}
2871
- if (Object.create) {
2872
- Events.prototype = Object.create(null);
2873
- if (!new Events().__proto__) prefix = false;
2874
- }
2875
- /**
2876
- * Representation of a single event listener.
2877
- *
2878
- * @param {Function} fn The listener function.
2879
- * @param {*} context The context to invoke the listener with.
2880
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
2881
- * @constructor
2882
- * @private
2883
- */
2884
- function EE(fn, context, once) {
2885
- this.fn = fn;
2886
- this.context = context;
2887
- this.once = once || false;
2888
- }
2889
- /**
2890
- * Add a listener for a given event.
2891
- *
2892
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
2893
- * @param {(String|Symbol)} event The event name.
2894
- * @param {Function} fn The listener function.
2895
- * @param {*} context The context to invoke the listener with.
2896
- * @param {Boolean} once Specify if the listener is a one-time listener.
2897
- * @returns {EventEmitter}
2898
- * @private
2899
- */
2900
- function addListener(emitter, event, fn, context, once) {
2901
- if (typeof fn !== "function") throw new TypeError("The listener must be a function");
2902
- var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
2903
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
2904
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
2905
- else emitter._events[evt] = [emitter._events[evt], listener];
2906
- return emitter;
2907
- }
2908
- /**
2909
- * Clear event by name.
2910
- *
2911
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
2912
- * @param {(String|Symbol)} evt The Event name.
2913
- * @private
2914
- */
2915
- function clearEvent(emitter, evt) {
2916
- if (--emitter._eventsCount === 0) emitter._events = new Events();
2917
- else delete emitter._events[evt];
2918
- }
2919
- /**
2920
- * Minimal `EventEmitter` interface that is molded against the Node.js
2921
- * `EventEmitter` interface.
2922
- *
2923
- * @constructor
2924
- * @public
2925
- */
2926
- function EventEmitter() {
2927
- this._events = new Events();
2928
- this._eventsCount = 0;
2929
- }
2930
- /**
2931
- * Return an array listing the events for which the emitter has registered
2932
- * listeners.
2933
- *
2934
- * @returns {Array}
2935
- * @public
2936
- */
2937
- EventEmitter.prototype.eventNames = function eventNames() {
2938
- var names = [], events, name;
2939
- if (this._eventsCount === 0) return names;
2940
- for (name in events = this._events) if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
2941
- if (Object.getOwnPropertySymbols) return names.concat(Object.getOwnPropertySymbols(events));
2942
- return names;
2943
- };
2944
- /**
2945
- * Return the listeners registered for a given event.
2946
- *
2947
- * @param {(String|Symbol)} event The event name.
2948
- * @returns {Array} The registered listeners.
2949
- * @public
2950
- */
2951
- EventEmitter.prototype.listeners = function listeners(event) {
2952
- var evt = prefix ? prefix + event : event, handlers = this._events[evt];
2953
- if (!handlers) return [];
2954
- if (handlers.fn) return [handlers.fn];
2955
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) ee[i] = handlers[i].fn;
2956
- return ee;
2957
- };
2958
- /**
2959
- * Return the number of listeners listening to a given event.
2960
- *
2961
- * @param {(String|Symbol)} event The event name.
2962
- * @returns {Number} The number of listeners.
2963
- * @public
2964
- */
2965
- EventEmitter.prototype.listenerCount = function listenerCount(event) {
2966
- var evt = prefix ? prefix + event : event, listeners = this._events[evt];
2967
- if (!listeners) return 0;
2968
- if (listeners.fn) return 1;
2969
- return listeners.length;
2970
- };
2971
- /**
2972
- * Calls each of the listeners registered for a given event.
2973
- *
2974
- * @param {(String|Symbol)} event The event name.
2975
- * @returns {Boolean} `true` if the event had listeners, else `false`.
2976
- * @public
2977
- */
2978
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
2979
- var evt = prefix ? prefix + event : event;
2980
- if (!this._events[evt]) return false;
2981
- var listeners = this._events[evt], len = arguments.length, args, i;
2982
- if (listeners.fn) {
2983
- if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
2984
- switch (len) {
2985
- case 1: return listeners.fn.call(listeners.context), true;
2986
- case 2: return listeners.fn.call(listeners.context, a1), true;
2987
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
2988
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
2989
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
2990
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
2991
- }
2992
- for (i = 1, args = new Array(len - 1); i < len; i++) args[i - 1] = arguments[i];
2993
- listeners.fn.apply(listeners.context, args);
2994
- } else {
2995
- var length = listeners.length, j;
2996
- for (i = 0; i < length; i++) {
2997
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, void 0, true);
2998
- switch (len) {
2999
- case 1:
3000
- listeners[i].fn.call(listeners[i].context);
3001
- break;
3002
- case 2:
3003
- listeners[i].fn.call(listeners[i].context, a1);
3004
- break;
3005
- case 3:
3006
- listeners[i].fn.call(listeners[i].context, a1, a2);
3007
- break;
3008
- case 4:
3009
- listeners[i].fn.call(listeners[i].context, a1, a2, a3);
3010
- break;
3011
- default:
3012
- if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) args[j - 1] = arguments[j];
3013
- listeners[i].fn.apply(listeners[i].context, args);
3014
- }
3015
- }
3016
- }
3017
- return true;
3018
- };
3019
- /**
3020
- * Add a listener for a given event.
3021
- *
3022
- * @param {(String|Symbol)} event The event name.
3023
- * @param {Function} fn The listener function.
3024
- * @param {*} [context=this] The context to invoke the listener with.
3025
- * @returns {EventEmitter} `this`.
3026
- * @public
3027
- */
3028
- EventEmitter.prototype.on = function on(event, fn, context) {
3029
- return addListener(this, event, fn, context, false);
3030
- };
3031
- /**
3032
- * Add a one-time listener for a given event.
3033
- *
3034
- * @param {(String|Symbol)} event The event name.
3035
- * @param {Function} fn The listener function.
3036
- * @param {*} [context=this] The context to invoke the listener with.
3037
- * @returns {EventEmitter} `this`.
3038
- * @public
3039
- */
3040
- EventEmitter.prototype.once = function once(event, fn, context) {
3041
- return addListener(this, event, fn, context, true);
3042
- };
3043
- /**
3044
- * Remove the listeners of a given event.
3045
- *
3046
- * @param {(String|Symbol)} event The event name.
3047
- * @param {Function} fn Only remove the listeners that match this function.
3048
- * @param {*} context Only remove the listeners that have this context.
3049
- * @param {Boolean} once Only remove one-time listeners.
3050
- * @returns {EventEmitter} `this`.
3051
- * @public
3052
- */
3053
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
3054
- var evt = prefix ? prefix + event : event;
3055
- if (!this._events[evt]) return this;
3056
- if (!fn) {
3057
- clearEvent(this, evt);
3058
- return this;
3059
- }
3060
- var listeners = this._events[evt];
3061
- if (listeners.fn) {
3062
- if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) clearEvent(this, evt);
3063
- } else {
3064
- for (var i = 0, events = [], length = listeners.length; i < length; i++) if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) events.push(listeners[i]);
3065
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
3066
- else clearEvent(this, evt);
3067
- }
3068
- return this;
3069
- };
3070
- /**
3071
- * Remove all listeners, or those of the specified event.
3072
- *
3073
- * @param {(String|Symbol)} [event] The event name.
3074
- * @returns {EventEmitter} `this`.
3075
- * @public
3076
- */
3077
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
3078
- var evt;
3079
- if (event) {
3080
- evt = prefix ? prefix + event : event;
3081
- if (this._events[evt]) clearEvent(this, evt);
3082
- } else {
3083
- this._events = new Events();
3084
- this._eventsCount = 0;
3085
- }
3086
- return this;
3087
- };
3088
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
3089
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
3090
- EventEmitter.prefixed = prefix;
3091
- EventEmitter.EventEmitter = EventEmitter;
3092
- if ("undefined" !== typeof module) module.exports = EventEmitter;
3093
- }));
3094
- //#endregion
3095
- //#region node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.mjs
3096
- var import_eventemitter3, eventemitter3_default;
3097
- var init_eventemitter3 = __esmMin((() => {
3098
- import_eventemitter3 = /* @__PURE__ */ __toESM(require_eventemitter3(), 1);
3099
- eventemitter3_default = import_eventemitter3.default;
3100
- }));
3101
- //#endregion
3102
- //#region node_modules/.pnpm/@fefeding+eventemitter@1.0.5/node_modules/@fefeding/eventemitter/dist/index.js
3103
- var JEventEmitter;
3104
- var init_dist = __esmMin((() => {
3105
- init_eventemitter3();
3106
- JEventEmitter = class JEventEmitter extends eventemitter3_default {
3107
- /**
3108
- * 唯一标识
3109
- */
3110
- key = "";
3111
- /**
3112
- * 私有方法,用于规范化事件名
3113
- * @param name - 可以是字符串、符号或字符串数组
3114
- * @returns 返回符号或字符串数组
3115
- */
3116
- normalizeEventNames(name) {
3117
- if (!name) return [];
3118
- if (typeof name === "string") return name.split(" ");
3119
- return Array.isArray(name) ? name : [name];
3120
- }
3121
- /**
3122
- * 为给定的事件添加一个监听器
3123
- * @param event - 事件名,可以是字符串、符号或字符串数组
3124
- * @param fn - 监听函数,参数列表为可变参数
3125
- * @param context - 可选,上下文对象
3126
- * @returns 返回 EventEmitter 实例
3127
- */
3128
- on(event, fn, context) {
3129
- const events = this.normalizeEventNames(event);
3130
- for (const name of events) name && super.on(name, fn, context);
3131
- return this;
3132
- }
3133
- /**
3134
- * 移除给定的事件的一个监听器
3135
- * @param event - 事件名,可以是字符串、符号或字符串数组
3136
- * @param fn - 可选,监听函数,参数列表为可变参数
3137
- * @param context - 可选,上下文对象
3138
- * @param once - 可选,是否只执行一次
3139
- * @returns 返回 EventEmitter 实例
3140
- */
3141
- off(event, fn, context, once) {
3142
- const events = this.normalizeEventNames(event);
3143
- for (const name of events) name && super.off(name, fn, context);
3144
- return this;
3145
- }
3146
- /**
3147
- * 消毁
3148
- */
3149
- destory() {
3150
- this.removeAllListeners();
3151
- if (this.key) JEventEmitter.removeEmitter(this.key);
3152
- }
3153
- static emitters = /* @__PURE__ */ new Map();
3154
- static getEmitter(key) {
3155
- let emmiter = this.emitters.get(key);
3156
- if (!emmiter) {
3157
- emmiter = new JEventEmitter();
3158
- emmiter.key = key;
3159
- this.emitters.set(key, emmiter);
3160
- }
3161
- return emmiter;
3162
- }
3163
- static removeEmitter(key) {
3164
- if (this.emitters.has(key)) return this.emitters.delete(key);
3165
- return false;
3166
- }
3167
- };
3168
- }));
3169
- //#endregion
3170
- //#region src/base/entity.ts
3171
- var Entity;
3172
- var init_entity = __esmMin((() => {
3173
- init_dist();
3174
- Entity = class extends JEventEmitter {
3175
- /**
3176
- * 状态
3177
- * @public
3178
- */
3179
- state;
3180
- /**
3181
- * @public
3182
- * @param data - initialization data.
3183
- */
3184
- constructor(data) {
3185
- super();
3186
- this.state = new Proxy(data || {}, { set: (oTarget, sKey, vValue) => {
3187
- if (oTarget[sKey] !== vValue) {
3188
- const oldValue = { ...oTarget };
3189
- oTarget[sKey] = vValue;
3190
- this.emit("update", { ...oTarget }, oldValue, sKey);
3191
- }
3192
- return true;
3193
- } });
3194
- }
3195
- /**
3196
- * @public
3197
- * @param cb - Callback function to execute on state updates.
3198
- * return Callback to lift the watch state.
3199
- */
3200
- watch(cb) {
3201
- this.on("update", cb);
3202
- return () => this.off("update", cb);
3203
- }
3204
- };
3205
- }));
3206
- //#endregion
3207
- //#region src/domain/SysConfig.ts
3208
- var SysConfig, sysConfig;
3209
- var init_SysConfig = __esmMin((() => {
3210
- init_entity();
3211
- init_config();
3212
- SysConfig = class extends Entity {
3213
- constructor(state) {
3214
- super(state);
3215
- }
3216
- /**
3217
- * 获取系统标题
3218
- */
3219
- get title() {
3220
- return this.state.title;
3221
- }
3222
- get url() {
3223
- return this.state?.url;
3224
- }
3225
- get sso() {
3226
- return this.state?.sso;
3227
- }
3228
- get config() {
3229
- return this.state?.config;
3230
- }
3231
- get user() {
3232
- return this.state.session?.user;
3233
- }
3234
- get session() {
3235
- return this.state.session;
3236
- }
3237
- get isManager() {
3238
- return this.state.isManager;
3239
- }
3240
- get rootUrl() {
3241
- return location.origin + (this.config?.prefix || "");
3242
- }
3243
- get baseUrl() {
3244
- if (this.sso?.baseUrl) return this.sso.baseUrl;
3245
- else return this.rootUrl;
3246
- }
3247
- getLoginUrl(redirectUrl = location.href) {
3248
- if (this.baseUrl === this.rootUrl) return this.baseUrl + "/login";
3249
- return this.baseUrl + "/login?url=" + encodeURIComponent(redirectUrl);
3250
- }
3251
- getLogoutUrl(redirectUrl = location.href) {
3252
- if (this.baseUrl === this.rootUrl) return this.baseUrl + "/logout";
3253
- return this.baseUrl + "/logout?url=" + encodeURIComponent(redirectUrl);
3254
- }
3255
- };
3256
- sysConfig = new SysConfig(config_default.state);
3257
- }));
3258
- //#endregion
3259
- //#region node_modules/.pnpm/pinia@3.0.4_typescript@5.9.3_vue@3.5.32_typescript@5.9.3_/node_modules/pinia/dist/pinia.mjs
3260
- function isPlainObject(o) {
3261
- return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
3262
- }
3263
- function bom(blob, { autoBom = false } = {}) {
3264
- if (autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) return new Blob([String.fromCharCode(65279), blob], { type: blob.type });
3265
- return blob;
3266
- }
3267
- function download(url, name, opts) {
3268
- const xhr = new XMLHttpRequest();
3269
- xhr.open("GET", url);
3270
- xhr.responseType = "blob";
3271
- xhr.onload = function() {
3272
- saveAs(xhr.response, name, opts);
3273
- };
3274
- xhr.onerror = function() {
3275
- console.error("could not download file");
3276
- };
3277
- xhr.send();
3278
- }
3279
- function corsEnabled(url) {
3280
- const xhr = new XMLHttpRequest();
3281
- xhr.open("HEAD", url, false);
3282
- try {
3283
- xhr.send();
3284
- } catch (e) {}
3285
- return xhr.status >= 200 && xhr.status <= 299;
3286
- }
3287
- function click(node) {
3288
- try {
3289
- node.dispatchEvent(new MouseEvent("click"));
3290
- } catch (e) {
3291
- const evt = new MouseEvent("click", {
3292
- bubbles: true,
3293
- cancelable: true,
3294
- view: window,
3295
- detail: 0,
3296
- screenX: 80,
3297
- screenY: 20,
3298
- clientX: 80,
3299
- clientY: 20,
3300
- ctrlKey: false,
3301
- altKey: false,
3302
- shiftKey: false,
3303
- metaKey: false,
3304
- button: 0,
3305
- relatedTarget: null
3306
- });
3307
- node.dispatchEvent(evt);
3308
- }
3309
- }
3310
- function downloadSaveAs(blob, name = "download", opts) {
3311
- const a = document.createElement("a");
3312
- a.download = name;
3313
- a.rel = "noopener";
3314
- if (typeof blob === "string") {
3315
- a.href = blob;
3316
- if (a.origin !== location.origin) if (corsEnabled(a.href)) download(blob, name, opts);
3317
- else {
3318
- a.target = "_blank";
3319
- click(a);
3320
- }
3321
- else click(a);
3322
- } else {
3323
- a.href = URL.createObjectURL(blob);
3324
- setTimeout(function() {
3325
- URL.revokeObjectURL(a.href);
3326
- }, 4e4);
3327
- setTimeout(function() {
3328
- click(a);
3329
- }, 0);
3330
- }
3331
- }
3332
- function msSaveAs(blob, name = "download", opts) {
3333
- if (typeof blob === "string") if (corsEnabled(blob)) download(blob, name, opts);
3334
- else {
3335
- const a = document.createElement("a");
3336
- a.href = blob;
3337
- a.target = "_blank";
3338
- setTimeout(function() {
3339
- click(a);
3340
- });
3341
- }
3342
- else navigator.msSaveOrOpenBlob(bom(blob, opts), name);
3343
- }
3344
- function fileSaverSaveAs(blob, name, opts, popup) {
3345
- popup = popup || open("", "_blank");
3346
- if (popup) popup.document.title = popup.document.body.innerText = "downloading...";
3347
- if (typeof blob === "string") return download(blob, name, opts);
3348
- const force = blob.type === "application/octet-stream";
3349
- const isSafari = /constructor/i.test(String(_global.HTMLElement)) || "safari" in _global;
3350
- const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent);
3351
- if ((isChromeIOS || force && isSafari || isMacOSWebView) && typeof FileReader !== "undefined") {
3352
- const reader = new FileReader();
3353
- reader.onloadend = function() {
3354
- let url = reader.result;
3355
- if (typeof url !== "string") {
3356
- popup = null;
3357
- throw new Error("Wrong reader.result type");
3358
- }
3359
- url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, "data:attachment/file;");
3360
- if (popup) popup.location.href = url;
3361
- else location.assign(url);
3362
- popup = null;
3363
- };
3364
- reader.readAsDataURL(blob);
3365
- } else {
3366
- const url = URL.createObjectURL(blob);
3367
- if (popup) popup.location.assign(url);
3368
- else location.href = url;
3369
- popup = null;
3370
- setTimeout(function() {
3371
- URL.revokeObjectURL(url);
3372
- }, 4e4);
3373
- }
3374
- }
3375
- /**
3376
- * Creates a Pinia instance to be used by the application
3377
- */
3378
- function createPinia() {
3379
- const scope = effectScope(true);
3380
- const state = scope.run(() => ref({}));
3381
- let _p = [];
3382
- let toBeInstalled = [];
3383
- const pinia = markRaw({
3384
- install(app) {
3385
- setActivePinia(pinia);
3386
- pinia._a = app;
3387
- app.provide(piniaSymbol, pinia);
3388
- app.config.globalProperties.$pinia = pinia;
3389
- toBeInstalled.forEach((plugin) => _p.push(plugin));
3390
- toBeInstalled = [];
3391
- },
3392
- use(plugin) {
3393
- if (!this._a) toBeInstalled.push(plugin);
3394
- else _p.push(plugin);
3395
- return this;
3396
- },
3397
- _p,
3398
- _a: null,
3399
- _e: scope,
3400
- _s: /* @__PURE__ */ new Map(),
3401
- state
3402
- });
3403
- return pinia;
3404
- }
3405
- function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
3406
- subscriptions.add(callback);
3407
- const removeSubscription = () => {
3408
- subscriptions.delete(callback) && onCleanup();
3409
- };
3410
- if (!detached && getCurrentScope()) onScopeDispose(removeSubscription);
3411
- return removeSubscription;
3412
- }
3413
- function triggerSubscriptions(subscriptions, ...args) {
3414
- subscriptions.forEach((callback) => {
3415
- callback(...args);
3416
- });
3417
- }
3418
- function mergeReactiveObjects(target, patchToApply) {
3419
- if (target instanceof Map && patchToApply instanceof Map) patchToApply.forEach((value, key) => target.set(key, value));
3420
- else if (target instanceof Set && patchToApply instanceof Set) patchToApply.forEach(target.add, target);
3421
- for (const key in patchToApply) {
3422
- if (!patchToApply.hasOwnProperty(key)) continue;
3423
- const subPatch = patchToApply[key];
3424
- const targetValue = target[key];
3425
- if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) target[key] = mergeReactiveObjects(targetValue, subPatch);
3426
- else target[key] = subPatch;
3427
- }
3428
- return target;
3429
- }
3430
- /**
3431
- * Returns whether a value should be hydrated
3432
- *
3433
- * @param obj - target variable
3434
- * @returns true if `obj` should be hydrated
3435
- */
3436
- function shouldHydrate(obj) {
3437
- return !isPlainObject(obj) || !Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol);
3438
- }
3439
- function isComputed(o) {
3440
- return !!(isRef(o) && o.effect);
3441
- }
3442
- function createOptionsStore(id, options, pinia, hot) {
3443
- const { state, actions, getters } = options;
3444
- const initialState = pinia.state.value[id];
3445
- let store;
3446
- function setup() {
3447
- if (!initialState && true)
3448
- /* istanbul ignore if */
3449
- pinia.state.value[id] = state ? state() : {};
3450
- return assign(toRefs(pinia.state.value[id]), actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
3451
- computedGetters[name] = markRaw(computed(() => {
3452
- setActivePinia(pinia);
3453
- const store = pinia._s.get(id);
3454
- return getters[name].call(store, store);
3455
- }));
3456
- return computedGetters;
3457
- }, {}));
3458
- }
3459
- store = createSetupStore(id, setup, options, pinia, hot, true);
3460
- return store;
3461
- }
3462
- function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
3463
- let scope;
3464
- const optionsForPlugin = assign({ actions: {} }, options);
3465
- const $subscribeOptions = { deep: true };
3466
- let isListening;
3467
- let isSyncListening;
3468
- let subscriptions = /* @__PURE__ */ new Set();
3469
- let actionSubscriptions = /* @__PURE__ */ new Set();
3470
- let debuggerEvents;
3471
- const initialState = pinia.state.value[$id];
3472
- if (!isOptionsStore && !initialState && true)
3473
- /* istanbul ignore if */
3474
- pinia.state.value[$id] = {};
3475
- ref({});
3476
- let activeListener;
3477
- function $patch(partialStateOrMutator) {
3478
- let subscriptionMutation;
3479
- isListening = isSyncListening = false;
3480
- if (typeof partialStateOrMutator === "function") {
3481
- partialStateOrMutator(pinia.state.value[$id]);
3482
- subscriptionMutation = {
3483
- type: MutationType.patchFunction,
3484
- storeId: $id,
3485
- events: debuggerEvents
3486
- };
3487
- } else {
3488
- mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
3489
- subscriptionMutation = {
3490
- type: MutationType.patchObject,
3491
- payload: partialStateOrMutator,
3492
- storeId: $id,
3493
- events: debuggerEvents
3494
- };
3495
- }
3496
- const myListenerId = activeListener = Symbol();
3497
- nextTick().then(() => {
3498
- if (activeListener === myListenerId) isListening = true;
3499
- });
3500
- isSyncListening = true;
3501
- triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
3502
- }
3503
- const $reset = isOptionsStore ? function $reset() {
3504
- const { state } = options;
3505
- const newState = state ? state() : {};
3506
- this.$patch(($state) => {
3507
- assign($state, newState);
3508
- });
3509
- } : noop;
3510
- function $dispose() {
3511
- scope.stop();
3512
- subscriptions.clear();
3513
- actionSubscriptions.clear();
3514
- pinia._s.delete($id);
3515
- }
3516
- /**
3517
- * Helper that wraps function so it can be tracked with $onAction
3518
- * @param fn - action to wrap
3519
- * @param name - name of the action
3520
- */
3521
- const action = (fn, name = "") => {
3522
- if (ACTION_MARKER in fn) {
3523
- fn[ACTION_NAME] = name;
3524
- return fn;
3525
- }
3526
- const wrappedAction = function() {
3527
- setActivePinia(pinia);
3528
- const args = Array.from(arguments);
3529
- const afterCallbackSet = /* @__PURE__ */ new Set();
3530
- const onErrorCallbackSet = /* @__PURE__ */ new Set();
3531
- function after(callback) {
3532
- afterCallbackSet.add(callback);
3533
- }
3534
- function onError(callback) {
3535
- onErrorCallbackSet.add(callback);
3536
- }
3537
- triggerSubscriptions(actionSubscriptions, {
3538
- args,
3539
- name: wrappedAction[ACTION_NAME],
3540
- store,
3541
- after,
3542
- onError
3543
- });
3544
- let ret;
3545
- try {
3546
- ret = fn.apply(this && this.$id === $id ? this : store, args);
3547
- } catch (error) {
3548
- triggerSubscriptions(onErrorCallbackSet, error);
3549
- throw error;
3550
- }
3551
- if (ret instanceof Promise) return ret.then((value) => {
3552
- triggerSubscriptions(afterCallbackSet, value);
3553
- return value;
3554
- }).catch((error) => {
3555
- triggerSubscriptions(onErrorCallbackSet, error);
3556
- return Promise.reject(error);
3557
- });
3558
- triggerSubscriptions(afterCallbackSet, ret);
3559
- return ret;
3560
- };
3561
- wrappedAction[ACTION_MARKER] = true;
3562
- wrappedAction[ACTION_NAME] = name;
3563
- return wrappedAction;
3564
- };
3565
- const store = reactive({
3566
- _p: pinia,
3567
- $id,
3568
- $onAction: addSubscription.bind(null, actionSubscriptions),
3569
- $patch,
3570
- $reset,
3571
- $subscribe(callback, options = {}) {
3572
- const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher());
3573
- const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {
3574
- if (options.flush === "sync" ? isSyncListening : isListening) callback({
3575
- storeId: $id,
3576
- type: MutationType.direct,
3577
- events: debuggerEvents
3578
- }, state);
3579
- }, assign({}, $subscribeOptions, options)));
3580
- return removeSubscription;
3581
- },
3582
- $dispose
3583
- });
3584
- pinia._s.set($id, store);
3585
- const setupStore = (pinia._a && pinia._a.runWithContext || fallbackRunWithContext)(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action }))));
3586
- for (const key in setupStore) {
3587
- const prop = setupStore[key];
3588
- if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
3589
- if (!isOptionsStore) {
3590
- if (initialState && shouldHydrate(prop)) if (isRef(prop)) prop.value = initialState[key];
3591
- else mergeReactiveObjects(prop, initialState[key]);
3592
- pinia.state.value[$id][key] = prop;
3593
- }
3594
- } else if (typeof prop === "function") {
3595
- setupStore[key] = action(prop, key);
3596
- optionsForPlugin.actions[key] = prop;
3597
- }
3598
- }
3599
- /* istanbul ignore if */
3600
- assign(store, setupStore);
3601
- assign(toRaw(store), setupStore);
3602
- Object.defineProperty(store, "$state", {
3603
- get: () => pinia.state.value[$id],
3604
- set: (state) => {
3605
- $patch(($state) => {
3606
- assign($state, state);
3607
- });
3608
- }
3609
- });
3610
- pinia._p.forEach((extender) => {
3611
- assign(store, scope.run(() => extender({
3612
- store,
3613
- app: pinia._a,
3614
- pinia,
3615
- options: optionsForPlugin
3616
- })));
3617
- });
3618
- if (initialState && isOptionsStore && options.hydrate) options.hydrate(store.$state, initialState);
3619
- isListening = true;
3620
- isSyncListening = true;
3621
- return store;
3622
- }
3623
- /*! #__NO_SIDE_EFFECTS__ */
3624
- function defineStore(id, setup, setupOptions) {
3625
- let options;
3626
- const isSetupStore = typeof setup === "function";
3627
- options = isSetupStore ? setupOptions : setup;
3628
- function useStore(pinia, hot) {
3629
- const hasContext = hasInjectionContext();
3630
- pinia = pinia || (hasContext ? inject(piniaSymbol, null) : null);
3631
- if (pinia) setActivePinia(pinia);
3632
- pinia = activePinia;
3633
- if (!pinia._s.has(id)) if (isSetupStore) createSetupStore(id, setup, options, pinia);
3634
- else createOptionsStore(id, options, pinia);
3635
- return pinia._s.get(id);
3636
- }
3637
- useStore.$id = id;
3638
- return useStore;
3639
- }
3640
- var IS_CLIENT, activePinia, setActivePinia, piniaSymbol, MutationType, _global, _navigator, isMacOSWebView, saveAs, assign$1, noop, fallbackRunWithContext, ACTION_MARKER, ACTION_NAME, skipHydrateSymbol, assign;
3641
- var init_pinia = __esmMin((() => {
3642
- init_vue_runtime_esm_bundler();
3643
- IS_CLIENT = typeof window !== "undefined";
3644
- setActivePinia = (pinia) => activePinia = pinia;
3645
- piniaSymbol = Symbol();
3646
- (function(MutationType) {
3647
- /**
3648
- * Direct mutation of the state:
3649
- *
3650
- * - `store.name = 'new name'`
3651
- * - `store.$state.name = 'new name'`
3652
- * - `store.list.push('new item')`
3653
- */
3654
- MutationType["direct"] = "direct";
3655
- /**
3656
- * Mutated the state with `$patch` and an object
3657
- *
3658
- * - `store.$patch({ name: 'newName' })`
3659
- */
3660
- MutationType["patchObject"] = "patch object";
3661
- /**
3662
- * Mutated the state with `$patch` and a function
3663
- *
3664
- * - `store.$patch(state => state.name = 'newName')`
3665
- */
3666
- MutationType["patchFunction"] = "patch function";
3667
- })(MutationType || (MutationType = {}));
3668
- _global = typeof window === "object" && window.window === window ? window : typeof self === "object" && self.self === self ? self : typeof global === "object" && global.global === global ? global : typeof globalThis === "object" ? globalThis : { HTMLElement: null };
3669
- _navigator = typeof navigator === "object" ? navigator : { userAgent: "" };
3670
- isMacOSWebView = /Macintosh/.test(_navigator.userAgent) && /AppleWebKit/.test(_navigator.userAgent) && !/Safari/.test(_navigator.userAgent);
3671
- saveAs = !IS_CLIENT ? () => {} : typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype && !isMacOSWebView ? downloadSaveAs : "msSaveOrOpenBlob" in _navigator ? msSaveAs : fileSaverSaveAs;
3672
- ({assign: assign$1} = Object);
3673
- noop = () => {};
3674
- fallbackRunWithContext = (fn) => fn();
3675
- ACTION_MARKER = Symbol();
3676
- ACTION_NAME = Symbol();
3677
- skipHydrateSymbol = Symbol();
3678
- ({assign} = Object);
3679
- }));
3680
- //#endregion
3681
- //#region src/stores/session.ts
3682
- function getDefaultState() {
3683
- try {
3684
- const locStr = storage.getItem(sessionStoreKey);
3685
- return locStr ? JSON.parse(locStr) : sysConfig.session || {};
3686
- } catch (e) {
3687
- console.error("Failed to read localStorage:", e);
3688
- return sysConfig.session || {};
3689
- }
3690
- }
3691
- var storage, sessionStoreKey, useSessionStore;
3692
- var init_session = __esmMin((() => {
3693
- init_pinia();
3694
- init_SysConfig();
3695
- storage = window.sessionStorage;
3696
- sessionStoreKey = "login-session";
3697
- useSessionStore = defineStore("session", {
3698
- state: () => getDefaultState(),
3699
- getters: {
3700
- isLoggedIn: (state) => {
3701
- console.log("Recomputing isLoggedIn", state, state.id, state.userId);
3702
- return !!state.id && !!state.userId;
3703
- },
3704
- userName: (state) => state.user?.name || "",
3705
- userLoginId: (state) => state.loginId,
3706
- userAvatar: (state) => state.user?.avatar || "",
3707
- token: (state) => state.id || ""
3708
- },
3709
- actions: {
3710
- setSession(session) {
3711
- this.$patch((state) => {
3712
- Object.assign(state, session);
3713
- });
3714
- },
3715
- clearSession() {
3716
- this.user = null;
3717
- this.account = null;
3718
- this.id = "";
3719
- this.userId = 0;
3720
- this.loginId = "";
3721
- storage.removeItem?.(sessionStoreKey);
3722
- },
3723
- updateUserInfo(user) {
3724
- if (this.user) this.$patch((state) => {
3725
- state.user = Object.assign(state.user || {}, user);
3726
- });
3727
- }
3728
- },
3729
- persist: {
3730
- key: sessionStoreKey,
3731
- storage
3732
- }
3733
- });
3734
- }));
3735
- //#endregion
3736
- //#region src/utils/request.ts
3737
- async function request$1(url, data, option) {
3738
- const session = useSessionStore();
3739
- option = { ...option || {} };
3740
- option = {
3741
- method: "POST",
3742
- withCredentials: true,
3743
- ...option,
3744
- headers: {
3745
- ...option.headers || {},
3746
- "x-auth-token": session.id || ""
3747
- }
3748
- };
3749
- let res;
3750
- if (option.method === "GET" || option.method === "get") res = await axios.get(url, {
3751
- ...option,
3752
- params: {
3753
- ...option.params || {},
3754
- ...data || {}
3755
- }
3756
- });
3757
- else res = await axios.post(url, data, option);
3758
- return res;
3759
- }
3760
- var axios;
3761
- var init_request = __esmMin((() => {
3762
- init_session();
3763
- init_axios();
3764
- axios = axios$1.create();
3765
- }));
3766
- //#endregion
3767
- //#region src/base/eventBus.ts
3768
- function publish(name, data) {
3769
- return GlobalEventBus.emit(name, data);
3770
- }
3771
- var AUTHTIMEOUT, GlobalEventBus;
3772
- var init_eventBus = __esmMin((() => {
3773
- init_dist();
3774
- AUTHTIMEOUT = "AUTHTIMEOUT";
3775
- GlobalEventBus = new JEventEmitter();
3776
- })), isNWjs, isVSCode, isChromeExtension, isElectron, isBrowser, UA, PLATFORM, SYSTEM, VER_MQQ, IS_MQQ, VER_WEIXIN, IS_WEIXIN, IS_PCWEIXIN, VER_MINA, IS_MINA, os, android, ipad, ipod, iphone, chrome, x5;
3777
- var init_detect = __esmMin((() => {
3778
- isNWjs = typeof process !== "undefined" && process.__nwjs !== void 0;
3779
- isVSCode = typeof acquireVsCodeApi !== "undefined" || typeof process !== "undefined" && {}.VSCODE_PID;
3780
- isChromeExtension = !isNWjs && !isVSCode && (() => {
3781
- try {
3782
- return typeof chrome !== "undefined" && Boolean(chrome?.runtime) && Boolean(chrome?.runtime?.id);
3783
- } catch (e) {
3784
- return false;
3785
- }
3786
- })();
3787
- isElectron = typeof process === "object" && process.versions?.electron !== void 0;
3788
- isBrowser = typeof window !== "undefined" && !isNWjs && !isVSCode && !isChromeExtension && !isElectron;
3789
- isBrowser && window.top;
3790
- UA = isBrowser ? navigator.userAgent : "";
3791
- PLATFORM = /* @__PURE__ */ function(PLATFORM) {
3792
- PLATFORM["UNKNOWN"] = "unknown";
3793
- PLATFORM["WEB"] = "web";
3794
- PLATFORM["PCWEIXIN"] = "pcweixin";
3795
- PLATFORM["WEIXIN"] = "weixin";
3796
- PLATFORM["WEWORK"] = "wework";
3797
- PLATFORM["MQQ"] = "mqq";
3798
- PLATFORM["MINA"] = "mina";
3799
- PLATFORM["IFRAME"] = "iframe";
3800
- return PLATFORM;
3801
- }({});
3802
- /WindowsWechat/i.test(UA);
3803
- /Mobile/i.test(UA);
3804
- SYSTEM = /* @__PURE__ */ function(SYSTEM) {
3805
- SYSTEM["UNKNOWN"] = "unknown";
3806
- SYSTEM["ANDROID"] = "android";
3807
- SYSTEM["IOS"] = "ios";
3808
- return SYSTEM;
3809
- }({});
3810
- VER_MQQ = UA.match(/QQ\/([\d.]+)/i) && UA.match(/QQ\/([\d.]+)/i)?.[1];
3811
- IS_MQQ = Boolean(VER_MQQ);
3812
- VER_WEIXIN = UA.match(/MicroMessenger\/([\d.]+)/i) && UA.match(/MicroMessenger\/([\d.]+)/i)?.[1]?.split(".").slice(0, 3).join(".");
3813
- IS_WEIXIN = Boolean(VER_WEIXIN);
3814
- /wechatdevtools\//i.test(UA);
3815
- isBrowser && window.__wxjs_is_wkwebview;
3816
- IS_PCWEIXIN = /(Windows|Mac)Wechat/i.test(UA);
3817
- /wxwork\//i.test(UA);
3818
- VER_MINA = isBrowser && (window.__wxjs_environment === "miniprogram" || /miniProgram/i.test(UA));
3819
- IS_MINA = Boolean(VER_MINA);
3820
- PLATFORM.WEB;
3821
- if (IS_MQQ) PLATFORM.MQQ;
3822
- else if (IS_MINA) PLATFORM.MINA;
3823
- else if (IS_PCWEIXIN) PLATFORM.PCWEIXIN;
3824
- else if (IS_WEIXIN) PLATFORM.WEIXIN;
3825
- os = {
3826
- version: "0.0.0",
3827
- android: false,
3828
- ios: false,
3829
- iphone: false,
3830
- ipad: false,
3831
- x5: false
3832
- };
3833
- UA.match(/Web[kK]it[/]{0,1}([\d.]+)/);
3834
- android = UA.match(/(Android);?[\s/]+([\d.]+)?/);
3835
- UA.match(/\(Macintosh; Intel /);
3836
- ipad = UA.match(/(iPad).*OS\s([\d_]+)/), ipod = UA.match(/(iPod)(.*OS\s([\d_]+))?/), iphone = !ipad && UA.match(/(iPhone\sOS)\s([\d_]+)/);
3837
- UA.match(/(webOS|hpwOS)[\s/]([\d.]+)/);
3838
- /Win\d{2}|Windows/.test(navigator.platform);
3839
- UA.match(/(BlackBerry).*Version\/([\d.]+)/);
3840
- UA.match(/(BB10).*Version\/([\d.]+)/);
3841
- UA.match(/PlayBook/);
3842
- chrome = UA.match(/Chrome\/([\d.]+)/) || UA.match(/CriOS\/([\d.]+)/), x5 = UA.match(/MQQBrowser\/([\d.]+)/i);
3843
- UA.match(/MSIE\s([\d.]+)/) || UA.match(/Trident\/[\d](?=[^?]+).*rv:([0-9.].)/);
3844
- !chrome && UA.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) || UA.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);
3845
- if (android) os.android = true, os.version = android[2];
3846
- if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2]?.replace(/_/g, ".");
3847
- if (ipad) os.ios = os.ipad = true, os.version = ipad[2]?.replace(/_/g, ".");
3848
- if (x5) os.x5 = true, os.version = x5[1];
3849
- SYSTEM.UNKNOWN;
3850
- if (os.ios) SYSTEM.IOS;
3851
- else if (os.android) SYSTEM.ANDROID;
3852
- if (os.ios) {
3853
- if (screen.height == 812 && screen.width == 375);
3854
- }
3855
- }));
3856
- //#endregion
3857
- //#region __vite-browser-external
3858
- var require___vite_browser_external = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3859
- module.exports = {};
3860
- }));
3861
- //#endregion
3862
- //#region src/service/base.ts
3863
- function getRequestUrl(api) {
3864
- if (/^(http(s)?:)?\/\//.test(api)) return api;
3865
- return `${(config_default.apiUrl || `${location.protocol}//${location.hostname}${[80, 443].includes(Number(location.port)) ? "" : ":" + location.port}`).trim()}${config_default.prefix}${api}`;
3866
- }
3867
- async function requestServer(url, data, option) {
3868
- if (isNWjs) try {
3869
- const apiPath = url.replace(/^(http(s)?:)?\/\//, "").replace(/.*?\/api\//, "/api/");
3870
- let server;
3871
- try {
3872
- server = __require("../server/index.js");
3873
- } catch (e) {
3874
- try {
3875
- const path = require___vite_browser_external();
3876
- const fs = require___vite_browser_external();
3877
- const appPath = process.cwd();
3878
- const serverFilePath = path.join(appPath, "server", "index.js");
3879
- console.log("尝试加载服务端代码:", serverFilePath);
3880
- if (fs.existsSync(serverFilePath)) server = __require(serverFilePath);
3881
- else server = __require("./server/index.js");
3882
- } catch (err) {
3883
- console.error("所有路径尝试失败:", err);
3884
- throw new Error("无法加载服务端代码");
3885
- }
3886
- }
3887
- const res = await server.handleDatabaseRoutes(apiPath, data);
3888
- const retData = {
3889
- ret: 0,
3890
- msg: "success",
3891
- data: res
3892
- };
3893
- if (res && typeof res === "object") {
3894
- if ("ret" in res && ("msg" in res || "message" in res)) {
3895
- retData.ret = res.ret;
3896
- retData.msg = res.msg || res.message;
3897
- retData.data = res.data;
3898
- }
3899
- }
3900
- return {
3901
- status: 200,
3902
- statusText: "OK",
3903
- data: retData
3904
- };
3905
- } catch (error) {
3906
- console.error("NW.js 环境下执行后端代码失败:", error);
3907
- return {
3908
- status: 500,
3909
- statusText: "Internal Server Error",
3910
- data: {
3911
- ret: 500,
3912
- msg: error.message || "执行失败"
3913
- }
3914
- };
3915
- }
3916
- else {
3917
- url = getRequestUrl(url);
3918
- return await request$1(url, data, option);
3919
- }
3920
- }
3921
- async function request(url, data, option) {
3922
- const res = await requestServer(url, data, option);
3923
- if (!res || res instanceof Array) return res;
3924
- if (typeof res !== "object") return res;
3925
- if (res.status !== 200) throw {
3926
- ret: res.status,
3927
- msg: res.data?.msg || res.statusText,
3928
- message: res.data?.msg || res.statusText
3929
- };
3930
- const responseData = res.data;
3931
- if (responseData.ret === 50001) {
3932
- console.error("登陆态失效,请重新登陆后再试");
3933
- publish(AUTHTIMEOUT, { message: responseData.msg || "登陆态失效,请重新登陆后再试" });
3934
- }
3935
- return responseData;
3936
- }
3937
- var init_base = __esmMin((() => {
3938
- init_request();
3939
- init_eventBus();
3940
- init_config();
3941
- init_detect();
3942
- }));
3943
- //#endregion
3944
- //#region src/components/toast/toast.vue?vue&type=script&setup=true&lang.ts
3945
- var _hoisted_1$4, _hoisted_2$4, _hoisted_3$3, _hoisted_4$2, _hoisted_5$2, toast_vue_vue_type_script_setup_true_lang_default;
3946
- var init_toast_vue_vue_type_script_setup_true_lang = __esmMin((() => {
3947
- init_vue_runtime_esm_bundler();
3948
- _hoisted_1$4 = { class: "toast-container position-fixed top-0 start-50 translate-middle-x p-3" };
3949
- _hoisted_2$4 = {
3950
- key: 0,
3951
- class: "toast-header"
3952
- };
3953
- _hoisted_3$3 = { class: "me-auto" };
3954
- _hoisted_4$2 = ["onClick"];
3955
- _hoisted_5$2 = { class: "toast-body" };
3956
- toast_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
3957
- __name: "toast",
3958
- setup(__props, { expose: __expose }) {
3959
- const toasts = reactive([]);
3960
- const addToast = (title, message, type = "success", duration = 3e3) => {
3961
- const toast = {
3962
- title,
3963
- message,
3964
- type,
3965
- removed: false
3966
- };
3967
- toasts.push(toast);
3968
- setTimeout(() => removeToast(toast), duration);
3969
- };
3970
- const removeToast = (toast) => {
3971
- const index = toasts.indexOf(toast);
3972
- if (index < 0) return;
3973
- toasts[index].removed = true;
3974
- setTimeout(() => {
3975
- toasts.splice(index, 1);
3976
- }, 1e3);
3977
- };
3978
- __expose({ addToast });
3979
- return (_ctx, _cache) => {
3980
- return openBlock(), createElementBlock("div", _hoisted_1$4, [(openBlock(true), createElementBlock(Fragment, null, renderList(toasts, (toast, index) => {
3981
- return openBlock(), createElementBlock("div", {
3982
- class: normalizeClass(`toast show bg-${toast.type === "error" ? "danger" : toast.type}-subtle ${toast.removed ? "fade-out" : ""}`),
3983
- role: "alert",
3984
- key: index
3985
- }, [toast.title ? (openBlock(), createElementBlock("div", _hoisted_2$4, [createBaseVNode("strong", _hoisted_3$3, toDisplayString(toast.title), 1), createBaseVNode("button", {
3986
- type: "button",
3987
- class: "btn-close",
3988
- onClick: ($event) => removeToast(index)
3989
- }, null, 8, _hoisted_4$2)])) : createCommentVNode("", true), createBaseVNode("div", _hoisted_5$2, toDisplayString(toast.message), 1)], 2);
3990
- }), 128))]);
3991
- };
3992
- }
3993
- });
3994
- }));
3995
- //#endregion
3996
- //#region src/components/toast/toast.vue?vue&type=style&index=0&scoped=7d639c44&lang.css
3997
- var init_toast_vue_vue_type_style_index_0_scoped_7d639c44_lang = __esmMin((() => {}));
3998
- //#endregion
3999
- //#region src/components/toast/toast.vue
4000
- var toast_default;
4001
- var init_toast$1 = __esmMin((() => {
4002
- init_toast_vue_vue_type_script_setup_true_lang();
4003
- init_toast_vue_vue_type_script_setup_true_lang();
4004
- init_toast_vue_vue_type_style_index_0_scoped_7d639c44_lang();
4005
- init__plugin_vue_export_helper();
4006
- toast_default = /* @__PURE__ */ _plugin_vue_export_helper_default(toast_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-7d639c44"]]);
4007
- }));
4008
- //#endregion
4009
- //#region src/utils/toast.ts
4010
- function setGlobalToast(toast) {
4011
- globalToast = toast;
4012
- }
4013
- var globalToast, ToastHelper, toast;
4014
- var init_toast = __esmMin((() => {
4015
- init_vue_runtime_esm_bundler();
4016
- globalToast = null;
4017
- ToastHelper = class {
4018
- getToast() {
4019
- if (globalToast) return globalToast;
4020
- const instance = getCurrentInstance();
4021
- if (!instance) {
4022
- console.warn("ToastHelper: Vue实例不存在,请确保已注册toast插件");
4023
- return null;
4024
- }
4025
- return instance.appContext.config?.globalProperties?.$toast || null;
4026
- }
4027
- success(message, title = "", duration = 3e3) {
4028
- const toast = this.getToast();
4029
- if (toast?.success) toast.success(message, title, duration);
4030
- }
4031
- error(message, title = "", duration = 3e3) {
4032
- const toast = this.getToast();
4033
- if (toast?.error) toast.error(message, title, duration);
4034
- }
4035
- warning(message, title = "", duration = 3e3) {
4036
- const toast = this.getToast();
4037
- if (toast?.warning) toast.warning(message, title, duration);
4038
- }
4039
- info(message, title = "", duration = 3e3) {
4040
- const toast = this.getToast();
4041
- if (toast?.info) toast.info(message, title, duration);
4042
- }
4043
- show(title, message, type, duration = 3e3) {
4044
- const toast = this.getToast();
4045
- if (toast?.show) toast.show(message, title, type, duration);
4046
- }
4047
- };
4048
- toast = new ToastHelper();
4049
- }));
4050
- //#endregion
4051
- //#region src/components/loading/index.vue?vue&type=script&setup=true&lang.ts
4052
- var _hoisted_1$3, _hoisted_2$3, index_vue_vue_type_script_setup_true_lang_default$2;
4053
- var init_index_vue_vue_type_script_setup_true_lang$2 = __esmMin((() => {
4054
- init_vue_runtime_esm_bundler();
4055
- _hoisted_1$3 = {
4056
- key: 0,
4057
- class: "loading-overlay"
4058
- };
4059
- _hoisted_2$3 = {
4060
- key: 0,
4061
- class: "m-3 text-primary"
4062
- };
4063
- index_vue_vue_type_script_setup_true_lang_default$2 = /* @__PURE__ */ defineComponent({
4064
- __name: "index",
4065
- props: {
4066
- isLoading: {
4067
- type: Boolean,
4068
- default: false
4069
- },
4070
- message: {
4071
- type: String,
4072
- default: "加载中..."
4073
- }
4074
- },
4075
- setup(__props) {
4076
- return (_ctx, _cache) => {
4077
- return __props.isLoading ? (openBlock(), createElementBlock("div", _hoisted_1$3, [_cache[0] || (_cache[0] = createBaseVNode("div", { class: "loading-spinner" }, [createBaseVNode("div", {
4078
- class: "spinner-border text-primary",
4079
- role: "status"
4080
- }, [createBaseVNode("span", { class: "visually-hidden" }, "Loading...")])], -1)), __props.message ? (openBlock(), createElementBlock("p", _hoisted_2$3, toDisplayString(__props.message), 1)) : createCommentVNode("", true)])) : createCommentVNode("", true);
4081
- };
4082
- }
4083
- });
4084
- }));
4085
- //#endregion
4086
- //#region src/components/loading/index.vue?vue&type=style&index=0&scoped=d5892680&lang.css
4087
- var init_index_vue_vue_type_style_index_0_scoped_d5892680_lang = __esmMin((() => {}));
4088
- //#endregion
4089
- //#region src/components/loading/index.vue
4090
- var loading_default;
4091
- var init_loading = __esmMin((() => {
4092
- init_index_vue_vue_type_script_setup_true_lang$2();
4093
- init_index_vue_vue_type_script_setup_true_lang$2();
4094
- init_index_vue_vue_type_style_index_0_scoped_d5892680_lang();
4095
- init__plugin_vue_export_helper();
4096
- loading_default = /* @__PURE__ */ _plugin_vue_export_helper_default(index_vue_vue_type_script_setup_true_lang_default$2, [["__scopeId", "data-v-d5892680"]]);
4097
- }));
4098
- //#endregion
4099
- //#region src/components/modal/index.vue?vue&type=script&setup=true&lang.ts
4100
- var _hoisted_1$2, _hoisted_2$2, _hoisted_3$2, _hoisted_4$1, _hoisted_5$1, _hoisted_6$1, _hoisted_7$1, _hoisted_8$1, _hoisted_9$1, index_vue_vue_type_script_setup_true_lang_default$1;
4101
- var init_index_vue_vue_type_script_setup_true_lang$1 = __esmMin((() => {
4102
- init_vue_runtime_esm_bundler();
4103
- init_bootstrap_esm();
4104
- init_loading();
4105
- _hoisted_1$2 = {
4106
- class: "modal-title d-flex align-items-center",
4107
- id: "modalLabel"
4108
- };
4109
- _hoisted_2$2 = {
4110
- key: 0,
4111
- class: "modal-body text-wrap"
4112
- };
4113
- _hoisted_3$2 = { key: 1 };
4114
- _hoisted_4$1 = { class: "d-flex align-items-center mb-3" };
4115
- _hoisted_5$1 = { class: "flex-grow-1 text-wrap" };
4116
- _hoisted_6$1 = {
4117
- key: 0,
4118
- class: "error-details-toggle mt-2"
4119
- };
4120
- _hoisted_7$1 = {
4121
- key: 0,
4122
- class: "error-details-content mt-2"
4123
- };
4124
- _hoisted_8$1 = { class: "error-json" };
4125
- _hoisted_9$1 = { class: "modal-footer" };
4126
- index_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ defineComponent({
4127
- __name: "index",
4128
- props: {
4129
- title: {
4130
- type: String,
4131
- default: ""
4132
- },
4133
- closeButton: {
4134
- type: Object,
4135
- default: {
4136
- text: "关闭",
4137
- show: false
4138
- }
4139
- },
4140
- confirmButton: {
4141
- type: Object,
4142
- default: {
4143
- text: "确定",
4144
- show: true
4145
- }
4146
- },
4147
- isLoading: {
4148
- type: Boolean,
4149
- default: false
4150
- },
4151
- loadingMessage: {
4152
- type: String,
4153
- default: "处理中..."
4154
- },
4155
- style: {
4156
- type: Object,
4157
- default: {}
4158
- },
4159
- visible: {
4160
- type: Boolean,
4161
- default: false
4162
- },
4163
- isFullScreen: {
4164
- type: Boolean,
4165
- default: false
4166
- },
4167
- teleport: {
4168
- type: [Boolean, String],
4169
- default: true
4170
- }
4171
- },
4172
- emits: [
4173
- "onConfirm",
4174
- "onClose",
4175
- "onCancel",
4176
- "onHidden"
4177
- ],
4178
- setup(__props, { expose: __expose, emit: __emit }) {
4179
- const modalId = `modal-${Date.now()}-${Math.floor(Math.random() * 1e3)}`;
4180
- const props = __props;
4181
- const dynamicOptions = ref({});
4182
- const dynamicTitle = ref("");
4183
- const dynamicContent = ref("");
4184
- const dynamicType = ref("");
4185
- const dynamicConfirmText = ref("");
4186
- const dynamicCancelText = ref("");
4187
- const dynamicShowCancel = ref(false);
4188
- const detailsExpanded = ref(false);
4189
- const dynamicErrorDetails = ref(null);
4190
- const isMobile = ref(false);
4191
- const checkScreenSize = () => {
4192
- isMobile.value = window.innerWidth < 768;
4193
- };
4194
- checkScreenSize();
4195
- window.addEventListener("resize", checkScreenSize);
4196
- onUnmounted(() => {
4197
- window.removeEventListener("resize", checkScreenSize);
4198
- });
4199
- const dynamicStyle = computed(() => {
4200
- return {
4201
- maxWidth: isMobile.value ? "100vw" : "80vw!important",
4202
- width: "auto",
4203
- minWidth: "300px",
4204
- wordWrap: "break-word",
4205
- overflowWrap: "break-word",
4206
- zIndex: 1060,
4207
- ...Object.keys(props.style).length ? props.style : {},
4208
- ...dynamicOptions.value?.style || {}
4209
- };
4210
- });
4211
- const shouldShowDetails = () => {
4212
- return dynamicType.value === "error" && dynamicErrorDetails.value;
4213
- };
4214
- const toggleDetails = () => {
4215
- detailsExpanded.value = !detailsExpanded.value;
4216
- };
4217
- const formatErrorDetails = () => {
4218
- if (!dynamicErrorDetails.value) return "";
4219
- try {
4220
- return JSON.stringify(dynamicErrorDetails.value, null, 2);
4221
- } catch {
4222
- return String(dynamicErrorDetails.value);
4223
- }
4224
- };
4225
- const typeIcon = computed(() => {
4226
- return {
4227
- success: "bi bi-check-circle-fill text-success",
4228
- error: "bi bi-x-circle-fill text-danger",
4229
- warning: "bi bi-exclamation-triangle-fill text-warning",
4230
- info: "bi bi-info-circle-fill text-info"
4231
- }[dynamicType.value] || "";
4232
- });
4233
- const headerClass = computed(() => {
4234
- return {
4235
- success: "bg-success text-white",
4236
- error: "bg-danger text-white",
4237
- warning: "bg-warning text-dark",
4238
- info: "bg-info text-white"
4239
- }[dynamicType.value] || "";
4240
- });
4241
- const contentClass = computed(() => {
4242
- if (!dynamicType.value) return "";
4243
- return `modal-${dynamicType.value}`;
4244
- });
4245
- const confirmButtonClass = computed(() => {
4246
- return {
4247
- success: "btn-success",
4248
- error: "btn-danger",
4249
- warning: "btn-warning",
4250
- info: "btn-info"
4251
- }[dynamicType.value] || "btn-primary";
4252
- });
4253
- const originalParent = ref(null);
4254
- const getTargetContainer = () => {
4255
- if (!props.teleport) return null;
4256
- if (typeof props.teleport === "string") return document.querySelector(props.teleport) || null;
4257
- else return document.body;
4258
- };
4259
- const teleportModal = () => {
4260
- if (!modalContainer.value) return;
4261
- const target = getTargetContainer();
4262
- if (!target) return;
4263
- if (!originalParent.value) originalParent.value = modalContainer.value.parentNode;
4264
- if (modalContainer.value.parentNode !== target) target.appendChild(modalContainer.value);
4265
- };
4266
- const restoreModal = () => {
4267
- if (modalContainer.value && originalParent.value && props.teleport) {
4268
- if (!originalParent.value.contains(modalContainer.value)) originalParent.value.appendChild(modalContainer.value);
4269
- }
4270
- };
4271
- const emits = __emit;
4272
- const modalShow = ref(false);
4273
- const isShowing = ref(false);
4274
- const isHiding = ref(false);
4275
- const modalContainer = ref(null);
4276
- let modal = null;
4277
- function getModal() {
4278
- if (modal) return modal;
4279
- if (!modalContainer.value) return null;
4280
- const handleModalHide = (e) => {
4281
- if (e.target === modalContainer.value && !isHiding.value) {
4282
- console.log(`Modal ${modalId} hidden event triggered`);
4283
- ModalHide();
4284
- }
4285
- };
4286
- const handleModalShow = (e) => {
4287
- if (e.target === modalContainer.value) {
4288
- console.log(`Modal ${modalId} show event triggered`);
4289
- ModalShow();
4290
- }
4291
- };
4292
- const m = new Modal(modalContainer.value, {
4293
- backdrop: "static",
4294
- keyboard: false
4295
- });
4296
- modalContainer.value.addEventListener("hidden.bs.modal", handleModalHide);
4297
- modalContainer.value.addEventListener("show.bs.modal", handleModalShow);
4298
- modalContainer.value.handleModalHide = handleModalHide;
4299
- modalContainer.value.handleModalShow = handleModalShow;
4300
- return m;
4301
- }
4302
- function ModalShow() {
4303
- console.log(`Modal ${modalId} shown function called`);
4304
- if (props.teleport) teleportModal();
4305
- modalShow.value = true;
4306
- isShowing.value = true;
4307
- isHiding.value = false;
4308
- setTimeout(() => {
4309
- const backdrop = document.querySelector(".modal-backdrop");
4310
- if (backdrop && modalContainer.value) {
4311
- const parentContainer = modalContainer.value.parentElement;
4312
- if (parentContainer) parentContainer.appendChild(backdrop);
4313
- backdrop.style.zIndex = "1050";
4314
- }
4315
- }, 100);
4316
- }
4317
- function ModalHide() {
4318
- console.log(`Modal ${modalId} hidden function called`);
4319
- modalShow.value = false;
4320
- isShowing.value = false;
4321
- isHiding.value = false;
4322
- emits("onHidden");
4323
- }
4324
- function show() {
4325
- if (isShowing.value && !isHiding.value) {
4326
- console.log("Modal already showing, skipping");
4327
- return Promise.resolve();
4328
- }
4329
- console.log(`Attempting to show modal ${modalId}`);
4330
- const modalInstance = getModal();
4331
- if (modalInstance) {
4332
- isHiding.value = false;
4333
- return new Promise((resolve) => {
4334
- nextTick(() => {
4335
- nextTick(() => {
4336
- modalInstance.show();
4337
- resolve();
4338
- });
4339
- });
4340
- });
4341
- }
4342
- return Promise.resolve();
4343
- }
4344
- function hide() {
4345
- if (isHiding.value) {
4346
- console.log("Modal already hiding, skipping");
4347
- return Promise.resolve();
4348
- }
4349
- console.log(`Attempting to hide modal ${modalId}`);
4350
- const modalInstance = getModal();
4351
- if (modalInstance) {
4352
- isHiding.value = true;
4353
- isShowing.value = false;
4354
- return new Promise((resolve) => {
4355
- const checkHidden = () => {
4356
- if (!modalContainer.value?.classList.contains("show")) resolve();
4357
- else setTimeout(checkHidden, 50);
4358
- };
4359
- modalInstance.hide();
4360
- setTimeout(checkHidden, 100);
4361
- });
4362
- }
4363
- return Promise.resolve();
4364
- }
4365
- function confirm() {
4366
- emits("onConfirm");
4367
- dynamicOptions.value?.onConfirm?.();
4368
- }
4369
- function cancel() {
4370
- hide();
4371
- emits("onCancel");
4372
- dynamicOptions.value?.onCancel?.();
4373
- }
4374
- watch(() => props.visible, (visible) => {
4375
- if (modalShow.value === visible) return;
4376
- if (visible) show();
4377
- else hide();
4378
- });
4379
- onMounted(() => {
4380
- modal = getModal();
4381
- });
4382
- onUnmounted(() => {
4383
- if (modalContainer.value) {
4384
- modalContainer.value.removeEventListener("hidden.bs.modal", modalContainer.value.handleModalHide);
4385
- modalContainer.value.removeEventListener("show.bs.modal", modalContainer.value.handleModalShow);
4386
- }
4387
- if (modal) modal.dispose();
4388
- restoreModal();
4389
- });
4390
- __expose({
4391
- show,
4392
- open: show,
4393
- hide,
4394
- close: hide,
4395
- modalId,
4396
- setTitle: (title) => dynamicTitle.value = title,
4397
- setContent: (content) => dynamicContent.value = content,
4398
- setType: (type) => dynamicType.value = type,
4399
- setConfirmText: (text) => dynamicConfirmText.value = text,
4400
- setCancelText: (text) => dynamicCancelText.value = text,
4401
- setShowCancel: (show) => dynamicShowCancel.value = show,
4402
- setOptions: (options) => {
4403
- if (options.title) dynamicTitle.value = options.title;
4404
- if (options.content) dynamicContent.value = options.content;
4405
- if (options.type) dynamicType.value = options.type;
4406
- if (options.confirmText) dynamicConfirmText.value = options.confirmText;
4407
- if (options.cancelText) dynamicCancelText.value = options.cancelText;
4408
- if (options.showCancel !== void 0) dynamicShowCancel.value = options.showCancel;
4409
- if (options.details !== void 0) dynamicErrorDetails.value = options.details;
4410
- dynamicOptions.value = options;
4411
- }
4412
- });
4413
- return (_ctx, _cache) => {
4414
- return openBlock(), createElementBlock("div", {
4415
- class: "modal fade",
4416
- id: modalId,
4417
- ref_key: "modalContainer",
4418
- ref: modalContainer,
4419
- tabindex: "-1",
4420
- "aria-labelledby": "modalLabel"
4421
- }, [createBaseVNode("div", {
4422
- class: normalizeClass(["modal-dialog modal-dialog-centered", { "modal-fullscreen": __props.isFullScreen }]),
4423
- style: normalizeStyle(dynamicStyle.value)
4424
- }, [createBaseVNode("div", {
4425
- class: normalizeClass(["modal-content", contentClass.value]),
4426
- style: { "margin": "auto" }
4427
- }, [
4428
- createBaseVNode("div", {
4429
- class: normalizeClass(["modal-header", headerClass.value]),
4430
- style: { "padding": "1rem 1.5rem" }
4431
- }, [createBaseVNode("h5", _hoisted_1$2, [typeIcon.value ? (openBlock(), createElementBlock("i", {
4432
- key: 0,
4433
- class: normalizeClass([typeIcon.value, "me-2"])
4434
- }, null, 2)) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(dynamicTitle.value || props.title), 1)]), createBaseVNode("button", {
4435
- type: "button",
4436
- class: "btn-close",
4437
- "aria-label": "Close",
4438
- onClick: cancel
4439
- })], 2),
4440
- modalShow.value ? (openBlock(), createElementBlock("div", _hoisted_2$2, [_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }, void 0, true) : (openBlock(), createElementBlock("div", _hoisted_3$2, [createBaseVNode("div", _hoisted_4$1, [typeIcon.value ? (openBlock(), createElementBlock("i", {
4441
- key: 0,
4442
- class: normalizeClass([typeIcon.value, "me-3 fs-1"])
4443
- }, null, 2)) : createCommentVNode("", true), createBaseVNode("div", _hoisted_5$1, toDisplayString(dynamicContent.value), 1)]), shouldShowDetails() ? (openBlock(), createElementBlock("div", _hoisted_6$1, [createBaseVNode("button", {
4444
- class: "btn btn-sm btn-outline-secondary",
4445
- onClick: toggleDetails
4446
- }, [createTextVNode(toDisplayString(detailsExpanded.value ? "隐藏" : "详情") + " ", 1), _cache[0] || (_cache[0] = createBaseVNode("i", { class: "bi bi-chevron-{{detailsExpanded ? 'up' : 'down'}} ms-1" }, null, -1))]), detailsExpanded.value ? (openBlock(), createElementBlock("div", _hoisted_7$1, [createBaseVNode("pre", _hoisted_8$1, toDisplayString(formatErrorDetails()), 1)])) : createCommentVNode("", true)])) : createCommentVNode("", true)]))])) : createCommentVNode("", true),
4447
- createBaseVNode("div", _hoisted_9$1, [_ctx.$slots.footer ? renderSlot(_ctx.$slots, "footer", { key: 0 }, void 0, true) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [dynamicShowCancel.value || props.closeButton.show ? (openBlock(), createElementBlock("button", {
4448
- key: 0,
4449
- type: "button",
4450
- class: "btn btn-secondary",
4451
- onClick: cancel
4452
- }, toDisplayString(dynamicCancelText.value || props.closeButton.text), 1)) : createCommentVNode("", true), props.confirmButton.show ? (openBlock(), createElementBlock("button", {
4453
- key: 1,
4454
- type: "button",
4455
- class: normalizeClass(["btn", confirmButtonClass.value]),
4456
- onClick: confirm
4457
- }, toDisplayString(dynamicConfirmText.value || props.confirmButton.text), 3)) : createCommentVNode("", true)], 64))]),
4458
- createVNode(loading_default, {
4459
- isLoading: props.isLoading,
4460
- message: props.loadingMessage
4461
- }, null, 8, ["isLoading", "message"])
4462
- ], 2)], 6)], 512);
4463
- };
4464
- }
4465
- });
4466
- }));
4467
- //#endregion
4468
- //#region src/components/modal/index.vue?vue&type=style&index=0&scoped=6653cff9&lang.css
4469
- var init_index_vue_vue_type_style_index_0_scoped_6653cff9_lang = __esmMin((() => {}));
4470
- //#endregion
4471
- //#region src/components/modal/index.vue
4472
- var modal_default$1;
4473
- var init_modal$1 = __esmMin((() => {
4474
- init_index_vue_vue_type_script_setup_true_lang$1();
4475
- init_index_vue_vue_type_script_setup_true_lang$1();
4476
- init_index_vue_vue_type_style_index_0_scoped_6653cff9_lang();
4477
- init__plugin_vue_export_helper();
4478
- modal_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(index_vue_vue_type_script_setup_true_lang_default$1, [["__scopeId", "data-v-6653cff9"]]);
4479
- }));
4480
- //#endregion
4481
- //#region src/components/dataGrid/pagination.vue?vue&type=script&setup=true&lang.ts
4482
- var _hoisted_1$1, _hoisted_2$1, _hoisted_3$1, pagination_vue_vue_type_script_setup_true_lang_default;
4483
- var init_pagination_vue_vue_type_script_setup_true_lang = __esmMin((() => {
4484
- init_vue_runtime_esm_bundler();
4485
- _hoisted_1$1 = {
4486
- "aria-label": "Page navigation",
4487
- class: "px-3"
4488
- };
4489
- _hoisted_2$1 = { class: "pagination" };
4490
- _hoisted_3$1 = ["onClick", "tabindex"];
4491
- pagination_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4492
- __name: "pagination",
4493
- props: {
4494
- totalPages: {
4495
- type: Number,
4496
- default: 1
4497
- },
4498
- currentPage: {
4499
- type: Number,
4500
- default: 1
4501
- }
4502
- },
4503
- emits: ["pageChanged"],
4504
- setup(__props, { emit: __emit }) {
4505
- const props = __props;
4506
- const emits = __emit;
4507
- const visiblePages = computed(() => {
4508
- const pages = [];
4509
- const maxVisiblePages = 5;
4510
- const current = props.currentPage;
4511
- if (props.totalPages <= maxVisiblePages) {
4512
- for (let i = 1; i <= props.totalPages; i++) pages.push(i);
4513
- return pages;
4514
- }
4515
- if (current <= 3) {
4516
- pages.push(1, 2, 3, 4, 5);
4517
- pages.push("...");
4518
- pages.push(props.totalPages);
4519
- } else if (current >= props.totalPages - 2) {
4520
- pages.push(1);
4521
- pages.push("...");
4522
- pages.push(props.totalPages - 4, props.totalPages - 3, props.totalPages - 2, props.totalPages - 1, props.totalPages);
4523
- } else {
4524
- pages.push(1);
4525
- pages.push("...");
4526
- pages.push(current - 2, current - 1, current, current + 1, current + 2);
4527
- pages.push("...");
4528
- pages.push(props.totalPages);
4529
- }
4530
- return pages;
4531
- });
4532
- const prevPage = () => {
4533
- if (props.currentPage > 1) emits("pageChanged", props.currentPage - 1);
4534
- };
4535
- const nextPage = () => {
4536
- if (props.currentPage < props.totalPages) emits("pageChanged", props.currentPage + 1);
4537
- };
4538
- const goToPage = (page) => {
4539
- if (typeof page === "number" && page >= 1 && page <= props.totalPages) emits("pageChanged", page);
4540
- };
4541
- return (_ctx, _cache) => {
4542
- return openBlock(), createElementBlock("nav", _hoisted_1$1, [createBaseVNode("ul", _hoisted_2$1, [
4543
- createBaseVNode("li", { class: normalizeClass(["page-item", { disabled: __props.currentPage === 1 }]) }, [createBaseVNode("a", {
4544
- class: "page-link",
4545
- href: "#",
4546
- onClick: withModifiers(prevPage, ["prevent"])
4547
- }, "上一页")], 2),
4548
- (openBlock(true), createElementBlock(Fragment, null, renderList(visiblePages.value, (page) => {
4549
- return openBlock(), createElementBlock("li", {
4550
- key: page,
4551
- class: normalizeClass(["page-item", {
4552
- disabled: page === "...",
4553
- active: __props.currentPage === page
4554
- }])
4555
- }, [createBaseVNode("a", {
4556
- class: "page-link",
4557
- href: "#",
4558
- onClick: withModifiers(($event) => goToPage(page), ["prevent"]),
4559
- tabindex: page === "..." ? -1 : 0
4560
- }, toDisplayString(page), 9, _hoisted_3$1)], 2);
4561
- }), 128)),
4562
- createBaseVNode("li", { class: normalizeClass(["page-item", { disabled: __props.currentPage === __props.totalPages }]) }, [createBaseVNode("a", {
4563
- class: "page-link",
4564
- href: "#",
4565
- onClick: withModifiers(nextPage, ["prevent"])
4566
- }, "下一页")], 2)
4567
- ])]);
4568
- };
4569
- }
4570
- });
4571
- }));
4572
- //#endregion
4573
- //#region src/components/dataGrid/pagination.vue
4574
- var pagination_default;
4575
- var init_pagination = __esmMin((() => {
4576
- init_pagination_vue_vue_type_script_setup_true_lang();
4577
- init_pagination_vue_vue_type_script_setup_true_lang();
4578
- pagination_default = pagination_vue_vue_type_script_setup_true_lang_default;
4579
- }));
4580
- //#endregion
4581
- //#region src/components/dataGrid/index.vue?vue&type=script&setup=true&lang.ts
4582
- var _hoisted_1, _hoisted_2, _hoisted_3, _hoisted_4, _hoisted_5, _hoisted_6, _hoisted_7, _hoisted_8, _hoisted_9, _hoisted_10, _hoisted_11, _hoisted_12, _hoisted_13, index_vue_vue_type_script_setup_true_lang_default;
4583
- var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
4584
- init_vue_runtime_esm_bundler();
4585
- init_loading();
4586
- init_pagination();
4587
- _hoisted_1 = { class: "datagrid-container" };
4588
- _hoisted_2 = { class: "datagrid-inner" };
4589
- _hoisted_3 = { class: "table table-light table-striped table-hover" };
4590
- _hoisted_4 = { class: "table-light" };
4591
- _hoisted_5 = ["onClick"];
4592
- _hoisted_6 = { class: "header-content" };
4593
- _hoisted_7 = {
4594
- key: 0,
4595
- class: "sort-icon"
4596
- };
4597
- _hoisted_8 = {
4598
- key: 0,
4599
- class: "bi bi-caret-up-fill"
4600
- };
4601
- _hoisted_9 = {
4602
- key: 1,
4603
- class: "bi bi-caret-down-fill"
4604
- };
4605
- _hoisted_10 = {
4606
- key: 2,
4607
- class: "bi bi-caret-up text-muted opacity-50"
4608
- };
4609
- _hoisted_11 = { class: "table-group-divider" };
4610
- _hoisted_12 = ["onClick"];
4611
- _hoisted_13 = { key: 1 };
4612
- index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4613
- __name: "index",
4614
- props: {
4615
- isLoading: {
4616
- type: Boolean,
4617
- default: false
4618
- },
4619
- loadingMessage: {
4620
- type: String,
4621
- default: "加载中..."
4622
- },
4623
- totalPages: {
4624
- type: Number,
4625
- default: 1
4626
- },
4627
- currentPage: {
4628
- type: Number,
4629
- default: 1
4630
- },
4631
- showPagination: {
4632
- type: Boolean,
4633
- default: true
4634
- },
4635
- data: {
4636
- type: Array,
4637
- default: []
4638
- },
4639
- columns: {
4640
- type: Array,
4641
- default: []
4642
- },
4643
- sortField: {
4644
- type: String,
4645
- default: ""
4646
- },
4647
- sortOrder: {
4648
- type: String,
4649
- default: ""
4650
- }
4651
- },
4652
- emits: [
4653
- "pageChanged",
4654
- "rowClicked",
4655
- "sortChanged"
4656
- ],
4657
- setup(__props, { emit: __emit }) {
4658
- const props = __props;
4659
- const emits = __emit;
4660
- function renderDataItem(row, column) {
4661
- if (typeof column === "string") return row[column];
4662
- if (column.formatter) return column.formatter(row, column);
4663
- return row[column.name];
4664
- }
4665
- function pageChanged(page) {
4666
- emits("pageChanged", page);
4667
- }
4668
- function handleSort(field) {
4669
- let order = "ASC";
4670
- if (props.sortField === field) {
4671
- if (props.sortOrder === "ASC") order = "DESC";
4672
- else if (props.sortOrder === "DESC") order = "";
4673
- }
4674
- emits("sortChanged", {
4675
- field: order ? field : "",
4676
- order
4677
- });
4678
- }
4679
- return (_ctx, _cache) => {
4680
- return openBlock(), createElementBlock("div", _hoisted_1, [createBaseVNode("div", _hoisted_2, [createBaseVNode("table", _hoisted_3, [
4681
- createBaseVNode("thead", _hoisted_4, [createBaseVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(props.columns, (column) => {
4682
- return openBlock(), createElementBlock("th", {
4683
- key: column.name,
4684
- scope: "col",
4685
- class: normalizeClass(["datagrid-th", { "sortable": column.sortable !== false }]),
4686
- style: normalizeStyle(column.headerStyle || ""),
4687
- onClick: ($event) => column.sortable !== false && handleSort(column.name)
4688
- }, [renderSlot(_ctx.$slots, column.name + "_header", { column }, () => [createBaseVNode("div", _hoisted_6, [createBaseVNode("span", null, toDisplayString(column.text || column.name || ""), 1), column.sortable !== false ? (openBlock(), createElementBlock("span", _hoisted_7, [props.sortField === column.name && props.sortOrder === "ASC" ? (openBlock(), createElementBlock("i", _hoisted_8)) : props.sortField === column.name && props.sortOrder === "DESC" ? (openBlock(), createElementBlock("i", _hoisted_9)) : (openBlock(), createElementBlock("i", _hoisted_10))])) : createCommentVNode("", true)])], true)], 14, _hoisted_5);
4689
- }), 128))])]),
4690
- createBaseVNode("tbody", _hoisted_11, [(openBlock(true), createElementBlock(Fragment, null, renderList(props.data, (row, index) => {
4691
- return openBlock(), createElementBlock("tr", {
4692
- key: index,
4693
- onClick: ($event) => emits("rowClicked", row, index),
4694
- style: { "cursor": "pointer" }
4695
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(props.columns, (column) => {
4696
- return openBlock(), createElementBlock("td", { key: column.name }, [renderSlot(_ctx.$slots, column.name || column, {
4697
- row,
4698
- column
4699
- }, () => [column.component ? (openBlock(), createBlock(resolveDynamicComponent(column.component), { key: 0 })) : (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(renderDataItem(row, column)), 1))], true)]);
4700
- }), 128))], 8, _hoisted_12);
4701
- }), 128))]),
4702
- createBaseVNode("tfoot", null, [renderSlot(_ctx.$slots, "footer", { columns: props.columns }, void 0, true)])
4703
- ]), createVNode(loading_default, {
4704
- isLoading: props.isLoading,
4705
- message: props.loadingMessage
4706
- }, null, 8, ["isLoading", "message"])]), props.showPagination ? (openBlock(), createBlock(pagination_default, {
4707
- key: 0,
4708
- currentPage: props.currentPage,
4709
- totalPages: props.totalPages,
4710
- onPageChanged: pageChanged
4711
- }, null, 8, ["currentPage", "totalPages"])) : createCommentVNode("", true)]);
4712
- };
4713
- }
4714
- });
4715
- }));
4716
- //#endregion
4717
- //#region src/components/dataGrid/index.vue?vue&type=style&index=0&scoped=ae552d25&lang.css
4718
- var init_index_vue_vue_type_style_index_0_scoped_ae552d25_lang = __esmMin((() => {}));
4719
- //#endregion
4720
- //#region src/components/dataGrid/index.vue
4721
- var dataGrid_default;
4722
- var init_dataGrid = __esmMin((() => {
4723
- init_index_vue_vue_type_script_setup_true_lang();
4724
- init_index_vue_vue_type_script_setup_true_lang();
4725
- init_index_vue_vue_type_style_index_0_scoped_ae552d25_lang();
4726
- init__plugin_vue_export_helper();
4727
- dataGrid_default = /* @__PURE__ */ _plugin_vue_export_helper_default(index_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ae552d25"]]);
4728
- }));
4729
- //#endregion
4730
- //#region src/components/modal/index.ts
4731
- var globalModalInstance, modalInstance, modal_default, getModalInstance, isModalActive, pendingModalOptions, showModal, showAlert, showConfirm;
4732
- var init_modal = __esmMin((() => {
4733
- init_vue_runtime_esm_bundler();
4734
- init_modal$1();
4735
- globalModalInstance = null;
4736
- modal_default = {
4737
- install(app) {
4738
- const mount = document.createElement("div");
4739
- document.body.appendChild(mount);
4740
- globalModalInstance = createApp(modal_default$1).mount(mount);
4741
- if (globalModalInstance && globalModalInstance.$el) globalModalInstance.$el.addEventListener("hidden.bs.modal", () => {
4742
- isModalActive = false;
4743
- console.log("Modal hidden, isModalActive reset to false");
4744
- if (pendingModalOptions) {
4745
- const pending = pendingModalOptions;
4746
- pendingModalOptions = null;
4747
- showModal(pending);
4748
- }
4749
- });
4750
- app.config.globalProperties.$modal = modalInstance = {
4751
- show: () => globalModalInstance.show(),
4752
- hide: () => globalModalInstance.hide(),
4753
- open: () => globalModalInstance.show(),
4754
- close: () => globalModalInstance.hide(),
4755
- alert(options) {
4756
- return showModal(typeof options === "string" ? {
4757
- content: options,
4758
- type: "info",
4759
- showCancel: false
4760
- } : {
4761
- ...options,
4762
- showCancel: false
4763
- });
4764
- },
4765
- confirm(options) {
4766
- return showModal(typeof options === "string" ? {
4767
- content: options,
4768
- type: "warning"
4769
- } : {
4770
- ...options,
4771
- showCancel: true
4772
- });
4773
- },
4774
- success(content) {
4775
- return this.alert({
4776
- content,
4777
- type: "success",
4778
- confirmText: "确定"
4779
- });
4780
- },
4781
- error(content, details) {
4782
- return this.alert({
4783
- content,
4784
- type: "error",
4785
- confirmText: "确定",
4786
- details
4787
- });
4788
- },
4789
- warning(content) {
4790
- return this.alert({
4791
- content,
4792
- type: "warning",
4793
- confirmText: "确定"
4794
- });
4795
- },
4796
- info(content) {
4797
- return this.alert({
4798
- content,
4799
- type: "info",
4800
- confirmText: "确定"
4801
- });
4802
- }
4803
- };
4804
- },
4805
- get() {
4806
- const instance = getCurrentInstance();
4807
- if (!instance) return null;
4808
- return instance.appContext.config?.globalProperties?.$modal;
4809
- }
4810
- };
4811
- getModalInstance = () => {
4812
- return modalInstance;
4813
- };
4814
- isModalActive = false;
4815
- pendingModalOptions = null;
4816
- showModal = (options) => {
4817
- if (!globalModalInstance) return Promise.resolve(false);
4818
- return new Promise((resolve) => {
4819
- const finalOptions = {
4820
- title: "提示",
4821
- confirmText: "确定",
4822
- cancelText: "取消",
4823
- showCancel: false,
4824
- type: "info",
4825
- ...options,
4826
- onConfirm: () => {
4827
- options.onConfirm?.();
4828
- globalModalInstance.hide();
4829
- nextTick(() => {
4830
- resolve(true);
4831
- });
4832
- },
4833
- onCancel: () => {
4834
- options.onCancel?.();
4835
- globalModalInstance.hide();
4836
- nextTick(() => {
4837
- resolve(false);
4838
- });
4839
- }
4840
- };
4841
- if (isModalActive) {
4842
- console.log("Modal busy, queuing new modal");
4843
- pendingModalOptions = options;
4844
- return;
4845
- }
4846
- const showModalInstance = () => {
4847
- globalModalInstance.setOptions?.(finalOptions);
4848
- isModalActive = true;
4849
- return globalModalInstance.show?.() || Promise.resolve();
4850
- };
4851
- showModalInstance();
4852
- });
4853
- };
4854
- showAlert = (content, type = "info", details) => {
4855
- return showModal({
4856
- content,
4857
- type,
4858
- showCancel: false,
4859
- details
4860
- });
4861
- };
4862
- showConfirm = (content, options) => {
4863
- return showModal({
4864
- title: "确认",
4865
- content,
4866
- type: "warning",
4867
- showCancel: true,
4868
- ...options
4869
- });
4870
- };
4871
- }));
4872
- //#endregion
4873
- export { init_SysConfig as C, init_axios as D, init_config as E, axios$1 as O, init_pinia as S, config_default as T, request as _, showConfirm as a, createPinia as b, init_modal$1 as c, init_toast as d, setGlobalToast as f, init_base as g, toast_default as h, showAlert as i, modal_default$1 as l, init_toast$1 as m, init_modal as n, dataGrid_default as o, toast as p, modal_default as r, init_dataGrid as s, getModalInstance as t, init_loading as u, init_session as v, sysConfig as w, defineStore as x, useSessionStore as y };