@feedmepos/mf-media 0.0.4 → 0.0.6

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.
@@ -0,0 +1,4193 @@
1
+ import { defineComponent as ye, resolveComponent as M, openBlock as S, createElementBlock as C, toDisplayString as E, unref as T, createElementVNode as h, Fragment as Z, renderList as be, normalizeClass as te, withModifiers as st, createBlock as ne, createCommentVNode as V, createVNode as F, ref as N, withDirectives as Tn, withKeys as On, vModelText as Cn, computed as ae, withCtx as le, createTextVNode as ge, watch as he, onScopeDispose as _n, mergeModels as _t, useModel as An, onMounted as Bn } from "vue";
2
+ import { useI18n as ve, useCoreStore as Kt } from "@feedmepos/mf-common";
3
+ import { useDialog as Xt } from "@feedmepos/ui-library";
4
+ function Zt(e, t) {
5
+ return function() {
6
+ return e.apply(t, arguments);
7
+ };
8
+ }
9
+ const { toString: Dn } = Object.prototype, { getPrototypeOf: Ce } = Object, { iterator: Le, toStringTag: Qt } = Symbol, Ke = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Ne = (e, t) => {
10
+ let n = e;
11
+ const a = [];
12
+ for (; n != null && n !== Object.prototype; ) {
13
+ if (a.indexOf(n) !== -1)
14
+ return !1;
15
+ if (a.push(n), Ke(n, t))
16
+ return !0;
17
+ n = Ce(n);
18
+ }
19
+ return !1;
20
+ }, Fn = (e, t) => e != null && Ne(e, t) ? e[t] : void 0, bt = ((e) => (t) => {
21
+ const n = Dn.call(t);
22
+ return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
23
+ })(/* @__PURE__ */ Object.create(null)), oe = (e) => (e = e.toLowerCase(), (t) => bt(t) === e), Ye = (e) => (t) => typeof t === e, { isArray: Re } = Array, _e = Ye("undefined");
24
+ function Ae(e) {
25
+ return e !== null && !_e(e) && e.constructor !== null && !_e(e.constructor) && Q(e.constructor.isBuffer) && e.constructor.isBuffer(e);
26
+ }
27
+ const Yt = oe("ArrayBuffer");
28
+ function Nn(e) {
29
+ let t;
30
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Yt(e.buffer), t;
31
+ }
32
+ const Ln = Ye("string"), Q = Ye("function"), en = Ye("number"), Be = (e) => e !== null && typeof e == "object", Un = (e) => e === !0 || e === !1, Ge = (e) => {
33
+ if (!Be(e))
34
+ return !1;
35
+ const t = Ce(e);
36
+ return (t === null || t === Object.prototype || Ce(t) === null) && // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
37
+ // Symbol.iterator as evidence the value is a tagged/iterable type rather
38
+ // than a plain object, while ignoring keys injected onto Object.prototype.
39
+ !Ne(e, Qt) && !Ne(e, Le);
40
+ }, jn = (e) => {
41
+ if (!Be(e) || Ae(e))
42
+ return !1;
43
+ try {
44
+ return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
45
+ } catch {
46
+ return !1;
47
+ }
48
+ }, In = oe("Date"), Mn = oe("File"), zn = (e) => !!(e && typeof e.uri < "u"), Vn = (e) => e && typeof e.getParts < "u", qn = oe("Blob"), $n = oe("FileList"), Gn = (e) => Be(e) && Q(e.pipe);
49
+ function Hn() {
50
+ return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
51
+ }
52
+ const At = Hn(), Bt = typeof At.FormData < "u" ? At.FormData : void 0, Jn = (e) => {
53
+ if (!e)
54
+ return !1;
55
+ if (Bt && e instanceof Bt)
56
+ return !0;
57
+ const t = Ce(e);
58
+ if (!t || t === Object.prototype || !Q(e.append))
59
+ return !1;
60
+ const n = bt(e);
61
+ return n === "formdata" || // detect form-data instance
62
+ n === "object" && Q(e.toString) && e.toString() === "[object FormData]";
63
+ }, Wn = oe("URLSearchParams"), [Kn, Xn, Zn, Qn] = [
64
+ "ReadableStream",
65
+ "Request",
66
+ "Response",
67
+ "Headers"
68
+ ].map(oe), Yn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
69
+ function Ue(e, t, { allOwnKeys: n = !1 } = {}) {
70
+ if (e === null || typeof e > "u")
71
+ return;
72
+ let a, r;
73
+ if (typeof e != "object" && (e = [e]), Re(e))
74
+ for (a = 0, r = e.length; a < r; a++)
75
+ t.call(null, e[a], a, e);
76
+ else {
77
+ if (Ae(e))
78
+ return;
79
+ const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), s = o.length;
80
+ let i;
81
+ for (a = 0; a < s; a++)
82
+ i = o[a], t.call(null, e[i], i, e);
83
+ }
84
+ }
85
+ function tn(e, t) {
86
+ if (Ae(e))
87
+ return null;
88
+ t = t.toLowerCase();
89
+ const n = Object.keys(e);
90
+ let a = n.length, r;
91
+ for (; a-- > 0; )
92
+ if (r = n[a], t === r.toLowerCase())
93
+ return r;
94
+ return null;
95
+ }
96
+ const Ee = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), nn = (e) => !_e(e) && e !== Ee;
97
+ function dt(...e) {
98
+ const { caseless: t, skipUndefined: n } = nn(this) && this || {}, a = {}, r = (o, s) => {
99
+ if (s === "__proto__" || s === "constructor" || s === "prototype")
100
+ return;
101
+ const i = t && typeof s == "string" && tn(a, s) || s, u = Ke(a, i) ? a[i] : void 0;
102
+ Ge(u) && Ge(o) ? a[i] = dt(u, o) : Ge(o) ? a[i] = dt({}, o) : Re(o) ? a[i] = o.slice() : (!n || !_e(o)) && (a[i] = o);
103
+ };
104
+ for (let o = 0, s = e.length; o < s; o++) {
105
+ const i = e[o];
106
+ if (!i || Ae(i) || (Ue(i, r), typeof i != "object" || Re(i)))
107
+ continue;
108
+ const u = Object.getOwnPropertySymbols(i);
109
+ for (let f = 0; f < u.length; f++) {
110
+ const c = u[f];
111
+ da.call(i, c) && r(i[c], c);
112
+ }
113
+ }
114
+ return a;
115
+ }
116
+ const ea = (e, t, n, { allOwnKeys: a } = {}) => (Ue(
117
+ t,
118
+ (r, o) => {
119
+ n && Q(r) ? Object.defineProperty(e, o, {
120
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
121
+ // hijack defineProperty's accessor-vs-data resolution.
122
+ __proto__: null,
123
+ value: Zt(r, n),
124
+ writable: !0,
125
+ enumerable: !0,
126
+ configurable: !0
127
+ }) : Object.defineProperty(e, o, {
128
+ __proto__: null,
129
+ value: r,
130
+ writable: !0,
131
+ enumerable: !0,
132
+ configurable: !0
133
+ });
134
+ },
135
+ { allOwnKeys: a }
136
+ ), e), ta = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), na = (e, t, n, a) => {
137
+ e.prototype = Object.create(t.prototype, a), Object.defineProperty(e.prototype, "constructor", {
138
+ __proto__: null,
139
+ value: e,
140
+ writable: !0,
141
+ enumerable: !1,
142
+ configurable: !0
143
+ }), Object.defineProperty(e, "super", {
144
+ __proto__: null,
145
+ value: t.prototype
146
+ }), n && Object.assign(e.prototype, n);
147
+ }, aa = (e, t, n, a) => {
148
+ let r, o, s;
149
+ const i = {};
150
+ if (t = t || {}, e == null)
151
+ return t;
152
+ do {
153
+ for (r = Object.getOwnPropertyNames(e), o = r.length; o-- > 0; )
154
+ s = r[o], (!a || a(s, e, t)) && !i[s] && (t[s] = e[s], i[s] = !0);
155
+ e = n !== !1 && Ce(e);
156
+ } while (e && (!n || n(e, t)) && e !== Object.prototype);
157
+ return t;
158
+ }, ra = (e, t, n) => {
159
+ e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
160
+ const a = e.indexOf(t, n);
161
+ return a !== -1 && a === n;
162
+ }, oa = (e) => {
163
+ if (!e)
164
+ return null;
165
+ if (Re(e))
166
+ return e;
167
+ let t = e.length;
168
+ if (!en(t))
169
+ return null;
170
+ const n = new Array(t);
171
+ for (; t-- > 0; )
172
+ n[t] = e[t];
173
+ return n;
174
+ }, sa = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ce(Uint8Array)), ia = (e, t) => {
175
+ const n = (e && e[Le]).call(e);
176
+ let a;
177
+ for (; (a = n.next()) && !a.done; ) {
178
+ const r = a.value;
179
+ t.call(e, r[0], r[1]);
180
+ }
181
+ }, la = (e, t) => {
182
+ let n;
183
+ const a = [];
184
+ for (; (n = e.exec(t)) !== null; )
185
+ a.push(n);
186
+ return a;
187
+ }, ua = oe("HTMLFormElement"), ca = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(t, n, a) {
188
+ return n.toUpperCase() + a;
189
+ }), { propertyIsEnumerable: da } = Object.prototype, fa = oe("RegExp"), an = (e, t) => {
190
+ const n = Object.getOwnPropertyDescriptors(e), a = {};
191
+ Ue(n, (r, o) => {
192
+ let s;
193
+ (s = t(r, o, e)) !== !1 && (a[o] = s || r);
194
+ }), Object.defineProperties(e, a);
195
+ }, pa = (e) => {
196
+ an(e, (t, n) => {
197
+ if (Q(e) && ["arguments", "caller", "callee"].includes(n))
198
+ return !1;
199
+ const a = e[n];
200
+ if (Q(a)) {
201
+ if (t.enumerable = !1, "writable" in t) {
202
+ t.writable = !1;
203
+ return;
204
+ }
205
+ t.set || (t.set = () => {
206
+ throw Error("Can not rewrite read-only method '" + n + "'");
207
+ });
208
+ }
209
+ });
210
+ }, ma = (e, t) => {
211
+ const n = {}, a = (r) => {
212
+ r.forEach((o) => {
213
+ n[o] = !0;
214
+ });
215
+ };
216
+ return Re(e) ? a(e) : a(String(e).split(t)), n;
217
+ }, ga = () => {
218
+ }, ha = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
219
+ function ba(e) {
220
+ return !!(e && Q(e.append) && e[Qt] === "FormData" && e[Le]);
221
+ }
222
+ const ya = (e) => {
223
+ const t = /* @__PURE__ */ new WeakSet(), n = (a) => {
224
+ if (Be(a)) {
225
+ if (t.has(a))
226
+ return;
227
+ if (Ae(a))
228
+ return a;
229
+ if (!("toJSON" in a)) {
230
+ t.add(a);
231
+ const r = Re(a) ? [] : {};
232
+ return Ue(a, (o, s) => {
233
+ const i = n(o);
234
+ !_e(i) && (r[s] = i);
235
+ }), t.delete(a), r;
236
+ }
237
+ }
238
+ return a;
239
+ };
240
+ return n(e);
241
+ }, va = oe("AsyncFunction"), wa = (e) => e && (Be(e) || Q(e)) && Q(e.then) && Q(e.catch), rn = ((e, t) => e ? setImmediate : t ? ((n, a) => (Ee.addEventListener(
242
+ "message",
243
+ ({ source: r, data: o }) => {
244
+ r === Ee && o === n && a.length && a.shift()();
245
+ },
246
+ !1
247
+ ), (r) => {
248
+ a.push(r), Ee.postMessage(n, "*");
249
+ }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", Q(Ee.postMessage)), xa = typeof queueMicrotask < "u" ? queueMicrotask.bind(Ee) : typeof process < "u" && process.nextTick || rn, on = (e) => e != null && Q(e[Le]), ka = (e) => e != null && Ne(e, Le) && on(e), l = {
250
+ isArray: Re,
251
+ isArrayBuffer: Yt,
252
+ isBuffer: Ae,
253
+ isFormData: Jn,
254
+ isArrayBufferView: Nn,
255
+ isString: Ln,
256
+ isNumber: en,
257
+ isBoolean: Un,
258
+ isObject: Be,
259
+ isPlainObject: Ge,
260
+ isEmptyObject: jn,
261
+ isReadableStream: Kn,
262
+ isRequest: Xn,
263
+ isResponse: Zn,
264
+ isHeaders: Qn,
265
+ isUndefined: _e,
266
+ isDate: In,
267
+ isFile: Mn,
268
+ isReactNativeBlob: zn,
269
+ isReactNative: Vn,
270
+ isBlob: qn,
271
+ isRegExp: fa,
272
+ isFunction: Q,
273
+ isStream: Gn,
274
+ isURLSearchParams: Wn,
275
+ isTypedArray: sa,
276
+ isFileList: $n,
277
+ forEach: Ue,
278
+ merge: dt,
279
+ extend: ea,
280
+ trim: Yn,
281
+ stripBOM: ta,
282
+ inherits: na,
283
+ toFlatObject: aa,
284
+ kindOf: bt,
285
+ kindOfTest: oe,
286
+ endsWith: ra,
287
+ toArray: oa,
288
+ forEachEntry: ia,
289
+ matchAll: la,
290
+ isHTMLForm: ua,
291
+ hasOwnProperty: Ke,
292
+ hasOwnProp: Ke,
293
+ // an alias to avoid ESLint no-prototype-builtins detection
294
+ hasOwnInPrototypeChain: Ne,
295
+ getSafeProp: Fn,
296
+ reduceDescriptors: an,
297
+ freezeMethods: pa,
298
+ toObjectSet: ma,
299
+ toCamelCase: ca,
300
+ noop: ga,
301
+ toFiniteNumber: ha,
302
+ findKey: tn,
303
+ global: Ee,
304
+ isContextDefined: nn,
305
+ isSpecCompliantForm: ba,
306
+ toJSONObject: ya,
307
+ isAsyncFn: va,
308
+ isThenable: wa,
309
+ setImmediate: rn,
310
+ asap: xa,
311
+ isIterable: on,
312
+ isSafeIterable: ka
313
+ }, Sa = l.toObjectSet([
314
+ "age",
315
+ "authorization",
316
+ "content-length",
317
+ "content-type",
318
+ "etag",
319
+ "expires",
320
+ "from",
321
+ "host",
322
+ "if-modified-since",
323
+ "if-unmodified-since",
324
+ "last-modified",
325
+ "location",
326
+ "max-forwards",
327
+ "proxy-authorization",
328
+ "referer",
329
+ "retry-after",
330
+ "user-agent"
331
+ ]), Pa = (e) => {
332
+ const t = {};
333
+ let n, a, r;
334
+ return e && e.split(`
335
+ `).forEach(function(o) {
336
+ r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), a = o.substring(r + 1).trim(), !(!n || t[n] && Sa[n]) && (n === "set-cookie" ? t[n] ? t[n].push(a) : t[n] = [a] : t[n] = t[n] ? t[n] + ", " + a : a);
337
+ }), t;
338
+ };
339
+ function Ea(e) {
340
+ let t = 0, n = e.length;
341
+ for (; t < n; ) {
342
+ const a = e.charCodeAt(t);
343
+ if (a !== 9 && a !== 32)
344
+ break;
345
+ t += 1;
346
+ }
347
+ for (; n > t; ) {
348
+ const a = e.charCodeAt(n - 1);
349
+ if (a !== 9 && a !== 32)
350
+ break;
351
+ n -= 1;
352
+ }
353
+ return t === 0 && n === e.length ? e : e.slice(t, n);
354
+ }
355
+ const Ra = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g"), Ta = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
356
+ function yt(e, t) {
357
+ return l.isArray(e) ? e.map((n) => yt(n, t)) : Ea(String(e).replace(t, ""));
358
+ }
359
+ const Oa = (e) => yt(e, Ra), Ca = (e) => yt(e, Ta);
360
+ function sn(e) {
361
+ const t = /* @__PURE__ */ Object.create(null);
362
+ return l.forEach(e.toJSON(), (n, a) => {
363
+ t[a] = Ca(n);
364
+ }), t;
365
+ }
366
+ const Dt = Symbol("internals");
367
+ function Fe(e) {
368
+ return e && String(e).trim().toLowerCase();
369
+ }
370
+ function He(e) {
371
+ return e === !1 || e == null ? e : l.isArray(e) ? e.map(He) : Oa(String(e));
372
+ }
373
+ function _a(e) {
374
+ const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
375
+ let a;
376
+ for (; a = n.exec(e); )
377
+ t[a[1]] = a[2];
378
+ return t;
379
+ }
380
+ const Aa = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
381
+ function it(e, t, n, a, r) {
382
+ if (l.isFunction(a))
383
+ return a.call(this, t, n);
384
+ if (r && (t = n), !!l.isString(t)) {
385
+ if (l.isString(a))
386
+ return t.indexOf(a) !== -1;
387
+ if (l.isRegExp(a))
388
+ return a.test(t);
389
+ }
390
+ }
391
+ function Ba(e) {
392
+ return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, a) => n.toUpperCase() + a);
393
+ }
394
+ function Da(e, t) {
395
+ const n = l.toCamelCase(" " + t);
396
+ ["get", "set", "has"].forEach((a) => {
397
+ Object.defineProperty(e, a + n, {
398
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
399
+ // this data descriptor into an accessor descriptor on the way in.
400
+ __proto__: null,
401
+ value: function(r, o, s) {
402
+ return this[a].call(this, t, r, o, s);
403
+ },
404
+ configurable: !0
405
+ });
406
+ });
407
+ }
408
+ class et {
409
+ constructor(t) {
410
+ t && this.set(t);
411
+ }
412
+ set(t, n, a) {
413
+ const r = this;
414
+ function o(i, u, f) {
415
+ const c = Fe(u);
416
+ if (!c)
417
+ return;
418
+ const d = l.findKey(r, c);
419
+ (!d || r[d] === void 0 || f === !0 || f === void 0 && r[d] !== !1) && (r[d || u] = He(i));
420
+ }
421
+ const s = (i, u) => l.forEach(i, (f, c) => o(f, c, u));
422
+ if (l.isPlainObject(t) || t instanceof this.constructor)
423
+ s(t, n);
424
+ else if (l.isString(t) && (t = t.trim()) && !Aa(t))
425
+ s(Pa(t), n);
426
+ else if (l.isObject(t) && l.isSafeIterable(t)) {
427
+ let i = /* @__PURE__ */ Object.create(null), u, f;
428
+ for (const c of t) {
429
+ if (!l.isArray(c))
430
+ throw new TypeError("Object iterator must return a key-value pair");
431
+ f = c[0], l.hasOwnProp(i, f) ? (u = i[f], i[f] = l.isArray(u) ? [...u, c[1]] : [u, c[1]]) : i[f] = c[1];
432
+ }
433
+ s(i, n);
434
+ } else
435
+ t != null && o(n, t, a);
436
+ return this;
437
+ }
438
+ get(t, n) {
439
+ if (t = Fe(t), t) {
440
+ const a = l.findKey(this, t);
441
+ if (a) {
442
+ const r = this[a];
443
+ if (!n)
444
+ return r;
445
+ if (n === !0)
446
+ return _a(r);
447
+ if (l.isFunction(n))
448
+ return n.call(this, r, a);
449
+ if (l.isRegExp(n))
450
+ return n.exec(r);
451
+ throw new TypeError("parser must be boolean|regexp|function");
452
+ }
453
+ }
454
+ }
455
+ has(t, n) {
456
+ if (t = Fe(t), t) {
457
+ const a = l.findKey(this, t);
458
+ return !!(a && this[a] !== void 0 && (!n || it(this, this[a], a, n)));
459
+ }
460
+ return !1;
461
+ }
462
+ delete(t, n) {
463
+ const a = this;
464
+ let r = !1;
465
+ function o(s) {
466
+ if (s = Fe(s), s) {
467
+ const i = l.findKey(a, s);
468
+ i && (!n || it(a, a[i], i, n)) && (delete a[i], r = !0);
469
+ }
470
+ }
471
+ return l.isArray(t) ? t.forEach(o) : o(t), r;
472
+ }
473
+ clear(t) {
474
+ const n = Object.keys(this);
475
+ let a = n.length, r = !1;
476
+ for (; a--; ) {
477
+ const o = n[a];
478
+ (!t || it(this, this[o], o, t, !0)) && (delete this[o], r = !0);
479
+ }
480
+ return r;
481
+ }
482
+ normalize(t) {
483
+ const n = this, a = {};
484
+ return l.forEach(this, (r, o) => {
485
+ const s = l.findKey(a, o);
486
+ if (s) {
487
+ n[s] = He(r), delete n[o];
488
+ return;
489
+ }
490
+ const i = t ? Ba(o) : String(o).trim();
491
+ i !== o && delete n[o], n[i] = He(r), a[i] = !0;
492
+ }), this;
493
+ }
494
+ concat(...t) {
495
+ return this.constructor.concat(this, ...t);
496
+ }
497
+ toJSON(t) {
498
+ const n = /* @__PURE__ */ Object.create(null);
499
+ return l.forEach(this, (a, r) => {
500
+ a != null && a !== !1 && (n[r] = t && l.isArray(a) ? a.join(", ") : a);
501
+ }), n;
502
+ }
503
+ [Symbol.iterator]() {
504
+ return Object.entries(this.toJSON())[Symbol.iterator]();
505
+ }
506
+ toString() {
507
+ return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
508
+ `);
509
+ }
510
+ getSetCookie() {
511
+ return this.get("set-cookie") || [];
512
+ }
513
+ get [Symbol.toStringTag]() {
514
+ return "AxiosHeaders";
515
+ }
516
+ static from(t) {
517
+ return t instanceof this ? t : new this(t);
518
+ }
519
+ static concat(t, ...n) {
520
+ const a = new this(t);
521
+ return n.forEach((r) => a.set(r)), a;
522
+ }
523
+ static accessor(t) {
524
+ const n = (this[Dt] = this[Dt] = {
525
+ accessors: {}
526
+ }).accessors, a = this.prototype;
527
+ function r(o) {
528
+ const s = Fe(o);
529
+ n[s] || (Da(a, o), n[s] = !0);
530
+ }
531
+ return l.isArray(t) ? t.forEach(r) : r(t), this;
532
+ }
533
+ }
534
+ et.accessor([
535
+ "Content-Type",
536
+ "Content-Length",
537
+ "Accept",
538
+ "Accept-Encoding",
539
+ "User-Agent",
540
+ "Authorization"
541
+ ]);
542
+ l.reduceDescriptors(et.prototype, ({ value: e }, t) => {
543
+ let n = t[0].toUpperCase() + t.slice(1);
544
+ return {
545
+ get: () => e,
546
+ set(a) {
547
+ this[n] = a;
548
+ }
549
+ };
550
+ });
551
+ l.freezeMethods(et);
552
+ const re = et, Fa = "[REDACTED ****]";
553
+ function Na(e) {
554
+ if (l.hasOwnProp(e, "toJSON"))
555
+ return !0;
556
+ let t = Object.getPrototypeOf(e);
557
+ for (; t && t !== Object.prototype; ) {
558
+ if (l.hasOwnProp(t, "toJSON"))
559
+ return !0;
560
+ t = Object.getPrototypeOf(t);
561
+ }
562
+ return !1;
563
+ }
564
+ function La(e, t) {
565
+ const n = new Set(t.map((o) => String(o).toLowerCase())), a = [], r = (o) => {
566
+ if (o === null || typeof o != "object" || l.isBuffer(o))
567
+ return o;
568
+ if (a.indexOf(o) !== -1)
569
+ return;
570
+ o instanceof re && (o = o.toJSON()), a.push(o);
571
+ let s;
572
+ if (l.isArray(o))
573
+ s = [], o.forEach((i, u) => {
574
+ const f = r(i);
575
+ l.isUndefined(f) || (s[u] = f);
576
+ });
577
+ else {
578
+ if (!l.isPlainObject(o) && Na(o))
579
+ return a.pop(), o;
580
+ s = /* @__PURE__ */ Object.create(null);
581
+ for (const [i, u] of Object.entries(o)) {
582
+ const f = n.has(i.toLowerCase()) ? Fa : r(u);
583
+ l.isUndefined(f) || (s[i] = f);
584
+ }
585
+ }
586
+ return a.pop(), s;
587
+ };
588
+ return r(e);
589
+ }
590
+ class J extends Error {
591
+ static from(t, n, a, r, o, s) {
592
+ const i = new J(t.message, n || t.code, a, r, o);
593
+ return Object.defineProperty(i, "cause", {
594
+ __proto__: null,
595
+ value: t,
596
+ writable: !0,
597
+ enumerable: !1,
598
+ configurable: !0
599
+ }), i.name = t.name, t.status != null && i.status == null && (i.status = t.status), s && Object.assign(i, s), i;
600
+ }
601
+ /**
602
+ * Create an Error with the specified message, config, error code, request and response.
603
+ *
604
+ * @param {string} message The error message.
605
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
606
+ * @param {Object} [config] The config.
607
+ * @param {Object} [request] The request.
608
+ * @param {Object} [response] The response.
609
+ *
610
+ * @returns {Error} The created error.
611
+ */
612
+ constructor(t, n, a, r, o) {
613
+ super(t), Object.defineProperty(this, "message", {
614
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
615
+ // this data descriptor into an accessor descriptor on the way in.
616
+ __proto__: null,
617
+ value: t,
618
+ enumerable: !0,
619
+ writable: !0,
620
+ configurable: !0
621
+ }), this.name = "AxiosError", this.isAxiosError = !0, n && (this.code = n), a && (this.config = a), r && (this.request = r), o && (this.response = o, this.status = o.status);
622
+ }
623
+ toJSON() {
624
+ const t = this.config, n = t && l.hasOwnProp(t, "redact") ? t.redact : void 0, a = l.isArray(n) && n.length > 0 ? La(t, n) : l.toJSONObject(t);
625
+ return {
626
+ // Standard
627
+ message: this.message,
628
+ name: this.name,
629
+ // Microsoft
630
+ description: this.description,
631
+ number: this.number,
632
+ // Mozilla
633
+ fileName: this.fileName,
634
+ lineNumber: this.lineNumber,
635
+ columnNumber: this.columnNumber,
636
+ stack: this.stack,
637
+ // Axios
638
+ config: a,
639
+ code: this.code,
640
+ status: this.status
641
+ };
642
+ }
643
+ }
644
+ J.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
645
+ J.ERR_BAD_OPTION = "ERR_BAD_OPTION";
646
+ J.ECONNABORTED = "ECONNABORTED";
647
+ J.ETIMEDOUT = "ETIMEDOUT";
648
+ J.ECONNREFUSED = "ECONNREFUSED";
649
+ J.ERR_NETWORK = "ERR_NETWORK";
650
+ J.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
651
+ J.ERR_DEPRECATED = "ERR_DEPRECATED";
652
+ J.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
653
+ J.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
654
+ J.ERR_CANCELED = "ERR_CANCELED";
655
+ J.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
656
+ J.ERR_INVALID_URL = "ERR_INVALID_URL";
657
+ J.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
658
+ const R = J, Ua = null, ln = 100;
659
+ function ft(e) {
660
+ return l.isPlainObject(e) || l.isArray(e);
661
+ }
662
+ function un(e) {
663
+ return l.endsWith(e, "[]") ? e.slice(0, -2) : e;
664
+ }
665
+ function lt(e, t, n) {
666
+ return e ? e.concat(t).map(function(a, r) {
667
+ return a = un(a), !n && r ? "[" + a + "]" : a;
668
+ }).join(n ? "." : "") : t;
669
+ }
670
+ function ja(e) {
671
+ return l.isArray(e) && !e.some(ft);
672
+ }
673
+ const Ia = l.toFlatObject(l, {}, null, function(e) {
674
+ return /^is[A-Z]/.test(e);
675
+ });
676
+ function tt(e, t, n) {
677
+ if (!l.isObject(e))
678
+ throw new TypeError("target must be an object");
679
+ t = t || new FormData(), n = l.toFlatObject(
680
+ n,
681
+ {
682
+ metaTokens: !0,
683
+ dots: !1,
684
+ indexes: !1
685
+ },
686
+ !1,
687
+ function(p, m) {
688
+ return !l.isUndefined(m[p]);
689
+ }
690
+ );
691
+ const a = n.metaTokens, r = n.visitor || w, o = n.dots, s = n.indexes, i = n.Blob || typeof Blob < "u" && Blob, u = n.maxDepth === void 0 ? ln : n.maxDepth, f = i && l.isSpecCompliantForm(t), c = [];
692
+ if (!l.isFunction(r))
693
+ throw new TypeError("visitor must be a function");
694
+ function d(p) {
695
+ if (p === null)
696
+ return "";
697
+ if (l.isDate(p))
698
+ return p.toISOString();
699
+ if (l.isBoolean(p))
700
+ return p.toString();
701
+ if (!f && l.isBlob(p))
702
+ throw new R("Blob is not supported. Use a Buffer instead.");
703
+ if (l.isArrayBuffer(p) || l.isTypedArray(p)) {
704
+ if (f && typeof i == "function")
705
+ return new i([p]);
706
+ if (typeof Buffer < "u")
707
+ return Buffer.from(p);
708
+ throw new R("Blob is not supported. Use a Buffer instead.", R.ERR_NOT_SUPPORT);
709
+ }
710
+ return p;
711
+ }
712
+ function b(p) {
713
+ if (p > u)
714
+ throw new R(
715
+ "Object is too deeply nested (" + p + " levels). Max depth: " + u,
716
+ R.ERR_FORM_DATA_DEPTH_EXCEEDED
717
+ );
718
+ }
719
+ function _(p, m) {
720
+ if (u === 1 / 0)
721
+ return JSON.stringify(p);
722
+ const P = [];
723
+ return JSON.stringify(p, function(x, k) {
724
+ if (!l.isObject(k))
725
+ return k;
726
+ for (; P.length && P[P.length - 1] !== this; )
727
+ P.pop();
728
+ return P.push(k), b(m + P.length - 1), k;
729
+ });
730
+ }
731
+ function w(p, m, P) {
732
+ let x = p;
733
+ if (l.isReactNative(t) && l.isReactNativeBlob(p))
734
+ return t.append(lt(P, m, o), d(p)), !1;
735
+ if (p && !P && typeof p == "object") {
736
+ if (l.endsWith(m, "{}"))
737
+ m = a ? m : m.slice(0, -2), p = _(p, 1);
738
+ else if (l.isArray(p) && ja(p) || (l.isFileList(p) || l.endsWith(m, "[]")) && (x = l.toArray(p)))
739
+ return m = un(m), x.forEach(function(k, g) {
740
+ !(l.isUndefined(k) || k === null) && t.append(
741
+ // eslint-disable-next-line no-nested-ternary
742
+ s === !0 ? lt([m], g, o) : s === null ? m : m + "[]",
743
+ d(k)
744
+ );
745
+ }), !1;
746
+ }
747
+ return ft(p) ? !0 : (t.append(lt(P, m, o), d(p)), !1);
748
+ }
749
+ const v = Object.assign(Ia, {
750
+ defaultVisitor: w,
751
+ convertValue: d,
752
+ isVisitable: ft
753
+ });
754
+ function y(p, m, P = 0) {
755
+ if (!l.isUndefined(p)) {
756
+ if (b(P), c.indexOf(p) !== -1)
757
+ throw new Error("Circular reference detected in " + m.join("."));
758
+ c.push(p), l.forEach(p, function(x, k) {
759
+ (!(l.isUndefined(x) || x === null) && r.call(t, x, l.isString(k) ? k.trim() : k, m, v)) === !0 && y(x, m ? m.concat(k) : [k], P + 1);
760
+ }), c.pop();
761
+ }
762
+ }
763
+ if (!l.isObject(e))
764
+ throw new TypeError("data must be an object");
765
+ return y(e), t;
766
+ }
767
+ function Ft(e) {
768
+ const t = {
769
+ "!": "%21",
770
+ "'": "%27",
771
+ "(": "%28",
772
+ ")": "%29",
773
+ "~": "%7E",
774
+ "%20": "+"
775
+ };
776
+ return encodeURIComponent(e).replace(/[!'()~]|%20/g, function(n) {
777
+ return t[n];
778
+ });
779
+ }
780
+ function vt(e, t) {
781
+ this._pairs = [], e && tt(e, this, t);
782
+ }
783
+ const cn = vt.prototype;
784
+ cn.append = function(e, t) {
785
+ this._pairs.push([e, t]);
786
+ };
787
+ cn.toString = function(e) {
788
+ const t = e ? (n) => e.call(this, n, Ft) : Ft;
789
+ return this._pairs.map(function(n) {
790
+ return t(n[0]) + "=" + t(n[1]);
791
+ }, "").join("&");
792
+ };
793
+ function Ma(e) {
794
+ return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
795
+ }
796
+ function dn(e, t, n) {
797
+ if (!t)
798
+ return e;
799
+ e = e || "";
800
+ const a = l.isFunction(n) ? {
801
+ serialize: n
802
+ } : n, r = l.getSafeProp(a, "encode") || Ma, o = l.getSafeProp(a, "serialize");
803
+ let s;
804
+ if (o ? s = o(t, a) : s = l.isURLSearchParams(t) ? t.toString() : new vt(t, a).toString(r), s) {
805
+ const i = e.indexOf("#");
806
+ i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
807
+ }
808
+ return e;
809
+ }
810
+ class za {
811
+ constructor() {
812
+ this.handlers = [];
813
+ }
814
+ /**
815
+ * Add a new interceptor to the stack
816
+ *
817
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
818
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
819
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
820
+ *
821
+ * @return {Number} An ID used to remove interceptor later
822
+ */
823
+ use(t, n, a) {
824
+ return this.handlers.push({
825
+ fulfilled: t,
826
+ rejected: n,
827
+ synchronous: a ? a.synchronous : !1,
828
+ runWhen: a ? a.runWhen : null
829
+ }), this.handlers.length - 1;
830
+ }
831
+ /**
832
+ * Remove an interceptor from the stack
833
+ *
834
+ * @param {Number} id The ID that was returned by `use`
835
+ *
836
+ * @returns {void}
837
+ */
838
+ eject(t) {
839
+ this.handlers[t] && (this.handlers[t] = null);
840
+ }
841
+ /**
842
+ * Clear all interceptors from the stack
843
+ *
844
+ * @returns {void}
845
+ */
846
+ clear() {
847
+ this.handlers && (this.handlers = []);
848
+ }
849
+ /**
850
+ * Iterate over all the registered interceptors
851
+ *
852
+ * This method is particularly useful for skipping over any
853
+ * interceptors that may have become `null` calling `eject`.
854
+ *
855
+ * @param {Function} fn The function to call for each interceptor
856
+ *
857
+ * @returns {void}
858
+ */
859
+ forEach(t) {
860
+ l.forEach(this.handlers, function(n) {
861
+ n !== null && t(n);
862
+ });
863
+ }
864
+ }
865
+ const Nt = za, wt = {
866
+ silentJSONParsing: !0,
867
+ forcedJSONParsing: !0,
868
+ clarifyTimeoutError: !1,
869
+ legacyInterceptorReqResOrdering: !0,
870
+ advertiseZstdAcceptEncoding: !1,
871
+ validateStatusUndefinedResolves: !0
872
+ }, Va = typeof URLSearchParams < "u" ? URLSearchParams : vt, qa = typeof FormData < "u" ? FormData : null, $a = typeof Blob < "u" ? Blob : null, Ga = {
873
+ isBrowser: !0,
874
+ classes: {
875
+ URLSearchParams: Va,
876
+ FormData: qa,
877
+ Blob: $a
878
+ },
879
+ protocols: ["http", "https", "file", "blob", "url", "data"]
880
+ }, xt = typeof window < "u" && typeof document < "u", pt = typeof navigator == "object" && navigator || void 0, Ha = xt && (!pt || ["ReactNative", "NativeScript", "NS"].indexOf(pt.product) < 0), Ja = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
881
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), Wa = xt && window.location.href || "http://localhost", Ka = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
882
+ __proto__: null,
883
+ hasBrowserEnv: xt,
884
+ hasStandardBrowserEnv: Ha,
885
+ hasStandardBrowserWebWorkerEnv: Ja,
886
+ navigator: pt,
887
+ origin: Wa
888
+ }, Symbol.toStringTag, { value: "Module" })), H = {
889
+ ...Ka,
890
+ ...Ga
891
+ };
892
+ function Xa(e, t) {
893
+ return tt(e, new H.classes.URLSearchParams(), {
894
+ visitor: function(n, a, r, o) {
895
+ return H.isNode && l.isBuffer(n) ? (this.append(a, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
896
+ },
897
+ ...t
898
+ });
899
+ }
900
+ const Lt = ln;
901
+ function fn(e) {
902
+ if (e > Lt)
903
+ throw new R(
904
+ "FormData field is too deeply nested (" + e + " levels). Max depth: " + Lt,
905
+ R.ERR_FORM_DATA_DEPTH_EXCEEDED
906
+ );
907
+ }
908
+ function Za(e) {
909
+ const t = [], n = /\w+|\[(\w*)]/g;
910
+ let a;
911
+ for (; (a = n.exec(e)) !== null; )
912
+ fn(t.length), t.push(a[0] === "[]" ? "" : a[1] || a[0]);
913
+ return t;
914
+ }
915
+ function Qa(e) {
916
+ const t = {}, n = Object.keys(e);
917
+ let a;
918
+ const r = n.length;
919
+ let o;
920
+ for (a = 0; a < r; a++)
921
+ o = n[a], t[o] = e[o];
922
+ return t;
923
+ }
924
+ function pn(e) {
925
+ function t(n, a, r, o) {
926
+ fn(o);
927
+ let s = n[o++];
928
+ if (s === "__proto__")
929
+ return !0;
930
+ const i = Number.isFinite(+s), u = o >= n.length;
931
+ return s = !s && l.isArray(r) ? r.length : s, u ? (l.hasOwnProp(r, s) ? r[s] = l.isArray(r[s]) ? r[s].concat(a) : [r[s], a] : r[s] = a, !i) : ((!l.hasOwnProp(r, s) || !l.isObject(r[s])) && (r[s] = []), t(n, a, r[s], o) && l.isArray(r[s]) && (r[s] = Qa(r[s])), !i);
932
+ }
933
+ if (l.isFormData(e) && l.isFunction(e.entries)) {
934
+ const n = {};
935
+ return l.forEachEntry(e, (a, r) => {
936
+ t(Za(a), r, n, 0);
937
+ }), n;
938
+ }
939
+ return null;
940
+ }
941
+ const Oe = (e, t) => e != null && l.hasOwnProp(e, t) ? e[t] : void 0;
942
+ function Ya(e, t, n) {
943
+ if (l.isString(e))
944
+ try {
945
+ return (t || JSON.parse)(e), l.trim(e);
946
+ } catch (a) {
947
+ if (a.name !== "SyntaxError")
948
+ throw a;
949
+ }
950
+ return (n || JSON.stringify)(e);
951
+ }
952
+ const kt = {
953
+ transitional: wt,
954
+ adapter: ["xhr", "http", "fetch"],
955
+ transformRequest: [
956
+ function(e, t) {
957
+ const n = t.getContentType() || "", a = n.indexOf("application/json") > -1, r = l.isObject(e);
958
+ if (r && l.isHTMLForm(e) && (e = new FormData(e)), l.isFormData(e))
959
+ return a ? JSON.stringify(pn(e)) : e;
960
+ if (l.isArrayBuffer(e) || l.isBuffer(e) || l.isStream(e) || l.isFile(e) || l.isBlob(e) || l.isReadableStream(e))
961
+ return e;
962
+ if (l.isArrayBufferView(e))
963
+ return e.buffer;
964
+ if (l.isURLSearchParams(e))
965
+ return t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
966
+ let o;
967
+ if (r) {
968
+ const s = Oe(this, "formSerializer");
969
+ if (n.indexOf("application/x-www-form-urlencoded") > -1)
970
+ return Xa(e, s).toString();
971
+ if ((o = l.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
972
+ const i = Oe(this, "env"), u = i && i.FormData;
973
+ return tt(
974
+ o ? { "files[]": e } : e,
975
+ u && new u(),
976
+ s
977
+ );
978
+ }
979
+ }
980
+ return r || a ? (t.setContentType("application/json", !1), Ya(e)) : e;
981
+ }
982
+ ],
983
+ transformResponse: [
984
+ function(e) {
985
+ const t = Oe(this, "transitional") || kt.transitional, n = t && t.forcedJSONParsing, a = Oe(this, "responseType"), r = a === "json";
986
+ if (l.isResponse(e) || l.isReadableStream(e))
987
+ return e;
988
+ if (e && l.isString(e) && (n && !a || r)) {
989
+ const o = !(t && t.silentJSONParsing) && r;
990
+ try {
991
+ return JSON.parse(e, Oe(this, "parseReviver"));
992
+ } catch (s) {
993
+ if (o)
994
+ throw s.name === "SyntaxError" ? R.from(s, R.ERR_BAD_RESPONSE, this, null, Oe(this, "response")) : s;
995
+ }
996
+ }
997
+ return e;
998
+ }
999
+ ],
1000
+ /**
1001
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
1002
+ * timeout is not created.
1003
+ */
1004
+ timeout: 0,
1005
+ xsrfCookieName: "XSRF-TOKEN",
1006
+ xsrfHeaderName: "X-XSRF-TOKEN",
1007
+ maxContentLength: -1,
1008
+ maxBodyLength: -1,
1009
+ env: {
1010
+ FormData: H.classes.FormData,
1011
+ Blob: H.classes.Blob
1012
+ },
1013
+ validateStatus: function(e) {
1014
+ return e >= 200 && e < 300;
1015
+ },
1016
+ headers: {
1017
+ common: {
1018
+ Accept: "application/json, text/plain, */*",
1019
+ "Content-Type": void 0
1020
+ }
1021
+ }
1022
+ };
1023
+ l.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (e) => {
1024
+ kt.headers[e] = {};
1025
+ });
1026
+ const St = kt;
1027
+ function ut(e, t) {
1028
+ const n = this || St, a = t || n, r = re.from(a.headers);
1029
+ let o = a.data;
1030
+ return l.forEach(e, function(s) {
1031
+ o = s.call(n, o, r.normalize(), t ? t.status : void 0);
1032
+ }), r.normalize(), o;
1033
+ }
1034
+ function mn(e) {
1035
+ return !!(e && e.__CANCEL__);
1036
+ }
1037
+ class er extends R {
1038
+ /**
1039
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
1040
+ *
1041
+ * @param {string=} message The message.
1042
+ * @param {Object=} config The config.
1043
+ * @param {Object=} request The request.
1044
+ *
1045
+ * @returns {CanceledError} The created error.
1046
+ */
1047
+ constructor(t, n, a) {
1048
+ super(t ?? "canceled", R.ERR_CANCELED, n, a), this.name = "CanceledError", this.__CANCEL__ = !0;
1049
+ }
1050
+ }
1051
+ const je = er;
1052
+ function gn(e, t, n) {
1053
+ const a = n.config.validateStatus;
1054
+ !n.status || !a || a(n.status) ? e(n) : t(new R(
1055
+ "Request failed with status code " + n.status,
1056
+ n.status >= 400 && n.status < 500 ? R.ERR_BAD_REQUEST : R.ERR_BAD_RESPONSE,
1057
+ n.config,
1058
+ n.request,
1059
+ n
1060
+ ));
1061
+ }
1062
+ function tr(e) {
1063
+ const t = /^([-+\w]{1,25}):(?:\/\/)?/.exec(e);
1064
+ return t && t[1] || "";
1065
+ }
1066
+ function nr(e, t) {
1067
+ e = e || 10;
1068
+ const n = new Array(e), a = new Array(e);
1069
+ let r = 0, o = 0, s;
1070
+ return t = t !== void 0 ? t : 1e3, function(i) {
1071
+ const u = Date.now(), f = a[o];
1072
+ s || (s = u), n[r] = i, a[r] = u;
1073
+ let c = o, d = 0;
1074
+ for (; c !== r; )
1075
+ d += n[c++], c = c % e;
1076
+ if (r = (r + 1) % e, r === o && (o = (o + 1) % e), u - s < t)
1077
+ return;
1078
+ const b = f && u - f;
1079
+ return b ? Math.round(d * 1e3 / b) : void 0;
1080
+ };
1081
+ }
1082
+ function ar(e, t) {
1083
+ let n = 0, a = 1e3 / t, r, o;
1084
+ const s = (i, u = Date.now()) => {
1085
+ n = u, r = null, o && (clearTimeout(o), o = null), e(...i);
1086
+ };
1087
+ return [(...i) => {
1088
+ const u = Date.now(), f = u - n;
1089
+ f >= a ? s(i, u) : (r = i, o || (o = setTimeout(() => {
1090
+ o = null, s(r);
1091
+ }, a - f)));
1092
+ }, () => r && s(r)];
1093
+ }
1094
+ const Xe = (e, t, n = 3) => {
1095
+ let a = 0;
1096
+ const r = nr(50, 250);
1097
+ return ar((o) => {
1098
+ if (!o || typeof o.loaded != "number")
1099
+ return;
1100
+ const s = o.loaded, i = o.lengthComputable ? o.total : void 0, u = i != null ? Math.min(s, i) : s, f = Math.max(0, u - a), c = r(f);
1101
+ a = Math.max(a, u);
1102
+ const d = {
1103
+ loaded: u,
1104
+ total: i,
1105
+ progress: i ? u / i : void 0,
1106
+ bytes: f,
1107
+ rate: c || void 0,
1108
+ estimated: c && i ? (i - u) / c : void 0,
1109
+ event: o,
1110
+ lengthComputable: i != null,
1111
+ [t ? "download" : "upload"]: !0
1112
+ };
1113
+ e(d);
1114
+ }, n);
1115
+ }, Ut = (e, t) => {
1116
+ const n = e != null;
1117
+ return [
1118
+ (a) => t[0]({
1119
+ lengthComputable: n,
1120
+ total: e,
1121
+ loaded: a
1122
+ }),
1123
+ t[1]
1124
+ ];
1125
+ }, jt = (e) => (...t) => l.asap(() => e(...t)), rr = H.hasStandardBrowserEnv ? ((e, t) => (n) => (n = new URL(n, H.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1126
+ new URL(H.origin),
1127
+ H.navigator && /(msie|trident)/i.test(H.navigator.userAgent)
1128
+ ) : () => !0, or = H.hasStandardBrowserEnv ? (
1129
+ // Standard browser envs support document.cookie
1130
+ {
1131
+ write(e, t, n, a, r, o, s) {
1132
+ if (typeof document > "u")
1133
+ return;
1134
+ const i = [`${e}=${encodeURIComponent(t)}`];
1135
+ l.isNumber(n) && i.push(`expires=${new Date(n).toUTCString()}`), l.isString(a) && i.push(`path=${a}`), l.isString(r) && i.push(`domain=${r}`), o === !0 && i.push("secure"), l.isString(s) && i.push(`SameSite=${s}`), document.cookie = i.join("; ");
1136
+ },
1137
+ read(e) {
1138
+ if (typeof document > "u")
1139
+ return null;
1140
+ const t = document.cookie.split(";");
1141
+ for (let n = 0; n < t.length; n++) {
1142
+ const a = t[n].replace(/^\s+/, ""), r = a.indexOf("=");
1143
+ if (r !== -1 && a.slice(0, r) === e)
1144
+ try {
1145
+ return decodeURIComponent(a.slice(r + 1));
1146
+ } catch {
1147
+ return a.slice(r + 1);
1148
+ }
1149
+ }
1150
+ return null;
1151
+ },
1152
+ remove(e) {
1153
+ this.write(e, "", Date.now() - 864e5, "/");
1154
+ }
1155
+ }
1156
+ ) : (
1157
+ // Non-standard browser env (web workers, react-native) lack needed support.
1158
+ {
1159
+ write() {
1160
+ },
1161
+ read() {
1162
+ return null;
1163
+ },
1164
+ remove() {
1165
+ }
1166
+ }
1167
+ );
1168
+ function sr(e) {
1169
+ return typeof e != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1170
+ }
1171
+ function ir(e, t) {
1172
+ return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1173
+ }
1174
+ const lr = /^https?:(?!\/\/)/i, ur = /[\t\n\r]/g;
1175
+ function cr(e) {
1176
+ let t = 0;
1177
+ for (; t < e.length && e.charCodeAt(t) <= 32; )
1178
+ t++;
1179
+ return e.slice(t);
1180
+ }
1181
+ function dr(e) {
1182
+ return cr(e).replace(ur, "");
1183
+ }
1184
+ function It(e, t) {
1185
+ if (typeof e == "string" && lr.test(dr(e)))
1186
+ throw new R(
1187
+ 'Invalid URL: missing "//" after protocol',
1188
+ R.ERR_INVALID_URL,
1189
+ t
1190
+ );
1191
+ }
1192
+ function hn(e, t, n, a) {
1193
+ It(t, a);
1194
+ let r = !sr(t);
1195
+ return e && (r || n === !1) ? (It(e, a), ir(e, t)) : t;
1196
+ }
1197
+ const Mt = (e) => e instanceof re ? { ...e } : e;
1198
+ function Te(e, t) {
1199
+ e = e || {}, t = t || {};
1200
+ const n = /* @__PURE__ */ Object.create(null);
1201
+ Object.defineProperty(n, "hasOwnProperty", {
1202
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
1203
+ // this data descriptor into an accessor descriptor on the way in.
1204
+ __proto__: null,
1205
+ value: Object.prototype.hasOwnProperty,
1206
+ enumerable: !1,
1207
+ writable: !0,
1208
+ configurable: !0
1209
+ });
1210
+ function a(c, d, b, _) {
1211
+ return l.isPlainObject(c) && l.isPlainObject(d) ? l.merge.call({ caseless: _ }, c, d) : l.isPlainObject(d) ? l.merge({}, d) : l.isArray(d) ? d.slice() : d;
1212
+ }
1213
+ function r(c, d, b, _) {
1214
+ if (l.isUndefined(d)) {
1215
+ if (!l.isUndefined(c))
1216
+ return a(void 0, c, b, _);
1217
+ } else
1218
+ return a(c, d, b, _);
1219
+ }
1220
+ function o(c, d) {
1221
+ if (!l.isUndefined(d))
1222
+ return a(void 0, d);
1223
+ }
1224
+ function s(c, d) {
1225
+ if (l.isUndefined(d)) {
1226
+ if (!l.isUndefined(c))
1227
+ return a(void 0, c);
1228
+ } else
1229
+ return a(void 0, d);
1230
+ }
1231
+ function i(c) {
1232
+ const d = l.hasOwnProp(t, "transitional") ? t.transitional : void 0;
1233
+ if (!l.isUndefined(d))
1234
+ if (l.isPlainObject(d)) {
1235
+ if (l.hasOwnProp(d, c))
1236
+ return d[c];
1237
+ } else
1238
+ return;
1239
+ const b = l.hasOwnProp(e, "transitional") ? e.transitional : void 0;
1240
+ if (l.isPlainObject(b) && l.hasOwnProp(b, c))
1241
+ return b[c];
1242
+ }
1243
+ function u(c, d, b) {
1244
+ if (l.hasOwnProp(t, b))
1245
+ return a(c, d);
1246
+ if (l.hasOwnProp(e, b))
1247
+ return a(void 0, c);
1248
+ }
1249
+ const f = {
1250
+ url: o,
1251
+ method: o,
1252
+ data: o,
1253
+ baseURL: s,
1254
+ transformRequest: s,
1255
+ transformResponse: s,
1256
+ paramsSerializer: s,
1257
+ timeout: s,
1258
+ timeoutMessage: s,
1259
+ withCredentials: s,
1260
+ withXSRFToken: s,
1261
+ adapter: s,
1262
+ responseType: s,
1263
+ xsrfCookieName: s,
1264
+ xsrfHeaderName: s,
1265
+ onUploadProgress: s,
1266
+ onDownloadProgress: s,
1267
+ decompress: s,
1268
+ maxContentLength: s,
1269
+ maxBodyLength: s,
1270
+ beforeRedirect: s,
1271
+ transport: s,
1272
+ httpAgent: s,
1273
+ httpsAgent: s,
1274
+ cancelToken: s,
1275
+ socketPath: s,
1276
+ allowedSocketPaths: s,
1277
+ responseEncoding: s,
1278
+ validateStatus: u,
1279
+ headers: (c, d, b) => r(Mt(c), Mt(d), b, !0)
1280
+ };
1281
+ return l.forEach(Object.keys({ ...e, ...t }), function(c) {
1282
+ if (c === "__proto__" || c === "constructor" || c === "prototype")
1283
+ return;
1284
+ const d = l.hasOwnProp(f, c) ? f[c] : r, b = l.hasOwnProp(e, c) ? e[c] : void 0, _ = l.hasOwnProp(t, c) ? t[c] : void 0, w = d(b, _, c);
1285
+ l.isUndefined(w) && d !== u || (n[c] = w);
1286
+ }), l.hasOwnProp(t, "validateStatus") && l.isUndefined(t.validateStatus) && i("validateStatusUndefinedResolves") === !1 && (l.hasOwnProp(e, "validateStatus") ? n.validateStatus = a(void 0, e.validateStatus) : delete n.validateStatus), n;
1287
+ }
1288
+ const fr = ["content-type", "content-length"];
1289
+ function pr(e, t, n) {
1290
+ if (n !== "content-only") {
1291
+ e.set(t);
1292
+ return;
1293
+ }
1294
+ Object.entries(t || {}).forEach(([a, r]) => {
1295
+ fr.includes(a.toLowerCase()) && e.set(a, r);
1296
+ });
1297
+ }
1298
+ const mr = (e) => encodeURIComponent(e).replace(
1299
+ /%([0-9A-F]{2})/gi,
1300
+ (t, n) => String.fromCharCode(parseInt(n, 16))
1301
+ );
1302
+ function bn(e) {
1303
+ const t = Te({}, e), n = (b) => l.hasOwnProp(t, b) ? t[b] : void 0, a = n("data");
1304
+ let r = n("withXSRFToken");
1305
+ const o = n("xsrfHeaderName"), s = n("xsrfCookieName");
1306
+ let i = n("headers");
1307
+ const u = n("auth"), f = n("baseURL"), c = n("allowAbsoluteUrls"), d = n("url");
1308
+ if (t.headers = i = re.from(i), t.url = dn(
1309
+ hn(f, d, c, t),
1310
+ n("params"),
1311
+ n("paramsSerializer")
1312
+ ), u) {
1313
+ const b = l.getSafeProp(u, "username") || "", _ = l.getSafeProp(u, "password") || "";
1314
+ try {
1315
+ i.set(
1316
+ "Authorization",
1317
+ "Basic " + btoa(b + ":" + (_ ? mr(_) : ""))
1318
+ );
1319
+ } catch (w) {
1320
+ throw R.from(w, R.ERR_BAD_OPTION_VALUE, e);
1321
+ }
1322
+ }
1323
+ if (l.isFormData(a) && (H.hasStandardBrowserEnv || H.hasStandardBrowserWebWorkerEnv || l.isReactNative(a) ? i.setContentType(void 0) : l.isFunction(a.getHeaders) && pr(i, a.getHeaders(), n("formDataHeaderPolicy"))), H.hasStandardBrowserEnv && (l.isFunction(r) && (r = r(t)), r === !0 || r == null && rr(t.url))) {
1324
+ const b = o && s && or.read(s);
1325
+ b && i.set(o, b);
1326
+ }
1327
+ return t;
1328
+ }
1329
+ const gr = typeof XMLHttpRequest < "u", hr = gr && function(e) {
1330
+ return new Promise(function(t, n) {
1331
+ const a = bn(e);
1332
+ let r = a.data;
1333
+ const o = re.from(a.headers).normalize();
1334
+ let { responseType: s, onUploadProgress: i, onDownloadProgress: u } = a, f, c, d, b, _;
1335
+ function w() {
1336
+ b && b(), _ && _(), a.cancelToken && a.cancelToken.unsubscribe(f), a.signal && a.signal.removeEventListener("abort", f);
1337
+ }
1338
+ let v = new XMLHttpRequest();
1339
+ v.open(a.method.toUpperCase(), a.url, !0), v.timeout = a.timeout;
1340
+ function y() {
1341
+ if (!v)
1342
+ return;
1343
+ const m = re.from(
1344
+ "getAllResponseHeaders" in v && v.getAllResponseHeaders()
1345
+ ), P = {
1346
+ data: !s || s === "text" || s === "json" ? v.responseText : v.response,
1347
+ status: v.status,
1348
+ statusText: v.statusText,
1349
+ headers: m,
1350
+ config: e,
1351
+ request: v
1352
+ };
1353
+ gn(
1354
+ function(x) {
1355
+ t(x), w();
1356
+ },
1357
+ function(x) {
1358
+ n(x), w();
1359
+ },
1360
+ P
1361
+ ), v = null;
1362
+ }
1363
+ "onloadend" in v ? v.onloadend = y : v.onreadystatechange = function() {
1364
+ !v || v.readyState !== 4 || v.status === 0 && !(v.responseURL && v.responseURL.startsWith("file:")) || setTimeout(y);
1365
+ }, v.onabort = function() {
1366
+ v && (n(new R("Request aborted", R.ECONNABORTED, e, v)), w(), v = null);
1367
+ }, v.onerror = function(m) {
1368
+ const P = m && m.message ? m.message : "Network Error", x = new R(P, R.ERR_NETWORK, e, v);
1369
+ x.event = m || null, n(x), w(), v = null;
1370
+ }, v.ontimeout = function() {
1371
+ let m = a.timeout ? "timeout of " + a.timeout + "ms exceeded" : "timeout exceeded";
1372
+ const P = a.transitional || wt;
1373
+ a.timeoutErrorMessage && (m = a.timeoutErrorMessage), n(
1374
+ new R(
1375
+ m,
1376
+ P.clarifyTimeoutError ? R.ETIMEDOUT : R.ECONNABORTED,
1377
+ e,
1378
+ v
1379
+ )
1380
+ ), w(), v = null;
1381
+ }, r === void 0 && o.setContentType(null), "setRequestHeader" in v && l.forEach(sn(o), function(m, P) {
1382
+ v.setRequestHeader(P, m);
1383
+ }), l.isUndefined(a.withCredentials) || (v.withCredentials = !!a.withCredentials), s && s !== "json" && (v.responseType = a.responseType), u && ([d, _] = Xe(u, !0), v.addEventListener("progress", d)), i && v.upload && ([c, b] = Xe(i), v.upload.addEventListener("progress", c), v.upload.addEventListener("loadend", b)), (a.cancelToken || a.signal) && (f = (m) => {
1384
+ v && (n(!m || m.type ? new je(null, e, v) : m), v.abort(), w(), v = null);
1385
+ }, a.cancelToken && a.cancelToken.subscribe(f), a.signal && (a.signal.aborted ? f() : a.signal.addEventListener("abort", f)));
1386
+ const p = tr(a.url);
1387
+ if (p && !H.protocols.includes(p)) {
1388
+ n(
1389
+ new R(
1390
+ "Unsupported protocol " + p + ":",
1391
+ R.ERR_BAD_REQUEST,
1392
+ e
1393
+ )
1394
+ ), w();
1395
+ return;
1396
+ }
1397
+ v.send(r || null);
1398
+ });
1399
+ }, br = (e, t) => {
1400
+ if (e = e ? e.filter(Boolean) : [], !t && !e.length)
1401
+ return;
1402
+ const n = new AbortController();
1403
+ let a = !1;
1404
+ const r = function(u) {
1405
+ if (!a) {
1406
+ a = !0, s();
1407
+ const f = u instanceof Error ? u : this.reason;
1408
+ n.abort(
1409
+ f instanceof R ? f : new je(f instanceof Error ? f.message : f)
1410
+ );
1411
+ }
1412
+ };
1413
+ let o = t && setTimeout(() => {
1414
+ o = null, r(new R(`timeout of ${t}ms exceeded`, R.ETIMEDOUT));
1415
+ }, t);
1416
+ const s = () => {
1417
+ e && (o && clearTimeout(o), o = null, e.forEach((u) => {
1418
+ u.unsubscribe ? u.unsubscribe(r) : u.removeEventListener("abort", r);
1419
+ }), e = null);
1420
+ };
1421
+ e.forEach((u) => u.addEventListener("abort", r, { once: !0 }));
1422
+ const { signal: i } = n;
1423
+ return i.unsubscribe = () => l.asap(s), i;
1424
+ }, yr = br, vr = function* (e, t) {
1425
+ let n = e.byteLength;
1426
+ if (!t || n < t) {
1427
+ yield e;
1428
+ return;
1429
+ }
1430
+ let a = 0, r;
1431
+ for (; a < n; )
1432
+ r = a + t, yield e.slice(a, r), a = r;
1433
+ }, wr = async function* (e, t) {
1434
+ for await (const n of xr(e))
1435
+ yield* vr(n, t);
1436
+ }, xr = async function* (e) {
1437
+ if (e[Symbol.asyncIterator]) {
1438
+ yield* e;
1439
+ return;
1440
+ }
1441
+ const t = e.getReader();
1442
+ try {
1443
+ for (; ; ) {
1444
+ const { done: n, value: a } = await t.read();
1445
+ if (n)
1446
+ break;
1447
+ yield a;
1448
+ }
1449
+ } finally {
1450
+ await t.cancel();
1451
+ }
1452
+ }, zt = (e, t, n, a) => {
1453
+ const r = wr(e, t);
1454
+ let o = 0, s, i = (u) => {
1455
+ s || (s = !0, a && a(u));
1456
+ };
1457
+ return new ReadableStream(
1458
+ {
1459
+ async pull(u) {
1460
+ try {
1461
+ const { done: f, value: c } = await r.next();
1462
+ if (f) {
1463
+ i(), u.close();
1464
+ return;
1465
+ }
1466
+ let d = c.byteLength;
1467
+ if (n) {
1468
+ let b = o += d;
1469
+ n(b);
1470
+ }
1471
+ u.enqueue(new Uint8Array(c));
1472
+ } catch (f) {
1473
+ throw i(f), f;
1474
+ }
1475
+ },
1476
+ cancel(u) {
1477
+ return i(u), r.return();
1478
+ }
1479
+ },
1480
+ {
1481
+ highWaterMark: 2
1482
+ }
1483
+ );
1484
+ }, Ze = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102, kr = (e, t, n) => t + 2 < n && Ze(e.charCodeAt(t + 1)) && Ze(e.charCodeAt(t + 2));
1485
+ function Sr(e) {
1486
+ if (!e || typeof e != "string" || !e.startsWith("data:"))
1487
+ return 0;
1488
+ const t = e.indexOf(",");
1489
+ if (t < 0)
1490
+ return 0;
1491
+ const n = e.slice(5, t), a = e.slice(t + 1);
1492
+ if (/;base64/i.test(n)) {
1493
+ let o = a.length;
1494
+ const s = a.length;
1495
+ for (let d = 0; d < s; d++)
1496
+ if (a.charCodeAt(d) === 37 && d + 2 < s) {
1497
+ const b = a.charCodeAt(d + 1), _ = a.charCodeAt(d + 2);
1498
+ Ze(b) && Ze(_) && (o -= 2, d += 2);
1499
+ }
1500
+ let i = 0, u = s - 1;
1501
+ const f = (d) => d >= 2 && a.charCodeAt(d - 2) === 37 && // '%'
1502
+ a.charCodeAt(d - 1) === 51 && // '3'
1503
+ (a.charCodeAt(d) === 68 || a.charCodeAt(d) === 100);
1504
+ u >= 0 && (a.charCodeAt(u) === 61 ? (i++, u--) : f(u) && (i++, u -= 3)), i === 1 && u >= 0 && (a.charCodeAt(u) === 61 || f(u)) && i++;
1505
+ const c = Math.floor(o / 4) * 3 - (i || 0);
1506
+ return c > 0 ? c : 0;
1507
+ }
1508
+ let r = 0;
1509
+ for (let o = 0, s = a.length; o < s; o++) {
1510
+ const i = a.charCodeAt(o);
1511
+ if (i === 37 && kr(a, o, s))
1512
+ r += 1, o += 2;
1513
+ else if (i < 128)
1514
+ r += 1;
1515
+ else if (i < 2048)
1516
+ r += 2;
1517
+ else if (i >= 55296 && i <= 56319 && o + 1 < s) {
1518
+ const u = a.charCodeAt(o + 1);
1519
+ u >= 56320 && u <= 57343 ? (r += 4, o++) : r += 3;
1520
+ } else
1521
+ r += 3;
1522
+ }
1523
+ return r;
1524
+ }
1525
+ const Pt = "1.18.1", Vt = 64 * 1024, { isFunction: $e } = l, Pr = (e) => encodeURIComponent(e).replace(
1526
+ /%([0-9A-F]{2})/gi,
1527
+ (t, n) => String.fromCharCode(parseInt(n, 16))
1528
+ ), qt = (e) => {
1529
+ if (!l.isString(e))
1530
+ return e;
1531
+ try {
1532
+ return decodeURIComponent(e);
1533
+ } catch {
1534
+ return e;
1535
+ }
1536
+ }, $t = (e, ...t) => {
1537
+ try {
1538
+ return !!e(...t);
1539
+ } catch {
1540
+ return !1;
1541
+ }
1542
+ }, Er = (e) => {
1543
+ const t = e.indexOf("://");
1544
+ let n = e;
1545
+ return t !== -1 && (n = n.slice(t + 3)), n.includes("@") || n.includes(":");
1546
+ }, Rr = (e) => {
1547
+ const t = l.global !== void 0 && l.global !== null ? l.global : globalThis, { ReadableStream: n, TextEncoder: a } = t;
1548
+ e = l.merge.call(
1549
+ {
1550
+ skipUndefined: !0
1551
+ },
1552
+ {
1553
+ Request: t.Request,
1554
+ Response: t.Response
1555
+ },
1556
+ e
1557
+ );
1558
+ const { fetch: r, Request: o, Response: s } = e, i = r ? $e(r) : typeof fetch == "function", u = $e(o), f = $e(s);
1559
+ if (!i)
1560
+ return !1;
1561
+ const c = i && $e(n), d = i && (typeof a == "function" ? ((p) => (m) => p.encode(m))(new a()) : async (p) => new Uint8Array(await new o(p).arrayBuffer())), b = u && c && $t(() => {
1562
+ let p = !1;
1563
+ const m = new o(H.origin, {
1564
+ body: new n(),
1565
+ method: "POST",
1566
+ get duplex() {
1567
+ return p = !0, "half";
1568
+ }
1569
+ }), P = m.headers.has("Content-Type");
1570
+ return m.body != null && m.body.cancel(), p && !P;
1571
+ }), _ = f && c && $t(() => l.isReadableStream(new s("").body)), w = {
1572
+ stream: _ && ((p) => p.body)
1573
+ };
1574
+ i && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((p) => {
1575
+ !w[p] && (w[p] = (m, P) => {
1576
+ let x = m && m[p];
1577
+ if (x)
1578
+ return x.call(m);
1579
+ throw new R(
1580
+ `Response type '${p}' is not supported`,
1581
+ R.ERR_NOT_SUPPORT,
1582
+ P
1583
+ );
1584
+ });
1585
+ });
1586
+ const v = async (p) => {
1587
+ if (p == null)
1588
+ return 0;
1589
+ if (l.isBlob(p))
1590
+ return p.size;
1591
+ if (l.isSpecCompliantForm(p))
1592
+ return (await new o(H.origin, {
1593
+ method: "POST",
1594
+ body: p
1595
+ }).arrayBuffer()).byteLength;
1596
+ if (l.isArrayBufferView(p) || l.isArrayBuffer(p))
1597
+ return p.byteLength;
1598
+ if (l.isURLSearchParams(p) && (p = p + ""), l.isString(p))
1599
+ return (await d(p)).byteLength;
1600
+ }, y = async (p, m) => l.toFiniteNumber(p.getContentLength()) ?? v(m);
1601
+ return async (p) => {
1602
+ let {
1603
+ url: m,
1604
+ method: P,
1605
+ data: x,
1606
+ signal: k,
1607
+ cancelToken: g,
1608
+ timeout: A,
1609
+ onDownloadProgress: Y,
1610
+ onUploadProgress: W,
1611
+ responseType: G,
1612
+ headers: j,
1613
+ withCredentials: z = "same-origin",
1614
+ fetchOptions: ue,
1615
+ maxContentLength: $,
1616
+ maxBodyLength: se
1617
+ } = bn(p);
1618
+ const X = l.isNumber($) && $ > -1, ce = l.isNumber(se) && se > -1, de = (L) => l.hasOwnProp(p, L) ? p[L] : void 0;
1619
+ let Me = r || fetch;
1620
+ G = G ? (G + "").toLowerCase() : "text";
1621
+ let ie = yr(
1622
+ [k, g && g.toAbortSignal()],
1623
+ A
1624
+ ), O = null;
1625
+ const B = ie && ie.unsubscribe && (() => {
1626
+ ie.unsubscribe();
1627
+ });
1628
+ let I, fe = null;
1629
+ const ze = () => new R(
1630
+ "Request body larger than maxBodyLength limit",
1631
+ R.ERR_BAD_REQUEST,
1632
+ p,
1633
+ O
1634
+ );
1635
+ try {
1636
+ let L;
1637
+ const U = de("auth");
1638
+ if (U) {
1639
+ const D = l.getSafeProp(U, "username") || "", ee = l.getSafeProp(U, "password") || "";
1640
+ L = {
1641
+ username: D,
1642
+ password: ee
1643
+ };
1644
+ }
1645
+ if (Er(m)) {
1646
+ const D = new URL(m, H.origin);
1647
+ if (!L && (D.username || D.password)) {
1648
+ const ee = qt(D.username), xe = qt(D.password);
1649
+ L = {
1650
+ username: ee,
1651
+ password: xe
1652
+ };
1653
+ }
1654
+ (D.username || D.password) && (D.username = "", D.password = "", m = D.href);
1655
+ }
1656
+ if (L && (j.delete("authorization"), j.set(
1657
+ "Authorization",
1658
+ "Basic " + btoa(Pr((L.username || "") + ":" + (L.password || "")))
1659
+ )), X && typeof m == "string" && m.startsWith("data:") && Sr(m) > $)
1660
+ throw new R(
1661
+ "maxContentLength size of " + $ + " exceeded",
1662
+ R.ERR_BAD_RESPONSE,
1663
+ p,
1664
+ O
1665
+ );
1666
+ if (ce && P !== "get" && P !== "head") {
1667
+ const D = await v(x);
1668
+ if (typeof D == "number" && isFinite(D) && (I = D, D > se))
1669
+ throw ze();
1670
+ }
1671
+ const Se = ce && (l.isReadableStream(x) || l.isStream(x)), Ve = (D, ee, xe) => zt(
1672
+ D,
1673
+ Vt,
1674
+ (Pe) => {
1675
+ if (ce && Pe > se)
1676
+ throw fe = ze();
1677
+ ee && ee(Pe);
1678
+ },
1679
+ xe
1680
+ );
1681
+ if (b && P !== "get" && P !== "head" && (W || Se)) {
1682
+ if (I = I ?? await y(j, x), I !== 0 || Se) {
1683
+ let D = new o(m, {
1684
+ method: "POST",
1685
+ body: x,
1686
+ duplex: "half"
1687
+ }), ee;
1688
+ if (l.isFormData(x) && (ee = D.headers.get("content-type")) && j.setContentType(ee), D.body) {
1689
+ const [xe, Pe] = W && Ut(
1690
+ I,
1691
+ Xe(jt(W))
1692
+ ) || [];
1693
+ x = Ve(D.body, xe, Pe);
1694
+ }
1695
+ }
1696
+ } else if (Se && !u && c && P !== "get" && P !== "head")
1697
+ x = Ve(x);
1698
+ else if (Se && u && !b && P !== "get" && P !== "head")
1699
+ throw new R(
1700
+ "Stream request bodies are not supported by the current fetch implementation",
1701
+ R.ERR_NOT_SUPPORT,
1702
+ p,
1703
+ O
1704
+ );
1705
+ l.isString(z) || (z = z ? "include" : "omit");
1706
+ const qe = u && "credentials" in o.prototype;
1707
+ if (l.isFormData(x)) {
1708
+ const D = j.getContentType();
1709
+ D && /^multipart\/form-data/i.test(D) && !/boundary=/i.test(D) && j.delete("content-type");
1710
+ }
1711
+ j.set("User-Agent", "axios/" + Pt, !1);
1712
+ const Tt = {
1713
+ ...ue,
1714
+ signal: ie,
1715
+ method: P.toUpperCase(),
1716
+ headers: sn(j.normalize()),
1717
+ body: x,
1718
+ duplex: "half",
1719
+ credentials: qe ? z : void 0
1720
+ };
1721
+ O = u && new o(m, Tt);
1722
+ let pe = await (u ? Me(O, ue) : Me(m, Tt));
1723
+ const Ot = re.from(pe.headers);
1724
+ if (X) {
1725
+ const D = l.toFiniteNumber(Ot.getContentLength());
1726
+ if (D != null && D > $)
1727
+ throw new R(
1728
+ "maxContentLength size of " + $ + " exceeded",
1729
+ R.ERR_BAD_RESPONSE,
1730
+ p,
1731
+ O
1732
+ );
1733
+ }
1734
+ const ot = _ && (G === "stream" || G === "response");
1735
+ if (_ && pe.body && (Y || X || ot && B)) {
1736
+ const D = {};
1737
+ ["status", "statusText", "headers"].forEach((De) => {
1738
+ D[De] = pe[De];
1739
+ });
1740
+ const ee = l.toFiniteNumber(Ot.getContentLength()), [xe, Pe] = Y && Ut(
1741
+ ee,
1742
+ Xe(jt(Y), !0)
1743
+ ) || [];
1744
+ let Ct = 0;
1745
+ const Rn = (De) => {
1746
+ if (X && (Ct = De, Ct > $))
1747
+ throw new R(
1748
+ "maxContentLength size of " + $ + " exceeded",
1749
+ R.ERR_BAD_RESPONSE,
1750
+ p,
1751
+ O
1752
+ );
1753
+ xe && xe(De);
1754
+ };
1755
+ pe = new s(
1756
+ zt(pe.body, Vt, Rn, () => {
1757
+ Pe && Pe(), B && B();
1758
+ }),
1759
+ D
1760
+ );
1761
+ }
1762
+ G = G || "text";
1763
+ let me = await w[l.findKey(w, G) || "text"](
1764
+ pe,
1765
+ p
1766
+ );
1767
+ if (X && !_ && !ot) {
1768
+ let D;
1769
+ if (me != null && (typeof me.byteLength == "number" ? D = me.byteLength : typeof me.size == "number" ? D = me.size : typeof me == "string" && (D = typeof a == "function" ? new a().encode(me).byteLength : me.length)), typeof D == "number" && D > $)
1770
+ throw new R(
1771
+ "maxContentLength size of " + $ + " exceeded",
1772
+ R.ERR_BAD_RESPONSE,
1773
+ p,
1774
+ O
1775
+ );
1776
+ }
1777
+ return !ot && B && B(), await new Promise((D, ee) => {
1778
+ gn(D, ee, {
1779
+ data: me,
1780
+ headers: re.from(pe.headers),
1781
+ status: pe.status,
1782
+ statusText: pe.statusText,
1783
+ config: p,
1784
+ request: O
1785
+ });
1786
+ });
1787
+ } catch (L) {
1788
+ if (B && B(), ie && ie.aborted && ie.reason instanceof R) {
1789
+ const U = ie.reason;
1790
+ throw U.config = p, O && (U.request = O), L !== U && Object.defineProperty(U, "cause", {
1791
+ __proto__: null,
1792
+ value: L,
1793
+ writable: !0,
1794
+ enumerable: !1,
1795
+ configurable: !0
1796
+ }), U;
1797
+ }
1798
+ if (fe)
1799
+ throw O && !fe.request && (fe.request = O), fe;
1800
+ if (L instanceof R)
1801
+ throw O && !L.request && (L.request = O), L;
1802
+ if (L && L.name === "TypeError" && /Load failed|fetch/i.test(L.message)) {
1803
+ const U = new R(
1804
+ "Network Error",
1805
+ R.ERR_NETWORK,
1806
+ p,
1807
+ O,
1808
+ L && L.response
1809
+ );
1810
+ throw Object.defineProperty(U, "cause", {
1811
+ __proto__: null,
1812
+ value: L.cause || L,
1813
+ writable: !0,
1814
+ enumerable: !1,
1815
+ configurable: !0
1816
+ }), U;
1817
+ }
1818
+ throw R.from(L, L && L.code, p, O, L && L.response);
1819
+ }
1820
+ };
1821
+ }, Tr = /* @__PURE__ */ new Map(), yn = (e) => {
1822
+ let t = e && e.env || {};
1823
+ const { fetch: n, Request: a, Response: r } = t, o = [a, r, n];
1824
+ let s = o.length, i = s, u, f, c = Tr;
1825
+ for (; i--; )
1826
+ u = o[i], f = c.get(u), f === void 0 && c.set(u, f = i ? /* @__PURE__ */ new Map() : Rr(t)), c = f;
1827
+ return f;
1828
+ };
1829
+ yn();
1830
+ const Et = {
1831
+ http: Ua,
1832
+ xhr: hr,
1833
+ fetch: {
1834
+ get: yn
1835
+ }
1836
+ };
1837
+ l.forEach(Et, (e, t) => {
1838
+ if (e) {
1839
+ try {
1840
+ Object.defineProperty(e, "name", { __proto__: null, value: t });
1841
+ } catch {
1842
+ }
1843
+ Object.defineProperty(e, "adapterName", { __proto__: null, value: t });
1844
+ }
1845
+ });
1846
+ const Gt = (e) => `- ${e}`, Or = (e) => l.isFunction(e) || e === null || e === !1;
1847
+ function Cr(e, t) {
1848
+ e = l.isArray(e) ? e : [e];
1849
+ const { length: n } = e;
1850
+ let a, r;
1851
+ const o = {};
1852
+ for (let s = 0; s < n; s++) {
1853
+ a = e[s];
1854
+ let i;
1855
+ if (r = a, !Or(a) && (r = Et[(i = String(a)).toLowerCase()], r === void 0))
1856
+ throw new R(`Unknown adapter '${i}'`);
1857
+ if (r && (l.isFunction(r) || (r = r.get(t))))
1858
+ break;
1859
+ o[i || "#" + s] = r;
1860
+ }
1861
+ if (!r) {
1862
+ const s = Object.entries(o).map(
1863
+ ([u, f]) => `adapter ${u} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
1864
+ );
1865
+ let i = n ? s.length > 1 ? `since :
1866
+ ` + s.map(Gt).join(`
1867
+ `) : " " + Gt(s[0]) : "as no adapter specified";
1868
+ throw new R(
1869
+ "There is no suitable adapter to dispatch the request " + i,
1870
+ R.ERR_NOT_SUPPORT
1871
+ );
1872
+ }
1873
+ return r;
1874
+ }
1875
+ const vn = {
1876
+ /**
1877
+ * Resolve an adapter from a list of adapter names or functions.
1878
+ * @type {Function}
1879
+ */
1880
+ getAdapter: Cr,
1881
+ /**
1882
+ * Exposes all known adapters
1883
+ * @type {Object<string, Function|Object>}
1884
+ */
1885
+ adapters: Et
1886
+ };
1887
+ function ct(e) {
1888
+ if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1889
+ throw new je(null, e);
1890
+ }
1891
+ function Ht(e) {
1892
+ return ct(e), e.headers = re.from(e.headers), e.data = ut.call(e, e.transformRequest), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), vn.getAdapter(e.adapter || St.adapter, e)(e).then(
1893
+ function(t) {
1894
+ ct(e), e.response = t;
1895
+ try {
1896
+ t.data = ut.call(e, e.transformResponse, t);
1897
+ } finally {
1898
+ delete e.response;
1899
+ }
1900
+ return t.headers = re.from(t.headers), t;
1901
+ },
1902
+ function(t) {
1903
+ if (!mn(t) && (ct(e), t && t.response)) {
1904
+ e.response = t.response;
1905
+ try {
1906
+ t.response.data = ut.call(
1907
+ e,
1908
+ e.transformResponse,
1909
+ t.response
1910
+ );
1911
+ } finally {
1912
+ delete e.response;
1913
+ }
1914
+ t.response.headers = re.from(t.response.headers);
1915
+ }
1916
+ return Promise.reject(t);
1917
+ }
1918
+ );
1919
+ }
1920
+ const nt = {};
1921
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1922
+ nt[e] = function(n) {
1923
+ return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
1924
+ };
1925
+ });
1926
+ const Jt = {};
1927
+ nt.transitional = function(e, t, n) {
1928
+ function a(r, o) {
1929
+ return "[Axios v" + Pt + "] Transitional option '" + r + "'" + o + (n ? ". " + n : "");
1930
+ }
1931
+ return (r, o, s) => {
1932
+ if (e === !1)
1933
+ throw new R(
1934
+ a(o, " has been removed" + (t ? " in " + t : "")),
1935
+ R.ERR_DEPRECATED
1936
+ );
1937
+ return t && !Jt[o] && (Jt[o] = !0, console.warn(
1938
+ a(
1939
+ o,
1940
+ " has been deprecated since v" + t + " and will be removed in the near future"
1941
+ )
1942
+ )), e ? e(r, o, s) : !0;
1943
+ };
1944
+ };
1945
+ nt.spelling = function(e) {
1946
+ return (t, n) => (console.warn(`${n} is likely a misspelling of ${e}`), !0);
1947
+ };
1948
+ function _r(e, t, n) {
1949
+ if (typeof e != "object" || e === null)
1950
+ throw new R("options must be an object", R.ERR_BAD_OPTION_VALUE);
1951
+ const a = Object.keys(e);
1952
+ let r = a.length;
1953
+ for (; r-- > 0; ) {
1954
+ const o = a[r], s = Object.prototype.hasOwnProperty.call(t, o) ? t[o] : void 0;
1955
+ if (s) {
1956
+ const i = e[o], u = i === void 0 || s(i, o, e);
1957
+ if (u !== !0)
1958
+ throw new R(
1959
+ "option " + o + " must be " + u,
1960
+ R.ERR_BAD_OPTION_VALUE
1961
+ );
1962
+ continue;
1963
+ }
1964
+ if (n !== !0)
1965
+ throw new R("Unknown option " + o, R.ERR_BAD_OPTION);
1966
+ }
1967
+ }
1968
+ const Je = {
1969
+ assertOptions: _r,
1970
+ validators: nt
1971
+ }, K = Je.validators;
1972
+ class Qe {
1973
+ constructor(t) {
1974
+ this.defaults = t || {}, this.interceptors = {
1975
+ request: new Nt(),
1976
+ response: new Nt()
1977
+ };
1978
+ }
1979
+ /**
1980
+ * Dispatch a request
1981
+ *
1982
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1983
+ * @param {?Object} config
1984
+ *
1985
+ * @returns {Promise} The Promise to be fulfilled
1986
+ */
1987
+ async request(t, n) {
1988
+ try {
1989
+ return await this._request(t, n);
1990
+ } catch (a) {
1991
+ if (a instanceof Error) {
1992
+ let r = {};
1993
+ Error.captureStackTrace ? Error.captureStackTrace(r) : r = new Error();
1994
+ const o = (() => {
1995
+ if (!r.stack)
1996
+ return "";
1997
+ const s = r.stack.indexOf(`
1998
+ `);
1999
+ return s === -1 ? "" : r.stack.slice(s + 1);
2000
+ })();
2001
+ try {
2002
+ if (!a.stack)
2003
+ a.stack = o;
2004
+ else if (o) {
2005
+ const s = o.indexOf(`
2006
+ `), i = s === -1 ? -1 : o.indexOf(`
2007
+ `, s + 1), u = i === -1 ? "" : o.slice(i + 1);
2008
+ String(a.stack).endsWith(u) || (a.stack += `
2009
+ ` + o);
2010
+ }
2011
+ } catch {
2012
+ }
2013
+ }
2014
+ throw a;
2015
+ }
2016
+ }
2017
+ _request(t, n) {
2018
+ typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = Te(this.defaults, n);
2019
+ const { transitional: a, paramsSerializer: r, headers: o } = n;
2020
+ a !== void 0 && Je.assertOptions(
2021
+ a,
2022
+ {
2023
+ silentJSONParsing: K.transitional(K.boolean),
2024
+ forcedJSONParsing: K.transitional(K.boolean),
2025
+ clarifyTimeoutError: K.transitional(K.boolean),
2026
+ legacyInterceptorReqResOrdering: K.transitional(K.boolean),
2027
+ advertiseZstdAcceptEncoding: K.transitional(K.boolean),
2028
+ validateStatusUndefinedResolves: K.transitional(K.boolean)
2029
+ },
2030
+ !1
2031
+ ), r != null && (l.isFunction(r) ? n.paramsSerializer = {
2032
+ serialize: r
2033
+ } : Je.assertOptions(
2034
+ r,
2035
+ {
2036
+ encode: K.function,
2037
+ serialize: K.function
2038
+ },
2039
+ !0
2040
+ )), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Je.assertOptions(
2041
+ n,
2042
+ {
2043
+ baseUrl: K.spelling("baseURL"),
2044
+ withXsrfToken: K.spelling("withXSRFToken")
2045
+ },
2046
+ !0
2047
+ ), n.method = (n.method || this.defaults.method || "get").toLowerCase();
2048
+ let s = o && l.merge(o.common, o[n.method]);
2049
+ o && l.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (w) => {
2050
+ delete o[w];
2051
+ }), n.headers = re.concat(s, o);
2052
+ const i = [];
2053
+ let u = !0;
2054
+ this.interceptors.request.forEach(function(w) {
2055
+ if (typeof w.runWhen == "function" && w.runWhen(n) === !1)
2056
+ return;
2057
+ u = u && w.synchronous;
2058
+ const v = n.transitional || wt;
2059
+ v && v.legacyInterceptorReqResOrdering ? i.unshift(w.fulfilled, w.rejected) : i.push(w.fulfilled, w.rejected);
2060
+ });
2061
+ const f = [];
2062
+ this.interceptors.response.forEach(function(w) {
2063
+ f.push(w.fulfilled, w.rejected);
2064
+ });
2065
+ let c, d = 0, b;
2066
+ if (!u) {
2067
+ const w = [Ht.bind(this), void 0];
2068
+ for (w.unshift(...i), w.push(...f), b = w.length, c = Promise.resolve(n); d < b; )
2069
+ c = c.then(w[d++], w[d++]);
2070
+ return c;
2071
+ }
2072
+ b = i.length;
2073
+ let _ = n;
2074
+ for (; d < b; ) {
2075
+ const w = i[d++], v = i[d++];
2076
+ try {
2077
+ _ = w(_);
2078
+ } catch (y) {
2079
+ v.call(this, y);
2080
+ break;
2081
+ }
2082
+ }
2083
+ try {
2084
+ c = Ht.call(this, _);
2085
+ } catch (w) {
2086
+ return Promise.reject(w);
2087
+ }
2088
+ for (d = 0, b = f.length; d < b; )
2089
+ c = c.then(f[d++], f[d++]);
2090
+ return c;
2091
+ }
2092
+ getUri(t) {
2093
+ t = Te(this.defaults, t);
2094
+ const n = hn(t.baseURL, t.url, t.allowAbsoluteUrls, t);
2095
+ return dn(n, t.params, t.paramsSerializer);
2096
+ }
2097
+ }
2098
+ l.forEach(["delete", "get", "head", "options"], function(e) {
2099
+ Qe.prototype[e] = function(t, n) {
2100
+ return this.request(
2101
+ Te(n || {}, {
2102
+ method: e,
2103
+ url: t,
2104
+ data: n && l.hasOwnProp(n, "data") ? n.data : void 0
2105
+ })
2106
+ );
2107
+ };
2108
+ });
2109
+ l.forEach(["post", "put", "patch", "query"], function(e) {
2110
+ function t(n) {
2111
+ return function(a, r, o) {
2112
+ return this.request(
2113
+ Te(o || {}, {
2114
+ method: e,
2115
+ headers: n ? {
2116
+ "Content-Type": "multipart/form-data"
2117
+ } : {},
2118
+ url: a,
2119
+ data: r
2120
+ })
2121
+ );
2122
+ };
2123
+ }
2124
+ Qe.prototype[e] = t(), e !== "query" && (Qe.prototype[e + "Form"] = t(!0));
2125
+ });
2126
+ const We = Qe;
2127
+ class Rt {
2128
+ constructor(t) {
2129
+ if (typeof t != "function")
2130
+ throw new TypeError("executor must be a function.");
2131
+ let n;
2132
+ this.promise = new Promise(function(r) {
2133
+ n = r;
2134
+ });
2135
+ const a = this;
2136
+ this.promise.then((r) => {
2137
+ if (!a._listeners)
2138
+ return;
2139
+ let o = a._listeners.length;
2140
+ for (; o-- > 0; )
2141
+ a._listeners[o](r);
2142
+ a._listeners = null;
2143
+ }), this.promise.then = (r) => {
2144
+ let o;
2145
+ const s = new Promise((i) => {
2146
+ a.subscribe(i), o = i;
2147
+ }).then(r);
2148
+ return s.cancel = function() {
2149
+ a.unsubscribe(o);
2150
+ }, s;
2151
+ }, t(function(r, o, s) {
2152
+ a.reason || (a.reason = new je(r, o, s), n(a.reason));
2153
+ });
2154
+ }
2155
+ /**
2156
+ * Throws a `CanceledError` if cancellation has been requested.
2157
+ */
2158
+ throwIfRequested() {
2159
+ if (this.reason)
2160
+ throw this.reason;
2161
+ }
2162
+ /**
2163
+ * Subscribe to the cancel signal
2164
+ */
2165
+ subscribe(t) {
2166
+ if (this.reason) {
2167
+ t(this.reason);
2168
+ return;
2169
+ }
2170
+ this._listeners ? this._listeners.push(t) : this._listeners = [t];
2171
+ }
2172
+ /**
2173
+ * Unsubscribe from the cancel signal
2174
+ */
2175
+ unsubscribe(t) {
2176
+ if (!this._listeners)
2177
+ return;
2178
+ const n = this._listeners.indexOf(t);
2179
+ n !== -1 && this._listeners.splice(n, 1);
2180
+ }
2181
+ toAbortSignal() {
2182
+ const t = new AbortController(), n = (a) => {
2183
+ t.abort(a);
2184
+ };
2185
+ return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
2186
+ }
2187
+ /**
2188
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
2189
+ * cancels the `CancelToken`.
2190
+ */
2191
+ static source() {
2192
+ let t;
2193
+ return {
2194
+ token: new Rt(function(n) {
2195
+ t = n;
2196
+ }),
2197
+ cancel: t
2198
+ };
2199
+ }
2200
+ }
2201
+ const Ar = Rt;
2202
+ function Br(e) {
2203
+ return function(t) {
2204
+ return e.apply(null, t);
2205
+ };
2206
+ }
2207
+ function Dr(e) {
2208
+ return l.isObject(e) && e.isAxiosError === !0;
2209
+ }
2210
+ const mt = {
2211
+ Continue: 100,
2212
+ SwitchingProtocols: 101,
2213
+ Processing: 102,
2214
+ EarlyHints: 103,
2215
+ Ok: 200,
2216
+ Created: 201,
2217
+ Accepted: 202,
2218
+ NonAuthoritativeInformation: 203,
2219
+ NoContent: 204,
2220
+ ResetContent: 205,
2221
+ PartialContent: 206,
2222
+ MultiStatus: 207,
2223
+ AlreadyReported: 208,
2224
+ ImUsed: 226,
2225
+ MultipleChoices: 300,
2226
+ MovedPermanently: 301,
2227
+ Found: 302,
2228
+ SeeOther: 303,
2229
+ NotModified: 304,
2230
+ UseProxy: 305,
2231
+ Unused: 306,
2232
+ TemporaryRedirect: 307,
2233
+ PermanentRedirect: 308,
2234
+ BadRequest: 400,
2235
+ Unauthorized: 401,
2236
+ PaymentRequired: 402,
2237
+ Forbidden: 403,
2238
+ NotFound: 404,
2239
+ MethodNotAllowed: 405,
2240
+ NotAcceptable: 406,
2241
+ ProxyAuthenticationRequired: 407,
2242
+ RequestTimeout: 408,
2243
+ Conflict: 409,
2244
+ Gone: 410,
2245
+ LengthRequired: 411,
2246
+ PreconditionFailed: 412,
2247
+ PayloadTooLarge: 413,
2248
+ UriTooLong: 414,
2249
+ UnsupportedMediaType: 415,
2250
+ RangeNotSatisfiable: 416,
2251
+ ExpectationFailed: 417,
2252
+ ImATeapot: 418,
2253
+ MisdirectedRequest: 421,
2254
+ UnprocessableEntity: 422,
2255
+ Locked: 423,
2256
+ FailedDependency: 424,
2257
+ TooEarly: 425,
2258
+ UpgradeRequired: 426,
2259
+ PreconditionRequired: 428,
2260
+ TooManyRequests: 429,
2261
+ RequestHeaderFieldsTooLarge: 431,
2262
+ UnavailableForLegalReasons: 451,
2263
+ InternalServerError: 500,
2264
+ NotImplemented: 501,
2265
+ BadGateway: 502,
2266
+ ServiceUnavailable: 503,
2267
+ GatewayTimeout: 504,
2268
+ HttpVersionNotSupported: 505,
2269
+ VariantAlsoNegotiates: 506,
2270
+ InsufficientStorage: 507,
2271
+ LoopDetected: 508,
2272
+ NotExtended: 510,
2273
+ NetworkAuthenticationRequired: 511,
2274
+ WebServerIsDown: 521,
2275
+ ConnectionTimedOut: 522,
2276
+ OriginIsUnreachable: 523,
2277
+ TimeoutOccurred: 524,
2278
+ SslHandshakeFailed: 525,
2279
+ InvalidSslCertificate: 526
2280
+ };
2281
+ Object.entries(mt).forEach(([e, t]) => {
2282
+ mt[t] = e;
2283
+ });
2284
+ const Fr = mt;
2285
+ function wn(e) {
2286
+ const t = new We(e), n = Zt(We.prototype.request, t);
2287
+ return l.extend(n, We.prototype, t, { allOwnKeys: !0 }), l.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(a) {
2288
+ return wn(Te(e, a));
2289
+ }, n;
2290
+ }
2291
+ const q = wn(St);
2292
+ q.Axios = We;
2293
+ q.CanceledError = je;
2294
+ q.CancelToken = Ar;
2295
+ q.isCancel = mn;
2296
+ q.VERSION = Pt;
2297
+ q.toFormData = tt;
2298
+ q.AxiosError = R;
2299
+ q.Cancel = q.CanceledError;
2300
+ q.all = function(e) {
2301
+ return Promise.all(e);
2302
+ };
2303
+ q.spread = Br;
2304
+ q.isAxiosError = Dr;
2305
+ q.mergeConfig = Te;
2306
+ q.AxiosHeaders = re;
2307
+ q.formToJSON = (e) => pn(l.isHTMLForm(e) ? new FormData(e) : e);
2308
+ q.getAdapter = vn.getAdapter;
2309
+ q.HttpStatusCode = Fr;
2310
+ q.default = q;
2311
+ const Nr = q;
2312
+ function Lr(e, t) {
2313
+ const n = t && t.toUpperCase() !== "MY" ? `.${t.toLowerCase()}` : "";
2314
+ return `https://portal-v2${e === "dev" ? "-dev" : ""}${n}.feedmeapi.com`;
2315
+ }
2316
+ function Ur(e, t) {
2317
+ return Lr(e, t);
2318
+ }
2319
+ const jr = ["1x1", "4x3", "16x9", "9x16"], gt = "asset";
2320
+ function Ir(e) {
2321
+ return e.some((t) => t.status === "pending");
2322
+ }
2323
+ function Mr(e) {
2324
+ if (e.length === 0)
2325
+ return null;
2326
+ const t = e.filter((n) => n.status === "active").length;
2327
+ return { tone: e.some((n) => n.status === "pending") ? "progress" : e.some((n) => n.status === "failed") ? "warning" : "done", active: t, total: e.length };
2328
+ }
2329
+ function xn(e, t) {
2330
+ return [
2331
+ { key: "original", kind: "original", ratio: null, url: e.url, status: null },
2332
+ ...t.map((n) => ({
2333
+ key: n.aspectRatio,
2334
+ kind: "variant",
2335
+ ratio: n.aspectRatio,
2336
+ url: n.status === "failed" ? null : n.url,
2337
+ status: n.status
2338
+ }))
2339
+ ];
2340
+ }
2341
+ function zr(e) {
2342
+ return e.refType && e.refId ? {
2343
+ kind: "image",
2344
+ entry: {
2345
+ refType: e.refType,
2346
+ refId: e.refId,
2347
+ imageId: e.imageId ?? "main",
2348
+ // null, not []: null deletes the whole set including the original, which is what
2349
+ // deleting an asset means. [] is rejected by the server.
2350
+ aspectRatios: null
2351
+ }
2352
+ } : { kind: "asset", id: e.id };
2353
+ }
2354
+ function Vr(e, t, n) {
2355
+ if (e.kind === "original" || e.ratio === null)
2356
+ return {
2357
+ ratio: null,
2358
+ dimensions: `${t.width}×${t.height}`,
2359
+ sizeBytes: t.fileSizeBytes,
2360
+ contentType: t.mimeType,
2361
+ url: t.url
2362
+ };
2363
+ const a = n.find((r) => r.aspectRatio === e.ratio);
2364
+ return {
2365
+ ratio: e.ratio,
2366
+ dimensions: a != null && a.width && a != null && a.height ? `${a.width}×${a.height}` : null,
2367
+ sizeBytes: (a == null ? void 0 : a.fileSizeBytes) ?? null,
2368
+ contentType: (a == null ? void 0 : a.contentType) ?? null,
2369
+ // Falling back to the asset's url here would reintroduce the copy-link bug, so a
2370
+ // missing variant keeps its derivable address rather than borrowing the original's.
2371
+ url: (a == null ? void 0 : a.url) ?? `${t.url}?aspect_ratio=${e.ratio}`
2372
+ };
2373
+ }
2374
+ function we() {
2375
+ var e;
2376
+ const { sessionUser: t, namespace: n, currentCountry: a } = Kt(), r = (e = t.value) == null ? void 0 : e.token;
2377
+ return Nr.create({
2378
+ baseURL: Ur(n.value, a.value),
2379
+ headers: r ? { Authorization: `Bearer ${r}` } : {}
2380
+ });
2381
+ }
2382
+ function at(e) {
2383
+ return `/media-v1/businesses/${e}/assets`;
2384
+ }
2385
+ async function rt(e) {
2386
+ const { businessId: t, ...n } = e, { data: a } = await we().get(at(t), { params: n });
2387
+ return a;
2388
+ }
2389
+ async function kn(e) {
2390
+ const { resources: t } = await rt({ businessId: e, limit: 200 }), n = /* @__PURE__ */ new Set();
2391
+ return t.forEach((a) => a.tags.forEach((r) => n.add(r))), [...n].sort();
2392
+ }
2393
+ async function qr(e) {
2394
+ const { resources: t } = await rt({ businessId: e, limit: 200 }), n = /* @__PURE__ */ new Map();
2395
+ return t.forEach((a) => a.tags.forEach((r) => n.set(r, (n.get(r) ?? 0) + 1))), { tags: [...n.entries()].map(([a, r]) => ({ tag: a, count: r })).sort((a, r) => a.tag.localeCompare(r.tag)), total: t.length };
2396
+ }
2397
+ async function $r(e, t, n) {
2398
+ const { data: a } = await we().patch(`${at(e)}/${t}`, { fileName: n });
2399
+ return a;
2400
+ }
2401
+ async function Gr(e, t, n) {
2402
+ const { data: a } = await we().patch(`${at(e)}/${t}`, { tags: n });
2403
+ return a;
2404
+ }
2405
+ async function Hr(e, t) {
2406
+ await we().delete(`${at(e)}/${t}`);
2407
+ }
2408
+ function Ie(e) {
2409
+ return `/media-v1/businesses/${e}/images`;
2410
+ }
2411
+ async function Jr(e, t, n) {
2412
+ const { data: a } = await we().post(`${Ie(e)}/create`, t, {
2413
+ headers: n ? { "Idempotency-Key": n } : {}
2414
+ });
2415
+ return a;
2416
+ }
2417
+ async function Wr(e, t) {
2418
+ const { data: n } = await we().post(`${Ie(e)}/delete`, {
2419
+ entries: t
2420
+ });
2421
+ return n.results;
2422
+ }
2423
+ async function Kr(e) {
2424
+ const { businessId: t, refIds: n, ...a } = e, { data: r } = await we().get(Ie(t), {
2425
+ params: { ...a, refIds: n.join(",") }
2426
+ });
2427
+ return r.images;
2428
+ }
2429
+ async function Xr(e, t) {
2430
+ const { data: n } = await we().post(`${Ie(e)}/upload-intent`, t);
2431
+ return n;
2432
+ }
2433
+ async function Zr(e, t) {
2434
+ const { data: n } = await we().post(`${Ie(e)}/confirm`, t);
2435
+ return n;
2436
+ }
2437
+ async function ht(e, t) {
2438
+ const n = zr(t);
2439
+ if (n.kind === "image") {
2440
+ await Wr(e, [n.entry]);
2441
+ return;
2442
+ }
2443
+ await Hr(e, n.id);
2444
+ }
2445
+ const Qr = {
2446
+ assetGrid: {
2447
+ loading: "Loading…",
2448
+ empty: "No assets yet",
2449
+ columns: {
2450
+ name: "Name",
2451
+ dimensions: "Dimensions",
2452
+ fileSize: "Size",
2453
+ uploader: "Uploaded By",
2454
+ uploadedAt: "Uploaded At"
2455
+ },
2456
+ time: {
2457
+ justNow: "Just now",
2458
+ minutesAgo: "{n} minutes ago",
2459
+ hoursAgo: "{n} hours ago",
2460
+ daysAgo: "{n} days ago"
2461
+ }
2462
+ },
2463
+ assetDetailDialog: {
2464
+ previewTitle: "Preview",
2465
+ saveButton: "Save",
2466
+ dimensionsLabel: "Dimensions",
2467
+ sizeLabel: "Size",
2468
+ formatLabel: "Format",
2469
+ copyLinkButton: "Copy Link",
2470
+ deleteButton: "Delete",
2471
+ deleteDisclaimer: "If any business module is still using this image, it will show as broken wherever it's referenced after deletion — make sure it's no longer needed.",
2472
+ deleteDialogTitle: "Delete Asset",
2473
+ deleteDialogMessage: 'Delete "{fileName}"? {disclaimer}',
2474
+ deleteConfirmButton: "Delete",
2475
+ cancelButton: "Cancel"
2476
+ },
2477
+ tagFilterBar: {
2478
+ all: "All",
2479
+ newTagPlaceholder: "New tag…"
2480
+ },
2481
+ tagFilterTabs: {
2482
+ all: "All"
2483
+ },
2484
+ uploadPanel: {
2485
+ dropLabel: "Drag images here, or click to choose",
2486
+ helperText: "Supports JPG, PNG, WEBP, up to 10MB each",
2487
+ stagedCount: "Pending · {count}",
2488
+ tagsLabel: "Tags (optional)",
2489
+ suggestedTagsLabel: "Common",
2490
+ uploadFailedError: "Upload failed: {status}"
2491
+ },
2492
+ pickerModal: {
2493
+ title: "Select Assets",
2494
+ subtitleMultiple: "Select multiple or upload — click an image to toggle selection",
2495
+ subtitleSingle: "Click an image to select it, or switch to Upload New",
2496
+ searchPlaceholder: "Search…",
2497
+ browseTab: "Browse",
2498
+ uploadTab: "Upload New",
2499
+ selectedCount: "{count} selected",
2500
+ selectPrompt: "Select an image",
2501
+ cancelButton: "Cancel",
2502
+ uploadSubmitButton: "Upload {count}",
2503
+ confirmButton: "Confirm"
2504
+ },
2505
+ ratios: {
2506
+ title: "Ratios to generate",
2507
+ hint: "AI expands the canvas — about 40s per ratio"
2508
+ },
2509
+ variants: {
2510
+ badgeDone: "{count} ratios",
2511
+ badgeProgress: "{active}/{total} ratios",
2512
+ original: "Original",
2513
+ generating: "Generating…",
2514
+ failed: "Generation failed",
2515
+ regenerate: "Regenerate"
2516
+ }
2517
+ }, Yr = {
2518
+ mediaPicker: Qr
2519
+ }, eo = {
2520
+ assetGrid: {
2521
+ loading: "Chargement…",
2522
+ empty: "Aucun média",
2523
+ columns: {
2524
+ name: "Nom",
2525
+ dimensions: "Dimensions",
2526
+ fileSize: "Taille",
2527
+ uploader: "Importé par",
2528
+ uploadedAt: "Importé le"
2529
+ },
2530
+ time: {
2531
+ justNow: "À l'instant",
2532
+ minutesAgo: "il y a {n} min",
2533
+ hoursAgo: "il y a {n} h",
2534
+ daysAgo: "il y a {n} j"
2535
+ }
2536
+ },
2537
+ assetDetailDialog: {
2538
+ previewTitle: "Aperçu",
2539
+ saveButton: "Enregistrer",
2540
+ dimensionsLabel: "Dimensions",
2541
+ sizeLabel: "Taille",
2542
+ formatLabel: "Format",
2543
+ copyLinkButton: "Copier le lien",
2544
+ deleteButton: "Supprimer",
2545
+ deleteDisclaimer: "Après suppression, si un module métier utilise encore cette image, elle apparaîtra comme cassée à l'endroit où elle est référencée. Assurez-vous qu'elle n'est plus nécessaire.",
2546
+ deleteDialogTitle: "Supprimer le média",
2547
+ deleteDialogMessage: "Supprimer « {fileName} » ? {disclaimer}",
2548
+ deleteConfirmButton: "Supprimer",
2549
+ cancelButton: "Annuler"
2550
+ },
2551
+ tagFilterBar: {
2552
+ all: "Tous",
2553
+ newTagPlaceholder: "Nouveau tag…"
2554
+ },
2555
+ tagFilterTabs: {
2556
+ all: "Tous"
2557
+ },
2558
+ uploadPanel: {
2559
+ dropLabel: "Glissez des images ici, ou cliquez pour choisir",
2560
+ helperText: "JPG, PNG, WEBP acceptés, 10 Mo maximum par image",
2561
+ stagedCount: "En attente · {count}",
2562
+ tagsLabel: "Tags (facultatif)",
2563
+ suggestedTagsLabel: "Fréquents",
2564
+ uploadFailedError: "Échec de l'import : {status}"
2565
+ },
2566
+ pickerModal: {
2567
+ title: "Sélectionner des médias",
2568
+ subtitleMultiple: "Sélection multiple ou import — cliquez sur une image pour la sélectionner",
2569
+ subtitleSingle: "Cliquez sur une image pour la choisir, ou passez à l'onglet Importer",
2570
+ searchPlaceholder: "Rechercher…",
2571
+ browseTab: "Parcourir",
2572
+ uploadTab: "Importer",
2573
+ selectedCount: "{count} sélectionné(s)",
2574
+ selectPrompt: "Sélectionnez une image",
2575
+ cancelButton: "Annuler",
2576
+ uploadSubmitButton: "Importer {count}",
2577
+ confirmButton: "Confirmer"
2578
+ },
2579
+ ratios: {
2580
+ title: "Ratios à générer",
2581
+ hint: "L'IA étend le cadre — environ 40 s par ratio"
2582
+ },
2583
+ variants: {
2584
+ badgeDone: "{count} ratios",
2585
+ badgeProgress: "{active}/{total} ratios",
2586
+ original: "Original",
2587
+ generating: "Génération…",
2588
+ failed: "Échec de la génération",
2589
+ regenerate: "Régénérer"
2590
+ }
2591
+ }, to = {
2592
+ mediaPicker: eo
2593
+ }, no = {
2594
+ assetGrid: {
2595
+ loading: "Memuat…",
2596
+ empty: "Belum ada media",
2597
+ columns: {
2598
+ name: "Nama",
2599
+ dimensions: "Dimensi",
2600
+ fileSize: "Ukuran",
2601
+ uploader: "Diunggah Oleh",
2602
+ uploadedAt: "Waktu Unggah"
2603
+ },
2604
+ time: {
2605
+ justNow: "Baru saja",
2606
+ minutesAgo: "{n} menit lalu",
2607
+ hoursAgo: "{n} jam lalu",
2608
+ daysAgo: "{n} hari lalu"
2609
+ }
2610
+ },
2611
+ assetDetailDialog: {
2612
+ previewTitle: "Pratinjau",
2613
+ saveButton: "Simpan",
2614
+ dimensionsLabel: "Dimensi",
2615
+ sizeLabel: "Ukuran",
2616
+ formatLabel: "Format",
2617
+ copyLinkButton: "Salin Tautan",
2618
+ deleteButton: "Hapus",
2619
+ deleteDisclaimer: "Setelah dihapus, jika ada modul bisnis yang masih menggunakan gambar ini, gambar akan tampil rusak di tempat penggunaannya. Pastikan gambar ini sudah tidak diperlukan lagi.",
2620
+ deleteDialogTitle: "Hapus Media",
2621
+ deleteDialogMessage: 'Hapus "{fileName}"? {disclaimer}',
2622
+ deleteConfirmButton: "Hapus",
2623
+ cancelButton: "Batal"
2624
+ },
2625
+ tagFilterBar: {
2626
+ all: "Semua",
2627
+ newTagPlaceholder: "Buat tag baru…"
2628
+ },
2629
+ tagFilterTabs: {
2630
+ all: "Semua"
2631
+ },
2632
+ uploadPanel: {
2633
+ dropLabel: "Seret gambar ke sini, atau klik untuk memilih",
2634
+ helperText: "Mendukung JPG, PNG, WEBP, maksimal 10MB per file",
2635
+ stagedCount: "Menunggu diunggah · {count}",
2636
+ tagsLabel: "Tag (opsional)",
2637
+ suggestedTagsLabel: "Sering digunakan",
2638
+ uploadFailedError: "Unggah gagal: {status}"
2639
+ },
2640
+ pickerModal: {
2641
+ title: "Pilih Media",
2642
+ subtitleMultiple: "Pilih beberapa atau unggah — klik gambar untuk mengubah pilihan",
2643
+ subtitleSingle: "Klik gambar untuk memilihnya, atau beralih ke Unggah Baru",
2644
+ searchPlaceholder: "Cari…",
2645
+ browseTab: "Jelajahi & Pilih",
2646
+ uploadTab: "Unggah Baru",
2647
+ selectedCount: "{count} dipilih",
2648
+ selectPrompt: "Pilih gambar",
2649
+ cancelButton: "Batal",
2650
+ uploadSubmitButton: "Unggah {count}",
2651
+ confirmButton: "Konfirmasi"
2652
+ },
2653
+ ratios: {
2654
+ title: "Rasio yang akan dibuat",
2655
+ hint: "AI memperluas kanvas — sekitar 40 detik per rasio"
2656
+ },
2657
+ variants: {
2658
+ badgeDone: "{count} rasio",
2659
+ badgeProgress: "{active}/{total} rasio",
2660
+ original: "Asli",
2661
+ generating: "Membuat…",
2662
+ failed: "Gagal membuat",
2663
+ regenerate: "Buat ulang"
2664
+ }
2665
+ }, ao = {
2666
+ mediaPicker: no
2667
+ }, ro = {
2668
+ assetGrid: {
2669
+ loading: "読み込み中…",
2670
+ empty: "素材がありません",
2671
+ columns: {
2672
+ name: "名前",
2673
+ dimensions: "サイズ",
2674
+ fileSize: "容量",
2675
+ uploader: "アップロード者",
2676
+ uploadedAt: "アップロード日時"
2677
+ },
2678
+ time: {
2679
+ justNow: "たった今",
2680
+ minutesAgo: "{n} 分前",
2681
+ hoursAgo: "{n} 時間前",
2682
+ daysAgo: "{n} 日前"
2683
+ }
2684
+ },
2685
+ assetDetailDialog: {
2686
+ previewTitle: "プレビュー",
2687
+ saveButton: "保存",
2688
+ dimensionsLabel: "サイズ",
2689
+ sizeLabel: "容量",
2690
+ formatLabel: "形式",
2691
+ copyLinkButton: "リンクをコピー",
2692
+ deleteButton: "削除",
2693
+ deleteDisclaimer: "削除後、この画像を使用している業務モジュールがある場合、参照元では画像が表示されなくなります。不要であることを確認してください。",
2694
+ deleteDialogTitle: "素材を削除",
2695
+ deleteDialogMessage: "「{fileName}」を削除しますか?{disclaimer}",
2696
+ deleteConfirmButton: "削除",
2697
+ cancelButton: "キャンセル"
2698
+ },
2699
+ tagFilterBar: {
2700
+ all: "すべて",
2701
+ newTagPlaceholder: "新しいタグを作成…"
2702
+ },
2703
+ tagFilterTabs: {
2704
+ all: "すべて"
2705
+ },
2706
+ uploadPanel: {
2707
+ dropLabel: "ここに画像をドラッグ、またはクリックして選択",
2708
+ helperText: "JPG、PNG、WEBP に対応、1枚あたり10MBまで",
2709
+ stagedCount: "アップロード待ち · {count}",
2710
+ tagsLabel: "タグ(任意)",
2711
+ suggestedTagsLabel: "よく使うタグ",
2712
+ uploadFailedError: "アップロードに失敗しました:{status}"
2713
+ },
2714
+ pickerModal: {
2715
+ title: "素材を選択",
2716
+ subtitleMultiple: "複数選択またはアップロードが可能です。画像をクリックして選択を切り替えます",
2717
+ subtitleSingle: "画像をクリックして選択するか、「新規アップロード」に切り替えてください",
2718
+ searchPlaceholder: "検索…",
2719
+ browseTab: "選択して閲覧",
2720
+ uploadTab: "新規アップロード",
2721
+ selectedCount: "{count} 件選択中",
2722
+ selectPrompt: "画像を選択してください",
2723
+ cancelButton: "キャンセル",
2724
+ uploadSubmitButton: "{count} 件をアップロード",
2725
+ confirmButton: "確定"
2726
+ },
2727
+ ratios: {
2728
+ title: "生成する比率",
2729
+ hint: "AI がキャンバスを拡張します(1件あたり約40秒)"
2730
+ },
2731
+ variants: {
2732
+ badgeDone: "{count} 比率",
2733
+ badgeProgress: "{active}/{total} 比率",
2734
+ original: "元画像",
2735
+ generating: "生成中…",
2736
+ failed: "生成に失敗しました",
2737
+ regenerate: "再生成"
2738
+ }
2739
+ }, oo = {
2740
+ mediaPicker: ro
2741
+ }, so = {
2742
+ assetGrid: {
2743
+ loading: "กำลังโหลด…",
2744
+ empty: "ยังไม่มีสื่อ",
2745
+ columns: {
2746
+ name: "ชื่อ",
2747
+ dimensions: "ขนาด (พิกเซล)",
2748
+ fileSize: "ขนาดไฟล์",
2749
+ uploader: "ผู้อัปโหลด",
2750
+ uploadedAt: "เวลาอัปโหลด"
2751
+ },
2752
+ time: {
2753
+ justNow: "เมื่อสักครู่",
2754
+ minutesAgo: "{n} นาทีที่แล้ว",
2755
+ hoursAgo: "{n} ชั่วโมงที่แล้ว",
2756
+ daysAgo: "{n} วันที่แล้ว"
2757
+ }
2758
+ },
2759
+ assetDetailDialog: {
2760
+ previewTitle: "ตัวอย่าง",
2761
+ saveButton: "บันทึก",
2762
+ dimensionsLabel: "ขนาด (พิกเซล)",
2763
+ sizeLabel: "ขนาดไฟล์",
2764
+ formatLabel: "รูปแบบ",
2765
+ copyLinkButton: "คัดลอกลิงก์",
2766
+ deleteButton: "ลบ",
2767
+ deleteDisclaimer: "หลังลบแล้ว หากมีโมดูลธุรกิจใดกำลังใช้รูปนี้อยู่ รูปจะแสดงเป็นลิงก์เสียในตำแหน่งที่ถูกใช้งาน กรุณายืนยันว่าไม่จำเป็นต้องใช้แล้ว",
2768
+ deleteDialogTitle: "ลบสื่อ",
2769
+ deleteDialogMessage: "ยืนยันลบ “{fileName}” ใช่หรือไม่? {disclaimer}",
2770
+ deleteConfirmButton: "ลบ",
2771
+ cancelButton: "ยกเลิก"
2772
+ },
2773
+ tagFilterBar: {
2774
+ all: "ทั้งหมด",
2775
+ newTagPlaceholder: "สร้างแท็กใหม่…"
2776
+ },
2777
+ tagFilterTabs: {
2778
+ all: "ทั้งหมด"
2779
+ },
2780
+ uploadPanel: {
2781
+ dropLabel: "ลากรูปภาพมาวางที่นี่ หรือคลิกเพื่อเลือก",
2782
+ helperText: "รองรับ JPG, PNG, WEBP ไฟล์ละไม่เกิน 10MB",
2783
+ stagedCount: "รอการอัปโหลด · {count}",
2784
+ tagsLabel: "แท็ก (ไม่บังคับ)",
2785
+ suggestedTagsLabel: "ที่ใช้บ่อย",
2786
+ uploadFailedError: "อัปโหลดล้มเหลว: {status}"
2787
+ },
2788
+ pickerModal: {
2789
+ title: "เลือกสื่อ",
2790
+ subtitleMultiple: "เลือกได้หลายรายการหรืออัปโหลด คลิกที่รูปเพื่อสลับการเลือก",
2791
+ subtitleSingle: "คลิกที่รูปเพื่อเลือก หรือสลับไปที่แท็บอัปโหลดรูปใหม่",
2792
+ searchPlaceholder: "ค้นหา…",
2793
+ browseTab: "เรียกดูและเลือก",
2794
+ uploadTab: "อัปโหลดรูปใหม่",
2795
+ selectedCount: "เลือกแล้ว {count} รายการ",
2796
+ selectPrompt: "กรุณาเลือกรูปภาพ",
2797
+ cancelButton: "ยกเลิก",
2798
+ uploadSubmitButton: "อัปโหลด {count} รายการ",
2799
+ confirmButton: "ยืนยัน"
2800
+ },
2801
+ ratios: {
2802
+ title: "อัตราส่วนที่ต้องการสร้าง",
2803
+ hint: "AI จะขยายพื้นที่ภาพ ใช้เวลาประมาณ 40 วินาทีต่อรายการ"
2804
+ },
2805
+ variants: {
2806
+ badgeDone: "{count} อัตราส่วน",
2807
+ badgeProgress: "{active}/{total} อัตราส่วน",
2808
+ original: "ภาพต้นฉบับ",
2809
+ generating: "กำลังสร้าง…",
2810
+ failed: "สร้างไม่สำเร็จ",
2811
+ regenerate: "สร้างใหม่"
2812
+ }
2813
+ }, io = {
2814
+ mediaPicker: so
2815
+ }, lo = {
2816
+ assetGrid: {
2817
+ loading: "加载中…",
2818
+ empty: "暂无素材",
2819
+ columns: {
2820
+ name: "名称",
2821
+ dimensions: "尺寸",
2822
+ fileSize: "大小",
2823
+ uploader: "上传人",
2824
+ uploadedAt: "上传时间"
2825
+ },
2826
+ time: {
2827
+ justNow: "刚刚",
2828
+ minutesAgo: "{n} 分钟前",
2829
+ hoursAgo: "{n} 小时前",
2830
+ daysAgo: "{n} 天前"
2831
+ }
2832
+ },
2833
+ assetDetailDialog: {
2834
+ previewTitle: "预览",
2835
+ saveButton: "保存",
2836
+ dimensionsLabel: "尺寸",
2837
+ sizeLabel: "大小",
2838
+ formatLabel: "格式",
2839
+ copyLinkButton: "复制链接",
2840
+ deleteButton: "删除",
2841
+ deleteDisclaimer: "删除后如有业务模块正在使用这张图,图片会在原处显示失效,请确认已不再需要。",
2842
+ deleteDialogTitle: "删除素材",
2843
+ deleteDialogMessage: "确定删除「{fileName}」吗?{disclaimer}",
2844
+ deleteConfirmButton: "删除",
2845
+ cancelButton: "取消"
2846
+ },
2847
+ tagFilterBar: {
2848
+ all: "全部",
2849
+ newTagPlaceholder: "新建标签…"
2850
+ },
2851
+ tagFilterTabs: {
2852
+ all: "全部"
2853
+ },
2854
+ uploadPanel: {
2855
+ dropLabel: "拖拽图片到此处,或点击选择",
2856
+ helperText: "支持 JPG、PNG、WEBP,单张不超过 10MB",
2857
+ stagedCount: "待上传 · {count}",
2858
+ tagsLabel: "标签(可选)",
2859
+ suggestedTagsLabel: "常用",
2860
+ uploadFailedError: "上传失败:{status}"
2861
+ },
2862
+ pickerModal: {
2863
+ title: "选择素材",
2864
+ subtitleMultiple: "可多选或上传,点击图片切换选择",
2865
+ subtitleSingle: "点击图片完成选择,或切换到上传新图",
2866
+ searchPlaceholder: "搜索…",
2867
+ browseTab: "浏览选择",
2868
+ uploadTab: "上传新图",
2869
+ selectedCount: "已选择 {count} 张",
2870
+ selectPrompt: "请选择图片",
2871
+ cancelButton: "取消",
2872
+ uploadSubmitButton: "上传 {count} 张",
2873
+ confirmButton: "确定"
2874
+ },
2875
+ ratios: {
2876
+ title: "要生成的规格",
2877
+ hint: "AI 扩展画布,每个规格约 40 秒"
2878
+ },
2879
+ variants: {
2880
+ badgeDone: "{count} 规格",
2881
+ badgeProgress: "{active}/{total} 规格",
2882
+ original: "原图",
2883
+ generating: "生成中…",
2884
+ failed: "生成失败",
2885
+ regenerate: "重新生成"
2886
+ }
2887
+ }, uo = {
2888
+ mediaPicker: lo
2889
+ }, co = {
2890
+ assetGrid: {
2891
+ loading: "載入中…",
2892
+ empty: "暫無素材",
2893
+ columns: {
2894
+ name: "名稱",
2895
+ dimensions: "尺寸",
2896
+ fileSize: "大小",
2897
+ uploader: "上傳人",
2898
+ uploadedAt: "上傳時間"
2899
+ },
2900
+ time: {
2901
+ justNow: "剛剛",
2902
+ minutesAgo: "{n} 分鐘前",
2903
+ hoursAgo: "{n} 小時前",
2904
+ daysAgo: "{n} 天前"
2905
+ }
2906
+ },
2907
+ assetDetailDialog: {
2908
+ previewTitle: "預覽",
2909
+ saveButton: "儲存",
2910
+ dimensionsLabel: "尺寸",
2911
+ sizeLabel: "大小",
2912
+ formatLabel: "格式",
2913
+ copyLinkButton: "複製連結",
2914
+ deleteButton: "刪除",
2915
+ deleteDisclaimer: "刪除後如有業務模組正在使用這張圖,圖片會在原處顯示失效,請確認已不再需要。",
2916
+ deleteDialogTitle: "刪除素材",
2917
+ deleteDialogMessage: "確定刪除「{fileName}」嗎?{disclaimer}",
2918
+ deleteConfirmButton: "刪除",
2919
+ cancelButton: "取消"
2920
+ },
2921
+ tagFilterBar: {
2922
+ all: "全部",
2923
+ newTagPlaceholder: "新增標籤…"
2924
+ },
2925
+ tagFilterTabs: {
2926
+ all: "全部"
2927
+ },
2928
+ uploadPanel: {
2929
+ dropLabel: "拖曳圖片到此處,或點擊選擇",
2930
+ helperText: "支援 JPG、PNG、WEBP,單張不超過 10MB",
2931
+ stagedCount: "待上傳 · {count}",
2932
+ tagsLabel: "標籤(可選)",
2933
+ suggestedTagsLabel: "常用",
2934
+ uploadFailedError: "上傳失敗:{status}"
2935
+ },
2936
+ pickerModal: {
2937
+ title: "選擇素材",
2938
+ subtitleMultiple: "可多選或上傳,點擊圖片切換選擇",
2939
+ subtitleSingle: "點擊圖片完成選擇,或切換到上傳新圖",
2940
+ searchPlaceholder: "搜尋…",
2941
+ browseTab: "瀏覽選擇",
2942
+ uploadTab: "上傳新圖",
2943
+ selectedCount: "已選擇 {count} 張",
2944
+ selectPrompt: "請選擇圖片",
2945
+ cancelButton: "取消",
2946
+ uploadSubmitButton: "上傳 {count} 張",
2947
+ confirmButton: "確定"
2948
+ },
2949
+ ratios: {
2950
+ title: "要產生的規格",
2951
+ hint: "AI 擴展畫布,每個規格約 40 秒"
2952
+ },
2953
+ variants: {
2954
+ badgeDone: "{count} 規格",
2955
+ badgeProgress: "{active}/{total} 規格",
2956
+ original: "原圖",
2957
+ generating: "產生中…",
2958
+ failed: "產生失敗",
2959
+ regenerate: "重新產生"
2960
+ }
2961
+ }, fo = {
2962
+ mediaPicker: co
2963
+ }, ke = {
2964
+ "en-US": Yr,
2965
+ "zh-CN": uo,
2966
+ "zh-Hant": fo,
2967
+ "th-TH": io,
2968
+ "ja-JP": oo,
2969
+ "id-ID": ao,
2970
+ "fr-MA": to
2971
+ }, po = {
2972
+ key: 0,
2973
+ class: "py-64 text-center text-sm text-gray-400"
2974
+ }, mo = {
2975
+ key: 1,
2976
+ class: "py-64 text-center text-sm text-gray-400"
2977
+ }, go = {
2978
+ key: 2,
2979
+ class: "bg-white border border-fm-color-neutral-gray-200 rounded-lg overflow-hidden"
2980
+ }, ho = { class: "grid grid-cols-[40px_56px_minmax(160px,2.2fr)_110px_90px_150px_120px_40px] items-center gap-8 px-16 h-40 bg-fm-color-neutral-gray-100 border-b border-fm-color-neutral-gray-200 text-xs font-semibold text-fm-color-typo-secondary" }, bo = ["onClick"], yo = ["onClick"], vo = { key: 1 }, wo = { class: "w-[44px] h-[36px] rounded overflow-hidden" }, xo = { class: "min-w-0 flex flex-col gap-4" }, ko = { class: "text-xs font-semibold truncate" }, So = { class: "flex items-center gap-8" }, Po = { class: "text-[11px] text-fm-color-typo-tertiary" }, Eo = { class: "text-xs text-fm-color-typo-primary" }, Ro = { class: "text-xs text-fm-color-typo-primary" }, To = { class: "flex items-center gap-8 min-w-0" }, Oo = { class: "text-xs text-fm-color-typo-primary truncate" }, Co = { class: "text-xs text-fm-color-typo-secondary" }, _o = {
2981
+ key: 3,
2982
+ class: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-16"
2983
+ }, Ao = ["onClick"], Bo = { class: "relative aspect-[4/3]" }, Do = ["onClick"], Fo = { class: "absolute bottom-8 left-8 bg-black/70 text-white text-[11px] font-semibold px-[6px] py-[2px] rounded" }, No = { class: "px-8 py-6 space-y-2" }, Lo = { class: "text-xs font-semibold truncate" }, Uo = { class: "text-[11px] text-gray-500 truncate" }, Sn = /* @__PURE__ */ ye({
2984
+ __name: "AssetGrid",
2985
+ props: {
2986
+ assets: {},
2987
+ loading: { type: Boolean, default: !1 },
2988
+ selectable: { type: Boolean, default: !1 },
2989
+ selectedIds: { default: () => /* @__PURE__ */ new Set() },
2990
+ view: { default: "grid" },
2991
+ variantsByRefId: {}
2992
+ },
2993
+ emits: ["open", "toggle", "delete"],
2994
+ setup(e, { emit: t }) {
2995
+ const { t: n } = ve({ messages: ke }), a = e;
2996
+ function r(c) {
2997
+ var d;
2998
+ if (!c.refId)
2999
+ return null;
3000
+ const b = (d = a.variantsByRefId) == null ? void 0 : d.get(c.refId);
3001
+ return b ? Mr(b.variants) : null;
3002
+ }
3003
+ function o(c) {
3004
+ return c.tone === "done" ? n("mediaPicker.variants.badgeDone", { count: c.total }) : n("mediaPicker.variants.badgeProgress", { active: c.active, total: c.total });
3005
+ }
3006
+ const s = t;
3007
+ function i(c) {
3008
+ var d;
3009
+ return ((d = c.split("/")[1]) == null ? void 0 : d.toUpperCase()) ?? c;
3010
+ }
3011
+ function u(c) {
3012
+ return c >= 1024 * 1024 ? `${(c / 1024 / 1024).toFixed(1)} MB` : `${Math.round(c / 1024)} KB`;
3013
+ }
3014
+ function f(c) {
3015
+ const d = Date.now() - new Date(c).getTime(), b = 6e4, _ = 36e5, w = 864e5;
3016
+ if (d < b)
3017
+ return n("mediaPicker.assetGrid.time.justNow");
3018
+ if (d < _)
3019
+ return n("mediaPicker.assetGrid.time.minutesAgo", { n: Math.floor(d / b) });
3020
+ if (d < w)
3021
+ return n("mediaPicker.assetGrid.time.hoursAgo", { n: Math.floor(d / _) });
3022
+ if (d < w * 8)
3023
+ return n("mediaPicker.assetGrid.time.daysAgo", { n: Math.floor(d / w) });
3024
+ const v = new Date(c);
3025
+ return `${v.getFullYear()}-${String(v.getMonth() + 1).padStart(2, "0")}-${String(v.getDate()).padStart(2, "0")}`;
3026
+ }
3027
+ return (c, d) => {
3028
+ const b = M("FmIcon"), _ = M("FmThumbnail"), w = M("FmAvatar"), v = M("FmButton");
3029
+ return e.loading ? (S(), C("div", po, E(T(n)("mediaPicker.assetGrid.loading")), 1)) : e.assets.length === 0 ? (S(), C("div", mo, E(T(n)("mediaPicker.assetGrid.empty")), 1)) : e.view === "list" ? (S(), C("div", go, [
3030
+ h("div", ho, [
3031
+ d[0] || (d[0] = h("span", null, null, -1)),
3032
+ d[1] || (d[1] = h("span", null, null, -1)),
3033
+ h("span", null, E(T(n)("mediaPicker.assetGrid.columns.name")), 1),
3034
+ h("span", null, E(T(n)("mediaPicker.assetGrid.columns.dimensions")), 1),
3035
+ h("span", null, E(T(n)("mediaPicker.assetGrid.columns.fileSize")), 1),
3036
+ h("span", null, E(T(n)("mediaPicker.assetGrid.columns.uploader")), 1),
3037
+ h("span", null, E(T(n)("mediaPicker.assetGrid.columns.uploadedAt")), 1),
3038
+ d[2] || (d[2] = h("span", null, null, -1))
3039
+ ]),
3040
+ (S(!0), C(Z, null, be(e.assets, (y) => (S(), C("div", {
3041
+ key: y.id,
3042
+ class: te(["grid grid-cols-[40px_56px_minmax(160px,2.2fr)_110px_90px_150px_120px_40px] items-center gap-8 px-16 h-56 border-b border-fm-color-neutral-gray-200 last:border-b-0 cursor-pointer hover:bg-fm-color-neutral-gray-100", e.selectedIds.has(y.id) ? "bg-[#FFF7F0]" : "bg-white"]),
3043
+ onClick: (p) => s("open", y)
3044
+ }, [
3045
+ e.selectable ? (S(), C("button", {
3046
+ key: 0,
3047
+ class: te(["w-[20px] h-[20px] rounded flex items-center justify-center", e.selectedIds.has(y.id) ? "bg-[--fm-color-brand-primary,#FF7823]" : "bg-white border border-fm-color-neutral-gray-200"]),
3048
+ onClick: st((p) => s("toggle", y), ["stop"])
3049
+ }, [
3050
+ e.selectedIds.has(y.id) ? (S(), ne(b, {
3051
+ key: 0,
3052
+ name: "check",
3053
+ size: "sm",
3054
+ color: "white"
3055
+ })) : V("", !0)
3056
+ ], 10, yo)) : (S(), C("span", vo)),
3057
+ h("div", wo, [
3058
+ F(_, {
3059
+ src: y.url,
3060
+ size: "sm",
3061
+ class: "!w-full !h-full"
3062
+ }, null, 8, ["src"])
3063
+ ]),
3064
+ h("div", xo, [
3065
+ h("span", ko, E(y.fileName), 1),
3066
+ h("div", So, [
3067
+ h("span", Po, E(i(y.mimeType)), 1),
3068
+ r(y) ? (S(), C("span", {
3069
+ key: 0,
3070
+ class: te(["text-[11px] font-semibold", {
3071
+ "text-fm-color-typo-tertiary": r(y).tone === "done",
3072
+ "text-blue-600": r(y).tone === "progress",
3073
+ "text-amber-600": r(y).tone === "warning"
3074
+ }])
3075
+ }, E(o(r(y))), 3)) : V("", !0)
3076
+ ])
3077
+ ]),
3078
+ h("span", Eo, E(y.width) + "×" + E(y.height), 1),
3079
+ h("span", Ro, E(u(y.fileSizeBytes)), 1),
3080
+ h("div", To, [
3081
+ F(w, {
3082
+ name: y.uploadedBy,
3083
+ size: "sm"
3084
+ }, null, 8, ["name"]),
3085
+ h("span", Oo, E(y.uploadedBy), 1)
3086
+ ]),
3087
+ h("span", Co, E(f(y.createdAt)), 1),
3088
+ F(v, {
3089
+ variant: "tertiary",
3090
+ size: "md",
3091
+ "prepend-icon": "delete",
3092
+ label: "",
3093
+ onClick: st((p) => s("delete", y), ["stop"])
3094
+ }, null, 8, ["onClick"])
3095
+ ], 10, bo))), 128))
3096
+ ])) : (S(), C("div", _o, [
3097
+ (S(!0), C(Z, null, be(e.assets, (y) => (S(), C("div", {
3098
+ key: y.id,
3099
+ class: te(["cursor-pointer rounded-lg border bg-white overflow-hidden transition-shadow hover:shadow-lg", e.selectedIds.has(y.id) ? "border-2 border-[--fm-color-brand-primary,#FF7823]" : "border-gray-200"]),
3100
+ onClick: (p) => s("open", y)
3101
+ }, [
3102
+ h("div", Bo, [
3103
+ F(_, {
3104
+ src: y.url,
3105
+ size: "xl",
3106
+ class: "w-full h-full"
3107
+ }, null, 8, ["src"]),
3108
+ e.selectable ? (S(), C("button", {
3109
+ key: 0,
3110
+ class: te(["absolute top-8 left-8 z-10 w-24 h-24 rounded-full flex items-center justify-center", e.selectedIds.has(y.id) ? "bg-[--fm-color-brand-primary,#FF7823]" : "bg-black/30 border border-white/80"]),
3111
+ onClick: st((p) => s("toggle", y), ["stop"])
3112
+ }, [
3113
+ e.selectedIds.has(y.id) ? (S(), ne(b, {
3114
+ key: 0,
3115
+ name: "check",
3116
+ size: "sm",
3117
+ color: "white"
3118
+ })) : V("", !0)
3119
+ ], 10, Do)) : V("", !0),
3120
+ h("span", Fo, E(i(y.mimeType)), 1),
3121
+ r(y) ? (S(), C("span", {
3122
+ key: 1,
3123
+ class: te(["absolute bottom-8 right-8 text-white text-[11px] font-semibold px-[6px] py-[2px] rounded", {
3124
+ "bg-black/70": r(y).tone === "done",
3125
+ "bg-blue-600/90": r(y).tone === "progress",
3126
+ "bg-amber-600/90": r(y).tone === "warning"
3127
+ }])
3128
+ }, E(o(r(y))), 3)) : V("", !0)
3129
+ ]),
3130
+ h("div", No, [
3131
+ h("div", Lo, E(y.fileName), 1),
3132
+ h("span", Uo, E(y.width) + "×" + E(y.height) + " · " + E(u(y.fileSizeBytes)), 1)
3133
+ ])
3134
+ ], 10, Ao))), 128))
3135
+ ]));
3136
+ };
3137
+ }
3138
+ }), jo = { class: "flex flex-wrap items-center gap-8" }, Io = { class: "flex items-center gap-6" }, Mo = { class: "flex items-center gap-6" }, zo = /* @__PURE__ */ ye({
3139
+ __name: "TagFilterTabs",
3140
+ props: {
3141
+ tags: {},
3142
+ total: {},
3143
+ modelValue: {}
3144
+ },
3145
+ emits: ["update:modelValue"],
3146
+ setup(e, { emit: t }) {
3147
+ const { t: n } = ve({ messages: ke }), a = t;
3148
+ return (r, o) => {
3149
+ const s = M("FmChip");
3150
+ return S(), C("div", jo, [
3151
+ F(s, {
3152
+ selectable: "",
3153
+ selected: e.modelValue === null,
3154
+ onClick: o[0] || (o[0] = (i) => a("update:modelValue", null))
3155
+ }, {
3156
+ default: le(() => [
3157
+ h("span", Io, [
3158
+ ge(E(T(n)("mediaPicker.tagFilterTabs.all")) + " ", 1),
3159
+ h("span", {
3160
+ class: te(["text-[11px] leading-none rounded-full px-6 py-2", e.modelValue === null ? "bg-white/25" : "bg-fm-color-neutral-gray-100"])
3161
+ }, E(e.total), 3)
3162
+ ])
3163
+ ]),
3164
+ _: 1
3165
+ }, 8, ["selected"]),
3166
+ (S(!0), C(Z, null, be(e.tags, (i) => (S(), ne(s, {
3167
+ key: i.tag,
3168
+ selectable: "",
3169
+ selected: e.modelValue === i.tag,
3170
+ onClick: (u) => a("update:modelValue", i.tag)
3171
+ }, {
3172
+ default: le(() => [
3173
+ h("span", Mo, [
3174
+ ge(E(i.tag) + " ", 1),
3175
+ h("span", {
3176
+ class: te(["text-[11px] leading-none rounded-full px-6 py-2", e.modelValue === i.tag ? "bg-white/25" : "bg-fm-color-neutral-gray-100"])
3177
+ }, E(i.count), 3)
3178
+ ])
3179
+ ]),
3180
+ _: 2
3181
+ }, 1032, ["selected", "onClick"]))), 128))
3182
+ ]);
3183
+ };
3184
+ }
3185
+ }), Vo = { class: "space-y-8" }, qo = { class: "text-xs font-semibold text-gray-500" }, $o = { class: "flex flex-wrap gap-8" }, Go = ["onClick"], Ho = { class: "text-[11px] text-gray-400" }, Jo = /* @__PURE__ */ ye({
3186
+ __name: "RatioSelector",
3187
+ props: {
3188
+ modelValue: {},
3189
+ disabled: { type: Boolean }
3190
+ },
3191
+ emits: ["update:modelValue"],
3192
+ setup(e, { emit: t }) {
3193
+ const { t: n } = ve({ messages: ke }), a = e, r = t;
3194
+ function o(i) {
3195
+ a.disabled || r(
3196
+ "update:modelValue",
3197
+ a.modelValue.includes(i) ? a.modelValue.filter((u) => u !== i) : [...a.modelValue, i]
3198
+ );
3199
+ }
3200
+ function s(i) {
3201
+ return i.replace("x", ":");
3202
+ }
3203
+ return (i, u) => (S(), C("div", Vo, [
3204
+ h("div", qo, E(T(n)("mediaPicker.ratios.title")), 1),
3205
+ h("div", $o, [
3206
+ (S(!0), C(Z, null, be(T(jr), (f) => (S(), C("button", {
3207
+ key: f,
3208
+ type: "button",
3209
+ class: te(["h-[30px] px-12 rounded-full border text-[11px] font-semibold transition-colors", [
3210
+ e.modelValue.includes(f) ? "border-[--fm-color-brand-primary,#FF7823] text-[--fm-color-brand-primary,#FF7823] bg-[#FFF7F0]" : "border-fm-color-neutral-gray-300 text-gray-500",
3211
+ e.disabled ? "opacity-50 cursor-not-allowed" : ""
3212
+ ]]),
3213
+ onClick: (c) => o(f)
3214
+ }, E(s(f)), 11, Go))), 128))
3215
+ ]),
3216
+ h("div", Ho, E(T(n)("mediaPicker.ratios.hint")), 1)
3217
+ ]));
3218
+ }
3219
+ });
3220
+ function Wt(e) {
3221
+ return new Promise((t) => {
3222
+ const n = new Image();
3223
+ n.onload = () => t({ width: n.naturalWidth || 480, height: n.naturalHeight || 360 }), n.onerror = () => t({ width: 480, height: 360 }), n.src = e;
3224
+ });
3225
+ }
3226
+ const Wo = { class: "flex flex-wrap items-center gap-8" }, Ko = {
3227
+ key: 1,
3228
+ class: "inline-flex items-center gap-4 border rounded-full border-gray-300 pl-8 pr-4 h-[28px]"
3229
+ }, Xo = ["placeholder"], Pn = /* @__PURE__ */ ye({
3230
+ __name: "TagFilterBar",
3231
+ props: {
3232
+ tags: {},
3233
+ modelValue: {},
3234
+ mode: { default: "filter" }
3235
+ },
3236
+ emits: ["update:modelValue", "tag-created"],
3237
+ setup(e, { emit: t }) {
3238
+ const { t: n } = ve({ messages: ke }), a = e, r = t;
3239
+ function o(u) {
3240
+ r("update:modelValue", a.modelValue.includes(u) ? a.modelValue.filter((f) => f !== u) : [...a.modelValue, u]);
3241
+ }
3242
+ const s = N("");
3243
+ function i() {
3244
+ const u = s.value.trim();
3245
+ s.value = "", u && (a.modelValue.includes(u) || r("update:modelValue", [...a.modelValue, u]), a.tags.includes(u) || r("tag-created", u));
3246
+ }
3247
+ return (u, f) => {
3248
+ const c = M("FmChip"), d = M("FmIcon");
3249
+ return S(), C("div", Wo, [
3250
+ e.mode === "filter" ? (S(), ne(c, {
3251
+ key: 0,
3252
+ label: T(n)("mediaPicker.tagFilterBar.all"),
3253
+ selected: e.modelValue.length === 0,
3254
+ selectable: "",
3255
+ onClick: f[0] || (f[0] = (b) => r("update:modelValue", []))
3256
+ }, null, 8, ["label", "selected"])) : V("", !0),
3257
+ (S(!0), C(Z, null, be(e.tags, (b) => (S(), ne(c, {
3258
+ key: b,
3259
+ label: b,
3260
+ selected: e.modelValue.includes(b),
3261
+ selectable: "",
3262
+ onClick: (_) => o(b)
3263
+ }, null, 8, ["label", "selected", "onClick"]))), 128)),
3264
+ e.mode === "assign" ? (S(), C("div", Ko, [
3265
+ Tn(h("input", {
3266
+ "onUpdate:modelValue": f[1] || (f[1] = (b) => s.value = b),
3267
+ placeholder: T(n)("mediaPicker.tagFilterBar.newTagPlaceholder"),
3268
+ class: "text-xs outline-none w-[88px]",
3269
+ onKeyup: On(i, ["enter"])
3270
+ }, null, 40, Xo), [
3271
+ [Cn, s.value]
3272
+ ]),
3273
+ h("button", {
3274
+ class: "p-2",
3275
+ onClick: i
3276
+ }, [
3277
+ F(d, {
3278
+ name: "add",
3279
+ size: "sm"
3280
+ })
3281
+ ])
3282
+ ])) : V("", !0)
3283
+ ]);
3284
+ };
3285
+ }
3286
+ }), Zo = { class: "space-y-16" }, Qo = {
3287
+ key: 0,
3288
+ class: "space-y-8"
3289
+ }, Yo = { class: "text-xs font-semibold text-gray-500" }, es = ["src"], ts = { class: "flex-1 min-w-0 flex flex-col gap-2" }, ns = { class: "text-xs font-semibold truncate" }, as = {
3290
+ key: 0,
3291
+ class: "text-[11px] text-red-600"
3292
+ }, rs = {
3293
+ key: 1,
3294
+ class: "text-[11px] text-gray-500"
3295
+ }, os = ["onClick"], ss = { class: "space-y-8" }, is = { class: "text-xs font-semibold text-gray-500" }, ls = {
3296
+ key: 0,
3297
+ class: "flex flex-wrap items-center gap-8"
3298
+ }, us = { class: "text-[11px] text-gray-400" }, cs = ["onClick"], En = /* @__PURE__ */ ye({
3299
+ __name: "UploadPanel",
3300
+ props: {
3301
+ businessId: {},
3302
+ restaurantId: {},
3303
+ availableTags: {}
3304
+ },
3305
+ emits: ["tag-created", "uploaded"],
3306
+ setup(e, { expose: t, emit: n }) {
3307
+ const { t: a } = ve({ messages: ke }), r = e, o = n, s = N([]), i = N([]), u = N([]), f = N(!1), c = ae(() => s.value.length), d = ae(() => r.availableTags.filter((m) => !i.value.includes(m)).slice(0, 6));
3308
+ function b() {
3309
+ s.value.forEach((m) => URL.revokeObjectURL(m.previewUrl)), s.value = [], i.value = [], u.value = [];
3310
+ }
3311
+ async function _(m) {
3312
+ const P = URL.createObjectURL(m), x = {
3313
+ id: crypto.randomUUID(),
3314
+ refId: crypto.randomUUID(),
3315
+ file: m,
3316
+ previewUrl: P,
3317
+ dimensions: null,
3318
+ error: null
3319
+ };
3320
+ s.value.push(x), x.dimensions = await Wt(P);
3321
+ }
3322
+ function w(m) {
3323
+ const P = s.value.find((x) => x.id === m);
3324
+ P && URL.revokeObjectURL(P.previewUrl), s.value = s.value.filter((x) => x.id !== m);
3325
+ }
3326
+ function v(m) {
3327
+ return m >= 1024 * 1024 ? `${(m / 1024 / 1024).toFixed(1)} MB` : `${Math.round(m / 1024)} KB`;
3328
+ }
3329
+ async function y(m) {
3330
+ const P = m.dimensions ?? await Wt(m.previewUrl), x = m.file.type || "image/jpeg", k = await Xr(r.businessId, {
3331
+ refType: gt,
3332
+ refId: m.refId,
3333
+ imageId: "main",
3334
+ contentType: x,
3335
+ fileSize: m.file.size
3336
+ }), g = await fetch(k.uploadUrl, { method: "PUT", headers: { "Content-Type": x }, body: m.file });
3337
+ if (!g.ok)
3338
+ throw new Error(a("mediaPicker.uploadPanel.uploadFailedError", { status: g.status }));
3339
+ const A = await Zr(r.businessId, {
3340
+ refType: gt,
3341
+ refId: m.refId,
3342
+ imageId: "main",
3343
+ restaurantId: r.restaurantId,
3344
+ fileName: m.file.name,
3345
+ width: P.width,
3346
+ height: P.height,
3347
+ aspectRatios: u.value
3348
+ });
3349
+ return i.value.length ? await Gr(r.businessId, A.asset.id, i.value) : A.asset;
3350
+ }
3351
+ async function p() {
3352
+ if (!(!s.value.length || !r.businessId)) {
3353
+ f.value = !0;
3354
+ try {
3355
+ const m = s.value, P = await Promise.allSettled(m.map(y)), x = /* @__PURE__ */ new Set(), k = [];
3356
+ P.forEach((g, A) => {
3357
+ g.status === "rejected" ? (x.add(m[A].id), m[A].error = g.reason instanceof Error ? g.reason.message : String(g.reason)) : k.push(g.value);
3358
+ }), s.value = m.filter((g) => x.has(g.id)), k.length > 0 && o("uploaded", k);
3359
+ } finally {
3360
+ f.value = !1;
3361
+ }
3362
+ }
3363
+ }
3364
+ return t({ stagedCount: c, uploading: f, upload: p, reset: b }), (m, P) => {
3365
+ const x = M("FmDropField"), k = M("FmIcon");
3366
+ return S(), C("div", Zo, [
3367
+ F(x, {
3368
+ label: T(a)("mediaPicker.uploadPanel.dropLabel"),
3369
+ accept: "image/jpeg,image/png,image/webp",
3370
+ "max-file-size": 10 * 1024 * 1024,
3371
+ onFileUpload: _
3372
+ }, {
3373
+ "helper-text": le(() => [
3374
+ ge(E(T(a)("mediaPicker.uploadPanel.helperText")), 1)
3375
+ ]),
3376
+ _: 1
3377
+ }, 8, ["label"]),
3378
+ F(Jo, {
3379
+ modelValue: u.value,
3380
+ "onUpdate:modelValue": P[0] || (P[0] = (g) => u.value = g),
3381
+ disabled: f.value
3382
+ }, null, 8, ["modelValue", "disabled"]),
3383
+ s.value.length ? (S(), C("div", Qo, [
3384
+ h("div", Yo, E(T(a)("mediaPicker.uploadPanel.stagedCount", { count: s.value.length })), 1),
3385
+ (S(!0), C(Z, null, be(s.value, (g) => (S(), C("div", {
3386
+ key: g.id,
3387
+ class: te(["flex items-center gap-12 p-8 border rounded-lg", g.error ? "border-red-300 bg-red-50" : "border-fm-color-neutral-gray-200"])
3388
+ }, [
3389
+ h("img", {
3390
+ src: g.previewUrl,
3391
+ class: "w-[44px] h-[44px] rounded flex-shrink-0 object-cover"
3392
+ }, null, 8, es),
3393
+ h("div", ts, [
3394
+ h("span", ns, E(g.file.name), 1),
3395
+ g.error ? (S(), C("span", as, E(g.error), 1)) : (S(), C("span", rs, [
3396
+ g.dimensions ? (S(), C(Z, { key: 0 }, [
3397
+ ge(E(g.dimensions.width) + "×" + E(g.dimensions.height) + " · ", 1)
3398
+ ], 64)) : V("", !0),
3399
+ ge(E(v(g.file.size)), 1)
3400
+ ]))
3401
+ ]),
3402
+ h("button", {
3403
+ class: "w-[28px] h-[28px] rounded flex-shrink-0 flex items-center justify-center text-gray-500 hover:bg-red-50 hover:text-red-600",
3404
+ onClick: (A) => w(g.id)
3405
+ }, [
3406
+ F(k, {
3407
+ name: "close",
3408
+ size: "sm"
3409
+ })
3410
+ ], 8, os)
3411
+ ], 2))), 128))
3412
+ ])) : V("", !0),
3413
+ h("div", ss, [
3414
+ h("div", is, E(T(a)("mediaPicker.uploadPanel.tagsLabel")), 1),
3415
+ F(Pn, {
3416
+ modelValue: i.value,
3417
+ "onUpdate:modelValue": P[1] || (P[1] = (g) => i.value = g),
3418
+ tags: e.availableTags,
3419
+ mode: "assign",
3420
+ onTagCreated: P[2] || (P[2] = (g) => o("tag-created", g))
3421
+ }, null, 8, ["modelValue", "tags"]),
3422
+ d.value.length ? (S(), C("div", ls, [
3423
+ h("span", us, E(T(a)("mediaPicker.uploadPanel.suggestedTagsLabel")), 1),
3424
+ (S(!0), C(Z, null, be(d.value, (g) => (S(), C("button", {
3425
+ key: g,
3426
+ class: "h-[26px] px-12 rounded-full border border-dashed border-fm-color-neutral-gray-300 text-[11px] font-semibold text-gray-500",
3427
+ onClick: (A) => i.value.push(g)
3428
+ }, " + " + E(g), 9, cs))), 128))
3429
+ ])) : V("", !0)
3430
+ ])
3431
+ ]);
3432
+ };
3433
+ }
3434
+ }), ds = { class: "w-full flex items-center justify-between gap-16 pr-8" }, fs = { class: "text-xs font-normal text-fm-color-typo-secondary" }, ps = { class: "flex gap-16 border-b border-fm-color-neutral-gray-200 mb-12" }, ms = { class: "flex items-center justify-between w-full" }, gs = {
3435
+ key: 0,
3436
+ class: "text-xs text-fm-color-typo-secondary"
3437
+ }, hs = { key: 1 }, bs = { class: "flex gap-8" }, ys = /* @__PURE__ */ ye({
3438
+ __name: "MediaPickerModal",
3439
+ props: {
3440
+ open: { type: Boolean },
3441
+ businessId: {},
3442
+ restaurantId: {},
3443
+ selectionMode: { default: "single" }
3444
+ },
3445
+ emits: ["update:open", "select", "confirm"],
3446
+ setup(e, { emit: t }) {
3447
+ const { t: n } = ve({ messages: ke }), a = e, r = t, o = N("browse"), s = N(""), i = N(null), u = N([]), f = N([]), c = N(0), d = N([]), b = N(!1);
3448
+ async function _() {
3449
+ if (a.businessId) {
3450
+ b.value = !0;
3451
+ try {
3452
+ const g = await rt({
3453
+ businessId: a.businessId,
3454
+ restaurantId: a.restaurantId,
3455
+ search: s.value || void 0,
3456
+ tags: i.value ? [i.value] : void 0,
3457
+ limit: 200,
3458
+ sortBy: "createdAt",
3459
+ descending: !0
3460
+ });
3461
+ u.value = g.resources;
3462
+ } finally {
3463
+ b.value = !1;
3464
+ }
3465
+ }
3466
+ }
3467
+ async function w() {
3468
+ if (!a.businessId)
3469
+ return;
3470
+ const [g, A] = await Promise.all([qr(a.businessId), kn(a.businessId)]);
3471
+ f.value = g.tags, c.value = g.total, d.value = A;
3472
+ }
3473
+ he(
3474
+ () => a.open,
3475
+ (g) => {
3476
+ var A;
3477
+ g && (o.value = "browse", s.value = "", i.value = null, y.value = /* @__PURE__ */ new Set(), (A = x.value) == null || A.reset(), w(), _());
3478
+ }
3479
+ ), he(i, _);
3480
+ let v;
3481
+ he(s, () => {
3482
+ clearTimeout(v), v = setTimeout(_, 250);
3483
+ });
3484
+ const y = N(/* @__PURE__ */ new Set());
3485
+ function p(g) {
3486
+ const A = new Set(y.value);
3487
+ A.has(g.id) ? A.delete(g.id) : A.add(g.id), y.value = A;
3488
+ }
3489
+ function m(g) {
3490
+ if (a.selectionMode === "single") {
3491
+ r("select", g), r("update:open", !1);
3492
+ return;
3493
+ }
3494
+ p(g);
3495
+ }
3496
+ function P() {
3497
+ const g = u.value.filter((A) => y.value.has(A.id));
3498
+ r("confirm", g), r("update:open", !1);
3499
+ }
3500
+ const x = N(null);
3501
+ async function k() {
3502
+ var g;
3503
+ (g = x.value) != null && g.stagedCount || (o.value = "browse"), await Promise.all([_(), w()]);
3504
+ }
3505
+ return (g, A) => {
3506
+ const Y = M("FmSearch"), W = M("FmButton"), G = M("FmDialog");
3507
+ return S(), ne(G, {
3508
+ "model-value": e.open,
3509
+ "max-width": 900,
3510
+ "onUpdate:modelValue": A[7] || (A[7] = (j) => !j && r("update:open", !1))
3511
+ }, {
3512
+ "dialog-header": le(() => [
3513
+ h("div", ds, [
3514
+ h("div", null, [
3515
+ h("div", null, E(T(n)("mediaPicker.pickerModal.title")), 1),
3516
+ h("div", fs, E(e.selectionMode === "multiple" ? T(n)("mediaPicker.pickerModal.subtitleMultiple") : T(n)("mediaPicker.pickerModal.subtitleSingle")), 1)
3517
+ ]),
3518
+ o.value === "browse" ? (S(), ne(Y, {
3519
+ key: 0,
3520
+ modelValue: s.value,
3521
+ "onUpdate:modelValue": A[0] || (A[0] = (j) => s.value = j),
3522
+ placeholder: T(n)("mediaPicker.pickerModal.searchPlaceholder"),
3523
+ class: "w-[200px] shrink-0"
3524
+ }, null, 8, ["modelValue", "placeholder"])) : V("", !0)
3525
+ ])
3526
+ ]),
3527
+ "dialog-footer": le(() => {
3528
+ var j, z;
3529
+ return [
3530
+ h("div", ms, [
3531
+ o.value === "browse" && e.selectionMode === "multiple" ? (S(), C("span", gs, [
3532
+ y.value.size ? (S(), C(Z, { key: 0 }, [
3533
+ ge(E(T(n)("mediaPicker.pickerModal.selectedCount", { count: y.value.size })), 1)
3534
+ ], 64)) : (S(), C(Z, { key: 1 }, [
3535
+ ge(E(T(n)("mediaPicker.pickerModal.selectPrompt")), 1)
3536
+ ], 64))
3537
+ ])) : (S(), C("span", hs)),
3538
+ h("div", bs, [
3539
+ F(W, {
3540
+ label: T(n)("mediaPicker.pickerModal.cancelButton"),
3541
+ variant: "tertiary",
3542
+ onClick: A[5] || (A[5] = (ue) => r("update:open", !1))
3543
+ }, null, 8, ["label"]),
3544
+ o.value === "upload" ? (S(), ne(W, {
3545
+ key: 0,
3546
+ label: T(n)("mediaPicker.pickerModal.uploadSubmitButton", { count: ((j = x.value) == null ? void 0 : j.stagedCount) ?? 0 }),
3547
+ variant: "primary",
3548
+ disabled: !((z = x.value) != null && z.stagedCount) || x.value.uploading,
3549
+ onClick: A[6] || (A[6] = (ue) => {
3550
+ var $;
3551
+ return ($ = x.value) == null ? void 0 : $.upload();
3552
+ })
3553
+ }, null, 8, ["label", "disabled"])) : e.selectionMode === "multiple" ? (S(), ne(W, {
3554
+ key: 1,
3555
+ label: T(n)("mediaPicker.pickerModal.confirmButton"),
3556
+ variant: "primary",
3557
+ disabled: y.value.size === 0,
3558
+ onClick: P
3559
+ }, null, 8, ["label", "disabled"])) : V("", !0)
3560
+ ])
3561
+ ])
3562
+ ];
3563
+ }),
3564
+ default: le(() => [
3565
+ h("div", ps, [
3566
+ h("button", {
3567
+ class: te(["pb-8 px-4 text-sm", o.value === "browse" ? "font-semibold border-b-2 border-[--fm-color-brand-primary,#FF7823]" : "text-gray-500"]),
3568
+ onClick: A[1] || (A[1] = (j) => o.value = "browse")
3569
+ }, E(T(n)("mediaPicker.pickerModal.browseTab")), 3),
3570
+ h("button", {
3571
+ class: te(["pb-8 px-4 text-sm", o.value === "upload" ? "font-semibold border-b-2 border-[--fm-color-brand-primary,#FF7823]" : "text-gray-500"]),
3572
+ onClick: A[2] || (A[2] = (j) => o.value = "upload")
3573
+ }, E(T(n)("mediaPicker.pickerModal.uploadTab")), 3)
3574
+ ]),
3575
+ o.value === "browse" ? (S(), C(Z, { key: 0 }, [
3576
+ f.value.length ? (S(), ne(zo, {
3577
+ key: 0,
3578
+ modelValue: i.value,
3579
+ "onUpdate:modelValue": A[3] || (A[3] = (j) => i.value = j),
3580
+ tags: f.value,
3581
+ total: c.value,
3582
+ class: "mb-12"
3583
+ }, null, 8, ["modelValue", "tags", "total"])) : V("", !0),
3584
+ F(Sn, {
3585
+ assets: u.value,
3586
+ loading: b.value,
3587
+ selectable: e.selectionMode === "multiple",
3588
+ "selected-ids": y.value,
3589
+ onOpen: m,
3590
+ onToggle: p
3591
+ }, null, 8, ["assets", "loading", "selectable", "selected-ids"])
3592
+ ], 64)) : (S(), ne(En, {
3593
+ key: 1,
3594
+ ref_key: "uploadPanelRef",
3595
+ ref: x,
3596
+ "business-id": e.businessId,
3597
+ "restaurant-id": e.restaurantId,
3598
+ "available-tags": d.value,
3599
+ onTagCreated: A[4] || (A[4] = (j) => d.value.push(j)),
3600
+ onUploaded: k
3601
+ }, null, 8, ["business-id", "restaurant-id", "available-tags"]))
3602
+ ]),
3603
+ _: 1
3604
+ }, 8, ["model-value"]);
3605
+ };
3606
+ }
3607
+ }), vs = { class: "relative flex-1 min-w-0 bg-gray-900 flex items-center justify-center overflow-hidden" }, ws = ["src", "alt"], xs = {
3608
+ key: 1,
3609
+ class: "flex flex-col items-center gap-12 text-center px-24"
3610
+ }, ks = { class: "text-sm text-white" }, Ss = { class: "absolute top-8 left-8 bg-black/70 text-white text-[11px] font-semibold px-8 py-[2px] rounded" }, Ps = { class: "absolute bottom-12 left-1/2 -translate-x-1/2 flex items-center gap-8" }, Es = ["onClick"], Rs = /* @__PURE__ */ ye({
3611
+ __name: "VariantCarousel",
3612
+ props: /* @__PURE__ */ _t({
3613
+ original: {},
3614
+ variants: {},
3615
+ alt: {}
3616
+ }, {
3617
+ index: { default: 0 },
3618
+ indexModifiers: {}
3619
+ }),
3620
+ emits: /* @__PURE__ */ _t(["regenerate"], ["update:index"]),
3621
+ setup(e, { emit: t }) {
3622
+ const { t: n } = ve({ messages: ke }), a = e, r = t, o = An(e, "index"), s = ae(() => xn(a.original, a.variants));
3623
+ he(s, (c) => {
3624
+ o.value > c.length - 1 && (o.value = c.length - 1);
3625
+ });
3626
+ const i = ae(() => s.value[o.value]);
3627
+ function u(c) {
3628
+ const d = s.value.length;
3629
+ o.value = (o.value + c + d) % d;
3630
+ }
3631
+ function f(c) {
3632
+ return c ? c.replace("x", ":") : "";
3633
+ }
3634
+ return (c, d) => {
3635
+ var b, _, w, v;
3636
+ const y = M("FmIcon"), p = M("FmButton");
3637
+ return S(), C("div", vs, [
3638
+ (b = i.value) != null && b.url ? (S(), C("img", {
3639
+ key: 0,
3640
+ src: i.value.url,
3641
+ alt: e.alt,
3642
+ class: "max-w-full max-h-full object-contain"
3643
+ }, null, 8, ws)) : i.value ? (S(), C("div", xs, [
3644
+ F(y, {
3645
+ name: "error",
3646
+ size: "lg",
3647
+ color: "white"
3648
+ }),
3649
+ h("span", ks, E(T(n)("mediaPicker.variants.failed")), 1),
3650
+ F(p, {
3651
+ label: T(n)("mediaPicker.variants.regenerate"),
3652
+ variant: "secondary",
3653
+ size: "md",
3654
+ "prepend-icon": "refresh",
3655
+ onClick: d[0] || (d[0] = (m) => i.value.ratio && r("regenerate", i.value.ratio))
3656
+ }, null, 8, ["label"])
3657
+ ])) : V("", !0),
3658
+ h("span", Ss, [
3659
+ ge(E(((_ = i.value) == null ? void 0 : _.kind) === "original" ? T(n)("mediaPicker.variants.original") : f(((w = i.value) == null ? void 0 : w.ratio) ?? null)) + " ", 1),
3660
+ ((v = i.value) == null ? void 0 : v.status) === "pending" ? (S(), C(Z, { key: 0 }, [
3661
+ ge(" · " + E(T(n)("mediaPicker.variants.generating")), 1)
3662
+ ], 64)) : V("", !0)
3663
+ ]),
3664
+ s.value.length > 1 ? (S(), C(Z, { key: 2 }, [
3665
+ h("button", {
3666
+ class: "absolute left-8 top-1/2 -translate-y-1/2 w-[32px] h-[32px] rounded-full bg-black/50 flex items-center justify-center",
3667
+ onClick: d[1] || (d[1] = (m) => u(-1))
3668
+ }, [
3669
+ F(y, {
3670
+ name: "chevron_left",
3671
+ size: "sm",
3672
+ color: "white"
3673
+ })
3674
+ ]),
3675
+ h("button", {
3676
+ class: "absolute right-8 top-1/2 -translate-y-1/2 w-[32px] h-[32px] rounded-full bg-black/50 flex items-center justify-center",
3677
+ onClick: d[2] || (d[2] = (m) => u(1))
3678
+ }, [
3679
+ F(y, {
3680
+ name: "chevron_right",
3681
+ size: "sm",
3682
+ color: "white"
3683
+ })
3684
+ ]),
3685
+ h("div", Ps, [
3686
+ (S(!0), C(Z, null, be(s.value, (m, P) => (S(), C("button", {
3687
+ key: m.key,
3688
+ class: te(["w-[8px] h-[8px] rounded-full", P === o.value ? "bg-white" : "bg-white/40"]),
3689
+ onClick: (x) => o.value = P
3690
+ }, null, 10, Es))), 128))
3691
+ ])
3692
+ ], 64)) : V("", !0)
3693
+ ]);
3694
+ };
3695
+ }
3696
+ }), Ts = {
3697
+ key: 0,
3698
+ class: "flex h-[620px]"
3699
+ }, Os = { class: "w-[320px] flex-shrink-0 flex flex-col gap-12 p-16 overflow-y-auto" }, Cs = { class: "flex items-center justify-between" }, _s = { class: "fm-typo-en-title-sm-600" }, As = {
3700
+ key: 0,
3701
+ class: "flex items-start gap-8"
3702
+ }, Bs = { class: "flex-1 text-sm font-semibold break-all" }, Ds = {
3703
+ key: 1,
3704
+ class: "flex gap-8"
3705
+ }, Fs = { class: "text-xs space-y-8 border-t pt-8" }, Ns = { class: "flex justify-between" }, Ls = { class: "text-gray-500" }, Us = { class: "font-semibold" }, js = { class: "flex justify-between" }, Is = { class: "text-gray-500" }, Ms = { class: "flex justify-between" }, zs = { class: "text-gray-500" }, Vs = { class: "flex justify-between" }, qs = { class: "text-gray-500" }, $s = {
3706
+ key: 2,
3707
+ class: "flex flex-wrap gap-4"
3708
+ }, Gs = { class: "flex gap-8 border-t pt-12" }, Hs = /* @__PURE__ */ ye({
3709
+ __name: "AssetDetailDialog",
3710
+ props: {
3711
+ asset: {},
3712
+ businessId: {},
3713
+ image: {}
3714
+ },
3715
+ emits: ["close", "renamed", "deleted", "changed"],
3716
+ setup(e, { emit: t }) {
3717
+ const n = Xt(), { t: a } = ve({ messages: ke }), r = e, o = t, s = N(!1), i = N("");
3718
+ he(
3719
+ () => r.asset,
3720
+ (k) => {
3721
+ s.value = !1, i.value = (k == null ? void 0 : k.fileName) ?? "";
3722
+ }
3723
+ );
3724
+ function u() {
3725
+ var k;
3726
+ i.value = ((k = r.asset) == null ? void 0 : k.fileName) ?? "", s.value = !0;
3727
+ }
3728
+ async function f() {
3729
+ r.asset && (await $r(r.businessId, r.asset.id, i.value), s.value = !1, o("renamed"));
3730
+ }
3731
+ function c() {
3732
+ if (!r.asset)
3733
+ return;
3734
+ const k = r.asset;
3735
+ n.open({
3736
+ title: a("mediaPicker.assetDetailDialog.deleteDialogTitle"),
3737
+ message: a("mediaPicker.assetDetailDialog.deleteDialogMessage", {
3738
+ fileName: k.fileName,
3739
+ disclaimer: a("mediaPicker.assetDetailDialog.deleteDisclaimer")
3740
+ }),
3741
+ primaryActions: { text: a("mediaPicker.assetDetailDialog.deleteConfirmButton"), close: !1, variant: "destructive" },
3742
+ secondaryActions: { text: a("mediaPicker.assetDetailDialog.cancelButton"), close: !0 }
3743
+ }).onPrimary(async () => {
3744
+ await ht(r.businessId, k), o("deleted", k.id), n.close();
3745
+ });
3746
+ }
3747
+ const d = N(0), b = ae(() => {
3748
+ var k, g, A, Y, W, G;
3749
+ return {
3750
+ url: ((k = r.image) == null ? void 0 : k.original.url) ?? ((g = r.asset) == null ? void 0 : g.url) ?? "",
3751
+ width: ((A = r.image) == null ? void 0 : A.original.width) ?? ((Y = r.asset) == null ? void 0 : Y.width),
3752
+ height: ((W = r.image) == null ? void 0 : W.original.height) ?? ((G = r.asset) == null ? void 0 : G.height)
3753
+ };
3754
+ }), _ = ae(
3755
+ () => {
3756
+ var k;
3757
+ return r.asset ? xn(b.value, ((k = r.image) == null ? void 0 : k.variants) ?? []) : [];
3758
+ }
3759
+ );
3760
+ he(() => {
3761
+ var k;
3762
+ return (k = r.asset) == null ? void 0 : k.id;
3763
+ }, () => d.value = 0);
3764
+ const w = ae(() => {
3765
+ var k;
3766
+ const g = _.value[d.value];
3767
+ return !g || !r.asset ? null : Vr(g, r.asset, ((k = r.image) == null ? void 0 : k.variants) ?? []);
3768
+ }), v = ae(
3769
+ () => {
3770
+ var k;
3771
+ return (k = w.value) != null && k.ratio ? w.value.ratio.replace("x", ":") : a("mediaPicker.variants.original");
3772
+ }
3773
+ ), y = N(!1);
3774
+ async function p(k) {
3775
+ var g;
3776
+ if (!(!((g = r.asset) != null && g.refType) || !r.asset.refId || y.value)) {
3777
+ y.value = !0;
3778
+ try {
3779
+ await Jr(r.businessId, {
3780
+ refType: r.asset.refType,
3781
+ refId: r.asset.refId,
3782
+ imageId: r.asset.imageId ?? "main",
3783
+ aspectRatios: [k],
3784
+ mode: "append"
3785
+ }), o("changed");
3786
+ } finally {
3787
+ y.value = !1;
3788
+ }
3789
+ }
3790
+ }
3791
+ function m() {
3792
+ var k;
3793
+ w.value && ((k = navigator.clipboard) == null || k.writeText(w.value.url));
3794
+ }
3795
+ function P(k) {
3796
+ var g;
3797
+ return ((g = k.split("/")[1]) == null ? void 0 : g.toUpperCase()) ?? k;
3798
+ }
3799
+ function x(k) {
3800
+ return k >= 1024 * 1024 ? `${(k / 1024 / 1024).toFixed(1)} MB` : `${Math.round(k / 1024)} KB`;
3801
+ }
3802
+ return (k, g) => {
3803
+ const A = M("FmIcon"), Y = M("FmTextField"), W = M("FmButton"), G = M("FmDialog");
3804
+ return S(), ne(G, {
3805
+ "model-value": !!e.asset,
3806
+ "max-width": 920,
3807
+ "max-height": "620px",
3808
+ "content-class": "!p-0 asset-preview-dialog-content",
3809
+ "close-button": !1,
3810
+ "onUpdate:modelValue": g[3] || (g[3] = (j) => !j && o("close"))
3811
+ }, {
3812
+ default: le(() => {
3813
+ var j, z, ue, $, se;
3814
+ return [
3815
+ e.asset ? (S(), C("div", Ts, [
3816
+ F(Rs, {
3817
+ index: d.value,
3818
+ "onUpdate:index": g[0] || (g[0] = (X) => d.value = X),
3819
+ original: b.value,
3820
+ variants: ((j = e.image) == null ? void 0 : j.variants) ?? [],
3821
+ alt: e.asset.fileName,
3822
+ onRegenerate: p
3823
+ }, null, 8, ["index", "original", "variants", "alt"]),
3824
+ h("div", Os, [
3825
+ h("div", Cs, [
3826
+ h("span", _s, E(T(a)("mediaPicker.assetDetailDialog.previewTitle")), 1),
3827
+ h("button", {
3828
+ class: "w-[32px] h-[32px] rounded-lg bg-fm-color-neutral-gray-100 flex items-center justify-center flex-shrink-0",
3829
+ onClick: g[1] || (g[1] = (X) => o("close"))
3830
+ }, [
3831
+ F(A, {
3832
+ name: "close",
3833
+ size: "sm"
3834
+ })
3835
+ ])
3836
+ ]),
3837
+ s.value ? (S(), C("div", Ds, [
3838
+ F(Y, {
3839
+ modelValue: i.value,
3840
+ "onUpdate:modelValue": g[2] || (g[2] = (X) => i.value = X)
3841
+ }, null, 8, ["modelValue"]),
3842
+ F(W, {
3843
+ label: T(a)("mediaPicker.assetDetailDialog.saveButton"),
3844
+ size: "md",
3845
+ onClick: f
3846
+ }, null, 8, ["label"])
3847
+ ])) : (S(), C("div", As, [
3848
+ h("span", Bs, E(e.asset.fileName), 1),
3849
+ h("button", { onClick: u }, [
3850
+ F(A, {
3851
+ name: "edit",
3852
+ size: "sm"
3853
+ })
3854
+ ])
3855
+ ])),
3856
+ h("div", Fs, [
3857
+ h("div", Ns, [
3858
+ h("span", Ls, E(T(a)("mediaPicker.ratios.title")), 1),
3859
+ h("span", Us, E(v.value), 1)
3860
+ ]),
3861
+ h("div", js, [
3862
+ h("span", Is, E(T(a)("mediaPicker.assetDetailDialog.dimensionsLabel")), 1),
3863
+ h("span", null, E(((z = w.value) == null ? void 0 : z.dimensions) ?? "—"), 1)
3864
+ ]),
3865
+ h("div", Ms, [
3866
+ h("span", zs, E(T(a)("mediaPicker.assetDetailDialog.sizeLabel")), 1),
3867
+ h("span", null, E((ue = w.value) != null && ue.sizeBytes ? x(w.value.sizeBytes) : "—"), 1)
3868
+ ]),
3869
+ h("div", Vs, [
3870
+ h("span", qs, E(T(a)("mediaPicker.assetDetailDialog.formatLabel")), 1),
3871
+ h("span", null, E(($ = w.value) != null && $.contentType ? P(w.value.contentType) : "—"), 1)
3872
+ ])
3873
+ ]),
3874
+ (se = e.asset.tags) != null && se.length ? (S(), C("div", $s, [
3875
+ (S(!0), C(Z, null, be(e.asset.tags, (X) => (S(), C("span", {
3876
+ key: X,
3877
+ class: "text-[11px] bg-gray-100 rounded-full px-8 py-[2px]"
3878
+ }, " # " + E(X), 1))), 128))
3879
+ ])) : V("", !0),
3880
+ g[4] || (g[4] = h("div", { class: "flex-1" }, null, -1)),
3881
+ h("div", Gs, [
3882
+ F(W, {
3883
+ label: T(a)("mediaPicker.assetDetailDialog.copyLinkButton"),
3884
+ variant: "tertiary",
3885
+ size: "md",
3886
+ "prepend-icon": "link",
3887
+ class: "flex-1",
3888
+ onClick: m
3889
+ }, null, 8, ["label"]),
3890
+ F(W, {
3891
+ label: T(a)("mediaPicker.assetDetailDialog.deleteButton"),
3892
+ variant: "destructive",
3893
+ size: "md",
3894
+ "prepend-icon": "delete",
3895
+ onClick: c
3896
+ }, null, 8, ["label"])
3897
+ ])
3898
+ ])
3899
+ ])) : V("", !0)
3900
+ ];
3901
+ }),
3902
+ _: 1
3903
+ }, 8, ["model-value"]);
3904
+ };
3905
+ }
3906
+ }), Js = 5e3, Ws = 3;
3907
+ function Ks(e) {
3908
+ const t = N(/* @__PURE__ */ new Map());
3909
+ let n = [], a, r = 0;
3910
+ function o() {
3911
+ a !== void 0 && clearTimeout(a), a = void 0;
3912
+ }
3913
+ async function s() {
3914
+ let u = !1;
3915
+ try {
3916
+ const f = await Kr({ businessId: e(), refType: gt, refIds: n });
3917
+ t.value = new Map(f.map((c) => [c.refId, c])), r = 0;
3918
+ } catch (f) {
3919
+ if (u = !0, r += 1, r >= Ws) {
3920
+ console.warn("[media-picker] stopped polling image variants after repeated failures", f);
3921
+ return;
3922
+ }
3923
+ }
3924
+ ([...t.value.values()].some((f) => Ir(f.variants)) || u) && (a = setTimeout(s, Js));
3925
+ }
3926
+ async function i(u) {
3927
+ if (o(), r = 0, n = u, u.length === 0 || !e()) {
3928
+ t.value = /* @__PURE__ */ new Map();
3929
+ return;
3930
+ }
3931
+ await s();
3932
+ }
3933
+ return _n(o), { byRefId: t, load: i, stop: o };
3934
+ }
3935
+ const Xs = { class: "p-24 relative min-h-full" }, Zs = { class: "flex items-center justify-between mb-16" }, Qs = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2" }, Ys = { class: "flex gap-8" }, ei = { class: "flex flex-col gap-12 mb-16" }, ti = { class: "flex items-center gap-12" }, ni = { class: "flex-1 text-xs text-fm-color-typo-secondary" }, ai = {
3936
+ key: 0,
3937
+ class: "text-fm-color-typo-primary font-semibold"
3938
+ }, ri = { key: 1 }, oi = {
3939
+ key: 0,
3940
+ class: "fixed bottom-24 left-1/2 -translate-x-1/2 flex items-center gap-12 bg-white border rounded-lg shadow-lg px-16 py-8 z-30"
3941
+ }, si = { class: "text-sm font-semibold" }, ii = { class: "flex justify-end gap-8 w-full" }, di = /* @__PURE__ */ ye({
3942
+ __name: "AssetLibrary",
3943
+ setup(e) {
3944
+ const t = Kt(), { t: n } = ve(), a = ae(() => {
3945
+ var O;
3946
+ return ((O = t.currentBusiness.value) == null ? void 0 : O.id) ?? "";
3947
+ }), r = ae(() => {
3948
+ var O;
3949
+ return (O = t.currentRestaurant.value) == null ? void 0 : O._id;
3950
+ }), o = Xt(), s = N(!1);
3951
+ function i(O) {
3952
+ console.log("[media-debug] MediaPickerModal selected", O), x();
3953
+ }
3954
+ const u = N(""), f = N([]), c = N([]), d = N([]), b = N(!1), _ = N("recent"), w = {
3955
+ recent: { sortBy: "createdAt", descending: !0 },
3956
+ name: { sortBy: "fileName", descending: !1 },
3957
+ size: { sortBy: "fileSizeBytes", descending: !0 }
3958
+ }, v = [{ icon: "grid_view" }, { icon: "view_list" }], y = N(v[0]), p = ae(() => y.value.icon === "grid_view" ? "grid" : "list"), m = ae(() => {
3959
+ const O = c.value.reduce((B, I) => B + I.fileSizeBytes, 0);
3960
+ return O >= 1024 * 1024 ? `${(O / 1024 / 1024).toFixed(1)} MB` : `${Math.round(O / 1024)} KB`;
3961
+ }), P = Ks(() => a.value);
3962
+ async function x() {
3963
+ if (a.value) {
3964
+ c.value.length === 0 && (b.value = !0);
3965
+ try {
3966
+ const [O, B] = await Promise.all([
3967
+ rt({
3968
+ businessId: a.value,
3969
+ restaurantId: r.value,
3970
+ search: u.value || void 0,
3971
+ tags: f.value.length ? f.value : void 0,
3972
+ ...w[_.value]
3973
+ }),
3974
+ kn(a.value)
3975
+ ]);
3976
+ c.value = O.resources, d.value = B, await P.load(O.resources.map((I) => I.refId).filter((I) => !!I));
3977
+ } finally {
3978
+ b.value = !1;
3979
+ }
3980
+ }
3981
+ }
3982
+ Bn(x), he(a, x), he([f, _], x);
3983
+ let k;
3984
+ he(u, () => {
3985
+ clearTimeout(k), k = setTimeout(x, 250);
3986
+ });
3987
+ const g = N(/* @__PURE__ */ new Set());
3988
+ function A(O) {
3989
+ const B = new Set(g.value);
3990
+ B.has(O.id) ? B.delete(O.id) : B.add(O.id), g.value = B;
3991
+ }
3992
+ function Y() {
3993
+ g.value = /* @__PURE__ */ new Set();
3994
+ }
3995
+ function W() {
3996
+ g.value = new Set(c.value.map((O) => O.id));
3997
+ }
3998
+ function G() {
3999
+ const O = g.value.size;
4000
+ o.open({
4001
+ title: n("media.library.deleteBulkTitle"),
4002
+ message: n("media.library.deleteBulkMessage", { count: O, disclaimer: n("media.library.deleteDisclaimer") }),
4003
+ primaryActions: { text: n("media.library.deleteConfirmButton"), close: !1, variant: "destructive" },
4004
+ secondaryActions: { text: n("media.library.cancelButton"), close: !0 }
4005
+ }).onPrimary(async () => {
4006
+ await Promise.all(
4007
+ [...g.value].map((B) => {
4008
+ const I = c.value.find((fe) => fe.id === B);
4009
+ return I ? ht(a.value, I) : Promise.resolve();
4010
+ })
4011
+ ), Y(), await x(), o.close();
4012
+ });
4013
+ }
4014
+ function j(O) {
4015
+ o.open({
4016
+ title: n("media.library.deleteOneTitle"),
4017
+ message: n("media.library.deleteOneMessage", { fileName: O.fileName, disclaimer: n("media.library.deleteDisclaimer") }),
4018
+ primaryActions: { text: n("media.library.deleteConfirmButton"), close: !1, variant: "destructive" },
4019
+ secondaryActions: { text: n("media.library.cancelButton"), close: !0 }
4020
+ }).onPrimary(async () => {
4021
+ await ht(a.value, O);
4022
+ const B = new Set(g.value);
4023
+ B.delete(O.id), g.value = B, await x(), o.close();
4024
+ });
4025
+ }
4026
+ const z = N(null), ue = ae(
4027
+ () => {
4028
+ var O;
4029
+ return (O = z.value) != null && O.refId ? P.byRefId.value.get(z.value.refId) ?? null : null;
4030
+ }
4031
+ );
4032
+ function $(O) {
4033
+ z.value = O;
4034
+ }
4035
+ async function se() {
4036
+ await x(), z.value && (z.value = c.value.find((O) => {
4037
+ var B;
4038
+ return O.id === ((B = z.value) == null ? void 0 : B.id);
4039
+ }) ?? null);
4040
+ }
4041
+ async function X() {
4042
+ z.value = null, await x();
4043
+ }
4044
+ const ce = N(!1), de = N(null);
4045
+ function Me() {
4046
+ var O;
4047
+ (O = de.value) == null || O.reset(), ce.value = !0;
4048
+ }
4049
+ async function ie() {
4050
+ var O;
4051
+ (O = de.value) != null && O.stagedCount || (ce.value = !1), await x();
4052
+ }
4053
+ return (O, B) => {
4054
+ const I = M("FmButton"), fe = M("FmSearch"), ze = M("FmButtonGroup"), L = M("FmDialog");
4055
+ return S(), C("div", Xs, [
4056
+ h("div", Zs, [
4057
+ h("h1", Qs, E(T(n)("media.title")), 1),
4058
+ h("div", Ys, [
4059
+ F(I, {
4060
+ label: T(n)("media.library.testPickerButton"),
4061
+ variant: "tertiary",
4062
+ onClick: B[0] || (B[0] = (U) => s.value = !0)
4063
+ }, null, 8, ["label"]),
4064
+ F(I, {
4065
+ label: T(n)("media.library.uploadButton"),
4066
+ "prepend-icon": "add",
4067
+ variant: "primary",
4068
+ onClick: Me
4069
+ }, null, 8, ["label"])
4070
+ ])
4071
+ ]),
4072
+ h("div", ei, [
4073
+ F(fe, {
4074
+ modelValue: u.value,
4075
+ "onUpdate:modelValue": B[1] || (B[1] = (U) => u.value = U),
4076
+ placeholder: T(n)("media.library.searchPlaceholder"),
4077
+ class: "max-w-[280px]"
4078
+ }, null, 8, ["modelValue", "placeholder"]),
4079
+ d.value.length ? (S(), ne(T(Pn), {
4080
+ key: 0,
4081
+ modelValue: f.value,
4082
+ "onUpdate:modelValue": B[2] || (B[2] = (U) => f.value = U),
4083
+ tags: d.value
4084
+ }, null, 8, ["modelValue", "tags"])) : V("", !0),
4085
+ h("div", ti, [
4086
+ h("div", ni, [
4087
+ g.value.size > 0 ? (S(), C("span", ai, E(T(n)("media.library.selectedCount", { count: g.value.size })), 1)) : (S(), C("span", ri, E(T(n)("media.library.totalSummary", { count: c.value.length, size: m.value })), 1))
4088
+ ]),
4089
+ F(I, {
4090
+ label: T(n)("media.library.selectAllButton"),
4091
+ variant: "tertiary",
4092
+ size: "md",
4093
+ onClick: W
4094
+ }, null, 8, ["label"]),
4095
+ F(ze, {
4096
+ modelValue: y.value,
4097
+ "onUpdate:modelValue": B[3] || (B[3] = (U) => y.value = U),
4098
+ items: v
4099
+ }, null, 8, ["modelValue"])
4100
+ ])
4101
+ ]),
4102
+ F(T(Sn), {
4103
+ assets: c.value,
4104
+ loading: b.value,
4105
+ view: p.value,
4106
+ selectable: "",
4107
+ "selected-ids": g.value,
4108
+ "variants-by-ref-id": T(P).byRefId.value,
4109
+ onOpen: $,
4110
+ onToggle: A,
4111
+ onDelete: j
4112
+ }, null, 8, ["assets", "loading", "view", "selected-ids", "variants-by-ref-id"]),
4113
+ g.value.size > 0 ? (S(), C("div", oi, [
4114
+ h("span", si, E(T(n)("media.library.selectedCount", { count: g.value.size })), 1),
4115
+ F(I, {
4116
+ label: T(n)("media.library.cancelButton"),
4117
+ variant: "tertiary",
4118
+ size: "md",
4119
+ onClick: Y
4120
+ }, null, 8, ["label"]),
4121
+ F(I, {
4122
+ label: T(n)("media.library.deleteSelectedButton"),
4123
+ variant: "destructive",
4124
+ size: "md",
4125
+ "prepend-icon": "delete",
4126
+ onClick: G
4127
+ }, null, 8, ["label"])
4128
+ ])) : V("", !0),
4129
+ F(T(Hs), {
4130
+ asset: z.value,
4131
+ image: ue.value,
4132
+ "business-id": a.value,
4133
+ onClose: B[4] || (B[4] = (U) => z.value = null),
4134
+ onRenamed: se,
4135
+ onDeleted: X,
4136
+ onChanged: se
4137
+ }, null, 8, ["asset", "image", "business-id"]),
4138
+ F(T(ys), {
4139
+ open: s.value,
4140
+ "onUpdate:open": B[5] || (B[5] = (U) => s.value = U),
4141
+ "business-id": a.value,
4142
+ "restaurant-id": r.value,
4143
+ onSelect: i
4144
+ }, null, 8, ["open", "business-id", "restaurant-id"]),
4145
+ F(L, {
4146
+ modelValue: ce.value,
4147
+ "onUpdate:modelValue": B[9] || (B[9] = (U) => ce.value = U),
4148
+ "max-width": 480
4149
+ }, {
4150
+ "dialog-header": le(() => [
4151
+ h("div", null, E(T(n)("media.library.uploadDialogTitle")), 1)
4152
+ ]),
4153
+ "dialog-footer": le(() => {
4154
+ var U, Se;
4155
+ return [
4156
+ h("div", ii, [
4157
+ F(I, {
4158
+ label: T(n)("media.library.cancelButton"),
4159
+ variant: "tertiary",
4160
+ onClick: B[7] || (B[7] = (Ve) => ce.value = !1)
4161
+ }, null, 8, ["label"]),
4162
+ F(I, {
4163
+ label: T(n)("media.library.uploadSubmitButton", { count: ((U = de.value) == null ? void 0 : U.stagedCount) ?? 0 }),
4164
+ variant: "primary",
4165
+ disabled: !((Se = de.value) != null && Se.stagedCount) || de.value.uploading,
4166
+ onClick: B[8] || (B[8] = (Ve) => {
4167
+ var qe;
4168
+ return (qe = de.value) == null ? void 0 : qe.upload();
4169
+ })
4170
+ }, null, 8, ["label", "disabled"])
4171
+ ])
4172
+ ];
4173
+ }),
4174
+ default: le(() => [
4175
+ F(T(En), {
4176
+ ref_key: "uploadPanelRef",
4177
+ ref: de,
4178
+ "business-id": a.value,
4179
+ "restaurant-id": r.value,
4180
+ "available-tags": d.value,
4181
+ onTagCreated: B[6] || (B[6] = (U) => d.value.push(U)),
4182
+ onUploaded: ie
4183
+ }, null, 8, ["business-id", "restaurant-id", "available-tags"])
4184
+ ]),
4185
+ _: 1
4186
+ }, 8, ["modelValue"])
4187
+ ]);
4188
+ };
4189
+ }
4190
+ });
4191
+ export {
4192
+ di as default
4193
+ };