l-min-components 1.8.474 → 1.8.476
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/chunks/{formatDuration.-bee1154e.js → formatDuration.-ac7eeadf.js} +231 -203
- package/dist/chunks/{formatDuration.-bee1154e.js.map → formatDuration.-ac7eeadf.js.map} +1 -1
- package/dist/chunks/{useCustomNavigate-bf4735c1.js → useCustomNavigate-055330f4.js} +1162 -2304
- package/dist/chunks/useCustomNavigate-055330f4.js.map +1 -0
- package/dist/components.js +14 -14
- package/dist/hooks.js +5 -5
- package/dist/index.js +5 -5
- package/dist/utils.js +146 -146
- package/package.json +4 -4
- package/dist/chunks/axios-7e873420.js +0 -1801
- package/dist/chunks/axios-7e873420.js.map +0 -1
- package/dist/chunks/useCustomNavigate-bf4735c1.js.map +0 -1
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as ba } from "./chunks/formatDuration.-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { c as Or, g as Ar, a as ba } from "./chunks/formatDuration.-ac7eeadf.js";
|
|
2
|
+
import { h as za, e as Ga, f as Va, d as Wa, r as $a, u as Ya } from "./chunks/formatDuration.-ac7eeadf.js";
|
|
3
|
+
import Vn from "axios";
|
|
4
4
|
import "react";
|
|
5
5
|
if (typeof ga > "u")
|
|
6
6
|
var ga = window;
|
|
@@ -60,8 +60,8 @@ Dt.interceptors.response.use(
|
|
|
60
60
|
const wa = Dt;
|
|
61
61
|
var Er = { exports: {} };
|
|
62
62
|
(function(C, j) {
|
|
63
|
-
(function(R,
|
|
64
|
-
C.exports =
|
|
63
|
+
(function(R, A) {
|
|
64
|
+
C.exports = A();
|
|
65
65
|
})(Or, function() {
|
|
66
66
|
var R = function(e, n) {
|
|
67
67
|
return (R = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
|
|
@@ -70,8 +70,8 @@ var Er = { exports: {} };
|
|
|
70
70
|
for (var a in r)
|
|
71
71
|
Object.prototype.hasOwnProperty.call(r, a) && (t[a] = r[a]);
|
|
72
72
|
})(e, n);
|
|
73
|
-
},
|
|
74
|
-
return (
|
|
73
|
+
}, A = function() {
|
|
74
|
+
return (A = Object.assign || function(e) {
|
|
75
75
|
for (var n, t = 1, r = arguments.length; t < r; t++)
|
|
76
76
|
for (var a in n = arguments[t])
|
|
77
77
|
Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]);
|
|
@@ -162,13 +162,13 @@ var Er = { exports: {} };
|
|
|
162
162
|
function Mt(e) {
|
|
163
163
|
return Br.apply([], e);
|
|
164
164
|
}
|
|
165
|
-
var
|
|
165
|
+
var Pe = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Mt([8, 16, 32, 64].map(function(e) {
|
|
166
166
|
return ["Int", "Uint", "Float"].map(function(n) {
|
|
167
167
|
return n + e + "Array";
|
|
168
168
|
});
|
|
169
169
|
}))).filter(function(e) {
|
|
170
170
|
return U[e];
|
|
171
|
-
}), Lt = new Set(
|
|
171
|
+
}), Lt = new Set(Pe.map(function(e) {
|
|
172
172
|
return U[e];
|
|
173
173
|
})), Xe = null;
|
|
174
174
|
function xe(e) {
|
|
@@ -336,16 +336,16 @@ var Er = { exports: {} };
|
|
|
336
336
|
function Gt(e) {
|
|
337
337
|
se = e;
|
|
338
338
|
}
|
|
339
|
-
var Ze = {}, Vt = 100,
|
|
339
|
+
var Ze = {}, Vt = 100, Pe = typeof Promise > "u" ? [] : function() {
|
|
340
340
|
var e = Promise.resolve();
|
|
341
341
|
if (typeof crypto > "u" || !crypto.subtle)
|
|
342
342
|
return [e, fe(e), e];
|
|
343
343
|
var n = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
344
344
|
return [n, fe(n), e];
|
|
345
|
-
}(), en =
|
|
345
|
+
}(), en = Pe[0], ue = Pe[1], Pe = Pe[2], ue = ue && ue.then, Ae = en && en.constructor, Zn = !!Pe, nn = function(e, n) {
|
|
346
346
|
tn.push([e, n]), gn && (queueMicrotask(Yr), gn = !1);
|
|
347
347
|
}, et = !0, gn = !0, Ee = [], bn = [], nt = Je, ye = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: G, pgp: !1, env: {}, finalize: G }, K = ye, tn = [], Ke = 0, wn = [];
|
|
348
|
-
function
|
|
348
|
+
function P(e) {
|
|
349
349
|
if (typeof this != "object")
|
|
350
350
|
throw new TypeError("Promises must be constructed via new");
|
|
351
351
|
this._listeners = [], this._lib = !1;
|
|
@@ -363,7 +363,7 @@ var Er = { exports: {} };
|
|
|
363
363
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
364
364
|
var o = r._lib && Ue();
|
|
365
365
|
i && typeof i.then == "function" ? t(r, function(u, c) {
|
|
366
|
-
i instanceof
|
|
366
|
+
i instanceof P ? i._then(u, c) : i.then(u, c);
|
|
367
367
|
}) : (r._state = !0, r._value = i, $t(r)), o && ze();
|
|
368
368
|
}
|
|
369
369
|
}, rt.bind(null, r));
|
|
@@ -375,7 +375,7 @@ var Er = { exports: {} };
|
|
|
375
375
|
var tt = { get: function() {
|
|
376
376
|
var e = K, n = xn;
|
|
377
377
|
function t(r, a) {
|
|
378
|
-
var i = this, o = !e.global && (e !== K || n !== xn), u = o && !be(), c = new
|
|
378
|
+
var i = this, o = !e.global && (e !== K || n !== xn), u = o && !be(), c = new P(function(l, m) {
|
|
379
379
|
at(i, new Wt(Ht(r, e, o, u), Ht(a, e, o, u), l, m, e));
|
|
380
380
|
});
|
|
381
381
|
return this._consoleTask && (c._consoleTask = this._consoleTask), c;
|
|
@@ -459,7 +459,7 @@ var Er = { exports: {} };
|
|
|
459
459
|
n[--t]();
|
|
460
460
|
}
|
|
461
461
|
function _n(e) {
|
|
462
|
-
return new
|
|
462
|
+
return new P(Ze, !1, e);
|
|
463
463
|
}
|
|
464
464
|
function $(e, n) {
|
|
465
465
|
var t = K;
|
|
@@ -474,7 +474,7 @@ var Er = { exports: {} };
|
|
|
474
474
|
}
|
|
475
475
|
};
|
|
476
476
|
}
|
|
477
|
-
Be(
|
|
477
|
+
Be(P.prototype, { then: tt, _then: function(e, n) {
|
|
478
478
|
at(this, new Wt(null, null, e, n, K));
|
|
479
479
|
}, catch: function(e) {
|
|
480
480
|
if (arguments.length === 1)
|
|
@@ -487,42 +487,42 @@ var Er = { exports: {} };
|
|
|
487
487
|
});
|
|
488
488
|
}, finally: function(e) {
|
|
489
489
|
return this.then(function(n) {
|
|
490
|
-
return
|
|
490
|
+
return P.resolve(e()).then(function() {
|
|
491
491
|
return n;
|
|
492
492
|
});
|
|
493
493
|
}, function(n) {
|
|
494
|
-
return
|
|
494
|
+
return P.resolve(e()).then(function() {
|
|
495
495
|
return _n(n);
|
|
496
496
|
});
|
|
497
497
|
});
|
|
498
498
|
}, timeout: function(e, n) {
|
|
499
499
|
var t = this;
|
|
500
|
-
return e < 1 / 0 ? new
|
|
500
|
+
return e < 1 / 0 ? new P(function(r, a) {
|
|
501
501
|
var i = setTimeout(function() {
|
|
502
502
|
return a(new T.Timeout(n));
|
|
503
503
|
}, e);
|
|
504
504
|
t.then(r, a).finally(clearTimeout.bind(null, i));
|
|
505
505
|
}) : this;
|
|
506
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && ve(
|
|
506
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && ve(P.prototype, Symbol.toStringTag, "Dexie.Promise"), ye.env = Yt(), Be(P, { all: function() {
|
|
507
507
|
var e = de.apply(null, arguments).map(On);
|
|
508
|
-
return new
|
|
508
|
+
return new P(function(n, t) {
|
|
509
509
|
e.length === 0 && n([]);
|
|
510
510
|
var r = e.length;
|
|
511
511
|
e.forEach(function(a, i) {
|
|
512
|
-
return
|
|
512
|
+
return P.resolve(a).then(function(o) {
|
|
513
513
|
e[i] = o, --r || n(e);
|
|
514
514
|
}, t);
|
|
515
515
|
});
|
|
516
516
|
});
|
|
517
517
|
}, resolve: function(e) {
|
|
518
|
-
return e instanceof
|
|
518
|
+
return e instanceof P ? e : e && typeof e.then == "function" ? new P(function(n, t) {
|
|
519
519
|
e.then(n, t);
|
|
520
|
-
}) : new
|
|
520
|
+
}) : new P(Ze, !0, e);
|
|
521
521
|
}, reject: _n, race: function() {
|
|
522
522
|
var e = de.apply(null, arguments).map(On);
|
|
523
|
-
return new
|
|
523
|
+
return new P(function(n, t) {
|
|
524
524
|
e.map(function(r) {
|
|
525
|
-
return
|
|
525
|
+
return P.resolve(r).then(n, t);
|
|
526
526
|
});
|
|
527
527
|
});
|
|
528
528
|
}, PSD: { get: function() {
|
|
@@ -540,7 +540,7 @@ var Er = { exports: {} };
|
|
|
540
540
|
}, set: function(e) {
|
|
541
541
|
nt = e;
|
|
542
542
|
} }, follow: function(e, n) {
|
|
543
|
-
return new
|
|
543
|
+
return new P(function(t, r) {
|
|
544
544
|
return ge(function(a, i) {
|
|
545
545
|
var o = K;
|
|
546
546
|
o.unhandleds = [], o.onunhandled = i, o.finalize = Se(function() {
|
|
@@ -555,13 +555,13 @@ var Er = { exports: {} };
|
|
|
555
555
|
}, o.finalize), e();
|
|
556
556
|
}, n, t, r);
|
|
557
557
|
});
|
|
558
|
-
} }),
|
|
558
|
+
} }), Ae && (Ae.allSettled && ve(P, "allSettled", function() {
|
|
559
559
|
var e = de.apply(null, arguments).map(On);
|
|
560
|
-
return new
|
|
560
|
+
return new P(function(n) {
|
|
561
561
|
e.length === 0 && n([]);
|
|
562
562
|
var t = e.length, r = new Array(t);
|
|
563
563
|
e.forEach(function(a, i) {
|
|
564
|
-
return
|
|
564
|
+
return P.resolve(a).then(function(o) {
|
|
565
565
|
return r[i] = { status: "fulfilled", value: o };
|
|
566
566
|
}, function(o) {
|
|
567
567
|
return r[i] = { status: "rejected", reason: o };
|
|
@@ -570,24 +570,24 @@ var Er = { exports: {} };
|
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
});
|
|
573
|
-
}),
|
|
573
|
+
}), Ae.any && typeof AggregateError < "u" && ve(P, "any", function() {
|
|
574
574
|
var e = de.apply(null, arguments).map(On);
|
|
575
|
-
return new
|
|
575
|
+
return new P(function(n, t) {
|
|
576
576
|
e.length === 0 && t(new AggregateError([]));
|
|
577
577
|
var r = e.length, a = new Array(r);
|
|
578
578
|
e.forEach(function(i, o) {
|
|
579
|
-
return
|
|
579
|
+
return P.resolve(i).then(function(u) {
|
|
580
580
|
return n(u);
|
|
581
581
|
}, function(u) {
|
|
582
582
|
a[o] = u, --r || t(new AggregateError(a));
|
|
583
583
|
});
|
|
584
584
|
});
|
|
585
585
|
});
|
|
586
|
-
}),
|
|
586
|
+
}), Ae.withResolvers && (P.withResolvers = Ae.withResolvers));
|
|
587
587
|
var X = { awaits: 0, echoes: 0, id: 0 }, Hr = 0, kn = [], Nn = 0, xn = 0, Qr = 0;
|
|
588
588
|
function ge(e, n, t, r) {
|
|
589
589
|
var a = K, i = Object.create(a);
|
|
590
|
-
return i.parent = a, i.ref = 0, i.global = !1, i.id = ++Qr, ye.env, i.env = Zn ? { Promise:
|
|
590
|
+
return i.parent = a, i.ref = 0, i.global = !1, i.id = ++Qr, ye.env, i.env = Zn ? { Promise: P, PromiseProp: { value: P, configurable: !0, writable: !0 }, all: P.all, race: P.race, allSettled: P.allSettled, any: P.any, resolve: P.resolve, reject: P.reject } : {}, n && W(i, n), ++a.ref, i.finalize = function() {
|
|
591
591
|
--this.parent.ref || this.parent.finalize();
|
|
592
592
|
}, r = Ce(i, e, t, r), i.ref === 0 && i.finalize(), r;
|
|
593
593
|
}
|
|
@@ -598,7 +598,7 @@ var Er = { exports: {} };
|
|
|
598
598
|
return !!X.awaits && (--X.awaits == 0 && (X.id = 0), X.echoes = X.awaits * Vt, !0);
|
|
599
599
|
}
|
|
600
600
|
function On(e) {
|
|
601
|
-
return X.echoes && e && e.constructor ===
|
|
601
|
+
return X.echoes && e && e.constructor === Ae ? (Ge(), e.then(function(n) {
|
|
602
602
|
return be(), n;
|
|
603
603
|
}, function(n) {
|
|
604
604
|
return be(), H(n);
|
|
@@ -638,17 +638,17 @@ var Er = { exports: {} };
|
|
|
638
638
|
};
|
|
639
639
|
}
|
|
640
640
|
function ot(e) {
|
|
641
|
-
Promise ===
|
|
641
|
+
Promise === Ae && X.echoes === 0 ? Nn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
642
642
|
}
|
|
643
643
|
("" + ue).indexOf("[native code]") === -1 && (Ge = be = G);
|
|
644
|
-
var H =
|
|
644
|
+
var H = P.reject, je = String.fromCharCode(65535), me = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Qt = "String expected.", Ve = [], Sn = "__dbnames", ut = "readonly", st = "readwrite";
|
|
645
645
|
function Te(e, n) {
|
|
646
646
|
return e ? n ? function() {
|
|
647
647
|
return e.apply(this, arguments) && n.apply(this, arguments);
|
|
648
648
|
} : e : n;
|
|
649
649
|
}
|
|
650
650
|
var Xt = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
651
|
-
function
|
|
651
|
+
function Pn(e) {
|
|
652
652
|
return typeof e != "string" || /\./.test(e) ? function(n) {
|
|
653
653
|
return n;
|
|
654
654
|
} : function(n) {
|
|
@@ -696,7 +696,7 @@ var Er = { exports: {} };
|
|
|
696
696
|
function er(e) {
|
|
697
697
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function An(e, n, t) {
|
|
700
700
|
var r = e.schema.yProps;
|
|
701
701
|
return r ? (n && 0 < t.numFailures && (n = n.filter(function(a, i) {
|
|
702
702
|
return !t.failures[i];
|
|
@@ -911,10 +911,10 @@ var Er = { exports: {} };
|
|
|
911
911
|
});
|
|
912
912
|
}, V.prototype.add = function(e, n) {
|
|
913
913
|
var t = this, r = this.schema.primKey, a = r.auto, i = r.keyPath, o = e;
|
|
914
|
-
return i && a && (o =
|
|
914
|
+
return i && a && (o = Pn(i)(e)), this._trans("readwrite", function(u) {
|
|
915
915
|
return t.core.mutate({ trans: u, type: "add", keys: n != null ? [n] : null, values: [o] });
|
|
916
916
|
}).then(function(u) {
|
|
917
|
-
return u.numFailures ?
|
|
917
|
+
return u.numFailures ? P.reject(u.failures[0]) : u.lastResult;
|
|
918
918
|
}).then(function(u) {
|
|
919
919
|
if (i)
|
|
920
920
|
try {
|
|
@@ -929,7 +929,7 @@ var Er = { exports: {} };
|
|
|
929
929
|
return t.core.get({ trans: a, key: e }).then(function(i) {
|
|
930
930
|
var o = i ?? {};
|
|
931
931
|
return tr(o, n), r && ae(o, r, e), t.core.mutate({ trans: a, type: "put", values: [o], keys: [e], upsert: !0, updates: { keys: [e], changeSpecs: [n] } }).then(function(u) {
|
|
932
|
-
return u.numFailures ?
|
|
932
|
+
return u.numFailures ? P.reject(u.failures[0]) : !!i;
|
|
933
933
|
});
|
|
934
934
|
});
|
|
935
935
|
});
|
|
@@ -937,10 +937,10 @@ var Er = { exports: {} };
|
|
|
937
937
|
return typeof e != "object" || D(e) ? this.where(":id").equals(e).modify(n) : (e = he(e, this.schema.primKey.keyPath), e === void 0 ? H(new T.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(n));
|
|
938
938
|
}, V.prototype.put = function(e, n) {
|
|
939
939
|
var t = this, r = this.schema.primKey, a = r.auto, i = r.keyPath, o = e;
|
|
940
|
-
return i && a && (o =
|
|
940
|
+
return i && a && (o = Pn(i)(e)), this._trans("readwrite", function(u) {
|
|
941
941
|
return t.core.mutate({ trans: u, type: "put", values: [o], keys: n != null ? [n] : null });
|
|
942
942
|
}).then(function(u) {
|
|
943
|
-
return u.numFailures ?
|
|
943
|
+
return u.numFailures ? P.reject(u.failures[0]) : u.lastResult;
|
|
944
944
|
}).then(function(u) {
|
|
945
945
|
if (i)
|
|
946
946
|
try {
|
|
@@ -953,19 +953,19 @@ var Er = { exports: {} };
|
|
|
953
953
|
var n = this;
|
|
954
954
|
return this._trans("readwrite", function(t) {
|
|
955
955
|
return n.core.mutate({ trans: t, type: "delete", keys: [e] }).then(function(r) {
|
|
956
|
-
return
|
|
956
|
+
return An(n, [e], r);
|
|
957
957
|
}).then(function(r) {
|
|
958
|
-
return r.numFailures ?
|
|
958
|
+
return r.numFailures ? P.reject(r.failures[0]) : void 0;
|
|
959
959
|
});
|
|
960
960
|
});
|
|
961
961
|
}, V.prototype.clear = function() {
|
|
962
962
|
var e = this;
|
|
963
963
|
return this._trans("readwrite", function(n) {
|
|
964
964
|
return e.core.mutate({ trans: n, type: "deleteRange", range: Xt }).then(function(t) {
|
|
965
|
-
return
|
|
965
|
+
return An(e, null, t);
|
|
966
966
|
});
|
|
967
967
|
}).then(function(n) {
|
|
968
|
-
return n.numFailures ?
|
|
968
|
+
return n.numFailures ? P.reject(n.failures[0]) : void 0;
|
|
969
969
|
});
|
|
970
970
|
}, V.prototype.bulkGet = function(e) {
|
|
971
971
|
var n = this;
|
|
@@ -984,7 +984,7 @@ var Er = { exports: {} };
|
|
|
984
984
|
throw new T.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
985
985
|
if (a && a.length !== e.length)
|
|
986
986
|
throw new T.InvalidArgument("Arguments objects and keys must have the same length");
|
|
987
|
-
var c = e.length, l = l && u ? e.map(
|
|
987
|
+
var c = e.length, l = l && u ? e.map(Pn(l)) : e;
|
|
988
988
|
return r.core.mutate({ trans: o, type: "add", keys: a, values: l, wantResults: i }).then(function(h) {
|
|
989
989
|
var s = h.numFailures, v = h.results, f = h.lastResult, h = h.failures;
|
|
990
990
|
if (s === 0)
|
|
@@ -1000,7 +1000,7 @@ var Er = { exports: {} };
|
|
|
1000
1000
|
throw new T.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
1001
1001
|
if (a && a.length !== e.length)
|
|
1002
1002
|
throw new T.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1003
|
-
var c = e.length, l = l && u ? e.map(
|
|
1003
|
+
var c = e.length, l = l && u ? e.map(Pn(l)) : e;
|
|
1004
1004
|
return r.core.mutate({ trans: o, type: "put", keys: a, values: l, wantResults: i }).then(function(h) {
|
|
1005
1005
|
var s = h.numFailures, v = h.results, f = h.lastResult, h = h.failures;
|
|
1006
1006
|
if (s === 0)
|
|
@@ -1048,7 +1048,7 @@ var Er = { exports: {} };
|
|
|
1048
1048
|
var n = this, t = e.length;
|
|
1049
1049
|
return this._trans("readwrite", function(r) {
|
|
1050
1050
|
return n.core.mutate({ trans: r, type: "delete", keys: e }).then(function(a) {
|
|
1051
|
-
return
|
|
1051
|
+
return An(n, e, a);
|
|
1052
1052
|
});
|
|
1053
1053
|
}).then(function(o) {
|
|
1054
1054
|
var a = o.numFailures, i = o.lastResult, o = o.failures;
|
|
@@ -1371,7 +1371,7 @@ var Er = { exports: {} };
|
|
|
1371
1371
|
});
|
|
1372
1372
|
}).then(function() {
|
|
1373
1373
|
return (0 < S.length || y && h) && i.mutate({ trans: r, type: "delete", keys: S, criteria: y, isAdditionalChunk: 0 < g }).then(function(B) {
|
|
1374
|
-
return
|
|
1374
|
+
return An(t.table, S, B);
|
|
1375
1375
|
}).then(function(B) {
|
|
1376
1376
|
return m(S.length, B);
|
|
1377
1377
|
});
|
|
@@ -1687,14 +1687,14 @@ var Er = { exports: {} };
|
|
|
1687
1687
|
if (!this.active)
|
|
1688
1688
|
return H(new T.TransactionInactive());
|
|
1689
1689
|
if (this._locked())
|
|
1690
|
-
return new
|
|
1690
|
+
return new P(function(i, o) {
|
|
1691
1691
|
r._blockedFuncs.push([function() {
|
|
1692
1692
|
r._promise(e, n, t).then(i, o);
|
|
1693
1693
|
}, K]);
|
|
1694
1694
|
});
|
|
1695
1695
|
if (t)
|
|
1696
1696
|
return ge(function() {
|
|
1697
|
-
var i = new
|
|
1697
|
+
var i = new P(function(o, u) {
|
|
1698
1698
|
r._lock();
|
|
1699
1699
|
var c = n(o, u, r);
|
|
1700
1700
|
c && c.then && c.then(o, u);
|
|
@@ -1703,7 +1703,7 @@ var Er = { exports: {} };
|
|
|
1703
1703
|
return r._unlock();
|
|
1704
1704
|
}), i._lib = !0, i;
|
|
1705
1705
|
});
|
|
1706
|
-
var a = new
|
|
1706
|
+
var a = new P(function(i, o) {
|
|
1707
1707
|
var u = n(i, o, r);
|
|
1708
1708
|
u && u.then && u.then(i, o);
|
|
1709
1709
|
});
|
|
@@ -1711,7 +1711,7 @@ var Er = { exports: {} };
|
|
|
1711
1711
|
}, le.prototype._root = function() {
|
|
1712
1712
|
return this.parent ? this.parent._root() : this;
|
|
1713
1713
|
}, le.prototype.waitFor = function(e) {
|
|
1714
|
-
var n, t = this._root(), r =
|
|
1714
|
+
var n, t = this._root(), r = P.resolve(e);
|
|
1715
1715
|
t._waitingFor ? t._waitingFor = t._waitingFor.then(function() {
|
|
1716
1716
|
return r;
|
|
1717
1717
|
}) : (t._waitingFor = r, t._waitingQueue = [], n = t.idbtrans.objectStore(t.storeNames[0]), function i() {
|
|
@@ -1720,7 +1720,7 @@ var Er = { exports: {} };
|
|
|
1720
1720
|
t._waitingFor && (n.get(-1 / 0).onsuccess = i);
|
|
1721
1721
|
}());
|
|
1722
1722
|
var a = t._waitingFor;
|
|
1723
|
-
return new
|
|
1723
|
+
return new P(function(i, o) {
|
|
1724
1724
|
r.then(function(u) {
|
|
1725
1725
|
return t._waitingQueue.push($(i.bind(null, u)));
|
|
1726
1726
|
}, function(u) {
|
|
@@ -1944,7 +1944,7 @@ var Er = { exports: {} };
|
|
|
1944
1944
|
function aa(e, n, t, r) {
|
|
1945
1945
|
var a = t.IDBKeyRange;
|
|
1946
1946
|
return t.indexedDB, { dbcore: (r = ra(n, a, r), e.dbcore.reduce(function(i, o) {
|
|
1947
|
-
return o = o.create,
|
|
1947
|
+
return o = o.create, A(A({}, i), o(i));
|
|
1948
1948
|
}, r)) };
|
|
1949
1949
|
}
|
|
1950
1950
|
function jn(e, r) {
|
|
@@ -1989,7 +1989,7 @@ var Er = { exports: {} };
|
|
|
1989
1989
|
ge(function() {
|
|
1990
1990
|
return K.trans = i, K.transless = u, n !== 0 ? (jn(e, t), l = n, ((c = i).storeNames.includes("$meta") ? c.table("$meta").get("version").then(function(m) {
|
|
1991
1991
|
return m ?? l;
|
|
1992
|
-
}) :
|
|
1992
|
+
}) : P.resolve(l)).then(function(m) {
|
|
1993
1993
|
return v = m, f = i, h = t, d = [], m = (s = e)._versions, p = s._dbSchema = Dn(0, s.idbdb, h), (m = m.filter(function(y) {
|
|
1994
1994
|
return y._cfg.version >= v;
|
|
1995
1995
|
})).length !== 0 ? (m.forEach(function(y) {
|
|
@@ -2019,10 +2019,10 @@ var Er = { exports: {} };
|
|
|
2019
2019
|
O[S] = g[S];
|
|
2020
2020
|
}), pt(s, [s.Transaction.prototype]), Tn(s, [s.Transaction.prototype], M(O), O), f.schema = O;
|
|
2021
2021
|
var _, N = Qn(k);
|
|
2022
|
-
return N && Ge(), w =
|
|
2022
|
+
return N && Ge(), w = P.follow(function() {
|
|
2023
2023
|
var S;
|
|
2024
2024
|
(_ = k(f)) && N && (S = be.bind(null, null), _.then(S, S));
|
|
2025
|
-
}), _ && typeof _.then == "function" ?
|
|
2025
|
+
}), _ && typeof _.then == "function" ? P.resolve(_) : w.then(function() {
|
|
2026
2026
|
return _;
|
|
2027
2027
|
});
|
|
2028
2028
|
}
|
|
@@ -2037,14 +2037,14 @@ var Er = { exports: {} };
|
|
|
2037
2037
|
})) : g.objectStore("$meta").put(y._cfg.version, "version"));
|
|
2038
2038
|
});
|
|
2039
2039
|
}), function y() {
|
|
2040
|
-
return d.length ?
|
|
2040
|
+
return d.length ? P.resolve(d.shift()(f.idbtrans)).then(y) : P.resolve();
|
|
2041
2041
|
}().then(function() {
|
|
2042
2042
|
fr(p, h);
|
|
2043
|
-
})) :
|
|
2043
|
+
})) : P.resolve();
|
|
2044
2044
|
var s, v, f, h, d, p;
|
|
2045
2045
|
}).catch(o)) : (M(a).forEach(function(m) {
|
|
2046
2046
|
yt(t, m, a[m].primKey, a[m].indexes);
|
|
2047
|
-
}), jn(e, t), void
|
|
2047
|
+
}), jn(e, t), void P.follow(function() {
|
|
2048
2048
|
return e.on.populate.fire(i);
|
|
2049
2049
|
}).catch(o));
|
|
2050
2050
|
var c, l;
|
|
@@ -2244,7 +2244,7 @@ var Er = { exports: {} };
|
|
|
2244
2244
|
}
|
|
2245
2245
|
function mr(e) {
|
|
2246
2246
|
var n, t, r = (((n = e.r) === null || n === void 0 ? void 0 : n.d) || 0) - (((t = e.l) === null || t === void 0 ? void 0 : t.d) || 0), a = 1 < r ? "r" : r < -1 ? "l" : "";
|
|
2247
|
-
a && (n = a == "r" ? "l" : "r", t =
|
|
2247
|
+
a && (n = a == "r" ? "l" : "r", t = A({}, e), r = e[a], e.from = r.from, e.to = r.to, e[a] = r[a], t[a] = r[n], (e[n] = t).d = pr(t)), e.d = pr(e);
|
|
2248
2248
|
}
|
|
2249
2249
|
function pr(t) {
|
|
2250
2250
|
var n = t.r, t = t.l;
|
|
@@ -2330,7 +2330,7 @@ var Er = { exports: {} };
|
|
|
2330
2330
|
throw new T.DatabaseClosed("db.open() was cancelled");
|
|
2331
2331
|
}
|
|
2332
2332
|
function u() {
|
|
2333
|
-
return new
|
|
2333
|
+
return new P(function(v, f) {
|
|
2334
2334
|
if (o(), !t)
|
|
2335
2335
|
throw new T.MissingAPI();
|
|
2336
2336
|
var h = e.name, d = n.autoSchema || !a ? t.open(h) : t.open(h, a);
|
|
@@ -2372,11 +2372,11 @@ var Er = { exports: {} };
|
|
|
2372
2372
|
if (0 < a)
|
|
2373
2373
|
return a = 0, u();
|
|
2374
2374
|
}
|
|
2375
|
-
return
|
|
2375
|
+
return P.reject(v);
|
|
2376
2376
|
});
|
|
2377
2377
|
}
|
|
2378
2378
|
var c, l = n.dbReadyResolve, m = null, s = !1;
|
|
2379
|
-
return
|
|
2379
|
+
return P.race([r, (typeof navigator > "u" ? P.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(v) {
|
|
2380
2380
|
function f() {
|
|
2381
2381
|
return indexedDB.databases().finally(v);
|
|
2382
2382
|
}
|
|
@@ -2384,12 +2384,12 @@ var Er = { exports: {} };
|
|
|
2384
2384
|
}).finally(function() {
|
|
2385
2385
|
return clearInterval(c);
|
|
2386
2386
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2387
|
-
return o(), n.onReadyBeingFired = [],
|
|
2387
|
+
return o(), n.onReadyBeingFired = [], P.resolve(wt(function() {
|
|
2388
2388
|
return e.on.ready.fire(e.vip);
|
|
2389
2389
|
})).then(function v() {
|
|
2390
2390
|
if (0 < n.onReadyBeingFired.length) {
|
|
2391
2391
|
var f = n.onReadyBeingFired.reduce(Jn, G);
|
|
2392
|
-
return n.onReadyBeingFired = [],
|
|
2392
|
+
return n.onReadyBeingFired = [], P.resolve(wt(function() {
|
|
2393
2393
|
return f(e.vip);
|
|
2394
2394
|
})).then(v);
|
|
2395
2395
|
}
|
|
@@ -2435,10 +2435,10 @@ var Er = { exports: {} };
|
|
|
2435
2435
|
return r;
|
|
2436
2436
|
}
|
|
2437
2437
|
var la = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2438
|
-
return
|
|
2438
|
+
return A(A({}, e), { table: function(n) {
|
|
2439
2439
|
var t = e.table(n), r = t.schema, a = {}, i = [];
|
|
2440
2440
|
function o(s, v, f) {
|
|
2441
|
-
var h = ln(s), d = a[h] = a[h] || [], p = s == null ? 0 : typeof s == "string" ? 1 : s.length, y = 0 < v, y =
|
|
2441
|
+
var h = ln(s), d = a[h] = a[h] || [], p = s == null ? 0 : typeof s == "string" ? 1 : s.length, y = 0 < v, y = A(A({}, f), { name: y ? "".concat(h, "(virtual-from:").concat(f.name, ")") : f.name, lowLevelIndex: f, isVirtual: y, keyTail: v, keyLength: p, extractKey: mt(s), unique: !y && f.unique });
|
|
2442
2442
|
return d.push(y), y.isPrimaryKey || i.push(y), 1 < p && o(p === 2 ? s[0] : s.slice(0, p - 1), v + 1, f), d.sort(function(g, b) {
|
|
2443
2443
|
return g.keyTail - b.keyTail;
|
|
2444
2444
|
}), y;
|
|
@@ -2450,9 +2450,9 @@ var Er = { exports: {} };
|
|
|
2450
2450
|
}
|
|
2451
2451
|
function m(s) {
|
|
2452
2452
|
var v, f = s.query.index;
|
|
2453
|
-
return f.isVirtual ?
|
|
2453
|
+
return f.isVirtual ? A(A({}, s), { query: { index: f.lowLevelIndex, range: (v = s.query.range, f = f.keyTail, { type: v.type === 1 ? 2 : v.type, lower: Mn(v.lower, v.lowerOpen ? e.MAX_KEY : e.MIN_KEY, f), lowerOpen: !0, upper: Mn(v.upper, v.upperOpen ? e.MIN_KEY : e.MAX_KEY, f), upperOpen: !0 }) } }) : s;
|
|
2454
2454
|
}
|
|
2455
|
-
return
|
|
2455
|
+
return A(A({}, t), { schema: A(A({}, r), { primaryKey: n, indexes: i, getIndexByKeyPath: function(s) {
|
|
2456
2456
|
return (s = a[ln(s)]) && s[0];
|
|
2457
2457
|
} }), count: function(s) {
|
|
2458
2458
|
return t.count(m(s));
|
|
@@ -2480,21 +2480,21 @@ var Er = { exports: {} };
|
|
|
2480
2480
|
} });
|
|
2481
2481
|
} });
|
|
2482
2482
|
} };
|
|
2483
|
-
function
|
|
2483
|
+
function Pt(e, n, t, r) {
|
|
2484
2484
|
return t = t || {}, r = r || "", M(e).forEach(function(a) {
|
|
2485
2485
|
var i, o, u;
|
|
2486
|
-
re(n, a) ? (i = e[a], o = n[a], typeof i == "object" && typeof o == "object" && i && o ? (u = Yn(i)) !== Yn(o) ? t[r + a] = n[a] : u === "Object" ?
|
|
2486
|
+
re(n, a) ? (i = e[a], o = n[a], typeof i == "object" && typeof o == "object" && i && o ? (u = Yn(i)) !== Yn(o) ? t[r + a] = n[a] : u === "Object" ? Pt(i, o, t, r + a + ".") : i !== o && (t[r + a] = n[a]) : i !== o && (t[r + a] = n[a])) : t[r + a] = void 0;
|
|
2487
2487
|
}), M(n).forEach(function(a) {
|
|
2488
2488
|
re(e, a) || (t[r + a] = n[a]);
|
|
2489
2489
|
}), t;
|
|
2490
2490
|
}
|
|
2491
|
-
function
|
|
2491
|
+
function At(e, n) {
|
|
2492
2492
|
return n.type === "delete" ? n.keys : n.keys || n.values.map(e.extractKey);
|
|
2493
2493
|
}
|
|
2494
2494
|
var fa = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2495
|
-
return
|
|
2495
|
+
return A(A({}, e), { table: function(n) {
|
|
2496
2496
|
var t = e.table(n), r = t.schema.primaryKey;
|
|
2497
|
-
return
|
|
2497
|
+
return A(A({}, t), { mutate: function(a) {
|
|
2498
2498
|
var i = K.trans, o = i.table(n).hook, u = o.deleting, c = o.creating, l = o.updating;
|
|
2499
2499
|
switch (a.type) {
|
|
2500
2500
|
case "add":
|
|
@@ -2523,7 +2523,7 @@ var Er = { exports: {} };
|
|
|
2523
2523
|
return t.query({ trans: v, values: !1, query: { index: r, range: f }, limit: h }).then(function(d) {
|
|
2524
2524
|
var p = d.result;
|
|
2525
2525
|
return m({ type: "delete", keys: p, trans: v }).then(function(y) {
|
|
2526
|
-
return 0 < y.numFailures ? Promise.reject(y.failures[0]) : p.length < h ? { failures: [], numFailures: 0, lastResult: void 0 } : s(v,
|
|
2526
|
+
return 0 < y.numFailures ? Promise.reject(y.failures[0]) : p.length < h ? { failures: [], numFailures: 0, lastResult: void 0 } : s(v, A(A({}, f), { lower: p[p.length - 1], lowerOpen: !0 }), h);
|
|
2527
2527
|
});
|
|
2528
2528
|
});
|
|
2529
2529
|
}(a.trans, a.range, 1e4);
|
|
@@ -2531,13 +2531,13 @@ var Er = { exports: {} };
|
|
|
2531
2531
|
}
|
|
2532
2532
|
return t.mutate(a);
|
|
2533
2533
|
function m(s) {
|
|
2534
|
-
var v, f, h, d = K.trans, p = s.keys ||
|
|
2534
|
+
var v, f, h, d = K.trans, p = s.keys || At(r, s);
|
|
2535
2535
|
if (!p)
|
|
2536
2536
|
throw new Error("Keys missing");
|
|
2537
|
-
return (s = s.type === "add" || s.type === "put" ?
|
|
2537
|
+
return (s = s.type === "add" || s.type === "put" ? A(A({}, s), { keys: p }) : A({}, s)).type !== "delete" && (s.values = Y([], s.values, !0)), s.keys && (s.keys = Y([], s.keys, !0)), v = t, h = p, ((f = s).type === "add" ? Promise.resolve([]) : v.getMany({ trans: f.trans, keys: h, cache: "immutable" })).then(function(y) {
|
|
2538
2538
|
var g = p.map(function(b, w) {
|
|
2539
2539
|
var k, O, _, N = y[w], S = { onerror: null, onsuccess: null };
|
|
2540
|
-
return s.type === "delete" ? u.fire.call(S, b, N, d) : s.type === "add" || N === void 0 ? (k = c.fire.call(S, b, s.values[w], d), b == null && k != null && (s.keys[w] = b = k, r.outbound || ae(s.values[w], r.keyPath, b))) : (k =
|
|
2540
|
+
return s.type === "delete" ? u.fire.call(S, b, N, d) : s.type === "add" || N === void 0 ? (k = c.fire.call(S, b, s.values[w], d), b == null && k != null && (s.keys[w] = b = k, r.outbound || ae(s.values[w], r.keyPath, b))) : (k = Pt(N, s.values[w]), (O = l.fire.call(S, k, b, N, d)) && (_ = s.values[w], Object.keys(O).forEach(function(x) {
|
|
2541
2541
|
re(_, x) ? _[x] = O[x] : ae(_, x, O[x]);
|
|
2542
2542
|
}))), S;
|
|
2543
2543
|
});
|
|
@@ -2571,11 +2571,11 @@ var Er = { exports: {} };
|
|
|
2571
2571
|
var ha = { stack: "dbcore", level: -1, create: function(e) {
|
|
2572
2572
|
return { table: function(n) {
|
|
2573
2573
|
var t = e.table(n);
|
|
2574
|
-
return
|
|
2574
|
+
return A(A({}, t), { getMany: function(r) {
|
|
2575
2575
|
if (!r.cache)
|
|
2576
2576
|
return t.getMany(r);
|
|
2577
2577
|
var a = yr(r.keys, r.trans._cache, r.cache === "clone");
|
|
2578
|
-
return a ?
|
|
2578
|
+
return a ? P.resolve(a) : t.getMany(r).then(function(i) {
|
|
2579
2579
|
return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? xe(i) : i }, i;
|
|
2580
2580
|
});
|
|
2581
2581
|
}, mutate: function(r) {
|
|
@@ -2599,18 +2599,18 @@ var Er = { exports: {} };
|
|
|
2599
2599
|
}
|
|
2600
2600
|
var da = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2601
2601
|
var n = e.schema.name, t = new Z(e.MIN_KEY, e.MAX_KEY);
|
|
2602
|
-
return
|
|
2602
|
+
return A(A({}, e), { transaction: function(r, a, i) {
|
|
2603
2603
|
if (K.subscr && a !== "readonly")
|
|
2604
2604
|
throw new T.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(K.querier));
|
|
2605
2605
|
return e.transaction(r, a, i);
|
|
2606
2606
|
}, table: function(r) {
|
|
2607
2607
|
var a = e.table(r), i = a.schema, o = i.primaryKey, s = i.indexes, u = o.extractKey, c = o.outbound, l = o.autoIncrement && s.filter(function(f) {
|
|
2608
2608
|
return f.compound && f.keyPath.includes(o.keyPath);
|
|
2609
|
-
}), m =
|
|
2609
|
+
}), m = A(A({}, a), { mutate: function(f) {
|
|
2610
2610
|
function h(x) {
|
|
2611
2611
|
return x = "idb://".concat(n, "/").concat(r, "/").concat(x), b[x] || (b[x] = new Z());
|
|
2612
2612
|
}
|
|
2613
|
-
var d, p, y, g = f.trans, b = f.mutatedParts || (f.mutatedParts = {}), w = h(""), k = h(":dels"), O = f.type, S = f.type === "deleteRange" ? [f.range] : f.type === "delete" ? [f.keys] : f.values.length < 50 ? [
|
|
2613
|
+
var d, p, y, g = f.trans, b = f.mutatedParts || (f.mutatedParts = {}), w = h(""), k = h(":dels"), O = f.type, S = f.type === "deleteRange" ? [f.range] : f.type === "delete" ? [f.keys] : f.values.length < 50 ? [At(o, f).filter(function(x) {
|
|
2614
2614
|
return x;
|
|
2615
2615
|
}), f.values] : [], _ = S[0], N = S[1], S = f.trans._cache;
|
|
2616
2616
|
return D(_) ? (w.addKeys(_), (S = O === "delete" || _.length === N.length ? yr(_, S) : null) || k.addKeys(_), (S || N) && (d = h, p = S, y = N, i.indexes.forEach(function(x) {
|
|
@@ -2657,7 +2657,7 @@ var Er = { exports: {} };
|
|
|
2657
2657
|
}, b = g(""), w = g(":dels"), d = v[f](h), p = d[0], d = d[1];
|
|
2658
2658
|
if ((f === "query" && p.isPrimaryKey && !h.values ? w : g(p.name || "")).add(d), !p.isPrimaryKey) {
|
|
2659
2659
|
if (f !== "count") {
|
|
2660
|
-
var k = f === "query" && c && h.values && a.query(
|
|
2660
|
+
var k = f === "query" && c && h.values && a.query(A(A({}, h), { values: !1 }));
|
|
2661
2661
|
return a[f].apply(this, arguments).then(function(N) {
|
|
2662
2662
|
if (f === "query") {
|
|
2663
2663
|
if (c && h.values)
|
|
@@ -2694,7 +2694,7 @@ var Er = { exports: {} };
|
|
|
2694
2694
|
if (n.type === "deleteRange")
|
|
2695
2695
|
return null;
|
|
2696
2696
|
var r = n.keys ? n.keys.length : "values" in n && n.values ? n.values.length : 1;
|
|
2697
|
-
return t.numFailures === r ? null : (n =
|
|
2697
|
+
return t.numFailures === r ? null : (n = A({}, n), D(n.keys) && (n.keys = n.keys.filter(function(a, i) {
|
|
2698
2698
|
return !(i in t.failures);
|
|
2699
2699
|
})), "values" in n && D(n.values) && (n.values = n.values.filter(function(a, i) {
|
|
2700
2700
|
return !(i in t.failures);
|
|
@@ -2800,7 +2800,7 @@ var Er = { exports: {} };
|
|
|
2800
2800
|
}
|
|
2801
2801
|
var va = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2802
2802
|
var n = e.schema.name;
|
|
2803
|
-
return
|
|
2803
|
+
return A(A({}, e), { transaction: function(t, r, a) {
|
|
2804
2804
|
var i, o, u = e.transaction(t, r, a);
|
|
2805
2805
|
return r === "readwrite" && (o = (i = new AbortController()).signal, a = function(c) {
|
|
2806
2806
|
return function() {
|
|
@@ -2825,7 +2825,7 @@ var Er = { exports: {} };
|
|
|
2825
2825
|
for (var O, _, N, S = 0, x = (O = k[w]).slice(); S < x.length; S++)
|
|
2826
2826
|
(_ = x[S]).res != null && u.mutatedParts && (c && !_.dirty ? (N = Object.isFrozen(_.res), N = _r(_.res, _.req, d, h, _, N), _.dirty ? (Oe(O, _), _.subscribers.forEach(function(E) {
|
|
2827
2827
|
return l.add(E);
|
|
2828
|
-
})) : N !== _.res && (_.res = N, _.promise =
|
|
2828
|
+
})) : N !== _.res && (_.res = N, _.promise = P.resolve({ result: N }))) : (_.dirty && Oe(O, _), _.subscribers.forEach(function(E) {
|
|
2829
2829
|
return l.add(E);
|
|
2830
2830
|
})));
|
|
2831
2831
|
}
|
|
@@ -2839,21 +2839,21 @@ var Er = { exports: {} };
|
|
|
2839
2839
|
}, u.addEventListener("abort", a(!1), { signal: o }), u.addEventListener("error", a(!1), { signal: o }), u.addEventListener("complete", a(!0), { signal: o })), u;
|
|
2840
2840
|
}, table: function(t) {
|
|
2841
2841
|
var r = e.table(t), a = r.schema.primaryKey;
|
|
2842
|
-
return
|
|
2842
|
+
return A(A({}, r), { mutate: function(i) {
|
|
2843
2843
|
var o = K.trans;
|
|
2844
2844
|
if (a.outbound || o.db._options.cache === "disabled" || o.explicit || o.idbtrans.mode !== "readwrite")
|
|
2845
2845
|
return r.mutate(i);
|
|
2846
2846
|
var u = Ie["idb://".concat(n, "/").concat(t)];
|
|
2847
|
-
return u ? (o = r.mutate(i), i.type !== "add" && i.type !== "put" || !(50 <= i.values.length ||
|
|
2847
|
+
return u ? (o = r.mutate(i), i.type !== "add" && i.type !== "put" || !(50 <= i.values.length || At(a, i).some(function(c) {
|
|
2848
2848
|
return c == null;
|
|
2849
2849
|
})) ? (u.optimisticOps.push(i), i.mutatedParts && Fn(i.mutatedParts), o.then(function(c) {
|
|
2850
2850
|
0 < c.numFailures && (Oe(u.optimisticOps, i), (c = wr(0, i, c)) && u.optimisticOps.push(c), i.mutatedParts && Fn(i.mutatedParts));
|
|
2851
2851
|
}), o.catch(function() {
|
|
2852
2852
|
Oe(u.optimisticOps, i), i.mutatedParts && Fn(i.mutatedParts);
|
|
2853
2853
|
})) : o.then(function(c) {
|
|
2854
|
-
var l = wr(0,
|
|
2854
|
+
var l = wr(0, A(A({}, i), { values: i.values.map(function(m, s) {
|
|
2855
2855
|
var v;
|
|
2856
|
-
return c.failures[s] ? m : (m = (v = a.keyPath) !== null && v !== void 0 && v.includes(".") ? xe(m) :
|
|
2856
|
+
return c.failures[s] ? m : (m = (v = a.keyPath) !== null && v !== void 0 && v.includes(".") ? xe(m) : A({}, m), ae(m, a.keyPath, c.results[s]), m);
|
|
2857
2857
|
}) }), c);
|
|
2858
2858
|
u.optimisticOps.push(l), queueMicrotask(function() {
|
|
2859
2859
|
return i.mutatedParts && Fn(i.mutatedParts);
|
|
@@ -2919,7 +2919,7 @@ var Er = { exports: {} };
|
|
|
2919
2919
|
return t || (t = new this.Version(e), n.push(t), n.sort(ia), t.stores({}), this._state.autoSchema = !1, t);
|
|
2920
2920
|
}, Q.prototype._whenReady = function(e) {
|
|
2921
2921
|
var n = this;
|
|
2922
|
-
return this.idbdb && (this._state.openComplete || K.letThrough || this._vip) ? e() : new
|
|
2922
|
+
return this.idbdb && (this._state.openComplete || K.letThrough || this._vip) ? e() : new P(function(t, r) {
|
|
2923
2923
|
if (n._state.openComplete)
|
|
2924
2924
|
return r(new T.DatabaseClosed(n._state.dbOpenError));
|
|
2925
2925
|
if (!n._state.isBeingOpened) {
|
|
@@ -2954,9 +2954,9 @@ var Er = { exports: {} };
|
|
|
2954
2954
|
}
|
|
2955
2955
|
this.idbdb = null;
|
|
2956
2956
|
}
|
|
2957
|
-
e.isBeingOpened || (e.dbReadyPromise = new
|
|
2957
|
+
e.isBeingOpened || (e.dbReadyPromise = new P(function(t) {
|
|
2958
2958
|
e.dbReadyResolve = t;
|
|
2959
|
-
}), e.openCanceller = new
|
|
2959
|
+
}), e.openCanceller = new P(function(t, r) {
|
|
2960
2960
|
e.cancelOpen = r;
|
|
2961
2961
|
}));
|
|
2962
2962
|
}, Q.prototype.close = function(t) {
|
|
@@ -2966,7 +2966,7 @@ var Er = { exports: {} };
|
|
|
2966
2966
|
var n = this;
|
|
2967
2967
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2968
2968
|
var t = 0 < arguments.length && typeof arguments[0] != "object", r = this._state;
|
|
2969
|
-
return new
|
|
2969
|
+
return new P(function(a, i) {
|
|
2970
2970
|
function o() {
|
|
2971
2971
|
n.close(e);
|
|
2972
2972
|
var u = n._deps.indexedDB.deleteDatabase(n.name);
|
|
@@ -3042,7 +3042,7 @@ var Er = { exports: {} };
|
|
|
3042
3042
|
}) : H(l);
|
|
3043
3043
|
}
|
|
3044
3044
|
var c = (function l(m, s, v, f, h) {
|
|
3045
|
-
return
|
|
3045
|
+
return P.resolve().then(function() {
|
|
3046
3046
|
var d = K.transless || K, p = m._createTransaction(s, v, m._dbSchema, f);
|
|
3047
3047
|
if (p.explicit = !0, d = { trans: p, transless: d }, f)
|
|
3048
3048
|
p.idbtrans = f.idbtrans;
|
|
@@ -3055,10 +3055,10 @@ var Er = { exports: {} };
|
|
|
3055
3055
|
})) : H(b);
|
|
3056
3056
|
}
|
|
3057
3057
|
var y, g = Qn(h);
|
|
3058
|
-
return g && Ge(), d =
|
|
3058
|
+
return g && Ge(), d = P.follow(function() {
|
|
3059
3059
|
var b;
|
|
3060
3060
|
(y = h.call(p, p)) && (g ? (b = be.bind(null, null), y.then(b, b)) : typeof y.next == "function" && typeof y.throw == "function" && (y = St(y)));
|
|
3061
|
-
}, d), (y && typeof y.then == "function" ?
|
|
3061
|
+
}, d), (y && typeof y.then == "function" ? P.resolve(y).then(function(b) {
|
|
3062
3062
|
return p.active ? b : H(new T.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3063
3063
|
}) : d.then(function() {
|
|
3064
3064
|
return y;
|
|
@@ -3083,11 +3083,11 @@ var Er = { exports: {} };
|
|
|
3083
3083
|
var t = this;
|
|
3084
3084
|
this._middlewares = {}, this.verno = 0;
|
|
3085
3085
|
var r = Q.dependencies;
|
|
3086
|
-
this._options = n =
|
|
3086
|
+
this._options = n = A({ addons: Q.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, n), this._deps = { indexedDB: n.indexedDB, IDBKeyRange: n.IDBKeyRange }, r = n.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3087
3087
|
var a, i, o, u, c, l = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: G, dbReadyPromise: null, cancelOpen: G, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: n.autoOpen };
|
|
3088
|
-
l.dbReadyPromise = new
|
|
3088
|
+
l.dbReadyPromise = new P(function(s) {
|
|
3089
3089
|
l.dbReadyResolve = s;
|
|
3090
|
-
}), l.openCanceller = new
|
|
3090
|
+
}), l.openCanceller = new P(function(s, v) {
|
|
3091
3091
|
l.cancelOpen = v;
|
|
3092
3092
|
}), this._state = l, this.name = e, this.on = an(this, "populate", "blocked", "versionchange", "close", { ready: [Jn, G] }), this.once = function(s, v) {
|
|
3093
3093
|
var f = function() {
|
|
@@ -3100,7 +3100,7 @@ var Er = { exports: {} };
|
|
|
3100
3100
|
return function(v, f) {
|
|
3101
3101
|
Q.vip(function() {
|
|
3102
3102
|
var h, d = t._state;
|
|
3103
|
-
d.openComplete ? (d.dbOpenError ||
|
|
3103
|
+
d.openComplete ? (d.dbOpenError || P.resolve().then(v), f && s(v)) : d.onReadyBeingFired ? (d.onReadyBeingFired.push(v), f && s(v)) : (s(v), h = t, f || s(function p() {
|
|
3104
3104
|
h.on.ready.unsubscribe(v), h.on.ready.unsubscribe(p);
|
|
3105
3105
|
}));
|
|
3106
3106
|
});
|
|
@@ -3124,7 +3124,7 @@ var Er = { exports: {} };
|
|
|
3124
3124
|
y = (y = f[y]) === null || y === void 0 ? void 0 : y.yProps, y && (v = v.concat(y.map(function(g) {
|
|
3125
3125
|
return g.updatesTable;
|
|
3126
3126
|
})));
|
|
3127
|
-
}), this.db = o, this.mode = s, this.storeNames = v, this.schema = f, this.chromeTransactionDurability = h, this.idbtrans = null, this.on = an(this, "complete", "error", "abort"), this.parent = d || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new
|
|
3127
|
+
}), this.db = o, this.mode = s, this.storeNames = v, this.schema = f, this.chromeTransactionDurability = h, this.idbtrans = null, this.on = an(this, "complete", "error", "abort"), this.parent = d || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new P(function(y, g) {
|
|
3128
3128
|
p._resolve = y, p._reject = g;
|
|
3129
3129
|
}), this._completion.then(function() {
|
|
3130
3130
|
p.active = !1, p.on.complete.fire();
|
|
@@ -3242,7 +3242,7 @@ var Er = { exports: {} };
|
|
|
3242
3242
|
Ne = n;
|
|
3243
3243
|
}
|
|
3244
3244
|
}
|
|
3245
|
-
Be(De,
|
|
3245
|
+
Be(De, A(A({}, yn), { delete: function(e) {
|
|
3246
3246
|
return new De(e, { addons: [] }).delete();
|
|
3247
3247
|
}, exists: function(e) {
|
|
3248
3248
|
return new De(e, { addons: [] }).open().then(function(n) {
|
|
@@ -3273,7 +3273,7 @@ var Er = { exports: {} };
|
|
|
3273
3273
|
return function() {
|
|
3274
3274
|
try {
|
|
3275
3275
|
var n = St(e.apply(this, arguments));
|
|
3276
|
-
return n && typeof n.then == "function" ? n :
|
|
3276
|
+
return n && typeof n.then == "function" ? n : P.resolve(n);
|
|
3277
3277
|
} catch (t) {
|
|
3278
3278
|
return H(t);
|
|
3279
3279
|
}
|
|
@@ -3281,15 +3281,15 @@ var Er = { exports: {} };
|
|
|
3281
3281
|
}, spawn: function(e, n, t) {
|
|
3282
3282
|
try {
|
|
3283
3283
|
var r = St(e.apply(t, n || []));
|
|
3284
|
-
return r && typeof r.then == "function" ? r :
|
|
3284
|
+
return r && typeof r.then == "function" ? r : P.resolve(r);
|
|
3285
3285
|
} catch (a) {
|
|
3286
3286
|
return H(a);
|
|
3287
3287
|
}
|
|
3288
3288
|
}, currentTransaction: { get: function() {
|
|
3289
3289
|
return K.trans || null;
|
|
3290
3290
|
} }, waitFor: function(e, n) {
|
|
3291
|
-
return n =
|
|
3292
|
-
}, Promise:
|
|
3291
|
+
return n = P.resolve(typeof e == "function" ? De.ignoreTransaction(e) : e).timeout(n || 6e4), K.trans ? K.trans.waitFor(n) : n;
|
|
3292
|
+
}, Promise: P, debug: { get: function() {
|
|
3293
3293
|
return se;
|
|
3294
3294
|
}, set: function(e) {
|
|
3295
3295
|
Gt(e);
|
|
@@ -3297,7 +3297,7 @@ var Er = { exports: {} };
|
|
|
3297
3297
|
typeof n == "string" ? ae(e, n, void 0) : "length" in n && [].map.call(n, function(t) {
|
|
3298
3298
|
ae(e, t, void 0);
|
|
3299
3299
|
});
|
|
3300
|
-
}, shallowClone: Ft, deepClone: xe, getObjectDiff:
|
|
3300
|
+
}, shallowClone: Ft, deepClone: xe, getObjectDiff: Pt, cmp: L, asap: Rt, minKey: -1 / 0, addons: [], connections: Ve, errnames: Xn, dependencies: Un, cache: Ie, semVer: "4.2.1", version: "4.2.1".split(".").map(function(e) {
|
|
3301
3301
|
return parseInt(e);
|
|
3302
3302
|
}).reduce(function(e, n, t) {
|
|
3303
3303
|
return e + n / Math.pow(10, 2 * t);
|
|
@@ -3322,11 +3322,11 @@ var Er = { exports: {} };
|
|
|
3322
3322
|
}
|
|
3323
3323
|
}), addEventListener("pageshow", function(e) {
|
|
3324
3324
|
!pe.disableBfCache && e.persisted && (se && console.debug("Dexie: handling persisted pageshow"), xr(), Ct({ all: new Z(-1 / 0, [[]]) }));
|
|
3325
|
-
})),
|
|
3325
|
+
})), P.rejectionMapper = function(e, n) {
|
|
3326
3326
|
return !e || e instanceof Me || e instanceof TypeError || e instanceof SyntaxError || !e.name || !zt[e.name] ? e : (n = new zt[e.name](n || e.message, e), "stack" in e && ve(n, "stack", { get: function() {
|
|
3327
3327
|
return this.inner.stack;
|
|
3328
3328
|
} }), n);
|
|
3329
|
-
}, Gt(se),
|
|
3329
|
+
}, Gt(se), A(pe, Object.freeze({ __proto__: null, Dexie: pe, liveQuery: Nr, Entity: Jt, cmp: L, PropModification: rn, replacePrefix: function(e, n) {
|
|
3330
3330
|
return new rn({ replacePrefix: [e, n] });
|
|
3331
3331
|
}, add: function(e) {
|
|
3332
3332
|
return new rn({ add: e });
|
|
@@ -3336,7 +3336,7 @@ var Er = { exports: {} };
|
|
|
3336
3336
|
});
|
|
3337
3337
|
})(Er);
|
|
3338
3338
|
var _a = Er.exports;
|
|
3339
|
-
const Tt = /* @__PURE__ */
|
|
3339
|
+
const Tt = /* @__PURE__ */ Ar(_a), Sr = Symbol.for("Dexie"), It = globalThis[Sr] || (globalThis[Sr] = Tt);
|
|
3340
3340
|
if (Tt.semVer !== It.semVer)
|
|
3341
3341
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Tt.semVer} and ${It.semVer}`);
|
|
3342
3342
|
const ka = {
|
|
@@ -4107,7 +4107,7 @@ var xa = class Gn {
|
|
|
4107
4107
|
return dn.hasOwnProperty(j);
|
|
4108
4108
|
}
|
|
4109
4109
|
};
|
|
4110
|
-
const Oa = /* @__PURE__ */
|
|
4110
|
+
const Oa = /* @__PURE__ */ Ar(xa), mn = new It("translations"), Sa = Oa.getAllCodes();
|
|
4111
4111
|
mn.version(2).stores({
|
|
4112
4112
|
kwarg: "&key, value, screenId",
|
|
4113
4113
|
...Sa.reduce(
|
|
@@ -4116,27 +4116,27 @@ mn.version(2).stores({
|
|
|
4116
4116
|
),
|
|
4117
4117
|
words: "&text, screenId, updatedAt"
|
|
4118
4118
|
});
|
|
4119
|
-
const
|
|
4119
|
+
const Pr = (C, j) => {
|
|
4120
4120
|
ba.remove(C, j);
|
|
4121
|
-
},
|
|
4121
|
+
}, Pa = (C) => {
|
|
4122
4122
|
const j = Array.isArray(C) ? C : [C], R = /* @__PURE__ */ new Date();
|
|
4123
4123
|
R.setHours(R.getHours() - 1);
|
|
4124
|
-
const { host:
|
|
4124
|
+
const { host: A } = window.location, Y = A.includes("localhost") ? "local" : A.includes("test") || A.includes("staging") ? "staging" : "production";
|
|
4125
4125
|
j.forEach((U) => {
|
|
4126
4126
|
var M;
|
|
4127
|
-
Y === "local" ?
|
|
4127
|
+
Y === "local" ? Pr(U, {
|
|
4128
4128
|
domain: "localhost",
|
|
4129
4129
|
expires: R,
|
|
4130
4130
|
path: "/"
|
|
4131
|
-
}) :
|
|
4131
|
+
}) : Pr(U, {
|
|
4132
4132
|
domain: window.location.href.includes("localhost") ? "localhost" : (M = window.location.hostname) != null && M.includes("ca") ? ".learngual.ca" : ".learngual.com",
|
|
4133
4133
|
expires: R,
|
|
4134
4134
|
path: "/"
|
|
4135
4135
|
});
|
|
4136
4136
|
});
|
|
4137
|
-
}, Ra =
|
|
4137
|
+
}, Ra = Pa;
|
|
4138
4138
|
window.translationCache || (window.translationCache = {});
|
|
4139
|
-
const
|
|
4139
|
+
const Aa = 60 * 60 * 1e3, Ea = "https://learngual-bucket.sfo3.digitaloceanspaces.com/media/media/";
|
|
4140
4140
|
async function Ka(C, j, R) {
|
|
4141
4141
|
try {
|
|
4142
4142
|
wa({
|
|
@@ -4152,8 +4152,8 @@ async function Ka(C, j, R) {
|
|
|
4152
4152
|
},
|
|
4153
4153
|
authRequired: !1
|
|
4154
4154
|
});
|
|
4155
|
-
} catch (
|
|
4156
|
-
console.warn("Translation request failed:",
|
|
4155
|
+
} catch (A) {
|
|
4156
|
+
console.warn("Translation request failed:", A);
|
|
4157
4157
|
}
|
|
4158
4158
|
}
|
|
4159
4159
|
async function Ca() {
|
|
@@ -4166,12 +4166,12 @@ async function Ca() {
|
|
|
4166
4166
|
);
|
|
4167
4167
|
if (!R.ok)
|
|
4168
4168
|
throw new Error(`Failed to fetch translations: ${R.status}`);
|
|
4169
|
-
const
|
|
4169
|
+
const A = await R.json();
|
|
4170
4170
|
return window.translationCache.master = {
|
|
4171
|
-
data:
|
|
4171
|
+
data: A,
|
|
4172
4172
|
timestamp: C,
|
|
4173
|
-
expires: C +
|
|
4174
|
-
}, console.log(
|
|
4173
|
+
expires: C + Aa
|
|
4174
|
+
}, console.log(A, "master"), A;
|
|
4175
4175
|
} catch (R) {
|
|
4176
4176
|
if (console.error("Failed to fetch master translations:", R), j && j.data)
|
|
4177
4177
|
return j.data;
|
|
@@ -4179,31 +4179,31 @@ async function Ca() {
|
|
|
4179
4179
|
}
|
|
4180
4180
|
}
|
|
4181
4181
|
function ja(C, j, R) {
|
|
4182
|
-
const
|
|
4182
|
+
const A = {}, Y = R.toUpperCase();
|
|
4183
4183
|
return j.forEach((U) => {
|
|
4184
4184
|
if (C[U] && C[U][Y]) {
|
|
4185
4185
|
const M = C[U][Y];
|
|
4186
|
-
|
|
4186
|
+
A[U] = M.trim() || U;
|
|
4187
4187
|
} else
|
|
4188
|
-
|
|
4189
|
-
}),
|
|
4188
|
+
A[U] = U;
|
|
4189
|
+
}), A;
|
|
4190
4190
|
}
|
|
4191
4191
|
async function Ta(C, j, R) {
|
|
4192
4192
|
try {
|
|
4193
|
-
const
|
|
4193
|
+
const A = Object.keys(C).map((Y) => ({
|
|
4194
4194
|
key: Y,
|
|
4195
4195
|
value: C[Y],
|
|
4196
4196
|
screenId: j,
|
|
4197
4197
|
updatedAt: (/* @__PURE__ */ new Date()).toDateString()
|
|
4198
4198
|
}));
|
|
4199
|
-
await mn[R].bulkPut(
|
|
4200
|
-
} catch (
|
|
4201
|
-
console.error("Failed to cache translations:",
|
|
4199
|
+
await mn[R].bulkPut(A);
|
|
4200
|
+
} catch (A) {
|
|
4201
|
+
console.error("Failed to cache translations:", A);
|
|
4202
4202
|
}
|
|
4203
4203
|
}
|
|
4204
4204
|
async function Ia(C, j) {
|
|
4205
4205
|
try {
|
|
4206
|
-
return (await mn[j].where({ screenId: C }).toArray()).reduce((
|
|
4206
|
+
return (await mn[j].where({ screenId: C }).toArray()).reduce((A, Y) => (A[Y.key] = Y.value, A), {});
|
|
4207
4207
|
} catch (R) {
|
|
4208
4208
|
return console.error("Failed to get cached translations:", R), {};
|
|
4209
4209
|
}
|
|
@@ -4214,24 +4214,24 @@ async function Fa(C = "ko") {
|
|
|
4214
4214
|
return M();
|
|
4215
4215
|
window.addEventListener("load", M);
|
|
4216
4216
|
});
|
|
4217
|
-
const j = btoa(window.location.href),
|
|
4218
|
-
Ka(
|
|
4217
|
+
const j = btoa(window.location.href), A = (await mn.words.where({ screenId: j }).toArray()).map((M) => M.text), U = (await mn.kwarg.where({ screenId: j }).toArray()).reduce((M, D) => ({ ...M, [D.key]: D.value }), {});
|
|
4218
|
+
Ka(A, U, C);
|
|
4219
4219
|
try {
|
|
4220
4220
|
const M = await Ca(), D = ja(
|
|
4221
4221
|
M,
|
|
4222
|
-
|
|
4222
|
+
A,
|
|
4223
4223
|
C
|
|
4224
4224
|
);
|
|
4225
4225
|
return await Ta(D, j, C), D;
|
|
4226
4226
|
} catch (M) {
|
|
4227
4227
|
console.error("Failed to load translations:", M);
|
|
4228
4228
|
const D = await Ia(j, C);
|
|
4229
|
-
return Object.keys(D).length > 0 ? D :
|
|
4229
|
+
return Object.keys(D).length > 0 ? D : A.reduce((W, fe) => (W[fe] = fe, W), {});
|
|
4230
4230
|
}
|
|
4231
4231
|
}
|
|
4232
4232
|
function Ma(C) {
|
|
4233
4233
|
const j = /\{([^}]+)\}/g, R = C.match(j);
|
|
4234
|
-
return R ? R.map((
|
|
4234
|
+
return R ? R.map((A) => A.slice(1, -1)) : [];
|
|
4235
4235
|
}
|
|
4236
4236
|
export {
|
|
4237
4237
|
wa as axiosConfig,
|