buzzcasting-storage 3.2.2 → 3.2.3
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.d.ts +5 -1
- package/dist/buzzcasting-storage.esm.js +515 -515
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var xa = Object.defineProperty;
|
|
2
|
-
var Aa = (
|
|
3
|
-
var k = (
|
|
4
|
-
var N = /* @__PURE__ */ ((
|
|
5
|
-
const ka = "3.2.
|
|
2
|
+
var Aa = (l, r, o) => r in l ? xa(l, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : l[r] = o;
|
|
3
|
+
var k = (l, r, o) => Aa(l, typeof r != "symbol" ? r + "" : r, o);
|
|
4
|
+
var N = /* @__PURE__ */ ((l) => (l.MESSAGES = "messages", l.CLOUD = "cloud", l.SERIES = "series", l.TOPICS = "topics", l.WIDGET = "widget", l.WIDGETS = "widgets", l.SLIDE = "slide", l))(N || {}), m = /* @__PURE__ */ ((l) => (l.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", l.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", l.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", l.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", l.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", l.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", l.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", l.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", l.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", l.NONE = "color:transparent;background-color:transparent;", l.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", l.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", l.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", l.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", l.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", l.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", l.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", l))(m || {}), re = /* @__PURE__ */ ((l) => (l.ADD_SLIDE = "addSlide", l.APP_READY = "appReady", l.API_UPDATE = "apiUpdate", l.WS_API_REQUEST = "wsApiRequest", l.WS_API_RESPONSE = "wsApiResponse", l.WS_API_UPDATE = "wsApiRUpdate", l.APPROVE_MESSAGE = "approveMessage", l.CHANNEL = "channel", l.CLEAN_MESSAGES = "cleanMessages", l.CLOSE_MODAL = "closeModal", l.CLOSE_BUILDER_MODAL = "closeBuilderModal", l.ERROR = "error", l.HIDE_MESSAGE = "hideMessage", l.HIDE_LABELS = "hideLabels", l.MAUPPUT_UPDATE = "layoutUpdate", l.PAUSE_PRESENTATION = "pausePresentation", l.PRESENTATION_READY = "presentationReady", l.PREV_SLIDE = "prevSlide", l.RELOAD_PRESENTATION = "reloadPresentation", l.SHOW_MODAL = "showModal", l.STAR_MESSAGE = "starMessage", l.GOTO_SLIDE = "gotoSlide", l.NEXT_SLIDE = "nextSlide", l.SHOW_BUILDER_MODAL = "showBuilderModal", l.SLIDE_DID_LOAD = "slideDidLoad", l.SLIDE_GOTO = "slideGoto", l.SLIDE_READY = "slideReady", l.SLIDE_LOAD = "loadSlide", l.SLIDE_STORE = "storeSlide", l.SLIDE_TRANSITIONER = "slideTransitioner", l.START_TRANSITIONER = "startTransitioner", l.STORAGE_INIT = "storageInit", l.SUBSCRIBE = "subscribe", l.SUSPEND_ACCOUNT = "suspendAccount", l.REMOVE_CLOUD = "removeCloud", l.UPDATE = "update", l.VERSION = "version", l.WIDGET_UPDATE = "widgetUpdate", l))(re || {}), Zt = /* @__PURE__ */ ((l) => (l.APPROVED = "approved", l.BEFORE = "before", l.DELAYED = "delayed", l.NONE = "none", l.REALTIME = "realtime", l))(Zt || {}), ye = /* @__PURE__ */ ((l) => (l.KEYVAL = "keyval", l.LOCAL = "local", l.SESSION = "session", l.DEXIE = "dexie", l.WINDOW = "window", l))(ye || {});
|
|
5
|
+
const ka = "3.2.2";
|
|
6
6
|
class Da {
|
|
7
7
|
constructor(r) {
|
|
8
8
|
k(this, "options");
|
|
@@ -32,7 +32,7 @@ class Da {
|
|
|
32
32
|
this.options = r, this.url = `https://${r.app}.buzzcasting.net`;
|
|
33
33
|
}
|
|
34
34
|
async get(r) {
|
|
35
|
-
const { version: o } = this.options,
|
|
35
|
+
const { version: o } = this.options, d = this.headers(), x = Object.assign({}, r);
|
|
36
36
|
delete x.slide, delete x.type, delete x.hash, delete x.order, delete x.period;
|
|
37
37
|
const D = Object.keys(x).length > 0 ? `?${new URLSearchParams(x).toString()}` : "";
|
|
38
38
|
return console.info(
|
|
@@ -43,7 +43,7 @@ class Da {
|
|
|
43
43
|
r.widget
|
|
44
44
|
), console.debug("%capi%c %cfetch", m.API, m.NONE, m.GET_DATA, x), await fetch(
|
|
45
45
|
[this.url, "api", o, r.type].join("/") + D,
|
|
46
|
-
{ ...
|
|
46
|
+
{ ...d, method: "get" }
|
|
47
47
|
).then(async (K) => {
|
|
48
48
|
if (!K.ok)
|
|
49
49
|
throw new Error(`${K.status}`);
|
|
@@ -51,7 +51,7 @@ class Da {
|
|
|
51
51
|
}).then((K) => K.json()).then((K) => (K.query = r, K)).catch((K) => ({ success: !1, message: `${K}`, data: null }));
|
|
52
52
|
}
|
|
53
53
|
async hideMessage(r) {
|
|
54
|
-
const { version: o } = this.options,
|
|
54
|
+
const { version: o } = this.options, d = this.headers(), x = "?action=visible";
|
|
55
55
|
return console.info(
|
|
56
56
|
"%capi%c %cput",
|
|
57
57
|
m.API,
|
|
@@ -62,7 +62,7 @@ class Da {
|
|
|
62
62
|
r.id
|
|
63
63
|
), await fetch(
|
|
64
64
|
[this.url, "api", o, "messages", r.id].join("/") + x,
|
|
65
|
-
{ ...
|
|
65
|
+
{ ...d, method: "put" }
|
|
66
66
|
).then((D) => {
|
|
67
67
|
if (!D.ok)
|
|
68
68
|
throw new Error(D.statusText);
|
|
@@ -70,7 +70,7 @@ class Da {
|
|
|
70
70
|
}).then((D) => D.json()).catch((D) => ({ succes: !1, message: D, data: [] }));
|
|
71
71
|
}
|
|
72
72
|
async hideLabels(r) {
|
|
73
|
-
const { version: o } = this.options,
|
|
73
|
+
const { version: o } = this.options, d = this.formHeaders(), x = new URLSearchParams(), D = r.labels || [];
|
|
74
74
|
for (const [K, U] of D.entries())
|
|
75
75
|
x.append(`custom_filters[${K}]`, U);
|
|
76
76
|
return console.info(
|
|
@@ -83,7 +83,7 @@ class Da {
|
|
|
83
83
|
D
|
|
84
84
|
), await fetch(
|
|
85
85
|
[this.url, "api", o, r.type, r.widget].join("/"),
|
|
86
|
-
{ ...
|
|
86
|
+
{ ...d, body: x, method: "put" }
|
|
87
87
|
).then((K) => {
|
|
88
88
|
if (!K.ok)
|
|
89
89
|
throw new Error(K.statusText);
|
|
@@ -91,7 +91,7 @@ class Da {
|
|
|
91
91
|
}).then((K) => K.json()).catch((K) => ({ succes: !1, message: K, data: [] }));
|
|
92
92
|
}
|
|
93
93
|
async loadSlide(r) {
|
|
94
|
-
const { version: o } = this.options,
|
|
94
|
+
const { version: o } = this.options, d = this.headers(), x = Object.assign({}, r);
|
|
95
95
|
return delete x.slide, delete x.type, delete x.hash, console.debug(
|
|
96
96
|
"%capi%c %cloadSlide",
|
|
97
97
|
m.API,
|
|
@@ -101,7 +101,7 @@ class Da {
|
|
|
101
101
|
r.slide
|
|
102
102
|
), await fetch(
|
|
103
103
|
[this.url, "api", o, "slides", r.id].join("/"),
|
|
104
|
-
{ ...
|
|
104
|
+
{ ...d, method: "get" }
|
|
105
105
|
).then(async (D) => {
|
|
106
106
|
if (!D.ok)
|
|
107
107
|
throw new Error(`${D.status}`);
|
|
@@ -116,7 +116,7 @@ class Da {
|
|
|
116
116
|
* @returns
|
|
117
117
|
*/
|
|
118
118
|
async storeSlide(r) {
|
|
119
|
-
const { version: o } = this.options,
|
|
119
|
+
const { version: o } = this.options, d = this.formHeaders();
|
|
120
120
|
delete r.update, delete r.type;
|
|
121
121
|
const x = JSON.stringify(r);
|
|
122
122
|
return console.info(
|
|
@@ -128,7 +128,7 @@ class Da {
|
|
|
128
128
|
r.id
|
|
129
129
|
), await fetch(
|
|
130
130
|
[this.url, "api", o, "slides", r.id].join("/"),
|
|
131
|
-
{ ...
|
|
131
|
+
{ ...d, body: x, method: "put" }
|
|
132
132
|
).then((D) => {
|
|
133
133
|
if (!D.ok)
|
|
134
134
|
throw new Error(D.statusText);
|
|
@@ -137,14 +137,14 @@ class Da {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
var Pa = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
140
|
-
function Ia(
|
|
141
|
-
return
|
|
140
|
+
function Ia(l) {
|
|
141
|
+
return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
|
|
142
142
|
}
|
|
143
143
|
var qt = { exports: {} }, Ca = qt.exports, Rr;
|
|
144
144
|
function Ra() {
|
|
145
|
-
return Rr || (Rr = 1, function(
|
|
146
|
-
(function(o,
|
|
147
|
-
|
|
145
|
+
return Rr || (Rr = 1, function(l, r) {
|
|
146
|
+
(function(o, d) {
|
|
147
|
+
l.exports = d();
|
|
148
148
|
})(Ca, function() {
|
|
149
149
|
var o = function(e, t) {
|
|
150
150
|
return (o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
@@ -152,8 +152,8 @@ function Ra() {
|
|
|
152
152
|
} || function(n, a) {
|
|
153
153
|
for (var i in a) Object.prototype.hasOwnProperty.call(a, i) && (n[i] = a[i]);
|
|
154
154
|
})(e, t);
|
|
155
|
-
},
|
|
156
|
-
return (
|
|
155
|
+
}, d = function() {
|
|
156
|
+
return (d = Object.assign || function(e) {
|
|
157
157
|
for (var t, n = 1, a = arguments.length; n < a; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
158
158
|
return e;
|
|
159
159
|
}).apply(this, arguments);
|
|
@@ -188,7 +188,7 @@ function Ra() {
|
|
|
188
188
|
} };
|
|
189
189
|
}
|
|
190
190
|
var Ur = Object.getOwnPropertyDescriptor, Fr = [].slice;
|
|
191
|
-
function
|
|
191
|
+
function St(e, t, n) {
|
|
192
192
|
return Fr.call(e, t, n);
|
|
193
193
|
}
|
|
194
194
|
function Hn(e, t) {
|
|
@@ -273,7 +273,7 @@ function Ra() {
|
|
|
273
273
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
274
274
|
}
|
|
275
275
|
var Qe = {};
|
|
276
|
-
function
|
|
276
|
+
function _e(e) {
|
|
277
277
|
var t, n, a, i;
|
|
278
278
|
if (arguments.length === 1) {
|
|
279
279
|
if (U(e)) return e.slice();
|
|
@@ -551,7 +551,7 @@ function Ra() {
|
|
|
551
551
|
n.then(a, i).finally(clearTimeout.bind(null, s));
|
|
552
552
|
}) : this;
|
|
553
553
|
} }), typeof Symbol < "u" && Symbol.toStringTag && xe(B.prototype, Symbol.toStringTag, "Dexie.Promise"), Ae.env = rr(), le(B, { all: function() {
|
|
554
|
-
var e =
|
|
554
|
+
var e = _e.apply(null, arguments).map(Rt);
|
|
555
555
|
return new B(function(t, n) {
|
|
556
556
|
e.length === 0 && t([]);
|
|
557
557
|
var a = e.length;
|
|
@@ -566,7 +566,7 @@ function Ra() {
|
|
|
566
566
|
e.then(t, n);
|
|
567
567
|
}) : new B(ot, !0, e);
|
|
568
568
|
}, reject: Dt, race: function() {
|
|
569
|
-
var e =
|
|
569
|
+
var e = _e.apply(null, arguments).map(Rt);
|
|
570
570
|
return new B(function(t, n) {
|
|
571
571
|
e.map(function(a) {
|
|
572
572
|
return B.resolve(a).then(t, n);
|
|
@@ -603,7 +603,7 @@ function Ra() {
|
|
|
603
603
|
}, t, n, a);
|
|
604
604
|
});
|
|
605
605
|
} }), Ke && (Ke.allSettled && xe(B, "allSettled", function() {
|
|
606
|
-
var e =
|
|
606
|
+
var e = _e.apply(null, arguments).map(Rt);
|
|
607
607
|
return new B(function(t) {
|
|
608
608
|
e.length === 0 && t([]);
|
|
609
609
|
var n = e.length, a = new Array(n);
|
|
@@ -618,7 +618,7 @@ function Ra() {
|
|
|
618
618
|
});
|
|
619
619
|
});
|
|
620
620
|
}), Ke.any && typeof AggregateError < "u" && xe(B, "any", function() {
|
|
621
|
-
var e =
|
|
621
|
+
var e = _e.apply(null, arguments).map(Rt);
|
|
622
622
|
return new B(function(t, n) {
|
|
623
623
|
e.length === 0 && n(new AggregateError([]));
|
|
624
624
|
var a = e.length, i = new Array(a);
|
|
@@ -688,7 +688,7 @@ function Ra() {
|
|
|
688
688
|
Promise === Ke && ae.echoes === 0 ? It === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
689
689
|
}
|
|
690
690
|
("" + ge).indexOf("[native code]") === -1 && (qe = De = J);
|
|
691
|
-
var te = B.reject, $e = "",
|
|
691
|
+
var te = B.reject, $e = "", Se = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ir = "String expected.", et = [], Tt = "__dbnames", gn = "readonly", yn = "readwrite";
|
|
692
692
|
function Ue(e, t) {
|
|
693
693
|
return e ? t ? function() {
|
|
694
694
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -749,14 +749,14 @@ function Ra() {
|
|
|
749
749
|
try {
|
|
750
750
|
var h = a && a.db._novip === this.db._novip ? a === G.trans ? a._promise(e, u, n) : ke(function() {
|
|
751
751
|
return a._promise(e, u, n);
|
|
752
|
-
}, { trans: a, transless: G.transless || G }) : function g(v, f,
|
|
752
|
+
}, { trans: a, transless: G.transless || G }) : function g(v, f, _, p) {
|
|
753
753
|
if (v.idbdb && (v._state.openComplete || G.letThrough || v._vip)) {
|
|
754
|
-
var b = v._createTransaction(f,
|
|
754
|
+
var b = v._createTransaction(f, _, v._dbSchema);
|
|
755
755
|
try {
|
|
756
756
|
b.create(), v._state.PR1398_maxLoop = 3;
|
|
757
757
|
} catch (w) {
|
|
758
758
|
return w.name === an.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
759
|
-
return g(v, f,
|
|
759
|
+
return g(v, f, _, p);
|
|
760
760
|
})) : te(w);
|
|
761
761
|
}
|
|
762
762
|
return b._promise(f, function(w, y) {
|
|
@@ -779,7 +779,7 @@ function Ra() {
|
|
|
779
779
|
v.open().catch(J);
|
|
780
780
|
}
|
|
781
781
|
return v._state.dbReadyPromise.then(function() {
|
|
782
|
-
return g(v, f,
|
|
782
|
+
return g(v, f, _, p);
|
|
783
783
|
});
|
|
784
784
|
}(this.db, e, [this.name], u);
|
|
785
785
|
return s && (h._consoleTask = s, h = h.catch(function(g) {
|
|
@@ -823,13 +823,13 @@ function Ra() {
|
|
|
823
823
|
return Y(c, h) === 0;
|
|
824
824
|
}
|
|
825
825
|
var u = t.reduce(function(f, h) {
|
|
826
|
-
var g = f[0], v = f[1], f = a[h],
|
|
826
|
+
var g = f[0], v = f[1], f = a[h], _ = e[h];
|
|
827
827
|
return [g || f, g || !f ? Ue(v, f && f.multi ? function(p) {
|
|
828
828
|
return p = we(p, h), U(p) && p.some(function(b) {
|
|
829
|
-
return i(
|
|
829
|
+
return i(_, b);
|
|
830
830
|
});
|
|
831
831
|
} : function(p) {
|
|
832
|
-
return i(
|
|
832
|
+
return i(_, we(p, h));
|
|
833
833
|
}) : v];
|
|
834
834
|
}, [null, null]), s = u[0], u = u[1];
|
|
835
835
|
return s ? this.where(s.name).equals(e[s.keyPath]).filter(u) : n ? this.filter(u) : this.where(t).equals("");
|
|
@@ -943,8 +943,8 @@ function Ra() {
|
|
|
943
943
|
if (i && i.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
944
944
|
var h = e.length, g = g && c ? e.map(Mt(g)) : e;
|
|
945
945
|
return a.core.mutate({ trans: u, type: "add", keys: i, values: g, wantResults: s }).then(function(b) {
|
|
946
|
-
var f = b.numFailures,
|
|
947
|
-
if (f === 0) return s ?
|
|
946
|
+
var f = b.numFailures, _ = b.results, p = b.lastResult, b = b.failures;
|
|
947
|
+
if (f === 0) return s ? _ : p;
|
|
948
948
|
throw new Je("".concat(a.name, ".bulkAdd(): ").concat(f, " of ").concat(h, " operations failed"), b);
|
|
949
949
|
});
|
|
950
950
|
});
|
|
@@ -956,8 +956,8 @@ function Ra() {
|
|
|
956
956
|
if (i && i.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
957
957
|
var h = e.length, g = g && c ? e.map(Mt(g)) : e;
|
|
958
958
|
return a.core.mutate({ trans: u, type: "put", keys: i, values: g, wantResults: s }).then(function(b) {
|
|
959
|
-
var f = b.numFailures,
|
|
960
|
-
if (f === 0) return s ?
|
|
959
|
+
var f = b.numFailures, _ = b.results, p = b.lastResult, b = b.failures;
|
|
960
|
+
if (f === 0) return s ? _ : p;
|
|
961
961
|
throw new Je("".concat(a.name, ".bulkPut(): ").concat(f, " of ").concat(h, " operations failed"), b);
|
|
962
962
|
});
|
|
963
963
|
});
|
|
@@ -970,27 +970,27 @@ function Ra() {
|
|
|
970
970
|
return this._trans("readwrite", function(u) {
|
|
971
971
|
return n.getMany({ trans: u, keys: a, cache: "clone" }).then(function(c) {
|
|
972
972
|
var h = [], g = [];
|
|
973
|
-
e.forEach(function(f,
|
|
974
|
-
var p = f.key, b = f.changes, w = c[
|
|
973
|
+
e.forEach(function(f, _) {
|
|
974
|
+
var p = f.key, b = f.changes, w = c[_];
|
|
975
975
|
if (w) {
|
|
976
|
-
for (var y = 0,
|
|
977
|
-
var E =
|
|
976
|
+
for (var y = 0, S = Object.keys(b); y < S.length; y++) {
|
|
977
|
+
var E = S[y], O = b[E];
|
|
978
978
|
if (E === t.schema.primKey.keyPath) {
|
|
979
979
|
if (Y(O, p) !== 0) throw new $.Constraint("Cannot update primary key in bulkUpdate()");
|
|
980
980
|
} else fe(w, E, O);
|
|
981
981
|
}
|
|
982
|
-
s.push(
|
|
982
|
+
s.push(_), h.push(p), g.push(w);
|
|
983
983
|
}
|
|
984
984
|
});
|
|
985
985
|
var v = h.length;
|
|
986
986
|
return n.mutate({ trans: u, type: "put", keys: h, values: g, updates: { keys: a, changeSpecs: i } }).then(function(f) {
|
|
987
|
-
var
|
|
988
|
-
if (
|
|
987
|
+
var _ = f.numFailures, p = f.failures;
|
|
988
|
+
if (_ === 0) return v;
|
|
989
989
|
for (var b = 0, w = Object.keys(p); b < w.length; b++) {
|
|
990
|
-
var y,
|
|
991
|
-
E != null && (y = p[
|
|
990
|
+
var y, S = w[b], E = s[Number(S)];
|
|
991
|
+
E != null && (y = p[S], delete p[S], p[E] = y);
|
|
992
992
|
}
|
|
993
|
-
throw new Je("".concat(t.name, ".bulkUpdate(): ").concat(
|
|
993
|
+
throw new Je("".concat(t.name, ".bulkUpdate(): ").concat(_, " of ").concat(v, " operations failed"), p);
|
|
994
994
|
});
|
|
995
995
|
});
|
|
996
996
|
});
|
|
@@ -1025,17 +1025,17 @@ function Ra() {
|
|
|
1025
1025
|
var v = { subscribers: [], fire: h = h || J, subscribe: function(f) {
|
|
1026
1026
|
v.subscribers.indexOf(f) === -1 && (v.subscribers.push(f), v.fire = c(v.fire, f));
|
|
1027
1027
|
}, unsubscribe: function(f) {
|
|
1028
|
-
v.subscribers = v.subscribers.filter(function(
|
|
1029
|
-
return
|
|
1028
|
+
v.subscribers = v.subscribers.filter(function(_) {
|
|
1029
|
+
return _ !== f;
|
|
1030
1030
|
}), v.fire = v.subscribers.reduce(c, h);
|
|
1031
1031
|
} };
|
|
1032
1032
|
return n[u] = t[u] = v;
|
|
1033
1033
|
}
|
|
1034
1034
|
K(g = u).forEach(function(f) {
|
|
1035
|
-
var
|
|
1036
|
-
if (U(
|
|
1035
|
+
var _ = g[f];
|
|
1036
|
+
if (U(_)) s(f, g[f][0], g[f][1]);
|
|
1037
1037
|
else {
|
|
1038
|
-
if (
|
|
1038
|
+
if (_ !== "asap") throw new $.InvalidArgument("Invalid event config");
|
|
1039
1039
|
var p = s(f, st, function() {
|
|
1040
1040
|
for (var b = arguments.length, w = new Array(b); b--; ) w[b] = arguments[b];
|
|
1041
1041
|
p.subscribers.forEach(function(y) {
|
|
@@ -1078,10 +1078,10 @@ function Ra() {
|
|
|
1078
1078
|
if (e.or) {
|
|
1079
1079
|
var s = {}, u = function(c, h, g) {
|
|
1080
1080
|
var v, f;
|
|
1081
|
-
i && !i(h, g, function(
|
|
1082
|
-
return h.stop(
|
|
1083
|
-
}, function(
|
|
1084
|
-
return h.fail(
|
|
1081
|
+
i && !i(h, g, function(_) {
|
|
1082
|
+
return h.stop(_);
|
|
1083
|
+
}, function(_) {
|
|
1084
|
+
return h.fail(_);
|
|
1085
1085
|
}) || ((f = "" + (v = h.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(v)), ee(s, f) || (s[f] = !0, t(c, h, g)));
|
|
1086
1086
|
};
|
|
1087
1087
|
return Promise.all([e.or._iterate(u, n), fr(dr(e, a, n), e.algorithm, u, !e.keysOnly && e.valueMapper)]);
|
|
@@ -1306,15 +1306,15 @@ function Ra() {
|
|
|
1306
1306
|
return this._write(function(a) {
|
|
1307
1307
|
var i, s, u;
|
|
1308
1308
|
u = typeof e == "function" ? e : (i = K(e), s = i.length, function(y) {
|
|
1309
|
-
for (var
|
|
1309
|
+
for (var S = !1, E = 0; E < s; ++E) {
|
|
1310
1310
|
var O = i[E], A = e[O], P = we(y, O);
|
|
1311
|
-
A instanceof ht ? (fe(y, O, A.execute(P)),
|
|
1311
|
+
A instanceof ht ? (fe(y, O, A.execute(P)), S = !0) : P !== A && (fe(y, O, A), S = !0);
|
|
1312
1312
|
}
|
|
1313
|
-
return
|
|
1313
|
+
return S;
|
|
1314
1314
|
});
|
|
1315
1315
|
var c = n.table.core, f = c.schema.primaryKey, h = f.outbound, g = f.extractKey, v = 200, f = t.db._options.modifyChunkSize;
|
|
1316
1316
|
f && (v = typeof f == "object" ? f[c.name] || f["*"] || 200 : f);
|
|
1317
|
-
function
|
|
1317
|
+
function _(y, O) {
|
|
1318
1318
|
var E = O.failures, O = O.numFailures;
|
|
1319
1319
|
b += y - O;
|
|
1320
1320
|
for (var A = 0, P = K(E); A < P.length; A++) {
|
|
@@ -1324,7 +1324,7 @@ function Ra() {
|
|
|
1324
1324
|
}
|
|
1325
1325
|
var p = [], b = 0, w = [];
|
|
1326
1326
|
return t.clone().primaryKeys().then(function(y) {
|
|
1327
|
-
function
|
|
1327
|
+
function S(O) {
|
|
1328
1328
|
var A = Math.min(v, y.length - O);
|
|
1329
1329
|
return c.getMany({ trans: a, keys: y.slice(O, O + A), cache: "immutable" }).then(function(P) {
|
|
1330
1330
|
for (var T = [], I = [], C = h ? [] : null, j = [], R = 0; R < A; ++R) {
|
|
@@ -1333,22 +1333,22 @@ function Ra() {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
return Promise.resolve(0 < T.length && c.mutate({ trans: a, type: "add", values: T }).then(function(z) {
|
|
1335
1335
|
for (var H in z.failures) j.splice(parseInt(H), 1);
|
|
1336
|
-
|
|
1336
|
+
_(T.length, z);
|
|
1337
1337
|
})).then(function() {
|
|
1338
1338
|
return (0 < I.length || E && typeof e == "object") && c.mutate({ trans: a, type: "put", keys: C, values: I, criteria: E, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < O }).then(function(z) {
|
|
1339
|
-
return
|
|
1339
|
+
return _(I.length, z);
|
|
1340
1340
|
});
|
|
1341
1341
|
}).then(function() {
|
|
1342
1342
|
return (0 < j.length || E && e === vn) && c.mutate({ trans: a, type: "delete", keys: j, criteria: E, isAdditionalChunk: 0 < O }).then(function(z) {
|
|
1343
|
-
return
|
|
1343
|
+
return _(j.length, z);
|
|
1344
1344
|
});
|
|
1345
1345
|
}).then(function() {
|
|
1346
|
-
return y.length > O + A &&
|
|
1346
|
+
return y.length > O + A && S(O + v);
|
|
1347
1347
|
});
|
|
1348
1348
|
});
|
|
1349
1349
|
}
|
|
1350
1350
|
var E = tt(n) && n.limit === 1 / 0 && (typeof e != "function" || e === vn) && { index: n.index, range: n.range };
|
|
1351
|
-
return
|
|
1351
|
+
return S(0).then(function() {
|
|
1352
1352
|
if (0 < p.length) throw new Et("Error modifying one or more objects", p, b, w);
|
|
1353
1353
|
return y.length;
|
|
1354
1354
|
});
|
|
@@ -1393,7 +1393,7 @@ function Ra() {
|
|
|
1393
1393
|
if (!n.every(function(b) {
|
|
1394
1394
|
return typeof b == "string";
|
|
1395
1395
|
})) return he(e, ir);
|
|
1396
|
-
function
|
|
1396
|
+
function _(b) {
|
|
1397
1397
|
i = b === "next" ? function(y) {
|
|
1398
1398
|
return y.toUpperCase();
|
|
1399
1399
|
} : function(y) {
|
|
@@ -1405,8 +1405,8 @@ function Ra() {
|
|
|
1405
1405
|
}, u = b === "next" ? sa : oa;
|
|
1406
1406
|
var w = n.map(function(y) {
|
|
1407
1407
|
return { lower: s(y), upper: i(y) };
|
|
1408
|
-
}).sort(function(y,
|
|
1409
|
-
return u(y.lower,
|
|
1408
|
+
}).sort(function(y, S) {
|
|
1409
|
+
return u(y.lower, S.lower);
|
|
1410
1410
|
});
|
|
1411
1411
|
c = w.map(function(y) {
|
|
1412
1412
|
return y.upper;
|
|
@@ -1414,16 +1414,16 @@ function Ra() {
|
|
|
1414
1414
|
return y.lower;
|
|
1415
1415
|
}), v = (g = b) === "next" ? "" : a;
|
|
1416
1416
|
}
|
|
1417
|
-
|
|
1417
|
+
_("next"), e = new e.Collection(e, function() {
|
|
1418
1418
|
return Ie(c[0], h[f - 1] + a);
|
|
1419
1419
|
}), e._ondirectionchange = function(b) {
|
|
1420
|
-
|
|
1420
|
+
_(b);
|
|
1421
1421
|
};
|
|
1422
1422
|
var p = 0;
|
|
1423
1423
|
return e._addAlgorithm(function(b, w, y) {
|
|
1424
|
-
var
|
|
1425
|
-
if (typeof
|
|
1426
|
-
var E = s(
|
|
1424
|
+
var S = b.key;
|
|
1425
|
+
if (typeof S != "string") return !1;
|
|
1426
|
+
var E = s(S);
|
|
1427
1427
|
if (t(E, h, p)) return !0;
|
|
1428
1428
|
for (var O = null, A = p; A < f; ++A) {
|
|
1429
1429
|
var P = function(T, I, C, j, R, L) {
|
|
@@ -1433,7 +1433,7 @@ function Ra() {
|
|
|
1433
1433
|
R(T[H], pe) < 0 && (z = H);
|
|
1434
1434
|
}
|
|
1435
1435
|
return W < j.length && L === "next" ? T + C.substr(T.length) : W < T.length && L === "prev" ? T.substr(0, C.length) : z < 0 ? null : T.substr(0, z) + j[z] + C.substr(z + 1);
|
|
1436
|
-
}(
|
|
1436
|
+
}(S, E, c[A], h[A], u, g);
|
|
1437
1437
|
P === null && O === null ? p = A + 1 : (O === null || 0 < u(O, P)) && (O = P);
|
|
1438
1438
|
}
|
|
1439
1439
|
return w(O !== null ? function() {
|
|
@@ -1456,26 +1456,26 @@ function Ra() {
|
|
|
1456
1456
|
return Ie(e, t, !n, !a);
|
|
1457
1457
|
});
|
|
1458
1458
|
} catch {
|
|
1459
|
-
return he(this,
|
|
1459
|
+
return he(this, Se);
|
|
1460
1460
|
}
|
|
1461
1461
|
}, ie.prototype.equals = function(e) {
|
|
1462
|
-
return e == null ? he(this,
|
|
1462
|
+
return e == null ? he(this, Se) : new this.Collection(this, function() {
|
|
1463
1463
|
return pr(e);
|
|
1464
1464
|
});
|
|
1465
1465
|
}, ie.prototype.above = function(e) {
|
|
1466
|
-
return e == null ? he(this,
|
|
1466
|
+
return e == null ? he(this, Se) : new this.Collection(this, function() {
|
|
1467
1467
|
return Ie(e, void 0, !0);
|
|
1468
1468
|
});
|
|
1469
1469
|
}, ie.prototype.aboveOrEqual = function(e) {
|
|
1470
|
-
return e == null ? he(this,
|
|
1470
|
+
return e == null ? he(this, Se) : new this.Collection(this, function() {
|
|
1471
1471
|
return Ie(e, void 0, !1);
|
|
1472
1472
|
});
|
|
1473
1473
|
}, ie.prototype.below = function(e) {
|
|
1474
|
-
return e == null ? he(this,
|
|
1474
|
+
return e == null ? he(this, Se) : new this.Collection(this, function() {
|
|
1475
1475
|
return Ie(void 0, e, !1, !0);
|
|
1476
1476
|
});
|
|
1477
1477
|
}, ie.prototype.belowOrEqual = function(e) {
|
|
1478
|
-
return e == null ? he(this,
|
|
1478
|
+
return e == null ? he(this, Se) : new this.Collection(this, function() {
|
|
1479
1479
|
return Ie(void 0, e);
|
|
1480
1480
|
});
|
|
1481
1481
|
}, ie.prototype.startsWith = function(e) {
|
|
@@ -1489,23 +1489,23 @@ function Ra() {
|
|
|
1489
1489
|
return t === n[0];
|
|
1490
1490
|
}, [e], "");
|
|
1491
1491
|
}, ie.prototype.anyOfIgnoreCase = function() {
|
|
1492
|
-
var e =
|
|
1492
|
+
var e = _e.apply(Qe, arguments);
|
|
1493
1493
|
return e.length === 0 ? nt(this) : Kt(this, function(t, n) {
|
|
1494
1494
|
return n.indexOf(t) !== -1;
|
|
1495
1495
|
}, e, "");
|
|
1496
1496
|
}, ie.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1497
|
-
var e =
|
|
1497
|
+
var e = _e.apply(Qe, arguments);
|
|
1498
1498
|
return e.length === 0 ? nt(this) : Kt(this, function(t, n) {
|
|
1499
1499
|
return n.some(function(a) {
|
|
1500
1500
|
return t.indexOf(a) === 0;
|
|
1501
1501
|
});
|
|
1502
1502
|
}, e, $e);
|
|
1503
1503
|
}, ie.prototype.anyOf = function() {
|
|
1504
|
-
var e = this, t =
|
|
1504
|
+
var e = this, t = _e.apply(Qe, arguments), n = this._cmp;
|
|
1505
1505
|
try {
|
|
1506
1506
|
t.sort(n);
|
|
1507
1507
|
} catch {
|
|
1508
|
-
return he(this,
|
|
1508
|
+
return he(this, Se);
|
|
1509
1509
|
}
|
|
1510
1510
|
if (t.length === 0) return nt(this);
|
|
1511
1511
|
var a = new this.Collection(this, function() {
|
|
@@ -1524,29 +1524,29 @@ function Ra() {
|
|
|
1524
1524
|
}, ie.prototype.notEqual = function(e) {
|
|
1525
1525
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1526
1526
|
}, ie.prototype.noneOf = function() {
|
|
1527
|
-
var e =
|
|
1527
|
+
var e = _e.apply(Qe, arguments);
|
|
1528
1528
|
if (e.length === 0) return new this.Collection(this);
|
|
1529
1529
|
try {
|
|
1530
1530
|
e.sort(this._ascending);
|
|
1531
1531
|
} catch {
|
|
1532
|
-
return he(this,
|
|
1532
|
+
return he(this, Se);
|
|
1533
1533
|
}
|
|
1534
1534
|
var t = e.reduce(function(n, a) {
|
|
1535
1535
|
return n ? n.concat([[n[n.length - 1][1], a]]) : [[-1 / 0, a]];
|
|
1536
1536
|
}, null);
|
|
1537
1537
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
1538
|
-
}, ie.prototype.inAnyRange = function(
|
|
1538
|
+
}, ie.prototype.inAnyRange = function(S, t) {
|
|
1539
1539
|
var n = this, a = this._cmp, i = this._ascending, s = this._descending, u = this._min, c = this._max;
|
|
1540
|
-
if (
|
|
1541
|
-
if (!
|
|
1540
|
+
if (S.length === 0) return nt(this);
|
|
1541
|
+
if (!S.every(function(E) {
|
|
1542
1542
|
return E[0] !== void 0 && E[1] !== void 0 && i(E[0], E[1]) <= 0;
|
|
1543
1543
|
})) return he(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", $.InvalidArgument);
|
|
1544
1544
|
var h = !t || t.includeLowers !== !1, g = t && t.includeUppers === !0, v, f = i;
|
|
1545
|
-
function
|
|
1545
|
+
function _(E, O) {
|
|
1546
1546
|
return f(E[0], O[0]);
|
|
1547
1547
|
}
|
|
1548
1548
|
try {
|
|
1549
|
-
(v =
|
|
1549
|
+
(v = S.reduce(function(E, O) {
|
|
1550
1550
|
for (var A = 0, P = E.length; A < P; ++A) {
|
|
1551
1551
|
var T = E[A];
|
|
1552
1552
|
if (a(O[0], T[1]) < 0 && 0 < a(O[1], T[0])) {
|
|
@@ -1555,9 +1555,9 @@ function Ra() {
|
|
|
1555
1555
|
}
|
|
1556
1556
|
}
|
|
1557
1557
|
return A === P && E.push(O), E;
|
|
1558
|
-
}, [])).sort(
|
|
1558
|
+
}, [])).sort(_);
|
|
1559
1559
|
} catch {
|
|
1560
|
-
return he(this,
|
|
1560
|
+
return he(this, Se);
|
|
1561
1561
|
}
|
|
1562
1562
|
var p = 0, b = g ? function(E) {
|
|
1563
1563
|
return 0 < i(E, v[p][1]);
|
|
@@ -1567,19 +1567,19 @@ function Ra() {
|
|
|
1567
1567
|
return 0 < s(E, v[p][0]);
|
|
1568
1568
|
} : function(E) {
|
|
1569
1569
|
return 0 <= s(E, v[p][0]);
|
|
1570
|
-
}, y = b,
|
|
1570
|
+
}, y = b, S = new this.Collection(this, function() {
|
|
1571
1571
|
return Ie(v[0][0], v[v.length - 1][1], !h, !g);
|
|
1572
1572
|
});
|
|
1573
|
-
return
|
|
1574
|
-
f = E === "next" ? (y = b, i) : (y = w, s), v.sort(
|
|
1575
|
-
},
|
|
1573
|
+
return S._ondirectionchange = function(E) {
|
|
1574
|
+
f = E === "next" ? (y = b, i) : (y = w, s), v.sort(_);
|
|
1575
|
+
}, S._addAlgorithm(function(E, O, A) {
|
|
1576
1576
|
for (var P, T = E.key; y(T); ) if (++p === v.length) return O(A), !1;
|
|
1577
1577
|
return !b(P = T) && !w(P) || (n._cmp(T, v[p][1]) === 0 || n._cmp(T, v[p][0]) === 0 || O(function() {
|
|
1578
1578
|
f === i ? E.continue(v[p][0]) : E.continue(v[p][1]);
|
|
1579
1579
|
}), !1);
|
|
1580
|
-
}),
|
|
1580
|
+
}), S;
|
|
1581
1581
|
}, ie.prototype.startsWithAnyOf = function() {
|
|
1582
|
-
var e =
|
|
1582
|
+
var e = _e.apply(Qe, arguments);
|
|
1583
1583
|
return e.every(function(t) {
|
|
1584
1584
|
return typeof t == "string";
|
|
1585
1585
|
}) ? e.length === 0 ? nt(this) : this.inAnyRange(e.map(function(t) {
|
|
@@ -1684,13 +1684,13 @@ function Ra() {
|
|
|
1684
1684
|
}, ve);
|
|
1685
1685
|
function ve() {
|
|
1686
1686
|
}
|
|
1687
|
-
function
|
|
1687
|
+
function _n(e, t, n, a, i, s, u) {
|
|
1688
1688
|
return { name: e, keyPath: t, unique: n, multi: a, auto: i, compound: s, src: (n && !u ? "&" : "") + (a ? "*" : "") + (i ? "++" : "") + yr(t) };
|
|
1689
1689
|
}
|
|
1690
1690
|
function yr(e) {
|
|
1691
1691
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function Sn(e, t, n) {
|
|
1694
1694
|
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (a = function(i) {
|
|
1695
1695
|
return [i.name, i];
|
|
1696
1696
|
}, n.reduce(function(i, s, u) {
|
|
@@ -1734,14 +1734,14 @@ function Ra() {
|
|
|
1734
1734
|
var p = y.lower, b = y.upper, w = y.lowerOpen, y = y.upperOpen;
|
|
1735
1735
|
return p === void 0 ? b === void 0 ? null : t.upperBound(b, !!y) : b === void 0 ? t.lowerBound(p, !!w) : t.bound(p, b, !!w, !!y);
|
|
1736
1736
|
}
|
|
1737
|
-
function i(
|
|
1738
|
-
var p, b =
|
|
1739
|
-
return { name: b, schema:
|
|
1740
|
-
var y = w.trans,
|
|
1737
|
+
function i(_) {
|
|
1738
|
+
var p, b = _.name;
|
|
1739
|
+
return { name: b, schema: _, mutate: function(w) {
|
|
1740
|
+
var y = w.trans, S = w.type, E = w.keys, O = w.values, A = w.range;
|
|
1741
1741
|
return new Promise(function(P, T) {
|
|
1742
1742
|
P = q(P);
|
|
1743
|
-
var I = y.objectStore(b), C = I.keyPath == null, j =
|
|
1744
|
-
if (!j &&
|
|
1743
|
+
var I = y.objectStore(b), C = I.keyPath == null, j = S === "put" || S === "add";
|
|
1744
|
+
if (!j && S !== "delete" && S !== "deleteRange") throw new Error("Invalid operation type: " + S);
|
|
1745
1745
|
var R, L = (E || O || { length: 1 }).length;
|
|
1746
1746
|
if (E && O && E.length !== O.length) throw new Error("Given keys array must have same length as given values array.");
|
|
1747
1747
|
if (L === 0) return P({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
@@ -1749,18 +1749,18 @@ function Ra() {
|
|
|
1749
1749
|
++pe, pt(de);
|
|
1750
1750
|
}
|
|
1751
1751
|
var z = [], H = [], pe = 0;
|
|
1752
|
-
if (
|
|
1752
|
+
if (S === "deleteRange") {
|
|
1753
1753
|
if (A.type === 4) return P({ numFailures: pe, failures: H, results: [], lastResult: void 0 });
|
|
1754
1754
|
A.type === 3 ? z.push(R = I.clear()) : z.push(R = I.delete(a(A)));
|
|
1755
1755
|
} else {
|
|
1756
1756
|
var C = j ? C ? [O, E] : [O, null] : [E, null], F = C[0], ue = C[1];
|
|
1757
|
-
if (j) for (var ce = 0; ce < L; ++ce) z.push(R = ue && ue[ce] !== void 0 ? I[
|
|
1758
|
-
else for (ce = 0; ce < L; ++ce) z.push(R = I[
|
|
1757
|
+
if (j) for (var ce = 0; ce < L; ++ce) z.push(R = ue && ue[ce] !== void 0 ? I[S](F[ce], ue[ce]) : I[S](F[ce])), R.onerror = W;
|
|
1758
|
+
else for (ce = 0; ce < L; ++ce) z.push(R = I[S](F[ce])), R.onerror = W;
|
|
1759
1759
|
}
|
|
1760
1760
|
function Jt(de) {
|
|
1761
1761
|
de = de.target.result, z.forEach(function(ze, $n) {
|
|
1762
1762
|
return ze.error != null && (H[$n] = ze.error);
|
|
1763
|
-
}), P({ numFailures: pe, failures: H, results:
|
|
1763
|
+
}), P({ numFailures: pe, failures: H, results: S === "delete" ? E : z.map(function(ze) {
|
|
1764
1764
|
return ze.result;
|
|
1765
1765
|
}), lastResult: de });
|
|
1766
1766
|
}
|
|
@@ -1769,40 +1769,40 @@ function Ra() {
|
|
|
1769
1769
|
}, R.onsuccess = Jt;
|
|
1770
1770
|
});
|
|
1771
1771
|
}, getMany: function(w) {
|
|
1772
|
-
var y = w.trans,
|
|
1772
|
+
var y = w.trans, S = w.keys;
|
|
1773
1773
|
return new Promise(function(E, O) {
|
|
1774
1774
|
E = q(E);
|
|
1775
|
-
for (var A, P = y.objectStore(b), T =
|
|
1775
|
+
for (var A, P = y.objectStore(b), T = S.length, I = new Array(T), C = 0, j = 0, R = function(z) {
|
|
1776
1776
|
z = z.target, I[z._pos] = z.result, ++j === C && E(I);
|
|
1777
|
-
}, L = be(O), W = 0; W < T; ++W)
|
|
1777
|
+
}, L = be(O), W = 0; W < T; ++W) S[W] != null && ((A = P.get(S[W]))._pos = W, A.onsuccess = R, A.onerror = L, ++C);
|
|
1778
1778
|
C === 0 && E(I);
|
|
1779
1779
|
});
|
|
1780
1780
|
}, get: function(w) {
|
|
1781
|
-
var y = w.trans,
|
|
1781
|
+
var y = w.trans, S = w.key;
|
|
1782
1782
|
return new Promise(function(E, O) {
|
|
1783
1783
|
E = q(E);
|
|
1784
|
-
var A = y.objectStore(b).get(
|
|
1784
|
+
var A = y.objectStore(b).get(S);
|
|
1785
1785
|
A.onsuccess = function(P) {
|
|
1786
1786
|
return E(P.target.result);
|
|
1787
1787
|
}, A.onerror = be(O);
|
|
1788
1788
|
});
|
|
1789
1789
|
}, query: (p = g, function(w) {
|
|
1790
|
-
return new Promise(function(y,
|
|
1790
|
+
return new Promise(function(y, S) {
|
|
1791
1791
|
y = q(y);
|
|
1792
1792
|
var E, O, A, C = w.trans, P = w.values, T = w.limit, R = w.query, I = T === 1 / 0 ? void 0 : T, j = R.index, R = R.range, C = C.objectStore(b), j = j.isPrimaryKey ? C : C.index(j.name), R = a(R);
|
|
1793
1793
|
if (T === 0) return y({ result: [] });
|
|
1794
1794
|
p ? ((I = P ? j.getAll(R, I) : j.getAllKeys(R, I)).onsuccess = function(L) {
|
|
1795
1795
|
return y({ result: L.target.result });
|
|
1796
|
-
}, I.onerror = be(
|
|
1796
|
+
}, I.onerror = be(S)) : (E = 0, O = !P && "openKeyCursor" in j ? j.openKeyCursor(R) : j.openCursor(R), A = [], O.onsuccess = function(L) {
|
|
1797
1797
|
var W = O.result;
|
|
1798
1798
|
return W ? (A.push(P ? W.value : W.primaryKey), ++E === T ? y({ result: A }) : void W.continue()) : y({ result: A });
|
|
1799
|
-
}, O.onerror = be(
|
|
1799
|
+
}, O.onerror = be(S));
|
|
1800
1800
|
});
|
|
1801
1801
|
}), openCursor: function(w) {
|
|
1802
|
-
var y = w.trans,
|
|
1802
|
+
var y = w.trans, S = w.values, E = w.query, O = w.reverse, A = w.unique;
|
|
1803
1803
|
return new Promise(function(P, T) {
|
|
1804
1804
|
P = q(P);
|
|
1805
|
-
var j = E.index, I = E.range, C = y.objectStore(b), C = j.isPrimaryKey ? C : C.index(j.name), j = O ? A ? "prevunique" : "prev" : A ? "nextunique" : "next", R = !
|
|
1805
|
+
var j = E.index, I = E.range, C = y.objectStore(b), C = j.isPrimaryKey ? C : C.index(j.name), j = O ? A ? "prevunique" : "prev" : A ? "nextunique" : "next", R = !S && "openKeyCursor" in C ? C.openKeyCursor(a(I), j) : C.openCursor(a(I), j);
|
|
1806
1806
|
R.onerror = be(T), R.onsuccess = q(function(L) {
|
|
1807
1807
|
var W, z, H, pe, F = R.result;
|
|
1808
1808
|
F ? (F.___id = ++ca, F.done = !1, W = F.continue.bind(F), z = (z = F.continuePrimaryKey) && z.bind(F), H = F.advance.bind(F), pe = function() {
|
|
@@ -1839,39 +1839,39 @@ function Ra() {
|
|
|
1839
1839
|
}, T);
|
|
1840
1840
|
});
|
|
1841
1841
|
}, count: function(w) {
|
|
1842
|
-
var y = w.query,
|
|
1842
|
+
var y = w.query, S = w.trans, E = y.index, O = y.range;
|
|
1843
1843
|
return new Promise(function(A, P) {
|
|
1844
|
-
var T =
|
|
1844
|
+
var T = S.objectStore(b), I = E.isPrimaryKey ? T : T.index(E.name), T = a(O), I = T ? I.count(T) : I.count();
|
|
1845
1845
|
I.onsuccess = q(function(C) {
|
|
1846
1846
|
return A(C.target.result);
|
|
1847
1847
|
}), I.onerror = be(P);
|
|
1848
1848
|
});
|
|
1849
1849
|
} };
|
|
1850
1850
|
}
|
|
1851
|
-
var s, u, c, v = (u = h, c = mr((s = e).objectStoreNames), { schema: { name: s.name, tables: c.map(function(
|
|
1852
|
-
return u.objectStore(
|
|
1853
|
-
}).map(function(
|
|
1854
|
-
var p =
|
|
1855
|
-
return
|
|
1851
|
+
var s, u, c, v = (u = h, c = mr((s = e).objectStoreNames), { schema: { name: s.name, tables: c.map(function(_) {
|
|
1852
|
+
return u.objectStore(_);
|
|
1853
|
+
}).map(function(_) {
|
|
1854
|
+
var p = _.keyPath, y = _.autoIncrement, b = U(p), w = {}, y = { name: _.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: b, keyPath: p, autoIncrement: y, unique: !0, extractKey: En(p) }, indexes: mr(_.indexNames).map(function(S) {
|
|
1855
|
+
return _.index(S);
|
|
1856
1856
|
}).map(function(A) {
|
|
1857
1857
|
var E = A.name, O = A.unique, P = A.multiEntry, A = A.keyPath, P = { name: E, compound: U(A), keyPath: A, unique: O, multiEntry: P, extractKey: En(A) };
|
|
1858
1858
|
return w[mt(A)] = P;
|
|
1859
|
-
}), getIndexByKeyPath: function(
|
|
1860
|
-
return w[mt(
|
|
1859
|
+
}), getIndexByKeyPath: function(S) {
|
|
1860
|
+
return w[mt(S)];
|
|
1861
1861
|
} };
|
|
1862
1862
|
return w[":id"] = y.primaryKey, p != null && (w[mt(p)] = y.primaryKey), y;
|
|
1863
1863
|
}) }, hasGetAll: 0 < c.length && "getAll" in u.objectStore(c[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = v.schema, g = v.hasGetAll, v = h.tables.map(i), f = {};
|
|
1864
|
-
return v.forEach(function(
|
|
1865
|
-
return f[
|
|
1866
|
-
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(
|
|
1867
|
-
if (!f[
|
|
1868
|
-
return f[
|
|
1864
|
+
return v.forEach(function(_) {
|
|
1865
|
+
return f[_.name] = _;
|
|
1866
|
+
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(_) {
|
|
1867
|
+
if (!f[_]) throw new Error("Table '".concat(_, "' not found"));
|
|
1868
|
+
return f[_];
|
|
1869
1869
|
}, MIN_KEY: -1 / 0, MAX_KEY: yt(t), schema: h };
|
|
1870
1870
|
}
|
|
1871
1871
|
function da(e, t, n, a) {
|
|
1872
1872
|
var i = n.IDBKeyRange;
|
|
1873
1873
|
return n.indexedDB, { dbcore: (a = la(t, i, a), e.dbcore.reduce(function(s, u) {
|
|
1874
|
-
return u = u.create,
|
|
1874
|
+
return u = u.create, d(d({}, s), u(s));
|
|
1875
1875
|
}, a)) };
|
|
1876
1876
|
}
|
|
1877
1877
|
function Bt(e, a) {
|
|
@@ -1908,7 +1908,7 @@ function Ra() {
|
|
|
1908
1908
|
}
|
|
1909
1909
|
function ha(e, t, n, a) {
|
|
1910
1910
|
var i = e._dbSchema;
|
|
1911
|
-
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta =
|
|
1911
|
+
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = Sn("$meta", vr("")[0], []), e._storeNames.push("$meta"));
|
|
1912
1912
|
var s = e._createTransaction("readwrite", e._storeNames, i);
|
|
1913
1913
|
s.create(n), s._completion.catch(a);
|
|
1914
1914
|
var u = s._reject.bind(s), c = G.transless || G;
|
|
@@ -1916,11 +1916,11 @@ function Ra() {
|
|
|
1916
1916
|
return G.trans = s, G.transless = c, t !== 0 ? (Bt(e, n), g = t, ((h = s).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(v) {
|
|
1917
1917
|
return v ?? g;
|
|
1918
1918
|
}) : B.resolve(g)).then(function(v) {
|
|
1919
|
-
return
|
|
1920
|
-
return
|
|
1921
|
-
})).length !== 0 ? (v.forEach(function(
|
|
1919
|
+
return _ = v, p = s, b = n, w = [], v = (f = e)._versions, y = f._dbSchema = $t(0, f.idbdb, b), (v = v.filter(function(S) {
|
|
1920
|
+
return S._cfg.version >= _;
|
|
1921
|
+
})).length !== 0 ? (v.forEach(function(S) {
|
|
1922
1922
|
w.push(function() {
|
|
1923
|
-
var E = y, O =
|
|
1923
|
+
var E = y, O = S._cfg.dbschema;
|
|
1924
1924
|
Ut(f, E, b), Ut(f, O, b), y = f._dbSchema = O;
|
|
1925
1925
|
var A = xn(E, O);
|
|
1926
1926
|
A.add.forEach(function(j) {
|
|
@@ -1936,8 +1936,8 @@ function Ra() {
|
|
|
1936
1936
|
return R.deleteIndex(L);
|
|
1937
1937
|
});
|
|
1938
1938
|
});
|
|
1939
|
-
var P =
|
|
1940
|
-
if (P &&
|
|
1939
|
+
var P = S._cfg.contentUpgrade;
|
|
1940
|
+
if (P && S._cfg.version > _) {
|
|
1941
1941
|
Bt(f, b), p._memoizedTables = {};
|
|
1942
1942
|
var T = Qn(O);
|
|
1943
1943
|
A.del.forEach(function(j) {
|
|
@@ -1952,21 +1952,21 @@ function Ra() {
|
|
|
1952
1952
|
});
|
|
1953
1953
|
}
|
|
1954
1954
|
}), w.push(function(E) {
|
|
1955
|
-
var O, A, P =
|
|
1955
|
+
var O, A, P = S._cfg.dbschema;
|
|
1956
1956
|
O = P, A = E, [].slice.call(A.db.objectStoreNames).forEach(function(T) {
|
|
1957
1957
|
return O[T] == null && A.db.deleteObjectStore(T);
|
|
1958
1958
|
}), On(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), p.schema = f._dbSchema;
|
|
1959
1959
|
}), w.push(function(E) {
|
|
1960
|
-
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) ===
|
|
1960
|
+
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) === S._cfg.version ? (f.idbdb.deleteObjectStore("$meta"), delete f._dbSchema.$meta, f._storeNames = f._storeNames.filter(function(O) {
|
|
1961
1961
|
return O !== "$meta";
|
|
1962
|
-
})) : E.objectStore("$meta").put(
|
|
1962
|
+
})) : E.objectStore("$meta").put(S._cfg.version, "version"));
|
|
1963
1963
|
});
|
|
1964
|
-
}), function
|
|
1965
|
-
return w.length ? B.resolve(w.shift()(p.idbtrans)).then(
|
|
1964
|
+
}), function S() {
|
|
1965
|
+
return w.length ? B.resolve(w.shift()(p.idbtrans)).then(S) : B.resolve();
|
|
1966
1966
|
}().then(function() {
|
|
1967
1967
|
br(y, b);
|
|
1968
1968
|
})) : B.resolve();
|
|
1969
|
-
var f,
|
|
1969
|
+
var f, _, p, b, w, y;
|
|
1970
1970
|
}).catch(u)) : (K(i).forEach(function(v) {
|
|
1971
1971
|
An(n, v, i[v].primKey, i[v].indexes);
|
|
1972
1972
|
}), Bt(e, n), void B.follow(function() {
|
|
@@ -2027,12 +2027,12 @@ function Ra() {
|
|
|
2027
2027
|
}
|
|
2028
2028
|
function $t(e, t, n) {
|
|
2029
2029
|
var a = {};
|
|
2030
|
-
return
|
|
2031
|
-
for (var s = n.objectStore(i), u =
|
|
2032
|
-
var v = s.index(s.indexNames[h]), g = v.keyPath, v =
|
|
2030
|
+
return St(t.objectStoreNames, 0).forEach(function(i) {
|
|
2031
|
+
for (var s = n.objectStore(i), u = _n(yr(g = s.keyPath), g || "", !0, !1, !!s.autoIncrement, g && typeof g != "string", !0), c = [], h = 0; h < s.indexNames.length; ++h) {
|
|
2032
|
+
var v = s.index(s.indexNames[h]), g = v.keyPath, v = _n(v.name, g, !!v.unique, !!v.multiEntry, !1, g && typeof g != "string", !1);
|
|
2033
2033
|
c.push(v);
|
|
2034
2034
|
}
|
|
2035
|
-
a[i] =
|
|
2035
|
+
a[i] = Sn(i, u, c);
|
|
2036
2036
|
}), a;
|
|
2037
2037
|
}
|
|
2038
2038
|
function Ut(e, t, n) {
|
|
@@ -2040,7 +2040,7 @@ function Ra() {
|
|
|
2040
2040
|
var s = a[i], u = n.objectStore(s);
|
|
2041
2041
|
e._hasGetAll = "getAll" in u;
|
|
2042
2042
|
for (var c = 0; c < u.indexNames.length; ++c) {
|
|
2043
|
-
var h = u.indexNames[c], g = u.index(h).keyPath, v = typeof g == "string" ? g : "[" +
|
|
2043
|
+
var h = u.indexNames[c], g = u.index(h).keyPath, v = typeof g == "string" ? g : "[" + St(g).join("+") + "]";
|
|
2044
2044
|
!t[s] || (g = t[s].idxByName[v]) && (g.name = h, delete t[s].idxByName[v], t[s].idxByName[h] = g);
|
|
2045
2045
|
}
|
|
2046
2046
|
}
|
|
@@ -2049,7 +2049,7 @@ function Ra() {
|
|
|
2049
2049
|
function vr(e) {
|
|
2050
2050
|
return e.split(",").map(function(t, n) {
|
|
2051
2051
|
var a = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), i = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
|
|
2052
|
-
return
|
|
2052
|
+
return _n(a, i || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), U(i), n === 0);
|
|
2053
2053
|
});
|
|
2054
2054
|
}
|
|
2055
2055
|
var ga = (Ft.prototype._parseStoresSpec = function(e, t) {
|
|
@@ -2060,7 +2060,7 @@ function Ra() {
|
|
|
2060
2060
|
a.forEach(function(s) {
|
|
2061
2061
|
if (s.auto) throw new $.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2062
2062
|
if (!s.keyPath) throw new $.Schema("Index must have a name and cannot be an empty string");
|
|
2063
|
-
}), t[n] =
|
|
2063
|
+
}), t[n] = Sn(n, i, a);
|
|
2064
2064
|
}
|
|
2065
2065
|
});
|
|
2066
2066
|
}, Ft.prototype.stores = function(n) {
|
|
@@ -2103,8 +2103,8 @@ function Ra() {
|
|
|
2103
2103
|
if (0 < a) throw RangeError();
|
|
2104
2104
|
if (In(e)) return M(e, { from: t, to: n, d: 1 });
|
|
2105
2105
|
var i = e.l, a = e.r;
|
|
2106
|
-
if (Y(n, e.from) < 0) return i ? bt(i, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null },
|
|
2107
|
-
if (0 < Y(t, e.to)) return a ? bt(a, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null },
|
|
2106
|
+
if (Y(n, e.from) < 0) return i ? bt(i, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, _r(e);
|
|
2107
|
+
if (0 < Y(t, e.to)) return a ? bt(a, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, _r(e);
|
|
2108
2108
|
Y(t, e.from) < 0 && (e.from = t, e.l = null, e.d = a ? a.d + 1 : 1), 0 < Y(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, i && !e.l && vt(e, i), a && n && vt(e, a);
|
|
2109
2109
|
}
|
|
2110
2110
|
}
|
|
@@ -2143,11 +2143,11 @@ function Ra() {
|
|
|
2143
2143
|
return { done: !0 };
|
|
2144
2144
|
} };
|
|
2145
2145
|
}
|
|
2146
|
-
function
|
|
2146
|
+
function _r(e) {
|
|
2147
2147
|
var t, n, a = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), i = 1 < a ? "r" : a < -1 ? "l" : "";
|
|
2148
|
-
i && (t = i == "r" ? "l" : "r", n =
|
|
2148
|
+
i && (t = i == "r" ? "l" : "r", n = d({}, e), a = e[i], e.from = a.from, e.to = a.to, e[i] = a[i], n[i] = a[t], (e[t] = n).d = Sr(n)), e.d = Sr(e);
|
|
2149
2149
|
}
|
|
2150
|
-
function
|
|
2150
|
+
function Sr(n) {
|
|
2151
2151
|
var t = n.r, n = n.l;
|
|
2152
2152
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2153
2153
|
}
|
|
@@ -2201,10 +2201,10 @@ function Ra() {
|
|
|
2201
2201
|
function Er(e, t, n, a) {
|
|
2202
2202
|
for (var i = [], s = 0, u = Object.entries(e.queries.query); s < u.length; s++) {
|
|
2203
2203
|
for (var c = u[s], h = c[0], g = [], v = 0, f = c[1]; v < f.length; v++) {
|
|
2204
|
-
var
|
|
2205
|
-
Cn(t,
|
|
2204
|
+
var _ = f[v];
|
|
2205
|
+
Cn(t, _.obsSet) ? _.subscribers.forEach(function(y) {
|
|
2206
2206
|
return n.add(y);
|
|
2207
|
-
}) : a && g.push(
|
|
2207
|
+
}) : a && g.push(_);
|
|
2208
2208
|
}
|
|
2209
2209
|
a && i.push([h, g]);
|
|
2210
2210
|
}
|
|
@@ -2224,24 +2224,24 @@ function Ra() {
|
|
|
2224
2224
|
if (t.openCanceller !== a) throw new $.DatabaseClosed("db.open() was cancelled");
|
|
2225
2225
|
}
|
|
2226
2226
|
function c() {
|
|
2227
|
-
return new B(function(
|
|
2227
|
+
return new B(function(_, p) {
|
|
2228
2228
|
if (u(), !n) throw new $.MissingAPI();
|
|
2229
2229
|
var b = e.name, w = t.autoSchema || !i ? n.open(b) : n.open(b, i);
|
|
2230
2230
|
if (!w) throw new $.MissingAPI();
|
|
2231
2231
|
w.onerror = be(p), w.onblocked = q(e._fireOnBlocked), w.onupgradeneeded = q(function(y) {
|
|
2232
|
-
var
|
|
2233
|
-
v = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = pt, v.abort(), w.result.close(), (
|
|
2232
|
+
var S;
|
|
2233
|
+
v = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = pt, v.abort(), w.result.close(), (S = n.deleteDatabase(b)).onsuccess = S.onerror = q(function() {
|
|
2234
2234
|
p(new $.NoSuchDatabase("Database ".concat(b, " doesnt exist")));
|
|
2235
2235
|
})) : (v.onerror = be(p), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, f = y < 1, e.idbdb = w.result, s && pa(e, v), ha(e, y / 10, v, p));
|
|
2236
2236
|
}, p), w.onsuccess = q(function() {
|
|
2237
2237
|
v = null;
|
|
2238
|
-
var y,
|
|
2238
|
+
var y, S, E, O, A, P = e.idbdb = w.result, T = St(P.objectStoreNames);
|
|
2239
2239
|
if (0 < T.length) try {
|
|
2240
2240
|
var I = P.transaction((O = T).length === 1 ? O[0] : O, "readonly");
|
|
2241
|
-
if (t.autoSchema)
|
|
2241
|
+
if (t.autoSchema) S = P, E = I, (y = e).verno = S.version / 10, E = y._dbSchema = $t(0, S, E), y._storeNames = St(S.objectStoreNames, 0), Lt(y, [y._allTables], K(E), E);
|
|
2242
2242
|
else if (Ut(e, e._dbSchema, I), ((A = xn($t(0, (A = e).idbdb, I), A._dbSchema)).add.length || A.change.some(function(C) {
|
|
2243
2243
|
return C.add.length || C.change.length;
|
|
2244
|
-
})) && !s) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), P.close(), i = P.version + 1, s = !0,
|
|
2244
|
+
})) && !s) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), P.close(), i = P.version + 1, s = !0, _(c());
|
|
2245
2245
|
Bt(e, I);
|
|
2246
2246
|
} catch {
|
|
2247
2247
|
}
|
|
@@ -2249,23 +2249,23 @@ function Ra() {
|
|
|
2249
2249
|
t.vcFired = !0, e.on("versionchange").fire(C);
|
|
2250
2250
|
}), P.onclose = q(function(C) {
|
|
2251
2251
|
e.on("close").fire(C);
|
|
2252
|
-
}), f && (A = e._deps, I = b, P = A.indexedDB, A = A.IDBKeyRange, Dn(P) || I === Tt || kn(P, A).put({ name: I }).catch(J)),
|
|
2252
|
+
}), f && (A = e._deps, I = b, P = A.indexedDB, A = A.IDBKeyRange, Dn(P) || I === Tt || kn(P, A).put({ name: I }).catch(J)), _();
|
|
2253
2253
|
}, p);
|
|
2254
|
-
}).catch(function(
|
|
2255
|
-
switch (
|
|
2254
|
+
}).catch(function(_) {
|
|
2255
|
+
switch (_ == null ? void 0 : _.name) {
|
|
2256
2256
|
case "UnknownError":
|
|
2257
2257
|
if (0 < t.PR1398_maxLoop) return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), c();
|
|
2258
2258
|
break;
|
|
2259
2259
|
case "VersionError":
|
|
2260
2260
|
if (0 < i) return i = 0, c();
|
|
2261
2261
|
}
|
|
2262
|
-
return B.reject(
|
|
2262
|
+
return B.reject(_);
|
|
2263
2263
|
});
|
|
2264
2264
|
}
|
|
2265
2265
|
var h, g = t.dbReadyResolve, v = null, f = !1;
|
|
2266
|
-
return B.race([a, (typeof navigator > "u" ? B.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(
|
|
2266
|
+
return B.race([a, (typeof navigator > "u" ? B.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(_) {
|
|
2267
2267
|
function p() {
|
|
2268
|
-
return indexedDB.databases().finally(
|
|
2268
|
+
return indexedDB.databases().finally(_);
|
|
2269
2269
|
}
|
|
2270
2270
|
h = setInterval(p, 100), p();
|
|
2271
2271
|
}).finally(function() {
|
|
@@ -2273,32 +2273,32 @@ function Ra() {
|
|
|
2273
2273
|
}) : Promise.resolve()).then(c)]).then(function() {
|
|
2274
2274
|
return u(), t.onReadyBeingFired = [], B.resolve(Pn(function() {
|
|
2275
2275
|
return e.on.ready.fire(e.vip);
|
|
2276
|
-
})).then(function
|
|
2276
|
+
})).then(function _() {
|
|
2277
2277
|
if (0 < t.onReadyBeingFired.length) {
|
|
2278
2278
|
var p = t.onReadyBeingFired.reduce(sn, J);
|
|
2279
2279
|
return t.onReadyBeingFired = [], B.resolve(Pn(function() {
|
|
2280
2280
|
return p(e.vip);
|
|
2281
|
-
})).then(
|
|
2281
|
+
})).then(_);
|
|
2282
2282
|
}
|
|
2283
2283
|
});
|
|
2284
2284
|
}).finally(function() {
|
|
2285
2285
|
t.openCanceller === a && (t.onReadyBeingFired = null, t.isBeingOpened = !1);
|
|
2286
|
-
}).catch(function(
|
|
2287
|
-
t.dbOpenError =
|
|
2286
|
+
}).catch(function(_) {
|
|
2287
|
+
t.dbOpenError = _;
|
|
2288
2288
|
try {
|
|
2289
2289
|
v && v.abort();
|
|
2290
2290
|
} catch {
|
|
2291
2291
|
}
|
|
2292
|
-
return a === t.openCanceller && e._close(), te(
|
|
2292
|
+
return a === t.openCanceller && e._close(), te(_);
|
|
2293
2293
|
}).finally(function() {
|
|
2294
2294
|
t.openComplete = !0, g();
|
|
2295
2295
|
}).then(function() {
|
|
2296
|
-
var
|
|
2297
|
-
return f && (
|
|
2296
|
+
var _;
|
|
2297
|
+
return f && (_ = {}, e.tables.forEach(function(p) {
|
|
2298
2298
|
p.schema.indexes.forEach(function(b) {
|
|
2299
|
-
b.name && (
|
|
2300
|
-
}),
|
|
2301
|
-
}), Ce(gt).fire(
|
|
2299
|
+
b.name && (_["idb://".concat(e.name, "/").concat(p.name, "/").concat(b.name)] = new oe(-1 / 0, [[[]]]));
|
|
2300
|
+
}), _["idb://".concat(e.name, "/").concat(p.name, "/")] = _["idb://".concat(e.name, "/").concat(p.name, "/:dels")] = new oe(-1 / 0, [[[]]]);
|
|
2301
|
+
}), Ce(gt).fire(_), Mn(_, !0)), e;
|
|
2302
2302
|
});
|
|
2303
2303
|
}
|
|
2304
2304
|
function jn(e) {
|
|
@@ -2321,13 +2321,13 @@ function Ra() {
|
|
|
2321
2321
|
return a;
|
|
2322
2322
|
}
|
|
2323
2323
|
var ma = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2324
|
-
return
|
|
2324
|
+
return d(d({}, e), { table: function(t) {
|
|
2325
2325
|
var n = e.table(t), a = n.schema, i = {}, s = [];
|
|
2326
|
-
function u(f,
|
|
2327
|
-
var b = mt(f), w = i[b] = i[b] || [], y = f == null ? 0 : typeof f == "string" ? 1 : f.length,
|
|
2328
|
-
return w.push(
|
|
2326
|
+
function u(f, _, p) {
|
|
2327
|
+
var b = mt(f), w = i[b] = i[b] || [], y = f == null ? 0 : typeof f == "string" ? 1 : f.length, S = 0 < _, S = d(d({}, p), { name: S ? "".concat(b, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: S, keyTail: _, keyLength: y, extractKey: En(f), unique: !S && p.unique });
|
|
2328
|
+
return w.push(S), S.isPrimaryKey || s.push(S), 1 < y && u(y === 2 ? f[0] : f.slice(0, y - 1), _ + 1, p), w.sort(function(E, O) {
|
|
2329
2329
|
return E.keyTail - O.keyTail;
|
|
2330
|
-
}),
|
|
2330
|
+
}), S;
|
|
2331
2331
|
}
|
|
2332
2332
|
t = u(a.primaryKey.keyPath, 0, a.primaryKey), i[":id"] = [t];
|
|
2333
2333
|
for (var c = 0, h = a.indexes; c < h.length; c++) {
|
|
@@ -2335,32 +2335,32 @@ function Ra() {
|
|
|
2335
2335
|
u(g.keyPath, 0, g);
|
|
2336
2336
|
}
|
|
2337
2337
|
function v(f) {
|
|
2338
|
-
var
|
|
2339
|
-
return p.isVirtual ?
|
|
2338
|
+
var _, p = f.query.index;
|
|
2339
|
+
return p.isVirtual ? d(d({}, f), { query: { index: p.lowLevelIndex, range: (_ = f.query.range, p = p.keyTail, { type: _.type === 1 ? 2 : _.type, lower: Yt(_.lower, _.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: Yt(_.upper, _.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : f;
|
|
2340
2340
|
}
|
|
2341
|
-
return
|
|
2341
|
+
return d(d({}, n), { schema: d(d({}, a), { primaryKey: t, indexes: s, getIndexByKeyPath: function(f) {
|
|
2342
2342
|
return (f = i[mt(f)]) && f[0];
|
|
2343
2343
|
} }), count: function(f) {
|
|
2344
2344
|
return n.count(v(f));
|
|
2345
2345
|
}, query: function(f) {
|
|
2346
2346
|
return n.query(v(f));
|
|
2347
2347
|
}, openCursor: function(f) {
|
|
2348
|
-
var
|
|
2349
|
-
return b ? n.openCursor(v(f)).then(function(
|
|
2350
|
-
return
|
|
2348
|
+
var _ = f.query.index, p = _.keyTail, b = _.isVirtual, w = _.keyLength;
|
|
2349
|
+
return b ? n.openCursor(v(f)).then(function(S) {
|
|
2350
|
+
return S && y(S);
|
|
2351
2351
|
}) : n.openCursor(f);
|
|
2352
|
-
function y(
|
|
2353
|
-
return Object.create(
|
|
2354
|
-
E != null ?
|
|
2352
|
+
function y(S) {
|
|
2353
|
+
return Object.create(S, { continue: { value: function(E) {
|
|
2354
|
+
E != null ? S.continue(Yt(E, f.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : f.unique ? S.continue(S.key.slice(0, w).concat(f.reverse ? e.MIN_KEY : e.MAX_KEY, p)) : S.continue();
|
|
2355
2355
|
} }, continuePrimaryKey: { value: function(E, O) {
|
|
2356
|
-
|
|
2356
|
+
S.continuePrimaryKey(Yt(E, e.MAX_KEY, p), O);
|
|
2357
2357
|
} }, primaryKey: { get: function() {
|
|
2358
|
-
return
|
|
2358
|
+
return S.primaryKey;
|
|
2359
2359
|
} }, key: { get: function() {
|
|
2360
|
-
var E =
|
|
2360
|
+
var E = S.key;
|
|
2361
2361
|
return w === 1 ? E[0] : E.slice(0, w);
|
|
2362
2362
|
} }, value: { get: function() {
|
|
2363
|
-
return
|
|
2363
|
+
return S.value;
|
|
2364
2364
|
} } });
|
|
2365
2365
|
}
|
|
2366
2366
|
} });
|
|
@@ -2378,9 +2378,9 @@ function Ra() {
|
|
|
2378
2378
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2379
2379
|
}
|
|
2380
2380
|
var ba = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2381
|
-
return
|
|
2381
|
+
return d(d({}, e), { table: function(t) {
|
|
2382
2382
|
var n = e.table(t), a = n.schema.primaryKey;
|
|
2383
|
-
return
|
|
2383
|
+
return d(d({}, n), { mutate: function(i) {
|
|
2384
2384
|
var s = G.trans, u = s.table(t).hook, c = u.deleting, h = u.creating, g = u.updating;
|
|
2385
2385
|
switch (i.type) {
|
|
2386
2386
|
case "add":
|
|
@@ -2401,11 +2401,11 @@ function Ra() {
|
|
|
2401
2401
|
case "deleteRange":
|
|
2402
2402
|
if (c.fire === J) break;
|
|
2403
2403
|
return s._promise("readwrite", function() {
|
|
2404
|
-
return function f(
|
|
2405
|
-
return n.query({ trans:
|
|
2404
|
+
return function f(_, p, b) {
|
|
2405
|
+
return n.query({ trans: _, values: !1, query: { index: a, range: p }, limit: b }).then(function(w) {
|
|
2406
2406
|
var y = w.result;
|
|
2407
|
-
return v({ type: "delete", keys: y, trans:
|
|
2408
|
-
return 0 <
|
|
2407
|
+
return v({ type: "delete", keys: y, trans: _ }).then(function(S) {
|
|
2408
|
+
return 0 < S.numFailures ? Promise.reject(S.failures[0]) : y.length < b ? { failures: [], numFailures: 0, lastResult: void 0 } : f(_, d(d({}, p), { lower: y[y.length - 1], lowerOpen: !0 }), b);
|
|
2409
2409
|
});
|
|
2410
2410
|
});
|
|
2411
2411
|
}(i.trans, i.range, 1e4);
|
|
@@ -2413,11 +2413,11 @@ function Ra() {
|
|
|
2413
2413
|
}
|
|
2414
2414
|
return n.mutate(i);
|
|
2415
2415
|
function v(f) {
|
|
2416
|
-
var
|
|
2416
|
+
var _, p, b, w = G.trans, y = f.keys || Kn(a, f);
|
|
2417
2417
|
if (!y) throw new Error("Keys missing");
|
|
2418
|
-
return (f = f.type === "add" || f.type === "put" ?
|
|
2418
|
+
return (f = f.type === "add" || f.type === "put" ? d(d({}, f), { keys: y }) : d({}, f)).type !== "delete" && (f.values = x([], f.values)), f.keys && (f.keys = x([], f.keys)), _ = n, b = y, ((p = f).type === "add" ? Promise.resolve([]) : _.getMany({ trans: p.trans, keys: b, cache: "immutable" })).then(function(S) {
|
|
2419
2419
|
var E = y.map(function(O, A) {
|
|
2420
|
-
var P, T, I, C =
|
|
2420
|
+
var P, T, I, C = S[A], j = { onerror: null, onsuccess: null };
|
|
2421
2421
|
return f.type === "delete" ? c.fire.call(j, O, C, w) : f.type === "add" || C === void 0 ? (P = h.fire.call(j, O, f.values[A], w), O == null && P != null && (f.keys[A] = O = P, a.outbound || fe(f.values[A], a.keyPath, O))) : (P = Nn(C, f.values[A]), (T = g.fire.call(j, P, O, C, w)) && (I = f.values[A], Object.keys(T).forEach(function(R) {
|
|
2422
2422
|
ee(I, R) ? I[R] = T[R] : fe(I, R, T[R]);
|
|
2423
2423
|
}))), j;
|
|
@@ -2425,7 +2425,7 @@ function Ra() {
|
|
|
2425
2425
|
return n.mutate(f).then(function(O) {
|
|
2426
2426
|
for (var A = O.failures, P = O.results, T = O.numFailures, O = O.lastResult, I = 0; I < y.length; ++I) {
|
|
2427
2427
|
var C = (P || y)[I], j = E[I];
|
|
2428
|
-
C == null ? j.onerror && j.onerror(A[I]) : j.onsuccess && j.onsuccess(f.type === "put" &&
|
|
2428
|
+
C == null ? j.onerror && j.onerror(A[I]) : j.onsuccess && j.onsuccess(f.type === "put" && S[I] ? f.values[I] : C);
|
|
2429
2429
|
}
|
|
2430
2430
|
return { failures: A, results: P, numFailures: T, lastResult: O };
|
|
2431
2431
|
}).catch(function(O) {
|
|
@@ -2450,7 +2450,7 @@ function Ra() {
|
|
|
2450
2450
|
var va = { stack: "dbcore", level: -1, create: function(e) {
|
|
2451
2451
|
return { table: function(t) {
|
|
2452
2452
|
var n = e.table(t);
|
|
2453
|
-
return
|
|
2453
|
+
return d(d({}, n), { getMany: function(a) {
|
|
2454
2454
|
if (!a.cache) return n.getMany(a);
|
|
2455
2455
|
var i = Or(a.keys, a.trans._cache, a.cache === "clone");
|
|
2456
2456
|
return i ? B.resolve(i) : n.getMany(a).then(function(s) {
|
|
@@ -2477,20 +2477,20 @@ function Ra() {
|
|
|
2477
2477
|
}
|
|
2478
2478
|
var wa = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2479
2479
|
var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
|
|
2480
|
-
return
|
|
2480
|
+
return d(d({}, e), { transaction: function(a, i, s) {
|
|
2481
2481
|
if (G.subscr && i !== "readonly") throw new $.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(G.querier));
|
|
2482
2482
|
return e.transaction(a, i, s);
|
|
2483
2483
|
}, table: function(a) {
|
|
2484
2484
|
var i = e.table(a), s = i.schema, u = s.primaryKey, f = s.indexes, c = u.extractKey, h = u.outbound, g = u.autoIncrement && f.filter(function(p) {
|
|
2485
2485
|
return p.compound && p.keyPath.includes(u.keyPath);
|
|
2486
|
-
}), v =
|
|
2486
|
+
}), v = d(d({}, i), { mutate: function(p) {
|
|
2487
2487
|
function b(R) {
|
|
2488
2488
|
return R = "idb://".concat(t, "/").concat(a, "/").concat(R), O[R] || (O[R] = new oe());
|
|
2489
2489
|
}
|
|
2490
|
-
var w, y,
|
|
2490
|
+
var w, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), A = b(""), P = b(":dels"), T = p.type, j = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [Kn(u, p).filter(function(R) {
|
|
2491
2491
|
return R;
|
|
2492
2492
|
}), p.values] : [], I = j[0], C = j[1], j = p.trans._cache;
|
|
2493
|
-
return U(I) ? (A.addKeys(I), (j = T === "delete" || I.length === C.length ? Or(I, j) : null) || P.addKeys(I), (j || C) && (w = b, y = j,
|
|
2493
|
+
return U(I) ? (A.addKeys(I), (j = T === "delete" || I.length === C.length ? Or(I, j) : null) || P.addKeys(I), (j || C) && (w = b, y = j, S = C, s.indexes.forEach(function(R) {
|
|
2494
2494
|
var L = w(R.name || "");
|
|
2495
2495
|
function W(H) {
|
|
2496
2496
|
return H != null ? R.extractKey(H) : null;
|
|
@@ -2500,8 +2500,8 @@ function Ra() {
|
|
|
2500
2500
|
return L.addKey(pe);
|
|
2501
2501
|
}) : L.addKey(H);
|
|
2502
2502
|
}
|
|
2503
|
-
(y ||
|
|
2504
|
-
var F = y && W(y[ue]), ue =
|
|
2503
|
+
(y || S).forEach(function(H, ue) {
|
|
2504
|
+
var F = y && W(y[ue]), ue = S && W(S[ue]);
|
|
2505
2505
|
Y(F, ue) !== 0 && (F != null && z(F), ue != null && z(ue));
|
|
2506
2506
|
});
|
|
2507
2507
|
}))) : I ? (C = { from: (C = I.lower) !== null && C !== void 0 ? C : e.MIN_KEY, to: (C = I.upper) !== null && C !== void 0 ? C : e.MAX_KEY }, P.add(C), A.add(C)) : (A.add(n), P.add(n), s.indexes.forEach(function(R) {
|
|
@@ -2519,21 +2519,21 @@ function Ra() {
|
|
|
2519
2519
|
} }), f = function(b) {
|
|
2520
2520
|
var w = b.query, b = w.index, w = w.range;
|
|
2521
2521
|
return [b, new oe((b = w.lower) !== null && b !== void 0 ? b : e.MIN_KEY, (w = w.upper) !== null && w !== void 0 ? w : e.MAX_KEY)];
|
|
2522
|
-
},
|
|
2522
|
+
}, _ = { get: function(p) {
|
|
2523
2523
|
return [u, new oe(p.key)];
|
|
2524
2524
|
}, getMany: function(p) {
|
|
2525
2525
|
return [u, new oe().addKeys(p.keys)];
|
|
2526
2526
|
}, count: f, query: f, openCursor: f };
|
|
2527
|
-
return K(
|
|
2527
|
+
return K(_).forEach(function(p) {
|
|
2528
2528
|
v[p] = function(b) {
|
|
2529
|
-
var w = G.subscr, y = !!w,
|
|
2529
|
+
var w = G.subscr, y = !!w, S = xr(G, i) && Ar(p, b) ? b.obsSet = {} : w;
|
|
2530
2530
|
if (y) {
|
|
2531
2531
|
var E = function(C) {
|
|
2532
|
-
return C = "idb://".concat(t, "/").concat(a, "/").concat(C),
|
|
2533
|
-
}, O = E(""), A = E(":dels"), w =
|
|
2532
|
+
return C = "idb://".concat(t, "/").concat(a, "/").concat(C), S[C] || (S[C] = new oe());
|
|
2533
|
+
}, O = E(""), A = E(":dels"), w = _[p](b), y = w[0], w = w[1];
|
|
2534
2534
|
if ((p === "query" && y.isPrimaryKey && !b.values ? A : E(y.name || "")).add(w), !y.isPrimaryKey) {
|
|
2535
2535
|
if (p !== "count") {
|
|
2536
|
-
var P = p === "query" && h && b.values && i.query(
|
|
2536
|
+
var P = p === "query" && h && b.values && i.query(d(d({}, b), { values: !1 }));
|
|
2537
2537
|
return i[p].apply(this, arguments).then(function(C) {
|
|
2538
2538
|
if (p === "query") {
|
|
2539
2539
|
if (h && b.values) return P.then(function(W) {
|
|
@@ -2567,7 +2567,7 @@ function Ra() {
|
|
|
2567
2567
|
if (n.numFailures === 0) return t;
|
|
2568
2568
|
if (t.type === "deleteRange") return null;
|
|
2569
2569
|
var a = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2570
|
-
return n.numFailures === a ? null : (t =
|
|
2570
|
+
return n.numFailures === a ? null : (t = d({}, t), U(t.keys) && (t.keys = t.keys.filter(function(i, s) {
|
|
2571
2571
|
return !(s in n.failures);
|
|
2572
2572
|
})), "values" in t && U(t.values) && (t.values = t.values.filter(function(i, s) {
|
|
2573
2573
|
return !(s in n.failures);
|
|
@@ -2577,15 +2577,15 @@ function Ra() {
|
|
|
2577
2577
|
return n = e, ((a = t).lower === void 0 || (a.lowerOpen ? 0 < Y(n, a.lower) : 0 <= Y(n, a.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? Y(e, t.upper) < 0 : Y(e, t.upper) <= 0));
|
|
2578
2578
|
var n, a;
|
|
2579
2579
|
}
|
|
2580
|
-
function Dr(e, t,
|
|
2581
|
-
if (!
|
|
2582
|
-
var u = t.query.index, c = u.multiEntry, h = t.query.range, g = a.schema.primaryKey.extractKey, v = u.extractKey, f = (u.lowLevelIndex || u).extractKey,
|
|
2580
|
+
function Dr(e, t, _, a, i, s) {
|
|
2581
|
+
if (!_ || _.length === 0) return e;
|
|
2582
|
+
var u = t.query.index, c = u.multiEntry, h = t.query.range, g = a.schema.primaryKey.extractKey, v = u.extractKey, f = (u.lowLevelIndex || u).extractKey, _ = _.reduce(function(p, b) {
|
|
2583
2583
|
var w = p, y = [];
|
|
2584
|
-
if (b.type === "add" || b.type === "put") for (var
|
|
2584
|
+
if (b.type === "add" || b.type === "put") for (var S = new oe(), E = b.values.length - 1; 0 <= E; --E) {
|
|
2585
2585
|
var O, A = b.values[E], P = g(A);
|
|
2586
|
-
|
|
2586
|
+
S.hasKey(P) || (O = v(A), (c && U(O) ? O.some(function(R) {
|
|
2587
2587
|
return Bn(R, h);
|
|
2588
|
-
}) : Bn(O, h)) && (
|
|
2588
|
+
}) : Bn(O, h)) && (S.addKey(P), y.push(A)));
|
|
2589
2589
|
}
|
|
2590
2590
|
switch (b.type) {
|
|
2591
2591
|
case "add":
|
|
@@ -2623,14 +2623,14 @@ function Ra() {
|
|
|
2623
2623
|
}
|
|
2624
2624
|
return w;
|
|
2625
2625
|
}, e);
|
|
2626
|
-
return
|
|
2626
|
+
return _ === e ? e : (_.sort(function(p, b) {
|
|
2627
2627
|
return Y(f(p), f(b)) || Y(g(p), g(b));
|
|
2628
|
-
}), t.limit && t.limit < 1 / 0 && (
|
|
2628
|
+
}), t.limit && t.limit < 1 / 0 && (_.length > t.limit ? _.length = t.limit : e.length === t.limit && _.length < t.limit && (i.dirty = !0)), s ? Object.freeze(_) : _);
|
|
2629
2629
|
}
|
|
2630
2630
|
function Pr(e, t) {
|
|
2631
2631
|
return Y(e.lower, t.lower) === 0 && Y(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
2632
2632
|
}
|
|
2633
|
-
function
|
|
2633
|
+
function _a(e, t) {
|
|
2634
2634
|
return function(n, a, i, s) {
|
|
2635
2635
|
if (n === void 0) return a !== void 0 ? -1 : 0;
|
|
2636
2636
|
if (a === void 0) return 1;
|
|
@@ -2651,7 +2651,7 @@ function Ra() {
|
|
|
2651
2651
|
return a;
|
|
2652
2652
|
}(e.upper, t.upper, e.upperOpen, t.upperOpen);
|
|
2653
2653
|
}
|
|
2654
|
-
function
|
|
2654
|
+
function Sa(e, t, n, a) {
|
|
2655
2655
|
e.subscribers.add(n), a.addEventListener("abort", function() {
|
|
2656
2656
|
var i, s;
|
|
2657
2657
|
e.subscribers.delete(n), e.subscribers.size === 0 && (i = e, s = t, setTimeout(function() {
|
|
@@ -2661,18 +2661,18 @@ function Ra() {
|
|
|
2661
2661
|
}
|
|
2662
2662
|
var Ea = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2663
2663
|
var t = e.schema.name;
|
|
2664
|
-
return
|
|
2664
|
+
return d(d({}, e), { transaction: function(n, a, i) {
|
|
2665
2665
|
var s, u, c = e.transaction(n, a, i);
|
|
2666
2666
|
return a === "readwrite" && (u = (s = new AbortController()).signal, i = function(h) {
|
|
2667
2667
|
return function() {
|
|
2668
2668
|
if (s.abort(), a === "readwrite") {
|
|
2669
2669
|
for (var g = /* @__PURE__ */ new Set(), v = 0, f = n; v < f.length; v++) {
|
|
2670
|
-
var
|
|
2670
|
+
var _ = f[v], p = Fe["idb://".concat(t, "/").concat(_)];
|
|
2671
2671
|
if (p) {
|
|
2672
|
-
var b = e.table(
|
|
2672
|
+
var b = e.table(_), w = p.optimisticOps.filter(function(L) {
|
|
2673
2673
|
return L.trans === c;
|
|
2674
2674
|
});
|
|
2675
|
-
if (c._explicit && h && c.mutatedParts) for (var y = 0,
|
|
2675
|
+
if (c._explicit && h && c.mutatedParts) for (var y = 0, S = Object.values(p.queries.query); y < S.length; y++) for (var E = 0, O = (T = S[y]).slice(); E < O.length; E++) Cn((I = O[E]).obsSet, c.mutatedParts) && (Me(T, I), I.subscribers.forEach(function(L) {
|
|
2676
2676
|
return g.add(L);
|
|
2677
2677
|
}));
|
|
2678
2678
|
else if (0 < w.length) {
|
|
@@ -2695,7 +2695,7 @@ function Ra() {
|
|
|
2695
2695
|
}, c.addEventListener("abort", i(!1), { signal: u }), c.addEventListener("error", i(!1), { signal: u }), c.addEventListener("complete", i(!0), { signal: u })), c;
|
|
2696
2696
|
}, table: function(n) {
|
|
2697
2697
|
var a = e.table(n), i = a.schema.primaryKey;
|
|
2698
|
-
return
|
|
2698
|
+
return d(d({}, a), { mutate: function(s) {
|
|
2699
2699
|
var u = G.trans;
|
|
2700
2700
|
if (i.outbound || u.db._options.cache === "disabled" || u.explicit || u.idbtrans.mode !== "readwrite") return a.mutate(s);
|
|
2701
2701
|
var c = Fe["idb://".concat(t, "/").concat(n)];
|
|
@@ -2706,9 +2706,9 @@ function Ra() {
|
|
|
2706
2706
|
}), u.catch(function() {
|
|
2707
2707
|
Me(c.optimisticOps, s), s.mutatedParts && Ht(s.mutatedParts);
|
|
2708
2708
|
})) : u.then(function(h) {
|
|
2709
|
-
var g = kr(0,
|
|
2710
|
-
var
|
|
2711
|
-
return h.failures[f] ? v : (v = (
|
|
2709
|
+
var g = kr(0, d(d({}, s), { values: s.values.map(function(v, f) {
|
|
2710
|
+
var _;
|
|
2711
|
+
return h.failures[f] ? v : (v = (_ = i.keyPath) !== null && _ !== void 0 && _.includes(".") ? Te(v) : d({}, v), fe(v, i.keyPath, h.results[f]), v);
|
|
2712
2712
|
}) }), h);
|
|
2713
2713
|
c.optimisticOps.push(g), queueMicrotask(function() {
|
|
2714
2714
|
return s.mutatedParts && Ht(s.mutatedParts);
|
|
@@ -2716,37 +2716,37 @@ function Ra() {
|
|
|
2716
2716
|
}), u) : a.mutate(s);
|
|
2717
2717
|
}, query: function(s) {
|
|
2718
2718
|
if (!xr(G, a) || !Ar("query", s)) return a.query(s);
|
|
2719
|
-
var u = ((g = G.trans) === null || g === void 0 ? void 0 : g.db._options.cache) === "immutable", f = G, c = f.requery, h = f.signal, g = function(b, w, y,
|
|
2719
|
+
var u = ((g = G.trans) === null || g === void 0 ? void 0 : g.db._options.cache) === "immutable", f = G, c = f.requery, h = f.signal, g = function(b, w, y, S) {
|
|
2720
2720
|
var E = Fe["idb://".concat(b, "/").concat(w)];
|
|
2721
2721
|
if (!E) return [];
|
|
2722
2722
|
if (!(w = E.queries[y])) return [null, !1, E, null];
|
|
2723
|
-
var O = w[(
|
|
2723
|
+
var O = w[(S.query ? S.query.index.name : null) || ""];
|
|
2724
2724
|
if (!O) return [null, !1, E, null];
|
|
2725
2725
|
switch (y) {
|
|
2726
2726
|
case "query":
|
|
2727
2727
|
var A = O.find(function(P) {
|
|
2728
|
-
return P.req.limit ===
|
|
2728
|
+
return P.req.limit === S.limit && P.req.values === S.values && Pr(P.req.query.range, S.query.range);
|
|
2729
2729
|
});
|
|
2730
2730
|
return A ? [A, !0, E, O] : [O.find(function(P) {
|
|
2731
|
-
return ("limit" in P.req ? P.req.limit : 1 / 0) >=
|
|
2731
|
+
return ("limit" in P.req ? P.req.limit : 1 / 0) >= S.limit && (!S.values || P.req.values) && _a(P.req.query.range, S.query.range);
|
|
2732
2732
|
}), !1, E, O];
|
|
2733
2733
|
case "count":
|
|
2734
2734
|
return A = O.find(function(P) {
|
|
2735
|
-
return Pr(P.req.query.range,
|
|
2735
|
+
return Pr(P.req.query.range, S.query.range);
|
|
2736
2736
|
}), [A, !!A, E, O];
|
|
2737
2737
|
}
|
|
2738
|
-
}(t, n, "query", s), v = g[0], f = g[1],
|
|
2738
|
+
}(t, n, "query", s), v = g[0], f = g[1], _ = g[2], p = g[3];
|
|
2739
2739
|
return v && f ? v.obsSet = s.obsSet : (f = a.query(s).then(function(b) {
|
|
2740
2740
|
var w = b.result;
|
|
2741
2741
|
if (v && (v.res = w), u) {
|
|
2742
|
-
for (var y = 0,
|
|
2742
|
+
for (var y = 0, S = w.length; y < S; ++y) Object.freeze(w[y]);
|
|
2743
2743
|
Object.freeze(w);
|
|
2744
2744
|
} else b.result = Te(w);
|
|
2745
2745
|
return b;
|
|
2746
2746
|
}).catch(function(b) {
|
|
2747
2747
|
return p && v && Me(p, v), Promise.reject(b);
|
|
2748
|
-
}), v = { obsSet: s.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: s, dirty: !1 }, p ? p.push(v) : (p = [v], (
|
|
2749
|
-
return { result: Dr(b.result, s,
|
|
2748
|
+
}), v = { obsSet: s.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: s, dirty: !1 }, p ? p.push(v) : (p = [v], (_ = _ || (Fe["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[s.query.index.name || ""] = p)), Sa(v, p, c, h), v.promise.then(function(b) {
|
|
2749
|
+
return { result: Dr(b.result, s, _ == null ? void 0 : _.optimisticOps, a, v, u) };
|
|
2750
2750
|
});
|
|
2751
2751
|
} });
|
|
2752
2752
|
} });
|
|
@@ -2877,25 +2877,25 @@ function Ra() {
|
|
|
2877
2877
|
f(g);
|
|
2878
2878
|
}) : te(g);
|
|
2879
2879
|
}
|
|
2880
|
-
var h = (function g(v, f,
|
|
2880
|
+
var h = (function g(v, f, _, p, b) {
|
|
2881
2881
|
return B.resolve().then(function() {
|
|
2882
|
-
var w = G.transless || G, y = v._createTransaction(f,
|
|
2882
|
+
var w = G.transless || G, y = v._createTransaction(f, _, v._dbSchema, p);
|
|
2883
2883
|
if (y.explicit = !0, w = { trans: y, transless: w }, p) y.idbtrans = p.idbtrans;
|
|
2884
2884
|
else try {
|
|
2885
2885
|
y.create(), y.idbtrans._explicit = !0, v._state.PR1398_maxLoop = 3;
|
|
2886
2886
|
} catch (O) {
|
|
2887
2887
|
return O.name === an.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
2888
|
-
return g(v, f,
|
|
2888
|
+
return g(v, f, _, null, b);
|
|
2889
2889
|
})) : te(O);
|
|
2890
2890
|
}
|
|
2891
|
-
var
|
|
2891
|
+
var S, E = rn(b);
|
|
2892
2892
|
return E && qe(), w = B.follow(function() {
|
|
2893
2893
|
var O;
|
|
2894
|
-
(
|
|
2895
|
-
}, w), (
|
|
2894
|
+
(S = b.call(y, y)) && (E ? (O = De.bind(null, null), S.then(O, O)) : typeof S.next == "function" && typeof S.throw == "function" && (S = jn(S)));
|
|
2895
|
+
}, w), (S && typeof S.then == "function" ? B.resolve(S).then(function(O) {
|
|
2896
2896
|
return y.active ? O : te(new $.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2897
2897
|
}) : w.then(function() {
|
|
2898
|
-
return
|
|
2898
|
+
return S;
|
|
2899
2899
|
})).then(function(O) {
|
|
2900
2900
|
return p && y._resolve(), y._completion.then(function() {
|
|
2901
2901
|
return O;
|
|
@@ -2916,22 +2916,22 @@ function Ra() {
|
|
|
2916
2916
|
var n = this;
|
|
2917
2917
|
this._middlewares = {}, this.verno = 0;
|
|
2918
2918
|
var a = ne.dependencies;
|
|
2919
|
-
this._options = t =
|
|
2919
|
+
this._options = t = d({ addons: ne.addons, autoOpen: !0, indexedDB: a.indexedDB, IDBKeyRange: a.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, a = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2920
2920
|
var i, s, u, c, h, g = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: J, dbReadyPromise: null, cancelOpen: J, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2921
2921
|
g.dbReadyPromise = new B(function(f) {
|
|
2922
2922
|
g.dbReadyResolve = f;
|
|
2923
|
-
}), g.openCanceller = new B(function(f,
|
|
2924
|
-
g.cancelOpen =
|
|
2923
|
+
}), g.openCanceller = new B(function(f, _) {
|
|
2924
|
+
g.cancelOpen = _;
|
|
2925
2925
|
}), this._state = g, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [sn, J] }), this.on.ready.subscribe = Hn(this.on.ready.subscribe, function(f) {
|
|
2926
|
-
return function(
|
|
2926
|
+
return function(_, p) {
|
|
2927
2927
|
ne.vip(function() {
|
|
2928
2928
|
var b, w = n._state;
|
|
2929
|
-
w.openComplete ? (w.dbOpenError || B.resolve().then(
|
|
2930
|
-
b.on.ready.unsubscribe(
|
|
2929
|
+
w.openComplete ? (w.dbOpenError || B.resolve().then(_), p && f(_)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(_), p && f(_)) : (f(_), b = n, p || f(function y() {
|
|
2930
|
+
b.on.ready.unsubscribe(_), b.on.ready.unsubscribe(y);
|
|
2931
2931
|
}));
|
|
2932
2932
|
});
|
|
2933
2933
|
};
|
|
2934
|
-
}), this.Collection = (i = this, ft(ia.prototype, function(
|
|
2934
|
+
}), this.Collection = (i = this, ft(ia.prototype, function(S, y) {
|
|
2935
2935
|
this.db = i;
|
|
2936
2936
|
var p = sr, b = null;
|
|
2937
2937
|
if (y) try {
|
|
@@ -2939,24 +2939,24 @@ function Ra() {
|
|
|
2939
2939
|
} catch (E) {
|
|
2940
2940
|
b = E;
|
|
2941
2941
|
}
|
|
2942
|
-
var w =
|
|
2943
|
-
this._ctx = { table: y, index: w.index, isPrimKey: !w.index || y.schema.primKey.keyPath && w.index === y.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: b, or: w.or, valueMapper:
|
|
2944
|
-
})), this.Table = (s = this, ft(lr.prototype, function(f,
|
|
2945
|
-
this.db = s, this._tx = p, this.name = f, this.schema =
|
|
2946
|
-
})), this.Transaction = (u = this, ft(ua.prototype, function(f,
|
|
2942
|
+
var w = S._ctx, y = w.table, S = y.hook.reading.fire;
|
|
2943
|
+
this._ctx = { table: y, index: w.index, isPrimKey: !w.index || y.schema.primKey.keyPath && w.index === y.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: b, or: w.or, valueMapper: S !== st ? S : null };
|
|
2944
|
+
})), this.Table = (s = this, ft(lr.prototype, function(f, _, p) {
|
|
2945
|
+
this.db = s, this._tx = p, this.name = f, this.schema = _, this.hook = s._allTables[f] ? s._allTables[f].hook : dt(null, { creating: [Jr, J], reading: [Xr, st], updating: [Zr, J], deleting: [Vr, J] });
|
|
2946
|
+
})), this.Transaction = (u = this, ft(ua.prototype, function(f, _, p, b, w) {
|
|
2947
2947
|
var y = this;
|
|
2948
|
-
this.db = u, this.mode = f, this.storeNames =
|
|
2949
|
-
y._resolve =
|
|
2948
|
+
this.db = u, this.mode = f, this.storeNames = _, this.schema = p, this.chromeTransactionDurability = b, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = w || 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 B(function(S, E) {
|
|
2949
|
+
y._resolve = S, y._reject = E;
|
|
2950
2950
|
}), this._completion.then(function() {
|
|
2951
2951
|
y.active = !1, y.on.complete.fire();
|
|
2952
|
-
}, function(
|
|
2952
|
+
}, function(S) {
|
|
2953
2953
|
var E = y.active;
|
|
2954
|
-
return y.active = !1, y.on.error.fire(
|
|
2954
|
+
return y.active = !1, y.on.error.fire(S), y.parent ? y.parent._reject(S) : E && y.idbtrans && y.idbtrans.abort(), te(S);
|
|
2955
2955
|
});
|
|
2956
2956
|
})), this.Version = (c = this, ft(ga.prototype, function(f) {
|
|
2957
2957
|
this.db = c, this._cfg = { version: f, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
2958
|
-
})), this.WhereClause = (h = this, ft(gr.prototype, function(f,
|
|
2959
|
-
if (this.db = h, this._ctx = { table: f, index:
|
|
2958
|
+
})), this.WhereClause = (h = this, ft(gr.prototype, function(f, _, p) {
|
|
2959
|
+
if (this.db = h, this._ctx = { table: f, index: _ === ":id" ? null : _, or: p }, this._cmp = this._ascending = Y, this._descending = function(b, w) {
|
|
2960
2960
|
return Y(w, b);
|
|
2961
2961
|
}, this._max = function(b, w) {
|
|
2962
2962
|
return 0 < Y(b, w) ? b : w;
|
|
@@ -2967,24 +2967,24 @@ function Ra() {
|
|
|
2967
2967
|
0 < f.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
2968
2968
|
}), this.on("blocked", function(f) {
|
|
2969
2969
|
!f.newVersion || f.newVersion < f.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(f.oldVersion / 10));
|
|
2970
|
-
}), this._maxKey = yt(t.IDBKeyRange), this._createTransaction = function(f,
|
|
2971
|
-
return new n.Transaction(f,
|
|
2970
|
+
}), this._maxKey = yt(t.IDBKeyRange), this._createTransaction = function(f, _, p, b) {
|
|
2971
|
+
return new n.Transaction(f, _, p, n._options.chromeTransactionDurability, b);
|
|
2972
2972
|
}, this._fireOnBlocked = function(f) {
|
|
2973
|
-
n.on("blocked").fire(f), et.filter(function(
|
|
2974
|
-
return
|
|
2975
|
-
}).map(function(
|
|
2976
|
-
return
|
|
2973
|
+
n.on("blocked").fire(f), et.filter(function(_) {
|
|
2974
|
+
return _.name === n.name && _ !== n && !_._state.vcFired;
|
|
2975
|
+
}).map(function(_) {
|
|
2976
|
+
return _.on("versionchange").fire(f);
|
|
2977
2977
|
});
|
|
2978
2978
|
}, this.use(va), this.use(Ea), this.use(wa), this.use(ma), this.use(ba);
|
|
2979
|
-
var v = new Proxy(this, { get: function(f,
|
|
2980
|
-
if (
|
|
2981
|
-
if (
|
|
2979
|
+
var v = new Proxy(this, { get: function(f, _, p) {
|
|
2980
|
+
if (_ === "_vip") return !0;
|
|
2981
|
+
if (_ === "table") return function(w) {
|
|
2982
2982
|
return Qt(n.table(w), v);
|
|
2983
2983
|
};
|
|
2984
|
-
var b = Reflect.get(f,
|
|
2985
|
-
return b instanceof lr ? Qt(b, v) :
|
|
2984
|
+
var b = Reflect.get(f, _, p);
|
|
2985
|
+
return b instanceof lr ? Qt(b, v) : _ === "tables" ? b.map(function(w) {
|
|
2986
2986
|
return Qt(w, v);
|
|
2987
|
-
}) :
|
|
2987
|
+
}) : _ === "_createTransaction" ? function() {
|
|
2988
2988
|
return Qt(b.apply(this, arguments), v);
|
|
2989
2989
|
} : b;
|
|
2990
2990
|
} });
|
|
@@ -3013,13 +3013,13 @@ function Ra() {
|
|
|
3013
3013
|
c || (c = !0, u && u.abort(), f && Ce.storagemutated.unsubscribe(p));
|
|
3014
3014
|
} };
|
|
3015
3015
|
i.start && i.start(v);
|
|
3016
|
-
var f = !1,
|
|
3016
|
+
var f = !1, _ = function() {
|
|
3017
3017
|
return pn(b);
|
|
3018
3018
|
}, p = function(w) {
|
|
3019
|
-
zt(h, w), Cn(g, h) &&
|
|
3019
|
+
zt(h, w), Cn(g, h) && _();
|
|
3020
3020
|
}, b = function() {
|
|
3021
|
-
var w, y,
|
|
3022
|
-
!c && Xt.indexedDB && (h = {}, w = {}, u && u.abort(), u = new AbortController(),
|
|
3021
|
+
var w, y, S;
|
|
3022
|
+
!c && Xt.indexedDB && (h = {}, w = {}, u && u.abort(), u = new AbortController(), S = function(E) {
|
|
3023
3023
|
var O = Ve();
|
|
3024
3024
|
try {
|
|
3025
3025
|
s && qe();
|
|
@@ -3028,7 +3028,7 @@ function Ra() {
|
|
|
3028
3028
|
} finally {
|
|
3029
3029
|
O && Ze();
|
|
3030
3030
|
}
|
|
3031
|
-
}(y = { subscr: w, signal: u.signal, requery:
|
|
3031
|
+
}(y = { subscr: w, signal: u.signal, requery: _, querier: e, trans: null }), Promise.resolve(S).then(function(E) {
|
|
3032
3032
|
n = !0, t = E, c || y.signal.aborted || (h = {}, function(O) {
|
|
3033
3033
|
for (var A in O) if (ee(O, A)) return;
|
|
3034
3034
|
return 1;
|
|
@@ -3041,7 +3041,7 @@ function Ra() {
|
|
|
3041
3041
|
});
|
|
3042
3042
|
}));
|
|
3043
3043
|
};
|
|
3044
|
-
return setTimeout(
|
|
3044
|
+
return setTimeout(_, 0), v;
|
|
3045
3045
|
});
|
|
3046
3046
|
return a.hasValue = function() {
|
|
3047
3047
|
return n;
|
|
@@ -3058,7 +3058,7 @@ function Ra() {
|
|
|
3058
3058
|
Re = t;
|
|
3059
3059
|
}
|
|
3060
3060
|
}
|
|
3061
|
-
le(We,
|
|
3061
|
+
le(We, d(d({}, Ot), { delete: function(e) {
|
|
3062
3062
|
return new We(e, { addons: [] }).delete();
|
|
3063
3063
|
}, exists: function(e) {
|
|
3064
3064
|
return new We(e, { addons: [] }).open().then(function(t) {
|
|
@@ -3141,7 +3141,7 @@ function Ra() {
|
|
|
3141
3141
|
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e && xe(t, "stack", { get: function() {
|
|
3142
3142
|
return this.inner.stack;
|
|
3143
3143
|
} }), t);
|
|
3144
|
-
}, qn(me),
|
|
3144
|
+
}, qn(me), d(Ee, Object.freeze({ __proto__: null, Dexie: Ee, liveQuery: Ir, Entity: or, cmp: Y, PropModification: ht, replacePrefix: function(e, t) {
|
|
3145
3145
|
return new ht({ replacePrefix: [e, t] });
|
|
3146
3146
|
}, add: function(e) {
|
|
3147
3147
|
return new ht({ add: e });
|
|
@@ -3155,33 +3155,33 @@ var Ta = Ra();
|
|
|
3155
3155
|
const Wn = /* @__PURE__ */ Ia(Ta), Tr = Symbol.for("Dexie"), en = globalThis[Tr] || (globalThis[Tr] = Wn);
|
|
3156
3156
|
if (Wn.semVer !== en.semVer)
|
|
3157
3157
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Wn.semVer} and ${en.semVer}`);
|
|
3158
|
-
function V(
|
|
3159
|
-
let r = `${
|
|
3160
|
-
return
|
|
3158
|
+
function V(l) {
|
|
3159
|
+
let r = `${l.type}.${l.topics}`;
|
|
3160
|
+
return l.order && (r += `.${l.order}`), l.period && (r += `.${l.period}`), r;
|
|
3161
3161
|
}
|
|
3162
|
-
function Mr(
|
|
3162
|
+
function Mr(l) {
|
|
3163
3163
|
var r;
|
|
3164
|
-
if (
|
|
3165
|
-
const o = (r =
|
|
3166
|
-
o && o.length > 1 ? (
|
|
3164
|
+
if (l.widget === void 0) {
|
|
3165
|
+
const o = (r = l.topics) == null ? void 0 : r.split("-");
|
|
3166
|
+
o && o.length > 1 ? (l.dashboard = o ? o[0] : "", l.widget = o ? o[1] : "") : (l.widget = l.topics, l.dashboard = l.slide);
|
|
3167
3167
|
}
|
|
3168
|
-
return
|
|
3168
|
+
return l.topics === void 0 && (l.topics = `${l.dashboard}-${l.widget}`), l;
|
|
3169
3169
|
}
|
|
3170
|
-
function
|
|
3170
|
+
function _t(l, r) {
|
|
3171
3171
|
var U;
|
|
3172
|
-
let o,
|
|
3173
|
-
switch (
|
|
3172
|
+
let o, d, x, D, K;
|
|
3173
|
+
switch (l.moderation) {
|
|
3174
3174
|
case Zt.BEFORE:
|
|
3175
|
-
o = /* @__PURE__ */ new Date(),
|
|
3175
|
+
o = /* @__PURE__ */ new Date(), d = (U = l.beforeTime) == null ? void 0 : U.split(":"), x = Number.parseInt(d ? d[0] : "00"), D = Number.parseInt(d ? d[1] : "00"), K = Number.parseInt(d ? d[2] : "00"), r.before = o.setHours(x, D, K, 0) / 1e3, r.period || (r.period = o.getDay() === 1 ? 72 : 24);
|
|
3176
3176
|
break;
|
|
3177
3177
|
case Zt.DELAYED:
|
|
3178
|
-
|
|
3178
|
+
l.delay && l.delay > 0 && (r.delay = `${l.delay}`);
|
|
3179
3179
|
break;
|
|
3180
3180
|
case Zt.APPROVED:
|
|
3181
3181
|
r.approved = "1";
|
|
3182
3182
|
break;
|
|
3183
3183
|
default:
|
|
3184
|
-
|
|
3184
|
+
l.period !== 0 && (r.period = l.period);
|
|
3185
3185
|
}
|
|
3186
3186
|
return r;
|
|
3187
3187
|
}
|
|
@@ -3234,9 +3234,9 @@ class jr {
|
|
|
3234
3234
|
k(this, "getMessages", async (r) => {
|
|
3235
3235
|
const o = (r == null ? void 0 : r.order) ?? "utc";
|
|
3236
3236
|
o !== "utc" && (r.since = Math.floor(Date.now() / 1e3) - 60 * 60 * 24 * 7), this.options.delay != 0 ? r.before = Math.floor(Date.now() / 1e3) - (this.options.delay || 0) : r.before = Math.floor(Date.now() / 1e3);
|
|
3237
|
-
const
|
|
3237
|
+
const d = (K) => K.utc > ((r == null ? void 0 : r.since) || 0), x = (K) => K.utc < ((r == null ? void 0 : r.before) || Date.now() / 1e3), D = (K) => (K == null ? void 0 : K.visible) !== 0;
|
|
3238
3238
|
try {
|
|
3239
|
-
const U = await this.db.table(N.TOPICS).where("widget_id").equals(r.widget).filter(D).filter(
|
|
3239
|
+
const U = await this.db.table(N.TOPICS).where("widget_id").equals(r.widget).filter(D).filter(d).filter(x).reverse().limit((r == null ? void 0 : r.limit) ?? 25).sortBy(o);
|
|
3240
3240
|
if (U.length === 0)
|
|
3241
3241
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3242
3242
|
let M = U.map((X) => this.db.table(N.MESSAGES).get({ id: X.message_id }));
|
|
@@ -3283,7 +3283,7 @@ class jr {
|
|
|
3283
3283
|
dashboard_id: r.dashboard,
|
|
3284
3284
|
//data: data.data,
|
|
3285
3285
|
data: o
|
|
3286
|
-
}).then(() => 201).catch((
|
|
3286
|
+
}).then(() => 201).catch((d) => (console.error("%cstorage", m.STORAGE, "set", r, d.message), 400)) : 400);
|
|
3287
3287
|
/**
|
|
3288
3288
|
* Update Series
|
|
3289
3289
|
* @param query IQuery
|
|
@@ -3295,7 +3295,7 @@ class jr {
|
|
|
3295
3295
|
dashboard_id: r.dashboard,
|
|
3296
3296
|
//data: data.data,
|
|
3297
3297
|
data: o
|
|
3298
|
-
}).then(() => 201).catch((
|
|
3298
|
+
}).then(() => 201).catch((d) => (console.error("%cstorage", m.STORAGE, "set", r, d.message), 400)) : 400);
|
|
3299
3299
|
/**
|
|
3300
3300
|
* Update Messages
|
|
3301
3301
|
* @param query IQuery
|
|
@@ -3305,7 +3305,7 @@ class jr {
|
|
|
3305
3305
|
k(this, "setMessages", async (r, o) => {
|
|
3306
3306
|
if (r.type !== N.MESSAGES)
|
|
3307
3307
|
return 400;
|
|
3308
|
-
const
|
|
3308
|
+
const d = o.data.title;
|
|
3309
3309
|
let x = 0;
|
|
3310
3310
|
return o.data.messages.forEach(async (D) => {
|
|
3311
3311
|
var K, U, M, X, se, ee, le;
|
|
@@ -3319,12 +3319,12 @@ class jr {
|
|
|
3319
3319
|
"%cstorage",
|
|
3320
3320
|
m.STORAGE,
|
|
3321
3321
|
"set message",
|
|
3322
|
-
`title: ${
|
|
3322
|
+
`title: ${d}`,
|
|
3323
3323
|
D,
|
|
3324
3324
|
He.message
|
|
3325
3325
|
);
|
|
3326
3326
|
}), await this.db.table(N.TOPICS).put({
|
|
3327
|
-
title:
|
|
3327
|
+
title: d,
|
|
3328
3328
|
widget_id: r.widget,
|
|
3329
3329
|
message_id: D.id,
|
|
3330
3330
|
dashboard_id: r.dashboard,
|
|
@@ -3339,7 +3339,7 @@ class jr {
|
|
|
3339
3339
|
"%cstorage",
|
|
3340
3340
|
m.STORAGE,
|
|
3341
3341
|
"set topic",
|
|
3342
|
-
`title: ${
|
|
3342
|
+
`title: ${d}`,
|
|
3343
3343
|
D,
|
|
3344
3344
|
He.message
|
|
3345
3345
|
);
|
|
@@ -3362,14 +3362,14 @@ class jr {
|
|
|
3362
3362
|
* Wipe Message data after expires timestamp
|
|
3363
3363
|
*/
|
|
3364
3364
|
k(this, "cleanMessages", async () => {
|
|
3365
|
-
const r = Date.now() / 1e3, o = (D) => D.expires < r,
|
|
3365
|
+
const r = Date.now() / 1e3, o = (D) => D.expires < r, d = (D) => D.expires < r;
|
|
3366
3366
|
return await this.db.table(N.TOPICS).orderBy("expires").filter(o).delete().catch((D) => (console.error(
|
|
3367
3367
|
"%cstorage%c %cclean",
|
|
3368
3368
|
m.STORAGE,
|
|
3369
3369
|
m.NONE,
|
|
3370
3370
|
m.MESSAGES,
|
|
3371
3371
|
D.message
|
|
3372
|
-
), 0)), await this.db.table(N.MESSAGES).orderBy("expires").filter(
|
|
3372
|
+
), 0)), await this.db.table(N.MESSAGES).orderBy("expires").filter(d).delete().catch((D) => (console.error(
|
|
3373
3373
|
"%cstorage%c %clean",
|
|
3374
3374
|
m.STORAGE,
|
|
3375
3375
|
m.NONE,
|
|
@@ -3378,12 +3378,12 @@ class jr {
|
|
|
3378
3378
|
), 0));
|
|
3379
3379
|
});
|
|
3380
3380
|
k(this, "hideMessage", async (r, o) => {
|
|
3381
|
-
await this.db.table(N.TOPICS).where("message_id").equals(r).modify({ visible: o ? 1 : 0 }).catch((
|
|
3381
|
+
await this.db.table(N.TOPICS).where("message_id").equals(r).modify({ visible: o ? 1 : 0 }).catch((d) => (console.error(
|
|
3382
3382
|
"%cstorage%c %chide",
|
|
3383
3383
|
m.STORAGE,
|
|
3384
3384
|
m.NONE,
|
|
3385
3385
|
m.HIDE,
|
|
3386
|
-
|
|
3386
|
+
d.message
|
|
3387
3387
|
), 0));
|
|
3388
3388
|
});
|
|
3389
3389
|
/**
|
|
@@ -3408,8 +3408,8 @@ class jr {
|
|
|
3408
3408
|
* @returns null
|
|
3409
3409
|
*/
|
|
3410
3410
|
k(this, "subscribe", (r) => (r = Mr(r), this.subscribers.filter(
|
|
3411
|
-
(
|
|
3412
|
-
).length > 0 || (r.type === N.MESSAGES && (r =
|
|
3411
|
+
(d) => d.widget === r.widget
|
|
3412
|
+
).length > 0 || (r.type === N.MESSAGES && (r = _t(this.options, r)), console.info(
|
|
3413
3413
|
"%cstorage%c %csubscribe",
|
|
3414
3414
|
m.STORAGE,
|
|
3415
3415
|
m.NONE,
|
|
@@ -3478,26 +3478,26 @@ class jr {
|
|
|
3478
3478
|
}), this.db.open();
|
|
3479
3479
|
}
|
|
3480
3480
|
}
|
|
3481
|
-
function zn(
|
|
3481
|
+
function zn(l) {
|
|
3482
3482
|
return new Promise((r, o) => {
|
|
3483
|
-
|
|
3483
|
+
l.oncomplete = l.onsuccess = () => r(l.result), l.onabort = l.onerror = () => o(l.error);
|
|
3484
3484
|
});
|
|
3485
3485
|
}
|
|
3486
|
-
function Ma(
|
|
3487
|
-
const o = indexedDB.open(
|
|
3486
|
+
function Ma(l, r) {
|
|
3487
|
+
const o = indexedDB.open(l);
|
|
3488
3488
|
o.onupgradeneeded = () => o.result.createObjectStore(r);
|
|
3489
|
-
const
|
|
3490
|
-
return (x, D) =>
|
|
3489
|
+
const d = zn(o);
|
|
3490
|
+
return (x, D) => d.then((K) => D(K.transaction(r, x).objectStore(r)));
|
|
3491
3491
|
}
|
|
3492
3492
|
let Un;
|
|
3493
3493
|
function Nr() {
|
|
3494
3494
|
return Un || (Un = Ma("keyval-store", "keyval")), Un;
|
|
3495
3495
|
}
|
|
3496
|
-
function Vt(
|
|
3497
|
-
return r("readonly", (o) => zn(o.get(
|
|
3496
|
+
function Vt(l, r = Nr()) {
|
|
3497
|
+
return r("readonly", (o) => zn(o.get(l)));
|
|
3498
3498
|
}
|
|
3499
|
-
function wt(
|
|
3500
|
-
return o("readwrite", (
|
|
3499
|
+
function wt(l, r, o = Nr()) {
|
|
3500
|
+
return o("readwrite", (d) => (d.put(r, l), zn(d.transaction)));
|
|
3501
3501
|
}
|
|
3502
3502
|
class Kr {
|
|
3503
3503
|
constructor(r) {
|
|
@@ -3505,15 +3505,15 @@ class Kr {
|
|
|
3505
3505
|
k(this, "options");
|
|
3506
3506
|
k(this, "getCloud", async (r) => {
|
|
3507
3507
|
const o = V(r);
|
|
3508
|
-
return await Vt(o).then((
|
|
3508
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", m.API, N.CLOUD, r.slide, r.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3509
3509
|
});
|
|
3510
3510
|
k(this, "getSeries", async (r) => {
|
|
3511
3511
|
const o = V(r);
|
|
3512
|
-
return await Vt(o).then((
|
|
3512
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", m.API, N.SERIES, r.slide, r.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3513
3513
|
});
|
|
3514
3514
|
k(this, "getMessages", async (r) => {
|
|
3515
3515
|
const o = V(r);
|
|
3516
|
-
return await Vt(o).then((
|
|
3516
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", m.API, N.MESSAGES, r.slide, r.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3517
3517
|
});
|
|
3518
3518
|
/**
|
|
3519
3519
|
* Update Cloud
|
|
@@ -3524,8 +3524,8 @@ class Kr {
|
|
|
3524
3524
|
k(this, "setCloud", async (r, o) => {
|
|
3525
3525
|
if (!o.success)
|
|
3526
3526
|
return 400;
|
|
3527
|
-
const
|
|
3528
|
-
return delete o.success, delete o.message, await wt(
|
|
3527
|
+
const d = V(r);
|
|
3528
|
+
return delete o.success, delete o.message, await wt(d, o).then(() => 201).catch((x) => (console.error("%cstorage", m.STORAGE, N.CLOUD, r, x.message), 400));
|
|
3529
3529
|
});
|
|
3530
3530
|
/**
|
|
3531
3531
|
* Update Series
|
|
@@ -3536,8 +3536,8 @@ class Kr {
|
|
|
3536
3536
|
k(this, "setSeries", async (r, o) => {
|
|
3537
3537
|
if (!o.success)
|
|
3538
3538
|
return 400;
|
|
3539
|
-
const
|
|
3540
|
-
return delete o.success, delete o.message, await wt(
|
|
3539
|
+
const d = V(r);
|
|
3540
|
+
return delete o.success, delete o.message, await wt(d, o).then(() => 201).catch((x) => (console.error("%cstorage", m.STORAGE, N.SERIES, r, x.message), 400));
|
|
3541
3541
|
});
|
|
3542
3542
|
/**
|
|
3543
3543
|
* Update Messages
|
|
@@ -3548,8 +3548,8 @@ class Kr {
|
|
|
3548
3548
|
k(this, "setMessages", async (r, o) => {
|
|
3549
3549
|
if (!o.success)
|
|
3550
3550
|
return 400;
|
|
3551
|
-
const
|
|
3552
|
-
return delete o.success, delete o.message, await wt(
|
|
3551
|
+
const d = V(r);
|
|
3552
|
+
return delete o.success, delete o.message, await wt(d, o).then(() => 201).catch((x) => (console.error("%cstorage", m.STORAGE, N.MESSAGES, r, x.message), 400));
|
|
3553
3553
|
});
|
|
3554
3554
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
3555
3555
|
k(this, "hideMessage", async (r, o) => {
|
|
@@ -3563,20 +3563,20 @@ class Kr {
|
|
|
3563
3563
|
* @returns number
|
|
3564
3564
|
*/
|
|
3565
3565
|
k(this, "setWidget", async (r) => {
|
|
3566
|
-
const o = V(r),
|
|
3566
|
+
const o = V(r), d = {
|
|
3567
3567
|
id: r.widget,
|
|
3568
3568
|
dashboard_id: r.dashboard,
|
|
3569
3569
|
type: r.type
|
|
3570
3570
|
};
|
|
3571
|
-
return await wt(o,
|
|
3571
|
+
return await wt(o, d).then(() => 201).catch((x) => (console.error("%cstorage", m.STORAGE, N.WIDGET, r, x.message), 400));
|
|
3572
3572
|
});
|
|
3573
3573
|
/**
|
|
3574
3574
|
* Add component subscriber
|
|
3575
3575
|
* @param query IQuery
|
|
3576
3576
|
* @returns null
|
|
3577
3577
|
*/
|
|
3578
|
-
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r =
|
|
3579
|
-
(
|
|
3578
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3579
|
+
(d) => d.widget === r.widget
|
|
3580
3580
|
).length > 0 || (console.debug(
|
|
3581
3581
|
"%cstorage%c %csubscribe",
|
|
3582
3582
|
m.STORAGE,
|
|
@@ -3592,7 +3592,7 @@ class Kr {
|
|
|
3592
3592
|
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3593
3593
|
k(this, "loadSlide", async (r) => {
|
|
3594
3594
|
const o = V(r);
|
|
3595
|
-
return await Vt(o).then((
|
|
3595
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", m.API, N.SLIDE, r.slide), { data: null, message: "Slide Load error", success: !1 }));
|
|
3596
3596
|
});
|
|
3597
3597
|
/**
|
|
3598
3598
|
* Update Slide
|
|
@@ -3600,14 +3600,14 @@ class Kr {
|
|
|
3600
3600
|
* @returns number
|
|
3601
3601
|
*/
|
|
3602
3602
|
k(this, "storeSlide", async (r) => {
|
|
3603
|
-
const o = V(r),
|
|
3603
|
+
const o = V(r), d = {
|
|
3604
3604
|
id: r.id,
|
|
3605
3605
|
title: r.data.title || "Not set",
|
|
3606
3606
|
json: r.data.json || {},
|
|
3607
3607
|
html: r.data.html || "",
|
|
3608
3608
|
css: r.data.css || ""
|
|
3609
3609
|
};
|
|
3610
|
-
return await wt(o,
|
|
3610
|
+
return await wt(o, d).then(() => 201).catch((x) => (console.error("%cstorage", m.STORAGE, N.SLIDE, r, x.message), 400));
|
|
3611
3611
|
});
|
|
3612
3612
|
this.options = r;
|
|
3613
3613
|
}
|
|
@@ -3620,24 +3620,24 @@ class Br {
|
|
|
3620
3620
|
const o = V(r);
|
|
3621
3621
|
try {
|
|
3622
3622
|
return localStorage.getObject(o);
|
|
3623
|
-
} catch (
|
|
3624
|
-
return console.warn("%capi", m.API, N.CLOUD, r.slide, r.widget,
|
|
3623
|
+
} catch (d) {
|
|
3624
|
+
return console.warn("%capi", m.API, N.CLOUD, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3625
3625
|
}
|
|
3626
3626
|
});
|
|
3627
3627
|
k(this, "getSeries", async (r) => {
|
|
3628
3628
|
const o = V(r);
|
|
3629
3629
|
try {
|
|
3630
3630
|
return localStorage.getObject(o);
|
|
3631
|
-
} catch (
|
|
3632
|
-
return console.warn("%capi", m.API, N.SERIES, r.slide, r.widget,
|
|
3631
|
+
} catch (d) {
|
|
3632
|
+
return console.warn("%capi", m.API, N.SERIES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3633
3633
|
}
|
|
3634
3634
|
});
|
|
3635
3635
|
k(this, "getMessages", async (r) => {
|
|
3636
3636
|
const o = V(r);
|
|
3637
3637
|
try {
|
|
3638
3638
|
return localStorage.getObject(o);
|
|
3639
|
-
} catch (
|
|
3640
|
-
return console.warn("%capi", m.API, N.MESSAGES, r.slide, r.widget,
|
|
3639
|
+
} catch (d) {
|
|
3640
|
+
return console.warn("%capi", m.API, N.MESSAGES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3641
3641
|
}
|
|
3642
3642
|
});
|
|
3643
3643
|
/**
|
|
@@ -3647,9 +3647,9 @@ class Br {
|
|
|
3647
3647
|
* @returns number
|
|
3648
3648
|
*/
|
|
3649
3649
|
k(this, "setCloud", async (r, o) => {
|
|
3650
|
-
const
|
|
3650
|
+
const d = V(r);
|
|
3651
3651
|
try {
|
|
3652
|
-
return localStorage.setObject(
|
|
3652
|
+
return localStorage.setObject(d, o), 201;
|
|
3653
3653
|
} catch (x) {
|
|
3654
3654
|
return console.error("%cstorage", m.STORAGE, N.CLOUD, r, x), 400;
|
|
3655
3655
|
}
|
|
@@ -3661,9 +3661,9 @@ class Br {
|
|
|
3661
3661
|
* @returns number
|
|
3662
3662
|
*/
|
|
3663
3663
|
k(this, "setSeries", async (r, o) => {
|
|
3664
|
-
const
|
|
3664
|
+
const d = V(r);
|
|
3665
3665
|
try {
|
|
3666
|
-
return localStorage.setObject(
|
|
3666
|
+
return localStorage.setObject(d, o), 201;
|
|
3667
3667
|
} catch (x) {
|
|
3668
3668
|
return console.error("%cstorage", m.STORAGE, N.SERIES, r, x), 400;
|
|
3669
3669
|
}
|
|
@@ -3675,9 +3675,9 @@ class Br {
|
|
|
3675
3675
|
* @returns number
|
|
3676
3676
|
*/
|
|
3677
3677
|
k(this, "setMessages", async (r, o) => {
|
|
3678
|
-
const
|
|
3678
|
+
const d = V(r);
|
|
3679
3679
|
try {
|
|
3680
|
-
return localStorage.setObject(
|
|
3680
|
+
return localStorage.setObject(d, o), 200;
|
|
3681
3681
|
} catch (x) {
|
|
3682
3682
|
return console.error("%cstorage", m.STORAGE, N.MESSAGES, r, x), 400;
|
|
3683
3683
|
}
|
|
@@ -3690,8 +3690,8 @@ class Br {
|
|
|
3690
3690
|
const o = `widget.${r.widget}`;
|
|
3691
3691
|
try {
|
|
3692
3692
|
return localStorage.setObject(o, r), 201;
|
|
3693
|
-
} catch (
|
|
3694
|
-
return console.error("%cstorage", m.STORAGE, N.WIDGET, r,
|
|
3693
|
+
} catch (d) {
|
|
3694
|
+
return console.error("%cstorage", m.STORAGE, N.WIDGET, r, d), 400;
|
|
3695
3695
|
}
|
|
3696
3696
|
});
|
|
3697
3697
|
/**
|
|
@@ -3699,8 +3699,8 @@ class Br {
|
|
|
3699
3699
|
* @param query IQuery
|
|
3700
3700
|
* @returns null
|
|
3701
3701
|
*/
|
|
3702
|
-
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r =
|
|
3703
|
-
(
|
|
3702
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3703
|
+
(d) => d.widget === r.widget
|
|
3704
3704
|
).length || (console.debug(
|
|
3705
3705
|
"%cstorage%c %csubscribe",
|
|
3706
3706
|
m.STORAGE,
|
|
@@ -3734,11 +3734,11 @@ class Br {
|
|
|
3734
3734
|
return console.error("%cstorage", m.STORAGE, N.SLIDE, r, o), 400;
|
|
3735
3735
|
}
|
|
3736
3736
|
});
|
|
3737
|
-
this.options = r, Storage.prototype.setObject = function(o,
|
|
3738
|
-
this.setObject(o, JSON.stringify(
|
|
3737
|
+
this.options = r, Storage.prototype.setObject = function(o, d) {
|
|
3738
|
+
this.setObject(o, JSON.stringify(d));
|
|
3739
3739
|
}, Storage.prototype.getObject = function(o) {
|
|
3740
|
-
const
|
|
3741
|
-
return
|
|
3740
|
+
const d = this.getObject(o);
|
|
3741
|
+
return d && JSON.parse(d);
|
|
3742
3742
|
};
|
|
3743
3743
|
}
|
|
3744
3744
|
}
|
|
@@ -3750,24 +3750,24 @@ class Lr {
|
|
|
3750
3750
|
const o = V(r);
|
|
3751
3751
|
try {
|
|
3752
3752
|
return sessionStorage.getObject(o);
|
|
3753
|
-
} catch (
|
|
3754
|
-
return console.warn("%capi", m.API, N.CLOUD, r.slide, r.widget,
|
|
3753
|
+
} catch (d) {
|
|
3754
|
+
return console.warn("%capi", m.API, N.CLOUD, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3755
3755
|
}
|
|
3756
3756
|
});
|
|
3757
3757
|
k(this, "getSeries", async (r) => {
|
|
3758
3758
|
const o = V(r);
|
|
3759
3759
|
try {
|
|
3760
3760
|
return sessionStorage.getObject(o);
|
|
3761
|
-
} catch (
|
|
3762
|
-
return console.warn("%capi", m.API, N.SERIES, r.slide, r.widget,
|
|
3761
|
+
} catch (d) {
|
|
3762
|
+
return console.warn("%capi", m.API, N.SERIES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3763
3763
|
}
|
|
3764
3764
|
});
|
|
3765
3765
|
k(this, "getMessages", async (r) => {
|
|
3766
3766
|
const o = V(r);
|
|
3767
3767
|
try {
|
|
3768
3768
|
return sessionStorage.getObject(o);
|
|
3769
|
-
} catch (
|
|
3770
|
-
return console.warn("%capi", m.API, N.MESSAGES, r.slide, r.widget,
|
|
3769
|
+
} catch (d) {
|
|
3770
|
+
return console.warn("%capi", m.API, N.MESSAGES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3771
3771
|
}
|
|
3772
3772
|
});
|
|
3773
3773
|
/**
|
|
@@ -3777,9 +3777,9 @@ class Lr {
|
|
|
3777
3777
|
* @returns number
|
|
3778
3778
|
*/
|
|
3779
3779
|
k(this, "setCloud", async (r, o) => {
|
|
3780
|
-
const
|
|
3780
|
+
const d = V(r);
|
|
3781
3781
|
try {
|
|
3782
|
-
return sessionStorage.setObject(
|
|
3782
|
+
return sessionStorage.setObject(d, o), 201;
|
|
3783
3783
|
} catch (x) {
|
|
3784
3784
|
return console.error("%cstorage", m.STORAGE, N.CLOUD, r, x), 400;
|
|
3785
3785
|
}
|
|
@@ -3791,9 +3791,9 @@ class Lr {
|
|
|
3791
3791
|
* @returns number
|
|
3792
3792
|
*/
|
|
3793
3793
|
k(this, "setSeries", async (r, o) => {
|
|
3794
|
-
const
|
|
3794
|
+
const d = V(r);
|
|
3795
3795
|
try {
|
|
3796
|
-
return sessionStorage.setObject(
|
|
3796
|
+
return sessionStorage.setObject(d, o), 201;
|
|
3797
3797
|
} catch (x) {
|
|
3798
3798
|
return console.error("%cstorage", m.STORAGE, N.SERIES, r, x), 400;
|
|
3799
3799
|
}
|
|
@@ -3805,9 +3805,9 @@ class Lr {
|
|
|
3805
3805
|
* @returns number
|
|
3806
3806
|
*/
|
|
3807
3807
|
k(this, "setMessages", async (r, o) => {
|
|
3808
|
-
const
|
|
3808
|
+
const d = V(r);
|
|
3809
3809
|
try {
|
|
3810
|
-
return sessionStorage.setObject(
|
|
3810
|
+
return sessionStorage.setObject(d, o), 200;
|
|
3811
3811
|
} catch (x) {
|
|
3812
3812
|
return console.error("%cstorage", m.STORAGE, N.MESSAGES, r, x), 400;
|
|
3813
3813
|
}
|
|
@@ -3820,8 +3820,8 @@ class Lr {
|
|
|
3820
3820
|
const o = `widget.${r.widget}`;
|
|
3821
3821
|
try {
|
|
3822
3822
|
return sessionStorage.setObject(o, r), 201;
|
|
3823
|
-
} catch (
|
|
3824
|
-
return console.error("%cstorage", m.STORAGE, N.WIDGET, r,
|
|
3823
|
+
} catch (d) {
|
|
3824
|
+
return console.error("%cstorage", m.STORAGE, N.WIDGET, r, d), 400;
|
|
3825
3825
|
}
|
|
3826
3826
|
});
|
|
3827
3827
|
/**
|
|
@@ -3829,8 +3829,8 @@ class Lr {
|
|
|
3829
3829
|
* @param query IQuery
|
|
3830
3830
|
* @returns null
|
|
3831
3831
|
*/
|
|
3832
|
-
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r =
|
|
3833
|
-
(
|
|
3832
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3833
|
+
(d) => d.widget === r.widget
|
|
3834
3834
|
).length || (console.debug(
|
|
3835
3835
|
"%cstorage%c %csubscribe",
|
|
3836
3836
|
m.STORAGE,
|
|
@@ -3869,11 +3869,11 @@ class Lr {
|
|
|
3869
3869
|
return console.error("%cstorage", m.STORAGE, N.SLIDE, r, o), 400;
|
|
3870
3870
|
}
|
|
3871
3871
|
});
|
|
3872
|
-
this.options = r, Storage.prototype.setObject = function(o,
|
|
3873
|
-
this.setItem(o, JSON.stringify(
|
|
3872
|
+
this.options = r, Storage.prototype.setObject = function(o, d) {
|
|
3873
|
+
this.setItem(o, JSON.stringify(d));
|
|
3874
3874
|
}, Storage.prototype.getObject = function(o) {
|
|
3875
|
-
const
|
|
3876
|
-
return
|
|
3875
|
+
const d = this.getItem(o);
|
|
3876
|
+
return d && JSON.parse(d);
|
|
3877
3877
|
};
|
|
3878
3878
|
}
|
|
3879
3879
|
}
|
|
@@ -3885,24 +3885,24 @@ class Gr {
|
|
|
3885
3885
|
const o = V(r);
|
|
3886
3886
|
try {
|
|
3887
3887
|
return window.BuzzCasting.WidgetData[o];
|
|
3888
|
-
} catch (
|
|
3889
|
-
return console.warn("%capi", m.API, N.CLOUD, r.slide, r.widget,
|
|
3888
|
+
} catch (d) {
|
|
3889
|
+
return console.warn("%capi", m.API, N.CLOUD, r.slide, r.widget, d), { data: null, message: "Cloud Data error", success: !1 };
|
|
3890
3890
|
}
|
|
3891
3891
|
});
|
|
3892
3892
|
k(this, "getSeries", async (r) => {
|
|
3893
3893
|
const o = V(r);
|
|
3894
3894
|
try {
|
|
3895
3895
|
return window.BuzzCasting.WidgetData[o];
|
|
3896
|
-
} catch (
|
|
3897
|
-
return console.warn("%capi", m.API, N.SERIES, r.slide, r.widget,
|
|
3896
|
+
} catch (d) {
|
|
3897
|
+
return console.warn("%capi", m.API, N.SERIES, r.slide, r.widget, d), { data: null, message: "Series Data error", success: !1 };
|
|
3898
3898
|
}
|
|
3899
3899
|
});
|
|
3900
3900
|
k(this, "getMessages", async (r) => {
|
|
3901
3901
|
const o = V(r);
|
|
3902
3902
|
try {
|
|
3903
3903
|
return window.BuzzCasting.WidgetData[o];
|
|
3904
|
-
} catch (
|
|
3905
|
-
return console.warn("%capi", m.API, N.MESSAGES, r.slide, r.widget,
|
|
3904
|
+
} catch (d) {
|
|
3905
|
+
return console.warn("%capi", m.API, N.MESSAGES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3906
3906
|
}
|
|
3907
3907
|
});
|
|
3908
3908
|
/**
|
|
@@ -3912,9 +3912,9 @@ class Gr {
|
|
|
3912
3912
|
* @returns number
|
|
3913
3913
|
*/
|
|
3914
3914
|
k(this, "setCloud", async (r, o) => {
|
|
3915
|
-
const
|
|
3915
|
+
const d = V(r);
|
|
3916
3916
|
try {
|
|
3917
|
-
return window.BuzzCasting.WidgetData[
|
|
3917
|
+
return window.BuzzCasting.WidgetData[d] = o, 201;
|
|
3918
3918
|
} catch (x) {
|
|
3919
3919
|
return console.error("%cstorage", m.STORAGE, "set", r, x), 400;
|
|
3920
3920
|
}
|
|
@@ -3926,9 +3926,9 @@ class Gr {
|
|
|
3926
3926
|
* @returns number
|
|
3927
3927
|
*/
|
|
3928
3928
|
k(this, "setSeries", async (r, o) => {
|
|
3929
|
-
const
|
|
3929
|
+
const d = V(r);
|
|
3930
3930
|
try {
|
|
3931
|
-
return window.BuzzCasting.WidgetData[
|
|
3931
|
+
return window.BuzzCasting.WidgetData[d] = o, 201;
|
|
3932
3932
|
} catch (x) {
|
|
3933
3933
|
return console.error("%cstorage", m.STORAGE, "set", r, x), 400;
|
|
3934
3934
|
}
|
|
@@ -3940,9 +3940,9 @@ class Gr {
|
|
|
3940
3940
|
* @returns number
|
|
3941
3941
|
*/
|
|
3942
3942
|
k(this, "setMessages", async (r, o) => {
|
|
3943
|
-
const
|
|
3943
|
+
const d = V(r);
|
|
3944
3944
|
try {
|
|
3945
|
-
return window.BuzzCasting.WidgetData[
|
|
3945
|
+
return window.BuzzCasting.WidgetData[d] = o, 201;
|
|
3946
3946
|
} catch (x) {
|
|
3947
3947
|
return console.error("%cstorage", m.STORAGE, "set", r, x), 400;
|
|
3948
3948
|
}
|
|
@@ -3955,8 +3955,8 @@ class Gr {
|
|
|
3955
3955
|
const o = `widget.${r.widget}`;
|
|
3956
3956
|
try {
|
|
3957
3957
|
return window.BuzzCasting.WidgetData[o] = r, 201;
|
|
3958
|
-
} catch (
|
|
3959
|
-
return console.error("%cstorage", m.STORAGE, N.WIDGET, r,
|
|
3958
|
+
} catch (d) {
|
|
3959
|
+
return console.error("%cstorage", m.STORAGE, N.WIDGET, r, d), 400;
|
|
3960
3960
|
}
|
|
3961
3961
|
});
|
|
3962
3962
|
/**
|
|
@@ -3964,8 +3964,8 @@ class Gr {
|
|
|
3964
3964
|
* @param query IQuery
|
|
3965
3965
|
* @returns null
|
|
3966
3966
|
*/
|
|
3967
|
-
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r =
|
|
3968
|
-
(
|
|
3967
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3968
|
+
(d) => d.widget === r.widget
|
|
3969
3969
|
).length || (console.debug(
|
|
3970
3970
|
"%cstorage%c %csubscribe",
|
|
3971
3971
|
m.STORAGE,
|
|
@@ -4002,44 +4002,44 @@ class Gr {
|
|
|
4002
4002
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
4003
4003
|
}
|
|
4004
4004
|
}
|
|
4005
|
-
function Fa(
|
|
4006
|
-
const r =
|
|
4007
|
-
return r.length > 0 ? (r.forEach((o,
|
|
4008
|
-
r[
|
|
4005
|
+
function Fa(l) {
|
|
4006
|
+
const r = l.toUpperCase().split(/[\s_-]+/);
|
|
4007
|
+
return r.length > 0 ? (r.forEach((o, d) => {
|
|
4008
|
+
r[d] = `${o.charAt(0)}.`;
|
|
4009
4009
|
}), r.join(" ")) : "";
|
|
4010
4010
|
}
|
|
4011
|
-
function Wa(
|
|
4012
|
-
let r = "", o = "",
|
|
4011
|
+
function Wa(l) {
|
|
4012
|
+
let r = "", o = "", d = {
|
|
4013
4013
|
backgroundImage: ""
|
|
4014
4014
|
};
|
|
4015
|
-
return typeof
|
|
4016
|
-
(x.type === "photo" || x.type === "image") && (
|
|
4015
|
+
return typeof l.media < "u" && l.media.forEach((x) => {
|
|
4016
|
+
(x.type === "photo" || x.type === "image") && (d = {
|
|
4017
4017
|
backgroundImage: `url(${x.url})`
|
|
4018
4018
|
}, o = x.url), x.type === "video" && (r = x.url);
|
|
4019
4019
|
}), {
|
|
4020
4020
|
image: o,
|
|
4021
|
-
background:
|
|
4021
|
+
background: d || null,
|
|
4022
4022
|
video: r
|
|
4023
4023
|
};
|
|
4024
4024
|
}
|
|
4025
|
-
function ja(
|
|
4025
|
+
function ja(l) {
|
|
4026
4026
|
const r = {};
|
|
4027
|
-
for (let o = 0; o <
|
|
4028
|
-
const
|
|
4029
|
-
|
|
4027
|
+
for (let o = 0; o < l.length; o++) {
|
|
4028
|
+
const d = l.item(o);
|
|
4029
|
+
d != null && d.name && (r[d.name] = d.value);
|
|
4030
4030
|
}
|
|
4031
4031
|
return r;
|
|
4032
4032
|
}
|
|
4033
|
-
function za(
|
|
4033
|
+
function za(l) {
|
|
4034
4034
|
const r = {};
|
|
4035
|
-
for (let o = 0; o <
|
|
4036
|
-
const
|
|
4037
|
-
|
|
4035
|
+
for (let o = 0; o < l.length; o++) {
|
|
4036
|
+
const d = l[o];
|
|
4037
|
+
d.name !== "class" && !d.name.includes("data") && (r[d.name] = d.value);
|
|
4038
4038
|
}
|
|
4039
4039
|
return r;
|
|
4040
4040
|
}
|
|
4041
|
-
function Ha(
|
|
4042
|
-
switch (
|
|
4041
|
+
function Ha(l, r) {
|
|
4042
|
+
switch (l) {
|
|
4043
4043
|
case "bl":
|
|
4044
4044
|
return `text-blue fa-solid fa-rss fa-${r}`;
|
|
4045
4045
|
case "co":
|
|
@@ -4080,22 +4080,22 @@ function Ha(d, r) {
|
|
|
4080
4080
|
return "";
|
|
4081
4081
|
}
|
|
4082
4082
|
}
|
|
4083
|
-
function Ya(
|
|
4084
|
-
return
|
|
4083
|
+
function Ya(l) {
|
|
4084
|
+
return l.replace(/^\w|[A-Z]|\b\w/g, (r, o) => o === 0 ? r.toLowerCase() : r.toUpperCase()).replace(/\s+/g, "");
|
|
4085
4085
|
}
|
|
4086
|
-
function Qa(
|
|
4087
|
-
return
|
|
4086
|
+
function Qa(l) {
|
|
4087
|
+
return l.toLowerCase().split("-").reduce((r, o) => r + (o.charAt(0).toUpperCase() + o.slice(1)));
|
|
4088
4088
|
}
|
|
4089
|
-
const Xa = (
|
|
4090
|
-
function Na(
|
|
4089
|
+
const Xa = (l) => l.charAt(0).toUpperCase() + l.slice(1);
|
|
4090
|
+
function Na(l) {
|
|
4091
4091
|
const r = document.createRange();
|
|
4092
|
-
r.selectNodeContents(
|
|
4092
|
+
r.selectNodeContents(l), r.deleteContents();
|
|
4093
4093
|
}
|
|
4094
|
-
function Ka(
|
|
4095
|
-
|
|
4094
|
+
function Ka(l) {
|
|
4095
|
+
l.reduce(
|
|
4096
4096
|
(r, o) => Object.keys(o).reduce(
|
|
4097
|
-
(
|
|
4098
|
-
...
|
|
4097
|
+
(d, x) => ({
|
|
4098
|
+
...d,
|
|
4099
4099
|
[x]: x in r && typeof r[x] == "object" && r[x] !== null && typeof o[x] == "object" && o[x] !== null ? Ka([r[x], o[x]]) : o[x]
|
|
4100
4100
|
}),
|
|
4101
4101
|
r
|
|
@@ -4103,40 +4103,40 @@ function Ka(d) {
|
|
|
4103
4103
|
{}
|
|
4104
4104
|
);
|
|
4105
4105
|
}
|
|
4106
|
-
function Ja(
|
|
4107
|
-
return `${(
|
|
4106
|
+
function Ja(l, r = "font-bold") {
|
|
4107
|
+
return `${(l == null ? void 0 : l.title.length) > 0 ? `<div class="${r}">${l.title}</div>` : ""}${l != null && l.content ? l.content.replace(/\n\n/g, `
|
|
4108
4108
|
`).replace(/\n/g, "<br/>") : ""}`;
|
|
4109
4109
|
}
|
|
4110
|
-
function Ba(
|
|
4111
|
-
for (;
|
|
4112
|
-
|
|
4113
|
-
return
|
|
4110
|
+
function Ba(l, r) {
|
|
4111
|
+
for (; l.length < r; )
|
|
4112
|
+
l = `0${l}`;
|
|
4113
|
+
return l;
|
|
4114
4114
|
}
|
|
4115
|
-
function Oe(
|
|
4116
|
-
let o,
|
|
4115
|
+
function Oe(l, r) {
|
|
4116
|
+
let o, d, x;
|
|
4117
4117
|
if (r.length === 0)
|
|
4118
|
-
return
|
|
4118
|
+
return l;
|
|
4119
4119
|
for (o = 0, x = r.length; o < x; o++)
|
|
4120
|
-
|
|
4121
|
-
return
|
|
4120
|
+
d = r.charCodeAt(o), l = (l << 5) - l + d, l |= 0;
|
|
4121
|
+
return l < 0 ? l * -2 : l;
|
|
4122
4122
|
}
|
|
4123
|
-
function La(
|
|
4124
|
-
return Object.keys(r).sort().reduce(
|
|
4125
|
-
function
|
|
4123
|
+
function La(l, r, o) {
|
|
4124
|
+
return Object.keys(r).sort().reduce(d, l);
|
|
4125
|
+
function d(x, D) {
|
|
4126
4126
|
return $r(x, r[D], D, o);
|
|
4127
4127
|
}
|
|
4128
4128
|
}
|
|
4129
|
-
function $r(
|
|
4130
|
-
const x = Oe(Oe(Oe(
|
|
4129
|
+
function $r(l, r, o, d) {
|
|
4130
|
+
const x = Oe(Oe(Oe(l, o), Ga(r)), typeof r);
|
|
4131
4131
|
if (r === null)
|
|
4132
4132
|
return Oe(x, "null");
|
|
4133
4133
|
if (r === void 0)
|
|
4134
4134
|
return Oe(x, "undefined");
|
|
4135
4135
|
if (typeof r == "object" || typeof r == "function") {
|
|
4136
|
-
if (
|
|
4136
|
+
if (d.includes(r))
|
|
4137
4137
|
return Oe(x, `[Circular]${o}`);
|
|
4138
|
-
|
|
4139
|
-
const D = La(x, r,
|
|
4138
|
+
d.push(r);
|
|
4139
|
+
const D = La(x, r, d);
|
|
4140
4140
|
if (!("valueOf" in r) || typeof r.valueOf != "function")
|
|
4141
4141
|
return D;
|
|
4142
4142
|
try {
|
|
@@ -4147,15 +4147,15 @@ function $r(d, r, o, l) {
|
|
|
4147
4147
|
}
|
|
4148
4148
|
return Oe(x, r.toString());
|
|
4149
4149
|
}
|
|
4150
|
-
function Ga(
|
|
4151
|
-
return Object.prototype.toString.call(
|
|
4150
|
+
function Ga(l) {
|
|
4151
|
+
return Object.prototype.toString.call(l);
|
|
4152
4152
|
}
|
|
4153
|
-
function Fn(
|
|
4154
|
-
return Ba($r(0,
|
|
4153
|
+
function Fn(l) {
|
|
4154
|
+
return Ba($r(0, l, "", []).toString(16), 8);
|
|
4155
4155
|
}
|
|
4156
|
-
function Va(
|
|
4157
|
-
if (
|
|
4158
|
-
return
|
|
4156
|
+
function Va(l, r) {
|
|
4157
|
+
if (l = l.toString().replace(/[^0-9.]/g, ""), l < 1e3)
|
|
4158
|
+
return l;
|
|
4159
4159
|
const o = [
|
|
4160
4160
|
{ v: 1e3, s: "K" },
|
|
4161
4161
|
{ v: 1e6, s: "M" },
|
|
@@ -4164,12 +4164,12 @@ function Va(d, r) {
|
|
|
4164
4164
|
{ v: 1e15, s: "P" },
|
|
4165
4165
|
{ v: 1e18, s: "E" }
|
|
4166
4166
|
];
|
|
4167
|
-
let
|
|
4168
|
-
for (
|
|
4167
|
+
let d;
|
|
4168
|
+
for (d = o.length - 1; d > 0 && !(l >= o[d].v); d--)
|
|
4169
4169
|
;
|
|
4170
|
-
return (
|
|
4170
|
+
return (l / o[d].v).toFixed(r).replace(/\.0+$|(\.\d*[1-9])0+$/, "$1") + o[d].s;
|
|
4171
4171
|
}
|
|
4172
|
-
function Za(
|
|
4172
|
+
function Za(l, r) {
|
|
4173
4173
|
const o = [
|
|
4174
4174
|
{ value: 1, symbol: "" },
|
|
4175
4175
|
{ value: 1e3, symbol: "K" },
|
|
@@ -4178,14 +4178,14 @@ function Za(d, r) {
|
|
|
4178
4178
|
{ value: 1e12, symbol: "T" },
|
|
4179
4179
|
{ value: 1e15, symbol: "P" },
|
|
4180
4180
|
{ value: 1e18, symbol: "E" }
|
|
4181
|
-
],
|
|
4181
|
+
], d = /\.0+$|(\.\d*[1-9])0+$/;
|
|
4182
4182
|
let x;
|
|
4183
|
-
for (x = o.length - 1; x > 0 && !(
|
|
4183
|
+
for (x = o.length - 1; x > 0 && !(l >= o[x].value); x--)
|
|
4184
4184
|
;
|
|
4185
|
-
return (
|
|
4185
|
+
return (l / o[x].value).toFixed(r).replace(d, "$1") + o[x].symbol;
|
|
4186
4186
|
}
|
|
4187
|
-
function qa(
|
|
4188
|
-
switch (
|
|
4187
|
+
function qa(l) {
|
|
4188
|
+
switch (l.language) {
|
|
4189
4189
|
case "ar":
|
|
4190
4190
|
return {
|
|
4191
4191
|
direction: "rtl",
|
|
@@ -4195,44 +4195,44 @@ function qa(d) {
|
|
|
4195
4195
|
return {};
|
|
4196
4196
|
}
|
|
4197
4197
|
}
|
|
4198
|
-
function ei(
|
|
4198
|
+
function ei(l) {
|
|
4199
4199
|
const r = window.BuzzCasting.getOptions().suspended ?? !1;
|
|
4200
|
-
return
|
|
4201
|
-
var
|
|
4202
|
-
if (r ? o.content = "License suspended, please contact your Sales Representative to restore service" : o.content = ((
|
|
4200
|
+
return l.forEach((o) => {
|
|
4201
|
+
var d, x, D, K, U;
|
|
4202
|
+
if (r ? o.content = "License suspended, please contact your Sales Representative to restore service" : o.content = ((d = o.content) == null ? void 0 : d.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", o.sender !== null ? ((((x = o.sender) == null ? void 0 : x.title) === "Unknown author" || ((D = o.sender) == null ? void 0 : D.title) === null) && (o.sender.title = ""), ((K = o.sender) == null ? void 0 : K.name) !== "" && o.sender.title === "" && (o.sender.title = o.sender.name), ((U = o.sender) == null ? void 0 : U.name) !== "" && o.channel === "tw" && (o.sender.name = `@${o.sender.name}`)) : o.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, o.sender.title === "" && o.link !== "") {
|
|
4203
4203
|
const M = new URL(o.link);
|
|
4204
4204
|
o.sender.title = M.hostname.replace("www.", "");
|
|
4205
4205
|
}
|
|
4206
|
-
}),
|
|
4206
|
+
}), l;
|
|
4207
4207
|
}
|
|
4208
|
-
function ti(
|
|
4209
|
-
|
|
4208
|
+
function ti(l, r, o, d) {
|
|
4209
|
+
l.stopPropagation(), r.showModal({
|
|
4210
4210
|
showComponent: "card-modal",
|
|
4211
|
-
props: { data: o, options:
|
|
4211
|
+
props: { data: o, options: d }
|
|
4212
4212
|
});
|
|
4213
4213
|
}
|
|
4214
|
-
function ni(
|
|
4215
|
-
const r = [...
|
|
4214
|
+
function ni(l) {
|
|
4215
|
+
const r = [...l];
|
|
4216
4216
|
for (let o = r.length - 1; o > 0; o--) {
|
|
4217
|
-
const
|
|
4218
|
-
[r[o], r[
|
|
4217
|
+
const d = Math.floor(Math.random() * (o + 1));
|
|
4218
|
+
[r[o], r[d]] = [r[d], r[o]];
|
|
4219
4219
|
}
|
|
4220
4220
|
return r;
|
|
4221
4221
|
}
|
|
4222
4222
|
function ri() {
|
|
4223
|
-
let
|
|
4223
|
+
let l = "";
|
|
4224
4224
|
const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
4225
|
-
for (let o = 0; o < 7; o++)
|
|
4226
|
-
return
|
|
4225
|
+
for (let o = 0; o < 7; o++) l += r.charAt(Math.floor(Math.random() * r.length));
|
|
4226
|
+
return l;
|
|
4227
4227
|
}
|
|
4228
|
-
function ai(
|
|
4229
|
-
return
|
|
4228
|
+
function ai(l) {
|
|
4229
|
+
return l[Math.floor(Math.random() * l.length)];
|
|
4230
4230
|
}
|
|
4231
|
-
const ii = (
|
|
4231
|
+
const ii = (l) => {
|
|
4232
4232
|
switch (!0) {
|
|
4233
|
-
case
|
|
4233
|
+
case l < 0:
|
|
4234
4234
|
return "text-down text-xs";
|
|
4235
|
-
case
|
|
4235
|
+
case l > 0:
|
|
4236
4236
|
return "text-up text-xs";
|
|
4237
4237
|
default:
|
|
4238
4238
|
return "text-white text-xs";
|
|
@@ -4250,10 +4250,10 @@ class si {
|
|
|
4250
4250
|
const o = await this.sm.getSubscribers();
|
|
4251
4251
|
if (o.length === 0)
|
|
4252
4252
|
return;
|
|
4253
|
-
const
|
|
4254
|
-
r ?
|
|
4255
|
-
|
|
4256
|
-
}), await Promise.allSettled(
|
|
4253
|
+
const d = [];
|
|
4254
|
+
r ? d.push(this.api.get(r)) : o == null || o.forEach((x) => {
|
|
4255
|
+
d.push(this.api.get(x));
|
|
4256
|
+
}), await Promise.allSettled(d).then(
|
|
4257
4257
|
(x) => x.forEach(async (D) => {
|
|
4258
4258
|
let K, U = 400;
|
|
4259
4259
|
if (D.status === "fulfilled") {
|
|
@@ -4453,8 +4453,8 @@ class si {
|
|
|
4453
4453
|
}
|
|
4454
4454
|
});
|
|
4455
4455
|
k(this, "cleanMessages", async () => {
|
|
4456
|
-
var
|
|
4457
|
-
if ((
|
|
4456
|
+
var d, x, D;
|
|
4457
|
+
if ((d = this.options) != null && d.suspended) {
|
|
4458
4458
|
console.info(
|
|
4459
4459
|
"%cstorage%c %cstorage",
|
|
4460
4460
|
m.STORAGE,
|
|
@@ -4476,8 +4476,8 @@ class si {
|
|
|
4476
4476
|
);
|
|
4477
4477
|
});
|
|
4478
4478
|
k(this, "hideMessage", async (r) => {
|
|
4479
|
-
var
|
|
4480
|
-
const o = await ((
|
|
4479
|
+
var d;
|
|
4480
|
+
const o = await ((d = this.sm) == null ? void 0 : d.hideMessage(r.id, 0));
|
|
4481
4481
|
return console.info(
|
|
4482
4482
|
"%cstorage%c %cstorage",
|
|
4483
4483
|
m.STORAGE,
|
|
@@ -4494,8 +4494,8 @@ class si {
|
|
|
4494
4494
|
k(this, "loadSlide", async (r) => await this.api.loadSlide(r));
|
|
4495
4495
|
k(this, "storeSlide", async (r) => {
|
|
4496
4496
|
var o;
|
|
4497
|
-
return await ((o = this.sm) == null ? void 0 : o.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((
|
|
4498
|
-
|
|
4497
|
+
return await ((o = this.sm) == null ? void 0 : o.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((d, x) => {
|
|
4498
|
+
d(201);
|
|
4499
4499
|
})));
|
|
4500
4500
|
});
|
|
4501
4501
|
console.info(
|
|
@@ -4515,8 +4515,8 @@ class si {
|
|
|
4515
4515
|
m.BROADCAST,
|
|
4516
4516
|
re.CHANNEL,
|
|
4517
4517
|
o
|
|
4518
|
-
), this.bc.onmessage = (
|
|
4519
|
-
this.actions(
|
|
4518
|
+
), this.bc.onmessage = (d) => {
|
|
4519
|
+
this.actions(d);
|
|
4520
4520
|
}, this.bc.postMessage({ event: re.STORAGE_INIT, data: {} }), this.api = new Da(r), r.storage) {
|
|
4521
4521
|
case ye.DEXIE:
|
|
4522
4522
|
this.sm = new jr(r);
|
|
@@ -4629,7 +4629,7 @@ class oi {
|
|
|
4629
4629
|
* @param callbacks functions in the widget that will receive the update
|
|
4630
4630
|
* @param selector container for the element - by default buzzcasting-slide (optional)
|
|
4631
4631
|
*/
|
|
4632
|
-
constructor(r, o,
|
|
4632
|
+
constructor(r, o, d) {
|
|
4633
4633
|
k(this, "storageReader");
|
|
4634
4634
|
k(this, "broadcastChannel");
|
|
4635
4635
|
k(this, "element");
|
|
@@ -4745,9 +4745,9 @@ class oi {
|
|
|
4745
4745
|
window.dispatchEvent(o);
|
|
4746
4746
|
});
|
|
4747
4747
|
var K;
|
|
4748
|
-
this.element = r, this.listeners = o,
|
|
4748
|
+
this.element = r, this.listeners = o, d = typeof d < "u" ? d : "buzzcasting-slide";
|
|
4749
4749
|
let x;
|
|
4750
|
-
x = { ...r.dataset }, delete x.hmr, x.slide = ((K = r.closest(
|
|
4750
|
+
x = { ...r.dataset }, delete x.hmr, x.slide = ((K = r.closest(d.toUpperCase())) == null ? void 0 : K.id) ?? `${d} not found`, x = Mr(x), this.query = x, Na(r);
|
|
4751
4751
|
const D = window.BuzzCasting.getOptions();
|
|
4752
4752
|
this.storageReader = new $a(D), this.broadcastChannel = new BroadcastChannel(x.slide), this.startListener();
|
|
4753
4753
|
}
|
|
@@ -4760,10 +4760,10 @@ class oi {
|
|
|
4760
4760
|
startListener() {
|
|
4761
4761
|
const r = this.query;
|
|
4762
4762
|
this.broadcastChannel.onmessage = async (o) => {
|
|
4763
|
-
const
|
|
4763
|
+
const d = o.data.data;
|
|
4764
4764
|
switch (o.data.event) {
|
|
4765
4765
|
case re.WIDGET_UPDATE:
|
|
4766
|
-
|
|
4766
|
+
d.query.slide === r.slide && d.query.widget === r.widget && this.listeners.forEach((x) => {
|
|
4767
4767
|
x(o.data);
|
|
4768
4768
|
});
|
|
4769
4769
|
break;
|