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