bt-core-app 1.4.110 → 1.4.111
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 +934 -940
- package/package.json +1 -1
package/dist/bt-core-app.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as z, shallowRef as
|
|
2
|
-
import { watchArray as Or, useStorage as
|
|
1
|
+
import { ref as z, shallowRef as Me, computed as ee, toValue as J, watch as Te, toRef as Zt, onMounted as Xr } from "vue";
|
|
2
|
+
import { watchArray as Or, useStorage as Yt, useEventListener as me, toValue as Ee, useParentElement as Jt, useResizeObserver as jt, useArrayUnique as Kt, useArrayDifference as Gr, watchDebounced as Qt, tryOnMounted as Xt } from "@vueuse/core";
|
|
3
3
|
import { defineStore as pr } from "pinia";
|
|
4
4
|
import { DateTime as he } from "luxon";
|
|
5
|
-
import { useRouter as
|
|
5
|
+
import { useRouter as Nr, useRoute as et } from "vue-router";
|
|
6
6
|
function Ot(e) {
|
|
7
7
|
return (e || "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx").replace(/[xy]/g, pt);
|
|
8
8
|
}
|
|
@@ -11,11 +11,11 @@ function pt(e) {
|
|
|
11
11
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
12
12
|
}
|
|
13
13
|
function en(e) {
|
|
14
|
-
const t = z([]), l =
|
|
14
|
+
const t = z([]), l = Me(), S = Me(), s = Me(), g = ee(() => l.value != null);
|
|
15
15
|
function I(d) {
|
|
16
16
|
t.value = t.value.filter((h) => h.id != d);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function P(d) {
|
|
19
19
|
const h = {
|
|
20
20
|
id: Ot(),
|
|
21
21
|
msg: d ?? "Loading"
|
|
@@ -23,18 +23,18 @@ function en(e) {
|
|
|
23
23
|
return t.value.push(h), h.id;
|
|
24
24
|
}
|
|
25
25
|
function _(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 };
|
|
33
33
|
u.completionMsg ?? (u.completionMsg = e == null ? void 0 : e.completionMsg), u.confirmationMsg ?? (u.confirmationMsg = e == null ? void 0 : e.confirmationMsg), u.errorMsg ?? (u.errorMsg = e == null ? void 0 : e.errorMsg), u.loadingMsg ?? (u.loadingMsg = (e == null ? void 0 : e.loadingMsg) ?? "Loading"), u.requireConfirmation ?? (u.requireConfirmation = e == null ? void 0 : e.requireConfirmation);
|
|
34
|
-
const r =
|
|
35
|
-
let
|
|
34
|
+
const r = P(u.loadingMsg);
|
|
35
|
+
let w = null;
|
|
36
36
|
try {
|
|
37
|
-
return u.requireConfirmation || u.confirmationMsg,
|
|
37
|
+
return u.requireConfirmation || u.confirmationMsg, w = await d(), u.completionMsg != null && (s.value = u.completionMsg), w;
|
|
38
38
|
} catch (D) {
|
|
39
39
|
if ((e == null ? void 0 : e.onError) != null)
|
|
40
40
|
e.onError(D);
|
|
@@ -50,7 +50,7 @@ function en(e) {
|
|
|
50
50
|
return Or(t, (d) => {
|
|
51
51
|
l.value = d.length > 0 ? d[0].msg : void 0;
|
|
52
52
|
}, { deep: !0 }), {
|
|
53
|
-
actionErrorMsg:
|
|
53
|
+
actionErrorMsg: S,
|
|
54
54
|
actionLoadingMsg: l,
|
|
55
55
|
actionCompleteMsg: s,
|
|
56
56
|
clearErrors: N,
|
|
@@ -78,11 +78,11 @@ var Re = function() {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
if (s.length === 1) {
|
|
81
|
-
var
|
|
81
|
+
var P = s, _ = g.ignoreCase ? t : e, N = g.cmp || function(d, h) {
|
|
82
82
|
return d < h ? -1 : d > h ? 1 : 0;
|
|
83
83
|
};
|
|
84
84
|
s = function(d, h) {
|
|
85
|
-
return N(_(
|
|
85
|
+
return N(_(P(d)), _(P(h)));
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
const $ = { "-1": "", desc: "" };
|
|
@@ -90,27 +90,27 @@ var Re = function() {
|
|
|
90
90
|
return -s(d, h);
|
|
91
91
|
} : s;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
var I = typeof this == "function" && !this.firstBy ? this : !1,
|
|
95
|
-
return I(N, $) ||
|
|
96
|
-
} :
|
|
97
|
-
return _.thenBy =
|
|
93
|
+
function S(s, g) {
|
|
94
|
+
var I = typeof this == "function" && !this.firstBy ? this : !1, P = l(s, g), _ = I ? function(N, $) {
|
|
95
|
+
return I(N, $) || P(N, $);
|
|
96
|
+
} : P;
|
|
97
|
+
return _.thenBy = S, _;
|
|
98
98
|
}
|
|
99
|
-
return
|
|
99
|
+
return S.firstBy = S, S;
|
|
100
100
|
}();
|
|
101
101
|
function Ue(e, t) {
|
|
102
|
-
let l = e ?? "",
|
|
102
|
+
let l = e ?? "", S = t ?? "";
|
|
103
103
|
if (l.endsWith("/"))
|
|
104
104
|
do
|
|
105
105
|
l = l.slice(0, l.length - 1);
|
|
106
106
|
while (l.endsWith("/"));
|
|
107
|
-
if (
|
|
107
|
+
if (S.startsWith("/"))
|
|
108
108
|
do
|
|
109
|
-
|
|
110
|
-
while (
|
|
111
|
-
return `${l}/${
|
|
109
|
+
S = S.slice(1, S.length);
|
|
110
|
+
while (S.startsWith("/"));
|
|
111
|
+
return `${l}/${S}`;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function Yn(e) {
|
|
114
114
|
return e == null || !Array.isArray(e) ? e : [...new Set(e.map((t) => t))];
|
|
115
115
|
}
|
|
116
116
|
function Jn(e = "blitzItExtensionExists") {
|
|
@@ -159,13 +159,13 @@ function rt(e, t = !1) {
|
|
|
159
159
|
}
|
|
160
160
|
function On(e, t, l) {
|
|
161
161
|
if (e) {
|
|
162
|
-
var
|
|
163
|
-
|
|
162
|
+
var S = new Image();
|
|
163
|
+
S.onload = t, S.onerror = l, S.src = e;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
async function pn(e, t = !0) {
|
|
167
|
-
return new Promise((l,
|
|
168
|
-
e == null &&
|
|
167
|
+
return new Promise((l, S) => {
|
|
168
|
+
e == null && S("no url given");
|
|
169
169
|
var s = new Image();
|
|
170
170
|
s.setAttribute("crossOrigin", "anonymous"), s.onload = function() {
|
|
171
171
|
var g = document.createElement("canvas");
|
|
@@ -173,7 +173,7 @@ async function pn(e, t = !0) {
|
|
|
173
173
|
var I = g.getContext("2d");
|
|
174
174
|
I == null || I.drawImage(this, 0, 0), l(g.toDataURL("image/png"));
|
|
175
175
|
}, s.onerror = function() {
|
|
176
|
-
console.log("errr"), t ?
|
|
176
|
+
console.log("errr"), t ? S("image could not be loaded for some reason") : l(null);
|
|
177
177
|
}, e != null && (s.src = e);
|
|
178
178
|
});
|
|
179
179
|
}
|
|
@@ -189,7 +189,7 @@ function ea(e) {
|
|
|
189
189
|
function nn(e) {
|
|
190
190
|
return e == null ? e : e.replace(/\w\S*/g, (t) => t.replace(/^\w/, (l) => l.toUpperCase()));
|
|
191
191
|
}
|
|
192
|
-
const
|
|
192
|
+
const Ye = [
|
|
193
193
|
{ value: 1, short: "sun", values: ["sun", "sunday"] },
|
|
194
194
|
{ value: 2, short: "mon", values: ["mon", "monday"] },
|
|
195
195
|
{ value: 3, short: "tue", values: ["tue", "tues", "tuesday"] },
|
|
@@ -202,19 +202,19 @@ const Ze = [
|
|
|
202
202
|
function ra(e) {
|
|
203
203
|
if (e == null)
|
|
204
204
|
return 0;
|
|
205
|
-
const t = e.replaceAll(" ", "").split(",").map((
|
|
205
|
+
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);
|
|
206
206
|
return l.length == 0 ? 8 : Math.min(...l);
|
|
207
207
|
}
|
|
208
208
|
function ta(e) {
|
|
209
209
|
return e == null ? e : e.toLowerCase().replaceAll(" ", "").split(",").map((t) => {
|
|
210
|
-
let l =
|
|
210
|
+
let l = Ye.find((S) => S.values.some((s) => s == t));
|
|
211
211
|
return l != null ? l.short : "";
|
|
212
212
|
}).filter((t) => t != null && t.length > 0).toString();
|
|
213
213
|
}
|
|
214
214
|
function na(e, t) {
|
|
215
215
|
if (e == null || t == null)
|
|
216
216
|
return !0;
|
|
217
|
-
const l = e.replaceAll(" ", "").split(",").map((g) => g.toLowerCase()),
|
|
217
|
+
const l = e.replaceAll(" ", "").split(",").map((g) => g.toLowerCase()), S = t.replaceAll(" ", "").toLowerCase(), s = Ye.find((g) => g.values.some((I) => I == S));
|
|
218
218
|
return s != null && l.some((g) => g == s.short || s.values.some((I) => I == g));
|
|
219
219
|
}
|
|
220
220
|
function aa(e, t) {
|
|
@@ -222,13 +222,13 @@ function aa(e, t) {
|
|
|
222
222
|
return e;
|
|
223
223
|
let l = e ?? "";
|
|
224
224
|
l = `${l},${t}`;
|
|
225
|
-
let
|
|
226
|
-
return
|
|
225
|
+
let S = [...new Set(l.replaceAll(" ", "").toLowerCase().split(",").map((s) => Ye.find((g) => g.values.some((I) => I == s))).filter((s) => s != null).sort(Re.firstBy((s) => (s == null ? void 0 : s.value) ?? 0)).map((s) => s == null ? void 0 : s.short))].toString();
|
|
226
|
+
return S.length > 0 ? S : void 0;
|
|
227
227
|
}
|
|
228
228
|
function la(e, t) {
|
|
229
229
|
if (t == null || e == null)
|
|
230
230
|
return e;
|
|
231
|
-
let l = e ?? "",
|
|
231
|
+
let l = e ?? "", S = t.replaceAll(" ", "").toLowerCase(), s = [...new Set(l.replaceAll(" ", "").toLowerCase().split(",").map((g) => Ye.find((I) => I.values.some((P) => P == g && P != S))).filter((g) => g != null).sort(Re.firstBy((g) => (g == null ? void 0 : g.value) ?? 0)).map((g) => g == null ? void 0 : g.short))].toString();
|
|
232
232
|
return s.length > 0 ? s : void 0;
|
|
233
233
|
}
|
|
234
234
|
function ua(e, t) {
|
|
@@ -247,38 +247,38 @@ function ln() {
|
|
|
247
247
|
return "0001-01-01T00:00:00Z";
|
|
248
248
|
}
|
|
249
249
|
function ca(e, t) {
|
|
250
|
-
let l = "1",
|
|
251
|
-
if (
|
|
250
|
+
let l = "1", S = 0;
|
|
251
|
+
if (S < t)
|
|
252
252
|
do
|
|
253
|
-
l = l + "0",
|
|
254
|
-
while (
|
|
253
|
+
l = l + "0", S += 1;
|
|
254
|
+
while (S < t);
|
|
255
255
|
let s = Number.parseInt(l);
|
|
256
256
|
return Math.round(e * s) / s;
|
|
257
257
|
}
|
|
258
258
|
function fa(e, t) {
|
|
259
259
|
let l = e ?? "";
|
|
260
|
-
return t != null && (un(l, t) ? l = l.split(",").filter((
|
|
260
|
+
return t != null && (un(l, t) ? l = l.split(",").filter((S) => S != t).toString() : l != null ? l = `${l},${t}` : l = t), l != null && l.length > 0 ? l : null;
|
|
261
261
|
}
|
|
262
262
|
function un(e, t) {
|
|
263
263
|
if (e == null || e.length == 0)
|
|
264
264
|
return !1;
|
|
265
265
|
if (!t)
|
|
266
266
|
return !0;
|
|
267
|
-
var l = e.split(","),
|
|
268
|
-
return l.some((s) =>
|
|
267
|
+
var l = e.split(","), S = t.split(",");
|
|
268
|
+
return l.some((s) => S.some((g) => g == s));
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function Mr(e) {
|
|
271
271
|
if (!e)
|
|
272
272
|
return e;
|
|
273
273
|
let t, l = Array.isArray(e) ? [] : {};
|
|
274
|
-
for (const
|
|
275
|
-
t = e[
|
|
274
|
+
for (const S in e)
|
|
275
|
+
t = e[S], l[S] = typeof t == "object" ? Mr(t) : t;
|
|
276
276
|
return l;
|
|
277
277
|
}
|
|
278
278
|
function cn(e) {
|
|
279
279
|
return e && Object.keys(e).sort().reduce(function(t, l) {
|
|
280
|
-
let
|
|
281
|
-
return t[l] = typeof
|
|
280
|
+
let S = e[l];
|
|
281
|
+
return t[l] = typeof S == "object" && S !== null ? cn(S) : S, t;
|
|
282
282
|
}, Array.isArray(e) ? [] : {});
|
|
283
283
|
}
|
|
284
284
|
function fn(e, t) {
|
|
@@ -288,17 +288,17 @@ function tt(e, t = (l) => l) {
|
|
|
288
288
|
if (e == null)
|
|
289
289
|
return [];
|
|
290
290
|
const l = Array.isArray(e) ? e : t(e);
|
|
291
|
-
return _e(l) ? [...l.reduce((
|
|
292
|
-
|
|
291
|
+
return _e(l) ? [...l.reduce((S, s) => {
|
|
292
|
+
S.push(s);
|
|
293
293
|
const g = tt(s, t);
|
|
294
|
-
return _e(g) &&
|
|
294
|
+
return _e(g) && S.push(...g), S;
|
|
295
295
|
}, [])] : [];
|
|
296
296
|
}
|
|
297
297
|
function sa(e) {
|
|
298
|
-
const t = e.split(","), l = t[0].indexOf("base64") >= 0 ? atob(t[1]) : decodeURI(t[1]),
|
|
298
|
+
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);
|
|
299
299
|
for (let g = 0; g < l.length; g++)
|
|
300
300
|
s[g] = l.charCodeAt(g);
|
|
301
|
-
return new Blob([s], { type:
|
|
301
|
+
return new Blob([s], { type: S });
|
|
302
302
|
}
|
|
303
303
|
function sn(e) {
|
|
304
304
|
var t = "";
|
|
@@ -324,8 +324,8 @@ function dn(e, t, l) {
|
|
|
324
324
|
return !1;
|
|
325
325
|
for (let s = 0; s < l.length; s++) {
|
|
326
326
|
const g = l[s];
|
|
327
|
-
var
|
|
328
|
-
if (
|
|
327
|
+
var S = Sr(e, g);
|
|
328
|
+
if (S != null && typeof S == "string" && fn(S, t))
|
|
329
329
|
return !0;
|
|
330
330
|
}
|
|
331
331
|
return !1;
|
|
@@ -342,8 +342,8 @@ function Sr(e, t) {
|
|
|
342
342
|
if (e == null || e == null || !t)
|
|
343
343
|
return null;
|
|
344
344
|
var l = t.split(".");
|
|
345
|
-
let
|
|
346
|
-
for (var s = e, g = 0; g <
|
|
345
|
+
let S = l.length;
|
|
346
|
+
for (var s = e, g = 0; g < S; g++)
|
|
347
347
|
if (s = s[l[g]], s == null)
|
|
348
348
|
return null;
|
|
349
349
|
return s;
|
|
@@ -368,51 +368,51 @@ var nt = { exports: {} };
|
|
|
368
368
|
(function(l) {
|
|
369
369
|
e.exports = l();
|
|
370
370
|
})(function() {
|
|
371
|
-
return function l(
|
|
371
|
+
return function l(S, s, g) {
|
|
372
372
|
function I(N, $) {
|
|
373
373
|
if (!s[N]) {
|
|
374
|
-
if (!
|
|
374
|
+
if (!S[N]) {
|
|
375
375
|
var d = typeof Oe == "function" && Oe;
|
|
376
376
|
if (!$ && d)
|
|
377
377
|
return d(N, !0);
|
|
378
|
-
if (
|
|
379
|
-
return
|
|
378
|
+
if (P)
|
|
379
|
+
return P(N, !0);
|
|
380
380
|
var h = new Error("Cannot find module '" + N + "'");
|
|
381
381
|
throw h.code = "MODULE_NOT_FOUND", h;
|
|
382
382
|
}
|
|
383
383
|
var u = s[N] = { exports: {} };
|
|
384
|
-
|
|
385
|
-
var
|
|
386
|
-
return I(
|
|
387
|
-
}, u, u.exports, l,
|
|
384
|
+
S[N][0].call(u.exports, function(r) {
|
|
385
|
+
var w = S[N][1][r];
|
|
386
|
+
return I(w || r);
|
|
387
|
+
}, u, u.exports, l, S, s, g);
|
|
388
388
|
}
|
|
389
389
|
return s[N].exports;
|
|
390
390
|
}
|
|
391
|
-
for (var
|
|
391
|
+
for (var P = typeof Oe == "function" && Oe, _ = 0; _ < g.length; _++)
|
|
392
392
|
I(g[_]);
|
|
393
393
|
return I;
|
|
394
|
-
}({ 1: [function(l,
|
|
394
|
+
}({ 1: [function(l, S, s) {
|
|
395
395
|
(function(g) {
|
|
396
|
-
var I = g.MutationObserver || g.WebKitMutationObserver,
|
|
396
|
+
var I = g.MutationObserver || g.WebKitMutationObserver, P;
|
|
397
397
|
if (I) {
|
|
398
398
|
var _ = 0, N = new I(r), $ = g.document.createTextNode("");
|
|
399
399
|
N.observe($, {
|
|
400
400
|
characterData: !0
|
|
401
|
-
}),
|
|
401
|
+
}), P = function() {
|
|
402
402
|
$.data = _ = ++_ % 2;
|
|
403
403
|
};
|
|
404
404
|
} else if (!g.setImmediate && typeof g.MessageChannel < "u") {
|
|
405
405
|
var d = new g.MessageChannel();
|
|
406
|
-
d.port1.onmessage = r,
|
|
406
|
+
d.port1.onmessage = r, P = function() {
|
|
407
407
|
d.port2.postMessage(0);
|
|
408
408
|
};
|
|
409
409
|
} else
|
|
410
|
-
"document" in g && "onreadystatechange" in g.document.createElement("script") ?
|
|
410
|
+
"document" in g && "onreadystatechange" in g.document.createElement("script") ? P = function() {
|
|
411
411
|
var D = g.document.createElement("script");
|
|
412
412
|
D.onreadystatechange = function() {
|
|
413
413
|
r(), D.onreadystatechange = null, D.parentNode.removeChild(D), D = null;
|
|
414
414
|
}, g.document.documentElement.appendChild(D);
|
|
415
|
-
} :
|
|
415
|
+
} : P = function() {
|
|
416
416
|
setTimeout(r, 0);
|
|
417
417
|
};
|
|
418
418
|
var h, u = [];
|
|
@@ -425,160 +425,160 @@ var nt = { exports: {} };
|
|
|
425
425
|
}
|
|
426
426
|
h = !1;
|
|
427
427
|
}
|
|
428
|
-
|
|
429
|
-
function
|
|
430
|
-
u.push(D) === 1 && !h &&
|
|
428
|
+
S.exports = w;
|
|
429
|
+
function w(D) {
|
|
430
|
+
u.push(D) === 1 && !h && P();
|
|
431
431
|
}
|
|
432
432
|
}).call(this, typeof Xe < "u" ? Xe : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
433
|
-
}, {}], 2: [function(l,
|
|
433
|
+
}, {}], 2: [function(l, S, s) {
|
|
434
434
|
var g = l(1);
|
|
435
435
|
function I() {
|
|
436
436
|
}
|
|
437
|
-
var
|
|
438
|
-
|
|
439
|
-
function d(
|
|
440
|
-
if (typeof
|
|
437
|
+
var P = {}, _ = ["REJECTED"], N = ["FULFILLED"], $ = ["PENDING"];
|
|
438
|
+
S.exports = d;
|
|
439
|
+
function d(A) {
|
|
440
|
+
if (typeof A != "function")
|
|
441
441
|
throw new TypeError("resolver must be a function");
|
|
442
|
-
this.state = $, this.queue = [], this.outcome = void 0,
|
|
442
|
+
this.state = $, this.queue = [], this.outcome = void 0, A !== I && w(this, A);
|
|
443
443
|
}
|
|
444
|
-
d.prototype.catch = function(
|
|
445
|
-
return this.then(null,
|
|
446
|
-
}, d.prototype.then = function(
|
|
447
|
-
if (typeof
|
|
444
|
+
d.prototype.catch = function(A) {
|
|
445
|
+
return this.then(null, A);
|
|
446
|
+
}, d.prototype.then = function(A, T) {
|
|
447
|
+
if (typeof A != "function" && this.state === N || typeof T != "function" && this.state === _)
|
|
448
448
|
return this;
|
|
449
449
|
var x = new this.constructor(I);
|
|
450
450
|
if (this.state !== $) {
|
|
451
|
-
var
|
|
452
|
-
u(x,
|
|
451
|
+
var C = this.state === N ? A : T;
|
|
452
|
+
u(x, C, this.outcome);
|
|
453
453
|
} else
|
|
454
|
-
this.queue.push(new h(x,
|
|
454
|
+
this.queue.push(new h(x, A, T));
|
|
455
455
|
return x;
|
|
456
456
|
};
|
|
457
|
-
function h(
|
|
458
|
-
this.promise =
|
|
457
|
+
function h(A, T, x) {
|
|
458
|
+
this.promise = A, typeof T == "function" && (this.onFulfilled = T, this.callFulfilled = this.otherCallFulfilled), typeof x == "function" && (this.onRejected = x, this.callRejected = this.otherCallRejected);
|
|
459
459
|
}
|
|
460
|
-
h.prototype.callFulfilled = function(
|
|
461
|
-
|
|
462
|
-
}, h.prototype.otherCallFulfilled = function(
|
|
463
|
-
u(this.promise, this.onFulfilled,
|
|
464
|
-
}, h.prototype.callRejected = function(
|
|
465
|
-
|
|
466
|
-
}, h.prototype.otherCallRejected = function(
|
|
467
|
-
u(this.promise, this.onRejected,
|
|
460
|
+
h.prototype.callFulfilled = function(A) {
|
|
461
|
+
P.resolve(this.promise, A);
|
|
462
|
+
}, h.prototype.otherCallFulfilled = function(A) {
|
|
463
|
+
u(this.promise, this.onFulfilled, A);
|
|
464
|
+
}, h.prototype.callRejected = function(A) {
|
|
465
|
+
P.reject(this.promise, A);
|
|
466
|
+
}, h.prototype.otherCallRejected = function(A) {
|
|
467
|
+
u(this.promise, this.onRejected, A);
|
|
468
468
|
};
|
|
469
|
-
function u(
|
|
469
|
+
function u(A, T, x) {
|
|
470
470
|
g(function() {
|
|
471
|
-
var
|
|
471
|
+
var C;
|
|
472
472
|
try {
|
|
473
|
-
|
|
473
|
+
C = T(x);
|
|
474
474
|
} catch (f) {
|
|
475
|
-
return
|
|
475
|
+
return P.reject(A, f);
|
|
476
476
|
}
|
|
477
|
-
|
|
477
|
+
C === A ? P.reject(A, new TypeError("Cannot resolve promise with itself")) : P.resolve(A, C);
|
|
478
478
|
});
|
|
479
479
|
}
|
|
480
|
-
|
|
480
|
+
P.resolve = function(A, T) {
|
|
481
481
|
var x = D(r, T);
|
|
482
482
|
if (x.status === "error")
|
|
483
|
-
return
|
|
484
|
-
var
|
|
485
|
-
if (
|
|
486
|
-
|
|
483
|
+
return P.reject(A, x.value);
|
|
484
|
+
var C = x.value;
|
|
485
|
+
if (C)
|
|
486
|
+
w(A, C);
|
|
487
487
|
else {
|
|
488
|
-
|
|
489
|
-
for (var f = -1,
|
|
490
|
-
|
|
488
|
+
A.state = N, A.outcome = T;
|
|
489
|
+
for (var f = -1, E = A.queue.length; ++f < E; )
|
|
490
|
+
A.queue[f].callFulfilled(T);
|
|
491
491
|
}
|
|
492
|
-
return
|
|
493
|
-
},
|
|
494
|
-
|
|
495
|
-
for (var x = -1,
|
|
496
|
-
|
|
497
|
-
return
|
|
492
|
+
return A;
|
|
493
|
+
}, P.reject = function(A, T) {
|
|
494
|
+
A.state = _, A.outcome = T;
|
|
495
|
+
for (var x = -1, C = A.queue.length; ++x < C; )
|
|
496
|
+
A.queue[x].callRejected(T);
|
|
497
|
+
return A;
|
|
498
498
|
};
|
|
499
|
-
function r(
|
|
500
|
-
var T =
|
|
501
|
-
if (
|
|
499
|
+
function r(A) {
|
|
500
|
+
var T = A && A.then;
|
|
501
|
+
if (A && (typeof A == "object" || typeof A == "function") && typeof T == "function")
|
|
502
502
|
return function() {
|
|
503
|
-
T.apply(
|
|
503
|
+
T.apply(A, arguments);
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function w(A, T) {
|
|
507
507
|
var x = !1;
|
|
508
|
-
function
|
|
509
|
-
x || (x = !0,
|
|
508
|
+
function C(X) {
|
|
509
|
+
x || (x = !0, P.reject(A, X));
|
|
510
510
|
}
|
|
511
511
|
function f(X) {
|
|
512
|
-
x || (x = !0,
|
|
512
|
+
x || (x = !0, P.resolve(A, X));
|
|
513
513
|
}
|
|
514
|
-
function
|
|
515
|
-
T(f,
|
|
514
|
+
function E() {
|
|
515
|
+
T(f, C);
|
|
516
516
|
}
|
|
517
|
-
var
|
|
518
|
-
|
|
517
|
+
var K = D(E);
|
|
518
|
+
K.status === "error" && C(K.value);
|
|
519
519
|
}
|
|
520
|
-
function D(
|
|
520
|
+
function D(A, T) {
|
|
521
521
|
var x = {};
|
|
522
522
|
try {
|
|
523
|
-
x.value =
|
|
524
|
-
} catch (
|
|
525
|
-
x.status = "error", x.value =
|
|
523
|
+
x.value = A(T), x.status = "success";
|
|
524
|
+
} catch (C) {
|
|
525
|
+
x.status = "error", x.value = C;
|
|
526
526
|
}
|
|
527
527
|
return x;
|
|
528
528
|
}
|
|
529
529
|
d.resolve = c;
|
|
530
|
-
function c(
|
|
531
|
-
return
|
|
530
|
+
function c(A) {
|
|
531
|
+
return A instanceof this ? A : P.resolve(new this(I), A);
|
|
532
532
|
}
|
|
533
533
|
d.reject = y;
|
|
534
|
-
function y(
|
|
534
|
+
function y(A) {
|
|
535
535
|
var T = new this(I);
|
|
536
|
-
return
|
|
536
|
+
return P.reject(T, A);
|
|
537
537
|
}
|
|
538
|
-
d.all =
|
|
539
|
-
function
|
|
538
|
+
d.all = b;
|
|
539
|
+
function b(A) {
|
|
540
540
|
var T = this;
|
|
541
|
-
if (Object.prototype.toString.call(
|
|
541
|
+
if (Object.prototype.toString.call(A) !== "[object Array]")
|
|
542
542
|
return this.reject(new TypeError("must be an array"));
|
|
543
|
-
var x =
|
|
543
|
+
var x = A.length, C = !1;
|
|
544
544
|
if (!x)
|
|
545
545
|
return this.resolve([]);
|
|
546
|
-
for (var f = new Array(x),
|
|
547
|
-
re(
|
|
546
|
+
for (var f = new Array(x), E = 0, K = -1, X = new this(I); ++K < x; )
|
|
547
|
+
re(A[K], K);
|
|
548
548
|
return X;
|
|
549
549
|
function re(ue, be) {
|
|
550
|
-
T.resolve(ue).then(G, function(
|
|
551
|
-
|
|
550
|
+
T.resolve(ue).then(G, function(Z) {
|
|
551
|
+
C || (C = !0, P.reject(X, Z));
|
|
552
552
|
});
|
|
553
|
-
function G(
|
|
554
|
-
f[be] =
|
|
553
|
+
function G(Z) {
|
|
554
|
+
f[be] = Z, ++E === x && !C && (C = !0, P.resolve(X, f));
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
d.race =
|
|
559
|
-
function
|
|
558
|
+
d.race = M;
|
|
559
|
+
function M(A) {
|
|
560
560
|
var T = this;
|
|
561
|
-
if (Object.prototype.toString.call(
|
|
561
|
+
if (Object.prototype.toString.call(A) !== "[object Array]")
|
|
562
562
|
return this.reject(new TypeError("must be an array"));
|
|
563
|
-
var x =
|
|
563
|
+
var x = A.length, C = !1;
|
|
564
564
|
if (!x)
|
|
565
565
|
return this.resolve([]);
|
|
566
|
-
for (var f = -1,
|
|
567
|
-
|
|
568
|
-
return
|
|
569
|
-
function
|
|
566
|
+
for (var f = -1, E = new this(I); ++f < x; )
|
|
567
|
+
K(A[f]);
|
|
568
|
+
return E;
|
|
569
|
+
function K(X) {
|
|
570
570
|
T.resolve(X).then(function(re) {
|
|
571
|
-
|
|
571
|
+
C || (C = !0, P.resolve(E, re));
|
|
572
572
|
}, function(re) {
|
|
573
|
-
|
|
573
|
+
C || (C = !0, P.reject(E, re));
|
|
574
574
|
});
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
|
-
}, { 1: 1 }], 3: [function(l,
|
|
577
|
+
}, { 1: 1 }], 3: [function(l, S, s) {
|
|
578
578
|
(function(g) {
|
|
579
579
|
typeof g.Promise != "function" && (g.Promise = l(2));
|
|
580
580
|
}).call(this, typeof Xe < "u" ? Xe : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
581
|
-
}, { 2: 2 }], 4: [function(l,
|
|
581
|
+
}, { 2: 2 }], 4: [function(l, S, s) {
|
|
582
582
|
var g = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
583
583
|
return typeof n;
|
|
584
584
|
} : function(n) {
|
|
@@ -588,7 +588,7 @@ var nt = { exports: {} };
|
|
|
588
588
|
if (!(n instanceof i))
|
|
589
589
|
throw new TypeError("Cannot call a class as a function");
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function P() {
|
|
592
592
|
try {
|
|
593
593
|
if (typeof indexedDB < "u")
|
|
594
594
|
return indexedDB;
|
|
@@ -604,7 +604,7 @@ var nt = { exports: {} };
|
|
|
604
604
|
return;
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
var _ =
|
|
607
|
+
var _ = P();
|
|
608
608
|
function N() {
|
|
609
609
|
try {
|
|
610
610
|
if (!_ || !_.open)
|
|
@@ -646,11 +646,11 @@ var nt = { exports: {} };
|
|
|
646
646
|
function r(n) {
|
|
647
647
|
return typeof n != "string" && (console.warn(n + " used as a key, but it is not a string."), n = String(n)), n;
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function w() {
|
|
650
650
|
if (arguments.length && typeof arguments[arguments.length - 1] == "function")
|
|
651
651
|
return arguments[arguments.length - 1];
|
|
652
652
|
}
|
|
653
|
-
var D = "local-forage-detect-blob-support", c = void 0, y = {},
|
|
653
|
+
var D = "local-forage-detect-blob-support", c = void 0, y = {}, b = Object.prototype.toString, M = "readonly", A = "readwrite";
|
|
654
654
|
function T(n) {
|
|
655
655
|
for (var i = n.length, a = new ArrayBuffer(i), m = new Uint8Array(a), v = 0; v < i; v++)
|
|
656
656
|
m[v] = n.charCodeAt(v);
|
|
@@ -658,7 +658,7 @@ var nt = { exports: {} };
|
|
|
658
658
|
}
|
|
659
659
|
function x(n) {
|
|
660
660
|
return new d(function(i) {
|
|
661
|
-
var a = n.transaction(D,
|
|
661
|
+
var a = n.transaction(D, A), m = $([""]);
|
|
662
662
|
a.objectStore(D).put(m, "key"), a.onabort = function(v) {
|
|
663
663
|
v.preventDefault(), v.stopPropagation(), i(!1);
|
|
664
664
|
}, a.oncomplete = function() {
|
|
@@ -669,7 +669,7 @@ var nt = { exports: {} };
|
|
|
669
669
|
return !1;
|
|
670
670
|
});
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function C(n) {
|
|
673
673
|
return typeof c == "boolean" ? d.resolve(c) : x(n).then(function(i) {
|
|
674
674
|
return c = i, c;
|
|
675
675
|
});
|
|
@@ -682,12 +682,12 @@ var nt = { exports: {} };
|
|
|
682
682
|
return a.promise;
|
|
683
683
|
}) : i.dbReady = a.promise;
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function E(n) {
|
|
686
686
|
var i = y[n.name], a = i.deferredOperations.pop();
|
|
687
687
|
if (a)
|
|
688
688
|
return a.resolve(), a.promise;
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function K(n, i) {
|
|
691
691
|
var a = y[n.name], m = a.deferredOperations.pop();
|
|
692
692
|
if (m)
|
|
693
693
|
return m.reject(i), m.promise;
|
|
@@ -702,23 +702,23 @@ var nt = { exports: {} };
|
|
|
702
702
|
var v = [n.name];
|
|
703
703
|
i && v.push(n.version);
|
|
704
704
|
var o = _.open.apply(_, v);
|
|
705
|
-
i && (o.onupgradeneeded = function(
|
|
705
|
+
i && (o.onupgradeneeded = function(L) {
|
|
706
706
|
var R = o.result;
|
|
707
707
|
try {
|
|
708
|
-
R.createObjectStore(n.storeName),
|
|
708
|
+
R.createObjectStore(n.storeName), L.oldVersion <= 1 && R.createObjectStore(D);
|
|
709
709
|
} catch (B) {
|
|
710
710
|
if (B.name === "ConstraintError")
|
|
711
|
-
console.warn('The database "' + n.name + '" has been upgraded from version ' +
|
|
711
|
+
console.warn('The database "' + n.name + '" has been upgraded from version ' + L.oldVersion + " to version " + L.newVersion + ', but the storage "' + n.storeName + '" already exists.');
|
|
712
712
|
else
|
|
713
713
|
throw B;
|
|
714
714
|
}
|
|
715
|
-
}), o.onerror = function(
|
|
716
|
-
|
|
715
|
+
}), o.onerror = function(L) {
|
|
716
|
+
L.preventDefault(), m(o.error);
|
|
717
717
|
}, o.onsuccess = function() {
|
|
718
|
-
var
|
|
719
|
-
|
|
718
|
+
var L = o.result;
|
|
719
|
+
L.onversionchange = function(R) {
|
|
720
720
|
R.target.close();
|
|
721
|
-
}, a(
|
|
721
|
+
}, a(L), E(n);
|
|
722
722
|
};
|
|
723
723
|
});
|
|
724
724
|
}
|
|
@@ -754,7 +754,7 @@ var nt = { exports: {} };
|
|
|
754
754
|
}, m.readAsBinaryString(n);
|
|
755
755
|
});
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function Z(n) {
|
|
758
758
|
var i = T(atob(n.data));
|
|
759
759
|
return $([i], { type: n.type });
|
|
760
760
|
}
|
|
@@ -769,7 +769,7 @@ var nt = { exports: {} };
|
|
|
769
769
|
});
|
|
770
770
|
return u(a, n, n), a;
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function Y(n) {
|
|
773
773
|
f(n);
|
|
774
774
|
for (var i = y[n.name], a = i.forages, m = 0; m < a.length; m++) {
|
|
775
775
|
var v = a[m];
|
|
@@ -779,10 +779,10 @@ var nt = { exports: {} };
|
|
|
779
779
|
return n.db = o, be(n) ? ue(n) : o;
|
|
780
780
|
}).then(function(o) {
|
|
781
781
|
n.db = i.db = o;
|
|
782
|
-
for (var
|
|
783
|
-
a[
|
|
782
|
+
for (var L = 0; L < a.length; L++)
|
|
783
|
+
a[L]._dbInfo.db = o;
|
|
784
784
|
}).catch(function(o) {
|
|
785
|
-
throw
|
|
785
|
+
throw K(n, o), o;
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
788
|
function W(n, i, a, m) {
|
|
@@ -796,7 +796,7 @@ var nt = { exports: {} };
|
|
|
796
796
|
if (!n.db || o.name === "NotFoundError" && !n.db.objectStoreNames.contains(n.storeName) && n.version <= n.db.version)
|
|
797
797
|
return n.db && (n.version = n.db.version + 1), ue(n);
|
|
798
798
|
}).then(function() {
|
|
799
|
-
return
|
|
799
|
+
return Y(n).then(function() {
|
|
800
800
|
W(n, i, a, m - 1);
|
|
801
801
|
});
|
|
802
802
|
}).catch(a);
|
|
@@ -825,12 +825,12 @@ var nt = { exports: {} };
|
|
|
825
825
|
var v = y[a.name];
|
|
826
826
|
v || (v = ne(), y[a.name] = v), v.forages.push(i), i._initReady || (i._initReady = i.ready, i.ready = ie);
|
|
827
827
|
var o = [];
|
|
828
|
-
function
|
|
828
|
+
function L() {
|
|
829
829
|
return d.resolve();
|
|
830
830
|
}
|
|
831
831
|
for (var R = 0; R < v.forages.length; R++) {
|
|
832
832
|
var B = v.forages[R];
|
|
833
|
-
B !== i && o.push(B._initReady().catch(
|
|
833
|
+
B !== i && o.push(B._initReady().catch(L));
|
|
834
834
|
}
|
|
835
835
|
var F = v.forages.slice(0);
|
|
836
836
|
return d.all(o).then(function() {
|
|
@@ -840,8 +840,8 @@ var nt = { exports: {} };
|
|
|
840
840
|
}).then(function(k) {
|
|
841
841
|
a.db = v.db = k, i._dbInfo = a;
|
|
842
842
|
for (var q = 0; q < F.length; q++) {
|
|
843
|
-
var
|
|
844
|
-
|
|
843
|
+
var j = F[q];
|
|
844
|
+
j !== i && (j._dbInfo.db = a.db, j._dbInfo.version = a.version);
|
|
845
845
|
}
|
|
846
846
|
});
|
|
847
847
|
}
|
|
@@ -850,14 +850,14 @@ var nt = { exports: {} };
|
|
|
850
850
|
n = r(n);
|
|
851
851
|
var m = new d(function(v, o) {
|
|
852
852
|
a.ready().then(function() {
|
|
853
|
-
W(a._dbInfo,
|
|
854
|
-
if (
|
|
855
|
-
return o(
|
|
853
|
+
W(a._dbInfo, M, function(L, R) {
|
|
854
|
+
if (L)
|
|
855
|
+
return o(L);
|
|
856
856
|
try {
|
|
857
857
|
var B = R.objectStore(a._dbInfo.storeName), F = B.get(n);
|
|
858
858
|
F.onsuccess = function() {
|
|
859
859
|
var k = F.result;
|
|
860
|
-
k === void 0 && (k = null), H(k) && (k =
|
|
860
|
+
k === void 0 && (k = null), H(k) && (k = Z(k)), v(k);
|
|
861
861
|
}, F.onerror = function() {
|
|
862
862
|
o(F.error);
|
|
863
863
|
};
|
|
@@ -872,17 +872,17 @@ var nt = { exports: {} };
|
|
|
872
872
|
function ge(n, i) {
|
|
873
873
|
var a = this, m = new d(function(v, o) {
|
|
874
874
|
a.ready().then(function() {
|
|
875
|
-
W(a._dbInfo,
|
|
876
|
-
if (
|
|
877
|
-
return o(
|
|
875
|
+
W(a._dbInfo, M, function(L, R) {
|
|
876
|
+
if (L)
|
|
877
|
+
return o(L);
|
|
878
878
|
try {
|
|
879
879
|
var B = R.objectStore(a._dbInfo.storeName), F = B.openCursor(), k = 1;
|
|
880
880
|
F.onsuccess = function() {
|
|
881
881
|
var q = F.result;
|
|
882
882
|
if (q) {
|
|
883
|
-
var
|
|
884
|
-
H(
|
|
885
|
-
var p = n(
|
|
883
|
+
var j = q.value;
|
|
884
|
+
H(j) && (j = Z(j));
|
|
885
|
+
var p = n(j, q.key, k++);
|
|
886
886
|
p !== void 0 ? v(p) : q.continue();
|
|
887
887
|
} else
|
|
888
888
|
v();
|
|
@@ -900,31 +900,31 @@ var nt = { exports: {} };
|
|
|
900
900
|
function Be(n, i, a) {
|
|
901
901
|
var m = this;
|
|
902
902
|
n = r(n);
|
|
903
|
-
var v = new d(function(o,
|
|
903
|
+
var v = new d(function(o, L) {
|
|
904
904
|
var R;
|
|
905
905
|
m.ready().then(function() {
|
|
906
|
-
return R = m._dbInfo,
|
|
906
|
+
return R = m._dbInfo, b.call(i) === "[object Blob]" ? C(R.db).then(function(B) {
|
|
907
907
|
return B ? i : G(i);
|
|
908
908
|
}) : i;
|
|
909
909
|
}).then(function(B) {
|
|
910
|
-
W(m._dbInfo,
|
|
910
|
+
W(m._dbInfo, A, function(F, k) {
|
|
911
911
|
if (F)
|
|
912
|
-
return
|
|
912
|
+
return L(F);
|
|
913
913
|
try {
|
|
914
914
|
var q = k.objectStore(m._dbInfo.storeName);
|
|
915
915
|
B === null && (B = void 0);
|
|
916
|
-
var
|
|
916
|
+
var j = q.put(B, n);
|
|
917
917
|
k.oncomplete = function() {
|
|
918
918
|
B === void 0 && (B = null), o(B);
|
|
919
919
|
}, k.onabort = k.onerror = function() {
|
|
920
|
-
var p =
|
|
921
|
-
|
|
920
|
+
var p = j.error ? j.error : j.transaction.error;
|
|
921
|
+
L(p);
|
|
922
922
|
};
|
|
923
923
|
} catch (p) {
|
|
924
|
-
|
|
924
|
+
L(p);
|
|
925
925
|
}
|
|
926
926
|
});
|
|
927
|
-
}).catch(
|
|
927
|
+
}).catch(L);
|
|
928
928
|
});
|
|
929
929
|
return h(v, a), v;
|
|
930
930
|
}
|
|
@@ -933,9 +933,9 @@ var nt = { exports: {} };
|
|
|
933
933
|
n = r(n);
|
|
934
934
|
var m = new d(function(v, o) {
|
|
935
935
|
a.ready().then(function() {
|
|
936
|
-
W(a._dbInfo,
|
|
937
|
-
if (
|
|
938
|
-
return o(
|
|
936
|
+
W(a._dbInfo, A, function(L, R) {
|
|
937
|
+
if (L)
|
|
938
|
+
return o(L);
|
|
939
939
|
try {
|
|
940
940
|
var B = R.objectStore(a._dbInfo.storeName), F = B.delete(n);
|
|
941
941
|
R.oncomplete = function() {
|
|
@@ -957,14 +957,14 @@ var nt = { exports: {} };
|
|
|
957
957
|
function Fe(n) {
|
|
958
958
|
var i = this, a = new d(function(m, v) {
|
|
959
959
|
i.ready().then(function() {
|
|
960
|
-
W(i._dbInfo,
|
|
960
|
+
W(i._dbInfo, A, function(o, L) {
|
|
961
961
|
if (o)
|
|
962
962
|
return v(o);
|
|
963
963
|
try {
|
|
964
|
-
var R =
|
|
965
|
-
|
|
964
|
+
var R = L.objectStore(i._dbInfo.storeName), B = R.clear();
|
|
965
|
+
L.oncomplete = function() {
|
|
966
966
|
m();
|
|
967
|
-
},
|
|
967
|
+
}, L.onabort = L.onerror = function() {
|
|
968
968
|
var F = B.error ? B.error : B.transaction.error;
|
|
969
969
|
v(F);
|
|
970
970
|
};
|
|
@@ -979,11 +979,11 @@ var nt = { exports: {} };
|
|
|
979
979
|
function tr(n) {
|
|
980
980
|
var i = this, a = new d(function(m, v) {
|
|
981
981
|
i.ready().then(function() {
|
|
982
|
-
W(i._dbInfo,
|
|
982
|
+
W(i._dbInfo, M, function(o, L) {
|
|
983
983
|
if (o)
|
|
984
984
|
return v(o);
|
|
985
985
|
try {
|
|
986
|
-
var R =
|
|
986
|
+
var R = L.objectStore(i._dbInfo.storeName), B = R.count();
|
|
987
987
|
B.onsuccess = function() {
|
|
988
988
|
m(B.result);
|
|
989
989
|
}, B.onerror = function() {
|
|
@@ -1004,9 +1004,9 @@ var nt = { exports: {} };
|
|
|
1004
1004
|
return;
|
|
1005
1005
|
}
|
|
1006
1006
|
a.ready().then(function() {
|
|
1007
|
-
W(a._dbInfo,
|
|
1008
|
-
if (
|
|
1009
|
-
return o(
|
|
1007
|
+
W(a._dbInfo, M, function(L, R) {
|
|
1008
|
+
if (L)
|
|
1009
|
+
return o(L);
|
|
1010
1010
|
try {
|
|
1011
1011
|
var B = R.objectStore(a._dbInfo.storeName), F = !1, k = B.openKeyCursor();
|
|
1012
1012
|
k.onsuccess = function() {
|
|
@@ -1030,11 +1030,11 @@ var nt = { exports: {} };
|
|
|
1030
1030
|
function Ce(n) {
|
|
1031
1031
|
var i = this, a = new d(function(m, v) {
|
|
1032
1032
|
i.ready().then(function() {
|
|
1033
|
-
W(i._dbInfo,
|
|
1033
|
+
W(i._dbInfo, M, function(o, L) {
|
|
1034
1034
|
if (o)
|
|
1035
1035
|
return v(o);
|
|
1036
1036
|
try {
|
|
1037
|
-
var R =
|
|
1037
|
+
var R = L.objectStore(i._dbInfo.storeName), B = R.openKeyCursor(), F = [];
|
|
1038
1038
|
B.onsuccess = function() {
|
|
1039
1039
|
var k = B.result;
|
|
1040
1040
|
if (!k) {
|
|
@@ -1054,35 +1054,35 @@ var nt = { exports: {} };
|
|
|
1054
1054
|
return h(a, n), a;
|
|
1055
1055
|
}
|
|
1056
1056
|
function ar(n, i) {
|
|
1057
|
-
i =
|
|
1057
|
+
i = w.apply(this, arguments);
|
|
1058
1058
|
var a = this.config();
|
|
1059
1059
|
n = typeof n != "function" && n || {}, n.name || (n.name = n.name || a.name, n.storeName = n.storeName || a.storeName);
|
|
1060
1060
|
var m = this, v;
|
|
1061
1061
|
if (!n.name)
|
|
1062
1062
|
v = d.reject("Invalid arguments");
|
|
1063
1063
|
else {
|
|
1064
|
-
var o = n.name === a.name && m._dbInfo.db,
|
|
1064
|
+
var o = n.name === a.name && m._dbInfo.db, L = o ? d.resolve(m._dbInfo.db) : re(n).then(function(R) {
|
|
1065
1065
|
var B = y[n.name], F = B.forages;
|
|
1066
1066
|
B.db = R;
|
|
1067
1067
|
for (var k = 0; k < F.length; k++)
|
|
1068
1068
|
F[k]._dbInfo.db = R;
|
|
1069
1069
|
return R;
|
|
1070
1070
|
});
|
|
1071
|
-
n.storeName ? v =
|
|
1071
|
+
n.storeName ? v = L.then(function(R) {
|
|
1072
1072
|
if (R.objectStoreNames.contains(n.storeName)) {
|
|
1073
1073
|
var B = R.version + 1;
|
|
1074
1074
|
f(n);
|
|
1075
1075
|
var F = y[n.name], k = F.forages;
|
|
1076
1076
|
R.close();
|
|
1077
1077
|
for (var q = 0; q < k.length; q++) {
|
|
1078
|
-
var
|
|
1079
|
-
|
|
1078
|
+
var j = k[q];
|
|
1079
|
+
j._dbInfo.db = null, j._dbInfo.version = B;
|
|
1080
1080
|
}
|
|
1081
1081
|
var p = new d(function(te, fe) {
|
|
1082
1082
|
var ae = _.open(n.name, B);
|
|
1083
1083
|
ae.onerror = function(we) {
|
|
1084
|
-
var
|
|
1085
|
-
|
|
1084
|
+
var Ze = ae.result;
|
|
1085
|
+
Ze.close(), fe(we);
|
|
1086
1086
|
}, ae.onupgradeneeded = function() {
|
|
1087
1087
|
var we = ae.result;
|
|
1088
1088
|
we.deleteObjectStore(n.storeName);
|
|
@@ -1095,14 +1095,14 @@ var nt = { exports: {} };
|
|
|
1095
1095
|
F.db = te;
|
|
1096
1096
|
for (var fe = 0; fe < k.length; fe++) {
|
|
1097
1097
|
var ae = k[fe];
|
|
1098
|
-
ae._dbInfo.db = te,
|
|
1098
|
+
ae._dbInfo.db = te, E(ae._dbInfo);
|
|
1099
1099
|
}
|
|
1100
1100
|
}).catch(function(te) {
|
|
1101
|
-
throw (
|
|
1101
|
+
throw (K(n, te) || d.resolve()).catch(function() {
|
|
1102
1102
|
}), te;
|
|
1103
1103
|
});
|
|
1104
1104
|
}
|
|
1105
|
-
}) : v =
|
|
1105
|
+
}) : v = L.then(function(R) {
|
|
1106
1106
|
f(n);
|
|
1107
1107
|
var B = y[n.name], F = B.forages;
|
|
1108
1108
|
R.close();
|
|
@@ -1110,7 +1110,7 @@ var nt = { exports: {} };
|
|
|
1110
1110
|
var q = F[k];
|
|
1111
1111
|
q._dbInfo.db = null;
|
|
1112
1112
|
}
|
|
1113
|
-
var
|
|
1113
|
+
var j = new d(function(p, te) {
|
|
1114
1114
|
var fe = _.deleteDatabase(n.name);
|
|
1115
1115
|
fe.onerror = function() {
|
|
1116
1116
|
var ae = fe.result;
|
|
@@ -1122,14 +1122,14 @@ var nt = { exports: {} };
|
|
|
1122
1122
|
ae && ae.close(), p(ae);
|
|
1123
1123
|
};
|
|
1124
1124
|
});
|
|
1125
|
-
return
|
|
1125
|
+
return j.then(function(p) {
|
|
1126
1126
|
B.db = p;
|
|
1127
1127
|
for (var te = 0; te < F.length; te++) {
|
|
1128
1128
|
var fe = F[te];
|
|
1129
|
-
|
|
1129
|
+
E(fe._dbInfo);
|
|
1130
1130
|
}
|
|
1131
1131
|
}).catch(function(p) {
|
|
1132
|
-
throw (
|
|
1132
|
+
throw (K(n, p) || d.resolve()).catch(function() {
|
|
1133
1133
|
}), p;
|
|
1134
1134
|
});
|
|
1135
1135
|
});
|
|
@@ -1155,11 +1155,11 @@ var nt = { exports: {} };
|
|
|
1155
1155
|
}
|
|
1156
1156
|
var Se = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ir = "~~local_forage_type~", Je = /^~~local_forage_type~([^~]+)~/, ke = "__lfsc__:", Pe = ke.length, qe = "arbf", Ie = "blob", je = "si08", Ke = "ui08", He = "uic8", Ve = "si16", U = "si32", Q = "ur16", V = "ui32", O = "fl32", de = "fl64", ye = Pe + qe.length, De = Object.prototype.toString;
|
|
1157
1157
|
function Ae(n) {
|
|
1158
|
-
var i = n.length * 0.75, a = n.length, m, v = 0, o,
|
|
1158
|
+
var i = n.length * 0.75, a = n.length, m, v = 0, o, L, R, B;
|
|
1159
1159
|
n[n.length - 1] === "=" && (i--, n[n.length - 2] === "=" && i--);
|
|
1160
1160
|
var F = new ArrayBuffer(i), k = new Uint8Array(F);
|
|
1161
1161
|
for (m = 0; m < a; m += 4)
|
|
1162
|
-
o = Se.indexOf(n[m]),
|
|
1162
|
+
o = Se.indexOf(n[m]), L = Se.indexOf(n[m + 1]), R = Se.indexOf(n[m + 2]), B = Se.indexOf(n[m + 3]), k[v++] = o << 2 | L >> 4, k[v++] = (L & 15) << 4 | R >> 2, k[v++] = (R & 3) << 6 | B & 63;
|
|
1163
1163
|
return F;
|
|
1164
1164
|
}
|
|
1165
1165
|
function oe(n) {
|
|
@@ -1168,7 +1168,7 @@ var nt = { exports: {} };
|
|
|
1168
1168
|
a += Se[i[m] >> 2], a += Se[(i[m] & 3) << 4 | i[m + 1] >> 4], a += Se[(i[m + 1] & 15) << 2 | i[m + 2] >> 6], a += Se[i[m + 2] & 63];
|
|
1169
1169
|
return i.length % 3 === 2 ? a = a.substring(0, a.length - 1) + "=" : i.length % 3 === 1 && (a = a.substring(0, a.length - 2) + "=="), a;
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function Le(n, i) {
|
|
1172
1172
|
var a = "";
|
|
1173
1173
|
if (n && (a = De.call(n)), n && (a === "[object ArrayBuffer]" || n.buffer && De.call(n.buffer) === "[object ArrayBuffer]")) {
|
|
1174
1174
|
var m, v = ke;
|
|
@@ -1176,14 +1176,14 @@ var nt = { exports: {} };
|
|
|
1176
1176
|
} else if (a === "[object Blob]") {
|
|
1177
1177
|
var o = new FileReader();
|
|
1178
1178
|
o.onload = function() {
|
|
1179
|
-
var
|
|
1180
|
-
i(ke + Ie +
|
|
1179
|
+
var L = ir + n.type + "~" + oe(this.result);
|
|
1180
|
+
i(ke + Ie + L);
|
|
1181
1181
|
}, o.readAsArrayBuffer(n);
|
|
1182
1182
|
} else
|
|
1183
1183
|
try {
|
|
1184
1184
|
i(JSON.stringify(n));
|
|
1185
|
-
} catch (
|
|
1186
|
-
console.error("Couldn't convert value into a JSON string: ", n), i(null,
|
|
1185
|
+
} catch (L) {
|
|
1186
|
+
console.error("Couldn't convert value into a JSON string: ", n), i(null, L);
|
|
1187
1187
|
}
|
|
1188
1188
|
}
|
|
1189
1189
|
function ct(n) {
|
|
@@ -1223,7 +1223,7 @@ var nt = { exports: {} };
|
|
|
1223
1223
|
}
|
|
1224
1224
|
}
|
|
1225
1225
|
var cr = {
|
|
1226
|
-
serialize:
|
|
1226
|
+
serialize: Le,
|
|
1227
1227
|
deserialize: ct,
|
|
1228
1228
|
stringToBuffer: Ae,
|
|
1229
1229
|
bufferToString: oe
|
|
@@ -1238,29 +1238,29 @@ var nt = { exports: {} };
|
|
|
1238
1238
|
if (n)
|
|
1239
1239
|
for (var m in n)
|
|
1240
1240
|
a[m] = typeof n[m] != "string" ? n[m].toString() : n[m];
|
|
1241
|
-
var v = new d(function(o,
|
|
1241
|
+
var v = new d(function(o, L) {
|
|
1242
1242
|
try {
|
|
1243
1243
|
a.db = openDatabase(a.name, String(a.version), a.description, a.size);
|
|
1244
1244
|
} catch (R) {
|
|
1245
|
-
return
|
|
1245
|
+
return L(R);
|
|
1246
1246
|
}
|
|
1247
1247
|
a.db.transaction(function(R) {
|
|
1248
1248
|
Rr(R, a, function() {
|
|
1249
1249
|
i._dbInfo = a, o();
|
|
1250
1250
|
}, function(B, F) {
|
|
1251
|
-
|
|
1251
|
+
L(F);
|
|
1252
1252
|
});
|
|
1253
|
-
},
|
|
1253
|
+
}, L);
|
|
1254
1254
|
});
|
|
1255
1255
|
return a.serializer = cr, v;
|
|
1256
1256
|
}
|
|
1257
1257
|
function xe(n, i, a, m, v, o) {
|
|
1258
|
-
n.executeSql(a, m, v, function(
|
|
1259
|
-
R.code === R.SYNTAX_ERR ?
|
|
1258
|
+
n.executeSql(a, m, v, function(L, R) {
|
|
1259
|
+
R.code === R.SYNTAX_ERR ? L.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [i.storeName], function(B, F) {
|
|
1260
1260
|
F.rows.length ? o(B, R) : Rr(B, i, function() {
|
|
1261
1261
|
B.executeSql(a, m, v, o);
|
|
1262
1262
|
}, o);
|
|
1263
|
-
}, o) : o(
|
|
1263
|
+
}, o) : o(L, R);
|
|
1264
1264
|
}, o);
|
|
1265
1265
|
}
|
|
1266
1266
|
function st(n, i) {
|
|
@@ -1268,11 +1268,11 @@ var nt = { exports: {} };
|
|
|
1268
1268
|
n = r(n);
|
|
1269
1269
|
var m = new d(function(v, o) {
|
|
1270
1270
|
a.ready().then(function() {
|
|
1271
|
-
var
|
|
1272
|
-
|
|
1273
|
-
xe(R,
|
|
1271
|
+
var L = a._dbInfo;
|
|
1272
|
+
L.db.transaction(function(R) {
|
|
1273
|
+
xe(R, L, "SELECT * FROM " + L.storeName + " WHERE key = ? LIMIT 1", [n], function(B, F) {
|
|
1274
1274
|
var k = F.rows.length ? F.rows.item(0).value : null;
|
|
1275
|
-
k && (k =
|
|
1275
|
+
k && (k = L.serializer.deserialize(k)), v(k);
|
|
1276
1276
|
}, function(B, F) {
|
|
1277
1277
|
o(F);
|
|
1278
1278
|
});
|
|
@@ -1284,12 +1284,12 @@ var nt = { exports: {} };
|
|
|
1284
1284
|
function ot(n, i) {
|
|
1285
1285
|
var a = this, m = new d(function(v, o) {
|
|
1286
1286
|
a.ready().then(function() {
|
|
1287
|
-
var
|
|
1288
|
-
|
|
1289
|
-
xe(R,
|
|
1290
|
-
for (var k = F.rows, q = k.length,
|
|
1291
|
-
var p = k.item(
|
|
1292
|
-
if (te && (te =
|
|
1287
|
+
var L = a._dbInfo;
|
|
1288
|
+
L.db.transaction(function(R) {
|
|
1289
|
+
xe(R, L, "SELECT * FROM " + L.storeName, [], function(B, F) {
|
|
1290
|
+
for (var k = F.rows, q = k.length, j = 0; j < q; j++) {
|
|
1291
|
+
var p = k.item(j), te = p.value;
|
|
1292
|
+
if (te && (te = L.serializer.deserialize(te)), te = n(te, p.key, j + 1), te !== void 0) {
|
|
1293
1293
|
v(te);
|
|
1294
1294
|
return;
|
|
1295
1295
|
}
|
|
@@ -1306,24 +1306,24 @@ var nt = { exports: {} };
|
|
|
1306
1306
|
function Ur(n, i, a, m) {
|
|
1307
1307
|
var v = this;
|
|
1308
1308
|
n = r(n);
|
|
1309
|
-
var o = new d(function(
|
|
1309
|
+
var o = new d(function(L, R) {
|
|
1310
1310
|
v.ready().then(function() {
|
|
1311
1311
|
i === void 0 && (i = null);
|
|
1312
1312
|
var B = i, F = v._dbInfo;
|
|
1313
1313
|
F.serializer.serialize(i, function(k, q) {
|
|
1314
|
-
q ? R(q) : F.db.transaction(function(
|
|
1315
|
-
xe(
|
|
1316
|
-
|
|
1314
|
+
q ? R(q) : F.db.transaction(function(j) {
|
|
1315
|
+
xe(j, F, "INSERT OR REPLACE INTO " + F.storeName + " (key, value) VALUES (?, ?)", [n, k], function() {
|
|
1316
|
+
L(B);
|
|
1317
1317
|
}, function(p, te) {
|
|
1318
1318
|
R(te);
|
|
1319
1319
|
});
|
|
1320
|
-
}, function(
|
|
1321
|
-
if (
|
|
1320
|
+
}, function(j) {
|
|
1321
|
+
if (j.code === j.QUOTA_ERR) {
|
|
1322
1322
|
if (m > 0) {
|
|
1323
|
-
|
|
1323
|
+
L(Ur.apply(v, [n, B, a, m - 1]));
|
|
1324
1324
|
return;
|
|
1325
1325
|
}
|
|
1326
|
-
R(
|
|
1326
|
+
R(j);
|
|
1327
1327
|
}
|
|
1328
1328
|
});
|
|
1329
1329
|
});
|
|
@@ -1339,9 +1339,9 @@ var nt = { exports: {} };
|
|
|
1339
1339
|
n = r(n);
|
|
1340
1340
|
var m = new d(function(v, o) {
|
|
1341
1341
|
a.ready().then(function() {
|
|
1342
|
-
var
|
|
1343
|
-
|
|
1344
|
-
xe(R,
|
|
1342
|
+
var L = a._dbInfo;
|
|
1343
|
+
L.db.transaction(function(R) {
|
|
1344
|
+
xe(R, L, "DELETE FROM " + L.storeName + " WHERE key = ?", [n], function() {
|
|
1345
1345
|
v();
|
|
1346
1346
|
}, function(B, F) {
|
|
1347
1347
|
o(F);
|
|
@@ -1355,8 +1355,8 @@ var nt = { exports: {} };
|
|
|
1355
1355
|
var i = this, a = new d(function(m, v) {
|
|
1356
1356
|
i.ready().then(function() {
|
|
1357
1357
|
var o = i._dbInfo;
|
|
1358
|
-
o.db.transaction(function(
|
|
1359
|
-
xe(
|
|
1358
|
+
o.db.transaction(function(L) {
|
|
1359
|
+
xe(L, o, "DELETE FROM " + o.storeName, [], function() {
|
|
1360
1360
|
m();
|
|
1361
1361
|
}, function(R, B) {
|
|
1362
1362
|
v(B);
|
|
@@ -1370,8 +1370,8 @@ var nt = { exports: {} };
|
|
|
1370
1370
|
var i = this, a = new d(function(m, v) {
|
|
1371
1371
|
i.ready().then(function() {
|
|
1372
1372
|
var o = i._dbInfo;
|
|
1373
|
-
o.db.transaction(function(
|
|
1374
|
-
xe(
|
|
1373
|
+
o.db.transaction(function(L) {
|
|
1374
|
+
xe(L, o, "SELECT COUNT(key) as c FROM " + o.storeName, [], function(R, B) {
|
|
1375
1375
|
var F = B.rows.item(0).c;
|
|
1376
1376
|
m(F);
|
|
1377
1377
|
}, function(R, B) {
|
|
@@ -1385,9 +1385,9 @@ var nt = { exports: {} };
|
|
|
1385
1385
|
function gt(n, i) {
|
|
1386
1386
|
var a = this, m = new d(function(v, o) {
|
|
1387
1387
|
a.ready().then(function() {
|
|
1388
|
-
var
|
|
1389
|
-
|
|
1390
|
-
xe(R,
|
|
1388
|
+
var L = a._dbInfo;
|
|
1389
|
+
L.db.transaction(function(R) {
|
|
1390
|
+
xe(R, L, "SELECT key FROM " + L.storeName + " WHERE id = ? LIMIT 1", [n + 1], function(B, F) {
|
|
1391
1391
|
var k = F.rows.length ? F.rows.item(0).key : null;
|
|
1392
1392
|
v(k);
|
|
1393
1393
|
}, function(B, F) {
|
|
@@ -1402,8 +1402,8 @@ var nt = { exports: {} };
|
|
|
1402
1402
|
var i = this, a = new d(function(m, v) {
|
|
1403
1403
|
i.ready().then(function() {
|
|
1404
1404
|
var o = i._dbInfo;
|
|
1405
|
-
o.db.transaction(function(
|
|
1406
|
-
xe(
|
|
1405
|
+
o.db.transaction(function(L) {
|
|
1406
|
+
xe(L, o, "SELECT key FROM " + o.storeName, [], function(R, B) {
|
|
1407
1407
|
for (var F = [], k = 0; k < B.rows.length; k++)
|
|
1408
1408
|
F.push(B.rows.item(k).key);
|
|
1409
1409
|
m(F);
|
|
@@ -1419,11 +1419,11 @@ var nt = { exports: {} };
|
|
|
1419
1419
|
return new d(function(i, a) {
|
|
1420
1420
|
n.transaction(function(m) {
|
|
1421
1421
|
m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(v, o) {
|
|
1422
|
-
for (var
|
|
1423
|
-
|
|
1422
|
+
for (var L = [], R = 0; R < o.rows.length; R++)
|
|
1423
|
+
L.push(o.rows.item(R).name);
|
|
1424
1424
|
i({
|
|
1425
1425
|
db: n,
|
|
1426
|
-
storeNames:
|
|
1426
|
+
storeNames: L
|
|
1427
1427
|
});
|
|
1428
1428
|
}, function(v, o) {
|
|
1429
1429
|
a(o);
|
|
@@ -1434,18 +1434,18 @@ var nt = { exports: {} };
|
|
|
1434
1434
|
});
|
|
1435
1435
|
}
|
|
1436
1436
|
function bt(n, i) {
|
|
1437
|
-
i =
|
|
1437
|
+
i = w.apply(this, arguments);
|
|
1438
1438
|
var a = this.config();
|
|
1439
1439
|
n = typeof n != "function" && n || {}, n.name || (n.name = n.name || a.name, n.storeName = n.storeName || a.storeName);
|
|
1440
1440
|
var m = this, v;
|
|
1441
1441
|
return n.name ? v = new d(function(o) {
|
|
1442
|
-
var
|
|
1443
|
-
n.name === a.name ?
|
|
1444
|
-
db:
|
|
1442
|
+
var L;
|
|
1443
|
+
n.name === a.name ? L = m._dbInfo.db : L = openDatabase(n.name, "", "", 0), n.storeName ? o({
|
|
1444
|
+
db: L,
|
|
1445
1445
|
storeNames: [n.storeName]
|
|
1446
|
-
}) : o(wt(
|
|
1446
|
+
}) : o(wt(L));
|
|
1447
1447
|
}).then(function(o) {
|
|
1448
|
-
return new d(function(
|
|
1448
|
+
return new d(function(L, R) {
|
|
1449
1449
|
o.db.transaction(function(B) {
|
|
1450
1450
|
function F(p) {
|
|
1451
1451
|
return new d(function(te, fe) {
|
|
@@ -1456,10 +1456,10 @@ var nt = { exports: {} };
|
|
|
1456
1456
|
});
|
|
1457
1457
|
});
|
|
1458
1458
|
}
|
|
1459
|
-
for (var k = [], q = 0,
|
|
1459
|
+
for (var k = [], q = 0, j = o.storeNames.length; q < j; q++)
|
|
1460
1460
|
k.push(F(o.storeNames[q]));
|
|
1461
1461
|
d.all(k).then(function() {
|
|
1462
|
-
|
|
1462
|
+
L();
|
|
1463
1463
|
}).catch(function(p) {
|
|
1464
1464
|
R(p);
|
|
1465
1465
|
});
|
|
@@ -1533,11 +1533,11 @@ var nt = { exports: {} };
|
|
|
1533
1533
|
}
|
|
1534
1534
|
function _t(n, i) {
|
|
1535
1535
|
var a = this, m = a.ready().then(function() {
|
|
1536
|
-
for (var v = a._dbInfo, o = v.keyPrefix,
|
|
1536
|
+
for (var v = a._dbInfo, o = v.keyPrefix, L = o.length, R = localStorage.length, B = 1, F = 0; F < R; F++) {
|
|
1537
1537
|
var k = localStorage.key(F);
|
|
1538
1538
|
if (k.indexOf(o) === 0) {
|
|
1539
1539
|
var q = localStorage.getItem(k);
|
|
1540
|
-
if (q && (q = v.serializer.deserialize(q)), q = n(q, k.substring(
|
|
1540
|
+
if (q && (q = v.serializer.deserialize(q)), q = n(q, k.substring(L), B++), q !== void 0)
|
|
1541
1541
|
return q;
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
@@ -1558,21 +1558,21 @@ var nt = { exports: {} };
|
|
|
1558
1558
|
}
|
|
1559
1559
|
function Pt(n) {
|
|
1560
1560
|
var i = this, a = i.ready().then(function() {
|
|
1561
|
-
for (var m = i._dbInfo, v = localStorage.length, o = [],
|
|
1562
|
-
var R = localStorage.key(
|
|
1561
|
+
for (var m = i._dbInfo, v = localStorage.length, o = [], L = 0; L < v; L++) {
|
|
1562
|
+
var R = localStorage.key(L);
|
|
1563
1563
|
R.indexOf(m.keyPrefix) === 0 && o.push(R.substring(m.keyPrefix.length));
|
|
1564
1564
|
}
|
|
1565
1565
|
return o;
|
|
1566
1566
|
});
|
|
1567
1567
|
return h(a, n), a;
|
|
1568
1568
|
}
|
|
1569
|
-
function
|
|
1569
|
+
function Lt(n) {
|
|
1570
1570
|
var i = this, a = i.keys().then(function(m) {
|
|
1571
1571
|
return m.length;
|
|
1572
1572
|
});
|
|
1573
1573
|
return h(a, n), a;
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1575
|
+
function Nt(n, i) {
|
|
1576
1576
|
var a = this;
|
|
1577
1577
|
n = r(n);
|
|
1578
1578
|
var m = a.ready().then(function() {
|
|
@@ -1581,20 +1581,20 @@ var nt = { exports: {} };
|
|
|
1581
1581
|
});
|
|
1582
1582
|
return h(m, i), m;
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1584
|
+
function Mt(n, i, a) {
|
|
1585
1585
|
var m = this;
|
|
1586
1586
|
n = r(n);
|
|
1587
1587
|
var v = m.ready().then(function() {
|
|
1588
1588
|
i === void 0 && (i = null);
|
|
1589
1589
|
var o = i;
|
|
1590
|
-
return new d(function(
|
|
1590
|
+
return new d(function(L, R) {
|
|
1591
1591
|
var B = m._dbInfo;
|
|
1592
1592
|
B.serializer.serialize(i, function(F, k) {
|
|
1593
1593
|
if (k)
|
|
1594
1594
|
R(k);
|
|
1595
1595
|
else
|
|
1596
1596
|
try {
|
|
1597
|
-
localStorage.setItem(B.keyPrefix + n, F),
|
|
1597
|
+
localStorage.setItem(B.keyPrefix + n, F), L(o);
|
|
1598
1598
|
} catch (q) {
|
|
1599
1599
|
(q.name === "QuotaExceededError" || q.name === "NS_ERROR_DOM_QUOTA_REACHED") && R(q), R(q);
|
|
1600
1600
|
}
|
|
@@ -1604,7 +1604,7 @@ var nt = { exports: {} };
|
|
|
1604
1604
|
return h(v, a), v;
|
|
1605
1605
|
}
|
|
1606
1606
|
function Rt(n, i) {
|
|
1607
|
-
if (i =
|
|
1607
|
+
if (i = w.apply(this, arguments), n = typeof n != "function" && n || {}, !n.name) {
|
|
1608
1608
|
var a = this.config();
|
|
1609
1609
|
n.name = n.name || a.name, n.storeName = n.storeName || a.storeName;
|
|
1610
1610
|
}
|
|
@@ -1612,8 +1612,8 @@ var nt = { exports: {} };
|
|
|
1612
1612
|
return n.name ? v = new d(function(o) {
|
|
1613
1613
|
n.storeName ? o(Br(n, m._defaultConfig)) : o(n.name + "/");
|
|
1614
1614
|
}).then(function(o) {
|
|
1615
|
-
for (var
|
|
1616
|
-
var R = localStorage.key(
|
|
1615
|
+
for (var L = localStorage.length - 1; L >= 0; L--) {
|
|
1616
|
+
var R = localStorage.key(L);
|
|
1617
1617
|
R.indexOf(o) === 0 && localStorage.removeItem(R);
|
|
1618
1618
|
}
|
|
1619
1619
|
}) : v = d.reject("Invalid arguments"), h(v, i), v;
|
|
@@ -1624,10 +1624,10 @@ var nt = { exports: {} };
|
|
|
1624
1624
|
_support: At(),
|
|
1625
1625
|
iterate: _t,
|
|
1626
1626
|
getItem: Tt,
|
|
1627
|
-
setItem:
|
|
1628
|
-
removeItem:
|
|
1627
|
+
setItem: Mt,
|
|
1628
|
+
removeItem: Nt,
|
|
1629
1629
|
clear: xt,
|
|
1630
|
-
length:
|
|
1630
|
+
length: Lt,
|
|
1631
1631
|
key: Ct,
|
|
1632
1632
|
keys: Pt,
|
|
1633
1633
|
dropInstance: Rt
|
|
@@ -1697,14 +1697,14 @@ var nt = { exports: {} };
|
|
|
1697
1697
|
} else
|
|
1698
1698
|
return typeof a == "string" ? this._config[a] : this._config;
|
|
1699
1699
|
}, n.prototype.defineDriver = function(a, m, v) {
|
|
1700
|
-
var o = new d(function(
|
|
1700
|
+
var o = new d(function(L, R) {
|
|
1701
1701
|
try {
|
|
1702
1702
|
var B = a._driver, F = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");
|
|
1703
1703
|
if (!a._driver) {
|
|
1704
1704
|
R(F);
|
|
1705
1705
|
return;
|
|
1706
1706
|
}
|
|
1707
|
-
for (var k = fr.concat("_initStorage"), q = 0,
|
|
1707
|
+
for (var k = fr.concat("_initStorage"), q = 0, j = k.length; q < j; q++) {
|
|
1708
1708
|
var p = k[q], te = !$t(Qe, p);
|
|
1709
1709
|
if ((te || a[p]) && typeof a[p] != "function") {
|
|
1710
1710
|
R(F);
|
|
@@ -1712,19 +1712,19 @@ var nt = { exports: {} };
|
|
|
1712
1712
|
}
|
|
1713
1713
|
}
|
|
1714
1714
|
var fe = function() {
|
|
1715
|
-
for (var
|
|
1715
|
+
for (var Ze = function(Vt) {
|
|
1716
1716
|
return function() {
|
|
1717
1717
|
var zt = new Error("Method " + Vt + " is not implemented by the current driver"), kr = d.reject(zt);
|
|
1718
1718
|
return h(kr, arguments[arguments.length - 1]), kr;
|
|
1719
1719
|
};
|
|
1720
1720
|
}, or = 0, Ht = Qe.length; or < Ht; or++) {
|
|
1721
1721
|
var dr = Qe[or];
|
|
1722
|
-
a[dr] || (a[dr] =
|
|
1722
|
+
a[dr] || (a[dr] = Ze(dr));
|
|
1723
1723
|
}
|
|
1724
1724
|
};
|
|
1725
1725
|
fe();
|
|
1726
|
-
var ae = function(
|
|
1727
|
-
ze[B] && console.info("Redefining LocalForage driver: " + B), ze[B] = a, Fr[B] =
|
|
1726
|
+
var ae = function(Ze) {
|
|
1727
|
+
ze[B] && console.info("Redefining LocalForage driver: " + B), ze[B] = a, Fr[B] = Ze, L();
|
|
1728
1728
|
};
|
|
1729
1729
|
"_support" in a ? a._support && typeof a._support == "function" ? a._support().then(ae, R) : ae(!!a._support) : ae(!0);
|
|
1730
1730
|
} catch (we) {
|
|
@@ -1748,7 +1748,7 @@ var nt = { exports: {} };
|
|
|
1748
1748
|
}, n.prototype.setDriver = function(a, m, v) {
|
|
1749
1749
|
var o = this;
|
|
1750
1750
|
$r(a) || (a = [a]);
|
|
1751
|
-
var
|
|
1751
|
+
var L = this._getSupportedDrivers(a);
|
|
1752
1752
|
function R() {
|
|
1753
1753
|
o._config.driver = o.driver();
|
|
1754
1754
|
}
|
|
@@ -1757,11 +1757,11 @@ var nt = { exports: {} };
|
|
|
1757
1757
|
}
|
|
1758
1758
|
function F(q) {
|
|
1759
1759
|
return function() {
|
|
1760
|
-
var
|
|
1760
|
+
var j = 0;
|
|
1761
1761
|
function p() {
|
|
1762
|
-
for (;
|
|
1763
|
-
var te = q[
|
|
1764
|
-
return
|
|
1762
|
+
for (; j < q.length; ) {
|
|
1763
|
+
var te = q[j];
|
|
1764
|
+
return j++, o._dbInfo = null, o._ready = null, o.getDriver(te).then(B).catch(p);
|
|
1765
1765
|
}
|
|
1766
1766
|
R();
|
|
1767
1767
|
var fe = new Error("No available storage method found.");
|
|
@@ -1774,9 +1774,9 @@ var nt = { exports: {} };
|
|
|
1774
1774
|
return d.resolve();
|
|
1775
1775
|
}) : d.resolve();
|
|
1776
1776
|
return this._driverSet = k.then(function() {
|
|
1777
|
-
var q =
|
|
1778
|
-
return o._dbInfo = null, o._ready = null, o.getDriver(q).then(function(
|
|
1779
|
-
o._driver =
|
|
1777
|
+
var q = L[0];
|
|
1778
|
+
return o._dbInfo = null, o._ready = null, o.getDriver(q).then(function(j) {
|
|
1779
|
+
o._driver = j._driver, R(), o._wrapLibraryMethodsWithReady(), o._initDriver = F(L);
|
|
1780
1780
|
});
|
|
1781
1781
|
}).catch(function() {
|
|
1782
1782
|
R();
|
|
@@ -1789,8 +1789,8 @@ var nt = { exports: {} };
|
|
|
1789
1789
|
sr(this, a);
|
|
1790
1790
|
}, n.prototype._getSupportedDrivers = function(a) {
|
|
1791
1791
|
for (var m = [], v = 0, o = a.length; v < o; v++) {
|
|
1792
|
-
var
|
|
1793
|
-
this.supports(
|
|
1792
|
+
var L = a[v];
|
|
1793
|
+
this.supports(L) && m.push(L);
|
|
1794
1794
|
}
|
|
1795
1795
|
return m;
|
|
1796
1796
|
}, n.prototype._wrapLibraryMethodsWithReady = function() {
|
|
@@ -1800,7 +1800,7 @@ var nt = { exports: {} };
|
|
|
1800
1800
|
return new n(a);
|
|
1801
1801
|
}, n;
|
|
1802
1802
|
}(), qt = new Wt();
|
|
1803
|
-
|
|
1803
|
+
S.exports = qt;
|
|
1804
1804
|
}, { 3: 3 }] }, {}, [4])(4);
|
|
1805
1805
|
});
|
|
1806
1806
|
})(nt);
|
|
@@ -1849,21 +1849,21 @@ function ma() {
|
|
|
1849
1849
|
async function l(s) {
|
|
1850
1850
|
return await ve().removeItem(s);
|
|
1851
1851
|
}
|
|
1852
|
-
async function
|
|
1852
|
+
async function S(s, g) {
|
|
1853
1853
|
await ve().setItem(g, s);
|
|
1854
1854
|
}
|
|
1855
1855
|
return {
|
|
1856
1856
|
clearAsync: e,
|
|
1857
1857
|
getAsync: t,
|
|
1858
1858
|
removeAsync: l,
|
|
1859
|
-
saveAsync:
|
|
1859
|
+
saveAsync: S
|
|
1860
1860
|
};
|
|
1861
1861
|
}
|
|
1862
1862
|
let rr;
|
|
1863
1863
|
function va(e) {
|
|
1864
1864
|
return rr(e)();
|
|
1865
1865
|
}
|
|
1866
|
-
function
|
|
1866
|
+
function Ne(e) {
|
|
1867
1867
|
return rr(e);
|
|
1868
1868
|
}
|
|
1869
1869
|
function wn(e) {
|
|
@@ -1873,8 +1873,8 @@ function wn(e) {
|
|
|
1873
1873
|
}), rr;
|
|
1874
1874
|
}
|
|
1875
1875
|
function bn(e) {
|
|
1876
|
-
var l,
|
|
1877
|
-
e.storeMode ?? (e.storeMode = ((
|
|
1876
|
+
var l, S, s, g, I;
|
|
1877
|
+
e.storeMode ?? (e.storeMode = ((S = (l = e.navigation) == null ? void 0 : l.findItem(e.nav)) == null ? void 0 : S.storeMode) ?? "session"), e.storageMode ?? (e.storageMode = ((g = (s = e.navigation) == null ? void 0 : s.findItem(e.nav)) == null ? void 0 : g.storageMode) ?? "local-cache"), e.storeName ?? (e.storeName = ((I = e.navigation) == null ? void 0 : I.findStoreName(e.nav)) ?? e.nav);
|
|
1878
1878
|
const t = { ...e, storeName: e.storeName ?? "" };
|
|
1879
1879
|
if (console.log("creating store def"), console.log(t), e.storeName == null)
|
|
1880
1880
|
throw new Error("no store name provided");
|
|
@@ -1903,45 +1903,45 @@ const Sn = (e) => {
|
|
|
1903
1903
|
function An(e) {
|
|
1904
1904
|
return pr(e.storeName, () => {
|
|
1905
1905
|
var u;
|
|
1906
|
-
const t = he.utc().toSeconds() / 86400, l = z({}),
|
|
1906
|
+
const t = he.utc().toSeconds() / 86400, l = z({}), S = z({}), s = e.storageMode == "local-cache", g = e.buildUrl ?? ((u = e.api) == null ? void 0 : u.buildUrl) ?? Sn;
|
|
1907
1907
|
function I(r) {
|
|
1908
1908
|
var c, y;
|
|
1909
|
-
let
|
|
1909
|
+
let w = "";
|
|
1910
1910
|
const D = r.params ?? {};
|
|
1911
|
-
return D != null && (
|
|
1911
|
+
return D != null && (w = Object.entries(D).sort(Re.firstBy((b) => b[0])).map((b) => `${b[0]}=${JSON.stringify(b[1])}`).join("&")), `${e.storeName ?? "base"}_${((c = e.auth) == null ? void 0 : c.credentials.value.userID) ?? "no-user-id"}_${r.id ?? ((y = r.data) == null ? void 0 : y.id) ?? "no-item-id"}_${w ?? "no-params"}`;
|
|
1912
1912
|
}
|
|
1913
|
-
async function
|
|
1913
|
+
async function P(r) {
|
|
1914
1914
|
r.additionalUrl ?? (r.additionalUrl = "/getAll"), g(r);
|
|
1915
|
-
const
|
|
1916
|
-
if (!D && l.value[
|
|
1917
|
-
return l.value[
|
|
1915
|
+
const w = I(r), D = r.refresh;
|
|
1916
|
+
if (!D && l.value[w] !== void 0)
|
|
1917
|
+
return l.value[w];
|
|
1918
1918
|
if (!D && s == !0) {
|
|
1919
|
-
const c = await ve().getItem(
|
|
1919
|
+
const c = await ve().getItem(w);
|
|
1920
1920
|
if (c != null && (e.api == null || parseFloat(c.meta.storedOn) > t - 7))
|
|
1921
|
-
return l.value[
|
|
1921
|
+
return l.value[w] = c, c;
|
|
1922
1922
|
}
|
|
1923
1923
|
if (e.api == null)
|
|
1924
|
-
return l.value[
|
|
1924
|
+
return l.value[w];
|
|
1925
1925
|
try {
|
|
1926
|
-
let c =
|
|
1927
|
-
c == null && (c = new Promise(async (
|
|
1928
|
-
var
|
|
1926
|
+
let c = S.value[w];
|
|
1927
|
+
c == null && (c = new Promise(async (b, M) => {
|
|
1928
|
+
var A;
|
|
1929
1929
|
try {
|
|
1930
|
-
const T = await ((
|
|
1930
|
+
const T = await ((A = e.api) == null ? void 0 : A.getAll(r)), x = {
|
|
1931
1931
|
meta: { storedOn: t.toString() },
|
|
1932
1932
|
data: T == null ? void 0 : T.data,
|
|
1933
1933
|
count: T == null ? void 0 : T.count,
|
|
1934
1934
|
filters: (T == null ? void 0 : T.filters) ?? []
|
|
1935
1935
|
};
|
|
1936
|
-
s == !0 && await ve().setItem(
|
|
1936
|
+
s == !0 && await ve().setItem(w, x), b(x);
|
|
1937
1937
|
} catch (T) {
|
|
1938
|
-
|
|
1938
|
+
M(T);
|
|
1939
1939
|
} finally {
|
|
1940
|
-
delete
|
|
1940
|
+
delete S.value[w];
|
|
1941
1941
|
}
|
|
1942
|
-
}),
|
|
1942
|
+
}), S.value[w] = c);
|
|
1943
1943
|
const y = await c;
|
|
1944
|
-
return l.value[
|
|
1944
|
+
return l.value[w] = y, {
|
|
1945
1945
|
data: y == null ? void 0 : y.data,
|
|
1946
1946
|
filters: y == null ? void 0 : y.filters,
|
|
1947
1947
|
count: y == null ? void 0 : y.count
|
|
@@ -1953,35 +1953,35 @@ function An(e) {
|
|
|
1953
1953
|
async function _(r) {
|
|
1954
1954
|
var c;
|
|
1955
1955
|
r.additionalUrl ?? (r.additionalUrl = "/get"), g(r);
|
|
1956
|
-
const
|
|
1957
|
-
if (!D && l.value[
|
|
1958
|
-
return l.value[
|
|
1956
|
+
const w = I(r), D = r.refresh;
|
|
1957
|
+
if (!D && l.value[w] !== void 0)
|
|
1958
|
+
return l.value[w];
|
|
1959
1959
|
if (!D && s == !0) {
|
|
1960
|
-
const y = await ve().getItem(
|
|
1960
|
+
const y = await ve().getItem(w);
|
|
1961
1961
|
if (y != null && (e.api == null || parseFloat(((c = y.meta) == null ? void 0 : c.storedOn) ?? "0") > t - 7))
|
|
1962
|
-
return l.value[
|
|
1962
|
+
return l.value[w] = y, { data: y.data };
|
|
1963
1963
|
}
|
|
1964
1964
|
if (e.api == null)
|
|
1965
|
-
return l.value[
|
|
1965
|
+
return l.value[w];
|
|
1966
1966
|
try {
|
|
1967
|
-
let y =
|
|
1968
|
-
y == null && (y = new Promise(async (
|
|
1967
|
+
let y = S.value[w];
|
|
1968
|
+
y == null && (y = new Promise(async (M, A) => {
|
|
1969
1969
|
var T;
|
|
1970
1970
|
try {
|
|
1971
1971
|
let x = await ((T = e.api) == null ? void 0 : T.get(r));
|
|
1972
|
-
const
|
|
1972
|
+
const C = {
|
|
1973
1973
|
meta: { storedOn: t.toString() },
|
|
1974
1974
|
data: x == null ? void 0 : x.data
|
|
1975
1975
|
};
|
|
1976
|
-
s == !0 && await ve().setItem(
|
|
1976
|
+
s == !0 && await ve().setItem(w, C), M(C);
|
|
1977
1977
|
} catch (x) {
|
|
1978
|
-
|
|
1978
|
+
A(x);
|
|
1979
1979
|
} finally {
|
|
1980
|
-
delete
|
|
1980
|
+
delete S.value[w];
|
|
1981
1981
|
}
|
|
1982
|
-
}),
|
|
1983
|
-
const
|
|
1984
|
-
return l.value[
|
|
1982
|
+
}), S.value[w] = y);
|
|
1983
|
+
const b = await y;
|
|
1984
|
+
return l.value[w] = b, { data: b.data };
|
|
1985
1985
|
} catch (y) {
|
|
1986
1986
|
throw y;
|
|
1987
1987
|
}
|
|
@@ -1989,7 +1989,7 @@ function An(e) {
|
|
|
1989
1989
|
async function N(r) {
|
|
1990
1990
|
var c;
|
|
1991
1991
|
r.additionalUrl ?? (r.additionalUrl = "/patch"), g(r);
|
|
1992
|
-
const
|
|
1992
|
+
const w = I(r);
|
|
1993
1993
|
let D;
|
|
1994
1994
|
if (e.api != null)
|
|
1995
1995
|
try {
|
|
@@ -2003,23 +2003,23 @@ function An(e) {
|
|
|
2003
2003
|
if (D != null) {
|
|
2004
2004
|
let y = {
|
|
2005
2005
|
meta: { storedOn: t.toString() },
|
|
2006
|
-
data: { ...(c = l.value[
|
|
2006
|
+
data: { ...(c = l.value[w]) == null ? void 0 : c.data, ...D }
|
|
2007
2007
|
};
|
|
2008
|
-
return l.value[
|
|
2009
|
-
const
|
|
2010
|
-
if (
|
|
2011
|
-
if (Array.isArray(
|
|
2012
|
-
for (let T = 0; T <
|
|
2013
|
-
|
|
2008
|
+
return l.value[w] = y, s == !0 && await ve().setItem(w, y), D.id != null && D.rowVersion != null && Object.entries(l.value).forEach((M) => {
|
|
2009
|
+
const A = M[1].data;
|
|
2010
|
+
if (A != null)
|
|
2011
|
+
if (Array.isArray(A))
|
|
2012
|
+
for (let T = 0; T < A.length; T++)
|
|
2013
|
+
A[T].id == D.id && A.splice(T, 1, y.data);
|
|
2014
2014
|
else
|
|
2015
|
-
|
|
2015
|
+
A.id == D.id && (l.value[M[0]] = y);
|
|
2016
2016
|
}), y.data;
|
|
2017
2017
|
}
|
|
2018
2018
|
return D;
|
|
2019
2019
|
}
|
|
2020
2020
|
async function $(r) {
|
|
2021
2021
|
r.additionalUrl ?? (r.additionalUrl = "/post"), g(r);
|
|
2022
|
-
const
|
|
2022
|
+
const w = I(r);
|
|
2023
2023
|
let D;
|
|
2024
2024
|
if (e.api != null)
|
|
2025
2025
|
try {
|
|
@@ -2035,14 +2035,14 @@ function An(e) {
|
|
|
2035
2035
|
meta: { storedOn: t.toString() },
|
|
2036
2036
|
data: D
|
|
2037
2037
|
};
|
|
2038
|
-
return s == !0 && await ve().setItem(
|
|
2038
|
+
return s == !0 && await ve().setItem(w, c), l.value[w] = c, c.data;
|
|
2039
2039
|
}
|
|
2040
2040
|
return D;
|
|
2041
2041
|
}
|
|
2042
2042
|
async function d(r) {
|
|
2043
2043
|
var c;
|
|
2044
2044
|
r.additionalUrl ?? (r.additionalUrl = "/delete"), g(r);
|
|
2045
|
-
const
|
|
2045
|
+
const w = I(r);
|
|
2046
2046
|
if (e.api != null)
|
|
2047
2047
|
try {
|
|
2048
2048
|
let y = await e.api.deleteItem(r);
|
|
@@ -2051,51 +2051,51 @@ function An(e) {
|
|
|
2051
2051
|
} catch (y) {
|
|
2052
2052
|
throw y;
|
|
2053
2053
|
}
|
|
2054
|
-
delete l.value[
|
|
2054
|
+
delete l.value[w];
|
|
2055
2055
|
const D = ((c = r.data) == null ? void 0 : c.id) ?? r.id;
|
|
2056
|
-
D != null && Object.entries(l.value).forEach((
|
|
2057
|
-
const
|
|
2058
|
-
if (
|
|
2059
|
-
if (Array.isArray(
|
|
2060
|
-
for (let
|
|
2061
|
-
|
|
2056
|
+
D != null && Object.entries(l.value).forEach((b) => {
|
|
2057
|
+
const M = b[1].data;
|
|
2058
|
+
if (M != null)
|
|
2059
|
+
if (Array.isArray(M))
|
|
2060
|
+
for (let A = 0; A < M.length; A++)
|
|
2061
|
+
M[A].id == D && M.splice(A, 1);
|
|
2062
2062
|
else
|
|
2063
|
-
delete l.value[
|
|
2064
|
-
}), s == !0 && await ve().removeItem(
|
|
2063
|
+
delete l.value[b[0]];
|
|
2064
|
+
}), s == !0 && await ve().removeItem(w);
|
|
2065
2065
|
}
|
|
2066
2066
|
async function h(r) {
|
|
2067
2067
|
if (r.additionalUrl ?? (r.additionalUrl = `/patch/restore?id=${r.data.id}`), g(r), e.api != null)
|
|
2068
2068
|
try {
|
|
2069
|
-
let
|
|
2070
|
-
return
|
|
2071
|
-
} catch (
|
|
2072
|
-
throw
|
|
2069
|
+
let w = await e.api.patch(r);
|
|
2070
|
+
return w == null ? void 0 : w.data;
|
|
2071
|
+
} catch (w) {
|
|
2072
|
+
throw w;
|
|
2073
2073
|
}
|
|
2074
2074
|
}
|
|
2075
2075
|
return {
|
|
2076
2076
|
deleteItem: d,
|
|
2077
2077
|
get: _,
|
|
2078
|
-
getAll:
|
|
2078
|
+
getAll: P,
|
|
2079
2079
|
patch: N,
|
|
2080
2080
|
post: $,
|
|
2081
2081
|
restore: h,
|
|
2082
2082
|
searchMemory: l,
|
|
2083
2083
|
//mainly for testing
|
|
2084
2084
|
currentTimeStampDays: t,
|
|
2085
|
-
promiseMemory:
|
|
2085
|
+
promiseMemory: S,
|
|
2086
2086
|
cacheLocally: s
|
|
2087
2087
|
};
|
|
2088
2088
|
});
|
|
2089
2089
|
}
|
|
2090
2090
|
function qr(e) {
|
|
2091
2091
|
return pr(e.storeName, () => {
|
|
2092
|
-
const t = z(), l = z(0),
|
|
2092
|
+
const t = z(), l = z(0), S = he.utc().toSeconds() / 3600, s = z(), g = z({ storedOn: S.toString() }), I = z({}), P = e.storageMode == "local-cache";
|
|
2093
2093
|
function _() {
|
|
2094
2094
|
var c;
|
|
2095
2095
|
return `${e.storeName}_${((c = e.auth) == null ? void 0 : c.credentials.value.userID) ?? "no-user-id"}`;
|
|
2096
2096
|
}
|
|
2097
2097
|
async function N() {
|
|
2098
|
-
if (console.log("trying save"),
|
|
2098
|
+
if (console.log("trying save"), P == !0) {
|
|
2099
2099
|
console.log("saving");
|
|
2100
2100
|
const c = {
|
|
2101
2101
|
meta: J(g),
|
|
@@ -2115,90 +2115,85 @@ function qr(e) {
|
|
|
2115
2115
|
}
|
|
2116
2116
|
function $(c) {
|
|
2117
2117
|
const y = _();
|
|
2118
|
-
return I.value[y] || (I.value[y] = new Promise(async (
|
|
2119
|
-
var
|
|
2118
|
+
return I.value[y] || (I.value[y] = new Promise(async (b, M) => {
|
|
2119
|
+
var A;
|
|
2120
2120
|
try {
|
|
2121
|
-
let T = await ((
|
|
2121
|
+
let T = await ((A = e.api) == null ? void 0 : A.getAll({
|
|
2122
2122
|
additionalUrl: "/getAll",
|
|
2123
2123
|
nav: c.nav,
|
|
2124
2124
|
params: {
|
|
2125
2125
|
lastUpdate: g.value.lastUpdate ?? ln()
|
|
2126
2126
|
}
|
|
2127
2127
|
}));
|
|
2128
|
-
|
|
2129
|
-
var f,
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2128
|
+
T == null ? M(T) : (t.value ?? (t.value = []), T.data.forEach((x) => {
|
|
2129
|
+
var f, E;
|
|
2130
|
+
const C = t.value.findIndex((K) => K.id == x.id);
|
|
2131
|
+
C >= 0 ? (f = t.value) == null || f.splice(C, 1, x) : (E = t.value) == null || E.push(x);
|
|
2132
2132
|
}), l.value = t.value.length, g.value = {
|
|
2133
2133
|
lastUpdate: he.utc().toString(),
|
|
2134
|
-
storedOn:
|
|
2135
|
-
}, await N(),
|
|
2134
|
+
storedOn: S.toString()
|
|
2135
|
+
}, await N(), b(T));
|
|
2136
2136
|
} catch (T) {
|
|
2137
|
-
|
|
2137
|
+
M(T);
|
|
2138
2138
|
} finally {
|
|
2139
2139
|
delete I.value[y];
|
|
2140
2140
|
}
|
|
2141
2141
|
})), I.value[y];
|
|
2142
2142
|
}
|
|
2143
2143
|
async function d(c) {
|
|
2144
|
-
var
|
|
2145
|
-
const y = _(),
|
|
2146
|
-
if (
|
|
2147
|
-
return
|
|
2148
|
-
count: (
|
|
2144
|
+
var M, A, T, x;
|
|
2145
|
+
const y = _(), b = c.refresh;
|
|
2146
|
+
if (!b && t.value != null)
|
|
2147
|
+
return {
|
|
2148
|
+
count: (M = t.value) == null ? void 0 : M.length,
|
|
2149
2149
|
data: t.value,
|
|
2150
2150
|
filters: []
|
|
2151
2151
|
};
|
|
2152
|
-
if (!
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
count: (x = t.value) == null ? void 0 : x.length,
|
|
2152
|
+
if (!b && P == !0) {
|
|
2153
|
+
const C = await ve().getItem(y);
|
|
2154
|
+
if (C != null && parseFloat(C.meta.storedOn) > S - 7)
|
|
2155
|
+
return t.value = C.data, l.value = C.data.length, s.value = C.filters ?? [], g.value = C.meta, {
|
|
2156
|
+
count: (A = t.value) == null ? void 0 : A.length,
|
|
2158
2157
|
data: t.value ?? [],
|
|
2159
2158
|
filters: []
|
|
2160
2159
|
};
|
|
2161
2160
|
}
|
|
2162
2161
|
if (e.api == null)
|
|
2163
2162
|
return console.log("no api"), {
|
|
2164
|
-
count: (
|
|
2163
|
+
count: (T = t.value) == null ? void 0 : T.length,
|
|
2165
2164
|
data: t.value ?? [],
|
|
2166
2165
|
filters: s.value
|
|
2167
2166
|
};
|
|
2168
2167
|
console.log("setting dataitems"), t.value ?? (t.value = []);
|
|
2169
2168
|
try {
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
console.log(L);
|
|
2173
|
-
var E = {
|
|
2174
|
-
count: (f = t.value) == null ? void 0 : f.length,
|
|
2169
|
+
return await $(c), {
|
|
2170
|
+
count: (x = t.value) == null ? void 0 : x.length,
|
|
2175
2171
|
data: t.value ?? [],
|
|
2176
2172
|
filters: s.value
|
|
2177
2173
|
};
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
throw new Error(j.message ?? "Problem");
|
|
2174
|
+
} catch (C) {
|
|
2175
|
+
let f = C;
|
|
2176
|
+
throw new Error(f.message ?? "Problem");
|
|
2182
2177
|
}
|
|
2183
2178
|
}
|
|
2184
2179
|
async function h(c) {
|
|
2185
|
-
var
|
|
2186
|
-
const y = _(),
|
|
2187
|
-
if (
|
|
2180
|
+
var A, T, x, C;
|
|
2181
|
+
const y = _(), b = c.id ?? ((A = c.data) == null ? void 0 : A.id);
|
|
2182
|
+
if (b == null)
|
|
2188
2183
|
throw new Error("no id provided");
|
|
2189
|
-
let
|
|
2190
|
-
if (!
|
|
2191
|
-
const f = t.value.find((
|
|
2184
|
+
let M = c.refresh;
|
|
2185
|
+
if (!M && t.value != null) {
|
|
2186
|
+
const f = t.value.find((E) => E.id == b);
|
|
2192
2187
|
if (f != null)
|
|
2193
2188
|
return { data: f };
|
|
2194
2189
|
}
|
|
2195
|
-
if (!
|
|
2190
|
+
if (!M && P == !0) {
|
|
2196
2191
|
const f = await ve().getItem(y);
|
|
2197
|
-
if (f != null && parseFloat(f.meta.storedOn) >
|
|
2192
|
+
if (f != null && parseFloat(f.meta.storedOn) > S - 12) {
|
|
2198
2193
|
t.value = f.data, l.value = f.data.length, s.value = f.filters ?? [], g.value = f.meta;
|
|
2199
|
-
let
|
|
2200
|
-
if (
|
|
2201
|
-
return { data:
|
|
2194
|
+
let E = (T = t.value) == null ? void 0 : T.find((K) => K.id == c.id);
|
|
2195
|
+
if (E != null)
|
|
2196
|
+
return { data: E };
|
|
2202
2197
|
}
|
|
2203
2198
|
}
|
|
2204
2199
|
if (e.api == null)
|
|
@@ -2207,14 +2202,14 @@ function qr(e) {
|
|
|
2207
2202
|
};
|
|
2208
2203
|
t.value ?? (t.value = []);
|
|
2209
2204
|
try {
|
|
2210
|
-
return await $(c), { data: (
|
|
2205
|
+
return await $(c), { data: (C = t.value) == null ? void 0 : C.find((f) => f.id == c.id) };
|
|
2211
2206
|
} catch (f) {
|
|
2212
|
-
let
|
|
2213
|
-
throw new Error(
|
|
2207
|
+
let E = f;
|
|
2208
|
+
throw new Error(E.message ?? "Problem");
|
|
2214
2209
|
}
|
|
2215
2210
|
}
|
|
2216
2211
|
async function u(c) {
|
|
2217
|
-
var
|
|
2212
|
+
var b, M, A;
|
|
2218
2213
|
c.additionalUrl ?? (c.additionalUrl = "/patch");
|
|
2219
2214
|
let y;
|
|
2220
2215
|
if (e.api != null)
|
|
@@ -2228,42 +2223,42 @@ function qr(e) {
|
|
|
2228
2223
|
else
|
|
2229
2224
|
y = c.data;
|
|
2230
2225
|
if (y != null) {
|
|
2231
|
-
let T = (
|
|
2232
|
-
T != null && T >= 0 && (t.value ?? (t.value = []), (
|
|
2226
|
+
let T = (b = t.value) == null ? void 0 : b.findIndex((x) => x.id == y.id);
|
|
2227
|
+
T != null && T >= 0 && (t.value ?? (t.value = []), (M = t.value) == null || M.splice(T, 1, y), await N());
|
|
2233
2228
|
}
|
|
2234
|
-
return (
|
|
2229
|
+
return (A = t.value) == null ? void 0 : A.find((T) => T.id == (c.id ?? c.data.id));
|
|
2235
2230
|
}
|
|
2236
2231
|
async function r(c) {
|
|
2237
|
-
var
|
|
2232
|
+
var b, M;
|
|
2238
2233
|
c.additionalUrl ?? (c.additionalUrl = "/post");
|
|
2239
2234
|
let y;
|
|
2240
2235
|
if (e.api != null)
|
|
2241
2236
|
try {
|
|
2242
|
-
let
|
|
2243
|
-
y =
|
|
2244
|
-
} catch (
|
|
2245
|
-
let T =
|
|
2237
|
+
let A = await e.api.post(c);
|
|
2238
|
+
y = A == null ? void 0 : A.data;
|
|
2239
|
+
} catch (A) {
|
|
2240
|
+
let T = A;
|
|
2246
2241
|
throw new Error(T.message ?? "Patch Problem");
|
|
2247
2242
|
}
|
|
2248
2243
|
else
|
|
2249
2244
|
y = c.data;
|
|
2250
|
-
return y != null && (t.value ?? (t.value = []), (
|
|
2245
|
+
return y != null && (t.value ?? (t.value = []), (b = t.value) == null || b.unshift(y), l.value += 1, await N()), (M = t.value) == null ? void 0 : M.find((A) => A.id == (c.id ?? c.data.id));
|
|
2251
2246
|
}
|
|
2252
|
-
async function
|
|
2253
|
-
var
|
|
2247
|
+
async function w(c) {
|
|
2248
|
+
var b, M;
|
|
2254
2249
|
if (c.additionalUrl ?? (c.additionalUrl = "/delete"), e.api != null)
|
|
2255
2250
|
try {
|
|
2256
|
-
let
|
|
2257
|
-
if (
|
|
2258
|
-
return
|
|
2259
|
-
} catch (
|
|
2260
|
-
let T =
|
|
2251
|
+
let A = await e.api.deleteItem(c);
|
|
2252
|
+
if (A != null)
|
|
2253
|
+
return A;
|
|
2254
|
+
} catch (A) {
|
|
2255
|
+
let T = A;
|
|
2261
2256
|
throw new Error(T.message ?? "Patch Problem");
|
|
2262
2257
|
}
|
|
2263
2258
|
const y = c.id ?? c.data.id;
|
|
2264
2259
|
if (y != null) {
|
|
2265
|
-
let
|
|
2266
|
-
|
|
2260
|
+
let A = (b = t.value) == null ? void 0 : b.findIndex((T) => T.id == y);
|
|
2261
|
+
A != null && A >= 0 && (t.value ?? (t.value = []), (M = t.value) == null || M.splice(A, 1), await N());
|
|
2267
2262
|
}
|
|
2268
2263
|
}
|
|
2269
2264
|
async function D(c) {
|
|
@@ -2271,20 +2266,20 @@ function qr(e) {
|
|
|
2271
2266
|
if (c.additionalUrl ?? (c.additionalUrl = `/patch/restore?id=${c.data.id}`), e.api != null)
|
|
2272
2267
|
try {
|
|
2273
2268
|
await e.api.patch(c);
|
|
2274
|
-
} catch (
|
|
2275
|
-
let
|
|
2276
|
-
throw new Error(
|
|
2269
|
+
} catch (b) {
|
|
2270
|
+
let M = b;
|
|
2271
|
+
throw new Error(M.message ?? "Patch Problem");
|
|
2277
2272
|
}
|
|
2278
2273
|
try {
|
|
2279
2274
|
c.additionalUrl = "/getAll", await $(c);
|
|
2280
|
-
} catch (
|
|
2281
|
-
let
|
|
2282
|
-
throw new Error(
|
|
2275
|
+
} catch (b) {
|
|
2276
|
+
let M = b;
|
|
2277
|
+
throw new Error(M.message ?? "Problem");
|
|
2283
2278
|
}
|
|
2284
|
-
return (y = t.value) == null ? void 0 : y.find((
|
|
2279
|
+
return (y = t.value) == null ? void 0 : y.find((b) => b.id == (c.id ?? c.data.id));
|
|
2285
2280
|
}
|
|
2286
2281
|
return {
|
|
2287
|
-
deleteItem:
|
|
2282
|
+
deleteItem: w,
|
|
2288
2283
|
get: h,
|
|
2289
2284
|
getAll: d,
|
|
2290
2285
|
patch: u,
|
|
@@ -2293,11 +2288,11 @@ function qr(e) {
|
|
|
2293
2288
|
//other stuff
|
|
2294
2289
|
dataItems: t,
|
|
2295
2290
|
count: l,
|
|
2296
|
-
currentTimeStampHours:
|
|
2291
|
+
currentTimeStampHours: S,
|
|
2297
2292
|
filters: s,
|
|
2298
2293
|
meta: g,
|
|
2299
2294
|
promiseMemory: I,
|
|
2300
|
-
cacheLocally:
|
|
2295
|
+
cacheLocally: P
|
|
2301
2296
|
};
|
|
2302
2297
|
});
|
|
2303
2298
|
}
|
|
@@ -2306,175 +2301,175 @@ function Er() {
|
|
|
2306
2301
|
return Ar;
|
|
2307
2302
|
}
|
|
2308
2303
|
function En(e) {
|
|
2309
|
-
const t = (e == null ? void 0 : e.buildHeaders) ??
|
|
2304
|
+
const t = (e == null ? void 0 : e.buildHeaders) ?? P, l = (e == null ? void 0 : e.buildQuery) ?? g, S = (e == null ? void 0 : e.buildUrl) ?? I, s = e == null ? void 0 : e.demo;
|
|
2310
2305
|
function g(u) {
|
|
2311
2306
|
let r = new URLSearchParams();
|
|
2312
|
-
return Object.entries(u).forEach((
|
|
2313
|
-
|
|
2314
|
-
}), u.filterBy && r.set("filterBy", u.filterBy), u.includeCount && r.set("includeCount", u.includeCount.toString()), u.includeDetails != null && r.set("includeDetails", u.includeDetails.toString()), u.includeInactive && r.set("includeInactive", u.includeInactive.toString()), u.properties && r.set("properties", u.properties.toString()), u.query && r.set("query", u.query.toString()), u.searchString && r.set("searchString", u.searchString), u.sortOrder && r.set("sortOrder", u.sortOrder), u.sortBy && r.set("sortBy", u.sortBy), u.takeFrom && r.set("takeFrom", u.takeFrom.toString()), u.takeAmount && r.set("takeAmount", u.takeAmount.toString()), u.other && Object.entries(u.other).forEach((
|
|
2315
|
-
|
|
2307
|
+
return Object.entries(u).forEach((w) => {
|
|
2308
|
+
w[1] != null && r.append(w[0], w[1]);
|
|
2309
|
+
}), u.filterBy && r.set("filterBy", u.filterBy), u.includeCount && r.set("includeCount", u.includeCount.toString()), u.includeDetails != null && r.set("includeDetails", u.includeDetails.toString()), u.includeInactive && r.set("includeInactive", u.includeInactive.toString()), u.properties && r.set("properties", u.properties.toString()), u.query && r.set("query", u.query.toString()), u.searchString && r.set("searchString", u.searchString), u.sortOrder && r.set("sortOrder", u.sortOrder), u.sortBy && r.set("sortBy", u.sortBy), u.takeFrom && r.set("takeFrom", u.takeFrom.toString()), u.takeAmount && r.set("takeAmount", u.takeAmount.toString()), u.other && Object.entries(u.other).forEach((w) => {
|
|
2310
|
+
w[1] != null && r.append(w[0], w[1].toString());
|
|
2316
2311
|
}), r.toString();
|
|
2317
2312
|
}
|
|
2318
2313
|
function I(u) {
|
|
2319
|
-
let r = J(u.url) ?? void 0,
|
|
2320
|
-
return r == null && (e == null ? void 0 : e.findPath) != null && (r = e.findPath(u.nav)), u.additionalUrl != null && (r == null ? r = u.additionalUrl : r = Ue(r, u.additionalUrl)),
|
|
2314
|
+
let r = J(u.url) ?? void 0, w = J(u.id);
|
|
2315
|
+
return r == null && (e == null ? void 0 : e.findPath) != null && (r = e.findPath(u.nav)), u.additionalUrl != null && (r == null ? r = u.additionalUrl : r = Ue(r, u.additionalUrl)), w != null && (r != null && r.includes("{id}") ? r = r.replaceAll("{id}", w) : r = Ue(r, w)), u.params != null && (r = `${r}?${l(u.params)}`), u.finalUrl = r, u.finalUrl ?? "";
|
|
2321
2316
|
}
|
|
2322
|
-
function
|
|
2323
|
-
var
|
|
2317
|
+
function P(u) {
|
|
2318
|
+
var w, D;
|
|
2324
2319
|
let r = { ...u.headers };
|
|
2325
|
-
return u.proxyID && (r.ManagedCompanyAccountID ?? (r.ManagedCompanyAccountID = u.proxyID)), (e == null ? void 0 : e.useBearerToken) != !1 && ((
|
|
2320
|
+
return u.proxyID && (r.ManagedCompanyAccountID ?? (r.ManagedCompanyAccountID = u.proxyID)), (e == null ? void 0 : e.useBearerToken) != !1 && ((w = e == null ? void 0 : e.auth) == null ? void 0 : w.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;
|
|
2326
2321
|
}
|
|
2327
2322
|
async function _(u) {
|
|
2328
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0,
|
|
2323
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, w = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2329
2324
|
let c = u.finalUrl, y = u.headers;
|
|
2330
|
-
if (c == null && (c =
|
|
2325
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (y = t(u)), s != null && s.isDemoing.value)
|
|
2331
2326
|
return console.log(`DEMO: Get from ${c}`), s.get(u);
|
|
2332
2327
|
console.log(`Get from ${c}`);
|
|
2333
|
-
let
|
|
2328
|
+
let b;
|
|
2334
2329
|
try {
|
|
2335
|
-
if (
|
|
2330
|
+
if (b = await fetch(c, {
|
|
2336
2331
|
method: "GET",
|
|
2337
2332
|
mode: "cors",
|
|
2338
2333
|
cache: "no-cache",
|
|
2339
2334
|
headers: y
|
|
2340
|
-
}), !
|
|
2341
|
-
if (
|
|
2335
|
+
}), !b.ok) {
|
|
2336
|
+
if (b.status == 401)
|
|
2342
2337
|
throw {
|
|
2343
|
-
code:
|
|
2338
|
+
code: b.status,
|
|
2344
2339
|
name: "Unauthorized",
|
|
2345
|
-
message:
|
|
2340
|
+
message: b.statusText
|
|
2346
2341
|
};
|
|
2347
|
-
let
|
|
2348
|
-
throw new Error(
|
|
2342
|
+
let M = await b.text();
|
|
2343
|
+
throw new Error(M ?? b.statusText ?? "Get error");
|
|
2349
2344
|
}
|
|
2350
2345
|
if (D)
|
|
2351
|
-
return await
|
|
2352
|
-
if (
|
|
2353
|
-
return await
|
|
2346
|
+
return await b.text();
|
|
2347
|
+
if (w)
|
|
2348
|
+
return await b.json();
|
|
2354
2349
|
throw new Error();
|
|
2355
|
-
} catch (
|
|
2356
|
-
const
|
|
2350
|
+
} catch (M) {
|
|
2351
|
+
const A = `${(b == null ? void 0 : b.status) ?? ""} ${(b == null ? void 0 : b.statusText) ?? ""} ${M.message}`;
|
|
2357
2352
|
if (!r)
|
|
2358
2353
|
return;
|
|
2359
|
-
throw
|
|
2354
|
+
throw M.code == 401 ? M : new Error(A);
|
|
2360
2355
|
}
|
|
2361
2356
|
}
|
|
2362
2357
|
async function N(u) {
|
|
2363
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0,
|
|
2358
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, w = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2364
2359
|
let c = u.finalUrl, y = u.headers;
|
|
2365
|
-
if (c == null && (c =
|
|
2360
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (y = t(u)), s != null && s.isDemoing.value)
|
|
2366
2361
|
return console.log(`DEMO: Get all from ${c}`), s.getAll(u);
|
|
2367
2362
|
console.log(`Get all from ${c}`);
|
|
2368
|
-
let
|
|
2363
|
+
let b;
|
|
2369
2364
|
try {
|
|
2370
|
-
if (
|
|
2365
|
+
if (b = await fetch(c, {
|
|
2371
2366
|
method: "GET",
|
|
2372
2367
|
mode: "cors",
|
|
2373
2368
|
cache: "no-cache",
|
|
2374
2369
|
headers: y
|
|
2375
|
-
}), !
|
|
2376
|
-
if (
|
|
2370
|
+
}), !b.ok) {
|
|
2371
|
+
if (b.status == 401)
|
|
2377
2372
|
throw {
|
|
2378
|
-
code:
|
|
2373
|
+
code: b.status,
|
|
2379
2374
|
name: "Unauthorized",
|
|
2380
|
-
message:
|
|
2375
|
+
message: b.statusText
|
|
2381
2376
|
};
|
|
2382
|
-
let
|
|
2383
|
-
throw new Error(
|
|
2377
|
+
let M = await b.text();
|
|
2378
|
+
throw new Error(M ?? b.statusText ?? "Get all error");
|
|
2384
2379
|
}
|
|
2385
2380
|
if (D)
|
|
2386
|
-
return await
|
|
2387
|
-
if (
|
|
2388
|
-
return await
|
|
2381
|
+
return await b.text();
|
|
2382
|
+
if (w)
|
|
2383
|
+
return await b.json();
|
|
2389
2384
|
throw new Error();
|
|
2390
|
-
} catch (
|
|
2391
|
-
const
|
|
2385
|
+
} catch (M) {
|
|
2386
|
+
const A = `${(b == null ? void 0 : b.status) ?? ""} ${(b == null ? void 0 : b.statusText) ?? ""} ${M.message}`;
|
|
2392
2387
|
if (!r)
|
|
2393
2388
|
return;
|
|
2394
|
-
throw
|
|
2389
|
+
throw M.code == 401 ? M : new Error(A);
|
|
2395
2390
|
}
|
|
2396
2391
|
}
|
|
2397
2392
|
async function $(u) {
|
|
2398
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0,
|
|
2393
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, w = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2399
2394
|
let c = u.finalUrl, y = u.headers;
|
|
2400
|
-
if (c == null && (c =
|
|
2395
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (y = t(u)), s != null && s.isDemoing.value)
|
|
2401
2396
|
return console.log(`DEMO: Post to ${c}`), s.post(u);
|
|
2402
2397
|
console.log(`Post to ${c}`);
|
|
2403
|
-
let
|
|
2398
|
+
let b;
|
|
2404
2399
|
try {
|
|
2405
|
-
if (
|
|
2400
|
+
if (b = await fetch(c, {
|
|
2406
2401
|
method: "POST",
|
|
2407
2402
|
mode: "cors",
|
|
2408
2403
|
cache: "no-cache",
|
|
2409
2404
|
headers: y,
|
|
2410
2405
|
body: JSON.stringify(u.data)
|
|
2411
|
-
}), !
|
|
2412
|
-
if (
|
|
2406
|
+
}), !b.ok) {
|
|
2407
|
+
if (b.status == 401)
|
|
2413
2408
|
throw {
|
|
2414
|
-
code:
|
|
2409
|
+
code: b.status,
|
|
2415
2410
|
name: "Unauthorized",
|
|
2416
|
-
message:
|
|
2411
|
+
message: b.statusText
|
|
2417
2412
|
};
|
|
2418
|
-
let
|
|
2419
|
-
throw new Error(
|
|
2413
|
+
let M = await b.text();
|
|
2414
|
+
throw new Error(M ?? b.statusText ?? "Post error!");
|
|
2420
2415
|
}
|
|
2421
2416
|
if (D)
|
|
2422
|
-
return await
|
|
2423
|
-
if (
|
|
2424
|
-
return await
|
|
2417
|
+
return await b.text();
|
|
2418
|
+
if (w)
|
|
2419
|
+
return await b.json();
|
|
2425
2420
|
throw new Error();
|
|
2426
|
-
} catch (
|
|
2427
|
-
if (
|
|
2421
|
+
} catch (M) {
|
|
2422
|
+
if (b.status == 200 || !r)
|
|
2428
2423
|
return;
|
|
2429
|
-
const
|
|
2430
|
-
throw
|
|
2424
|
+
const A = `${(b == null ? void 0 : b.status) ?? ""} ${(b == null ? void 0 : b.statusText) ?? ""} ${M.message}`;
|
|
2425
|
+
throw M.code == 401 ? M : new Error(A);
|
|
2431
2426
|
}
|
|
2432
2427
|
}
|
|
2433
2428
|
async function d(u) {
|
|
2434
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0,
|
|
2429
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, w = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2435
2430
|
let c = u.finalUrl, y = u.headers;
|
|
2436
|
-
if (c == null && (c =
|
|
2431
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (y = t(u)), s != null && s.isDemoing.value)
|
|
2437
2432
|
return console.log(`DEMO: Patch to ${c}`), s.patch(u);
|
|
2438
2433
|
console.log(`Patch to ${c}`);
|
|
2439
|
-
let
|
|
2434
|
+
let b;
|
|
2440
2435
|
try {
|
|
2441
|
-
if (
|
|
2436
|
+
if (b = await fetch(c, {
|
|
2442
2437
|
method: "PATCH",
|
|
2443
2438
|
mode: "cors",
|
|
2444
2439
|
cache: "no-cache",
|
|
2445
2440
|
headers: y,
|
|
2446
2441
|
body: JSON.stringify(u.data)
|
|
2447
|
-
}), !
|
|
2448
|
-
if (
|
|
2442
|
+
}), !b.ok) {
|
|
2443
|
+
if (b.status == 401)
|
|
2449
2444
|
throw {
|
|
2450
|
-
code:
|
|
2445
|
+
code: b.status,
|
|
2451
2446
|
name: "Unauthorized",
|
|
2452
|
-
message:
|
|
2447
|
+
message: b.statusText
|
|
2453
2448
|
};
|
|
2454
|
-
let
|
|
2455
|
-
throw new Error(
|
|
2449
|
+
let M = await b.text();
|
|
2450
|
+
throw new Error(M ?? b.statusText ?? "Patch error!");
|
|
2456
2451
|
}
|
|
2457
2452
|
if (D)
|
|
2458
|
-
return await
|
|
2459
|
-
if (
|
|
2460
|
-
return await
|
|
2453
|
+
return await b.text();
|
|
2454
|
+
if (w)
|
|
2455
|
+
return await b.json();
|
|
2461
2456
|
throw new Error();
|
|
2462
|
-
} catch (
|
|
2463
|
-
if (
|
|
2457
|
+
} catch (M) {
|
|
2458
|
+
if (b.status == 200 || !r)
|
|
2464
2459
|
return;
|
|
2465
|
-
const
|
|
2466
|
-
throw
|
|
2460
|
+
const A = `${(b == null ? void 0 : b.status) ?? ""} ${(b == null ? void 0 : b.statusText) ?? ""} ${M.message}`;
|
|
2461
|
+
throw M.code == 401 ? M : new Error(A);
|
|
2467
2462
|
}
|
|
2468
2463
|
}
|
|
2469
2464
|
async function h(u) {
|
|
2470
2465
|
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0;
|
|
2471
|
-
let
|
|
2472
|
-
if (
|
|
2473
|
-
return console.log(`DEMO: Delete ${
|
|
2474
|
-
console.log(`Delete ${
|
|
2466
|
+
let w = u.finalUrl, D = u.headers;
|
|
2467
|
+
if (w == null && (w = S(u)), u.overrideHeaders !== !0 && (D = t(u)), s != null && s.isDemoing.value)
|
|
2468
|
+
return console.log(`DEMO: Delete ${w}`), s.deleteItem(u);
|
|
2469
|
+
console.log(`Delete ${w}`);
|
|
2475
2470
|
let c;
|
|
2476
2471
|
try {
|
|
2477
|
-
if (c = await fetch(
|
|
2472
|
+
if (c = await fetch(w, {
|
|
2478
2473
|
method: "DELETE",
|
|
2479
2474
|
mode: "cors",
|
|
2480
2475
|
cache: "no-cache",
|
|
@@ -2488,16 +2483,16 @@ function En(e) {
|
|
|
2488
2483
|
};
|
|
2489
2484
|
return c.status == 200 ? void 0 : c.statusText;
|
|
2490
2485
|
} catch (y) {
|
|
2491
|
-
const
|
|
2486
|
+
const b = `${(c == null ? void 0 : c.status) ?? ""} ${(c == null ? void 0 : c.statusText) ?? ""} ${y.message}`;
|
|
2492
2487
|
if (!r)
|
|
2493
|
-
return
|
|
2488
|
+
return b;
|
|
2494
2489
|
throw y.code == 401 ? y : new Error(`${c.status} ${c.statusText} ${y.message}`);
|
|
2495
2490
|
}
|
|
2496
2491
|
}
|
|
2497
2492
|
return Ar = {
|
|
2498
2493
|
buildHeaders: t,
|
|
2499
2494
|
buildQuery: l,
|
|
2500
|
-
buildUrl:
|
|
2495
|
+
buildUrl: S,
|
|
2501
2496
|
deleteItem: h,
|
|
2502
2497
|
get: _,
|
|
2503
2498
|
getAll: N,
|
|
@@ -2506,17 +2501,17 @@ function En(e) {
|
|
|
2506
2501
|
}, Ar;
|
|
2507
2502
|
}
|
|
2508
2503
|
function ut(e) {
|
|
2509
|
-
const { actionErrorMsg: t, actionLoadingMsg: l, clearErrors:
|
|
2510
|
-
function
|
|
2504
|
+
const { actionErrorMsg: t, actionLoadingMsg: l, clearErrors: S, isLoading: s, doAction: g, logError: I } = en(e);
|
|
2505
|
+
function P(r) {
|
|
2511
2506
|
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);
|
|
2512
|
-
let
|
|
2507
|
+
let w = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2513
2508
|
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2514
|
-
return
|
|
2515
|
-
var
|
|
2516
|
-
const c = r.id ?? ((
|
|
2509
|
+
return w == null && r.nav != null && (w = Ne({ nav: r.nav })), w != null ? r.onDeleteAsync ?? (r.onDeleteAsync = () => w().deleteItem(r)) : r.onDeleteAsync ?? (r.onDeleteAsync = () => {
|
|
2510
|
+
var b;
|
|
2511
|
+
const c = r.id ?? ((b = r.data) == null ? void 0 : b.id);
|
|
2517
2512
|
if (c == null)
|
|
2518
2513
|
return Promise.resolve("No id found in delete action");
|
|
2519
|
-
const y = D.findIndex((
|
|
2514
|
+
const y = D.findIndex((M) => M.id == c);
|
|
2520
2515
|
return y >= 0 && D.splice(y, 1), Promise.resolve(void 0);
|
|
2521
2516
|
}), g(async () => {
|
|
2522
2517
|
let c;
|
|
@@ -2532,12 +2527,12 @@ function ut(e) {
|
|
|
2532
2527
|
}
|
|
2533
2528
|
function _(r) {
|
|
2534
2529
|
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);
|
|
2535
|
-
let
|
|
2530
|
+
let w = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2536
2531
|
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2537
|
-
return
|
|
2532
|
+
return w == null && r.nav != null && (w = Ne({ nav: r.nav })), w != null ? r.onGetAsync ?? (r.onGetAsync = async () => (await w().get(r)).data) : r.onGetAsync ?? (r.onGetAsync = () => {
|
|
2538
2533
|
var y;
|
|
2539
2534
|
const c = r.id ?? ((y = r.data) == null ? void 0 : y.id);
|
|
2540
|
-
return c == null ? Promise.resolve(void 0) : Promise.resolve(D.find((
|
|
2535
|
+
return c == null ? Promise.resolve(void 0) : Promise.resolve(D.find((b) => b.id == c));
|
|
2541
2536
|
}), g(async () => {
|
|
2542
2537
|
let c;
|
|
2543
2538
|
return r.onGetAsync != null && (c = await r.onGetAsync(r)), r.onGetSuccessAsync != null && (c = await r.onGetSuccessAsync(c, r)), c;
|
|
@@ -2552,9 +2547,9 @@ function ut(e) {
|
|
|
2552
2547
|
}
|
|
2553
2548
|
function N(r) {
|
|
2554
2549
|
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);
|
|
2555
|
-
let
|
|
2550
|
+
let w = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2556
2551
|
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2557
|
-
return
|
|
2552
|
+
return w == null && r.nav != null && (w = Ne({ nav: r.nav })), w != null ? r.onGetAsync ?? (r.onGetAsync = () => w().getAll(r)) : r.onGetAsync ?? (r.onGetAsync = () => Promise.resolve(D)), g(async () => {
|
|
2558
2553
|
let c;
|
|
2559
2554
|
return r.onGetAsync != null && (c = await r.onGetAsync(r)), r.onGetSuccessAsync != null && (c = await r.onGetSuccessAsync(c, r)), c;
|
|
2560
2555
|
}, {
|
|
@@ -2568,8 +2563,8 @@ function ut(e) {
|
|
|
2568
2563
|
}
|
|
2569
2564
|
function $(r) {
|
|
2570
2565
|
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);
|
|
2571
|
-
let
|
|
2572
|
-
return
|
|
2566
|
+
let w = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2567
|
+
return w == null && r.nav != null && (w = Ne({ nav: r.nav })), w != null && (r.onRestoreAsync ?? (r.onRestoreAsync = () => w().restore(r))), g(async () => {
|
|
2573
2568
|
let D, c;
|
|
2574
2569
|
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), I(D), c;
|
|
2575
2570
|
}, {
|
|
@@ -2583,21 +2578,21 @@ function ut(e) {
|
|
|
2583
2578
|
}
|
|
2584
2579
|
function d(r) {
|
|
2585
2580
|
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);
|
|
2586
|
-
let
|
|
2581
|
+
let w = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2587
2582
|
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2588
|
-
return r.onGetSaveAsync ?? (r.onGetSaveAsync = (c) => c), r.onCanSaveAsync ?? (r.onCanSaveAsync = () => Promise.resolve(void 0)),
|
|
2583
|
+
return r.onGetSaveAsync ?? (r.onGetSaveAsync = (c) => c), r.onCanSaveAsync ?? (r.onCanSaveAsync = () => Promise.resolve(void 0)), w == null && r.nav != null && (w = Ne({ nav: r.nav })), w != null ? r.onSaveAsync ?? (r.onSaveAsync = async () => {
|
|
2589
2584
|
var c;
|
|
2590
|
-
return r.mode ?? (r.mode = ((c = r.data) == null ? void 0 : c.id) == null ? "new" : "edit"), r.mode == "new" ? await
|
|
2585
|
+
return r.mode ?? (r.mode = ((c = r.data) == null ? void 0 : c.id) == null ? "new" : "edit"), r.mode == "new" ? await w().post(r) : await w().patch(r);
|
|
2591
2586
|
}) : r.onSaveAsync ?? (r.onSaveAsync = (c) => {
|
|
2592
|
-
const y = D.findIndex((
|
|
2587
|
+
const y = D.findIndex((b) => b.id == c.id);
|
|
2593
2588
|
return y >= 0 ? D.splice(y, 1, c) : D.push(c), Promise.resolve(c);
|
|
2594
2589
|
}), g(async () => {
|
|
2595
2590
|
let c;
|
|
2596
2591
|
if (r.onGetSaveAsync != null && (c = await r.onGetSaveAsync(r.data)), c == null)
|
|
2597
2592
|
return;
|
|
2598
2593
|
if (r.onCanSaveAsync != null) {
|
|
2599
|
-
let
|
|
2600
|
-
if (I(
|
|
2594
|
+
let b = await r.onCanSaveAsync(c);
|
|
2595
|
+
if (I(b), b != null)
|
|
2601
2596
|
return;
|
|
2602
2597
|
}
|
|
2603
2598
|
let y;
|
|
@@ -2622,8 +2617,8 @@ function ut(e) {
|
|
|
2622
2617
|
actionErrorMsg: t,
|
|
2623
2618
|
apiGet: h,
|
|
2624
2619
|
apiPost: u,
|
|
2625
|
-
clearErrors:
|
|
2626
|
-
deleteItem:
|
|
2620
|
+
clearErrors: S,
|
|
2621
|
+
deleteItem: P,
|
|
2627
2622
|
doAction: g,
|
|
2628
2623
|
getAllItems: N,
|
|
2629
2624
|
getItem: _,
|
|
@@ -2641,170 +2636,170 @@ function In() {
|
|
|
2641
2636
|
function Dn(e) {
|
|
2642
2637
|
const t = e.expiryTokenFormat ?? "d/MM/yyyy h:mm:ss a";
|
|
2643
2638
|
let l = z(localStorage.getItem(Hr) ?? "");
|
|
2644
|
-
l.value.length == 0 &&
|
|
2645
|
-
function
|
|
2639
|
+
l.value.length == 0 && S();
|
|
2640
|
+
function S() {
|
|
2646
2641
|
l.value = Math.random().toString(36).substring(4, 19) + Math.random().toString(12).substring(1, 11), localStorage.setItem(Hr, l.value);
|
|
2647
2642
|
}
|
|
2648
|
-
const s =
|
|
2643
|
+
const s = Yt("auth-credentials", {});
|
|
2649
2644
|
function g(x) {
|
|
2650
2645
|
if (x == null)
|
|
2651
2646
|
return !0;
|
|
2652
|
-
var
|
|
2653
|
-
if (
|
|
2647
|
+
var C = e.getAuthItem != null ? e.getAuthItem(x) : null;
|
|
2648
|
+
if (C == null)
|
|
2654
2649
|
return !1;
|
|
2655
|
-
if (
|
|
2650
|
+
if (C.requiresAuth === !1)
|
|
2656
2651
|
return !0;
|
|
2657
2652
|
const f = J(s);
|
|
2658
|
-
if (f.isSuspended &&
|
|
2653
|
+
if (f.isSuspended && C.ignoreSuspension !== !0)
|
|
2659
2654
|
return !1;
|
|
2660
2655
|
if (f.isGlobalAdmin)
|
|
2661
2656
|
return !0;
|
|
2662
|
-
if (
|
|
2663
|
-
for (var
|
|
2664
|
-
if (!I(
|
|
2657
|
+
if (C.permissions != null) {
|
|
2658
|
+
for (var E = 0; E < C.permissions.length; E++)
|
|
2659
|
+
if (!I(C.permissions[E]))
|
|
2665
2660
|
return !1;
|
|
2666
2661
|
}
|
|
2667
2662
|
return !0;
|
|
2668
2663
|
}
|
|
2669
2664
|
function I(x) {
|
|
2670
|
-
const
|
|
2671
|
-
if (
|
|
2672
|
-
for (var f = 0; f <
|
|
2673
|
-
var
|
|
2674
|
-
if (
|
|
2665
|
+
const C = J(s);
|
|
2666
|
+
if (C.userPermissions != null)
|
|
2667
|
+
for (var f = 0; f < C.userPermissions.length; f++) {
|
|
2668
|
+
var E = C.userPermissions[f].split(".");
|
|
2669
|
+
if (C.userPermissions[f] == "everything.edit" || x == E[0] && E.length > 1 && E[1] == "edit")
|
|
2675
2670
|
return !0;
|
|
2676
2671
|
}
|
|
2677
2672
|
return !1;
|
|
2678
2673
|
}
|
|
2679
|
-
function
|
|
2674
|
+
function P(x) {
|
|
2680
2675
|
if (x == null)
|
|
2681
2676
|
return !0;
|
|
2682
|
-
var
|
|
2683
|
-
if (
|
|
2677
|
+
var C = e.getAuthItem != null ? e.getAuthItem(x) : null;
|
|
2678
|
+
if (C == null)
|
|
2684
2679
|
return !1;
|
|
2685
|
-
if (
|
|
2680
|
+
if (C.requiresAuth === !1)
|
|
2686
2681
|
return !0;
|
|
2687
2682
|
const f = J(s);
|
|
2688
|
-
if (f.isSuspended &&
|
|
2683
|
+
if (f.isSuspended && C.ignoreSuspension !== !0)
|
|
2689
2684
|
return !1;
|
|
2690
2685
|
if (f.isGlobalAdmin)
|
|
2691
2686
|
return !0;
|
|
2692
|
-
if (
|
|
2693
|
-
for (var
|
|
2694
|
-
if (!_(
|
|
2687
|
+
if (C.permissions != null) {
|
|
2688
|
+
for (var E = 0; E < C.permissions.length; E++)
|
|
2689
|
+
if (!_(C.permissions[E]))
|
|
2695
2690
|
return !1;
|
|
2696
2691
|
}
|
|
2697
2692
|
return !0;
|
|
2698
2693
|
}
|
|
2699
2694
|
function _(x) {
|
|
2700
|
-
const
|
|
2701
|
-
if (
|
|
2702
|
-
for (var f = 0; f <
|
|
2703
|
-
var
|
|
2704
|
-
if (x ==
|
|
2695
|
+
const C = J(s);
|
|
2696
|
+
if (C.userPermissions != null)
|
|
2697
|
+
for (var f = 0; f < C.userPermissions.length; f++) {
|
|
2698
|
+
var E = C.userPermissions[f].split(".");
|
|
2699
|
+
if (x == E[0] || x == "everything" || C.userPermissions[f] == "everything.view" || C.userPermissions[f] == "everything.edit")
|
|
2705
2700
|
return !0;
|
|
2706
2701
|
}
|
|
2707
2702
|
return !1;
|
|
2708
2703
|
}
|
|
2709
|
-
function N(x,
|
|
2710
|
-
let
|
|
2711
|
-
return J(s).isGlobalAdmin ? !0 : (
|
|
2712
|
-
f == "edit" ? I(X) || (
|
|
2713
|
-
}), x != null && x.length > 0 && (x.some((X) => u(X)) || (
|
|
2704
|
+
function N(x, C, f) {
|
|
2705
|
+
let E = !0;
|
|
2706
|
+
return J(s).isGlobalAdmin ? !0 : (C != null && C.length > 0 && C.forEach((X) => {
|
|
2707
|
+
f == "edit" ? I(X) || (E = !1) : _(X) || (E = !1);
|
|
2708
|
+
}), x != null && x.length > 0 && (x.some((X) => u(X)) || (E = !1)), E);
|
|
2714
2709
|
}
|
|
2715
|
-
function $(x,
|
|
2710
|
+
function $(x, C = !1) {
|
|
2716
2711
|
var f = e.getAuthItem != null ? e.getAuthItem(x) : null;
|
|
2717
|
-
let
|
|
2712
|
+
let E = !1;
|
|
2718
2713
|
if (f == null)
|
|
2719
2714
|
return !1;
|
|
2720
|
-
let
|
|
2721
|
-
return re || !
|
|
2722
|
-
$(ue, !0) && (
|
|
2723
|
-
}),
|
|
2715
|
+
let K = f.subscriptions ?? [], X = f.permissions ?? [], re = N(K, X, "view");
|
|
2716
|
+
return re || !C || !_e(f.children) ? re : ((f == null ? void 0 : f.children) != null && f.children.forEach((ue) => {
|
|
2717
|
+
$(ue, !0) && (E = !0);
|
|
2718
|
+
}), E);
|
|
2724
2719
|
}
|
|
2725
2720
|
function d(x) {
|
|
2726
|
-
return e.getAuthorizeUrl ?? (e.getAuthorizeUrl = (
|
|
2727
|
-
const
|
|
2728
|
-
return
|
|
2721
|
+
return e.getAuthorizeUrl ?? (e.getAuthorizeUrl = (C, f) => {
|
|
2722
|
+
const E = Ue(Wr(), `authorize?response_type=code&client_id=${e.oauthClientID}&redirect_uri=${window.location.origin}/authentication&state=${f}`);
|
|
2723
|
+
return C ? `${E}&redirect_path=${C}` : E;
|
|
2729
2724
|
}), e.getAuthorizeUrl != null ? e.getAuthorizeUrl(x, l.value) ?? "" : "";
|
|
2730
2725
|
}
|
|
2731
2726
|
function h(x) {
|
|
2732
2727
|
var f;
|
|
2733
|
-
return x == null ? 0 : ((f = (e.subscriptionOptions ?? []).find((
|
|
2728
|
+
return x == null ? 0 : ((f = (e.subscriptionOptions ?? []).find((E) => E.code == x)) == null ? void 0 : f.value) ?? 0;
|
|
2734
2729
|
}
|
|
2735
2730
|
function u(x) {
|
|
2736
|
-
const
|
|
2737
|
-
if (
|
|
2731
|
+
const C = J(s);
|
|
2732
|
+
if (C.subscriptionCode == null)
|
|
2738
2733
|
return !1;
|
|
2739
|
-
if (
|
|
2734
|
+
if (C.subscriptionCode == x)
|
|
2740
2735
|
return !0;
|
|
2741
|
-
const f = h(x),
|
|
2742
|
-
return f <=
|
|
2736
|
+
const f = h(x), E = h(C.subscriptionCode);
|
|
2737
|
+
return f <= E;
|
|
2743
2738
|
}
|
|
2744
2739
|
function r(x) {
|
|
2745
|
-
const f = x.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"),
|
|
2746
|
-
atob(f).split("").map(function(
|
|
2747
|
-
return "%" + ("00" +
|
|
2740
|
+
const f = x.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), E = decodeURIComponent(
|
|
2741
|
+
atob(f).split("").map(function(K) {
|
|
2742
|
+
return "%" + ("00" + K.charCodeAt(0).toString(16)).slice(-2);
|
|
2748
2743
|
}).join("")
|
|
2749
2744
|
);
|
|
2750
|
-
return JSON.parse(
|
|
2745
|
+
return JSON.parse(E);
|
|
2751
2746
|
}
|
|
2752
|
-
function
|
|
2753
|
-
s.value = void 0,
|
|
2747
|
+
function w(x, C) {
|
|
2748
|
+
s.value = void 0, M(), x != null && C != null && C.currentRoute.value.path != x && C.push({ path: x });
|
|
2754
2749
|
}
|
|
2755
2750
|
function D(x) {
|
|
2756
2751
|
var f;
|
|
2757
|
-
J(s).isLoggedIn || ((f = e.demo) == null || f.endDemo(), T() && (
|
|
2752
|
+
J(s).isLoggedIn || ((f = e.demo) == null || f.endDemo(), T() && (w(), window.location.href = d(x)));
|
|
2758
2753
|
}
|
|
2759
|
-
async function c(x,
|
|
2754
|
+
async function c(x, C) {
|
|
2760
2755
|
return e.getToken ?? (e.getToken = async () => {
|
|
2761
|
-
let f = x,
|
|
2762
|
-
if (f == null ||
|
|
2756
|
+
let f = x, E = C, K = e.oauthGrantType ?? "authorization_token", X = e.oauthClientID ?? "";
|
|
2757
|
+
if (f == null || E == null)
|
|
2763
2758
|
throw new Error("Code and State required in OAuth token process");
|
|
2764
|
-
if (
|
|
2759
|
+
if (E != l.value)
|
|
2765
2760
|
throw new Error("state does not match");
|
|
2766
2761
|
let re = "";
|
|
2767
|
-
e.getTokenUrl ?? (e.getTokenUrl = () => Ue(Wr(), "token")), re = e.getTokenUrl(f, `${window.location.origin}/authentication`,
|
|
2762
|
+
e.getTokenUrl ?? (e.getTokenUrl = () => Ue(Wr(), "token")), re = e.getTokenUrl(f, `${window.location.origin}/authentication`, K, X);
|
|
2768
2763
|
const ue = {};
|
|
2769
|
-
ue.grant_type =
|
|
2764
|
+
ue.grant_type = K, ue.code = f, ue.redirect_uri = `${window.location.origin}/authentication`, ue.client_id = X;
|
|
2770
2765
|
const G = await Er().post({
|
|
2771
2766
|
additionalUrl: re,
|
|
2772
2767
|
data: ue
|
|
2773
2768
|
});
|
|
2774
2769
|
y(G.access_token);
|
|
2775
|
-
}), await e.getToken(x,
|
|
2770
|
+
}), await e.getToken(x, C);
|
|
2776
2771
|
}
|
|
2777
2772
|
function y(x) {
|
|
2778
2773
|
if (x != null && (e.demo == null || !e.demo.isDemoing.value)) {
|
|
2779
|
-
const
|
|
2780
|
-
|
|
2774
|
+
const C = r(x);
|
|
2775
|
+
b(C, x), e.processTokenPayload != null && e.processTokenPayload(s, C);
|
|
2781
2776
|
}
|
|
2782
2777
|
}
|
|
2783
|
-
function
|
|
2784
|
-
var
|
|
2778
|
+
function b(x, C) {
|
|
2779
|
+
var E;
|
|
2785
2780
|
const f = s.value;
|
|
2786
|
-
f.expiresOn = x.ExpiresOn, f.isGlobalAdmin = x.IsGlobalAdmin == "True", f.isLoggedIn = !0, f.permissions = x.Permissions, f.subscriptionCode = x.Subscription, f.timeZone ?? (f.timeZone = e.defaultTimeZone ?? hr), f.token =
|
|
2781
|
+
f.expiresOn = x.ExpiresOn, f.isGlobalAdmin = x.IsGlobalAdmin == "True", f.isLoggedIn = !0, f.permissions = x.Permissions, f.subscriptionCode = x.Subscription, f.timeZone ?? (f.timeZone = e.defaultTimeZone ?? hr), f.token = C, f.userID = x.UserLoginID, f.userPermissions = ((E = x.Permissions) == null ? void 0 : E.split(",")) ?? [];
|
|
2787
2782
|
}
|
|
2788
|
-
function
|
|
2783
|
+
function M() {
|
|
2789
2784
|
var x;
|
|
2790
2785
|
s.value ?? (s.value = {}), (x = s.value).timeZone ?? (x.timeZone = e.defaultTimeZone ?? hr);
|
|
2791
2786
|
}
|
|
2792
|
-
function
|
|
2787
|
+
function A() {
|
|
2793
2788
|
const x = J(s);
|
|
2794
|
-
return x.isLoggedIn && T() && (
|
|
2789
|
+
return x.isLoggedIn && T() && (w(), window.location.href = d()), x.isLoggedIn;
|
|
2795
2790
|
}
|
|
2796
2791
|
function T() {
|
|
2797
2792
|
const x = J(s);
|
|
2798
2793
|
if (x == null || x.expiresOn == null)
|
|
2799
2794
|
return !0;
|
|
2800
|
-
const
|
|
2801
|
-
return
|
|
2795
|
+
const C = he.fromFormat(x.expiresOn, t), f = he.utc();
|
|
2796
|
+
return C <= f;
|
|
2802
2797
|
}
|
|
2803
|
-
return
|
|
2798
|
+
return M(), Ir = {
|
|
2804
2799
|
authState: l,
|
|
2805
2800
|
canEdit: g,
|
|
2806
2801
|
canEditPermit: I,
|
|
2807
|
-
canView:
|
|
2802
|
+
canView: P,
|
|
2808
2803
|
canViewPermit: _,
|
|
2809
2804
|
credentials: s,
|
|
2810
2805
|
doShow: N,
|
|
@@ -2813,172 +2808,172 @@ function Dn(e) {
|
|
|
2813
2808
|
getToken: c,
|
|
2814
2809
|
isLoggedIn: ee(() => s.value.isLoggedIn === !0),
|
|
2815
2810
|
login: D,
|
|
2816
|
-
logout:
|
|
2817
|
-
resetAuthState:
|
|
2811
|
+
logout: w,
|
|
2812
|
+
resetAuthState: S,
|
|
2818
2813
|
setAuth: y,
|
|
2819
2814
|
timeZone: ee(() => s.value.timeZone ?? e.defaultTimeZone ?? hr),
|
|
2820
|
-
tryLogin:
|
|
2815
|
+
tryLogin: A
|
|
2821
2816
|
}, Ir;
|
|
2822
2817
|
}
|
|
2823
2818
|
function xn(e, t, l = {}) {
|
|
2824
2819
|
const {
|
|
2825
|
-
preventDefault:
|
|
2820
|
+
preventDefault: S = !1,
|
|
2826
2821
|
stopPropagation: s = !1,
|
|
2827
2822
|
axis: g = "both"
|
|
2828
2823
|
} = l, I = { capture: l.capture ?? !0 };
|
|
2829
|
-
let
|
|
2830
|
-
function u(
|
|
2831
|
-
J(
|
|
2824
|
+
let P = { x: 0, y: 0 }, _ = { x: 0, y: 0 }, N = { x: 0, y: 0 }, $ = [], d = [], h = z(!1);
|
|
2825
|
+
function u(M) {
|
|
2826
|
+
J(S) && M.preventDefault(), J(s) && M.stopPropagation();
|
|
2832
2827
|
}
|
|
2833
|
-
function r(
|
|
2828
|
+
function r(M) {
|
|
2834
2829
|
var f;
|
|
2835
|
-
const
|
|
2836
|
-
if (!
|
|
2830
|
+
const A = J(e);
|
|
2831
|
+
if (!A)
|
|
2837
2832
|
return;
|
|
2838
|
-
const T =
|
|
2839
|
-
N = { x:
|
|
2833
|
+
const T = A.$el, C = M.type === "touchstart" && M.touches.length > 0 ? M.touches[0] : M;
|
|
2834
|
+
N = { x: C.clientX, y: C.clientY }, _ = {
|
|
2840
2835
|
x: T.offsetLeft,
|
|
2841
2836
|
y: T.offsetTop
|
|
2842
|
-
},
|
|
2837
|
+
}, P = {
|
|
2843
2838
|
x: T.offsetLeft,
|
|
2844
2839
|
y: T.offsetTop
|
|
2845
|
-
}, ((f = l.onStart) == null ? void 0 : f.call(l, N,
|
|
2840
|
+
}, ((f = l.onStart) == null ? void 0 : f.call(l, N, M)) !== !1 && (d.push(me("mousemove", w)), d.push(me("touchmove", w)), d.push(me("mouseup", D)), d.push(me("touchend", D)), u(M));
|
|
2846
2841
|
}
|
|
2847
|
-
function
|
|
2848
|
-
var
|
|
2842
|
+
function w(M) {
|
|
2843
|
+
var E;
|
|
2849
2844
|
if (!N || !J(e))
|
|
2850
2845
|
return;
|
|
2851
|
-
const x =
|
|
2852
|
-
let
|
|
2853
|
-
(g === "x" || g === "both") && (
|
|
2846
|
+
const x = M.type === "touchmove" && M.touches.length > 0 ? M.touches[0] : M;
|
|
2847
|
+
let C = x.clientX - N.x, f = x.clientY - N.y;
|
|
2848
|
+
(g === "x" || g === "both") && (P.x = _.x + C), (g === "y" || g === "both") && (P.y = _.y + f), (E = l.onMove) == null || E.call(l, P, M), u(M), c(P);
|
|
2854
2849
|
}
|
|
2855
|
-
function D(
|
|
2856
|
-
var
|
|
2850
|
+
function D(M) {
|
|
2851
|
+
var A;
|
|
2857
2852
|
document.documentElement.style.cursor = "", d.forEach((T) => {
|
|
2858
2853
|
T();
|
|
2859
|
-
}), d.length = 0, (
|
|
2854
|
+
}), d.length = 0, (A = l.onEnd) == null || A.call(l, P, M), u(M);
|
|
2860
2855
|
}
|
|
2861
|
-
function c(
|
|
2862
|
-
const
|
|
2863
|
-
if (!
|
|
2856
|
+
function c(M) {
|
|
2857
|
+
const A = J(e);
|
|
2858
|
+
if (!A)
|
|
2864
2859
|
return;
|
|
2865
|
-
const T =
|
|
2866
|
-
T.style.left = `${
|
|
2860
|
+
const T = A.$el;
|
|
2861
|
+
T.style.left = `${M.x}px`, T.style.top = `${M.y}px`;
|
|
2867
2862
|
}
|
|
2868
2863
|
function y() {
|
|
2869
2864
|
if (J(h))
|
|
2870
2865
|
return;
|
|
2871
|
-
const
|
|
2872
|
-
if (!
|
|
2866
|
+
const M = J(t);
|
|
2867
|
+
if (!M)
|
|
2873
2868
|
return;
|
|
2874
|
-
const
|
|
2875
|
-
|
|
2869
|
+
const A = M.$el;
|
|
2870
|
+
A.style.cursor = "move", $.push(me(A, "mousedown", r, I)), $.push(me(A, "touchstart", r, I)), h.value = !0;
|
|
2876
2871
|
}
|
|
2877
|
-
function
|
|
2872
|
+
function b() {
|
|
2878
2873
|
if (!J(h))
|
|
2879
2874
|
return;
|
|
2880
|
-
const
|
|
2881
|
-
if (!
|
|
2875
|
+
const M = J(t);
|
|
2876
|
+
if (!M)
|
|
2882
2877
|
return;
|
|
2883
|
-
const
|
|
2884
|
-
|
|
2878
|
+
const A = M.$el;
|
|
2879
|
+
A.style.cursor = "", $.forEach((T) => {
|
|
2885
2880
|
T();
|
|
2886
2881
|
}), $.length = 0, h.value = !1;
|
|
2887
2882
|
}
|
|
2888
2883
|
return {
|
|
2889
2884
|
draggingIsOn: h,
|
|
2890
|
-
turnDraggableOff:
|
|
2885
|
+
turnDraggableOff: b,
|
|
2891
2886
|
turnDraggableOn: y
|
|
2892
2887
|
};
|
|
2893
2888
|
}
|
|
2894
2889
|
const Tn = ["t", "r", "b", "l", "tr", "br", "bl", "tl"];
|
|
2895
2890
|
function _n(e, t = {}) {
|
|
2896
|
-
let l,
|
|
2891
|
+
let l, S = t.handleWidth ?? 12, s = t.handleZIndex ?? 100, g = t.minWidth ?? 0, I = t.maxWidth ?? Number.MAX_SAFE_INTEGER, P = t.minHeight ?? 0, _ = t.maxHeight ?? Number.MAX_SAFE_INTEGER, N = t.preventDefault ?? !1, $ = t.stopPropagation ?? !1, d, h = [];
|
|
2897
2892
|
const u = z(!1);
|
|
2898
|
-
let r = [],
|
|
2893
|
+
let r = [], w = [];
|
|
2899
2894
|
const D = z(!1), c = z({ x: 0, y: 0 });
|
|
2900
|
-
let y = { left: 0, top: 0, height: 0, width: 0, position: "absolute" },
|
|
2901
|
-
function
|
|
2895
|
+
let y = { left: 0, top: 0, height: 0, width: 0, position: "absolute" }, b = {};
|
|
2896
|
+
function M(G) {
|
|
2902
2897
|
Ee(N) && G.preventDefault(), Ee($) && G.stopPropagation();
|
|
2903
2898
|
}
|
|
2904
|
-
function
|
|
2905
|
-
h =
|
|
2899
|
+
function A(G, Z) {
|
|
2900
|
+
h = Z.map(x), h.forEach((H) => G.$el.appendChild(H));
|
|
2906
2901
|
}
|
|
2907
2902
|
function T(G) {
|
|
2908
|
-
h.forEach((
|
|
2903
|
+
h.forEach((Z) => G.$el.removeChild(Z));
|
|
2909
2904
|
}
|
|
2910
2905
|
function x(G) {
|
|
2911
|
-
const
|
|
2912
|
-
return
|
|
2906
|
+
const Z = S + "px", H = -S / 2 + "px", ie = s + 1, Y = document.createElement("div");
|
|
2907
|
+
return Y.dataset.handle = G, Y.style.position = "absolute", Y.style.touchAction = "none", Y.style.userSelect = "none", Y.style.zIndex = (G.length === 1 ? s : ie).toString(), Y.style.cursor = K(G), G.includes("t") && (Y.style.top = H, Y.style.height = Z, G === "t" && (Y.style.left = "0", Y.style.width = "100%")), G.includes("b") && (Y.style.bottom = H, Y.style.height = Z, G === "b" && (Y.style.left = "0", Y.style.width = "100%")), G.includes("r") && (Y.style.right = H, Y.style.width = Z, G === "r" && (Y.style.top = "0", Y.style.height = "100%")), G.includes("l") && (Y.style.left = H, Y.style.width = Z, G === "l" && (Y.style.top = "0", Y.style.height = "100%")), Y;
|
|
2913
2908
|
}
|
|
2914
|
-
function
|
|
2909
|
+
function C(G) {
|
|
2915
2910
|
var ne;
|
|
2916
2911
|
if (!h.some((ce) => ce == G.target))
|
|
2917
2912
|
return;
|
|
2918
|
-
const
|
|
2919
|
-
if (!
|
|
2913
|
+
const Z = Ee(e);
|
|
2914
|
+
if (!Z)
|
|
2920
2915
|
return;
|
|
2921
|
-
const H =
|
|
2922
|
-
if (c.value.x =
|
|
2916
|
+
const H = Z.$el, Y = G.type === "touchstart" && G.touches.length > 0 ? G.touches[0] : G;
|
|
2917
|
+
if (c.value.x = Y.clientX, c.value.y = Y.clientY, y = {
|
|
2923
2918
|
left: H.offsetLeft,
|
|
2924
2919
|
top: H.offsetTop,
|
|
2925
2920
|
height: parseInt(window.getComputedStyle(H).getPropertyValue("height")),
|
|
2926
2921
|
width: parseInt(window.getComputedStyle(H).getPropertyValue("width"))
|
|
2927
|
-
},
|
|
2922
|
+
}, b = Mr(y), ((ne = t.onStart) == null ? void 0 : ne.call(t, c.value, G)) === !1)
|
|
2928
2923
|
return;
|
|
2929
2924
|
let W = G.target;
|
|
2930
|
-
document.documentElement.style.cursor =
|
|
2925
|
+
document.documentElement.style.cursor = K(W.dataset.handle), d = W.dataset.handle, w.push(me("mousemove", f)), w.push(me("mouseup", E)), w.push(me("touchmove", f)), w.push(me("touchend", E)), M(G);
|
|
2931
2926
|
}
|
|
2932
2927
|
function f(G) {
|
|
2933
|
-
const
|
|
2934
|
-
if (!
|
|
2928
|
+
const Z = Ee(e);
|
|
2929
|
+
if (!Z)
|
|
2935
2930
|
return;
|
|
2936
|
-
const H =
|
|
2937
|
-
let W =
|
|
2931
|
+
const H = Z.$el, Y = G.type === "touchmove" && G.touches.length > 0 ? G.touches[0] : G;
|
|
2932
|
+
let W = Y.clientX - c.value.x, ne = Y.clientY - c.value.y;
|
|
2938
2933
|
const ce = Ee(y);
|
|
2939
2934
|
if (d.includes("t")) {
|
|
2940
|
-
const se = Math.min(_, Math.max(
|
|
2941
|
-
|
|
2935
|
+
const se = Math.min(_, Math.max(P, (ce.height ?? 0) - ne));
|
|
2936
|
+
b.height = se, b.top = (ce.top ?? 0) + ne;
|
|
2942
2937
|
}
|
|
2943
2938
|
if (d.includes("b")) {
|
|
2944
|
-
const se = Math.min(_, Math.max(
|
|
2945
|
-
|
|
2939
|
+
const se = Math.min(_, Math.max(P, (ce.height ?? 0) + ne));
|
|
2940
|
+
b.height = se;
|
|
2946
2941
|
}
|
|
2947
2942
|
if (d.includes("l")) {
|
|
2948
2943
|
const se = Math.min(I, Math.max(g, (ce.width ?? 0) - W));
|
|
2949
|
-
|
|
2944
|
+
b.width = se, b.left = (ce.left ?? 0) + W;
|
|
2950
2945
|
}
|
|
2951
2946
|
if (d.includes("r")) {
|
|
2952
2947
|
const se = Math.min(I, Math.max(g, (ce.width ?? 0) + W));
|
|
2953
|
-
|
|
2948
|
+
b.width = se;
|
|
2954
2949
|
}
|
|
2955
|
-
H.dispatchEvent(new CustomEvent("resize")),
|
|
2950
|
+
H.dispatchEvent(new CustomEvent("resize")), M(G), re(b);
|
|
2956
2951
|
}
|
|
2957
|
-
function
|
|
2958
|
-
document.documentElement.style.cursor = "", d = null,
|
|
2952
|
+
function E() {
|
|
2953
|
+
document.documentElement.style.cursor = "", d = null, w.forEach((G) => {
|
|
2959
2954
|
G();
|
|
2960
|
-
}),
|
|
2955
|
+
}), w.length = 0;
|
|
2961
2956
|
}
|
|
2962
|
-
function
|
|
2963
|
-
const
|
|
2957
|
+
function K(G) {
|
|
2958
|
+
const Z = {
|
|
2964
2959
|
t: "n",
|
|
2965
2960
|
r: "e",
|
|
2966
2961
|
b: "s",
|
|
2967
2962
|
l: "w"
|
|
2968
2963
|
};
|
|
2969
|
-
return G.split("").map((H) =>
|
|
2964
|
+
return G.split("").map((H) => Z[H]).join("") + "-resize";
|
|
2970
2965
|
}
|
|
2971
2966
|
function X(G) {
|
|
2972
|
-
const
|
|
2973
|
-
if (!
|
|
2967
|
+
const Z = Ee(e);
|
|
2968
|
+
if (!Z)
|
|
2974
2969
|
return;
|
|
2975
|
-
const H =
|
|
2970
|
+
const H = Z.$el;
|
|
2976
2971
|
if (console.log(l), l !== "page" && G == "page") {
|
|
2977
|
-
const ie = Jt(H),
|
|
2972
|
+
const ie = Jt(H), Y = Ee(ie) ?? null;
|
|
2978
2973
|
let W = 0;
|
|
2979
|
-
if (
|
|
2980
|
-
const ne = window.getComputedStyle(
|
|
2981
|
-
W = parseInt(ne.getPropertyValue("width")) -
|
|
2974
|
+
if (Y != null) {
|
|
2975
|
+
const ne = window.getComputedStyle(Y);
|
|
2976
|
+
W = parseInt(ne.getPropertyValue("width")) - Y.offsetLeft;
|
|
2982
2977
|
}
|
|
2983
2978
|
H.style.transition = "width 0.5s, height 0.5s, top 0.5s, left 0.5s", H.offsetHeight, u.value = !0, re({
|
|
2984
2979
|
height: void 0,
|
|
@@ -2989,7 +2984,7 @@ function _n(e, t = {}) {
|
|
|
2989
2984
|
}), me(H, "transitionend", () => {
|
|
2990
2985
|
H.style.width = "auto", H.style.top = "", H.style.left = "", H.style.position = "", H.style.transition = "", u.value = !1;
|
|
2991
2986
|
}, { once: !0 });
|
|
2992
|
-
} else if ((l == "page" ||
|
|
2987
|
+
} else if ((l == "page" || Z.$el.style.position !== "absolute") && G !== "page") {
|
|
2993
2988
|
H.style.transition = "width 0.5s, height 0.5s, top 0.5s, left 0.5s", u.value = !0, y = {
|
|
2994
2989
|
height: parseInt(window.getComputedStyle(H).getPropertyValue("height")),
|
|
2995
2990
|
width: parseInt(window.getComputedStyle(H).getPropertyValue("width")),
|
|
@@ -2998,41 +2993,41 @@ function _n(e, t = {}) {
|
|
|
2998
2993
|
position: "absolute"
|
|
2999
2994
|
}, re(y), H.offsetHeight;
|
|
3000
2995
|
const ie = y;
|
|
3001
|
-
G == "freestyle" ?
|
|
2996
|
+
G == "freestyle" ? b = {
|
|
3002
2997
|
height: ie.height,
|
|
3003
2998
|
width: (ie.width ?? 100) / 2,
|
|
3004
2999
|
top: (ie.top ?? 0) + 2,
|
|
3005
3000
|
left: (ie.left ?? 0) + 2,
|
|
3006
3001
|
position: "absolute"
|
|
3007
|
-
} : G == "blade" && (
|
|
3002
|
+
} : G == "blade" && (b = {
|
|
3008
3003
|
height: ie.height,
|
|
3009
3004
|
width: (ie.width ?? 100) / 2,
|
|
3010
3005
|
top: (ie.top ?? 0) + 2,
|
|
3011
3006
|
left: (ie.left ?? 0) + 2,
|
|
3012
3007
|
position: "absolute"
|
|
3013
|
-
}), re(
|
|
3008
|
+
}), re(b), me(H, "transitionend", () => {
|
|
3014
3009
|
H.style.transition = "", u.value = !1;
|
|
3015
3010
|
}, { once: !0 });
|
|
3016
3011
|
}
|
|
3017
3012
|
}
|
|
3018
3013
|
function re(G) {
|
|
3019
|
-
const
|
|
3020
|
-
if (!
|
|
3014
|
+
const Z = Ee(e);
|
|
3015
|
+
if (!Z)
|
|
3021
3016
|
return;
|
|
3022
|
-
const H =
|
|
3017
|
+
const H = Z.$el;
|
|
3023
3018
|
G.top ? H.style.top = `${G.top}px` : H.style.top = void 0, G.left ? H.style.left = `${G.left}px` : H.style.left = void 0, G.height ? H.style.height = `${G.height}px` : H.style.height = void 0, G.width ? H.style.width = `${G.width}px` : H.style.width = void 0, G.position ? H.style.position = `${G.position}` : H.style.position = void 0, console.log(H.style.position);
|
|
3024
3019
|
}
|
|
3025
|
-
function ue(G,
|
|
3020
|
+
function ue(G, Z) {
|
|
3026
3021
|
if (D.value)
|
|
3027
3022
|
return;
|
|
3028
3023
|
const H = Ee(e);
|
|
3029
|
-
H && (
|
|
3024
|
+
H && (A(H, G ?? Tn), X(Z), r.push(me(H.$el, "mousedown", C)), r.push(me(H.$el, "touchstart", C)), D.value = !0, l = Z);
|
|
3030
3025
|
}
|
|
3031
3026
|
function be(G) {
|
|
3032
3027
|
if (!D.value)
|
|
3033
3028
|
return;
|
|
3034
|
-
const
|
|
3035
|
-
|
|
3029
|
+
const Z = Ee(e);
|
|
3030
|
+
Z && (T(Z), X(G), r.forEach((H) => {
|
|
3036
3031
|
H();
|
|
3037
3032
|
}), r.length = 0, D.value = !1);
|
|
3038
3033
|
}
|
|
@@ -3043,16 +3038,16 @@ function _n(e, t = {}) {
|
|
|
3043
3038
|
};
|
|
3044
3039
|
}
|
|
3045
3040
|
function Cn(e) {
|
|
3046
|
-
const t = (e == null ? void 0 : e.blade) ?? z(null), l = (e == null ? void 0 : e.handle) ?? z(null),
|
|
3041
|
+
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"), I = z({}), { turnResizingOff: P, turnResizingOn: _ } = _n(t), { turnDraggableOff: N, turnDraggableOn: $ } = xn(t, l);
|
|
3047
3042
|
jt(t, (h) => {
|
|
3048
3043
|
const u = h[0], { width: r } = u.contentRect;
|
|
3049
|
-
|
|
3044
|
+
S.value = r < s;
|
|
3050
3045
|
});
|
|
3051
3046
|
function d(h) {
|
|
3052
|
-
N(), h == "page" ?
|
|
3047
|
+
N(), h == "page" ? P(h) : h == "blade" ? _(["l", "r"], h) : h == "freestyle" ? (P(), _(void 0, h), $()) : h == "inline" && P();
|
|
3053
3048
|
}
|
|
3054
3049
|
return d(g.value), Te(g, (h) => d(h)), {
|
|
3055
|
-
isMobile:
|
|
3050
|
+
isMobile: S,
|
|
3056
3051
|
variant: g,
|
|
3057
3052
|
bladeData: I
|
|
3058
3053
|
};
|
|
@@ -3096,7 +3091,7 @@ function ya(e) {
|
|
|
3096
3091
|
function Pn(e) {
|
|
3097
3092
|
const t = z({});
|
|
3098
3093
|
let l = e.vuetifyInstance;
|
|
3099
|
-
function
|
|
3094
|
+
function S() {
|
|
3100
3095
|
const d = localStorage.getItem("cosmetics");
|
|
3101
3096
|
d != null && d.length > 0 ? t.value = JSON.parse(d) : t.value = {
|
|
3102
3097
|
theme: e.defaultTheme ?? "light",
|
|
@@ -3131,7 +3126,7 @@ function Pn(e) {
|
|
|
3131
3126
|
u.colors.primary = d, r.colors.primary = d, (h = document.querySelector('meta[name="theme-color"]')) == null || h.setAttribute("content", d);
|
|
3132
3127
|
}
|
|
3133
3128
|
}
|
|
3134
|
-
function
|
|
3129
|
+
function P() {
|
|
3135
3130
|
t.value.drawer = !t.value.drawer;
|
|
3136
3131
|
}
|
|
3137
3132
|
function _() {
|
|
@@ -3147,13 +3142,13 @@ function Pn(e) {
|
|
|
3147
3142
|
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", "");
|
|
3148
3143
|
}
|
|
3149
3144
|
}
|
|
3150
|
-
return
|
|
3145
|
+
return S(), Te(t, () => {
|
|
3151
3146
|
s();
|
|
3152
3147
|
}), Dr = {
|
|
3153
3148
|
state: t,
|
|
3154
3149
|
resetCosmetics: g,
|
|
3155
3150
|
setTemporaryColor: I,
|
|
3156
|
-
toggleDrawer:
|
|
3151
|
+
toggleDrawer: P,
|
|
3157
3152
|
toggleDrawerStick: _,
|
|
3158
3153
|
toggleLightDark: N,
|
|
3159
3154
|
undoTemporaryColor: $
|
|
@@ -3162,41 +3157,41 @@ function Pn(e) {
|
|
|
3162
3157
|
const wa = {
|
|
3163
3158
|
canExportCSV: !1
|
|
3164
3159
|
};
|
|
3165
|
-
function
|
|
3160
|
+
function Ln() {
|
|
3166
3161
|
function e(t) {
|
|
3167
3162
|
const {
|
|
3168
3163
|
items: l,
|
|
3169
|
-
headers:
|
|
3164
|
+
headers: S,
|
|
3170
3165
|
fileName: s = "data.csv",
|
|
3171
3166
|
format: g = "file"
|
|
3172
3167
|
} = t;
|
|
3173
3168
|
if (!_e(l))
|
|
3174
3169
|
return;
|
|
3175
3170
|
let I = [];
|
|
3176
|
-
|
|
3171
|
+
S != null ? I = S == null ? void 0 : S.filter((D) => (D.csv ?? D.csvText ?? D.csvFilter ?? D.csvArray) != null).map((D) => ({
|
|
3177
3172
|
header: D.title ?? D.value ?? "",
|
|
3178
3173
|
itemText: D.itemText,
|
|
3179
3174
|
value: D.value
|
|
3180
3175
|
})) : I = Object.keys(l[0]).map((D) => ({ header: tn(D) ?? "", value: D })), I = I.filter((D) => D.header.length > 0);
|
|
3181
|
-
var
|
|
3176
|
+
var P = [];
|
|
3182
3177
|
for (let D = 0; D < l.length; D++) {
|
|
3183
3178
|
const c = l[D];
|
|
3184
3179
|
var _ = {}, N = [];
|
|
3185
3180
|
for (let y = 0; y < I.length; y++) {
|
|
3186
|
-
const
|
|
3181
|
+
const b = I[y];
|
|
3187
3182
|
var $ = null;
|
|
3188
|
-
typeof
|
|
3183
|
+
typeof b.value == "function" ? $ = b.value(c) : typeof b.value == "string" && ($ = Sr(c, b.value)), b.itemText != null ? _[b.header] = Sr($, b.itemText) : _[b.header] = $;
|
|
3189
3184
|
}
|
|
3190
|
-
|
|
3191
|
-
|
|
3185
|
+
P.push(_), _e(N) && N.forEach((y) => {
|
|
3186
|
+
P.push(y);
|
|
3192
3187
|
}), N = [];
|
|
3193
3188
|
}
|
|
3194
3189
|
var d = [];
|
|
3195
|
-
if (d.push(I.map((D) => D.header).toString()),
|
|
3190
|
+
if (d.push(I.map((D) => D.header).toString()), P.forEach((D) => {
|
|
3196
3191
|
let c = [];
|
|
3197
3192
|
I.forEach(function(y) {
|
|
3198
|
-
var
|
|
3199
|
-
c.push(
|
|
3193
|
+
var b = D[y.header];
|
|
3194
|
+
c.push(b ?? "");
|
|
3200
3195
|
}), d.push(c.join(","));
|
|
3201
3196
|
}), g == "array")
|
|
3202
3197
|
return d;
|
|
@@ -3205,9 +3200,9 @@ function Nn() {
|
|
|
3205
3200
|
if (window.navigator.msSaveOrOpenBlob)
|
|
3206
3201
|
window.navigator.msSaveOrOpenBlob(u, s);
|
|
3207
3202
|
else {
|
|
3208
|
-
var r = document.createElement("a"),
|
|
3209
|
-
r.href =
|
|
3210
|
-
document.body.removeChild(r), window.URL.revokeObjectURL(
|
|
3203
|
+
var r = document.createElement("a"), w = URL.createObjectURL(u);
|
|
3204
|
+
r.href = w, r.download = s, document.body.appendChild(r), r.click(), setTimeout(function() {
|
|
3205
|
+
document.body.removeChild(r), window.URL.revokeObjectURL(w);
|
|
3211
3206
|
}, 0);
|
|
3212
3207
|
}
|
|
3213
3208
|
}
|
|
@@ -3219,12 +3214,12 @@ let xr;
|
|
|
3219
3214
|
function ba() {
|
|
3220
3215
|
return xr;
|
|
3221
3216
|
}
|
|
3222
|
-
function
|
|
3217
|
+
function Nn(e) {
|
|
3223
3218
|
const t = e.getUTC ?? he.utc;
|
|
3224
3219
|
function l() {
|
|
3225
3220
|
return s().startOf("day").toUTC().toString() ?? "";
|
|
3226
3221
|
}
|
|
3227
|
-
function
|
|
3222
|
+
function S() {
|
|
3228
3223
|
return s().startOf("day").plus({ day: 1 }).toUTC().toString() ?? "";
|
|
3229
3224
|
}
|
|
3230
3225
|
function s(_, N) {
|
|
@@ -3243,7 +3238,7 @@ function Mn(e) {
|
|
|
3243
3238
|
function I(_, N) {
|
|
3244
3239
|
return _ == null ? t() : N ? he.fromFormat(_, N) : he.fromISO(_);
|
|
3245
3240
|
}
|
|
3246
|
-
function
|
|
3241
|
+
function P(_, N, $) {
|
|
3247
3242
|
if (_ == null)
|
|
3248
3243
|
return N ? t().toFormat(N) : t().toString();
|
|
3249
3244
|
{
|
|
@@ -3253,20 +3248,20 @@ function Mn(e) {
|
|
|
3253
3248
|
}
|
|
3254
3249
|
return xr = {
|
|
3255
3250
|
getToday: l,
|
|
3256
|
-
getTomorrow:
|
|
3251
|
+
getTomorrow: S,
|
|
3257
3252
|
tzDate: s,
|
|
3258
3253
|
tzString: g,
|
|
3259
3254
|
utcDate: I,
|
|
3260
|
-
utcString:
|
|
3255
|
+
utcString: P
|
|
3261
3256
|
}, xr;
|
|
3262
3257
|
}
|
|
3263
3258
|
let Tr;
|
|
3264
3259
|
function Sa() {
|
|
3265
3260
|
return Tr;
|
|
3266
3261
|
}
|
|
3267
|
-
function
|
|
3262
|
+
function Mn(e) {
|
|
3268
3263
|
const t = z(!1), l = (e == null ? void 0 : e.apis) ?? [];
|
|
3269
|
-
function
|
|
3264
|
+
function S() {
|
|
3270
3265
|
t.value = !0;
|
|
3271
3266
|
}
|
|
3272
3267
|
function s() {
|
|
@@ -3286,20 +3281,20 @@ function Ln(e) {
|
|
|
3286
3281
|
return Promise.resolve("no demo data available for this api");
|
|
3287
3282
|
const h = d.id ?? ((r = d.data) == null ? void 0 : r.id), u = g(d);
|
|
3288
3283
|
if (h != null && (u == null ? void 0 : u.data) != null) {
|
|
3289
|
-
const
|
|
3290
|
-
|
|
3284
|
+
const w = u.data.findIndex((D) => D.id == h);
|
|
3285
|
+
w >= 0 && u.data.splice(w, 1);
|
|
3291
3286
|
}
|
|
3292
|
-
return new Promise(function(
|
|
3287
|
+
return new Promise(function(w) {
|
|
3293
3288
|
setTimeout(function() {
|
|
3294
|
-
|
|
3289
|
+
w(void 0);
|
|
3295
3290
|
}, 200);
|
|
3296
3291
|
});
|
|
3297
3292
|
}
|
|
3298
|
-
function
|
|
3299
|
-
var
|
|
3293
|
+
function P(d) {
|
|
3294
|
+
var w, D, c;
|
|
3300
3295
|
if (l == null)
|
|
3301
3296
|
throw new Error("no demo data available for this api");
|
|
3302
|
-
const h = d.id ?? ((
|
|
3297
|
+
const h = d.id ?? ((w = d.data) == null ? void 0 : w.id), u = g(d);
|
|
3303
3298
|
let r;
|
|
3304
3299
|
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((y) => y.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((y) => {
|
|
3305
3300
|
setTimeout(() => {
|
|
@@ -3325,12 +3320,12 @@ function Ln(e) {
|
|
|
3325
3320
|
});
|
|
3326
3321
|
}
|
|
3327
3322
|
function N(d) {
|
|
3328
|
-
var r,
|
|
3323
|
+
var r, w;
|
|
3329
3324
|
if (l == null)
|
|
3330
3325
|
throw new Error("no demo data available for this api");
|
|
3331
3326
|
const h = g(d);
|
|
3332
3327
|
let u;
|
|
3333
|
-
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, (
|
|
3328
|
+
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, (w = h.data) == null || w.push(u))), u == null ? Promise.resolve(void 0) : new Promise((D) => {
|
|
3334
3329
|
setTimeout(() => {
|
|
3335
3330
|
D({
|
|
3336
3331
|
data: u
|
|
@@ -3339,7 +3334,7 @@ function Ln(e) {
|
|
|
3339
3334
|
});
|
|
3340
3335
|
}
|
|
3341
3336
|
function $(d) {
|
|
3342
|
-
var r,
|
|
3337
|
+
var r, w;
|
|
3343
3338
|
if (l == null)
|
|
3344
3339
|
throw new Error("no demo data available for this api");
|
|
3345
3340
|
const h = g(d);
|
|
@@ -3349,7 +3344,7 @@ function Ln(e) {
|
|
|
3349
3344
|
u = h.patchAction(h.data, d.data);
|
|
3350
3345
|
else if (d.data.id != null) {
|
|
3351
3346
|
const D = (r = h.data) == null ? void 0 : r.findIndex((c) => c.id == d.data.id);
|
|
3352
|
-
D != null && D > -1 && ((
|
|
3347
|
+
D != null && D > -1 && ((w = h.data) == null || w.splice(D, 1, d.data)), u = d.data;
|
|
3353
3348
|
}
|
|
3354
3349
|
}
|
|
3355
3350
|
return u == null ? Promise.resolve(void 0) : new Promise((D) => {
|
|
@@ -3363,10 +3358,10 @@ function Ln(e) {
|
|
|
3363
3358
|
return Tr = {
|
|
3364
3359
|
endDemo: s,
|
|
3365
3360
|
isDemoing: t,
|
|
3366
|
-
startDemo:
|
|
3361
|
+
startDemo: S,
|
|
3367
3362
|
data: l,
|
|
3368
3363
|
deleteItem: I,
|
|
3369
|
-
get:
|
|
3364
|
+
get: P,
|
|
3370
3365
|
getAll: _,
|
|
3371
3366
|
post: N,
|
|
3372
3367
|
patch: $
|
|
@@ -3376,9 +3371,9 @@ var Rn = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
|
3376
3371
|
function Aa(e) {
|
|
3377
3372
|
function t(l) {
|
|
3378
3373
|
var s;
|
|
3379
|
-
const
|
|
3380
|
-
if (
|
|
3381
|
-
document.title =
|
|
3374
|
+
const S = l.matched.slice().reverse().find((g) => g.meta && g.meta.title);
|
|
3375
|
+
if (S)
|
|
3376
|
+
document.title = S.meta.title;
|
|
3382
3377
|
else {
|
|
3383
3378
|
const g = Rn.VITE_NODE_ENV;
|
|
3384
3379
|
let I = "";
|
|
@@ -3394,41 +3389,41 @@ function Ea() {
|
|
|
3394
3389
|
return _r;
|
|
3395
3390
|
}
|
|
3396
3391
|
function Un(e) {
|
|
3397
|
-
function t(f,
|
|
3398
|
-
return f ? an(f) ?
|
|
3392
|
+
function t(f, E, K) {
|
|
3393
|
+
return f ? an(f) ? K ?? "" : e.dates.tzString(f, E) : K ?? f ?? "";
|
|
3399
3394
|
}
|
|
3400
3395
|
function l(f) {
|
|
3401
3396
|
if (!f)
|
|
3402
3397
|
return "";
|
|
3403
3398
|
if (typeof f != "object")
|
|
3404
3399
|
return f;
|
|
3405
|
-
var
|
|
3406
|
-
return f.companyAccount != null && (
|
|
3400
|
+
var E = "";
|
|
3401
|
+
return f.companyAccount != null && (E = f.companyAccount.companyName + " | "), f.addressLineOne != null && (E = E + f.addressLineOne + " "), f.streetNumber != null && (E = E + f.streetNumber + " "), f.streetName != null && (E = E + f.streetName + ", "), f.suburb != null && (E = E + f.suburb + " "), f.state != null && (E = E + f.state + " "), f.postcode != null && (E = E + f.postcode), E;
|
|
3407
3402
|
}
|
|
3408
|
-
function
|
|
3403
|
+
function S(f) {
|
|
3409
3404
|
if (typeof f != "number")
|
|
3410
3405
|
return f;
|
|
3411
|
-
var
|
|
3406
|
+
var E = new Intl.NumberFormat("en-US", {
|
|
3412
3407
|
style: "currency",
|
|
3413
3408
|
currency: "AUD",
|
|
3414
3409
|
minimumFractionDigits: 2
|
|
3415
3410
|
});
|
|
3416
|
-
return
|
|
3411
|
+
return E.format(f);
|
|
3417
3412
|
}
|
|
3418
|
-
function s(f,
|
|
3419
|
-
return t(f, "ccc | d LLL",
|
|
3413
|
+
function s(f, E) {
|
|
3414
|
+
return t(f, "ccc | d LLL", E);
|
|
3420
3415
|
}
|
|
3421
|
-
function g(f,
|
|
3422
|
-
return t(f, "d LLL",
|
|
3416
|
+
function g(f, E) {
|
|
3417
|
+
return t(f, "d LLL", E);
|
|
3423
3418
|
}
|
|
3424
|
-
function I(f,
|
|
3425
|
-
return t(f, "ccc",
|
|
3419
|
+
function I(f, E) {
|
|
3420
|
+
return t(f, "ccc", E);
|
|
3426
3421
|
}
|
|
3427
|
-
function
|
|
3428
|
-
return t(f, "ccc dd LLL yyyy",
|
|
3422
|
+
function P(f, E) {
|
|
3423
|
+
return t(f, "ccc dd LLL yyyy", E);
|
|
3429
3424
|
}
|
|
3430
|
-
function _(f,
|
|
3431
|
-
return t(f, "ccc dd LLL @ hh:mm a",
|
|
3425
|
+
function _(f, E) {
|
|
3426
|
+
return t(f, "ccc dd LLL @ hh:mm a", E);
|
|
3432
3427
|
}
|
|
3433
3428
|
function N(f) {
|
|
3434
3429
|
return new Intl.NumberFormat().format(f);
|
|
@@ -3439,11 +3434,11 @@ function Un(e) {
|
|
|
3439
3434
|
function d(f) {
|
|
3440
3435
|
if (f == 0)
|
|
3441
3436
|
return "";
|
|
3442
|
-
var
|
|
3443
|
-
return f > 0 ? "+" +
|
|
3437
|
+
var E = new Intl.NumberFormat().format(f);
|
|
3438
|
+
return f > 0 ? "+" + E : E;
|
|
3444
3439
|
}
|
|
3445
|
-
function h(f,
|
|
3446
|
-
return e.dates.utcString(f,
|
|
3440
|
+
function h(f, E) {
|
|
3441
|
+
return e.dates.utcString(f, E);
|
|
3447
3442
|
}
|
|
3448
3443
|
function u(f) {
|
|
3449
3444
|
return rt(f, !1);
|
|
@@ -3453,44 +3448,44 @@ function Un(e) {
|
|
|
3453
3448
|
return "";
|
|
3454
3449
|
if (typeof f != "object")
|
|
3455
3450
|
return f;
|
|
3456
|
-
var
|
|
3457
|
-
return f.addressLineOne != null && (
|
|
3451
|
+
var E = "";
|
|
3452
|
+
return f.addressLineOne != null && (E = f.addressLineOne + " "), f.streetNumber != null && (E = E + f.streetNumber + " "), f.streetName != null && (E = E + f.streetName + " "), f.suburb != null && (E = E + f.suburb + " "), f.state != null && (E = E + f.state + " "), f.postcode != null && (E = E + f.postcode), E = E.replaceAll(",", " "), E;
|
|
3458
3453
|
}
|
|
3459
|
-
function
|
|
3460
|
-
return t(f, "
|
|
3454
|
+
function w(f, E) {
|
|
3455
|
+
return t(f, "ccc dd LLL yyyy", E);
|
|
3461
3456
|
}
|
|
3462
|
-
function D(f,
|
|
3463
|
-
return t(f, "ccc dd LLL yyyy hh:mm a",
|
|
3457
|
+
function D(f, E) {
|
|
3458
|
+
return t(f, "ccc dd LLL yyyy hh:mm a", E);
|
|
3464
3459
|
}
|
|
3465
3460
|
function c(f) {
|
|
3466
|
-
var
|
|
3461
|
+
var E = new Intl.NumberFormat("en-US", {
|
|
3467
3462
|
style: "percent",
|
|
3468
3463
|
minimumFractionDigits: 2
|
|
3469
3464
|
});
|
|
3470
|
-
return
|
|
3465
|
+
return E.format(f);
|
|
3471
3466
|
}
|
|
3472
3467
|
function y(f) {
|
|
3473
3468
|
return f.replaceAll(",", " ");
|
|
3474
3469
|
}
|
|
3475
|
-
function
|
|
3476
|
-
return t(f, "dd LLL yyyy",
|
|
3470
|
+
function b(f, E) {
|
|
3471
|
+
return t(f, "dd LLL yyyy", E);
|
|
3477
3472
|
}
|
|
3478
|
-
function
|
|
3479
|
-
return t(f, "dd LLL yyyy hh:mm a",
|
|
3473
|
+
function M(f, E) {
|
|
3474
|
+
return t(f, "dd LLL yyyy hh:mm a", E);
|
|
3480
3475
|
}
|
|
3481
|
-
function
|
|
3482
|
-
return t(f, "hh:mm a",
|
|
3476
|
+
function A(f, E) {
|
|
3477
|
+
return t(f, "hh:mm a", E);
|
|
3483
3478
|
}
|
|
3484
3479
|
function T(f) {
|
|
3485
3480
|
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";
|
|
3486
3481
|
}
|
|
3487
3482
|
const x = {
|
|
3488
3483
|
toCompanyNameAndLocationLine: l,
|
|
3489
|
-
toCurrency:
|
|
3484
|
+
toCurrency: S,
|
|
3490
3485
|
toDayDate: s,
|
|
3491
3486
|
toDayMonth: g,
|
|
3492
3487
|
toDayOfWeek: I,
|
|
3493
|
-
toDayShortDate:
|
|
3488
|
+
toDayShortDate: P,
|
|
3494
3489
|
toDayShortDateAndTime: _,
|
|
3495
3490
|
toDisplayNumber: N,
|
|
3496
3491
|
toDisplayNumberOver: $,
|
|
@@ -3498,69 +3493,69 @@ function Un(e) {
|
|
|
3498
3493
|
toFormat: h,
|
|
3499
3494
|
toLocationLine: u,
|
|
3500
3495
|
toLocationLineNoCommas: r,
|
|
3501
|
-
toLongDate:
|
|
3496
|
+
toLongDate: w,
|
|
3502
3497
|
toLongDateAndTime: D,
|
|
3503
3498
|
toPercent: c,
|
|
3504
3499
|
toPrettyCSV: y,
|
|
3505
|
-
toShortDate:
|
|
3506
|
-
toShortDateAndTime:
|
|
3507
|
-
toTime:
|
|
3500
|
+
toShortDate: b,
|
|
3501
|
+
toShortDateAndTime: M,
|
|
3502
|
+
toTime: A,
|
|
3508
3503
|
toTimeOfDay: T
|
|
3509
3504
|
};
|
|
3510
|
-
function
|
|
3505
|
+
function C(f) {
|
|
3511
3506
|
if (f != null) {
|
|
3512
|
-
let
|
|
3513
|
-
if (
|
|
3514
|
-
return x[
|
|
3507
|
+
let E = f;
|
|
3508
|
+
if (E != null && x[E] != null)
|
|
3509
|
+
return x[E];
|
|
3515
3510
|
}
|
|
3516
|
-
return (
|
|
3511
|
+
return (E) => E;
|
|
3517
3512
|
}
|
|
3518
3513
|
return _r = {
|
|
3519
|
-
findFilter:
|
|
3514
|
+
findFilter: C,
|
|
3520
3515
|
...x
|
|
3521
3516
|
}, _r;
|
|
3522
3517
|
}
|
|
3523
3518
|
function Bn(e, t) {
|
|
3524
|
-
const l = z(!1),
|
|
3519
|
+
const l = z(!1), S = Zt(e);
|
|
3525
3520
|
let s = g(J(e));
|
|
3526
|
-
(t == null ? void 0 : t.useTracker) !== !1 && Te(
|
|
3527
|
-
l.value = g(
|
|
3521
|
+
(t == null ? void 0 : t.useTracker) !== !1 && Te(S, (P) => {
|
|
3522
|
+
l.value = g(P) != s;
|
|
3528
3523
|
}, { deep: !0 });
|
|
3529
|
-
function g(
|
|
3530
|
-
const _ =
|
|
3524
|
+
function g(P) {
|
|
3525
|
+
const _ = Mr(P);
|
|
3531
3526
|
return t != null && (t.propsToIgnore != null ? t.propsToIgnore.forEach((N) => {
|
|
3532
3527
|
delete _[N];
|
|
3533
|
-
}) : t.propsToTrack != null && Object.keys(
|
|
3528
|
+
}) : t.propsToTrack != null && Object.keys(P).forEach(($) => {
|
|
3534
3529
|
t.propsToTrack.some((d) => d == $) || delete _[$];
|
|
3535
3530
|
})), JSON.stringify(_);
|
|
3536
3531
|
}
|
|
3537
3532
|
function I() {
|
|
3538
|
-
s = g(J(
|
|
3533
|
+
s = g(J(S)), l.value = !1;
|
|
3539
3534
|
}
|
|
3540
3535
|
return {
|
|
3541
|
-
asyncItem:
|
|
3536
|
+
asyncItem: S,
|
|
3542
3537
|
isChanged: l,
|
|
3543
3538
|
restartTracker: I
|
|
3544
3539
|
};
|
|
3545
3540
|
}
|
|
3546
3541
|
function Ia(e, t) {
|
|
3547
|
-
var
|
|
3542
|
+
var Y;
|
|
3548
3543
|
const {
|
|
3549
3544
|
// useBladeSrc = true,
|
|
3550
3545
|
useRouteSrc: l = !0
|
|
3551
|
-
} = t ?? {},
|
|
3546
|
+
} = 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", I = Nr(), P = et(), _ = J(e.proxyQueryKey), N = ee(() => {
|
|
3552
3547
|
var W;
|
|
3553
|
-
return J(e.proxyID) ?? (_ != null ? (W =
|
|
3554
|
-
}), $ = z(void 0), { actionErrorMsg: d, actionLoadingMsg: h, deleteItem: u, getItem: r, getAllItems:
|
|
3548
|
+
return J(e.proxyID) ?? (_ != null ? (W = P == null ? void 0 : P.query) == null ? void 0 : W[_] : void 0);
|
|
3549
|
+
}), $ = z(void 0), { actionErrorMsg: d, actionLoadingMsg: h, deleteItem: u, getItem: r, getAllItems: w, restoreItem: D, saveItem: c } = ut({
|
|
3555
3550
|
nav: g,
|
|
3556
3551
|
onError: e.onError ?? (t == null ? void 0 : t.onError),
|
|
3557
3552
|
proxyID: N.value,
|
|
3558
|
-
store:
|
|
3559
|
-
storeMode:
|
|
3553
|
+
store: Ne({
|
|
3554
|
+
storeMode: S,
|
|
3560
3555
|
storageMode: s,
|
|
3561
3556
|
nav: g
|
|
3562
3557
|
})
|
|
3563
|
-
}), y = ee(() => e.errorMsg ?? d.value),
|
|
3558
|
+
}), y = ee(() => e.errorMsg ?? d.value), b = ee(() => e.loadingMsg ?? h.value), M = ee(() => b.value != null), A = z(e.itemID ?? (l ? (Y = P == null ? void 0 : P.params) == null ? void 0 : Y.id : void 0)), T = z(A.value == "new" ? "new" : e.startEditing ? "edit" : "view"), x = Me(!1), C = ee(() => {
|
|
3564
3559
|
let W = e.params != null ? { ...e.params } : {};
|
|
3565
3560
|
return e.includeDetails != null && (W.includeDetails = e.includeDetails), W;
|
|
3566
3561
|
}), f = ee(() => {
|
|
@@ -3568,12 +3563,12 @@ function Ia(e, t) {
|
|
|
3568
3563
|
return !1;
|
|
3569
3564
|
const W = J($);
|
|
3570
3565
|
return e.onCanDelete != null ? e.onCanDelete(W) : (W == null ? void 0 : W.isInactive) !== !0;
|
|
3571
|
-
}),
|
|
3566
|
+
}), E = ee(() => {
|
|
3572
3567
|
if (T.value == "new")
|
|
3573
3568
|
return !1;
|
|
3574
3569
|
const W = J($);
|
|
3575
3570
|
return e.onCanEdit != null ? e.onCanEdit(W) : !0;
|
|
3576
|
-
}),
|
|
3571
|
+
}), K = ee(() => {
|
|
3577
3572
|
if (T.value == "new")
|
|
3578
3573
|
return !1;
|
|
3579
3574
|
const W = J($);
|
|
@@ -3623,16 +3618,16 @@ function Ia(e, t) {
|
|
|
3623
3618
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3624
3619
|
});
|
|
3625
3620
|
}
|
|
3626
|
-
async function
|
|
3621
|
+
async function Z(W) {
|
|
3627
3622
|
if (x.value = !1, e.item != null)
|
|
3628
3623
|
$.value = e.item;
|
|
3629
3624
|
else {
|
|
3630
3625
|
const ne = {
|
|
3631
3626
|
additionalUrl: e.additionalUrl,
|
|
3632
|
-
id:
|
|
3627
|
+
id: A.value,
|
|
3633
3628
|
nav: g,
|
|
3634
3629
|
proxyID: N.value,
|
|
3635
|
-
params:
|
|
3630
|
+
params: C.value,
|
|
3636
3631
|
//props.params,
|
|
3637
3632
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3638
3633
|
refresh: (W == null ? void 0 : W.deepRefresh) ?? !1,
|
|
@@ -3642,7 +3637,7 @@ function Ia(e, t) {
|
|
|
3642
3637
|
if (e.isSingle === !0)
|
|
3643
3638
|
ne.id === "new" ? $.value = e.onGetNew ? e.onGetNew() : {} : $.value = await r(ne);
|
|
3644
3639
|
else {
|
|
3645
|
-
const ce = await
|
|
3640
|
+
const ce = await w(ne);
|
|
3646
3641
|
$.value = ce.data;
|
|
3647
3642
|
}
|
|
3648
3643
|
}
|
|
@@ -3677,10 +3672,10 @@ function Ia(e, t) {
|
|
|
3677
3672
|
return Te(y, (W) => {
|
|
3678
3673
|
x.value = W != null;
|
|
3679
3674
|
}), Te(() => e.refreshToggle, () => {
|
|
3680
|
-
|
|
3675
|
+
Z({ deepRefresh: !0 });
|
|
3681
3676
|
}), Xr(async () => {
|
|
3682
3677
|
var W;
|
|
3683
|
-
e.eager == !0 && await
|
|
3678
|
+
e.eager == !0 && await Z({ deepRefresh: ((W = P == null ? void 0 : P.params) == null ? void 0 : W.refresh) == "true" });
|
|
3684
3679
|
}), {
|
|
3685
3680
|
asyncItem: $,
|
|
3686
3681
|
deleteItem: be,
|
|
@@ -3688,21 +3683,21 @@ function Ia(e, t) {
|
|
|
3688
3683
|
isChanged: re,
|
|
3689
3684
|
isDeletable: f,
|
|
3690
3685
|
isEditing: ee(() => T.value == "new" || T.value == "edit"),
|
|
3691
|
-
isEditable:
|
|
3692
|
-
isLoading:
|
|
3686
|
+
isEditable: E,
|
|
3687
|
+
isLoading: M,
|
|
3693
3688
|
isNew: ee(() => T.value == "new"),
|
|
3694
|
-
isRestorable:
|
|
3689
|
+
isRestorable: K,
|
|
3695
3690
|
isSaveable: X,
|
|
3696
|
-
loadingMsg:
|
|
3691
|
+
loadingMsg: b,
|
|
3697
3692
|
mode: T,
|
|
3698
|
-
refresh:
|
|
3693
|
+
refresh: Z,
|
|
3699
3694
|
restoreItem: G,
|
|
3700
3695
|
saveItem: H,
|
|
3701
3696
|
showError: x,
|
|
3702
3697
|
toggleMode: ie
|
|
3703
3698
|
};
|
|
3704
3699
|
}
|
|
3705
|
-
const Vr = z(!0), zr = z(!1),
|
|
3700
|
+
const Vr = z(!0), zr = z(!1), Zr = z(), gr = z(!1);
|
|
3706
3701
|
let yr = null, Cr;
|
|
3707
3702
|
function it() {
|
|
3708
3703
|
return Cr;
|
|
@@ -3719,37 +3714,37 @@ function $n(e) {
|
|
|
3719
3714
|
displayName: h.displayName ?? e.getDisplayName(h),
|
|
3720
3715
|
...h
|
|
3721
3716
|
}));
|
|
3722
|
-
function
|
|
3717
|
+
function S(h) {
|
|
3723
3718
|
var u;
|
|
3724
|
-
return (u =
|
|
3719
|
+
return (u = P(h)) == null ? void 0 : u.archiveName;
|
|
3725
3720
|
}
|
|
3726
3721
|
function s(h) {
|
|
3727
3722
|
var u;
|
|
3728
|
-
return ((u =
|
|
3723
|
+
return ((u = P(h)) == null ? void 0 : u.cacheExpiryHours) ?? t;
|
|
3729
3724
|
}
|
|
3730
3725
|
function g(h) {
|
|
3731
3726
|
var u;
|
|
3732
|
-
return (u =
|
|
3727
|
+
return (u = P(h)) == null ? void 0 : u.displayName;
|
|
3733
3728
|
}
|
|
3734
3729
|
function I(h) {
|
|
3735
3730
|
var u;
|
|
3736
|
-
return (u =
|
|
3731
|
+
return (u = P(h)) == null ? void 0 : u.icon;
|
|
3737
3732
|
}
|
|
3738
|
-
function
|
|
3733
|
+
function P(h) {
|
|
3739
3734
|
return h == null ? null : typeof h != "string" ? h : tt(l, (r) => r.children).find((r) => {
|
|
3740
|
-
var
|
|
3741
|
-
return r.name == h || r.singleName == h || ((
|
|
3735
|
+
var w;
|
|
3736
|
+
return r.name == h || r.singleName == h || ((w = r.aliases) == null ? void 0 : w.some((D) => D == h));
|
|
3742
3737
|
}) ?? null;
|
|
3743
3738
|
}
|
|
3744
3739
|
function _(h) {
|
|
3745
|
-
const u =
|
|
3740
|
+
const u = P(h);
|
|
3746
3741
|
if (u == null)
|
|
3747
3742
|
return;
|
|
3748
3743
|
let r = gn(u.microservice ?? "default") ?? "";
|
|
3749
3744
|
return u.path != null && (r = Ue(r, u.path)), r != null && r.endsWith("/") && (r = r.slice(0, r.length - 1)), r;
|
|
3750
3745
|
}
|
|
3751
3746
|
function N(h) {
|
|
3752
|
-
const u =
|
|
3747
|
+
const u = P(h);
|
|
3753
3748
|
if ((u == null ? void 0 : u.singleName) != null)
|
|
3754
3749
|
return u.singleName;
|
|
3755
3750
|
const r = u == null ? void 0 : u.displayName;
|
|
@@ -3757,28 +3752,28 @@ function $n(e) {
|
|
|
3757
3752
|
return mn(r);
|
|
3758
3753
|
}
|
|
3759
3754
|
function $(h) {
|
|
3760
|
-
const u =
|
|
3755
|
+
const u = P(h);
|
|
3761
3756
|
return (u == null ? void 0 : u.name) ?? (u == null ? void 0 : u.singleName);
|
|
3762
3757
|
}
|
|
3763
3758
|
function d(h) {
|
|
3764
3759
|
if (h == null)
|
|
3765
3760
|
return;
|
|
3766
|
-
const u = typeof h == "string" ?
|
|
3767
|
-
|
|
3761
|
+
const u = typeof h == "string" ? P(h) : h;
|
|
3762
|
+
Zr.value = u == null ? void 0 : u.background, zr.value = (u == null ? void 0 : u.hideNavigation) !== !0, Vr.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) => {
|
|
3768
3763
|
r.preventDefault();
|
|
3769
3764
|
}));
|
|
3770
3765
|
}
|
|
3771
3766
|
return Cr = {
|
|
3772
3767
|
showAppBar: Vr,
|
|
3773
3768
|
showAppNavigation: zr,
|
|
3774
|
-
backgroundName:
|
|
3769
|
+
backgroundName: Zr,
|
|
3775
3770
|
hesitate: gr,
|
|
3776
3771
|
navigationItems: l,
|
|
3777
|
-
findArchiveName:
|
|
3772
|
+
findArchiveName: S,
|
|
3778
3773
|
findCacheHours: s,
|
|
3779
3774
|
findDisplay: g,
|
|
3780
3775
|
findIcon: I,
|
|
3781
|
-
findItem:
|
|
3776
|
+
findItem: P,
|
|
3782
3777
|
findStoreName: $,
|
|
3783
3778
|
findPath: _,
|
|
3784
3779
|
findSingleDisplay: N,
|
|
@@ -3787,17 +3782,17 @@ function $n(e) {
|
|
|
3787
3782
|
}
|
|
3788
3783
|
function Da(e, t, l) {
|
|
3789
3784
|
var He, Ve;
|
|
3790
|
-
const
|
|
3785
|
+
const S = Ln(), s = it(), g = Nr(), I = et(), { bladeData: P } = Cn({}), _ = e.useBladeSrc ?? !0, N = e.useRouteSrc ?? !0, $ = e.nav ?? e.bladeName ?? e.itemBladeName ?? "basic", d = e.storeMode ?? ((He = s.findItem($)) == null ? void 0 : He.storeMode), h = e.storageMode ?? ((Ve = s.findItem($)) == null ? void 0 : Ve.storageMode), u = J(e.customFilters) ?? [], r = z([]), w = ee(() => Kt([
|
|
3791
3786
|
...u.filter((U) => U.name != null).map((U) => U.name),
|
|
3792
3787
|
...e.defaultFilters ?? [],
|
|
3793
3788
|
...r.value
|
|
3794
|
-
]).value), D = z((e.defaultFilters ?? []).map((U) =>
|
|
3789
|
+
]).value), D = z((e.defaultFilters ?? []).map((U) => w.value.indexOf(U)));
|
|
3795
3790
|
let c = z([...D.value]);
|
|
3796
|
-
const y = ee(() => Gr(c, D).value.length > 0 || Gr(D, c).value.length > 0),
|
|
3797
|
-
function
|
|
3791
|
+
const y = ee(() => Gr(c, D).value.length > 0 || Gr(D, c).value.length > 0), b = z(M());
|
|
3792
|
+
function M() {
|
|
3798
3793
|
var U, Q;
|
|
3799
3794
|
if (_) {
|
|
3800
|
-
const V = (U =
|
|
3795
|
+
const V = (U = P.value) == null ? void 0 : U.page;
|
|
3801
3796
|
if (V != null)
|
|
3802
3797
|
return Number.parseInt(V);
|
|
3803
3798
|
}
|
|
@@ -3808,10 +3803,10 @@ function Da(e, t, l) {
|
|
|
3808
3803
|
}
|
|
3809
3804
|
return 1;
|
|
3810
3805
|
}
|
|
3811
|
-
const
|
|
3806
|
+
const A = ee(() => {
|
|
3812
3807
|
var U, Q;
|
|
3813
3808
|
if (_) {
|
|
3814
|
-
const V = (U =
|
|
3809
|
+
const V = (U = P.value) == null ? void 0 : U.proxyID;
|
|
3815
3810
|
if (V != null)
|
|
3816
3811
|
return V;
|
|
3817
3812
|
}
|
|
@@ -3825,7 +3820,7 @@ function Da(e, t, l) {
|
|
|
3825
3820
|
function x() {
|
|
3826
3821
|
var U, Q;
|
|
3827
3822
|
if (_) {
|
|
3828
|
-
const V = (U =
|
|
3823
|
+
const V = (U = P.value) == null ? void 0 : U.search;
|
|
3829
3824
|
if (V != null)
|
|
3830
3825
|
return V;
|
|
3831
3826
|
}
|
|
@@ -3835,24 +3830,24 @@ function Da(e, t, l) {
|
|
|
3835
3830
|
return V;
|
|
3836
3831
|
}
|
|
3837
3832
|
}
|
|
3838
|
-
const
|
|
3833
|
+
const C = z(J(e.startShowingInactive) ?? !1), f = ee(() => [
|
|
3839
3834
|
...e.searchProps ?? [],
|
|
3840
3835
|
...(e.headers ?? []).filter((U) => U.searchable != null && U.value != null).map((U) => U.value ?? "")
|
|
3841
|
-
]),
|
|
3836
|
+
]), E = z([]), K = Me([]), X = z([]);
|
|
3842
3837
|
let re;
|
|
3843
|
-
const { actionErrorMsg: ue, actionLoadingMsg: be, deleteItem: G, doAction:
|
|
3838
|
+
const { actionErrorMsg: ue, actionLoadingMsg: be, deleteItem: G, doAction: Z, getItem: H, getAllItems: ie, restoreItem: Y } = ut({
|
|
3844
3839
|
nav: $,
|
|
3845
3840
|
onError: e.onError ?? (l == null ? void 0 : l.onError),
|
|
3846
|
-
proxyID:
|
|
3847
|
-
store:
|
|
3841
|
+
proxyID: A.value,
|
|
3842
|
+
store: Ne({
|
|
3848
3843
|
storeMode: d,
|
|
3849
3844
|
storageMode: h,
|
|
3850
3845
|
nav: $
|
|
3851
3846
|
})
|
|
3852
|
-
}), W = ee(() => e.errorMsg ?? ue.value), ne = ee(() => e.loadingMsg ?? be.value), ce = ee(() => ne.value != null), se =
|
|
3847
|
+
}), W = ee(() => e.errorMsg ?? ue.value), ne = ee(() => e.loadingMsg ?? be.value), ce = ee(() => ne.value != null), se = Me(!1), ge = Me(e.showSearch ?? !0), Be = z(0), $e = ee(() => {
|
|
3853
3848
|
let U, Q = [];
|
|
3854
3849
|
D.value.forEach((O) => {
|
|
3855
|
-
const de =
|
|
3850
|
+
const de = w.value[O], ye = u.find((De) => De.name == de);
|
|
3856
3851
|
ye != null ? U = U != null ? `${U}ANDALSO${ye.filterFunction()}` : ye.filterFunction() : Q.push(de);
|
|
3857
3852
|
});
|
|
3858
3853
|
const V = {};
|
|
@@ -3860,8 +3855,8 @@ function Da(e, t, l) {
|
|
|
3860
3855
|
}), Fe = ee(() => {
|
|
3861
3856
|
var Q;
|
|
3862
3857
|
let U = e.params != null ? { ...e.params } : {};
|
|
3863
|
-
return e.useServerPagination && e.itemsPerPage != null && (U.includeCount = !0, U.takeAmount = e.itemsPerPage, U.takeFrom = (
|
|
3864
|
-
}), tr = ee(() => (U) => e.onCanDelete != null ? e.onCanDelete(U) : !(U != null && U.isInactive === !0)), nr = ee(() => (U) =>
|
|
3858
|
+
return e.useServerPagination && e.itemsPerPage != null && (U.includeCount = !0, U.takeAmount = e.itemsPerPage, U.takeFrom = (b.value - 1) * e.itemsPerPage), $e.value != null && (U = { ...U, ...$e.value }), C.value && (U.includeInactive = !0), _e(e.selectProps) && (U.properties = (Q = e.selectProps) == null ? void 0 : Q.toString()), T.value != null && (U.searchString = T.value), U;
|
|
3859
|
+
}), tr = ee(() => (U) => e.onCanDelete != null ? e.onCanDelete(U) : !(U != null && U.isInactive === !0)), nr = ee(() => (U) => C.value ? e.onCanRestore != null ? e.onCanRestore(U) : (U == null ? void 0 : U.isInactive) === !0 : !1), Ce = ee(() => X.value.filter((U) => !U.hide)), ar = ee(() => {
|
|
3865
3860
|
let U = new Array();
|
|
3866
3861
|
return Ce.value.filter((V) => V.sublevel != null).forEach((V) => {
|
|
3867
3862
|
let O = U.find((de) => de.position == V.sublevel);
|
|
@@ -3893,16 +3888,16 @@ function Da(e, t, l) {
|
|
|
3893
3888
|
onDeleteAsync: V
|
|
3894
3889
|
} = { ...e }, O = J(U), de = O.id, ye = (De) => {
|
|
3895
3890
|
if (De != null) {
|
|
3896
|
-
let Ae =
|
|
3897
|
-
if (Ae > -1 &&
|
|
3898
|
-
let oe = e.items.findIndex((
|
|
3891
|
+
let Ae = E.value.findIndex((oe) => oe.id == De);
|
|
3892
|
+
if (Ae > -1 && E.value.splice(Ae, 1), e.items != null) {
|
|
3893
|
+
let oe = e.items.findIndex((Le) => Le.id == De);
|
|
3899
3894
|
oe > -1 && e.items.splice(oe, 1);
|
|
3900
3895
|
}
|
|
3901
3896
|
} else {
|
|
3902
|
-
let Ae =
|
|
3903
|
-
if (Ae == -1 && (Ae =
|
|
3904
|
-
let oe = e.items.findIndex((
|
|
3905
|
-
oe == -1 && (oe = e.items.findIndex((
|
|
3897
|
+
let Ae = E.value.findIndex((oe) => oe === O);
|
|
3898
|
+
if (Ae == -1 && (Ae = E.value.findIndex((oe) => oe == O)), Ae > -1 && E.value.splice(Ae, 1), e.items != null) {
|
|
3899
|
+
let oe = e.items.findIndex((Le) => Le === O);
|
|
3900
|
+
oe == -1 && (oe = e.items.findIndex((Le) => Le == O)), oe > -1 && e.items.splice(oe, 1);
|
|
3906
3901
|
}
|
|
3907
3902
|
}
|
|
3908
3903
|
};
|
|
@@ -3913,35 +3908,35 @@ function Da(e, t, l) {
|
|
|
3913
3908
|
onCanDeleteAsync: e.onCanDeleteAsync,
|
|
3914
3909
|
onDeleteAsync: V,
|
|
3915
3910
|
onDeleteSuccessAsync: async () => (ye(de), e.onDeleteSuccessAsync != null ? e.onDeleteSuccessAsync(O) : Promise.resolve(void 0)),
|
|
3916
|
-
proxyID:
|
|
3911
|
+
proxyID: A.value,
|
|
3917
3912
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3918
3913
|
requireConfirmation: !0
|
|
3919
3914
|
}), t && t("deleted", U);
|
|
3920
3915
|
}
|
|
3921
3916
|
function Je(U) {
|
|
3922
|
-
|
|
3917
|
+
Y({
|
|
3923
3918
|
data: J(U),
|
|
3924
3919
|
additionalUrl: e.additionalUrl,
|
|
3925
3920
|
nav: $,
|
|
3926
3921
|
onCanRestoreAsync: e.onCanRestoreAsync,
|
|
3927
3922
|
onRestoreAsync: e.onRestoreAsync,
|
|
3928
3923
|
onRestoreSuccessAsync: e.onRestoreSuccessAsync,
|
|
3929
|
-
proxyID:
|
|
3924
|
+
proxyID: A.value
|
|
3930
3925
|
// ...(useBladeSrc ? bladeData.value : {})
|
|
3931
3926
|
});
|
|
3932
3927
|
}
|
|
3933
3928
|
function ke() {
|
|
3934
|
-
|
|
3935
|
-
|
|
3929
|
+
Z(() => {
|
|
3930
|
+
S.exportToCSV(Ce.value, K.value);
|
|
3936
3931
|
}, { loadingMsg: "Exporting to CSV" });
|
|
3937
3932
|
}
|
|
3938
3933
|
function Pe() {
|
|
3939
|
-
let U = J(
|
|
3934
|
+
let U = J(E);
|
|
3940
3935
|
if (U = e.onFilter ? e.onFilter(U) : U, T.value != null && T.value.length > 0) {
|
|
3941
3936
|
let Q = [...f.value];
|
|
3942
3937
|
e.itemText && Q.push(e.itemText), _e(Q) && (U = U.filter((V) => dn(V, T.value, Q)));
|
|
3943
3938
|
}
|
|
3944
|
-
|
|
3939
|
+
K.value = U;
|
|
3945
3940
|
}
|
|
3946
3941
|
function qe() {
|
|
3947
3942
|
const U = (l == null ? void 0 : l.hideActions) ?? e.hideActions;
|
|
@@ -3949,7 +3944,7 @@ function Da(e, t, l) {
|
|
|
3949
3944
|
}
|
|
3950
3945
|
async function Ie(U) {
|
|
3951
3946
|
if (se.value = !1, (U == null ? void 0 : U.resetSearch) === !0 && (ge.value = e.showSearch ?? !1, T.value = void 0), e.items != null) {
|
|
3952
|
-
|
|
3947
|
+
E.value = e.onGetSuccessAsync != null ? await e.onGetSuccessAsync(e.items) : e.items;
|
|
3953
3948
|
return;
|
|
3954
3949
|
}
|
|
3955
3950
|
const Q = {
|
|
@@ -3959,7 +3954,7 @@ function Da(e, t, l) {
|
|
|
3959
3954
|
params: Fe.value,
|
|
3960
3955
|
//params,
|
|
3961
3956
|
// params: params.getParamOptions(),
|
|
3962
|
-
proxyID:
|
|
3957
|
+
proxyID: A.value,
|
|
3963
3958
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3964
3959
|
// ...(props.useInterEvents ? eventData : {}),
|
|
3965
3960
|
refresh: (U == null ? void 0 : U.deepRefresh) ?? !1,
|
|
@@ -3967,17 +3962,16 @@ function Da(e, t, l) {
|
|
|
3967
3962
|
onGetSuccessAsync: e.onGetSuccessAsync
|
|
3968
3963
|
};
|
|
3969
3964
|
if (e.isSingle === !0)
|
|
3970
|
-
Q.id === "new" ?
|
|
3965
|
+
Q.id === "new" ? E.value = [] : E.value = await H(Q);
|
|
3971
3966
|
else {
|
|
3972
3967
|
let V = await ie({
|
|
3973
3968
|
...Q,
|
|
3974
3969
|
onGetSuccessAsync: async (O, de) => {
|
|
3975
|
-
console.log("get suc"), console.log(O);
|
|
3976
3970
|
let ye = O == null ? void 0 : O.data;
|
|
3977
3971
|
return r.value = (O == null ? void 0 : O.filters) ?? [], e.useServerPagination === !0 && e.itemsPerPage && O.count && (Be.value = Math.ceil(O.count / e.itemsPerPage)), e.onGetSuccessAsync != null && (ye = await e.onGetSuccessAsync(ye, de)), ye;
|
|
3978
3972
|
}
|
|
3979
3973
|
});
|
|
3980
|
-
|
|
3974
|
+
E.value = V, c.value = [...D.value];
|
|
3981
3975
|
}
|
|
3982
3976
|
Pe();
|
|
3983
3977
|
}
|
|
@@ -4004,27 +3998,27 @@ function Da(e, t, l) {
|
|
|
4004
3998
|
}
|
|
4005
3999
|
return qe(), Qt([T], () => {
|
|
4006
4000
|
Pe();
|
|
4007
|
-
}, { debounce: 500, maxWait: 500 }), Te([
|
|
4001
|
+
}, { debounce: 500, maxWait: 500 }), Te([C, b], async () => {
|
|
4008
4002
|
await Ie();
|
|
4009
4003
|
}), Te([W, () => e.errorMsg], ([U, Q]) => {
|
|
4010
4004
|
se.value = U != null || Q != null;
|
|
4011
4005
|
}), Te(() => e.refreshToggle, () => {
|
|
4012
4006
|
Ie({ deepRefresh: !0 });
|
|
4013
|
-
}), Or([
|
|
4007
|
+
}), Or([E, () => e.items], () => {
|
|
4014
4008
|
Pe();
|
|
4015
4009
|
}), Xr(async () => {
|
|
4016
4010
|
var U;
|
|
4017
4011
|
e.eager == !0 && await Ie({ deepRefresh: ((U = I == null ? void 0 : I.params) == null ? void 0 : U.refresh) == "true" });
|
|
4018
4012
|
}), {
|
|
4019
4013
|
add: Se,
|
|
4020
|
-
asyncItems:
|
|
4021
|
-
currentPage:
|
|
4014
|
+
asyncItems: E,
|
|
4015
|
+
currentPage: b,
|
|
4022
4016
|
deleteItem: ir,
|
|
4023
4017
|
displayHeaders: ur,
|
|
4024
4018
|
errorMsg: W,
|
|
4025
4019
|
exportToCSV: ke,
|
|
4026
|
-
filteredItems:
|
|
4027
|
-
filters:
|
|
4020
|
+
filteredItems: K,
|
|
4021
|
+
filters: w,
|
|
4028
4022
|
filtersChanged: y,
|
|
4029
4023
|
headerOptions: X,
|
|
4030
4024
|
isDeletable: tr,
|
|
@@ -4038,7 +4032,7 @@ function Da(e, t, l) {
|
|
|
4038
4032
|
selectItem: je,
|
|
4039
4033
|
// serverFilters,
|
|
4040
4034
|
showError: se,
|
|
4041
|
-
showInactive:
|
|
4035
|
+
showInactive: C,
|
|
4042
4036
|
showSearch: ge,
|
|
4043
4037
|
subtitleOptions: ar,
|
|
4044
4038
|
tableHeaders: Ce,
|
|
@@ -4057,21 +4051,21 @@ function Fn(e) {
|
|
|
4057
4051
|
}, We;
|
|
4058
4052
|
}
|
|
4059
4053
|
function xa() {
|
|
4060
|
-
const e =
|
|
4061
|
-
let
|
|
4054
|
+
const e = Nr(), t = it(), l = In();
|
|
4055
|
+
let S = e.getRoutes();
|
|
4062
4056
|
return {
|
|
4063
4057
|
...We,
|
|
4064
4058
|
sidebarNavItems: ee(() => {
|
|
4065
4059
|
var g;
|
|
4066
|
-
|
|
4060
|
+
S = S.filter((I) => I.meta != null && I.meta.menuGroup != null);
|
|
4067
4061
|
const s = [];
|
|
4068
|
-
return
|
|
4062
|
+
return S.forEach((I) => {
|
|
4069
4063
|
var d;
|
|
4070
|
-
const
|
|
4064
|
+
const P = We.groupOptions.value.find((h) => h.displayName == I.meta.menuGroup), _ = t.findItem(I.meta.nav), N = I.meta;
|
|
4071
4065
|
let $ = s.find((h) => h.displayName == N.menuGroup);
|
|
4072
4066
|
$ == null && ($ = {
|
|
4073
4067
|
displayName: N.menuGroup,
|
|
4074
|
-
icon: (
|
|
4068
|
+
icon: (P == null ? void 0 : P.icon) ?? (N == null ? void 0 : N.icon) ?? (_ == null ? void 0 : _.icon),
|
|
4075
4069
|
isGroup: !0,
|
|
4076
4070
|
items: []
|
|
4077
4071
|
}, s.push($)), (d = $.items) == null || d.push({
|
|
@@ -4084,8 +4078,8 @@ function xa() {
|
|
|
4084
4078
|
routeName: I.name
|
|
4085
4079
|
});
|
|
4086
4080
|
}), s.forEach((I) => {
|
|
4087
|
-
var
|
|
4088
|
-
I.items = (
|
|
4081
|
+
var P;
|
|
4082
|
+
I.items = (P = I.items) == null ? void 0 : P.filter((_) => !_.requiresAuth || l.doShow(_.subscriptions, _.permissions, "view")).sort(Re.firstBy((_) => _.displayName));
|
|
4089
4083
|
}), We.currentGroup.value != null ? ((g = s.find((I) => I.displayName == We.currentGroup.value)) == null ? void 0 : g.items) ?? [] : s.filter((I) => !I.requiresAuth || l.doShow(I.subscriptions, I.permissions, "view"));
|
|
4090
4084
|
})
|
|
4091
4085
|
};
|
|
@@ -4098,18 +4092,18 @@ function kn(e) {
|
|
|
4098
4092
|
function t(l) {
|
|
4099
4093
|
if (!l)
|
|
4100
4094
|
return {};
|
|
4101
|
-
let
|
|
4102
|
-
return e.presets[
|
|
4095
|
+
let S = l;
|
|
4096
|
+
return e.presets[S] ?? {};
|
|
4103
4097
|
}
|
|
4104
4098
|
return Pr = {
|
|
4105
4099
|
usePresets: t
|
|
4106
4100
|
}, Pr;
|
|
4107
4101
|
}
|
|
4108
|
-
let
|
|
4102
|
+
let Yr, Jr, jr, Kr = !1;
|
|
4109
4103
|
const wr = z(!1), br = z(!1), Qr = z(), er = z();
|
|
4110
|
-
let
|
|
4104
|
+
let Lr;
|
|
4111
4105
|
function _a() {
|
|
4112
|
-
return
|
|
4106
|
+
return Lr;
|
|
4113
4107
|
}
|
|
4114
4108
|
function Gn() {
|
|
4115
4109
|
function e(I) {
|
|
@@ -4122,7 +4116,7 @@ function Gn() {
|
|
|
4122
4116
|
var I;
|
|
4123
4117
|
(I = Qr.value) == null || I.prompt(), wr.value = !1;
|
|
4124
4118
|
}
|
|
4125
|
-
function
|
|
4119
|
+
function S() {
|
|
4126
4120
|
return !!window.matchMedia("(display-mode: standalone)").matches;
|
|
4127
4121
|
}
|
|
4128
4122
|
function s(I) {
|
|
@@ -4132,14 +4126,14 @@ function Gn() {
|
|
|
4132
4126
|
br.value = !1, !(!er.value || !er.value.waiting) && er.value.waiting.postMessage({ type: "SKIP_WAITING" });
|
|
4133
4127
|
}
|
|
4134
4128
|
return Xt(() => {
|
|
4135
|
-
|
|
4136
|
-
}),
|
|
4129
|
+
Yr == null && (Yr = document.addEventListener("swUpdated", e, { once: !0 })), Jr == null && (Jr = navigator.serviceWorker.addEventListener("controllerchange", t)), jr == null && (jr = window.addEventListener("beforeinstallprompt", s));
|
|
4130
|
+
}), Lr = {
|
|
4137
4131
|
canInstallApp: wr,
|
|
4138
4132
|
canUpdateApp: br,
|
|
4139
4133
|
installApp: l,
|
|
4140
|
-
isInstalled:
|
|
4134
|
+
isInstalled: S,
|
|
4141
4135
|
updateApp: g
|
|
4142
|
-
},
|
|
4136
|
+
}, Lr;
|
|
4143
4137
|
}
|
|
4144
4138
|
function Ca(e) {
|
|
4145
4139
|
const t = [];
|
|
@@ -4150,19 +4144,19 @@ function Pa(e) {
|
|
|
4150
4144
|
install(t, l) {
|
|
4151
4145
|
var _;
|
|
4152
4146
|
console.log(t), e.vuetifyInstance ?? (e.vuetifyInstance = l.vuetifyInstance), yn(e.urls), Pn(e);
|
|
4153
|
-
const
|
|
4154
|
-
kn(e), (_ = e.auth).demo ?? (_.demo =
|
|
4147
|
+
const S = Mn(), s = $n(e);
|
|
4148
|
+
kn(e), (_ = e.auth).demo ?? (_.demo = S), e.auth.getAuthItem = s.findItem;
|
|
4155
4149
|
const g = Dn(e.auth);
|
|
4156
4150
|
Fn(e.menu);
|
|
4157
4151
|
const I = En({
|
|
4158
4152
|
auth: g,
|
|
4159
4153
|
findPath: s.findPath,
|
|
4160
4154
|
useBearerToken: !0
|
|
4161
|
-
}),
|
|
4155
|
+
}), P = Nn({
|
|
4162
4156
|
getTimeZone: () => g.timeZone.value
|
|
4163
4157
|
});
|
|
4164
4158
|
Un({
|
|
4165
|
-
dates:
|
|
4159
|
+
dates: P
|
|
4166
4160
|
}), Gn(), wn({
|
|
4167
4161
|
api: I,
|
|
4168
4162
|
auth: g,
|
|
@@ -4179,14 +4173,14 @@ export {
|
|
|
4179
4173
|
On as checkImage,
|
|
4180
4174
|
fn as containsSearch,
|
|
4181
4175
|
na as containsWeekday,
|
|
4182
|
-
|
|
4176
|
+
Mr as copyDeep,
|
|
4183
4177
|
cn as copyItemByAlphabet,
|
|
4184
4178
|
En as createApi,
|
|
4185
4179
|
Dn as createAuth,
|
|
4186
4180
|
Pa as createCore,
|
|
4187
4181
|
Pn as createCosmetics,
|
|
4188
|
-
|
|
4189
|
-
|
|
4182
|
+
Nn as createDates,
|
|
4183
|
+
Mn as createDemo,
|
|
4190
4184
|
Un as createFilters,
|
|
4191
4185
|
Fn as createMenu,
|
|
4192
4186
|
$n as createNavigation,
|
|
@@ -4199,7 +4193,7 @@ export {
|
|
|
4199
4193
|
un as csvContains,
|
|
4200
4194
|
wa as csvDefaults,
|
|
4201
4195
|
tt as deepSelect,
|
|
4202
|
-
|
|
4196
|
+
Yn as distinct,
|
|
4203
4197
|
Jn as extensionExists,
|
|
4204
4198
|
sn as extractErrorDescription,
|
|
4205
4199
|
tn as fromCamelCase,
|
|
@@ -4230,7 +4224,7 @@ export {
|
|
|
4230
4224
|
In as useAuth,
|
|
4231
4225
|
Wr as useAuthUrl,
|
|
4232
4226
|
Cn as useBlade,
|
|
4233
|
-
|
|
4227
|
+
Ln as useCSV,
|
|
4234
4228
|
ga as useCosmetics,
|
|
4235
4229
|
gn as useDataUrl,
|
|
4236
4230
|
ba as useDates,
|
|
@@ -4252,11 +4246,11 @@ export {
|
|
|
4252
4246
|
_n as useResizable,
|
|
4253
4247
|
Ca as useRules,
|
|
4254
4248
|
va as useStore,
|
|
4255
|
-
|
|
4249
|
+
Ne as useStoreDefinition,
|
|
4256
4250
|
Bn as useTracker,
|
|
4257
4251
|
ha as useUrls,
|
|
4258
4252
|
hn as validEmail,
|
|
4259
|
-
|
|
4253
|
+
Ye as weekdayPairs,
|
|
4260
4254
|
ta as weekdayShortName,
|
|
4261
4255
|
ra as weekdayValue
|
|
4262
4256
|
};
|