buzzcasting-storage 3.9.12 → 3.9.13
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/buzzcasting-storage.esm.js +123 -123
- package/package.json +2 -2
|
@@ -117,10 +117,10 @@ function Ia(p) {
|
|
|
117
117
|
}
|
|
118
118
|
function Ot(p, n) {
|
|
119
119
|
var o;
|
|
120
|
-
let l, E, O, C,
|
|
120
|
+
let l, E, O, C, B;
|
|
121
121
|
switch (p.moderation) {
|
|
122
122
|
case en.BEFORE:
|
|
123
|
-
l = /* @__PURE__ */ new Date(), E = (o = p.beforeTime) == null ? void 0 : o.split(":"), O = Number.parseInt(E ? E[0] : "00"), C = Number.parseInt(E ? E[1] : "00"),
|
|
123
|
+
l = /* @__PURE__ */ new Date(), E = (o = p.beforeTime) == null ? void 0 : o.split(":"), O = Number.parseInt(E ? E[0] : "00"), C = Number.parseInt(E ? E[1] : "00"), B = Number.parseInt(E ? E[2] : "00"), n.before = l.setHours(O, C, B, 0) / 1e3, n.period || (n.period = l.getDay() === 1 ? 72 : 24);
|
|
124
124
|
break;
|
|
125
125
|
case en.DELAYED:
|
|
126
126
|
p.delay && p.delay > 0 && (n.delay = `${p.delay}`);
|
|
@@ -133,7 +133,7 @@ function Ot(p, n) {
|
|
|
133
133
|
}
|
|
134
134
|
return n;
|
|
135
135
|
}
|
|
136
|
-
const xa = "3.9.
|
|
136
|
+
const xa = "3.9.12";
|
|
137
137
|
class ka {
|
|
138
138
|
options;
|
|
139
139
|
url;
|
|
@@ -189,11 +189,11 @@ class ka {
|
|
|
189
189
|
]), K(4, [n.type, E]), await fetch(
|
|
190
190
|
[this.url, "api", o, n.type].join("/") + O,
|
|
191
191
|
{ ...l, method: "get" }
|
|
192
|
-
).then(async (
|
|
193
|
-
if (!
|
|
194
|
-
throw new Error(`${
|
|
195
|
-
return
|
|
196
|
-
}).then((
|
|
192
|
+
).then(async (B) => {
|
|
193
|
+
if (!B.ok)
|
|
194
|
+
throw new Error(`${B.status}`);
|
|
195
|
+
return B;
|
|
196
|
+
}).then((B) => B.json()).then((B) => (B.query = n, B)).catch((B) => ({ success: !1, message: `${B}`, data: null, query: n }));
|
|
197
197
|
}
|
|
198
198
|
async hideMessage(n) {
|
|
199
199
|
const { version: o } = this.options, l = this.headers(), E = "?action=visible";
|
|
@@ -216,8 +216,8 @@ class ka {
|
|
|
216
216
|
}
|
|
217
217
|
async hideLabels(n) {
|
|
218
218
|
const { version: o } = this.options, l = this.formHeaders(), E = new URLSearchParams(), O = n.labels || [];
|
|
219
|
-
for (const [C,
|
|
220
|
-
E.append(`custom_filters[${C}]`,
|
|
219
|
+
for (const [C, B] of O.entries())
|
|
220
|
+
E.append(`custom_filters[${C}]`, B);
|
|
221
221
|
return console.info(
|
|
222
222
|
"%capi%c %cput",
|
|
223
223
|
c.API,
|
|
@@ -432,7 +432,7 @@ function Ma() {
|
|
|
432
432
|
for (var a, s = 0, i = t.length; s < i; s++) !a && s in t || ((a = a || Array.prototype.slice.call(t, 0, s))[s] = t[s]);
|
|
433
433
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
434
434
|
}
|
|
435
|
-
var O = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca, C = Object.keys,
|
|
435
|
+
var O = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca, C = Object.keys, B = Array.isArray;
|
|
436
436
|
function te(e, t) {
|
|
437
437
|
return typeof t != "object" || C(t).forEach(function(r) {
|
|
438
438
|
e[r] = t[r];
|
|
@@ -492,7 +492,7 @@ function Ma() {
|
|
|
492
492
|
for (var a = 0, s = t.length; a < s; ++a) ue(e, t[a], r[a]);
|
|
493
493
|
} else {
|
|
494
494
|
var i, u, d = t.indexOf(".");
|
|
495
|
-
d !== -1 ? (i = t.substr(0, d), (u = t.substr(d + 1)) === "" ? r === void 0 ?
|
|
495
|
+
d !== -1 ? (i = t.substr(0, d), (u = t.substr(d + 1)) === "" ? r === void 0 ? B(e) && !isNaN(parseInt(i)) ? e.splice(i, 1) : delete e[i] : e[i] = r : ue(d = !(d = e[i]) || !ie(e, i) ? e[i] = {} : d, u, r)) : r === void 0 ? B(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = r;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
function Qn(e) {
|
|
@@ -518,7 +518,7 @@ function Ma() {
|
|
|
518
518
|
if (!r || typeof r != "object") return r;
|
|
519
519
|
var a = it.get(r);
|
|
520
520
|
if (a) return a;
|
|
521
|
-
if (
|
|
521
|
+
if (B(r)) {
|
|
522
522
|
a = [], it.set(r, a);
|
|
523
523
|
for (var s = 0, i = r.length; s < i; ++s) a.push(t(r[s]));
|
|
524
524
|
} else if (Jn.has(r.constructor)) a = r;
|
|
@@ -546,7 +546,7 @@ function Ma() {
|
|
|
546
546
|
function Ee(e) {
|
|
547
547
|
var t, r, a, s;
|
|
548
548
|
if (arguments.length === 1) {
|
|
549
|
-
if (
|
|
549
|
+
if (B(e)) return e.slice();
|
|
550
550
|
if (this === Qe && typeof e == "string") return [e];
|
|
551
551
|
if (s = Vr(e)) {
|
|
552
552
|
for (r = []; !(a = s.next()).done; ) r.push(a.value);
|
|
@@ -670,13 +670,13 @@ function Ma() {
|
|
|
670
670
|
if (typeof crypto > "u" || !crypto.subtle) return [e, ge(e), e];
|
|
671
671
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
672
672
|
return [t, ge(t), e];
|
|
673
|
-
}(), lt = Ke[0], fe = Ke[1], Ke = Ke[2], fe = fe && fe.then,
|
|
673
|
+
}(), lt = Ke[0], fe = Ke[1], Ke = Ke[2], fe = fe && fe.then, Be = lt && lt.constructor, cn = !!Ke, dt = function(e, t) {
|
|
674
674
|
ft.push([e, t]), Nt && (queueMicrotask(na), Nt = !1);
|
|
675
|
-
}, un = !0, Nt = !0,
|
|
675
|
+
}, un = !0, Nt = !0, Ge = [], Rt = [], ln = ct, Pe = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Q, pgp: !1, env: {}, finalize: Q }, G = Pe, ft = [], Le = 0, Tt = [];
|
|
676
676
|
function j(e) {
|
|
677
677
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
678
678
|
this._listeners = [], this._lib = !1;
|
|
679
|
-
var t = this._PSD =
|
|
679
|
+
var t = this._PSD = G;
|
|
680
680
|
if (typeof e != "function") {
|
|
681
681
|
if (e !== ut) throw new TypeError("Not a function");
|
|
682
682
|
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && fn(this, this._value));
|
|
@@ -698,9 +698,9 @@ function Ma() {
|
|
|
698
698
|
}(this, e);
|
|
699
699
|
}
|
|
700
700
|
var dn = { get: function() {
|
|
701
|
-
var e =
|
|
701
|
+
var e = G, t = Ct;
|
|
702
702
|
function r(a, s) {
|
|
703
|
-
var i = this, u = !e.global && (e !==
|
|
703
|
+
var i = this, u = !e.global && (e !== G || t !== Ct), d = u && !Ne(), h = new j(function(m, v) {
|
|
704
704
|
hn(i, new nr(sr(a, e, u, d), sr(s, e, u, d), m, v, e));
|
|
705
705
|
});
|
|
706
706
|
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
@@ -716,9 +716,9 @@ function Ma() {
|
|
|
716
716
|
}
|
|
717
717
|
function fn(e, t) {
|
|
718
718
|
var r, a;
|
|
719
|
-
Rt.push(t), e._state === null && (r = e._lib && Ze(), t = ln(t), e._state = !1, e._value = t, a = e,
|
|
719
|
+
Rt.push(t), e._state === null && (r = e._lib && Ze(), t = ln(t), e._state = !1, e._value = t, a = e, Ge.some(function(s) {
|
|
720
720
|
return s._value === a._value;
|
|
721
|
-
}) ||
|
|
721
|
+
}) || Ge.push(a), rr(e), r && qe());
|
|
722
722
|
}
|
|
723
723
|
function rr(e) {
|
|
724
724
|
var t = e._listeners;
|
|
@@ -742,7 +742,7 @@ function Ma() {
|
|
|
742
742
|
!t._state && Rt.length && (Rt = []), a = pe && t._consoleTask ? t._consoleTask.run(function() {
|
|
743
743
|
return e(s);
|
|
744
744
|
}) : e(s), t._state || Rt.indexOf(s) !== -1 || function(i) {
|
|
745
|
-
for (var u =
|
|
745
|
+
for (var u = Ge.length; u; ) if (Ge[--u]._value === i._value) return Ge.splice(u, 1);
|
|
746
746
|
}(t), r.resolve(a);
|
|
747
747
|
} catch (i) {
|
|
748
748
|
r.reject(i);
|
|
@@ -770,8 +770,8 @@ function Ma() {
|
|
|
770
770
|
Nt = un = !0;
|
|
771
771
|
}
|
|
772
772
|
function gn() {
|
|
773
|
-
var e =
|
|
774
|
-
|
|
773
|
+
var e = Ge;
|
|
774
|
+
Ge = [], e.forEach(function(a) {
|
|
775
775
|
a._PSD.onunhandled.call(null, a._value, a);
|
|
776
776
|
});
|
|
777
777
|
for (var t = Tt.slice(0), r = t.length; r; ) t[--r]();
|
|
@@ -780,9 +780,9 @@ function Ma() {
|
|
|
780
780
|
return new j(ut, !1, e);
|
|
781
781
|
}
|
|
782
782
|
function Z(e, t) {
|
|
783
|
-
var r =
|
|
783
|
+
var r = G;
|
|
784
784
|
return function() {
|
|
785
|
-
var a = Ze(), s =
|
|
785
|
+
var a = Ze(), s = G;
|
|
786
786
|
try {
|
|
787
787
|
return Re(r, !0), e.apply(this, arguments);
|
|
788
788
|
} catch (i) {
|
|
@@ -793,7 +793,7 @@ function Ma() {
|
|
|
793
793
|
};
|
|
794
794
|
}
|
|
795
795
|
be(j.prototype, { then: dn, _then: function(e, t) {
|
|
796
|
-
hn(this, new nr(null, null, e, t,
|
|
796
|
+
hn(this, new nr(null, null, e, t, G));
|
|
797
797
|
}, catch: function(e) {
|
|
798
798
|
if (arguments.length === 1) return this.then(null, e);
|
|
799
799
|
var t = e, r = arguments[1];
|
|
@@ -843,9 +843,9 @@ function Ma() {
|
|
|
843
843
|
});
|
|
844
844
|
});
|
|
845
845
|
}, PSD: { get: function() {
|
|
846
|
-
return
|
|
846
|
+
return G;
|
|
847
847
|
}, set: function(e) {
|
|
848
|
-
return
|
|
848
|
+
return G = e;
|
|
849
849
|
} }, totalEchoes: { get: function() {
|
|
850
850
|
return Ct;
|
|
851
851
|
} }, newPSD: De, usePSD: We, scheduler: { get: function() {
|
|
@@ -859,7 +859,7 @@ function Ma() {
|
|
|
859
859
|
} }, follow: function(e, t) {
|
|
860
860
|
return new j(function(r, a) {
|
|
861
861
|
return De(function(s, i) {
|
|
862
|
-
var u =
|
|
862
|
+
var u = G;
|
|
863
863
|
u.unhandleds = [], u.onunhandled = i, u.finalize = Me(function() {
|
|
864
864
|
var d, h = this;
|
|
865
865
|
d = function() {
|
|
@@ -872,7 +872,7 @@ function Ma() {
|
|
|
872
872
|
}, u.finalize), e();
|
|
873
873
|
}, t, r, a);
|
|
874
874
|
});
|
|
875
|
-
} }),
|
|
875
|
+
} }), Be && (Be.allSettled && Ae(j, "allSettled", function() {
|
|
876
876
|
var e = Ee.apply(null, arguments).map($t);
|
|
877
877
|
return new j(function(t) {
|
|
878
878
|
e.length === 0 && t([]);
|
|
@@ -887,7 +887,7 @@ function Ma() {
|
|
|
887
887
|
});
|
|
888
888
|
});
|
|
889
889
|
});
|
|
890
|
-
}),
|
|
890
|
+
}), Be.any && typeof AggregateError < "u" && Ae(j, "any", function() {
|
|
891
891
|
var e = Ee.apply(null, arguments).map($t);
|
|
892
892
|
return new j(function(t, r) {
|
|
893
893
|
e.length === 0 && r(new AggregateError([]));
|
|
@@ -900,10 +900,10 @@ function Ma() {
|
|
|
900
900
|
});
|
|
901
901
|
});
|
|
902
902
|
});
|
|
903
|
-
}),
|
|
903
|
+
}), Be.withResolvers && (j.withResolvers = Be.withResolvers));
|
|
904
904
|
var ne = { awaits: 0, echoes: 0, id: 0 }, ra = 0, xt = [], kt = 0, Ct = 0, aa = 0;
|
|
905
905
|
function De(e, t, r, a) {
|
|
906
|
-
var s =
|
|
906
|
+
var s = G, i = Object.create(s);
|
|
907
907
|
return i.parent = s, i.ref = 0, i.global = !1, i.id = ++aa, Pe.env, i.env = cn ? { Promise: j, PromiseProp: { value: j, configurable: !0, writable: !0 }, all: j.all, race: j.race, allSettled: j.allSettled, any: j.any, resolve: j.resolve, reject: j.reject } : {}, t && te(i, t), ++s.ref, i.finalize = function() {
|
|
908
908
|
--this.parent.ref || this.parent.finalize();
|
|
909
909
|
}, a = We(i, e, r, a), i.ref === 0 && i.finalize(), a;
|
|
@@ -915,7 +915,7 @@ function Ma() {
|
|
|
915
915
|
return !!ne.awaits && (--ne.awaits == 0 && (ne.id = 0), ne.echoes = ne.awaits * tr, !0);
|
|
916
916
|
}
|
|
917
917
|
function $t(e) {
|
|
918
|
-
return ne.echoes && e && e.constructor ===
|
|
918
|
+
return ne.echoes && e && e.constructor === Be ? (et(), e.then(function(t) {
|
|
919
919
|
return Ne(), t;
|
|
920
920
|
}, function(t) {
|
|
921
921
|
return Ne(), q(t);
|
|
@@ -926,17 +926,17 @@ function Ma() {
|
|
|
926
926
|
xt.pop(), Re(e, !1);
|
|
927
927
|
}
|
|
928
928
|
function Re(e, t) {
|
|
929
|
-
var r, a =
|
|
930
|
-
(t ? !ne.echoes || kt++ && e ===
|
|
931
|
-
++Ct, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), xt.push(
|
|
932
|
-
}.bind(null, e) : sa), e !==
|
|
929
|
+
var r, a = G;
|
|
930
|
+
(t ? !ne.echoes || kt++ && e === G : !kt || --kt && e === G) || queueMicrotask(t ? function(s) {
|
|
931
|
+
++Ct, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), xt.push(G), Re(s, !0);
|
|
932
|
+
}.bind(null, e) : sa), e !== G && (G = e, a === Pe && (Pe.env = ar()), cn && (r = Pe.env.Promise, t = e.env, (a.global || e.global) && (Object.defineProperty(O, "Promise", t.PromiseProp), r.all = t.all, r.race = t.race, r.resolve = t.resolve, r.reject = t.reject, t.allSettled && (r.allSettled = t.allSettled), t.any && (r.any = t.any))));
|
|
933
933
|
}
|
|
934
934
|
function ar() {
|
|
935
935
|
var e = O.Promise;
|
|
936
936
|
return cn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(O, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
937
937
|
}
|
|
938
938
|
function We(e, t, r, a, s) {
|
|
939
|
-
var i =
|
|
939
|
+
var i = G;
|
|
940
940
|
try {
|
|
941
941
|
return Re(e, !0), t(r, a, s);
|
|
942
942
|
} finally {
|
|
@@ -945,7 +945,7 @@ function Ma() {
|
|
|
945
945
|
}
|
|
946
946
|
function sr(e, t, r, a) {
|
|
947
947
|
return typeof e != "function" ? e : function() {
|
|
948
|
-
var s =
|
|
948
|
+
var s = G;
|
|
949
949
|
r && et(), Re(t, !0);
|
|
950
950
|
try {
|
|
951
951
|
return e.apply(this, arguments);
|
|
@@ -955,7 +955,7 @@ function Ma() {
|
|
|
955
955
|
};
|
|
956
956
|
}
|
|
957
957
|
function pn(e) {
|
|
958
|
-
Promise ===
|
|
958
|
+
Promise === Be && ne.echoes === 0 ? kt === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
959
959
|
}
|
|
960
960
|
("" + fe).indexOf("[native code]") === -1 && (et = Ne = Q);
|
|
961
961
|
var q = j.reject, Fe = "", we = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", or = "String expected.", tt = [], jt = "__dbnames", mn = "readonly", yn = "readwrite";
|
|
@@ -1010,17 +1010,17 @@ function Ma() {
|
|
|
1010
1010
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
1011
1011
|
}
|
|
1012
1012
|
var dr = (X.prototype._trans = function(e, t, r) {
|
|
1013
|
-
var a = this._tx ||
|
|
1013
|
+
var a = this._tx || G.trans, s = this.name, i = pe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
1014
1014
|
function u(m, v, f) {
|
|
1015
1015
|
if (!f.schema[s]) throw new L.NotFound("Table " + s + " not part of transaction");
|
|
1016
1016
|
return t(f.idbtrans, f);
|
|
1017
1017
|
}
|
|
1018
1018
|
var d = Ze();
|
|
1019
1019
|
try {
|
|
1020
|
-
var h = a && a.db._novip === this.db._novip ? a ===
|
|
1020
|
+
var h = a && a.db._novip === this.db._novip ? a === G.trans ? a._promise(e, u, r) : De(function() {
|
|
1021
1021
|
return a._promise(e, u, r);
|
|
1022
|
-
}, { trans: a, transless:
|
|
1023
|
-
if (v.idbdb && (v._state.openComplete ||
|
|
1022
|
+
}, { trans: a, transless: G.transless || G }) : function m(v, f, S, g) {
|
|
1023
|
+
if (v.idbdb && (v._state.openComplete || G.letThrough || v._vip)) {
|
|
1024
1024
|
var b = v._createTransaction(f, S, v._dbSchema);
|
|
1025
1025
|
try {
|
|
1026
1026
|
b.create(), v._state.PR1398_maxLoop = 3;
|
|
@@ -1031,7 +1031,7 @@ function Ma() {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
return b._promise(f, function(w, y) {
|
|
1033
1033
|
return De(function() {
|
|
1034
|
-
return
|
|
1034
|
+
return G.trans = b, g(w, y, b);
|
|
1035
1035
|
});
|
|
1036
1036
|
}).then(function(w) {
|
|
1037
1037
|
if (f === "readwrite") try {
|
|
@@ -1067,7 +1067,7 @@ function Ma() {
|
|
|
1067
1067
|
}).then(t);
|
|
1068
1068
|
}, X.prototype.where = function(e) {
|
|
1069
1069
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
1070
|
-
if (
|
|
1070
|
+
if (B(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
1071
1071
|
var t = C(e);
|
|
1072
1072
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
1073
1073
|
var r = this.schema.indexes.concat(this.schema.primKey).filter(function(d) {
|
|
@@ -1095,7 +1095,7 @@ function Ma() {
|
|
|
1095
1095
|
var u = t.reduce(function(f, h) {
|
|
1096
1096
|
var m = f[0], v = f[1], f = a[h], S = e[h];
|
|
1097
1097
|
return [m || f, m || !f ? Ue(v, f && f.multi ? function(g) {
|
|
1098
|
-
return g = ve(g, h),
|
|
1098
|
+
return g = ve(g, h), B(g) && g.some(function(b) {
|
|
1099
1099
|
return s(S, b);
|
|
1100
1100
|
});
|
|
1101
1101
|
} : function(g) {
|
|
@@ -1118,7 +1118,7 @@ function Ma() {
|
|
|
1118
1118
|
}, X.prototype.toCollection = function() {
|
|
1119
1119
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
1120
1120
|
}, X.prototype.orderBy = function(e) {
|
|
1121
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
1121
|
+
return new this.db.Collection(new this.db.WhereClause(this, B(e) ? "[".concat(e.join("+"), "]") : e));
|
|
1122
1122
|
}, X.prototype.reverse = function() {
|
|
1123
1123
|
return this.toCollection().reverse();
|
|
1124
1124
|
}, X.prototype.mapToClass = function(e) {
|
|
@@ -1168,7 +1168,7 @@ function Ma() {
|
|
|
1168
1168
|
return d;
|
|
1169
1169
|
});
|
|
1170
1170
|
}, X.prototype.update = function(e, t) {
|
|
1171
|
-
return typeof e != "object" ||
|
|
1171
|
+
return typeof e != "object" || B(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? q(new L.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
1172
1172
|
}, X.prototype.put = function(e, t) {
|
|
1173
1173
|
var r = this, a = this.schema.primKey, s = a.auto, i = a.keyPath, u = e;
|
|
1174
1174
|
return i && s && (u = Mt(i)(e)), this._trans("readwrite", function(d) {
|
|
@@ -1303,7 +1303,7 @@ function Ma() {
|
|
|
1303
1303
|
}
|
|
1304
1304
|
C(m = u).forEach(function(f) {
|
|
1305
1305
|
var S = m[f];
|
|
1306
|
-
if (
|
|
1306
|
+
if (B(S)) i(f, m[f][0], m[f][1]);
|
|
1307
1307
|
else {
|
|
1308
1308
|
if (S !== "asap") throw new L.InvalidArgument("Invalid event config");
|
|
1309
1309
|
var g = i(f, ct, function() {
|
|
@@ -1343,7 +1343,7 @@ function Ma() {
|
|
|
1343
1343
|
var a = Kt(e, t.schema);
|
|
1344
1344
|
return t.openCursor({ trans: r, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: a, range: e.range } });
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1346
|
+
function Bt(e, t, r, a) {
|
|
1347
1347
|
var s = e.replayFilter ? Ue(e.filter, e.replayFilter()) : e.filter;
|
|
1348
1348
|
if (e.or) {
|
|
1349
1349
|
var i = {}, u = function(d, h, m) {
|
|
@@ -1383,7 +1383,7 @@ function Ma() {
|
|
|
1383
1383
|
var t = this["@@propmod"];
|
|
1384
1384
|
if (t.add !== void 0) {
|
|
1385
1385
|
var r = t.add;
|
|
1386
|
-
if (
|
|
1386
|
+
if (B(r)) return E(E([], B(e) ? e : [], !0), r).sort();
|
|
1387
1387
|
if (typeof r == "number") return (Number(e) || 0) + r;
|
|
1388
1388
|
if (typeof r == "bigint") try {
|
|
1389
1389
|
return BigInt(e) + r;
|
|
@@ -1394,7 +1394,7 @@ function Ma() {
|
|
|
1394
1394
|
}
|
|
1395
1395
|
if (t.remove !== void 0) {
|
|
1396
1396
|
var a = t.remove;
|
|
1397
|
-
if (
|
|
1397
|
+
if (B(a)) return B(e) ? e.filter(function(s) {
|
|
1398
1398
|
return !a.includes(s);
|
|
1399
1399
|
}).sort() : [];
|
|
1400
1400
|
if (typeof a == "number") return Number(e) - a;
|
|
@@ -1420,7 +1420,7 @@ function Ma() {
|
|
|
1420
1420
|
var t = this._ctx;
|
|
1421
1421
|
t.algorithm = Ue(t.algorithm, e);
|
|
1422
1422
|
}, V.prototype._iterate = function(e, t) {
|
|
1423
|
-
return
|
|
1423
|
+
return Bt(this._ctx, e, t, this._ctx.table.core);
|
|
1424
1424
|
}, V.prototype.clone = function(e) {
|
|
1425
1425
|
var t = Object.create(this.constructor.prototype), r = Object.create(this._ctx);
|
|
1426
1426
|
return e && te(r, e), t._ctx = r, t;
|
|
@@ -1429,7 +1429,7 @@ function Ma() {
|
|
|
1429
1429
|
}, V.prototype.each = function(e) {
|
|
1430
1430
|
var t = this._ctx;
|
|
1431
1431
|
return this._read(function(r) {
|
|
1432
|
-
return
|
|
1432
|
+
return Bt(t, e, r, t.table.core);
|
|
1433
1433
|
});
|
|
1434
1434
|
}, V.prototype.count = function(e) {
|
|
1435
1435
|
var t = this;
|
|
@@ -1439,7 +1439,7 @@ function Ma() {
|
|
|
1439
1439
|
return Math.min(u, a.limit);
|
|
1440
1440
|
});
|
|
1441
1441
|
var i = 0;
|
|
1442
|
-
return
|
|
1442
|
+
return Bt(a, function() {
|
|
1443
1443
|
return ++i, !1;
|
|
1444
1444
|
}, r, s).then(function() {
|
|
1445
1445
|
return i;
|
|
@@ -1468,7 +1468,7 @@ function Ma() {
|
|
|
1468
1468
|
});
|
|
1469
1469
|
}
|
|
1470
1470
|
var u = [];
|
|
1471
|
-
return
|
|
1471
|
+
return Bt(a, function(d) {
|
|
1472
1472
|
return u.push(d);
|
|
1473
1473
|
}, r, a.table.core).then(function() {
|
|
1474
1474
|
return u;
|
|
@@ -1658,7 +1658,7 @@ function Ma() {
|
|
|
1658
1658
|
return pr("");
|
|
1659
1659
|
}).limit(0);
|
|
1660
1660
|
}
|
|
1661
|
-
function
|
|
1661
|
+
function Gt(e, t, r, a) {
|
|
1662
1662
|
var s, i, u, d, h, m, v, f = r.length;
|
|
1663
1663
|
if (!r.every(function(b) {
|
|
1664
1664
|
return typeof b == "string";
|
|
@@ -1751,21 +1751,21 @@ function Ma() {
|
|
|
1751
1751
|
}, re.prototype.startsWith = function(e) {
|
|
1752
1752
|
return typeof e != "string" ? le(this, or) : this.between(e, e + Fe, !0, !0);
|
|
1753
1753
|
}, re.prototype.startsWithIgnoreCase = function(e) {
|
|
1754
|
-
return e === "" ? this.startsWith(e) :
|
|
1754
|
+
return e === "" ? this.startsWith(e) : Gt(this, function(t, r) {
|
|
1755
1755
|
return t.indexOf(r[0]) === 0;
|
|
1756
1756
|
}, [e], Fe);
|
|
1757
1757
|
}, re.prototype.equalsIgnoreCase = function(e) {
|
|
1758
|
-
return
|
|
1758
|
+
return Gt(this, function(t, r) {
|
|
1759
1759
|
return t === r[0];
|
|
1760
1760
|
}, [e], "");
|
|
1761
1761
|
}, re.prototype.anyOfIgnoreCase = function() {
|
|
1762
1762
|
var e = Ee.apply(Qe, arguments);
|
|
1763
|
-
return e.length === 0 ? rt(this) :
|
|
1763
|
+
return e.length === 0 ? rt(this) : Gt(this, function(t, r) {
|
|
1764
1764
|
return r.indexOf(t) !== -1;
|
|
1765
1765
|
}, e, "");
|
|
1766
1766
|
}, re.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1767
1767
|
var e = Ee.apply(Qe, arguments);
|
|
1768
|
-
return e.length === 0 ? rt(this) :
|
|
1768
|
+
return e.length === 0 ? rt(this) : Gt(this, function(t, r) {
|
|
1769
1769
|
return r.some(function(a) {
|
|
1770
1770
|
return t.indexOf(a) === 0;
|
|
1771
1771
|
});
|
|
@@ -1867,9 +1867,9 @@ function Ma() {
|
|
|
1867
1867
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1868
1868
|
}
|
|
1869
1869
|
var yt = "storagemutated", wn = "x-storagemutated-1", Ie = ht(null, yt), ua = (ye.prototype._lock = function() {
|
|
1870
|
-
return ot(!
|
|
1870
|
+
return ot(!G.global), ++this._reculock, this._reculock !== 1 || G.global || (G.lockOwnerFor = this), this;
|
|
1871
1871
|
}, ye.prototype._unlock = function() {
|
|
1872
|
-
if (ot(!
|
|
1872
|
+
if (ot(!G.global), --this._reculock == 0) for (G.global || (G.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
1873
1873
|
var e = this._blockedFuncs.shift();
|
|
1874
1874
|
try {
|
|
1875
1875
|
We(e[1], e[0]);
|
|
@@ -1878,7 +1878,7 @@ function Ma() {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
return this;
|
|
1880
1880
|
}, ye.prototype._locked = function() {
|
|
1881
|
-
return this._reculock &&
|
|
1881
|
+
return this._reculock && G.lockOwnerFor !== this;
|
|
1882
1882
|
}, ye.prototype.create = function(e) {
|
|
1883
1883
|
var t = this;
|
|
1884
1884
|
if (!this.mode) return this;
|
|
@@ -1906,7 +1906,7 @@ function Ma() {
|
|
|
1906
1906
|
if (this._locked()) return new j(function(i, u) {
|
|
1907
1907
|
a._blockedFuncs.push([function() {
|
|
1908
1908
|
a._promise(e, t, r).then(i, u);
|
|
1909
|
-
},
|
|
1909
|
+
}, G]);
|
|
1910
1910
|
});
|
|
1911
1911
|
if (r) return De(function() {
|
|
1912
1912
|
var i = new j(function(u, d) {
|
|
@@ -2121,10 +2121,10 @@ function Ma() {
|
|
|
2121
2121
|
var i, u, d, v = (u = h, d = br((i = e).objectStoreNames), { schema: { name: i.name, tables: d.map(function(S) {
|
|
2122
2122
|
return u.objectStore(S);
|
|
2123
2123
|
}).map(function(S) {
|
|
2124
|
-
var g = S.keyPath, y = S.autoIncrement, b =
|
|
2124
|
+
var g = S.keyPath, y = S.autoIncrement, b = B(g), w = {}, y = { name: S.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: g == null, compound: b, keyPath: g, autoIncrement: y, unique: !0, extractKey: _n(g) }, indexes: br(S.indexNames).map(function(A) {
|
|
2125
2125
|
return S.index(A);
|
|
2126
2126
|
}).map(function(N) {
|
|
2127
|
-
var P = N.name, D = N.unique, R = N.multiEntry, N = N.keyPath, R = { name: P, compound:
|
|
2127
|
+
var P = N.name, D = N.unique, R = N.multiEntry, N = N.keyPath, R = { name: P, compound: B(N), keyPath: N, unique: D, multiEntry: R, extractKey: _n(N) };
|
|
2128
2128
|
return w[vt(N)] = R;
|
|
2129
2129
|
}), getIndexByKeyPath: function(A) {
|
|
2130
2130
|
return w[vt(A)];
|
|
@@ -2181,9 +2181,9 @@ function Ma() {
|
|
|
2181
2181
|
r.objectStoreNames.contains("$meta") && !s.$meta && (s.$meta = On("$meta", Er("")[0], []), e._storeNames.push("$meta"));
|
|
2182
2182
|
var i = e._createTransaction("readwrite", e._storeNames, s);
|
|
2183
2183
|
i.create(r), i._completion.catch(a);
|
|
2184
|
-
var u = i._reject.bind(i), d =
|
|
2184
|
+
var u = i._reject.bind(i), d = G.transless || G;
|
|
2185
2185
|
De(function() {
|
|
2186
|
-
return
|
|
2186
|
+
return G.trans = i, G.transless = d, t !== 0 ? (Lt(e, r), m = t, ((h = i).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(v) {
|
|
2187
2187
|
return v ?? m;
|
|
2188
2188
|
}) : j.resolve(m)).then(function(v) {
|
|
2189
2189
|
return S = v, g = i, b = r, w = [], v = (f = e)._versions, y = f._dbSchema = Ut(0, f.idbdb, b), (v = v.filter(function(A) {
|
|
@@ -2319,7 +2319,7 @@ function Ma() {
|
|
|
2319
2319
|
function Er(e) {
|
|
2320
2320
|
return e.split(",").map(function(t, r) {
|
|
2321
2321
|
var a = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), s = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
|
|
2322
|
-
return Sn(a, s || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t),
|
|
2322
|
+
return Sn(a, s || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), B(s), r === 0);
|
|
2323
2323
|
});
|
|
2324
2324
|
}
|
|
2325
2325
|
var ma = (Ht.prototype._parseStoresSpec = function(e, t) {
|
|
@@ -2354,7 +2354,7 @@ function Ma() {
|
|
|
2354
2354
|
}
|
|
2355
2355
|
function Tn(e) {
|
|
2356
2356
|
return De(function() {
|
|
2357
|
-
return
|
|
2357
|
+
return G.letThrough = !0, e();
|
|
2358
2358
|
});
|
|
2359
2359
|
}
|
|
2360
2360
|
function In(e) {
|
|
@@ -2581,13 +2581,13 @@ function Ma() {
|
|
|
2581
2581
|
function s(i) {
|
|
2582
2582
|
return function(h) {
|
|
2583
2583
|
var d = i(h), h = d.value;
|
|
2584
|
-
return d.done ? h : h && typeof h.then == "function" ? h.then(r, a) :
|
|
2584
|
+
return d.done ? h : h && typeof h.then == "function" ? h.then(r, a) : B(h) ? Promise.all(h).then(r, a) : r(h);
|
|
2585
2585
|
};
|
|
2586
2586
|
}
|
|
2587
2587
|
return s(t)();
|
|
2588
2588
|
}
|
|
2589
2589
|
function Xt(e, t, r) {
|
|
2590
|
-
for (var a =
|
|
2590
|
+
for (var a = B(e) ? e.slice() : [e], s = 0; s < r; ++s) a.push(t);
|
|
2591
2591
|
return a;
|
|
2592
2592
|
}
|
|
2593
2593
|
var ba = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
@@ -2651,7 +2651,7 @@ function Ma() {
|
|
|
2651
2651
|
return l(l({}, e), { table: function(t) {
|
|
2652
2652
|
var r = e.table(t), a = r.schema.primaryKey;
|
|
2653
2653
|
return l(l({}, r), { mutate: function(s) {
|
|
2654
|
-
var i =
|
|
2654
|
+
var i = G.trans, u = i.table(t).hook, d = u.deleting, h = u.creating, m = u.updating;
|
|
2655
2655
|
switch (s.type) {
|
|
2656
2656
|
case "add":
|
|
2657
2657
|
if (h.fire === Q) break;
|
|
@@ -2683,7 +2683,7 @@ function Ma() {
|
|
|
2683
2683
|
}
|
|
2684
2684
|
return r.mutate(s);
|
|
2685
2685
|
function v(f) {
|
|
2686
|
-
var S, g, b, w =
|
|
2686
|
+
var S, g, b, w = G.trans, y = f.keys || Kn(a, f);
|
|
2687
2687
|
if (!y) throw new Error("Keys missing");
|
|
2688
2688
|
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: y }) : l({}, f)).type !== "delete" && (f.values = E([], f.values)), f.keys && (f.keys = E([], f.keys)), S = r, b = y, ((g = f).type === "add" ? Promise.resolve([]) : S.getMany({ trans: g.trans, keys: b, cache: "immutable" })).then(function(A) {
|
|
2689
2689
|
var P = y.map(function(D, N) {
|
|
@@ -2748,7 +2748,7 @@ function Ma() {
|
|
|
2748
2748
|
var wa = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2749
2749
|
var t = e.schema.name, r = new ae(e.MIN_KEY, e.MAX_KEY);
|
|
2750
2750
|
return l(l({}, e), { transaction: function(a, s, i) {
|
|
2751
|
-
if (
|
|
2751
|
+
if (G.subscr && s !== "readonly") throw new L.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(G.querier));
|
|
2752
2752
|
return e.transaction(a, s, i);
|
|
2753
2753
|
}, table: function(a) {
|
|
2754
2754
|
var s = e.table(a), i = s.schema, u = i.primaryKey, f = i.indexes, d = u.extractKey, h = u.outbound, m = u.autoIncrement && f.filter(function(g) {
|
|
@@ -2760,13 +2760,13 @@ function Ma() {
|
|
|
2760
2760
|
var w, y, A, P = g.trans, D = g.mutatedParts || (g.mutatedParts = {}), N = b(""), R = b(":dels"), k = g.type, $ = g.type === "deleteRange" ? [g.range] : g.type === "delete" ? [g.keys] : g.values.length < 50 ? [Kn(u, g).filter(function(x) {
|
|
2761
2761
|
return x;
|
|
2762
2762
|
}), g.values] : [], T = $[0], I = $[1], $ = g.trans._cache;
|
|
2763
|
-
return
|
|
2763
|
+
return B(T) ? (N.addKeys(T), ($ = k === "delete" || T.length === I.length ? Ar(T, $) : null) || R.addKeys(T), ($ || I) && (w = b, y = $, A = I, i.indexes.forEach(function(x) {
|
|
2764
2764
|
var M = w(x.name || "");
|
|
2765
2765
|
function F(z) {
|
|
2766
2766
|
return z != null ? x.extractKey(z) : null;
|
|
2767
2767
|
}
|
|
2768
2768
|
function U(z) {
|
|
2769
|
-
return x.multiEntry &&
|
|
2769
|
+
return x.multiEntry && B(z) ? z.forEach(function(de) {
|
|
2770
2770
|
return M.addKey(de);
|
|
2771
2771
|
}) : M.addKey(z);
|
|
2772
2772
|
}
|
|
@@ -2796,7 +2796,7 @@ function Ma() {
|
|
|
2796
2796
|
}, count: f, query: f, openCursor: f };
|
|
2797
2797
|
return C(S).forEach(function(g) {
|
|
2798
2798
|
v[g] = function(b) {
|
|
2799
|
-
var w =
|
|
2799
|
+
var w = G.subscr, y = !!w, A = Pr(G, s) && Dr(g, b) ? b.obsSet = {} : w;
|
|
2800
2800
|
if (y) {
|
|
2801
2801
|
var P = function(I) {
|
|
2802
2802
|
return I = "idb://".concat(t, "/").concat(a, "/").concat(I), A[I] || (A[I] = new ae());
|
|
@@ -2837,13 +2837,13 @@ function Ma() {
|
|
|
2837
2837
|
if (r.numFailures === 0) return t;
|
|
2838
2838
|
if (t.type === "deleteRange") return null;
|
|
2839
2839
|
var a = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2840
|
-
return r.numFailures === a ? null : (t = l({}, t),
|
|
2840
|
+
return r.numFailures === a ? null : (t = l({}, t), B(t.keys) && (t.keys = t.keys.filter(function(s, i) {
|
|
2841
2841
|
return !(i in r.failures);
|
|
2842
|
-
})), "values" in t &&
|
|
2842
|
+
})), "values" in t && B(t.values) && (t.values = t.values.filter(function(s, i) {
|
|
2843
2843
|
return !(i in r.failures);
|
|
2844
2844
|
})), t);
|
|
2845
2845
|
}
|
|
2846
|
-
function
|
|
2846
|
+
function Bn(e, t) {
|
|
2847
2847
|
return r = e, ((a = t).lower === void 0 || (a.lowerOpen ? 0 < H(r, a.lower) : 0 <= H(r, a.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? H(e, t.upper) < 0 : H(e, t.upper) <= 0));
|
|
2848
2848
|
var r, a;
|
|
2849
2849
|
}
|
|
@@ -2853,9 +2853,9 @@ function Ma() {
|
|
|
2853
2853
|
var w = g, y = [];
|
|
2854
2854
|
if (b.type === "add" || b.type === "put") for (var A = new ae(), P = b.values.length - 1; 0 <= P; --P) {
|
|
2855
2855
|
var D, N = b.values[P], R = m(N);
|
|
2856
|
-
A.hasKey(R) || (D = v(N), (d &&
|
|
2857
|
-
return
|
|
2858
|
-
}) :
|
|
2856
|
+
A.hasKey(R) || (D = v(N), (d && B(D) ? D.some(function(x) {
|
|
2857
|
+
return Bn(x, h);
|
|
2858
|
+
}) : Bn(D, h)) && (A.addKey(R), y.push(N)));
|
|
2859
2859
|
}
|
|
2860
2860
|
switch (b.type) {
|
|
2861
2861
|
case "add":
|
|
@@ -2888,7 +2888,7 @@ function Ma() {
|
|
|
2888
2888
|
case "deleteRange":
|
|
2889
2889
|
var $ = b.range;
|
|
2890
2890
|
w = g.filter(function(M) {
|
|
2891
|
-
return !
|
|
2891
|
+
return !Bn(m(M), $);
|
|
2892
2892
|
});
|
|
2893
2893
|
}
|
|
2894
2894
|
return w;
|
|
@@ -2966,7 +2966,7 @@ function Ma() {
|
|
|
2966
2966
|
}, table: function(r) {
|
|
2967
2967
|
var a = e.table(r), s = a.schema.primaryKey;
|
|
2968
2968
|
return l(l({}, a), { mutate: function(i) {
|
|
2969
|
-
var u =
|
|
2969
|
+
var u = G.trans;
|
|
2970
2970
|
if (s.outbound || u.db._options.cache === "disabled" || u.explicit || u.idbtrans.mode !== "readwrite") return a.mutate(i);
|
|
2971
2971
|
var d = ze["idb://".concat(t, "/").concat(r)];
|
|
2972
2972
|
return d ? (u = a.mutate(i), i.type !== "add" && i.type !== "put" || !(50 <= i.values.length || Kn(s, i).some(function(h) {
|
|
@@ -2985,8 +2985,8 @@ function Ma() {
|
|
|
2985
2985
|
});
|
|
2986
2986
|
}), u) : a.mutate(i);
|
|
2987
2987
|
}, query: function(i) {
|
|
2988
|
-
if (!Pr(
|
|
2989
|
-
var u = ((m =
|
|
2988
|
+
if (!Pr(G, a) || !Dr("query", i)) return a.query(i);
|
|
2989
|
+
var u = ((m = G.trans) === null || m === void 0 ? void 0 : m.db._options.cache) === "immutable", f = G, d = f.requery, h = f.signal, m = function(b, w, y, A) {
|
|
2990
2990
|
var P = ze["idb://".concat(b, "/").concat(w)];
|
|
2991
2991
|
if (!P) return [];
|
|
2992
2992
|
if (!(w = P.queries[y])) return [null, !1, P, null];
|
|
@@ -3036,7 +3036,7 @@ function Ma() {
|
|
|
3036
3036
|
return r || (r = new this.Version(e), t.push(r), t.sort(ha), r.stores({}), this._state.autoSchema = !1, r);
|
|
3037
3037
|
}, ee.prototype._whenReady = function(e) {
|
|
3038
3038
|
var t = this;
|
|
3039
|
-
return this.idbdb && (this._state.openComplete ||
|
|
3039
|
+
return this.idbdb && (this._state.openComplete || G.letThrough || this._vip) ? e() : new j(function(r, a) {
|
|
3040
3040
|
if (t._state.openComplete) return a(new L.DatabaseClosed(t._state.dbOpenError));
|
|
3041
3041
|
if (!t._state.isBeingOpened) {
|
|
3042
3042
|
if (!t._state.autoOpen) return void a(new L.DatabaseClosed());
|
|
@@ -3117,7 +3117,7 @@ function Ma() {
|
|
|
3117
3117
|
}.apply(this, arguments);
|
|
3118
3118
|
return this._transaction.apply(this, e);
|
|
3119
3119
|
}, ee.prototype._transaction = function(e, t, r) {
|
|
3120
|
-
var a = this, s =
|
|
3120
|
+
var a = this, s = G.trans;
|
|
3121
3121
|
s && s.db === this && e.indexOf("!") === -1 || (s = null);
|
|
3122
3122
|
var i, u, d = e.indexOf("?") !== -1;
|
|
3123
3123
|
e = e.replace("!", "").replace("?", "");
|
|
@@ -3149,7 +3149,7 @@ function Ma() {
|
|
|
3149
3149
|
}
|
|
3150
3150
|
var h = function m(v, f, S, g, b) {
|
|
3151
3151
|
return j.resolve().then(function() {
|
|
3152
|
-
var w =
|
|
3152
|
+
var w = G.transless || G, y = v._createTransaction(f, S, v._dbSchema, g);
|
|
3153
3153
|
if (y.explicit = !0, w = { trans: y, transless: w }, g) y.idbtrans = g.idbtrans;
|
|
3154
3154
|
else try {
|
|
3155
3155
|
y.create(), y.idbtrans._explicit = !0, v._state.PR1398_maxLoop = 3;
|
|
@@ -3175,7 +3175,7 @@ function Ma() {
|
|
|
3175
3175
|
});
|
|
3176
3176
|
});
|
|
3177
3177
|
}.bind(null, this, i, u, s, r);
|
|
3178
|
-
return s ? s._promise(i, h, "lock") :
|
|
3178
|
+
return s ? s._promise(i, h, "lock") : G.trans ? We(G.transless, function() {
|
|
3179
3179
|
return a._whenReady(h);
|
|
3180
3180
|
}) : this._whenReady(h);
|
|
3181
3181
|
}, ee.prototype.table = function(e) {
|
|
@@ -3262,12 +3262,12 @@ function Ma() {
|
|
|
3262
3262
|
return f(r);
|
|
3263
3263
|
});
|
|
3264
3264
|
}
|
|
3265
|
-
var Zt, fe = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Aa = (
|
|
3265
|
+
var Zt, fe = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Aa = (Gn.prototype.subscribe = function(e, t, r) {
|
|
3266
3266
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: r });
|
|
3267
|
-
},
|
|
3267
|
+
}, Gn.prototype[fe] = function() {
|
|
3268
3268
|
return this;
|
|
3269
|
-
},
|
|
3270
|
-
function
|
|
3269
|
+
}, Gn);
|
|
3270
|
+
function Gn(e) {
|
|
3271
3271
|
this._subscribe = e;
|
|
3272
3272
|
}
|
|
3273
3273
|
try {
|
|
@@ -3354,7 +3354,7 @@ function Ma() {
|
|
|
3354
3354
|
te(this, e);
|
|
3355
3355
|
};
|
|
3356
3356
|
}, ignoreTransaction: function(e) {
|
|
3357
|
-
return
|
|
3357
|
+
return G.trans ? We(G.transless, e) : e();
|
|
3358
3358
|
}, vip: Tn, async: function(e) {
|
|
3359
3359
|
return function() {
|
|
3360
3360
|
try {
|
|
@@ -3372,9 +3372,9 @@ function Ma() {
|
|
|
3372
3372
|
return q(s);
|
|
3373
3373
|
}
|
|
3374
3374
|
}, currentTransaction: { get: function() {
|
|
3375
|
-
return
|
|
3375
|
+
return G.trans || null;
|
|
3376
3376
|
} }, waitFor: function(e, t) {
|
|
3377
|
-
return t = j.resolve(typeof e == "function" ? He.ignoreTransaction(e) : e).timeout(t || 6e4),
|
|
3377
|
+
return t = j.resolve(typeof e == "function" ? He.ignoreTransaction(e) : e).timeout(t || 6e4), G.trans ? G.trans.waitFor(t) : t;
|
|
3378
3378
|
}, Promise: j, debug: { get: function() {
|
|
3379
3379
|
return pe;
|
|
3380
3380
|
}, set: function(e) {
|
|
@@ -3615,7 +3615,7 @@ class Mr {
|
|
|
3615
3615
|
};
|
|
3616
3616
|
const o = n?.order ?? "utc", l = Math.floor(Date.now() / 1e3);
|
|
3617
3617
|
o !== "utc" && (n.since = l - 60 * 60 * 24 * 30), this.options.delay != 0 ? n.before = l - (this.options.delay || 0) : n.before = l;
|
|
3618
|
-
const E = (
|
|
3618
|
+
const E = (B) => B.utc > (n?.since || 0), O = (B) => B.utc < (n?.before || l), C = (B) => B?.visible !== 0;
|
|
3619
3619
|
try {
|
|
3620
3620
|
const te = await this.db.table(_.TOPICS).where("widget_id").equals(n.widget).filter(C).filter(E).filter(O).reverse().limit(n?.limit ?? 25).sortBy(o);
|
|
3621
3621
|
if (te.length === 0)
|
|
@@ -3645,7 +3645,7 @@ class Mr {
|
|
|
3645
3645
|
be
|
|
3646
3646
|
]), be;
|
|
3647
3647
|
});
|
|
3648
|
-
} catch (
|
|
3648
|
+
} catch (B) {
|
|
3649
3649
|
return K(2, [
|
|
3650
3650
|
"%cget%c %cstorage%c %cmessages",
|
|
3651
3651
|
c.OK,
|
|
@@ -3654,7 +3654,7 @@ class Mr {
|
|
|
3654
3654
|
c.NONE,
|
|
3655
3655
|
c.NO_UPDATES,
|
|
3656
3656
|
n,
|
|
3657
|
-
|
|
3657
|
+
B.message
|
|
3658
3658
|
]), { data: null, message: "Messages Data error", success: !1 };
|
|
3659
3659
|
}
|
|
3660
3660
|
};
|
|
@@ -3726,8 +3726,8 @@ class Mr {
|
|
|
3726
3726
|
C.message
|
|
3727
3727
|
]);
|
|
3728
3728
|
}), await o.data.topics.forEach(async (C) => {
|
|
3729
|
-
const
|
|
3730
|
-
await this.db.table(_.TOPICS).where("message_id").equals(
|
|
3729
|
+
const B = C.message_id, te = C.visible ? 1 : 0, ge = C.title;
|
|
3730
|
+
await this.db.table(_.TOPICS).where("message_id").equals(B).modify({ visible: te }).catch((Ce) => {
|
|
3731
3731
|
E++, K(4, [
|
|
3732
3732
|
"%cset%c %cstorage",
|
|
3733
3733
|
c.KO,
|
|
@@ -4108,7 +4108,7 @@ function Hn(p) {
|
|
|
4108
4108
|
p.oncomplete = p.onsuccess = () => n(p.result), p.onabort = p.onerror = () => o(p.error);
|
|
4109
4109
|
});
|
|
4110
4110
|
}
|
|
4111
|
-
function
|
|
4111
|
+
function Ba(p, n) {
|
|
4112
4112
|
const o = indexedDB.open(p);
|
|
4113
4113
|
o.onupgradeneeded = () => o.result.createObjectStore(n);
|
|
4114
4114
|
const l = Hn(o);
|
|
@@ -4116,7 +4116,7 @@ function Ga(p, n) {
|
|
|
4116
4116
|
}
|
|
4117
4117
|
let Un;
|
|
4118
4118
|
function Kr() {
|
|
4119
|
-
return Un || (Un =
|
|
4119
|
+
return Un || (Un = Ba("keyval-store", "keyval")), Un;
|
|
4120
4120
|
}
|
|
4121
4121
|
function _e(p, n = Kr()) {
|
|
4122
4122
|
return n("readonly", (o) => Hn(o.get(p)));
|
|
@@ -4124,7 +4124,7 @@ function _e(p, n = Kr()) {
|
|
|
4124
4124
|
function ke(p, n, o = Kr()) {
|
|
4125
4125
|
return o("readwrite", (l) => (l.put(n, p), Hn(l.transaction)));
|
|
4126
4126
|
}
|
|
4127
|
-
class
|
|
4127
|
+
class Br {
|
|
4128
4128
|
subscribers = [];
|
|
4129
4129
|
options;
|
|
4130
4130
|
constructor(n) {
|
|
@@ -4410,7 +4410,7 @@ class Gr {
|
|
|
4410
4410
|
success: !1
|
|
4411
4411
|
}));
|
|
4412
4412
|
}
|
|
4413
|
-
class
|
|
4413
|
+
class Gr {
|
|
4414
4414
|
subscribers = [];
|
|
4415
4415
|
options;
|
|
4416
4416
|
constructor(n) {
|
|
@@ -5376,10 +5376,10 @@ class Ja {
|
|
|
5376
5376
|
this.sm = new Lr(n);
|
|
5377
5377
|
break;
|
|
5378
5378
|
case he.SESSION:
|
|
5379
|
-
this.sm = new
|
|
5379
|
+
this.sm = new Gr(n);
|
|
5380
5380
|
break;
|
|
5381
5381
|
case he.KEYVAL:
|
|
5382
|
-
this.sm = new
|
|
5382
|
+
this.sm = new Br(n);
|
|
5383
5383
|
break;
|
|
5384
5384
|
case he.WINDOW:
|
|
5385
5385
|
this.sm = new Wr(n);
|
|
@@ -5410,7 +5410,7 @@ class Ja {
|
|
|
5410
5410
|
case _.MESSAGES:
|
|
5411
5411
|
let C;
|
|
5412
5412
|
C = n.data.messages.filter(
|
|
5413
|
-
(
|
|
5413
|
+
(B) => B.id !== null
|
|
5414
5414
|
), n.data.messages = C, O = n.data.messages.length > 0 ? Fn(n.data.messages[0].utc) : "none", E?.hash && E.hash === O ? (K(3, [
|
|
5415
5415
|
"%cload%c %cmessages%c %cno updates",
|
|
5416
5416
|
c.OK,
|
|
@@ -5419,7 +5419,7 @@ class Ja {
|
|
|
5419
5419
|
c.NONE,
|
|
5420
5420
|
c.NO_UPDATES,
|
|
5421
5421
|
n.query.widget
|
|
5422
|
-
]), K(4, ["%cmessages", c.MESSAGES, n]), l = 204) : (o = n, E.hash = O, l = await this.sm?.setMessages(n.query, n).then(async (
|
|
5422
|
+
]), K(4, ["%cmessages", c.MESSAGES, n]), l = 204) : (o = n, E.hash = O, l = await this.sm?.setMessages(n.query, n).then(async (B) => (B = 201, this.broadcastUpdate(B, n))));
|
|
5423
5423
|
break;
|
|
5424
5424
|
case _.CLOUD:
|
|
5425
5425
|
O = Fn(n.data.cloud), E?.hash && E.hash === O ? (K(3, [
|
|
@@ -5437,7 +5437,7 @@ class Ja {
|
|
|
5437
5437
|
message: n.message,
|
|
5438
5438
|
success: n.success,
|
|
5439
5439
|
query: n.query
|
|
5440
|
-
}, l = await this.sm?.setCloud(n.query, o.data).then((
|
|
5440
|
+
}, l = await this.sm?.setCloud(n.query, o.data).then((B) => this.broadcastUpdate(B, n)));
|
|
5441
5441
|
break;
|
|
5442
5442
|
case _.SERIES:
|
|
5443
5443
|
O = Fn(n.data.series), E?.hash && E.hash === O ? (K(3, [
|
|
@@ -5453,7 +5453,7 @@ class Ja {
|
|
|
5453
5453
|
message: n.message,
|
|
5454
5454
|
success: n.success,
|
|
5455
5455
|
query: n.query
|
|
5456
|
-
}, l = await this.sm?.setSeries(n.query, n.data).then((
|
|
5456
|
+
}, l = await this.sm?.setSeries(n.query, n.data).then((B) => this.broadcastUpdate(B, n)));
|
|
5457
5457
|
break;
|
|
5458
5458
|
default:
|
|
5459
5459
|
return K(4, [
|
|
@@ -5617,7 +5617,7 @@ class Ja {
|
|
|
5617
5617
|
getDashboards = async (n) => await this.sm?.getDashboards();
|
|
5618
5618
|
setDashboard = async (n) => await this.sm?.setDashboard(n);
|
|
5619
5619
|
}
|
|
5620
|
-
class
|
|
5620
|
+
class Ga {
|
|
5621
5621
|
sm;
|
|
5622
5622
|
constructor(n) {
|
|
5623
5623
|
switch (this.sm = null, n.storage) {
|
|
@@ -5628,10 +5628,10 @@ class Ba {
|
|
|
5628
5628
|
this.sm = new Lr(n);
|
|
5629
5629
|
break;
|
|
5630
5630
|
case he.SESSION:
|
|
5631
|
-
this.sm = new
|
|
5631
|
+
this.sm = new Gr(n);
|
|
5632
5632
|
break;
|
|
5633
5633
|
case he.KEYVAL:
|
|
5634
|
-
this.sm = new
|
|
5634
|
+
this.sm = new Br(n);
|
|
5635
5635
|
break;
|
|
5636
5636
|
case he.WINDOW:
|
|
5637
5637
|
this.sm = new Wr(n);
|
|
@@ -5717,7 +5717,7 @@ class Za {
|
|
|
5717
5717
|
let E;
|
|
5718
5718
|
E = { ...n.dataset }, delete E.hmr, E.presentation = n.closest(l)?.getAttribute("presentation") ?? `${l} not found`, this.query = E, Da(n);
|
|
5719
5719
|
const O = window.BuzzCasting.getOptions();
|
|
5720
|
-
this.storageReader = new
|
|
5720
|
+
this.storageReader = new Ga(O), this.broadcastChannel = new BroadcastChannel(E.presentation), this.broadcastListener();
|
|
5721
5721
|
}
|
|
5722
5722
|
addCallbackListener(n) {
|
|
5723
5723
|
this.callbacks.push(n);
|
|
@@ -5892,6 +5892,6 @@ class Za {
|
|
|
5892
5892
|
}
|
|
5893
5893
|
export {
|
|
5894
5894
|
Ja as BuzzcastingStorageManager,
|
|
5895
|
-
|
|
5895
|
+
Ga as BuzzcastingStorageReader,
|
|
5896
5896
|
Za as Widget
|
|
5897
5897
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buzzcasting-storage",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.9.
|
|
4
|
+
"version": "3.9.13",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Mark Tamis, TouchFlows SAS",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
|
40
40
|
"@typescript-eslint/parser": "^8.31.1",
|
|
41
41
|
"@vitest/coverage-v8": "^3.1.2",
|
|
42
|
-
"buzzcasting-utils": "^1.3.
|
|
42
|
+
"buzzcasting-utils": "^1.3.11",
|
|
43
43
|
"camelcase": "^8.0.0",
|
|
44
44
|
"changelogen": "^0.6.1",
|
|
45
45
|
"eslint": "^9.25.1",
|