@feedmepos/mf-media 1.0.0 → 1.0.1-dev.2

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,4817 @@
1
+ import { defineComponent as be, resolveComponent as K, resolveDirective as ua, openBlock as b, createElementBlock as k, toDisplayString as x, unref as h, createElementVNode as v, normalizeStyle as j, Fragment as Z, renderList as he, withDirectives as et, normalizeClass as ee, withModifiers as ct, createBlock as oe, createCommentVNode as F, createVNode as W, createTextVNode as de, ref as G, withKeys as $a, vModelText as Ja, computed as z, withCtx as Se, onScopeDispose as Ha, watch as xe, mergeModels as yt, useModel as da } from "vue";
2
+ import { useI18n as ye, useCoreStore as Ka } from "@feedmepos/mf-common";
3
+ import { useDialog as Xa } from "@feedmepos/ui-library";
4
+ function ca(e, t) {
5
+ return function() {
6
+ return e.apply(t, arguments);
7
+ };
8
+ }
9
+ const { toString: Qa } = Object.prototype, { getPrototypeOf: De } = Object, { iterator: qe, toStringTag: pa } = Symbol, tt = (({ hasOwnProperty: e }) => (t, a) => e.call(t, a))(Object.prototype), Ve = (e, t) => {
10
+ let a = e;
11
+ const n = [];
12
+ for (; a != null && a !== Object.prototype; ) {
13
+ if (n.indexOf(a) !== -1)
14
+ return !1;
15
+ if (n.push(a), tt(a, t))
16
+ return !0;
17
+ a = De(a);
18
+ }
19
+ return !1;
20
+ }, Ya = (e, t) => e != null && Ve(e, t) ? e[t] : void 0, Pt = ((e) => (t) => {
21
+ const a = Qa.call(t);
22
+ return e[a] || (e[a] = a.slice(8, -1).toLowerCase());
23
+ })(/* @__PURE__ */ Object.create(null)), ge = (e) => (e = e.toLowerCase(), (t) => Pt(t) === e), rt = (e) => (t) => typeof t === e, { isArray: Ce } = Array, Me = rt("undefined");
24
+ function Ne(e) {
25
+ return e !== null && !Me(e) && e.constructor !== null && !Me(e.constructor) && se(e.constructor.isBuffer) && e.constructor.isBuffer(e);
26
+ }
27
+ const fa = ge("ArrayBuffer");
28
+ function Za(e) {
29
+ let t;
30
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && fa(e.buffer), t;
31
+ }
32
+ const en = rt("string"), se = rt("function"), ma = rt("number"), Ie = (e) => e !== null && typeof e == "object", tn = (e) => e === !0 || e === !1, Xe = (e) => {
33
+ if (!Ie(e))
34
+ return !1;
35
+ const t = De(e);
36
+ return (t === null || t === Object.prototype || De(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
+ !Ve(e, pa) && !Ve(e, qe);
40
+ }, an = (e) => {
41
+ if (!Ie(e) || Ne(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
+ }, nn = ge("Date"), on = ge("File"), rn = (e) => !!(e && typeof e.uri < "u"), sn = (e) => e && typeof e.getParts < "u", ln = ge("Blob"), un = ge("FileList"), dn = (e) => Ie(e) && se(e.pipe);
49
+ function cn() {
50
+ return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
51
+ }
52
+ const qt = cn(), Wt = typeof qt.FormData < "u" ? qt.FormData : void 0, pn = (e) => {
53
+ if (!e)
54
+ return !1;
55
+ if (Wt && e instanceof Wt)
56
+ return !0;
57
+ const t = De(e);
58
+ if (!t || t === Object.prototype || !se(e.append))
59
+ return !1;
60
+ const a = Pt(e);
61
+ return a === "formdata" || // detect form-data instance
62
+ a === "object" && se(e.toString) && e.toString() === "[object FormData]";
63
+ }, fn = ge("URLSearchParams"), [mn, gn, hn, bn] = [
64
+ "ReadableStream",
65
+ "Request",
66
+ "Response",
67
+ "Headers"
68
+ ].map(ge), yn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
69
+ function We(e, t, { allOwnKeys: a = !1 } = {}) {
70
+ if (e === null || typeof e > "u")
71
+ return;
72
+ let n, o;
73
+ if (typeof e != "object" && (e = [e]), Ce(e))
74
+ for (n = 0, o = e.length; n < o; n++)
75
+ t.call(null, e[n], n, e);
76
+ else {
77
+ if (Ne(e))
78
+ return;
79
+ const r = a ? Object.getOwnPropertyNames(e) : Object.keys(e), i = r.length;
80
+ let s;
81
+ for (n = 0; n < i; n++)
82
+ s = r[n], t.call(null, e[s], s, e);
83
+ }
84
+ }
85
+ function ga(e, t) {
86
+ if (Ne(e))
87
+ return null;
88
+ t = t.toLowerCase();
89
+ const a = Object.keys(e);
90
+ let n = a.length, o;
91
+ for (; n-- > 0; )
92
+ if (o = a[n], t === o.toLowerCase())
93
+ return o;
94
+ return null;
95
+ }
96
+ const Oe = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), ha = (e) => !Me(e) && e !== Oe;
97
+ function vt(...e) {
98
+ const { caseless: t, skipUndefined: a } = ha(this) && this || {}, n = {}, o = (r, i) => {
99
+ if (i === "__proto__" || i === "constructor" || i === "prototype")
100
+ return;
101
+ const s = t && typeof i == "string" && ga(n, i) || i, u = tt(n, s) ? n[s] : void 0;
102
+ Xe(u) && Xe(r) ? n[s] = vt(u, r) : Xe(r) ? n[s] = vt({}, r) : Ce(r) ? n[s] = r.slice() : (!a || !Me(r)) && (n[s] = r);
103
+ };
104
+ for (let r = 0, i = e.length; r < i; r++) {
105
+ const s = e[r];
106
+ if (!s || Ne(s) || (We(s, o), typeof s != "object" || Ce(s)))
107
+ continue;
108
+ const u = Object.getOwnPropertySymbols(s);
109
+ for (let c = 0; c < u.length; c++) {
110
+ const d = u[c];
111
+ An.call(s, d) && o(s[d], d);
112
+ }
113
+ }
114
+ return n;
115
+ }
116
+ const vn = (e, t, a, { allOwnKeys: n } = {}) => (We(
117
+ t,
118
+ (o, r) => {
119
+ a && se(o) ? Object.defineProperty(e, r, {
120
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
121
+ // hijack defineProperty's accessor-vs-data resolution.
122
+ __proto__: null,
123
+ value: ca(o, a),
124
+ writable: !0,
125
+ enumerable: !0,
126
+ configurable: !0
127
+ }) : Object.defineProperty(e, r, {
128
+ __proto__: null,
129
+ value: o,
130
+ writable: !0,
131
+ enumerable: !0,
132
+ configurable: !0
133
+ });
134
+ },
135
+ { allOwnKeys: n }
136
+ ), e), wn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), kn = (e, t, a, n) => {
137
+ e.prototype = Object.create(t.prototype, n), 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
+ }), a && Object.assign(e.prototype, a);
147
+ }, xn = (e, t, a, n) => {
148
+ let o, r, i;
149
+ const s = {};
150
+ if (t = t || {}, e == null)
151
+ return t;
152
+ do {
153
+ for (o = Object.getOwnPropertyNames(e), r = o.length; r-- > 0; )
154
+ i = o[r], (!n || n(i, e, t)) && !s[i] && (t[i] = e[i], s[i] = !0);
155
+ e = a !== !1 && De(e);
156
+ } while (e && (!a || a(e, t)) && e !== Object.prototype);
157
+ return t;
158
+ }, Pn = (e, t, a) => {
159
+ e = String(e), (a === void 0 || a > e.length) && (a = e.length), a -= t.length;
160
+ const n = e.indexOf(t, a);
161
+ return n !== -1 && n === a;
162
+ }, En = (e) => {
163
+ if (!e)
164
+ return null;
165
+ if (Ce(e))
166
+ return e;
167
+ let t = e.length;
168
+ if (!ma(t))
169
+ return null;
170
+ const a = new Array(t);
171
+ for (; t-- > 0; )
172
+ a[t] = e[t];
173
+ return a;
174
+ }, Rn = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && De(Uint8Array)), Sn = (e, t) => {
175
+ const a = (e && e[qe]).call(e);
176
+ let n;
177
+ for (; (n = a.next()) && !n.done; ) {
178
+ const o = n.value;
179
+ t.call(e, o[0], o[1]);
180
+ }
181
+ }, Tn = (e, t) => {
182
+ let a;
183
+ const n = [];
184
+ for (; (a = e.exec(t)) !== null; )
185
+ n.push(a);
186
+ return n;
187
+ }, On = ge("HTMLFormElement"), Cn = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(t, a, n) {
188
+ return a.toUpperCase() + n;
189
+ }), { propertyIsEnumerable: An } = Object.prototype, Bn = ge("RegExp"), ba = (e, t) => {
190
+ const a = Object.getOwnPropertyDescriptors(e), n = {};
191
+ We(a, (o, r) => {
192
+ let i;
193
+ (i = t(o, r, e)) !== !1 && (n[r] = i || o);
194
+ }), Object.defineProperties(e, n);
195
+ }, _n = (e) => {
196
+ ba(e, (t, a) => {
197
+ if (se(e) && ["arguments", "caller", "callee"].includes(a))
198
+ return !1;
199
+ const n = e[a];
200
+ if (se(n)) {
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 '" + a + "'");
207
+ });
208
+ }
209
+ });
210
+ }, Dn = (e, t) => {
211
+ const a = {}, n = (o) => {
212
+ o.forEach((r) => {
213
+ a[r] = !0;
214
+ });
215
+ };
216
+ return Ce(e) ? n(e) : n(String(e).split(t)), a;
217
+ }, Mn = () => {
218
+ }, Nn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
219
+ function In(e) {
220
+ return !!(e && se(e.append) && e[pa] === "FormData" && e[qe]);
221
+ }
222
+ const Un = (e) => {
223
+ const t = /* @__PURE__ */ new WeakSet(), a = (n) => {
224
+ if (Ie(n)) {
225
+ if (t.has(n))
226
+ return;
227
+ if (Ne(n))
228
+ return n;
229
+ if (!("toJSON" in n)) {
230
+ t.add(n);
231
+ const o = Ce(n) ? [] : {};
232
+ return We(n, (r, i) => {
233
+ const s = a(r);
234
+ !Me(s) && (o[i] = s);
235
+ }), t.delete(n), o;
236
+ }
237
+ }
238
+ return n;
239
+ };
240
+ return a(e);
241
+ }, Ln = ge("AsyncFunction"), jn = (e) => e && (Ie(e) || se(e)) && se(e.then) && se(e.catch), ya = ((e, t) => e ? setImmediate : t ? ((a, n) => (Oe.addEventListener(
242
+ "message",
243
+ ({ source: o, data: r }) => {
244
+ o === Oe && r === a && n.length && n.shift()();
245
+ },
246
+ !1
247
+ ), (o) => {
248
+ n.push(o), Oe.postMessage(a, "*");
249
+ }))(`axios@${Math.random()}`, []) : (a) => setTimeout(a))(typeof setImmediate == "function", se(Oe.postMessage)), Fn = typeof queueMicrotask < "u" ? queueMicrotask.bind(Oe) : typeof process < "u" && process.nextTick || ya, va = (e) => e != null && se(e[qe]), zn = (e) => e != null && Ve(e, qe) && va(e), l = {
250
+ isArray: Ce,
251
+ isArrayBuffer: fa,
252
+ isBuffer: Ne,
253
+ isFormData: pn,
254
+ isArrayBufferView: Za,
255
+ isString: en,
256
+ isNumber: ma,
257
+ isBoolean: tn,
258
+ isObject: Ie,
259
+ isPlainObject: Xe,
260
+ isEmptyObject: an,
261
+ isReadableStream: mn,
262
+ isRequest: gn,
263
+ isResponse: hn,
264
+ isHeaders: bn,
265
+ isUndefined: Me,
266
+ isDate: nn,
267
+ isFile: on,
268
+ isReactNativeBlob: rn,
269
+ isReactNative: sn,
270
+ isBlob: ln,
271
+ isRegExp: Bn,
272
+ isFunction: se,
273
+ isStream: dn,
274
+ isURLSearchParams: fn,
275
+ isTypedArray: Rn,
276
+ isFileList: un,
277
+ forEach: We,
278
+ merge: vt,
279
+ extend: vn,
280
+ trim: yn,
281
+ stripBOM: wn,
282
+ inherits: kn,
283
+ toFlatObject: xn,
284
+ kindOf: Pt,
285
+ kindOfTest: ge,
286
+ endsWith: Pn,
287
+ toArray: En,
288
+ forEachEntry: Sn,
289
+ matchAll: Tn,
290
+ isHTMLForm: On,
291
+ hasOwnProperty: tt,
292
+ hasOwnProp: tt,
293
+ // an alias to avoid ESLint no-prototype-builtins detection
294
+ hasOwnInPrototypeChain: Ve,
295
+ getSafeProp: Ya,
296
+ reduceDescriptors: ba,
297
+ freezeMethods: _n,
298
+ toObjectSet: Dn,
299
+ toCamelCase: Cn,
300
+ noop: Mn,
301
+ toFiniteNumber: Nn,
302
+ findKey: ga,
303
+ global: Oe,
304
+ isContextDefined: ha,
305
+ isSpecCompliantForm: In,
306
+ toJSONObject: Un,
307
+ isAsyncFn: Ln,
308
+ isThenable: jn,
309
+ setImmediate: ya,
310
+ asap: Fn,
311
+ isIterable: va,
312
+ isSafeIterable: zn
313
+ }, Vn = 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
+ ]), qn = (e) => {
332
+ const t = {};
333
+ let a, n, o;
334
+ return e && e.split(`
335
+ `).forEach(function(r) {
336
+ o = r.indexOf(":"), a = r.substring(0, o).trim().toLowerCase(), n = r.substring(o + 1).trim(), !(!a || t[a] && Vn[a]) && (a === "set-cookie" ? t[a] ? t[a].push(n) : t[a] = [n] : t[a] = t[a] ? t[a] + ", " + n : n);
337
+ }), t;
338
+ };
339
+ function Wn(e) {
340
+ let t = 0, a = e.length;
341
+ for (; t < a; ) {
342
+ const n = e.charCodeAt(t);
343
+ if (n !== 9 && n !== 32)
344
+ break;
345
+ t += 1;
346
+ }
347
+ for (; a > t; ) {
348
+ const n = e.charCodeAt(a - 1);
349
+ if (n !== 9 && n !== 32)
350
+ break;
351
+ a -= 1;
352
+ }
353
+ return t === 0 && a === e.length ? e : e.slice(t, a);
354
+ }
355
+ const Gn = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g"), $n = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
356
+ function Et(e, t) {
357
+ return l.isArray(e) ? e.map((a) => Et(a, t)) : Wn(String(e).replace(t, ""));
358
+ }
359
+ const Jn = (e) => Et(e, Gn), Hn = (e) => Et(e, $n);
360
+ function wa(e) {
361
+ const t = /* @__PURE__ */ Object.create(null);
362
+ return l.forEach(e.toJSON(), (a, n) => {
363
+ t[n] = Hn(a);
364
+ }), t;
365
+ }
366
+ const Gt = Symbol("internals");
367
+ function je(e) {
368
+ return e && String(e).trim().toLowerCase();
369
+ }
370
+ function Qe(e) {
371
+ return e === !1 || e == null ? e : l.isArray(e) ? e.map(Qe) : Jn(String(e));
372
+ }
373
+ function Kn(e) {
374
+ const t = /* @__PURE__ */ Object.create(null), a = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
375
+ let n;
376
+ for (; n = a.exec(e); )
377
+ t[n[1]] = n[2];
378
+ return t;
379
+ }
380
+ const Xn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
381
+ function pt(e, t, a, n, o) {
382
+ if (l.isFunction(n))
383
+ return n.call(this, t, a);
384
+ if (o && (t = a), !!l.isString(t)) {
385
+ if (l.isString(n))
386
+ return t.indexOf(n) !== -1;
387
+ if (l.isRegExp(n))
388
+ return n.test(t);
389
+ }
390
+ }
391
+ function Qn(e) {
392
+ return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, a, n) => a.toUpperCase() + n);
393
+ }
394
+ function Yn(e, t) {
395
+ const a = l.toCamelCase(" " + t);
396
+ ["get", "set", "has"].forEach((n) => {
397
+ Object.defineProperty(e, n + a, {
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(o, r, i) {
402
+ return this[n].call(this, t, o, r, i);
403
+ },
404
+ configurable: !0
405
+ });
406
+ });
407
+ }
408
+ class it {
409
+ constructor(t) {
410
+ t && this.set(t);
411
+ }
412
+ set(t, a, n) {
413
+ const o = this;
414
+ function r(s, u, c) {
415
+ const d = je(u);
416
+ if (!d)
417
+ return;
418
+ const f = l.findKey(o, d);
419
+ (!f || o[f] === void 0 || c === !0 || c === void 0 && o[f] !== !1) && (o[f || u] = Qe(s));
420
+ }
421
+ const i = (s, u) => l.forEach(s, (c, d) => r(c, d, u));
422
+ if (l.isPlainObject(t) || t instanceof this.constructor)
423
+ i(t, a);
424
+ else if (l.isString(t) && (t = t.trim()) && !Xn(t))
425
+ i(qn(t), a);
426
+ else if (l.isObject(t) && l.isSafeIterable(t)) {
427
+ let s = /* @__PURE__ */ Object.create(null), u, c;
428
+ for (const d of t) {
429
+ if (!l.isArray(d))
430
+ throw new TypeError("Object iterator must return a key-value pair");
431
+ c = d[0], l.hasOwnProp(s, c) ? (u = s[c], s[c] = l.isArray(u) ? [...u, d[1]] : [u, d[1]]) : s[c] = d[1];
432
+ }
433
+ i(s, a);
434
+ } else
435
+ t != null && r(a, t, n);
436
+ return this;
437
+ }
438
+ get(t, a) {
439
+ if (t = je(t), t) {
440
+ const n = l.findKey(this, t);
441
+ if (n) {
442
+ const o = this[n];
443
+ if (!a)
444
+ return o;
445
+ if (a === !0)
446
+ return Kn(o);
447
+ if (l.isFunction(a))
448
+ return a.call(this, o, n);
449
+ if (l.isRegExp(a))
450
+ return a.exec(o);
451
+ throw new TypeError("parser must be boolean|regexp|function");
452
+ }
453
+ }
454
+ }
455
+ has(t, a) {
456
+ if (t = je(t), t) {
457
+ const n = l.findKey(this, t);
458
+ return !!(n && this[n] !== void 0 && (!a || pt(this, this[n], n, a)));
459
+ }
460
+ return !1;
461
+ }
462
+ delete(t, a) {
463
+ const n = this;
464
+ let o = !1;
465
+ function r(i) {
466
+ if (i = je(i), i) {
467
+ const s = l.findKey(n, i);
468
+ s && (!a || pt(n, n[s], s, a)) && (delete n[s], o = !0);
469
+ }
470
+ }
471
+ return l.isArray(t) ? t.forEach(r) : r(t), o;
472
+ }
473
+ clear(t) {
474
+ const a = Object.keys(this);
475
+ let n = a.length, o = !1;
476
+ for (; n--; ) {
477
+ const r = a[n];
478
+ (!t || pt(this, this[r], r, t, !0)) && (delete this[r], o = !0);
479
+ }
480
+ return o;
481
+ }
482
+ normalize(t) {
483
+ const a = this, n = {};
484
+ return l.forEach(this, (o, r) => {
485
+ const i = l.findKey(n, r);
486
+ if (i) {
487
+ a[i] = Qe(o), delete a[r];
488
+ return;
489
+ }
490
+ const s = t ? Qn(r) : String(r).trim();
491
+ s !== r && delete a[r], a[s] = Qe(o), n[s] = !0;
492
+ }), this;
493
+ }
494
+ concat(...t) {
495
+ return this.constructor.concat(this, ...t);
496
+ }
497
+ toJSON(t) {
498
+ const a = /* @__PURE__ */ Object.create(null);
499
+ return l.forEach(this, (n, o) => {
500
+ n != null && n !== !1 && (a[o] = t && l.isArray(n) ? n.join(", ") : n);
501
+ }), a;
502
+ }
503
+ [Symbol.iterator]() {
504
+ return Object.entries(this.toJSON())[Symbol.iterator]();
505
+ }
506
+ toString() {
507
+ return Object.entries(this.toJSON()).map(([t, a]) => t + ": " + a).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, ...a) {
520
+ const n = new this(t);
521
+ return a.forEach((o) => n.set(o)), n;
522
+ }
523
+ static accessor(t) {
524
+ const a = (this[Gt] = this[Gt] = {
525
+ accessors: {}
526
+ }).accessors, n = this.prototype;
527
+ function o(r) {
528
+ const i = je(r);
529
+ a[i] || (Yn(n, r), a[i] = !0);
530
+ }
531
+ return l.isArray(t) ? t.forEach(o) : o(t), this;
532
+ }
533
+ }
534
+ it.accessor([
535
+ "Content-Type",
536
+ "Content-Length",
537
+ "Accept",
538
+ "Accept-Encoding",
539
+ "User-Agent",
540
+ "Authorization"
541
+ ]);
542
+ l.reduceDescriptors(it.prototype, ({ value: e }, t) => {
543
+ let a = t[0].toUpperCase() + t.slice(1);
544
+ return {
545
+ get: () => e,
546
+ set(n) {
547
+ this[a] = n;
548
+ }
549
+ };
550
+ });
551
+ l.freezeMethods(it);
552
+ const ce = it, Zn = "[REDACTED ****]";
553
+ function eo(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 to(e, t) {
565
+ const a = new Set(t.map((r) => String(r).toLowerCase())), n = [], o = (r) => {
566
+ if (r === null || typeof r != "object" || l.isBuffer(r))
567
+ return r;
568
+ if (n.indexOf(r) !== -1)
569
+ return;
570
+ r instanceof ce && (r = r.toJSON()), n.push(r);
571
+ let i;
572
+ if (l.isArray(r))
573
+ i = [], r.forEach((s, u) => {
574
+ const c = o(s);
575
+ l.isUndefined(c) || (i[u] = c);
576
+ });
577
+ else {
578
+ if (!l.isPlainObject(r) && eo(r))
579
+ return n.pop(), r;
580
+ i = /* @__PURE__ */ Object.create(null);
581
+ for (const [s, u] of Object.entries(r)) {
582
+ const c = a.has(s.toLowerCase()) ? Zn : o(u);
583
+ l.isUndefined(c) || (i[s] = c);
584
+ }
585
+ }
586
+ return n.pop(), i;
587
+ };
588
+ return o(e);
589
+ }
590
+ class ae extends Error {
591
+ static from(t, a, n, o, r, i) {
592
+ const s = new ae(t.message, a || t.code, n, o, r);
593
+ return Object.defineProperty(s, "cause", {
594
+ __proto__: null,
595
+ value: t,
596
+ writable: !0,
597
+ enumerable: !1,
598
+ configurable: !0
599
+ }), s.name = t.name, t.status != null && s.status == null && (s.status = t.status), i && Object.assign(s, i), s;
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, a, n, o, r) {
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, a && (this.code = a), n && (this.config = n), o && (this.request = o), r && (this.response = r, this.status = r.status);
622
+ }
623
+ toJSON() {
624
+ const t = this.config, a = t && l.hasOwnProp(t, "redact") ? t.redact : void 0, n = l.isArray(a) && a.length > 0 ? to(t, a) : 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: n,
639
+ code: this.code,
640
+ status: this.status
641
+ };
642
+ }
643
+ }
644
+ ae.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
645
+ ae.ERR_BAD_OPTION = "ERR_BAD_OPTION";
646
+ ae.ECONNABORTED = "ECONNABORTED";
647
+ ae.ETIMEDOUT = "ETIMEDOUT";
648
+ ae.ECONNREFUSED = "ECONNREFUSED";
649
+ ae.ERR_NETWORK = "ERR_NETWORK";
650
+ ae.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
651
+ ae.ERR_DEPRECATED = "ERR_DEPRECATED";
652
+ ae.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
653
+ ae.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
654
+ ae.ERR_CANCELED = "ERR_CANCELED";
655
+ ae.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
656
+ ae.ERR_INVALID_URL = "ERR_INVALID_URL";
657
+ ae.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
658
+ const T = ae, ao = null, ka = 100;
659
+ function wt(e) {
660
+ return l.isPlainObject(e) || l.isArray(e);
661
+ }
662
+ function xa(e) {
663
+ return l.endsWith(e, "[]") ? e.slice(0, -2) : e;
664
+ }
665
+ function ft(e, t, a) {
666
+ return e ? e.concat(t).map(function(n, o) {
667
+ return n = xa(n), !a && o ? "[" + n + "]" : n;
668
+ }).join(a ? "." : "") : t;
669
+ }
670
+ function no(e) {
671
+ return l.isArray(e) && !e.some(wt);
672
+ }
673
+ const oo = l.toFlatObject(l, {}, null, function(e) {
674
+ return /^is[A-Z]/.test(e);
675
+ });
676
+ function st(e, t, a) {
677
+ if (!l.isObject(e))
678
+ throw new TypeError("target must be an object");
679
+ t = t || new FormData(), a = l.toFlatObject(
680
+ a,
681
+ {
682
+ metaTokens: !0,
683
+ dots: !1,
684
+ indexes: !1
685
+ },
686
+ !1,
687
+ function(p, y) {
688
+ return !l.isUndefined(y[p]);
689
+ }
690
+ );
691
+ const n = a.metaTokens, o = a.visitor || P, r = a.dots, i = a.indexes, s = a.Blob || typeof Blob < "u" && Blob, u = a.maxDepth === void 0 ? ka : a.maxDepth, c = s && l.isSpecCompliantForm(t), d = [];
692
+ if (!l.isFunction(o))
693
+ throw new TypeError("visitor must be a function");
694
+ function f(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 (!c && l.isBlob(p))
702
+ throw new T("Blob is not supported. Use a Buffer instead.");
703
+ if (l.isArrayBuffer(p) || l.isTypedArray(p)) {
704
+ if (c && typeof s == "function")
705
+ return new s([p]);
706
+ if (typeof Buffer < "u")
707
+ return Buffer.from(p);
708
+ throw new T("Blob is not supported. Use a Buffer instead.", T.ERR_NOT_SUPPORT);
709
+ }
710
+ return p;
711
+ }
712
+ function w(p) {
713
+ if (p > u)
714
+ throw new T(
715
+ "Object is too deeply nested (" + p + " levels). Max depth: " + u,
716
+ T.ERR_FORM_DATA_DEPTH_EXCEEDED
717
+ );
718
+ }
719
+ function _(p, y) {
720
+ if (u === 1 / 0)
721
+ return JSON.stringify(p);
722
+ const C = [];
723
+ return JSON.stringify(p, function(A, V) {
724
+ if (!l.isObject(V))
725
+ return V;
726
+ for (; C.length && C[C.length - 1] !== this; )
727
+ C.pop();
728
+ return C.push(V), w(y + C.length - 1), V;
729
+ });
730
+ }
731
+ function P(p, y, C) {
732
+ let A = p;
733
+ if (l.isReactNative(t) && l.isReactNativeBlob(p))
734
+ return t.append(ft(C, y, r), f(p)), !1;
735
+ if (p && !C && typeof p == "object") {
736
+ if (l.endsWith(y, "{}"))
737
+ y = n ? y : y.slice(0, -2), p = _(p, 1);
738
+ else if (l.isArray(p) && no(p) || (l.isFileList(p) || l.endsWith(y, "[]")) && (A = l.toArray(p)))
739
+ return y = xa(y), A.forEach(function(V, Q) {
740
+ !(l.isUndefined(V) || V === null) && t.append(
741
+ // eslint-disable-next-line no-nested-ternary
742
+ i === !0 ? ft([y], Q, r) : i === null ? y : y + "[]",
743
+ f(V)
744
+ );
745
+ }), !1;
746
+ }
747
+ return wt(p) ? !0 : (t.append(ft(C, y, r), f(p)), !1);
748
+ }
749
+ const E = Object.assign(oo, {
750
+ defaultVisitor: P,
751
+ convertValue: f,
752
+ isVisitable: wt
753
+ });
754
+ function R(p, y, C = 0) {
755
+ if (!l.isUndefined(p)) {
756
+ if (w(C), d.indexOf(p) !== -1)
757
+ throw new Error("Circular reference detected in " + y.join("."));
758
+ d.push(p), l.forEach(p, function(A, V) {
759
+ (!(l.isUndefined(A) || A === null) && o.call(t, A, l.isString(V) ? V.trim() : V, y, E)) === !0 && R(A, y ? y.concat(V) : [V], C + 1);
760
+ }), d.pop();
761
+ }
762
+ }
763
+ if (!l.isObject(e))
764
+ throw new TypeError("data must be an object");
765
+ return R(e), t;
766
+ }
767
+ function $t(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(a) {
777
+ return t[a];
778
+ });
779
+ }
780
+ function Rt(e, t) {
781
+ this._pairs = [], e && st(e, this, t);
782
+ }
783
+ const Pa = Rt.prototype;
784
+ Pa.append = function(e, t) {
785
+ this._pairs.push([e, t]);
786
+ };
787
+ Pa.toString = function(e) {
788
+ const t = e ? (a) => e.call(this, a, $t) : $t;
789
+ return this._pairs.map(function(a) {
790
+ return t(a[0]) + "=" + t(a[1]);
791
+ }, "").join("&");
792
+ };
793
+ function ro(e) {
794
+ return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
795
+ }
796
+ function Ea(e, t, a) {
797
+ if (!t)
798
+ return e;
799
+ e = e || "";
800
+ const n = l.isFunction(a) ? {
801
+ serialize: a
802
+ } : a, o = l.getSafeProp(n, "encode") || ro, r = l.getSafeProp(n, "serialize");
803
+ let i;
804
+ if (r ? i = r(t, n) : i = l.isURLSearchParams(t) ? t.toString() : new Rt(t, n).toString(o), i) {
805
+ const s = e.indexOf("#");
806
+ s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
807
+ }
808
+ return e;
809
+ }
810
+ class io {
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, a, n) {
824
+ return this.handlers.push({
825
+ fulfilled: t,
826
+ rejected: a,
827
+ synchronous: n ? n.synchronous : !1,
828
+ runWhen: n ? n.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(a) {
861
+ a !== null && t(a);
862
+ });
863
+ }
864
+ }
865
+ const Jt = io, St = {
866
+ silentJSONParsing: !0,
867
+ forcedJSONParsing: !0,
868
+ clarifyTimeoutError: !1,
869
+ legacyInterceptorReqResOrdering: !0,
870
+ advertiseZstdAcceptEncoding: !1,
871
+ validateStatusUndefinedResolves: !0
872
+ }, so = typeof URLSearchParams < "u" ? URLSearchParams : Rt, lo = typeof FormData < "u" ? FormData : null, uo = typeof Blob < "u" ? Blob : null, co = {
873
+ isBrowser: !0,
874
+ classes: {
875
+ URLSearchParams: so,
876
+ FormData: lo,
877
+ Blob: uo
878
+ },
879
+ protocols: ["http", "https", "file", "blob", "url", "data"]
880
+ }, Tt = typeof window < "u" && typeof document < "u", kt = typeof navigator == "object" && navigator || void 0, po = Tt && (!kt || ["ReactNative", "NativeScript", "NS"].indexOf(kt.product) < 0), fo = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
881
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), mo = Tt && window.location.href || "http://localhost", go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
882
+ __proto__: null,
883
+ hasBrowserEnv: Tt,
884
+ hasStandardBrowserEnv: po,
885
+ hasStandardBrowserWebWorkerEnv: fo,
886
+ navigator: kt,
887
+ origin: mo
888
+ }, Symbol.toStringTag, { value: "Module" })), te = {
889
+ ...go,
890
+ ...co
891
+ };
892
+ function ho(e, t) {
893
+ return st(e, new te.classes.URLSearchParams(), {
894
+ visitor: function(a, n, o, r) {
895
+ return te.isNode && l.isBuffer(a) ? (this.append(n, a.toString("base64")), !1) : r.defaultVisitor.apply(this, arguments);
896
+ },
897
+ ...t
898
+ });
899
+ }
900
+ const Ht = ka;
901
+ function Ra(e) {
902
+ if (e > Ht)
903
+ throw new T(
904
+ "FormData field is too deeply nested (" + e + " levels). Max depth: " + Ht,
905
+ T.ERR_FORM_DATA_DEPTH_EXCEEDED
906
+ );
907
+ }
908
+ function bo(e) {
909
+ const t = [], a = /\w+|\[(\w*)]/g;
910
+ let n;
911
+ for (; (n = a.exec(e)) !== null; )
912
+ Ra(t.length), t.push(n[0] === "[]" ? "" : n[1] || n[0]);
913
+ return t;
914
+ }
915
+ function yo(e) {
916
+ const t = {}, a = Object.keys(e);
917
+ let n;
918
+ const o = a.length;
919
+ let r;
920
+ for (n = 0; n < o; n++)
921
+ r = a[n], t[r] = e[r];
922
+ return t;
923
+ }
924
+ function Sa(e) {
925
+ function t(a, n, o, r) {
926
+ Ra(r);
927
+ let i = a[r++];
928
+ if (i === "__proto__")
929
+ return !0;
930
+ const s = Number.isFinite(+i), u = r >= a.length;
931
+ return i = !i && l.isArray(o) ? o.length : i, u ? (l.hasOwnProp(o, i) ? o[i] = l.isArray(o[i]) ? o[i].concat(n) : [o[i], n] : o[i] = n, !s) : ((!l.hasOwnProp(o, i) || !l.isObject(o[i])) && (o[i] = []), t(a, n, o[i], r) && l.isArray(o[i]) && (o[i] = yo(o[i])), !s);
932
+ }
933
+ if (l.isFormData(e) && l.isFunction(e.entries)) {
934
+ const a = {};
935
+ return l.forEachEntry(e, (n, o) => {
936
+ t(bo(n), o, a, 0);
937
+ }), a;
938
+ }
939
+ return null;
940
+ }
941
+ const _e = (e, t) => e != null && l.hasOwnProp(e, t) ? e[t] : void 0;
942
+ function vo(e, t, a) {
943
+ if (l.isString(e))
944
+ try {
945
+ return (t || JSON.parse)(e), l.trim(e);
946
+ } catch (n) {
947
+ if (n.name !== "SyntaxError")
948
+ throw n;
949
+ }
950
+ return (a || JSON.stringify)(e);
951
+ }
952
+ const Ot = {
953
+ transitional: St,
954
+ adapter: ["xhr", "http", "fetch"],
955
+ transformRequest: [
956
+ function(e, t) {
957
+ const a = t.getContentType() || "", n = a.indexOf("application/json") > -1, o = l.isObject(e);
958
+ if (o && l.isHTMLForm(e) && (e = new FormData(e)), l.isFormData(e))
959
+ return n ? JSON.stringify(Sa(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 r;
967
+ if (o) {
968
+ const i = _e(this, "formSerializer");
969
+ if (a.indexOf("application/x-www-form-urlencoded") > -1)
970
+ return ho(e, i).toString();
971
+ if ((r = l.isFileList(e)) || a.indexOf("multipart/form-data") > -1) {
972
+ const s = _e(this, "env"), u = s && s.FormData;
973
+ return st(
974
+ r ? { "files[]": e } : e,
975
+ u && new u(),
976
+ i
977
+ );
978
+ }
979
+ }
980
+ return o || n ? (t.setContentType("application/json", !1), vo(e)) : e;
981
+ }
982
+ ],
983
+ transformResponse: [
984
+ function(e) {
985
+ const t = _e(this, "transitional") || Ot.transitional, a = t && t.forcedJSONParsing, n = _e(this, "responseType"), o = n === "json";
986
+ if (l.isResponse(e) || l.isReadableStream(e))
987
+ return e;
988
+ if (e && l.isString(e) && (a && !n || o)) {
989
+ const r = !(t && t.silentJSONParsing) && o;
990
+ try {
991
+ return JSON.parse(e, _e(this, "parseReviver"));
992
+ } catch (i) {
993
+ if (r)
994
+ throw i.name === "SyntaxError" ? T.from(i, T.ERR_BAD_RESPONSE, this, null, _e(this, "response")) : i;
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: te.classes.FormData,
1011
+ Blob: te.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
+ Ot.headers[e] = {};
1025
+ });
1026
+ const Ct = Ot;
1027
+ function mt(e, t) {
1028
+ const a = this || Ct, n = t || a, o = ce.from(n.headers);
1029
+ let r = n.data;
1030
+ return l.forEach(e, function(i) {
1031
+ r = i.call(a, r, o.normalize(), t ? t.status : void 0);
1032
+ }), o.normalize(), r;
1033
+ }
1034
+ function Ta(e) {
1035
+ return !!(e && e.__CANCEL__);
1036
+ }
1037
+ class wo extends T {
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, a, n) {
1048
+ super(t ?? "canceled", T.ERR_CANCELED, a, n), this.name = "CanceledError", this.__CANCEL__ = !0;
1049
+ }
1050
+ }
1051
+ const Ge = wo;
1052
+ function Oa(e, t, a) {
1053
+ const n = a.config.validateStatus;
1054
+ !a.status || !n || n(a.status) ? e(a) : t(new T(
1055
+ "Request failed with status code " + a.status,
1056
+ a.status >= 400 && a.status < 500 ? T.ERR_BAD_REQUEST : T.ERR_BAD_RESPONSE,
1057
+ a.config,
1058
+ a.request,
1059
+ a
1060
+ ));
1061
+ }
1062
+ function ko(e) {
1063
+ const t = /^([-+\w]{1,25}):(?:\/\/)?/.exec(e);
1064
+ return t && t[1] || "";
1065
+ }
1066
+ function xo(e, t) {
1067
+ e = e || 10;
1068
+ const a = new Array(e), n = new Array(e);
1069
+ let o = 0, r = 0, i;
1070
+ return t = t !== void 0 ? t : 1e3, function(s) {
1071
+ const u = Date.now(), c = n[r];
1072
+ i || (i = u), a[o] = s, n[o] = u;
1073
+ let d = r, f = 0;
1074
+ for (; d !== o; )
1075
+ f += a[d++], d = d % e;
1076
+ if (o = (o + 1) % e, o === r && (r = (r + 1) % e), u - i < t)
1077
+ return;
1078
+ const w = c && u - c;
1079
+ return w ? Math.round(f * 1e3 / w) : void 0;
1080
+ };
1081
+ }
1082
+ function Po(e, t) {
1083
+ let a = 0, n = 1e3 / t, o, r;
1084
+ const i = (s, u = Date.now()) => {
1085
+ a = u, o = null, r && (clearTimeout(r), r = null), e(...s);
1086
+ };
1087
+ return [(...s) => {
1088
+ const u = Date.now(), c = u - a;
1089
+ c >= n ? i(s, u) : (o = s, r || (r = setTimeout(() => {
1090
+ r = null, i(o);
1091
+ }, n - c)));
1092
+ }, () => o && i(o)];
1093
+ }
1094
+ const at = (e, t, a = 3) => {
1095
+ let n = 0;
1096
+ const o = xo(50, 250);
1097
+ return Po((r) => {
1098
+ if (!r || typeof r.loaded != "number")
1099
+ return;
1100
+ const i = r.loaded, s = r.lengthComputable ? r.total : void 0, u = s != null ? Math.min(i, s) : i, c = Math.max(0, u - n), d = o(c);
1101
+ n = Math.max(n, u);
1102
+ const f = {
1103
+ loaded: u,
1104
+ total: s,
1105
+ progress: s ? u / s : void 0,
1106
+ bytes: c,
1107
+ rate: d || void 0,
1108
+ estimated: d && s ? (s - u) / d : void 0,
1109
+ event: r,
1110
+ lengthComputable: s != null,
1111
+ [t ? "download" : "upload"]: !0
1112
+ };
1113
+ e(f);
1114
+ }, a);
1115
+ }, Kt = (e, t) => {
1116
+ const a = e != null;
1117
+ return [
1118
+ (n) => t[0]({
1119
+ lengthComputable: a,
1120
+ total: e,
1121
+ loaded: n
1122
+ }),
1123
+ t[1]
1124
+ ];
1125
+ }, Xt = (e) => (...t) => l.asap(() => e(...t)), Eo = te.hasStandardBrowserEnv ? ((e, t) => (a) => (a = new URL(a, te.origin), e.protocol === a.protocol && e.host === a.host && (t || e.port === a.port)))(
1126
+ new URL(te.origin),
1127
+ te.navigator && /(msie|trident)/i.test(te.navigator.userAgent)
1128
+ ) : () => !0, Ro = te.hasStandardBrowserEnv ? (
1129
+ // Standard browser envs support document.cookie
1130
+ {
1131
+ write(e, t, a, n, o, r, i) {
1132
+ if (typeof document > "u")
1133
+ return;
1134
+ const s = [`${e}=${encodeURIComponent(t)}`];
1135
+ l.isNumber(a) && s.push(`expires=${new Date(a).toUTCString()}`), l.isString(n) && s.push(`path=${n}`), l.isString(o) && s.push(`domain=${o}`), r === !0 && s.push("secure"), l.isString(i) && s.push(`SameSite=${i}`), document.cookie = s.join("; ");
1136
+ },
1137
+ read(e) {
1138
+ if (typeof document > "u")
1139
+ return null;
1140
+ const t = document.cookie.split(";");
1141
+ for (let a = 0; a < t.length; a++) {
1142
+ const n = t[a].replace(/^\s+/, ""), o = n.indexOf("=");
1143
+ if (o !== -1 && n.slice(0, o) === e)
1144
+ try {
1145
+ return decodeURIComponent(n.slice(o + 1));
1146
+ } catch {
1147
+ return n.slice(o + 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 So(e) {
1169
+ return typeof e != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1170
+ }
1171
+ function To(e, t) {
1172
+ return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1173
+ }
1174
+ const Oo = /^https?:(?!\/\/)/i, Co = /[\t\n\r]/g;
1175
+ function Ao(e) {
1176
+ let t = 0;
1177
+ for (; t < e.length && e.charCodeAt(t) <= 32; )
1178
+ t++;
1179
+ return e.slice(t);
1180
+ }
1181
+ function Bo(e) {
1182
+ return Ao(e).replace(Co, "");
1183
+ }
1184
+ function Qt(e, t) {
1185
+ if (typeof e == "string" && Oo.test(Bo(e)))
1186
+ throw new T(
1187
+ 'Invalid URL: missing "//" after protocol',
1188
+ T.ERR_INVALID_URL,
1189
+ t
1190
+ );
1191
+ }
1192
+ function Ca(e, t, a, n) {
1193
+ Qt(t, n);
1194
+ let o = !So(t);
1195
+ return e && (o || a === !1) ? (Qt(e, n), To(e, t)) : t;
1196
+ }
1197
+ const Yt = (e) => e instanceof ce ? { ...e } : e;
1198
+ function Ae(e, t) {
1199
+ e = e || {}, t = t || {};
1200
+ const a = /* @__PURE__ */ Object.create(null);
1201
+ Object.defineProperty(a, "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 n(d, f, w, _) {
1211
+ return l.isPlainObject(d) && l.isPlainObject(f) ? l.merge.call({ caseless: _ }, d, f) : l.isPlainObject(f) ? l.merge({}, f) : l.isArray(f) ? f.slice() : f;
1212
+ }
1213
+ function o(d, f, w, _) {
1214
+ if (l.isUndefined(f)) {
1215
+ if (!l.isUndefined(d))
1216
+ return n(void 0, d, w, _);
1217
+ } else
1218
+ return n(d, f, w, _);
1219
+ }
1220
+ function r(d, f) {
1221
+ if (!l.isUndefined(f))
1222
+ return n(void 0, f);
1223
+ }
1224
+ function i(d, f) {
1225
+ if (l.isUndefined(f)) {
1226
+ if (!l.isUndefined(d))
1227
+ return n(void 0, d);
1228
+ } else
1229
+ return n(void 0, f);
1230
+ }
1231
+ function s(d) {
1232
+ const f = l.hasOwnProp(t, "transitional") ? t.transitional : void 0;
1233
+ if (!l.isUndefined(f))
1234
+ if (l.isPlainObject(f)) {
1235
+ if (l.hasOwnProp(f, d))
1236
+ return f[d];
1237
+ } else
1238
+ return;
1239
+ const w = l.hasOwnProp(e, "transitional") ? e.transitional : void 0;
1240
+ if (l.isPlainObject(w) && l.hasOwnProp(w, d))
1241
+ return w[d];
1242
+ }
1243
+ function u(d, f, w) {
1244
+ if (l.hasOwnProp(t, w))
1245
+ return n(d, f);
1246
+ if (l.hasOwnProp(e, w))
1247
+ return n(void 0, d);
1248
+ }
1249
+ const c = {
1250
+ url: r,
1251
+ method: r,
1252
+ data: r,
1253
+ baseURL: i,
1254
+ transformRequest: i,
1255
+ transformResponse: i,
1256
+ paramsSerializer: i,
1257
+ timeout: i,
1258
+ timeoutMessage: i,
1259
+ withCredentials: i,
1260
+ withXSRFToken: i,
1261
+ adapter: i,
1262
+ responseType: i,
1263
+ xsrfCookieName: i,
1264
+ xsrfHeaderName: i,
1265
+ onUploadProgress: i,
1266
+ onDownloadProgress: i,
1267
+ decompress: i,
1268
+ maxContentLength: i,
1269
+ maxBodyLength: i,
1270
+ beforeRedirect: i,
1271
+ transport: i,
1272
+ httpAgent: i,
1273
+ httpsAgent: i,
1274
+ cancelToken: i,
1275
+ socketPath: i,
1276
+ allowedSocketPaths: i,
1277
+ responseEncoding: i,
1278
+ validateStatus: u,
1279
+ headers: (d, f, w) => o(Yt(d), Yt(f), w, !0)
1280
+ };
1281
+ return l.forEach(Object.keys({ ...e, ...t }), function(d) {
1282
+ if (d === "__proto__" || d === "constructor" || d === "prototype")
1283
+ return;
1284
+ const f = l.hasOwnProp(c, d) ? c[d] : o, w = l.hasOwnProp(e, d) ? e[d] : void 0, _ = l.hasOwnProp(t, d) ? t[d] : void 0, P = f(w, _, d);
1285
+ l.isUndefined(P) && f !== u || (a[d] = P);
1286
+ }), l.hasOwnProp(t, "validateStatus") && l.isUndefined(t.validateStatus) && s("validateStatusUndefinedResolves") === !1 && (l.hasOwnProp(e, "validateStatus") ? a.validateStatus = n(void 0, e.validateStatus) : delete a.validateStatus), a;
1287
+ }
1288
+ const _o = ["content-type", "content-length"];
1289
+ function Do(e, t, a) {
1290
+ if (a !== "content-only") {
1291
+ e.set(t);
1292
+ return;
1293
+ }
1294
+ Object.entries(t || {}).forEach(([n, o]) => {
1295
+ _o.includes(n.toLowerCase()) && e.set(n, o);
1296
+ });
1297
+ }
1298
+ const Mo = (e) => encodeURIComponent(e).replace(
1299
+ /%([0-9A-F]{2})/gi,
1300
+ (t, a) => String.fromCharCode(parseInt(a, 16))
1301
+ );
1302
+ function Aa(e) {
1303
+ const t = Ae({}, e), a = (w) => l.hasOwnProp(t, w) ? t[w] : void 0, n = a("data");
1304
+ let o = a("withXSRFToken");
1305
+ const r = a("xsrfHeaderName"), i = a("xsrfCookieName");
1306
+ let s = a("headers");
1307
+ const u = a("auth"), c = a("baseURL"), d = a("allowAbsoluteUrls"), f = a("url");
1308
+ if (t.headers = s = ce.from(s), t.url = Ea(
1309
+ Ca(c, f, d, t),
1310
+ a("params"),
1311
+ a("paramsSerializer")
1312
+ ), u) {
1313
+ const w = l.getSafeProp(u, "username") || "", _ = l.getSafeProp(u, "password") || "";
1314
+ try {
1315
+ s.set(
1316
+ "Authorization",
1317
+ "Basic " + btoa(w + ":" + (_ ? Mo(_) : ""))
1318
+ );
1319
+ } catch (P) {
1320
+ throw T.from(P, T.ERR_BAD_OPTION_VALUE, e);
1321
+ }
1322
+ }
1323
+ if (l.isFormData(n) && (te.hasStandardBrowserEnv || te.hasStandardBrowserWebWorkerEnv || l.isReactNative(n) ? s.setContentType(void 0) : l.isFunction(n.getHeaders) && Do(s, n.getHeaders(), a("formDataHeaderPolicy"))), te.hasStandardBrowserEnv && (l.isFunction(o) && (o = o(t)), o === !0 || o == null && Eo(t.url))) {
1324
+ const w = r && i && Ro.read(i);
1325
+ w && s.set(r, w);
1326
+ }
1327
+ return t;
1328
+ }
1329
+ const No = typeof XMLHttpRequest < "u", Io = No && function(e) {
1330
+ return new Promise(function(t, a) {
1331
+ const n = Aa(e);
1332
+ let o = n.data;
1333
+ const r = ce.from(n.headers).normalize();
1334
+ let { responseType: i, onUploadProgress: s, onDownloadProgress: u } = n, c, d, f, w, _;
1335
+ function P() {
1336
+ w && w(), _ && _(), n.cancelToken && n.cancelToken.unsubscribe(c), n.signal && n.signal.removeEventListener("abort", c);
1337
+ }
1338
+ let E = new XMLHttpRequest();
1339
+ E.open(n.method.toUpperCase(), n.url, !0), E.timeout = n.timeout;
1340
+ function R() {
1341
+ if (!E)
1342
+ return;
1343
+ const y = ce.from(
1344
+ "getAllResponseHeaders" in E && E.getAllResponseHeaders()
1345
+ ), C = {
1346
+ data: !i || i === "text" || i === "json" ? E.responseText : E.response,
1347
+ status: E.status,
1348
+ statusText: E.statusText,
1349
+ headers: y,
1350
+ config: e,
1351
+ request: E
1352
+ };
1353
+ Oa(
1354
+ function(A) {
1355
+ t(A), P();
1356
+ },
1357
+ function(A) {
1358
+ a(A), P();
1359
+ },
1360
+ C
1361
+ ), E = null;
1362
+ }
1363
+ "onloadend" in E ? E.onloadend = R : E.onreadystatechange = function() {
1364
+ !E || E.readyState !== 4 || E.status === 0 && !(E.responseURL && E.responseURL.startsWith("file:")) || setTimeout(R);
1365
+ }, E.onabort = function() {
1366
+ E && (a(new T("Request aborted", T.ECONNABORTED, e, E)), P(), E = null);
1367
+ }, E.onerror = function(y) {
1368
+ const C = y && y.message ? y.message : "Network Error", A = new T(C, T.ERR_NETWORK, e, E);
1369
+ A.event = y || null, a(A), P(), E = null;
1370
+ }, E.ontimeout = function() {
1371
+ let y = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded";
1372
+ const C = n.transitional || St;
1373
+ n.timeoutErrorMessage && (y = n.timeoutErrorMessage), a(
1374
+ new T(
1375
+ y,
1376
+ C.clarifyTimeoutError ? T.ETIMEDOUT : T.ECONNABORTED,
1377
+ e,
1378
+ E
1379
+ )
1380
+ ), P(), E = null;
1381
+ }, o === void 0 && r.setContentType(null), "setRequestHeader" in E && l.forEach(wa(r), function(y, C) {
1382
+ E.setRequestHeader(C, y);
1383
+ }), l.isUndefined(n.withCredentials) || (E.withCredentials = !!n.withCredentials), i && i !== "json" && (E.responseType = n.responseType), u && ([f, _] = at(u, !0), E.addEventListener("progress", f)), s && E.upload && ([d, w] = at(s), E.upload.addEventListener("progress", d), E.upload.addEventListener("loadend", w)), (n.cancelToken || n.signal) && (c = (y) => {
1384
+ E && (a(!y || y.type ? new Ge(null, e, E) : y), E.abort(), P(), E = null);
1385
+ }, n.cancelToken && n.cancelToken.subscribe(c), n.signal && (n.signal.aborted ? c() : n.signal.addEventListener("abort", c)));
1386
+ const p = ko(n.url);
1387
+ if (p && !te.protocols.includes(p)) {
1388
+ a(
1389
+ new T(
1390
+ "Unsupported protocol " + p + ":",
1391
+ T.ERR_BAD_REQUEST,
1392
+ e
1393
+ )
1394
+ ), P();
1395
+ return;
1396
+ }
1397
+ E.send(o || null);
1398
+ });
1399
+ }, Uo = (e, t) => {
1400
+ if (e = e ? e.filter(Boolean) : [], !t && !e.length)
1401
+ return;
1402
+ const a = new AbortController();
1403
+ let n = !1;
1404
+ const o = function(u) {
1405
+ if (!n) {
1406
+ n = !0, i();
1407
+ const c = u instanceof Error ? u : this.reason;
1408
+ a.abort(
1409
+ c instanceof T ? c : new Ge(c instanceof Error ? c.message : c)
1410
+ );
1411
+ }
1412
+ };
1413
+ let r = t && setTimeout(() => {
1414
+ r = null, o(new T(`timeout of ${t}ms exceeded`, T.ETIMEDOUT));
1415
+ }, t);
1416
+ const i = () => {
1417
+ e && (r && clearTimeout(r), r = null, e.forEach((u) => {
1418
+ u.unsubscribe ? u.unsubscribe(o) : u.removeEventListener("abort", o);
1419
+ }), e = null);
1420
+ };
1421
+ e.forEach((u) => u.addEventListener("abort", o, { once: !0 }));
1422
+ const { signal: s } = a;
1423
+ return s.unsubscribe = () => l.asap(i), s;
1424
+ }, Lo = Uo, jo = function* (e, t) {
1425
+ let a = e.byteLength;
1426
+ if (!t || a < t) {
1427
+ yield e;
1428
+ return;
1429
+ }
1430
+ let n = 0, o;
1431
+ for (; n < a; )
1432
+ o = n + t, yield e.slice(n, o), n = o;
1433
+ }, Fo = async function* (e, t) {
1434
+ for await (const a of zo(e))
1435
+ yield* jo(a, t);
1436
+ }, zo = 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: a, value: n } = await t.read();
1445
+ if (a)
1446
+ break;
1447
+ yield n;
1448
+ }
1449
+ } finally {
1450
+ await t.cancel();
1451
+ }
1452
+ }, Zt = (e, t, a, n) => {
1453
+ const o = Fo(e, t);
1454
+ let r = 0, i, s = (u) => {
1455
+ i || (i = !0, n && n(u));
1456
+ };
1457
+ return new ReadableStream(
1458
+ {
1459
+ async pull(u) {
1460
+ try {
1461
+ const { done: c, value: d } = await o.next();
1462
+ if (c) {
1463
+ s(), u.close();
1464
+ return;
1465
+ }
1466
+ let f = d.byteLength;
1467
+ if (a) {
1468
+ let w = r += f;
1469
+ a(w);
1470
+ }
1471
+ u.enqueue(new Uint8Array(d));
1472
+ } catch (c) {
1473
+ throw s(c), c;
1474
+ }
1475
+ },
1476
+ cancel(u) {
1477
+ return s(u), o.return();
1478
+ }
1479
+ },
1480
+ {
1481
+ highWaterMark: 2
1482
+ }
1483
+ );
1484
+ }, nt = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102, Vo = (e, t, a) => t + 2 < a && nt(e.charCodeAt(t + 1)) && nt(e.charCodeAt(t + 2));
1485
+ function qo(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 a = e.slice(5, t), n = e.slice(t + 1);
1492
+ if (/;base64/i.test(a)) {
1493
+ let r = n.length;
1494
+ const i = n.length;
1495
+ for (let f = 0; f < i; f++)
1496
+ if (n.charCodeAt(f) === 37 && f + 2 < i) {
1497
+ const w = n.charCodeAt(f + 1), _ = n.charCodeAt(f + 2);
1498
+ nt(w) && nt(_) && (r -= 2, f += 2);
1499
+ }
1500
+ let s = 0, u = i - 1;
1501
+ const c = (f) => f >= 2 && n.charCodeAt(f - 2) === 37 && // '%'
1502
+ n.charCodeAt(f - 1) === 51 && // '3'
1503
+ (n.charCodeAt(f) === 68 || n.charCodeAt(f) === 100);
1504
+ u >= 0 && (n.charCodeAt(u) === 61 ? (s++, u--) : c(u) && (s++, u -= 3)), s === 1 && u >= 0 && (n.charCodeAt(u) === 61 || c(u)) && s++;
1505
+ const d = Math.floor(r / 4) * 3 - (s || 0);
1506
+ return d > 0 ? d : 0;
1507
+ }
1508
+ let o = 0;
1509
+ for (let r = 0, i = n.length; r < i; r++) {
1510
+ const s = n.charCodeAt(r);
1511
+ if (s === 37 && Vo(n, r, i))
1512
+ o += 1, r += 2;
1513
+ else if (s < 128)
1514
+ o += 1;
1515
+ else if (s < 2048)
1516
+ o += 2;
1517
+ else if (s >= 55296 && s <= 56319 && r + 1 < i) {
1518
+ const u = n.charCodeAt(r + 1);
1519
+ u >= 56320 && u <= 57343 ? (o += 4, r++) : o += 3;
1520
+ } else
1521
+ o += 3;
1522
+ }
1523
+ return o;
1524
+ }
1525
+ const At = "1.18.1", ea = 64 * 1024, { isFunction: Ke } = l, Wo = (e) => encodeURIComponent(e).replace(
1526
+ /%([0-9A-F]{2})/gi,
1527
+ (t, a) => String.fromCharCode(parseInt(a, 16))
1528
+ ), ta = (e) => {
1529
+ if (!l.isString(e))
1530
+ return e;
1531
+ try {
1532
+ return decodeURIComponent(e);
1533
+ } catch {
1534
+ return e;
1535
+ }
1536
+ }, aa = (e, ...t) => {
1537
+ try {
1538
+ return !!e(...t);
1539
+ } catch {
1540
+ return !1;
1541
+ }
1542
+ }, Go = (e) => {
1543
+ const t = e.indexOf("://");
1544
+ let a = e;
1545
+ return t !== -1 && (a = a.slice(t + 3)), a.includes("@") || a.includes(":");
1546
+ }, $o = (e) => {
1547
+ const t = l.global !== void 0 && l.global !== null ? l.global : globalThis, { ReadableStream: a, TextEncoder: n } = 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: o, Request: r, Response: i } = e, s = o ? Ke(o) : typeof fetch == "function", u = Ke(r), c = Ke(i);
1559
+ if (!s)
1560
+ return !1;
1561
+ const d = s && Ke(a), f = s && (typeof n == "function" ? ((p) => (y) => p.encode(y))(new n()) : async (p) => new Uint8Array(await new r(p).arrayBuffer())), w = u && d && aa(() => {
1562
+ let p = !1;
1563
+ const y = new r(te.origin, {
1564
+ body: new a(),
1565
+ method: "POST",
1566
+ get duplex() {
1567
+ return p = !0, "half";
1568
+ }
1569
+ }), C = y.headers.has("Content-Type");
1570
+ return y.body != null && y.body.cancel(), p && !C;
1571
+ }), _ = c && d && aa(() => l.isReadableStream(new i("").body)), P = {
1572
+ stream: _ && ((p) => p.body)
1573
+ };
1574
+ s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((p) => {
1575
+ !P[p] && (P[p] = (y, C) => {
1576
+ let A = y && y[p];
1577
+ if (A)
1578
+ return A.call(y);
1579
+ throw new T(
1580
+ `Response type '${p}' is not supported`,
1581
+ T.ERR_NOT_SUPPORT,
1582
+ C
1583
+ );
1584
+ });
1585
+ });
1586
+ const E = 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 r(te.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 f(p)).byteLength;
1600
+ }, R = async (p, y) => l.toFiniteNumber(p.getContentLength()) ?? E(y);
1601
+ return async (p) => {
1602
+ let {
1603
+ url: y,
1604
+ method: C,
1605
+ data: A,
1606
+ signal: V,
1607
+ cancelToken: Q,
1608
+ timeout: S,
1609
+ onDownloadProgress: re,
1610
+ onUploadProgress: O,
1611
+ responseType: N,
1612
+ headers: J,
1613
+ withCredentials: le = "same-origin",
1614
+ fetchOptions: H,
1615
+ maxContentLength: Y,
1616
+ maxBodyLength: m
1617
+ } = Aa(p);
1618
+ const g = l.isNumber(Y) && Y > -1, L = l.isNumber(m) && m > -1, U = (q) => l.hasOwnProp(p, q) ? p[q] : void 0;
1619
+ let B = o || fetch;
1620
+ N = N ? (N + "").toLowerCase() : "text";
1621
+ let M = Lo(
1622
+ [V, Q && Q.toAbortSignal()],
1623
+ S
1624
+ ), I = null;
1625
+ const ie = M && M.unsubscribe && (() => {
1626
+ M.unsubscribe();
1627
+ });
1628
+ let Pe, Ue = null;
1629
+ const Lt = () => new T(
1630
+ "Request body larger than maxBodyLength limit",
1631
+ T.ERR_BAD_REQUEST,
1632
+ p,
1633
+ I
1634
+ );
1635
+ try {
1636
+ let q;
1637
+ const fe = U("auth");
1638
+ if (fe) {
1639
+ const D = l.getSafeProp(fe, "username") || "", ue = l.getSafeProp(fe, "password") || "";
1640
+ q = {
1641
+ username: D,
1642
+ password: ue
1643
+ };
1644
+ }
1645
+ if (Go(y)) {
1646
+ const D = new URL(y, te.origin);
1647
+ if (!q && (D.username || D.password)) {
1648
+ const ue = ta(D.username), Ee = ta(D.password);
1649
+ q = {
1650
+ username: ue,
1651
+ password: Ee
1652
+ };
1653
+ }
1654
+ (D.username || D.password) && (D.username = "", D.password = "", y = D.href);
1655
+ }
1656
+ if (q && (J.delete("authorization"), J.set(
1657
+ "Authorization",
1658
+ "Basic " + btoa(Wo((q.username || "") + ":" + (q.password || "")))
1659
+ )), g && typeof y == "string" && y.startsWith("data:") && qo(y) > Y)
1660
+ throw new T(
1661
+ "maxContentLength size of " + Y + " exceeded",
1662
+ T.ERR_BAD_RESPONSE,
1663
+ p,
1664
+ I
1665
+ );
1666
+ if (L && C !== "get" && C !== "head") {
1667
+ const D = await E(A);
1668
+ if (typeof D == "number" && isFinite(D) && (Pe = D, D > m))
1669
+ throw Lt();
1670
+ }
1671
+ const He = L && (l.isReadableStream(A) || l.isStream(A)), jt = (D, ue, Ee) => Zt(
1672
+ D,
1673
+ ea,
1674
+ (Te) => {
1675
+ if (L && Te > m)
1676
+ throw Ue = Lt();
1677
+ ue && ue(Te);
1678
+ },
1679
+ Ee
1680
+ );
1681
+ if (w && C !== "get" && C !== "head" && (O || He)) {
1682
+ if (Pe = Pe ?? await R(J, A), Pe !== 0 || He) {
1683
+ let D = new r(y, {
1684
+ method: "POST",
1685
+ body: A,
1686
+ duplex: "half"
1687
+ }), ue;
1688
+ if (l.isFormData(A) && (ue = D.headers.get("content-type")) && J.setContentType(ue), D.body) {
1689
+ const [Ee, Te] = O && Kt(
1690
+ Pe,
1691
+ at(Xt(O))
1692
+ ) || [];
1693
+ A = jt(D.body, Ee, Te);
1694
+ }
1695
+ }
1696
+ } else if (He && !u && d && C !== "get" && C !== "head")
1697
+ A = jt(A);
1698
+ else if (He && u && !w && C !== "get" && C !== "head")
1699
+ throw new T(
1700
+ "Stream request bodies are not supported by the current fetch implementation",
1701
+ T.ERR_NOT_SUPPORT,
1702
+ p,
1703
+ I
1704
+ );
1705
+ l.isString(le) || (le = le ? "include" : "omit");
1706
+ const Wa = u && "credentials" in r.prototype;
1707
+ if (l.isFormData(A)) {
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/" + At, !1);
1712
+ const Ft = {
1713
+ ...H,
1714
+ signal: M,
1715
+ method: C.toUpperCase(),
1716
+ headers: wa(J.normalize()),
1717
+ body: A,
1718
+ duplex: "half",
1719
+ credentials: Wa ? le : void 0
1720
+ };
1721
+ I = u && new r(y, Ft);
1722
+ let we = await (u ? B(I, H) : B(y, Ft));
1723
+ const zt = ce.from(we.headers);
1724
+ if (g) {
1725
+ const D = l.toFiniteNumber(zt.getContentLength());
1726
+ if (D != null && D > Y)
1727
+ throw new T(
1728
+ "maxContentLength size of " + Y + " exceeded",
1729
+ T.ERR_BAD_RESPONSE,
1730
+ p,
1731
+ I
1732
+ );
1733
+ }
1734
+ const dt = _ && (N === "stream" || N === "response");
1735
+ if (_ && we.body && (re || g || dt && ie)) {
1736
+ const D = {};
1737
+ ["status", "statusText", "headers"].forEach((Le) => {
1738
+ D[Le] = we[Le];
1739
+ });
1740
+ const ue = l.toFiniteNumber(zt.getContentLength()), [Ee, Te] = re && Kt(
1741
+ ue,
1742
+ at(Xt(re), !0)
1743
+ ) || [];
1744
+ let Vt = 0;
1745
+ const Ga = (Le) => {
1746
+ if (g && (Vt = Le, Vt > Y))
1747
+ throw new T(
1748
+ "maxContentLength size of " + Y + " exceeded",
1749
+ T.ERR_BAD_RESPONSE,
1750
+ p,
1751
+ I
1752
+ );
1753
+ Ee && Ee(Le);
1754
+ };
1755
+ we = new i(
1756
+ Zt(we.body, ea, Ga, () => {
1757
+ Te && Te(), ie && ie();
1758
+ }),
1759
+ D
1760
+ );
1761
+ }
1762
+ N = N || "text";
1763
+ let ke = await P[l.findKey(P, N) || "text"](
1764
+ we,
1765
+ p
1766
+ );
1767
+ if (g && !_ && !dt) {
1768
+ let D;
1769
+ if (ke != null && (typeof ke.byteLength == "number" ? D = ke.byteLength : typeof ke.size == "number" ? D = ke.size : typeof ke == "string" && (D = typeof n == "function" ? new n().encode(ke).byteLength : ke.length)), typeof D == "number" && D > Y)
1770
+ throw new T(
1771
+ "maxContentLength size of " + Y + " exceeded",
1772
+ T.ERR_BAD_RESPONSE,
1773
+ p,
1774
+ I
1775
+ );
1776
+ }
1777
+ return !dt && ie && ie(), await new Promise((D, ue) => {
1778
+ Oa(D, ue, {
1779
+ data: ke,
1780
+ headers: ce.from(we.headers),
1781
+ status: we.status,
1782
+ statusText: we.statusText,
1783
+ config: p,
1784
+ request: I
1785
+ });
1786
+ });
1787
+ } catch (q) {
1788
+ if (ie && ie(), M && M.aborted && M.reason instanceof T) {
1789
+ const fe = M.reason;
1790
+ throw fe.config = p, I && (fe.request = I), q !== fe && Object.defineProperty(fe, "cause", {
1791
+ __proto__: null,
1792
+ value: q,
1793
+ writable: !0,
1794
+ enumerable: !1,
1795
+ configurable: !0
1796
+ }), fe;
1797
+ }
1798
+ if (Ue)
1799
+ throw I && !Ue.request && (Ue.request = I), Ue;
1800
+ if (q instanceof T)
1801
+ throw I && !q.request && (q.request = I), q;
1802
+ if (q && q.name === "TypeError" && /Load failed|fetch/i.test(q.message)) {
1803
+ const fe = new T(
1804
+ "Network Error",
1805
+ T.ERR_NETWORK,
1806
+ p,
1807
+ I,
1808
+ q && q.response
1809
+ );
1810
+ throw Object.defineProperty(fe, "cause", {
1811
+ __proto__: null,
1812
+ value: q.cause || q,
1813
+ writable: !0,
1814
+ enumerable: !1,
1815
+ configurable: !0
1816
+ }), fe;
1817
+ }
1818
+ throw T.from(q, q && q.code, p, I, q && q.response);
1819
+ }
1820
+ };
1821
+ }, Jo = /* @__PURE__ */ new Map(), Ba = (e) => {
1822
+ let t = e && e.env || {};
1823
+ const { fetch: a, Request: n, Response: o } = t, r = [n, o, a];
1824
+ let i = r.length, s = i, u, c, d = Jo;
1825
+ for (; s--; )
1826
+ u = r[s], c = d.get(u), c === void 0 && d.set(u, c = s ? /* @__PURE__ */ new Map() : $o(t)), d = c;
1827
+ return c;
1828
+ };
1829
+ Ba();
1830
+ const Bt = {
1831
+ http: ao,
1832
+ xhr: Io,
1833
+ fetch: {
1834
+ get: Ba
1835
+ }
1836
+ };
1837
+ l.forEach(Bt, (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 na = (e) => `- ${e}`, Ho = (e) => l.isFunction(e) || e === null || e === !1;
1847
+ function Ko(e, t) {
1848
+ e = l.isArray(e) ? e : [e];
1849
+ const { length: a } = e;
1850
+ let n, o;
1851
+ const r = {};
1852
+ for (let i = 0; i < a; i++) {
1853
+ n = e[i];
1854
+ let s;
1855
+ if (o = n, !Ho(n) && (o = Bt[(s = String(n)).toLowerCase()], o === void 0))
1856
+ throw new T(`Unknown adapter '${s}'`);
1857
+ if (o && (l.isFunction(o) || (o = o.get(t))))
1858
+ break;
1859
+ r[s || "#" + i] = o;
1860
+ }
1861
+ if (!o) {
1862
+ const i = Object.entries(r).map(
1863
+ ([u, c]) => `adapter ${u} ` + (c === !1 ? "is not supported by the environment" : "is not available in the build")
1864
+ );
1865
+ let s = a ? i.length > 1 ? `since :
1866
+ ` + i.map(na).join(`
1867
+ `) : " " + na(i[0]) : "as no adapter specified";
1868
+ throw new T(
1869
+ "There is no suitable adapter to dispatch the request " + s,
1870
+ T.ERR_NOT_SUPPORT
1871
+ );
1872
+ }
1873
+ return o;
1874
+ }
1875
+ const _a = {
1876
+ /**
1877
+ * Resolve an adapter from a list of adapter names or functions.
1878
+ * @type {Function}
1879
+ */
1880
+ getAdapter: Ko,
1881
+ /**
1882
+ * Exposes all known adapters
1883
+ * @type {Object<string, Function|Object>}
1884
+ */
1885
+ adapters: Bt
1886
+ };
1887
+ function gt(e) {
1888
+ if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1889
+ throw new Ge(null, e);
1890
+ }
1891
+ function oa(e) {
1892
+ return gt(e), e.headers = ce.from(e.headers), e.data = mt.call(e, e.transformRequest), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), _a.getAdapter(e.adapter || Ct.adapter, e)(e).then(
1893
+ function(t) {
1894
+ gt(e), e.response = t;
1895
+ try {
1896
+ t.data = mt.call(e, e.transformResponse, t);
1897
+ } finally {
1898
+ delete e.response;
1899
+ }
1900
+ return t.headers = ce.from(t.headers), t;
1901
+ },
1902
+ function(t) {
1903
+ if (!Ta(t) && (gt(e), t && t.response)) {
1904
+ e.response = t.response;
1905
+ try {
1906
+ t.response.data = mt.call(
1907
+ e,
1908
+ e.transformResponse,
1909
+ t.response
1910
+ );
1911
+ } finally {
1912
+ delete e.response;
1913
+ }
1914
+ t.response.headers = ce.from(t.response.headers);
1915
+ }
1916
+ return Promise.reject(t);
1917
+ }
1918
+ );
1919
+ }
1920
+ const lt = {};
1921
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1922
+ lt[e] = function(a) {
1923
+ return typeof a === e || "a" + (t < 1 ? "n " : " ") + e;
1924
+ };
1925
+ });
1926
+ const ra = {};
1927
+ lt.transitional = function(e, t, a) {
1928
+ function n(o, r) {
1929
+ return "[Axios v" + At + "] Transitional option '" + o + "'" + r + (a ? ". " + a : "");
1930
+ }
1931
+ return (o, r, i) => {
1932
+ if (e === !1)
1933
+ throw new T(
1934
+ n(r, " has been removed" + (t ? " in " + t : "")),
1935
+ T.ERR_DEPRECATED
1936
+ );
1937
+ return t && !ra[r] && (ra[r] = !0, console.warn(
1938
+ n(
1939
+ r,
1940
+ " has been deprecated since v" + t + " and will be removed in the near future"
1941
+ )
1942
+ )), e ? e(o, r, i) : !0;
1943
+ };
1944
+ };
1945
+ lt.spelling = function(e) {
1946
+ return (t, a) => (console.warn(`${a} is likely a misspelling of ${e}`), !0);
1947
+ };
1948
+ function Xo(e, t, a) {
1949
+ if (typeof e != "object" || e === null)
1950
+ throw new T("options must be an object", T.ERR_BAD_OPTION_VALUE);
1951
+ const n = Object.keys(e);
1952
+ let o = n.length;
1953
+ for (; o-- > 0; ) {
1954
+ const r = n[o], i = Object.prototype.hasOwnProperty.call(t, r) ? t[r] : void 0;
1955
+ if (i) {
1956
+ const s = e[r], u = s === void 0 || i(s, r, e);
1957
+ if (u !== !0)
1958
+ throw new T(
1959
+ "option " + r + " must be " + u,
1960
+ T.ERR_BAD_OPTION_VALUE
1961
+ );
1962
+ continue;
1963
+ }
1964
+ if (a !== !0)
1965
+ throw new T("Unknown option " + r, T.ERR_BAD_OPTION);
1966
+ }
1967
+ }
1968
+ const Ye = {
1969
+ assertOptions: Xo,
1970
+ validators: lt
1971
+ }, ne = Ye.validators;
1972
+ class ot {
1973
+ constructor(t) {
1974
+ this.defaults = t || {}, this.interceptors = {
1975
+ request: new Jt(),
1976
+ response: new Jt()
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, a) {
1988
+ try {
1989
+ return await this._request(t, a);
1990
+ } catch (n) {
1991
+ if (n instanceof Error) {
1992
+ let o = {};
1993
+ Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
1994
+ const r = (() => {
1995
+ if (!o.stack)
1996
+ return "";
1997
+ const i = o.stack.indexOf(`
1998
+ `);
1999
+ return i === -1 ? "" : o.stack.slice(i + 1);
2000
+ })();
2001
+ try {
2002
+ if (!n.stack)
2003
+ n.stack = r;
2004
+ else if (r) {
2005
+ const i = r.indexOf(`
2006
+ `), s = i === -1 ? -1 : r.indexOf(`
2007
+ `, i + 1), u = s === -1 ? "" : r.slice(s + 1);
2008
+ String(n.stack).endsWith(u) || (n.stack += `
2009
+ ` + r);
2010
+ }
2011
+ } catch {
2012
+ }
2013
+ }
2014
+ throw n;
2015
+ }
2016
+ }
2017
+ _request(t, a) {
2018
+ typeof t == "string" ? (a = a || {}, a.url = t) : a = t || {}, a = Ae(this.defaults, a);
2019
+ const { transitional: n, paramsSerializer: o, headers: r } = a;
2020
+ n !== void 0 && Ye.assertOptions(
2021
+ n,
2022
+ {
2023
+ silentJSONParsing: ne.transitional(ne.boolean),
2024
+ forcedJSONParsing: ne.transitional(ne.boolean),
2025
+ clarifyTimeoutError: ne.transitional(ne.boolean),
2026
+ legacyInterceptorReqResOrdering: ne.transitional(ne.boolean),
2027
+ advertiseZstdAcceptEncoding: ne.transitional(ne.boolean),
2028
+ validateStatusUndefinedResolves: ne.transitional(ne.boolean)
2029
+ },
2030
+ !1
2031
+ ), o != null && (l.isFunction(o) ? a.paramsSerializer = {
2032
+ serialize: o
2033
+ } : Ye.assertOptions(
2034
+ o,
2035
+ {
2036
+ encode: ne.function,
2037
+ serialize: ne.function
2038
+ },
2039
+ !0
2040
+ )), a.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? a.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : a.allowAbsoluteUrls = !0), Ye.assertOptions(
2041
+ a,
2042
+ {
2043
+ baseUrl: ne.spelling("baseURL"),
2044
+ withXsrfToken: ne.spelling("withXSRFToken")
2045
+ },
2046
+ !0
2047
+ ), a.method = (a.method || this.defaults.method || "get").toLowerCase();
2048
+ let i = r && l.merge(r.common, r[a.method]);
2049
+ r && l.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (P) => {
2050
+ delete r[P];
2051
+ }), a.headers = ce.concat(i, r);
2052
+ const s = [];
2053
+ let u = !0;
2054
+ this.interceptors.request.forEach(function(P) {
2055
+ if (typeof P.runWhen == "function" && P.runWhen(a) === !1)
2056
+ return;
2057
+ u = u && P.synchronous;
2058
+ const E = a.transitional || St;
2059
+ E && E.legacyInterceptorReqResOrdering ? s.unshift(P.fulfilled, P.rejected) : s.push(P.fulfilled, P.rejected);
2060
+ });
2061
+ const c = [];
2062
+ this.interceptors.response.forEach(function(P) {
2063
+ c.push(P.fulfilled, P.rejected);
2064
+ });
2065
+ let d, f = 0, w;
2066
+ if (!u) {
2067
+ const P = [oa.bind(this), void 0];
2068
+ for (P.unshift(...s), P.push(...c), w = P.length, d = Promise.resolve(a); f < w; )
2069
+ d = d.then(P[f++], P[f++]);
2070
+ return d;
2071
+ }
2072
+ w = s.length;
2073
+ let _ = a;
2074
+ for (; f < w; ) {
2075
+ const P = s[f++], E = s[f++];
2076
+ try {
2077
+ _ = P(_);
2078
+ } catch (R) {
2079
+ E.call(this, R);
2080
+ break;
2081
+ }
2082
+ }
2083
+ try {
2084
+ d = oa.call(this, _);
2085
+ } catch (P) {
2086
+ return Promise.reject(P);
2087
+ }
2088
+ for (f = 0, w = c.length; f < w; )
2089
+ d = d.then(c[f++], c[f++]);
2090
+ return d;
2091
+ }
2092
+ getUri(t) {
2093
+ t = Ae(this.defaults, t);
2094
+ const a = Ca(t.baseURL, t.url, t.allowAbsoluteUrls, t);
2095
+ return Ea(a, t.params, t.paramsSerializer);
2096
+ }
2097
+ }
2098
+ l.forEach(["delete", "get", "head", "options"], function(e) {
2099
+ ot.prototype[e] = function(t, a) {
2100
+ return this.request(
2101
+ Ae(a || {}, {
2102
+ method: e,
2103
+ url: t,
2104
+ data: a && l.hasOwnProp(a, "data") ? a.data : void 0
2105
+ })
2106
+ );
2107
+ };
2108
+ });
2109
+ l.forEach(["post", "put", "patch", "query"], function(e) {
2110
+ function t(a) {
2111
+ return function(n, o, r) {
2112
+ return this.request(
2113
+ Ae(r || {}, {
2114
+ method: e,
2115
+ headers: a ? {
2116
+ "Content-Type": "multipart/form-data"
2117
+ } : {},
2118
+ url: n,
2119
+ data: o
2120
+ })
2121
+ );
2122
+ };
2123
+ }
2124
+ ot.prototype[e] = t(), e !== "query" && (ot.prototype[e + "Form"] = t(!0));
2125
+ });
2126
+ const Ze = ot;
2127
+ class _t {
2128
+ constructor(t) {
2129
+ if (typeof t != "function")
2130
+ throw new TypeError("executor must be a function.");
2131
+ let a;
2132
+ this.promise = new Promise(function(o) {
2133
+ a = o;
2134
+ });
2135
+ const n = this;
2136
+ this.promise.then((o) => {
2137
+ if (!n._listeners)
2138
+ return;
2139
+ let r = n._listeners.length;
2140
+ for (; r-- > 0; )
2141
+ n._listeners[r](o);
2142
+ n._listeners = null;
2143
+ }), this.promise.then = (o) => {
2144
+ let r;
2145
+ const i = new Promise((s) => {
2146
+ n.subscribe(s), r = s;
2147
+ }).then(o);
2148
+ return i.cancel = function() {
2149
+ n.unsubscribe(r);
2150
+ }, i;
2151
+ }, t(function(o, r, i) {
2152
+ n.reason || (n.reason = new Ge(o, r, i), a(n.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 a = this._listeners.indexOf(t);
2179
+ a !== -1 && this._listeners.splice(a, 1);
2180
+ }
2181
+ toAbortSignal() {
2182
+ const t = new AbortController(), a = (n) => {
2183
+ t.abort(n);
2184
+ };
2185
+ return this.subscribe(a), t.signal.unsubscribe = () => this.unsubscribe(a), 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 _t(function(a) {
2195
+ t = a;
2196
+ }),
2197
+ cancel: t
2198
+ };
2199
+ }
2200
+ }
2201
+ const Qo = _t;
2202
+ function Yo(e) {
2203
+ return function(t) {
2204
+ return e.apply(null, t);
2205
+ };
2206
+ }
2207
+ function Zo(e) {
2208
+ return l.isObject(e) && e.isAxiosError === !0;
2209
+ }
2210
+ const xt = {
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(xt).forEach(([e, t]) => {
2282
+ xt[t] = e;
2283
+ });
2284
+ const er = xt;
2285
+ function Da(e) {
2286
+ const t = new Ze(e), a = ca(Ze.prototype.request, t);
2287
+ return l.extend(a, Ze.prototype, t, { allOwnKeys: !0 }), l.extend(a, t, null, { allOwnKeys: !0 }), a.create = function(n) {
2288
+ return Da(Ae(e, n));
2289
+ }, a;
2290
+ }
2291
+ const X = Da(Ct);
2292
+ X.Axios = Ze;
2293
+ X.CanceledError = Ge;
2294
+ X.CancelToken = Qo;
2295
+ X.isCancel = Ta;
2296
+ X.VERSION = At;
2297
+ X.toFormData = st;
2298
+ X.AxiosError = T;
2299
+ X.Cancel = X.CanceledError;
2300
+ X.all = function(e) {
2301
+ return Promise.all(e);
2302
+ };
2303
+ X.spread = Yo;
2304
+ X.isAxiosError = Zo;
2305
+ X.mergeConfig = Ae;
2306
+ X.AxiosHeaders = ce;
2307
+ X.formToJSON = (e) => Sa(l.isHTMLForm(e) ? new FormData(e) : e);
2308
+ X.getAdapter = _a.getAdapter;
2309
+ X.HttpStatusCode = er;
2310
+ X.default = X;
2311
+ const tr = X;
2312
+ function ar(e, t) {
2313
+ const a = t && t.toUpperCase() !== "MY" ? `.${t.toLowerCase()}` : "";
2314
+ return `https://portal-v2${e === "dev" ? "-dev" : ""}${a}.feedmeapi.com`;
2315
+ }
2316
+ function nr(e, t) {
2317
+ return ar(e, t);
2318
+ }
2319
+ const Dt = ["1x1", "4x3", "16x9", "9x16"];
2320
+ function Be(e) {
2321
+ return e.replace("x", ":");
2322
+ }
2323
+ const Fe = "asset";
2324
+ function or(e) {
2325
+ return e.some((t) => t.status === "pending");
2326
+ }
2327
+ function rr(e) {
2328
+ if (e.length === 0)
2329
+ return null;
2330
+ const t = e.filter((a) => a.status === "active").length;
2331
+ return { tone: e.some((a) => a.status === "pending") ? "progress" : e.some((a) => a.status === "failed") ? "warning" : "done", active: t, total: e.length };
2332
+ }
2333
+ function Ma(e, t) {
2334
+ return [
2335
+ { key: "original", kind: "original", ratio: null, url: e.url, status: null },
2336
+ ...t.map((a) => ({
2337
+ key: a.aspectRatio,
2338
+ kind: "variant",
2339
+ ratio: a.aspectRatio,
2340
+ url: a.status === "failed" ? null : a.url,
2341
+ status: a.status,
2342
+ failureCode: a.failureCode
2343
+ }))
2344
+ ];
2345
+ }
2346
+ function Na(e) {
2347
+ return e.kind ?? "image";
2348
+ }
2349
+ function Re(e) {
2350
+ return Na(e) === "video";
2351
+ }
2352
+ function Ia(e) {
2353
+ return e.hasPoster && e.posterUrl ? e.posterUrl : null;
2354
+ }
2355
+ function ze(e) {
2356
+ return e.width > 0 && e.height > 0 ? `${e.width}×${e.height}` : null;
2357
+ }
2358
+ function ir(e) {
2359
+ return e.kind === "video" && e.refType && e.refId ? {
2360
+ kind: "video",
2361
+ entry: {
2362
+ refType: e.refType,
2363
+ refId: e.refId,
2364
+ // The video's id sits in imageId on the wire: the two flows share the asset
2365
+ // document's field, since the segment means the same thing in both keys.
2366
+ videoId: e.imageId ?? "main"
2367
+ }
2368
+ } : e.refType && e.refId ? {
2369
+ kind: "image",
2370
+ entry: {
2371
+ refType: e.refType,
2372
+ refId: e.refId,
2373
+ imageId: e.imageId ?? "main",
2374
+ // null, not []: null deletes the whole set including the original, which is what
2375
+ // deleting an asset means. [] is rejected by the server.
2376
+ aspectRatios: null
2377
+ }
2378
+ } : { kind: "asset", id: e.id };
2379
+ }
2380
+ function sr(e, t, a) {
2381
+ if (e.kind === "original" || e.ratio === null)
2382
+ return {
2383
+ ratio: null,
2384
+ // Null rather than "0×0" for a video whose uploader could not decode it. The panel
2385
+ // already renders a dash for null, and its own rule is that absent data is
2386
+ // recoverable while wrong data that looks right is not.
2387
+ dimensions: ze(t),
2388
+ sizeBytes: t.fileSizeBytes,
2389
+ contentType: t.mimeType,
2390
+ url: t.url
2391
+ };
2392
+ const n = a.find((o) => o.aspectRatio === e.ratio);
2393
+ return {
2394
+ ratio: e.ratio,
2395
+ dimensions: n != null && n.width && n != null && n.height ? `${n.width}×${n.height}` : null,
2396
+ sizeBytes: (n == null ? void 0 : n.fileSizeBytes) ?? null,
2397
+ contentType: (n == null ? void 0 : n.contentType) ?? null,
2398
+ // Falling back to the asset's url here would reintroduce the copy-link bug, so a
2399
+ // missing variant keeps its derivable address rather than borrowing the original's.
2400
+ url: (n == null ? void 0 : n.url) ?? `${t.url}?aspect_ratio=${e.ratio}`
2401
+ };
2402
+ }
2403
+ function ht(e, t, a) {
2404
+ if (t === null)
2405
+ return { asset: e, ratio: null, url: e.url, kind: Na(e) };
2406
+ if (Re(e))
2407
+ return null;
2408
+ const n = a.find((o) => o.aspectRatio === t);
2409
+ return !n || n.status !== "active" ? null : { asset: e, ratio: t, url: n.url, kind: "image" };
2410
+ }
2411
+ function lr(e) {
2412
+ return e >= 1024 * 1024 ? `${(e / 1024 / 1024).toFixed(1)} MB` : `${Math.round(e / 1024)} KB`;
2413
+ }
2414
+ const Ua = "ai-draft";
2415
+ function ur() {
2416
+ var e;
2417
+ const { sessionUser: t, namespace: a, currentCountry: n } = Ka(), o = (e = t.value) == null ? void 0 : e.token;
2418
+ return tr.create({
2419
+ baseURL: nr(a.value, n.value),
2420
+ headers: o ? { Authorization: `Bearer ${o}` } : {}
2421
+ });
2422
+ }
2423
+ const pe = ur;
2424
+ function $e(e) {
2425
+ return `/media-v1/businesses/${e}/assets`;
2426
+ }
2427
+ async function dr(e) {
2428
+ const { businessId: t, ...a } = e, { data: n } = await pe().get($e(t), { params: a });
2429
+ return n;
2430
+ }
2431
+ async function La(e) {
2432
+ const { data: t } = await pe().get(`${$e(e)}/tags`, {
2433
+ params: { excludeTags: [Ua] }
2434
+ });
2435
+ return t;
2436
+ }
2437
+ async function cr(e) {
2438
+ const { tags: t } = await La(e);
2439
+ return t.map((a) => a.tag);
2440
+ }
2441
+ async function pr(e, t, a) {
2442
+ const { data: n } = await pe().patch(`${$e(e)}/${t}`, { fileName: a });
2443
+ return n;
2444
+ }
2445
+ async function fr(e, t, a) {
2446
+ const { data: n } = await pe().patch(`${$e(e)}/${t}`, { tags: a });
2447
+ return n;
2448
+ }
2449
+ async function mr(e, t) {
2450
+ await pe().delete(`${$e(e)}/${t}`);
2451
+ }
2452
+ function Je(e) {
2453
+ return `/media-v1/businesses/${e}/images`;
2454
+ }
2455
+ async function gr(e, t, a) {
2456
+ const { data: n } = await pe().post(`${Je(e)}/create`, t, {
2457
+ headers: a ? { "Idempotency-Key": a } : {}
2458
+ });
2459
+ return n;
2460
+ }
2461
+ async function hr(e, t) {
2462
+ const { data: a } = await pe().post(`${Je(e)}/delete`, {
2463
+ entries: t
2464
+ });
2465
+ return a.results;
2466
+ }
2467
+ async function br(e) {
2468
+ const { businessId: t, refIds: a, ...n } = e, { data: o } = await pe().get(Je(t), {
2469
+ params: { ...n, refIds: a.join(",") }
2470
+ });
2471
+ return o.images;
2472
+ }
2473
+ async function yr(e, t) {
2474
+ const { data: a } = await pe().post(`${Je(e)}/upload-intent`, t);
2475
+ return a;
2476
+ }
2477
+ async function vr(e, t) {
2478
+ const { data: a } = await pe().post(`${Je(e)}/confirm`, t);
2479
+ return a;
2480
+ }
2481
+ function Mt(e) {
2482
+ return `/media-v1/businesses/${e}/videos`;
2483
+ }
2484
+ async function wr(e, t) {
2485
+ const { data: a } = await pe().post(`${Mt(e)}/upload-intent`, t);
2486
+ return a;
2487
+ }
2488
+ async function kr(e, t) {
2489
+ const { data: a } = await pe().post(`${Mt(e)}/confirm`, t);
2490
+ return a;
2491
+ }
2492
+ async function xr(e, t) {
2493
+ const { data: a } = await pe().post(`${Mt(e)}/delete`, {
2494
+ entries: t
2495
+ });
2496
+ return a.results;
2497
+ }
2498
+ async function Pr(e, t) {
2499
+ const a = ir(t);
2500
+ if (a.kind === "video") {
2501
+ await xr(e, [a.entry]);
2502
+ return;
2503
+ }
2504
+ if (a.kind === "image") {
2505
+ await hr(e, [a.entry]);
2506
+ return;
2507
+ }
2508
+ await mr(e, a.id);
2509
+ }
2510
+ const me = "var(--fm-color-brand-primary, #FF7823)", Nt = "#FFF7F0", ia = "40px 56px minmax(160px, 2.2fr) 110px 90px 150px 120px 40px", $ = "font-size:11px", bt = "padding:2px 6px", Er = "background:#FFFBEB;border-color:#FCD34D", Rr = "color:#B45309", Sr = {
2511
+ assetGrid: {
2512
+ loading: "Loading…",
2513
+ empty: "No assets yet",
2514
+ unavailableForRatio: "This image has no {ratio} version yet",
2515
+ columns: {
2516
+ name: "Name",
2517
+ dimensions: "Dimensions",
2518
+ fileSize: "Size",
2519
+ uploader: "Uploaded By",
2520
+ uploadedAt: "Uploaded At"
2521
+ },
2522
+ time: {
2523
+ justNow: "Just now",
2524
+ minutesAgo: "{n} minutes ago",
2525
+ hoursAgo: "{n} hours ago",
2526
+ daysAgo: "{n} days ago"
2527
+ },
2528
+ noPoster: "No preview",
2529
+ videoUnavailableForRatio: "A video cannot be used where a fixed {ratio} ratio is required"
2530
+ },
2531
+ assetPagination: {
2532
+ itemCount: "{start}–{end} of {total}",
2533
+ pageCount: "{total} pages"
2534
+ },
2535
+ assetDetailDialog: {
2536
+ previewTitle: "Preview",
2537
+ saveButton: "Save",
2538
+ dimensionsLabel: "Dimensions",
2539
+ sizeLabel: "Size",
2540
+ formatLabel: "Format",
2541
+ copyLinkButton: "Copy Link",
2542
+ deleteButton: "Delete",
2543
+ deleteDisclaimer: "If any business module is still using this asset, it will show as broken wherever it's referenced after deletion — make sure it's no longer needed.",
2544
+ deleteDialogTitle: "Delete Asset",
2545
+ deleteDialogMessage: 'Delete "{fileName}"? {disclaimer}',
2546
+ deleteConfirmButton: "Delete",
2547
+ cancelButton: "Cancel",
2548
+ durationLabel: "Duration"
2549
+ },
2550
+ tagFilterBar: {
2551
+ all: "All",
2552
+ newTagPlaceholder: "New tag…"
2553
+ },
2554
+ tagFilterTabs: {
2555
+ all: "All"
2556
+ },
2557
+ uploadPanel: {
2558
+ dropLabel: "Drag images or videos here, or click to choose",
2559
+ helperText: "Images JPG/PNG/WEBP up to 10MB · Videos MP4/MOV/WEBM up to 512MB",
2560
+ stagedCount: "Pending · {count}",
2561
+ tagsLabel: "Tags (optional)",
2562
+ suggestedTagsLabel: "Common",
2563
+ uploadFailedError: "Upload failed: {status}",
2564
+ uploading: "Uploading…",
2565
+ videoUndecodableWarning: "This browser could not play the video, so no cover frame was captured. It may not play on POS terminals or in mini-programs either — converting it to MP4 (H.264) is recommended.",
2566
+ videoNoRatiosNote: "Videos have no aspect-ratio versions; the ratio options apply to images only.",
2567
+ fileTooLargeError: "This file is {limit} at most",
2568
+ dropLabelImages: "Drag images here, or click to choose",
2569
+ dropLabelVideos: "Drag videos here, or click to choose",
2570
+ helperTextImages: "JPG, PNG or WEBP, up to 10MB each",
2571
+ helperTextVideos: "MP4, MOV or WEBM, up to 512MB each",
2572
+ kindNotAllowedError: "This picker does not accept that file type"
2573
+ },
2574
+ pickerModal: {
2575
+ title: "Select Assets",
2576
+ subtitleMultiple: "Select multiple or upload — click an item to toggle selection",
2577
+ subtitleSingle: "Click an item to select it, or switch to Upload New",
2578
+ searchPlaceholder: "Search…",
2579
+ browseTab: "Browse",
2580
+ uploadTab: "Upload New",
2581
+ selectedCount: "{count} selected",
2582
+ selectPrompt: "Select an item",
2583
+ cancelButton: "Cancel",
2584
+ uploadSubmitButton: "Upload {count}",
2585
+ confirmButton: "Confirm"
2586
+ },
2587
+ ratios: {
2588
+ title: "Ratios to generate",
2589
+ hint: "AI expands the canvas — about 40s per ratio"
2590
+ },
2591
+ variants: {
2592
+ badgeDone: "{count} ratios",
2593
+ badgeProgress: "{active}/{total} ratios",
2594
+ original: "Original",
2595
+ generating: "Generating…",
2596
+ failed: "Generation failed",
2597
+ failedNoTokens: "Out of AI tokens. Top up, then generate this size again.",
2598
+ failedTokenServiceDown: "Couldn't check your AI token balance. Try again shortly.",
2599
+ regenerate: "Regenerate"
2600
+ },
2601
+ ratioBar: {
2602
+ label: "Ratio",
2603
+ unavailableForSelection: "The selected image has no {ratio} version yet"
2604
+ }
2605
+ }, Tr = {
2606
+ mediaPicker: Sr
2607
+ }, Or = {
2608
+ assetGrid: {
2609
+ loading: "Chargement…",
2610
+ empty: "Aucun média",
2611
+ unavailableForRatio: "Cette image n'a pas encore de version {ratio}",
2612
+ columns: {
2613
+ name: "Nom",
2614
+ dimensions: "Dimensions",
2615
+ fileSize: "Taille",
2616
+ uploader: "Importé par",
2617
+ uploadedAt: "Importé le"
2618
+ },
2619
+ time: {
2620
+ justNow: "À l'instant",
2621
+ minutesAgo: "il y a {n} min",
2622
+ hoursAgo: "il y a {n} h",
2623
+ daysAgo: "il y a {n} j"
2624
+ },
2625
+ noPoster: "Aucun aperçu",
2626
+ videoUnavailableForRatio: "Une vidéo ne peut pas être utilisée là où un ratio {ratio} fixe est requis"
2627
+ },
2628
+ assetPagination: {
2629
+ itemCount: "{start}–{end} sur {total}",
2630
+ pageCount: "{total} pages"
2631
+ },
2632
+ assetDetailDialog: {
2633
+ previewTitle: "Aperçu",
2634
+ saveButton: "Enregistrer",
2635
+ dimensionsLabel: "Dimensions",
2636
+ sizeLabel: "Taille",
2637
+ formatLabel: "Format",
2638
+ copyLinkButton: "Copier le lien",
2639
+ deleteButton: "Supprimer",
2640
+ deleteDisclaimer: "Après suppression, si un module métier utilise encore cet élément, il apparaîtra comme cassé à l'endroit où il est référencé. Assurez-vous qu'il n'est plus nécessaire.",
2641
+ deleteDialogTitle: "Supprimer le média",
2642
+ deleteDialogMessage: "Supprimer « {fileName} » ? {disclaimer}",
2643
+ deleteConfirmButton: "Supprimer",
2644
+ cancelButton: "Annuler",
2645
+ durationLabel: "Durée"
2646
+ },
2647
+ tagFilterBar: {
2648
+ all: "Tous",
2649
+ newTagPlaceholder: "Nouveau tag…"
2650
+ },
2651
+ tagFilterTabs: {
2652
+ all: "Tous"
2653
+ },
2654
+ uploadPanel: {
2655
+ dropLabel: "Glissez des images ou des vidéos ici, ou cliquez pour choisir",
2656
+ helperText: "Images JPG/PNG/WEBP jusqu'à 10 Mo · Vidéos MP4/MOV/WEBM jusqu'à 512 Mo",
2657
+ stagedCount: "En attente · {count}",
2658
+ tagsLabel: "Tags (facultatif)",
2659
+ suggestedTagsLabel: "Fréquents",
2660
+ uploadFailedError: "Échec de l'import : {status}",
2661
+ uploading: "Téléchargement…",
2662
+ videoUndecodableWarning: "Ce navigateur n'a pas pu lire la vidéo, aucune image de couverture n'a donc été capturée. Elle risque aussi de ne pas se lire sur les terminaux POS et dans les mini-programmes — il est conseillé de la convertir en MP4 (H.264).",
2663
+ videoNoRatiosNote: "Les vidéos n'ont pas de versions par ratio ; les options de ratio ne concernent que les images.",
2664
+ fileTooLargeError: "Ce fichier ne doit pas dépasser {limit}",
2665
+ dropLabelImages: "Glissez des images ici, ou cliquez pour choisir",
2666
+ dropLabelVideos: "Glissez des vidéos ici, ou cliquez pour choisir",
2667
+ helperTextImages: "JPG, PNG ou WEBP, jusqu'à 10 Mo chacun",
2668
+ helperTextVideos: "MP4, MOV ou WEBM, jusqu'à 512 Mo chacun",
2669
+ kindNotAllowedError: "Ce type de fichier n'est pas accepté ici"
2670
+ },
2671
+ pickerModal: {
2672
+ title: "Sélectionner des médias",
2673
+ subtitleMultiple: "Sélectionnez plusieurs éléments ou importez — cliquez sur un élément pour le (dé)sélectionner",
2674
+ subtitleSingle: "Cliquez sur un élément pour le choisir, ou passez à l'onglet Importer",
2675
+ searchPlaceholder: "Rechercher…",
2676
+ browseTab: "Parcourir",
2677
+ uploadTab: "Importer",
2678
+ selectedCount: "{count} sélectionné(s)",
2679
+ selectPrompt: "Sélectionnez un élément",
2680
+ cancelButton: "Annuler",
2681
+ uploadSubmitButton: "Importer {count}",
2682
+ confirmButton: "Confirmer"
2683
+ },
2684
+ ratios: {
2685
+ title: "Ratios à générer",
2686
+ hint: "L'IA étend le cadre — environ 40 s par ratio"
2687
+ },
2688
+ variants: {
2689
+ badgeDone: "{count} ratios",
2690
+ badgeProgress: "{active}/{total} ratios",
2691
+ original: "Original",
2692
+ generating: "Génération…",
2693
+ failed: "Échec de la génération",
2694
+ failedNoTokens: "Jetons IA épuisés. Rechargez, puis regénérez ce format.",
2695
+ failedTokenServiceDown: "Impossible de vérifier votre solde de jetons IA. Réessayez sous peu.",
2696
+ regenerate: "Régénérer"
2697
+ },
2698
+ ratioBar: {
2699
+ label: "Ratio",
2700
+ unavailableForSelection: "L'image sélectionnée n'a pas encore de version {ratio}"
2701
+ }
2702
+ }, Cr = {
2703
+ mediaPicker: Or
2704
+ }, Ar = {
2705
+ assetGrid: {
2706
+ loading: "Memuat…",
2707
+ empty: "Belum ada media",
2708
+ unavailableForRatio: "Gambar ini belum memiliki versi {ratio}",
2709
+ columns: {
2710
+ name: "Nama",
2711
+ dimensions: "Dimensi",
2712
+ fileSize: "Ukuran",
2713
+ uploader: "Diunggah Oleh",
2714
+ uploadedAt: "Waktu Unggah"
2715
+ },
2716
+ time: {
2717
+ justNow: "Baru saja",
2718
+ minutesAgo: "{n} menit lalu",
2719
+ hoursAgo: "{n} jam lalu",
2720
+ daysAgo: "{n} hari lalu"
2721
+ },
2722
+ noPoster: "Tanpa pratinjau",
2723
+ videoUnavailableForRatio: "Video tidak dapat dipakai pada slot yang mewajibkan rasio {ratio}"
2724
+ },
2725
+ assetPagination: {
2726
+ itemCount: "{start}–{end} dari {total}",
2727
+ pageCount: "{total} halaman"
2728
+ },
2729
+ assetDetailDialog: {
2730
+ previewTitle: "Pratinjau",
2731
+ saveButton: "Simpan",
2732
+ dimensionsLabel: "Dimensi",
2733
+ sizeLabel: "Ukuran",
2734
+ formatLabel: "Format",
2735
+ copyLinkButton: "Salin Tautan",
2736
+ deleteButton: "Hapus",
2737
+ deleteDisclaimer: "Setelah dihapus, jika ada modul bisnis yang masih menggunakan aset ini, aset akan tampil rusak di tempat penggunaannya. Pastikan aset ini sudah tidak diperlukan lagi.",
2738
+ deleteDialogTitle: "Hapus Media",
2739
+ deleteDialogMessage: 'Hapus "{fileName}"? {disclaimer}',
2740
+ deleteConfirmButton: "Hapus",
2741
+ cancelButton: "Batal",
2742
+ durationLabel: "Durasi"
2743
+ },
2744
+ tagFilterBar: {
2745
+ all: "Semua",
2746
+ newTagPlaceholder: "Buat tag baru…"
2747
+ },
2748
+ tagFilterTabs: {
2749
+ all: "Semua"
2750
+ },
2751
+ uploadPanel: {
2752
+ dropLabel: "Seret gambar atau video ke sini, atau klik untuk memilih",
2753
+ helperText: "Gambar JPG/PNG/WEBP maksimal 10MB per file · Video MP4/MOV/WEBM maksimal 512MB per file",
2754
+ stagedCount: "Menunggu diunggah · {count}",
2755
+ tagsLabel: "Tag (opsional)",
2756
+ suggestedTagsLabel: "Sering digunakan",
2757
+ uploadFailedError: "Unggah gagal: {status}",
2758
+ uploading: "Mengunggah…",
2759
+ videoUndecodableWarning: "Peramban ini tidak dapat memutar video tersebut, sehingga sampul gagal diambil. Video mungkin juga tidak dapat diputar di terminal POS maupun mini program — sebaiknya konversikan ke MP4 (H.264).",
2760
+ videoNoRatiosNote: "Video tidak memiliki versi rasio; opsi rasio hanya berlaku untuk gambar.",
2761
+ fileTooLargeError: "Berkas ini maksimal {limit}",
2762
+ dropLabelImages: "Seret gambar ke sini, atau klik untuk memilih",
2763
+ dropLabelVideos: "Seret video ke sini, atau klik untuk memilih",
2764
+ helperTextImages: "JPG, PNG atau WEBP, maksimal 10MB per berkas",
2765
+ helperTextVideos: "MP4, MOV atau WEBM, maksimal 512MB per berkas",
2766
+ kindNotAllowedError: "Jenis berkas itu tidak diterima di sini"
2767
+ },
2768
+ pickerModal: {
2769
+ title: "Pilih Media",
2770
+ subtitleMultiple: "Pilih beberapa atau unggah — klik item untuk mengubah pilihan",
2771
+ subtitleSingle: "Klik item untuk memilihnya, atau beralih ke Unggah Baru",
2772
+ searchPlaceholder: "Cari…",
2773
+ browseTab: "Jelajahi & Pilih",
2774
+ uploadTab: "Unggah Baru",
2775
+ selectedCount: "{count} dipilih",
2776
+ selectPrompt: "Pilih item",
2777
+ cancelButton: "Batal",
2778
+ uploadSubmitButton: "Unggah {count}",
2779
+ confirmButton: "Konfirmasi"
2780
+ },
2781
+ ratios: {
2782
+ title: "Rasio yang akan dibuat",
2783
+ hint: "AI memperluas kanvas — sekitar 40 detik per rasio"
2784
+ },
2785
+ variants: {
2786
+ badgeDone: "{count} rasio",
2787
+ badgeProgress: "{active}/{total} rasio",
2788
+ original: "Asli",
2789
+ generating: "Membuat…",
2790
+ failed: "Gagal membuat",
2791
+ failedNoTokens: "Token AI habis. Isi ulang, lalu buat ukuran ini lagi.",
2792
+ failedTokenServiceDown: "Saldo token AI tidak dapat diperiksa. Coba lagi sebentar lagi.",
2793
+ regenerate: "Buat ulang"
2794
+ },
2795
+ ratioBar: {
2796
+ label: "Rasio",
2797
+ unavailableForSelection: "Gambar yang dipilih belum memiliki versi {ratio}"
2798
+ }
2799
+ }, Br = {
2800
+ mediaPicker: Ar
2801
+ }, _r = {
2802
+ assetGrid: {
2803
+ loading: "読み込み中…",
2804
+ empty: "素材がありません",
2805
+ unavailableForRatio: "この画像にはまだ {ratio} バージョンがありません",
2806
+ columns: {
2807
+ name: "名前",
2808
+ dimensions: "サイズ",
2809
+ fileSize: "容量",
2810
+ uploader: "アップロード者",
2811
+ uploadedAt: "アップロード日時"
2812
+ },
2813
+ time: {
2814
+ justNow: "たった今",
2815
+ minutesAgo: "{n} 分前",
2816
+ hoursAgo: "{n} 時間前",
2817
+ daysAgo: "{n} 日前"
2818
+ },
2819
+ noPoster: "プレビューなし",
2820
+ videoUnavailableForRatio: "{ratio} の比率が固定された場所では動画は使用できません"
2821
+ },
2822
+ assetPagination: {
2823
+ itemCount: "{total} 件中 {start}–{end} 件",
2824
+ pageCount: "全 {total} ページ"
2825
+ },
2826
+ assetDetailDialog: {
2827
+ previewTitle: "プレビュー",
2828
+ saveButton: "保存",
2829
+ dimensionsLabel: "サイズ",
2830
+ sizeLabel: "容量",
2831
+ formatLabel: "形式",
2832
+ copyLinkButton: "リンクをコピー",
2833
+ deleteButton: "削除",
2834
+ deleteDisclaimer: "削除後、この素材を使用している業務モジュールがある場合、参照元では表示されなくなります。不要であることを確認してください。",
2835
+ deleteDialogTitle: "素材を削除",
2836
+ deleteDialogMessage: "「{fileName}」を削除しますか?{disclaimer}",
2837
+ deleteConfirmButton: "削除",
2838
+ cancelButton: "キャンセル",
2839
+ durationLabel: "再生時間"
2840
+ },
2841
+ tagFilterBar: {
2842
+ all: "すべて",
2843
+ newTagPlaceholder: "新しいタグを作成…"
2844
+ },
2845
+ tagFilterTabs: {
2846
+ all: "すべて"
2847
+ },
2848
+ uploadPanel: {
2849
+ dropLabel: "画像または動画をここにドラッグ、またはクリックして選択",
2850
+ helperText: "画像 JPG/PNG/WEBP は1件あたり10MBまで・動画 MP4/MOV/WEBM は1件あたり512MBまで",
2851
+ stagedCount: "アップロード待ち · {count}",
2852
+ tagsLabel: "タグ(任意)",
2853
+ suggestedTagsLabel: "よく使うタグ",
2854
+ uploadFailedError: "アップロードに失敗しました:{status}",
2855
+ uploading: "アップロード中…",
2856
+ videoUndecodableWarning: "このブラウザーでは動画を再生できないため、サムネイルを取得できませんでした。POS端末やミニプログラムでも再生できない可能性があります。MP4(H.264)に変換してからアップロードすることをおすすめします。",
2857
+ videoNoRatiosNote: "動画には比率バージョンがありません。比率の選択は画像にのみ適用されます。",
2858
+ fileTooLargeError: "このファイルは最大 {limit} までです",
2859
+ dropLabelImages: "画像をここにドラッグ、またはクリックして選択",
2860
+ dropLabelVideos: "動画をここにドラッグ、またはクリックして選択",
2861
+ helperTextImages: "JPG・PNG・WEBP、1件あたり10MBまで",
2862
+ helperTextVideos: "MP4・MOV・WEBM、1件あたり512MBまで",
2863
+ kindNotAllowedError: "ここではこの種類のファイルは扱えません"
2864
+ },
2865
+ pickerModal: {
2866
+ title: "素材を選択",
2867
+ subtitleMultiple: "複数選択またはアップロードできます。素材をクリックで選択を切り替え",
2868
+ subtitleSingle: "素材をクリックして選択するか、「新規アップロード」に切り替えてください",
2869
+ searchPlaceholder: "検索…",
2870
+ browseTab: "選択して閲覧",
2871
+ uploadTab: "新規アップロード",
2872
+ selectedCount: "{count} 件選択中",
2873
+ selectPrompt: "素材を選択してください",
2874
+ cancelButton: "キャンセル",
2875
+ uploadSubmitButton: "{count} 件をアップロード",
2876
+ confirmButton: "確定"
2877
+ },
2878
+ ratios: {
2879
+ title: "生成する比率",
2880
+ hint: "AI がキャンバスを拡張します(1件あたり約40秒)"
2881
+ },
2882
+ variants: {
2883
+ badgeDone: "{count} 比率",
2884
+ badgeProgress: "{active}/{total} 比率",
2885
+ original: "元画像",
2886
+ generating: "生成中…",
2887
+ failed: "生成に失敗しました",
2888
+ failedNoTokens: "AIトークンが不足しています。チャージ後にこのサイズを再生成できます。",
2889
+ failedTokenServiceDown: "AIトークンの残高を確認できませんでした。しばらくしてからお試しください。",
2890
+ regenerate: "再生成"
2891
+ },
2892
+ ratioBar: {
2893
+ label: "比率",
2894
+ unavailableForSelection: "選択した画像にはまだ {ratio} バージョンがありません"
2895
+ }
2896
+ }, Dr = {
2897
+ mediaPicker: _r
2898
+ }, Mr = {
2899
+ assetGrid: {
2900
+ loading: "กำลังโหลด…",
2901
+ empty: "ยังไม่มีสื่อ",
2902
+ unavailableForRatio: "รูปนี้ยังไม่มีเวอร์ชัน {ratio}",
2903
+ columns: {
2904
+ name: "ชื่อ",
2905
+ dimensions: "ขนาด (พิกเซล)",
2906
+ fileSize: "ขนาดไฟล์",
2907
+ uploader: "ผู้อัปโหลด",
2908
+ uploadedAt: "เวลาอัปโหลด"
2909
+ },
2910
+ time: {
2911
+ justNow: "เมื่อสักครู่",
2912
+ minutesAgo: "{n} นาทีที่แล้ว",
2913
+ hoursAgo: "{n} ชั่วโมงที่แล้ว",
2914
+ daysAgo: "{n} วันที่แล้ว"
2915
+ },
2916
+ noPoster: "ไม่มีตัวอย่าง",
2917
+ videoUnavailableForRatio: "ตำแหน่งที่ต้องใช้อัตราส่วน {ratio} คงที่ใช้วิดีโอไม่ได้"
2918
+ },
2919
+ assetPagination: {
2920
+ itemCount: "{start}–{end} จาก {total} รายการ",
2921
+ pageCount: "{total} หน้า"
2922
+ },
2923
+ assetDetailDialog: {
2924
+ previewTitle: "ตัวอย่าง",
2925
+ saveButton: "บันทึก",
2926
+ dimensionsLabel: "ขนาด (พิกเซล)",
2927
+ sizeLabel: "ขนาดไฟล์",
2928
+ formatLabel: "รูปแบบ",
2929
+ copyLinkButton: "คัดลอกลิงก์",
2930
+ deleteButton: "ลบ",
2931
+ deleteDisclaimer: "หลังลบแล้ว หากมีโมดูลธุรกิจใดกำลังใช้สื่อนี้อยู่ สื่อจะแสดงเป็นลิงก์เสียในตำแหน่งที่ถูกใช้งาน กรุณายืนยันว่าไม่จำเป็นต้องใช้แล้ว",
2932
+ deleteDialogTitle: "ลบสื่อ",
2933
+ deleteDialogMessage: "ยืนยันลบ “{fileName}” ใช่หรือไม่? {disclaimer}",
2934
+ deleteConfirmButton: "ลบ",
2935
+ cancelButton: "ยกเลิก",
2936
+ durationLabel: "ความยาว"
2937
+ },
2938
+ tagFilterBar: {
2939
+ all: "ทั้งหมด",
2940
+ newTagPlaceholder: "สร้างแท็กใหม่…"
2941
+ },
2942
+ tagFilterTabs: {
2943
+ all: "ทั้งหมด"
2944
+ },
2945
+ uploadPanel: {
2946
+ dropLabel: "ลากรูปภาพหรือวิดีโอมาที่นี่ หรือคลิกเพื่อเลือก",
2947
+ helperText: "รูปภาพ JPG/PNG/WEBP ไม่เกิน 10MB ต่อไฟล์ · วิดีโอ MP4/MOV/WEBM ไม่เกิน 512MB ต่อไฟล์",
2948
+ stagedCount: "รอการอัปโหลด · {count}",
2949
+ tagsLabel: "แท็ก (ไม่บังคับ)",
2950
+ suggestedTagsLabel: "ที่ใช้บ่อย",
2951
+ uploadFailedError: "อัปโหลดล้มเหลว: {status}",
2952
+ uploading: "กำลังอัปโหลด…",
2953
+ videoUndecodableWarning: "เบราว์เซอร์นี้เล่นวิดีโอไม่ได้ จึงจับภาพหน้าปกไม่สำเร็จ วิดีโออาจเล่นไม่ได้บนเครื่อง POS และในมินิโปรแกรมด้วย แนะนำให้แปลงเป็น MP4 (H.264) ก่อนอัปโหลด",
2954
+ videoNoRatiosNote: "วิดีโอไม่มีเวอร์ชันตามอัตราส่วน ตัวเลือกอัตราส่วนใช้กับรูปภาพเท่านั้น",
2955
+ fileTooLargeError: "ไฟล์นี้ต้องไม่เกิน {limit}",
2956
+ dropLabelImages: "ลากรูปภาพมาที่นี่ หรือคลิกเพื่อเลือก",
2957
+ dropLabelVideos: "ลากวิดีโอมาที่นี่ หรือคลิกเพื่อเลือก",
2958
+ helperTextImages: "รองรับ JPG, PNG, WEBP ไม่เกิน 10MB ต่อไฟล์",
2959
+ helperTextVideos: "รองรับ MP4, MOV, WEBM ไม่เกิน 512MB ต่อไฟล์",
2960
+ kindNotAllowedError: "ที่นี่ไม่รับไฟล์ประเภทนี้"
2961
+ },
2962
+ pickerModal: {
2963
+ title: "เลือกสื่อ",
2964
+ subtitleMultiple: "เลือกได้หลายรายการหรืออัปโหลด คลิกที่รายการเพื่อสลับการเลือก",
2965
+ subtitleSingle: "คลิกที่รายการเพื่อเลือก หรือสลับไปที่แท็บอัปโหลดใหม่",
2966
+ searchPlaceholder: "ค้นหา…",
2967
+ browseTab: "เรียกดูและเลือก",
2968
+ uploadTab: "อัปโหลดใหม่",
2969
+ selectedCount: "เลือกแล้ว {count} รายการ",
2970
+ selectPrompt: "เลือกรายการ",
2971
+ cancelButton: "ยกเลิก",
2972
+ uploadSubmitButton: "อัปโหลด {count} รายการ",
2973
+ confirmButton: "ยืนยัน"
2974
+ },
2975
+ ratios: {
2976
+ title: "อัตราส่วนที่ต้องการสร้าง",
2977
+ hint: "AI จะขยายพื้นที่ภาพ ใช้เวลาประมาณ 40 วินาทีต่อรายการ"
2978
+ },
2979
+ variants: {
2980
+ badgeDone: "{count} อัตราส่วน",
2981
+ badgeProgress: "{active}/{total} อัตราส่วน",
2982
+ original: "ภาพต้นฉบับ",
2983
+ generating: "กำลังสร้าง…",
2984
+ failed: "สร้างไม่สำเร็จ",
2985
+ failedNoTokens: "โทเค็น AI หมดแล้ว เติมเงินแล้วสร้างขนาดนี้ใหม่ได้",
2986
+ failedTokenServiceDown: "ตรวจสอบยอดโทเค็น AI ไม่ได้ กรุณาลองใหม่อีกครั้ง",
2987
+ regenerate: "สร้างใหม่"
2988
+ },
2989
+ ratioBar: {
2990
+ label: "อัตราส่วน",
2991
+ unavailableForSelection: "รูปที่เลือกยังไม่มีเวอร์ชัน {ratio}"
2992
+ }
2993
+ }, Nr = {
2994
+ mediaPicker: Mr
2995
+ }, Ir = {
2996
+ assetGrid: {
2997
+ loading: "加载中…",
2998
+ empty: "暂无素材",
2999
+ unavailableForRatio: "这张图还没有 {ratio} 版本",
3000
+ columns: {
3001
+ name: "名称",
3002
+ dimensions: "尺寸",
3003
+ fileSize: "大小",
3004
+ uploader: "上传人",
3005
+ uploadedAt: "上传时间"
3006
+ },
3007
+ time: {
3008
+ justNow: "刚刚",
3009
+ minutesAgo: "{n} 分钟前",
3010
+ hoursAgo: "{n} 小时前",
3011
+ daysAgo: "{n} 天前"
3012
+ },
3013
+ noPoster: "无预览",
3014
+ videoUnavailableForRatio: "需要固定 {ratio} 比例的位置无法使用视频"
3015
+ },
3016
+ assetPagination: {
3017
+ itemCount: "第 {start}–{end} 项,共 {total} 项",
3018
+ pageCount: "共 {total} 页"
3019
+ },
3020
+ assetDetailDialog: {
3021
+ previewTitle: "预览",
3022
+ saveButton: "保存",
3023
+ dimensionsLabel: "尺寸",
3024
+ sizeLabel: "大小",
3025
+ formatLabel: "格式",
3026
+ copyLinkButton: "复制链接",
3027
+ deleteButton: "删除",
3028
+ deleteDisclaimer: "删除后如有业务模块正在使用这个素材,引用处会显示失效,请确认已不再需要。",
3029
+ deleteDialogTitle: "删除素材",
3030
+ deleteDialogMessage: "确定删除「{fileName}」吗?{disclaimer}",
3031
+ deleteConfirmButton: "删除",
3032
+ cancelButton: "取消",
3033
+ durationLabel: "时长"
3034
+ },
3035
+ tagFilterBar: {
3036
+ all: "全部",
3037
+ newTagPlaceholder: "新建标签…"
3038
+ },
3039
+ tagFilterTabs: {
3040
+ all: "全部"
3041
+ },
3042
+ uploadPanel: {
3043
+ dropLabel: "将图片或视频拖到此处,或点击选择",
3044
+ helperText: "图片 JPG/PNG/WEBP,单个不超过 10MB · 视频 MP4/MOV/WEBM,单个不超过 512MB",
3045
+ stagedCount: "待上传 · {count}",
3046
+ tagsLabel: "标签(可选)",
3047
+ suggestedTagsLabel: "常用",
3048
+ uploadFailedError: "上传失败:{status}",
3049
+ uploading: "上传中…",
3050
+ videoUndecodableWarning: "当前浏览器无法播放该视频,因此未能截取封面。它在 POS 终端和小程序上也可能无法播放,建议转成 MP4(H.264)后再上传。",
3051
+ videoNoRatiosNote: "视频没有比例版本,比例选项仅对图片生效。",
3052
+ fileTooLargeError: "该文件最大不能超过 {limit}",
3053
+ dropLabelImages: "将图片拖到此处,或点击选择",
3054
+ dropLabelVideos: "将视频拖到此处,或点击选择",
3055
+ helperTextImages: "支持 JPG、PNG、WEBP,单个不超过 10MB",
3056
+ helperTextVideos: "支持 MP4、MOV、WEBM,单个不超过 512MB",
3057
+ kindNotAllowedError: "此处不接受该类型的文件"
3058
+ },
3059
+ pickerModal: {
3060
+ title: "选择素材",
3061
+ subtitleMultiple: "可多选或上传,点击素材切换选择",
3062
+ subtitleSingle: "点击素材完成选择,或切换到上传新素材",
3063
+ searchPlaceholder: "搜索…",
3064
+ browseTab: "浏览选择",
3065
+ uploadTab: "上传新素材",
3066
+ selectedCount: "已选择 {count} 个",
3067
+ selectPrompt: "请选择素材",
3068
+ cancelButton: "取消",
3069
+ uploadSubmitButton: "上传 {count} 个",
3070
+ confirmButton: "确定"
3071
+ },
3072
+ ratios: {
3073
+ title: "要生成的规格",
3074
+ hint: "AI 扩展画布,每个规格约 40 秒"
3075
+ },
3076
+ variants: {
3077
+ badgeDone: "{count} 规格",
3078
+ badgeProgress: "{active}/{total} 规格",
3079
+ original: "原图",
3080
+ generating: "生成中…",
3081
+ failed: "生成失败",
3082
+ failedNoTokens: "AI 额度已用完。充值后可重新生成这个尺寸。",
3083
+ failedTokenServiceDown: "暂时无法确认 AI 额度,请稍后重试。",
3084
+ regenerate: "重新生成"
3085
+ },
3086
+ ratioBar: {
3087
+ label: "规格",
3088
+ unavailableForSelection: "所选图片还没有 {ratio} 版本"
3089
+ }
3090
+ }, Ur = {
3091
+ mediaPicker: Ir
3092
+ }, Lr = {
3093
+ assetGrid: {
3094
+ loading: "載入中…",
3095
+ empty: "暫無素材",
3096
+ unavailableForRatio: "這張圖還沒有 {ratio} 版本",
3097
+ columns: {
3098
+ name: "名稱",
3099
+ dimensions: "尺寸",
3100
+ fileSize: "大小",
3101
+ uploader: "上傳人",
3102
+ uploadedAt: "上傳時間"
3103
+ },
3104
+ time: {
3105
+ justNow: "剛剛",
3106
+ minutesAgo: "{n} 分鐘前",
3107
+ hoursAgo: "{n} 小時前",
3108
+ daysAgo: "{n} 天前"
3109
+ },
3110
+ noPoster: "無預覽",
3111
+ videoUnavailableForRatio: "需要固定 {ratio} 比例的位置無法使用影片"
3112
+ },
3113
+ assetPagination: {
3114
+ itemCount: "第 {start}–{end} 項,共 {total} 項",
3115
+ pageCount: "共 {total} 頁"
3116
+ },
3117
+ assetDetailDialog: {
3118
+ previewTitle: "預覽",
3119
+ saveButton: "儲存",
3120
+ dimensionsLabel: "尺寸",
3121
+ sizeLabel: "大小",
3122
+ formatLabel: "格式",
3123
+ copyLinkButton: "複製連結",
3124
+ deleteButton: "刪除",
3125
+ deleteDisclaimer: "刪除後如有業務模組正在使用這個素材,引用處會顯示失效,請確認已不再需要。",
3126
+ deleteDialogTitle: "刪除素材",
3127
+ deleteDialogMessage: "確定刪除「{fileName}」嗎?{disclaimer}",
3128
+ deleteConfirmButton: "刪除",
3129
+ cancelButton: "取消",
3130
+ durationLabel: "時長"
3131
+ },
3132
+ tagFilterBar: {
3133
+ all: "全部",
3134
+ newTagPlaceholder: "新增標籤…"
3135
+ },
3136
+ tagFilterTabs: {
3137
+ all: "全部"
3138
+ },
3139
+ uploadPanel: {
3140
+ dropLabel: "將圖片或影片拖到此處,或點擊選擇",
3141
+ helperText: "圖片 JPG/PNG/WEBP,單個不超過 10MB · 影片 MP4/MOV/WEBM,單個不超過 512MB",
3142
+ stagedCount: "待上傳 · {count}",
3143
+ tagsLabel: "標籤(可選)",
3144
+ suggestedTagsLabel: "常用",
3145
+ uploadFailedError: "上傳失敗:{status}",
3146
+ uploading: "上傳中…",
3147
+ videoUndecodableWarning: "目前的瀏覽器無法播放此影片,因此未能擷取封面。它在 POS 終端與小程式上也可能無法播放,建議轉成 MP4(H.264)後再上傳。",
3148
+ videoNoRatiosNote: "影片沒有比例版本,比例選項僅對圖片生效。",
3149
+ fileTooLargeError: "此檔案最大不能超過 {limit}",
3150
+ dropLabelImages: "將圖片拖到此處,或點擊選擇",
3151
+ dropLabelVideos: "將影片拖到此處,或點擊選擇",
3152
+ helperTextImages: "支援 JPG、PNG、WEBP,單個不超過 10MB",
3153
+ helperTextVideos: "支援 MP4、MOV、WEBM,單個不超過 512MB",
3154
+ kindNotAllowedError: "此處不接受該類型的檔案"
3155
+ },
3156
+ pickerModal: {
3157
+ title: "選擇素材",
3158
+ subtitleMultiple: "可多選或上傳,點擊素材切換選擇",
3159
+ subtitleSingle: "點擊素材完成選擇,或切換到上傳新素材",
3160
+ searchPlaceholder: "搜尋…",
3161
+ browseTab: "瀏覽選擇",
3162
+ uploadTab: "上傳新素材",
3163
+ selectedCount: "已選擇 {count} 個",
3164
+ selectPrompt: "請選擇素材",
3165
+ cancelButton: "取消",
3166
+ uploadSubmitButton: "上傳 {count} 個",
3167
+ confirmButton: "確定"
3168
+ },
3169
+ ratios: {
3170
+ title: "要產生的規格",
3171
+ hint: "AI 擴展畫布,每個規格約 40 秒"
3172
+ },
3173
+ variants: {
3174
+ badgeDone: "{count} 規格",
3175
+ badgeProgress: "{active}/{total} 規格",
3176
+ original: "原圖",
3177
+ generating: "產生中…",
3178
+ failed: "產生失敗",
3179
+ failedNoTokens: "AI 額度已用完。儲值後可重新產生這個尺寸。",
3180
+ failedTokenServiceDown: "暫時無法確認 AI 額度,請稍後重試。",
3181
+ regenerate: "重新產生"
3182
+ },
3183
+ ratioBar: {
3184
+ label: "規格",
3185
+ unavailableForSelection: "所選圖片還沒有 {ratio} 版本"
3186
+ }
3187
+ }, jr = {
3188
+ mediaPicker: Lr
3189
+ }, ve = {
3190
+ "en-US": Tr,
3191
+ "zh-CN": Ur,
3192
+ "zh-Hant": jr,
3193
+ "th-TH": Nr,
3194
+ "ja-JP": Dr,
3195
+ "id-ID": Br,
3196
+ "fr-MA": Cr
3197
+ }, ja = 15e3, Fr = 0.92, zr = 0.1;
3198
+ function Vr(e) {
3199
+ return new Promise((t) => {
3200
+ const a = document.createElement("video");
3201
+ let n = !1;
3202
+ const o = (i) => {
3203
+ n || (n = !0, clearTimeout(r), a.removeAttribute("src"), a.load(), t(i));
3204
+ }, r = setTimeout(() => o(null), ja);
3205
+ a.preload = "metadata", a.muted = !0, a.onloadedmetadata = () => {
3206
+ const i = a.videoWidth, s = a.videoHeight, u = a.duration;
3207
+ if (!i || !s || !Number.isFinite(u) || u <= 0) {
3208
+ o(null);
3209
+ return;
3210
+ }
3211
+ o({ width: i, height: s, durationMs: Math.round(u * 1e3) });
3212
+ }, a.onerror = () => o(null), a.src = e;
3213
+ });
3214
+ }
3215
+ function qr(e) {
3216
+ return new Promise((t) => {
3217
+ const a = document.createElement("video");
3218
+ let n = !1;
3219
+ const o = (s) => {
3220
+ n || (n = !0, clearTimeout(r), a.removeAttribute("src"), a.load(), t(s));
3221
+ }, r = setTimeout(() => o(null), ja), i = () => {
3222
+ try {
3223
+ const s = document.createElement("canvas");
3224
+ if (s.width = a.videoWidth, s.height = a.videoHeight, !s.width || !s.height) {
3225
+ o(null);
3226
+ return;
3227
+ }
3228
+ const u = s.getContext("2d");
3229
+ if (!u) {
3230
+ o(null);
3231
+ return;
3232
+ }
3233
+ u.drawImage(a, 0, 0, s.width, s.height), s.toBlob((c) => o(c), "image/jpeg", Fr);
3234
+ } catch {
3235
+ o(null);
3236
+ }
3237
+ };
3238
+ a.preload = "auto", a.muted = !0, a.crossOrigin = "anonymous", a.onloadeddata = () => {
3239
+ if (!a.videoWidth || !a.videoHeight) {
3240
+ o(null);
3241
+ return;
3242
+ }
3243
+ const s = Math.min(zr, Math.max(0, (a.duration || 0) / 2));
3244
+ if (s <= 0) {
3245
+ i();
3246
+ return;
3247
+ }
3248
+ a.onseeked = i, a.currentTime = s;
3249
+ }, a.onerror = () => o(null), a.src = e;
3250
+ });
3251
+ }
3252
+ function It(e) {
3253
+ if (!Number.isFinite(e))
3254
+ return "0:00";
3255
+ const t = Math.max(0, Math.round(e / 1e3)), a = Math.floor(t / 3600), n = Math.floor(t % 3600 / 60), o = t % 60, r = (i) => String(i).padStart(2, "0");
3256
+ return a > 0 ? `${a}:${r(n)}:${r(o)}` : `${n}:${r(o)}`;
3257
+ }
3258
+ const Wr = {
3259
+ key: 0,
3260
+ class: "py-64 text-center text-sm text-gray-400"
3261
+ }, Gr = {
3262
+ key: 1,
3263
+ class: "py-64 text-center text-sm text-gray-400"
3264
+ }, $r = {
3265
+ key: 2,
3266
+ class: "bg-white border border-fm-color-neutral-gray-200 rounded-lg overflow-hidden"
3267
+ }, Jr = ["onClick"], Hr = ["onClick"], Kr = { key: 1 }, Xr = {
3268
+ class: "rounded overflow-hidden",
3269
+ style: { width: "44px", height: "36px" }
3270
+ }, Qr = {
3271
+ key: 1,
3272
+ class: "w-full h-full flex items-center justify-center bg-fm-color-neutral-gray-100 text-gray-400"
3273
+ }, Yr = { class: "min-w-0 flex flex-col gap-4" }, Zr = { class: "text-xs font-semibold truncate" }, ei = { class: "flex items-center gap-8" }, ti = { class: "text-xs text-fm-color-typo-primary" }, ai = { class: "text-xs text-fm-color-typo-primary" }, ni = { class: "flex items-center gap-8 min-w-0" }, oi = { class: "text-xs text-fm-color-typo-primary truncate" }, ri = { class: "text-xs text-fm-color-typo-secondary" }, ii = {
3274
+ key: 3,
3275
+ class: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-16"
3276
+ }, si = ["onClick"], li = {
3277
+ class: "relative",
3278
+ style: { "aspect-ratio": "4 / 3" }
3279
+ }, ui = {
3280
+ key: 1,
3281
+ class: "w-full h-full flex flex-col items-center justify-center gap-4 bg-fm-color-neutral-gray-100 text-gray-400"
3282
+ }, di = {
3283
+ key: 2,
3284
+ class: "absolute inset-0 flex items-center justify-center pointer-events-none"
3285
+ }, ci = {
3286
+ class: "rounded-full bg-black/50 flex items-center justify-center",
3287
+ style: { width: "40px", height: "40px" }
3288
+ }, pi = ["onClick"], fi = { class: "px-8 py-6 space-y-2" }, mi = { class: "text-xs font-semibold truncate" }, gi = /* @__PURE__ */ be({
3289
+ __name: "AssetGrid",
3290
+ props: {
3291
+ assets: {},
3292
+ loading: { type: Boolean, default: !1 },
3293
+ selectable: { type: Boolean, default: !1 },
3294
+ selectedIds: { default: () => /* @__PURE__ */ new Set() },
3295
+ view: { default: "grid" },
3296
+ variantsByRefId: {},
3297
+ unavailableIds: {},
3298
+ unavailableRatio: {}
3299
+ },
3300
+ emits: ["open", "toggle", "delete"],
3301
+ setup(e, { emit: t }) {
3302
+ const { t: a } = ye({ messages: ve }), n = e;
3303
+ function o(R) {
3304
+ var p;
3305
+ if (Re(R) || !R.refId)
3306
+ return null;
3307
+ const y = (p = n.variantsByRefId) == null ? void 0 : p.get(R.refId);
3308
+ return y ? rr(y.variants) : null;
3309
+ }
3310
+ function r(R) {
3311
+ var p;
3312
+ return ((p = n.unavailableIds) == null ? void 0 : p.has(R.id)) ?? !1;
3313
+ }
3314
+ function i(R) {
3315
+ const p = n.unavailableRatio;
3316
+ return !r(R) || !p ? { content: "", disabled: !0 } : {
3317
+ content: Re(R) ? a("mediaPicker.assetGrid.videoUnavailableForRatio", { ratio: Be(p) }) : a("mediaPicker.assetGrid.unavailableForRatio", { ratio: Be(p) }),
3318
+ disabled: !1
3319
+ };
3320
+ }
3321
+ function s(R) {
3322
+ return Re(R) ? Ia(R) : R.url;
3323
+ }
3324
+ function u(R) {
3325
+ return Re(R) && R.durationMs ? It(R.durationMs) : null;
3326
+ }
3327
+ function c(R) {
3328
+ r(R) || w("open", R);
3329
+ }
3330
+ function d(R) {
3331
+ r(R) || w("toggle", R);
3332
+ }
3333
+ function f(R) {
3334
+ return R.tone === "done" ? a("mediaPicker.variants.badgeDone", { count: R.total }) : a("mediaPicker.variants.badgeProgress", { active: R.active, total: R.total });
3335
+ }
3336
+ const w = t;
3337
+ function _(R) {
3338
+ var p;
3339
+ return ((p = R.split("/")[1]) == null ? void 0 : p.toUpperCase()) ?? R;
3340
+ }
3341
+ function P(R) {
3342
+ return R >= 1024 * 1024 ? `${(R / 1024 / 1024).toFixed(1)} MB` : `${Math.round(R / 1024)} KB`;
3343
+ }
3344
+ function E(R) {
3345
+ const p = Date.now() - new Date(R).getTime(), y = 6e4, C = 36e5, A = 864e5;
3346
+ if (p < y)
3347
+ return a("mediaPicker.assetGrid.time.justNow");
3348
+ if (p < C)
3349
+ return a("mediaPicker.assetGrid.time.minutesAgo", { n: Math.floor(p / y) });
3350
+ if (p < A)
3351
+ return a("mediaPicker.assetGrid.time.hoursAgo", { n: Math.floor(p / C) });
3352
+ if (p < A * 8)
3353
+ return a("mediaPicker.assetGrid.time.daysAgo", { n: Math.floor(p / A) });
3354
+ const V = new Date(R);
3355
+ return `${V.getFullYear()}-${String(V.getMonth() + 1).padStart(2, "0")}-${String(V.getDate()).padStart(2, "0")}`;
3356
+ }
3357
+ return (R, p) => {
3358
+ const y = K("FmIcon"), C = K("FmThumbnail"), A = K("FmAvatar"), V = K("FmButton"), Q = ua("tooltip");
3359
+ return e.loading ? (b(), k("div", Wr, x(h(a)("mediaPicker.assetGrid.loading")), 1)) : e.assets.length === 0 ? (b(), k("div", Gr, x(h(a)("mediaPicker.assetGrid.empty")), 1)) : e.view === "list" ? (b(), k("div", $r, [
3360
+ v("div", {
3361
+ class: "grid 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",
3362
+ style: j({ gridTemplateColumns: h(ia) })
3363
+ }, [
3364
+ p[0] || (p[0] = v("span", null, null, -1)),
3365
+ p[1] || (p[1] = v("span", null, null, -1)),
3366
+ v("span", null, x(h(a)("mediaPicker.assetGrid.columns.name")), 1),
3367
+ v("span", null, x(h(a)("mediaPicker.assetGrid.columns.dimensions")), 1),
3368
+ v("span", null, x(h(a)("mediaPicker.assetGrid.columns.fileSize")), 1),
3369
+ v("span", null, x(h(a)("mediaPicker.assetGrid.columns.uploader")), 1),
3370
+ v("span", null, x(h(a)("mediaPicker.assetGrid.columns.uploadedAt")), 1),
3371
+ p[2] || (p[2] = v("span", null, null, -1))
3372
+ ], 4),
3373
+ (b(!0), k(Z, null, he(e.assets, (S) => et((b(), k("div", {
3374
+ key: S.id,
3375
+ class: ee(["grid items-center gap-8 px-16 h-56 border-b border-fm-color-neutral-gray-200 last:border-b-0 hover:bg-fm-color-neutral-gray-100", r(S) ? "opacity-40 cursor-not-allowed" : "cursor-pointer"]),
3376
+ style: j({
3377
+ gridTemplateColumns: h(ia),
3378
+ ...e.selectedIds.has(S.id) ? { background: h(Nt) } : {}
3379
+ }),
3380
+ onClick: (re) => c(S)
3381
+ }, [
3382
+ e.selectable ? (b(), k("button", {
3383
+ key: 0,
3384
+ class: ee(["rounded flex items-center justify-center", e.selectedIds.has(S.id) ? "" : "bg-white border border-fm-color-neutral-gray-200"]),
3385
+ style: j({
3386
+ width: "20px",
3387
+ height: "20px",
3388
+ ...e.selectedIds.has(S.id) ? { background: h(me) } : {}
3389
+ }),
3390
+ onClick: ct((re) => d(S), ["stop"])
3391
+ }, [
3392
+ e.selectedIds.has(S.id) ? (b(), oe(y, {
3393
+ key: 0,
3394
+ name: "check",
3395
+ size: "sm",
3396
+ color: "white"
3397
+ })) : F("", !0)
3398
+ ], 14, Hr)) : (b(), k("span", Kr)),
3399
+ v("div", Xr, [
3400
+ s(S) ? (b(), oe(C, {
3401
+ key: 0,
3402
+ src: s(S),
3403
+ size: "sm",
3404
+ class: "!w-full !h-full"
3405
+ }, null, 8, ["src"])) : (b(), k("div", Qr, [
3406
+ W(y, {
3407
+ name: "movie",
3408
+ size: "sm"
3409
+ })
3410
+ ]))
3411
+ ]),
3412
+ v("div", Yr, [
3413
+ v("span", Zr, x(S.fileName), 1),
3414
+ v("div", ei, [
3415
+ v("span", {
3416
+ class: "text-fm-color-typo-tertiary",
3417
+ style: j(h($))
3418
+ }, x(_(S.mimeType)), 5),
3419
+ u(S) ? (b(), k("span", {
3420
+ key: 0,
3421
+ class: "text-fm-color-typo-tertiary",
3422
+ style: j(h($))
3423
+ }, x(u(S)), 5)) : F("", !0),
3424
+ o(S) ? (b(), k("span", {
3425
+ key: 1,
3426
+ class: ee(["font-semibold", {
3427
+ "text-fm-color-typo-tertiary": o(S).tone === "done",
3428
+ "text-blue-600": o(S).tone === "progress",
3429
+ "text-amber-600": o(S).tone === "warning"
3430
+ }]),
3431
+ style: j(h($))
3432
+ }, x(f(o(S))), 7)) : F("", !0)
3433
+ ])
3434
+ ]),
3435
+ v("span", ti, x(h(ze)(S) ?? "—"), 1),
3436
+ v("span", ai, x(P(S.fileSizeBytes)), 1),
3437
+ v("div", ni, [
3438
+ W(A, {
3439
+ name: S.uploadedBy,
3440
+ size: "sm"
3441
+ }, null, 8, ["name"]),
3442
+ v("span", oi, x(S.uploadedBy), 1)
3443
+ ]),
3444
+ v("span", ri, x(E(S.createdAt)), 1),
3445
+ W(V, {
3446
+ variant: "tertiary",
3447
+ size: "md",
3448
+ "prepend-icon": "delete",
3449
+ label: "",
3450
+ onClick: ct((re) => w("delete", S), ["stop"])
3451
+ }, null, 8, ["onClick"])
3452
+ ], 14, Jr)), [
3453
+ [Q, i(S)]
3454
+ ])), 128))
3455
+ ])) : (b(), k("div", ii, [
3456
+ (b(!0), k(Z, null, he(e.assets, (S) => et((b(), k("div", {
3457
+ key: S.id,
3458
+ class: ee(["rounded-lg border bg-white overflow-hidden transition-shadow hover:shadow-lg", [
3459
+ e.selectedIds.has(S.id) ? "border-2" : "border-gray-200",
3460
+ r(S) ? "opacity-40 cursor-not-allowed" : "cursor-pointer"
3461
+ ]]),
3462
+ style: j(e.selectedIds.has(S.id) ? { borderColor: h(me) } : {}),
3463
+ onClick: (re) => c(S)
3464
+ }, [
3465
+ v("div", li, [
3466
+ s(S) ? (b(), oe(C, {
3467
+ key: 0,
3468
+ src: s(S),
3469
+ size: "xl",
3470
+ class: "w-full h-full"
3471
+ }, null, 8, ["src"])) : (b(), k("div", ui, [
3472
+ W(y, {
3473
+ name: "movie",
3474
+ size: "lg"
3475
+ }),
3476
+ v("span", {
3477
+ style: j(h($))
3478
+ }, x(h(a)("mediaPicker.assetGrid.noPoster")), 5)
3479
+ ])),
3480
+ h(Re)(S) ? (b(), k("div", di, [
3481
+ v("span", ci, [
3482
+ W(y, {
3483
+ name: "play_arrow",
3484
+ size: "md",
3485
+ color: "white"
3486
+ })
3487
+ ])
3488
+ ])) : F("", !0),
3489
+ e.selectable ? (b(), k("button", {
3490
+ key: 3,
3491
+ class: ee(["absolute top-8 left-8 z-10 w-24 h-24 rounded-full flex items-center justify-center", e.selectedIds.has(S.id) ? "" : "bg-black/30 border border-white/80"]),
3492
+ style: j(e.selectedIds.has(S.id) ? { background: h(me) } : {}),
3493
+ onClick: ct((re) => d(S), ["stop"])
3494
+ }, [
3495
+ e.selectedIds.has(S.id) ? (b(), oe(y, {
3496
+ key: 0,
3497
+ name: "check",
3498
+ size: "sm",
3499
+ color: "white"
3500
+ })) : F("", !0)
3501
+ ], 14, pi)) : F("", !0),
3502
+ v("span", {
3503
+ class: "absolute bottom-8 left-8 bg-black/70 text-white font-semibold rounded",
3504
+ style: j([h($), h(bt)])
3505
+ }, x(_(S.mimeType)), 5),
3506
+ u(S) ? (b(), k("span", {
3507
+ key: 4,
3508
+ class: "absolute bottom-8 right-8 bg-black/70 text-white font-semibold rounded",
3509
+ style: j([h($), h(bt)])
3510
+ }, x(u(S)), 5)) : F("", !0),
3511
+ o(S) ? (b(), k("span", {
3512
+ key: 5,
3513
+ class: ee(["absolute bottom-8 right-8 text-white font-semibold rounded", {
3514
+ "bg-black/70": o(S).tone === "done",
3515
+ "bg-blue-600/90": o(S).tone === "progress",
3516
+ "bg-amber-600/90": o(S).tone === "warning"
3517
+ }]),
3518
+ style: j([h($), h(bt)])
3519
+ }, x(f(o(S))), 7)) : F("", !0)
3520
+ ]),
3521
+ v("div", fi, [
3522
+ v("div", mi, x(S.fileName), 1),
3523
+ v("span", {
3524
+ class: "text-gray-500 truncate",
3525
+ style: j(h($))
3526
+ }, [
3527
+ h(ze)(S) ? (b(), k(Z, { key: 0 }, [
3528
+ de(x(h(ze)(S)) + " · ", 1)
3529
+ ], 64)) : F("", !0),
3530
+ de(x(P(S.fileSizeBytes)), 1)
3531
+ ], 4)
3532
+ ])
3533
+ ], 14, si)), [
3534
+ [Q, i(S)]
3535
+ ])), 128))
3536
+ ]));
3537
+ };
3538
+ }
3539
+ }), hi = { class: "flex flex-wrap items-center gap-8" }, bi = /* @__PURE__ */ be({
3540
+ __name: "TagFilterTabs",
3541
+ props: {
3542
+ tags: {},
3543
+ total: {},
3544
+ modelValue: {}
3545
+ },
3546
+ emits: ["update:modelValue"],
3547
+ setup(e, { emit: t }) {
3548
+ const { t: a } = ye({ messages: ve }), n = t;
3549
+ return (o, r) => {
3550
+ const i = K("FmChip");
3551
+ return b(), k("div", hi, [
3552
+ W(i, {
3553
+ selectable: "",
3554
+ selected: e.modelValue === null,
3555
+ onClick: r[0] || (r[0] = (s) => n("update:modelValue", null))
3556
+ }, {
3557
+ default: Se(() => [
3558
+ v("span", {
3559
+ class: ee(["fm-typo-en-body-md-600 flex items-center gap-6", { "text-white": e.modelValue === null }])
3560
+ }, [
3561
+ de(x(h(a)("mediaPicker.tagFilterTabs.all")) + " ", 1),
3562
+ v("span", {
3563
+ class: ee(["leading-none rounded-full px-6 py-2", e.modelValue === null ? "bg-white/25" : "bg-fm-color-neutral-gray-100"]),
3564
+ style: j(h($))
3565
+ }, x(e.total), 7)
3566
+ ], 2)
3567
+ ]),
3568
+ _: 1
3569
+ }, 8, ["selected"]),
3570
+ (b(!0), k(Z, null, he(e.tags, (s) => (b(), oe(i, {
3571
+ key: s.tag,
3572
+ selectable: "",
3573
+ selected: e.modelValue === s.tag,
3574
+ onClick: (u) => n("update:modelValue", e.modelValue === s.tag ? null : s.tag)
3575
+ }, {
3576
+ default: Se(() => [
3577
+ v("span", {
3578
+ class: ee(["fm-typo-en-body-md-600 flex items-center gap-6", { "text-white": e.modelValue === s.tag }])
3579
+ }, [
3580
+ de(x(s.tag) + " ", 1),
3581
+ v("span", {
3582
+ class: ee(["leading-none rounded-full px-6 py-2", e.modelValue === s.tag ? "bg-white/25" : "bg-fm-color-neutral-gray-100"]),
3583
+ style: j(h($))
3584
+ }, x(s.count), 7)
3585
+ ], 2)
3586
+ ]),
3587
+ _: 2
3588
+ }, 1032, ["selected", "onClick"]))), 128))
3589
+ ]);
3590
+ };
3591
+ }
3592
+ }), yi = { class: "flex items-center gap-12 py-4 px-2" }, vi = { class: "text-xs font-semibold text-fm-color-typo-secondary shrink-0" }, wi = { class: "flex flex-wrap items-center gap-6" }, ki = ["onClick"], xi = {
3593
+ key: 0,
3594
+ class: "text-xs text-fm-color-typo-secondary shrink-0"
3595
+ }, Pi = /* @__PURE__ */ be({
3596
+ __name: "RatioPickerBar",
3597
+ props: /* @__PURE__ */ yt({
3598
+ facts: {},
3599
+ locked: { type: Boolean },
3600
+ unavailableRatios: {}
3601
+ }, {
3602
+ modelValue: { default: null },
3603
+ modelModifiers: {}
3604
+ }),
3605
+ emits: ["update:modelValue"],
3606
+ setup(e) {
3607
+ const { t } = ye({ messages: ve }), a = e, n = da(e, "modelValue");
3608
+ function o(u) {
3609
+ var c;
3610
+ a.locked || u !== null && (c = a.unavailableRatios) != null && c.has(u) || (n.value = u);
3611
+ }
3612
+ function r(u, c) {
3613
+ var d;
3614
+ return c !== void 0 && ((d = a.unavailableRatios) != null && d.has(c)) ? "border-fm-color-neutral-gray-200 text-fm-color-neutral-gray-300 cursor-not-allowed opacity-40" : [
3615
+ u ? "" : "border-fm-color-neutral-gray-300 text-gray-500",
3616
+ a.locked ? "cursor-not-allowed opacity-60" : ""
3617
+ ];
3618
+ }
3619
+ function i(u) {
3620
+ var c;
3621
+ const d = u !== void 0 && (((c = a.unavailableRatios) == null ? void 0 : c.has(u)) ?? !1);
3622
+ return {
3623
+ content: d && u ? t("mediaPicker.ratioBar.unavailableForSelection", { ratio: Be(u) }) : "",
3624
+ disabled: !d
3625
+ };
3626
+ }
3627
+ function s(u, c) {
3628
+ var d;
3629
+ const f = c !== void 0 && ((d = a.unavailableRatios) == null ? void 0 : d.has(c));
3630
+ return [
3631
+ "height:28px",
3632
+ $,
3633
+ u && !f ? { borderColor: me, color: me, background: Nt } : {}
3634
+ ];
3635
+ }
3636
+ return (u, c) => {
3637
+ const d = ua("tooltip");
3638
+ return b(), k("div", yi, [
3639
+ v("span", vi, x(h(t)("mediaPicker.ratioBar.label")), 1),
3640
+ v("div", wi, [
3641
+ v("button", {
3642
+ type: "button",
3643
+ class: ee(["px-12 rounded-full border font-semibold transition-colors", r(n.value === null)]),
3644
+ style: j(s(n.value === null)),
3645
+ onClick: c[0] || (c[0] = (f) => o(null))
3646
+ }, x(h(t)("mediaPicker.variants.original")), 7),
3647
+ (b(!0), k(Z, null, he(h(Dt), (f) => et((b(), k("button", {
3648
+ key: f,
3649
+ type: "button",
3650
+ class: ee(["px-12 rounded-full border font-semibold transition-colors", r(n.value === f, f)]),
3651
+ style: j(s(n.value === f, f)),
3652
+ onClick: (w) => o(f)
3653
+ }, [
3654
+ de(x(h(Be)(f)), 1)
3655
+ ], 14, ki)), [
3656
+ [d, i(f)]
3657
+ ])), 128))
3658
+ ]),
3659
+ c[1] || (c[1] = v("div", { class: "flex-1" }, null, -1)),
3660
+ e.facts ? (b(), k("span", xi, x(e.facts.dimensions) + " · " + x(h(lr)(e.facts.sizeBytes)), 1)) : F("", !0)
3661
+ ]);
3662
+ };
3663
+ }
3664
+ });
3665
+ function Fa(e) {
3666
+ var t, a;
3667
+ const n = (a = (t = e == null ? void 0 : e.response) == null ? void 0 : t.data) == null ? void 0 : a.message;
3668
+ return n || (e instanceof Error ? e.message : (e == null ? void 0 : e.message) || String(e));
3669
+ }
3670
+ function Ei(e) {
3671
+ switch (e) {
3672
+ case "INSUFFICIENT_TOKENS":
3673
+ return "mediaPicker.variants.failedNoTokens";
3674
+ case "TOKEN_SERVICE_UNAVAILABLE":
3675
+ return "mediaPicker.variants.failedTokenServiceDown";
3676
+ default:
3677
+ return "mediaPicker.variants.failed";
3678
+ }
3679
+ }
3680
+ const Ri = { class: "space-y-8" }, Si = { class: "text-xs font-semibold text-gray-500" }, Ti = { class: "flex flex-wrap gap-8" }, Oi = ["onClick"], Ci = /* @__PURE__ */ be({
3681
+ __name: "RatioSelector",
3682
+ props: {
3683
+ modelValue: {},
3684
+ disabled: { type: Boolean }
3685
+ },
3686
+ emits: ["update:modelValue"],
3687
+ setup(e, { emit: t }) {
3688
+ const { t: a } = ye({ messages: ve }), n = e, o = t;
3689
+ function r(i) {
3690
+ n.disabled || o(
3691
+ "update:modelValue",
3692
+ n.modelValue.includes(i) ? n.modelValue.filter((s) => s !== i) : [...n.modelValue, i]
3693
+ );
3694
+ }
3695
+ return (i, s) => (b(), k("div", Ri, [
3696
+ v("div", Si, x(h(a)("mediaPicker.ratios.title")), 1),
3697
+ v("div", Ti, [
3698
+ (b(!0), k(Z, null, he(h(Dt), (u) => (b(), k("button", {
3699
+ key: u,
3700
+ type: "button",
3701
+ class: ee(["px-12 rounded-full border font-semibold transition-colors", [
3702
+ e.modelValue.includes(u) ? "" : "border-fm-color-neutral-gray-300 text-gray-500",
3703
+ e.disabled ? "opacity-50 cursor-not-allowed" : ""
3704
+ ]]),
3705
+ style: j([
3706
+ "height:30px",
3707
+ h($),
3708
+ e.modelValue.includes(u) ? { borderColor: h(me), color: h(me), background: h(Nt) } : {}
3709
+ ]),
3710
+ onClick: (c) => r(u)
3711
+ }, x(h(Be)(u)), 15, Oi))), 128))
3712
+ ]),
3713
+ v("div", {
3714
+ class: "text-gray-400",
3715
+ style: j(h($))
3716
+ }, x(h(a)("mediaPicker.ratios.hint")), 5)
3717
+ ]));
3718
+ }
3719
+ });
3720
+ function sa(e) {
3721
+ return new Promise((t) => {
3722
+ const a = new Image();
3723
+ a.onload = () => t({ width: a.naturalWidth || 480, height: a.naturalHeight || 360 }), a.onerror = () => t({ width: 480, height: 360 }), a.src = e;
3724
+ });
3725
+ }
3726
+ const Ai = { class: "flex flex-wrap items-center gap-8" }, Bi = {
3727
+ key: 1,
3728
+ class: "inline-flex items-center gap-4 border rounded-full border-gray-300 pl-8 pr-4",
3729
+ style: { height: "28px" }
3730
+ }, _i = ["placeholder"], Di = /* @__PURE__ */ be({
3731
+ __name: "TagFilterBar",
3732
+ props: {
3733
+ tags: {},
3734
+ modelValue: {},
3735
+ mode: { default: "filter" }
3736
+ },
3737
+ emits: ["update:modelValue", "tag-created"],
3738
+ setup(e, { emit: t }) {
3739
+ const { t: a } = ye({ messages: ve }), n = e, o = t;
3740
+ function r(u) {
3741
+ o("update:modelValue", n.modelValue.includes(u) ? n.modelValue.filter((c) => c !== u) : [...n.modelValue, u]);
3742
+ }
3743
+ const i = G("");
3744
+ function s() {
3745
+ const u = i.value.trim();
3746
+ i.value = "", u && (n.modelValue.includes(u) || o("update:modelValue", [...n.modelValue, u]), n.tags.includes(u) || o("tag-created", u));
3747
+ }
3748
+ return (u, c) => {
3749
+ const d = K("FmChip"), f = K("FmIcon");
3750
+ return b(), k("div", Ai, [
3751
+ e.mode === "filter" ? (b(), oe(d, {
3752
+ key: 0,
3753
+ label: h(a)("mediaPicker.tagFilterBar.all"),
3754
+ selected: e.modelValue.length === 0,
3755
+ selectable: "",
3756
+ onClick: c[0] || (c[0] = (w) => o("update:modelValue", []))
3757
+ }, null, 8, ["label", "selected"])) : F("", !0),
3758
+ (b(!0), k(Z, null, he(e.tags, (w) => (b(), oe(d, {
3759
+ key: w,
3760
+ label: w,
3761
+ selected: e.modelValue.includes(w),
3762
+ selectable: "",
3763
+ onClick: (_) => r(w)
3764
+ }, null, 8, ["label", "selected", "onClick"]))), 128)),
3765
+ e.mode === "assign" ? (b(), k("div", Bi, [
3766
+ et(v("input", {
3767
+ "onUpdate:modelValue": c[1] || (c[1] = (w) => i.value = w),
3768
+ placeholder: h(a)("mediaPicker.tagFilterBar.newTagPlaceholder"),
3769
+ class: "text-xs outline-none",
3770
+ style: { width: "88px" },
3771
+ onKeyup: $a(s, ["enter"])
3772
+ }, null, 40, _i), [
3773
+ [Ja, i.value]
3774
+ ]),
3775
+ v("button", {
3776
+ class: "p-2",
3777
+ onClick: s
3778
+ }, [
3779
+ W(f, {
3780
+ name: "add",
3781
+ size: "sm"
3782
+ })
3783
+ ])
3784
+ ])) : F("", !0)
3785
+ ]);
3786
+ };
3787
+ }
3788
+ }), za = 10 * 1024 * 1024, Va = 512 * 1024 * 1024, Mi = ["image/jpeg", "image/png", "image/webp"], Ni = ["video/mp4", "video/quicktime", "video/webm"], la = ["image", "video"];
3789
+ function ut(e) {
3790
+ return !e || e.length === 0 ? la : la.filter((t) => e.includes(t));
3791
+ }
3792
+ function Ii(e) {
3793
+ return ut(e).includes("image");
3794
+ }
3795
+ function qa(e) {
3796
+ return ut(e).includes("video");
3797
+ }
3798
+ function Ui(e) {
3799
+ const t = ut(e), a = [];
3800
+ return t.includes("image") && a.push(...Mi), t.includes("video") && a.push(...Ni), a.join(",");
3801
+ }
3802
+ function Li(e) {
3803
+ return qa(e) ? Va : za;
3804
+ }
3805
+ function Ut(e) {
3806
+ return e.type.startsWith("video/") ? "video" : "image";
3807
+ }
3808
+ function ji(e) {
3809
+ return Ut(e) === "video" ? Va : za;
3810
+ }
3811
+ function Fi(e, t) {
3812
+ return ut(t).includes(Ut(e));
3813
+ }
3814
+ const zi = { class: "space-y-16" }, Vi = {
3815
+ key: 2,
3816
+ class: "space-y-8"
3817
+ }, qi = { class: "text-xs font-semibold text-gray-500" }, Wi = ["src"], Gi = {
3818
+ key: 1,
3819
+ class: "rounded flex-shrink-0 flex items-center justify-center bg-fm-color-neutral-gray-100 text-gray-400",
3820
+ style: { width: "44px", height: "44px" }
3821
+ }, $i = { class: "flex-1 min-w-0 flex flex-col gap-2" }, Ji = { class: "text-xs font-semibold truncate" }, Hi = ["onClick"], Ki = { class: "space-y-8" }, Xi = { class: "text-xs font-semibold text-gray-500" }, Qi = {
3822
+ key: 0,
3823
+ class: "flex flex-wrap items-center gap-8"
3824
+ }, Yi = ["onClick"], Zi = /* @__PURE__ */ be({
3825
+ __name: "UploadPanel",
3826
+ props: {
3827
+ businessId: {},
3828
+ restaurantId: {},
3829
+ availableTags: {},
3830
+ kinds: {}
3831
+ },
3832
+ emits: ["tag-created", "uploaded"],
3833
+ setup(e, { expose: t, emit: a }) {
3834
+ const { t: n } = ye({ messages: ve }), o = e, r = a, i = G([]), s = G([]), u = G([]), c = G(!1), d = z(() => i.value.length), f = z(() => o.availableTags.filter((m) => !s.value.includes(m)).slice(0, 6)), w = z(() => i.value.some((m) => m.isVideo)), _ = z(() => i.value.some((m) => !m.isVideo)), P = z(() => Ui(o.kinds)), E = z(() => Li(o.kinds)), R = z(() => Ii(o.kinds)), p = z(() => qa(o.kinds)), y = z(() => p.value ? R.value ? n("mediaPicker.uploadPanel.dropLabel") : n("mediaPicker.uploadPanel.dropLabelVideos") : n("mediaPicker.uploadPanel.dropLabelImages")), C = z(() => p.value ? R.value ? n("mediaPicker.uploadPanel.helperText") : n("mediaPicker.uploadPanel.helperTextVideos") : n("mediaPicker.uploadPanel.helperTextImages"));
3835
+ function A(m) {
3836
+ URL.revokeObjectURL(m.previewUrl), m.posterPreviewUrl && URL.revokeObjectURL(m.posterPreviewUrl);
3837
+ }
3838
+ function V() {
3839
+ i.value.forEach(A), i.value = [], s.value = [], u.value = [];
3840
+ }
3841
+ async function Q(m) {
3842
+ const g = URL.createObjectURL(m), L = Ut(m) === "video", U = {
3843
+ id: crypto.randomUUID(),
3844
+ refId: crypto.randomUUID(),
3845
+ file: m,
3846
+ previewUrl: g,
3847
+ dimensions: null,
3848
+ error: null,
3849
+ isVideo: L,
3850
+ durationMs: null,
3851
+ poster: null,
3852
+ posterPreviewUrl: null,
3853
+ probed: !1
3854
+ };
3855
+ if (i.value.push(U), !Fi(m, o.kinds)) {
3856
+ U.error = n("mediaPicker.uploadPanel.kindNotAllowedError"), U.probed = !0;
3857
+ return;
3858
+ }
3859
+ const B = ji(m);
3860
+ if (m.size > B) {
3861
+ U.error = n("mediaPicker.uploadPanel.fileTooLargeError", { limit: N(B) }), U.probed = !0;
3862
+ return;
3863
+ }
3864
+ if (!L) {
3865
+ U.dimensions = await sa(g), U.probed = !0;
3866
+ return;
3867
+ }
3868
+ const M = await Vr(g);
3869
+ M && (U.dimensions = { width: M.width, height: M.height }, U.durationMs = M.durationMs, U.poster = await qr(g), U.poster && (U.posterPreviewUrl = URL.createObjectURL(U.poster))), U.probed = !0;
3870
+ }
3871
+ function S(m) {
3872
+ return m.isVideo && m.probed && m.dimensions === null;
3873
+ }
3874
+ function re(m) {
3875
+ return m.durationMs === null ? null : It(m.durationMs);
3876
+ }
3877
+ function O(m) {
3878
+ const g = i.value.find((L) => L.id === m);
3879
+ g && A(g), i.value = i.value.filter((L) => L.id !== m);
3880
+ }
3881
+ function N(m) {
3882
+ return m >= 1024 * 1024 ? `${(m / 1024 / 1024).toFixed(1)} MB` : `${Math.round(m / 1024)} KB`;
3883
+ }
3884
+ async function J(m) {
3885
+ const g = m.isVideo ? await le(m) : await H(m);
3886
+ return s.value.length ? await fr(o.businessId, g.id, s.value) : g;
3887
+ }
3888
+ async function le(m) {
3889
+ const g = m.dimensions ? { width: m.dimensions.width, height: m.dimensions.height, durationMs: m.durationMs ?? 0 } : { width: 0, height: 0, durationMs: 0 }, L = m.file.type, U = await wr(o.businessId, {
3890
+ refType: Fe,
3891
+ refId: m.refId,
3892
+ videoId: "main",
3893
+ contentType: L,
3894
+ fileSize: m.file.size
3895
+ }), B = await fetch(U.uploadUrl, {
3896
+ method: "PUT",
3897
+ headers: { "Content-Type": L },
3898
+ body: m.file
3899
+ });
3900
+ if (!B.ok)
3901
+ throw new Error(n("mediaPicker.uploadPanel.uploadFailedError", { status: B.status }));
3902
+ if (m.poster)
3903
+ try {
3904
+ await fetch(U.posterUploadUrl, {
3905
+ method: "PUT",
3906
+ headers: { "Content-Type": U.posterContentType },
3907
+ body: m.poster
3908
+ });
3909
+ } catch {
3910
+ }
3911
+ return (await kr(o.businessId, {
3912
+ refType: Fe,
3913
+ refId: m.refId,
3914
+ videoId: "main",
3915
+ restaurantId: o.restaurantId,
3916
+ fileName: m.file.name,
3917
+ // The same value the intent was signed for, and the same one the PUT sent. It is what
3918
+ // locates the object server-side, because the key ends in an extension derived from it.
3919
+ contentType: L,
3920
+ width: g.width,
3921
+ height: g.height,
3922
+ durationMs: g.durationMs
3923
+ })).asset;
3924
+ }
3925
+ async function H(m) {
3926
+ const g = m.dimensions ?? await sa(m.previewUrl), L = m.file.type || "image/jpeg", U = await yr(o.businessId, {
3927
+ refType: Fe,
3928
+ refId: m.refId,
3929
+ imageId: "main",
3930
+ contentType: L,
3931
+ fileSize: m.file.size
3932
+ }), B = await fetch(U.uploadUrl, { method: "PUT", headers: { "Content-Type": L }, body: m.file });
3933
+ if (!B.ok)
3934
+ throw new Error(n("mediaPicker.uploadPanel.uploadFailedError", { status: B.status }));
3935
+ return (await vr(o.businessId, {
3936
+ refType: Fe,
3937
+ refId: m.refId,
3938
+ imageId: "main",
3939
+ restaurantId: o.restaurantId,
3940
+ fileName: m.file.name,
3941
+ width: g.width,
3942
+ height: g.height,
3943
+ aspectRatios: u.value
3944
+ })).asset;
3945
+ }
3946
+ async function Y() {
3947
+ if (!(!i.value.length || !o.businessId)) {
3948
+ c.value = !0;
3949
+ try {
3950
+ const m = i.value, g = m.filter((I) => !I.error), L = m.filter((I) => I.error);
3951
+ if (!g.length)
3952
+ return;
3953
+ const U = await Promise.allSettled(g.map(J)), B = /* @__PURE__ */ new Set(), M = [];
3954
+ U.forEach((I, ie) => {
3955
+ I.status === "rejected" ? (B.add(g[ie].id), g[ie].error = Fa(I.reason)) : M.push(I.value);
3956
+ }), i.value = [...L, ...g.filter((I) => B.has(I.id))], M.length > 0 && r("uploaded", M);
3957
+ } finally {
3958
+ c.value = !1;
3959
+ }
3960
+ }
3961
+ }
3962
+ return t({ stagedCount: d, uploading: c, upload: Y, reset: V }), (m, g) => {
3963
+ const L = K("FmDropField"), U = K("FmIcon");
3964
+ return b(), k("div", zi, [
3965
+ W(L, {
3966
+ label: y.value,
3967
+ accept: P.value,
3968
+ "max-file-size": E.value,
3969
+ onFileUpload: Q
3970
+ }, {
3971
+ "accept-text": Se(() => [...g[3] || (g[3] = [])]),
3972
+ "helper-text": Se(() => [
3973
+ de(x(C.value), 1)
3974
+ ]),
3975
+ _: 1
3976
+ }, 8, ["label", "accept", "max-file-size"]),
3977
+ R.value && (_.value || !w.value) ? (b(), oe(Ci, {
3978
+ key: 0,
3979
+ modelValue: u.value,
3980
+ "onUpdate:modelValue": g[0] || (g[0] = (B) => u.value = B),
3981
+ disabled: c.value
3982
+ }, null, 8, ["modelValue", "disabled"])) : F("", !0),
3983
+ w.value && _.value ? (b(), k("div", {
3984
+ key: 1,
3985
+ class: "text-gray-500",
3986
+ style: j(h($))
3987
+ }, x(h(n)("mediaPicker.uploadPanel.videoNoRatiosNote")), 5)) : F("", !0),
3988
+ i.value.length ? (b(), k("div", Vi, [
3989
+ v("div", qi, x(h(n)("mediaPicker.uploadPanel.stagedCount", { count: i.value.length })), 1),
3990
+ (b(!0), k(Z, null, he(i.value, (B) => (b(), k("div", {
3991
+ key: B.id,
3992
+ class: ee(["flex items-center gap-12 p-8 border rounded-lg", B.error ? "border-red-300 bg-red-50" : "border-fm-color-neutral-gray-200"]),
3993
+ style: j(S(B) && !B.error ? h(Er) : void 0)
3994
+ }, [
3995
+ !B.isVideo || B.posterPreviewUrl ? (b(), k("img", {
3996
+ key: 0,
3997
+ src: B.isVideo ? B.posterPreviewUrl : B.previewUrl,
3998
+ class: "rounded flex-shrink-0 object-cover",
3999
+ style: { width: "44px", height: "44px" }
4000
+ }, null, 8, Wi)) : (b(), k("div", Gi, [
4001
+ W(U, {
4002
+ name: "movie",
4003
+ size: "sm"
4004
+ })
4005
+ ])),
4006
+ v("div", $i, [
4007
+ v("span", Ji, x(B.file.name), 1),
4008
+ B.error ? (b(), k("span", {
4009
+ key: 0,
4010
+ class: "text-red-600",
4011
+ style: j(h($))
4012
+ }, x(B.error), 5)) : S(B) ? (b(), k("span", {
4013
+ key: 1,
4014
+ style: j([h($), h(Rr)])
4015
+ }, x(h(n)("mediaPicker.uploadPanel.videoUndecodableWarning")), 5)) : (b(), k("span", {
4016
+ key: 2,
4017
+ class: "text-gray-500",
4018
+ style: j(h($))
4019
+ }, [
4020
+ B.dimensions ? (b(), k(Z, { key: 0 }, [
4021
+ de(x(B.dimensions.width) + "×" + x(B.dimensions.height) + " · ", 1)
4022
+ ], 64)) : F("", !0),
4023
+ re(B) ? (b(), k(Z, { key: 1 }, [
4024
+ de(x(re(B)) + " · ", 1)
4025
+ ], 64)) : F("", !0),
4026
+ de(x(N(B.file.size)), 1)
4027
+ ], 4))
4028
+ ]),
4029
+ v("button", {
4030
+ class: "rounded flex-shrink-0 flex items-center justify-center text-gray-500 hover:bg-red-50 hover:text-red-600",
4031
+ style: { width: "28px", height: "28px" },
4032
+ onClick: (M) => O(B.id)
4033
+ }, [
4034
+ W(U, {
4035
+ name: "close",
4036
+ size: "sm"
4037
+ })
4038
+ ], 8, Hi)
4039
+ ], 6))), 128))
4040
+ ])) : F("", !0),
4041
+ v("div", Ki, [
4042
+ v("div", Xi, x(h(n)("mediaPicker.uploadPanel.tagsLabel")), 1),
4043
+ W(Di, {
4044
+ modelValue: s.value,
4045
+ "onUpdate:modelValue": g[1] || (g[1] = (B) => s.value = B),
4046
+ tags: e.availableTags,
4047
+ mode: "assign",
4048
+ onTagCreated: g[2] || (g[2] = (B) => r("tag-created", B))
4049
+ }, null, 8, ["modelValue", "tags"]),
4050
+ f.value.length ? (b(), k("div", Qi, [
4051
+ v("span", {
4052
+ class: "text-gray-400",
4053
+ style: j(h($))
4054
+ }, x(h(n)("mediaPicker.uploadPanel.suggestedTagsLabel")), 5),
4055
+ (b(!0), k(Z, null, he(f.value, (B) => (b(), k("button", {
4056
+ key: B,
4057
+ class: "px-12 rounded-full border border-dashed border-fm-color-neutral-gray-300 font-semibold text-gray-500",
4058
+ style: j([h($), "height:26px"]),
4059
+ onClick: (M) => s.value.push(B)
4060
+ }, " + " + x(B), 13, Yi))), 128))
4061
+ ])) : F("", !0)
4062
+ ])
4063
+ ]);
4064
+ };
4065
+ }
4066
+ }), es = 5e3, ts = 3;
4067
+ function as(e) {
4068
+ const t = G(/* @__PURE__ */ new Map());
4069
+ let a = [], n, o = 0;
4070
+ function r() {
4071
+ n !== void 0 && clearTimeout(n), n = void 0;
4072
+ }
4073
+ async function i() {
4074
+ let u = !1;
4075
+ try {
4076
+ const c = await br({ businessId: e(), refType: Fe, refIds: a });
4077
+ t.value = new Map(c.map((d) => [d.refId, d])), o = 0;
4078
+ } catch (c) {
4079
+ if (u = !0, o += 1, o >= ts) {
4080
+ console.warn("[media-picker] stopped polling image variants after repeated failures", c);
4081
+ return;
4082
+ }
4083
+ }
4084
+ ([...t.value.values()].some((c) => or(c.variants)) || u) && (n = setTimeout(i, es));
4085
+ }
4086
+ async function s(u) {
4087
+ if (r(), o = 0, a = u, u.length === 0 || !e()) {
4088
+ t.value = /* @__PURE__ */ new Map();
4089
+ return;
4090
+ }
4091
+ await i();
4092
+ }
4093
+ return Ha(r), { byRefId: t, load: s, stop: r };
4094
+ }
4095
+ const ns = { class: "w-full flex items-center justify-between gap-16 pr-8" }, os = { class: "text-xs font-normal text-fm-color-typo-secondary" }, rs = { class: "relative" }, is = {
4096
+ key: 0,
4097
+ class: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-12 bg-white/80 rounded"
4098
+ }, ss = {
4099
+ key: 1,
4100
+ class: "flex gap-16 border-b border-fm-color-neutral-gray-200 mb-12"
4101
+ }, ls = { class: "flex flex-col w-full" }, us = {
4102
+ key: 0,
4103
+ class: "border-b border-fm-color-neutral-gray-200 pb-12 mb-12"
4104
+ }, ds = { class: "flex items-center justify-between w-full" }, cs = {
4105
+ key: 0,
4106
+ class: "text-xs text-fm-color-typo-secondary"
4107
+ }, ps = { key: 1 }, fs = { class: "flex gap-8" }, al = /* @__PURE__ */ be({
4108
+ __name: "MediaPickerModal",
4109
+ props: {
4110
+ open: { type: Boolean },
4111
+ businessId: {},
4112
+ restaurantId: {},
4113
+ selectionMode: { default: "single" },
4114
+ ratio: {},
4115
+ allowUpload: { type: Boolean, default: !0 },
4116
+ kinds: { default: () => ["image", "video"] }
4117
+ },
4118
+ emits: ["update:open", "select", "confirm"],
4119
+ setup(e, { emit: t }) {
4120
+ const { t: a } = ye({ messages: ve }), n = e, o = z(() => n.ratio ? n.kinds.filter((m) => m !== "video") : n.kinds), r = t, i = G("browse");
4121
+ xe(
4122
+ () => n.allowUpload,
4123
+ (m) => {
4124
+ m || (i.value = "browse");
4125
+ },
4126
+ { immediate: !0 }
4127
+ );
4128
+ const s = G(""), u = G(null), c = G([]), d = as(() => n.businessId), f = G([]), w = G(0), _ = G([]), P = G(!1);
4129
+ async function E() {
4130
+ if (n.businessId) {
4131
+ P.value = !0;
4132
+ try {
4133
+ const m = await dr({
4134
+ // Never offer an unconfirmed AI draft as a pickable image.
4135
+ excludeTags: [Ua],
4136
+ businessId: n.businessId,
4137
+ restaurantId: n.restaurantId,
4138
+ search: s.value || void 0,
4139
+ tags: u.value ? [u.value] : void 0,
4140
+ kinds: o.value,
4141
+ limit: 200,
4142
+ sortBy: "createdAt",
4143
+ descending: !0
4144
+ });
4145
+ c.value = m.resources, await d.load(
4146
+ m.resources.filter((g) => !Re(g)).map((g) => g.refId).filter((g) => !!g)
4147
+ );
4148
+ } finally {
4149
+ P.value = !1;
4150
+ }
4151
+ }
4152
+ }
4153
+ async function R() {
4154
+ if (!n.businessId)
4155
+ return;
4156
+ const [m, g] = await Promise.all([La(n.businessId), cr(n.businessId)]);
4157
+ f.value = m.tags, w.value = m.total, _.value = g;
4158
+ }
4159
+ xe(
4160
+ () => n.open,
4161
+ (m) => {
4162
+ var g;
4163
+ m && (i.value = "browse", s.value = "", u.value = null, Q.value = /* @__PURE__ */ new Set(), y.value = n.ratio ?? null, (g = H.value) == null || g.reset(), R(), E());
4164
+ }
4165
+ ), xe(u, E), xe(
4166
+ () => o.value.join(","),
4167
+ () => E()
4168
+ );
4169
+ let p;
4170
+ xe(s, () => {
4171
+ clearTimeout(p), p = setTimeout(E, 250);
4172
+ });
4173
+ const y = G(n.ratio ?? null);
4174
+ xe(
4175
+ () => n.ratio,
4176
+ (m) => y.value = m ?? null
4177
+ );
4178
+ const C = z(() => n.ratio !== void 0 && n.ratio !== null);
4179
+ function A(m) {
4180
+ var g;
4181
+ return m.refId ? ((g = d.byRefId.value.get(m.refId)) == null ? void 0 : g.variants) ?? [] : [];
4182
+ }
4183
+ const V = z(() => {
4184
+ const m = /* @__PURE__ */ new Set();
4185
+ if (y.value === null)
4186
+ return m;
4187
+ for (const g of c.value)
4188
+ ht(g, y.value, A(g)) || m.add(g.id);
4189
+ return m;
4190
+ }), Q = G(/* @__PURE__ */ new Set());
4191
+ function S(m) {
4192
+ const g = new Set(Q.value);
4193
+ g.has(m.id) ? g.delete(m.id) : (n.selectionMode === "single" && g.clear(), g.add(m.id)), Q.value = g;
4194
+ }
4195
+ function re(m) {
4196
+ S(m);
4197
+ }
4198
+ const O = z(
4199
+ () => c.value.filter((m) => Q.value.has(m.id)).map((m) => ht(m, y.value, A(m))).filter((m) => m !== null)
4200
+ ), N = z(() => {
4201
+ if (O.value.length !== 1)
4202
+ return /* @__PURE__ */ new Set();
4203
+ const m = O.value[0].asset, g = A(m);
4204
+ return new Set(Dt.filter((L) => !ht(m, L, g)));
4205
+ }), J = z(() => {
4206
+ if (O.value.length !== 1)
4207
+ return null;
4208
+ const m = O.value[0];
4209
+ if (m.ratio === null) {
4210
+ const L = ze(m.asset);
4211
+ return L ? { dimensions: L, sizeBytes: m.asset.fileSizeBytes } : null;
4212
+ }
4213
+ const g = A(m.asset).find((L) => L.aspectRatio === m.ratio);
4214
+ return !(g != null && g.width) || !(g != null && g.height) || !g.fileSizeBytes ? null : { dimensions: `${g.width}×${g.height}`, sizeBytes: g.fileSizeBytes };
4215
+ });
4216
+ function le() {
4217
+ if (n.selectionMode === "single") {
4218
+ const m = O.value[0];
4219
+ if (!m)
4220
+ return;
4221
+ r("select", m), r("update:open", !1);
4222
+ return;
4223
+ }
4224
+ r("confirm", O.value), r("update:open", !1);
4225
+ }
4226
+ const H = G(null);
4227
+ async function Y() {
4228
+ var m;
4229
+ (m = H.value) != null && m.stagedCount || (i.value = "browse"), await Promise.all([E(), R()]);
4230
+ }
4231
+ return (m, g) => {
4232
+ const L = K("FmSearch"), U = K("FmButton"), B = K("FmDialog");
4233
+ return b(), oe(B, {
4234
+ "model-value": e.open,
4235
+ "max-width": 900,
4236
+ "onUpdate:modelValue": g[8] || (g[8] = (M) => !M && r("update:open", !1))
4237
+ }, {
4238
+ "dialog-header": Se(() => [
4239
+ v("div", ns, [
4240
+ v("div", null, [
4241
+ v("div", null, x(h(a)("mediaPicker.pickerModal.title")), 1),
4242
+ v("div", os, x(e.selectionMode === "multiple" ? h(a)("mediaPicker.pickerModal.subtitleMultiple") : h(a)("mediaPicker.pickerModal.subtitleSingle")), 1)
4243
+ ]),
4244
+ i.value === "browse" ? (b(), oe(L, {
4245
+ key: 0,
4246
+ modelValue: s.value,
4247
+ "onUpdate:modelValue": g[0] || (g[0] = (M) => s.value = M),
4248
+ placeholder: h(a)("mediaPicker.pickerModal.searchPlaceholder"),
4249
+ class: "shrink-0",
4250
+ style: { width: "200px" }
4251
+ }, null, 8, ["modelValue", "placeholder"])) : F("", !0)
4252
+ ])
4253
+ ]),
4254
+ "dialog-footer": Se(() => {
4255
+ var M, I;
4256
+ return [
4257
+ v("div", ls, [
4258
+ i.value === "browse" && e.selectionMode === "single" ? (b(), k("div", us, [
4259
+ W(Pi, {
4260
+ modelValue: y.value,
4261
+ "onUpdate:modelValue": g[5] || (g[5] = (ie) => y.value = ie),
4262
+ facts: J.value,
4263
+ locked: C.value,
4264
+ "unavailable-ratios": N.value
4265
+ }, null, 8, ["modelValue", "facts", "locked", "unavailable-ratios"])
4266
+ ])) : F("", !0),
4267
+ v("div", ds, [
4268
+ i.value === "browse" ? (b(), k("span", cs, [
4269
+ Q.value.size ? (b(), k(Z, { key: 0 }, [
4270
+ de(x(h(a)("mediaPicker.pickerModal.selectedCount", { count: Q.value.size })), 1)
4271
+ ], 64)) : (b(), k(Z, { key: 1 }, [
4272
+ de(x(h(a)("mediaPicker.pickerModal.selectPrompt")), 1)
4273
+ ], 64))
4274
+ ])) : (b(), k("span", ps)),
4275
+ v("div", fs, [
4276
+ W(U, {
4277
+ label: h(a)("mediaPicker.pickerModal.cancelButton"),
4278
+ variant: "tertiary",
4279
+ onClick: g[6] || (g[6] = (ie) => r("update:open", !1))
4280
+ }, null, 8, ["label"]),
4281
+ i.value === "upload" ? (b(), oe(U, {
4282
+ key: 0,
4283
+ label: h(a)("mediaPicker.pickerModal.uploadSubmitButton", { count: ((M = H.value) == null ? void 0 : M.stagedCount) ?? 0 }),
4284
+ variant: "primary",
4285
+ disabled: !((I = H.value) != null && I.stagedCount) || H.value.uploading,
4286
+ onClick: g[7] || (g[7] = (ie) => {
4287
+ var Pe;
4288
+ return (Pe = H.value) == null ? void 0 : Pe.upload();
4289
+ })
4290
+ }, null, 8, ["label", "disabled"])) : (b(), oe(U, {
4291
+ key: 1,
4292
+ label: h(a)("mediaPicker.pickerModal.confirmButton"),
4293
+ variant: "primary",
4294
+ disabled: O.value.length === 0,
4295
+ onClick: le
4296
+ }, null, 8, ["label", "disabled"]))
4297
+ ])
4298
+ ])
4299
+ ])
4300
+ ];
4301
+ }),
4302
+ default: Se(() => {
4303
+ var M;
4304
+ return [
4305
+ v("div", rs, [
4306
+ (M = H.value) != null && M.uploading ? (b(), k("div", is, [
4307
+ (b(), k("svg", {
4308
+ class: "animate-spin",
4309
+ style: j({ width: "32px", height: "32px", color: h(me) }),
4310
+ xmlns: "http://www.w3.org/2000/svg",
4311
+ fill: "none",
4312
+ viewBox: "0 0 24 24"
4313
+ }, [...g[9] || (g[9] = [
4314
+ v("circle", {
4315
+ class: "opacity-25",
4316
+ cx: "12",
4317
+ cy: "12",
4318
+ r: "10",
4319
+ stroke: "currentColor",
4320
+ "stroke-width": "3"
4321
+ }, null, -1),
4322
+ v("path", {
4323
+ class: "opacity-75",
4324
+ fill: "currentColor",
4325
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
4326
+ }, null, -1)
4327
+ ])], 4)),
4328
+ v("span", {
4329
+ class: "text-sm font-semibold",
4330
+ style: j({ color: h(me) })
4331
+ }, x(h(a)("mediaPicker.uploadPanel.uploading")), 5)
4332
+ ])) : F("", !0),
4333
+ e.allowUpload ? (b(), k("div", ss, [
4334
+ v("button", {
4335
+ class: ee(["pb-8 px-4 text-sm", i.value === "browse" ? "font-semibold border-b-2" : "text-gray-500"]),
4336
+ style: j(i.value === "browse" ? { borderColor: h(me) } : {}),
4337
+ onClick: g[1] || (g[1] = (I) => i.value = "browse")
4338
+ }, x(h(a)("mediaPicker.pickerModal.browseTab")), 7),
4339
+ v("button", {
4340
+ class: ee(["pb-8 px-4 text-sm", i.value === "upload" ? "font-semibold border-b-2" : "text-gray-500"]),
4341
+ style: j(i.value === "upload" ? { borderColor: h(me) } : {}),
4342
+ onClick: g[2] || (g[2] = (I) => i.value = "upload")
4343
+ }, x(h(a)("mediaPicker.pickerModal.uploadTab")), 7)
4344
+ ])) : F("", !0),
4345
+ i.value === "browse" ? (b(), k(Z, { key: 2 }, [
4346
+ f.value.length ? (b(), oe(bi, {
4347
+ key: 0,
4348
+ modelValue: u.value,
4349
+ "onUpdate:modelValue": g[3] || (g[3] = (I) => u.value = I),
4350
+ tags: f.value,
4351
+ total: w.value,
4352
+ class: "mb-12"
4353
+ }, null, 8, ["modelValue", "tags", "total"])) : F("", !0),
4354
+ W(gi, {
4355
+ assets: c.value,
4356
+ loading: P.value,
4357
+ selectable: "",
4358
+ "selected-ids": Q.value,
4359
+ "variants-by-ref-id": h(d).byRefId.value,
4360
+ "unavailable-ids": V.value,
4361
+ "unavailable-ratio": y.value,
4362
+ onOpen: re,
4363
+ onToggle: S
4364
+ }, null, 8, ["assets", "loading", "selected-ids", "variants-by-ref-id", "unavailable-ids", "unavailable-ratio"])
4365
+ ], 64)) : e.allowUpload ? (b(), oe(Zi, {
4366
+ key: 3,
4367
+ ref_key: "uploadPanelRef",
4368
+ ref: H,
4369
+ "business-id": e.businessId,
4370
+ "restaurant-id": e.restaurantId,
4371
+ "available-tags": _.value,
4372
+ kinds: o.value,
4373
+ onTagCreated: g[4] || (g[4] = (I) => _.value.push(I)),
4374
+ onUploaded: Y
4375
+ }, null, 8, ["business-id", "restaurant-id", "available-tags", "kinds"])) : F("", !0)
4376
+ ])
4377
+ ];
4378
+ }),
4379
+ _: 1
4380
+ }, 8, ["model-value"]);
4381
+ };
4382
+ }
4383
+ }), nl = 60;
4384
+ function ms(e, t) {
4385
+ return (e - 1) * t;
4386
+ }
4387
+ function gs(e, t, a) {
4388
+ if (a === 0)
4389
+ return { start: 0, end: 0 };
4390
+ const n = ms(e, t) + 1;
4391
+ return { start: n, end: Math.min(n + t - 1, a) };
4392
+ }
4393
+ function ol(e, t) {
4394
+ return Math.min(Math.max(e, 1), Math.max(t, 1));
4395
+ }
4396
+ function hs(e) {
4397
+ return Array.from({ length: Math.max(e, 0) }, (t, a) => ({
4398
+ label: String(a + 1),
4399
+ value: a + 1
4400
+ }));
4401
+ }
4402
+ const bs = {
4403
+ key: 0,
4404
+ class: "flex items-center justify-between gap-24 mt-16 flex-wrap"
4405
+ }, ys = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, vs = { class: "flex gap-8 items-center" }, ws = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, rl = /* @__PURE__ */ be({
4406
+ __name: "AssetPagination",
4407
+ props: {
4408
+ page: {},
4409
+ pageSize: {},
4410
+ totalResources: {},
4411
+ totalPages: {},
4412
+ disabled: { type: Boolean, default: !1 }
4413
+ },
4414
+ emits: ["update:page"],
4415
+ setup(e, { emit: t }) {
4416
+ const a = e, n = t, { t: o } = ye({ messages: ve }), r = z(() => gs(a.page, a.pageSize, a.totalResources)), i = z(() => hs(a.totalPages)), s = z(() => a.page <= 1), u = z(() => a.page >= a.totalPages);
4417
+ function c(d) {
4418
+ d === a.page || d < 1 || d > a.totalPages || n("update:page", d);
4419
+ }
4420
+ return (d, f) => {
4421
+ const w = K("FmSelect"), _ = K("FmButton");
4422
+ return e.totalPages > 1 ? (b(), k("div", bs, [
4423
+ v("span", ys, x(h(o)("mediaPicker.assetPagination.itemCount", { start: r.value.start, end: r.value.end, total: e.totalResources })), 1),
4424
+ v("div", vs, [
4425
+ W(w, {
4426
+ items: i.value,
4427
+ "model-value": e.page,
4428
+ disabled: e.disabled,
4429
+ "onUpdate:modelValue": f[0] || (f[0] = (P) => c(P))
4430
+ }, null, 8, ["items", "model-value", "disabled"]),
4431
+ v("span", ws, x(h(o)("mediaPicker.assetPagination.pageCount", { total: e.totalPages })), 1),
4432
+ W(_, {
4433
+ icon: "chevron_left",
4434
+ "icon-color": "neutral-black",
4435
+ variant: "tertiary",
4436
+ disabled: e.disabled || s.value,
4437
+ onClick: f[1] || (f[1] = (P) => c(e.page - 1))
4438
+ }, null, 8, ["disabled"]),
4439
+ W(_, {
4440
+ icon: "chevron_right",
4441
+ "icon-color": "neutral-black",
4442
+ variant: "tertiary",
4443
+ disabled: e.disabled || u.value,
4444
+ onClick: f[2] || (f[2] = (P) => c(e.page + 1))
4445
+ }, null, 8, ["disabled"])
4446
+ ])
4447
+ ])) : F("", !0);
4448
+ };
4449
+ }
4450
+ }), ks = { class: "relative flex-1 min-w-0 bg-gray-900 flex items-center justify-center overflow-hidden" }, xs = ["src", "alt"], Ps = {
4451
+ key: 1,
4452
+ class: "flex flex-col items-center gap-12 text-center px-24"
4453
+ }, Es = { class: "text-sm text-white" }, Rs = { class: "absolute bottom-12 left-1/2 -translate-x-1/2 flex items-center gap-8" }, Ss = ["onClick"], Ts = /* @__PURE__ */ be({
4454
+ __name: "VariantCarousel",
4455
+ props: /* @__PURE__ */ yt({
4456
+ original: {},
4457
+ variants: {},
4458
+ alt: {}
4459
+ }, {
4460
+ index: { default: 0 },
4461
+ indexModifiers: {}
4462
+ }),
4463
+ emits: /* @__PURE__ */ yt(["regenerate"], ["update:index"]),
4464
+ setup(e, { emit: t }) {
4465
+ const { t: a } = ye({ messages: ve }), n = e, o = t, r = da(e, "index"), i = z(() => Ma(n.original, n.variants));
4466
+ xe(i, (d) => {
4467
+ r.value > d.length - 1 && (r.value = d.length - 1);
4468
+ });
4469
+ const s = z(() => i.value[r.value]);
4470
+ function u(d) {
4471
+ const f = i.value.length;
4472
+ r.value = (r.value + d + f) % f;
4473
+ }
4474
+ function c(d) {
4475
+ return d ? Be(d) : "";
4476
+ }
4477
+ return (d, f) => {
4478
+ var w, _, P, E;
4479
+ const R = K("FmIcon"), p = K("FmButton");
4480
+ return b(), k("div", ks, [
4481
+ (w = s.value) != null && w.url ? (b(), k("img", {
4482
+ key: 0,
4483
+ src: s.value.url,
4484
+ alt: e.alt,
4485
+ class: "max-w-full max-h-full object-contain"
4486
+ }, null, 8, xs)) : s.value ? (b(), k("div", Ps, [
4487
+ W(R, {
4488
+ name: "error",
4489
+ size: "lg",
4490
+ color: "white"
4491
+ }),
4492
+ v("span", Es, x(h(a)(h(Ei)(s.value.failureCode))), 1),
4493
+ W(p, {
4494
+ label: h(a)("mediaPicker.variants.regenerate"),
4495
+ variant: "secondary",
4496
+ size: "md",
4497
+ "prepend-icon": "refresh",
4498
+ onClick: f[0] || (f[0] = (y) => s.value.ratio && o("regenerate", s.value.ratio))
4499
+ }, null, 8, ["label"])
4500
+ ])) : F("", !0),
4501
+ v("span", {
4502
+ class: "absolute top-8 left-8 bg-black/70 text-white font-semibold px-8 rounded",
4503
+ style: j([h($), "padding-top:2px;padding-bottom:2px"])
4504
+ }, [
4505
+ de(x(((_ = s.value) == null ? void 0 : _.kind) === "original" ? h(a)("mediaPicker.variants.original") : c(((P = s.value) == null ? void 0 : P.ratio) ?? null)) + " ", 1),
4506
+ ((E = s.value) == null ? void 0 : E.status) === "pending" ? (b(), k(Z, { key: 0 }, [
4507
+ de(" · " + x(h(a)("mediaPicker.variants.generating")), 1)
4508
+ ], 64)) : F("", !0)
4509
+ ], 4),
4510
+ i.value.length > 1 ? (b(), k(Z, { key: 2 }, [
4511
+ v("button", {
4512
+ class: "absolute left-8 top-1/2 -translate-y-1/2 rounded-full bg-black/50 flex items-center justify-center",
4513
+ style: { width: "32px", height: "32px" },
4514
+ onClick: f[1] || (f[1] = (y) => u(-1))
4515
+ }, [
4516
+ W(R, {
4517
+ name: "chevron_left",
4518
+ size: "sm",
4519
+ color: "white"
4520
+ })
4521
+ ]),
4522
+ v("button", {
4523
+ class: "absolute right-8 top-1/2 -translate-y-1/2 rounded-full bg-black/50 flex items-center justify-center",
4524
+ style: { width: "32px", height: "32px" },
4525
+ onClick: f[2] || (f[2] = (y) => u(1))
4526
+ }, [
4527
+ W(R, {
4528
+ name: "chevron_right",
4529
+ size: "sm",
4530
+ color: "white"
4531
+ })
4532
+ ]),
4533
+ v("div", Rs, [
4534
+ (b(!0), k(Z, null, he(i.value, (y, C) => (b(), k("button", {
4535
+ key: y.key,
4536
+ class: ee(["rounded-full", C === r.value ? "bg-white" : "bg-white/40"]),
4537
+ style: { width: "8px", height: "8px" },
4538
+ onClick: (A) => r.value = C
4539
+ }, null, 10, Ss))), 128))
4540
+ ])
4541
+ ], 64)) : F("", !0)
4542
+ ]);
4543
+ };
4544
+ }
4545
+ }), Os = {
4546
+ key: 0,
4547
+ class: "flex",
4548
+ style: { height: "620px" }
4549
+ }, Cs = {
4550
+ key: 0,
4551
+ class: "flex-1 min-w-0 bg-black flex items-center justify-center"
4552
+ }, As = ["src", "poster"], Bs = {
4553
+ class: "flex-shrink-0 flex flex-col gap-12 p-16 overflow-y-auto",
4554
+ style: { width: "320px" }
4555
+ }, _s = {
4556
+ key: 0,
4557
+ class: "text-sm text-red-600 bg-red-50 rounded-lg px-12 py-8"
4558
+ }, Ds = { class: "flex items-center justify-between" }, Ms = { class: "fm-typo-en-title-sm-600" }, Ns = {
4559
+ key: 1,
4560
+ class: "flex items-start gap-8"
4561
+ }, Is = { class: "flex-1 text-sm font-semibold break-all" }, Us = {
4562
+ key: 2,
4563
+ class: "flex gap-8"
4564
+ }, Ls = { class: "text-xs space-y-8 border-t pt-8" }, js = {
4565
+ key: 0,
4566
+ class: "flex justify-between"
4567
+ }, Fs = { class: "text-gray-500" }, zs = { class: "font-semibold" }, Vs = {
4568
+ key: 1,
4569
+ class: "flex justify-between"
4570
+ }, qs = { class: "text-gray-500" }, Ws = { class: "font-semibold" }, Gs = { class: "flex justify-between" }, $s = { class: "text-gray-500" }, Js = { class: "flex justify-between" }, Hs = { class: "text-gray-500" }, Ks = { class: "flex justify-between" }, Xs = { class: "text-gray-500" }, Qs = {
4571
+ key: 3,
4572
+ class: "flex flex-wrap gap-4"
4573
+ }, Ys = { class: "flex gap-8 border-t pt-12" }, il = /* @__PURE__ */ be({
4574
+ __name: "AssetDetailDialog",
4575
+ props: {
4576
+ asset: {},
4577
+ businessId: {},
4578
+ image: {}
4579
+ },
4580
+ emits: ["close", "renamed", "deleted", "changed"],
4581
+ setup(e, { emit: t }) {
4582
+ const a = Xa(), { t: n } = ye({ messages: ve }), o = e, r = t, i = G(!1), s = G("");
4583
+ xe(
4584
+ () => o.asset,
4585
+ (O) => {
4586
+ i.value = !1, s.value = (O == null ? void 0 : O.fileName) ?? "";
4587
+ }
4588
+ );
4589
+ function u() {
4590
+ var O;
4591
+ s.value = ((O = o.asset) == null ? void 0 : O.fileName) ?? "", i.value = !0;
4592
+ }
4593
+ async function c() {
4594
+ o.asset && (await pr(o.businessId, o.asset.id, s.value), i.value = !1, r("renamed"));
4595
+ }
4596
+ function d() {
4597
+ if (!o.asset)
4598
+ return;
4599
+ const O = o.asset;
4600
+ a.open({
4601
+ title: n("mediaPicker.assetDetailDialog.deleteDialogTitle"),
4602
+ message: n("mediaPicker.assetDetailDialog.deleteDialogMessage", {
4603
+ fileName: O.fileName,
4604
+ disclaimer: n("mediaPicker.assetDetailDialog.deleteDisclaimer")
4605
+ }),
4606
+ primaryActions: { text: n("mediaPicker.assetDetailDialog.deleteConfirmButton"), close: !1, variant: "destructive" },
4607
+ secondaryActions: { text: n("mediaPicker.assetDetailDialog.cancelButton"), close: !0 }
4608
+ }).onPrimary(async () => {
4609
+ await Pr(o.businessId, O), r("deleted", O.id), a.close();
4610
+ });
4611
+ }
4612
+ const f = G(0), w = z(() => {
4613
+ var O, N, J, le, H, Y;
4614
+ return {
4615
+ url: ((O = o.image) == null ? void 0 : O.original.url) ?? ((N = o.asset) == null ? void 0 : N.url) ?? "",
4616
+ width: ((J = o.image) == null ? void 0 : J.original.width) ?? ((le = o.asset) == null ? void 0 : le.width),
4617
+ height: ((H = o.image) == null ? void 0 : H.original.height) ?? ((Y = o.asset) == null ? void 0 : Y.height)
4618
+ };
4619
+ }), _ = z(
4620
+ () => {
4621
+ var O;
4622
+ return o.asset ? Ma(w.value, ((O = o.image) == null ? void 0 : O.variants) ?? []) : [];
4623
+ }
4624
+ );
4625
+ xe(() => {
4626
+ var O;
4627
+ return (O = o.asset) == null ? void 0 : O.id;
4628
+ }, () => f.value = 0);
4629
+ const P = z(() => {
4630
+ var O;
4631
+ const N = _.value[f.value];
4632
+ return !N || !o.asset ? null : sr(N, o.asset, ((O = o.image) == null ? void 0 : O.variants) ?? []);
4633
+ }), E = z(
4634
+ () => {
4635
+ var O;
4636
+ return (O = P.value) != null && O.ratio ? Be(P.value.ratio) : n("mediaPicker.variants.original");
4637
+ }
4638
+ ), R = z(() => o.asset ? Re(o.asset) : !1), p = z(() => o.asset ? Ia(o.asset) ?? void 0 : void 0), y = z(
4639
+ () => {
4640
+ var O;
4641
+ return (O = o.asset) != null && O.durationMs ? It(o.asset.durationMs) : null;
4642
+ }
4643
+ ), C = G(!1), A = G(null);
4644
+ async function V(O) {
4645
+ var N;
4646
+ if (!(!((N = o.asset) != null && N.refType) || !o.asset.refId || C.value)) {
4647
+ C.value = !0, A.value = null;
4648
+ try {
4649
+ await gr(o.businessId, {
4650
+ refType: o.asset.refType,
4651
+ refId: o.asset.refId,
4652
+ imageId: o.asset.imageId ?? "main",
4653
+ aspectRatios: [O],
4654
+ mode: "append"
4655
+ }), r("changed");
4656
+ } catch (J) {
4657
+ A.value = Fa(J);
4658
+ } finally {
4659
+ C.value = !1;
4660
+ }
4661
+ }
4662
+ }
4663
+ function Q() {
4664
+ var O;
4665
+ P.value && ((O = navigator.clipboard) == null || O.writeText(P.value.url));
4666
+ }
4667
+ function S(O) {
4668
+ var N;
4669
+ return ((N = O.split("/")[1]) == null ? void 0 : N.toUpperCase()) ?? O;
4670
+ }
4671
+ function re(O) {
4672
+ return O >= 1024 * 1024 ? `${(O / 1024 / 1024).toFixed(1)} MB` : `${Math.round(O / 1024)} KB`;
4673
+ }
4674
+ return (O, N) => {
4675
+ const J = K("FmIcon"), le = K("FmTextField"), H = K("FmButton"), Y = K("FmDialog");
4676
+ return b(), oe(Y, {
4677
+ "model-value": !!e.asset,
4678
+ "max-width": 920,
4679
+ "max-height": "620px",
4680
+ "content-class": "!p-0 asset-preview-dialog-content",
4681
+ "close-button": !1,
4682
+ "onUpdate:modelValue": N[3] || (N[3] = (m) => !m && r("close"))
4683
+ }, {
4684
+ default: Se(() => {
4685
+ var m, g, L, U, B;
4686
+ return [
4687
+ e.asset ? (b(), k("div", Os, [
4688
+ R.value ? (b(), k("div", Cs, [
4689
+ (b(), k("video", {
4690
+ key: e.asset.id,
4691
+ src: e.asset.url,
4692
+ poster: p.value,
4693
+ controls: "",
4694
+ preload: "metadata",
4695
+ class: "max-w-full max-h-full"
4696
+ }, null, 8, As))
4697
+ ])) : (b(), oe(Ts, {
4698
+ key: 1,
4699
+ index: f.value,
4700
+ "onUpdate:index": N[0] || (N[0] = (M) => f.value = M),
4701
+ original: w.value,
4702
+ variants: ((m = e.image) == null ? void 0 : m.variants) ?? [],
4703
+ alt: e.asset.fileName,
4704
+ onRegenerate: V
4705
+ }, null, 8, ["index", "original", "variants", "alt"])),
4706
+ v("div", Bs, [
4707
+ A.value ? (b(), k("p", _s, x(A.value), 1)) : F("", !0),
4708
+ v("div", Ds, [
4709
+ v("span", Ms, x(h(n)("mediaPicker.assetDetailDialog.previewTitle")), 1),
4710
+ v("button", {
4711
+ class: "rounded-lg bg-fm-color-neutral-gray-100 flex items-center justify-center flex-shrink-0",
4712
+ style: { width: "32px", height: "32px" },
4713
+ onClick: N[1] || (N[1] = (M) => r("close"))
4714
+ }, [
4715
+ W(J, {
4716
+ name: "close",
4717
+ size: "sm"
4718
+ })
4719
+ ])
4720
+ ]),
4721
+ i.value ? (b(), k("div", Us, [
4722
+ W(le, {
4723
+ modelValue: s.value,
4724
+ "onUpdate:modelValue": N[2] || (N[2] = (M) => s.value = M),
4725
+ class: "flex-1 min-w-0"
4726
+ }, null, 8, ["modelValue"]),
4727
+ W(H, {
4728
+ label: h(n)("mediaPicker.assetDetailDialog.saveButton"),
4729
+ variant: "primary",
4730
+ size: "md",
4731
+ class: "flex-shrink-0",
4732
+ onClick: c
4733
+ }, null, 8, ["label"])
4734
+ ])) : (b(), k("div", Ns, [
4735
+ v("span", Is, x(e.asset.fileName), 1),
4736
+ v("button", { onClick: u }, [
4737
+ W(J, {
4738
+ name: "edit",
4739
+ size: "sm"
4740
+ })
4741
+ ])
4742
+ ])),
4743
+ v("div", Ls, [
4744
+ R.value ? (b(), k("div", js, [
4745
+ v("span", Fs, x(h(n)("mediaPicker.assetDetailDialog.durationLabel")), 1),
4746
+ v("span", zs, x(y.value ?? "—"), 1)
4747
+ ])) : (b(), k("div", Vs, [
4748
+ v("span", qs, x(h(n)("mediaPicker.ratios.title")), 1),
4749
+ v("span", Ws, x(E.value), 1)
4750
+ ])),
4751
+ v("div", Gs, [
4752
+ v("span", $s, x(h(n)("mediaPicker.assetDetailDialog.dimensionsLabel")), 1),
4753
+ v("span", null, x(((g = P.value) == null ? void 0 : g.dimensions) ?? "—"), 1)
4754
+ ]),
4755
+ v("div", Js, [
4756
+ v("span", Hs, x(h(n)("mediaPicker.assetDetailDialog.sizeLabel")), 1),
4757
+ v("span", null, x((L = P.value) != null && L.sizeBytes ? re(P.value.sizeBytes) : "—"), 1)
4758
+ ]),
4759
+ v("div", Ks, [
4760
+ v("span", Xs, x(h(n)("mediaPicker.assetDetailDialog.formatLabel")), 1),
4761
+ v("span", null, x((U = P.value) != null && U.contentType ? S(P.value.contentType) : "—"), 1)
4762
+ ])
4763
+ ]),
4764
+ (B = e.asset.tags) != null && B.length ? (b(), k("div", Qs, [
4765
+ (b(!0), k(Z, null, he(e.asset.tags, (M) => (b(), k("span", {
4766
+ key: M,
4767
+ class: "bg-gray-100 rounded-full px-8",
4768
+ style: j([h($), "padding-top:2px;padding-bottom:2px"])
4769
+ }, " # " + x(M), 5))), 128))
4770
+ ])) : F("", !0),
4771
+ N[4] || (N[4] = v("div", { class: "flex-1" }, null, -1)),
4772
+ v("div", Ys, [
4773
+ W(H, {
4774
+ label: h(n)("mediaPicker.assetDetailDialog.copyLinkButton"),
4775
+ variant: "tertiary",
4776
+ size: "md",
4777
+ "prepend-icon": "link",
4778
+ class: "flex-1",
4779
+ onClick: Q
4780
+ }, null, 8, ["label"]),
4781
+ W(H, {
4782
+ label: h(n)("mediaPicker.assetDetailDialog.deleteButton"),
4783
+ variant: "destructive",
4784
+ size: "md",
4785
+ "prepend-icon": "delete",
4786
+ onClick: d
4787
+ }, null, 8, ["label"])
4788
+ ])
4789
+ ])
4790
+ ])) : F("", !0)
4791
+ ];
4792
+ }),
4793
+ _: 1
4794
+ }, 8, ["model-value"]);
4795
+ };
4796
+ }
4797
+ });
4798
+ export {
4799
+ Re as E,
4800
+ Di as I,
4801
+ Pr as T,
4802
+ Ua as U,
4803
+ cr as a,
4804
+ ol as b,
4805
+ nl as c,
4806
+ dr as d,
4807
+ Zi as e,
4808
+ rl as f,
4809
+ gi as g,
4810
+ ms as h,
4811
+ ur as i,
4812
+ hr as j,
4813
+ il as m,
4814
+ as as o,
4815
+ fr as p,
4816
+ al as u
4817
+ };