@feedmepos/mf-settings 0.0.74-dev.1 → 0.0.75-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/App-35971c1b.js +4378 -0
  2. package/dist/Business-f606024e.js +11276 -0
  3. package/dist/{CreateBusiness-55e7de74.js → CreateBusiness-8709fcdc.js} +117 -149
  4. package/dist/FoodCourt-b54debb1.js +47800 -0
  5. package/dist/{FormSection.vue_vue_type_script_setup_true_lang-6aab82f2.js → FormSection.vue_vue_type_script_setup_true_lang-f34c8596.js} +17 -16
  6. package/dist/{Tagging-3d10ba6e.js → Tagging-a5f9efca.js} +8 -9
  7. package/dist/app-3b03b910.js +4270 -0
  8. package/dist/app.js +3 -4
  9. package/dist/apps/mf-settings/src/app.d.ts +1 -1
  10. package/dist/apps/mf-settings/src/components/tagging/TaggingForm.vue.d.ts +6 -3
  11. package/dist/apps/mf-settings/src/extensions/business.d.ts +7 -2
  12. package/dist/apps/mf-settings/src/router/shared.d.ts +1 -1
  13. package/dist/apps/mf-settings/src/store/attributeSettings.d.ts +30 -15
  14. package/dist/apps/mf-settings/tsconfig.app.tsbuildinfo +1 -1
  15. package/dist/{business-1b85fe7e.js → business-1f49af71.js} +1 -1
  16. package/dist/dayjs.min-a3e17295.js +345 -0
  17. package/dist/index-406cc08d.js +19758 -0
  18. package/dist/{index-b9ef9a01.js → index-4d304b46.js} +5520 -5366
  19. package/dist/index-fdc00332.js +8047 -0
  20. package/dist/object-8ac0c0d8.js +63 -0
  21. package/dist/packages/shared/src/helpers/actionButton.d.ts +2 -2
  22. package/dist/rules-c9fa22f8.js +13 -0
  23. package/package.json +5 -4
  24. package/dist/App-44a7faee.js +0 -23266
  25. package/dist/Business-80eeb674.js +0 -11950
  26. package/dist/FoodCourt-c38eaa03.js +0 -72969
  27. package/dist/ReasonTemplate-b56a5a9d.js +0 -2235
  28. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-8f929a2d.js +0 -38
  29. package/dist/_commonjs-dynamic-modules-bed80856.js +0 -6
  30. package/dist/_plugin-vue_export-helper-dad06003.js +0 -9
  31. package/dist/app-a734e3bb.js +0 -1853
  32. package/dist/apps/mf-settings/src/View/ReasonTemplate.vue.d.ts +0 -2
  33. package/dist/apps/mf-settings/src/components/reason/ReasonTemplateForm.vue.d.ts +0 -28
  34. package/dist/apps/mf-settings/src/types/reasonTemplate.d.ts +0 -9
  35. package/dist/createForm-d3b97d2e.js +0 -50
  36. package/dist/dayjs.min-6eec923a.js +0 -310
  37. package/dist/index-b1e448c9.js +0 -2395
  38. package/dist/object-27ce045b.js +0 -16
  39. package/dist/rules-2bee6632.js +0 -6
@@ -1,2395 +0,0 @@
1
- import { computed as Et, isRef as St, watch as Rt } from "vue";
2
- import { SnackbarPosition as ue } from "@feedmepos/ui-library";
3
- import { defineStore as Tt } from "pinia";
4
- import { e as he } from "./index-b9ef9a01.js";
5
- import { useCoreStore as j } from "@feedmepos/mf-common";
6
- var T = [];
7
- for (var ce = 0; ce < 256; ++ce)
8
- T.push((ce + 256).toString(16).slice(1));
9
- function Ot(t, e = 0) {
10
- return (T[t[e + 0]] + T[t[e + 1]] + T[t[e + 2]] + T[t[e + 3]] + "-" + T[t[e + 4]] + T[t[e + 5]] + "-" + T[t[e + 6]] + T[t[e + 7]] + "-" + T[t[e + 8]] + T[t[e + 9]] + "-" + T[t[e + 10]] + T[t[e + 11]] + T[t[e + 12]] + T[t[e + 13]] + T[t[e + 14]] + T[t[e + 15]]).toLowerCase();
11
- }
12
- var H, At = new Uint8Array(16);
13
- function Ct() {
14
- if (!H && (H = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !H))
15
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
16
- return H(At);
17
- }
18
- var kt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
19
- const Ue = {
20
- randomUUID: kt
21
- };
22
- function We(t, e, n) {
23
- if (Ue.randomUUID && !e && !t)
24
- return Ue.randomUUID();
25
- t = t || {};
26
- var r = t.random || (t.rng || Ct)();
27
- if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, e) {
28
- n = n || 0;
29
- for (var s = 0; s < 16; ++s)
30
- e[n + s] = r[s];
31
- return e;
32
- }
33
- return Ot(r);
34
- }
35
- function Ve(t, e) {
36
- return function() {
37
- return t.apply(e, arguments);
38
- };
39
- }
40
- const { toString: Ut } = Object.prototype, { getPrototypeOf: Se } = Object, { iterator: Y, toStringTag: Ge } = Symbol, ee = ((t) => (e) => {
41
- const n = Ut.call(e);
42
- return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
43
- })(/* @__PURE__ */ Object.create(null)), U = (t) => (t = t.toLowerCase(), (e) => ee(e) === t), te = (t) => (e) => typeof e === t, { isArray: F } = Array, $ = te("undefined");
44
- function xt(t) {
45
- return t !== null && !$(t) && t.constructor !== null && !$(t.constructor) && C(t.constructor.isBuffer) && t.constructor.isBuffer(t);
46
- }
47
- const Qe = U("ArrayBuffer");
48
- function It(t) {
49
- let e;
50
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Qe(t.buffer), e;
51
- }
52
- const Pt = te("string"), C = te("function"), Ke = te("number"), ne = (t) => t !== null && typeof t == "object", Lt = (t) => t === !0 || t === !1, W = (t) => {
53
- if (ee(t) !== "object")
54
- return !1;
55
- const e = Se(t);
56
- return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Ge in t) && !(Y in t);
57
- }, _t = U("Date"), vt = U("File"), Bt = U("Blob"), Nt = U("FileList"), Ft = (t) => ne(t) && C(t.pipe), Mt = (t) => {
58
- let e;
59
- return t && (typeof FormData == "function" && t instanceof FormData || C(t.append) && ((e = ee(t)) === "formdata" || // detect form-data instance
60
- e === "object" && C(t.toString) && t.toString() === "[object FormData]"));
61
- }, Dt = U("URLSearchParams"), [$t, jt, qt, zt] = ["ReadableStream", "Request", "Response", "Headers"].map(U), Ht = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
62
- function q(t, e, { allOwnKeys: n = !1 } = {}) {
63
- if (t === null || typeof t > "u")
64
- return;
65
- let r, s;
66
- if (typeof t != "object" && (t = [t]), F(t))
67
- for (r = 0, s = t.length; r < s; r++)
68
- e.call(null, t[r], r, t);
69
- else {
70
- const o = n ? Object.getOwnPropertyNames(t) : Object.keys(t), i = o.length;
71
- let a;
72
- for (r = 0; r < i; r++)
73
- a = o[r], e.call(null, t[a], a, t);
74
- }
75
- }
76
- function Xe(t, e) {
77
- e = e.toLowerCase();
78
- const n = Object.keys(t);
79
- let r = n.length, s;
80
- for (; r-- > 0; )
81
- if (s = n[r], e === s.toLowerCase())
82
- return s;
83
- return null;
84
- }
85
- const B = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Ze = (t) => !$(t) && t !== B;
86
- function me() {
87
- const { caseless: t } = Ze(this) && this || {}, e = {}, n = (r, s) => {
88
- const o = t && Xe(e, s) || s;
89
- W(e[o]) && W(r) ? e[o] = me(e[o], r) : W(r) ? e[o] = me({}, r) : F(r) ? e[o] = r.slice() : e[o] = r;
90
- };
91
- for (let r = 0, s = arguments.length; r < s; r++)
92
- arguments[r] && q(arguments[r], n);
93
- return e;
94
- }
95
- const Jt = (t, e, n, { allOwnKeys: r } = {}) => (q(e, (s, o) => {
96
- n && C(s) ? t[o] = Ve(s, n) : t[o] = s;
97
- }, { allOwnKeys: r }), t), Wt = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Vt = (t, e, n, r) => {
98
- t.prototype = Object.create(e.prototype, r), t.prototype.constructor = t, Object.defineProperty(t, "super", {
99
- value: e.prototype
100
- }), n && Object.assign(t.prototype, n);
101
- }, Gt = (t, e, n, r) => {
102
- let s, o, i;
103
- const a = {};
104
- if (e = e || {}, t == null)
105
- return e;
106
- do {
107
- for (s = Object.getOwnPropertyNames(t), o = s.length; o-- > 0; )
108
- i = s[o], (!r || r(i, t, e)) && !a[i] && (e[i] = t[i], a[i] = !0);
109
- t = n !== !1 && Se(t);
110
- } while (t && (!n || n(t, e)) && t !== Object.prototype);
111
- return e;
112
- }, Qt = (t, e, n) => {
113
- t = String(t), (n === void 0 || n > t.length) && (n = t.length), n -= e.length;
114
- const r = t.indexOf(e, n);
115
- return r !== -1 && r === n;
116
- }, Kt = (t) => {
117
- if (!t)
118
- return null;
119
- if (F(t))
120
- return t;
121
- let e = t.length;
122
- if (!Ke(e))
123
- return null;
124
- const n = new Array(e);
125
- for (; e-- > 0; )
126
- n[e] = t[e];
127
- return n;
128
- }, Xt = ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && Se(Uint8Array)), Zt = (t, e) => {
129
- const r = (t && t[Y]).call(t);
130
- let s;
131
- for (; (s = r.next()) && !s.done; ) {
132
- const o = s.value;
133
- e.call(t, o[0], o[1]);
134
- }
135
- }, Yt = (t, e) => {
136
- let n;
137
- const r = [];
138
- for (; (n = t.exec(e)) !== null; )
139
- r.push(n);
140
- return r;
141
- }, en = U("HTMLFormElement"), tn = (t) => t.toLowerCase().replace(
142
- /[-_\s]([a-z\d])(\w*)/g,
143
- function(n, r, s) {
144
- return r.toUpperCase() + s;
145
- }
146
- ), xe = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), nn = U("RegExp"), Ye = (t, e) => {
147
- const n = Object.getOwnPropertyDescriptors(t), r = {};
148
- q(n, (s, o) => {
149
- let i;
150
- (i = e(s, o, t)) !== !1 && (r[o] = i || s);
151
- }), Object.defineProperties(t, r);
152
- }, rn = (t) => {
153
- Ye(t, (e, n) => {
154
- if (C(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
155
- return !1;
156
- const r = t[n];
157
- if (C(r)) {
158
- if (e.enumerable = !1, "writable" in e) {
159
- e.writable = !1;
160
- return;
161
- }
162
- e.set || (e.set = () => {
163
- throw Error("Can not rewrite read-only method '" + n + "'");
164
- });
165
- }
166
- });
167
- }, sn = (t, e) => {
168
- const n = {}, r = (s) => {
169
- s.forEach((o) => {
170
- n[o] = !0;
171
- });
172
- };
173
- return F(t) ? r(t) : r(String(t).split(e)), n;
174
- }, on = () => {
175
- }, an = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
176
- function un(t) {
177
- return !!(t && C(t.append) && t[Ge] === "FormData" && t[Y]);
178
- }
179
- const cn = (t) => {
180
- const e = new Array(10), n = (r, s) => {
181
- if (ne(r)) {
182
- if (e.indexOf(r) >= 0)
183
- return;
184
- if (!("toJSON" in r)) {
185
- e[s] = r;
186
- const o = F(r) ? [] : {};
187
- return q(r, (i, a) => {
188
- const d = n(i, s + 1);
189
- !$(d) && (o[a] = d);
190
- }), e[s] = void 0, o;
191
- }
192
- }
193
- return r;
194
- };
195
- return n(t, 0);
196
- }, ln = U("AsyncFunction"), dn = (t) => t && (ne(t) || C(t)) && C(t.then) && C(t.catch), et = ((t, e) => t ? setImmediate : e ? ((n, r) => (B.addEventListener("message", ({ source: s, data: o }) => {
197
- s === B && o === n && r.length && r.shift()();
198
- }, !1), (s) => {
199
- r.push(s), B.postMessage(n, "*");
200
- }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
201
- typeof setImmediate == "function",
202
- C(B.postMessage)
203
- ), fn = typeof queueMicrotask < "u" ? queueMicrotask.bind(B) : typeof process < "u" && process.nextTick || et, pn = (t) => t != null && C(t[Y]), u = {
204
- isArray: F,
205
- isArrayBuffer: Qe,
206
- isBuffer: xt,
207
- isFormData: Mt,
208
- isArrayBufferView: It,
209
- isString: Pt,
210
- isNumber: Ke,
211
- isBoolean: Lt,
212
- isObject: ne,
213
- isPlainObject: W,
214
- isReadableStream: $t,
215
- isRequest: jt,
216
- isResponse: qt,
217
- isHeaders: zt,
218
- isUndefined: $,
219
- isDate: _t,
220
- isFile: vt,
221
- isBlob: Bt,
222
- isRegExp: nn,
223
- isFunction: C,
224
- isStream: Ft,
225
- isURLSearchParams: Dt,
226
- isTypedArray: Xt,
227
- isFileList: Nt,
228
- forEach: q,
229
- merge: me,
230
- extend: Jt,
231
- trim: Ht,
232
- stripBOM: Wt,
233
- inherits: Vt,
234
- toFlatObject: Gt,
235
- kindOf: ee,
236
- kindOfTest: U,
237
- endsWith: Qt,
238
- toArray: Kt,
239
- forEachEntry: Zt,
240
- matchAll: Yt,
241
- isHTMLForm: en,
242
- hasOwnProperty: xe,
243
- hasOwnProp: xe,
244
- // an alias to avoid ESLint no-prototype-builtins detection
245
- reduceDescriptors: Ye,
246
- freezeMethods: rn,
247
- toObjectSet: sn,
248
- toCamelCase: tn,
249
- noop: on,
250
- toFiniteNumber: an,
251
- findKey: Xe,
252
- global: B,
253
- isContextDefined: Ze,
254
- isSpecCompliantForm: un,
255
- toJSONObject: cn,
256
- isAsyncFn: ln,
257
- isThenable: dn,
258
- setImmediate: et,
259
- asap: fn,
260
- isIterable: pn
261
- };
262
- function m(t, e, n, r, s) {
263
- Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
264
- }
265
- u.inherits(m, Error, {
266
- toJSON: function() {
267
- return {
268
- // Standard
269
- message: this.message,
270
- name: this.name,
271
- // Microsoft
272
- description: this.description,
273
- number: this.number,
274
- // Mozilla
275
- fileName: this.fileName,
276
- lineNumber: this.lineNumber,
277
- columnNumber: this.columnNumber,
278
- stack: this.stack,
279
- // Axios
280
- config: u.toJSONObject(this.config),
281
- code: this.code,
282
- status: this.status
283
- };
284
- }
285
- });
286
- const tt = m.prototype, nt = {};
287
- [
288
- "ERR_BAD_OPTION_VALUE",
289
- "ERR_BAD_OPTION",
290
- "ECONNABORTED",
291
- "ETIMEDOUT",
292
- "ERR_NETWORK",
293
- "ERR_FR_TOO_MANY_REDIRECTS",
294
- "ERR_DEPRECATED",
295
- "ERR_BAD_RESPONSE",
296
- "ERR_BAD_REQUEST",
297
- "ERR_CANCELED",
298
- "ERR_NOT_SUPPORT",
299
- "ERR_INVALID_URL"
300
- // eslint-disable-next-line func-names
301
- ].forEach((t) => {
302
- nt[t] = { value: t };
303
- });
304
- Object.defineProperties(m, nt);
305
- Object.defineProperty(tt, "isAxiosError", { value: !0 });
306
- m.from = (t, e, n, r, s, o) => {
307
- const i = Object.create(tt);
308
- return u.toFlatObject(t, i, function(d) {
309
- return d !== Error.prototype;
310
- }, (a) => a !== "isAxiosError"), m.call(i, t.message, e, n, r, s), i.cause = t, i.name = t.name, o && Object.assign(i, o), i;
311
- };
312
- const hn = null;
313
- function ye(t) {
314
- return u.isPlainObject(t) || u.isArray(t);
315
- }
316
- function rt(t) {
317
- return u.endsWith(t, "[]") ? t.slice(0, -2) : t;
318
- }
319
- function Ie(t, e, n) {
320
- return t ? t.concat(e).map(function(s, o) {
321
- return s = rt(s), !n && o ? "[" + s + "]" : s;
322
- }).join(n ? "." : "") : e;
323
- }
324
- function mn(t) {
325
- return u.isArray(t) && !t.some(ye);
326
- }
327
- const yn = u.toFlatObject(u, {}, null, function(e) {
328
- return /^is[A-Z]/.test(e);
329
- });
330
- function re(t, e, n) {
331
- if (!u.isObject(t))
332
- throw new TypeError("target must be an object");
333
- e = e || new FormData(), n = u.toFlatObject(n, {
334
- metaTokens: !0,
335
- dots: !1,
336
- indexes: !1
337
- }, !1, function(y, h) {
338
- return !u.isUndefined(h[y]);
339
- });
340
- const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && u.isSpecCompliantForm(e);
341
- if (!u.isFunction(s))
342
- throw new TypeError("visitor must be a function");
343
- function c(p) {
344
- if (p === null)
345
- return "";
346
- if (u.isDate(p))
347
- return p.toISOString();
348
- if (!d && u.isBlob(p))
349
- throw new m("Blob is not supported. Use a Buffer instead.");
350
- return u.isArrayBuffer(p) || u.isTypedArray(p) ? d && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
351
- }
352
- function l(p, y, h) {
353
- let b = p;
354
- if (p && !h && typeof p == "object") {
355
- if (u.endsWith(y, "{}"))
356
- y = r ? y : y.slice(0, -2), p = JSON.stringify(p);
357
- else if (u.isArray(p) && mn(p) || (u.isFileList(p) || u.endsWith(y, "[]")) && (b = u.toArray(p)))
358
- return y = rt(y), b.forEach(function(R, I) {
359
- !(u.isUndefined(R) || R === null) && e.append(
360
- // eslint-disable-next-line no-nested-ternary
361
- i === !0 ? Ie([y], I, o) : i === null ? y : y + "[]",
362
- c(R)
363
- );
364
- }), !1;
365
- }
366
- return ye(p) ? !0 : (e.append(Ie(h, y, o), c(p)), !1);
367
- }
368
- const f = [], w = Object.assign(yn, {
369
- defaultVisitor: l,
370
- convertValue: c,
371
- isVisitable: ye
372
- });
373
- function E(p, y) {
374
- if (!u.isUndefined(p)) {
375
- if (f.indexOf(p) !== -1)
376
- throw Error("Circular reference detected in " + y.join("."));
377
- f.push(p), u.forEach(p, function(b, S) {
378
- (!(u.isUndefined(b) || b === null) && s.call(
379
- e,
380
- b,
381
- u.isString(S) ? S.trim() : S,
382
- y,
383
- w
384
- )) === !0 && E(b, y ? y.concat(S) : [S]);
385
- }), f.pop();
386
- }
387
- }
388
- if (!u.isObject(t))
389
- throw new TypeError("data must be an object");
390
- return E(t), e;
391
- }
392
- function Pe(t) {
393
- const e = {
394
- "!": "%21",
395
- "'": "%27",
396
- "(": "%28",
397
- ")": "%29",
398
- "~": "%7E",
399
- "%20": "+",
400
- "%00": "\0"
401
- };
402
- return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(r) {
403
- return e[r];
404
- });
405
- }
406
- function Re(t, e) {
407
- this._pairs = [], t && re(t, this, e);
408
- }
409
- const st = Re.prototype;
410
- st.append = function(e, n) {
411
- this._pairs.push([e, n]);
412
- };
413
- st.toString = function(e) {
414
- const n = e ? function(r) {
415
- return e.call(this, r, Pe);
416
- } : Pe;
417
- return this._pairs.map(function(s) {
418
- return n(s[0]) + "=" + n(s[1]);
419
- }, "").join("&");
420
- };
421
- function wn(t) {
422
- return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
423
- }
424
- function ot(t, e, n) {
425
- if (!e)
426
- return t;
427
- const r = n && n.encode || wn;
428
- u.isFunction(n) && (n = {
429
- serialize: n
430
- });
431
- const s = n && n.serialize;
432
- let o;
433
- if (s ? o = s(e, n) : o = u.isURLSearchParams(e) ? e.toString() : new Re(e, n).toString(r), o) {
434
- const i = t.indexOf("#");
435
- i !== -1 && (t = t.slice(0, i)), t += (t.indexOf("?") === -1 ? "?" : "&") + o;
436
- }
437
- return t;
438
- }
439
- class bn {
440
- constructor() {
441
- this.handlers = [];
442
- }
443
- /**
444
- * Add a new interceptor to the stack
445
- *
446
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
447
- * @param {Function} rejected The function to handle `reject` for a `Promise`
448
- *
449
- * @return {Number} An ID used to remove interceptor later
450
- */
451
- use(e, n, r) {
452
- return this.handlers.push({
453
- fulfilled: e,
454
- rejected: n,
455
- synchronous: r ? r.synchronous : !1,
456
- runWhen: r ? r.runWhen : null
457
- }), this.handlers.length - 1;
458
- }
459
- /**
460
- * Remove an interceptor from the stack
461
- *
462
- * @param {Number} id The ID that was returned by `use`
463
- *
464
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
465
- */
466
- eject(e) {
467
- this.handlers[e] && (this.handlers[e] = null);
468
- }
469
- /**
470
- * Clear all interceptors from the stack
471
- *
472
- * @returns {void}
473
- */
474
- clear() {
475
- this.handlers && (this.handlers = []);
476
- }
477
- /**
478
- * Iterate over all the registered interceptors
479
- *
480
- * This method is particularly useful for skipping over any
481
- * interceptors that may have become `null` calling `eject`.
482
- *
483
- * @param {Function} fn The function to call for each interceptor
484
- *
485
- * @returns {void}
486
- */
487
- forEach(e) {
488
- u.forEach(this.handlers, function(r) {
489
- r !== null && e(r);
490
- });
491
- }
492
- }
493
- const Le = bn, it = {
494
- silentJSONParsing: !0,
495
- forcedJSONParsing: !0,
496
- clarifyTimeoutError: !1
497
- }, gn = typeof URLSearchParams < "u" ? URLSearchParams : Re, En = typeof FormData < "u" ? FormData : null, Sn = typeof Blob < "u" ? Blob : null, Rn = {
498
- isBrowser: !0,
499
- classes: {
500
- URLSearchParams: gn,
501
- FormData: En,
502
- Blob: Sn
503
- },
504
- protocols: ["http", "https", "file", "blob", "url", "data"]
505
- }, Te = typeof window < "u" && typeof document < "u", we = typeof navigator == "object" && navigator || void 0, Tn = Te && (!we || ["ReactNative", "NativeScript", "NS"].indexOf(we.product) < 0), On = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
506
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), An = Te && window.location.href || "http://localhost", Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
507
- __proto__: null,
508
- hasBrowserEnv: Te,
509
- hasStandardBrowserEnv: Tn,
510
- hasStandardBrowserWebWorkerEnv: On,
511
- navigator: we,
512
- origin: An
513
- }, Symbol.toStringTag, { value: "Module" })), O = {
514
- ...Cn,
515
- ...Rn
516
- };
517
- function kn(t, e) {
518
- return re(t, new O.classes.URLSearchParams(), Object.assign({
519
- visitor: function(n, r, s, o) {
520
- return O.isNode && u.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
521
- }
522
- }, e));
523
- }
524
- function Un(t) {
525
- return u.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
526
- }
527
- function xn(t) {
528
- const e = {}, n = Object.keys(t);
529
- let r;
530
- const s = n.length;
531
- let o;
532
- for (r = 0; r < s; r++)
533
- o = n[r], e[o] = t[o];
534
- return e;
535
- }
536
- function at(t) {
537
- function e(n, r, s, o) {
538
- let i = n[o++];
539
- if (i === "__proto__")
540
- return !0;
541
- const a = Number.isFinite(+i), d = o >= n.length;
542
- return i = !i && u.isArray(s) ? s.length : i, d ? (u.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !a) : ((!s[i] || !u.isObject(s[i])) && (s[i] = []), e(n, r, s[i], o) && u.isArray(s[i]) && (s[i] = xn(s[i])), !a);
543
- }
544
- if (u.isFormData(t) && u.isFunction(t.entries)) {
545
- const n = {};
546
- return u.forEachEntry(t, (r, s) => {
547
- e(Un(r), s, n, 0);
548
- }), n;
549
- }
550
- return null;
551
- }
552
- function In(t, e, n) {
553
- if (u.isString(t))
554
- try {
555
- return (e || JSON.parse)(t), u.trim(t);
556
- } catch (r) {
557
- if (r.name !== "SyntaxError")
558
- throw r;
559
- }
560
- return (n || JSON.stringify)(t);
561
- }
562
- const Oe = {
563
- transitional: it,
564
- adapter: ["xhr", "http", "fetch"],
565
- transformRequest: [function(e, n) {
566
- const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = u.isObject(e);
567
- if (o && u.isHTMLForm(e) && (e = new FormData(e)), u.isFormData(e))
568
- return s ? JSON.stringify(at(e)) : e;
569
- if (u.isArrayBuffer(e) || u.isBuffer(e) || u.isStream(e) || u.isFile(e) || u.isBlob(e) || u.isReadableStream(e))
570
- return e;
571
- if (u.isArrayBufferView(e))
572
- return e.buffer;
573
- if (u.isURLSearchParams(e))
574
- return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
575
- let a;
576
- if (o) {
577
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
578
- return kn(e, this.formSerializer).toString();
579
- if ((a = u.isFileList(e)) || r.indexOf("multipart/form-data") > -1) {
580
- const d = this.env && this.env.FormData;
581
- return re(
582
- a ? { "files[]": e } : e,
583
- d && new d(),
584
- this.formSerializer
585
- );
586
- }
587
- }
588
- return o || s ? (n.setContentType("application/json", !1), In(e)) : e;
589
- }],
590
- transformResponse: [function(e) {
591
- const n = this.transitional || Oe.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
592
- if (u.isResponse(e) || u.isReadableStream(e))
593
- return e;
594
- if (e && u.isString(e) && (r && !this.responseType || s)) {
595
- const i = !(n && n.silentJSONParsing) && s;
596
- try {
597
- return JSON.parse(e);
598
- } catch (a) {
599
- if (i)
600
- throw a.name === "SyntaxError" ? m.from(a, m.ERR_BAD_RESPONSE, this, null, this.response) : a;
601
- }
602
- }
603
- return e;
604
- }],
605
- /**
606
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
607
- * timeout is not created.
608
- */
609
- timeout: 0,
610
- xsrfCookieName: "XSRF-TOKEN",
611
- xsrfHeaderName: "X-XSRF-TOKEN",
612
- maxContentLength: -1,
613
- maxBodyLength: -1,
614
- env: {
615
- FormData: O.classes.FormData,
616
- Blob: O.classes.Blob
617
- },
618
- validateStatus: function(e) {
619
- return e >= 200 && e < 300;
620
- },
621
- headers: {
622
- common: {
623
- Accept: "application/json, text/plain, */*",
624
- "Content-Type": void 0
625
- }
626
- }
627
- };
628
- u.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
629
- Oe.headers[t] = {};
630
- });
631
- const Ae = Oe, Pn = u.toObjectSet([
632
- "age",
633
- "authorization",
634
- "content-length",
635
- "content-type",
636
- "etag",
637
- "expires",
638
- "from",
639
- "host",
640
- "if-modified-since",
641
- "if-unmodified-since",
642
- "last-modified",
643
- "location",
644
- "max-forwards",
645
- "proxy-authorization",
646
- "referer",
647
- "retry-after",
648
- "user-agent"
649
- ]), Ln = (t) => {
650
- const e = {};
651
- let n, r, s;
652
- return t && t.split(`
653
- `).forEach(function(i) {
654
- s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || e[n] && Pn[n]) && (n === "set-cookie" ? e[n] ? e[n].push(r) : e[n] = [r] : e[n] = e[n] ? e[n] + ", " + r : r);
655
- }), e;
656
- }, _e = Symbol("internals");
657
- function D(t) {
658
- return t && String(t).trim().toLowerCase();
659
- }
660
- function V(t) {
661
- return t === !1 || t == null ? t : u.isArray(t) ? t.map(V) : String(t);
662
- }
663
- function _n(t) {
664
- const e = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
665
- let r;
666
- for (; r = n.exec(t); )
667
- e[r[1]] = r[2];
668
- return e;
669
- }
670
- const vn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
671
- function le(t, e, n, r, s) {
672
- if (u.isFunction(r))
673
- return r.call(this, e, n);
674
- if (s && (e = n), !!u.isString(e)) {
675
- if (u.isString(r))
676
- return e.indexOf(r) !== -1;
677
- if (u.isRegExp(r))
678
- return r.test(e);
679
- }
680
- }
681
- function Bn(t) {
682
- return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, n, r) => n.toUpperCase() + r);
683
- }
684
- function Nn(t, e) {
685
- const n = u.toCamelCase(" " + e);
686
- ["get", "set", "has"].forEach((r) => {
687
- Object.defineProperty(t, r + n, {
688
- value: function(s, o, i) {
689
- return this[r].call(this, e, s, o, i);
690
- },
691
- configurable: !0
692
- });
693
- });
694
- }
695
- let se = class {
696
- constructor(e) {
697
- e && this.set(e);
698
- }
699
- set(e, n, r) {
700
- const s = this;
701
- function o(a, d, c) {
702
- const l = D(d);
703
- if (!l)
704
- throw new Error("header name must be a non-empty string");
705
- const f = u.findKey(s, l);
706
- (!f || s[f] === void 0 || c === !0 || c === void 0 && s[f] !== !1) && (s[f || d] = V(a));
707
- }
708
- const i = (a, d) => u.forEach(a, (c, l) => o(c, l, d));
709
- if (u.isPlainObject(e) || e instanceof this.constructor)
710
- i(e, n);
711
- else if (u.isString(e) && (e = e.trim()) && !vn(e))
712
- i(Ln(e), n);
713
- else if (u.isObject(e) && u.isIterable(e)) {
714
- let a = {}, d, c;
715
- for (const l of e) {
716
- if (!u.isArray(l))
717
- throw TypeError("Object iterator must return a key-value pair");
718
- a[c = l[0]] = (d = a[c]) ? u.isArray(d) ? [...d, l[1]] : [d, l[1]] : l[1];
719
- }
720
- i(a, n);
721
- } else
722
- e != null && o(n, e, r);
723
- return this;
724
- }
725
- get(e, n) {
726
- if (e = D(e), e) {
727
- const r = u.findKey(this, e);
728
- if (r) {
729
- const s = this[r];
730
- if (!n)
731
- return s;
732
- if (n === !0)
733
- return _n(s);
734
- if (u.isFunction(n))
735
- return n.call(this, s, r);
736
- if (u.isRegExp(n))
737
- return n.exec(s);
738
- throw new TypeError("parser must be boolean|regexp|function");
739
- }
740
- }
741
- }
742
- has(e, n) {
743
- if (e = D(e), e) {
744
- const r = u.findKey(this, e);
745
- return !!(r && this[r] !== void 0 && (!n || le(this, this[r], r, n)));
746
- }
747
- return !1;
748
- }
749
- delete(e, n) {
750
- const r = this;
751
- let s = !1;
752
- function o(i) {
753
- if (i = D(i), i) {
754
- const a = u.findKey(r, i);
755
- a && (!n || le(r, r[a], a, n)) && (delete r[a], s = !0);
756
- }
757
- }
758
- return u.isArray(e) ? e.forEach(o) : o(e), s;
759
- }
760
- clear(e) {
761
- const n = Object.keys(this);
762
- let r = n.length, s = !1;
763
- for (; r--; ) {
764
- const o = n[r];
765
- (!e || le(this, this[o], o, e, !0)) && (delete this[o], s = !0);
766
- }
767
- return s;
768
- }
769
- normalize(e) {
770
- const n = this, r = {};
771
- return u.forEach(this, (s, o) => {
772
- const i = u.findKey(r, o);
773
- if (i) {
774
- n[i] = V(s), delete n[o];
775
- return;
776
- }
777
- const a = e ? Bn(o) : String(o).trim();
778
- a !== o && delete n[o], n[a] = V(s), r[a] = !0;
779
- }), this;
780
- }
781
- concat(...e) {
782
- return this.constructor.concat(this, ...e);
783
- }
784
- toJSON(e) {
785
- const n = /* @__PURE__ */ Object.create(null);
786
- return u.forEach(this, (r, s) => {
787
- r != null && r !== !1 && (n[s] = e && u.isArray(r) ? r.join(", ") : r);
788
- }), n;
789
- }
790
- [Symbol.iterator]() {
791
- return Object.entries(this.toJSON())[Symbol.iterator]();
792
- }
793
- toString() {
794
- return Object.entries(this.toJSON()).map(([e, n]) => e + ": " + n).join(`
795
- `);
796
- }
797
- getSetCookie() {
798
- return this.get("set-cookie") || [];
799
- }
800
- get [Symbol.toStringTag]() {
801
- return "AxiosHeaders";
802
- }
803
- static from(e) {
804
- return e instanceof this ? e : new this(e);
805
- }
806
- static concat(e, ...n) {
807
- const r = new this(e);
808
- return n.forEach((s) => r.set(s)), r;
809
- }
810
- static accessor(e) {
811
- const r = (this[_e] = this[_e] = {
812
- accessors: {}
813
- }).accessors, s = this.prototype;
814
- function o(i) {
815
- const a = D(i);
816
- r[a] || (Nn(s, i), r[a] = !0);
817
- }
818
- return u.isArray(e) ? e.forEach(o) : o(e), this;
819
- }
820
- };
821
- se.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
822
- u.reduceDescriptors(se.prototype, ({ value: t }, e) => {
823
- let n = e[0].toUpperCase() + e.slice(1);
824
- return {
825
- get: () => t,
826
- set(r) {
827
- this[n] = r;
828
- }
829
- };
830
- });
831
- u.freezeMethods(se);
832
- const k = se;
833
- function de(t, e) {
834
- const n = this || Ae, r = e || n, s = k.from(r.headers);
835
- let o = r.data;
836
- return u.forEach(t, function(a) {
837
- o = a.call(n, o, s.normalize(), e ? e.status : void 0);
838
- }), s.normalize(), o;
839
- }
840
- function ut(t) {
841
- return !!(t && t.__CANCEL__);
842
- }
843
- function M(t, e, n) {
844
- m.call(this, t ?? "canceled", m.ERR_CANCELED, e, n), this.name = "CanceledError";
845
- }
846
- u.inherits(M, m, {
847
- __CANCEL__: !0
848
- });
849
- function ct(t, e, n) {
850
- const r = n.config.validateStatus;
851
- !n.status || !r || r(n.status) ? t(n) : e(new m(
852
- "Request failed with status code " + n.status,
853
- [m.ERR_BAD_REQUEST, m.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
854
- n.config,
855
- n.request,
856
- n
857
- ));
858
- }
859
- function Fn(t) {
860
- const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
861
- return e && e[1] || "";
862
- }
863
- function Mn(t, e) {
864
- t = t || 10;
865
- const n = new Array(t), r = new Array(t);
866
- let s = 0, o = 0, i;
867
- return e = e !== void 0 ? e : 1e3, function(d) {
868
- const c = Date.now(), l = r[o];
869
- i || (i = c), n[s] = d, r[s] = c;
870
- let f = o, w = 0;
871
- for (; f !== s; )
872
- w += n[f++], f = f % t;
873
- if (s = (s + 1) % t, s === o && (o = (o + 1) % t), c - i < e)
874
- return;
875
- const E = l && c - l;
876
- return E ? Math.round(w * 1e3 / E) : void 0;
877
- };
878
- }
879
- function Dn(t, e) {
880
- let n = 0, r = 1e3 / e, s, o;
881
- const i = (c, l = Date.now()) => {
882
- n = l, s = null, o && (clearTimeout(o), o = null), t.apply(null, c);
883
- };
884
- return [(...c) => {
885
- const l = Date.now(), f = l - n;
886
- f >= r ? i(c, l) : (s = c, o || (o = setTimeout(() => {
887
- o = null, i(s);
888
- }, r - f)));
889
- }, () => s && i(s)];
890
- }
891
- const K = (t, e, n = 3) => {
892
- let r = 0;
893
- const s = Mn(50, 250);
894
- return Dn((o) => {
895
- const i = o.loaded, a = o.lengthComputable ? o.total : void 0, d = i - r, c = s(d), l = i <= a;
896
- r = i;
897
- const f = {
898
- loaded: i,
899
- total: a,
900
- progress: a ? i / a : void 0,
901
- bytes: d,
902
- rate: c || void 0,
903
- estimated: c && a && l ? (a - i) / c : void 0,
904
- event: o,
905
- lengthComputable: a != null,
906
- [e ? "download" : "upload"]: !0
907
- };
908
- t(f);
909
- }, n);
910
- }, ve = (t, e) => {
911
- const n = t != null;
912
- return [(r) => e[0]({
913
- lengthComputable: n,
914
- total: t,
915
- loaded: r
916
- }), e[1]];
917
- }, Be = (t) => (...e) => u.asap(() => t(...e)), $n = O.hasStandardBrowserEnv ? ((t, e) => (n) => (n = new URL(n, O.origin), t.protocol === n.protocol && t.host === n.host && (e || t.port === n.port)))(
918
- new URL(O.origin),
919
- O.navigator && /(msie|trident)/i.test(O.navigator.userAgent)
920
- ) : () => !0, jn = O.hasStandardBrowserEnv ? (
921
- // Standard browser envs support document.cookie
922
- {
923
- write(t, e, n, r, s, o) {
924
- const i = [t + "=" + encodeURIComponent(e)];
925
- u.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), u.isString(r) && i.push("path=" + r), u.isString(s) && i.push("domain=" + s), o === !0 && i.push("secure"), document.cookie = i.join("; ");
926
- },
927
- read(t) {
928
- const e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)"));
929
- return e ? decodeURIComponent(e[3]) : null;
930
- },
931
- remove(t) {
932
- this.write(t, "", Date.now() - 864e5);
933
- }
934
- }
935
- ) : (
936
- // Non-standard browser env (web workers, react-native) lack needed support.
937
- {
938
- write() {
939
- },
940
- read() {
941
- return null;
942
- },
943
- remove() {
944
- }
945
- }
946
- );
947
- function qn(t) {
948
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
949
- }
950
- function zn(t, e) {
951
- return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
952
- }
953
- function lt(t, e, n) {
954
- let r = !qn(e);
955
- return t && (r || n == !1) ? zn(t, e) : e;
956
- }
957
- const Ne = (t) => t instanceof k ? { ...t } : t;
958
- function N(t, e) {
959
- e = e || {};
960
- const n = {};
961
- function r(c, l, f, w) {
962
- return u.isPlainObject(c) && u.isPlainObject(l) ? u.merge.call({ caseless: w }, c, l) : u.isPlainObject(l) ? u.merge({}, l) : u.isArray(l) ? l.slice() : l;
963
- }
964
- function s(c, l, f, w) {
965
- if (u.isUndefined(l)) {
966
- if (!u.isUndefined(c))
967
- return r(void 0, c, f, w);
968
- } else
969
- return r(c, l, f, w);
970
- }
971
- function o(c, l) {
972
- if (!u.isUndefined(l))
973
- return r(void 0, l);
974
- }
975
- function i(c, l) {
976
- if (u.isUndefined(l)) {
977
- if (!u.isUndefined(c))
978
- return r(void 0, c);
979
- } else
980
- return r(void 0, l);
981
- }
982
- function a(c, l, f) {
983
- if (f in e)
984
- return r(c, l);
985
- if (f in t)
986
- return r(void 0, c);
987
- }
988
- const d = {
989
- url: o,
990
- method: o,
991
- data: o,
992
- baseURL: i,
993
- transformRequest: i,
994
- transformResponse: i,
995
- paramsSerializer: i,
996
- timeout: i,
997
- timeoutMessage: i,
998
- withCredentials: i,
999
- withXSRFToken: i,
1000
- adapter: i,
1001
- responseType: i,
1002
- xsrfCookieName: i,
1003
- xsrfHeaderName: i,
1004
- onUploadProgress: i,
1005
- onDownloadProgress: i,
1006
- decompress: i,
1007
- maxContentLength: i,
1008
- maxBodyLength: i,
1009
- beforeRedirect: i,
1010
- transport: i,
1011
- httpAgent: i,
1012
- httpsAgent: i,
1013
- cancelToken: i,
1014
- socketPath: i,
1015
- responseEncoding: i,
1016
- validateStatus: a,
1017
- headers: (c, l, f) => s(Ne(c), Ne(l), f, !0)
1018
- };
1019
- return u.forEach(Object.keys(Object.assign({}, t, e)), function(l) {
1020
- const f = d[l] || s, w = f(t[l], e[l], l);
1021
- u.isUndefined(w) && f !== a || (n[l] = w);
1022
- }), n;
1023
- }
1024
- const dt = (t) => {
1025
- const e = N({}, t);
1026
- let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: a } = e;
1027
- e.headers = i = k.from(i), e.url = ot(lt(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), a && i.set(
1028
- "Authorization",
1029
- "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1030
- );
1031
- let d;
1032
- if (u.isFormData(n)) {
1033
- if (O.hasStandardBrowserEnv || O.hasStandardBrowserWebWorkerEnv)
1034
- i.setContentType(void 0);
1035
- else if ((d = i.getContentType()) !== !1) {
1036
- const [c, ...l] = d ? d.split(";").map((f) => f.trim()).filter(Boolean) : [];
1037
- i.setContentType([c || "multipart/form-data", ...l].join("; "));
1038
- }
1039
- }
1040
- if (O.hasStandardBrowserEnv && (r && u.isFunction(r) && (r = r(e)), r || r !== !1 && $n(e.url))) {
1041
- const c = s && o && jn.read(o);
1042
- c && i.set(s, c);
1043
- }
1044
- return e;
1045
- }, Hn = typeof XMLHttpRequest < "u", Jn = Hn && function(t) {
1046
- return new Promise(function(n, r) {
1047
- const s = dt(t);
1048
- let o = s.data;
1049
- const i = k.from(s.headers).normalize();
1050
- let { responseType: a, onUploadProgress: d, onDownloadProgress: c } = s, l, f, w, E, p;
1051
- function y() {
1052
- E && E(), p && p(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
1053
- }
1054
- let h = new XMLHttpRequest();
1055
- h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
1056
- function b() {
1057
- if (!h)
1058
- return;
1059
- const R = k.from(
1060
- "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1061
- ), A = {
1062
- data: !a || a === "text" || a === "json" ? h.responseText : h.response,
1063
- status: h.status,
1064
- statusText: h.statusText,
1065
- headers: R,
1066
- config: t,
1067
- request: h
1068
- };
1069
- ct(function(_) {
1070
- n(_), y();
1071
- }, function(_) {
1072
- r(_), y();
1073
- }, A), h = null;
1074
- }
1075
- "onloadend" in h ? h.onloadend = b : h.onreadystatechange = function() {
1076
- !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(b);
1077
- }, h.onabort = function() {
1078
- h && (r(new m("Request aborted", m.ECONNABORTED, t, h)), h = null);
1079
- }, h.onerror = function() {
1080
- r(new m("Network Error", m.ERR_NETWORK, t, h)), h = null;
1081
- }, h.ontimeout = function() {
1082
- let I = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1083
- const A = s.transitional || it;
1084
- s.timeoutErrorMessage && (I = s.timeoutErrorMessage), r(new m(
1085
- I,
1086
- A.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
1087
- t,
1088
- h
1089
- )), h = null;
1090
- }, o === void 0 && i.setContentType(null), "setRequestHeader" in h && u.forEach(i.toJSON(), function(I, A) {
1091
- h.setRequestHeader(A, I);
1092
- }), u.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), a && a !== "json" && (h.responseType = s.responseType), c && ([w, p] = K(c, !0), h.addEventListener("progress", w)), d && h.upload && ([f, E] = K(d), h.upload.addEventListener("progress", f), h.upload.addEventListener("loadend", E)), (s.cancelToken || s.signal) && (l = (R) => {
1093
- h && (r(!R || R.type ? new M(null, t, h) : R), h.abort(), h = null);
1094
- }, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
1095
- const S = Fn(s.url);
1096
- if (S && O.protocols.indexOf(S) === -1) {
1097
- r(new m("Unsupported protocol " + S + ":", m.ERR_BAD_REQUEST, t));
1098
- return;
1099
- }
1100
- h.send(o || null);
1101
- });
1102
- }, Wn = (t, e) => {
1103
- const { length: n } = t = t ? t.filter(Boolean) : [];
1104
- if (e || n) {
1105
- let r = new AbortController(), s;
1106
- const o = function(c) {
1107
- if (!s) {
1108
- s = !0, a();
1109
- const l = c instanceof Error ? c : this.reason;
1110
- r.abort(l instanceof m ? l : new M(l instanceof Error ? l.message : l));
1111
- }
1112
- };
1113
- let i = e && setTimeout(() => {
1114
- i = null, o(new m(`timeout ${e} of ms exceeded`, m.ETIMEDOUT));
1115
- }, e);
1116
- const a = () => {
1117
- t && (i && clearTimeout(i), i = null, t.forEach((c) => {
1118
- c.unsubscribe ? c.unsubscribe(o) : c.removeEventListener("abort", o);
1119
- }), t = null);
1120
- };
1121
- t.forEach((c) => c.addEventListener("abort", o));
1122
- const { signal: d } = r;
1123
- return d.unsubscribe = () => u.asap(a), d;
1124
- }
1125
- }, Vn = Wn, Gn = function* (t, e) {
1126
- let n = t.byteLength;
1127
- if (!e || n < e) {
1128
- yield t;
1129
- return;
1130
- }
1131
- let r = 0, s;
1132
- for (; r < n; )
1133
- s = r + e, yield t.slice(r, s), r = s;
1134
- }, Qn = async function* (t, e) {
1135
- for await (const n of Kn(t))
1136
- yield* Gn(n, e);
1137
- }, Kn = async function* (t) {
1138
- if (t[Symbol.asyncIterator]) {
1139
- yield* t;
1140
- return;
1141
- }
1142
- const e = t.getReader();
1143
- try {
1144
- for (; ; ) {
1145
- const { done: n, value: r } = await e.read();
1146
- if (n)
1147
- break;
1148
- yield r;
1149
- }
1150
- } finally {
1151
- await e.cancel();
1152
- }
1153
- }, Fe = (t, e, n, r) => {
1154
- const s = Qn(t, e);
1155
- let o = 0, i, a = (d) => {
1156
- i || (i = !0, r && r(d));
1157
- };
1158
- return new ReadableStream({
1159
- async pull(d) {
1160
- try {
1161
- const { done: c, value: l } = await s.next();
1162
- if (c) {
1163
- a(), d.close();
1164
- return;
1165
- }
1166
- let f = l.byteLength;
1167
- if (n) {
1168
- let w = o += f;
1169
- n(w);
1170
- }
1171
- d.enqueue(new Uint8Array(l));
1172
- } catch (c) {
1173
- throw a(c), c;
1174
- }
1175
- },
1176
- cancel(d) {
1177
- return a(d), s.return();
1178
- }
1179
- }, {
1180
- highWaterMark: 2
1181
- });
1182
- }, oe = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", ft = oe && typeof ReadableStream == "function", Xn = oe && (typeof TextEncoder == "function" ? ((t) => (e) => t.encode(e))(new TextEncoder()) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())), pt = (t, ...e) => {
1183
- try {
1184
- return !!t(...e);
1185
- } catch {
1186
- return !1;
1187
- }
1188
- }, Zn = ft && pt(() => {
1189
- let t = !1;
1190
- const e = new Request(O.origin, {
1191
- body: new ReadableStream(),
1192
- method: "POST",
1193
- get duplex() {
1194
- return t = !0, "half";
1195
- }
1196
- }).headers.has("Content-Type");
1197
- return t && !e;
1198
- }), Me = 64 * 1024, be = ft && pt(() => u.isReadableStream(new Response("").body)), X = {
1199
- stream: be && ((t) => t.body)
1200
- };
1201
- oe && ((t) => {
1202
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => {
1203
- !X[e] && (X[e] = u.isFunction(t[e]) ? (n) => n[e]() : (n, r) => {
1204
- throw new m(`Response type '${e}' is not supported`, m.ERR_NOT_SUPPORT, r);
1205
- });
1206
- });
1207
- })(new Response());
1208
- const Yn = async (t) => {
1209
- if (t == null)
1210
- return 0;
1211
- if (u.isBlob(t))
1212
- return t.size;
1213
- if (u.isSpecCompliantForm(t))
1214
- return (await new Request(O.origin, {
1215
- method: "POST",
1216
- body: t
1217
- }).arrayBuffer()).byteLength;
1218
- if (u.isArrayBufferView(t) || u.isArrayBuffer(t))
1219
- return t.byteLength;
1220
- if (u.isURLSearchParams(t) && (t = t + ""), u.isString(t))
1221
- return (await Xn(t)).byteLength;
1222
- }, er = async (t, e) => {
1223
- const n = u.toFiniteNumber(t.getContentLength());
1224
- return n ?? Yn(e);
1225
- }, tr = oe && (async (t) => {
1226
- let {
1227
- url: e,
1228
- method: n,
1229
- data: r,
1230
- signal: s,
1231
- cancelToken: o,
1232
- timeout: i,
1233
- onDownloadProgress: a,
1234
- onUploadProgress: d,
1235
- responseType: c,
1236
- headers: l,
1237
- withCredentials: f = "same-origin",
1238
- fetchOptions: w
1239
- } = dt(t);
1240
- c = c ? (c + "").toLowerCase() : "text";
1241
- let E = Vn([s, o && o.toAbortSignal()], i), p;
1242
- const y = E && E.unsubscribe && (() => {
1243
- E.unsubscribe();
1244
- });
1245
- let h;
1246
- try {
1247
- if (d && Zn && n !== "get" && n !== "head" && (h = await er(l, r)) !== 0) {
1248
- let A = new Request(e, {
1249
- method: "POST",
1250
- body: r,
1251
- duplex: "half"
1252
- }), P;
1253
- if (u.isFormData(r) && (P = A.headers.get("content-type")) && l.setContentType(P), A.body) {
1254
- const [_, z] = ve(
1255
- h,
1256
- K(Be(d))
1257
- );
1258
- r = Fe(A.body, Me, _, z);
1259
- }
1260
- }
1261
- u.isString(f) || (f = f ? "include" : "omit");
1262
- const b = "credentials" in Request.prototype;
1263
- p = new Request(e, {
1264
- ...w,
1265
- signal: E,
1266
- method: n.toUpperCase(),
1267
- headers: l.normalize().toJSON(),
1268
- body: r,
1269
- duplex: "half",
1270
- credentials: b ? f : void 0
1271
- });
1272
- let S = await fetch(p);
1273
- const R = be && (c === "stream" || c === "response");
1274
- if (be && (a || R && y)) {
1275
- const A = {};
1276
- ["status", "statusText", "headers"].forEach((ke) => {
1277
- A[ke] = S[ke];
1278
- });
1279
- const P = u.toFiniteNumber(S.headers.get("content-length")), [_, z] = a && ve(
1280
- P,
1281
- K(Be(a), !0)
1282
- ) || [];
1283
- S = new Response(
1284
- Fe(S.body, Me, _, () => {
1285
- z && z(), y && y();
1286
- }),
1287
- A
1288
- );
1289
- }
1290
- c = c || "text";
1291
- let I = await X[u.findKey(X, c) || "text"](S, t);
1292
- return !R && y && y(), await new Promise((A, P) => {
1293
- ct(A, P, {
1294
- data: I,
1295
- headers: k.from(S.headers),
1296
- status: S.status,
1297
- statusText: S.statusText,
1298
- config: t,
1299
- request: p
1300
- });
1301
- });
1302
- } catch (b) {
1303
- throw y && y(), b && b.name === "TypeError" && /Load failed|fetch/i.test(b.message) ? Object.assign(
1304
- new m("Network Error", m.ERR_NETWORK, t, p),
1305
- {
1306
- cause: b.cause || b
1307
- }
1308
- ) : m.from(b, b && b.code, t, p);
1309
- }
1310
- }), ge = {
1311
- http: hn,
1312
- xhr: Jn,
1313
- fetch: tr
1314
- };
1315
- u.forEach(ge, (t, e) => {
1316
- if (t) {
1317
- try {
1318
- Object.defineProperty(t, "name", { value: e });
1319
- } catch {
1320
- }
1321
- Object.defineProperty(t, "adapterName", { value: e });
1322
- }
1323
- });
1324
- const De = (t) => `- ${t}`, nr = (t) => u.isFunction(t) || t === null || t === !1, ht = {
1325
- getAdapter: (t) => {
1326
- t = u.isArray(t) ? t : [t];
1327
- const { length: e } = t;
1328
- let n, r;
1329
- const s = {};
1330
- for (let o = 0; o < e; o++) {
1331
- n = t[o];
1332
- let i;
1333
- if (r = n, !nr(n) && (r = ge[(i = String(n)).toLowerCase()], r === void 0))
1334
- throw new m(`Unknown adapter '${i}'`);
1335
- if (r)
1336
- break;
1337
- s[i || "#" + o] = r;
1338
- }
1339
- if (!r) {
1340
- const o = Object.entries(s).map(
1341
- ([a, d]) => `adapter ${a} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
1342
- );
1343
- let i = e ? o.length > 1 ? `since :
1344
- ` + o.map(De).join(`
1345
- `) : " " + De(o[0]) : "as no adapter specified";
1346
- throw new m(
1347
- "There is no suitable adapter to dispatch the request " + i,
1348
- "ERR_NOT_SUPPORT"
1349
- );
1350
- }
1351
- return r;
1352
- },
1353
- adapters: ge
1354
- };
1355
- function fe(t) {
1356
- if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
1357
- throw new M(null, t);
1358
- }
1359
- function $e(t) {
1360
- return fe(t), t.headers = k.from(t.headers), t.data = de.call(
1361
- t,
1362
- t.transformRequest
1363
- ), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), ht.getAdapter(t.adapter || Ae.adapter)(t).then(function(r) {
1364
- return fe(t), r.data = de.call(
1365
- t,
1366
- t.transformResponse,
1367
- r
1368
- ), r.headers = k.from(r.headers), r;
1369
- }, function(r) {
1370
- return ut(r) || (fe(t), r && r.response && (r.response.data = de.call(
1371
- t,
1372
- t.transformResponse,
1373
- r.response
1374
- ), r.response.headers = k.from(r.response.headers))), Promise.reject(r);
1375
- });
1376
- }
1377
- const mt = "1.9.0", ie = {};
1378
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
1379
- ie[t] = function(r) {
1380
- return typeof r === t || "a" + (e < 1 ? "n " : " ") + t;
1381
- };
1382
- });
1383
- const je = {};
1384
- ie.transitional = function(e, n, r) {
1385
- function s(o, i) {
1386
- return "[Axios v" + mt + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
1387
- }
1388
- return (o, i, a) => {
1389
- if (e === !1)
1390
- throw new m(
1391
- s(i, " has been removed" + (n ? " in " + n : "")),
1392
- m.ERR_DEPRECATED
1393
- );
1394
- return n && !je[i] && (je[i] = !0, console.warn(
1395
- s(
1396
- i,
1397
- " has been deprecated since v" + n + " and will be removed in the near future"
1398
- )
1399
- )), e ? e(o, i, a) : !0;
1400
- };
1401
- };
1402
- ie.spelling = function(e) {
1403
- return (n, r) => (console.warn(`${r} is likely a misspelling of ${e}`), !0);
1404
- };
1405
- function rr(t, e, n) {
1406
- if (typeof t != "object")
1407
- throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
1408
- const r = Object.keys(t);
1409
- let s = r.length;
1410
- for (; s-- > 0; ) {
1411
- const o = r[s], i = e[o];
1412
- if (i) {
1413
- const a = t[o], d = a === void 0 || i(a, o, t);
1414
- if (d !== !0)
1415
- throw new m("option " + o + " must be " + d, m.ERR_BAD_OPTION_VALUE);
1416
- continue;
1417
- }
1418
- if (n !== !0)
1419
- throw new m("Unknown option " + o, m.ERR_BAD_OPTION);
1420
- }
1421
- }
1422
- const G = {
1423
- assertOptions: rr,
1424
- validators: ie
1425
- }, x = G.validators;
1426
- let Z = class {
1427
- constructor(e) {
1428
- this.defaults = e || {}, this.interceptors = {
1429
- request: new Le(),
1430
- response: new Le()
1431
- };
1432
- }
1433
- /**
1434
- * Dispatch a request
1435
- *
1436
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1437
- * @param {?Object} config
1438
- *
1439
- * @returns {Promise} The Promise to be fulfilled
1440
- */
1441
- async request(e, n) {
1442
- try {
1443
- return await this._request(e, n);
1444
- } catch (r) {
1445
- if (r instanceof Error) {
1446
- let s = {};
1447
- Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
1448
- const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1449
- try {
1450
- r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
1451
- ` + o) : r.stack = o;
1452
- } catch {
1453
- }
1454
- }
1455
- throw r;
1456
- }
1457
- }
1458
- _request(e, n) {
1459
- typeof e == "string" ? (n = n || {}, n.url = e) : n = e || {}, n = N(this.defaults, n);
1460
- const { transitional: r, paramsSerializer: s, headers: o } = n;
1461
- r !== void 0 && G.assertOptions(r, {
1462
- silentJSONParsing: x.transitional(x.boolean),
1463
- forcedJSONParsing: x.transitional(x.boolean),
1464
- clarifyTimeoutError: x.transitional(x.boolean)
1465
- }, !1), s != null && (u.isFunction(s) ? n.paramsSerializer = {
1466
- serialize: s
1467
- } : G.assertOptions(s, {
1468
- encode: x.function,
1469
- serialize: x.function
1470
- }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), G.assertOptions(n, {
1471
- baseUrl: x.spelling("baseURL"),
1472
- withXsrfToken: x.spelling("withXSRFToken")
1473
- }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1474
- let i = o && u.merge(
1475
- o.common,
1476
- o[n.method]
1477
- );
1478
- o && u.forEach(
1479
- ["delete", "get", "head", "post", "put", "patch", "common"],
1480
- (p) => {
1481
- delete o[p];
1482
- }
1483
- ), n.headers = k.concat(i, o);
1484
- const a = [];
1485
- let d = !0;
1486
- this.interceptors.request.forEach(function(y) {
1487
- typeof y.runWhen == "function" && y.runWhen(n) === !1 || (d = d && y.synchronous, a.unshift(y.fulfilled, y.rejected));
1488
- });
1489
- const c = [];
1490
- this.interceptors.response.forEach(function(y) {
1491
- c.push(y.fulfilled, y.rejected);
1492
- });
1493
- let l, f = 0, w;
1494
- if (!d) {
1495
- const p = [$e.bind(this), void 0];
1496
- for (p.unshift.apply(p, a), p.push.apply(p, c), w = p.length, l = Promise.resolve(n); f < w; )
1497
- l = l.then(p[f++], p[f++]);
1498
- return l;
1499
- }
1500
- w = a.length;
1501
- let E = n;
1502
- for (f = 0; f < w; ) {
1503
- const p = a[f++], y = a[f++];
1504
- try {
1505
- E = p(E);
1506
- } catch (h) {
1507
- y.call(this, h);
1508
- break;
1509
- }
1510
- }
1511
- try {
1512
- l = $e.call(this, E);
1513
- } catch (p) {
1514
- return Promise.reject(p);
1515
- }
1516
- for (f = 0, w = c.length; f < w; )
1517
- l = l.then(c[f++], c[f++]);
1518
- return l;
1519
- }
1520
- getUri(e) {
1521
- e = N(this.defaults, e);
1522
- const n = lt(e.baseURL, e.url, e.allowAbsoluteUrls);
1523
- return ot(n, e.params, e.paramsSerializer);
1524
- }
1525
- };
1526
- u.forEach(["delete", "get", "head", "options"], function(e) {
1527
- Z.prototype[e] = function(n, r) {
1528
- return this.request(N(r || {}, {
1529
- method: e,
1530
- url: n,
1531
- data: (r || {}).data
1532
- }));
1533
- };
1534
- });
1535
- u.forEach(["post", "put", "patch"], function(e) {
1536
- function n(r) {
1537
- return function(o, i, a) {
1538
- return this.request(N(a || {}, {
1539
- method: e,
1540
- headers: r ? {
1541
- "Content-Type": "multipart/form-data"
1542
- } : {},
1543
- url: o,
1544
- data: i
1545
- }));
1546
- };
1547
- }
1548
- Z.prototype[e] = n(), Z.prototype[e + "Form"] = n(!0);
1549
- });
1550
- const Q = Z;
1551
- let sr = class yt {
1552
- constructor(e) {
1553
- if (typeof e != "function")
1554
- throw new TypeError("executor must be a function.");
1555
- let n;
1556
- this.promise = new Promise(function(o) {
1557
- n = o;
1558
- });
1559
- const r = this;
1560
- this.promise.then((s) => {
1561
- if (!r._listeners)
1562
- return;
1563
- let o = r._listeners.length;
1564
- for (; o-- > 0; )
1565
- r._listeners[o](s);
1566
- r._listeners = null;
1567
- }), this.promise.then = (s) => {
1568
- let o;
1569
- const i = new Promise((a) => {
1570
- r.subscribe(a), o = a;
1571
- }).then(s);
1572
- return i.cancel = function() {
1573
- r.unsubscribe(o);
1574
- }, i;
1575
- }, e(function(o, i, a) {
1576
- r.reason || (r.reason = new M(o, i, a), n(r.reason));
1577
- });
1578
- }
1579
- /**
1580
- * Throws a `CanceledError` if cancellation has been requested.
1581
- */
1582
- throwIfRequested() {
1583
- if (this.reason)
1584
- throw this.reason;
1585
- }
1586
- /**
1587
- * Subscribe to the cancel signal
1588
- */
1589
- subscribe(e) {
1590
- if (this.reason) {
1591
- e(this.reason);
1592
- return;
1593
- }
1594
- this._listeners ? this._listeners.push(e) : this._listeners = [e];
1595
- }
1596
- /**
1597
- * Unsubscribe from the cancel signal
1598
- */
1599
- unsubscribe(e) {
1600
- if (!this._listeners)
1601
- return;
1602
- const n = this._listeners.indexOf(e);
1603
- n !== -1 && this._listeners.splice(n, 1);
1604
- }
1605
- toAbortSignal() {
1606
- const e = new AbortController(), n = (r) => {
1607
- e.abort(r);
1608
- };
1609
- return this.subscribe(n), e.signal.unsubscribe = () => this.unsubscribe(n), e.signal;
1610
- }
1611
- /**
1612
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1613
- * cancels the `CancelToken`.
1614
- */
1615
- static source() {
1616
- let e;
1617
- return {
1618
- token: new yt(function(s) {
1619
- e = s;
1620
- }),
1621
- cancel: e
1622
- };
1623
- }
1624
- };
1625
- const or = sr;
1626
- function ir(t) {
1627
- return function(n) {
1628
- return t.apply(null, n);
1629
- };
1630
- }
1631
- function ar(t) {
1632
- return u.isObject(t) && t.isAxiosError === !0;
1633
- }
1634
- const Ee = {
1635
- Continue: 100,
1636
- SwitchingProtocols: 101,
1637
- Processing: 102,
1638
- EarlyHints: 103,
1639
- Ok: 200,
1640
- Created: 201,
1641
- Accepted: 202,
1642
- NonAuthoritativeInformation: 203,
1643
- NoContent: 204,
1644
- ResetContent: 205,
1645
- PartialContent: 206,
1646
- MultiStatus: 207,
1647
- AlreadyReported: 208,
1648
- ImUsed: 226,
1649
- MultipleChoices: 300,
1650
- MovedPermanently: 301,
1651
- Found: 302,
1652
- SeeOther: 303,
1653
- NotModified: 304,
1654
- UseProxy: 305,
1655
- Unused: 306,
1656
- TemporaryRedirect: 307,
1657
- PermanentRedirect: 308,
1658
- BadRequest: 400,
1659
- Unauthorized: 401,
1660
- PaymentRequired: 402,
1661
- Forbidden: 403,
1662
- NotFound: 404,
1663
- MethodNotAllowed: 405,
1664
- NotAcceptable: 406,
1665
- ProxyAuthenticationRequired: 407,
1666
- RequestTimeout: 408,
1667
- Conflict: 409,
1668
- Gone: 410,
1669
- LengthRequired: 411,
1670
- PreconditionFailed: 412,
1671
- PayloadTooLarge: 413,
1672
- UriTooLong: 414,
1673
- UnsupportedMediaType: 415,
1674
- RangeNotSatisfiable: 416,
1675
- ExpectationFailed: 417,
1676
- ImATeapot: 418,
1677
- MisdirectedRequest: 421,
1678
- UnprocessableEntity: 422,
1679
- Locked: 423,
1680
- FailedDependency: 424,
1681
- TooEarly: 425,
1682
- UpgradeRequired: 426,
1683
- PreconditionRequired: 428,
1684
- TooManyRequests: 429,
1685
- RequestHeaderFieldsTooLarge: 431,
1686
- UnavailableForLegalReasons: 451,
1687
- InternalServerError: 500,
1688
- NotImplemented: 501,
1689
- BadGateway: 502,
1690
- ServiceUnavailable: 503,
1691
- GatewayTimeout: 504,
1692
- HttpVersionNotSupported: 505,
1693
- VariantAlsoNegotiates: 506,
1694
- InsufficientStorage: 507,
1695
- LoopDetected: 508,
1696
- NotExtended: 510,
1697
- NetworkAuthenticationRequired: 511
1698
- };
1699
- Object.entries(Ee).forEach(([t, e]) => {
1700
- Ee[e] = t;
1701
- });
1702
- const ur = Ee;
1703
- function wt(t) {
1704
- const e = new Q(t), n = Ve(Q.prototype.request, e);
1705
- return u.extend(n, Q.prototype, e, { allOwnKeys: !0 }), u.extend(n, e, null, { allOwnKeys: !0 }), n.create = function(s) {
1706
- return wt(N(t, s));
1707
- }, n;
1708
- }
1709
- const g = wt(Ae);
1710
- g.Axios = Q;
1711
- g.CanceledError = M;
1712
- g.CancelToken = or;
1713
- g.isCancel = ut;
1714
- g.VERSION = mt;
1715
- g.toFormData = re;
1716
- g.AxiosError = m;
1717
- g.Cancel = g.CanceledError;
1718
- g.all = function(e) {
1719
- return Promise.all(e);
1720
- };
1721
- g.spread = ir;
1722
- g.isAxiosError = ar;
1723
- g.mergeConfig = N;
1724
- g.AxiosHeaders = k;
1725
- g.formToJSON = (t) => at(u.isHTMLForm(t) ? new FormData(t) : t);
1726
- g.getAdapter = ht.getAdapter;
1727
- g.HttpStatusCode = ur;
1728
- g.default = g;
1729
- const Ce = g, {
1730
- Axios: Ar,
1731
- AxiosError: bt,
1732
- CanceledError: Cr,
1733
- isCancel: kr,
1734
- CancelToken: Ur,
1735
- VERSION: xr,
1736
- all: Ir,
1737
- Cancel: Pr,
1738
- isAxiosError: Lr,
1739
- spread: _r,
1740
- toFormData: vr,
1741
- AxiosHeaders: Br,
1742
- HttpStatusCode: Nr,
1743
- formToJSON: Fr,
1744
- getAdapter: Mr,
1745
- mergeConfig: Dr
1746
- } = Ce;
1747
- var v = globalThis && globalThis.__awaiter || function(t, e, n, r) {
1748
- function s(o) {
1749
- return o instanceof n ? o : new n(function(i) {
1750
- i(o);
1751
- });
1752
- }
1753
- return new (n || (n = Promise))(function(o, i) {
1754
- function a(l) {
1755
- try {
1756
- c(r.next(l));
1757
- } catch (f) {
1758
- i(f);
1759
- }
1760
- }
1761
- function d(l) {
1762
- try {
1763
- c(r.throw(l));
1764
- } catch (f) {
1765
- i(f);
1766
- }
1767
- }
1768
- function c(l) {
1769
- l.done ? o(l.value) : s(l.value).then(a, d);
1770
- }
1771
- c((r = r.apply(t, e || [])).next());
1772
- });
1773
- };
1774
- const J = "feedme-one-tap", cr = "feedme-login-iframe", pe = "feedme-otp-iframe", lr = "fm-iframe-message-request", dr = "fm-iframe-message-response";
1775
- class L {
1776
- static get token() {
1777
- if (!this.bgIframe)
1778
- throw new Error("FeedMeAuth.token must be called after initialize()");
1779
- return this.bgIframe.contentWindow.postMessage("fm-get-token", this.baseUrl + "/one-tap/background"), this._token;
1780
- }
1781
- static setBaseUrl(e) {
1782
- typeof e == "string" ? this.baseUrl = e : this.baseUrl = `https://account.feedme${e ? "dev" : ""}.cc`;
1783
- }
1784
- static initialize({ clientId: e, setProfile: n = !0, profileAllowSkip: r = !0, oneTapMode: s = "popup", loginMode: o = "new_window", forceOtpLogin: i = !1 }) {
1785
- if (!e)
1786
- throw new Error("FeedMeAuth: clientId is required");
1787
- this.feedMePosOptions = {
1788
- clientId: e,
1789
- setProfile: n,
1790
- forceOtpLogin: i,
1791
- profileAllowSkip: r,
1792
- oneTapMode: s,
1793
- loginMode: o
1794
- }, this.startBackground(), this.initTokenRevokeCheck();
1795
- const a = document.createElement("style");
1796
- a.innerHTML = `
1797
- #feedme-one-tap.popup {
1798
- width: 100%;
1799
- max-width: 350px;
1800
- height: 0;
1801
- position: absolute;
1802
- bottom: 20px;
1803
- /* center align */
1804
- left: 50%;
1805
- transform: translateX(-50%);
1806
- background-color: white;
1807
- transition: opacity 0.3s;
1808
- }
1809
-
1810
- #feedme-otp-iframe.full-screen {
1811
- width: 100vw;
1812
- height: 100vh;
1813
- left: 0;
1814
- top: 0;
1815
- position: fixed;
1816
- background-color: white;
1817
- transition: opacity 0.3s;
1818
- }
1819
-
1820
- #feedme-otp-iframe iframe {
1821
- width: 100%;
1822
- height: 100%;
1823
- }
1824
-
1825
- #feedme-one-tap.full-screen {
1826
- width: 100vw;
1827
- height: 100vh;
1828
- left: 0;
1829
- top: 0;
1830
- position: fixed;
1831
- background-color: white;
1832
- transition: opacity 0.3s;
1833
- }
1834
-
1835
- #feedme-login-iframe {
1836
- position: fixed;
1837
- left: 0;
1838
- right: 0;
1839
- top: 0;
1840
- bottom: 0;
1841
- background: white;
1842
- transition: opacity 0.3s;
1843
- }
1844
-
1845
- #feedme-login-iframe iframe {
1846
- width: 100%;
1847
- height: 100%;
1848
- }
1849
-
1850
- /* media query if pc or tablet */
1851
- @media (min-width: 768px) {
1852
- #feedme-one-tap.popup {
1853
- top: 20px;
1854
- right: 20px;
1855
- left: auto;
1856
- transform: none;
1857
- }
1858
- }
1859
-
1860
- #feedme-one-tap iframe {
1861
- width: 100%;
1862
- height: 100%;
1863
- border: none;
1864
- border-radius: 10px;
1865
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
1866
- }
1867
- `, document.head.appendChild(a);
1868
- }
1869
- static signIn({ waitForInitialAuthState: e = !1, root: n } = {}) {
1870
- return v(this, void 0, void 0, function* () {
1871
- if (e && (yield this.initialAuthStatePromise) || (window.parent !== window && console.warn("FeedMeAuth: looks like you are inside an iframe now, please let the parent window to handle the login instead."), document.getElementById(J)))
1872
- return;
1873
- const r = this.feedMePosOptions.oneTapMode, { wrapper: s } = this.createIframe({
1874
- root: n,
1875
- url: this.getOneTapUrl(),
1876
- id: J,
1877
- classList: [r === "full_screen" ? "full-screen" : "popup"]
1878
- }), o = (i) => {
1879
- if (i.origin === this.baseUrl) {
1880
- if (typeof i.data == "string")
1881
- if (i.data === "fm-close-one-tap")
1882
- this.unmountById(J), window.removeEventListener("message", o);
1883
- else if (i.data.startsWith("fm-one-tap-height-") && this.feedMePosOptions.oneTapMode === "popup") {
1884
- const a = i.data.replace("fm-one-tap-height-", "");
1885
- s.style.height = a + "px";
1886
- } else
1887
- i.data === "fm-one-tap-open-login-iframe" && this.startLoginIframe();
1888
- else if (i.data instanceof Error)
1889
- throw s.style.display = "none", i.data;
1890
- }
1891
- };
1892
- window.addEventListener("message", o);
1893
- });
1894
- }
1895
- static setToken(e) {
1896
- this._token = e;
1897
- }
1898
- static onAuthStateChanged(e) {
1899
- const n = this.authStateChangeCallBackId++;
1900
- return this.authStateChangeCallbacks[n] = e, () => {
1901
- delete this.authStateChangeCallbacks[n];
1902
- };
1903
- }
1904
- static signOut() {
1905
- if (!this.bgIframe)
1906
- throw new Error("FeedMeAuth.signOut() must be called after initialize()");
1907
- return this.bgIframe.contentWindow.postMessage("fm-sign-out", this.baseUrl + "/one-tap/background"), new Promise((e, n) => {
1908
- const r = this.onAuthStateChanged((o) => {
1909
- o || (r(), e({ status: "success" }));
1910
- });
1911
- setTimeout(() => {
1912
- r(), n({ status: "failed" });
1913
- }, 3e3);
1914
- });
1915
- }
1916
- static verifyOtp({ phone: e, tokenType: n = "idtoken" }) {
1917
- return new Promise((r, s) => {
1918
- this.createIframe({
1919
- id: pe,
1920
- url: this.getOtpUrl(e, n),
1921
- classList: ["full-screen"]
1922
- });
1923
- const o = (i) => {
1924
- if (i.origin === this.baseUrl && typeof i.data == "string") {
1925
- const a = "fm-idtoken-";
1926
- if (i.data.startsWith(a)) {
1927
- const d = i.data.replace(a, "");
1928
- window.removeEventListener("message", o), this.unmountById(pe), r(d);
1929
- }
1930
- i.data === "fm-close-otp" && (this.unmountById(pe), window.removeEventListener("message", o), s(new Error("Verify Failed.")));
1931
- }
1932
- };
1933
- window.addEventListener("message", o);
1934
- });
1935
- }
1936
- static unmountById(e) {
1937
- const n = document.getElementById(e);
1938
- n && (n.style.opacity = "0", setTimeout(() => {
1939
- n.remove();
1940
- }, 300));
1941
- }
1942
- static getCustomToken(e) {
1943
- return v(this, void 0, void 0, function* () {
1944
- const n = yield fetch(this.baseUrl + "/api/token/custom", {
1945
- method: "POST",
1946
- headers: {
1947
- Authorization: `Bearer ${e || this.token}`,
1948
- "Content-Type": "application/json"
1949
- },
1950
- body: JSON.stringify({
1951
- token: e || this.token
1952
- })
1953
- });
1954
- if (!n.ok)
1955
- throw new Error("Failed to get custom token");
1956
- return yield n.text();
1957
- });
1958
- }
1959
- static currentUser() {
1960
- return v(this, void 0, void 0, function* () {
1961
- if (!this.bgIframe)
1962
- throw new Error("Can't call before initialize");
1963
- return yield this.initialAuthStatePromise, yield this.callMethodOnIframe({
1964
- iframe: this.bgIframe,
1965
- methodName: "currentUser",
1966
- timeout: 3e4
1967
- });
1968
- });
1969
- }
1970
- static signInWithCustomToken(e) {
1971
- return v(this, void 0, void 0, function* () {
1972
- if (!this.bgIframe)
1973
- throw new Error("Can't call before initialize");
1974
- return yield this.initialAuthStatePromise, yield this.callMethodOnIframe({
1975
- iframe: this.bgIframe,
1976
- methodName: "signInWithCustomToken",
1977
- params: [e],
1978
- timeout: 3e4
1979
- });
1980
- });
1981
- }
1982
- static refreshToken() {
1983
- return v(this, void 0, void 0, function* () {
1984
- if (!this.bgIframe)
1985
- throw new Error("FeedMeAuth.refreshToken must be called after initialize()");
1986
- return new Promise((e, n) => {
1987
- const r = (o) => {
1988
- o.origin === this.baseUrl && o.data.type === "fm-token-refreshed" && (clearTimeout(s), window.removeEventListener("message", r), this.setToken(o.data.token), e(o.data.token));
1989
- }, s = setTimeout(() => {
1990
- window.removeEventListener("message", r), n(new Error("FeedMeAuth.refreshToken timed out"));
1991
- }, 6e4);
1992
- window.addEventListener("message", r), this.bgIframe.contentWindow.postMessage("fm-refresh-token", this.baseUrl + "/one-tap/background");
1993
- });
1994
- });
1995
- }
1996
- static getUserClaims() {
1997
- return v(this, void 0, void 0, function* () {
1998
- const e = yield fetch(this.baseUrl + "/api/user/claims", {
1999
- method: "GET",
2000
- headers: {
2001
- Authorization: `Bearer ${this.token}`
2002
- }
2003
- });
2004
- if (!e.ok)
2005
- throw new Error("Failed to get user claims");
2006
- return yield e.json();
2007
- });
2008
- }
2009
- static checkTokenValidity() {
2010
- return v(this, void 0, void 0, function* () {
2011
- if (!this.token)
2012
- return;
2013
- const e = yield fetch(this.baseUrl + "/api/token/verify", {
2014
- method: "POST",
2015
- body: JSON.stringify({ token: this.token })
2016
- }).then((r) => r.json()), n = ["auth/user-disabled", "auth/id-token-revoked"];
2017
- !e.valid && n.indexOf(e.code || "") > -1 && this.signOut();
2018
- });
2019
- }
2020
- static initTokenRevokeCheck() {
2021
- window.addEventListener("focus", () => {
2022
- this.checkTokenValidity();
2023
- });
2024
- }
2025
- static startBackground() {
2026
- if (!document)
2027
- throw new Error("FeedMeAuth.prompt() must be called in the browser");
2028
- const e = document.createElement("div");
2029
- e.id = "feedme-auth-bg", this.bgIframe = document.createElement("iframe"), this.bgIframe.src = this.getBackgroundUrl(), e.appendChild(this.bgIframe), e.style.display = "none", document.body.appendChild(e), window.addEventListener("message", (n) => {
2030
- if (n.origin === this.baseUrl && typeof n.data == "object") {
2031
- const r = n.data;
2032
- if (r.type === "fm-auth-state-changed") {
2033
- if (r.user && !r.user.phoneNumber)
2034
- return;
2035
- this._token = r.token, Object.values(this.authStateChangeCallbacks).forEach((s) => s(r.user, r.token)), this._token && this.unmountById(J);
2036
- }
2037
- }
2038
- }), this.initialAuthStatePromise = new Promise((n, r) => {
2039
- const s = this.onAuthStateChanged((i) => {
2040
- s(), n(!!i);
2041
- });
2042
- setTimeout(() => {
2043
- s(), n(!1);
2044
- }, 3e3);
2045
- });
2046
- }
2047
- static startLoginIframe() {
2048
- const { wrapper: e } = this.createIframe({
2049
- id: cr,
2050
- url: this.getLoginUrl()
2051
- }), n = (r) => {
2052
- if (r.origin === this.baseUrl) {
2053
- if (typeof r.data == "string")
2054
- r.data === "fm-close-login-iframe" && (this.unmountById("feedme-login-iframe"), window.removeEventListener("message", n));
2055
- else if (r.data instanceof Error)
2056
- throw e.style.display = "none", r.data;
2057
- }
2058
- };
2059
- window.addEventListener("message", n);
2060
- }
2061
- static createIframe({ root: e = document.body, url: n, id: r, classList: s = [] }) {
2062
- const o = document.getElementById(r), i = document.querySelector("iframe");
2063
- if (o && i)
2064
- return {
2065
- wrapper: o,
2066
- iframe: i
2067
- };
2068
- const a = document.createElement("div");
2069
- a.id = r, a.style.zIndex = String(this.getMaxZIndex() + 1), a.classList.add(...s), a.style.opacity = "0";
2070
- const d = document.createElement("iframe");
2071
- return d.src = n, a.appendChild(d), e.appendChild(a), d.addEventListener("load", () => {
2072
- a.style.opacity = "1";
2073
- }), {
2074
- wrapper: a,
2075
- iframe: d
2076
- };
2077
- }
2078
- static getQueryParams() {
2079
- const e = this.feedMePosOptions;
2080
- return `client_id=${e.clientId}&set_profile=${e.setProfile}&profile_allow_skip=${e.profileAllowSkip}&login_mode=${e.loginMode}&force_otp_login=${e.forceOtpLogin}`;
2081
- }
2082
- static getBackgroundUrl() {
2083
- return `${this.baseUrl}/one-tap/background?${this.getQueryParams()}`;
2084
- }
2085
- static getOneTapUrl() {
2086
- const e = this.feedMePosOptions.oneTapMode === "full_screen";
2087
- return `${this.baseUrl}/one-tap${e ? "/full" : ""}?${this.getQueryParams()}`;
2088
- }
2089
- static getLoginUrl() {
2090
- return `${this.baseUrl}/login?${this.getQueryParams()}`;
2091
- }
2092
- static getOtpUrl(e, n) {
2093
- return `${this.baseUrl}/otp?phone=${encodeURIComponent(e)}&tokentype=${encodeURIComponent(n)}`;
2094
- }
2095
- static getMaxZIndex() {
2096
- const e = document.querySelectorAll("body *");
2097
- let n = 1;
2098
- for (let r = 0; r < e.length; r++) {
2099
- const s = Number(getComputedStyle(e[r]).zIndex);
2100
- s > n && (n = s);
2101
- }
2102
- return n;
2103
- }
2104
- static callMethodOnIframe({ iframe: e, methodName: n, params: r = [], timeout: s }) {
2105
- if (!e)
2106
- throw new Error("Target iframe not exist.");
2107
- const o = String(Math.random());
2108
- return e.contentWindow.postMessage({
2109
- type: lr,
2110
- messageId: o,
2111
- methodName: n,
2112
- params: r
2113
- }, "*"), new Promise((i, a) => {
2114
- const d = (l) => {
2115
- var f, w;
2116
- l.origin === this.baseUrl && l.data.type === dr && ((f = l.data) === null || f === void 0 ? void 0 : f.messageId) === o && (clearTimeout(c), window.removeEventListener("message", d), i((w = l.data) === null || w === void 0 ? void 0 : w.response));
2117
- };
2118
- window.addEventListener("message", d);
2119
- let c;
2120
- s && (c = setTimeout(() => {
2121
- window.removeEventListener("message", d), a(new Error(`FeedMeAuth ${n} timed out`));
2122
- }, s));
2123
- });
2124
- }
2125
- }
2126
- L.baseUrl = "https://account.feedmedev.cc";
2127
- L.authStateChangeCallbacks = {};
2128
- L.bgIframe = null;
2129
- L._token = null;
2130
- L.authStateChangeCallBackId = 1;
2131
- window.FeedMeAuthGlobal = L;
2132
- const fr = (t) => (e) => {
2133
- var s;
2134
- const n = ((s = j().sessionUser.value) == null ? void 0 : s.token) ?? L.token;
2135
- if (!n)
2136
- throw new Error("Invalid token");
2137
- const r = Ce.create({
2138
- baseURL: `${t}/${e}`,
2139
- headers: {
2140
- Authorization: `Bearer ${n}`
2141
- }
2142
- });
2143
- return r.interceptors.response.use(
2144
- (o) => o,
2145
- async (o) => {
2146
- var i;
2147
- if (o instanceof bt) {
2148
- const a = (i = o.response) == null ? void 0 : i.data, d = (a == null ? void 0 : a.message) || (a == null ? void 0 : a.error) || `${o.message}` || `${o}`;
2149
- return Promise.reject(d);
2150
- }
2151
- return Promise.reject(o);
2152
- }
2153
- ), r;
2154
- }, qe = (t = "") => {
2155
- const { portalBackendUrl: e } = pr();
2156
- return fr(e)(t);
2157
- };
2158
- function ze(t) {
2159
- return t.data;
2160
- }
2161
- function pr() {
2162
- var i;
2163
- const { namespace: t, currentCountry: e } = j(), n = t.value === "dev", r = e.value !== he.F_COUNTRY.enum.MY ? `.${(i = e.value) == null ? void 0 : i.toLowerCase()}` : "";
2164
- return {
2165
- portalBackendUrl: `https://portal-v2${`${n ? "-dev" : ""}${r}.feedmeapi.com`}`
2166
- };
2167
- }
2168
- const He = {
2169
- async read() {
2170
- return ze(await qe().get("/public-setting"));
2171
- },
2172
- async update(t) {
2173
- return ze(await qe().put("/public-setting", t));
2174
- }
2175
- };
2176
- function hr() {
2177
- return {
2178
- loadingQueue: [],
2179
- publicSetting: {
2180
- delivery: {
2181
- feedMe: {
2182
- areas: [],
2183
- enable: !1,
2184
- maxDistance: 0
2185
- }
2186
- },
2187
- sms: {
2188
- firebase: !1
2189
- },
2190
- assets: {
2191
- groups: []
2192
- },
2193
- aiSettings: {
2194
- remy: { enable: !1 }
2195
- }
2196
- }
2197
- };
2198
- }
2199
- const Je = Tt("portal-app-store", {
2200
- state: () => hr(),
2201
- actions: {
2202
- addLoadingQueues(t) {
2203
- this.loadingQueue = [...this.loadingQueue, ...t];
2204
- },
2205
- clearLoadingQueue() {
2206
- this.loadingQueue = [];
2207
- },
2208
- resolveQueues(t) {
2209
- this.loadingQueue = this.loadingQueue.filter((e) => !t.includes(e.id));
2210
- },
2211
- async promise(t, e = !0) {
2212
- const n = We();
2213
- try {
2214
- const r = [{ id: n, isGlobal: e }];
2215
- return this.addLoadingQueues(r), await t();
2216
- } finally {
2217
- this.resolveQueues([n]);
2218
- }
2219
- },
2220
- async getPublicSetting() {
2221
- return this.publicSetting = await He.read(), this.publicSetting;
2222
- },
2223
- async updatePublicSetting(t) {
2224
- return this.publicSetting = await He.update({
2225
- ...this.publicSetting,
2226
- ...t
2227
- }), this.publicSetting;
2228
- }
2229
- }
2230
- }), mr = (t) => {
2231
- async function e(r, s) {
2232
- var a, d;
2233
- let o = [];
2234
- !s || !s.customId ? o.push(`${(/* @__PURE__ */ new Date()).toISOString()}_${We().split("-")[0]}`) : typeof s.customId == "string" ? o.push(s.customId) : o = s.customId;
2235
- const i = Je();
2236
- i.addLoadingQueues(
2237
- o.map((c) => ({
2238
- id: c,
2239
- isGlobal: (s == null ? void 0 : s.isGlobal) || !1
2240
- }))
2241
- );
2242
- try {
2243
- const c = await r();
2244
- return await ((a = s == null ? void 0 : s.onSuccess) == null ? void 0 : a.call(s, c)), c;
2245
- } catch (c) {
2246
- const l = c instanceof Error ? c.message : `${c}`;
2247
- throw s != null && s.onError ? await s.onError(l) : t.open({
2248
- type: "error",
2249
- message: l
2250
- }), c;
2251
- } finally {
2252
- i.resolveQueues(o), (d = s == null ? void 0 : s.onComplete) == null || d.call(s);
2253
- }
2254
- }
2255
- const n = Je();
2256
- return {
2257
- queue: Et(() => n.loadingQueue),
2258
- checkIsLoading: (r) => n.loadingQueue.some((s) => s.id === r),
2259
- global: async (r, s) => await e(r, {
2260
- isGlobal: !0,
2261
- onSuccess: async (o) => {
2262
- var i;
2263
- await ((i = s == null ? void 0 : s.onSuccess) == null ? void 0 : i.call(s, o)), s != null && s.successMessage && t.open({
2264
- type: "success",
2265
- message: s.successMessage,
2266
- position: ue.BOTTOM
2267
- });
2268
- }
2269
- }),
2270
- minor: async (r, s) => {
2271
- const o = t.open({
2272
- type: "info",
2273
- message: "Loading",
2274
- spinner: !0,
2275
- persistent: !0
2276
- }), i = (a, d) => {
2277
- if (!d)
2278
- return;
2279
- const c = (l) => {
2280
- t.updateSnackbar(o, { [a]: l });
2281
- };
2282
- St(d) ? (c(d.value), Rt(d, (l) => c(l))) : c(d);
2283
- };
2284
- return i("title", s == null ? void 0 : s.message), i("message", s == null ? void 0 : s.caption), await e(
2285
- async () => (s != null && s.isLoading && (s.isLoading.value = !0), await r()),
2286
- {
2287
- onSuccess: () => {
2288
- const a = (s == null ? void 0 : s.successMessage) || "Completed";
2289
- t.close(o), t.open({
2290
- type: "success",
2291
- title: a,
2292
- position: ue.BOTTOM
2293
- });
2294
- },
2295
- onError: (a) => {
2296
- const d = `${a}` || "Error";
2297
- t.close(o), t.open({
2298
- type: "error",
2299
- title: d,
2300
- position: ue.BOTTOM
2301
- });
2302
- },
2303
- onComplete: () => {
2304
- s != null && s.isLoading && (s.isLoading.value = !1);
2305
- },
2306
- customId: s == null ? void 0 : s.customId
2307
- }
2308
- );
2309
- },
2310
- custom: async (r, s) => await e(
2311
- async () => (s != null && s.isLoading && (s.isLoading.value = !0), await r()),
2312
- {
2313
- onSuccess: async () => {
2314
- s != null && s.successMessage && t.open({ message: s.successMessage });
2315
- },
2316
- onComplete: () => {
2317
- s && s.isLoading && (s.isLoading.value = !1);
2318
- },
2319
- customId: s == null ? void 0 : s.customId
2320
- }
2321
- )
2322
- };
2323
- }, $r = mr, yr = (t) => (e) => {
2324
- var s;
2325
- const n = ((s = j().sessionUser.value) == null ? void 0 : s.token) ?? L.token;
2326
- if (!n)
2327
- throw new Error("Invalid token");
2328
- const r = Ce.create({
2329
- baseURL: `${t}/${e}`,
2330
- headers: {
2331
- Authorization: `Bearer ${n}`
2332
- }
2333
- });
2334
- return r.interceptors.response.use(
2335
- (o) => o,
2336
- async (o) => {
2337
- var i;
2338
- if (o instanceof bt) {
2339
- const a = (i = o.response) == null ? void 0 : i.data, d = (a == null ? void 0 : a.message) || (a == null ? void 0 : a.error) || `${o.message}` || `${o}`;
2340
- return Promise.reject(d);
2341
- }
2342
- return Promise.reject(o);
2343
- }
2344
- ), r;
2345
- }, ae = (t = "", e = void 0) => {
2346
- const { portalBackendUrl: n } = wr(e);
2347
- return yr(n)(t);
2348
- }, jr = () => {
2349
- var e;
2350
- const t = j();
2351
- if (t.currentBusiness.value) {
2352
- const n = `businesses/${(e = t.currentBusiness.value) == null ? void 0 : e.id}`;
2353
- return ae(n);
2354
- } else
2355
- throw new Error("Invalid business");
2356
- }, qr = (t, e) => {
2357
- const n = `/restaurants/${t}`, r = e ? `/${e}${n}` : n;
2358
- if (t)
2359
- return ae(r);
2360
- throw new Error("Invalid restaurant");
2361
- };
2362
- he.F_COUNTRY.enum.SG, he.F_COUNTRY.enum.ID;
2363
- function gt(t) {
2364
- return t.data;
2365
- }
2366
- function wr(t = void 0) {
2367
- const { namespace: e, currentCountry: n } = j(), r = t ?? n.value, s = e.value === "dev", o = (r == null ? void 0 : r.toLowerCase()) !== "my" ? `.${r == null ? void 0 : r.toLowerCase()}` : "", a = `https://portal-v2${`${s ? "-dev" : ""}${o}.feedmeapi.com`}`;
2368
- return {
2369
- portalBackendUrl: { remy: "https://remy-dev.feedmeapi.com/v1", customerApp: "https://feedmedev.cc", googleMap: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", templateBuilderUrl: "https://print-template-builder.feedme.dev/", gtm: { id: "GTM-P7Z9FMS6", serverUrl: "https://server-side-tagging-rsrq3ogsuq-as.a.run.app", env: "development", serverMeasurementId: "G-759WBZPF06", debug: !0 }, firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, r2: null }.mainBackend ?? a,
2370
- menuBackendUrl: { remy: "https://remy-dev.feedmeapi.com/v1", customerApp: "https://feedmedev.cc", googleMap: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", templateBuilderUrl: "https://print-template-builder.feedme.dev/", gtm: { id: "GTM-P7Z9FMS6", serverUrl: "https://server-side-tagging-rsrq3ogsuq-as.a.run.app", env: "development", serverMeasurementId: "G-759WBZPF06", debug: !0 }, firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, r2: null }.menuBackend ?? a
2371
- };
2372
- }
2373
- function zr(t) {
2374
- return t.data;
2375
- }
2376
- async function Hr(t) {
2377
- return gt(
2378
- await ae("").get(`/restaurants/${t}/restaurant-setting`)
2379
- );
2380
- }
2381
- async function Jr(t, e) {
2382
- return gt(
2383
- await ae("").put(`/restaurants/${t}/restaurant-setting`, e)
2384
- );
2385
- }
2386
- export {
2387
- L as F,
2388
- jr as a,
2389
- ae as b,
2390
- qr as c,
2391
- zr as g,
2392
- Hr as r,
2393
- Jr as s,
2394
- $r as u
2395
- };