@viasoftbr/shared-ui 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hooks.js ADDED
@@ -0,0 +1,4438 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __export = (target, all3) => {
4
+ for (var name in all3)
5
+ __defProp(target, name, { get: all3[name], enumerable: true });
6
+ };
7
+ var __publicField = (obj, key, value) => {
8
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9
+ return value;
10
+ };
11
+ var __accessCheck = (obj, member, msg) => {
12
+ if (!member.has(obj))
13
+ throw TypeError("Cannot " + msg);
14
+ };
15
+ var __privateGet = (obj, member, getter) => {
16
+ __accessCheck(obj, member, "read from private field");
17
+ return getter ? getter.call(obj) : member.get(obj);
18
+ };
19
+ var __privateAdd = (obj, member, value) => {
20
+ if (member.has(obj))
21
+ throw TypeError("Cannot add the same private member more than once");
22
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
23
+ };
24
+ var __privateSet = (obj, member, value, setter) => {
25
+ __accessCheck(obj, member, "write to private field");
26
+ setter ? setter.call(obj, value) : member.set(obj, value);
27
+ return value;
28
+ };
29
+ var __privateMethod = (obj, member, method) => {
30
+ __accessCheck(obj, member, "access private method");
31
+ return method;
32
+ };
33
+
34
+ // src/hooks/useSettings.ts
35
+ import { useState as useState4, useEffect as useEffect5, useCallback as useCallback3, useMemo } from "react";
36
+
37
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/subscribable.js
38
+ var Subscribable = class {
39
+ constructor() {
40
+ this.listeners = /* @__PURE__ */ new Set();
41
+ this.subscribe = this.subscribe.bind(this);
42
+ }
43
+ subscribe(listener) {
44
+ this.listeners.add(listener);
45
+ this.onSubscribe();
46
+ return () => {
47
+ this.listeners.delete(listener);
48
+ this.onUnsubscribe();
49
+ };
50
+ }
51
+ hasListeners() {
52
+ return this.listeners.size > 0;
53
+ }
54
+ onSubscribe() {
55
+ }
56
+ onUnsubscribe() {
57
+ }
58
+ };
59
+
60
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
61
+ var defaultTimeoutProvider = {
62
+ // We need the wrapper function syntax below instead of direct references to
63
+ // global setTimeout etc.
64
+ //
65
+ // BAD: `setTimeout: setTimeout`
66
+ // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
67
+ //
68
+ // If we use direct references here, then anything that wants to spy on or
69
+ // replace the global setTimeout (like tests) won't work since we'll already
70
+ // have a hard reference to the original implementation at the time when this
71
+ // file was imported.
72
+ setTimeout: (callback, delay) => setTimeout(callback, delay),
73
+ clearTimeout: (timeoutId) => clearTimeout(timeoutId),
74
+ setInterval: (callback, delay) => setInterval(callback, delay),
75
+ clearInterval: (intervalId) => clearInterval(intervalId)
76
+ };
77
+ var _provider, _providerCalled, _a;
78
+ var TimeoutManager = (_a = class {
79
+ constructor() {
80
+ // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
81
+ // type at app boot; and if we leave that type, then any new timer provider
82
+ // would need to support ReturnType<typeof setTimeout>, which is infeasible.
83
+ //
84
+ // We settle for type safety for the TimeoutProvider type, and accept that
85
+ // this class is unsafe internally to allow for extension.
86
+ __privateAdd(this, _provider, defaultTimeoutProvider);
87
+ __privateAdd(this, _providerCalled, false);
88
+ }
89
+ setTimeoutProvider(provider) {
90
+ if (false) {
91
+ if (__privateGet(this, _providerCalled) && provider !== __privateGet(this, _provider)) {
92
+ console.error(
93
+ `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,
94
+ { previous: __privateGet(this, _provider), provider }
95
+ );
96
+ }
97
+ }
98
+ __privateSet(this, _provider, provider);
99
+ if (false) {
100
+ __privateSet(this, _providerCalled, false);
101
+ }
102
+ }
103
+ setTimeout(callback, delay) {
104
+ if (false) {
105
+ __privateSet(this, _providerCalled, true);
106
+ }
107
+ return __privateGet(this, _provider).setTimeout(callback, delay);
108
+ }
109
+ clearTimeout(timeoutId) {
110
+ __privateGet(this, _provider).clearTimeout(timeoutId);
111
+ }
112
+ setInterval(callback, delay) {
113
+ if (false) {
114
+ __privateSet(this, _providerCalled, true);
115
+ }
116
+ return __privateGet(this, _provider).setInterval(callback, delay);
117
+ }
118
+ clearInterval(intervalId) {
119
+ __privateGet(this, _provider).clearInterval(intervalId);
120
+ }
121
+ }, _provider = new WeakMap(), _providerCalled = new WeakMap(), _a);
122
+ var timeoutManager = new TimeoutManager();
123
+ function systemSetTimeoutZero(callback) {
124
+ setTimeout(callback, 0);
125
+ }
126
+
127
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/utils.js
128
+ var isServer = typeof window === "undefined" || "Deno" in globalThis;
129
+ function noop() {
130
+ }
131
+ function isValidTimeout(value) {
132
+ return typeof value === "number" && value >= 0 && value !== Infinity;
133
+ }
134
+ function timeUntilStale(updatedAt, staleTime) {
135
+ return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
136
+ }
137
+ function resolveStaleTime(staleTime, query) {
138
+ return typeof staleTime === "function" ? staleTime(query) : staleTime;
139
+ }
140
+ function resolveEnabled(enabled, query) {
141
+ return typeof enabled === "function" ? enabled(query) : enabled;
142
+ }
143
+ function hashKey(queryKey) {
144
+ return JSON.stringify(
145
+ queryKey,
146
+ (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {
147
+ result[key] = val[key];
148
+ return result;
149
+ }, {}) : val
150
+ );
151
+ }
152
+ var hasOwn = Object.prototype.hasOwnProperty;
153
+ function replaceEqualDeep(a, b, depth = 0) {
154
+ if (a === b) {
155
+ return a;
156
+ }
157
+ if (depth > 500)
158
+ return b;
159
+ const array = isPlainArray(a) && isPlainArray(b);
160
+ if (!array && !(isPlainObject(a) && isPlainObject(b)))
161
+ return b;
162
+ const aItems = array ? a : Object.keys(a);
163
+ const aSize = aItems.length;
164
+ const bItems = array ? b : Object.keys(b);
165
+ const bSize = bItems.length;
166
+ const copy = array ? new Array(bSize) : {};
167
+ let equalItems = 0;
168
+ for (let i = 0; i < bSize; i++) {
169
+ const key = array ? i : bItems[i];
170
+ const aItem = a[key];
171
+ const bItem = b[key];
172
+ if (aItem === bItem) {
173
+ copy[key] = aItem;
174
+ if (array ? i < aSize : hasOwn.call(a, key))
175
+ equalItems++;
176
+ continue;
177
+ }
178
+ if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") {
179
+ copy[key] = bItem;
180
+ continue;
181
+ }
182
+ const v = replaceEqualDeep(aItem, bItem, depth + 1);
183
+ copy[key] = v;
184
+ if (v === aItem)
185
+ equalItems++;
186
+ }
187
+ return aSize === bSize && equalItems === aSize ? a : copy;
188
+ }
189
+ function shallowEqualObjects(a, b) {
190
+ if (!b || Object.keys(a).length !== Object.keys(b).length) {
191
+ return false;
192
+ }
193
+ for (const key in a) {
194
+ if (a[key] !== b[key]) {
195
+ return false;
196
+ }
197
+ }
198
+ return true;
199
+ }
200
+ function isPlainArray(value) {
201
+ return Array.isArray(value) && value.length === Object.keys(value).length;
202
+ }
203
+ function isPlainObject(o) {
204
+ if (!hasObjectPrototype(o)) {
205
+ return false;
206
+ }
207
+ const ctor = o.constructor;
208
+ if (ctor === void 0) {
209
+ return true;
210
+ }
211
+ const prot = ctor.prototype;
212
+ if (!hasObjectPrototype(prot)) {
213
+ return false;
214
+ }
215
+ if (!prot.hasOwnProperty("isPrototypeOf")) {
216
+ return false;
217
+ }
218
+ if (Object.getPrototypeOf(o) !== Object.prototype) {
219
+ return false;
220
+ }
221
+ return true;
222
+ }
223
+ function hasObjectPrototype(o) {
224
+ return Object.prototype.toString.call(o) === "[object Object]";
225
+ }
226
+ function replaceData(prevData, data, options) {
227
+ if (typeof options.structuralSharing === "function") {
228
+ return options.structuralSharing(prevData, data);
229
+ } else if (options.structuralSharing !== false) {
230
+ if (false) {
231
+ try {
232
+ return replaceEqualDeep(prevData, data);
233
+ } catch (error) {
234
+ console.error(
235
+ `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`
236
+ );
237
+ throw error;
238
+ }
239
+ }
240
+ return replaceEqualDeep(prevData, data);
241
+ }
242
+ return data;
243
+ }
244
+ function shouldThrowError(throwOnError, params) {
245
+ if (typeof throwOnError === "function") {
246
+ return throwOnError(...params);
247
+ }
248
+ return !!throwOnError;
249
+ }
250
+
251
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/focusManager.js
252
+ var _focused, _cleanup, _setup, _a2;
253
+ var FocusManager = (_a2 = class extends Subscribable {
254
+ constructor() {
255
+ super();
256
+ __privateAdd(this, _focused, void 0);
257
+ __privateAdd(this, _cleanup, void 0);
258
+ __privateAdd(this, _setup, void 0);
259
+ __privateSet(this, _setup, (onFocus) => {
260
+ if (!isServer && window.addEventListener) {
261
+ const listener = () => onFocus();
262
+ window.addEventListener("visibilitychange", listener, false);
263
+ return () => {
264
+ window.removeEventListener("visibilitychange", listener);
265
+ };
266
+ }
267
+ return;
268
+ });
269
+ }
270
+ onSubscribe() {
271
+ if (!__privateGet(this, _cleanup)) {
272
+ this.setEventListener(__privateGet(this, _setup));
273
+ }
274
+ }
275
+ onUnsubscribe() {
276
+ var _a6;
277
+ if (!this.hasListeners()) {
278
+ (_a6 = __privateGet(this, _cleanup)) == null ? void 0 : _a6.call(this);
279
+ __privateSet(this, _cleanup, void 0);
280
+ }
281
+ }
282
+ setEventListener(setup) {
283
+ var _a6;
284
+ __privateSet(this, _setup, setup);
285
+ (_a6 = __privateGet(this, _cleanup)) == null ? void 0 : _a6.call(this);
286
+ __privateSet(this, _cleanup, setup((focused) => {
287
+ if (typeof focused === "boolean") {
288
+ this.setFocused(focused);
289
+ } else {
290
+ this.onFocus();
291
+ }
292
+ }));
293
+ }
294
+ setFocused(focused) {
295
+ const changed = __privateGet(this, _focused) !== focused;
296
+ if (changed) {
297
+ __privateSet(this, _focused, focused);
298
+ this.onFocus();
299
+ }
300
+ }
301
+ onFocus() {
302
+ const isFocused = this.isFocused();
303
+ this.listeners.forEach((listener) => {
304
+ listener(isFocused);
305
+ });
306
+ }
307
+ isFocused() {
308
+ if (typeof __privateGet(this, _focused) === "boolean") {
309
+ return __privateGet(this, _focused);
310
+ }
311
+ return globalThis.document?.visibilityState !== "hidden";
312
+ }
313
+ }, _focused = new WeakMap(), _cleanup = new WeakMap(), _setup = new WeakMap(), _a2);
314
+ var focusManager = new FocusManager();
315
+
316
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/thenable.js
317
+ function pendingThenable() {
318
+ let resolve;
319
+ let reject;
320
+ const thenable = new Promise((_resolve, _reject) => {
321
+ resolve = _resolve;
322
+ reject = _reject;
323
+ });
324
+ thenable.status = "pending";
325
+ thenable.catch(() => {
326
+ });
327
+ function finalize(data) {
328
+ Object.assign(thenable, data);
329
+ delete thenable.resolve;
330
+ delete thenable.reject;
331
+ }
332
+ thenable.resolve = (value) => {
333
+ finalize({
334
+ status: "fulfilled",
335
+ value
336
+ });
337
+ resolve(value);
338
+ };
339
+ thenable.reject = (reason) => {
340
+ finalize({
341
+ status: "rejected",
342
+ reason
343
+ });
344
+ reject(reason);
345
+ };
346
+ return thenable;
347
+ }
348
+
349
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/notifyManager.js
350
+ var defaultScheduler = systemSetTimeoutZero;
351
+ function createNotifyManager() {
352
+ let queue = [];
353
+ let transactions = 0;
354
+ let notifyFn = (callback) => {
355
+ callback();
356
+ };
357
+ let batchNotifyFn = (callback) => {
358
+ callback();
359
+ };
360
+ let scheduleFn = defaultScheduler;
361
+ const schedule = (callback) => {
362
+ if (transactions) {
363
+ queue.push(callback);
364
+ } else {
365
+ scheduleFn(() => {
366
+ notifyFn(callback);
367
+ });
368
+ }
369
+ };
370
+ const flush = () => {
371
+ const originalQueue = queue;
372
+ queue = [];
373
+ if (originalQueue.length) {
374
+ scheduleFn(() => {
375
+ batchNotifyFn(() => {
376
+ originalQueue.forEach((callback) => {
377
+ notifyFn(callback);
378
+ });
379
+ });
380
+ });
381
+ }
382
+ };
383
+ return {
384
+ batch: (callback) => {
385
+ let result;
386
+ transactions++;
387
+ try {
388
+ result = callback();
389
+ } finally {
390
+ transactions--;
391
+ if (!transactions) {
392
+ flush();
393
+ }
394
+ }
395
+ return result;
396
+ },
397
+ /**
398
+ * All calls to the wrapped function will be batched.
399
+ */
400
+ batchCalls: (callback) => {
401
+ return (...args) => {
402
+ schedule(() => {
403
+ callback(...args);
404
+ });
405
+ };
406
+ },
407
+ schedule,
408
+ /**
409
+ * Use this method to set a custom notify function.
410
+ * This can be used to for example wrap notifications with `React.act` while running tests.
411
+ */
412
+ setNotifyFunction: (fn) => {
413
+ notifyFn = fn;
414
+ },
415
+ /**
416
+ * Use this method to set a custom function to batch notifications together into a single tick.
417
+ * By default React Query will use the batch function provided by ReactDOM or React Native.
418
+ */
419
+ setBatchNotifyFunction: (fn) => {
420
+ batchNotifyFn = fn;
421
+ },
422
+ setScheduler: (fn) => {
423
+ scheduleFn = fn;
424
+ }
425
+ };
426
+ }
427
+ var notifyManager = createNotifyManager();
428
+
429
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/onlineManager.js
430
+ var _online, _cleanup2, _setup2, _a3;
431
+ var OnlineManager = (_a3 = class extends Subscribable {
432
+ constructor() {
433
+ super();
434
+ __privateAdd(this, _online, true);
435
+ __privateAdd(this, _cleanup2, void 0);
436
+ __privateAdd(this, _setup2, void 0);
437
+ __privateSet(this, _setup2, (onOnline) => {
438
+ if (!isServer && window.addEventListener) {
439
+ const onlineListener = () => onOnline(true);
440
+ const offlineListener = () => onOnline(false);
441
+ window.addEventListener("online", onlineListener, false);
442
+ window.addEventListener("offline", offlineListener, false);
443
+ return () => {
444
+ window.removeEventListener("online", onlineListener);
445
+ window.removeEventListener("offline", offlineListener);
446
+ };
447
+ }
448
+ return;
449
+ });
450
+ }
451
+ onSubscribe() {
452
+ if (!__privateGet(this, _cleanup2)) {
453
+ this.setEventListener(__privateGet(this, _setup2));
454
+ }
455
+ }
456
+ onUnsubscribe() {
457
+ var _a6;
458
+ if (!this.hasListeners()) {
459
+ (_a6 = __privateGet(this, _cleanup2)) == null ? void 0 : _a6.call(this);
460
+ __privateSet(this, _cleanup2, void 0);
461
+ }
462
+ }
463
+ setEventListener(setup) {
464
+ var _a6;
465
+ __privateSet(this, _setup2, setup);
466
+ (_a6 = __privateGet(this, _cleanup2)) == null ? void 0 : _a6.call(this);
467
+ __privateSet(this, _cleanup2, setup(this.setOnline.bind(this)));
468
+ }
469
+ setOnline(online) {
470
+ const changed = __privateGet(this, _online) !== online;
471
+ if (changed) {
472
+ __privateSet(this, _online, online);
473
+ this.listeners.forEach((listener) => {
474
+ listener(online);
475
+ });
476
+ }
477
+ }
478
+ isOnline() {
479
+ return __privateGet(this, _online);
480
+ }
481
+ }, _online = new WeakMap(), _cleanup2 = new WeakMap(), _setup2 = new WeakMap(), _a3);
482
+ var onlineManager = new OnlineManager();
483
+
484
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/retryer.js
485
+ function canFetch(networkMode) {
486
+ return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true;
487
+ }
488
+
489
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/query.js
490
+ function fetchState(data, options) {
491
+ return {
492
+ fetchFailureCount: 0,
493
+ fetchFailureReason: null,
494
+ fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused",
495
+ ...data === void 0 && {
496
+ error: null,
497
+ status: "pending"
498
+ }
499
+ };
500
+ }
501
+
502
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryObserver.js
503
+ var _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _executeFetch, executeFetch_fn, _updateStaleTimeout, updateStaleTimeout_fn, _computeRefetchInterval, computeRefetchInterval_fn, _updateRefetchInterval, updateRefetchInterval_fn, _updateTimers, updateTimers_fn, _clearStaleTimeout, clearStaleTimeout_fn, _clearRefetchInterval, clearRefetchInterval_fn, _updateQuery, updateQuery_fn, _notify, notify_fn, _a4;
504
+ var QueryObserver = (_a4 = class extends Subscribable {
505
+ constructor(client, options) {
506
+ super();
507
+ __privateAdd(this, _executeFetch);
508
+ __privateAdd(this, _updateStaleTimeout);
509
+ __privateAdd(this, _computeRefetchInterval);
510
+ __privateAdd(this, _updateRefetchInterval);
511
+ __privateAdd(this, _updateTimers);
512
+ __privateAdd(this, _clearStaleTimeout);
513
+ __privateAdd(this, _clearRefetchInterval);
514
+ __privateAdd(this, _updateQuery);
515
+ __privateAdd(this, _notify);
516
+ __privateAdd(this, _client, void 0);
517
+ __privateAdd(this, _currentQuery, void 0);
518
+ __privateAdd(this, _currentQueryInitialState, void 0);
519
+ __privateAdd(this, _currentResult, void 0);
520
+ __privateAdd(this, _currentResultState, void 0);
521
+ __privateAdd(this, _currentResultOptions, void 0);
522
+ __privateAdd(this, _currentThenable, void 0);
523
+ __privateAdd(this, _selectError, void 0);
524
+ __privateAdd(this, _selectFn, void 0);
525
+ __privateAdd(this, _selectResult, void 0);
526
+ // This property keeps track of the last query with defined data.
527
+ // It will be used to pass the previous data and query to the placeholder function between renders.
528
+ __privateAdd(this, _lastQueryWithDefinedData, void 0);
529
+ __privateAdd(this, _staleTimeoutId, void 0);
530
+ __privateAdd(this, _refetchIntervalId, void 0);
531
+ __privateAdd(this, _currentRefetchInterval, void 0);
532
+ __privateAdd(this, _trackedProps, /* @__PURE__ */ new Set());
533
+ this.options = options;
534
+ __privateSet(this, _client, client);
535
+ __privateSet(this, _selectError, null);
536
+ __privateSet(this, _currentThenable, pendingThenable());
537
+ this.bindMethods();
538
+ this.setOptions(options);
539
+ }
540
+ bindMethods() {
541
+ this.refetch = this.refetch.bind(this);
542
+ }
543
+ onSubscribe() {
544
+ if (this.listeners.size === 1) {
545
+ __privateGet(this, _currentQuery).addObserver(this);
546
+ if (shouldFetchOnMount(__privateGet(this, _currentQuery), this.options)) {
547
+ __privateMethod(this, _executeFetch, executeFetch_fn).call(this);
548
+ } else {
549
+ this.updateResult();
550
+ }
551
+ __privateMethod(this, _updateTimers, updateTimers_fn).call(this);
552
+ }
553
+ }
554
+ onUnsubscribe() {
555
+ if (!this.hasListeners()) {
556
+ this.destroy();
557
+ }
558
+ }
559
+ shouldFetchOnReconnect() {
560
+ return shouldFetchOn(
561
+ __privateGet(this, _currentQuery),
562
+ this.options,
563
+ this.options.refetchOnReconnect
564
+ );
565
+ }
566
+ shouldFetchOnWindowFocus() {
567
+ return shouldFetchOn(
568
+ __privateGet(this, _currentQuery),
569
+ this.options,
570
+ this.options.refetchOnWindowFocus
571
+ );
572
+ }
573
+ destroy() {
574
+ this.listeners = /* @__PURE__ */ new Set();
575
+ __privateMethod(this, _clearStaleTimeout, clearStaleTimeout_fn).call(this);
576
+ __privateMethod(this, _clearRefetchInterval, clearRefetchInterval_fn).call(this);
577
+ __privateGet(this, _currentQuery).removeObserver(this);
578
+ }
579
+ setOptions(options) {
580
+ const prevOptions = this.options;
581
+ const prevQuery = __privateGet(this, _currentQuery);
582
+ this.options = __privateGet(this, _client).defaultQueryOptions(options);
583
+ if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== "boolean") {
584
+ throw new Error(
585
+ "Expected enabled to be a boolean or a callback that returns a boolean"
586
+ );
587
+ }
588
+ __privateMethod(this, _updateQuery, updateQuery_fn).call(this);
589
+ __privateGet(this, _currentQuery).setOptions(this.options);
590
+ if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {
591
+ __privateGet(this, _client).getQueryCache().notify({
592
+ type: "observerOptionsUpdated",
593
+ query: __privateGet(this, _currentQuery),
594
+ observer: this
595
+ });
596
+ }
597
+ const mounted = this.hasListeners();
598
+ if (mounted && shouldFetchOptionally(
599
+ __privateGet(this, _currentQuery),
600
+ prevQuery,
601
+ this.options,
602
+ prevOptions
603
+ )) {
604
+ __privateMethod(this, _executeFetch, executeFetch_fn).call(this);
605
+ }
606
+ this.updateResult();
607
+ if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || resolveStaleTime(this.options.staleTime, __privateGet(this, _currentQuery)) !== resolveStaleTime(prevOptions.staleTime, __privateGet(this, _currentQuery)))) {
608
+ __privateMethod(this, _updateStaleTimeout, updateStaleTimeout_fn).call(this);
609
+ }
610
+ const nextRefetchInterval = __privateMethod(this, _computeRefetchInterval, computeRefetchInterval_fn).call(this);
611
+ if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || nextRefetchInterval !== __privateGet(this, _currentRefetchInterval))) {
612
+ __privateMethod(this, _updateRefetchInterval, updateRefetchInterval_fn).call(this, nextRefetchInterval);
613
+ }
614
+ }
615
+ getOptimisticResult(options) {
616
+ const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), options);
617
+ const result = this.createResult(query, options);
618
+ if (shouldAssignObserverCurrentProperties(this, result)) {
619
+ __privateSet(this, _currentResult, result);
620
+ __privateSet(this, _currentResultOptions, this.options);
621
+ __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state);
622
+ }
623
+ return result;
624
+ }
625
+ getCurrentResult() {
626
+ return __privateGet(this, _currentResult);
627
+ }
628
+ trackResult(result, onPropTracked) {
629
+ return new Proxy(result, {
630
+ get: (target, key) => {
631
+ this.trackProp(key);
632
+ onPropTracked?.(key);
633
+ if (key === "promise") {
634
+ this.trackProp("data");
635
+ if (!this.options.experimental_prefetchInRender && __privateGet(this, _currentThenable).status === "pending") {
636
+ __privateGet(this, _currentThenable).reject(
637
+ new Error(
638
+ "experimental_prefetchInRender feature flag is not enabled"
639
+ )
640
+ );
641
+ }
642
+ }
643
+ return Reflect.get(target, key);
644
+ }
645
+ });
646
+ }
647
+ trackProp(key) {
648
+ __privateGet(this, _trackedProps).add(key);
649
+ }
650
+ getCurrentQuery() {
651
+ return __privateGet(this, _currentQuery);
652
+ }
653
+ refetch({ ...options } = {}) {
654
+ return this.fetch({
655
+ ...options
656
+ });
657
+ }
658
+ fetchOptimistic(options) {
659
+ const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options);
660
+ const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), defaultedOptions);
661
+ return query.fetch().then(() => this.createResult(query, defaultedOptions));
662
+ }
663
+ fetch(fetchOptions) {
664
+ return __privateMethod(this, _executeFetch, executeFetch_fn).call(this, {
665
+ ...fetchOptions,
666
+ cancelRefetch: fetchOptions.cancelRefetch ?? true
667
+ }).then(() => {
668
+ this.updateResult();
669
+ return __privateGet(this, _currentResult);
670
+ });
671
+ }
672
+ createResult(query, options) {
673
+ const prevQuery = __privateGet(this, _currentQuery);
674
+ const prevOptions = this.options;
675
+ const prevResult = __privateGet(this, _currentResult);
676
+ const prevResultState = __privateGet(this, _currentResultState);
677
+ const prevResultOptions = __privateGet(this, _currentResultOptions);
678
+ const queryChange = query !== prevQuery;
679
+ const queryInitialState = queryChange ? query.state : __privateGet(this, _currentQueryInitialState);
680
+ const { state } = query;
681
+ let newState = { ...state };
682
+ let isPlaceholderData = false;
683
+ let data;
684
+ if (options._optimisticResults) {
685
+ const mounted = this.hasListeners();
686
+ const fetchOnMount = !mounted && shouldFetchOnMount(query, options);
687
+ const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);
688
+ if (fetchOnMount || fetchOptionally) {
689
+ newState = {
690
+ ...newState,
691
+ ...fetchState(state.data, query.options)
692
+ };
693
+ }
694
+ if (options._optimisticResults === "isRestoring") {
695
+ newState.fetchStatus = "idle";
696
+ }
697
+ }
698
+ let { error, errorUpdatedAt, status } = newState;
699
+ data = newState.data;
700
+ let skipSelect = false;
701
+ if (options.placeholderData !== void 0 && data === void 0 && status === "pending") {
702
+ let placeholderData;
703
+ if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {
704
+ placeholderData = prevResult.data;
705
+ skipSelect = true;
706
+ } else {
707
+ placeholderData = typeof options.placeholderData === "function" ? options.placeholderData(
708
+ __privateGet(this, _lastQueryWithDefinedData)?.state.data,
709
+ __privateGet(this, _lastQueryWithDefinedData)
710
+ ) : options.placeholderData;
711
+ }
712
+ if (placeholderData !== void 0) {
713
+ status = "success";
714
+ data = replaceData(
715
+ prevResult?.data,
716
+ placeholderData,
717
+ options
718
+ );
719
+ isPlaceholderData = true;
720
+ }
721
+ }
722
+ if (options.select && data !== void 0 && !skipSelect) {
723
+ if (prevResult && data === prevResultState?.data && options.select === __privateGet(this, _selectFn)) {
724
+ data = __privateGet(this, _selectResult);
725
+ } else {
726
+ try {
727
+ __privateSet(this, _selectFn, options.select);
728
+ data = options.select(data);
729
+ data = replaceData(prevResult?.data, data, options);
730
+ __privateSet(this, _selectResult, data);
731
+ __privateSet(this, _selectError, null);
732
+ } catch (selectError) {
733
+ __privateSet(this, _selectError, selectError);
734
+ }
735
+ }
736
+ }
737
+ if (__privateGet(this, _selectError)) {
738
+ error = __privateGet(this, _selectError);
739
+ data = __privateGet(this, _selectResult);
740
+ errorUpdatedAt = Date.now();
741
+ status = "error";
742
+ }
743
+ const isFetching = newState.fetchStatus === "fetching";
744
+ const isPending = status === "pending";
745
+ const isError = status === "error";
746
+ const isLoading = isPending && isFetching;
747
+ const hasData = data !== void 0;
748
+ const result = {
749
+ status,
750
+ fetchStatus: newState.fetchStatus,
751
+ isPending,
752
+ isSuccess: status === "success",
753
+ isError,
754
+ isInitialLoading: isLoading,
755
+ isLoading,
756
+ data,
757
+ dataUpdatedAt: newState.dataUpdatedAt,
758
+ error,
759
+ errorUpdatedAt,
760
+ failureCount: newState.fetchFailureCount,
761
+ failureReason: newState.fetchFailureReason,
762
+ errorUpdateCount: newState.errorUpdateCount,
763
+ isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,
764
+ isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,
765
+ isFetching,
766
+ isRefetching: isFetching && !isPending,
767
+ isLoadingError: isError && !hasData,
768
+ isPaused: newState.fetchStatus === "paused",
769
+ isPlaceholderData,
770
+ isRefetchError: isError && hasData,
771
+ isStale: isStale(query, options),
772
+ refetch: this.refetch,
773
+ promise: __privateGet(this, _currentThenable),
774
+ isEnabled: resolveEnabled(options.enabled, query) !== false
775
+ };
776
+ const nextResult = result;
777
+ if (this.options.experimental_prefetchInRender) {
778
+ const hasResultData = nextResult.data !== void 0;
779
+ const isErrorWithoutData = nextResult.status === "error" && !hasResultData;
780
+ const finalizeThenableIfPossible = (thenable) => {
781
+ if (isErrorWithoutData) {
782
+ thenable.reject(nextResult.error);
783
+ } else if (hasResultData) {
784
+ thenable.resolve(nextResult.data);
785
+ }
786
+ };
787
+ const recreateThenable = () => {
788
+ const pending = __privateSet(this, _currentThenable, nextResult.promise = pendingThenable());
789
+ finalizeThenableIfPossible(pending);
790
+ };
791
+ const prevThenable = __privateGet(this, _currentThenable);
792
+ switch (prevThenable.status) {
793
+ case "pending":
794
+ if (query.queryHash === prevQuery.queryHash) {
795
+ finalizeThenableIfPossible(prevThenable);
796
+ }
797
+ break;
798
+ case "fulfilled":
799
+ if (isErrorWithoutData || nextResult.data !== prevThenable.value) {
800
+ recreateThenable();
801
+ }
802
+ break;
803
+ case "rejected":
804
+ if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {
805
+ recreateThenable();
806
+ }
807
+ break;
808
+ }
809
+ }
810
+ return nextResult;
811
+ }
812
+ updateResult() {
813
+ const prevResult = __privateGet(this, _currentResult);
814
+ const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options);
815
+ __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state);
816
+ __privateSet(this, _currentResultOptions, this.options);
817
+ if (__privateGet(this, _currentResultState).data !== void 0) {
818
+ __privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery));
819
+ }
820
+ if (shallowEqualObjects(nextResult, prevResult)) {
821
+ return;
822
+ }
823
+ __privateSet(this, _currentResult, nextResult);
824
+ const shouldNotifyListeners = () => {
825
+ if (!prevResult) {
826
+ return true;
827
+ }
828
+ const { notifyOnChangeProps } = this.options;
829
+ const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps;
830
+ if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !__privateGet(this, _trackedProps).size) {
831
+ return true;
832
+ }
833
+ const includedProps = new Set(
834
+ notifyOnChangePropsValue ?? __privateGet(this, _trackedProps)
835
+ );
836
+ if (this.options.throwOnError) {
837
+ includedProps.add("error");
838
+ }
839
+ return Object.keys(__privateGet(this, _currentResult)).some((key) => {
840
+ const typedKey = key;
841
+ const changed = __privateGet(this, _currentResult)[typedKey] !== prevResult[typedKey];
842
+ return changed && includedProps.has(typedKey);
843
+ });
844
+ };
845
+ __privateMethod(this, _notify, notify_fn).call(this, { listeners: shouldNotifyListeners() });
846
+ }
847
+ onQueryUpdate() {
848
+ this.updateResult();
849
+ if (this.hasListeners()) {
850
+ __privateMethod(this, _updateTimers, updateTimers_fn).call(this);
851
+ }
852
+ }
853
+ }, _client = new WeakMap(), _currentQuery = new WeakMap(), _currentQueryInitialState = new WeakMap(), _currentResult = new WeakMap(), _currentResultState = new WeakMap(), _currentResultOptions = new WeakMap(), _currentThenable = new WeakMap(), _selectError = new WeakMap(), _selectFn = new WeakMap(), _selectResult = new WeakMap(), _lastQueryWithDefinedData = new WeakMap(), _staleTimeoutId = new WeakMap(), _refetchIntervalId = new WeakMap(), _currentRefetchInterval = new WeakMap(), _trackedProps = new WeakMap(), _executeFetch = new WeakSet(), executeFetch_fn = function(fetchOptions) {
854
+ __privateMethod(this, _updateQuery, updateQuery_fn).call(this);
855
+ let promise = __privateGet(this, _currentQuery).fetch(
856
+ this.options,
857
+ fetchOptions
858
+ );
859
+ if (!fetchOptions?.throwOnError) {
860
+ promise = promise.catch(noop);
861
+ }
862
+ return promise;
863
+ }, _updateStaleTimeout = new WeakSet(), updateStaleTimeout_fn = function() {
864
+ __privateMethod(this, _clearStaleTimeout, clearStaleTimeout_fn).call(this);
865
+ const staleTime = resolveStaleTime(
866
+ this.options.staleTime,
867
+ __privateGet(this, _currentQuery)
868
+ );
869
+ if (isServer || __privateGet(this, _currentResult).isStale || !isValidTimeout(staleTime)) {
870
+ return;
871
+ }
872
+ const time = timeUntilStale(__privateGet(this, _currentResult).dataUpdatedAt, staleTime);
873
+ const timeout = time + 1;
874
+ __privateSet(this, _staleTimeoutId, timeoutManager.setTimeout(() => {
875
+ if (!__privateGet(this, _currentResult).isStale) {
876
+ this.updateResult();
877
+ }
878
+ }, timeout));
879
+ }, _computeRefetchInterval = new WeakSet(), computeRefetchInterval_fn = function() {
880
+ return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(__privateGet(this, _currentQuery)) : this.options.refetchInterval) ?? false;
881
+ }, _updateRefetchInterval = new WeakSet(), updateRefetchInterval_fn = function(nextInterval) {
882
+ __privateMethod(this, _clearRefetchInterval, clearRefetchInterval_fn).call(this);
883
+ __privateSet(this, _currentRefetchInterval, nextInterval);
884
+ if (isServer || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) === false || !isValidTimeout(__privateGet(this, _currentRefetchInterval)) || __privateGet(this, _currentRefetchInterval) === 0) {
885
+ return;
886
+ }
887
+ __privateSet(this, _refetchIntervalId, timeoutManager.setInterval(() => {
888
+ if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {
889
+ __privateMethod(this, _executeFetch, executeFetch_fn).call(this);
890
+ }
891
+ }, __privateGet(this, _currentRefetchInterval)));
892
+ }, _updateTimers = new WeakSet(), updateTimers_fn = function() {
893
+ __privateMethod(this, _updateStaleTimeout, updateStaleTimeout_fn).call(this);
894
+ __privateMethod(this, _updateRefetchInterval, updateRefetchInterval_fn).call(this, __privateMethod(this, _computeRefetchInterval, computeRefetchInterval_fn).call(this));
895
+ }, _clearStaleTimeout = new WeakSet(), clearStaleTimeout_fn = function() {
896
+ if (__privateGet(this, _staleTimeoutId)) {
897
+ timeoutManager.clearTimeout(__privateGet(this, _staleTimeoutId));
898
+ __privateSet(this, _staleTimeoutId, void 0);
899
+ }
900
+ }, _clearRefetchInterval = new WeakSet(), clearRefetchInterval_fn = function() {
901
+ if (__privateGet(this, _refetchIntervalId)) {
902
+ timeoutManager.clearInterval(__privateGet(this, _refetchIntervalId));
903
+ __privateSet(this, _refetchIntervalId, void 0);
904
+ }
905
+ }, _updateQuery = new WeakSet(), updateQuery_fn = function() {
906
+ const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), this.options);
907
+ if (query === __privateGet(this, _currentQuery)) {
908
+ return;
909
+ }
910
+ const prevQuery = __privateGet(this, _currentQuery);
911
+ __privateSet(this, _currentQuery, query);
912
+ __privateSet(this, _currentQueryInitialState, query.state);
913
+ if (this.hasListeners()) {
914
+ prevQuery?.removeObserver(this);
915
+ query.addObserver(this);
916
+ }
917
+ }, _notify = new WeakSet(), notify_fn = function(notifyOptions) {
918
+ notifyManager.batch(() => {
919
+ if (notifyOptions.listeners) {
920
+ this.listeners.forEach((listener) => {
921
+ listener(__privateGet(this, _currentResult));
922
+ });
923
+ }
924
+ __privateGet(this, _client).getQueryCache().notify({
925
+ query: __privateGet(this, _currentQuery),
926
+ type: "observerResultsUpdated"
927
+ });
928
+ });
929
+ }, _a4);
930
+ function shouldLoadOnMount(query, options) {
931
+ return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false);
932
+ }
933
+ function shouldFetchOnMount(query, options) {
934
+ return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);
935
+ }
936
+ function shouldFetchOn(query, options, field) {
937
+ if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") {
938
+ const value = typeof field === "function" ? field(query) : field;
939
+ return value === "always" || value !== false && isStale(query, options);
940
+ }
941
+ return false;
942
+ }
943
+ function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
944
+ return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
945
+ }
946
+ function isStale(query, options) {
947
+ return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));
948
+ }
949
+ function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
950
+ if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {
951
+ return true;
952
+ }
953
+ return false;
954
+ }
955
+
956
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutation.js
957
+ function getDefaultState() {
958
+ return {
959
+ context: void 0,
960
+ data: void 0,
961
+ error: null,
962
+ failureCount: 0,
963
+ failureReason: null,
964
+ isPaused: false,
965
+ status: "idle",
966
+ variables: void 0,
967
+ submittedAt: 0
968
+ };
969
+ }
970
+
971
+ // node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutationObserver.js
972
+ var _client2, _currentResult2, _currentMutation, _mutateOptions, _updateResult, updateResult_fn, _notify2, notify_fn2, _a5;
973
+ var MutationObserver = (_a5 = class extends Subscribable {
974
+ constructor(client, options) {
975
+ super();
976
+ __privateAdd(this, _updateResult);
977
+ __privateAdd(this, _notify2);
978
+ __privateAdd(this, _client2, void 0);
979
+ __privateAdd(this, _currentResult2, void 0);
980
+ __privateAdd(this, _currentMutation, void 0);
981
+ __privateAdd(this, _mutateOptions, void 0);
982
+ __privateSet(this, _client2, client);
983
+ this.setOptions(options);
984
+ this.bindMethods();
985
+ __privateMethod(this, _updateResult, updateResult_fn).call(this);
986
+ }
987
+ bindMethods() {
988
+ this.mutate = this.mutate.bind(this);
989
+ this.reset = this.reset.bind(this);
990
+ }
991
+ setOptions(options) {
992
+ const prevOptions = this.options;
993
+ this.options = __privateGet(this, _client2).defaultMutationOptions(options);
994
+ if (!shallowEqualObjects(this.options, prevOptions)) {
995
+ __privateGet(this, _client2).getMutationCache().notify({
996
+ type: "observerOptionsUpdated",
997
+ mutation: __privateGet(this, _currentMutation),
998
+ observer: this
999
+ });
1000
+ }
1001
+ if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) {
1002
+ this.reset();
1003
+ } else if (__privateGet(this, _currentMutation)?.state.status === "pending") {
1004
+ __privateGet(this, _currentMutation).setOptions(this.options);
1005
+ }
1006
+ }
1007
+ onUnsubscribe() {
1008
+ if (!this.hasListeners()) {
1009
+ __privateGet(this, _currentMutation)?.removeObserver(this);
1010
+ }
1011
+ }
1012
+ onMutationUpdate(action) {
1013
+ __privateMethod(this, _updateResult, updateResult_fn).call(this);
1014
+ __privateMethod(this, _notify2, notify_fn2).call(this, action);
1015
+ }
1016
+ getCurrentResult() {
1017
+ return __privateGet(this, _currentResult2);
1018
+ }
1019
+ reset() {
1020
+ __privateGet(this, _currentMutation)?.removeObserver(this);
1021
+ __privateSet(this, _currentMutation, void 0);
1022
+ __privateMethod(this, _updateResult, updateResult_fn).call(this);
1023
+ __privateMethod(this, _notify2, notify_fn2).call(this);
1024
+ }
1025
+ mutate(variables, options) {
1026
+ __privateSet(this, _mutateOptions, options);
1027
+ __privateGet(this, _currentMutation)?.removeObserver(this);
1028
+ __privateSet(this, _currentMutation, __privateGet(this, _client2).getMutationCache().build(__privateGet(this, _client2), this.options));
1029
+ __privateGet(this, _currentMutation).addObserver(this);
1030
+ return __privateGet(this, _currentMutation).execute(variables);
1031
+ }
1032
+ }, _client2 = new WeakMap(), _currentResult2 = new WeakMap(), _currentMutation = new WeakMap(), _mutateOptions = new WeakMap(), _updateResult = new WeakSet(), updateResult_fn = function() {
1033
+ const state = __privateGet(this, _currentMutation)?.state ?? getDefaultState();
1034
+ __privateSet(this, _currentResult2, {
1035
+ ...state,
1036
+ isPending: state.status === "pending",
1037
+ isSuccess: state.status === "success",
1038
+ isError: state.status === "error",
1039
+ isIdle: state.status === "idle",
1040
+ mutate: this.mutate,
1041
+ reset: this.reset
1042
+ });
1043
+ }, _notify2 = new WeakSet(), notify_fn2 = function(action) {
1044
+ notifyManager.batch(() => {
1045
+ if (__privateGet(this, _mutateOptions) && this.hasListeners()) {
1046
+ const variables = __privateGet(this, _currentResult2).variables;
1047
+ const onMutateResult = __privateGet(this, _currentResult2).context;
1048
+ const context = {
1049
+ client: __privateGet(this, _client2),
1050
+ meta: this.options.meta,
1051
+ mutationKey: this.options.mutationKey
1052
+ };
1053
+ if (action?.type === "success") {
1054
+ try {
1055
+ __privateGet(this, _mutateOptions).onSuccess?.(
1056
+ action.data,
1057
+ variables,
1058
+ onMutateResult,
1059
+ context
1060
+ );
1061
+ } catch (e) {
1062
+ void Promise.reject(e);
1063
+ }
1064
+ try {
1065
+ __privateGet(this, _mutateOptions).onSettled?.(
1066
+ action.data,
1067
+ null,
1068
+ variables,
1069
+ onMutateResult,
1070
+ context
1071
+ );
1072
+ } catch (e) {
1073
+ void Promise.reject(e);
1074
+ }
1075
+ } else if (action?.type === "error") {
1076
+ try {
1077
+ __privateGet(this, _mutateOptions).onError?.(
1078
+ action.error,
1079
+ variables,
1080
+ onMutateResult,
1081
+ context
1082
+ );
1083
+ } catch (e) {
1084
+ void Promise.reject(e);
1085
+ }
1086
+ try {
1087
+ __privateGet(this, _mutateOptions).onSettled?.(
1088
+ void 0,
1089
+ action.error,
1090
+ variables,
1091
+ onMutateResult,
1092
+ context
1093
+ );
1094
+ } catch (e) {
1095
+ void Promise.reject(e);
1096
+ }
1097
+ }
1098
+ }
1099
+ this.listeners.forEach((listener) => {
1100
+ listener(__privateGet(this, _currentResult2));
1101
+ });
1102
+ });
1103
+ }, _a5);
1104
+
1105
+ // node_modules/.pnpm/@tanstack+react-query@5.90.20_react@19.2.4/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
1106
+ import * as React from "react";
1107
+ import { jsx } from "react/jsx-runtime";
1108
+ var QueryClientContext = React.createContext(
1109
+ void 0
1110
+ );
1111
+ var useQueryClient = (queryClient) => {
1112
+ const client = React.useContext(QueryClientContext);
1113
+ if (queryClient) {
1114
+ return queryClient;
1115
+ }
1116
+ if (!client) {
1117
+ throw new Error("No QueryClient set, use QueryClientProvider to set one");
1118
+ }
1119
+ return client;
1120
+ };
1121
+
1122
+ // node_modules/.pnpm/@tanstack+react-query@5.90.20_react@19.2.4/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js
1123
+ import * as React2 from "react";
1124
+ var IsRestoringContext = React2.createContext(false);
1125
+ var useIsRestoring = () => React2.useContext(IsRestoringContext);
1126
+ var IsRestoringProvider = IsRestoringContext.Provider;
1127
+
1128
+ // node_modules/.pnpm/@tanstack+react-query@5.90.20_react@19.2.4/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
1129
+ import * as React3 from "react";
1130
+ import { jsx as jsx2 } from "react/jsx-runtime";
1131
+ function createValue() {
1132
+ let isReset = false;
1133
+ return {
1134
+ clearReset: () => {
1135
+ isReset = false;
1136
+ },
1137
+ reset: () => {
1138
+ isReset = true;
1139
+ },
1140
+ isReset: () => {
1141
+ return isReset;
1142
+ }
1143
+ };
1144
+ }
1145
+ var QueryErrorResetBoundaryContext = React3.createContext(createValue());
1146
+ var useQueryErrorResetBoundary = () => React3.useContext(QueryErrorResetBoundaryContext);
1147
+
1148
+ // node_modules/.pnpm/@tanstack+react-query@5.90.20_react@19.2.4/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js
1149
+ import * as React4 from "react";
1150
+ var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {
1151
+ const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;
1152
+ if (options.suspense || options.experimental_prefetchInRender || throwOnError) {
1153
+ if (!errorResetBoundary.isReset()) {
1154
+ options.retryOnMount = false;
1155
+ }
1156
+ }
1157
+ };
1158
+ var useClearResetErrorBoundary = (errorResetBoundary) => {
1159
+ React4.useEffect(() => {
1160
+ errorResetBoundary.clearReset();
1161
+ }, [errorResetBoundary]);
1162
+ };
1163
+ var getHasError = ({
1164
+ result,
1165
+ errorResetBoundary,
1166
+ throwOnError,
1167
+ query,
1168
+ suspense
1169
+ }) => {
1170
+ return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));
1171
+ };
1172
+
1173
+ // node_modules/.pnpm/@tanstack+react-query@5.90.20_react@19.2.4/node_modules/@tanstack/react-query/build/modern/suspense.js
1174
+ var ensureSuspenseTimers = (defaultedOptions) => {
1175
+ if (defaultedOptions.suspense) {
1176
+ const MIN_SUSPENSE_TIME_MS = 1e3;
1177
+ const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);
1178
+ const originalStaleTime = defaultedOptions.staleTime;
1179
+ defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);
1180
+ if (typeof defaultedOptions.gcTime === "number") {
1181
+ defaultedOptions.gcTime = Math.max(
1182
+ defaultedOptions.gcTime,
1183
+ MIN_SUSPENSE_TIME_MS
1184
+ );
1185
+ }
1186
+ }
1187
+ };
1188
+ var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
1189
+ var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;
1190
+ var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
1191
+ errorResetBoundary.clearReset();
1192
+ });
1193
+
1194
+ // node_modules/.pnpm/@tanstack+react-query@5.90.20_react@19.2.4/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
1195
+ import * as React5 from "react";
1196
+ function useBaseQuery(options, Observer, queryClient) {
1197
+ if (false) {
1198
+ if (typeof options !== "object" || Array.isArray(options)) {
1199
+ throw new Error(
1200
+ 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
1201
+ );
1202
+ }
1203
+ }
1204
+ const isRestoring = useIsRestoring();
1205
+ const errorResetBoundary = useQueryErrorResetBoundary();
1206
+ const client = useQueryClient(queryClient);
1207
+ const defaultedOptions = client.defaultQueryOptions(options);
1208
+ client.getDefaultOptions().queries?._experimental_beforeQuery?.(
1209
+ defaultedOptions
1210
+ );
1211
+ const query = client.getQueryCache().get(defaultedOptions.queryHash);
1212
+ if (false) {
1213
+ if (!defaultedOptions.queryFn) {
1214
+ console.error(
1215
+ `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
1216
+ );
1217
+ }
1218
+ }
1219
+ defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic";
1220
+ ensureSuspenseTimers(defaultedOptions);
1221
+ ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);
1222
+ useClearResetErrorBoundary(errorResetBoundary);
1223
+ const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);
1224
+ const [observer] = React5.useState(
1225
+ () => new Observer(
1226
+ client,
1227
+ defaultedOptions
1228
+ )
1229
+ );
1230
+ const result = observer.getOptimisticResult(defaultedOptions);
1231
+ const shouldSubscribe = !isRestoring && options.subscribed !== false;
1232
+ React5.useSyncExternalStore(
1233
+ React5.useCallback(
1234
+ (onStoreChange) => {
1235
+ const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;
1236
+ observer.updateResult();
1237
+ return unsubscribe;
1238
+ },
1239
+ [observer, shouldSubscribe]
1240
+ ),
1241
+ () => observer.getCurrentResult(),
1242
+ () => observer.getCurrentResult()
1243
+ );
1244
+ React5.useEffect(() => {
1245
+ observer.setOptions(defaultedOptions);
1246
+ }, [defaultedOptions, observer]);
1247
+ if (shouldSuspend(defaultedOptions, result)) {
1248
+ throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);
1249
+ }
1250
+ if (getHasError({
1251
+ result,
1252
+ errorResetBoundary,
1253
+ throwOnError: defaultedOptions.throwOnError,
1254
+ query,
1255
+ suspense: defaultedOptions.suspense
1256
+ })) {
1257
+ throw result.error;
1258
+ }
1259
+ ;
1260
+ client.getDefaultOptions().queries?._experimental_afterQuery?.(
1261
+ defaultedOptions,
1262
+ result
1263
+ );
1264
+ if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) {
1265
+ const promise = isNewCacheEntry ? (
1266
+ // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1267
+ fetchOptimistic(defaultedOptions, observer, errorResetBoundary)
1268
+ ) : (
1269
+ // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1270
+ query?.promise
1271
+ );
1272
+ promise?.catch(noop).finally(() => {
1273
+ observer.updateResult();
1274
+ });
1275
+ }
1276
+ return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
1277
+ }
1278
+
1279
+ // node_modules/.pnpm/@tanstack+react-query@5.90.20_react@19.2.4/node_modules/@tanstack/react-query/build/modern/useQuery.js
1280
+ function useQuery(options, queryClient) {
1281
+ return useBaseQuery(options, QueryObserver, queryClient);
1282
+ }
1283
+
1284
+ // node_modules/.pnpm/@tanstack+react-query@5.90.20_react@19.2.4/node_modules/@tanstack/react-query/build/modern/useMutation.js
1285
+ import * as React6 from "react";
1286
+ function useMutation(options, queryClient) {
1287
+ const client = useQueryClient(queryClient);
1288
+ const [observer] = React6.useState(
1289
+ () => new MutationObserver(
1290
+ client,
1291
+ options
1292
+ )
1293
+ );
1294
+ React6.useEffect(() => {
1295
+ observer.setOptions(options);
1296
+ }, [observer, options]);
1297
+ const result = React6.useSyncExternalStore(
1298
+ React6.useCallback(
1299
+ (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)),
1300
+ [observer]
1301
+ ),
1302
+ () => observer.getCurrentResult(),
1303
+ () => observer.getCurrentResult()
1304
+ );
1305
+ const mutate = React6.useCallback(
1306
+ (variables, mutateOptions) => {
1307
+ observer.mutate(variables, mutateOptions).catch(noop);
1308
+ },
1309
+ [observer]
1310
+ );
1311
+ if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) {
1312
+ throw result.error;
1313
+ }
1314
+ return { ...result, mutate, mutateAsync: result.mutate };
1315
+ }
1316
+
1317
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/bind.js
1318
+ function bind(fn, thisArg) {
1319
+ return function wrap() {
1320
+ return fn.apply(thisArg, arguments);
1321
+ };
1322
+ }
1323
+
1324
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/utils.js
1325
+ var { toString } = Object.prototype;
1326
+ var { getPrototypeOf } = Object;
1327
+ var { iterator, toStringTag } = Symbol;
1328
+ var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
1329
+ const str = toString.call(thing);
1330
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
1331
+ })(/* @__PURE__ */ Object.create(null));
1332
+ var kindOfTest = (type) => {
1333
+ type = type.toLowerCase();
1334
+ return (thing) => kindOf(thing) === type;
1335
+ };
1336
+ var typeOfTest = (type) => (thing) => typeof thing === type;
1337
+ var { isArray } = Array;
1338
+ var isUndefined = typeOfTest("undefined");
1339
+ function isBuffer(val) {
1340
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
1341
+ }
1342
+ var isArrayBuffer = kindOfTest("ArrayBuffer");
1343
+ function isArrayBufferView(val) {
1344
+ let result;
1345
+ if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
1346
+ result = ArrayBuffer.isView(val);
1347
+ } else {
1348
+ result = val && val.buffer && isArrayBuffer(val.buffer);
1349
+ }
1350
+ return result;
1351
+ }
1352
+ var isString = typeOfTest("string");
1353
+ var isFunction = typeOfTest("function");
1354
+ var isNumber = typeOfTest("number");
1355
+ var isObject = (thing) => thing !== null && typeof thing === "object";
1356
+ var isBoolean = (thing) => thing === true || thing === false;
1357
+ var isPlainObject2 = (val) => {
1358
+ if (kindOf(val) !== "object") {
1359
+ return false;
1360
+ }
1361
+ const prototype2 = getPrototypeOf(val);
1362
+ return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
1363
+ };
1364
+ var isEmptyObject = (val) => {
1365
+ if (!isObject(val) || isBuffer(val)) {
1366
+ return false;
1367
+ }
1368
+ try {
1369
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
1370
+ } catch (e) {
1371
+ return false;
1372
+ }
1373
+ };
1374
+ var isDate = kindOfTest("Date");
1375
+ var isFile = kindOfTest("File");
1376
+ var isBlob = kindOfTest("Blob");
1377
+ var isFileList = kindOfTest("FileList");
1378
+ var isStream = (val) => isObject(val) && isFunction(val.pipe);
1379
+ var isFormData = (thing) => {
1380
+ let kind;
1381
+ return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
1382
+ kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
1383
+ };
1384
+ var isURLSearchParams = kindOfTest("URLSearchParams");
1385
+ var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
1386
+ var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
1387
+ function forEach(obj, fn, { allOwnKeys = false } = {}) {
1388
+ if (obj === null || typeof obj === "undefined") {
1389
+ return;
1390
+ }
1391
+ let i;
1392
+ let l;
1393
+ if (typeof obj !== "object") {
1394
+ obj = [obj];
1395
+ }
1396
+ if (isArray(obj)) {
1397
+ for (i = 0, l = obj.length; i < l; i++) {
1398
+ fn.call(null, obj[i], i, obj);
1399
+ }
1400
+ } else {
1401
+ if (isBuffer(obj)) {
1402
+ return;
1403
+ }
1404
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
1405
+ const len = keys.length;
1406
+ let key;
1407
+ for (i = 0; i < len; i++) {
1408
+ key = keys[i];
1409
+ fn.call(null, obj[key], key, obj);
1410
+ }
1411
+ }
1412
+ }
1413
+ function findKey(obj, key) {
1414
+ if (isBuffer(obj)) {
1415
+ return null;
1416
+ }
1417
+ key = key.toLowerCase();
1418
+ const keys = Object.keys(obj);
1419
+ let i = keys.length;
1420
+ let _key;
1421
+ while (i-- > 0) {
1422
+ _key = keys[i];
1423
+ if (key === _key.toLowerCase()) {
1424
+ return _key;
1425
+ }
1426
+ }
1427
+ return null;
1428
+ }
1429
+ var _global = (() => {
1430
+ if (typeof globalThis !== "undefined")
1431
+ return globalThis;
1432
+ return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
1433
+ })();
1434
+ var isContextDefined = (context) => !isUndefined(context) && context !== _global;
1435
+ function merge() {
1436
+ const { caseless, skipUndefined } = isContextDefined(this) && this || {};
1437
+ const result = {};
1438
+ const assignValue = (val, key) => {
1439
+ const targetKey = caseless && findKey(result, key) || key;
1440
+ if (isPlainObject2(result[targetKey]) && isPlainObject2(val)) {
1441
+ result[targetKey] = merge(result[targetKey], val);
1442
+ } else if (isPlainObject2(val)) {
1443
+ result[targetKey] = merge({}, val);
1444
+ } else if (isArray(val)) {
1445
+ result[targetKey] = val.slice();
1446
+ } else if (!skipUndefined || !isUndefined(val)) {
1447
+ result[targetKey] = val;
1448
+ }
1449
+ };
1450
+ for (let i = 0, l = arguments.length; i < l; i++) {
1451
+ arguments[i] && forEach(arguments[i], assignValue);
1452
+ }
1453
+ return result;
1454
+ }
1455
+ var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
1456
+ forEach(b, (val, key) => {
1457
+ if (thisArg && isFunction(val)) {
1458
+ Object.defineProperty(a, key, {
1459
+ value: bind(val, thisArg),
1460
+ writable: true,
1461
+ enumerable: true,
1462
+ configurable: true
1463
+ });
1464
+ } else {
1465
+ Object.defineProperty(a, key, {
1466
+ value: val,
1467
+ writable: true,
1468
+ enumerable: true,
1469
+ configurable: true
1470
+ });
1471
+ }
1472
+ }, { allOwnKeys });
1473
+ return a;
1474
+ };
1475
+ var stripBOM = (content) => {
1476
+ if (content.charCodeAt(0) === 65279) {
1477
+ content = content.slice(1);
1478
+ }
1479
+ return content;
1480
+ };
1481
+ var inherits = (constructor, superConstructor, props, descriptors) => {
1482
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
1483
+ Object.defineProperty(constructor.prototype, "constructor", {
1484
+ value: constructor,
1485
+ writable: true,
1486
+ enumerable: false,
1487
+ configurable: true
1488
+ });
1489
+ Object.defineProperty(constructor, "super", {
1490
+ value: superConstructor.prototype
1491
+ });
1492
+ props && Object.assign(constructor.prototype, props);
1493
+ };
1494
+ var toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
1495
+ let props;
1496
+ let i;
1497
+ let prop;
1498
+ const merged = {};
1499
+ destObj = destObj || {};
1500
+ if (sourceObj == null)
1501
+ return destObj;
1502
+ do {
1503
+ props = Object.getOwnPropertyNames(sourceObj);
1504
+ i = props.length;
1505
+ while (i-- > 0) {
1506
+ prop = props[i];
1507
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
1508
+ destObj[prop] = sourceObj[prop];
1509
+ merged[prop] = true;
1510
+ }
1511
+ }
1512
+ sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
1513
+ } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
1514
+ return destObj;
1515
+ };
1516
+ var endsWith = (str, searchString, position) => {
1517
+ str = String(str);
1518
+ if (position === void 0 || position > str.length) {
1519
+ position = str.length;
1520
+ }
1521
+ position -= searchString.length;
1522
+ const lastIndex = str.indexOf(searchString, position);
1523
+ return lastIndex !== -1 && lastIndex === position;
1524
+ };
1525
+ var toArray = (thing) => {
1526
+ if (!thing)
1527
+ return null;
1528
+ if (isArray(thing))
1529
+ return thing;
1530
+ let i = thing.length;
1531
+ if (!isNumber(i))
1532
+ return null;
1533
+ const arr = new Array(i);
1534
+ while (i-- > 0) {
1535
+ arr[i] = thing[i];
1536
+ }
1537
+ return arr;
1538
+ };
1539
+ var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
1540
+ return (thing) => {
1541
+ return TypedArray && thing instanceof TypedArray;
1542
+ };
1543
+ })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
1544
+ var forEachEntry = (obj, fn) => {
1545
+ const generator = obj && obj[iterator];
1546
+ const _iterator = generator.call(obj);
1547
+ let result;
1548
+ while ((result = _iterator.next()) && !result.done) {
1549
+ const pair = result.value;
1550
+ fn.call(obj, pair[0], pair[1]);
1551
+ }
1552
+ };
1553
+ var matchAll = (regExp, str) => {
1554
+ let matches;
1555
+ const arr = [];
1556
+ while ((matches = regExp.exec(str)) !== null) {
1557
+ arr.push(matches);
1558
+ }
1559
+ return arr;
1560
+ };
1561
+ var isHTMLForm = kindOfTest("HTMLFormElement");
1562
+ var toCamelCase = (str) => {
1563
+ return str.toLowerCase().replace(
1564
+ /[-_\s]([a-z\d])(\w*)/g,
1565
+ function replacer(m, p1, p2) {
1566
+ return p1.toUpperCase() + p2;
1567
+ }
1568
+ );
1569
+ };
1570
+ var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
1571
+ var isRegExp = kindOfTest("RegExp");
1572
+ var reduceDescriptors = (obj, reducer) => {
1573
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
1574
+ const reducedDescriptors = {};
1575
+ forEach(descriptors, (descriptor, name) => {
1576
+ let ret;
1577
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
1578
+ reducedDescriptors[name] = ret || descriptor;
1579
+ }
1580
+ });
1581
+ Object.defineProperties(obj, reducedDescriptors);
1582
+ };
1583
+ var freezeMethods = (obj) => {
1584
+ reduceDescriptors(obj, (descriptor, name) => {
1585
+ if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
1586
+ return false;
1587
+ }
1588
+ const value = obj[name];
1589
+ if (!isFunction(value))
1590
+ return;
1591
+ descriptor.enumerable = false;
1592
+ if ("writable" in descriptor) {
1593
+ descriptor.writable = false;
1594
+ return;
1595
+ }
1596
+ if (!descriptor.set) {
1597
+ descriptor.set = () => {
1598
+ throw Error("Can not rewrite read-only method '" + name + "'");
1599
+ };
1600
+ }
1601
+ });
1602
+ };
1603
+ var toObjectSet = (arrayOrString, delimiter) => {
1604
+ const obj = {};
1605
+ const define = (arr) => {
1606
+ arr.forEach((value) => {
1607
+ obj[value] = true;
1608
+ });
1609
+ };
1610
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
1611
+ return obj;
1612
+ };
1613
+ var noop2 = () => {
1614
+ };
1615
+ var toFiniteNumber = (value, defaultValue) => {
1616
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
1617
+ };
1618
+ function isSpecCompliantForm(thing) {
1619
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
1620
+ }
1621
+ var toJSONObject = (obj) => {
1622
+ const stack = new Array(10);
1623
+ const visit = (source, i) => {
1624
+ if (isObject(source)) {
1625
+ if (stack.indexOf(source) >= 0) {
1626
+ return;
1627
+ }
1628
+ if (isBuffer(source)) {
1629
+ return source;
1630
+ }
1631
+ if (!("toJSON" in source)) {
1632
+ stack[i] = source;
1633
+ const target = isArray(source) ? [] : {};
1634
+ forEach(source, (value, key) => {
1635
+ const reducedValue = visit(value, i + 1);
1636
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
1637
+ });
1638
+ stack[i] = void 0;
1639
+ return target;
1640
+ }
1641
+ }
1642
+ return source;
1643
+ };
1644
+ return visit(obj, 0);
1645
+ };
1646
+ var isAsyncFn = kindOfTest("AsyncFunction");
1647
+ var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
1648
+ var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
1649
+ if (setImmediateSupported) {
1650
+ return setImmediate;
1651
+ }
1652
+ return postMessageSupported ? ((token, callbacks) => {
1653
+ _global.addEventListener("message", ({ source, data }) => {
1654
+ if (source === _global && data === token) {
1655
+ callbacks.length && callbacks.shift()();
1656
+ }
1657
+ }, false);
1658
+ return (cb) => {
1659
+ callbacks.push(cb);
1660
+ _global.postMessage(token, "*");
1661
+ };
1662
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
1663
+ })(
1664
+ typeof setImmediate === "function",
1665
+ isFunction(_global.postMessage)
1666
+ );
1667
+ var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
1668
+ var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
1669
+ var utils_default = {
1670
+ isArray,
1671
+ isArrayBuffer,
1672
+ isBuffer,
1673
+ isFormData,
1674
+ isArrayBufferView,
1675
+ isString,
1676
+ isNumber,
1677
+ isBoolean,
1678
+ isObject,
1679
+ isPlainObject: isPlainObject2,
1680
+ isEmptyObject,
1681
+ isReadableStream,
1682
+ isRequest,
1683
+ isResponse,
1684
+ isHeaders,
1685
+ isUndefined,
1686
+ isDate,
1687
+ isFile,
1688
+ isBlob,
1689
+ isRegExp,
1690
+ isFunction,
1691
+ isStream,
1692
+ isURLSearchParams,
1693
+ isTypedArray,
1694
+ isFileList,
1695
+ forEach,
1696
+ merge,
1697
+ extend,
1698
+ trim,
1699
+ stripBOM,
1700
+ inherits,
1701
+ toFlatObject,
1702
+ kindOf,
1703
+ kindOfTest,
1704
+ endsWith,
1705
+ toArray,
1706
+ forEachEntry,
1707
+ matchAll,
1708
+ isHTMLForm,
1709
+ hasOwnProperty,
1710
+ hasOwnProp: hasOwnProperty,
1711
+ // an alias to avoid ESLint no-prototype-builtins detection
1712
+ reduceDescriptors,
1713
+ freezeMethods,
1714
+ toObjectSet,
1715
+ toCamelCase,
1716
+ noop: noop2,
1717
+ toFiniteNumber,
1718
+ findKey,
1719
+ global: _global,
1720
+ isContextDefined,
1721
+ isSpecCompliantForm,
1722
+ toJSONObject,
1723
+ isAsyncFn,
1724
+ isThenable,
1725
+ setImmediate: _setImmediate,
1726
+ asap,
1727
+ isIterable
1728
+ };
1729
+
1730
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/core/AxiosError.js
1731
+ var AxiosError = class _AxiosError extends Error {
1732
+ static from(error, code, config, request, response, customProps) {
1733
+ const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
1734
+ axiosError.cause = error;
1735
+ axiosError.name = error.name;
1736
+ customProps && Object.assign(axiosError, customProps);
1737
+ return axiosError;
1738
+ }
1739
+ /**
1740
+ * Create an Error with the specified message, config, error code, request and response.
1741
+ *
1742
+ * @param {string} message The error message.
1743
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
1744
+ * @param {Object} [config] The config.
1745
+ * @param {Object} [request] The request.
1746
+ * @param {Object} [response] The response.
1747
+ *
1748
+ * @returns {Error} The created error.
1749
+ */
1750
+ constructor(message, code, config, request, response) {
1751
+ super(message);
1752
+ this.name = "AxiosError";
1753
+ this.isAxiosError = true;
1754
+ code && (this.code = code);
1755
+ config && (this.config = config);
1756
+ request && (this.request = request);
1757
+ if (response) {
1758
+ this.response = response;
1759
+ this.status = response.status;
1760
+ }
1761
+ }
1762
+ toJSON() {
1763
+ return {
1764
+ // Standard
1765
+ message: this.message,
1766
+ name: this.name,
1767
+ // Microsoft
1768
+ description: this.description,
1769
+ number: this.number,
1770
+ // Mozilla
1771
+ fileName: this.fileName,
1772
+ lineNumber: this.lineNumber,
1773
+ columnNumber: this.columnNumber,
1774
+ stack: this.stack,
1775
+ // Axios
1776
+ config: utils_default.toJSONObject(this.config),
1777
+ code: this.code,
1778
+ status: this.status
1779
+ };
1780
+ }
1781
+ };
1782
+ AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
1783
+ AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
1784
+ AxiosError.ECONNABORTED = "ECONNABORTED";
1785
+ AxiosError.ETIMEDOUT = "ETIMEDOUT";
1786
+ AxiosError.ERR_NETWORK = "ERR_NETWORK";
1787
+ AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
1788
+ AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
1789
+ AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
1790
+ AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
1791
+ AxiosError.ERR_CANCELED = "ERR_CANCELED";
1792
+ AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
1793
+ AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
1794
+ var AxiosError_default = AxiosError;
1795
+
1796
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/null.js
1797
+ var null_default = null;
1798
+
1799
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/toFormData.js
1800
+ function isVisitable(thing) {
1801
+ return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
1802
+ }
1803
+ function removeBrackets(key) {
1804
+ return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
1805
+ }
1806
+ function renderKey(path, key, dots) {
1807
+ if (!path)
1808
+ return key;
1809
+ return path.concat(key).map(function each(token, i) {
1810
+ token = removeBrackets(token);
1811
+ return !dots && i ? "[" + token + "]" : token;
1812
+ }).join(dots ? "." : "");
1813
+ }
1814
+ function isFlatArray(arr) {
1815
+ return utils_default.isArray(arr) && !arr.some(isVisitable);
1816
+ }
1817
+ var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
1818
+ return /^is[A-Z]/.test(prop);
1819
+ });
1820
+ function toFormData(obj, formData, options) {
1821
+ if (!utils_default.isObject(obj)) {
1822
+ throw new TypeError("target must be an object");
1823
+ }
1824
+ formData = formData || new (null_default || FormData)();
1825
+ options = utils_default.toFlatObject(options, {
1826
+ metaTokens: true,
1827
+ dots: false,
1828
+ indexes: false
1829
+ }, false, function defined(option, source) {
1830
+ return !utils_default.isUndefined(source[option]);
1831
+ });
1832
+ const metaTokens = options.metaTokens;
1833
+ const visitor = options.visitor || defaultVisitor;
1834
+ const dots = options.dots;
1835
+ const indexes = options.indexes;
1836
+ const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
1837
+ const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
1838
+ if (!utils_default.isFunction(visitor)) {
1839
+ throw new TypeError("visitor must be a function");
1840
+ }
1841
+ function convertValue(value) {
1842
+ if (value === null)
1843
+ return "";
1844
+ if (utils_default.isDate(value)) {
1845
+ return value.toISOString();
1846
+ }
1847
+ if (utils_default.isBoolean(value)) {
1848
+ return value.toString();
1849
+ }
1850
+ if (!useBlob && utils_default.isBlob(value)) {
1851
+ throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
1852
+ }
1853
+ if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
1854
+ return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
1855
+ }
1856
+ return value;
1857
+ }
1858
+ function defaultVisitor(value, key, path) {
1859
+ let arr = value;
1860
+ if (value && !path && typeof value === "object") {
1861
+ if (utils_default.endsWith(key, "{}")) {
1862
+ key = metaTokens ? key : key.slice(0, -2);
1863
+ value = JSON.stringify(value);
1864
+ } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
1865
+ key = removeBrackets(key);
1866
+ arr.forEach(function each(el, index) {
1867
+ !(utils_default.isUndefined(el) || el === null) && formData.append(
1868
+ // eslint-disable-next-line no-nested-ternary
1869
+ indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
1870
+ convertValue(el)
1871
+ );
1872
+ });
1873
+ return false;
1874
+ }
1875
+ }
1876
+ if (isVisitable(value)) {
1877
+ return true;
1878
+ }
1879
+ formData.append(renderKey(path, key, dots), convertValue(value));
1880
+ return false;
1881
+ }
1882
+ const stack = [];
1883
+ const exposedHelpers = Object.assign(predicates, {
1884
+ defaultVisitor,
1885
+ convertValue,
1886
+ isVisitable
1887
+ });
1888
+ function build(value, path) {
1889
+ if (utils_default.isUndefined(value))
1890
+ return;
1891
+ if (stack.indexOf(value) !== -1) {
1892
+ throw Error("Circular reference detected in " + path.join("."));
1893
+ }
1894
+ stack.push(value);
1895
+ utils_default.forEach(value, function each(el, key) {
1896
+ const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(
1897
+ formData,
1898
+ el,
1899
+ utils_default.isString(key) ? key.trim() : key,
1900
+ path,
1901
+ exposedHelpers
1902
+ );
1903
+ if (result === true) {
1904
+ build(el, path ? path.concat(key) : [key]);
1905
+ }
1906
+ });
1907
+ stack.pop();
1908
+ }
1909
+ if (!utils_default.isObject(obj)) {
1910
+ throw new TypeError("data must be an object");
1911
+ }
1912
+ build(obj);
1913
+ return formData;
1914
+ }
1915
+ var toFormData_default = toFormData;
1916
+
1917
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
1918
+ function encode(str) {
1919
+ const charMap = {
1920
+ "!": "%21",
1921
+ "'": "%27",
1922
+ "(": "%28",
1923
+ ")": "%29",
1924
+ "~": "%7E",
1925
+ "%20": "+",
1926
+ "%00": "\0"
1927
+ };
1928
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
1929
+ return charMap[match];
1930
+ });
1931
+ }
1932
+ function AxiosURLSearchParams(params, options) {
1933
+ this._pairs = [];
1934
+ params && toFormData_default(params, this, options);
1935
+ }
1936
+ var prototype = AxiosURLSearchParams.prototype;
1937
+ prototype.append = function append(name, value) {
1938
+ this._pairs.push([name, value]);
1939
+ };
1940
+ prototype.toString = function toString2(encoder) {
1941
+ const _encode = encoder ? function(value) {
1942
+ return encoder.call(this, value, encode);
1943
+ } : encode;
1944
+ return this._pairs.map(function each(pair) {
1945
+ return _encode(pair[0]) + "=" + _encode(pair[1]);
1946
+ }, "").join("&");
1947
+ };
1948
+ var AxiosURLSearchParams_default = AxiosURLSearchParams;
1949
+
1950
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/buildURL.js
1951
+ function encode2(val) {
1952
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
1953
+ }
1954
+ function buildURL(url, params, options) {
1955
+ if (!params) {
1956
+ return url;
1957
+ }
1958
+ const _encode = options && options.encode || encode2;
1959
+ const _options = utils_default.isFunction(options) ? {
1960
+ serialize: options
1961
+ } : options;
1962
+ const serializeFn = _options && _options.serialize;
1963
+ let serializedParams;
1964
+ if (serializeFn) {
1965
+ serializedParams = serializeFn(params, _options);
1966
+ } else {
1967
+ serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, _options).toString(_encode);
1968
+ }
1969
+ if (serializedParams) {
1970
+ const hashmarkIndex = url.indexOf("#");
1971
+ if (hashmarkIndex !== -1) {
1972
+ url = url.slice(0, hashmarkIndex);
1973
+ }
1974
+ url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
1975
+ }
1976
+ return url;
1977
+ }
1978
+
1979
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/core/InterceptorManager.js
1980
+ var InterceptorManager = class {
1981
+ constructor() {
1982
+ this.handlers = [];
1983
+ }
1984
+ /**
1985
+ * Add a new interceptor to the stack
1986
+ *
1987
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
1988
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
1989
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
1990
+ *
1991
+ * @return {Number} An ID used to remove interceptor later
1992
+ */
1993
+ use(fulfilled, rejected, options) {
1994
+ this.handlers.push({
1995
+ fulfilled,
1996
+ rejected,
1997
+ synchronous: options ? options.synchronous : false,
1998
+ runWhen: options ? options.runWhen : null
1999
+ });
2000
+ return this.handlers.length - 1;
2001
+ }
2002
+ /**
2003
+ * Remove an interceptor from the stack
2004
+ *
2005
+ * @param {Number} id The ID that was returned by `use`
2006
+ *
2007
+ * @returns {void}
2008
+ */
2009
+ eject(id) {
2010
+ if (this.handlers[id]) {
2011
+ this.handlers[id] = null;
2012
+ }
2013
+ }
2014
+ /**
2015
+ * Clear all interceptors from the stack
2016
+ *
2017
+ * @returns {void}
2018
+ */
2019
+ clear() {
2020
+ if (this.handlers) {
2021
+ this.handlers = [];
2022
+ }
2023
+ }
2024
+ /**
2025
+ * Iterate over all the registered interceptors
2026
+ *
2027
+ * This method is particularly useful for skipping over any
2028
+ * interceptors that may have become `null` calling `eject`.
2029
+ *
2030
+ * @param {Function} fn The function to call for each interceptor
2031
+ *
2032
+ * @returns {void}
2033
+ */
2034
+ forEach(fn) {
2035
+ utils_default.forEach(this.handlers, function forEachHandler(h) {
2036
+ if (h !== null) {
2037
+ fn(h);
2038
+ }
2039
+ });
2040
+ }
2041
+ };
2042
+ var InterceptorManager_default = InterceptorManager;
2043
+
2044
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/defaults/transitional.js
2045
+ var transitional_default = {
2046
+ silentJSONParsing: true,
2047
+ forcedJSONParsing: true,
2048
+ clarifyTimeoutError: false
2049
+ };
2050
+
2051
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
2052
+ var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default;
2053
+
2054
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/platform/browser/classes/FormData.js
2055
+ var FormData_default = typeof FormData !== "undefined" ? FormData : null;
2056
+
2057
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/platform/browser/classes/Blob.js
2058
+ var Blob_default = typeof Blob !== "undefined" ? Blob : null;
2059
+
2060
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/platform/browser/index.js
2061
+ var browser_default = {
2062
+ isBrowser: true,
2063
+ classes: {
2064
+ URLSearchParams: URLSearchParams_default,
2065
+ FormData: FormData_default,
2066
+ Blob: Blob_default
2067
+ },
2068
+ protocols: ["http", "https", "file", "blob", "url", "data"]
2069
+ };
2070
+
2071
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/platform/common/utils.js
2072
+ var utils_exports = {};
2073
+ __export(utils_exports, {
2074
+ hasBrowserEnv: () => hasBrowserEnv,
2075
+ hasStandardBrowserEnv: () => hasStandardBrowserEnv,
2076
+ hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
2077
+ navigator: () => _navigator,
2078
+ origin: () => origin
2079
+ });
2080
+ var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
2081
+ var _navigator = typeof navigator === "object" && navigator || void 0;
2082
+ var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
2083
+ var hasStandardBrowserWebWorkerEnv = (() => {
2084
+ return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
2085
+ self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
2086
+ })();
2087
+ var origin = hasBrowserEnv && window.location.href || "http://localhost";
2088
+
2089
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/platform/index.js
2090
+ var platform_default = {
2091
+ ...utils_exports,
2092
+ ...browser_default
2093
+ };
2094
+
2095
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/toURLEncodedForm.js
2096
+ function toURLEncodedForm(data, options) {
2097
+ return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
2098
+ visitor: function(value, key, path, helpers) {
2099
+ if (platform_default.isNode && utils_default.isBuffer(value)) {
2100
+ this.append(key, value.toString("base64"));
2101
+ return false;
2102
+ }
2103
+ return helpers.defaultVisitor.apply(this, arguments);
2104
+ },
2105
+ ...options
2106
+ });
2107
+ }
2108
+
2109
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/formDataToJSON.js
2110
+ function parsePropPath(name) {
2111
+ return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
2112
+ return match[0] === "[]" ? "" : match[1] || match[0];
2113
+ });
2114
+ }
2115
+ function arrayToObject(arr) {
2116
+ const obj = {};
2117
+ const keys = Object.keys(arr);
2118
+ let i;
2119
+ const len = keys.length;
2120
+ let key;
2121
+ for (i = 0; i < len; i++) {
2122
+ key = keys[i];
2123
+ obj[key] = arr[key];
2124
+ }
2125
+ return obj;
2126
+ }
2127
+ function formDataToJSON(formData) {
2128
+ function buildPath(path, value, target, index) {
2129
+ let name = path[index++];
2130
+ if (name === "__proto__")
2131
+ return true;
2132
+ const isNumericKey = Number.isFinite(+name);
2133
+ const isLast = index >= path.length;
2134
+ name = !name && utils_default.isArray(target) ? target.length : name;
2135
+ if (isLast) {
2136
+ if (utils_default.hasOwnProp(target, name)) {
2137
+ target[name] = [target[name], value];
2138
+ } else {
2139
+ target[name] = value;
2140
+ }
2141
+ return !isNumericKey;
2142
+ }
2143
+ if (!target[name] || !utils_default.isObject(target[name])) {
2144
+ target[name] = [];
2145
+ }
2146
+ const result = buildPath(path, value, target[name], index);
2147
+ if (result && utils_default.isArray(target[name])) {
2148
+ target[name] = arrayToObject(target[name]);
2149
+ }
2150
+ return !isNumericKey;
2151
+ }
2152
+ if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
2153
+ const obj = {};
2154
+ utils_default.forEachEntry(formData, (name, value) => {
2155
+ buildPath(parsePropPath(name), value, obj, 0);
2156
+ });
2157
+ return obj;
2158
+ }
2159
+ return null;
2160
+ }
2161
+ var formDataToJSON_default = formDataToJSON;
2162
+
2163
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/defaults/index.js
2164
+ function stringifySafely(rawValue, parser, encoder) {
2165
+ if (utils_default.isString(rawValue)) {
2166
+ try {
2167
+ (parser || JSON.parse)(rawValue);
2168
+ return utils_default.trim(rawValue);
2169
+ } catch (e) {
2170
+ if (e.name !== "SyntaxError") {
2171
+ throw e;
2172
+ }
2173
+ }
2174
+ }
2175
+ return (encoder || JSON.stringify)(rawValue);
2176
+ }
2177
+ var defaults = {
2178
+ transitional: transitional_default,
2179
+ adapter: ["xhr", "http", "fetch"],
2180
+ transformRequest: [function transformRequest(data, headers) {
2181
+ const contentType = headers.getContentType() || "";
2182
+ const hasJSONContentType = contentType.indexOf("application/json") > -1;
2183
+ const isObjectPayload = utils_default.isObject(data);
2184
+ if (isObjectPayload && utils_default.isHTMLForm(data)) {
2185
+ data = new FormData(data);
2186
+ }
2187
+ const isFormData2 = utils_default.isFormData(data);
2188
+ if (isFormData2) {
2189
+ return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
2190
+ }
2191
+ 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)) {
2192
+ return data;
2193
+ }
2194
+ if (utils_default.isArrayBufferView(data)) {
2195
+ return data.buffer;
2196
+ }
2197
+ if (utils_default.isURLSearchParams(data)) {
2198
+ headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
2199
+ return data.toString();
2200
+ }
2201
+ let isFileList2;
2202
+ if (isObjectPayload) {
2203
+ if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
2204
+ return toURLEncodedForm(data, this.formSerializer).toString();
2205
+ }
2206
+ if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
2207
+ const _FormData = this.env && this.env.FormData;
2208
+ return toFormData_default(
2209
+ isFileList2 ? { "files[]": data } : data,
2210
+ _FormData && new _FormData(),
2211
+ this.formSerializer
2212
+ );
2213
+ }
2214
+ }
2215
+ if (isObjectPayload || hasJSONContentType) {
2216
+ headers.setContentType("application/json", false);
2217
+ return stringifySafely(data);
2218
+ }
2219
+ return data;
2220
+ }],
2221
+ transformResponse: [function transformResponse(data) {
2222
+ const transitional2 = this.transitional || defaults.transitional;
2223
+ const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
2224
+ const JSONRequested = this.responseType === "json";
2225
+ if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
2226
+ return data;
2227
+ }
2228
+ if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
2229
+ const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
2230
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
2231
+ try {
2232
+ return JSON.parse(data, this.parseReviver);
2233
+ } catch (e) {
2234
+ if (strictJSONParsing) {
2235
+ if (e.name === "SyntaxError") {
2236
+ throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
2237
+ }
2238
+ throw e;
2239
+ }
2240
+ }
2241
+ }
2242
+ return data;
2243
+ }],
2244
+ /**
2245
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
2246
+ * timeout is not created.
2247
+ */
2248
+ timeout: 0,
2249
+ xsrfCookieName: "XSRF-TOKEN",
2250
+ xsrfHeaderName: "X-XSRF-TOKEN",
2251
+ maxContentLength: -1,
2252
+ maxBodyLength: -1,
2253
+ env: {
2254
+ FormData: platform_default.classes.FormData,
2255
+ Blob: platform_default.classes.Blob
2256
+ },
2257
+ validateStatus: function validateStatus(status) {
2258
+ return status >= 200 && status < 300;
2259
+ },
2260
+ headers: {
2261
+ common: {
2262
+ "Accept": "application/json, text/plain, */*",
2263
+ "Content-Type": void 0
2264
+ }
2265
+ }
2266
+ };
2267
+ utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
2268
+ defaults.headers[method] = {};
2269
+ });
2270
+ var defaults_default = defaults;
2271
+
2272
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/parseHeaders.js
2273
+ var ignoreDuplicateOf = utils_default.toObjectSet([
2274
+ "age",
2275
+ "authorization",
2276
+ "content-length",
2277
+ "content-type",
2278
+ "etag",
2279
+ "expires",
2280
+ "from",
2281
+ "host",
2282
+ "if-modified-since",
2283
+ "if-unmodified-since",
2284
+ "last-modified",
2285
+ "location",
2286
+ "max-forwards",
2287
+ "proxy-authorization",
2288
+ "referer",
2289
+ "retry-after",
2290
+ "user-agent"
2291
+ ]);
2292
+ var parseHeaders_default = (rawHeaders) => {
2293
+ const parsed = {};
2294
+ let key;
2295
+ let val;
2296
+ let i;
2297
+ rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
2298
+ i = line.indexOf(":");
2299
+ key = line.substring(0, i).trim().toLowerCase();
2300
+ val = line.substring(i + 1).trim();
2301
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
2302
+ return;
2303
+ }
2304
+ if (key === "set-cookie") {
2305
+ if (parsed[key]) {
2306
+ parsed[key].push(val);
2307
+ } else {
2308
+ parsed[key] = [val];
2309
+ }
2310
+ } else {
2311
+ parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
2312
+ }
2313
+ });
2314
+ return parsed;
2315
+ };
2316
+
2317
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/core/AxiosHeaders.js
2318
+ var $internals = Symbol("internals");
2319
+ function normalizeHeader(header) {
2320
+ return header && String(header).trim().toLowerCase();
2321
+ }
2322
+ function normalizeValue(value) {
2323
+ if (value === false || value == null) {
2324
+ return value;
2325
+ }
2326
+ return utils_default.isArray(value) ? value.map(normalizeValue) : String(value);
2327
+ }
2328
+ function parseTokens(str) {
2329
+ const tokens = /* @__PURE__ */ Object.create(null);
2330
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
2331
+ let match;
2332
+ while (match = tokensRE.exec(str)) {
2333
+ tokens[match[1]] = match[2];
2334
+ }
2335
+ return tokens;
2336
+ }
2337
+ var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
2338
+ function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
2339
+ if (utils_default.isFunction(filter2)) {
2340
+ return filter2.call(this, value, header);
2341
+ }
2342
+ if (isHeaderNameFilter) {
2343
+ value = header;
2344
+ }
2345
+ if (!utils_default.isString(value))
2346
+ return;
2347
+ if (utils_default.isString(filter2)) {
2348
+ return value.indexOf(filter2) !== -1;
2349
+ }
2350
+ if (utils_default.isRegExp(filter2)) {
2351
+ return filter2.test(value);
2352
+ }
2353
+ }
2354
+ function formatHeader(header) {
2355
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
2356
+ return char.toUpperCase() + str;
2357
+ });
2358
+ }
2359
+ function buildAccessors(obj, header) {
2360
+ const accessorName = utils_default.toCamelCase(" " + header);
2361
+ ["get", "set", "has"].forEach((methodName) => {
2362
+ Object.defineProperty(obj, methodName + accessorName, {
2363
+ value: function(arg1, arg2, arg3) {
2364
+ return this[methodName].call(this, header, arg1, arg2, arg3);
2365
+ },
2366
+ configurable: true
2367
+ });
2368
+ });
2369
+ }
2370
+ var AxiosHeaders = class {
2371
+ constructor(headers) {
2372
+ headers && this.set(headers);
2373
+ }
2374
+ set(header, valueOrRewrite, rewrite) {
2375
+ const self2 = this;
2376
+ function setHeader(_value, _header, _rewrite) {
2377
+ const lHeader = normalizeHeader(_header);
2378
+ if (!lHeader) {
2379
+ throw new Error("header name must be a non-empty string");
2380
+ }
2381
+ const key = utils_default.findKey(self2, lHeader);
2382
+ if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
2383
+ self2[key || _header] = normalizeValue(_value);
2384
+ }
2385
+ }
2386
+ const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
2387
+ if (utils_default.isPlainObject(header) || header instanceof this.constructor) {
2388
+ setHeaders(header, valueOrRewrite);
2389
+ } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
2390
+ setHeaders(parseHeaders_default(header), valueOrRewrite);
2391
+ } else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
2392
+ let obj = {}, dest, key;
2393
+ for (const entry of header) {
2394
+ if (!utils_default.isArray(entry)) {
2395
+ throw TypeError("Object iterator must return a key-value pair");
2396
+ }
2397
+ obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
2398
+ }
2399
+ setHeaders(obj, valueOrRewrite);
2400
+ } else {
2401
+ header != null && setHeader(valueOrRewrite, header, rewrite);
2402
+ }
2403
+ return this;
2404
+ }
2405
+ get(header, parser) {
2406
+ header = normalizeHeader(header);
2407
+ if (header) {
2408
+ const key = utils_default.findKey(this, header);
2409
+ if (key) {
2410
+ const value = this[key];
2411
+ if (!parser) {
2412
+ return value;
2413
+ }
2414
+ if (parser === true) {
2415
+ return parseTokens(value);
2416
+ }
2417
+ if (utils_default.isFunction(parser)) {
2418
+ return parser.call(this, value, key);
2419
+ }
2420
+ if (utils_default.isRegExp(parser)) {
2421
+ return parser.exec(value);
2422
+ }
2423
+ throw new TypeError("parser must be boolean|regexp|function");
2424
+ }
2425
+ }
2426
+ }
2427
+ has(header, matcher) {
2428
+ header = normalizeHeader(header);
2429
+ if (header) {
2430
+ const key = utils_default.findKey(this, header);
2431
+ return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
2432
+ }
2433
+ return false;
2434
+ }
2435
+ delete(header, matcher) {
2436
+ const self2 = this;
2437
+ let deleted = false;
2438
+ function deleteHeader(_header) {
2439
+ _header = normalizeHeader(_header);
2440
+ if (_header) {
2441
+ const key = utils_default.findKey(self2, _header);
2442
+ if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
2443
+ delete self2[key];
2444
+ deleted = true;
2445
+ }
2446
+ }
2447
+ }
2448
+ if (utils_default.isArray(header)) {
2449
+ header.forEach(deleteHeader);
2450
+ } else {
2451
+ deleteHeader(header);
2452
+ }
2453
+ return deleted;
2454
+ }
2455
+ clear(matcher) {
2456
+ const keys = Object.keys(this);
2457
+ let i = keys.length;
2458
+ let deleted = false;
2459
+ while (i--) {
2460
+ const key = keys[i];
2461
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
2462
+ delete this[key];
2463
+ deleted = true;
2464
+ }
2465
+ }
2466
+ return deleted;
2467
+ }
2468
+ normalize(format) {
2469
+ const self2 = this;
2470
+ const headers = {};
2471
+ utils_default.forEach(this, (value, header) => {
2472
+ const key = utils_default.findKey(headers, header);
2473
+ if (key) {
2474
+ self2[key] = normalizeValue(value);
2475
+ delete self2[header];
2476
+ return;
2477
+ }
2478
+ const normalized = format ? formatHeader(header) : String(header).trim();
2479
+ if (normalized !== header) {
2480
+ delete self2[header];
2481
+ }
2482
+ self2[normalized] = normalizeValue(value);
2483
+ headers[normalized] = true;
2484
+ });
2485
+ return this;
2486
+ }
2487
+ concat(...targets) {
2488
+ return this.constructor.concat(this, ...targets);
2489
+ }
2490
+ toJSON(asStrings) {
2491
+ const obj = /* @__PURE__ */ Object.create(null);
2492
+ utils_default.forEach(this, (value, header) => {
2493
+ value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
2494
+ });
2495
+ return obj;
2496
+ }
2497
+ [Symbol.iterator]() {
2498
+ return Object.entries(this.toJSON())[Symbol.iterator]();
2499
+ }
2500
+ toString() {
2501
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
2502
+ }
2503
+ getSetCookie() {
2504
+ return this.get("set-cookie") || [];
2505
+ }
2506
+ get [Symbol.toStringTag]() {
2507
+ return "AxiosHeaders";
2508
+ }
2509
+ static from(thing) {
2510
+ return thing instanceof this ? thing : new this(thing);
2511
+ }
2512
+ static concat(first, ...targets) {
2513
+ const computed = new this(first);
2514
+ targets.forEach((target) => computed.set(target));
2515
+ return computed;
2516
+ }
2517
+ static accessor(header) {
2518
+ const internals = this[$internals] = this[$internals] = {
2519
+ accessors: {}
2520
+ };
2521
+ const accessors = internals.accessors;
2522
+ const prototype2 = this.prototype;
2523
+ function defineAccessor(_header) {
2524
+ const lHeader = normalizeHeader(_header);
2525
+ if (!accessors[lHeader]) {
2526
+ buildAccessors(prototype2, _header);
2527
+ accessors[lHeader] = true;
2528
+ }
2529
+ }
2530
+ utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2531
+ return this;
2532
+ }
2533
+ };
2534
+ AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
2535
+ utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
2536
+ let mapped = key[0].toUpperCase() + key.slice(1);
2537
+ return {
2538
+ get: () => value,
2539
+ set(headerValue) {
2540
+ this[mapped] = headerValue;
2541
+ }
2542
+ };
2543
+ });
2544
+ utils_default.freezeMethods(AxiosHeaders);
2545
+ var AxiosHeaders_default = AxiosHeaders;
2546
+
2547
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/core/transformData.js
2548
+ function transformData(fns, response) {
2549
+ const config = this || defaults_default;
2550
+ const context = response || config;
2551
+ const headers = AxiosHeaders_default.from(context.headers);
2552
+ let data = context.data;
2553
+ utils_default.forEach(fns, function transform(fn) {
2554
+ data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
2555
+ });
2556
+ headers.normalize();
2557
+ return data;
2558
+ }
2559
+
2560
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/cancel/isCancel.js
2561
+ function isCancel(value) {
2562
+ return !!(value && value.__CANCEL__);
2563
+ }
2564
+
2565
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/cancel/CanceledError.js
2566
+ var CanceledError = class extends AxiosError_default {
2567
+ /**
2568
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
2569
+ *
2570
+ * @param {string=} message The message.
2571
+ * @param {Object=} config The config.
2572
+ * @param {Object=} request The request.
2573
+ *
2574
+ * @returns {CanceledError} The created error.
2575
+ */
2576
+ constructor(message, config, request) {
2577
+ super(message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
2578
+ this.name = "CanceledError";
2579
+ this.__CANCEL__ = true;
2580
+ }
2581
+ };
2582
+ var CanceledError_default = CanceledError;
2583
+
2584
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/core/settle.js
2585
+ function settle(resolve, reject, response) {
2586
+ const validateStatus2 = response.config.validateStatus;
2587
+ if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
2588
+ resolve(response);
2589
+ } else {
2590
+ reject(new AxiosError_default(
2591
+ "Request failed with status code " + response.status,
2592
+ [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2593
+ response.config,
2594
+ response.request,
2595
+ response
2596
+ ));
2597
+ }
2598
+ }
2599
+
2600
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/parseProtocol.js
2601
+ function parseProtocol(url) {
2602
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2603
+ return match && match[1] || "";
2604
+ }
2605
+
2606
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/speedometer.js
2607
+ function speedometer(samplesCount, min) {
2608
+ samplesCount = samplesCount || 10;
2609
+ const bytes = new Array(samplesCount);
2610
+ const timestamps = new Array(samplesCount);
2611
+ let head = 0;
2612
+ let tail = 0;
2613
+ let firstSampleTS;
2614
+ min = min !== void 0 ? min : 1e3;
2615
+ return function push(chunkLength) {
2616
+ const now = Date.now();
2617
+ const startedAt = timestamps[tail];
2618
+ if (!firstSampleTS) {
2619
+ firstSampleTS = now;
2620
+ }
2621
+ bytes[head] = chunkLength;
2622
+ timestamps[head] = now;
2623
+ let i = tail;
2624
+ let bytesCount = 0;
2625
+ while (i !== head) {
2626
+ bytesCount += bytes[i++];
2627
+ i = i % samplesCount;
2628
+ }
2629
+ head = (head + 1) % samplesCount;
2630
+ if (head === tail) {
2631
+ tail = (tail + 1) % samplesCount;
2632
+ }
2633
+ if (now - firstSampleTS < min) {
2634
+ return;
2635
+ }
2636
+ const passed = startedAt && now - startedAt;
2637
+ return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
2638
+ };
2639
+ }
2640
+ var speedometer_default = speedometer;
2641
+
2642
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/throttle.js
2643
+ function throttle(fn, freq) {
2644
+ let timestamp = 0;
2645
+ let threshold = 1e3 / freq;
2646
+ let lastArgs;
2647
+ let timer;
2648
+ const invoke = (args, now = Date.now()) => {
2649
+ timestamp = now;
2650
+ lastArgs = null;
2651
+ if (timer) {
2652
+ clearTimeout(timer);
2653
+ timer = null;
2654
+ }
2655
+ fn(...args);
2656
+ };
2657
+ const throttled = (...args) => {
2658
+ const now = Date.now();
2659
+ const passed = now - timestamp;
2660
+ if (passed >= threshold) {
2661
+ invoke(args, now);
2662
+ } else {
2663
+ lastArgs = args;
2664
+ if (!timer) {
2665
+ timer = setTimeout(() => {
2666
+ timer = null;
2667
+ invoke(lastArgs);
2668
+ }, threshold - passed);
2669
+ }
2670
+ }
2671
+ };
2672
+ const flush = () => lastArgs && invoke(lastArgs);
2673
+ return [throttled, flush];
2674
+ }
2675
+ var throttle_default = throttle;
2676
+
2677
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/progressEventReducer.js
2678
+ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
2679
+ let bytesNotified = 0;
2680
+ const _speedometer = speedometer_default(50, 250);
2681
+ return throttle_default((e) => {
2682
+ const loaded = e.loaded;
2683
+ const total = e.lengthComputable ? e.total : void 0;
2684
+ const progressBytes = loaded - bytesNotified;
2685
+ const rate = _speedometer(progressBytes);
2686
+ const inRange = loaded <= total;
2687
+ bytesNotified = loaded;
2688
+ const data = {
2689
+ loaded,
2690
+ total,
2691
+ progress: total ? loaded / total : void 0,
2692
+ bytes: progressBytes,
2693
+ rate: rate ? rate : void 0,
2694
+ estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
2695
+ event: e,
2696
+ lengthComputable: total != null,
2697
+ [isDownloadStream ? "download" : "upload"]: true
2698
+ };
2699
+ listener(data);
2700
+ }, freq);
2701
+ };
2702
+ var progressEventDecorator = (total, throttled) => {
2703
+ const lengthComputable = total != null;
2704
+ return [(loaded) => throttled[0]({
2705
+ lengthComputable,
2706
+ total,
2707
+ loaded
2708
+ }), throttled[1]];
2709
+ };
2710
+ var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
2711
+
2712
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/isURLSameOrigin.js
2713
+ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
2714
+ url = new URL(url, platform_default.origin);
2715
+ return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
2716
+ })(
2717
+ new URL(platform_default.origin),
2718
+ platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
2719
+ ) : () => true;
2720
+
2721
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/cookies.js
2722
+ var cookies_default = platform_default.hasStandardBrowserEnv ? (
2723
+ // Standard browser envs support document.cookie
2724
+ {
2725
+ write(name, value, expires, path, domain, secure, sameSite) {
2726
+ if (typeof document === "undefined")
2727
+ return;
2728
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
2729
+ if (utils_default.isNumber(expires)) {
2730
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
2731
+ }
2732
+ if (utils_default.isString(path)) {
2733
+ cookie.push(`path=${path}`);
2734
+ }
2735
+ if (utils_default.isString(domain)) {
2736
+ cookie.push(`domain=${domain}`);
2737
+ }
2738
+ if (secure === true) {
2739
+ cookie.push("secure");
2740
+ }
2741
+ if (utils_default.isString(sameSite)) {
2742
+ cookie.push(`SameSite=${sameSite}`);
2743
+ }
2744
+ document.cookie = cookie.join("; ");
2745
+ },
2746
+ read(name) {
2747
+ if (typeof document === "undefined")
2748
+ return null;
2749
+ const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
2750
+ return match ? decodeURIComponent(match[1]) : null;
2751
+ },
2752
+ remove(name) {
2753
+ this.write(name, "", Date.now() - 864e5, "/");
2754
+ }
2755
+ }
2756
+ ) : (
2757
+ // Non-standard browser env (web workers, react-native) lack needed support.
2758
+ {
2759
+ write() {
2760
+ },
2761
+ read() {
2762
+ return null;
2763
+ },
2764
+ remove() {
2765
+ }
2766
+ }
2767
+ );
2768
+
2769
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/isAbsoluteURL.js
2770
+ function isAbsoluteURL(url) {
2771
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2772
+ }
2773
+
2774
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/combineURLs.js
2775
+ function combineURLs(baseURL, relativeURL) {
2776
+ return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
2777
+ }
2778
+
2779
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/core/buildFullPath.js
2780
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2781
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
2782
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
2783
+ return combineURLs(baseURL, requestedURL);
2784
+ }
2785
+ return requestedURL;
2786
+ }
2787
+
2788
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/core/mergeConfig.js
2789
+ var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
2790
+ function mergeConfig(config1, config2) {
2791
+ config2 = config2 || {};
2792
+ const config = {};
2793
+ function getMergedValue(target, source, prop, caseless) {
2794
+ if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
2795
+ return utils_default.merge.call({ caseless }, target, source);
2796
+ } else if (utils_default.isPlainObject(source)) {
2797
+ return utils_default.merge({}, source);
2798
+ } else if (utils_default.isArray(source)) {
2799
+ return source.slice();
2800
+ }
2801
+ return source;
2802
+ }
2803
+ function mergeDeepProperties(a, b, prop, caseless) {
2804
+ if (!utils_default.isUndefined(b)) {
2805
+ return getMergedValue(a, b, prop, caseless);
2806
+ } else if (!utils_default.isUndefined(a)) {
2807
+ return getMergedValue(void 0, a, prop, caseless);
2808
+ }
2809
+ }
2810
+ function valueFromConfig2(a, b) {
2811
+ if (!utils_default.isUndefined(b)) {
2812
+ return getMergedValue(void 0, b);
2813
+ }
2814
+ }
2815
+ function defaultToConfig2(a, b) {
2816
+ if (!utils_default.isUndefined(b)) {
2817
+ return getMergedValue(void 0, b);
2818
+ } else if (!utils_default.isUndefined(a)) {
2819
+ return getMergedValue(void 0, a);
2820
+ }
2821
+ }
2822
+ function mergeDirectKeys(a, b, prop) {
2823
+ if (prop in config2) {
2824
+ return getMergedValue(a, b);
2825
+ } else if (prop in config1) {
2826
+ return getMergedValue(void 0, a);
2827
+ }
2828
+ }
2829
+ const mergeMap = {
2830
+ url: valueFromConfig2,
2831
+ method: valueFromConfig2,
2832
+ data: valueFromConfig2,
2833
+ baseURL: defaultToConfig2,
2834
+ transformRequest: defaultToConfig2,
2835
+ transformResponse: defaultToConfig2,
2836
+ paramsSerializer: defaultToConfig2,
2837
+ timeout: defaultToConfig2,
2838
+ timeoutMessage: defaultToConfig2,
2839
+ withCredentials: defaultToConfig2,
2840
+ withXSRFToken: defaultToConfig2,
2841
+ adapter: defaultToConfig2,
2842
+ responseType: defaultToConfig2,
2843
+ xsrfCookieName: defaultToConfig2,
2844
+ xsrfHeaderName: defaultToConfig2,
2845
+ onUploadProgress: defaultToConfig2,
2846
+ onDownloadProgress: defaultToConfig2,
2847
+ decompress: defaultToConfig2,
2848
+ maxContentLength: defaultToConfig2,
2849
+ maxBodyLength: defaultToConfig2,
2850
+ beforeRedirect: defaultToConfig2,
2851
+ transport: defaultToConfig2,
2852
+ httpAgent: defaultToConfig2,
2853
+ httpsAgent: defaultToConfig2,
2854
+ cancelToken: defaultToConfig2,
2855
+ socketPath: defaultToConfig2,
2856
+ responseEncoding: defaultToConfig2,
2857
+ validateStatus: mergeDirectKeys,
2858
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
2859
+ };
2860
+ utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
2861
+ const merge2 = mergeMap[prop] || mergeDeepProperties;
2862
+ const configValue = merge2(config1[prop], config2[prop], prop);
2863
+ utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
2864
+ });
2865
+ return config;
2866
+ }
2867
+
2868
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/resolveConfig.js
2869
+ var resolveConfig_default = (config) => {
2870
+ const newConfig = mergeConfig({}, config);
2871
+ let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
2872
+ newConfig.headers = headers = AxiosHeaders_default.from(headers);
2873
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
2874
+ if (auth) {
2875
+ headers.set(
2876
+ "Authorization",
2877
+ "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
2878
+ );
2879
+ }
2880
+ if (utils_default.isFormData(data)) {
2881
+ if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
2882
+ headers.setContentType(void 0);
2883
+ } else if (utils_default.isFunction(data.getHeaders)) {
2884
+ const formHeaders = data.getHeaders();
2885
+ const allowedHeaders = ["content-type", "content-length"];
2886
+ Object.entries(formHeaders).forEach(([key, val]) => {
2887
+ if (allowedHeaders.includes(key.toLowerCase())) {
2888
+ headers.set(key, val);
2889
+ }
2890
+ });
2891
+ }
2892
+ }
2893
+ if (platform_default.hasStandardBrowserEnv) {
2894
+ withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
2895
+ if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
2896
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
2897
+ if (xsrfValue) {
2898
+ headers.set(xsrfHeaderName, xsrfValue);
2899
+ }
2900
+ }
2901
+ }
2902
+ return newConfig;
2903
+ };
2904
+
2905
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/adapters/xhr.js
2906
+ var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
2907
+ var xhr_default = isXHRAdapterSupported && function(config) {
2908
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
2909
+ const _config = resolveConfig_default(config);
2910
+ let requestData = _config.data;
2911
+ const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
2912
+ let { responseType, onUploadProgress, onDownloadProgress } = _config;
2913
+ let onCanceled;
2914
+ let uploadThrottled, downloadThrottled;
2915
+ let flushUpload, flushDownload;
2916
+ function done() {
2917
+ flushUpload && flushUpload();
2918
+ flushDownload && flushDownload();
2919
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
2920
+ _config.signal && _config.signal.removeEventListener("abort", onCanceled);
2921
+ }
2922
+ let request = new XMLHttpRequest();
2923
+ request.open(_config.method.toUpperCase(), _config.url, true);
2924
+ request.timeout = _config.timeout;
2925
+ function onloadend() {
2926
+ if (!request) {
2927
+ return;
2928
+ }
2929
+ const responseHeaders = AxiosHeaders_default.from(
2930
+ "getAllResponseHeaders" in request && request.getAllResponseHeaders()
2931
+ );
2932
+ const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
2933
+ const response = {
2934
+ data: responseData,
2935
+ status: request.status,
2936
+ statusText: request.statusText,
2937
+ headers: responseHeaders,
2938
+ config,
2939
+ request
2940
+ };
2941
+ settle(function _resolve(value) {
2942
+ resolve(value);
2943
+ done();
2944
+ }, function _reject(err) {
2945
+ reject(err);
2946
+ done();
2947
+ }, response);
2948
+ request = null;
2949
+ }
2950
+ if ("onloadend" in request) {
2951
+ request.onloadend = onloadend;
2952
+ } else {
2953
+ request.onreadystatechange = function handleLoad() {
2954
+ if (!request || request.readyState !== 4) {
2955
+ return;
2956
+ }
2957
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
2958
+ return;
2959
+ }
2960
+ setTimeout(onloadend);
2961
+ };
2962
+ }
2963
+ request.onabort = function handleAbort() {
2964
+ if (!request) {
2965
+ return;
2966
+ }
2967
+ reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
2968
+ request = null;
2969
+ };
2970
+ request.onerror = function handleError(event) {
2971
+ const msg = event && event.message ? event.message : "Network Error";
2972
+ const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
2973
+ err.event = event || null;
2974
+ reject(err);
2975
+ request = null;
2976
+ };
2977
+ request.ontimeout = function handleTimeout() {
2978
+ let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
2979
+ const transitional2 = _config.transitional || transitional_default;
2980
+ if (_config.timeoutErrorMessage) {
2981
+ timeoutErrorMessage = _config.timeoutErrorMessage;
2982
+ }
2983
+ reject(new AxiosError_default(
2984
+ timeoutErrorMessage,
2985
+ transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
2986
+ config,
2987
+ request
2988
+ ));
2989
+ request = null;
2990
+ };
2991
+ requestData === void 0 && requestHeaders.setContentType(null);
2992
+ if ("setRequestHeader" in request) {
2993
+ utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2994
+ request.setRequestHeader(key, val);
2995
+ });
2996
+ }
2997
+ if (!utils_default.isUndefined(_config.withCredentials)) {
2998
+ request.withCredentials = !!_config.withCredentials;
2999
+ }
3000
+ if (responseType && responseType !== "json") {
3001
+ request.responseType = _config.responseType;
3002
+ }
3003
+ if (onDownloadProgress) {
3004
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
3005
+ request.addEventListener("progress", downloadThrottled);
3006
+ }
3007
+ if (onUploadProgress && request.upload) {
3008
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
3009
+ request.upload.addEventListener("progress", uploadThrottled);
3010
+ request.upload.addEventListener("loadend", flushUpload);
3011
+ }
3012
+ if (_config.cancelToken || _config.signal) {
3013
+ onCanceled = (cancel) => {
3014
+ if (!request) {
3015
+ return;
3016
+ }
3017
+ reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
3018
+ request.abort();
3019
+ request = null;
3020
+ };
3021
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
3022
+ if (_config.signal) {
3023
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
3024
+ }
3025
+ }
3026
+ const protocol = parseProtocol(_config.url);
3027
+ if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
3028
+ reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
3029
+ return;
3030
+ }
3031
+ request.send(requestData || null);
3032
+ });
3033
+ };
3034
+
3035
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/composeSignals.js
3036
+ var composeSignals = (signals, timeout) => {
3037
+ const { length } = signals = signals ? signals.filter(Boolean) : [];
3038
+ if (timeout || length) {
3039
+ let controller = new AbortController();
3040
+ let aborted;
3041
+ const onabort = function(reason) {
3042
+ if (!aborted) {
3043
+ aborted = true;
3044
+ unsubscribe();
3045
+ const err = reason instanceof Error ? reason : this.reason;
3046
+ controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
3047
+ }
3048
+ };
3049
+ let timer = timeout && setTimeout(() => {
3050
+ timer = null;
3051
+ onabort(new AxiosError_default(`timeout of ${timeout}ms exceeded`, AxiosError_default.ETIMEDOUT));
3052
+ }, timeout);
3053
+ const unsubscribe = () => {
3054
+ if (signals) {
3055
+ timer && clearTimeout(timer);
3056
+ timer = null;
3057
+ signals.forEach((signal2) => {
3058
+ signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
3059
+ });
3060
+ signals = null;
3061
+ }
3062
+ };
3063
+ signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
3064
+ const { signal } = controller;
3065
+ signal.unsubscribe = () => utils_default.asap(unsubscribe);
3066
+ return signal;
3067
+ }
3068
+ };
3069
+ var composeSignals_default = composeSignals;
3070
+
3071
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/trackStream.js
3072
+ var streamChunk = function* (chunk, chunkSize) {
3073
+ let len = chunk.byteLength;
3074
+ if (!chunkSize || len < chunkSize) {
3075
+ yield chunk;
3076
+ return;
3077
+ }
3078
+ let pos = 0;
3079
+ let end;
3080
+ while (pos < len) {
3081
+ end = pos + chunkSize;
3082
+ yield chunk.slice(pos, end);
3083
+ pos = end;
3084
+ }
3085
+ };
3086
+ var readBytes = async function* (iterable, chunkSize) {
3087
+ for await (const chunk of readStream(iterable)) {
3088
+ yield* streamChunk(chunk, chunkSize);
3089
+ }
3090
+ };
3091
+ var readStream = async function* (stream) {
3092
+ if (stream[Symbol.asyncIterator]) {
3093
+ yield* stream;
3094
+ return;
3095
+ }
3096
+ const reader = stream.getReader();
3097
+ try {
3098
+ for (; ; ) {
3099
+ const { done, value } = await reader.read();
3100
+ if (done) {
3101
+ break;
3102
+ }
3103
+ yield value;
3104
+ }
3105
+ } finally {
3106
+ await reader.cancel();
3107
+ }
3108
+ };
3109
+ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
3110
+ const iterator2 = readBytes(stream, chunkSize);
3111
+ let bytes = 0;
3112
+ let done;
3113
+ let _onFinish = (e) => {
3114
+ if (!done) {
3115
+ done = true;
3116
+ onFinish && onFinish(e);
3117
+ }
3118
+ };
3119
+ return new ReadableStream({
3120
+ async pull(controller) {
3121
+ try {
3122
+ const { done: done2, value } = await iterator2.next();
3123
+ if (done2) {
3124
+ _onFinish();
3125
+ controller.close();
3126
+ return;
3127
+ }
3128
+ let len = value.byteLength;
3129
+ if (onProgress) {
3130
+ let loadedBytes = bytes += len;
3131
+ onProgress(loadedBytes);
3132
+ }
3133
+ controller.enqueue(new Uint8Array(value));
3134
+ } catch (err) {
3135
+ _onFinish(err);
3136
+ throw err;
3137
+ }
3138
+ },
3139
+ cancel(reason) {
3140
+ _onFinish(reason);
3141
+ return iterator2.return();
3142
+ }
3143
+ }, {
3144
+ highWaterMark: 2
3145
+ });
3146
+ };
3147
+
3148
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/adapters/fetch.js
3149
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
3150
+ var { isFunction: isFunction2 } = utils_default;
3151
+ var globalFetchAPI = (({ Request, Response }) => ({
3152
+ Request,
3153
+ Response
3154
+ }))(utils_default.global);
3155
+ var {
3156
+ ReadableStream: ReadableStream2,
3157
+ TextEncoder
3158
+ } = utils_default.global;
3159
+ var test = (fn, ...args) => {
3160
+ try {
3161
+ return !!fn(...args);
3162
+ } catch (e) {
3163
+ return false;
3164
+ }
3165
+ };
3166
+ var factory = (env) => {
3167
+ env = utils_default.merge.call({
3168
+ skipUndefined: true
3169
+ }, globalFetchAPI, env);
3170
+ const { fetch: envFetch, Request, Response } = env;
3171
+ const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
3172
+ const isRequestSupported = isFunction2(Request);
3173
+ const isResponseSupported = isFunction2(Response);
3174
+ if (!isFetchSupported) {
3175
+ return false;
3176
+ }
3177
+ const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
3178
+ const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
3179
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
3180
+ let duplexAccessed = false;
3181
+ const hasContentType = new Request(platform_default.origin, {
3182
+ body: new ReadableStream2(),
3183
+ method: "POST",
3184
+ get duplex() {
3185
+ duplexAccessed = true;
3186
+ return "half";
3187
+ }
3188
+ }).headers.has("Content-Type");
3189
+ return duplexAccessed && !hasContentType;
3190
+ });
3191
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
3192
+ const resolvers = {
3193
+ stream: supportsResponseStream && ((res) => res.body)
3194
+ };
3195
+ isFetchSupported && (() => {
3196
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
3197
+ !resolvers[type] && (resolvers[type] = (res, config) => {
3198
+ let method = res && res[type];
3199
+ if (method) {
3200
+ return method.call(res);
3201
+ }
3202
+ throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
3203
+ });
3204
+ });
3205
+ })();
3206
+ const getBodyLength = async (body) => {
3207
+ if (body == null) {
3208
+ return 0;
3209
+ }
3210
+ if (utils_default.isBlob(body)) {
3211
+ return body.size;
3212
+ }
3213
+ if (utils_default.isSpecCompliantForm(body)) {
3214
+ const _request = new Request(platform_default.origin, {
3215
+ method: "POST",
3216
+ body
3217
+ });
3218
+ return (await _request.arrayBuffer()).byteLength;
3219
+ }
3220
+ if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
3221
+ return body.byteLength;
3222
+ }
3223
+ if (utils_default.isURLSearchParams(body)) {
3224
+ body = body + "";
3225
+ }
3226
+ if (utils_default.isString(body)) {
3227
+ return (await encodeText(body)).byteLength;
3228
+ }
3229
+ };
3230
+ const resolveBodyLength = async (headers, body) => {
3231
+ const length = utils_default.toFiniteNumber(headers.getContentLength());
3232
+ return length == null ? getBodyLength(body) : length;
3233
+ };
3234
+ return async (config) => {
3235
+ let {
3236
+ url,
3237
+ method,
3238
+ data,
3239
+ signal,
3240
+ cancelToken,
3241
+ timeout,
3242
+ onDownloadProgress,
3243
+ onUploadProgress,
3244
+ responseType,
3245
+ headers,
3246
+ withCredentials = "same-origin",
3247
+ fetchOptions
3248
+ } = resolveConfig_default(config);
3249
+ let _fetch = envFetch || fetch;
3250
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
3251
+ let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
3252
+ let request = null;
3253
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
3254
+ composedSignal.unsubscribe();
3255
+ });
3256
+ let requestContentLength;
3257
+ try {
3258
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
3259
+ let _request = new Request(url, {
3260
+ method: "POST",
3261
+ body: data,
3262
+ duplex: "half"
3263
+ });
3264
+ let contentTypeHeader;
3265
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
3266
+ headers.setContentType(contentTypeHeader);
3267
+ }
3268
+ if (_request.body) {
3269
+ const [onProgress, flush] = progressEventDecorator(
3270
+ requestContentLength,
3271
+ progressEventReducer(asyncDecorator(onUploadProgress))
3272
+ );
3273
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
3274
+ }
3275
+ }
3276
+ if (!utils_default.isString(withCredentials)) {
3277
+ withCredentials = withCredentials ? "include" : "omit";
3278
+ }
3279
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
3280
+ const resolvedOptions = {
3281
+ ...fetchOptions,
3282
+ signal: composedSignal,
3283
+ method: method.toUpperCase(),
3284
+ headers: headers.normalize().toJSON(),
3285
+ body: data,
3286
+ duplex: "half",
3287
+ credentials: isCredentialsSupported ? withCredentials : void 0
3288
+ };
3289
+ request = isRequestSupported && new Request(url, resolvedOptions);
3290
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
3291
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
3292
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
3293
+ const options = {};
3294
+ ["status", "statusText", "headers"].forEach((prop) => {
3295
+ options[prop] = response[prop];
3296
+ });
3297
+ const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
3298
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
3299
+ responseContentLength,
3300
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
3301
+ ) || [];
3302
+ response = new Response(
3303
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
3304
+ flush && flush();
3305
+ unsubscribe && unsubscribe();
3306
+ }),
3307
+ options
3308
+ );
3309
+ }
3310
+ responseType = responseType || "text";
3311
+ let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
3312
+ !isStreamResponse && unsubscribe && unsubscribe();
3313
+ return await new Promise((resolve, reject) => {
3314
+ settle(resolve, reject, {
3315
+ data: responseData,
3316
+ headers: AxiosHeaders_default.from(response.headers),
3317
+ status: response.status,
3318
+ statusText: response.statusText,
3319
+ config,
3320
+ request
3321
+ });
3322
+ });
3323
+ } catch (err) {
3324
+ unsubscribe && unsubscribe();
3325
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
3326
+ throw Object.assign(
3327
+ new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
3328
+ {
3329
+ cause: err.cause || err
3330
+ }
3331
+ );
3332
+ }
3333
+ throw AxiosError_default.from(err, err && err.code, config, request);
3334
+ }
3335
+ };
3336
+ };
3337
+ var seedCache = /* @__PURE__ */ new Map();
3338
+ var getFetch = (config) => {
3339
+ let env = config && config.env || {};
3340
+ const { fetch: fetch2, Request, Response } = env;
3341
+ const seeds = [
3342
+ Request,
3343
+ Response,
3344
+ fetch2
3345
+ ];
3346
+ let len = seeds.length, i = len, seed, target, map = seedCache;
3347
+ while (i--) {
3348
+ seed = seeds[i];
3349
+ target = map.get(seed);
3350
+ target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
3351
+ map = target;
3352
+ }
3353
+ return target;
3354
+ };
3355
+ var adapter = getFetch();
3356
+
3357
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/adapters/adapters.js
3358
+ var knownAdapters = {
3359
+ http: null_default,
3360
+ xhr: xhr_default,
3361
+ fetch: {
3362
+ get: getFetch
3363
+ }
3364
+ };
3365
+ utils_default.forEach(knownAdapters, (fn, value) => {
3366
+ if (fn) {
3367
+ try {
3368
+ Object.defineProperty(fn, "name", { value });
3369
+ } catch (e) {
3370
+ }
3371
+ Object.defineProperty(fn, "adapterName", { value });
3372
+ }
3373
+ });
3374
+ var renderReason = (reason) => `- ${reason}`;
3375
+ var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
3376
+ function getAdapter(adapters, config) {
3377
+ adapters = utils_default.isArray(adapters) ? adapters : [adapters];
3378
+ const { length } = adapters;
3379
+ let nameOrAdapter;
3380
+ let adapter2;
3381
+ const rejectedReasons = {};
3382
+ for (let i = 0; i < length; i++) {
3383
+ nameOrAdapter = adapters[i];
3384
+ let id;
3385
+ adapter2 = nameOrAdapter;
3386
+ if (!isResolvedHandle(nameOrAdapter)) {
3387
+ adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3388
+ if (adapter2 === void 0) {
3389
+ throw new AxiosError_default(`Unknown adapter '${id}'`);
3390
+ }
3391
+ }
3392
+ if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
3393
+ break;
3394
+ }
3395
+ rejectedReasons[id || "#" + i] = adapter2;
3396
+ }
3397
+ if (!adapter2) {
3398
+ const reasons = Object.entries(rejectedReasons).map(
3399
+ ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
3400
+ );
3401
+ let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
3402
+ throw new AxiosError_default(
3403
+ `There is no suitable adapter to dispatch the request ` + s,
3404
+ "ERR_NOT_SUPPORT"
3405
+ );
3406
+ }
3407
+ return adapter2;
3408
+ }
3409
+ var adapters_default = {
3410
+ /**
3411
+ * Resolve an adapter from a list of adapter names or functions.
3412
+ * @type {Function}
3413
+ */
3414
+ getAdapter,
3415
+ /**
3416
+ * Exposes all known adapters
3417
+ * @type {Object<string, Function|Object>}
3418
+ */
3419
+ adapters: knownAdapters
3420
+ };
3421
+
3422
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/core/dispatchRequest.js
3423
+ function throwIfCancellationRequested(config) {
3424
+ if (config.cancelToken) {
3425
+ config.cancelToken.throwIfRequested();
3426
+ }
3427
+ if (config.signal && config.signal.aborted) {
3428
+ throw new CanceledError_default(null, config);
3429
+ }
3430
+ }
3431
+ function dispatchRequest(config) {
3432
+ throwIfCancellationRequested(config);
3433
+ config.headers = AxiosHeaders_default.from(config.headers);
3434
+ config.data = transformData.call(
3435
+ config,
3436
+ config.transformRequest
3437
+ );
3438
+ if (["post", "put", "patch"].indexOf(config.method) !== -1) {
3439
+ config.headers.setContentType("application/x-www-form-urlencoded", false);
3440
+ }
3441
+ const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
3442
+ return adapter2(config).then(function onAdapterResolution(response) {
3443
+ throwIfCancellationRequested(config);
3444
+ response.data = transformData.call(
3445
+ config,
3446
+ config.transformResponse,
3447
+ response
3448
+ );
3449
+ response.headers = AxiosHeaders_default.from(response.headers);
3450
+ return response;
3451
+ }, function onAdapterRejection(reason) {
3452
+ if (!isCancel(reason)) {
3453
+ throwIfCancellationRequested(config);
3454
+ if (reason && reason.response) {
3455
+ reason.response.data = transformData.call(
3456
+ config,
3457
+ config.transformResponse,
3458
+ reason.response
3459
+ );
3460
+ reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
3461
+ }
3462
+ }
3463
+ return Promise.reject(reason);
3464
+ });
3465
+ }
3466
+
3467
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/env/data.js
3468
+ var VERSION = "1.13.4";
3469
+
3470
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/validator.js
3471
+ var validators = {};
3472
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
3473
+ validators[type] = function validator(thing) {
3474
+ return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
3475
+ };
3476
+ });
3477
+ var deprecatedWarnings = {};
3478
+ validators.transitional = function transitional(validator, version, message) {
3479
+ function formatMessage(opt, desc) {
3480
+ return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
3481
+ }
3482
+ return (value, opt, opts) => {
3483
+ if (validator === false) {
3484
+ throw new AxiosError_default(
3485
+ formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
3486
+ AxiosError_default.ERR_DEPRECATED
3487
+ );
3488
+ }
3489
+ if (version && !deprecatedWarnings[opt]) {
3490
+ deprecatedWarnings[opt] = true;
3491
+ console.warn(
3492
+ formatMessage(
3493
+ opt,
3494
+ " has been deprecated since v" + version + " and will be removed in the near future"
3495
+ )
3496
+ );
3497
+ }
3498
+ return validator ? validator(value, opt, opts) : true;
3499
+ };
3500
+ };
3501
+ validators.spelling = function spelling(correctSpelling) {
3502
+ return (value, opt) => {
3503
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
3504
+ return true;
3505
+ };
3506
+ };
3507
+ function assertOptions(options, schema, allowUnknown) {
3508
+ if (typeof options !== "object") {
3509
+ throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
3510
+ }
3511
+ const keys = Object.keys(options);
3512
+ let i = keys.length;
3513
+ while (i-- > 0) {
3514
+ const opt = keys[i];
3515
+ const validator = schema[opt];
3516
+ if (validator) {
3517
+ const value = options[opt];
3518
+ const result = value === void 0 || validator(value, opt, options);
3519
+ if (result !== true) {
3520
+ throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE);
3521
+ }
3522
+ continue;
3523
+ }
3524
+ if (allowUnknown !== true) {
3525
+ throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
3526
+ }
3527
+ }
3528
+ }
3529
+ var validator_default = {
3530
+ assertOptions,
3531
+ validators
3532
+ };
3533
+
3534
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/core/Axios.js
3535
+ var validators2 = validator_default.validators;
3536
+ var Axios = class {
3537
+ constructor(instanceConfig) {
3538
+ this.defaults = instanceConfig || {};
3539
+ this.interceptors = {
3540
+ request: new InterceptorManager_default(),
3541
+ response: new InterceptorManager_default()
3542
+ };
3543
+ }
3544
+ /**
3545
+ * Dispatch a request
3546
+ *
3547
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
3548
+ * @param {?Object} config
3549
+ *
3550
+ * @returns {Promise} The Promise to be fulfilled
3551
+ */
3552
+ async request(configOrUrl, config) {
3553
+ try {
3554
+ return await this._request(configOrUrl, config);
3555
+ } catch (err) {
3556
+ if (err instanceof Error) {
3557
+ let dummy = {};
3558
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
3559
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
3560
+ try {
3561
+ if (!err.stack) {
3562
+ err.stack = stack;
3563
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
3564
+ err.stack += "\n" + stack;
3565
+ }
3566
+ } catch (e) {
3567
+ }
3568
+ }
3569
+ throw err;
3570
+ }
3571
+ }
3572
+ _request(configOrUrl, config) {
3573
+ if (typeof configOrUrl === "string") {
3574
+ config = config || {};
3575
+ config.url = configOrUrl;
3576
+ } else {
3577
+ config = configOrUrl || {};
3578
+ }
3579
+ config = mergeConfig(this.defaults, config);
3580
+ const { transitional: transitional2, paramsSerializer, headers } = config;
3581
+ if (transitional2 !== void 0) {
3582
+ validator_default.assertOptions(transitional2, {
3583
+ silentJSONParsing: validators2.transitional(validators2.boolean),
3584
+ forcedJSONParsing: validators2.transitional(validators2.boolean),
3585
+ clarifyTimeoutError: validators2.transitional(validators2.boolean)
3586
+ }, false);
3587
+ }
3588
+ if (paramsSerializer != null) {
3589
+ if (utils_default.isFunction(paramsSerializer)) {
3590
+ config.paramsSerializer = {
3591
+ serialize: paramsSerializer
3592
+ };
3593
+ } else {
3594
+ validator_default.assertOptions(paramsSerializer, {
3595
+ encode: validators2.function,
3596
+ serialize: validators2.function
3597
+ }, true);
3598
+ }
3599
+ }
3600
+ if (config.allowAbsoluteUrls !== void 0) {
3601
+ } else if (this.defaults.allowAbsoluteUrls !== void 0) {
3602
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
3603
+ } else {
3604
+ config.allowAbsoluteUrls = true;
3605
+ }
3606
+ validator_default.assertOptions(config, {
3607
+ baseUrl: validators2.spelling("baseURL"),
3608
+ withXsrfToken: validators2.spelling("withXSRFToken")
3609
+ }, true);
3610
+ config.method = (config.method || this.defaults.method || "get").toLowerCase();
3611
+ let contextHeaders = headers && utils_default.merge(
3612
+ headers.common,
3613
+ headers[config.method]
3614
+ );
3615
+ headers && utils_default.forEach(
3616
+ ["delete", "get", "head", "post", "put", "patch", "common"],
3617
+ (method) => {
3618
+ delete headers[method];
3619
+ }
3620
+ );
3621
+ config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
3622
+ const requestInterceptorChain = [];
3623
+ let synchronousRequestInterceptors = true;
3624
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
3625
+ if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
3626
+ return;
3627
+ }
3628
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
3629
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
3630
+ });
3631
+ const responseInterceptorChain = [];
3632
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
3633
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
3634
+ });
3635
+ let promise;
3636
+ let i = 0;
3637
+ let len;
3638
+ if (!synchronousRequestInterceptors) {
3639
+ const chain = [dispatchRequest.bind(this), void 0];
3640
+ chain.unshift(...requestInterceptorChain);
3641
+ chain.push(...responseInterceptorChain);
3642
+ len = chain.length;
3643
+ promise = Promise.resolve(config);
3644
+ while (i < len) {
3645
+ promise = promise.then(chain[i++], chain[i++]);
3646
+ }
3647
+ return promise;
3648
+ }
3649
+ len = requestInterceptorChain.length;
3650
+ let newConfig = config;
3651
+ while (i < len) {
3652
+ const onFulfilled = requestInterceptorChain[i++];
3653
+ const onRejected = requestInterceptorChain[i++];
3654
+ try {
3655
+ newConfig = onFulfilled(newConfig);
3656
+ } catch (error) {
3657
+ onRejected.call(this, error);
3658
+ break;
3659
+ }
3660
+ }
3661
+ try {
3662
+ promise = dispatchRequest.call(this, newConfig);
3663
+ } catch (error) {
3664
+ return Promise.reject(error);
3665
+ }
3666
+ i = 0;
3667
+ len = responseInterceptorChain.length;
3668
+ while (i < len) {
3669
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
3670
+ }
3671
+ return promise;
3672
+ }
3673
+ getUri(config) {
3674
+ config = mergeConfig(this.defaults, config);
3675
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
3676
+ return buildURL(fullPath, config.params, config.paramsSerializer);
3677
+ }
3678
+ };
3679
+ utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
3680
+ Axios.prototype[method] = function(url, config) {
3681
+ return this.request(mergeConfig(config || {}, {
3682
+ method,
3683
+ url,
3684
+ data: (config || {}).data
3685
+ }));
3686
+ };
3687
+ });
3688
+ utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
3689
+ function generateHTTPMethod(isForm) {
3690
+ return function httpMethod(url, data, config) {
3691
+ return this.request(mergeConfig(config || {}, {
3692
+ method,
3693
+ headers: isForm ? {
3694
+ "Content-Type": "multipart/form-data"
3695
+ } : {},
3696
+ url,
3697
+ data
3698
+ }));
3699
+ };
3700
+ }
3701
+ Axios.prototype[method] = generateHTTPMethod();
3702
+ Axios.prototype[method + "Form"] = generateHTTPMethod(true);
3703
+ });
3704
+ var Axios_default = Axios;
3705
+
3706
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/cancel/CancelToken.js
3707
+ var CancelToken = class _CancelToken {
3708
+ constructor(executor) {
3709
+ if (typeof executor !== "function") {
3710
+ throw new TypeError("executor must be a function.");
3711
+ }
3712
+ let resolvePromise;
3713
+ this.promise = new Promise(function promiseExecutor(resolve) {
3714
+ resolvePromise = resolve;
3715
+ });
3716
+ const token = this;
3717
+ this.promise.then((cancel) => {
3718
+ if (!token._listeners)
3719
+ return;
3720
+ let i = token._listeners.length;
3721
+ while (i-- > 0) {
3722
+ token._listeners[i](cancel);
3723
+ }
3724
+ token._listeners = null;
3725
+ });
3726
+ this.promise.then = (onfulfilled) => {
3727
+ let _resolve;
3728
+ const promise = new Promise((resolve) => {
3729
+ token.subscribe(resolve);
3730
+ _resolve = resolve;
3731
+ }).then(onfulfilled);
3732
+ promise.cancel = function reject() {
3733
+ token.unsubscribe(_resolve);
3734
+ };
3735
+ return promise;
3736
+ };
3737
+ executor(function cancel(message, config, request) {
3738
+ if (token.reason) {
3739
+ return;
3740
+ }
3741
+ token.reason = new CanceledError_default(message, config, request);
3742
+ resolvePromise(token.reason);
3743
+ });
3744
+ }
3745
+ /**
3746
+ * Throws a `CanceledError` if cancellation has been requested.
3747
+ */
3748
+ throwIfRequested() {
3749
+ if (this.reason) {
3750
+ throw this.reason;
3751
+ }
3752
+ }
3753
+ /**
3754
+ * Subscribe to the cancel signal
3755
+ */
3756
+ subscribe(listener) {
3757
+ if (this.reason) {
3758
+ listener(this.reason);
3759
+ return;
3760
+ }
3761
+ if (this._listeners) {
3762
+ this._listeners.push(listener);
3763
+ } else {
3764
+ this._listeners = [listener];
3765
+ }
3766
+ }
3767
+ /**
3768
+ * Unsubscribe from the cancel signal
3769
+ */
3770
+ unsubscribe(listener) {
3771
+ if (!this._listeners) {
3772
+ return;
3773
+ }
3774
+ const index = this._listeners.indexOf(listener);
3775
+ if (index !== -1) {
3776
+ this._listeners.splice(index, 1);
3777
+ }
3778
+ }
3779
+ toAbortSignal() {
3780
+ const controller = new AbortController();
3781
+ const abort = (err) => {
3782
+ controller.abort(err);
3783
+ };
3784
+ this.subscribe(abort);
3785
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
3786
+ return controller.signal;
3787
+ }
3788
+ /**
3789
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
3790
+ * cancels the `CancelToken`.
3791
+ */
3792
+ static source() {
3793
+ let cancel;
3794
+ const token = new _CancelToken(function executor(c) {
3795
+ cancel = c;
3796
+ });
3797
+ return {
3798
+ token,
3799
+ cancel
3800
+ };
3801
+ }
3802
+ };
3803
+ var CancelToken_default = CancelToken;
3804
+
3805
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/spread.js
3806
+ function spread(callback) {
3807
+ return function wrap(arr) {
3808
+ return callback.apply(null, arr);
3809
+ };
3810
+ }
3811
+
3812
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/isAxiosError.js
3813
+ function isAxiosError(payload) {
3814
+ return utils_default.isObject(payload) && payload.isAxiosError === true;
3815
+ }
3816
+
3817
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/HttpStatusCode.js
3818
+ var HttpStatusCode = {
3819
+ Continue: 100,
3820
+ SwitchingProtocols: 101,
3821
+ Processing: 102,
3822
+ EarlyHints: 103,
3823
+ Ok: 200,
3824
+ Created: 201,
3825
+ Accepted: 202,
3826
+ NonAuthoritativeInformation: 203,
3827
+ NoContent: 204,
3828
+ ResetContent: 205,
3829
+ PartialContent: 206,
3830
+ MultiStatus: 207,
3831
+ AlreadyReported: 208,
3832
+ ImUsed: 226,
3833
+ MultipleChoices: 300,
3834
+ MovedPermanently: 301,
3835
+ Found: 302,
3836
+ SeeOther: 303,
3837
+ NotModified: 304,
3838
+ UseProxy: 305,
3839
+ Unused: 306,
3840
+ TemporaryRedirect: 307,
3841
+ PermanentRedirect: 308,
3842
+ BadRequest: 400,
3843
+ Unauthorized: 401,
3844
+ PaymentRequired: 402,
3845
+ Forbidden: 403,
3846
+ NotFound: 404,
3847
+ MethodNotAllowed: 405,
3848
+ NotAcceptable: 406,
3849
+ ProxyAuthenticationRequired: 407,
3850
+ RequestTimeout: 408,
3851
+ Conflict: 409,
3852
+ Gone: 410,
3853
+ LengthRequired: 411,
3854
+ PreconditionFailed: 412,
3855
+ PayloadTooLarge: 413,
3856
+ UriTooLong: 414,
3857
+ UnsupportedMediaType: 415,
3858
+ RangeNotSatisfiable: 416,
3859
+ ExpectationFailed: 417,
3860
+ ImATeapot: 418,
3861
+ MisdirectedRequest: 421,
3862
+ UnprocessableEntity: 422,
3863
+ Locked: 423,
3864
+ FailedDependency: 424,
3865
+ TooEarly: 425,
3866
+ UpgradeRequired: 426,
3867
+ PreconditionRequired: 428,
3868
+ TooManyRequests: 429,
3869
+ RequestHeaderFieldsTooLarge: 431,
3870
+ UnavailableForLegalReasons: 451,
3871
+ InternalServerError: 500,
3872
+ NotImplemented: 501,
3873
+ BadGateway: 502,
3874
+ ServiceUnavailable: 503,
3875
+ GatewayTimeout: 504,
3876
+ HttpVersionNotSupported: 505,
3877
+ VariantAlsoNegotiates: 506,
3878
+ InsufficientStorage: 507,
3879
+ LoopDetected: 508,
3880
+ NotExtended: 510,
3881
+ NetworkAuthenticationRequired: 511,
3882
+ WebServerIsDown: 521,
3883
+ ConnectionTimedOut: 522,
3884
+ OriginIsUnreachable: 523,
3885
+ TimeoutOccurred: 524,
3886
+ SslHandshakeFailed: 525,
3887
+ InvalidSslCertificate: 526
3888
+ };
3889
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
3890
+ HttpStatusCode[value] = key;
3891
+ });
3892
+ var HttpStatusCode_default = HttpStatusCode;
3893
+
3894
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/axios.js
3895
+ function createInstance(defaultConfig) {
3896
+ const context = new Axios_default(defaultConfig);
3897
+ const instance = bind(Axios_default.prototype.request, context);
3898
+ utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
3899
+ utils_default.extend(instance, context, null, { allOwnKeys: true });
3900
+ instance.create = function create(instanceConfig) {
3901
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
3902
+ };
3903
+ return instance;
3904
+ }
3905
+ var axios = createInstance(defaults_default);
3906
+ axios.Axios = Axios_default;
3907
+ axios.CanceledError = CanceledError_default;
3908
+ axios.CancelToken = CancelToken_default;
3909
+ axios.isCancel = isCancel;
3910
+ axios.VERSION = VERSION;
3911
+ axios.toFormData = toFormData_default;
3912
+ axios.AxiosError = AxiosError_default;
3913
+ axios.Cancel = axios.CanceledError;
3914
+ axios.all = function all(promises) {
3915
+ return Promise.all(promises);
3916
+ };
3917
+ axios.spread = spread;
3918
+ axios.isAxiosError = isAxiosError;
3919
+ axios.mergeConfig = mergeConfig;
3920
+ axios.AxiosHeaders = AxiosHeaders_default;
3921
+ axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
3922
+ axios.getAdapter = adapters_default.getAdapter;
3923
+ axios.HttpStatusCode = HttpStatusCode_default;
3924
+ axios.default = axios;
3925
+ var axios_default = axios;
3926
+
3927
+ // node_modules/.pnpm/axios@1.13.4/node_modules/axios/index.js
3928
+ var {
3929
+ Axios: Axios2,
3930
+ AxiosError: AxiosError2,
3931
+ CanceledError: CanceledError2,
3932
+ isCancel: isCancel2,
3933
+ CancelToken: CancelToken2,
3934
+ VERSION: VERSION2,
3935
+ all: all2,
3936
+ Cancel,
3937
+ isAxiosError: isAxiosError2,
3938
+ spread: spread2,
3939
+ toFormData: toFormData2,
3940
+ AxiosHeaders: AxiosHeaders2,
3941
+ HttpStatusCode: HttpStatusCode2,
3942
+ formToJSON,
3943
+ getAdapter: getAdapter2,
3944
+ mergeConfig: mergeConfig2
3945
+ } = axios_default;
3946
+
3947
+ // src/services/api.ts
3948
+ var getApiBaseUrl = () => {
3949
+ if (typeof import.meta !== "undefined" && import.meta.env?.VITE_API_BASE_URL) {
3950
+ return import.meta.env.VITE_API_BASE_URL;
3951
+ }
3952
+ return "192.168.100.9:3000";
3953
+ };
3954
+ var serverUrl = getApiBaseUrl();
3955
+ var api = axios_default.create({
3956
+ baseURL: `http://${serverUrl}`,
3957
+ timeout: 1e4
3958
+ });
3959
+ var authApi = axios_default.create({
3960
+ baseURL: `http://${serverUrl}`,
3961
+ timeout: 1e4
3962
+ });
3963
+ function getAccessToken() {
3964
+ try {
3965
+ return localStorage.getItem("accessToken");
3966
+ } catch {
3967
+ return null;
3968
+ }
3969
+ }
3970
+ function setAccessToken(token) {
3971
+ try {
3972
+ if (token)
3973
+ localStorage.setItem("accessToken", token);
3974
+ else
3975
+ localStorage.removeItem("accessToken");
3976
+ } catch {
3977
+ }
3978
+ }
3979
+ function getRefreshToken() {
3980
+ try {
3981
+ return localStorage.getItem("refreshToken");
3982
+ } catch {
3983
+ return null;
3984
+ }
3985
+ }
3986
+ function setRefreshToken(token) {
3987
+ try {
3988
+ if (token)
3989
+ localStorage.setItem("refreshToken", token);
3990
+ else
3991
+ localStorage.removeItem("refreshToken");
3992
+ } catch {
3993
+ }
3994
+ }
3995
+ function clearTokens() {
3996
+ setAccessToken(null);
3997
+ setRefreshToken(null);
3998
+ }
3999
+ authApi.interceptors.request.use((config) => {
4000
+ const token = getAccessToken();
4001
+ if (token && config) {
4002
+ config.headers = config.headers || {};
4003
+ config.headers.Authorization = `Bearer ${token}`;
4004
+ }
4005
+ return config;
4006
+ });
4007
+ var isRefreshing = false;
4008
+ var refreshPromise = null;
4009
+ async function doRefreshOnce() {
4010
+ if (isRefreshing && refreshPromise)
4011
+ return refreshPromise;
4012
+ const rt = getRefreshToken();
4013
+ if (!rt)
4014
+ return null;
4015
+ isRefreshing = true;
4016
+ refreshPromise = authApi.post(
4017
+ "/refresh",
4018
+ { refreshToken: rt },
4019
+ { headers: { "Content-Type": "application/json" } }
4020
+ ).then((r) => r.data).catch(() => null).finally(() => {
4021
+ isRefreshing = false;
4022
+ refreshPromise = null;
4023
+ });
4024
+ return refreshPromise;
4025
+ }
4026
+ authApi.interceptors.response.use(
4027
+ (r) => r,
4028
+ async (err) => {
4029
+ const originalRequest = err.config || {};
4030
+ if (err.response?.status === 401 && !originalRequest._retry) {
4031
+ originalRequest._retry = true;
4032
+ const refreshed = await doRefreshOnce();
4033
+ if (!refreshed) {
4034
+ clearTokens();
4035
+ return Promise.reject(err);
4036
+ }
4037
+ setAccessToken(refreshed.token);
4038
+ setRefreshToken(refreshed.refreshToken);
4039
+ originalRequest.headers = originalRequest.headers || {};
4040
+ originalRequest.headers.Authorization = `Bearer ${refreshed.token}`;
4041
+ return authApi(originalRequest);
4042
+ }
4043
+ return Promise.reject(err);
4044
+ }
4045
+ );
4046
+ function formatAxiosError(err) {
4047
+ if (err instanceof AxiosError2) {
4048
+ const status = err.response?.status;
4049
+ const data = err.response?.data;
4050
+ return new Error(
4051
+ `Request failed${status ? ` (status ${status})` : ""}: ${err.message || JSON.stringify(data) || "unknown"}`
4052
+ );
4053
+ }
4054
+ return err instanceof Error ? err : new Error(String(err));
4055
+ }
4056
+ var fetchApi = {
4057
+ getJson: async (path, params, headers) => {
4058
+ try {
4059
+ const response = await (path.includes("/auth") ? authApi : api).get(path.replace("/auth", ""), { params, headers });
4060
+ return response.data;
4061
+ } catch (e) {
4062
+ throw formatAxiosError(e);
4063
+ }
4064
+ },
4065
+ getText: async (path, params, headers) => {
4066
+ try {
4067
+ const response = await (path.includes("/auth") ? authApi : api).get(path.replace("/auth", ""), {
4068
+ params,
4069
+ headers,
4070
+ responseType: "text"
4071
+ });
4072
+ return response.data;
4073
+ } catch (e) {
4074
+ throw formatAxiosError(e);
4075
+ }
4076
+ },
4077
+ getVoid: async (path, params, headers) => {
4078
+ try {
4079
+ await (path.includes("/auth") ? authApi : api).get(path.replace("/auth", ""), { params, headers });
4080
+ } catch (e) {
4081
+ throw formatAxiosError(e);
4082
+ }
4083
+ },
4084
+ postJson: async (path, payload, headers) => {
4085
+ try {
4086
+ const response = await (path.includes("/auth") ? authApi : api).post(path.replace("/auth", ""), payload, { headers });
4087
+ return response.data;
4088
+ } catch (e) {
4089
+ throw formatAxiosError(e);
4090
+ }
4091
+ },
4092
+ patchJson: async (path, payload, headers) => {
4093
+ try {
4094
+ const response = await (path.includes("/auth") ? authApi : api).patch(path.replace("/auth", ""), payload, { headers });
4095
+ return response.data;
4096
+ } catch (e) {
4097
+ throw formatAxiosError(e);
4098
+ }
4099
+ },
4100
+ putJson: async (path, payload, headers) => {
4101
+ try {
4102
+ const response = await (path.includes("/auth") ? authApi : api).put(path.replace("/auth", ""), payload, { headers });
4103
+ return response.data;
4104
+ } catch (e) {
4105
+ throw formatAxiosError(e);
4106
+ }
4107
+ },
4108
+ deleteJson: async (path, headers) => {
4109
+ try {
4110
+ const response = await (path.includes("/auth") ? authApi : api).delete(path.replace("/auth", ""), { headers });
4111
+ return response.data;
4112
+ } catch (e) {
4113
+ throw formatAxiosError(e);
4114
+ }
4115
+ },
4116
+ deleteVoid: async (path, headers) => {
4117
+ try {
4118
+ await (path.includes("/auth") ? authApi : api).delete(path.replace("/auth", ""), { headers });
4119
+ } catch (e) {
4120
+ throw formatAxiosError(e);
4121
+ }
4122
+ }
4123
+ };
4124
+ var serverOrigin = `http://${serverUrl}`;
4125
+
4126
+ // src/services/loadRemoteModule.ts
4127
+ import * as React7 from "react";
4128
+ import * as ReactDOM from "react-dom";
4129
+
4130
+ // src/services/metadataLoader.ts
4131
+ var MetadataLoader = class {
4132
+ constructor() {
4133
+ __publicField(this, "metadataCache", /* @__PURE__ */ new Map());
4134
+ }
4135
+ async loadMetadata(metadataUrl) {
4136
+ if (this.metadataCache.has(metadataUrl)) {
4137
+ return this.metadataCache.get(metadataUrl) || [];
4138
+ }
4139
+ try {
4140
+ const response = await fetch(metadataUrl);
4141
+ console.log(response);
4142
+ if (!response.ok) {
4143
+ throw new Error(`Failed to fetch metadata: ${response.statusText}`);
4144
+ }
4145
+ const data = await response.json();
4146
+ let metadata;
4147
+ if (Array.isArray(data)) {
4148
+ metadata = data;
4149
+ } else if (data.pages && Array.isArray(data.pages)) {
4150
+ metadata = data.pages;
4151
+ } else {
4152
+ throw new Error(
4153
+ "Invalid metadata format: expected array or object with pages property"
4154
+ );
4155
+ }
4156
+ metadata.forEach((page, index) => {
4157
+ if (!page.id || !page.name || !page.path || !page.bundleUrl) {
4158
+ throw new Error(
4159
+ `Invalid page metadata at index ${index}: missing required fields`
4160
+ );
4161
+ }
4162
+ });
4163
+ this.metadataCache.set(metadataUrl, metadata);
4164
+ return metadata;
4165
+ } catch (error) {
4166
+ console.warn(`Failed to load metadata from ${metadataUrl}:`, error);
4167
+ return [];
4168
+ }
4169
+ }
4170
+ async loadFromDirectory(directoryUrl) {
4171
+ try {
4172
+ const manifestUrl = `${directoryUrl}/manifest.json`;
4173
+ return await this.loadMetadata(manifestUrl);
4174
+ } catch (error) {
4175
+ throw new Error(
4176
+ `Directory manifest not found at ${directoryUrl}/manifest.json: ${error}`
4177
+ );
4178
+ }
4179
+ }
4180
+ clearCache() {
4181
+ this.metadataCache.clear();
4182
+ }
4183
+ getCachedMetadata(metadataUrl) {
4184
+ return this.metadataCache.get(metadataUrl);
4185
+ }
4186
+ };
4187
+ var metadataLoader = new MetadataLoader();
4188
+
4189
+ // src/services/registry.ts
4190
+ var PluginRegistryImpl = class {
4191
+ constructor() {
4192
+ __publicField(this, "components", /* @__PURE__ */ new Map());
4193
+ __publicField(this, "services", /* @__PURE__ */ new Map());
4194
+ __publicField(this, "routes", []);
4195
+ __publicField(this, "pages", []);
4196
+ }
4197
+ registerComponent(name, component) {
4198
+ if (!name || !component)
4199
+ return;
4200
+ this.components.set(name, component);
4201
+ }
4202
+ getComponent(name) {
4203
+ return this.components.get(name);
4204
+ }
4205
+ registerService(name, service) {
4206
+ if (!name || service === void 0)
4207
+ return;
4208
+ this.services.set(name, service);
4209
+ }
4210
+ getService(name) {
4211
+ return this.services.get(name);
4212
+ }
4213
+ registerRoute(route) {
4214
+ if (!route || !route.path)
4215
+ return;
4216
+ this.routes.push(route);
4217
+ }
4218
+ getRoutes() {
4219
+ return [...this.routes];
4220
+ }
4221
+ registerPage(page) {
4222
+ if (!page || !page.id || !page.component)
4223
+ return;
4224
+ const existing = this.pages.findIndex((p) => p.id === page.id);
4225
+ if (existing >= 0) {
4226
+ this.pages[existing] = page;
4227
+ } else {
4228
+ this.pages.push(page);
4229
+ }
4230
+ this.components.set(page.id, page.component);
4231
+ }
4232
+ getPages() {
4233
+ return [...this.pages];
4234
+ }
4235
+ };
4236
+ var registry = new PluginRegistryImpl();
4237
+
4238
+ // src/services/hostConfig.ts
4239
+ var HostConfigLoader = class {
4240
+ constructor() {
4241
+ __publicField(this, "cache");
4242
+ }
4243
+ async loadHostConfig(url = "/config/host.json") {
4244
+ if (this.cache)
4245
+ return this.cache;
4246
+ try {
4247
+ const res = await fetch(url);
4248
+ if (!res.ok)
4249
+ throw new Error(`HTTP ${res.status}: ${res.statusText}`);
4250
+ const data = await res.json();
4251
+ this.cache = data;
4252
+ return data;
4253
+ } catch (err) {
4254
+ const fallback = {
4255
+ pluginsManifestUrl: "/plugins/manifest.json",
4256
+ defaultRoute: "/",
4257
+ staticRoutes: [],
4258
+ features: {}
4259
+ };
4260
+ this.cache = fallback;
4261
+ return fallback;
4262
+ }
4263
+ }
4264
+ clearCache() {
4265
+ this.cache = void 0;
4266
+ }
4267
+ };
4268
+ var hostConfigLoader = new HostConfigLoader();
4269
+
4270
+ // src/services/discovery.ts
4271
+ var discoveryService = {
4272
+ /**
4273
+ * GET /services/available (authenticated)
4274
+ * Returns whatever the backend provides about available services/subservices.
4275
+ */
4276
+ available: async () => {
4277
+ try {
4278
+ const data = await fetchApi.getJson("/auth/services/available");
4279
+ return data;
4280
+ } catch (err) {
4281
+ console.error("Failed to fetch available services:", err);
4282
+ throw err;
4283
+ }
4284
+ }
4285
+ };
4286
+
4287
+ // src/hooks/useSettings.ts
4288
+ function useSettings(defaultSettings, options) {
4289
+ const {
4290
+ queryKey,
4291
+ fetchPath,
4292
+ savePath = fetchPath,
4293
+ fetchParams,
4294
+ transform = (data2) => data2,
4295
+ toPayload = (settings2) => settings2,
4296
+ saveMethod = "patch",
4297
+ enabled = true,
4298
+ refetchInterval
4299
+ } = options;
4300
+ const queryClient = useQueryClient();
4301
+ const [settings, setSettings] = useState4(defaultSettings);
4302
+ const [savedSettings, setSavedSettings] = useState4(defaultSettings);
4303
+ const {
4304
+ data,
4305
+ isLoading,
4306
+ error: fetchError,
4307
+ refetch
4308
+ } = useQuery({
4309
+ queryKey,
4310
+ queryFn: async () => {
4311
+ const raw = await fetchApi.getJson(fetchPath, fetchParams);
4312
+ return transform(raw);
4313
+ },
4314
+ enabled,
4315
+ refetchInterval
4316
+ });
4317
+ useEffect5(() => {
4318
+ if (data) {
4319
+ setSettings(data);
4320
+ setSavedSettings(data);
4321
+ }
4322
+ }, [data]);
4323
+ const saveMutation = useMutation({
4324
+ mutationFn: async (payload) => {
4325
+ switch (saveMethod) {
4326
+ case "put":
4327
+ return fetchApi.putJson(savePath, payload);
4328
+ case "post":
4329
+ return fetchApi.postJson(savePath, payload);
4330
+ default:
4331
+ return fetchApi.patchJson(savePath, payload);
4332
+ }
4333
+ },
4334
+ onSuccess: () => {
4335
+ setSavedSettings(settings);
4336
+ queryClient.invalidateQueries({ queryKey });
4337
+ }
4338
+ });
4339
+ const isDirty = useMemo(
4340
+ () => JSON.stringify(settings) !== JSON.stringify(savedSettings),
4341
+ [settings, savedSettings]
4342
+ );
4343
+ const updateField = useCallback3((key, value) => {
4344
+ setSettings((prev) => ({ ...prev, [key]: value }));
4345
+ }, []);
4346
+ const updateSettings = useCallback3((partial) => {
4347
+ setSettings((prev) => ({ ...prev, ...partial }));
4348
+ }, []);
4349
+ const discard = useCallback3(() => {
4350
+ setSettings(savedSettings);
4351
+ }, [savedSettings]);
4352
+ const save = useCallback3(async () => {
4353
+ const payload = toPayload(settings);
4354
+ await saveMutation.mutateAsync(payload);
4355
+ }, [settings, toPayload, saveMutation]);
4356
+ return {
4357
+ settings,
4358
+ savedSettings,
4359
+ updateField,
4360
+ updateSettings,
4361
+ discard,
4362
+ save,
4363
+ isDirty,
4364
+ isLoading,
4365
+ isSaving: saveMutation.isPending,
4366
+ error: fetchError || saveMutation.error || null,
4367
+ refetch
4368
+ };
4369
+ }
4370
+
4371
+ // src/hooks/useApi.ts
4372
+ function useApi(type, key, path, params, enabled = true, refetchInterval) {
4373
+ return useQuery({
4374
+ queryKey: key,
4375
+ queryFn: () => {
4376
+ switch (type) {
4377
+ case "json":
4378
+ return fetchApi.getJson(path, params);
4379
+ case "text":
4380
+ return fetchApi.getText(path, params);
4381
+ default:
4382
+ return fetchApi.getJson(path, params);
4383
+ }
4384
+ },
4385
+ enabled,
4386
+ refetchInterval
4387
+ });
4388
+ }
4389
+
4390
+ // src/hooks/useAvailableSubservices.ts
4391
+ import { useEffect as useEffect6, useState as useState5 } from "react";
4392
+ function useAvailableSubservices(serviceKey, fallbackCount = 4) {
4393
+ const [options, setOptions] = useState5(
4394
+ Array.from({ length: fallbackCount }).map((_, i) => ({ label: `Channel ${i + 1}`, value: `${i}` }))
4395
+ );
4396
+ const [loading, setLoading] = useState5(false);
4397
+ useEffect6(() => {
4398
+ let mounted = true;
4399
+ (async () => {
4400
+ setLoading(true);
4401
+ try {
4402
+ const data = await discoveryService.available();
4403
+ if (!mounted)
4404
+ return;
4405
+ let list;
4406
+ if (data && Array.isArray(data[serviceKey]))
4407
+ list = data[serviceKey];
4408
+ else if (data && data.services && Array.isArray(data.services[serviceKey]))
4409
+ list = data.services[serviceKey];
4410
+ else if (data && Array.isArray(data.available)) {
4411
+ const found = data.available.find((s) => s.service === serviceKey || s.key === serviceKey || s.id === serviceKey);
4412
+ if (found && Array.isArray(found.subservices))
4413
+ list = found.subservices;
4414
+ }
4415
+ if (Array.isArray(list) && list.length > 0) {
4416
+ const mapped = list.map((item, idx) => ({
4417
+ label: item.label || item.name || `Channel ${idx + 1}`,
4418
+ value: `${idx}`
4419
+ }));
4420
+ setOptions(mapped);
4421
+ }
4422
+ } catch (e) {
4423
+ } finally {
4424
+ if (mounted)
4425
+ setLoading(false);
4426
+ }
4427
+ })();
4428
+ return () => {
4429
+ mounted = false;
4430
+ };
4431
+ }, [serviceKey, fallbackCount]);
4432
+ return { options, loading };
4433
+ }
4434
+ export {
4435
+ useApi,
4436
+ useAvailableSubservices,
4437
+ useSettings
4438
+ };