bt-core-app 1.4.63 → 1.4.64
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/bt-core-app.js +962 -938
- package/package.json +1 -1
package/dist/bt-core-app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as z, shallowRef as Re, computed as te, toValue as K, watch as _e, toRef as Zt, onMounted as Or } from "vue";
|
|
2
2
|
import { watchArray as pr, useStorage as Jt, useEventListener as he, toValue as Ae, useParentElement as jt, useResizeObserver as Kt, useArrayUnique as Qt, useArrayDifference as Wr, watchDebounced as Xt, tryOnMounted as Ot } from "@vueuse/core";
|
|
3
3
|
import { defineStore as et } from "pinia";
|
|
4
4
|
import { DateTime as de } from "luxon";
|
|
@@ -11,7 +11,7 @@ function en(e) {
|
|
|
11
11
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
12
12
|
}
|
|
13
13
|
function rn(e) {
|
|
14
|
-
const t =
|
|
14
|
+
const t = z([]), l = Re(), S = Re(), s = Re(), g = te(() => l.value != null);
|
|
15
15
|
function x(d) {
|
|
16
16
|
t.value = t.value.filter((h) => h.id != d);
|
|
17
17
|
}
|
|
@@ -23,10 +23,10 @@ function rn(e) {
|
|
|
23
23
|
return t.value.push(h), h.id;
|
|
24
24
|
}
|
|
25
25
|
function T(d) {
|
|
26
|
-
d != null && (
|
|
26
|
+
d != null && (S.value = d.toString());
|
|
27
27
|
}
|
|
28
28
|
function N() {
|
|
29
|
-
|
|
29
|
+
S.value = void 0;
|
|
30
30
|
}
|
|
31
31
|
async function $(d, h) {
|
|
32
32
|
const u = { ...h };
|
|
@@ -35,10 +35,10 @@ function rn(e) {
|
|
|
35
35
|
let y = null;
|
|
36
36
|
try {
|
|
37
37
|
return u.requireConfirmation || u.confirmationMsg, y = await d(), u.completionMsg != null && (s.value = u.completionMsg), y;
|
|
38
|
-
} catch (
|
|
38
|
+
} catch (D) {
|
|
39
39
|
if (u.throwError == !0)
|
|
40
40
|
return y;
|
|
41
|
-
T(u.errorMsg ??
|
|
41
|
+
T(u.errorMsg ?? D ?? "error");
|
|
42
42
|
} finally {
|
|
43
43
|
x(r);
|
|
44
44
|
}
|
|
@@ -46,7 +46,7 @@ function rn(e) {
|
|
|
46
46
|
return pr(t, (d) => {
|
|
47
47
|
l.value = d.length > 0 ? d[0].msg : void 0;
|
|
48
48
|
}, { deep: !0 }), {
|
|
49
|
-
actionErrorMsg:
|
|
49
|
+
actionErrorMsg: S,
|
|
50
50
|
actionLoadingMsg: l,
|
|
51
51
|
actionCompleteMsg: s,
|
|
52
52
|
clearErrors: N,
|
|
@@ -59,7 +59,7 @@ var Qe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
59
59
|
function tn(e) {
|
|
60
60
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
61
61
|
}
|
|
62
|
-
var
|
|
62
|
+
var Ue = function() {
|
|
63
63
|
function e(s) {
|
|
64
64
|
return s;
|
|
65
65
|
}
|
|
@@ -86,25 +86,25 @@ var Be = function() {
|
|
|
86
86
|
return -s(d, h);
|
|
87
87
|
} : s;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function S(s, g) {
|
|
90
90
|
var x = typeof this == "function" && !this.firstBy ? this : !1, P = l(s, g), T = x ? function(N, $) {
|
|
91
91
|
return x(N, $) || P(N, $);
|
|
92
92
|
} : P;
|
|
93
|
-
return T.thenBy =
|
|
93
|
+
return T.thenBy = S, T;
|
|
94
94
|
}
|
|
95
|
-
return
|
|
95
|
+
return S.firstBy = S, S;
|
|
96
96
|
}();
|
|
97
|
-
function
|
|
98
|
-
let l = e ?? "",
|
|
97
|
+
function Be(e, t) {
|
|
98
|
+
let l = e ?? "", S = t ?? "";
|
|
99
99
|
if (l.endsWith("/"))
|
|
100
100
|
do
|
|
101
101
|
l = l.slice(0, l.length - 1);
|
|
102
102
|
while (l.endsWith("/"));
|
|
103
|
-
if (
|
|
103
|
+
if (S.startsWith("/"))
|
|
104
104
|
do
|
|
105
|
-
|
|
106
|
-
while (
|
|
107
|
-
return `${l}/${
|
|
105
|
+
S = S.slice(1, S.length);
|
|
106
|
+
while (S.startsWith("/"));
|
|
107
|
+
return `${l}/${S}`;
|
|
108
108
|
}
|
|
109
109
|
function Jn(e) {
|
|
110
110
|
return e == null || !Array.isArray(e) ? e : [...new Set(e.map((t) => t))];
|
|
@@ -155,13 +155,13 @@ function tt(e, t = !1) {
|
|
|
155
155
|
}
|
|
156
156
|
function pn(e, t, l) {
|
|
157
157
|
if (e) {
|
|
158
|
-
var
|
|
159
|
-
|
|
158
|
+
var S = new Image();
|
|
159
|
+
S.onload = t, S.onerror = l, S.src = e;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
async function ea(e, t = !0) {
|
|
163
|
-
return new Promise((l,
|
|
164
|
-
e == null &&
|
|
163
|
+
return new Promise((l, S) => {
|
|
164
|
+
e == null && S("no url given");
|
|
165
165
|
var s = new Image();
|
|
166
166
|
s.setAttribute("crossOrigin", "anonymous"), s.onload = function() {
|
|
167
167
|
var g = document.createElement("canvas");
|
|
@@ -169,7 +169,7 @@ async function ea(e, t = !0) {
|
|
|
169
169
|
var x = g.getContext("2d");
|
|
170
170
|
x == null || x.drawImage(this, 0, 0), l(g.toDataURL("image/png"));
|
|
171
171
|
}, s.onerror = function() {
|
|
172
|
-
console.log("errr"), t ?
|
|
172
|
+
console.log("errr"), t ? S("image could not be loaded for some reason") : l(null);
|
|
173
173
|
}, e != null && (s.src = e);
|
|
174
174
|
});
|
|
175
175
|
}
|
|
@@ -185,7 +185,7 @@ function ra(e) {
|
|
|
185
185
|
function an(e) {
|
|
186
186
|
return e == null ? e : e.replace(/\w\S*/g, (t) => t.replace(/^\w/, (l) => l.toUpperCase()));
|
|
187
187
|
}
|
|
188
|
-
const
|
|
188
|
+
const Ye = [
|
|
189
189
|
{ value: 1, short: "sun", values: ["sun", "sunday"] },
|
|
190
190
|
{ value: 2, short: "mon", values: ["mon", "monday"] },
|
|
191
191
|
{ value: 3, short: "tue", values: ["tue", "tues", "tuesday"] },
|
|
@@ -198,19 +198,19 @@ const Ze = [
|
|
|
198
198
|
function ta(e) {
|
|
199
199
|
if (e == null)
|
|
200
200
|
return 0;
|
|
201
|
-
const t = e.replaceAll(" ", "").split(",").map((
|
|
201
|
+
const t = e.replaceAll(" ", "").split(",").map((S) => S.toLowerCase()), l = Ye.filter((S) => S.values.some((s) => t.some((g) => s == g))).map((S) => S.value);
|
|
202
202
|
return l.length == 0 ? 8 : Math.min(...l);
|
|
203
203
|
}
|
|
204
204
|
function na(e) {
|
|
205
205
|
return e == null ? e : e.toLowerCase().replaceAll(" ", "").split(",").map((t) => {
|
|
206
|
-
let l =
|
|
206
|
+
let l = Ye.find((S) => S.values.some((s) => s == t));
|
|
207
207
|
return l != null ? l.short : "";
|
|
208
208
|
}).filter((t) => t != null && t.length > 0).toString();
|
|
209
209
|
}
|
|
210
210
|
function aa(e, t) {
|
|
211
211
|
if (e == null || t == null)
|
|
212
212
|
return !0;
|
|
213
|
-
const l = e.replaceAll(" ", "").split(",").map((g) => g.toLowerCase()),
|
|
213
|
+
const l = e.replaceAll(" ", "").split(",").map((g) => g.toLowerCase()), S = t.replaceAll(" ", "").toLowerCase(), s = Ye.find((g) => g.values.some((x) => x == S));
|
|
214
214
|
return s != null && l.some((g) => g == s.short || s.values.some((x) => x == g));
|
|
215
215
|
}
|
|
216
216
|
function la(e, t) {
|
|
@@ -218,13 +218,13 @@ function la(e, t) {
|
|
|
218
218
|
return e;
|
|
219
219
|
let l = e ?? "";
|
|
220
220
|
l = `${l},${t}`;
|
|
221
|
-
let
|
|
222
|
-
return
|
|
221
|
+
let S = [...new Set(l.replaceAll(" ", "").toLowerCase().split(",").map((s) => Ye.find((g) => g.values.some((x) => x == s))).filter((s) => s != null).sort(Ue.firstBy((s) => (s == null ? void 0 : s.value) ?? 0)).map((s) => s == null ? void 0 : s.short))].toString();
|
|
222
|
+
return S.length > 0 ? S : void 0;
|
|
223
223
|
}
|
|
224
224
|
function ua(e, t) {
|
|
225
225
|
if (t == null || e == null)
|
|
226
226
|
return e;
|
|
227
|
-
let l = e ?? "",
|
|
227
|
+
let l = e ?? "", S = t.replaceAll(" ", "").toLowerCase(), s = [...new Set(l.replaceAll(" ", "").toLowerCase().split(",").map((g) => Ye.find((x) => x.values.some((P) => P == g && P != S))).filter((g) => g != null).sort(Ue.firstBy((g) => (g == null ? void 0 : g.value) ?? 0)).map((g) => g == null ? void 0 : g.short))].toString();
|
|
228
228
|
return s.length > 0 ? s : void 0;
|
|
229
229
|
}
|
|
230
230
|
function ia(e, t) {
|
|
@@ -243,38 +243,38 @@ function un() {
|
|
|
243
243
|
return "0001-01-01T00:00:00Z";
|
|
244
244
|
}
|
|
245
245
|
function fa(e, t) {
|
|
246
|
-
let l = "1",
|
|
247
|
-
if (
|
|
246
|
+
let l = "1", S = 0;
|
|
247
|
+
if (S < t)
|
|
248
248
|
do
|
|
249
|
-
l = l + "0",
|
|
250
|
-
while (
|
|
249
|
+
l = l + "0", S += 1;
|
|
250
|
+
while (S < t);
|
|
251
251
|
let s = Number.parseInt(l);
|
|
252
252
|
return Math.round(e * s) / s;
|
|
253
253
|
}
|
|
254
254
|
function sa(e, t) {
|
|
255
255
|
let l = e ?? "";
|
|
256
|
-
return t != null && (cn(l, t) ? l = l.split(",").filter((
|
|
256
|
+
return t != null && (cn(l, t) ? l = l.split(",").filter((S) => S != t).toString() : l != null ? l = `${l},${t}` : l = t), l != null && l.length > 0 ? l : null;
|
|
257
257
|
}
|
|
258
258
|
function cn(e, t) {
|
|
259
259
|
if (e == null || e.length == 0)
|
|
260
260
|
return !1;
|
|
261
261
|
if (!t)
|
|
262
262
|
return !0;
|
|
263
|
-
var l = e.split(","),
|
|
264
|
-
return l.some((s) =>
|
|
263
|
+
var l = e.split(","), S = t.split(",");
|
|
264
|
+
return l.some((s) => S.some((g) => g == s));
|
|
265
265
|
}
|
|
266
266
|
function Lr(e) {
|
|
267
267
|
if (!e)
|
|
268
268
|
return e;
|
|
269
269
|
let t, l = Array.isArray(e) ? [] : {};
|
|
270
|
-
for (const
|
|
271
|
-
t = e[
|
|
270
|
+
for (const S in e)
|
|
271
|
+
t = e[S], l[S] = typeof t == "object" ? Lr(t) : t;
|
|
272
272
|
return l;
|
|
273
273
|
}
|
|
274
274
|
function fn(e) {
|
|
275
275
|
return e && Object.keys(e).sort().reduce(function(t, l) {
|
|
276
|
-
let
|
|
277
|
-
return t[l] = typeof
|
|
276
|
+
let S = e[l];
|
|
277
|
+
return t[l] = typeof S == "object" && S !== null ? fn(S) : S, t;
|
|
278
278
|
}, Array.isArray(e) ? [] : {});
|
|
279
279
|
}
|
|
280
280
|
function sn(e, t) {
|
|
@@ -284,17 +284,17 @@ function nt(e, t = (l) => l) {
|
|
|
284
284
|
if (e == null)
|
|
285
285
|
return [];
|
|
286
286
|
const l = Array.isArray(e) ? e : t(e);
|
|
287
|
-
return Te(l) ? [...l.reduce((
|
|
288
|
-
|
|
287
|
+
return Te(l) ? [...l.reduce((S, s) => {
|
|
288
|
+
S.push(s);
|
|
289
289
|
const g = nt(s, t);
|
|
290
|
-
return Te(g) &&
|
|
290
|
+
return Te(g) && S.push(...g), S;
|
|
291
291
|
}, [])] : [];
|
|
292
292
|
}
|
|
293
293
|
function oa(e) {
|
|
294
|
-
const t = e.split(","), l = t[0].indexOf("base64") >= 0 ? atob(t[1]) : decodeURI(t[1]),
|
|
294
|
+
const t = e.split(","), l = t[0].indexOf("base64") >= 0 ? atob(t[1]) : decodeURI(t[1]), S = t[0].split(":")[1].split(";")[0], s = new Uint8Array(l.length);
|
|
295
295
|
for (let g = 0; g < l.length; g++)
|
|
296
296
|
s[g] = l.charCodeAt(g);
|
|
297
|
-
return new Blob([s], { type:
|
|
297
|
+
return new Blob([s], { type: S });
|
|
298
298
|
}
|
|
299
299
|
function on(e) {
|
|
300
300
|
var t = "";
|
|
@@ -320,8 +320,8 @@ function hn(e, t, l) {
|
|
|
320
320
|
return !1;
|
|
321
321
|
for (let s = 0; s < l.length; s++) {
|
|
322
322
|
const g = l[s];
|
|
323
|
-
var
|
|
324
|
-
if (
|
|
323
|
+
var S = Sr(e, g);
|
|
324
|
+
if (S != null && typeof S == "string" && sn(S, t))
|
|
325
325
|
return !0;
|
|
326
326
|
}
|
|
327
327
|
return !1;
|
|
@@ -338,8 +338,8 @@ function Sr(e, t) {
|
|
|
338
338
|
if (e == null || e == null || !t)
|
|
339
339
|
return null;
|
|
340
340
|
var l = t.split(".");
|
|
341
|
-
let
|
|
342
|
-
for (var s = e, g = 0; g <
|
|
341
|
+
let S = l.length;
|
|
342
|
+
for (var s = e, g = 0; g < S; g++)
|
|
343
343
|
if (s = s[l[g]], s == null)
|
|
344
344
|
return null;
|
|
345
345
|
return s;
|
|
@@ -364,10 +364,10 @@ var at = { exports: {} };
|
|
|
364
364
|
(function(l) {
|
|
365
365
|
e.exports = l();
|
|
366
366
|
})(function() {
|
|
367
|
-
return function l(
|
|
367
|
+
return function l(S, s, g) {
|
|
368
368
|
function x(N, $) {
|
|
369
369
|
if (!s[N]) {
|
|
370
|
-
if (!
|
|
370
|
+
if (!S[N]) {
|
|
371
371
|
var d = typeof Xe == "function" && Xe;
|
|
372
372
|
if (!$ && d)
|
|
373
373
|
return d(N, !0);
|
|
@@ -377,17 +377,17 @@ var at = { exports: {} };
|
|
|
377
377
|
throw h.code = "MODULE_NOT_FOUND", h;
|
|
378
378
|
}
|
|
379
379
|
var u = s[N] = { exports: {} };
|
|
380
|
-
|
|
381
|
-
var y =
|
|
380
|
+
S[N][0].call(u.exports, function(r) {
|
|
381
|
+
var y = S[N][1][r];
|
|
382
382
|
return x(y || r);
|
|
383
|
-
}, u, u.exports, l,
|
|
383
|
+
}, u, u.exports, l, S, s, g);
|
|
384
384
|
}
|
|
385
385
|
return s[N].exports;
|
|
386
386
|
}
|
|
387
387
|
for (var P = typeof Xe == "function" && Xe, T = 0; T < g.length; T++)
|
|
388
388
|
x(g[T]);
|
|
389
389
|
return x;
|
|
390
|
-
}({ 1: [function(l,
|
|
390
|
+
}({ 1: [function(l, S, s) {
|
|
391
391
|
(function(g) {
|
|
392
392
|
var x = g.MutationObserver || g.WebKitMutationObserver, P;
|
|
393
393
|
if (x) {
|
|
@@ -404,177 +404,177 @@ var at = { exports: {} };
|
|
|
404
404
|
};
|
|
405
405
|
} else
|
|
406
406
|
"document" in g && "onreadystatechange" in g.document.createElement("script") ? P = function() {
|
|
407
|
-
var
|
|
408
|
-
|
|
409
|
-
r(),
|
|
410
|
-
}, g.document.documentElement.appendChild(
|
|
407
|
+
var D = g.document.createElement("script");
|
|
408
|
+
D.onreadystatechange = function() {
|
|
409
|
+
r(), D.onreadystatechange = null, D.parentNode.removeChild(D), D = null;
|
|
410
|
+
}, g.document.documentElement.appendChild(D);
|
|
411
411
|
} : P = function() {
|
|
412
412
|
setTimeout(r, 0);
|
|
413
413
|
};
|
|
414
414
|
var h, u = [];
|
|
415
415
|
function r() {
|
|
416
416
|
h = !0;
|
|
417
|
-
for (var
|
|
418
|
-
for (c = u, u = [],
|
|
419
|
-
c[
|
|
420
|
-
|
|
417
|
+
for (var D, c, I = u.length; I; ) {
|
|
418
|
+
for (c = u, u = [], D = -1; ++D < I; )
|
|
419
|
+
c[D]();
|
|
420
|
+
I = u.length;
|
|
421
421
|
}
|
|
422
422
|
h = !1;
|
|
423
423
|
}
|
|
424
|
-
|
|
425
|
-
function y(
|
|
426
|
-
u.push(
|
|
424
|
+
S.exports = y;
|
|
425
|
+
function y(D) {
|
|
426
|
+
u.push(D) === 1 && !h && P();
|
|
427
427
|
}
|
|
428
428
|
}).call(this, typeof Qe < "u" ? Qe : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
429
|
-
}, {}], 2: [function(l,
|
|
429
|
+
}, {}], 2: [function(l, S, s) {
|
|
430
430
|
var g = l(1);
|
|
431
431
|
function x() {
|
|
432
432
|
}
|
|
433
433
|
var P = {}, T = ["REJECTED"], N = ["FULFILLED"], $ = ["PENDING"];
|
|
434
|
-
|
|
435
|
-
function d(
|
|
436
|
-
if (typeof
|
|
434
|
+
S.exports = d;
|
|
435
|
+
function d(b) {
|
|
436
|
+
if (typeof b != "function")
|
|
437
437
|
throw new TypeError("resolver must be a function");
|
|
438
|
-
this.state = $, this.queue = [], this.outcome = void 0,
|
|
438
|
+
this.state = $, this.queue = [], this.outcome = void 0, b !== x && y(this, b);
|
|
439
439
|
}
|
|
440
|
-
d.prototype.catch = function(
|
|
441
|
-
return this.then(null,
|
|
442
|
-
}, d.prototype.then = function(
|
|
443
|
-
if (typeof
|
|
440
|
+
d.prototype.catch = function(b) {
|
|
441
|
+
return this.then(null, b);
|
|
442
|
+
}, d.prototype.then = function(b, _) {
|
|
443
|
+
if (typeof b != "function" && this.state === N || typeof _ != "function" && this.state === T)
|
|
444
444
|
return this;
|
|
445
|
-
var
|
|
445
|
+
var E = new this.constructor(x);
|
|
446
446
|
if (this.state !== $) {
|
|
447
|
-
var
|
|
448
|
-
u(
|
|
447
|
+
var L = this.state === N ? b : _;
|
|
448
|
+
u(E, L, this.outcome);
|
|
449
449
|
} else
|
|
450
|
-
this.queue.push(new h(
|
|
451
|
-
return
|
|
450
|
+
this.queue.push(new h(E, b, _));
|
|
451
|
+
return E;
|
|
452
452
|
};
|
|
453
|
-
function h(
|
|
454
|
-
this.promise =
|
|
453
|
+
function h(b, _, E) {
|
|
454
|
+
this.promise = b, typeof _ == "function" && (this.onFulfilled = _, this.callFulfilled = this.otherCallFulfilled), typeof E == "function" && (this.onRejected = E, this.callRejected = this.otherCallRejected);
|
|
455
455
|
}
|
|
456
|
-
h.prototype.callFulfilled = function(
|
|
457
|
-
P.resolve(this.promise,
|
|
458
|
-
}, h.prototype.otherCallFulfilled = function(
|
|
459
|
-
u(this.promise, this.onFulfilled,
|
|
460
|
-
}, h.prototype.callRejected = function(
|
|
461
|
-
P.reject(this.promise,
|
|
462
|
-
}, h.prototype.otherCallRejected = function(
|
|
463
|
-
u(this.promise, this.onRejected,
|
|
456
|
+
h.prototype.callFulfilled = function(b) {
|
|
457
|
+
P.resolve(this.promise, b);
|
|
458
|
+
}, h.prototype.otherCallFulfilled = function(b) {
|
|
459
|
+
u(this.promise, this.onFulfilled, b);
|
|
460
|
+
}, h.prototype.callRejected = function(b) {
|
|
461
|
+
P.reject(this.promise, b);
|
|
462
|
+
}, h.prototype.otherCallRejected = function(b) {
|
|
463
|
+
u(this.promise, this.onRejected, b);
|
|
464
464
|
};
|
|
465
|
-
function u(
|
|
465
|
+
function u(b, _, E) {
|
|
466
466
|
g(function() {
|
|
467
|
-
var
|
|
467
|
+
var L;
|
|
468
468
|
try {
|
|
469
|
-
|
|
469
|
+
L = _(E);
|
|
470
470
|
} catch (f) {
|
|
471
|
-
return P.reject(
|
|
471
|
+
return P.reject(b, f);
|
|
472
472
|
}
|
|
473
|
-
|
|
473
|
+
L === b ? P.reject(b, new TypeError("Cannot resolve promise with itself")) : P.resolve(b, L);
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
|
-
P.resolve = function(
|
|
477
|
-
var
|
|
478
|
-
if (
|
|
479
|
-
return P.reject(
|
|
480
|
-
var
|
|
481
|
-
if (
|
|
482
|
-
y(
|
|
476
|
+
P.resolve = function(b, _) {
|
|
477
|
+
var E = D(r, _);
|
|
478
|
+
if (E.status === "error")
|
|
479
|
+
return P.reject(b, E.value);
|
|
480
|
+
var L = E.value;
|
|
481
|
+
if (L)
|
|
482
|
+
y(b, L);
|
|
483
483
|
else {
|
|
484
|
-
|
|
485
|
-
for (var f = -1, A =
|
|
486
|
-
|
|
484
|
+
b.state = N, b.outcome = _;
|
|
485
|
+
for (var f = -1, A = b.queue.length; ++f < A; )
|
|
486
|
+
b.queue[f].callFulfilled(_);
|
|
487
487
|
}
|
|
488
|
-
return
|
|
489
|
-
}, P.reject = function(
|
|
490
|
-
|
|
491
|
-
for (var
|
|
492
|
-
|
|
493
|
-
return
|
|
488
|
+
return b;
|
|
489
|
+
}, P.reject = function(b, _) {
|
|
490
|
+
b.state = T, b.outcome = _;
|
|
491
|
+
for (var E = -1, L = b.queue.length; ++E < L; )
|
|
492
|
+
b.queue[E].callRejected(_);
|
|
493
|
+
return b;
|
|
494
494
|
};
|
|
495
|
-
function r(
|
|
496
|
-
var _ =
|
|
497
|
-
if (
|
|
495
|
+
function r(b) {
|
|
496
|
+
var _ = b && b.then;
|
|
497
|
+
if (b && (typeof b == "object" || typeof b == "function") && typeof _ == "function")
|
|
498
498
|
return function() {
|
|
499
|
-
_.apply(
|
|
499
|
+
_.apply(b, arguments);
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
|
-
function y(
|
|
503
|
-
var
|
|
504
|
-
function
|
|
505
|
-
|
|
502
|
+
function y(b, _) {
|
|
503
|
+
var E = !1;
|
|
504
|
+
function L(Q) {
|
|
505
|
+
E || (E = !0, P.reject(b, Q));
|
|
506
506
|
}
|
|
507
507
|
function f(Q) {
|
|
508
|
-
|
|
508
|
+
E || (E = !0, P.resolve(b, Q));
|
|
509
509
|
}
|
|
510
510
|
function A() {
|
|
511
|
-
_(f,
|
|
511
|
+
_(f, L);
|
|
512
512
|
}
|
|
513
|
-
var J =
|
|
514
|
-
J.status === "error" &&
|
|
513
|
+
var J = D(A);
|
|
514
|
+
J.status === "error" && L(J.value);
|
|
515
515
|
}
|
|
516
|
-
function
|
|
517
|
-
var
|
|
516
|
+
function D(b, _) {
|
|
517
|
+
var E = {};
|
|
518
518
|
try {
|
|
519
|
-
|
|
520
|
-
} catch (
|
|
521
|
-
|
|
519
|
+
E.value = b(_), E.status = "success";
|
|
520
|
+
} catch (L) {
|
|
521
|
+
E.status = "error", E.value = L;
|
|
522
522
|
}
|
|
523
|
-
return
|
|
523
|
+
return E;
|
|
524
524
|
}
|
|
525
525
|
d.resolve = c;
|
|
526
|
-
function c(
|
|
527
|
-
return
|
|
526
|
+
function c(b) {
|
|
527
|
+
return b instanceof this ? b : P.resolve(new this(x), b);
|
|
528
528
|
}
|
|
529
|
-
d.reject =
|
|
530
|
-
function
|
|
529
|
+
d.reject = I;
|
|
530
|
+
function I(b) {
|
|
531
531
|
var _ = new this(x);
|
|
532
|
-
return P.reject(_,
|
|
532
|
+
return P.reject(_, b);
|
|
533
533
|
}
|
|
534
|
-
d.all =
|
|
535
|
-
function
|
|
534
|
+
d.all = w;
|
|
535
|
+
function w(b) {
|
|
536
536
|
var _ = this;
|
|
537
|
-
if (Object.prototype.toString.call(
|
|
537
|
+
if (Object.prototype.toString.call(b) !== "[object Array]")
|
|
538
538
|
return this.reject(new TypeError("must be an array"));
|
|
539
|
-
var
|
|
540
|
-
if (!
|
|
539
|
+
var E = b.length, L = !1;
|
|
540
|
+
if (!E)
|
|
541
541
|
return this.resolve([]);
|
|
542
|
-
for (var f = new Array(
|
|
543
|
-
ee(
|
|
542
|
+
for (var f = new Array(E), A = 0, J = -1, Q = new this(x); ++J < E; )
|
|
543
|
+
ee(b[J], J);
|
|
544
544
|
return Q;
|
|
545
545
|
function ee(ie, we) {
|
|
546
|
-
_.resolve(ie).then(W, function(
|
|
547
|
-
|
|
546
|
+
_.resolve(ie).then(W, function(Y) {
|
|
547
|
+
L || (L = !0, P.reject(Q, Y));
|
|
548
548
|
});
|
|
549
|
-
function W(
|
|
550
|
-
f[we] =
|
|
549
|
+
function W(Y) {
|
|
550
|
+
f[we] = Y, ++A === E && !L && (L = !0, P.resolve(Q, f));
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
d.race =
|
|
555
|
-
function
|
|
554
|
+
d.race = M;
|
|
555
|
+
function M(b) {
|
|
556
556
|
var _ = this;
|
|
557
|
-
if (Object.prototype.toString.call(
|
|
557
|
+
if (Object.prototype.toString.call(b) !== "[object Array]")
|
|
558
558
|
return this.reject(new TypeError("must be an array"));
|
|
559
|
-
var
|
|
560
|
-
if (!
|
|
559
|
+
var E = b.length, L = !1;
|
|
560
|
+
if (!E)
|
|
561
561
|
return this.resolve([]);
|
|
562
|
-
for (var f = -1, A = new this(x); ++f <
|
|
563
|
-
J(
|
|
562
|
+
for (var f = -1, A = new this(x); ++f < E; )
|
|
563
|
+
J(b[f]);
|
|
564
564
|
return A;
|
|
565
565
|
function J(Q) {
|
|
566
566
|
_.resolve(Q).then(function(ee) {
|
|
567
|
-
|
|
567
|
+
L || (L = !0, P.resolve(A, ee));
|
|
568
568
|
}, function(ee) {
|
|
569
|
-
|
|
569
|
+
L || (L = !0, P.reject(A, ee));
|
|
570
570
|
});
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
|
-
}, { 1: 1 }], 3: [function(l,
|
|
573
|
+
}, { 1: 1 }], 3: [function(l, S, s) {
|
|
574
574
|
(function(g) {
|
|
575
575
|
typeof g.Promise != "function" && (g.Promise = l(2));
|
|
576
576
|
}).call(this, typeof Qe < "u" ? Qe : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
577
|
-
}, { 2: 2 }], 4: [function(l,
|
|
577
|
+
}, { 2: 2 }], 4: [function(l, S, s) {
|
|
578
578
|
var g = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
579
579
|
return typeof n;
|
|
580
580
|
} : function(n) {
|
|
@@ -646,16 +646,16 @@ var at = { exports: {} };
|
|
|
646
646
|
if (arguments.length && typeof arguments[arguments.length - 1] == "function")
|
|
647
647
|
return arguments[arguments.length - 1];
|
|
648
648
|
}
|
|
649
|
-
var
|
|
649
|
+
var D = "local-forage-detect-blob-support", c = void 0, I = {}, w = Object.prototype.toString, M = "readonly", b = "readwrite";
|
|
650
650
|
function _(n) {
|
|
651
651
|
for (var i = n.length, a = new ArrayBuffer(i), m = new Uint8Array(a), v = 0; v < i; v++)
|
|
652
652
|
m[v] = n.charCodeAt(v);
|
|
653
653
|
return a;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function E(n) {
|
|
656
656
|
return new d(function(i) {
|
|
657
|
-
var a = n.transaction(
|
|
658
|
-
a.objectStore(
|
|
657
|
+
var a = n.transaction(D, b), m = $([""]);
|
|
658
|
+
a.objectStore(D).put(m, "key"), a.onabort = function(v) {
|
|
659
659
|
v.preventDefault(), v.stopPropagation(), i(!1);
|
|
660
660
|
}, a.oncomplete = function() {
|
|
661
661
|
var v = navigator.userAgent.match(/Chrome\/(\d+)/), o = navigator.userAgent.match(/Edge\//);
|
|
@@ -665,13 +665,13 @@ var at = { exports: {} };
|
|
|
665
665
|
return !1;
|
|
666
666
|
});
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
return typeof c == "boolean" ? d.resolve(c) :
|
|
668
|
+
function L(n) {
|
|
669
|
+
return typeof c == "boolean" ? d.resolve(c) : E(n).then(function(i) {
|
|
670
670
|
return c = i, c;
|
|
671
671
|
});
|
|
672
672
|
}
|
|
673
673
|
function f(n) {
|
|
674
|
-
var i =
|
|
674
|
+
var i = I[n.name], a = {};
|
|
675
675
|
a.promise = new d(function(m, v) {
|
|
676
676
|
a.resolve = m, a.reject = v;
|
|
677
677
|
}), i.deferredOperations.push(a), i.dbReady ? i.dbReady = i.dbReady.then(function() {
|
|
@@ -679,18 +679,18 @@ var at = { exports: {} };
|
|
|
679
679
|
}) : i.dbReady = a.promise;
|
|
680
680
|
}
|
|
681
681
|
function A(n) {
|
|
682
|
-
var i =
|
|
682
|
+
var i = I[n.name], a = i.deferredOperations.pop();
|
|
683
683
|
if (a)
|
|
684
684
|
return a.resolve(), a.promise;
|
|
685
685
|
}
|
|
686
686
|
function J(n, i) {
|
|
687
|
-
var a =
|
|
687
|
+
var a = I[n.name], m = a.deferredOperations.pop();
|
|
688
688
|
if (m)
|
|
689
689
|
return m.reject(i), m.promise;
|
|
690
690
|
}
|
|
691
691
|
function Q(n, i) {
|
|
692
692
|
return new d(function(a, m) {
|
|
693
|
-
if (
|
|
693
|
+
if (I[n.name] = I[n.name] || ne(), n.db)
|
|
694
694
|
if (i)
|
|
695
695
|
f(n), n.db.close();
|
|
696
696
|
else
|
|
@@ -701,12 +701,12 @@ var at = { exports: {} };
|
|
|
701
701
|
i && (o.onupgradeneeded = function(C) {
|
|
702
702
|
var R = o.result;
|
|
703
703
|
try {
|
|
704
|
-
R.createObjectStore(n.storeName), C.oldVersion <= 1 && R.createObjectStore(
|
|
705
|
-
} catch (
|
|
706
|
-
if (
|
|
704
|
+
R.createObjectStore(n.storeName), C.oldVersion <= 1 && R.createObjectStore(D);
|
|
705
|
+
} catch (B) {
|
|
706
|
+
if (B.name === "ConstraintError")
|
|
707
707
|
console.warn('The database "' + n.name + '" has been upgraded from version ' + C.oldVersion + " to version " + C.newVersion + ', but the storage "' + n.storeName + '" already exists.');
|
|
708
708
|
else
|
|
709
|
-
throw
|
|
709
|
+
throw B;
|
|
710
710
|
}
|
|
711
711
|
}), o.onerror = function(C) {
|
|
712
712
|
C.preventDefault(), m(o.error);
|
|
@@ -750,7 +750,7 @@ var at = { exports: {} };
|
|
|
750
750
|
}, m.readAsBinaryString(n);
|
|
751
751
|
});
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function Y(n) {
|
|
754
754
|
var i = _(atob(n.data));
|
|
755
755
|
return $([i], { type: n.type });
|
|
756
756
|
}
|
|
@@ -759,7 +759,7 @@ var at = { exports: {} };
|
|
|
759
759
|
}
|
|
760
760
|
function ae(n) {
|
|
761
761
|
var i = this, a = i._initReady().then(function() {
|
|
762
|
-
var m =
|
|
762
|
+
var m = I[i._dbInfo.name];
|
|
763
763
|
if (m && m.dbReady)
|
|
764
764
|
return m.dbReady;
|
|
765
765
|
});
|
|
@@ -767,7 +767,7 @@ var at = { exports: {} };
|
|
|
767
767
|
}
|
|
768
768
|
function G(n) {
|
|
769
769
|
f(n);
|
|
770
|
-
for (var i =
|
|
770
|
+
for (var i = I[n.name], a = i.forages, m = 0; m < a.length; m++) {
|
|
771
771
|
var v = a[m];
|
|
772
772
|
v._dbInfo.db && (v._dbInfo.db.close(), v._dbInfo.db = null);
|
|
773
773
|
}
|
|
@@ -818,15 +818,15 @@ var at = { exports: {} };
|
|
|
818
818
|
if (n)
|
|
819
819
|
for (var m in n)
|
|
820
820
|
a[m] = n[m];
|
|
821
|
-
var v =
|
|
822
|
-
v || (v = ne(),
|
|
821
|
+
var v = I[a.name];
|
|
822
|
+
v || (v = ne(), I[a.name] = v), v.forages.push(i), i._initReady || (i._initReady = i.ready, i.ready = ae);
|
|
823
823
|
var o = [];
|
|
824
824
|
function C() {
|
|
825
825
|
return d.resolve();
|
|
826
826
|
}
|
|
827
827
|
for (var R = 0; R < v.forages.length; R++) {
|
|
828
|
-
var
|
|
829
|
-
|
|
828
|
+
var B = v.forages[R];
|
|
829
|
+
B !== i && o.push(B._initReady().catch(C));
|
|
830
830
|
}
|
|
831
831
|
var F = v.forages.slice(0);
|
|
832
832
|
return d.all(o).then(function() {
|
|
@@ -836,8 +836,8 @@ var at = { exports: {} };
|
|
|
836
836
|
}).then(function(k) {
|
|
837
837
|
a.db = v.db = k, i._dbInfo = a;
|
|
838
838
|
for (var q = 0; q < F.length; q++) {
|
|
839
|
-
var
|
|
840
|
-
|
|
839
|
+
var Z = F[q];
|
|
840
|
+
Z !== i && (Z._dbInfo.db = a.db, Z._dbInfo.version = a.version);
|
|
841
841
|
}
|
|
842
842
|
});
|
|
843
843
|
}
|
|
@@ -846,14 +846,14 @@ var at = { exports: {} };
|
|
|
846
846
|
n = r(n);
|
|
847
847
|
var m = new d(function(v, o) {
|
|
848
848
|
a.ready().then(function() {
|
|
849
|
-
X(a._dbInfo,
|
|
849
|
+
X(a._dbInfo, M, function(C, R) {
|
|
850
850
|
if (C)
|
|
851
851
|
return o(C);
|
|
852
852
|
try {
|
|
853
|
-
var
|
|
853
|
+
var B = R.objectStore(a._dbInfo.storeName), F = B.get(n);
|
|
854
854
|
F.onsuccess = function() {
|
|
855
855
|
var k = F.result;
|
|
856
|
-
k === void 0 && (k = null), V(k) && (k =
|
|
856
|
+
k === void 0 && (k = null), V(k) && (k = Y(k)), v(k);
|
|
857
857
|
}, F.onerror = function() {
|
|
858
858
|
o(F.error);
|
|
859
859
|
};
|
|
@@ -865,20 +865,20 @@ var at = { exports: {} };
|
|
|
865
865
|
});
|
|
866
866
|
return h(m, i), m;
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function Ie(n, i) {
|
|
869
869
|
var a = this, m = new d(function(v, o) {
|
|
870
870
|
a.ready().then(function() {
|
|
871
|
-
X(a._dbInfo,
|
|
871
|
+
X(a._dbInfo, M, function(C, R) {
|
|
872
872
|
if (C)
|
|
873
873
|
return o(C);
|
|
874
874
|
try {
|
|
875
|
-
var
|
|
875
|
+
var B = R.objectStore(a._dbInfo.storeName), F = B.openCursor(), k = 1;
|
|
876
876
|
F.onsuccess = function() {
|
|
877
877
|
var q = F.result;
|
|
878
878
|
if (q) {
|
|
879
|
-
var
|
|
880
|
-
V(
|
|
881
|
-
var p = n(
|
|
879
|
+
var Z = q.value;
|
|
880
|
+
V(Z) && (Z = Y(Z));
|
|
881
|
+
var p = n(Z, q.key, k++);
|
|
882
882
|
p !== void 0 ? v(p) : q.continue();
|
|
883
883
|
} else
|
|
884
884
|
v();
|
|
@@ -899,21 +899,21 @@ var at = { exports: {} };
|
|
|
899
899
|
var v = new d(function(o, C) {
|
|
900
900
|
var R;
|
|
901
901
|
m.ready().then(function() {
|
|
902
|
-
return R = m._dbInfo,
|
|
903
|
-
return
|
|
902
|
+
return R = m._dbInfo, w.call(i) === "[object Blob]" ? L(R.db).then(function(B) {
|
|
903
|
+
return B ? i : W(i);
|
|
904
904
|
}) : i;
|
|
905
|
-
}).then(function(
|
|
906
|
-
X(m._dbInfo,
|
|
905
|
+
}).then(function(B) {
|
|
906
|
+
X(m._dbInfo, b, function(F, k) {
|
|
907
907
|
if (F)
|
|
908
908
|
return C(F);
|
|
909
909
|
try {
|
|
910
910
|
var q = k.objectStore(m._dbInfo.storeName);
|
|
911
|
-
|
|
912
|
-
var
|
|
911
|
+
B === null && (B = void 0);
|
|
912
|
+
var Z = q.put(B, n);
|
|
913
913
|
k.oncomplete = function() {
|
|
914
|
-
|
|
914
|
+
B === void 0 && (B = null), o(B);
|
|
915
915
|
}, k.onabort = k.onerror = function() {
|
|
916
|
-
var p =
|
|
916
|
+
var p = Z.error ? Z.error : Z.transaction.error;
|
|
917
917
|
C(p);
|
|
918
918
|
};
|
|
919
919
|
} catch (p) {
|
|
@@ -929,11 +929,11 @@ var at = { exports: {} };
|
|
|
929
929
|
n = r(n);
|
|
930
930
|
var m = new d(function(v, o) {
|
|
931
931
|
a.ready().then(function() {
|
|
932
|
-
X(a._dbInfo,
|
|
932
|
+
X(a._dbInfo, b, function(C, R) {
|
|
933
933
|
if (C)
|
|
934
934
|
return o(C);
|
|
935
935
|
try {
|
|
936
|
-
var
|
|
936
|
+
var B = R.objectStore(a._dbInfo.storeName), F = B.delete(n);
|
|
937
937
|
R.oncomplete = function() {
|
|
938
938
|
v();
|
|
939
939
|
}, R.onerror = function() {
|
|
@@ -953,15 +953,15 @@ var at = { exports: {} };
|
|
|
953
953
|
function rr(n) {
|
|
954
954
|
var i = this, a = new d(function(m, v) {
|
|
955
955
|
i.ready().then(function() {
|
|
956
|
-
X(i._dbInfo,
|
|
956
|
+
X(i._dbInfo, b, function(o, C) {
|
|
957
957
|
if (o)
|
|
958
958
|
return v(o);
|
|
959
959
|
try {
|
|
960
|
-
var R = C.objectStore(i._dbInfo.storeName),
|
|
960
|
+
var R = C.objectStore(i._dbInfo.storeName), B = R.clear();
|
|
961
961
|
C.oncomplete = function() {
|
|
962
962
|
m();
|
|
963
963
|
}, C.onabort = C.onerror = function() {
|
|
964
|
-
var F =
|
|
964
|
+
var F = B.error ? B.error : B.transaction.error;
|
|
965
965
|
v(F);
|
|
966
966
|
};
|
|
967
967
|
} catch (F) {
|
|
@@ -975,15 +975,15 @@ var at = { exports: {} };
|
|
|
975
975
|
function tr(n) {
|
|
976
976
|
var i = this, a = new d(function(m, v) {
|
|
977
977
|
i.ready().then(function() {
|
|
978
|
-
X(i._dbInfo,
|
|
978
|
+
X(i._dbInfo, M, function(o, C) {
|
|
979
979
|
if (o)
|
|
980
980
|
return v(o);
|
|
981
981
|
try {
|
|
982
|
-
var R = C.objectStore(i._dbInfo.storeName),
|
|
983
|
-
|
|
984
|
-
m(
|
|
985
|
-
},
|
|
986
|
-
v(
|
|
982
|
+
var R = C.objectStore(i._dbInfo.storeName), B = R.count();
|
|
983
|
+
B.onsuccess = function() {
|
|
984
|
+
m(B.result);
|
|
985
|
+
}, B.onerror = function() {
|
|
986
|
+
v(B.error);
|
|
987
987
|
};
|
|
988
988
|
} catch (F) {
|
|
989
989
|
v(F);
|
|
@@ -1000,11 +1000,11 @@ var at = { exports: {} };
|
|
|
1000
1000
|
return;
|
|
1001
1001
|
}
|
|
1002
1002
|
a.ready().then(function() {
|
|
1003
|
-
X(a._dbInfo,
|
|
1003
|
+
X(a._dbInfo, M, function(C, R) {
|
|
1004
1004
|
if (C)
|
|
1005
1005
|
return o(C);
|
|
1006
1006
|
try {
|
|
1007
|
-
var
|
|
1007
|
+
var B = R.objectStore(a._dbInfo.storeName), F = !1, k = B.openKeyCursor();
|
|
1008
1008
|
k.onsuccess = function() {
|
|
1009
1009
|
var q = k.result;
|
|
1010
1010
|
if (!q) {
|
|
@@ -1026,20 +1026,20 @@ var at = { exports: {} };
|
|
|
1026
1026
|
function Pe(n) {
|
|
1027
1027
|
var i = this, a = new d(function(m, v) {
|
|
1028
1028
|
i.ready().then(function() {
|
|
1029
|
-
X(i._dbInfo,
|
|
1029
|
+
X(i._dbInfo, M, function(o, C) {
|
|
1030
1030
|
if (o)
|
|
1031
1031
|
return v(o);
|
|
1032
1032
|
try {
|
|
1033
|
-
var R = C.objectStore(i._dbInfo.storeName),
|
|
1034
|
-
|
|
1035
|
-
var k =
|
|
1033
|
+
var R = C.objectStore(i._dbInfo.storeName), B = R.openKeyCursor(), F = [];
|
|
1034
|
+
B.onsuccess = function() {
|
|
1035
|
+
var k = B.result;
|
|
1036
1036
|
if (!k) {
|
|
1037
1037
|
m(F);
|
|
1038
1038
|
return;
|
|
1039
1039
|
}
|
|
1040
1040
|
F.push(k.key), k.continue();
|
|
1041
|
-
},
|
|
1042
|
-
v(
|
|
1041
|
+
}, B.onerror = function() {
|
|
1042
|
+
v(B.error);
|
|
1043
1043
|
};
|
|
1044
1044
|
} catch (k) {
|
|
1045
1045
|
v(k);
|
|
@@ -1058,27 +1058,27 @@ var at = { exports: {} };
|
|
|
1058
1058
|
v = d.reject("Invalid arguments");
|
|
1059
1059
|
else {
|
|
1060
1060
|
var o = n.name === a.name && m._dbInfo.db, C = o ? d.resolve(m._dbInfo.db) : ee(n).then(function(R) {
|
|
1061
|
-
var
|
|
1062
|
-
|
|
1061
|
+
var B = I[n.name], F = B.forages;
|
|
1062
|
+
B.db = R;
|
|
1063
1063
|
for (var k = 0; k < F.length; k++)
|
|
1064
1064
|
F[k]._dbInfo.db = R;
|
|
1065
1065
|
return R;
|
|
1066
1066
|
});
|
|
1067
1067
|
n.storeName ? v = C.then(function(R) {
|
|
1068
1068
|
if (R.objectStoreNames.contains(n.storeName)) {
|
|
1069
|
-
var
|
|
1069
|
+
var B = R.version + 1;
|
|
1070
1070
|
f(n);
|
|
1071
|
-
var F =
|
|
1071
|
+
var F = I[n.name], k = F.forages;
|
|
1072
1072
|
R.close();
|
|
1073
1073
|
for (var q = 0; q < k.length; q++) {
|
|
1074
|
-
var
|
|
1075
|
-
|
|
1074
|
+
var Z = k[q];
|
|
1075
|
+
Z._dbInfo.db = null, Z._dbInfo.version = B;
|
|
1076
1076
|
}
|
|
1077
1077
|
var p = new d(function(re, ue) {
|
|
1078
|
-
var le = T.open(n.name,
|
|
1078
|
+
var le = T.open(n.name, B);
|
|
1079
1079
|
le.onerror = function(ge) {
|
|
1080
|
-
var
|
|
1081
|
-
|
|
1080
|
+
var ze = le.result;
|
|
1081
|
+
ze.close(), ue(ge);
|
|
1082
1082
|
}, le.onupgradeneeded = function() {
|
|
1083
1083
|
var ge = le.result;
|
|
1084
1084
|
ge.deleteObjectStore(n.storeName);
|
|
@@ -1100,13 +1100,13 @@ var at = { exports: {} };
|
|
|
1100
1100
|
}
|
|
1101
1101
|
}) : v = C.then(function(R) {
|
|
1102
1102
|
f(n);
|
|
1103
|
-
var
|
|
1103
|
+
var B = I[n.name], F = B.forages;
|
|
1104
1104
|
R.close();
|
|
1105
1105
|
for (var k = 0; k < F.length; k++) {
|
|
1106
1106
|
var q = F[k];
|
|
1107
1107
|
q._dbInfo.db = null;
|
|
1108
1108
|
}
|
|
1109
|
-
var
|
|
1109
|
+
var Z = new d(function(p, re) {
|
|
1110
1110
|
var ue = T.deleteDatabase(n.name);
|
|
1111
1111
|
ue.onerror = function() {
|
|
1112
1112
|
var le = ue.result;
|
|
@@ -1118,8 +1118,8 @@ var at = { exports: {} };
|
|
|
1118
1118
|
le && le.close(), p(le);
|
|
1119
1119
|
};
|
|
1120
1120
|
});
|
|
1121
|
-
return
|
|
1122
|
-
|
|
1121
|
+
return Z.then(function(p) {
|
|
1122
|
+
B.db = p;
|
|
1123
1123
|
for (var re = 0; re < F.length; re++) {
|
|
1124
1124
|
var ue = F[re];
|
|
1125
1125
|
A(ue._dbInfo);
|
|
@@ -1136,7 +1136,7 @@ var at = { exports: {} };
|
|
|
1136
1136
|
_driver: "asyncStorage",
|
|
1137
1137
|
_initStorage: fe,
|
|
1138
1138
|
_support: N(),
|
|
1139
|
-
iterate:
|
|
1139
|
+
iterate: Ie,
|
|
1140
1140
|
getItem: ce,
|
|
1141
1141
|
setItem: $e,
|
|
1142
1142
|
removeItem: Ce,
|
|
@@ -1149,13 +1149,13 @@ var at = { exports: {} };
|
|
|
1149
1149
|
function ur() {
|
|
1150
1150
|
return typeof openDatabase == "function";
|
|
1151
1151
|
}
|
|
1152
|
-
var be = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ir = "~~local_forage_type~",
|
|
1152
|
+
var be = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ir = "~~local_forage_type~", Ze = /^~~local_forage_type~([^~]+)~/, Fe = "__lfsc__:", Ne = Fe.length, We = "arbf", Ee = "blob", Je = "si08", je = "ui08", qe = "uic8", Ve = "si16", U = "si32", j = "ur16", H = "ui32", O = "fl32", oe = "fl64", ve = Ne + We.length, De = Object.prototype.toString;
|
|
1153
1153
|
function Se(n) {
|
|
1154
|
-
var i = n.length * 0.75, a = n.length, m, v = 0, o, C, R,
|
|
1154
|
+
var i = n.length * 0.75, a = n.length, m, v = 0, o, C, R, B;
|
|
1155
1155
|
n[n.length - 1] === "=" && (i--, n[n.length - 2] === "=" && i--);
|
|
1156
1156
|
var F = new ArrayBuffer(i), k = new Uint8Array(F);
|
|
1157
1157
|
for (m = 0; m < a; m += 4)
|
|
1158
|
-
o = be.indexOf(n[m]), C = be.indexOf(n[m + 1]), R = be.indexOf(n[m + 2]),
|
|
1158
|
+
o = be.indexOf(n[m]), C = be.indexOf(n[m + 1]), R = be.indexOf(n[m + 2]), B = be.indexOf(n[m + 3]), k[v++] = o << 2 | C >> 4, k[v++] = (C & 15) << 4 | R >> 2, k[v++] = (R & 3) << 6 | B & 63;
|
|
1159
1159
|
return F;
|
|
1160
1160
|
}
|
|
1161
1161
|
function se(n) {
|
|
@@ -1168,12 +1168,12 @@ var at = { exports: {} };
|
|
|
1168
1168
|
var a = "";
|
|
1169
1169
|
if (n && (a = De.call(n)), n && (a === "[object ArrayBuffer]" || n.buffer && De.call(n.buffer) === "[object ArrayBuffer]")) {
|
|
1170
1170
|
var m, v = Fe;
|
|
1171
|
-
n instanceof ArrayBuffer ? (m = n, v += We) : (m = n.buffer, a === "[object Int8Array]" ? v += Je : a === "[object Uint8Array]" ? v += je : a === "[object Uint8ClampedArray]" ? v += qe : a === "[object Int16Array]" ? v += Ve : a === "[object Uint16Array]" ? v += j : a === "[object Int32Array]" ? v +=
|
|
1171
|
+
n instanceof ArrayBuffer ? (m = n, v += We) : (m = n.buffer, a === "[object Int8Array]" ? v += Je : a === "[object Uint8Array]" ? v += je : a === "[object Uint8ClampedArray]" ? v += qe : a === "[object Int16Array]" ? v += Ve : a === "[object Uint16Array]" ? v += j : a === "[object Int32Array]" ? v += U : a === "[object Uint32Array]" ? v += H : a === "[object Float32Array]" ? v += O : a === "[object Float64Array]" ? v += oe : i(new Error("Failed to get type for BinaryArray"))), i(v + se(m));
|
|
1172
1172
|
} else if (a === "[object Blob]") {
|
|
1173
1173
|
var o = new FileReader();
|
|
1174
1174
|
o.onload = function() {
|
|
1175
1175
|
var C = ir + n.type + "~" + se(this.result);
|
|
1176
|
-
i(Fe +
|
|
1176
|
+
i(Fe + Ee + C);
|
|
1177
1177
|
}, o.readAsArrayBuffer(n);
|
|
1178
1178
|
} else
|
|
1179
1179
|
try {
|
|
@@ -1186,15 +1186,15 @@ var at = { exports: {} };
|
|
|
1186
1186
|
if (n.substring(0, Ne) !== Fe)
|
|
1187
1187
|
return JSON.parse(n);
|
|
1188
1188
|
var i = n.substring(ve), a = n.substring(Ne, ve), m;
|
|
1189
|
-
if (a ===
|
|
1190
|
-
var v = i.match(
|
|
1189
|
+
if (a === Ee && Ze.test(i)) {
|
|
1190
|
+
var v = i.match(Ze);
|
|
1191
1191
|
m = v[1], i = i.substring(v[0].length);
|
|
1192
1192
|
}
|
|
1193
1193
|
var o = Se(i);
|
|
1194
1194
|
switch (a) {
|
|
1195
1195
|
case We:
|
|
1196
1196
|
return o;
|
|
1197
|
-
case
|
|
1197
|
+
case Ee:
|
|
1198
1198
|
return $([o], { type: m });
|
|
1199
1199
|
case Je:
|
|
1200
1200
|
return new Int8Array(o);
|
|
@@ -1206,7 +1206,7 @@ var at = { exports: {} };
|
|
|
1206
1206
|
return new Int16Array(o);
|
|
1207
1207
|
case j:
|
|
1208
1208
|
return new Uint16Array(o);
|
|
1209
|
-
case
|
|
1209
|
+
case U:
|
|
1210
1210
|
return new Int32Array(o);
|
|
1211
1211
|
case H:
|
|
1212
1212
|
return new Uint32Array(o);
|
|
@@ -1224,7 +1224,7 @@ var at = { exports: {} };
|
|
|
1224
1224
|
stringToBuffer: Se,
|
|
1225
1225
|
bufferToString: se
|
|
1226
1226
|
};
|
|
1227
|
-
function
|
|
1227
|
+
function Ur(n, i, a, m) {
|
|
1228
1228
|
n.executeSql("CREATE TABLE IF NOT EXISTS " + i.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], a, m);
|
|
1229
1229
|
}
|
|
1230
1230
|
function st(n) {
|
|
@@ -1241,9 +1241,9 @@ var at = { exports: {} };
|
|
|
1241
1241
|
return C(R);
|
|
1242
1242
|
}
|
|
1243
1243
|
a.db.transaction(function(R) {
|
|
1244
|
-
|
|
1244
|
+
Ur(R, a, function() {
|
|
1245
1245
|
i._dbInfo = a, o();
|
|
1246
|
-
}, function(
|
|
1246
|
+
}, function(B, F) {
|
|
1247
1247
|
C(F);
|
|
1248
1248
|
});
|
|
1249
1249
|
}, C);
|
|
@@ -1252,9 +1252,9 @@ var at = { exports: {} };
|
|
|
1252
1252
|
}
|
|
1253
1253
|
function xe(n, i, a, m, v, o) {
|
|
1254
1254
|
n.executeSql(a, m, v, function(C, R) {
|
|
1255
|
-
R.code === R.SYNTAX_ERR ? C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [i.storeName], function(
|
|
1256
|
-
F.rows.length ? o(
|
|
1257
|
-
|
|
1255
|
+
R.code === R.SYNTAX_ERR ? C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [i.storeName], function(B, F) {
|
|
1256
|
+
F.rows.length ? o(B, R) : Ur(B, i, function() {
|
|
1257
|
+
B.executeSql(a, m, v, o);
|
|
1258
1258
|
}, o);
|
|
1259
1259
|
}, o) : o(C, R);
|
|
1260
1260
|
}, o);
|
|
@@ -1266,10 +1266,10 @@ var at = { exports: {} };
|
|
|
1266
1266
|
a.ready().then(function() {
|
|
1267
1267
|
var C = a._dbInfo;
|
|
1268
1268
|
C.db.transaction(function(R) {
|
|
1269
|
-
xe(R, C, "SELECT * FROM " + C.storeName + " WHERE key = ? LIMIT 1", [n], function(
|
|
1269
|
+
xe(R, C, "SELECT * FROM " + C.storeName + " WHERE key = ? LIMIT 1", [n], function(B, F) {
|
|
1270
1270
|
var k = F.rows.length ? F.rows.item(0).value : null;
|
|
1271
1271
|
k && (k = C.serializer.deserialize(k)), v(k);
|
|
1272
|
-
}, function(
|
|
1272
|
+
}, function(B, F) {
|
|
1273
1273
|
o(F);
|
|
1274
1274
|
});
|
|
1275
1275
|
});
|
|
@@ -1282,16 +1282,16 @@ var at = { exports: {} };
|
|
|
1282
1282
|
a.ready().then(function() {
|
|
1283
1283
|
var C = a._dbInfo;
|
|
1284
1284
|
C.db.transaction(function(R) {
|
|
1285
|
-
xe(R, C, "SELECT * FROM " + C.storeName, [], function(
|
|
1286
|
-
for (var k = F.rows, q = k.length,
|
|
1287
|
-
var p = k.item(
|
|
1288
|
-
if (re && (re = C.serializer.deserialize(re)), re = n(re, p.key,
|
|
1285
|
+
xe(R, C, "SELECT * FROM " + C.storeName, [], function(B, F) {
|
|
1286
|
+
for (var k = F.rows, q = k.length, Z = 0; Z < q; Z++) {
|
|
1287
|
+
var p = k.item(Z), re = p.value;
|
|
1288
|
+
if (re && (re = C.serializer.deserialize(re)), re = n(re, p.key, Z + 1), re !== void 0) {
|
|
1289
1289
|
v(re);
|
|
1290
1290
|
return;
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
1293
|
v();
|
|
1294
|
-
}, function(
|
|
1294
|
+
}, function(B, F) {
|
|
1295
1295
|
o(F);
|
|
1296
1296
|
});
|
|
1297
1297
|
});
|
|
@@ -1299,27 +1299,27 @@ var at = { exports: {} };
|
|
|
1299
1299
|
});
|
|
1300
1300
|
return h(m, i), m;
|
|
1301
1301
|
}
|
|
1302
|
-
function
|
|
1302
|
+
function Br(n, i, a, m) {
|
|
1303
1303
|
var v = this;
|
|
1304
1304
|
n = r(n);
|
|
1305
1305
|
var o = new d(function(C, R) {
|
|
1306
1306
|
v.ready().then(function() {
|
|
1307
1307
|
i === void 0 && (i = null);
|
|
1308
|
-
var
|
|
1308
|
+
var B = i, F = v._dbInfo;
|
|
1309
1309
|
F.serializer.serialize(i, function(k, q) {
|
|
1310
|
-
q ? R(q) : F.db.transaction(function(
|
|
1311
|
-
xe(
|
|
1312
|
-
C(
|
|
1310
|
+
q ? R(q) : F.db.transaction(function(Z) {
|
|
1311
|
+
xe(Z, F, "INSERT OR REPLACE INTO " + F.storeName + " (key, value) VALUES (?, ?)", [n, k], function() {
|
|
1312
|
+
C(B);
|
|
1313
1313
|
}, function(p, re) {
|
|
1314
1314
|
R(re);
|
|
1315
1315
|
});
|
|
1316
|
-
}, function(
|
|
1317
|
-
if (
|
|
1316
|
+
}, function(Z) {
|
|
1317
|
+
if (Z.code === Z.QUOTA_ERR) {
|
|
1318
1318
|
if (m > 0) {
|
|
1319
|
-
C(
|
|
1319
|
+
C(Br.apply(v, [n, B, a, m - 1]));
|
|
1320
1320
|
return;
|
|
1321
1321
|
}
|
|
1322
|
-
R(
|
|
1322
|
+
R(Z);
|
|
1323
1323
|
}
|
|
1324
1324
|
});
|
|
1325
1325
|
});
|
|
@@ -1328,7 +1328,7 @@ var at = { exports: {} };
|
|
|
1328
1328
|
return h(o, a), o;
|
|
1329
1329
|
}
|
|
1330
1330
|
function ht(n, i, a) {
|
|
1331
|
-
return
|
|
1331
|
+
return Br.apply(this, [n, i, a, 1]);
|
|
1332
1332
|
}
|
|
1333
1333
|
function mt(n, i) {
|
|
1334
1334
|
var a = this;
|
|
@@ -1339,7 +1339,7 @@ var at = { exports: {} };
|
|
|
1339
1339
|
C.db.transaction(function(R) {
|
|
1340
1340
|
xe(R, C, "DELETE FROM " + C.storeName + " WHERE key = ?", [n], function() {
|
|
1341
1341
|
v();
|
|
1342
|
-
}, function(
|
|
1342
|
+
}, function(B, F) {
|
|
1343
1343
|
o(F);
|
|
1344
1344
|
});
|
|
1345
1345
|
});
|
|
@@ -1354,8 +1354,8 @@ var at = { exports: {} };
|
|
|
1354
1354
|
o.db.transaction(function(C) {
|
|
1355
1355
|
xe(C, o, "DELETE FROM " + o.storeName, [], function() {
|
|
1356
1356
|
m();
|
|
1357
|
-
}, function(R,
|
|
1358
|
-
v(
|
|
1357
|
+
}, function(R, B) {
|
|
1358
|
+
v(B);
|
|
1359
1359
|
});
|
|
1360
1360
|
});
|
|
1361
1361
|
}).catch(v);
|
|
@@ -1367,11 +1367,11 @@ var at = { exports: {} };
|
|
|
1367
1367
|
i.ready().then(function() {
|
|
1368
1368
|
var o = i._dbInfo;
|
|
1369
1369
|
o.db.transaction(function(C) {
|
|
1370
|
-
xe(C, o, "SELECT COUNT(key) as c FROM " + o.storeName, [], function(R,
|
|
1371
|
-
var F =
|
|
1370
|
+
xe(C, o, "SELECT COUNT(key) as c FROM " + o.storeName, [], function(R, B) {
|
|
1371
|
+
var F = B.rows.item(0).c;
|
|
1372
1372
|
m(F);
|
|
1373
|
-
}, function(R,
|
|
1374
|
-
v(
|
|
1373
|
+
}, function(R, B) {
|
|
1374
|
+
v(B);
|
|
1375
1375
|
});
|
|
1376
1376
|
});
|
|
1377
1377
|
}).catch(v);
|
|
@@ -1383,10 +1383,10 @@ var at = { exports: {} };
|
|
|
1383
1383
|
a.ready().then(function() {
|
|
1384
1384
|
var C = a._dbInfo;
|
|
1385
1385
|
C.db.transaction(function(R) {
|
|
1386
|
-
xe(R, C, "SELECT key FROM " + C.storeName + " WHERE id = ? LIMIT 1", [n + 1], function(
|
|
1386
|
+
xe(R, C, "SELECT key FROM " + C.storeName + " WHERE id = ? LIMIT 1", [n + 1], function(B, F) {
|
|
1387
1387
|
var k = F.rows.length ? F.rows.item(0).key : null;
|
|
1388
1388
|
v(k);
|
|
1389
|
-
}, function(
|
|
1389
|
+
}, function(B, F) {
|
|
1390
1390
|
o(F);
|
|
1391
1391
|
});
|
|
1392
1392
|
});
|
|
@@ -1399,12 +1399,12 @@ var at = { exports: {} };
|
|
|
1399
1399
|
i.ready().then(function() {
|
|
1400
1400
|
var o = i._dbInfo;
|
|
1401
1401
|
o.db.transaction(function(C) {
|
|
1402
|
-
xe(C, o, "SELECT key FROM " + o.storeName, [], function(R,
|
|
1403
|
-
for (var F = [], k = 0; k <
|
|
1404
|
-
F.push(
|
|
1402
|
+
xe(C, o, "SELECT key FROM " + o.storeName, [], function(R, B) {
|
|
1403
|
+
for (var F = [], k = 0; k < B.rows.length; k++)
|
|
1404
|
+
F.push(B.rows.item(k).key);
|
|
1405
1405
|
m(F);
|
|
1406
|
-
}, function(R,
|
|
1407
|
-
v(
|
|
1406
|
+
}, function(R, B) {
|
|
1407
|
+
v(B);
|
|
1408
1408
|
});
|
|
1409
1409
|
});
|
|
1410
1410
|
}).catch(v);
|
|
@@ -1442,25 +1442,25 @@ var at = { exports: {} };
|
|
|
1442
1442
|
}) : o(bt(C));
|
|
1443
1443
|
}).then(function(o) {
|
|
1444
1444
|
return new d(function(C, R) {
|
|
1445
|
-
o.db.transaction(function(
|
|
1445
|
+
o.db.transaction(function(B) {
|
|
1446
1446
|
function F(p) {
|
|
1447
1447
|
return new d(function(re, ue) {
|
|
1448
|
-
|
|
1448
|
+
B.executeSql("DROP TABLE IF EXISTS " + p, [], function() {
|
|
1449
1449
|
re();
|
|
1450
1450
|
}, function(le, ge) {
|
|
1451
1451
|
ue(ge);
|
|
1452
1452
|
});
|
|
1453
1453
|
});
|
|
1454
1454
|
}
|
|
1455
|
-
for (var k = [], q = 0,
|
|
1455
|
+
for (var k = [], q = 0, Z = o.storeNames.length; q < Z; q++)
|
|
1456
1456
|
k.push(F(o.storeNames[q]));
|
|
1457
1457
|
d.all(k).then(function() {
|
|
1458
1458
|
C();
|
|
1459
1459
|
}).catch(function(p) {
|
|
1460
1460
|
R(p);
|
|
1461
1461
|
});
|
|
1462
|
-
}, function(
|
|
1463
|
-
R(
|
|
1462
|
+
}, function(B) {
|
|
1463
|
+
R(B);
|
|
1464
1464
|
});
|
|
1465
1465
|
});
|
|
1466
1466
|
}) : v = d.reject("Invalid arguments"), h(v, i), v;
|
|
@@ -1479,7 +1479,7 @@ var at = { exports: {} };
|
|
|
1479
1479
|
keys: wt,
|
|
1480
1480
|
dropInstance: St
|
|
1481
1481
|
};
|
|
1482
|
-
function
|
|
1482
|
+
function It() {
|
|
1483
1483
|
try {
|
|
1484
1484
|
return typeof localStorage < "u" && "setItem" in localStorage && // in IE8 typeof localStorage.setItem === 'object'
|
|
1485
1485
|
!!localStorage.setItem;
|
|
@@ -1491,7 +1491,7 @@ var at = { exports: {} };
|
|
|
1491
1491
|
var a = n.name + "/";
|
|
1492
1492
|
return n.storeName !== i.storeName && (a += n.storeName + "/"), a;
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1494
|
+
function Et() {
|
|
1495
1495
|
var n = "_localforage_support_test";
|
|
1496
1496
|
try {
|
|
1497
1497
|
return localStorage.setItem(n, !0), localStorage.removeItem(n), !1;
|
|
@@ -1500,7 +1500,7 @@ var at = { exports: {} };
|
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
1502
|
function Dt() {
|
|
1503
|
-
return !
|
|
1503
|
+
return !Et() || localStorage.length > 0;
|
|
1504
1504
|
}
|
|
1505
1505
|
function xt(n) {
|
|
1506
1506
|
var i = this, a = {};
|
|
@@ -1529,11 +1529,11 @@ var at = { exports: {} };
|
|
|
1529
1529
|
}
|
|
1530
1530
|
function Ct(n, i) {
|
|
1531
1531
|
var a = this, m = a.ready().then(function() {
|
|
1532
|
-
for (var v = a._dbInfo, o = v.keyPrefix, C = o.length, R = localStorage.length,
|
|
1532
|
+
for (var v = a._dbInfo, o = v.keyPrefix, C = o.length, R = localStorage.length, B = 1, F = 0; F < R; F++) {
|
|
1533
1533
|
var k = localStorage.key(F);
|
|
1534
1534
|
if (k.indexOf(o) === 0) {
|
|
1535
1535
|
var q = localStorage.getItem(k);
|
|
1536
|
-
if (q && (q = v.serializer.deserialize(q)), q = n(q, k.substring(C),
|
|
1536
|
+
if (q && (q = v.serializer.deserialize(q)), q = n(q, k.substring(C), B++), q !== void 0)
|
|
1537
1537
|
return q;
|
|
1538
1538
|
}
|
|
1539
1539
|
}
|
|
@@ -1584,13 +1584,13 @@ var at = { exports: {} };
|
|
|
1584
1584
|
i === void 0 && (i = null);
|
|
1585
1585
|
var o = i;
|
|
1586
1586
|
return new d(function(C, R) {
|
|
1587
|
-
var
|
|
1588
|
-
|
|
1587
|
+
var B = m._dbInfo;
|
|
1588
|
+
B.serializer.serialize(i, function(F, k) {
|
|
1589
1589
|
if (k)
|
|
1590
1590
|
R(k);
|
|
1591
1591
|
else
|
|
1592
1592
|
try {
|
|
1593
|
-
localStorage.setItem(
|
|
1593
|
+
localStorage.setItem(B.keyPrefix + n, F), C(o);
|
|
1594
1594
|
} catch (q) {
|
|
1595
1595
|
(q.name === "QuotaExceededError" || q.name === "NS_ERROR_DOM_QUOTA_REACHED") && R(q), R(q);
|
|
1596
1596
|
}
|
|
@@ -1599,7 +1599,7 @@ var at = { exports: {} };
|
|
|
1599
1599
|
});
|
|
1600
1600
|
return h(v, a), v;
|
|
1601
1601
|
}
|
|
1602
|
-
function
|
|
1602
|
+
function Ut(n, i) {
|
|
1603
1603
|
if (i = y.apply(this, arguments), n = typeof n != "function" && n || {}, !n.name) {
|
|
1604
1604
|
var a = this.config();
|
|
1605
1605
|
n.name = n.name || a.name, n.storeName = n.storeName || a.storeName;
|
|
@@ -1614,10 +1614,10 @@ var at = { exports: {} };
|
|
|
1614
1614
|
}
|
|
1615
1615
|
}) : v = d.reject("Invalid arguments"), h(v, i), v;
|
|
1616
1616
|
}
|
|
1617
|
-
var
|
|
1617
|
+
var Bt = {
|
|
1618
1618
|
_driver: "localStorageWrapper",
|
|
1619
1619
|
_initStorage: xt,
|
|
1620
|
-
_support:
|
|
1620
|
+
_support: It(),
|
|
1621
1621
|
iterate: Ct,
|
|
1622
1622
|
getItem: Tt,
|
|
1623
1623
|
setItem: Rt,
|
|
@@ -1626,7 +1626,7 @@ var at = { exports: {} };
|
|
|
1626
1626
|
length: Mt,
|
|
1627
1627
|
key: Pt,
|
|
1628
1628
|
keys: Nt,
|
|
1629
|
-
dropInstance:
|
|
1629
|
+
dropInstance: Ut
|
|
1630
1630
|
}, $t = function(i, a) {
|
|
1631
1631
|
return i === a || typeof i == "number" && typeof a == "number" && isNaN(i) && isNaN(a);
|
|
1632
1632
|
}, Ft = function(i, a) {
|
|
@@ -1641,7 +1641,7 @@ var at = { exports: {} };
|
|
|
1641
1641
|
}, He = {}, kr = {}, ke = {
|
|
1642
1642
|
INDEXEDDB: lr,
|
|
1643
1643
|
WEBSQL: At,
|
|
1644
|
-
LOCALSTORAGE:
|
|
1644
|
+
LOCALSTORAGE: Bt
|
|
1645
1645
|
}, kt = [ke.INDEXEDDB._driver, ke.WEBSQL._driver, ke.LOCALSTORAGE._driver], Ke = ["dropInstance"], fr = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(Ke), Gt = {
|
|
1646
1646
|
description: "",
|
|
1647
1647
|
driver: kt.slice(),
|
|
@@ -1695,12 +1695,12 @@ var at = { exports: {} };
|
|
|
1695
1695
|
}, n.prototype.defineDriver = function(a, m, v) {
|
|
1696
1696
|
var o = new d(function(C, R) {
|
|
1697
1697
|
try {
|
|
1698
|
-
var
|
|
1698
|
+
var B = a._driver, F = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");
|
|
1699
1699
|
if (!a._driver) {
|
|
1700
1700
|
R(F);
|
|
1701
1701
|
return;
|
|
1702
1702
|
}
|
|
1703
|
-
for (var k = fr.concat("_initStorage"), q = 0,
|
|
1703
|
+
for (var k = fr.concat("_initStorage"), q = 0, Z = k.length; q < Z; q++) {
|
|
1704
1704
|
var p = k[q], re = !Ft(Ke, p);
|
|
1705
1705
|
if ((re || a[p]) && typeof a[p] != "function") {
|
|
1706
1706
|
R(F);
|
|
@@ -1708,19 +1708,19 @@ var at = { exports: {} };
|
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
1710
|
var ue = function() {
|
|
1711
|
-
for (var
|
|
1711
|
+
for (var ze = function(zt) {
|
|
1712
1712
|
return function() {
|
|
1713
|
-
var
|
|
1713
|
+
var Yt = new Error("Method " + zt + " is not implemented by the current driver"), Gr = d.reject(Yt);
|
|
1714
1714
|
return h(Gr, arguments[arguments.length - 1]), Gr;
|
|
1715
1715
|
};
|
|
1716
1716
|
}, or = 0, Ht = Ke.length; or < Ht; or++) {
|
|
1717
1717
|
var dr = Ke[or];
|
|
1718
|
-
a[dr] || (a[dr] =
|
|
1718
|
+
a[dr] || (a[dr] = ze(dr));
|
|
1719
1719
|
}
|
|
1720
1720
|
};
|
|
1721
1721
|
ue();
|
|
1722
|
-
var le = function(
|
|
1723
|
-
He[
|
|
1722
|
+
var le = function(ze) {
|
|
1723
|
+
He[B] && console.info("Redefining LocalForage driver: " + B), He[B] = a, kr[B] = ze, C();
|
|
1724
1724
|
};
|
|
1725
1725
|
"_support" in a ? a._support && typeof a._support == "function" ? a._support().then(le, R) : le(!!a._support) : le(!0);
|
|
1726
1726
|
} catch (ge) {
|
|
@@ -1748,16 +1748,16 @@ var at = { exports: {} };
|
|
|
1748
1748
|
function R() {
|
|
1749
1749
|
o._config.driver = o.driver();
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function B(q) {
|
|
1752
1752
|
return o._extend(q), R(), o._ready = o._initStorage(o._config), o._ready;
|
|
1753
1753
|
}
|
|
1754
1754
|
function F(q) {
|
|
1755
1755
|
return function() {
|
|
1756
|
-
var
|
|
1756
|
+
var Z = 0;
|
|
1757
1757
|
function p() {
|
|
1758
|
-
for (;
|
|
1759
|
-
var re = q[
|
|
1760
|
-
return
|
|
1758
|
+
for (; Z < q.length; ) {
|
|
1759
|
+
var re = q[Z];
|
|
1760
|
+
return Z++, o._dbInfo = null, o._ready = null, o.getDriver(re).then(B).catch(p);
|
|
1761
1761
|
}
|
|
1762
1762
|
R();
|
|
1763
1763
|
var ue = new Error("No available storage method found.");
|
|
@@ -1771,8 +1771,8 @@ var at = { exports: {} };
|
|
|
1771
1771
|
}) : d.resolve();
|
|
1772
1772
|
return this._driverSet = k.then(function() {
|
|
1773
1773
|
var q = C[0];
|
|
1774
|
-
return o._dbInfo = null, o._ready = null, o.getDriver(q).then(function(
|
|
1775
|
-
o._driver =
|
|
1774
|
+
return o._dbInfo = null, o._ready = null, o.getDriver(q).then(function(Z) {
|
|
1775
|
+
o._driver = Z._driver, R(), o._wrapLibraryMethodsWithReady(), o._initDriver = F(C);
|
|
1776
1776
|
});
|
|
1777
1777
|
}).catch(function() {
|
|
1778
1778
|
R();
|
|
@@ -1796,7 +1796,7 @@ var at = { exports: {} };
|
|
|
1796
1796
|
return new n(a);
|
|
1797
1797
|
}, n;
|
|
1798
1798
|
}(), Vt = new qt();
|
|
1799
|
-
|
|
1799
|
+
S.exports = Vt;
|
|
1800
1800
|
}, { 3: 3 }] }, {}, [4])(4);
|
|
1801
1801
|
});
|
|
1802
1802
|
})(at);
|
|
@@ -1846,14 +1846,14 @@ function va() {
|
|
|
1846
1846
|
async function l(s) {
|
|
1847
1847
|
return await me().removeItem(s);
|
|
1848
1848
|
}
|
|
1849
|
-
async function
|
|
1849
|
+
async function S(s, g) {
|
|
1850
1850
|
await me().setItem(g, s);
|
|
1851
1851
|
}
|
|
1852
1852
|
return {
|
|
1853
1853
|
clearAsync: e,
|
|
1854
1854
|
getAsync: t,
|
|
1855
1855
|
removeAsync: l,
|
|
1856
|
-
saveAsync:
|
|
1856
|
+
saveAsync: S
|
|
1857
1857
|
};
|
|
1858
1858
|
}
|
|
1859
1859
|
let er;
|
|
@@ -1870,8 +1870,8 @@ function bn(e) {
|
|
|
1870
1870
|
}), er;
|
|
1871
1871
|
}
|
|
1872
1872
|
function Sn(e) {
|
|
1873
|
-
var t, l,
|
|
1874
|
-
if (e.storeMode ?? (e.storeMode = ((l = (t = e.navigation) == null ? void 0 : t.findItem(e.nav)) == null ? void 0 : l.storeMode) ?? "session"), e.storageMode ?? (e.storageMode = ((s = (
|
|
1873
|
+
var t, l, S, s, g;
|
|
1874
|
+
if (e.storeMode ?? (e.storeMode = ((l = (t = e.navigation) == null ? void 0 : t.findItem(e.nav)) == null ? void 0 : l.storeMode) ?? "session"), e.storageMode ?? (e.storageMode = ((s = (S = e.navigation) == null ? void 0 : S.findItem(e.nav)) == null ? void 0 : s.storageMode) ?? "local-cache"), e.storeName ?? (e.storeName = ((g = e.navigation) == null ? void 0 : g.findStoreName(e.nav)) ?? e.nav), e.storeName == null)
|
|
1875
1875
|
throw new Error("no store name provided");
|
|
1876
1876
|
if (e.storeMode == "whole-last-updated") {
|
|
1877
1877
|
if (e.api == null)
|
|
@@ -1882,35 +1882,35 @@ function Sn(e) {
|
|
|
1882
1882
|
throw new Error("Must supply an api object to use store");
|
|
1883
1883
|
return Vr({ ...e, storeName: e.storeName ?? "" });
|
|
1884
1884
|
} else
|
|
1885
|
-
return
|
|
1885
|
+
return In({ ...e, storeName: e.storeName ?? "" });
|
|
1886
1886
|
}
|
|
1887
1887
|
const An = (e) => {
|
|
1888
1888
|
let t = K(e.url) ?? void 0;
|
|
1889
|
-
if (e.additionalUrl != null && (t == null ? t = e.additionalUrl : t =
|
|
1889
|
+
if (e.additionalUrl != null && (t == null ? t = e.additionalUrl : t = Be(t, e.additionalUrl)), e.id != null && (t != null && t.includes("{id}") ? t = t.replaceAll("{id}", e.id) : t = Be(t, e.id)), e.params != null) {
|
|
1890
1890
|
t ?? (t = "");
|
|
1891
1891
|
let l = new URLSearchParams();
|
|
1892
|
-
Object.entries(e.params).sort(
|
|
1892
|
+
Object.entries(e.params).sort(Ue.firstBy((s) => s[0])).forEach((s) => {
|
|
1893
1893
|
s[1] != null && l.append(s[0], s[1].toString());
|
|
1894
1894
|
}), t = `${t}?${l.toString()}`;
|
|
1895
1895
|
}
|
|
1896
1896
|
return e.finalUrl = t, e.finalUrl ?? "";
|
|
1897
1897
|
};
|
|
1898
|
-
function
|
|
1898
|
+
function In(e) {
|
|
1899
1899
|
return et(e.storeName, () => {
|
|
1900
1900
|
var u;
|
|
1901
|
-
const t = de.utc().toSeconds() / 86400, l =
|
|
1901
|
+
const t = de.utc().toSeconds() / 86400, l = z({}), S = z({}), s = e.storageMode == "local-cache", g = e.buildUrl ?? ((u = e.api) == null ? void 0 : u.buildUrl) ?? An;
|
|
1902
1902
|
function x(r) {
|
|
1903
|
-
var c,
|
|
1903
|
+
var c, I;
|
|
1904
1904
|
let y = "";
|
|
1905
|
-
const
|
|
1906
|
-
return
|
|
1905
|
+
const D = r.params ?? {};
|
|
1906
|
+
return D != null && (y = Object.entries(D).sort(Ue.firstBy((w) => w[0])).map((w) => `${w[0]}=${JSON.stringify(w[1])}`).join("&")), `${e.storeName ?? "base"}_${((c = e.auth) == null ? void 0 : c.credentials.value.userID) ?? "no-user-id"}_${r.id ?? ((I = r.data) == null ? void 0 : I.id) ?? "no-item-id"}_${y ?? "no-params"}`;
|
|
1907
1907
|
}
|
|
1908
1908
|
async function P(r) {
|
|
1909
1909
|
r.additionalUrl ?? (r.additionalUrl = "/getAll"), g(r);
|
|
1910
|
-
const y = x(r),
|
|
1911
|
-
if (!
|
|
1910
|
+
const y = x(r), D = r.refresh;
|
|
1911
|
+
if (!D && l.value[y] !== void 0)
|
|
1912
1912
|
return l.value[y];
|
|
1913
|
-
if (!
|
|
1913
|
+
if (!D && s == !0) {
|
|
1914
1914
|
const c = await me().getItem(y);
|
|
1915
1915
|
if (c != null && (e.api == null || parseFloat(c.meta.storedOn) > t - 7))
|
|
1916
1916
|
return l.value[y] = c, c;
|
|
@@ -1918,40 +1918,39 @@ function En(e) {
|
|
|
1918
1918
|
if (e.api == null)
|
|
1919
1919
|
return l.value[y];
|
|
1920
1920
|
try {
|
|
1921
|
-
let c =
|
|
1922
|
-
c == null && (c = new Promise(async (
|
|
1923
|
-
var
|
|
1921
|
+
let c = S.value[y];
|
|
1922
|
+
c == null && (c = new Promise(async (w, M) => {
|
|
1923
|
+
var b;
|
|
1924
1924
|
try {
|
|
1925
|
-
const _ = await ((
|
|
1925
|
+
const _ = await ((b = e.api) == null ? void 0 : b.getAll(r)), E = {
|
|
1926
1926
|
meta: { storedOn: t.toString() },
|
|
1927
1927
|
data: _ == null ? void 0 : _.data,
|
|
1928
1928
|
count: _ == null ? void 0 : _.count,
|
|
1929
1929
|
filters: (_ == null ? void 0 : _.filters) ?? []
|
|
1930
1930
|
};
|
|
1931
|
-
s == !0 && await me().setItem(y,
|
|
1931
|
+
s == !0 && await me().setItem(y, E), w(E);
|
|
1932
1932
|
} catch (_) {
|
|
1933
|
-
|
|
1933
|
+
M(_);
|
|
1934
1934
|
} finally {
|
|
1935
|
-
delete
|
|
1935
|
+
delete S.value[y];
|
|
1936
1936
|
}
|
|
1937
|
-
}),
|
|
1938
|
-
const
|
|
1939
|
-
return l.value[y] =
|
|
1940
|
-
data:
|
|
1941
|
-
filters:
|
|
1942
|
-
count:
|
|
1937
|
+
}), S.value[y] = c);
|
|
1938
|
+
const I = await c;
|
|
1939
|
+
return l.value[y] = I, {
|
|
1940
|
+
data: I == null ? void 0 : I.data,
|
|
1941
|
+
filters: I == null ? void 0 : I.filters,
|
|
1942
|
+
count: I == null ? void 0 : I.count
|
|
1943
1943
|
};
|
|
1944
1944
|
} catch (c) {
|
|
1945
|
-
|
|
1946
|
-
throw new Error(S.message ?? "Problem");
|
|
1945
|
+
throw c;
|
|
1947
1946
|
}
|
|
1948
1947
|
}
|
|
1949
1948
|
async function T(r) {
|
|
1950
1949
|
r.additionalUrl ?? (r.additionalUrl = "/get"), g(r);
|
|
1951
|
-
const y = x(r),
|
|
1952
|
-
if (!
|
|
1950
|
+
const y = x(r), D = r.refresh;
|
|
1951
|
+
if (!D && l.value[y] !== void 0)
|
|
1953
1952
|
return l.value[y];
|
|
1954
|
-
if (!
|
|
1953
|
+
if (!D && s == !0) {
|
|
1955
1954
|
const c = await me().getItem(y);
|
|
1956
1955
|
if (c != null && (e.api == null || parseFloat(c.meta.storedOn) > t - 7))
|
|
1957
1956
|
return l.value[y] = c, { data: c.data };
|
|
@@ -1959,83 +1958,80 @@ function En(e) {
|
|
|
1959
1958
|
if (e.api == null)
|
|
1960
1959
|
return l.value[y];
|
|
1961
1960
|
try {
|
|
1962
|
-
let c =
|
|
1963
|
-
c == null && (c = new Promise(async (
|
|
1964
|
-
var
|
|
1961
|
+
let c = S.value[y];
|
|
1962
|
+
c == null && (c = new Promise(async (w, M) => {
|
|
1963
|
+
var b;
|
|
1965
1964
|
try {
|
|
1966
|
-
let _ = await ((
|
|
1967
|
-
const
|
|
1965
|
+
let _ = await ((b = e.api) == null ? void 0 : b.get(r));
|
|
1966
|
+
const E = {
|
|
1968
1967
|
meta: { storedOn: t.toString() },
|
|
1969
1968
|
data: _ == null ? void 0 : _.data
|
|
1970
1969
|
};
|
|
1971
|
-
s == !0 && await me().setItem(y,
|
|
1970
|
+
s == !0 && await me().setItem(y, E), w(E);
|
|
1972
1971
|
} catch (_) {
|
|
1973
|
-
|
|
1972
|
+
M(_);
|
|
1974
1973
|
} finally {
|
|
1975
|
-
delete
|
|
1974
|
+
delete S.value[y];
|
|
1976
1975
|
}
|
|
1977
|
-
}),
|
|
1978
|
-
const
|
|
1979
|
-
return l.value[y] =
|
|
1976
|
+
}), S.value[y] = c);
|
|
1977
|
+
const I = await c;
|
|
1978
|
+
return l.value[y] = I, { data: I.data };
|
|
1980
1979
|
} catch (c) {
|
|
1981
|
-
|
|
1982
|
-
throw new Error(S.message ?? "Problem");
|
|
1980
|
+
throw c;
|
|
1983
1981
|
}
|
|
1984
1982
|
}
|
|
1985
1983
|
async function N(r) {
|
|
1986
1984
|
var c;
|
|
1987
1985
|
r.additionalUrl ?? (r.additionalUrl = "/patch"), g(r);
|
|
1988
1986
|
const y = x(r);
|
|
1989
|
-
let
|
|
1987
|
+
let D;
|
|
1990
1988
|
if (e.api != null)
|
|
1991
1989
|
try {
|
|
1992
|
-
let
|
|
1993
|
-
|
|
1994
|
-
} catch (
|
|
1995
|
-
|
|
1996
|
-
throw new Error(E.message ?? "Patch Problem");
|
|
1990
|
+
let I = await e.api.patch(r);
|
|
1991
|
+
D = I == null ? void 0 : I.data;
|
|
1992
|
+
} catch (I) {
|
|
1993
|
+
throw I;
|
|
1997
1994
|
}
|
|
1998
1995
|
else
|
|
1999
|
-
|
|
2000
|
-
if (
|
|
2001
|
-
let
|
|
1996
|
+
D = r.data;
|
|
1997
|
+
if (D != null) {
|
|
1998
|
+
let I = {
|
|
2002
1999
|
meta: { storedOn: t.toString() },
|
|
2003
|
-
data: { ...(c = l.value[y]) == null ? void 0 : c.data, ...
|
|
2000
|
+
data: { ...(c = l.value[y]) == null ? void 0 : c.data, ...D }
|
|
2004
2001
|
};
|
|
2005
|
-
return l.value[y] =
|
|
2006
|
-
const
|
|
2007
|
-
if (
|
|
2008
|
-
if (Array.isArray(
|
|
2009
|
-
for (let _ = 0; _ <
|
|
2010
|
-
|
|
2002
|
+
return l.value[y] = I, s == !0 && await me().setItem(y, I), D.id != null && D.rowVersion != null && Object.entries(l.value).forEach((M) => {
|
|
2003
|
+
const b = M[1].data;
|
|
2004
|
+
if (b != null)
|
|
2005
|
+
if (Array.isArray(b))
|
|
2006
|
+
for (let _ = 0; _ < b.length; _++)
|
|
2007
|
+
b[_].id == D.id && b.splice(_, 1, I.data);
|
|
2011
2008
|
else
|
|
2012
|
-
|
|
2013
|
-
}),
|
|
2009
|
+
b.id == D.id && (l.value[M[0]] = I);
|
|
2010
|
+
}), I.data;
|
|
2014
2011
|
}
|
|
2015
|
-
return
|
|
2012
|
+
return D;
|
|
2016
2013
|
}
|
|
2017
2014
|
async function $(r) {
|
|
2018
2015
|
r.additionalUrl ?? (r.additionalUrl = "/post"), g(r);
|
|
2019
2016
|
const y = x(r);
|
|
2020
|
-
let
|
|
2017
|
+
let D;
|
|
2021
2018
|
if (e.api != null)
|
|
2022
2019
|
try {
|
|
2023
2020
|
let c = await e.api.post(r);
|
|
2024
|
-
|
|
2021
|
+
D = c == null ? void 0 : c.data;
|
|
2025
2022
|
} catch (c) {
|
|
2026
|
-
|
|
2027
|
-
throw new Error(S.message ?? "Patch Problem");
|
|
2023
|
+
throw c;
|
|
2028
2024
|
}
|
|
2029
2025
|
else
|
|
2030
|
-
|
|
2031
|
-
if (
|
|
2026
|
+
D = r.data;
|
|
2027
|
+
if (D != null) {
|
|
2032
2028
|
let c = {
|
|
2033
2029
|
meta: { storedOn: t.toString() },
|
|
2034
|
-
data:
|
|
2030
|
+
data: D
|
|
2035
2031
|
};
|
|
2036
2032
|
return s == !0 && await me().setItem(y, c), l.value[y] = c, c.data;
|
|
2037
2033
|
}
|
|
2038
|
-
return
|
|
2034
|
+
return D;
|
|
2039
2035
|
}
|
|
2040
2036
|
async function d(r) {
|
|
2041
2037
|
var c;
|
|
@@ -2043,23 +2039,22 @@ function En(e) {
|
|
|
2043
2039
|
const y = x(r);
|
|
2044
2040
|
if (e.api != null)
|
|
2045
2041
|
try {
|
|
2046
|
-
let
|
|
2047
|
-
if (
|
|
2048
|
-
return
|
|
2049
|
-
} catch (
|
|
2050
|
-
|
|
2051
|
-
throw new Error(E.message ?? "Patch Problem");
|
|
2042
|
+
let I = await e.api.deleteItem(r);
|
|
2043
|
+
if (I != null)
|
|
2044
|
+
return I;
|
|
2045
|
+
} catch (I) {
|
|
2046
|
+
throw I;
|
|
2052
2047
|
}
|
|
2053
2048
|
delete l.value[y];
|
|
2054
|
-
const
|
|
2055
|
-
|
|
2056
|
-
const
|
|
2057
|
-
if (
|
|
2058
|
-
if (Array.isArray(
|
|
2059
|
-
for (let
|
|
2060
|
-
|
|
2049
|
+
const D = ((c = r.data) == null ? void 0 : c.id) ?? r.id;
|
|
2050
|
+
D != null && Object.entries(l.value).forEach((w) => {
|
|
2051
|
+
const M = w[1].data;
|
|
2052
|
+
if (M != null)
|
|
2053
|
+
if (Array.isArray(M))
|
|
2054
|
+
for (let b = 0; b < M.length; b++)
|
|
2055
|
+
M[b].id == D && M.splice(b, 1);
|
|
2061
2056
|
else
|
|
2062
|
-
delete l.value[
|
|
2057
|
+
delete l.value[w[0]];
|
|
2063
2058
|
}), s == !0 && await me().removeItem(y);
|
|
2064
2059
|
}
|
|
2065
2060
|
async function h(r) {
|
|
@@ -2068,8 +2063,7 @@ function En(e) {
|
|
|
2068
2063
|
let y = await e.api.patch(r);
|
|
2069
2064
|
return y == null ? void 0 : y.data;
|
|
2070
2065
|
} catch (y) {
|
|
2071
|
-
|
|
2072
|
-
throw new Error(I.message ?? "Patch Problem");
|
|
2066
|
+
throw y;
|
|
2073
2067
|
}
|
|
2074
2068
|
}
|
|
2075
2069
|
return {
|
|
@@ -2086,7 +2080,7 @@ function En(e) {
|
|
|
2086
2080
|
}
|
|
2087
2081
|
function Vr(e) {
|
|
2088
2082
|
return et(e.storeName, () => {
|
|
2089
|
-
const t =
|
|
2083
|
+
const t = z(), l = z(0), S = de.utc().toSeconds() / 3600, s = z(), g = z(), x = z({}), P = e.storageMode == "local-cache";
|
|
2090
2084
|
function T() {
|
|
2091
2085
|
var c;
|
|
2092
2086
|
return `${e.storeName}_${((c = e.auth) == null ? void 0 : c.credentials.value.userID) ?? "no-user-id"}`;
|
|
@@ -2100,46 +2094,46 @@ function Vr(e) {
|
|
|
2100
2094
|
});
|
|
2101
2095
|
}
|
|
2102
2096
|
function $(c) {
|
|
2103
|
-
const
|
|
2104
|
-
return x.value[
|
|
2105
|
-
var
|
|
2097
|
+
const I = T();
|
|
2098
|
+
return x.value[I] || (x.value[I] = new Promise(async (w, M) => {
|
|
2099
|
+
var b, _;
|
|
2106
2100
|
try {
|
|
2107
|
-
let
|
|
2101
|
+
let E = await ((_ = e.api) == null ? void 0 : _.getAll({
|
|
2108
2102
|
additionalUrl: "/getAll",
|
|
2109
2103
|
nav: c.nav,
|
|
2110
2104
|
params: {
|
|
2111
|
-
lastUpdate: ((
|
|
2105
|
+
lastUpdate: ((b = g.value) == null ? void 0 : b.lastUpdate) ?? un()
|
|
2112
2106
|
}
|
|
2113
2107
|
}));
|
|
2114
|
-
|
|
2108
|
+
E == null ? M(E) : (t.value ?? (t.value = []), E.data.forEach((L) => {
|
|
2115
2109
|
var A, J;
|
|
2116
|
-
const f = t.value.findIndex((Q) => Q.id ==
|
|
2117
|
-
f >= 0 ? (A = t.value) == null || A.splice(f, 1,
|
|
2110
|
+
const f = t.value.findIndex((Q) => Q.id == L.id);
|
|
2111
|
+
f >= 0 ? (A = t.value) == null || A.splice(f, 1, L) : (J = t.value) == null || J.push(L);
|
|
2118
2112
|
}), l.value = t.value.length, g.value = {
|
|
2119
2113
|
lastUpdate: de.utc().toString(),
|
|
2120
|
-
storedOn:
|
|
2121
|
-
}, await N(), E
|
|
2122
|
-
} catch (
|
|
2123
|
-
|
|
2114
|
+
storedOn: S.toString()
|
|
2115
|
+
}, await N(), w(E));
|
|
2116
|
+
} catch (E) {
|
|
2117
|
+
M(E);
|
|
2124
2118
|
} finally {
|
|
2125
|
-
delete x.value[
|
|
2119
|
+
delete x.value[I];
|
|
2126
2120
|
}
|
|
2127
|
-
})), x.value[
|
|
2121
|
+
})), x.value[I];
|
|
2128
2122
|
}
|
|
2129
2123
|
async function d(c) {
|
|
2130
|
-
var
|
|
2131
|
-
const
|
|
2132
|
-
if (!
|
|
2124
|
+
var M, b, _;
|
|
2125
|
+
const I = T(), w = c.refresh;
|
|
2126
|
+
if (!w && t.value != null)
|
|
2133
2127
|
return {
|
|
2134
|
-
count: (
|
|
2128
|
+
count: (M = t.value) == null ? void 0 : M.length,
|
|
2135
2129
|
data: t.value,
|
|
2136
2130
|
filters: []
|
|
2137
2131
|
};
|
|
2138
|
-
if (!
|
|
2139
|
-
const
|
|
2140
|
-
if (
|
|
2141
|
-
return t.value =
|
|
2142
|
-
count: (
|
|
2132
|
+
if (!w && P == !0) {
|
|
2133
|
+
const E = await me().getItem(I);
|
|
2134
|
+
if (E != null && parseFloat(E.meta.storedOn) > S - 7)
|
|
2135
|
+
return t.value = E.data, l.value = E.data.length, s.value = E.filters ?? [], g.value = E.meta, {
|
|
2136
|
+
count: (b = t.value) == null ? void 0 : b.length,
|
|
2143
2137
|
data: t.value ?? [],
|
|
2144
2138
|
filters: []
|
|
2145
2139
|
};
|
|
@@ -2153,25 +2147,25 @@ function Vr(e) {
|
|
|
2153
2147
|
t.value ?? (t.value = []);
|
|
2154
2148
|
try {
|
|
2155
2149
|
return await $(c);
|
|
2156
|
-
} catch (
|
|
2157
|
-
let
|
|
2158
|
-
throw new Error(
|
|
2150
|
+
} catch (E) {
|
|
2151
|
+
let L = E;
|
|
2152
|
+
throw new Error(L.message ?? "Problem");
|
|
2159
2153
|
}
|
|
2160
2154
|
}
|
|
2161
2155
|
async function h(c) {
|
|
2162
|
-
var
|
|
2163
|
-
const
|
|
2164
|
-
if (
|
|
2156
|
+
var b, _, E, L;
|
|
2157
|
+
const I = T(), w = c.id ?? ((b = c.data) == null ? void 0 : b.id);
|
|
2158
|
+
if (w == null)
|
|
2165
2159
|
throw new Error("no id provided");
|
|
2166
|
-
let
|
|
2167
|
-
if (!
|
|
2168
|
-
const f = t.value.find((A) => A.id ==
|
|
2160
|
+
let M = c.refresh;
|
|
2161
|
+
if (!M && t.value != null) {
|
|
2162
|
+
const f = t.value.find((A) => A.id == w);
|
|
2169
2163
|
if (f != null)
|
|
2170
2164
|
return { data: f };
|
|
2171
2165
|
}
|
|
2172
|
-
if (!
|
|
2173
|
-
const f = await me().getItem(
|
|
2174
|
-
if (f != null && parseFloat(f.meta.storedOn) >
|
|
2166
|
+
if (!M && P == !0) {
|
|
2167
|
+
const f = await me().getItem(I);
|
|
2168
|
+
if (f != null && parseFloat(f.meta.storedOn) > S - 12) {
|
|
2175
2169
|
t.value = f.data, l.value = f.data.length, s.value = f.filters ?? [], g.value = f.meta;
|
|
2176
2170
|
let A = (_ = t.value) == null ? void 0 : _.find((J) => J.id == c.id);
|
|
2177
2171
|
if (A != null)
|
|
@@ -2180,85 +2174,85 @@ function Vr(e) {
|
|
|
2180
2174
|
}
|
|
2181
2175
|
if (e.api == null)
|
|
2182
2176
|
return {
|
|
2183
|
-
data: (
|
|
2177
|
+
data: (E = t.value) == null ? void 0 : E.find((f) => f.id == c.id)
|
|
2184
2178
|
};
|
|
2185
2179
|
t.value ?? (t.value = []);
|
|
2186
2180
|
try {
|
|
2187
|
-
return await $(c), { data: (
|
|
2181
|
+
return await $(c), { data: (L = t.value) == null ? void 0 : L.find((f) => f.id == c.id) };
|
|
2188
2182
|
} catch (f) {
|
|
2189
2183
|
let A = f;
|
|
2190
2184
|
throw new Error(A.message ?? "Problem");
|
|
2191
2185
|
}
|
|
2192
2186
|
}
|
|
2193
2187
|
async function u(c) {
|
|
2194
|
-
var
|
|
2188
|
+
var w, M, b;
|
|
2195
2189
|
c.additionalUrl ?? (c.additionalUrl = "/patch");
|
|
2196
|
-
let
|
|
2190
|
+
let I;
|
|
2197
2191
|
if (e.api != null)
|
|
2198
2192
|
try {
|
|
2199
2193
|
let _ = await e.api.patch(c);
|
|
2200
|
-
|
|
2194
|
+
I = { ...c.data, ..._ == null ? void 0 : _.data };
|
|
2201
2195
|
} catch (_) {
|
|
2202
|
-
let
|
|
2203
|
-
throw new Error(
|
|
2196
|
+
let E = _;
|
|
2197
|
+
throw new Error(E.message ?? "Patch Problem");
|
|
2204
2198
|
}
|
|
2205
2199
|
else
|
|
2206
|
-
|
|
2207
|
-
if (
|
|
2208
|
-
let _ = (
|
|
2209
|
-
_ != null && _ >= 0 && (t.value ?? (t.value = []), (
|
|
2200
|
+
I = c.data;
|
|
2201
|
+
if (I != null) {
|
|
2202
|
+
let _ = (w = t.value) == null ? void 0 : w.findIndex((E) => E.id == I.id);
|
|
2203
|
+
_ != null && _ >= 0 && (t.value ?? (t.value = []), (M = t.value) == null || M.splice(_, 1, I), await N());
|
|
2210
2204
|
}
|
|
2211
|
-
return (
|
|
2205
|
+
return (b = t.value) == null ? void 0 : b.find((_) => _.id == (c.id ?? c.data.id));
|
|
2212
2206
|
}
|
|
2213
2207
|
async function r(c) {
|
|
2214
|
-
var
|
|
2208
|
+
var w, M;
|
|
2215
2209
|
c.additionalUrl ?? (c.additionalUrl = "/post");
|
|
2216
|
-
let
|
|
2210
|
+
let I;
|
|
2217
2211
|
if (e.api != null)
|
|
2218
2212
|
try {
|
|
2219
|
-
let
|
|
2220
|
-
|
|
2221
|
-
} catch (
|
|
2222
|
-
let _ =
|
|
2213
|
+
let b = await e.api.post(c);
|
|
2214
|
+
I = b == null ? void 0 : b.data;
|
|
2215
|
+
} catch (b) {
|
|
2216
|
+
let _ = b;
|
|
2223
2217
|
throw new Error(_.message ?? "Patch Problem");
|
|
2224
2218
|
}
|
|
2225
2219
|
else
|
|
2226
|
-
|
|
2227
|
-
return
|
|
2220
|
+
I = c.data;
|
|
2221
|
+
return I != null && (t.value ?? (t.value = []), (w = t.value) == null || w.unshift(I), l.value += 1, await N()), (M = t.value) == null ? void 0 : M.find((b) => b.id == (c.id ?? c.data.id));
|
|
2228
2222
|
}
|
|
2229
2223
|
async function y(c) {
|
|
2230
|
-
var
|
|
2224
|
+
var w, M;
|
|
2231
2225
|
if (c.additionalUrl ?? (c.additionalUrl = "/delete"), e.api != null)
|
|
2232
2226
|
try {
|
|
2233
|
-
let
|
|
2234
|
-
if (
|
|
2235
|
-
return
|
|
2236
|
-
} catch (
|
|
2237
|
-
let _ =
|
|
2227
|
+
let b = await e.api.deleteItem(c);
|
|
2228
|
+
if (b != null)
|
|
2229
|
+
return b;
|
|
2230
|
+
} catch (b) {
|
|
2231
|
+
let _ = b;
|
|
2238
2232
|
throw new Error(_.message ?? "Patch Problem");
|
|
2239
2233
|
}
|
|
2240
|
-
const
|
|
2241
|
-
if (
|
|
2242
|
-
let
|
|
2243
|
-
|
|
2234
|
+
const I = c.id ?? c.data.id;
|
|
2235
|
+
if (I != null) {
|
|
2236
|
+
let b = (w = t.value) == null ? void 0 : w.findIndex((_) => _.id == I);
|
|
2237
|
+
b != null && b >= 0 && (t.value ?? (t.value = []), (M = t.value) == null || M.splice(b, 1), await N());
|
|
2244
2238
|
}
|
|
2245
2239
|
}
|
|
2246
|
-
async function
|
|
2247
|
-
var
|
|
2240
|
+
async function D(c) {
|
|
2241
|
+
var I;
|
|
2248
2242
|
if (c.additionalUrl ?? (c.additionalUrl = `/patch/restore?id=${c.data.id}`), e.api != null)
|
|
2249
2243
|
try {
|
|
2250
2244
|
await e.api.patch(c);
|
|
2251
|
-
} catch (
|
|
2252
|
-
let
|
|
2253
|
-
throw new Error(
|
|
2245
|
+
} catch (w) {
|
|
2246
|
+
let M = w;
|
|
2247
|
+
throw new Error(M.message ?? "Patch Problem");
|
|
2254
2248
|
}
|
|
2255
2249
|
try {
|
|
2256
2250
|
c.additionalUrl = "/getAll", await $(c);
|
|
2257
|
-
} catch (
|
|
2258
|
-
let
|
|
2259
|
-
throw new Error(
|
|
2251
|
+
} catch (w) {
|
|
2252
|
+
let M = w;
|
|
2253
|
+
throw new Error(M.message ?? "Problem");
|
|
2260
2254
|
}
|
|
2261
|
-
return (
|
|
2255
|
+
return (I = t.value) == null ? void 0 : I.find((w) => w.id == (c.id ?? c.data.id));
|
|
2262
2256
|
}
|
|
2263
2257
|
return {
|
|
2264
2258
|
deleteItem: y,
|
|
@@ -2266,16 +2260,16 @@ function Vr(e) {
|
|
|
2266
2260
|
getAll: d,
|
|
2267
2261
|
patch: u,
|
|
2268
2262
|
post: r,
|
|
2269
|
-
restore:
|
|
2263
|
+
restore: D
|
|
2270
2264
|
};
|
|
2271
2265
|
});
|
|
2272
2266
|
}
|
|
2273
2267
|
let Ar;
|
|
2274
|
-
function
|
|
2268
|
+
function Ir() {
|
|
2275
2269
|
return Ar;
|
|
2276
2270
|
}
|
|
2277
|
-
function
|
|
2278
|
-
const t = (e == null ? void 0 : e.buildHeaders) ?? P, l = (e == null ? void 0 : e.buildQuery) ?? g,
|
|
2271
|
+
function En(e) {
|
|
2272
|
+
const t = (e == null ? void 0 : e.buildHeaders) ?? P, l = (e == null ? void 0 : e.buildQuery) ?? g, S = (e == null ? void 0 : e.buildUrl) ?? x, s = e == null ? void 0 : e.demo;
|
|
2279
2273
|
function g(u) {
|
|
2280
2274
|
let r = new URLSearchParams();
|
|
2281
2275
|
return Object.entries(u).forEach((y) => {
|
|
@@ -2286,157 +2280,187 @@ function In(e) {
|
|
|
2286
2280
|
}
|
|
2287
2281
|
function x(u) {
|
|
2288
2282
|
let r = K(u.url) ?? void 0, y = K(u.id);
|
|
2289
|
-
return r == null && (e == null ? void 0 : e.findPath) != null && (r = e.findPath(u.nav)), u.additionalUrl != null && (r == null ? r = u.additionalUrl : r =
|
|
2283
|
+
return r == null && (e == null ? void 0 : e.findPath) != null && (r = e.findPath(u.nav)), u.additionalUrl != null && (r == null ? r = u.additionalUrl : r = Be(r, u.additionalUrl)), y != null && (r != null && r.includes("{id}") ? r = r.replaceAll("{id}", y) : r = Be(r, y)), u.params != null && (r = `${r}?${l(u.params)}`), u.finalUrl = r, u.finalUrl ?? "";
|
|
2290
2284
|
}
|
|
2291
2285
|
function P(u) {
|
|
2292
|
-
var y,
|
|
2286
|
+
var y, D;
|
|
2293
2287
|
let r = { ...u.headers };
|
|
2294
|
-
return u.proxyID && (r.ManagedCompanyAccountID ?? (r.ManagedCompanyAccountID = u.proxyID)), (e == null ? void 0 : e.useBearerToken) != !1 && ((y = e == null ? void 0 : e.auth) == null ? void 0 : y.isLoggedIn.value) == !0 && (r.authorization ?? (r.authorization = `bearer ${(
|
|
2288
|
+
return u.proxyID && (r.ManagedCompanyAccountID ?? (r.ManagedCompanyAccountID = u.proxyID)), (e == null ? void 0 : e.useBearerToken) != !1 && ((y = e == null ? void 0 : e.auth) == null ? void 0 : y.isLoggedIn.value) == !0 && (r.authorization ?? (r.authorization = `bearer ${(D = e == null ? void 0 : e.auth) == null ? void 0 : D.credentials.value.token}`)), r["Content-Type"] ?? (r["Content-Type"] = u.contentType ?? (e == null ? void 0 : e.defaultContentType) ?? "application/json"), r;
|
|
2295
2289
|
}
|
|
2296
2290
|
async function T(u) {
|
|
2297
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0,
|
|
2298
|
-
let c = u.finalUrl,
|
|
2299
|
-
if (c == null && (c =
|
|
2291
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2292
|
+
let c = u.finalUrl, I = u.headers;
|
|
2293
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (I = t(u)), s != null && s.isDemoing.value)
|
|
2300
2294
|
return console.log(`DEMO: Get from ${c}`), s.get(u);
|
|
2301
2295
|
console.log(`Get from ${c}`);
|
|
2302
|
-
let
|
|
2296
|
+
let w;
|
|
2303
2297
|
try {
|
|
2304
|
-
if (
|
|
2298
|
+
if (w = await fetch(c, {
|
|
2305
2299
|
method: "GET",
|
|
2306
2300
|
mode: "cors",
|
|
2307
2301
|
cache: "no-cache",
|
|
2308
|
-
headers:
|
|
2309
|
-
}), !
|
|
2310
|
-
|
|
2311
|
-
|
|
2302
|
+
headers: I
|
|
2303
|
+
}), !w.ok) {
|
|
2304
|
+
if (w.status == 401)
|
|
2305
|
+
throw {
|
|
2306
|
+
code: w.status,
|
|
2307
|
+
name: "Unauthorized",
|
|
2308
|
+
message: w.statusText
|
|
2309
|
+
};
|
|
2310
|
+
let M = await w.text();
|
|
2311
|
+
throw new Error(M ?? w.statusText ?? "Get error");
|
|
2312
2312
|
}
|
|
2313
|
-
if (
|
|
2314
|
-
return await
|
|
2313
|
+
if (D)
|
|
2314
|
+
return await w.text();
|
|
2315
2315
|
if (y)
|
|
2316
|
-
return await
|
|
2316
|
+
return await w.json();
|
|
2317
2317
|
throw new Error();
|
|
2318
|
-
} catch (
|
|
2319
|
-
const
|
|
2318
|
+
} catch (M) {
|
|
2319
|
+
const b = `${(w == null ? void 0 : w.status) ?? ""} ${(w == null ? void 0 : w.statusText) ?? ""} ${M.message}`;
|
|
2320
2320
|
if (!r)
|
|
2321
2321
|
return;
|
|
2322
|
-
throw new Error(
|
|
2322
|
+
throw M.code == 401 ? M : new Error(b);
|
|
2323
2323
|
}
|
|
2324
2324
|
}
|
|
2325
2325
|
async function N(u) {
|
|
2326
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0,
|
|
2327
|
-
let c = u.finalUrl,
|
|
2328
|
-
if (c == null && (c =
|
|
2326
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2327
|
+
let c = u.finalUrl, I = u.headers;
|
|
2328
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (I = t(u)), s != null && s.isDemoing.value)
|
|
2329
2329
|
return console.log(`DEMO: Get all from ${c}`), s.getAll(u);
|
|
2330
2330
|
console.log(`Get all from ${c}`);
|
|
2331
|
-
let
|
|
2331
|
+
let w;
|
|
2332
2332
|
try {
|
|
2333
|
-
if (
|
|
2333
|
+
if (w = await fetch(c, {
|
|
2334
2334
|
method: "GET",
|
|
2335
2335
|
mode: "cors",
|
|
2336
2336
|
cache: "no-cache",
|
|
2337
|
-
headers:
|
|
2338
|
-
}), !
|
|
2339
|
-
|
|
2340
|
-
|
|
2337
|
+
headers: I
|
|
2338
|
+
}), !w.ok) {
|
|
2339
|
+
if (w.status == 401)
|
|
2340
|
+
throw {
|
|
2341
|
+
code: w.status,
|
|
2342
|
+
name: "Unauthorized",
|
|
2343
|
+
message: w.statusText
|
|
2344
|
+
};
|
|
2345
|
+
let M = await w.text();
|
|
2346
|
+
throw new Error(M ?? w.statusText ?? "Get all error");
|
|
2341
2347
|
}
|
|
2342
|
-
if (
|
|
2343
|
-
return await
|
|
2348
|
+
if (D)
|
|
2349
|
+
return await w.text();
|
|
2344
2350
|
if (y)
|
|
2345
|
-
return await
|
|
2351
|
+
return await w.json();
|
|
2346
2352
|
throw new Error();
|
|
2347
|
-
} catch (
|
|
2348
|
-
const
|
|
2353
|
+
} catch (M) {
|
|
2354
|
+
const b = `${(w == null ? void 0 : w.status) ?? ""} ${(w == null ? void 0 : w.statusText) ?? ""} ${M.message}`;
|
|
2349
2355
|
if (!r)
|
|
2350
2356
|
return;
|
|
2351
|
-
throw new Error(
|
|
2357
|
+
throw M.code == 401 ? M : new Error(b);
|
|
2352
2358
|
}
|
|
2353
2359
|
}
|
|
2354
2360
|
async function $(u) {
|
|
2355
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0,
|
|
2356
|
-
let c = u.finalUrl,
|
|
2357
|
-
if (c == null && (c =
|
|
2361
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2362
|
+
let c = u.finalUrl, I = u.headers;
|
|
2363
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (I = t(u)), s != null && s.isDemoing.value)
|
|
2358
2364
|
return console.log(`DEMO: Post to ${c}`), s.post(u);
|
|
2359
2365
|
console.log(`Post to ${c}`);
|
|
2360
|
-
let
|
|
2366
|
+
let w;
|
|
2361
2367
|
try {
|
|
2362
|
-
if (
|
|
2368
|
+
if (w = await fetch(c, {
|
|
2363
2369
|
method: "POST",
|
|
2364
2370
|
mode: "cors",
|
|
2365
2371
|
cache: "no-cache",
|
|
2366
|
-
headers:
|
|
2372
|
+
headers: I,
|
|
2367
2373
|
body: JSON.stringify(u.data)
|
|
2368
|
-
}), !
|
|
2369
|
-
|
|
2370
|
-
|
|
2374
|
+
}), !w.ok) {
|
|
2375
|
+
if (w.status == 401)
|
|
2376
|
+
throw {
|
|
2377
|
+
code: w.status,
|
|
2378
|
+
name: "Unauthorized",
|
|
2379
|
+
message: w.statusText
|
|
2380
|
+
};
|
|
2381
|
+
let M = await w.text();
|
|
2382
|
+
throw new Error(M ?? w.statusText ?? "Post error!");
|
|
2371
2383
|
}
|
|
2372
|
-
if (
|
|
2373
|
-
return await
|
|
2384
|
+
if (D)
|
|
2385
|
+
return await w.text();
|
|
2374
2386
|
if (y)
|
|
2375
|
-
return await
|
|
2387
|
+
return await w.json();
|
|
2376
2388
|
throw new Error();
|
|
2377
|
-
} catch (
|
|
2378
|
-
if (
|
|
2389
|
+
} catch (M) {
|
|
2390
|
+
if (w.status == 200 || !r)
|
|
2379
2391
|
return;
|
|
2380
|
-
const
|
|
2381
|
-
throw new Error(
|
|
2392
|
+
const b = `${(w == null ? void 0 : w.status) ?? ""} ${(w == null ? void 0 : w.statusText) ?? ""} ${M.message}`;
|
|
2393
|
+
throw M.code == 401 ? M : new Error(b);
|
|
2382
2394
|
}
|
|
2383
2395
|
}
|
|
2384
2396
|
async function d(u) {
|
|
2385
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0,
|
|
2386
|
-
let c = u.finalUrl,
|
|
2387
|
-
if (c == null && (c =
|
|
2397
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2398
|
+
let c = u.finalUrl, I = u.headers;
|
|
2399
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (I = t(u)), s != null && s.isDemoing.value)
|
|
2388
2400
|
return console.log(`DEMO: Patch to ${c}`), s.patch(u);
|
|
2389
2401
|
console.log(`Patch to ${c}`);
|
|
2390
|
-
let
|
|
2402
|
+
let w;
|
|
2391
2403
|
try {
|
|
2392
|
-
if (
|
|
2404
|
+
if (w = await fetch(c, {
|
|
2393
2405
|
method: "PATCH",
|
|
2394
2406
|
mode: "cors",
|
|
2395
2407
|
cache: "no-cache",
|
|
2396
|
-
headers:
|
|
2408
|
+
headers: I,
|
|
2397
2409
|
body: JSON.stringify(u.data)
|
|
2398
|
-
}), !
|
|
2399
|
-
|
|
2400
|
-
|
|
2410
|
+
}), !w.ok) {
|
|
2411
|
+
if (w.status == 401)
|
|
2412
|
+
throw {
|
|
2413
|
+
code: w.status,
|
|
2414
|
+
name: "Unauthorized",
|
|
2415
|
+
message: w.statusText
|
|
2416
|
+
};
|
|
2417
|
+
let M = await w.text();
|
|
2418
|
+
throw new Error(M ?? w.statusText ?? "Patch error!");
|
|
2401
2419
|
}
|
|
2402
|
-
if (
|
|
2403
|
-
return await
|
|
2420
|
+
if (D)
|
|
2421
|
+
return await w.text();
|
|
2404
2422
|
if (y)
|
|
2405
|
-
return await
|
|
2423
|
+
return await w.json();
|
|
2406
2424
|
throw new Error();
|
|
2407
|
-
} catch (
|
|
2408
|
-
if (
|
|
2425
|
+
} catch (M) {
|
|
2426
|
+
if (w.status == 200 || !r)
|
|
2409
2427
|
return;
|
|
2410
|
-
const
|
|
2411
|
-
throw new Error(
|
|
2428
|
+
const b = `${(w == null ? void 0 : w.status) ?? ""} ${(w == null ? void 0 : w.statusText) ?? ""} ${M.message}`;
|
|
2429
|
+
throw M.code == 401 ? M : new Error(b);
|
|
2412
2430
|
}
|
|
2413
2431
|
}
|
|
2414
2432
|
async function h(u) {
|
|
2415
2433
|
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0;
|
|
2416
|
-
let y = u.finalUrl,
|
|
2417
|
-
if (y == null && (y =
|
|
2434
|
+
let y = u.finalUrl, D = u.headers;
|
|
2435
|
+
if (y == null && (y = S(u)), u.overrideHeaders !== !0 && (D = t(u)), s != null && s.isDemoing.value)
|
|
2418
2436
|
return console.log(`DEMO: Delete ${y}`), s.deleteItem(u);
|
|
2419
2437
|
console.log(`Delete ${y}`);
|
|
2420
2438
|
let c;
|
|
2421
2439
|
try {
|
|
2422
|
-
|
|
2440
|
+
if (c = await fetch(y, {
|
|
2423
2441
|
method: "DELETE",
|
|
2424
2442
|
mode: "cors",
|
|
2425
2443
|
cache: "no-cache",
|
|
2426
|
-
headers:
|
|
2444
|
+
headers: D,
|
|
2427
2445
|
body: JSON.stringify(u.data)
|
|
2428
|
-
}), c.status ==
|
|
2429
|
-
|
|
2430
|
-
|
|
2446
|
+
}), c.status == 401)
|
|
2447
|
+
throw {
|
|
2448
|
+
code: c.status,
|
|
2449
|
+
name: "Unauthorized",
|
|
2450
|
+
message: c.statusText
|
|
2451
|
+
};
|
|
2452
|
+
return c.status == 200 ? void 0 : c.statusText;
|
|
2453
|
+
} catch (I) {
|
|
2454
|
+
const w = `${(c == null ? void 0 : c.status) ?? ""} ${(c == null ? void 0 : c.statusText) ?? ""} ${I.message}`;
|
|
2431
2455
|
if (!r)
|
|
2432
|
-
return
|
|
2433
|
-
throw new Error(`${c.status} ${c.statusText} ${
|
|
2456
|
+
return w;
|
|
2457
|
+
throw I.code == 401 ? I : new Error(`${c.status} ${c.statusText} ${I.message}`);
|
|
2434
2458
|
}
|
|
2435
2459
|
}
|
|
2436
2460
|
return Ar = {
|
|
2437
2461
|
buildHeaders: t,
|
|
2438
2462
|
buildQuery: l,
|
|
2439
|
-
buildUrl:
|
|
2463
|
+
buildUrl: S,
|
|
2440
2464
|
deleteItem: h,
|
|
2441
2465
|
get: T,
|
|
2442
2466
|
getAll: N,
|
|
@@ -2445,18 +2469,18 @@ function In(e) {
|
|
|
2445
2469
|
}, Ar;
|
|
2446
2470
|
}
|
|
2447
2471
|
function it(e) {
|
|
2448
|
-
const { actionErrorMsg: t, actionLoadingMsg: l, clearErrors:
|
|
2472
|
+
const { actionErrorMsg: t, actionLoadingMsg: l, clearErrors: S, isLoading: s, doAction: g, logError: x } = rn(e);
|
|
2449
2473
|
function P(r) {
|
|
2450
2474
|
r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.refresh ?? (r.refresh = e == null ? void 0 : e.refresh), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), r.confirmationMsg ?? (r.confirmationMsg = r.requireConfirmation === !0 ? "Are you sure you want to delete this item?" : void 0);
|
|
2451
2475
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2452
|
-
const
|
|
2476
|
+
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2453
2477
|
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onDeleteAsync ?? (r.onDeleteAsync = () => y().deleteItem(r)) : r.onDeleteAsync ?? (r.onDeleteAsync = () => {
|
|
2454
|
-
var
|
|
2455
|
-
const c = r.id ?? ((
|
|
2478
|
+
var w;
|
|
2479
|
+
const c = r.id ?? ((w = r.data) == null ? void 0 : w.id);
|
|
2456
2480
|
if (c == null)
|
|
2457
2481
|
return Promise.resolve("No id found in delete action");
|
|
2458
|
-
const
|
|
2459
|
-
return
|
|
2482
|
+
const I = D.findIndex((M) => M.id == c);
|
|
2483
|
+
return I >= 0 && D.splice(I, 1), Promise.resolve(void 0);
|
|
2460
2484
|
}), g(async () => {
|
|
2461
2485
|
let c;
|
|
2462
2486
|
r.onCanDeleteAsync != null && (c = await r.onCanDeleteAsync(r.data)), c == null && r.onDeleteAsync != null && (c = await r.onDeleteAsync(r.data)), c == null && r.onDeleteSuccessAsync != null && await r.onDeleteSuccessAsync(r.data), x(c);
|
|
@@ -2472,11 +2496,11 @@ function it(e) {
|
|
|
2472
2496
|
function T(r) {
|
|
2473
2497
|
r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.refresh ?? (r.refresh = e == null ? void 0 : e.refresh), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), r.confirmationMsg ?? (r.confirmationMsg = r.requireConfirmation === !0 ? "Are you sure you want to get this item?" : void 0);
|
|
2474
2498
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2475
|
-
const
|
|
2499
|
+
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2476
2500
|
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onGetAsync ?? (r.onGetAsync = async () => (await y().get(r)).data) : r.onGetAsync ?? (r.onGetAsync = () => {
|
|
2477
|
-
var
|
|
2478
|
-
const c = r.id ?? ((
|
|
2479
|
-
return c == null ? Promise.resolve(void 0) : Promise.resolve(
|
|
2501
|
+
var I;
|
|
2502
|
+
const c = r.id ?? ((I = r.data) == null ? void 0 : I.id);
|
|
2503
|
+
return c == null ? Promise.resolve(void 0) : Promise.resolve(D.find((w) => w.id == c));
|
|
2480
2504
|
}), g(async () => {
|
|
2481
2505
|
let c;
|
|
2482
2506
|
return r.onGetAsync != null && (c = await r.onGetAsync(r)), r.onGetSuccessAsync != null && (c = await r.onGetSuccessAsync(c, r)), c;
|
|
@@ -2492,8 +2516,8 @@ function it(e) {
|
|
|
2492
2516
|
function N(r) {
|
|
2493
2517
|
r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.refresh ?? (r.refresh = e == null ? void 0 : e.refresh), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), r.confirmationMsg ?? (r.confirmationMsg = r.requireConfirmation === !0 ? "Are you sure you want to get these items?" : void 0);
|
|
2494
2518
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2495
|
-
const
|
|
2496
|
-
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onGetAsync ?? (r.onGetAsync = () => y().getAll(r)) : r.onGetAsync ?? (r.onGetAsync = () => Promise.resolve(
|
|
2519
|
+
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2520
|
+
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onGetAsync ?? (r.onGetAsync = () => y().getAll(r)) : r.onGetAsync ?? (r.onGetAsync = () => Promise.resolve(D)), g(async () => {
|
|
2497
2521
|
let c;
|
|
2498
2522
|
return r.onGetAsync != null && (c = await r.onGetAsync(r)), r.onGetSuccessAsync != null && (c = await r.onGetSuccessAsync(c, r)), c;
|
|
2499
2523
|
}, {
|
|
@@ -2509,8 +2533,8 @@ function it(e) {
|
|
|
2509
2533
|
r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.refresh ?? (r.refresh = e == null ? void 0 : e.refresh), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), r.confirmationMsg ?? (r.confirmationMsg = r.requireConfirmation === !0 ? "Are you sure you want to restore this item?" : void 0);
|
|
2510
2534
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2511
2535
|
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null && (r.onRestoreAsync ?? (r.onRestoreAsync = () => y().restore(r))), g(async () => {
|
|
2512
|
-
let
|
|
2513
|
-
return r.onCanRestoreAsync != null && (
|
|
2536
|
+
let D, c;
|
|
2537
|
+
return r.onCanRestoreAsync != null && (D = await r.onCanRestoreAsync(r.data)), D == null && r.onRestoreAsync != null && (c = await r.onRestoreAsync(r.data)), c != null && r.onRestoreSuccessAsync != null && await r.onRestoreSuccessAsync(c), x(D), c;
|
|
2514
2538
|
}, {
|
|
2515
2539
|
completionMsg: r.completionMsg ?? (e == null ? void 0 : e.completionMsg),
|
|
2516
2540
|
confirmationMsg: r.confirmationMsg ?? (e == null ? void 0 : e.confirmationMsg),
|
|
@@ -2523,24 +2547,24 @@ function it(e) {
|
|
|
2523
2547
|
function d(r) {
|
|
2524
2548
|
r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.refresh ?? (r.refresh = e == null ? void 0 : e.refresh), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), r.confirmationMsg ?? (r.confirmationMsg = r.requireConfirmation === !0 ? "Are you sure you want to save this item?" : void 0);
|
|
2525
2549
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2526
|
-
const
|
|
2550
|
+
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2527
2551
|
return r.onGetSaveAsync ?? (r.onGetSaveAsync = (c) => c), r.onCanSaveAsync ?? (r.onCanSaveAsync = () => Promise.resolve(void 0)), y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onSaveAsync ?? (r.onSaveAsync = async () => {
|
|
2528
2552
|
var c;
|
|
2529
2553
|
return r.mode ?? (r.mode = ((c = r.data) == null ? void 0 : c.id) == null ? "new" : "edit"), r.mode == "new" ? await y().post(r) : await y().patch(r);
|
|
2530
2554
|
}) : r.onSaveAsync ?? (r.onSaveAsync = (c) => {
|
|
2531
|
-
const
|
|
2532
|
-
return
|
|
2555
|
+
const I = D.findIndex((w) => w.id == c.id);
|
|
2556
|
+
return I >= 0 ? D.splice(I, 1, c) : D.push(c), Promise.resolve(c);
|
|
2533
2557
|
}), g(async () => {
|
|
2534
2558
|
let c;
|
|
2535
2559
|
if (r.onGetSaveAsync != null && (c = await r.onGetSaveAsync(r.data)), c == null)
|
|
2536
2560
|
return;
|
|
2537
2561
|
if (r.onCanSaveAsync != null) {
|
|
2538
|
-
let
|
|
2539
|
-
if (x(
|
|
2562
|
+
let w = await r.onCanSaveAsync(c);
|
|
2563
|
+
if (x(w), w != null)
|
|
2540
2564
|
return;
|
|
2541
2565
|
}
|
|
2542
|
-
let
|
|
2543
|
-
return r.onSaveAsync != null && (
|
|
2566
|
+
let I;
|
|
2567
|
+
return r.onSaveAsync != null && (I = await r.onSaveAsync(c), I = I.data != null ? I.data : I), r.onSaveSuccessAsync != null && (I = await r.onSaveSuccessAsync(I)), I;
|
|
2544
2568
|
}, {
|
|
2545
2569
|
completionMsg: r.completionMsg ?? (e == null ? void 0 : e.completionMsg),
|
|
2546
2570
|
confirmationMsg: r.confirmationMsg ?? (e == null ? void 0 : e.confirmationMsg),
|
|
@@ -2551,17 +2575,17 @@ function it(e) {
|
|
|
2551
2575
|
});
|
|
2552
2576
|
}
|
|
2553
2577
|
function h(r) {
|
|
2554
|
-
return r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), g(async () => await (r.api ??
|
|
2578
|
+
return r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), g(async () => await (r.api ?? Ir()).get(r), { ...e, ...r });
|
|
2555
2579
|
}
|
|
2556
2580
|
function u(r) {
|
|
2557
|
-
return r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), g(async () => await (r.api ??
|
|
2581
|
+
return r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), g(async () => await (r.api ?? Ir()).post(r), { ...e, ...r });
|
|
2558
2582
|
}
|
|
2559
2583
|
return {
|
|
2560
2584
|
actionLoadingMsg: l,
|
|
2561
2585
|
actionErrorMsg: t,
|
|
2562
2586
|
apiGet: h,
|
|
2563
2587
|
apiPost: u,
|
|
2564
|
-
clearErrors:
|
|
2588
|
+
clearErrors: S,
|
|
2565
2589
|
deleteItem: P,
|
|
2566
2590
|
doAction: g,
|
|
2567
2591
|
getAllItems: N,
|
|
@@ -2572,174 +2596,174 @@ function it(e) {
|
|
|
2572
2596
|
saveItem: d
|
|
2573
2597
|
};
|
|
2574
2598
|
}
|
|
2575
|
-
let hr = "Australia/Melbourne",
|
|
2599
|
+
let hr = "Australia/Melbourne", Er;
|
|
2576
2600
|
const Hr = "auth-credentials-state";
|
|
2577
2601
|
function Dn() {
|
|
2578
|
-
return
|
|
2602
|
+
return Er;
|
|
2579
2603
|
}
|
|
2580
2604
|
function xn(e) {
|
|
2581
2605
|
const t = e.expiryTokenFormat ?? "d/MM/yyyy h:mm:ss a";
|
|
2582
|
-
let l =
|
|
2583
|
-
l.value.length == 0 &&
|
|
2584
|
-
function
|
|
2606
|
+
let l = z(localStorage.getItem(Hr) ?? "");
|
|
2607
|
+
l.value.length == 0 && S();
|
|
2608
|
+
function S() {
|
|
2585
2609
|
l.value = Math.random().toString(36).substring(4, 19) + Math.random().toString(12).substring(1, 11), localStorage.setItem(Hr, l.value);
|
|
2586
2610
|
}
|
|
2587
2611
|
const s = Jt("auth-credentials", {});
|
|
2588
|
-
function g(
|
|
2589
|
-
if (
|
|
2612
|
+
function g(E) {
|
|
2613
|
+
if (E == null)
|
|
2590
2614
|
return !0;
|
|
2591
|
-
var
|
|
2592
|
-
if (
|
|
2615
|
+
var L = e.getAuthItem != null ? e.getAuthItem(E) : null;
|
|
2616
|
+
if (L == null)
|
|
2593
2617
|
return !1;
|
|
2594
|
-
if (
|
|
2618
|
+
if (L.requiresAuth === !1)
|
|
2595
2619
|
return !0;
|
|
2596
2620
|
const f = K(s);
|
|
2597
|
-
if (f.isSuspended &&
|
|
2621
|
+
if (f.isSuspended && L.ignoreSuspension !== !0)
|
|
2598
2622
|
return !1;
|
|
2599
2623
|
if (f.isGlobalAdmin)
|
|
2600
2624
|
return !0;
|
|
2601
|
-
if (
|
|
2602
|
-
for (var A = 0; A <
|
|
2603
|
-
if (!x(
|
|
2625
|
+
if (L.permissions != null) {
|
|
2626
|
+
for (var A = 0; A < L.permissions.length; A++)
|
|
2627
|
+
if (!x(L.permissions[A]))
|
|
2604
2628
|
return !1;
|
|
2605
2629
|
}
|
|
2606
2630
|
return !0;
|
|
2607
2631
|
}
|
|
2608
|
-
function x(
|
|
2609
|
-
const
|
|
2610
|
-
if (
|
|
2611
|
-
for (var f = 0; f <
|
|
2612
|
-
var A =
|
|
2613
|
-
if (
|
|
2632
|
+
function x(E) {
|
|
2633
|
+
const L = K(s);
|
|
2634
|
+
if (L.userPermissions != null)
|
|
2635
|
+
for (var f = 0; f < L.userPermissions.length; f++) {
|
|
2636
|
+
var A = L.userPermissions[f].split(".");
|
|
2637
|
+
if (L.userPermissions[f] == "everything.edit" || E == A[0] && A.length > 1 && A[1] == "edit")
|
|
2614
2638
|
return !0;
|
|
2615
2639
|
}
|
|
2616
2640
|
return !1;
|
|
2617
2641
|
}
|
|
2618
|
-
function P(
|
|
2619
|
-
if (
|
|
2642
|
+
function P(E) {
|
|
2643
|
+
if (E == null)
|
|
2620
2644
|
return !0;
|
|
2621
|
-
var
|
|
2622
|
-
if (
|
|
2645
|
+
var L = e.getAuthItem != null ? e.getAuthItem(E) : null;
|
|
2646
|
+
if (L == null)
|
|
2623
2647
|
return !1;
|
|
2624
|
-
if (
|
|
2648
|
+
if (L.requiresAuth === !1)
|
|
2625
2649
|
return !0;
|
|
2626
2650
|
const f = K(s);
|
|
2627
|
-
if (f.isSuspended &&
|
|
2651
|
+
if (f.isSuspended && L.ignoreSuspension !== !0)
|
|
2628
2652
|
return !1;
|
|
2629
2653
|
if (f.isGlobalAdmin)
|
|
2630
2654
|
return !0;
|
|
2631
|
-
if (
|
|
2632
|
-
for (var A = 0; A <
|
|
2633
|
-
if (!T(
|
|
2655
|
+
if (L.permissions != null) {
|
|
2656
|
+
for (var A = 0; A < L.permissions.length; A++)
|
|
2657
|
+
if (!T(L.permissions[A]))
|
|
2634
2658
|
return !1;
|
|
2635
2659
|
}
|
|
2636
2660
|
return !0;
|
|
2637
2661
|
}
|
|
2638
|
-
function T(
|
|
2639
|
-
const
|
|
2640
|
-
if (
|
|
2641
|
-
for (var f = 0; f <
|
|
2642
|
-
var A =
|
|
2643
|
-
if (
|
|
2662
|
+
function T(E) {
|
|
2663
|
+
const L = K(s);
|
|
2664
|
+
if (L.userPermissions != null)
|
|
2665
|
+
for (var f = 0; f < L.userPermissions.length; f++) {
|
|
2666
|
+
var A = L.userPermissions[f].split(".");
|
|
2667
|
+
if (E == A[0] || E == "everything" || L.userPermissions[f] == "everything.view" || L.userPermissions[f] == "everything.edit")
|
|
2644
2668
|
return !0;
|
|
2645
2669
|
}
|
|
2646
2670
|
return !1;
|
|
2647
2671
|
}
|
|
2648
|
-
function N(
|
|
2672
|
+
function N(E, L, f) {
|
|
2649
2673
|
let A = !0;
|
|
2650
|
-
return K(s).isGlobalAdmin ? !0 : (
|
|
2674
|
+
return K(s).isGlobalAdmin ? !0 : (L != null && L.length > 0 && L.forEach((Q) => {
|
|
2651
2675
|
f == "edit" ? x(Q) || (A = !1) : T(Q) || (A = !1);
|
|
2652
|
-
}),
|
|
2676
|
+
}), E != null && E.length > 0 && (E.some((Q) => u(Q)) || (A = !1)), A);
|
|
2653
2677
|
}
|
|
2654
|
-
function $(
|
|
2655
|
-
var f = e.getAuthItem != null ? e.getAuthItem(
|
|
2678
|
+
function $(E, L = !1) {
|
|
2679
|
+
var f = e.getAuthItem != null ? e.getAuthItem(E) : null;
|
|
2656
2680
|
let A = !1;
|
|
2657
2681
|
if (f == null)
|
|
2658
2682
|
return !1;
|
|
2659
2683
|
let J = f.subscriptions ?? [], Q = f.permissions ?? [], ee = N(J, Q, "view");
|
|
2660
|
-
return ee || !
|
|
2684
|
+
return ee || !L || !Te(f.children) ? ee : ((f == null ? void 0 : f.children) != null && f.children.forEach((ie) => {
|
|
2661
2685
|
$(ie, !0) && (A = !0);
|
|
2662
2686
|
}), A);
|
|
2663
2687
|
}
|
|
2664
|
-
function d(
|
|
2665
|
-
return e.getAuthorizeUrl ?? (e.getAuthorizeUrl = (
|
|
2666
|
-
const A =
|
|
2667
|
-
return
|
|
2668
|
-
}), e.getAuthorizeUrl != null ? e.getAuthorizeUrl(
|
|
2688
|
+
function d(E) {
|
|
2689
|
+
return e.getAuthorizeUrl ?? (e.getAuthorizeUrl = (L, f) => {
|
|
2690
|
+
const A = Be(qr(), `authorize?response_type=code&client_id=${e.oauthClientID}&redirect_uri=${window.location.origin}/authentication&state=${f}`);
|
|
2691
|
+
return L ? `${A}&redirect_path=${L}` : A;
|
|
2692
|
+
}), e.getAuthorizeUrl != null ? e.getAuthorizeUrl(E, l.value) ?? "" : "";
|
|
2669
2693
|
}
|
|
2670
|
-
function h(
|
|
2694
|
+
function h(E) {
|
|
2671
2695
|
var f;
|
|
2672
|
-
return
|
|
2696
|
+
return E == null ? 0 : ((f = (e.subscriptionOptions ?? []).find((A) => A.code == E)) == null ? void 0 : f.value) ?? 0;
|
|
2673
2697
|
}
|
|
2674
|
-
function u(
|
|
2675
|
-
const
|
|
2676
|
-
if (
|
|
2698
|
+
function u(E) {
|
|
2699
|
+
const L = K(s);
|
|
2700
|
+
if (L.subscriptionCode == null)
|
|
2677
2701
|
return !1;
|
|
2678
|
-
if (
|
|
2702
|
+
if (L.subscriptionCode == E)
|
|
2679
2703
|
return !0;
|
|
2680
|
-
const f = h(
|
|
2704
|
+
const f = h(E), A = h(L.subscriptionCode);
|
|
2681
2705
|
return f <= A;
|
|
2682
2706
|
}
|
|
2683
|
-
function r(
|
|
2684
|
-
const f =
|
|
2707
|
+
function r(E) {
|
|
2708
|
+
const f = E.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), A = decodeURIComponent(
|
|
2685
2709
|
atob(f).split("").map(function(J) {
|
|
2686
2710
|
return "%" + ("00" + J.charCodeAt(0).toString(16)).slice(-2);
|
|
2687
2711
|
}).join("")
|
|
2688
2712
|
);
|
|
2689
2713
|
return JSON.parse(A);
|
|
2690
2714
|
}
|
|
2691
|
-
function y(
|
|
2692
|
-
s.value = void 0,
|
|
2715
|
+
function y(E, L) {
|
|
2716
|
+
s.value = void 0, M(), E != null && L != null && L.currentRoute.value.path != E && L.push({ path: E });
|
|
2693
2717
|
}
|
|
2694
|
-
function
|
|
2718
|
+
function D(E) {
|
|
2695
2719
|
var f;
|
|
2696
|
-
K(s).isLoggedIn || ((f = e.demo) == null || f.endDemo(), _() && (y(), window.location.href = d(
|
|
2720
|
+
K(s).isLoggedIn || ((f = e.demo) == null || f.endDemo(), _() && (y(), window.location.href = d(E)));
|
|
2697
2721
|
}
|
|
2698
|
-
async function c(
|
|
2722
|
+
async function c(E, L) {
|
|
2699
2723
|
return e.getToken ?? (e.getToken = async () => {
|
|
2700
|
-
let f =
|
|
2724
|
+
let f = E, A = L, J = e.oauthGrantType ?? "authorization_token", Q = e.oauthClientID ?? "";
|
|
2701
2725
|
if (f == null || A == null)
|
|
2702
2726
|
throw new Error("Code and State required in OAuth token process");
|
|
2703
2727
|
if (A != l.value)
|
|
2704
2728
|
throw new Error("state does not match");
|
|
2705
2729
|
let ee = "";
|
|
2706
|
-
e.getTokenUrl ?? (e.getTokenUrl = () =>
|
|
2730
|
+
e.getTokenUrl ?? (e.getTokenUrl = () => Be(qr(), "token")), ee = e.getTokenUrl(f, `${window.location.origin}/authentication`, J, Q);
|
|
2707
2731
|
const ie = {};
|
|
2708
2732
|
ie.grant_type = J, ie.code = f, ie.redirect_uri = `${window.location.origin}/authentication`, ie.client_id = Q;
|
|
2709
|
-
const W = await
|
|
2733
|
+
const W = await Ir().post({
|
|
2710
2734
|
additionalUrl: ee,
|
|
2711
2735
|
data: ie
|
|
2712
2736
|
});
|
|
2713
|
-
|
|
2714
|
-
}), await e.getToken(
|
|
2737
|
+
I(W.access_token);
|
|
2738
|
+
}), await e.getToken(E, L);
|
|
2715
2739
|
}
|
|
2716
|
-
function
|
|
2717
|
-
if (
|
|
2718
|
-
const
|
|
2719
|
-
|
|
2740
|
+
function I(E) {
|
|
2741
|
+
if (E != null && (e.demo == null || !e.demo.isDemoing.value)) {
|
|
2742
|
+
const L = r(E);
|
|
2743
|
+
w(L, E), e.processTokenPayload != null && e.processTokenPayload(s, L);
|
|
2720
2744
|
}
|
|
2721
2745
|
}
|
|
2722
|
-
function E
|
|
2746
|
+
function w(E, L) {
|
|
2723
2747
|
var A;
|
|
2724
2748
|
const f = s.value;
|
|
2725
|
-
f.expiresOn =
|
|
2749
|
+
f.expiresOn = E.ExpiresOn, f.isGlobalAdmin = E.IsGlobalAdmin == "True", f.isLoggedIn = !0, f.permissions = E.Permissions, f.subscriptionCode = E.Subscription, f.timeZone ?? (f.timeZone = e.defaultTimeZone ?? hr), f.token = L, f.userID = E.UserLoginID, f.userPermissions = ((A = E.Permissions) == null ? void 0 : A.split(",")) ?? [];
|
|
2726
2750
|
}
|
|
2727
|
-
function
|
|
2728
|
-
var
|
|
2729
|
-
s.value ?? (s.value = {}), (
|
|
2751
|
+
function M() {
|
|
2752
|
+
var E;
|
|
2753
|
+
s.value ?? (s.value = {}), (E = s.value).timeZone ?? (E.timeZone = e.defaultTimeZone ?? hr);
|
|
2730
2754
|
}
|
|
2731
|
-
function
|
|
2732
|
-
const
|
|
2733
|
-
return
|
|
2755
|
+
function b() {
|
|
2756
|
+
const E = K(s);
|
|
2757
|
+
return E.isLoggedIn && _() && (y(), window.location.href = d()), E.isLoggedIn;
|
|
2734
2758
|
}
|
|
2735
2759
|
function _() {
|
|
2736
|
-
const
|
|
2737
|
-
if (
|
|
2760
|
+
const E = K(s);
|
|
2761
|
+
if (E == null || E.expiresOn == null)
|
|
2738
2762
|
return !0;
|
|
2739
|
-
const
|
|
2740
|
-
return
|
|
2763
|
+
const L = de.fromFormat(E.expiresOn, t), f = de.utc();
|
|
2764
|
+
return L <= f;
|
|
2741
2765
|
}
|
|
2742
|
-
return
|
|
2766
|
+
return M(), Er = {
|
|
2743
2767
|
authState: l,
|
|
2744
2768
|
canEdit: g,
|
|
2745
2769
|
canEditPermit: x,
|
|
@@ -2751,147 +2775,147 @@ function xn(e) {
|
|
|
2751
2775
|
getAuthorizeUrl: d,
|
|
2752
2776
|
getToken: c,
|
|
2753
2777
|
isLoggedIn: te(() => s.value.isLoggedIn === !0),
|
|
2754
|
-
login:
|
|
2778
|
+
login: D,
|
|
2755
2779
|
logout: y,
|
|
2756
|
-
resetAuthState:
|
|
2757
|
-
setAuth:
|
|
2780
|
+
resetAuthState: S,
|
|
2781
|
+
setAuth: I,
|
|
2758
2782
|
timeZone: te(() => s.value.timeZone ?? e.defaultTimeZone ?? hr),
|
|
2759
|
-
tryLogin:
|
|
2760
|
-
},
|
|
2783
|
+
tryLogin: b
|
|
2784
|
+
}, Er;
|
|
2761
2785
|
}
|
|
2762
2786
|
function _n(e, t, l = {}) {
|
|
2763
2787
|
const {
|
|
2764
|
-
preventDefault:
|
|
2788
|
+
preventDefault: S = !1,
|
|
2765
2789
|
stopPropagation: s = !1,
|
|
2766
2790
|
axis: g = "both"
|
|
2767
2791
|
} = l, x = { capture: l.capture ?? !0 };
|
|
2768
|
-
let P = { x: 0, y: 0 }, T = { x: 0, y: 0 }, N = { x: 0, y: 0 }, $ = [], d = [], h =
|
|
2769
|
-
function u(
|
|
2770
|
-
K(
|
|
2792
|
+
let P = { x: 0, y: 0 }, T = { x: 0, y: 0 }, N = { x: 0, y: 0 }, $ = [], d = [], h = z(!1);
|
|
2793
|
+
function u(M) {
|
|
2794
|
+
K(S) && M.preventDefault(), K(s) && M.stopPropagation();
|
|
2771
2795
|
}
|
|
2772
|
-
function r(
|
|
2796
|
+
function r(M) {
|
|
2773
2797
|
var f;
|
|
2774
|
-
const
|
|
2775
|
-
if (!
|
|
2798
|
+
const b = K(e);
|
|
2799
|
+
if (!b)
|
|
2776
2800
|
return;
|
|
2777
|
-
const _ =
|
|
2778
|
-
N = { x:
|
|
2801
|
+
const _ = b.$el, L = M.type === "touchstart" && M.touches.length > 0 ? M.touches[0] : M;
|
|
2802
|
+
N = { x: L.clientX, y: L.clientY }, T = {
|
|
2779
2803
|
x: _.offsetLeft,
|
|
2780
2804
|
y: _.offsetTop
|
|
2781
2805
|
}, P = {
|
|
2782
2806
|
x: _.offsetLeft,
|
|
2783
2807
|
y: _.offsetTop
|
|
2784
|
-
}, ((f = l.onStart) == null ? void 0 : f.call(l, N,
|
|
2808
|
+
}, ((f = l.onStart) == null ? void 0 : f.call(l, N, M)) !== !1 && (d.push(he("mousemove", y)), d.push(he("touchmove", y)), d.push(he("mouseup", D)), d.push(he("touchend", D)), u(M));
|
|
2785
2809
|
}
|
|
2786
|
-
function y(
|
|
2810
|
+
function y(M) {
|
|
2787
2811
|
var A;
|
|
2788
2812
|
if (!N || !K(e))
|
|
2789
2813
|
return;
|
|
2790
|
-
const
|
|
2791
|
-
let
|
|
2792
|
-
(g === "x" || g === "both") && (P.x = T.x +
|
|
2814
|
+
const E = M.type === "touchmove" && M.touches.length > 0 ? M.touches[0] : M;
|
|
2815
|
+
let L = E.clientX - N.x, f = E.clientY - N.y;
|
|
2816
|
+
(g === "x" || g === "both") && (P.x = T.x + L), (g === "y" || g === "both") && (P.y = T.y + f), (A = l.onMove) == null || A.call(l, P, M), u(M), c(P);
|
|
2793
2817
|
}
|
|
2794
|
-
function
|
|
2795
|
-
var
|
|
2818
|
+
function D(M) {
|
|
2819
|
+
var b;
|
|
2796
2820
|
document.documentElement.style.cursor = "", d.forEach((_) => {
|
|
2797
2821
|
_();
|
|
2798
|
-
}), d.length = 0, (
|
|
2822
|
+
}), d.length = 0, (b = l.onEnd) == null || b.call(l, P, M), u(M);
|
|
2799
2823
|
}
|
|
2800
|
-
function c(
|
|
2801
|
-
const
|
|
2802
|
-
if (!
|
|
2824
|
+
function c(M) {
|
|
2825
|
+
const b = K(e);
|
|
2826
|
+
if (!b)
|
|
2803
2827
|
return;
|
|
2804
|
-
const _ =
|
|
2805
|
-
_.style.left = `${
|
|
2828
|
+
const _ = b.$el;
|
|
2829
|
+
_.style.left = `${M.x}px`, _.style.top = `${M.y}px`;
|
|
2806
2830
|
}
|
|
2807
|
-
function
|
|
2831
|
+
function I() {
|
|
2808
2832
|
if (K(h))
|
|
2809
2833
|
return;
|
|
2810
|
-
const
|
|
2811
|
-
if (!
|
|
2834
|
+
const M = K(t);
|
|
2835
|
+
if (!M)
|
|
2812
2836
|
return;
|
|
2813
|
-
const
|
|
2814
|
-
|
|
2837
|
+
const b = M.$el;
|
|
2838
|
+
b.style.cursor = "move", $.push(he(b, "mousedown", r, x)), $.push(he(b, "touchstart", r, x)), h.value = !0;
|
|
2815
2839
|
}
|
|
2816
|
-
function
|
|
2840
|
+
function w() {
|
|
2817
2841
|
if (!K(h))
|
|
2818
2842
|
return;
|
|
2819
|
-
const
|
|
2820
|
-
if (!
|
|
2843
|
+
const M = K(t);
|
|
2844
|
+
if (!M)
|
|
2821
2845
|
return;
|
|
2822
|
-
const
|
|
2823
|
-
|
|
2846
|
+
const b = M.$el;
|
|
2847
|
+
b.style.cursor = "", $.forEach((_) => {
|
|
2824
2848
|
_();
|
|
2825
2849
|
}), $.length = 0, h.value = !1;
|
|
2826
2850
|
}
|
|
2827
2851
|
return {
|
|
2828
2852
|
draggingIsOn: h,
|
|
2829
|
-
turnDraggableOff:
|
|
2830
|
-
turnDraggableOn:
|
|
2853
|
+
turnDraggableOff: w,
|
|
2854
|
+
turnDraggableOn: I
|
|
2831
2855
|
};
|
|
2832
2856
|
}
|
|
2833
2857
|
const Tn = ["t", "r", "b", "l", "tr", "br", "bl", "tl"];
|
|
2834
2858
|
function Cn(e, t = {}) {
|
|
2835
|
-
let l,
|
|
2836
|
-
const u =
|
|
2859
|
+
let l, S = t.handleWidth ?? 12, s = t.handleZIndex ?? 100, g = t.minWidth ?? 0, x = t.maxWidth ?? Number.MAX_SAFE_INTEGER, P = t.minHeight ?? 0, T = t.maxHeight ?? Number.MAX_SAFE_INTEGER, N = t.preventDefault ?? !1, $ = t.stopPropagation ?? !1, d, h = [];
|
|
2860
|
+
const u = z(!1);
|
|
2837
2861
|
let r = [], y = [];
|
|
2838
|
-
const
|
|
2839
|
-
let
|
|
2840
|
-
function
|
|
2862
|
+
const D = z(!1), c = z({ x: 0, y: 0 });
|
|
2863
|
+
let I = { left: 0, top: 0, height: 0, width: 0, position: "absolute" }, w = {};
|
|
2864
|
+
function M(W) {
|
|
2841
2865
|
Ae(N) && W.preventDefault(), Ae($) && W.stopPropagation();
|
|
2842
2866
|
}
|
|
2843
|
-
function
|
|
2844
|
-
h =
|
|
2867
|
+
function b(W, Y) {
|
|
2868
|
+
h = Y.map(E), h.forEach((V) => W.$el.appendChild(V));
|
|
2845
2869
|
}
|
|
2846
2870
|
function _(W) {
|
|
2847
|
-
h.forEach((
|
|
2871
|
+
h.forEach((Y) => W.$el.removeChild(Y));
|
|
2848
2872
|
}
|
|
2849
|
-
function
|
|
2850
|
-
const
|
|
2851
|
-
return G.dataset.handle = W, G.style.position = "absolute", G.style.touchAction = "none", G.style.userSelect = "none", G.style.zIndex = (W.length === 1 ? s : ae).toString(), G.style.cursor = J(W), W.includes("t") && (G.style.top = V, G.style.height =
|
|
2873
|
+
function E(W) {
|
|
2874
|
+
const Y = S + "px", V = -S / 2 + "px", ae = s + 1, G = document.createElement("div");
|
|
2875
|
+
return G.dataset.handle = W, G.style.position = "absolute", G.style.touchAction = "none", G.style.userSelect = "none", G.style.zIndex = (W.length === 1 ? s : ae).toString(), G.style.cursor = J(W), W.includes("t") && (G.style.top = V, G.style.height = Y, W === "t" && (G.style.left = "0", G.style.width = "100%")), W.includes("b") && (G.style.bottom = V, G.style.height = Y, W === "b" && (G.style.left = "0", G.style.width = "100%")), W.includes("r") && (G.style.right = V, G.style.width = Y, W === "r" && (G.style.top = "0", G.style.height = "100%")), W.includes("l") && (G.style.left = V, G.style.width = Y, W === "l" && (G.style.top = "0", G.style.height = "100%")), G;
|
|
2852
2876
|
}
|
|
2853
|
-
function
|
|
2877
|
+
function L(W) {
|
|
2854
2878
|
var ne;
|
|
2855
2879
|
if (!h.some((fe) => fe == W.target))
|
|
2856
2880
|
return;
|
|
2857
|
-
const
|
|
2858
|
-
if (!
|
|
2881
|
+
const Y = Ae(e);
|
|
2882
|
+
if (!Y)
|
|
2859
2883
|
return;
|
|
2860
|
-
const V =
|
|
2861
|
-
if (c.value.x = G.clientX, c.value.y = G.clientY,
|
|
2884
|
+
const V = Y.$el, G = W.type === "touchstart" && W.touches.length > 0 ? W.touches[0] : W;
|
|
2885
|
+
if (c.value.x = G.clientX, c.value.y = G.clientY, I = {
|
|
2862
2886
|
left: V.offsetLeft,
|
|
2863
2887
|
top: V.offsetTop,
|
|
2864
2888
|
height: parseInt(window.getComputedStyle(V).getPropertyValue("height")),
|
|
2865
2889
|
width: parseInt(window.getComputedStyle(V).getPropertyValue("width"))
|
|
2866
|
-
},
|
|
2890
|
+
}, w = Lr(I), ((ne = t.onStart) == null ? void 0 : ne.call(t, c.value, W)) === !1)
|
|
2867
2891
|
return;
|
|
2868
2892
|
let X = W.target;
|
|
2869
|
-
document.documentElement.style.cursor = J(X.dataset.handle), d = X.dataset.handle, y.push(he("mousemove", f)), y.push(he("mouseup", A)), y.push(he("touchmove", f)), y.push(he("touchend", A)),
|
|
2893
|
+
document.documentElement.style.cursor = J(X.dataset.handle), d = X.dataset.handle, y.push(he("mousemove", f)), y.push(he("mouseup", A)), y.push(he("touchmove", f)), y.push(he("touchend", A)), M(W);
|
|
2870
2894
|
}
|
|
2871
2895
|
function f(W) {
|
|
2872
|
-
const
|
|
2873
|
-
if (!
|
|
2896
|
+
const Y = Ae(e);
|
|
2897
|
+
if (!Y)
|
|
2874
2898
|
return;
|
|
2875
|
-
const V =
|
|
2899
|
+
const V = Y.$el, G = W.type === "touchmove" && W.touches.length > 0 ? W.touches[0] : W;
|
|
2876
2900
|
let X = G.clientX - c.value.x, ne = G.clientY - c.value.y;
|
|
2877
|
-
const fe = Ae(
|
|
2901
|
+
const fe = Ae(I);
|
|
2878
2902
|
if (d.includes("t")) {
|
|
2879
2903
|
const ce = Math.min(T, Math.max(P, (fe.height ?? 0) - ne));
|
|
2880
|
-
|
|
2904
|
+
w.height = ce, w.top = (fe.top ?? 0) + ne;
|
|
2881
2905
|
}
|
|
2882
2906
|
if (d.includes("b")) {
|
|
2883
2907
|
const ce = Math.min(T, Math.max(P, (fe.height ?? 0) + ne));
|
|
2884
|
-
|
|
2908
|
+
w.height = ce;
|
|
2885
2909
|
}
|
|
2886
2910
|
if (d.includes("l")) {
|
|
2887
2911
|
const ce = Math.min(x, Math.max(g, (fe.width ?? 0) - X));
|
|
2888
|
-
|
|
2912
|
+
w.width = ce, w.left = (fe.left ?? 0) + X;
|
|
2889
2913
|
}
|
|
2890
2914
|
if (d.includes("r")) {
|
|
2891
2915
|
const ce = Math.min(x, Math.max(g, (fe.width ?? 0) + X));
|
|
2892
|
-
|
|
2916
|
+
w.width = ce;
|
|
2893
2917
|
}
|
|
2894
|
-
V.dispatchEvent(new CustomEvent("resize")),
|
|
2918
|
+
V.dispatchEvent(new CustomEvent("resize")), M(W), ee(w);
|
|
2895
2919
|
}
|
|
2896
2920
|
function A() {
|
|
2897
2921
|
document.documentElement.style.cursor = "", d = null, y.forEach((W) => {
|
|
@@ -2899,19 +2923,19 @@ function Cn(e, t = {}) {
|
|
|
2899
2923
|
}), y.length = 0;
|
|
2900
2924
|
}
|
|
2901
2925
|
function J(W) {
|
|
2902
|
-
const
|
|
2926
|
+
const Y = {
|
|
2903
2927
|
t: "n",
|
|
2904
2928
|
r: "e",
|
|
2905
2929
|
b: "s",
|
|
2906
2930
|
l: "w"
|
|
2907
2931
|
};
|
|
2908
|
-
return W.split("").map((V) =>
|
|
2932
|
+
return W.split("").map((V) => Y[V]).join("") + "-resize";
|
|
2909
2933
|
}
|
|
2910
2934
|
function Q(W) {
|
|
2911
|
-
const
|
|
2912
|
-
if (!
|
|
2935
|
+
const Y = Ae(e);
|
|
2936
|
+
if (!Y)
|
|
2913
2937
|
return;
|
|
2914
|
-
const V =
|
|
2938
|
+
const V = Y.$el;
|
|
2915
2939
|
if (console.log(l), l !== "page" && W == "page") {
|
|
2916
2940
|
const ae = jt(V), G = Ae(ae) ?? null;
|
|
2917
2941
|
let X = 0;
|
|
@@ -2928,70 +2952,70 @@ function Cn(e, t = {}) {
|
|
|
2928
2952
|
}), he(V, "transitionend", () => {
|
|
2929
2953
|
V.style.width = "auto", V.style.top = "", V.style.left = "", V.style.position = "", V.style.transition = "", u.value = !1;
|
|
2930
2954
|
}, { once: !0 });
|
|
2931
|
-
} else if ((l == "page" ||
|
|
2932
|
-
V.style.transition = "width 0.5s, height 0.5s, top 0.5s, left 0.5s", u.value = !0,
|
|
2955
|
+
} else if ((l == "page" || Y.$el.style.position !== "absolute") && W !== "page") {
|
|
2956
|
+
V.style.transition = "width 0.5s, height 0.5s, top 0.5s, left 0.5s", u.value = !0, I = {
|
|
2933
2957
|
height: parseInt(window.getComputedStyle(V).getPropertyValue("height")),
|
|
2934
2958
|
width: parseInt(window.getComputedStyle(V).getPropertyValue("width")),
|
|
2935
2959
|
top: V.offsetTop,
|
|
2936
2960
|
left: V.offsetLeft,
|
|
2937
2961
|
position: "absolute"
|
|
2938
|
-
}, ee(
|
|
2939
|
-
const ae =
|
|
2940
|
-
W == "freestyle" ?
|
|
2962
|
+
}, ee(I), V.offsetHeight;
|
|
2963
|
+
const ae = I;
|
|
2964
|
+
W == "freestyle" ? w = {
|
|
2941
2965
|
height: ae.height,
|
|
2942
2966
|
width: (ae.width ?? 100) / 2,
|
|
2943
2967
|
top: (ae.top ?? 0) + 2,
|
|
2944
2968
|
left: (ae.left ?? 0) + 2,
|
|
2945
2969
|
position: "absolute"
|
|
2946
|
-
} : W == "blade" && (
|
|
2970
|
+
} : W == "blade" && (w = {
|
|
2947
2971
|
height: ae.height,
|
|
2948
2972
|
width: (ae.width ?? 100) / 2,
|
|
2949
2973
|
top: (ae.top ?? 0) + 2,
|
|
2950
2974
|
left: (ae.left ?? 0) + 2,
|
|
2951
2975
|
position: "absolute"
|
|
2952
|
-
}), ee(
|
|
2976
|
+
}), ee(w), he(V, "transitionend", () => {
|
|
2953
2977
|
V.style.transition = "", u.value = !1;
|
|
2954
2978
|
}, { once: !0 });
|
|
2955
2979
|
}
|
|
2956
2980
|
}
|
|
2957
2981
|
function ee(W) {
|
|
2958
|
-
const
|
|
2959
|
-
if (!
|
|
2982
|
+
const Y = Ae(e);
|
|
2983
|
+
if (!Y)
|
|
2960
2984
|
return;
|
|
2961
|
-
const V =
|
|
2985
|
+
const V = Y.$el;
|
|
2962
2986
|
W.top ? V.style.top = `${W.top}px` : V.style.top = void 0, W.left ? V.style.left = `${W.left}px` : V.style.left = void 0, W.height ? V.style.height = `${W.height}px` : V.style.height = void 0, W.width ? V.style.width = `${W.width}px` : V.style.width = void 0, W.position ? V.style.position = `${W.position}` : V.style.position = void 0, console.log(V.style.position);
|
|
2963
2987
|
}
|
|
2964
|
-
function ie(W,
|
|
2965
|
-
if (
|
|
2988
|
+
function ie(W, Y) {
|
|
2989
|
+
if (D.value)
|
|
2966
2990
|
return;
|
|
2967
2991
|
const V = Ae(e);
|
|
2968
|
-
V && (
|
|
2992
|
+
V && (b(V, W ?? Tn), Q(Y), r.push(he(V.$el, "mousedown", L)), r.push(he(V.$el, "touchstart", L)), D.value = !0, l = Y);
|
|
2969
2993
|
}
|
|
2970
2994
|
function we(W) {
|
|
2971
|
-
if (!
|
|
2995
|
+
if (!D.value)
|
|
2972
2996
|
return;
|
|
2973
|
-
const
|
|
2974
|
-
|
|
2997
|
+
const Y = Ae(e);
|
|
2998
|
+
Y && (_(Y), Q(W), r.forEach((V) => {
|
|
2975
2999
|
V();
|
|
2976
|
-
}), r.length = 0,
|
|
3000
|
+
}), r.length = 0, D.value = !1);
|
|
2977
3001
|
}
|
|
2978
3002
|
return {
|
|
2979
|
-
resizingIsOn:
|
|
3003
|
+
resizingIsOn: D,
|
|
2980
3004
|
turnResizingOn: ie,
|
|
2981
3005
|
turnResizingOff: we
|
|
2982
3006
|
};
|
|
2983
3007
|
}
|
|
2984
3008
|
function Pn(e) {
|
|
2985
|
-
const t = (e == null ? void 0 : e.blade) ??
|
|
3009
|
+
const t = (e == null ? void 0 : e.blade) ?? z(null), l = (e == null ? void 0 : e.handle) ?? z(null), S = z(!1), s = (e == null ? void 0 : e.mobileBreakpoint) ?? 500, g = z((e == null ? void 0 : e.defaultVariant) ?? "page"), x = z({}), { turnResizingOff: P, turnResizingOn: T } = Cn(t), { turnDraggableOff: N, turnDraggableOn: $ } = _n(t, l);
|
|
2986
3010
|
Kt(t, (h) => {
|
|
2987
3011
|
const u = h[0], { width: r } = u.contentRect;
|
|
2988
|
-
|
|
3012
|
+
S.value = r < s;
|
|
2989
3013
|
});
|
|
2990
3014
|
function d(h) {
|
|
2991
3015
|
N(), h == "page" ? P(h) : h == "blade" ? T(["l", "r"], h) : h == "freestyle" ? (P(), T(void 0, h), $()) : h == "inline" && P();
|
|
2992
3016
|
}
|
|
2993
3017
|
return d(g.value), _e(g, (h) => d(h)), {
|
|
2994
|
-
isMobile:
|
|
3018
|
+
isMobile: S,
|
|
2995
3019
|
variant: g,
|
|
2996
3020
|
bladeData: x
|
|
2997
3021
|
};
|
|
@@ -3033,9 +3057,9 @@ function wa(e) {
|
|
|
3033
3057
|
};
|
|
3034
3058
|
}
|
|
3035
3059
|
function Nn(e) {
|
|
3036
|
-
const t =
|
|
3060
|
+
const t = z({});
|
|
3037
3061
|
let l = e.vuetifyInstance;
|
|
3038
|
-
function
|
|
3062
|
+
function S() {
|
|
3039
3063
|
const d = localStorage.getItem("cosmetics");
|
|
3040
3064
|
d != null && d.length > 0 ? t.value = JSON.parse(d) : t.value = {
|
|
3041
3065
|
theme: e.defaultTheme ?? "light",
|
|
@@ -3086,7 +3110,7 @@ function Nn(e) {
|
|
|
3086
3110
|
h.colors.primary = (t.value.dark ?? { ...vr, ...e.defaultDarkTheme }).primary, u.colors.primary = (t.value.light ?? { ...mr, ...e.defaultLightTheme }).primary, (d = document.querySelector('meta[name="theme-color"]')) == null || d.setAttribute("content", "");
|
|
3087
3111
|
}
|
|
3088
3112
|
}
|
|
3089
|
-
return
|
|
3113
|
+
return S(), _e(t, () => {
|
|
3090
3114
|
s();
|
|
3091
3115
|
}), Dr = {
|
|
3092
3116
|
state: t,
|
|
@@ -3105,37 +3129,37 @@ function Mn() {
|
|
|
3105
3129
|
function e(t) {
|
|
3106
3130
|
const {
|
|
3107
3131
|
items: l,
|
|
3108
|
-
headers:
|
|
3132
|
+
headers: S,
|
|
3109
3133
|
fileName: s = "data.csv",
|
|
3110
3134
|
format: g = "file"
|
|
3111
3135
|
} = t;
|
|
3112
3136
|
if (!Te(l))
|
|
3113
3137
|
return;
|
|
3114
3138
|
let x = [];
|
|
3115
|
-
|
|
3116
|
-
header:
|
|
3117
|
-
itemText:
|
|
3118
|
-
value:
|
|
3119
|
-
})) : x = Object.keys(l[0]).map((
|
|
3139
|
+
S != null ? x = S == null ? void 0 : S.filter((D) => (D.csv ?? D.csvText ?? D.csvFilter ?? D.csvArray) != null).map((D) => ({
|
|
3140
|
+
header: D.title ?? D.value ?? "",
|
|
3141
|
+
itemText: D.itemText,
|
|
3142
|
+
value: D.value
|
|
3143
|
+
})) : x = Object.keys(l[0]).map((D) => ({ header: nn(D) ?? "", value: D })), x = x.filter((D) => D.header.length > 0);
|
|
3120
3144
|
var P = [];
|
|
3121
|
-
for (let
|
|
3122
|
-
const c = l[
|
|
3145
|
+
for (let D = 0; D < l.length; D++) {
|
|
3146
|
+
const c = l[D];
|
|
3123
3147
|
var T = {}, N = [];
|
|
3124
|
-
for (let
|
|
3125
|
-
const
|
|
3148
|
+
for (let I = 0; I < x.length; I++) {
|
|
3149
|
+
const w = x[I];
|
|
3126
3150
|
var $ = null;
|
|
3127
|
-
typeof
|
|
3151
|
+
typeof w.value == "function" ? $ = w.value(c) : typeof w.value == "string" && ($ = Sr(c, w.value)), w.itemText != null ? T[w.header] = Sr($, w.itemText) : T[w.header] = $;
|
|
3128
3152
|
}
|
|
3129
|
-
P.push(T), Te(N) && N.forEach((
|
|
3130
|
-
P.push(
|
|
3153
|
+
P.push(T), Te(N) && N.forEach((I) => {
|
|
3154
|
+
P.push(I);
|
|
3131
3155
|
}), N = [];
|
|
3132
3156
|
}
|
|
3133
3157
|
var d = [];
|
|
3134
|
-
if (d.push(x.map((
|
|
3158
|
+
if (d.push(x.map((D) => D.header).toString()), P.forEach((D) => {
|
|
3135
3159
|
let c = [];
|
|
3136
|
-
x.forEach(function(
|
|
3137
|
-
var
|
|
3138
|
-
c.push(
|
|
3160
|
+
x.forEach(function(I) {
|
|
3161
|
+
var w = D[I.header];
|
|
3162
|
+
c.push(w ?? "");
|
|
3139
3163
|
}), d.push(c.join(","));
|
|
3140
3164
|
}), g == "array")
|
|
3141
3165
|
return d;
|
|
@@ -3163,7 +3187,7 @@ function Ln(e) {
|
|
|
3163
3187
|
function l() {
|
|
3164
3188
|
return s().startOf("day").toUTC().toString() ?? "";
|
|
3165
3189
|
}
|
|
3166
|
-
function
|
|
3190
|
+
function S() {
|
|
3167
3191
|
return s().startOf("day").plus({ day: 1 }).toUTC().toString() ?? "";
|
|
3168
3192
|
}
|
|
3169
3193
|
function s(T, N) {
|
|
@@ -3192,7 +3216,7 @@ function Ln(e) {
|
|
|
3192
3216
|
}
|
|
3193
3217
|
return xr = {
|
|
3194
3218
|
getToday: l,
|
|
3195
|
-
getTomorrow:
|
|
3219
|
+
getTomorrow: S,
|
|
3196
3220
|
tzDate: s,
|
|
3197
3221
|
tzString: g,
|
|
3198
3222
|
utcDate: x,
|
|
@@ -3204,8 +3228,8 @@ function Aa() {
|
|
|
3204
3228
|
return _r;
|
|
3205
3229
|
}
|
|
3206
3230
|
function Rn(e) {
|
|
3207
|
-
const t =
|
|
3208
|
-
function
|
|
3231
|
+
const t = z(!1), l = (e == null ? void 0 : e.apis) ?? [];
|
|
3232
|
+
function S() {
|
|
3209
3233
|
t.value = !0;
|
|
3210
3234
|
}
|
|
3211
3235
|
function s() {
|
|
@@ -3225,7 +3249,7 @@ function Rn(e) {
|
|
|
3225
3249
|
return Promise.resolve("no demo data available for this api");
|
|
3226
3250
|
const h = d.id ?? ((r = d.data) == null ? void 0 : r.id), u = g(d);
|
|
3227
3251
|
if (h != null && (u == null ? void 0 : u.data) != null) {
|
|
3228
|
-
const y = u.data.findIndex((
|
|
3252
|
+
const y = u.data.findIndex((D) => D.id == h);
|
|
3229
3253
|
y >= 0 && u.data.splice(y, 1);
|
|
3230
3254
|
}
|
|
3231
3255
|
return new Promise(function(y) {
|
|
@@ -3235,14 +3259,14 @@ function Rn(e) {
|
|
|
3235
3259
|
});
|
|
3236
3260
|
}
|
|
3237
3261
|
function P(d) {
|
|
3238
|
-
var y,
|
|
3262
|
+
var y, D, c;
|
|
3239
3263
|
if (l == null)
|
|
3240
3264
|
throw new Error("no demo data available for this api");
|
|
3241
3265
|
const h = d.id ?? ((y = d.data) == null ? void 0 : y.id), u = g(d);
|
|
3242
3266
|
let r;
|
|
3243
|
-
return u != null && (u.data ?? (u.data = []), u.getAction != null ? r = u.getAction(u.data, h) : h != null ? r = (
|
|
3267
|
+
return u != null && (u.data ?? (u.data = []), u.getAction != null ? r = u.getAction(u.data, h) : h != null ? r = (D = u.data) == null ? void 0 : D.find((I) => I.id == h) : u.path != null && ((c = u.data) == null ? void 0 : c.length) == 1 && (r = u.data[0])), r == null ? Promise.resolve(void 0) : new Promise((I) => {
|
|
3244
3268
|
setTimeout(() => {
|
|
3245
|
-
|
|
3269
|
+
I({
|
|
3246
3270
|
data: r
|
|
3247
3271
|
});
|
|
3248
3272
|
});
|
|
@@ -3269,9 +3293,9 @@ function Rn(e) {
|
|
|
3269
3293
|
throw new Error("no demo data available for this api");
|
|
3270
3294
|
const h = g(d);
|
|
3271
3295
|
let u;
|
|
3272
|
-
return h != null && (h.data ?? (h.data = []), h.postAction != null ? u = h.postAction(h.data, d.data) : d.data != null && (d.data.id == null && (d.data.id = ((((r = h.data) == null ? void 0 : r.length) ?? 0) + 1).toString()), u = d.data, (y = h.data) == null || y.push(u))), u == null ? Promise.resolve(void 0) : new Promise((
|
|
3296
|
+
return h != null && (h.data ?? (h.data = []), h.postAction != null ? u = h.postAction(h.data, d.data) : d.data != null && (d.data.id == null && (d.data.id = ((((r = h.data) == null ? void 0 : r.length) ?? 0) + 1).toString()), u = d.data, (y = h.data) == null || y.push(u))), u == null ? Promise.resolve(void 0) : new Promise((D) => {
|
|
3273
3297
|
setTimeout(() => {
|
|
3274
|
-
|
|
3298
|
+
D({
|
|
3275
3299
|
data: u
|
|
3276
3300
|
});
|
|
3277
3301
|
});
|
|
@@ -3287,13 +3311,13 @@ function Rn(e) {
|
|
|
3287
3311
|
if (h.data ?? (h.data = []), h.patchAction != null)
|
|
3288
3312
|
u = h.patchAction(h.data, d.data);
|
|
3289
3313
|
else if (d.data.id != null) {
|
|
3290
|
-
const
|
|
3291
|
-
|
|
3314
|
+
const D = (r = h.data) == null ? void 0 : r.findIndex((c) => c.id == d.data.id);
|
|
3315
|
+
D != null && D > -1 && ((y = h.data) == null || y.splice(D, 1, d.data)), u = d.data;
|
|
3292
3316
|
}
|
|
3293
3317
|
}
|
|
3294
|
-
return u == null ? Promise.resolve(void 0) : new Promise((
|
|
3318
|
+
return u == null ? Promise.resolve(void 0) : new Promise((D) => {
|
|
3295
3319
|
setTimeout(() => {
|
|
3296
|
-
|
|
3320
|
+
D({
|
|
3297
3321
|
data: u
|
|
3298
3322
|
});
|
|
3299
3323
|
});
|
|
@@ -3302,7 +3326,7 @@ function Rn(e) {
|
|
|
3302
3326
|
return _r = {
|
|
3303
3327
|
endDemo: s,
|
|
3304
3328
|
isDemoing: t,
|
|
3305
|
-
startDemo:
|
|
3329
|
+
startDemo: S,
|
|
3306
3330
|
data: l,
|
|
3307
3331
|
deleteItem: x,
|
|
3308
3332
|
get: P,
|
|
@@ -3311,15 +3335,15 @@ function Rn(e) {
|
|
|
3311
3335
|
patch: $
|
|
3312
3336
|
}, _r;
|
|
3313
3337
|
}
|
|
3314
|
-
var
|
|
3315
|
-
function
|
|
3338
|
+
var Un = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
3339
|
+
function Ia(e) {
|
|
3316
3340
|
function t(l) {
|
|
3317
3341
|
var s;
|
|
3318
|
-
const
|
|
3319
|
-
if (
|
|
3320
|
-
document.title =
|
|
3342
|
+
const S = l.matched.slice().reverse().find((g) => g.meta && g.meta.title);
|
|
3343
|
+
if (S)
|
|
3344
|
+
document.title = S.meta.title;
|
|
3321
3345
|
else {
|
|
3322
|
-
const g =
|
|
3346
|
+
const g = Un.NODE_ENV;
|
|
3323
3347
|
let x = "";
|
|
3324
3348
|
g == "development" ? x = "BWeb Dev" : g == "staging" ? x = "BlitzIt Sandpit" : x = "BlitzIt Web | Cloud-Based Wholesale Logistics Platform", ((s = e == null ? void 0 : e.demo) == null ? void 0 : s.isDemoing.value) == !0 && (x = `Training: ${x}`), document.title = x;
|
|
3325
3349
|
}
|
|
@@ -3329,10 +3353,10 @@ function Ea(e) {
|
|
|
3329
3353
|
};
|
|
3330
3354
|
}
|
|
3331
3355
|
let Tr;
|
|
3332
|
-
function
|
|
3356
|
+
function Ea() {
|
|
3333
3357
|
return Tr;
|
|
3334
3358
|
}
|
|
3335
|
-
function
|
|
3359
|
+
function Bn(e) {
|
|
3336
3360
|
function t(f, A, J) {
|
|
3337
3361
|
return f ? ln(f) ? J ?? "" : e.dates.tzString(f, A) : J ?? f ?? "";
|
|
3338
3362
|
}
|
|
@@ -3344,7 +3368,7 @@ function Un(e) {
|
|
|
3344
3368
|
var A = "";
|
|
3345
3369
|
return f.companyAccount != null && (A = f.companyAccount.companyName + " | "), f.addressLineOne != null && (A = A + f.addressLineOne + " "), f.streetNumber != null && (A = A + f.streetNumber + " "), f.streetName != null && (A = A + f.streetName + ", "), f.suburb != null && (A = A + f.suburb + " "), f.state != null && (A = A + f.state + " "), f.postcode != null && (A = A + f.postcode), A;
|
|
3346
3370
|
}
|
|
3347
|
-
function
|
|
3371
|
+
function S(f) {
|
|
3348
3372
|
if (typeof f != "number")
|
|
3349
3373
|
return f;
|
|
3350
3374
|
var A = new Intl.NumberFormat("en-US", {
|
|
@@ -3398,7 +3422,7 @@ function Un(e) {
|
|
|
3398
3422
|
function y(f, A) {
|
|
3399
3423
|
return t(f, "ddd DD MMM YYYY", A);
|
|
3400
3424
|
}
|
|
3401
|
-
function
|
|
3425
|
+
function D(f, A) {
|
|
3402
3426
|
return t(f, "ccc dd LLL yyyy hh:mm a", A);
|
|
3403
3427
|
}
|
|
3404
3428
|
function c(f) {
|
|
@@ -3408,24 +3432,24 @@ function Un(e) {
|
|
|
3408
3432
|
});
|
|
3409
3433
|
return A.format(f);
|
|
3410
3434
|
}
|
|
3411
|
-
function
|
|
3435
|
+
function I(f) {
|
|
3412
3436
|
return f.replaceAll(",", " ");
|
|
3413
3437
|
}
|
|
3414
|
-
function
|
|
3438
|
+
function w(f, A) {
|
|
3415
3439
|
return t(f, "dd LLL yyyy", A);
|
|
3416
3440
|
}
|
|
3417
|
-
function
|
|
3441
|
+
function M(f, A) {
|
|
3418
3442
|
return t(f, "dd LLL yyyy hh:mm a", A);
|
|
3419
3443
|
}
|
|
3420
|
-
function
|
|
3444
|
+
function b(f, A) {
|
|
3421
3445
|
return t(f, "hh:mm a", A);
|
|
3422
3446
|
}
|
|
3423
3447
|
function _(f) {
|
|
3424
3448
|
return f == null ? "" : typeof f == "number" ? e.dates.tzDate().startOf("day").plus({ minutes: f }).toFormat("T") : typeof f == "string" ? e.dates.tzString(f, "t") : "unknown";
|
|
3425
3449
|
}
|
|
3426
|
-
const
|
|
3450
|
+
const E = {
|
|
3427
3451
|
toCompanyNameAndLocationLine: l,
|
|
3428
|
-
toCurrency:
|
|
3452
|
+
toCurrency: S,
|
|
3429
3453
|
toDayDate: s,
|
|
3430
3454
|
toDayMonth: g,
|
|
3431
3455
|
toDayOfWeek: x,
|
|
@@ -3438,31 +3462,31 @@ function Un(e) {
|
|
|
3438
3462
|
toLocationLine: u,
|
|
3439
3463
|
toLocationLineNoCommas: r,
|
|
3440
3464
|
toLongDate: y,
|
|
3441
|
-
toLongDateAndTime:
|
|
3465
|
+
toLongDateAndTime: D,
|
|
3442
3466
|
toPercent: c,
|
|
3443
|
-
toPrettyCSV:
|
|
3444
|
-
toShortDate:
|
|
3445
|
-
toShortDateAndTime:
|
|
3446
|
-
toTime:
|
|
3467
|
+
toPrettyCSV: I,
|
|
3468
|
+
toShortDate: w,
|
|
3469
|
+
toShortDateAndTime: M,
|
|
3470
|
+
toTime: b,
|
|
3447
3471
|
toTimeOfDay: _
|
|
3448
3472
|
};
|
|
3449
|
-
function
|
|
3473
|
+
function L(f) {
|
|
3450
3474
|
if (f != null) {
|
|
3451
3475
|
let A = f;
|
|
3452
|
-
if (A != null &&
|
|
3453
|
-
return
|
|
3476
|
+
if (A != null && E[A] != null)
|
|
3477
|
+
return E[A];
|
|
3454
3478
|
}
|
|
3455
3479
|
return (A) => A;
|
|
3456
3480
|
}
|
|
3457
3481
|
return Tr = {
|
|
3458
|
-
findFilter:
|
|
3459
|
-
...
|
|
3482
|
+
findFilter: L,
|
|
3483
|
+
...E
|
|
3460
3484
|
}, Tr;
|
|
3461
3485
|
}
|
|
3462
3486
|
function $n(e, t) {
|
|
3463
|
-
const l =
|
|
3487
|
+
const l = z(!1), S = Zt(e);
|
|
3464
3488
|
let s = g(K(e));
|
|
3465
|
-
(t == null ? void 0 : t.useTracker) !== !1 && _e(
|
|
3489
|
+
(t == null ? void 0 : t.useTracker) !== !1 && _e(S, (P) => {
|
|
3466
3490
|
l.value = g(P) != s;
|
|
3467
3491
|
}, { deep: !0 });
|
|
3468
3492
|
function g(P) {
|
|
@@ -3474,10 +3498,10 @@ function $n(e, t) {
|
|
|
3474
3498
|
})), JSON.stringify(T);
|
|
3475
3499
|
}
|
|
3476
3500
|
function x() {
|
|
3477
|
-
s = g(K(
|
|
3501
|
+
s = g(K(S)), l.value = !1;
|
|
3478
3502
|
}
|
|
3479
3503
|
return {
|
|
3480
|
-
asyncItem:
|
|
3504
|
+
asyncItem: S,
|
|
3481
3505
|
isChanged: l,
|
|
3482
3506
|
restartTracker: x
|
|
3483
3507
|
};
|
|
@@ -3487,18 +3511,18 @@ function Da(e, t) {
|
|
|
3487
3511
|
const {
|
|
3488
3512
|
// useBladeSrc = true,
|
|
3489
3513
|
useRouteSrc: l = !0
|
|
3490
|
-
} = t ?? {},
|
|
3514
|
+
} = t ?? {}, S = e.storeMode ?? (t == null ? void 0 : t.storeMode), s = e.storageMode ?? (t == null ? void 0 : t.storageMode), g = e.nav ?? e.bladeName ?? "basic", x = Mr(), P = rt(), T = K(e.proxyQueryKey), N = te(() => {
|
|
3491
3515
|
var G;
|
|
3492
3516
|
return K(e.proxyID) ?? (T != null ? (G = P == null ? void 0 : P.query) == null ? void 0 : G[T] : void 0);
|
|
3493
|
-
}), $ =
|
|
3517
|
+
}), $ = z(void 0), { actionErrorMsg: d, actionLoadingMsg: h, deleteItem: u, getItem: r, getAllItems: y, restoreItem: D, saveItem: c } = it({
|
|
3494
3518
|
nav: g,
|
|
3495
3519
|
proxyID: N.value,
|
|
3496
3520
|
store: Le({
|
|
3497
|
-
storeMode:
|
|
3521
|
+
storeMode: S,
|
|
3498
3522
|
storageMode: s,
|
|
3499
3523
|
nav: g
|
|
3500
3524
|
})
|
|
3501
|
-
}),
|
|
3525
|
+
}), I = te(() => e.errorMsg ?? d.value), w = te(() => e.loadingMsg ?? h.value), M = te(() => w.value != null), b = z(e.itemID ?? (l ? (ae = P == null ? void 0 : P.params) == null ? void 0 : ae.id : void 0)), _ = z(b.value == "new" ? "new" : e.startEditing ? "edit" : "view"), E = Re(!1), L = te(() => {
|
|
3502
3526
|
if (_.value == "new")
|
|
3503
3527
|
return !1;
|
|
3504
3528
|
const G = K($);
|
|
@@ -3547,7 +3571,7 @@ function Da(e, t) {
|
|
|
3547
3571
|
onRestoreSuccessAsync: fe,
|
|
3548
3572
|
proxyID: ce
|
|
3549
3573
|
} = { ...e };
|
|
3550
|
-
|
|
3574
|
+
D({
|
|
3551
3575
|
additionalUrl: X,
|
|
3552
3576
|
data: G,
|
|
3553
3577
|
nav: g,
|
|
@@ -3559,12 +3583,12 @@ function Da(e, t) {
|
|
|
3559
3583
|
});
|
|
3560
3584
|
}
|
|
3561
3585
|
async function W(G) {
|
|
3562
|
-
if (
|
|
3586
|
+
if (E.value = !1, e.item != null)
|
|
3563
3587
|
$.value = e.item;
|
|
3564
3588
|
else {
|
|
3565
3589
|
const X = {
|
|
3566
3590
|
additionalUrl: e.additionalUrl,
|
|
3567
|
-
id:
|
|
3591
|
+
id: b.value,
|
|
3568
3592
|
nav: g,
|
|
3569
3593
|
proxyID: N.value,
|
|
3570
3594
|
params: e.params,
|
|
@@ -3582,12 +3606,12 @@ function Da(e, t) {
|
|
|
3582
3606
|
}
|
|
3583
3607
|
ee();
|
|
3584
3608
|
}
|
|
3585
|
-
function
|
|
3609
|
+
function Y(G, X) {
|
|
3586
3610
|
const {
|
|
3587
3611
|
additionalUrl: ne,
|
|
3588
3612
|
onCanSaveAsync: fe,
|
|
3589
3613
|
onGetSaveAsync: ce,
|
|
3590
|
-
onSaveAsync:
|
|
3614
|
+
onSaveAsync: Ie,
|
|
3591
3615
|
onSaveSuccessAsync: $e = (Ce) => ((X == null ? void 0 : X.navBack) === !0 ? x.back() : (G.rowVersion != null && Ce.rowVersion != null && (G.rowVersion = Ce.rowVersion), ee(), _.value = "view"), Promise.resolve(void 0))
|
|
3592
3616
|
} = { ...e };
|
|
3593
3617
|
c({
|
|
@@ -3596,7 +3620,7 @@ function Da(e, t) {
|
|
|
3596
3620
|
nav: g,
|
|
3597
3621
|
onCanSaveAsync: fe,
|
|
3598
3622
|
onGetSaveAsync: ce,
|
|
3599
|
-
onSaveAsync:
|
|
3623
|
+
onSaveAsync: Ie,
|
|
3600
3624
|
onSaveSuccessAsync: $e,
|
|
3601
3625
|
proxyID: N.value,
|
|
3602
3626
|
// ...params.getOptions(),
|
|
@@ -3608,8 +3632,8 @@ function Da(e, t) {
|
|
|
3608
3632
|
const G = K(_);
|
|
3609
3633
|
!G || G == "view" ? _.value = "edit" : G == "edit" && (_.value = "view");
|
|
3610
3634
|
}
|
|
3611
|
-
return _e(
|
|
3612
|
-
|
|
3635
|
+
return _e(I, (G) => {
|
|
3636
|
+
E.value = G != null;
|
|
3613
3637
|
}), _e(() => e.refreshToggle, () => {
|
|
3614
3638
|
W({ deepRefresh: !0 });
|
|
3615
3639
|
}), Or(async () => {
|
|
@@ -3618,25 +3642,25 @@ function Da(e, t) {
|
|
|
3618
3642
|
}), {
|
|
3619
3643
|
asyncItem: $,
|
|
3620
3644
|
deleteItem: ie,
|
|
3621
|
-
errorMsg:
|
|
3645
|
+
errorMsg: I,
|
|
3622
3646
|
isChanged: Q,
|
|
3623
|
-
isDeletable:
|
|
3647
|
+
isDeletable: L,
|
|
3624
3648
|
isEditing: te(() => _.value == "new" || _.value == "edit"),
|
|
3625
3649
|
isEditable: f,
|
|
3626
|
-
isLoading:
|
|
3650
|
+
isLoading: M,
|
|
3627
3651
|
isNew: te(() => _.value == "new"),
|
|
3628
3652
|
isRestorable: A,
|
|
3629
3653
|
isSaveable: J,
|
|
3630
|
-
loadingMsg:
|
|
3654
|
+
loadingMsg: w,
|
|
3631
3655
|
mode: _,
|
|
3632
3656
|
refresh: W,
|
|
3633
3657
|
restoreItem: we,
|
|
3634
|
-
saveItem:
|
|
3635
|
-
showError:
|
|
3658
|
+
saveItem: Y,
|
|
3659
|
+
showError: E,
|
|
3636
3660
|
toggleMode: V
|
|
3637
3661
|
};
|
|
3638
3662
|
}
|
|
3639
|
-
const
|
|
3663
|
+
const zr = z(!0), Yr = z(!1), Zr = z(), gr = z(!1);
|
|
3640
3664
|
let yr = null, Cr;
|
|
3641
3665
|
function ct() {
|
|
3642
3666
|
return Cr;
|
|
@@ -3653,7 +3677,7 @@ function Fn(e) {
|
|
|
3653
3677
|
displayName: h.displayName ?? e.getDisplayName(h),
|
|
3654
3678
|
...h
|
|
3655
3679
|
}));
|
|
3656
|
-
function
|
|
3680
|
+
function S(h) {
|
|
3657
3681
|
var u;
|
|
3658
3682
|
return (u = P(h)) == null ? void 0 : u.archiveName;
|
|
3659
3683
|
}
|
|
@@ -3672,7 +3696,7 @@ function Fn(e) {
|
|
|
3672
3696
|
function P(h) {
|
|
3673
3697
|
return h == null ? null : typeof h != "string" ? h : nt(l, (r) => r.children).find((r) => {
|
|
3674
3698
|
var y;
|
|
3675
|
-
return r.name == h || r.singleName == h || ((y = r.aliases) == null ? void 0 : y.some((
|
|
3699
|
+
return r.name == h || r.singleName == h || ((y = r.aliases) == null ? void 0 : y.some((D) => D == h));
|
|
3676
3700
|
}) ?? null;
|
|
3677
3701
|
}
|
|
3678
3702
|
function T(h) {
|
|
@@ -3680,7 +3704,7 @@ function Fn(e) {
|
|
|
3680
3704
|
if (u == null)
|
|
3681
3705
|
return;
|
|
3682
3706
|
let r = yn(u.microservice ?? "default") ?? "";
|
|
3683
|
-
return u.path != null && (r =
|
|
3707
|
+
return u.path != null && (r = Be(r, u.path)), r != null && r.endsWith("/") && (r = r.slice(0, r.length - 1)), r;
|
|
3684
3708
|
}
|
|
3685
3709
|
function N(h) {
|
|
3686
3710
|
const u = P(h);
|
|
@@ -3698,17 +3722,17 @@ function Fn(e) {
|
|
|
3698
3722
|
if (h == null)
|
|
3699
3723
|
return;
|
|
3700
3724
|
const u = typeof h == "string" ? P(h) : h;
|
|
3701
|
-
|
|
3725
|
+
Zr.value = u == null ? void 0 : u.background, Yr.value = (u == null ? void 0 : u.hideNavigation) !== !0, zr.value = (u == null ? void 0 : u.hideAppBar) !== !0, yr != null && yr(), gr.value = (u == null ? void 0 : u.hesitate) === !0, gr.value && (yr = window.addEventListener("beforeunload", (r) => {
|
|
3702
3726
|
r.preventDefault();
|
|
3703
3727
|
}));
|
|
3704
3728
|
}
|
|
3705
3729
|
return Cr = {
|
|
3706
|
-
showAppBar:
|
|
3707
|
-
showAppNavigation:
|
|
3708
|
-
backgroundName:
|
|
3730
|
+
showAppBar: zr,
|
|
3731
|
+
showAppNavigation: Yr,
|
|
3732
|
+
backgroundName: Zr,
|
|
3709
3733
|
hesitate: gr,
|
|
3710
3734
|
navigationItems: l,
|
|
3711
|
-
findArchiveName:
|
|
3735
|
+
findArchiveName: S,
|
|
3712
3736
|
findCacheHours: s,
|
|
3713
3737
|
findDisplay: g,
|
|
3714
3738
|
findIcon: x,
|
|
@@ -3721,17 +3745,17 @@ function Fn(e) {
|
|
|
3721
3745
|
}
|
|
3722
3746
|
function xa(e, t, l) {
|
|
3723
3747
|
var qe, Ve;
|
|
3724
|
-
const
|
|
3725
|
-
...u.filter((
|
|
3748
|
+
const S = Mn(), s = ct(), g = Mr(), x = rt(), { bladeData: P } = Pn({}), T = e.useBladeSrc ?? !0, N = e.useRouteSrc ?? !0, $ = e.nav ?? e.bladeName ?? e.itemBladeName ?? "basic", d = e.storeMode ?? ((qe = s.findItem($)) == null ? void 0 : qe.storeMode), h = e.storageMode ?? ((Ve = s.findItem($)) == null ? void 0 : Ve.storageMode), u = K(e.customFilters) ?? [], r = z([]), y = te(() => Qt([
|
|
3749
|
+
...u.filter((U) => U.name != null).map((U) => U.name),
|
|
3726
3750
|
...e.defaultFilters ?? [],
|
|
3727
3751
|
...r.value
|
|
3728
|
-
]).value),
|
|
3729
|
-
let c =
|
|
3730
|
-
const
|
|
3731
|
-
function
|
|
3732
|
-
var
|
|
3752
|
+
]).value), D = z((e.defaultFilters ?? []).map((U) => y.value.indexOf(U)));
|
|
3753
|
+
let c = z([...D.value]);
|
|
3754
|
+
const I = te(() => Wr(c, D).value.length > 0 || Wr(D, c).value.length > 0), w = z(M());
|
|
3755
|
+
function M() {
|
|
3756
|
+
var U, j;
|
|
3733
3757
|
if (T) {
|
|
3734
|
-
const H = (
|
|
3758
|
+
const H = (U = P.value) == null ? void 0 : U.page;
|
|
3735
3759
|
if (H != null)
|
|
3736
3760
|
return Number.parseInt(H);
|
|
3737
3761
|
}
|
|
@@ -3742,10 +3766,10 @@ function xa(e, t, l) {
|
|
|
3742
3766
|
}
|
|
3743
3767
|
return 1;
|
|
3744
3768
|
}
|
|
3745
|
-
const
|
|
3746
|
-
var
|
|
3769
|
+
const b = te(() => {
|
|
3770
|
+
var U, j;
|
|
3747
3771
|
if (T) {
|
|
3748
|
-
const H = (
|
|
3772
|
+
const H = (U = P.value) == null ? void 0 : U.proxyID;
|
|
3749
3773
|
if (H != null)
|
|
3750
3774
|
return H;
|
|
3751
3775
|
}
|
|
@@ -3755,11 +3779,11 @@ function xa(e, t, l) {
|
|
|
3755
3779
|
return H;
|
|
3756
3780
|
}
|
|
3757
3781
|
return e.proxyID;
|
|
3758
|
-
}), _ =
|
|
3759
|
-
function
|
|
3760
|
-
var
|
|
3782
|
+
}), _ = z(E());
|
|
3783
|
+
function E() {
|
|
3784
|
+
var U, j;
|
|
3761
3785
|
if (T) {
|
|
3762
|
-
const H = (
|
|
3786
|
+
const H = (U = P.value) == null ? void 0 : U.search;
|
|
3763
3787
|
if (H != null)
|
|
3764
3788
|
return H;
|
|
3765
3789
|
}
|
|
@@ -3769,62 +3793,62 @@ function xa(e, t, l) {
|
|
|
3769
3793
|
return H;
|
|
3770
3794
|
}
|
|
3771
3795
|
}
|
|
3772
|
-
const
|
|
3796
|
+
const L = z(K(e.startShowingInactive) ?? !1), f = te(() => [
|
|
3773
3797
|
...e.searchProps ?? [],
|
|
3774
|
-
...(e.headers ?? []).filter((
|
|
3775
|
-
]), A =
|
|
3798
|
+
...(e.headers ?? []).filter((U) => U.searchable != null && U.value != null).map((U) => U.value ?? "")
|
|
3799
|
+
]), A = z([]), J = Re([]), Q = z([]);
|
|
3776
3800
|
let ee;
|
|
3777
|
-
const { actionErrorMsg: ie, actionLoadingMsg: we, deleteItem: W, doAction:
|
|
3801
|
+
const { actionErrorMsg: ie, actionLoadingMsg: we, deleteItem: W, doAction: Y, getItem: V, getAllItems: ae, restoreItem: G } = it({
|
|
3778
3802
|
nav: $,
|
|
3779
|
-
proxyID:
|
|
3803
|
+
proxyID: b.value,
|
|
3780
3804
|
store: Le({
|
|
3781
3805
|
storeMode: d,
|
|
3782
3806
|
storageMode: h,
|
|
3783
3807
|
nav: $
|
|
3784
3808
|
})
|
|
3785
|
-
}), X = te(() => e.errorMsg ?? ie.value), ne = te(() => e.loadingMsg ?? we.value), fe = te(() => ne.value != null), ce = Re(!1),
|
|
3786
|
-
let
|
|
3787
|
-
|
|
3809
|
+
}), X = te(() => e.errorMsg ?? ie.value), ne = te(() => e.loadingMsg ?? we.value), fe = te(() => ne.value != null), ce = Re(!1), Ie = Re(e.showSearch ?? !0), $e = z(0), Ce = te(() => {
|
|
3810
|
+
let U, j = [];
|
|
3811
|
+
D.value.forEach((O) => {
|
|
3788
3812
|
const oe = y.value[O], ve = u.find((De) => De.name == oe);
|
|
3789
|
-
ve != null ?
|
|
3813
|
+
ve != null ? U = U != null ? `${U}ANDALSO${ve.filterFunction()}` : ve.filterFunction() : j.push(oe);
|
|
3790
3814
|
});
|
|
3791
3815
|
const H = {};
|
|
3792
|
-
return Te(j) && (H.filterBy = j.toString()),
|
|
3816
|
+
return Te(j) && (H.filterBy = j.toString()), U != null && (H.query = U), H;
|
|
3793
3817
|
}), rr = te(() => {
|
|
3794
3818
|
var j;
|
|
3795
|
-
let
|
|
3796
|
-
return e.useServerPagination && e.itemsPerPage != null && (
|
|
3797
|
-
}), tr = te(() => (
|
|
3798
|
-
let
|
|
3819
|
+
let U = e.params != null ? { ...e.params } : {};
|
|
3820
|
+
return e.useServerPagination && e.itemsPerPage != null && (U.includeCount = !0, U.takeAmount = e.itemsPerPage, U.takeFrom = (w.value - 1) * e.itemsPerPage), Ce.value != null && (U = { ...U, ...Ce.value }), L.value && (U.includeInactive = !0), Te(e.selectProps) && (U.properties = (j = e.selectProps) == null ? void 0 : j.toString()), _.value != null && (U.searchString = _.value), U;
|
|
3821
|
+
}), tr = te(() => (U) => e.onCanDelete != null ? e.onCanDelete(U) : !(U != null && U.isInactive === !0)), nr = te(() => (U) => L.value ? e.onCanRestore != null ? e.onCanRestore(U) : (U == null ? void 0 : U.isInactive) === !0 : !1), Pe = te(() => Q.value.filter((U) => !U.hide)), ar = te(() => {
|
|
3822
|
+
let U = new Array();
|
|
3799
3823
|
return Pe.value.filter((H) => H.sublevel != null).forEach((H) => {
|
|
3800
|
-
let O =
|
|
3801
|
-
O == null ?
|
|
3802
|
-
}),
|
|
3824
|
+
let O = U.find((oe) => oe.position == H.sublevel);
|
|
3825
|
+
O == null ? U.push({ position: H.sublevel ?? 0, values: [H] }) : O.values.push(H);
|
|
3826
|
+
}), U.sort(Ue.firstBy((H) => H.position));
|
|
3803
3827
|
}), lr = te(() => {
|
|
3804
|
-
let
|
|
3828
|
+
let U = new Array();
|
|
3805
3829
|
return Pe.value.filter((H) => H.level != null).forEach((H) => {
|
|
3806
|
-
let O =
|
|
3807
|
-
O == null ?
|
|
3808
|
-
}),
|
|
3809
|
-
}), ur = te(() => Pe.value.filter((
|
|
3810
|
-
function be(
|
|
3830
|
+
let O = U.find((oe) => oe.position == H.level);
|
|
3831
|
+
O == null ? U.push({ position: H.level ?? 0, values: [H] }) : O.values.push(H);
|
|
3832
|
+
}), U.sort(Ue.firstBy((H) => H.position));
|
|
3833
|
+
}), ur = te(() => Pe.value.filter((U) => U.nav != null && U.itemText != null || U.textFilter != null || U.display != null || U.bool != null));
|
|
3834
|
+
function be(U) {
|
|
3811
3835
|
if (e.itemBladeName != null) {
|
|
3812
3836
|
let j = {
|
|
3813
3837
|
bladeName: e.itemBladeName,
|
|
3814
3838
|
id: "new",
|
|
3815
3839
|
nav: $
|
|
3816
3840
|
};
|
|
3817
|
-
|
|
3841
|
+
U == "page" && g.push({
|
|
3818
3842
|
name: j.bladeName,
|
|
3819
3843
|
params: { id: "new" }
|
|
3820
3844
|
});
|
|
3821
3845
|
}
|
|
3822
3846
|
}
|
|
3823
|
-
function ir(
|
|
3847
|
+
function ir(U) {
|
|
3824
3848
|
const {
|
|
3825
3849
|
additionalUrl: j,
|
|
3826
3850
|
onDeleteAsync: H
|
|
3827
|
-
} = { ...e }, O = K(
|
|
3851
|
+
} = { ...e }, O = K(U), oe = O.id, ve = (De) => {
|
|
3828
3852
|
if (De != null) {
|
|
3829
3853
|
let Se = A.value.findIndex((se) => se.id == De);
|
|
3830
3854
|
if (Se > -1 && A.value.splice(Se, 1), e.items != null) {
|
|
@@ -3846,42 +3870,42 @@ function xa(e, t, l) {
|
|
|
3846
3870
|
onCanDeleteAsync: e.onCanDeleteAsync,
|
|
3847
3871
|
onDeleteAsync: H,
|
|
3848
3872
|
onDeleteSuccessAsync: async () => (ve(oe), e.onDeleteSuccessAsync != null ? e.onDeleteSuccessAsync(O) : Promise.resolve(void 0)),
|
|
3849
|
-
proxyID:
|
|
3873
|
+
proxyID: b.value,
|
|
3850
3874
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3851
3875
|
requireConfirmation: !0
|
|
3852
|
-
}), t && t("deleted",
|
|
3876
|
+
}), t && t("deleted", U);
|
|
3853
3877
|
}
|
|
3854
|
-
function
|
|
3878
|
+
function Ze(U) {
|
|
3855
3879
|
G({
|
|
3856
|
-
data: K(
|
|
3880
|
+
data: K(U),
|
|
3857
3881
|
additionalUrl: e.additionalUrl,
|
|
3858
3882
|
nav: $,
|
|
3859
3883
|
onCanRestoreAsync: e.onCanRestoreAsync,
|
|
3860
3884
|
onRestoreAsync: e.onRestoreAsync,
|
|
3861
3885
|
onRestoreSuccessAsync: e.onRestoreSuccessAsync,
|
|
3862
|
-
proxyID:
|
|
3886
|
+
proxyID: b.value
|
|
3863
3887
|
// ...(useBladeSrc ? bladeData.value : {})
|
|
3864
3888
|
});
|
|
3865
3889
|
}
|
|
3866
3890
|
function Fe() {
|
|
3867
|
-
|
|
3868
|
-
|
|
3891
|
+
Y(() => {
|
|
3892
|
+
S.exportToCSV(Pe.value, J.value);
|
|
3869
3893
|
}, { loadingMsg: "Exporting to CSV" });
|
|
3870
3894
|
}
|
|
3871
3895
|
function Ne() {
|
|
3872
|
-
let
|
|
3873
|
-
if (
|
|
3896
|
+
let U = K(A);
|
|
3897
|
+
if (U = e.onFilter ? e.onFilter(U) : U, _.value != null && _.value.length > 0) {
|
|
3874
3898
|
let j = [...f.value];
|
|
3875
|
-
e.itemText && j.push(e.itemText), Te(j) && (
|
|
3899
|
+
e.itemText && j.push(e.itemText), Te(j) && (U = U.filter((H) => hn(H, _.value, j)));
|
|
3876
3900
|
}
|
|
3877
|
-
J.value =
|
|
3901
|
+
J.value = U;
|
|
3878
3902
|
}
|
|
3879
3903
|
function We() {
|
|
3880
|
-
const
|
|
3881
|
-
e.headers != null && (Q.value = [...e.headers],
|
|
3904
|
+
const U = (l == null ? void 0 : l.hideActions) ?? e.hideActions;
|
|
3905
|
+
e.headers != null && (Q.value = [...e.headers], U || Q.value.push({ title: "Actions", value: "itemActions", align: "end" }));
|
|
3882
3906
|
}
|
|
3883
|
-
async function
|
|
3884
|
-
if (ce.value = !1, (
|
|
3907
|
+
async function Ee(U) {
|
|
3908
|
+
if (ce.value = !1, (U == null ? void 0 : U.resetSearch) === !0 && (Ie.value = e.showSearch ?? !1, _.value = void 0), e.items != null) {
|
|
3885
3909
|
A.value = e.onGetSuccessAsync != null ? await e.onGetSuccessAsync(e.items) : e.items;
|
|
3886
3910
|
return;
|
|
3887
3911
|
}
|
|
@@ -3892,10 +3916,10 @@ function xa(e, t, l) {
|
|
|
3892
3916
|
params: rr.value,
|
|
3893
3917
|
//params,
|
|
3894
3918
|
// params: params.getParamOptions(),
|
|
3895
|
-
proxyID:
|
|
3919
|
+
proxyID: b.value,
|
|
3896
3920
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3897
3921
|
// ...(props.useInterEvents ? eventData : {}),
|
|
3898
|
-
refresh: (
|
|
3922
|
+
refresh: (U == null ? void 0 : U.deepRefresh) ?? !1,
|
|
3899
3923
|
onGetAsync: e.onGetAsync,
|
|
3900
3924
|
onGetSuccessAsync: e.onGetSuccessAsync
|
|
3901
3925
|
};
|
|
@@ -3913,8 +3937,8 @@ function xa(e, t, l) {
|
|
|
3913
3937
|
}
|
|
3914
3938
|
Ne();
|
|
3915
3939
|
}
|
|
3916
|
-
function Je(
|
|
3917
|
-
const H = K(
|
|
3940
|
+
function Je(U, j) {
|
|
3941
|
+
const H = K(U);
|
|
3918
3942
|
if (H != null && H === ee && e.canUnselect ? ee = null : ee = H, t != null && t("select", ee), !(!e.canSelect || e.onCanSelectItem != null && !e.onCanSelectItem(H)))
|
|
3919
3943
|
if (e.onSelectItem != null)
|
|
3920
3944
|
e.onSelectItem(ee);
|
|
@@ -3931,46 +3955,46 @@ function xa(e, t, l) {
|
|
|
3931
3955
|
}
|
|
3932
3956
|
}
|
|
3933
3957
|
function je() {
|
|
3934
|
-
|
|
3958
|
+
Ie.value ? (Ie.value = e.showSearch ?? !1, _.value = void 0, Ee()) : Ie.value = e.showSearch ?? !0;
|
|
3935
3959
|
}
|
|
3936
3960
|
return We(), Xt([_], () => {
|
|
3937
3961
|
Ne();
|
|
3938
|
-
}, { debounce: 500, maxWait: 500 }), _e([
|
|
3939
|
-
await
|
|
3940
|
-
}), _e([X, () => e.errorMsg], ([
|
|
3941
|
-
ce.value =
|
|
3962
|
+
}, { debounce: 500, maxWait: 500 }), _e([L, w], async () => {
|
|
3963
|
+
await Ee();
|
|
3964
|
+
}), _e([X, () => e.errorMsg], ([U, j]) => {
|
|
3965
|
+
ce.value = U != null || j != null;
|
|
3942
3966
|
}), _e(() => e.refreshToggle, () => {
|
|
3943
|
-
|
|
3967
|
+
Ee({ deepRefresh: !0 });
|
|
3944
3968
|
}), pr([A, () => e.items], () => {
|
|
3945
3969
|
Ne();
|
|
3946
3970
|
}), Or(async () => {
|
|
3947
|
-
var
|
|
3948
|
-
e.eager == !0 && await
|
|
3971
|
+
var U;
|
|
3972
|
+
e.eager == !0 && await Ee({ deepRefresh: ((U = x == null ? void 0 : x.params) == null ? void 0 : U.refresh) == "true" });
|
|
3949
3973
|
}), {
|
|
3950
3974
|
add: be,
|
|
3951
3975
|
asyncItems: A,
|
|
3952
|
-
currentPage:
|
|
3976
|
+
currentPage: w,
|
|
3953
3977
|
deleteItem: ir,
|
|
3954
3978
|
displayHeaders: ur,
|
|
3955
3979
|
errorMsg: X,
|
|
3956
3980
|
exportToCSV: Fe,
|
|
3957
3981
|
filteredItems: J,
|
|
3958
3982
|
filters: y,
|
|
3959
|
-
filtersChanged:
|
|
3983
|
+
filtersChanged: I,
|
|
3960
3984
|
headerOptions: Q,
|
|
3961
3985
|
isDeletable: tr,
|
|
3962
3986
|
isLoading: fe,
|
|
3963
3987
|
isRestorable: nr,
|
|
3964
3988
|
loadingMsg: ne,
|
|
3965
|
-
refresh:
|
|
3966
|
-
restoreItem:
|
|
3989
|
+
refresh: Ee,
|
|
3990
|
+
restoreItem: Ze,
|
|
3967
3991
|
searchString: _,
|
|
3968
|
-
selectedFilters:
|
|
3992
|
+
selectedFilters: D,
|
|
3969
3993
|
selectItem: Je,
|
|
3970
3994
|
// serverFilters,
|
|
3971
3995
|
showError: ce,
|
|
3972
|
-
showInactive:
|
|
3973
|
-
showSearch:
|
|
3996
|
+
showInactive: L,
|
|
3997
|
+
showSearch: Ie,
|
|
3974
3998
|
subtitleOptions: ar,
|
|
3975
3999
|
tableHeaders: Pe,
|
|
3976
4000
|
titleOptions: lr,
|
|
@@ -3980,7 +4004,7 @@ function xa(e, t, l) {
|
|
|
3980
4004
|
}
|
|
3981
4005
|
let Ge;
|
|
3982
4006
|
function kn(e) {
|
|
3983
|
-
const t =
|
|
4007
|
+
const t = z((e == null ? void 0 : e.default) ?? "Admin"), l = z((e == null ? void 0 : e.groups) ?? []);
|
|
3984
4008
|
return Ge = {
|
|
3985
4009
|
currentGroup: t,
|
|
3986
4010
|
groupOptions: l,
|
|
@@ -3989,14 +4013,14 @@ function kn(e) {
|
|
|
3989
4013
|
}
|
|
3990
4014
|
function _a() {
|
|
3991
4015
|
const e = Mr(), t = ct(), l = Dn();
|
|
3992
|
-
let
|
|
4016
|
+
let S = e.getRoutes();
|
|
3993
4017
|
return {
|
|
3994
4018
|
...Ge,
|
|
3995
4019
|
sidebarNavItems: te(() => {
|
|
3996
4020
|
var g;
|
|
3997
|
-
|
|
4021
|
+
S = S.filter((x) => x.meta != null && x.meta.menuGroup != null);
|
|
3998
4022
|
const s = [];
|
|
3999
|
-
return
|
|
4023
|
+
return S.forEach((x) => {
|
|
4000
4024
|
var d;
|
|
4001
4025
|
const P = Ge.groupOptions.value.find((h) => h.displayName == x.meta.menuGroup), T = t.findItem(x.meta.nav), N = x.meta;
|
|
4002
4026
|
let $ = s.find((h) => h.displayName == N.menuGroup);
|
|
@@ -4016,7 +4040,7 @@ function _a() {
|
|
|
4016
4040
|
});
|
|
4017
4041
|
}), s.forEach((x) => {
|
|
4018
4042
|
var P;
|
|
4019
|
-
x.items = (P = x.items) == null ? void 0 : P.filter((T) => !T.requiresAuth || l.doShow(T.subscriptions, T.permissions, "view")).sort(
|
|
4043
|
+
x.items = (P = x.items) == null ? void 0 : P.filter((T) => !T.requiresAuth || l.doShow(T.subscriptions, T.permissions, "view")).sort(Ue.firstBy((T) => T.displayName));
|
|
4020
4044
|
}), Ge.currentGroup.value != null ? ((g = s.find((x) => x.displayName == Ge.currentGroup.value)) == null ? void 0 : g.items) ?? [] : s.filter((x) => !x.requiresAuth || l.doShow(x.subscriptions, x.permissions, "view"));
|
|
4021
4045
|
})
|
|
4022
4046
|
};
|
|
@@ -4029,15 +4053,15 @@ function Gn(e) {
|
|
|
4029
4053
|
function t(l) {
|
|
4030
4054
|
if (!l)
|
|
4031
4055
|
return {};
|
|
4032
|
-
let
|
|
4033
|
-
return e.presets[
|
|
4056
|
+
let S = l;
|
|
4057
|
+
return e.presets[S] ?? {};
|
|
4034
4058
|
}
|
|
4035
4059
|
return Pr = {
|
|
4036
4060
|
usePresets: t
|
|
4037
4061
|
}, Pr;
|
|
4038
4062
|
}
|
|
4039
4063
|
let Jr, jr, Kr, Qr = !1;
|
|
4040
|
-
const wr =
|
|
4064
|
+
const wr = z(!1), br = z(!1), Xr = z(), pe = z();
|
|
4041
4065
|
let Nr;
|
|
4042
4066
|
function Ca() {
|
|
4043
4067
|
return Nr;
|
|
@@ -4053,7 +4077,7 @@ function Wn() {
|
|
|
4053
4077
|
var x;
|
|
4054
4078
|
(x = Xr.value) == null || x.prompt(), wr.value = !1;
|
|
4055
4079
|
}
|
|
4056
|
-
function
|
|
4080
|
+
function S() {
|
|
4057
4081
|
return !!window.matchMedia("(display-mode: standalone)").matches;
|
|
4058
4082
|
}
|
|
4059
4083
|
function s(x) {
|
|
@@ -4068,7 +4092,7 @@ function Wn() {
|
|
|
4068
4092
|
canInstallApp: wr,
|
|
4069
4093
|
canUpdateApp: br,
|
|
4070
4094
|
installApp: l,
|
|
4071
|
-
isInstalled:
|
|
4095
|
+
isInstalled: S,
|
|
4072
4096
|
updateApp: g
|
|
4073
4097
|
}, Nr;
|
|
4074
4098
|
}
|
|
@@ -4081,18 +4105,18 @@ function Na(e) {
|
|
|
4081
4105
|
install(t, l) {
|
|
4082
4106
|
var T;
|
|
4083
4107
|
console.log(t), e.vuetifyInstance ?? (e.vuetifyInstance = l.vuetifyInstance), Nn(e);
|
|
4084
|
-
const
|
|
4085
|
-
Gn(e), (T = e.auth).demo ?? (T.demo =
|
|
4108
|
+
const S = Rn(), s = Fn(e);
|
|
4109
|
+
Gn(e), (T = e.auth).demo ?? (T.demo = S), e.auth.getAuthItem = s.findItem;
|
|
4086
4110
|
const g = xn(e.auth);
|
|
4087
4111
|
kn(e.menu);
|
|
4088
|
-
const x =
|
|
4112
|
+
const x = En({
|
|
4089
4113
|
auth: g,
|
|
4090
4114
|
findPath: s.findPath,
|
|
4091
4115
|
useBearerToken: !0
|
|
4092
4116
|
}), P = Ln({
|
|
4093
4117
|
getTimeZone: () => g.timeZone.value
|
|
4094
4118
|
});
|
|
4095
|
-
|
|
4119
|
+
Bn({
|
|
4096
4120
|
dates: P
|
|
4097
4121
|
}), Wn(), bn({
|
|
4098
4122
|
api: x,
|
|
@@ -4105,25 +4129,25 @@ function Na(e) {
|
|
|
4105
4129
|
export {
|
|
4106
4130
|
oa as DataURIToBlob,
|
|
4107
4131
|
la as addWeekday,
|
|
4108
|
-
|
|
4132
|
+
Be as appendUrl,
|
|
4109
4133
|
an as capitalizeWords,
|
|
4110
4134
|
pn as checkImage,
|
|
4111
4135
|
sn as containsSearch,
|
|
4112
4136
|
aa as containsWeekday,
|
|
4113
4137
|
Lr as copyDeep,
|
|
4114
4138
|
fn as copyItemByAlphabet,
|
|
4115
|
-
|
|
4139
|
+
En as createApi,
|
|
4116
4140
|
xn as createAuth,
|
|
4117
4141
|
Na as createCore,
|
|
4118
4142
|
Nn as createCosmetics,
|
|
4119
4143
|
Ln as createDates,
|
|
4120
4144
|
Rn as createDemo,
|
|
4121
|
-
|
|
4145
|
+
Bn as createFilters,
|
|
4122
4146
|
kn as createMenu,
|
|
4123
4147
|
Fn as createNavigation,
|
|
4124
4148
|
Wn as createPWA,
|
|
4125
4149
|
Gn as createPresets,
|
|
4126
|
-
|
|
4150
|
+
In as createSessionStoreDefinition,
|
|
4127
4151
|
bn as createStoreBuilder,
|
|
4128
4152
|
wn as createUrl,
|
|
4129
4153
|
Vr as createWholeLastUpdateStoreDefinition,
|
|
@@ -4157,7 +4181,7 @@ export {
|
|
|
4157
4181
|
ha as twiddleThumbs,
|
|
4158
4182
|
it as useActions,
|
|
4159
4183
|
rn as useActionsTracker,
|
|
4160
|
-
|
|
4184
|
+
Ir as useApi,
|
|
4161
4185
|
Dn as useAuth,
|
|
4162
4186
|
qr as useAuthUrl,
|
|
4163
4187
|
Pn as useBlade,
|
|
@@ -4167,9 +4191,9 @@ export {
|
|
|
4167
4191
|
Sa as useDates,
|
|
4168
4192
|
ut as useDbName,
|
|
4169
4193
|
Aa as useDemo,
|
|
4170
|
-
|
|
4194
|
+
Ia as useDocumentMeta,
|
|
4171
4195
|
_n as useDraggable,
|
|
4172
|
-
|
|
4196
|
+
Ea as useFilters,
|
|
4173
4197
|
pt as useId,
|
|
4174
4198
|
Da as useItem,
|
|
4175
4199
|
xa as useList,
|
|
@@ -4187,7 +4211,7 @@ export {
|
|
|
4187
4211
|
$n as useTracker,
|
|
4188
4212
|
ma as useUrls,
|
|
4189
4213
|
mn as validEmail,
|
|
4190
|
-
|
|
4214
|
+
Ye as weekdayPairs,
|
|
4191
4215
|
na as weekdayShortName,
|
|
4192
4216
|
ta as weekdayValue
|
|
4193
4217
|
};
|