buzzcasting-storage 2.16.7 → 2.16.8
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 +1 -0
- package/dist/buzzcasting-storage.esm.js +562 -575
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var xi = Object.defineProperty;
|
|
2
2
|
var ki = (f, r, c) => r in f ? xi(f, r, { enumerable: !0, configurable: !0, writable: !0, value: c }) : f[r] = c;
|
|
3
3
|
var A = (f, r, c) => ki(f, typeof r != "symbol" ? r + "" : r, c);
|
|
4
|
-
var K = /* @__PURE__ */ ((f) => (f.MESSAGES = "messages", f.CLOUD = "cloud", f.SERIES = "series", f.TOPICS = "topics", f.WIDGET = "widget", f.WIDGETS = "widgets", f.SLIDE = "slide", f))(K || {}),
|
|
5
|
-
const Ai = "2.16.
|
|
4
|
+
var K = /* @__PURE__ */ ((f) => (f.MESSAGES = "messages", f.CLOUD = "cloud", f.SERIES = "series", f.TOPICS = "topics", f.WIDGET = "widget", f.WIDGETS = "widgets", f.SLIDE = "slide", f))(K || {}), S = /* @__PURE__ */ ((f) => (f.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", f.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", f.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", f.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", f.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", f.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", f.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", f.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", f.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", f.NONE = "color:transparent;background-color:transparent;", f.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", f.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", f.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", f.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", f.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", f.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", f.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", f))(S || {}), ne = /* @__PURE__ */ ((f) => (f.ADD_SLIDE = "addSlide", f.APP_READY = "appReady", f.API_UPDATE = "apiUpdate", f.APPROVE_MESSAGE = "approveMessage", f.CHANNEL = "channel", f.CLEAN_MESSAGES = "cleanMessages", f.CLOSE_MODAL = "closeModal", f.ERROR = "error", f.HIDE_MESSAGE = "hideMessage", f.HIDE_LABELS = "hideLabels", f.PAUSE_PRESENTATION = "pausePresentation", f.PRESENTATION_READY = "presentationReady", f.PREV_SLIDE = "prevSlide", f.RELOAD_PRESENTATION = "reloadPresentation", f.SHOW_MODAL = "showModal", f.STAR_MESSAGE = "starMessage", f.GOTO_SLIDE = "gotoSlide", f.NEXT_SLIDE = "nextSlide", f.SLIDE_DID_LOAD = "slideDidLoad", f.SLIDE_GOTO = "slideGoto", f.SLIDE_READY = "slideReady", f.SLIDE_LOAD = "loadSlide", f.SLIDE_STORE = "storeSlide", f.SLIDE_TRANSITIONER = "slideTransitioner", f.START_TRANSITIONER = "startTransitioner", f.STORAGE_INIT = "storageInit", f.SUBSCRIBE = "subscribe", f.REMOVE_CLOUD = "removeCloud", f.UPDATE = "update", f.VERSION = "version", f.WIDGET_UPDATE = "widgetUpdate", f))(ne || {}), Zt = /* @__PURE__ */ ((f) => (f.APPROVED = "approved", f.BEFORE = "before", f.DELAYED = "delayed", f.NONE = "none", f.REALTIME = "realtime", f))(Zt || {}), ge = /* @__PURE__ */ ((f) => (f.KEYVAL = "keyval", f.LOCAL = "local", f.SESSION = "session", f.DEXIE = "dexie", f.WINDOW = "window", f))(ge || {});
|
|
5
|
+
const Ai = "2.16.7";
|
|
6
6
|
class Di {
|
|
7
7
|
constructor(r) {
|
|
8
8
|
A(this, "options");
|
|
@@ -37,28 +37,28 @@ class Di {
|
|
|
37
37
|
const D = Object.keys(k).length > 0 ? `?${new URLSearchParams(k).toString()}` : "";
|
|
38
38
|
return console.debug(
|
|
39
39
|
"%capi%c %cget",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
S.API,
|
|
41
|
+
S.NONE,
|
|
42
|
+
S.GET_DATA,
|
|
43
43
|
r.slide,
|
|
44
44
|
r.widget
|
|
45
45
|
), await fetch(
|
|
46
46
|
[this.url, "api", c, r.type].join("/") + D,
|
|
47
47
|
{ ...l, method: "get" }
|
|
48
|
-
).then(async (
|
|
49
|
-
if (!
|
|
50
|
-
throw new Error(`${
|
|
51
|
-
return
|
|
52
|
-
}).then((
|
|
48
|
+
).then(async (M) => {
|
|
49
|
+
if (!M.ok)
|
|
50
|
+
throw new Error(`${M.status}`);
|
|
51
|
+
return M;
|
|
52
|
+
}).then((M) => M.json()).then((M) => (M.query = r, M)).catch((M) => ({ success: !1, message: `${M}`, data: null }));
|
|
53
53
|
}
|
|
54
54
|
async hideMessage(r) {
|
|
55
55
|
const { version: c } = this.options, l = this.headers(), k = "?action=visible";
|
|
56
56
|
return console.info(
|
|
57
57
|
"%capi%c %cput",
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
S.API,
|
|
59
|
+
S.NONE,
|
|
60
|
+
S.GET_DATA,
|
|
61
|
+
ne.HIDE_MESSAGE,
|
|
62
62
|
r.widget,
|
|
63
63
|
r.id
|
|
64
64
|
), await fetch(
|
|
@@ -72,33 +72,33 @@ class Di {
|
|
|
72
72
|
}
|
|
73
73
|
async hideLabels(r) {
|
|
74
74
|
const { version: c } = this.options, l = this.formHeaders(), k = new URLSearchParams(), D = r.labels || [];
|
|
75
|
-
for (const [
|
|
76
|
-
k.append(`custom_filters[${
|
|
75
|
+
for (const [M, B] of D.entries())
|
|
76
|
+
k.append(`custom_filters[${M}]`, B);
|
|
77
77
|
return console.info(
|
|
78
78
|
"%capi%c %cput",
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
S.API,
|
|
80
|
+
S.NONE,
|
|
81
|
+
S.GET_DATA,
|
|
82
|
+
ne.HIDE_LABELS,
|
|
83
83
|
r.widget,
|
|
84
84
|
D
|
|
85
85
|
), await fetch(
|
|
86
86
|
[this.url, "api", c, r.type, r.widget].join("/"),
|
|
87
87
|
{ ...l, body: k, method: "put" }
|
|
88
|
-
).then((
|
|
89
|
-
if (!
|
|
90
|
-
throw new Error(
|
|
91
|
-
return
|
|
92
|
-
}).then((
|
|
88
|
+
).then((M) => {
|
|
89
|
+
if (!M.ok)
|
|
90
|
+
throw new Error(M.statusText);
|
|
91
|
+
return M;
|
|
92
|
+
}).then((M) => M.json()).catch((M) => ({ succes: !1, message: M, data: [] }));
|
|
93
93
|
}
|
|
94
94
|
async loadSlide(r) {
|
|
95
95
|
const { version: c } = this.options, l = this.headers(), k = Object.assign({}, r);
|
|
96
96
|
return delete k.slide, delete k.type, delete k.hash, console.debug(
|
|
97
97
|
"%capi%c %cget",
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
S.API,
|
|
99
|
+
S.NONE,
|
|
100
|
+
S.SLIDE,
|
|
101
|
+
ne.SLIDE_LOAD,
|
|
102
102
|
r.slide
|
|
103
103
|
), await fetch(
|
|
104
104
|
[this.url, "api", c, "slides", r.id].join("/"),
|
|
@@ -122,10 +122,10 @@ class Di {
|
|
|
122
122
|
const k = JSON.stringify(r);
|
|
123
123
|
return console.info(
|
|
124
124
|
"%capi%c %cput",
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
S.API,
|
|
126
|
+
S.NONE,
|
|
127
|
+
S.SLIDE,
|
|
128
|
+
ne.SLIDE_STORE,
|
|
129
129
|
r.id
|
|
130
130
|
), await fetch(
|
|
131
131
|
[this.url, "api", c, "slides", r.id].join("/"),
|
|
@@ -162,25 +162,25 @@ var jr = { exports: {} };
|
|
|
162
162
|
for (var i, a = 0, o = t.length; a < o; a++) !i && a in t || ((i = i || Array.prototype.slice.call(t, 0, a))[a] = t[a]);
|
|
163
163
|
return e.concat(i || Array.prototype.slice.call(t));
|
|
164
164
|
}
|
|
165
|
-
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Rr,
|
|
165
|
+
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Rr, M = Object.keys, B = Array.isArray;
|
|
166
166
|
function J(e, t) {
|
|
167
|
-
return typeof t != "object" ||
|
|
167
|
+
return typeof t != "object" || M(t).forEach(function(n) {
|
|
168
168
|
e[n] = t[n];
|
|
169
169
|
}), e;
|
|
170
170
|
}
|
|
171
171
|
typeof Promise > "u" || D.Promise || (D.Promise = Promise);
|
|
172
|
-
var
|
|
173
|
-
function
|
|
174
|
-
return
|
|
172
|
+
var q = Object.getPrototypeOf, le = {}.hasOwnProperty;
|
|
173
|
+
function ae(e, t) {
|
|
174
|
+
return le.call(e, t);
|
|
175
175
|
}
|
|
176
176
|
function xe(e, t) {
|
|
177
|
-
typeof t == "function" && (t = t(
|
|
177
|
+
typeof t == "function" && (t = t(q(e))), (typeof Reflect > "u" ? M : Reflect.ownKeys)(t).forEach(function(n) {
|
|
178
178
|
ke(e, n, t[n]);
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
var zn = Object.defineProperty;
|
|
182
182
|
function ke(e, t, n, i) {
|
|
183
|
-
zn(e, t, J(n &&
|
|
183
|
+
zn(e, t, J(n && ae(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, i));
|
|
184
184
|
}
|
|
185
185
|
function ze(e) {
|
|
186
186
|
return { from: function(t) {
|
|
@@ -201,7 +201,7 @@ var jr = { exports: {} };
|
|
|
201
201
|
D.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
202
202
|
}
|
|
203
203
|
function ve(e, t) {
|
|
204
|
-
if (typeof t == "string" &&
|
|
204
|
+
if (typeof t == "string" && ae(e, t)) return e[t];
|
|
205
205
|
if (!t) return e;
|
|
206
206
|
if (typeof t != "string") {
|
|
207
207
|
for (var n = [], i = 0, a = t.length; i < a; ++i) {
|
|
@@ -216,18 +216,18 @@ var jr = { exports: {} };
|
|
|
216
216
|
return u == null ? void 0 : ve(u, t.substr(s + 1));
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function de(e, t, n) {
|
|
220
220
|
if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof t != "string" && "length" in t) {
|
|
221
221
|
rt(typeof n != "string" && "length" in n);
|
|
222
|
-
for (var i = 0, a = t.length; i < a; ++i)
|
|
222
|
+
for (var i = 0, a = t.length; i < a; ++i) de(e, t[i], n[i]);
|
|
223
223
|
} else {
|
|
224
224
|
var o, s, u = t.indexOf(".");
|
|
225
|
-
u !== -1 ? (o = t.substr(0, u), (s = t.substr(u + 1)) === "" ? n === void 0 ? B(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n :
|
|
225
|
+
u !== -1 ? (o = t.substr(0, u), (s = t.substr(u + 1)) === "" ? n === void 0 ? B(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n : de(u = !(u = e[o]) || !ae(e, o) ? e[o] = {} : u, s, n)) : n === void 0 ? B(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
function Qn(e) {
|
|
229
229
|
var t, n = {};
|
|
230
|
-
for (t in e)
|
|
230
|
+
for (t in e) ae(e, t) && (n[t] = e[t]);
|
|
231
231
|
return n;
|
|
232
232
|
}
|
|
233
233
|
var Wr = [].concat;
|
|
@@ -253,8 +253,8 @@ var jr = { exports: {} };
|
|
|
253
253
|
for (var a = 0, o = n.length; a < o; ++a) i.push(t(n[a]));
|
|
254
254
|
} else if (Vn.has(n.constructor)) i = n;
|
|
255
255
|
else {
|
|
256
|
-
var s, u =
|
|
257
|
-
for (s in i = u === Object.prototype ? {} : Object.create(u), it.set(n, i), n)
|
|
256
|
+
var s, u = q(n);
|
|
257
|
+
for (s in i = u === Object.prototype ? {} : Object.create(u), it.set(n, i), n) ae(n, s) && (i[s] = t(n[s]));
|
|
258
258
|
}
|
|
259
259
|
return i;
|
|
260
260
|
}(e), it = null, e;
|
|
@@ -397,9 +397,9 @@ var jr = { exports: {} };
|
|
|
397
397
|
}
|
|
398
398
|
var ot = {}, er = 100, Se = typeof Promise > "u" ? [] : function() {
|
|
399
399
|
var e = Promise.resolve();
|
|
400
|
-
if (typeof crypto > "u" || !crypto.subtle) return [e,
|
|
400
|
+
if (typeof crypto > "u" || !crypto.subtle) return [e, q(e), e];
|
|
401
401
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
402
|
-
return [t,
|
|
402
|
+
return [t, q(t), e];
|
|
403
403
|
}(), st = Se[0], he = Se[1], Se = Se[2], he = he && he.then, ct = st && st.constructor, an = !!Se, ut = function(e, t) {
|
|
404
404
|
lt.push([e, t]), xt && (queueMicrotask(ti), xt = !1);
|
|
405
405
|
}, on = !0, xt = !0, Ne = [], kt = [], sn = at, Ae = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Q, pgp: !1, env: {}, finalize: Q }, L = Ae, lt = [], Be = 0, At = [];
|
|
@@ -631,7 +631,7 @@ var jr = { exports: {} };
|
|
|
631
631
|
});
|
|
632
632
|
});
|
|
633
633
|
}));
|
|
634
|
-
var
|
|
634
|
+
var re = { awaits: 0, echoes: 0, id: 0 }, ni = 0, Pt = [], It = 0, Ct = 0, ri = 0;
|
|
635
635
|
function De(e, t, n, i) {
|
|
636
636
|
var a = L, o = Object.create(a);
|
|
637
637
|
return o.parent = a, o.ref = 0, o.global = !1, o.id = ++ri, Ae.env, o.env = an ? { Promise: N, PromiseProp: { value: N, configurable: !0, writable: !0 }, all: N.all, race: N.race, allSettled: N.allSettled, any: N.any, resolve: N.resolve, reject: N.reject } : {}, t && J(o, t), ++a.ref, o.finalize = function() {
|
|
@@ -639,16 +639,16 @@ var jr = { exports: {} };
|
|
|
639
639
|
}, i = Le(o, e, n, i), o.ref === 0 && o.finalize(), i;
|
|
640
640
|
}
|
|
641
641
|
function Je() {
|
|
642
|
-
return
|
|
642
|
+
return re.id || (re.id = ++ni), ++re.awaits, re.echoes += er, re.id;
|
|
643
643
|
}
|
|
644
644
|
function Pe() {
|
|
645
|
-
return !!
|
|
645
|
+
return !!re.awaits && (--re.awaits == 0 && (re.id = 0), re.echoes = re.awaits * er, !0);
|
|
646
646
|
}
|
|
647
647
|
function Rt(e) {
|
|
648
|
-
return
|
|
648
|
+
return re.echoes && e && e.constructor === ct ? (Je(), e.then(function(t) {
|
|
649
649
|
return Pe(), t;
|
|
650
650
|
}, function(t) {
|
|
651
|
-
return Pe(),
|
|
651
|
+
return Pe(), ee(t);
|
|
652
652
|
})) : e;
|
|
653
653
|
}
|
|
654
654
|
function ii() {
|
|
@@ -657,8 +657,8 @@ var jr = { exports: {} };
|
|
|
657
657
|
}
|
|
658
658
|
function Ie(e, t) {
|
|
659
659
|
var n, i = L;
|
|
660
|
-
(t ? !
|
|
661
|
-
++Ct,
|
|
660
|
+
(t ? !re.echoes || It++ && e === L : !It || --It && e === L) || queueMicrotask(t ? (function(a) {
|
|
661
|
+
++Ct, re.echoes && --re.echoes != 0 || (re.echoes = re.awaits = re.id = 0), Pt.push(L), Ie(a, !0);
|
|
662
662
|
}).bind(null, e) : ii), e !== L && (L = e, i === Ae && (Ae.env = rr()), an && (n = Ae.env.Promise, t = e.env, (i.global || e.global) && (Object.defineProperty(D, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
663
663
|
}
|
|
664
664
|
function rr() {
|
|
@@ -685,10 +685,10 @@ var jr = { exports: {} };
|
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
687
|
function fn(e) {
|
|
688
|
-
Promise === ct &&
|
|
688
|
+
Promise === ct && re.echoes === 0 ? It === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
689
689
|
}
|
|
690
690
|
("" + he).indexOf("[native code]") === -1 && (Je = Pe = Q);
|
|
691
|
-
var
|
|
691
|
+
var ee = N.reject, Ge = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ar = "String expected.", Ze = [], Tt = "__dbnames", hn = "readonly", pn = "readwrite";
|
|
692
692
|
function $e(e, t) {
|
|
693
693
|
return e ? t ? function() {
|
|
694
694
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -757,7 +757,7 @@ var jr = { exports: {} };
|
|
|
757
757
|
} catch (w) {
|
|
758
758
|
return w.name === nn.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
759
759
|
return h(b, d, v, p);
|
|
760
|
-
})) :
|
|
760
|
+
})) : ee(w);
|
|
761
761
|
}
|
|
762
762
|
return m._promise(d, function(w, y) {
|
|
763
763
|
return De(function() {
|
|
@@ -773,9 +773,9 @@ var jr = { exports: {} };
|
|
|
773
773
|
});
|
|
774
774
|
});
|
|
775
775
|
}
|
|
776
|
-
if (b._state.openComplete) return
|
|
776
|
+
if (b._state.openComplete) return ee(new G.DatabaseClosed(b._state.dbOpenError));
|
|
777
777
|
if (!b._state.isBeingOpened) {
|
|
778
|
-
if (!b._state.autoOpen) return
|
|
778
|
+
if (!b._state.autoOpen) return ee(new G.DatabaseClosed());
|
|
779
779
|
b.open().catch(Q);
|
|
780
780
|
}
|
|
781
781
|
return b._state.dbReadyPromise.then(function() {
|
|
@@ -783,14 +783,14 @@ var jr = { exports: {} };
|
|
|
783
783
|
});
|
|
784
784
|
}(this.db, e, [this.name], s);
|
|
785
785
|
return o && (g._consoleTask = o, g = g.catch(function(h) {
|
|
786
|
-
return console.trace(h),
|
|
786
|
+
return console.trace(h), ee(h);
|
|
787
787
|
})), g;
|
|
788
788
|
} finally {
|
|
789
789
|
u && Ve();
|
|
790
790
|
}
|
|
791
791
|
}, V.prototype.get = function(e, t) {
|
|
792
792
|
var n = this;
|
|
793
|
-
return e && e.constructor === Object ? this.where(e).first(t) : e == null ?
|
|
793
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? ee(new G.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(i) {
|
|
794
794
|
return n.core.get({ trans: i, key: e }).then(function(a) {
|
|
795
795
|
return n.hook.reading.fire(a);
|
|
796
796
|
});
|
|
@@ -798,7 +798,7 @@ var jr = { exports: {} };
|
|
|
798
798
|
}, V.prototype.where = function(e) {
|
|
799
799
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
800
800
|
if (B(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
801
|
-
var t =
|
|
801
|
+
var t = M(e);
|
|
802
802
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
803
803
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(g) {
|
|
804
804
|
if (g.compound && t.every(function(b) {
|
|
@@ -867,7 +867,7 @@ var jr = { exports: {} };
|
|
|
867
867
|
}, enumerable: !1, configurable: !0 }), a.prototype.table = function() {
|
|
868
868
|
return i;
|
|
869
869
|
}, e = a);
|
|
870
|
-
for (var o = /* @__PURE__ */ new Set(), s = e.prototype; s; s =
|
|
870
|
+
for (var o = /* @__PURE__ */ new Set(), s = e.prototype; s; s = q(s)) Object.getOwnPropertyNames(s).forEach(function(g) {
|
|
871
871
|
return o.add(g);
|
|
872
872
|
});
|
|
873
873
|
function u(g) {
|
|
@@ -892,13 +892,13 @@ var jr = { exports: {} };
|
|
|
892
892
|
return u.numFailures ? N.reject(u.failures[0]) : u.lastResult;
|
|
893
893
|
}).then(function(u) {
|
|
894
894
|
if (o) try {
|
|
895
|
-
|
|
895
|
+
de(e, o, u);
|
|
896
896
|
} catch {
|
|
897
897
|
}
|
|
898
898
|
return u;
|
|
899
899
|
});
|
|
900
900
|
}, V.prototype.update = function(e, t) {
|
|
901
|
-
return typeof e != "object" || B(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ?
|
|
901
|
+
return typeof e != "object" || B(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? ee(new G.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
902
902
|
}, V.prototype.put = function(e, t) {
|
|
903
903
|
var n = this, i = this.schema.primKey, a = i.auto, o = i.keyPath, s = e;
|
|
904
904
|
return o && a && (s = jt(o)(e)), this._trans("readwrite", function(u) {
|
|
@@ -907,7 +907,7 @@ var jr = { exports: {} };
|
|
|
907
907
|
return u.numFailures ? N.reject(u.failures[0]) : u.lastResult;
|
|
908
908
|
}).then(function(u) {
|
|
909
909
|
if (o) try {
|
|
910
|
-
|
|
910
|
+
de(e, o, u);
|
|
911
911
|
} catch {
|
|
912
912
|
}
|
|
913
913
|
return u;
|
|
@@ -973,11 +973,11 @@ var jr = { exports: {} };
|
|
|
973
973
|
e.forEach(function(d, v) {
|
|
974
974
|
var p = d.key, m = d.changes, w = u[v];
|
|
975
975
|
if (w) {
|
|
976
|
-
for (var y = 0,
|
|
977
|
-
var E =
|
|
976
|
+
for (var y = 0, _ = Object.keys(m); y < _.length; y++) {
|
|
977
|
+
var E = _[y], O = m[E];
|
|
978
978
|
if (E === t.schema.primKey.keyPath) {
|
|
979
979
|
if (H(O, p) !== 0) throw new G.Constraint("Cannot update primary key in bulkUpdate()");
|
|
980
|
-
} else
|
|
980
|
+
} else de(w, E, O);
|
|
981
981
|
}
|
|
982
982
|
o.push(v), g.push(p), h.push(w);
|
|
983
983
|
}
|
|
@@ -987,8 +987,8 @@ var jr = { exports: {} };
|
|
|
987
987
|
var v = d.numFailures, p = d.failures;
|
|
988
988
|
if (v === 0) return b;
|
|
989
989
|
for (var m = 0, w = Object.keys(p); m < w.length; m++) {
|
|
990
|
-
var y,
|
|
991
|
-
E != null && (y = p[
|
|
990
|
+
var y, _ = w[m], E = o[Number(_)];
|
|
991
|
+
E != null && (y = p[_], delete p[_], p[E] = y);
|
|
992
992
|
}
|
|
993
993
|
throw new Qe("".concat(t.name, ".bulkUpdate(): ").concat(v, " of ").concat(b, " operations failed"), p);
|
|
994
994
|
});
|
|
@@ -1031,7 +1031,7 @@ var jr = { exports: {} };
|
|
|
1031
1031
|
} };
|
|
1032
1032
|
return n[s] = t[s] = b;
|
|
1033
1033
|
}
|
|
1034
|
-
|
|
1034
|
+
M(h = s).forEach(function(d) {
|
|
1035
1035
|
var v = h[d];
|
|
1036
1036
|
if (B(v)) o(d, h[d][0], h[d][1]);
|
|
1037
1037
|
else {
|
|
@@ -1082,7 +1082,7 @@ var jr = { exports: {} };
|
|
|
1082
1082
|
return g.stop(v);
|
|
1083
1083
|
}, function(v) {
|
|
1084
1084
|
return g.fail(v);
|
|
1085
|
-
}) || ((d = "" + (b = g.primaryKey)) == "[object ArrayBuffer]" && (d = "" + new Uint8Array(b)),
|
|
1085
|
+
}) || ((d = "" + (b = g.primaryKey)) == "[object ArrayBuffer]" && (d = "" + new Uint8Array(b)), ae(o, d) || (o[d] = !0, t(u, g, h)));
|
|
1086
1086
|
};
|
|
1087
1087
|
return Promise.all([e.or._iterate(s, n), fr(dr(e, i, n), e.algorithm, s, !e.keysOnly && e.valueMapper)]);
|
|
1088
1088
|
}
|
|
@@ -1141,10 +1141,10 @@ var jr = { exports: {} };
|
|
|
1141
1141
|
}
|
|
1142
1142
|
var ai = (Y.prototype._read = function(e, t) {
|
|
1143
1143
|
var n = this._ctx;
|
|
1144
|
-
return n.error ? n.table._trans(null,
|
|
1144
|
+
return n.error ? n.table._trans(null, ee.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
|
|
1145
1145
|
}, Y.prototype._write = function(e) {
|
|
1146
1146
|
var t = this._ctx;
|
|
1147
|
-
return t.error ? t.table._trans(null,
|
|
1147
|
+
return t.error ? t.table._trans(null, ee.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
|
|
1148
1148
|
}, Y.prototype._addAlgorithm = function(e) {
|
|
1149
1149
|
var t = this._ctx;
|
|
1150
1150
|
t.algorithm = $e(t.algorithm, e);
|
|
@@ -1297,55 +1297,55 @@ var jr = { exports: {} };
|
|
|
1297
1297
|
if (!e || !e.multi) return this;
|
|
1298
1298
|
var t = {};
|
|
1299
1299
|
return gn(this._ctx, function(a) {
|
|
1300
|
-
var i = a.primaryKey.toString(), a =
|
|
1300
|
+
var i = a.primaryKey.toString(), a = ae(t, i);
|
|
1301
1301
|
return t[i] = !0, !a;
|
|
1302
1302
|
}), this;
|
|
1303
1303
|
}, Y.prototype.modify = function(e) {
|
|
1304
1304
|
var t = this, n = this._ctx;
|
|
1305
1305
|
return this._write(function(i) {
|
|
1306
1306
|
var a, o, s;
|
|
1307
|
-
s = typeof e == "function" ? e : (a =
|
|
1308
|
-
for (var
|
|
1307
|
+
s = typeof e == "function" ? e : (a = M(e), o = a.length, function(y) {
|
|
1308
|
+
for (var _ = !1, E = 0; E < o; ++E) {
|
|
1309
1309
|
var O = a[E], x = e[O], I = ve(y, O);
|
|
1310
|
-
x instanceof ht ? (
|
|
1310
|
+
x instanceof ht ? (de(y, O, x.execute(I)), _ = !0) : I !== x && (de(y, O, x), _ = !0);
|
|
1311
1311
|
}
|
|
1312
|
-
return
|
|
1312
|
+
return _;
|
|
1313
1313
|
});
|
|
1314
1314
|
function u(y, O) {
|
|
1315
1315
|
var E = O.failures, O = O.numFailures;
|
|
1316
1316
|
m += y - O;
|
|
1317
|
-
for (var x = 0, I =
|
|
1318
|
-
var
|
|
1319
|
-
p.push(E[
|
|
1317
|
+
for (var x = 0, I = M(E); x < I.length; x++) {
|
|
1318
|
+
var T = I[x];
|
|
1319
|
+
p.push(E[T]);
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
1322
|
var g = n.table.core, h = g.schema.primaryKey, b = h.outbound, d = h.extractKey, v = t.db._options.modifyChunkSize || 200, p = [], m = 0, w = [];
|
|
1323
1323
|
return t.clone().primaryKeys().then(function(y) {
|
|
1324
|
-
function
|
|
1324
|
+
function _(O) {
|
|
1325
1325
|
var x = Math.min(v, y.length - O);
|
|
1326
1326
|
return g.getMany({ trans: i, keys: y.slice(O, O + x), cache: "immutable" }).then(function(I) {
|
|
1327
|
-
for (var
|
|
1327
|
+
for (var T = [], C = [], R = b ? [] : null, j = [], P = 0; P < x; ++P) {
|
|
1328
1328
|
var $ = I[P], F = { value: je($), primKey: y[O + P] };
|
|
1329
|
-
s.call(F, F.value, F) !== !1 && (F.value == null ?
|
|
1329
|
+
s.call(F, F.value, F) !== !1 && (F.value == null ? j.push(y[O + P]) : b || H(d($), d(F.value)) === 0 ? (C.push(F.value), b && R.push(y[O + P])) : (j.push(y[O + P]), T.push(F.value)));
|
|
1330
1330
|
}
|
|
1331
|
-
return Promise.resolve(0 <
|
|
1332
|
-
for (var U in z.failures)
|
|
1333
|
-
u(
|
|
1331
|
+
return Promise.resolve(0 < T.length && g.mutate({ trans: i, type: "add", values: T }).then(function(z) {
|
|
1332
|
+
for (var U in z.failures) j.splice(parseInt(U), 1);
|
|
1333
|
+
u(T.length, z);
|
|
1334
1334
|
})).then(function() {
|
|
1335
|
-
return (0 < C.length || E && typeof e == "object") && g.mutate({ trans: i, type: "put", keys:
|
|
1335
|
+
return (0 < C.length || E && typeof e == "object") && g.mutate({ trans: i, type: "put", keys: R, values: C, criteria: E, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < O }).then(function(z) {
|
|
1336
1336
|
return u(C.length, z);
|
|
1337
1337
|
});
|
|
1338
1338
|
}).then(function() {
|
|
1339
|
-
return (0 <
|
|
1340
|
-
return u(
|
|
1339
|
+
return (0 < j.length || E && e === mn) && g.mutate({ trans: i, type: "delete", keys: j, criteria: E, isAdditionalChunk: 0 < O }).then(function(z) {
|
|
1340
|
+
return u(j.length, z);
|
|
1341
1341
|
});
|
|
1342
1342
|
}).then(function() {
|
|
1343
|
-
return y.length > O + x &&
|
|
1343
|
+
return y.length > O + x && _(O + v);
|
|
1344
1344
|
});
|
|
1345
1345
|
});
|
|
1346
1346
|
}
|
|
1347
1347
|
var E = qe(n) && n.limit === 1 / 0 && (typeof e != "function" || e === mn) && { index: n.index, range: n.range };
|
|
1348
|
-
return
|
|
1348
|
+
return _(0).then(function() {
|
|
1349
1349
|
if (0 < p.length) throw new Et("Error modifying one or more objects", p, m, w);
|
|
1350
1350
|
return y.length;
|
|
1351
1351
|
});
|
|
@@ -1377,7 +1377,7 @@ var jr = { exports: {} };
|
|
|
1377
1377
|
function si(e, t) {
|
|
1378
1378
|
return t < e ? -1 : e === t ? 0 : 1;
|
|
1379
1379
|
}
|
|
1380
|
-
function
|
|
1380
|
+
function fe(e, t, n) {
|
|
1381
1381
|
return e = e instanceof gr ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(t), e;
|
|
1382
1382
|
}
|
|
1383
1383
|
function et(e) {
|
|
@@ -1389,7 +1389,7 @@ var jr = { exports: {} };
|
|
|
1389
1389
|
var a, o, s, u, g, h, b, d = n.length;
|
|
1390
1390
|
if (!n.every(function(m) {
|
|
1391
1391
|
return typeof m == "string";
|
|
1392
|
-
})) return
|
|
1392
|
+
})) return fe(e, ar);
|
|
1393
1393
|
function v(m) {
|
|
1394
1394
|
a = m === "next" ? function(y) {
|
|
1395
1395
|
return y.toUpperCase();
|
|
@@ -1402,8 +1402,8 @@ var jr = { exports: {} };
|
|
|
1402
1402
|
}, s = m === "next" ? oi : si;
|
|
1403
1403
|
var w = n.map(function(y) {
|
|
1404
1404
|
return { lower: o(y), upper: a(y) };
|
|
1405
|
-
}).sort(function(y,
|
|
1406
|
-
return s(y.lower,
|
|
1405
|
+
}).sort(function(y, _) {
|
|
1406
|
+
return s(y.lower, _.lower);
|
|
1407
1407
|
});
|
|
1408
1408
|
u = w.map(function(y) {
|
|
1409
1409
|
return y.upper;
|
|
@@ -1418,19 +1418,19 @@ var jr = { exports: {} };
|
|
|
1418
1418
|
};
|
|
1419
1419
|
var p = 0;
|
|
1420
1420
|
return e._addAlgorithm(function(m, w, y) {
|
|
1421
|
-
var
|
|
1422
|
-
if (typeof
|
|
1423
|
-
var E = o(
|
|
1421
|
+
var _ = m.key;
|
|
1422
|
+
if (typeof _ != "string") return !1;
|
|
1423
|
+
var E = o(_);
|
|
1424
1424
|
if (t(E, g, p)) return !0;
|
|
1425
1425
|
for (var O = null, x = p; x < d; ++x) {
|
|
1426
|
-
var I = function(
|
|
1427
|
-
for (var F = Math.min(
|
|
1426
|
+
var I = function(T, C, R, j, P, $) {
|
|
1427
|
+
for (var F = Math.min(T.length, j.length), z = -1, U = 0; U < F; ++U) {
|
|
1428
1428
|
var pe = C[U];
|
|
1429
|
-
if (pe !==
|
|
1430
|
-
P(
|
|
1429
|
+
if (pe !== j[U]) return P(T[U], R[U]) < 0 ? T.substr(0, U) + R[U] + R.substr(U + 1) : P(T[U], j[U]) < 0 ? T.substr(0, U) + j[U] + R.substr(U + 1) : 0 <= z ? T.substr(0, z) + C[z] + R.substr(z + 1) : null;
|
|
1430
|
+
P(T[U], pe) < 0 && (z = U);
|
|
1431
1431
|
}
|
|
1432
|
-
return F <
|
|
1433
|
-
}(
|
|
1432
|
+
return F < j.length && $ === "next" ? T + R.substr(T.length) : F < T.length && $ === "prev" ? T.substr(0, R.length) : z < 0 ? null : T.substr(0, z) + j[z] + R.substr(z + 1);
|
|
1433
|
+
}(_, E, u[x], g[x], s, h);
|
|
1434
1434
|
I === null && O === null ? p = x + 1 : (O === null || 0 < s(O, I)) && (O = I);
|
|
1435
1435
|
}
|
|
1436
1436
|
return w(O !== null ? function() {
|
|
@@ -1444,65 +1444,65 @@ var jr = { exports: {} };
|
|
|
1444
1444
|
function pr(e) {
|
|
1445
1445
|
return { type: 1, lower: e, upper: e };
|
|
1446
1446
|
}
|
|
1447
|
-
var gr = (Object.defineProperty(
|
|
1447
|
+
var gr = (Object.defineProperty(ie.prototype, "Collection", { get: function() {
|
|
1448
1448
|
return this._ctx.table.db.Collection;
|
|
1449
|
-
}, enumerable: !1, configurable: !0 }),
|
|
1449
|
+
}, enumerable: !1, configurable: !0 }), ie.prototype.between = function(e, t, n, i) {
|
|
1450
1450
|
n = n !== !1, i = i === !0;
|
|
1451
1451
|
try {
|
|
1452
1452
|
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || i) && (!n || !i) ? et(this) : new this.Collection(this, function() {
|
|
1453
1453
|
return Ce(e, t, !n, !i);
|
|
1454
1454
|
});
|
|
1455
1455
|
} catch {
|
|
1456
|
-
return
|
|
1456
|
+
return fe(this, _e);
|
|
1457
1457
|
}
|
|
1458
|
-
},
|
|
1459
|
-
return e == null ?
|
|
1458
|
+
}, ie.prototype.equals = function(e) {
|
|
1459
|
+
return e == null ? fe(this, _e) : new this.Collection(this, function() {
|
|
1460
1460
|
return pr(e);
|
|
1461
1461
|
});
|
|
1462
|
-
},
|
|
1463
|
-
return e == null ?
|
|
1462
|
+
}, ie.prototype.above = function(e) {
|
|
1463
|
+
return e == null ? fe(this, _e) : new this.Collection(this, function() {
|
|
1464
1464
|
return Ce(e, void 0, !0);
|
|
1465
1465
|
});
|
|
1466
|
-
},
|
|
1467
|
-
return e == null ?
|
|
1466
|
+
}, ie.prototype.aboveOrEqual = function(e) {
|
|
1467
|
+
return e == null ? fe(this, _e) : new this.Collection(this, function() {
|
|
1468
1468
|
return Ce(e, void 0, !1);
|
|
1469
1469
|
});
|
|
1470
|
-
},
|
|
1471
|
-
return e == null ?
|
|
1470
|
+
}, ie.prototype.below = function(e) {
|
|
1471
|
+
return e == null ? fe(this, _e) : new this.Collection(this, function() {
|
|
1472
1472
|
return Ce(void 0, e, !1, !0);
|
|
1473
1473
|
});
|
|
1474
|
-
},
|
|
1475
|
-
return e == null ?
|
|
1474
|
+
}, ie.prototype.belowOrEqual = function(e) {
|
|
1475
|
+
return e == null ? fe(this, _e) : new this.Collection(this, function() {
|
|
1476
1476
|
return Ce(void 0, e);
|
|
1477
1477
|
});
|
|
1478
|
-
},
|
|
1479
|
-
return typeof e != "string" ?
|
|
1480
|
-
},
|
|
1478
|
+
}, ie.prototype.startsWith = function(e) {
|
|
1479
|
+
return typeof e != "string" ? fe(this, ar) : this.between(e, e + Ge, !0, !0);
|
|
1480
|
+
}, ie.prototype.startsWithIgnoreCase = function(e) {
|
|
1481
1481
|
return e === "" ? this.startsWith(e) : Nt(this, function(t, n) {
|
|
1482
1482
|
return t.indexOf(n[0]) === 0;
|
|
1483
1483
|
}, [e], Ge);
|
|
1484
|
-
},
|
|
1484
|
+
}, ie.prototype.equalsIgnoreCase = function(e) {
|
|
1485
1485
|
return Nt(this, function(t, n) {
|
|
1486
1486
|
return t === n[0];
|
|
1487
1487
|
}, [e], "");
|
|
1488
|
-
},
|
|
1488
|
+
}, ie.prototype.anyOfIgnoreCase = function() {
|
|
1489
1489
|
var e = we.apply(He, arguments);
|
|
1490
1490
|
return e.length === 0 ? et(this) : Nt(this, function(t, n) {
|
|
1491
1491
|
return n.indexOf(t) !== -1;
|
|
1492
1492
|
}, e, "");
|
|
1493
|
-
},
|
|
1493
|
+
}, ie.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1494
1494
|
var e = we.apply(He, arguments);
|
|
1495
1495
|
return e.length === 0 ? et(this) : Nt(this, function(t, n) {
|
|
1496
1496
|
return n.some(function(i) {
|
|
1497
1497
|
return t.indexOf(i) === 0;
|
|
1498
1498
|
});
|
|
1499
1499
|
}, e, Ge);
|
|
1500
|
-
},
|
|
1500
|
+
}, ie.prototype.anyOf = function() {
|
|
1501
1501
|
var e = this, t = we.apply(He, arguments), n = this._cmp;
|
|
1502
1502
|
try {
|
|
1503
1503
|
t.sort(n);
|
|
1504
1504
|
} catch {
|
|
1505
|
-
return
|
|
1505
|
+
return fe(this, _e);
|
|
1506
1506
|
}
|
|
1507
1507
|
if (t.length === 0) return et(this);
|
|
1508
1508
|
var i = new this.Collection(this, function() {
|
|
@@ -1518,43 +1518,43 @@ var jr = { exports: {} };
|
|
|
1518
1518
|
o.continue(t[a]);
|
|
1519
1519
|
}), !1);
|
|
1520
1520
|
}), i;
|
|
1521
|
-
},
|
|
1521
|
+
}, ie.prototype.notEqual = function(e) {
|
|
1522
1522
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1523
|
-
},
|
|
1523
|
+
}, ie.prototype.noneOf = function() {
|
|
1524
1524
|
var e = we.apply(He, arguments);
|
|
1525
1525
|
if (e.length === 0) return new this.Collection(this);
|
|
1526
1526
|
try {
|
|
1527
1527
|
e.sort(this._ascending);
|
|
1528
1528
|
} catch {
|
|
1529
|
-
return
|
|
1529
|
+
return fe(this, _e);
|
|
1530
1530
|
}
|
|
1531
1531
|
var t = e.reduce(function(n, i) {
|
|
1532
1532
|
return n ? n.concat([[n[n.length - 1][1], i]]) : [[-1 / 0, i]];
|
|
1533
1533
|
}, null);
|
|
1534
1534
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
1535
|
-
},
|
|
1535
|
+
}, ie.prototype.inAnyRange = function(_, t) {
|
|
1536
1536
|
var n = this, i = this._cmp, a = this._ascending, o = this._descending, s = this._min, u = this._max;
|
|
1537
|
-
if (
|
|
1538
|
-
if (!
|
|
1537
|
+
if (_.length === 0) return et(this);
|
|
1538
|
+
if (!_.every(function(E) {
|
|
1539
1539
|
return E[0] !== void 0 && E[1] !== void 0 && a(E[0], E[1]) <= 0;
|
|
1540
|
-
})) return
|
|
1540
|
+
})) return fe(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", G.InvalidArgument);
|
|
1541
1541
|
var g = !t || t.includeLowers !== !1, h = t && t.includeUppers === !0, b, d = a;
|
|
1542
1542
|
function v(E, O) {
|
|
1543
1543
|
return d(E[0], O[0]);
|
|
1544
1544
|
}
|
|
1545
1545
|
try {
|
|
1546
|
-
(b =
|
|
1546
|
+
(b = _.reduce(function(E, O) {
|
|
1547
1547
|
for (var x = 0, I = E.length; x < I; ++x) {
|
|
1548
|
-
var
|
|
1549
|
-
if (i(O[0],
|
|
1550
|
-
|
|
1548
|
+
var T = E[x];
|
|
1549
|
+
if (i(O[0], T[1]) < 0 && 0 < i(O[1], T[0])) {
|
|
1550
|
+
T[0] = s(T[0], O[0]), T[1] = u(T[1], O[1]);
|
|
1551
1551
|
break;
|
|
1552
1552
|
}
|
|
1553
1553
|
}
|
|
1554
1554
|
return x === I && E.push(O), E;
|
|
1555
1555
|
}, [])).sort(v);
|
|
1556
1556
|
} catch {
|
|
1557
|
-
return
|
|
1557
|
+
return fe(this, _e);
|
|
1558
1558
|
}
|
|
1559
1559
|
var p = 0, m = h ? function(E) {
|
|
1560
1560
|
return 0 < a(E, b[p][1]);
|
|
@@ -1564,26 +1564,26 @@ var jr = { exports: {} };
|
|
|
1564
1564
|
return 0 < o(E, b[p][0]);
|
|
1565
1565
|
} : function(E) {
|
|
1566
1566
|
return 0 <= o(E, b[p][0]);
|
|
1567
|
-
}, y = m,
|
|
1567
|
+
}, y = m, _ = new this.Collection(this, function() {
|
|
1568
1568
|
return Ce(b[0][0], b[b.length - 1][1], !g, !h);
|
|
1569
1569
|
});
|
|
1570
|
-
return
|
|
1570
|
+
return _._ondirectionchange = function(E) {
|
|
1571
1571
|
d = E === "next" ? (y = m, a) : (y = w, o), b.sort(v);
|
|
1572
|
-
},
|
|
1573
|
-
for (var I,
|
|
1574
|
-
return !m(I =
|
|
1572
|
+
}, _._addAlgorithm(function(E, O, x) {
|
|
1573
|
+
for (var I, T = E.key; y(T); ) if (++p === b.length) return O(x), !1;
|
|
1574
|
+
return !m(I = T) && !w(I) || (n._cmp(T, b[p][1]) === 0 || n._cmp(T, b[p][0]) === 0 || O(function() {
|
|
1575
1575
|
d === a ? E.continue(b[p][0]) : E.continue(b[p][1]);
|
|
1576
1576
|
}), !1);
|
|
1577
|
-
}),
|
|
1578
|
-
},
|
|
1577
|
+
}), _;
|
|
1578
|
+
}, ie.prototype.startsWithAnyOf = function() {
|
|
1579
1579
|
var e = we.apply(He, arguments);
|
|
1580
1580
|
return e.every(function(t) {
|
|
1581
1581
|
return typeof t == "string";
|
|
1582
1582
|
}) ? e.length === 0 ? et(this) : this.inAnyRange(e.map(function(t) {
|
|
1583
1583
|
return [t, t + Ge];
|
|
1584
|
-
})) :
|
|
1585
|
-
},
|
|
1586
|
-
function
|
|
1584
|
+
})) : fe(this, "startsWithAnyOf() only works with strings");
|
|
1585
|
+
}, ie);
|
|
1586
|
+
function ie() {
|
|
1587
1587
|
}
|
|
1588
1588
|
function me(e) {
|
|
1589
1589
|
return Z(function(t) {
|
|
@@ -1628,8 +1628,8 @@ var jr = { exports: {} };
|
|
|
1628
1628
|
}), this;
|
|
1629
1629
|
}, be.prototype._promise = function(e, t, n) {
|
|
1630
1630
|
var i = this;
|
|
1631
|
-
if (e === "readwrite" && this.mode !== "readwrite") return
|
|
1632
|
-
if (!this.active) return
|
|
1631
|
+
if (e === "readwrite" && this.mode !== "readwrite") return ee(new G.ReadOnly("Transaction is readonly"));
|
|
1632
|
+
if (!this.active) return ee(new G.TransactionInactive());
|
|
1633
1633
|
if (this._locked()) return new N(function(o, s) {
|
|
1634
1634
|
i._blockedFuncs.push([function() {
|
|
1635
1635
|
i._promise(e, t, n).then(o, s);
|
|
@@ -1674,7 +1674,7 @@ var jr = { exports: {} };
|
|
|
1674
1674
|
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new G.Abort()));
|
|
1675
1675
|
}, be.prototype.table = function(e) {
|
|
1676
1676
|
var t = this._memoizedTables || (this._memoizedTables = {});
|
|
1677
|
-
if (
|
|
1677
|
+
if (ae(t, e)) return t[e];
|
|
1678
1678
|
var n = this.schema[e];
|
|
1679
1679
|
if (!n) throw new G.NotFound("Table " + e + " not part of transaction");
|
|
1680
1680
|
return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
|
|
@@ -1734,11 +1734,11 @@ var jr = { exports: {} };
|
|
|
1734
1734
|
function a(v) {
|
|
1735
1735
|
var p, m = v.name;
|
|
1736
1736
|
return { name: m, schema: v, mutate: function(w) {
|
|
1737
|
-
var y = w.trans,
|
|
1738
|
-
return new Promise(function(I,
|
|
1737
|
+
var y = w.trans, _ = w.type, E = w.keys, O = w.values, x = w.range;
|
|
1738
|
+
return new Promise(function(I, T) {
|
|
1739
1739
|
I = Z(I);
|
|
1740
|
-
var C = y.objectStore(m),
|
|
1741
|
-
if (!
|
|
1740
|
+
var C = y.objectStore(m), R = C.keyPath == null, j = _ === "put" || _ === "add";
|
|
1741
|
+
if (!j && _ !== "delete" && _ !== "deleteRange") throw new Error("Invalid operation type: " + _);
|
|
1742
1742
|
var P, $ = (E || O || { length: 1 }).length;
|
|
1743
1743
|
if (E && O && E.length !== O.length) throw new Error("Given keys array must have same length as given values array.");
|
|
1744
1744
|
if ($ === 0) return I({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
@@ -1746,18 +1746,18 @@ var jr = { exports: {} };
|
|
|
1746
1746
|
++pe, pt(ue);
|
|
1747
1747
|
}
|
|
1748
1748
|
var z = [], U = [], pe = 0;
|
|
1749
|
-
if (
|
|
1749
|
+
if (_ === "deleteRange") {
|
|
1750
1750
|
if (x.type === 4) return I({ numFailures: pe, failures: U, results: [], lastResult: void 0 });
|
|
1751
1751
|
x.type === 3 ? z.push(P = C.clear()) : z.push(P = C.delete(i(x)));
|
|
1752
1752
|
} else {
|
|
1753
|
-
var
|
|
1754
|
-
if (
|
|
1755
|
-
else for (se = 0; se < $; ++se) z.push(P = C[
|
|
1753
|
+
var R = j ? R ? [O, E] : [O, null] : [E, null], W = R[0], oe = R[1];
|
|
1754
|
+
if (j) for (var se = 0; se < $; ++se) z.push(P = oe && oe[se] !== void 0 ? C[_](W[se], oe[se]) : C[_](W[se])), P.onerror = F;
|
|
1755
|
+
else for (se = 0; se < $; ++se) z.push(P = C[_](W[se])), P.onerror = F;
|
|
1756
1756
|
}
|
|
1757
1757
|
function Vt(ue) {
|
|
1758
1758
|
ue = ue.target.result, z.forEach(function(We, Ln) {
|
|
1759
1759
|
return We.error != null && (U[Ln] = We.error);
|
|
1760
|
-
}), I({ numFailures: pe, failures: U, results:
|
|
1760
|
+
}), I({ numFailures: pe, failures: U, results: _ === "delete" ? E : z.map(function(We) {
|
|
1761
1761
|
return We.result;
|
|
1762
1762
|
}), lastResult: ue });
|
|
1763
1763
|
}
|
|
@@ -1766,47 +1766,47 @@ var jr = { exports: {} };
|
|
|
1766
1766
|
}, P.onsuccess = Vt;
|
|
1767
1767
|
});
|
|
1768
1768
|
}, getMany: function(w) {
|
|
1769
|
-
var y = w.trans,
|
|
1769
|
+
var y = w.trans, _ = w.keys;
|
|
1770
1770
|
return new Promise(function(E, O) {
|
|
1771
1771
|
E = Z(E);
|
|
1772
|
-
for (var x, I = y.objectStore(m),
|
|
1773
|
-
z = z.target, C[z._pos] = z.result, ++
|
|
1774
|
-
}, $ = me(O), F = 0; F <
|
|
1775
|
-
|
|
1772
|
+
for (var x, I = y.objectStore(m), T = _.length, C = new Array(T), R = 0, j = 0, P = function(z) {
|
|
1773
|
+
z = z.target, C[z._pos] = z.result, ++j === R && E(C);
|
|
1774
|
+
}, $ = me(O), F = 0; F < T; ++F) _[F] != null && ((x = I.get(_[F]))._pos = F, x.onsuccess = P, x.onerror = $, ++R);
|
|
1775
|
+
R === 0 && E(C);
|
|
1776
1776
|
});
|
|
1777
1777
|
}, get: function(w) {
|
|
1778
|
-
var y = w.trans,
|
|
1778
|
+
var y = w.trans, _ = w.key;
|
|
1779
1779
|
return new Promise(function(E, O) {
|
|
1780
1780
|
E = Z(E);
|
|
1781
|
-
var x = y.objectStore(m).get(
|
|
1781
|
+
var x = y.objectStore(m).get(_);
|
|
1782
1782
|
x.onsuccess = function(I) {
|
|
1783
1783
|
return E(I.target.result);
|
|
1784
1784
|
}, x.onerror = me(O);
|
|
1785
1785
|
});
|
|
1786
1786
|
}, query: (p = h, function(w) {
|
|
1787
|
-
return new Promise(function(y,
|
|
1787
|
+
return new Promise(function(y, _) {
|
|
1788
1788
|
y = Z(y);
|
|
1789
|
-
var E, O, x,
|
|
1790
|
-
if (
|
|
1791
|
-
p ? ((C = I ?
|
|
1789
|
+
var E, O, x, R = w.trans, I = w.values, T = w.limit, P = w.query, C = T === 1 / 0 ? void 0 : T, j = P.index, P = P.range, R = R.objectStore(m), j = j.isPrimaryKey ? R : R.index(j.name), P = i(P);
|
|
1790
|
+
if (T === 0) return y({ result: [] });
|
|
1791
|
+
p ? ((C = I ? j.getAll(P, C) : j.getAllKeys(P, C)).onsuccess = function($) {
|
|
1792
1792
|
return y({ result: $.target.result });
|
|
1793
|
-
}, C.onerror = me(
|
|
1793
|
+
}, C.onerror = me(_)) : (E = 0, O = !I && "openKeyCursor" in j ? j.openKeyCursor(P) : j.openCursor(P), x = [], O.onsuccess = function($) {
|
|
1794
1794
|
var F = O.result;
|
|
1795
|
-
return F ? (x.push(I ? F.value : F.primaryKey), ++E ===
|
|
1796
|
-
}, O.onerror = me(
|
|
1795
|
+
return F ? (x.push(I ? F.value : F.primaryKey), ++E === T ? y({ result: x }) : void F.continue()) : y({ result: x });
|
|
1796
|
+
}, O.onerror = me(_));
|
|
1797
1797
|
});
|
|
1798
1798
|
}), openCursor: function(w) {
|
|
1799
|
-
var y = w.trans,
|
|
1800
|
-
return new Promise(function(I,
|
|
1799
|
+
var y = w.trans, _ = w.values, E = w.query, O = w.reverse, x = w.unique;
|
|
1800
|
+
return new Promise(function(I, T) {
|
|
1801
1801
|
I = Z(I);
|
|
1802
|
-
var
|
|
1803
|
-
P.onerror = me(
|
|
1802
|
+
var j = E.index, C = E.range, R = y.objectStore(m), R = j.isPrimaryKey ? R : R.index(j.name), j = O ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", P = !_ && "openKeyCursor" in R ? R.openKeyCursor(i(C), j) : R.openCursor(i(C), j);
|
|
1803
|
+
P.onerror = me(T), P.onsuccess = Z(function($) {
|
|
1804
1804
|
var F, z, U, pe, W = P.result;
|
|
1805
1805
|
W ? (W.___id = ++ui, W.done = !1, F = W.continue.bind(W), z = (z = W.continuePrimaryKey) && z.bind(W), U = W.advance.bind(W), pe = function() {
|
|
1806
1806
|
throw new Error("Cursor not stopped");
|
|
1807
1807
|
}, W.trans = y, W.stop = W.continue = W.continuePrimaryKey = W.advance = function() {
|
|
1808
1808
|
throw new Error("Cursor not started");
|
|
1809
|
-
}, W.fail = Z(
|
|
1809
|
+
}, W.fail = Z(T), W.next = function() {
|
|
1810
1810
|
var oe = this, se = 1;
|
|
1811
1811
|
return this.start(function() {
|
|
1812
1812
|
return se-- ? oe.continue() : oe.stop();
|
|
@@ -1833,14 +1833,14 @@ var jr = { exports: {} };
|
|
|
1833
1833
|
P.onsuccess = se, se();
|
|
1834
1834
|
}), W.continue = F, W.continuePrimaryKey = z, W.advance = U, se(), Vt;
|
|
1835
1835
|
}, I(W)) : I(null);
|
|
1836
|
-
},
|
|
1836
|
+
}, T);
|
|
1837
1837
|
});
|
|
1838
1838
|
}, count: function(w) {
|
|
1839
|
-
var y = w.query,
|
|
1839
|
+
var y = w.query, _ = w.trans, E = y.index, O = y.range;
|
|
1840
1840
|
return new Promise(function(x, I) {
|
|
1841
|
-
var
|
|
1842
|
-
C.onsuccess = Z(function(
|
|
1843
|
-
return x(
|
|
1841
|
+
var T = _.objectStore(m), C = E.isPrimaryKey ? T : T.index(E.name), T = i(O), C = T ? C.count(T) : C.count();
|
|
1842
|
+
C.onsuccess = Z(function(R) {
|
|
1843
|
+
return x(R.target.result);
|
|
1844
1844
|
}), C.onerror = me(I);
|
|
1845
1845
|
});
|
|
1846
1846
|
} };
|
|
@@ -1848,13 +1848,13 @@ var jr = { exports: {} };
|
|
|
1848
1848
|
var o, s, u, b = (s = g, u = mr((o = e).objectStoreNames), { schema: { name: o.name, tables: u.map(function(v) {
|
|
1849
1849
|
return s.objectStore(v);
|
|
1850
1850
|
}).map(function(v) {
|
|
1851
|
-
var p = v.keyPath, y = v.autoIncrement, m = B(p), w = {}, y = { name: v.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: m, keyPath: p, autoIncrement: y, unique: !0, extractKey: _n(p) }, indexes: mr(v.indexNames).map(function(
|
|
1852
|
-
return v.index(
|
|
1851
|
+
var p = v.keyPath, y = v.autoIncrement, m = B(p), w = {}, y = { name: v.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: m, keyPath: p, autoIncrement: y, unique: !0, extractKey: _n(p) }, indexes: mr(v.indexNames).map(function(_) {
|
|
1852
|
+
return v.index(_);
|
|
1853
1853
|
}).map(function(x) {
|
|
1854
1854
|
var E = x.name, O = x.unique, I = x.multiEntry, x = x.keyPath, I = { name: E, compound: B(x), keyPath: x, unique: O, multiEntry: I, extractKey: _n(x) };
|
|
1855
1855
|
return w[mt(x)] = I;
|
|
1856
|
-
}), getIndexByKeyPath: function(
|
|
1857
|
-
return w[mt(
|
|
1856
|
+
}), getIndexByKeyPath: function(_) {
|
|
1857
|
+
return w[mt(_)];
|
|
1858
1858
|
} };
|
|
1859
1859
|
return w[":id"] = y.primaryKey, p != null && (w[mt(p)] = y.primaryKey), y;
|
|
1860
1860
|
}) }, hasGetAll: 0 < u.length && "getAll" in s.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), g = b.schema, h = b.hasGetAll, b = g.tables.map(a), d = {};
|
|
@@ -1885,7 +1885,7 @@ var jr = { exports: {} };
|
|
|
1885
1885
|
var o = i[a];
|
|
1886
1886
|
t.forEach(function(s) {
|
|
1887
1887
|
var u = function g(h, b) {
|
|
1888
|
-
return Fr(h, b) || (h =
|
|
1888
|
+
return Fr(h, b) || (h = q(h)) && g(h, b);
|
|
1889
1889
|
}(s, a);
|
|
1890
1890
|
(!u || "value" in u && u.value === void 0) && (s === e.Transaction.prototype || s instanceof e.Transaction ? ke(s, a, { get: function() {
|
|
1891
1891
|
return this.table(a);
|
|
@@ -1913,58 +1913,58 @@ var jr = { exports: {} };
|
|
|
1913
1913
|
return L.trans = o, L.transless = u, t !== 0 ? (Bt(e, n), h = t, ((g = o).storeNames.includes("$meta") ? g.table("$meta").get("version").then(function(b) {
|
|
1914
1914
|
return b ?? h;
|
|
1915
1915
|
}) : N.resolve(h)).then(function(b) {
|
|
1916
|
-
return v = b, p = o, m = n, w = [], b = (d = e)._versions, y = d._dbSchema = $t(0, d.idbdb, m), (b = b.filter(function(
|
|
1917
|
-
return
|
|
1918
|
-
})).length !== 0 ? (b.forEach(function(
|
|
1916
|
+
return v = b, p = o, m = n, w = [], b = (d = e)._versions, y = d._dbSchema = $t(0, d.idbdb, m), (b = b.filter(function(_) {
|
|
1917
|
+
return _._cfg.version >= v;
|
|
1918
|
+
})).length !== 0 ? (b.forEach(function(_) {
|
|
1919
1919
|
w.push(function() {
|
|
1920
|
-
var E = y, O =
|
|
1920
|
+
var E = y, O = _._cfg.dbschema;
|
|
1921
1921
|
Ft(d, E, m), Ft(d, O, m), y = d._dbSchema = O;
|
|
1922
1922
|
var x = En(E, O);
|
|
1923
|
-
x.add.forEach(function(
|
|
1924
|
-
On(m,
|
|
1925
|
-
}), x.change.forEach(function(
|
|
1926
|
-
if (
|
|
1927
|
-
var P = m.objectStore(
|
|
1928
|
-
|
|
1923
|
+
x.add.forEach(function(j) {
|
|
1924
|
+
On(m, j[0], j[1].primKey, j[1].indexes);
|
|
1925
|
+
}), x.change.forEach(function(j) {
|
|
1926
|
+
if (j.recreate) throw new G.Upgrade("Not yet support for changing primary key");
|
|
1927
|
+
var P = m.objectStore(j.name);
|
|
1928
|
+
j.add.forEach(function($) {
|
|
1929
1929
|
return Gt(P, $);
|
|
1930
|
-
}),
|
|
1930
|
+
}), j.change.forEach(function($) {
|
|
1931
1931
|
P.deleteIndex($.name), Gt(P, $);
|
|
1932
|
-
}),
|
|
1932
|
+
}), j.del.forEach(function($) {
|
|
1933
1933
|
return P.deleteIndex($);
|
|
1934
1934
|
});
|
|
1935
1935
|
});
|
|
1936
|
-
var I =
|
|
1937
|
-
if (I &&
|
|
1936
|
+
var I = _._cfg.contentUpgrade;
|
|
1937
|
+
if (I && _._cfg.version > v) {
|
|
1938
1938
|
Bt(d, m), p._memoizedTables = {};
|
|
1939
|
-
var
|
|
1940
|
-
x.del.forEach(function(
|
|
1941
|
-
j
|
|
1942
|
-
}), Sn(d, [d.Transaction.prototype]), Lt(d, [d.Transaction.prototype],
|
|
1943
|
-
var C,
|
|
1944
|
-
return
|
|
1945
|
-
var
|
|
1946
|
-
(C = I(p)) &&
|
|
1939
|
+
var T = Qn(O);
|
|
1940
|
+
x.del.forEach(function(j) {
|
|
1941
|
+
T[j] = E[j];
|
|
1942
|
+
}), Sn(d, [d.Transaction.prototype]), Lt(d, [d.Transaction.prototype], M(T), T), p.schema = T;
|
|
1943
|
+
var C, R = tn(I);
|
|
1944
|
+
return R && Je(), x = N.follow(function() {
|
|
1945
|
+
var j;
|
|
1946
|
+
(C = I(p)) && R && (j = Pe.bind(null, null), C.then(j, j));
|
|
1947
1947
|
}), C && typeof C.then == "function" ? N.resolve(C) : x.then(function() {
|
|
1948
1948
|
return C;
|
|
1949
1949
|
});
|
|
1950
1950
|
}
|
|
1951
1951
|
}), w.push(function(E) {
|
|
1952
|
-
var O, x, I =
|
|
1953
|
-
O = I, x = E, [].slice.call(x.db.objectStoreNames).forEach(function(
|
|
1954
|
-
return O[
|
|
1952
|
+
var O, x, I = _._cfg.dbschema;
|
|
1953
|
+
O = I, x = E, [].slice.call(x.db.objectStoreNames).forEach(function(T) {
|
|
1954
|
+
return O[T] == null && x.db.deleteObjectStore(T);
|
|
1955
1955
|
}), Sn(d, [d.Transaction.prototype]), Lt(d, [d.Transaction.prototype], d._storeNames, d._dbSchema), p.schema = d._dbSchema;
|
|
1956
1956
|
}), w.push(function(E) {
|
|
1957
|
-
d.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(d.idbdb.version / 10) ===
|
|
1957
|
+
d.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(d.idbdb.version / 10) === _._cfg.version ? (d.idbdb.deleteObjectStore("$meta"), delete d._dbSchema.$meta, d._storeNames = d._storeNames.filter(function(O) {
|
|
1958
1958
|
return O !== "$meta";
|
|
1959
|
-
})) : E.objectStore("$meta").put(
|
|
1959
|
+
})) : E.objectStore("$meta").put(_._cfg.version, "version"));
|
|
1960
1960
|
});
|
|
1961
|
-
}), function
|
|
1962
|
-
return w.length ? N.resolve(w.shift()(p.idbtrans)).then(
|
|
1961
|
+
}), function _() {
|
|
1962
|
+
return w.length ? N.resolve(w.shift()(p.idbtrans)).then(_) : N.resolve();
|
|
1963
1963
|
}().then(function() {
|
|
1964
1964
|
br(y, m);
|
|
1965
1965
|
})) : N.resolve();
|
|
1966
1966
|
var d, v, p, m, w, y;
|
|
1967
|
-
}).catch(s)) : (
|
|
1967
|
+
}).catch(s)) : (M(a).forEach(function(b) {
|
|
1968
1968
|
On(n, b, a[b].primKey, a[b].indexes);
|
|
1969
1969
|
}), Bt(e, n), void N.follow(function() {
|
|
1970
1970
|
return e.on.populate.fire(o);
|
|
@@ -2015,7 +2015,7 @@ var jr = { exports: {} };
|
|
|
2015
2015
|
}), a;
|
|
2016
2016
|
}
|
|
2017
2017
|
function br(e, t) {
|
|
2018
|
-
|
|
2018
|
+
M(e).forEach(function(n) {
|
|
2019
2019
|
t.db.objectStoreNames.contains(n) || (ye && console.debug("Dexie: Creating missing table", n), On(t, n, e[n].primKey, e[n].indexes));
|
|
2020
2020
|
});
|
|
2021
2021
|
}
|
|
@@ -2050,7 +2050,7 @@ var jr = { exports: {} };
|
|
|
2050
2050
|
});
|
|
2051
2051
|
}
|
|
2052
2052
|
var gi = (Ut.prototype._parseStoresSpec = function(e, t) {
|
|
2053
|
-
|
|
2053
|
+
M(e).forEach(function(n) {
|
|
2054
2054
|
if (e[n] !== null) {
|
|
2055
2055
|
var i = vr(e[n]), a = i.shift();
|
|
2056
2056
|
if (a.unique = !0, a.multi) throw new G.Schema("Primary key cannot be multi-valued");
|
|
@@ -2066,7 +2066,7 @@ var jr = { exports: {} };
|
|
|
2066
2066
|
var n = t._versions, i = {}, a = {};
|
|
2067
2067
|
return n.forEach(function(o) {
|
|
2068
2068
|
J(i, o._cfg.storesSource), a = o._cfg.dbschema = {}, o._parseStoresSpec(i, a);
|
|
2069
|
-
}), t._dbSchema = a, Sn(t, [t._allTables, t, t.Transaction.prototype]), Lt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables],
|
|
2069
|
+
}), t._dbSchema = a, Sn(t, [t._allTables, t, t.Transaction.prototype]), Lt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], M(a), a), t._storeNames = M(a), this;
|
|
2070
2070
|
}, Ut.prototype.upgrade = function(e) {
|
|
2071
2071
|
return this._cfg.contentUpgrade = rn(this._cfg.contentUpgrade || Q, e), this;
|
|
2072
2072
|
}, Ut);
|
|
@@ -2149,10 +2149,10 @@ var jr = { exports: {} };
|
|
|
2149
2149
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2150
2150
|
}
|
|
2151
2151
|
function zt(e, t) {
|
|
2152
|
-
return
|
|
2152
|
+
return M(t).forEach(function(n) {
|
|
2153
2153
|
e[n] ? vt(e[n], t[n]) : e[n] = function i(a) {
|
|
2154
2154
|
var o, s, u = {};
|
|
2155
|
-
for (o in a)
|
|
2155
|
+
for (o in a) ae(a, o) && (s = a[o], u[o] = !s || typeof s != "object" || Vn.has(s.constructor) ? s : i(s));
|
|
2156
2156
|
return u;
|
|
2157
2157
|
}(t[n]);
|
|
2158
2158
|
}), e;
|
|
@@ -2213,7 +2213,7 @@ var jr = { exports: {} };
|
|
|
2213
2213
|
function yi(e) {
|
|
2214
2214
|
var t = e._state, n = e._deps.indexedDB;
|
|
2215
2215
|
if (t.isBeingOpened || e.idbdb) return t.dbReadyPromise.then(function() {
|
|
2216
|
-
return t.dbOpenError ?
|
|
2216
|
+
return t.dbOpenError ? ee(t.dbOpenError) : e;
|
|
2217
2217
|
});
|
|
2218
2218
|
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
2219
2219
|
var i = t.openCanceller, a = Math.round(10 * e.verno), o = !1;
|
|
@@ -2226,26 +2226,26 @@ var jr = { exports: {} };
|
|
|
2226
2226
|
var m = e.name, w = t.autoSchema || !a ? n.open(m) : n.open(m, a);
|
|
2227
2227
|
if (!w) throw new G.MissingAPI();
|
|
2228
2228
|
w.onerror = me(p), w.onblocked = Z(e._fireOnBlocked), w.onupgradeneeded = Z(function(y) {
|
|
2229
|
-
var
|
|
2230
|
-
b = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = pt, b.abort(), w.result.close(), (
|
|
2229
|
+
var _;
|
|
2230
|
+
b = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = pt, b.abort(), w.result.close(), (_ = n.deleteDatabase(m)).onsuccess = _.onerror = Z(function() {
|
|
2231
2231
|
p(new G.NoSuchDatabase("Database ".concat(m, " doesnt exist")));
|
|
2232
2232
|
})) : (b.onerror = me(p), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, d = y < 1, e.idbdb = w.result, o && pi(e, b), hi(e, y / 10, b, p));
|
|
2233
2233
|
}, p), w.onsuccess = Z(function() {
|
|
2234
2234
|
b = null;
|
|
2235
|
-
var y,
|
|
2236
|
-
if (0 <
|
|
2237
|
-
var C = I.transaction((O =
|
|
2238
|
-
if (t.autoSchema)
|
|
2239
|
-
else if (Ft(e, e._dbSchema, C), ((x = En($t(0, (x = e).idbdb, C), x._dbSchema)).add.length || x.change.some(function(
|
|
2240
|
-
return
|
|
2235
|
+
var y, _, E, O, x, I = e.idbdb = w.result, T = St(I.objectStoreNames);
|
|
2236
|
+
if (0 < T.length) try {
|
|
2237
|
+
var C = I.transaction((O = T).length === 1 ? O[0] : O, "readonly");
|
|
2238
|
+
if (t.autoSchema) _ = I, E = C, (y = e).verno = _.version / 10, E = y._dbSchema = $t(0, _, E), y._storeNames = St(_.objectStoreNames, 0), Lt(y, [y._allTables], M(E), E);
|
|
2239
|
+
else if (Ft(e, e._dbSchema, C), ((x = En($t(0, (x = e).idbdb, C), x._dbSchema)).add.length || x.change.some(function(R) {
|
|
2240
|
+
return R.add.length || R.change.length;
|
|
2241
2241
|
})) && !o) 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."), I.close(), a = I.version + 1, o = !0, v(u());
|
|
2242
2242
|
Bt(e, C);
|
|
2243
2243
|
} catch {
|
|
2244
2244
|
}
|
|
2245
|
-
Ze.push(e), I.onversionchange = Z(function(
|
|
2246
|
-
t.vcFired = !0, e.on("versionchange").fire(
|
|
2247
|
-
}), I.onclose = Z(function(
|
|
2248
|
-
e.on("close").fire(
|
|
2245
|
+
Ze.push(e), I.onversionchange = Z(function(R) {
|
|
2246
|
+
t.vcFired = !0, e.on("versionchange").fire(R);
|
|
2247
|
+
}), I.onclose = Z(function(R) {
|
|
2248
|
+
e.on("close").fire(R);
|
|
2249
2249
|
}), d && (x = e._deps, C = m, I = x.indexedDB, x = x.IDBKeyRange, kn(I) || C === Tt || xn(I, x).put({ name: C }).catch(Q)), v();
|
|
2250
2250
|
}, p);
|
|
2251
2251
|
}).catch(function(v) {
|
|
@@ -2286,7 +2286,7 @@ var jr = { exports: {} };
|
|
|
2286
2286
|
b && b.abort();
|
|
2287
2287
|
} catch {
|
|
2288
2288
|
}
|
|
2289
|
-
return i === t.openCanceller && e._close(),
|
|
2289
|
+
return i === t.openCanceller && e._close(), ee(v);
|
|
2290
2290
|
}).finally(function() {
|
|
2291
2291
|
t.openComplete = !0, h();
|
|
2292
2292
|
}).then(function() {
|
|
@@ -2321,10 +2321,10 @@ var jr = { exports: {} };
|
|
|
2321
2321
|
return l(l({}, e), { table: function(t) {
|
|
2322
2322
|
var n = e.table(t), i = n.schema, a = {}, o = [];
|
|
2323
2323
|
function s(d, v, p) {
|
|
2324
|
-
var m = mt(d), w = a[m] = a[m] || [], y = d == null ? 0 : typeof d == "string" ? 1 : d.length,
|
|
2325
|
-
return w.push(
|
|
2324
|
+
var m = mt(d), w = a[m] = a[m] || [], y = d == null ? 0 : typeof d == "string" ? 1 : d.length, _ = 0 < v, _ = l(l({}, p), { name: _ ? "".concat(m, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: _, keyTail: v, keyLength: y, extractKey: _n(d), unique: !_ && p.unique });
|
|
2325
|
+
return w.push(_), _.isPrimaryKey || o.push(_), 1 < y && s(y === 2 ? d[0] : d.slice(0, y - 1), v + 1, p), w.sort(function(E, O) {
|
|
2326
2326
|
return E.keyTail - O.keyTail;
|
|
2327
|
-
}),
|
|
2327
|
+
}), _;
|
|
2328
2328
|
}
|
|
2329
2329
|
t = s(i.primaryKey.keyPath, 0, i.primaryKey), a[":id"] = [t];
|
|
2330
2330
|
for (var u = 0, g = i.indexes; u < g.length; u++) {
|
|
@@ -2343,32 +2343,32 @@ var jr = { exports: {} };
|
|
|
2343
2343
|
return n.query(b(d));
|
|
2344
2344
|
}, openCursor: function(d) {
|
|
2345
2345
|
var v = d.query.index, p = v.keyTail, m = v.isVirtual, w = v.keyLength;
|
|
2346
|
-
return m ? n.openCursor(b(d)).then(function(
|
|
2347
|
-
return
|
|
2346
|
+
return m ? n.openCursor(b(d)).then(function(_) {
|
|
2347
|
+
return _ && y(_);
|
|
2348
2348
|
}) : n.openCursor(d);
|
|
2349
|
-
function y(
|
|
2350
|
-
return Object.create(
|
|
2351
|
-
E != null ?
|
|
2349
|
+
function y(_) {
|
|
2350
|
+
return Object.create(_, { continue: { value: function(E) {
|
|
2351
|
+
E != null ? _.continue(Yt(E, d.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : d.unique ? _.continue(_.key.slice(0, w).concat(d.reverse ? e.MIN_KEY : e.MAX_KEY, p)) : _.continue();
|
|
2352
2352
|
} }, continuePrimaryKey: { value: function(E, O) {
|
|
2353
|
-
|
|
2353
|
+
_.continuePrimaryKey(Yt(E, e.MAX_KEY, p), O);
|
|
2354
2354
|
} }, primaryKey: { get: function() {
|
|
2355
|
-
return
|
|
2355
|
+
return _.primaryKey;
|
|
2356
2356
|
} }, key: { get: function() {
|
|
2357
|
-
var E =
|
|
2357
|
+
var E = _.key;
|
|
2358
2358
|
return w === 1 ? E[0] : E.slice(0, w);
|
|
2359
2359
|
} }, value: { get: function() {
|
|
2360
|
-
return
|
|
2360
|
+
return _.value;
|
|
2361
2361
|
} } });
|
|
2362
2362
|
}
|
|
2363
2363
|
} });
|
|
2364
2364
|
} });
|
|
2365
2365
|
} };
|
|
2366
2366
|
function jn(e, t, n, i) {
|
|
2367
|
-
return n = n || {}, i = i || "",
|
|
2367
|
+
return n = n || {}, i = i || "", M(e).forEach(function(a) {
|
|
2368
2368
|
var o, s, u;
|
|
2369
|
-
|
|
2370
|
-
}),
|
|
2371
|
-
|
|
2369
|
+
ae(t, a) ? (o = e[a], s = t[a], typeof o == "object" && typeof s == "object" && o && s ? (u = qt(o)) !== qt(s) ? n[i + a] = t[a] : u === "Object" ? jn(o, s, n, i + a + ".") : o !== s && (n[i + a] = t[a]) : o !== s && (n[i + a] = t[a])) : n[i + a] = void 0;
|
|
2370
|
+
}), M(t).forEach(function(a) {
|
|
2371
|
+
ae(e, a) || (n[i + a] = t[a]);
|
|
2372
2372
|
}), n;
|
|
2373
2373
|
}
|
|
2374
2374
|
function Mn(e, t) {
|
|
@@ -2401,8 +2401,8 @@ var jr = { exports: {} };
|
|
|
2401
2401
|
return function d(v, p, m) {
|
|
2402
2402
|
return n.query({ trans: v, values: !1, query: { index: i, range: p }, limit: m }).then(function(w) {
|
|
2403
2403
|
var y = w.result;
|
|
2404
|
-
return b({ type: "delete", keys: y, trans: v }).then(function(
|
|
2405
|
-
return 0 <
|
|
2404
|
+
return b({ type: "delete", keys: y, trans: v }).then(function(_) {
|
|
2405
|
+
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : y.length < m ? { failures: [], numFailures: 0, lastResult: void 0 } : d(v, l(l({}, p), { lower: y[y.length - 1], lowerOpen: !0 }), m);
|
|
2406
2406
|
});
|
|
2407
2407
|
});
|
|
2408
2408
|
}(a.trans, a.range, 1e4);
|
|
@@ -2412,19 +2412,19 @@ var jr = { exports: {} };
|
|
|
2412
2412
|
function b(d) {
|
|
2413
2413
|
var v, p, m, w = L.trans, y = d.keys || Mn(i, d);
|
|
2414
2414
|
if (!y) throw new Error("Keys missing");
|
|
2415
|
-
return (d = d.type === "add" || d.type === "put" ? l(l({}, d), { keys: y }) : l({}, d)).type !== "delete" && (d.values = k([], d.values)), d.keys && (d.keys = k([], d.keys)), v = n, m = y, ((p = d).type === "add" ? Promise.resolve([]) : v.getMany({ trans: p.trans, keys: m, cache: "immutable" })).then(function(
|
|
2415
|
+
return (d = d.type === "add" || d.type === "put" ? l(l({}, d), { keys: y }) : l({}, d)).type !== "delete" && (d.values = k([], d.values)), d.keys && (d.keys = k([], d.keys)), v = n, m = y, ((p = d).type === "add" ? Promise.resolve([]) : v.getMany({ trans: p.trans, keys: m, cache: "immutable" })).then(function(_) {
|
|
2416
2416
|
var E = y.map(function(O, x) {
|
|
2417
|
-
var I,
|
|
2418
|
-
return d.type === "delete" ? u.fire.call(
|
|
2419
|
-
|
|
2420
|
-
}))),
|
|
2417
|
+
var I, T, C, R = _[x], j = { onerror: null, onsuccess: null };
|
|
2418
|
+
return d.type === "delete" ? u.fire.call(j, O, R, w) : d.type === "add" || R === void 0 ? (I = g.fire.call(j, O, d.values[x], w), O == null && I != null && (d.keys[x] = O = I, i.outbound || de(d.values[x], i.keyPath, O))) : (I = jn(R, d.values[x]), (T = h.fire.call(j, I, O, R, w)) && (C = d.values[x], Object.keys(T).forEach(function(P) {
|
|
2419
|
+
ae(C, P) ? C[P] = T[P] : de(C, P, T[P]);
|
|
2420
|
+
}))), j;
|
|
2421
2421
|
});
|
|
2422
2422
|
return n.mutate(d).then(function(O) {
|
|
2423
|
-
for (var x = O.failures, I = O.results,
|
|
2424
|
-
var
|
|
2425
|
-
|
|
2423
|
+
for (var x = O.failures, I = O.results, T = O.numFailures, O = O.lastResult, C = 0; C < y.length; ++C) {
|
|
2424
|
+
var R = (I || y)[C], j = E[C];
|
|
2425
|
+
R == null ? j.onerror && j.onerror(x[C]) : j.onsuccess && j.onsuccess(d.type === "put" && _[C] ? d.values[C] : R);
|
|
2426
2426
|
}
|
|
2427
|
-
return { failures: x, results: I, numFailures:
|
|
2427
|
+
return { failures: x, results: I, numFailures: T, lastResult: O };
|
|
2428
2428
|
}).catch(function(O) {
|
|
2429
2429
|
return E.forEach(function(x) {
|
|
2430
2430
|
return x.onerror && x.onerror(O);
|
|
@@ -2484,10 +2484,10 @@ var jr = { exports: {} };
|
|
|
2484
2484
|
function m(P) {
|
|
2485
2485
|
return P = "idb://".concat(t, "/").concat(i, "/").concat(P), O[P] || (O[P] = new ce());
|
|
2486
2486
|
}
|
|
2487
|
-
var w, y,
|
|
2487
|
+
var w, y, _, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), x = m(""), I = m(":dels"), T = p.type, j = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [Mn(s, p).filter(function(P) {
|
|
2488
2488
|
return P;
|
|
2489
|
-
}), p.values] : [], C =
|
|
2490
|
-
return B(C) ? (x.addKeys(C), (
|
|
2489
|
+
}), p.values] : [], C = j[0], R = j[1], j = p.trans._cache;
|
|
2490
|
+
return B(C) ? (x.addKeys(C), (j = T === "delete" || C.length === R.length ? Or(C, j) : null) || I.addKeys(C), (j || R) && (w = m, y = j, _ = R, o.indexes.forEach(function(P) {
|
|
2491
2491
|
var $ = w(P.name || "");
|
|
2492
2492
|
function F(U) {
|
|
2493
2493
|
return U != null ? P.extractKey(U) : null;
|
|
@@ -2497,11 +2497,11 @@ var jr = { exports: {} };
|
|
|
2497
2497
|
return $.addKey(pe);
|
|
2498
2498
|
}) : $.addKey(U);
|
|
2499
2499
|
}
|
|
2500
|
-
(y ||
|
|
2501
|
-
var W = y && F(y[oe]), oe =
|
|
2500
|
+
(y || _).forEach(function(U, oe) {
|
|
2501
|
+
var W = y && F(y[oe]), oe = _ && F(_[oe]);
|
|
2502
2502
|
H(W, oe) !== 0 && (W != null && z(W), oe != null && z(oe));
|
|
2503
2503
|
});
|
|
2504
|
-
}))) : C ? (
|
|
2504
|
+
}))) : C ? (R = { from: C.lower, to: C.upper }, I.add(R), x.add(R)) : (x.add(n), I.add(n), o.indexes.forEach(function(P) {
|
|
2505
2505
|
return m(P.name).add(n);
|
|
2506
2506
|
})), a.mutate(p).then(function(P) {
|
|
2507
2507
|
return !C || p.type !== "add" && p.type !== "put" || (x.addKeys(P.results), h && h.forEach(function($) {
|
|
@@ -2523,25 +2523,25 @@ var jr = { exports: {} };
|
|
|
2523
2523
|
}, getMany: function(p) {
|
|
2524
2524
|
return [s, new ce().addKeys(p.keys)];
|
|
2525
2525
|
}, count: d, query: d, openCursor: d };
|
|
2526
|
-
return
|
|
2526
|
+
return M(v).forEach(function(p) {
|
|
2527
2527
|
b[p] = function(m) {
|
|
2528
|
-
var w = L.subscr, y = !!w,
|
|
2528
|
+
var w = L.subscr, y = !!w, _ = xr(L, a) && kr(p, m) ? m.obsSet = {} : w;
|
|
2529
2529
|
if (y) {
|
|
2530
|
-
var E = function(
|
|
2531
|
-
return
|
|
2530
|
+
var E = function(R) {
|
|
2531
|
+
return R = "idb://".concat(t, "/").concat(i, "/").concat(R), _[R] || (_[R] = new ce());
|
|
2532
2532
|
}, O = E(""), x = E(":dels"), w = v[p](m), y = w[0], w = w[1];
|
|
2533
2533
|
if ((p === "query" && y.isPrimaryKey && !m.values ? x : E(y.name || "")).add(w), !y.isPrimaryKey) {
|
|
2534
2534
|
if (p !== "count") {
|
|
2535
2535
|
var I = p === "query" && g && m.values && a.query(l(l({}, m), { values: !1 }));
|
|
2536
|
-
return a[p].apply(this, arguments).then(function(
|
|
2536
|
+
return a[p].apply(this, arguments).then(function(R) {
|
|
2537
2537
|
if (p === "query") {
|
|
2538
2538
|
if (g && m.values) return I.then(function(F) {
|
|
2539
|
-
return F = F.result, O.addKeys(F),
|
|
2539
|
+
return F = F.result, O.addKeys(F), R;
|
|
2540
2540
|
});
|
|
2541
|
-
var
|
|
2542
|
-
(m.values ? O : x).addKeys(
|
|
2541
|
+
var j = m.values ? R.result.map(u) : R.result;
|
|
2542
|
+
(m.values ? O : x).addKeys(j);
|
|
2543
2543
|
} else if (p === "openCursor") {
|
|
2544
|
-
var P =
|
|
2544
|
+
var P = R, $ = m.values;
|
|
2545
2545
|
return P && Object.create(P, { key: { get: function() {
|
|
2546
2546
|
return x.addKey(P.primaryKey), P.key;
|
|
2547
2547
|
} }, primaryKey: { get: function() {
|
|
@@ -2551,7 +2551,7 @@ var jr = { exports: {} };
|
|
|
2551
2551
|
return $ && O.addKey(P.primaryKey), P.value;
|
|
2552
2552
|
} } });
|
|
2553
2553
|
}
|
|
2554
|
-
return
|
|
2554
|
+
return R;
|
|
2555
2555
|
});
|
|
2556
2556
|
}
|
|
2557
2557
|
x.add(n);
|
|
@@ -2580,11 +2580,11 @@ var jr = { exports: {} };
|
|
|
2580
2580
|
if (!v || v.length === 0) return e;
|
|
2581
2581
|
var s = t.query.index, u = s.multiEntry, g = t.query.range, h = i.schema.primaryKey.extractKey, b = s.extractKey, d = (s.lowLevelIndex || s).extractKey, v = v.reduce(function(p, m) {
|
|
2582
2582
|
var w = p, y = [];
|
|
2583
|
-
if (m.type === "add" || m.type === "put") for (var
|
|
2583
|
+
if (m.type === "add" || m.type === "put") for (var _ = new ce(), E = m.values.length - 1; 0 <= E; --E) {
|
|
2584
2584
|
var O, x = m.values[E], I = h(x);
|
|
2585
|
-
|
|
2586
|
-
return Kn(
|
|
2587
|
-
}) : Kn(O, g)) && (
|
|
2585
|
+
_.hasKey(I) || (O = b(x), (u && B(O) ? O.some(function(j) {
|
|
2586
|
+
return Kn(j, g);
|
|
2587
|
+
}) : Kn(O, g)) && (_.addKey(I), y.push(x)));
|
|
2588
2588
|
}
|
|
2589
2589
|
switch (m.type) {
|
|
2590
2590
|
case "add":
|
|
@@ -2593,10 +2593,10 @@ var jr = { exports: {} };
|
|
|
2593
2593
|
}));
|
|
2594
2594
|
break;
|
|
2595
2595
|
case "put":
|
|
2596
|
-
var
|
|
2596
|
+
var T = new ce().addKeys(m.values.map(function(P) {
|
|
2597
2597
|
return h(P);
|
|
2598
2598
|
})), w = p.filter(function(P) {
|
|
2599
|
-
return !
|
|
2599
|
+
return !T.hasKey(t.values ? h(P) : P);
|
|
2600
2600
|
}).concat(t.values ? y : y.map(function(P) {
|
|
2601
2601
|
return h(P);
|
|
2602
2602
|
}));
|
|
@@ -2608,9 +2608,9 @@ var jr = { exports: {} };
|
|
|
2608
2608
|
});
|
|
2609
2609
|
break;
|
|
2610
2610
|
case "deleteRange":
|
|
2611
|
-
var
|
|
2611
|
+
var R = m.range;
|
|
2612
2612
|
w = p.filter(function(P) {
|
|
2613
|
-
return !Kn(h(P),
|
|
2613
|
+
return !Kn(h(P), R);
|
|
2614
2614
|
});
|
|
2615
2615
|
}
|
|
2616
2616
|
return w;
|
|
@@ -2664,16 +2664,16 @@ var jr = { exports: {} };
|
|
|
2664
2664
|
var m = e.table(v), w = p.optimisticOps.filter(function($) {
|
|
2665
2665
|
return $.trans === u;
|
|
2666
2666
|
});
|
|
2667
|
-
if (u._explicit && g && u.mutatedParts) for (var y = 0,
|
|
2667
|
+
if (u._explicit && g && u.mutatedParts) for (var y = 0, _ = Object.values(p.queries.query); y < _.length; y++) for (var E = 0, O = (T = _[y]).slice(); E < O.length; E++) Pn((C = O[E]).obsSet, u.mutatedParts) && (Me(T, C), C.subscribers.forEach(function($) {
|
|
2668
2668
|
return h.add($);
|
|
2669
2669
|
}));
|
|
2670
2670
|
else if (0 < w.length) {
|
|
2671
2671
|
p.optimisticOps = p.optimisticOps.filter(function($) {
|
|
2672
2672
|
return $.trans !== u;
|
|
2673
2673
|
});
|
|
2674
|
-
for (var x = 0, I = Object.values(p.queries.query); x < I.length; x++) for (var
|
|
2674
|
+
for (var x = 0, I = Object.values(p.queries.query); x < I.length; x++) for (var T, C, R, j = 0, P = (T = I[x]).slice(); j < P.length; j++) (C = P[j]).res != null && u.mutatedParts && (g && !C.dirty ? (R = Object.isFrozen(C.res), R = Dr(C.res, C.req, w, m, C, R), C.dirty ? (Me(T, C), C.subscribers.forEach(function($) {
|
|
2675
2675
|
return h.add($);
|
|
2676
|
-
})) :
|
|
2676
|
+
})) : R !== C.res && (C.res = R, C.promise = N.resolve({ result: R }))) : (C.dirty && Me(T, C), C.subscribers.forEach(function($) {
|
|
2677
2677
|
return h.add($);
|
|
2678
2678
|
})));
|
|
2679
2679
|
}
|
|
@@ -2700,7 +2700,7 @@ var jr = { exports: {} };
|
|
|
2700
2700
|
})) : s.then(function(g) {
|
|
2701
2701
|
var h = Ar(0, l(l({}, o), { values: o.values.map(function(p, d) {
|
|
2702
2702
|
var v, p = (v = a.keyPath) !== null && v !== void 0 && v.includes(".") ? je(p) : l({}, p);
|
|
2703
|
-
return
|
|
2703
|
+
return de(p, a.keyPath, g.results[d]), p;
|
|
2704
2704
|
}) }), g);
|
|
2705
2705
|
u.optimisticOps.push(h), queueMicrotask(function() {
|
|
2706
2706
|
return o.mutatedParts && Ht(o.mutatedParts);
|
|
@@ -2708,30 +2708,30 @@ var jr = { exports: {} };
|
|
|
2708
2708
|
}), s) : i.mutate(o);
|
|
2709
2709
|
}, query: function(o) {
|
|
2710
2710
|
if (!xr(L, i) || !kr("query", o)) return i.query(o);
|
|
2711
|
-
var s = ((h = L.trans) === null || h === void 0 ? void 0 : h.db._options.cache) === "immutable", d = L, u = d.requery, g = d.signal, h = function(m, w, y,
|
|
2711
|
+
var s = ((h = L.trans) === null || h === void 0 ? void 0 : h.db._options.cache) === "immutable", d = L, u = d.requery, g = d.signal, h = function(m, w, y, _) {
|
|
2712
2712
|
var E = Fe["idb://".concat(m, "/").concat(w)];
|
|
2713
2713
|
if (!E) return [];
|
|
2714
2714
|
if (!(w = E.queries[y])) return [null, !1, E, null];
|
|
2715
|
-
var O = w[(
|
|
2715
|
+
var O = w[(_.query ? _.query.index.name : null) || ""];
|
|
2716
2716
|
if (!O) return [null, !1, E, null];
|
|
2717
2717
|
switch (y) {
|
|
2718
2718
|
case "query":
|
|
2719
2719
|
var x = O.find(function(I) {
|
|
2720
|
-
return I.req.limit ===
|
|
2720
|
+
return I.req.limit === _.limit && I.req.values === _.values && Pr(I.req.query.range, _.query.range);
|
|
2721
2721
|
});
|
|
2722
2722
|
return x ? [x, !0, E, O] : [O.find(function(I) {
|
|
2723
|
-
return ("limit" in I.req ? I.req.limit : 1 / 0) >=
|
|
2723
|
+
return ("limit" in I.req ? I.req.limit : 1 / 0) >= _.limit && (!_.values || I.req.values) && _i(I.req.query.range, _.query.range);
|
|
2724
2724
|
}), !1, E, O];
|
|
2725
2725
|
case "count":
|
|
2726
2726
|
return x = O.find(function(I) {
|
|
2727
|
-
return Pr(I.req.query.range,
|
|
2727
|
+
return Pr(I.req.query.range, _.query.range);
|
|
2728
2728
|
}), [x, !!x, E, O];
|
|
2729
2729
|
}
|
|
2730
2730
|
}(t, n, "query", o), b = h[0], d = h[1], v = h[2], p = h[3];
|
|
2731
2731
|
return b && d ? b.obsSet = o.obsSet : (d = i.query(o).then(function(m) {
|
|
2732
2732
|
var w = m.result;
|
|
2733
2733
|
if (b && (b.res = w), s) {
|
|
2734
|
-
for (var y = 0,
|
|
2734
|
+
for (var y = 0, _ = w.length; y < _; ++y) Object.freeze(w[y]);
|
|
2735
2735
|
Object.freeze(w);
|
|
2736
2736
|
} else m.result = je(w);
|
|
2737
2737
|
return m;
|
|
@@ -2748,7 +2748,7 @@ var jr = { exports: {} };
|
|
|
2748
2748
|
return i === "db" ? t : Reflect.get(n, i, a);
|
|
2749
2749
|
} });
|
|
2750
2750
|
}
|
|
2751
|
-
var Ee = (
|
|
2751
|
+
var Ee = (te.prototype.version = function(e) {
|
|
2752
2752
|
if (isNaN(e) || e < 0.1) throw new G.Type("Given version is not a positive number");
|
|
2753
2753
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new G.Schema("Cannot add version when database is open");
|
|
2754
2754
|
this.verno = Math.max(this.verno, e);
|
|
@@ -2756,7 +2756,7 @@ var jr = { exports: {} };
|
|
|
2756
2756
|
return i._cfg.version === e;
|
|
2757
2757
|
})[0];
|
|
2758
2758
|
return n || (n = new this.Version(e), t.push(n), t.sort(fi), n.stores({}), this._state.autoSchema = !1, n);
|
|
2759
|
-
},
|
|
2759
|
+
}, te.prototype._whenReady = function(e) {
|
|
2760
2760
|
var t = this;
|
|
2761
2761
|
return this.idbdb && (this._state.openComplete || L.letThrough || this._vip) ? e() : new N(function(n, i) {
|
|
2762
2762
|
if (t._state.openComplete) return i(new G.DatabaseClosed(t._state.dbOpenError));
|
|
@@ -2766,22 +2766,22 @@ var jr = { exports: {} };
|
|
|
2766
2766
|
}
|
|
2767
2767
|
t._state.dbReadyPromise.then(n, i);
|
|
2768
2768
|
}).then(e);
|
|
2769
|
-
},
|
|
2769
|
+
}, te.prototype.use = function(e) {
|
|
2770
2770
|
var t = e.stack, n = e.create, i = e.level, a = e.name;
|
|
2771
2771
|
return a && this.unuse({ stack: t, name: a }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: i ?? 10, name: a }), e.sort(function(o, s) {
|
|
2772
2772
|
return o.level - s.level;
|
|
2773
2773
|
}), this;
|
|
2774
|
-
},
|
|
2774
|
+
}, te.prototype.unuse = function(e) {
|
|
2775
2775
|
var t = e.stack, n = e.name, i = e.create;
|
|
2776
2776
|
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(a) {
|
|
2777
2777
|
return i ? a.create !== i : !!n && a.name !== n;
|
|
2778
2778
|
})), this;
|
|
2779
|
-
},
|
|
2779
|
+
}, te.prototype.open = function() {
|
|
2780
2780
|
var e = this;
|
|
2781
2781
|
return Le(Ae, function() {
|
|
2782
2782
|
return yi(e);
|
|
2783
2783
|
});
|
|
2784
|
-
},
|
|
2784
|
+
}, te.prototype._close = function() {
|
|
2785
2785
|
var e = this._state, t = Ze.indexOf(this);
|
|
2786
2786
|
if (0 <= t && Ze.splice(t, 1), this.idbdb) {
|
|
2787
2787
|
try {
|
|
@@ -2795,10 +2795,10 @@ var jr = { exports: {} };
|
|
|
2795
2795
|
}), e.openCanceller = new N(function(n, i) {
|
|
2796
2796
|
e.cancelOpen = i;
|
|
2797
2797
|
}));
|
|
2798
|
-
},
|
|
2798
|
+
}, te.prototype.close = function(n) {
|
|
2799
2799
|
var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
2800
2800
|
t ? (n.isBeingOpened && n.cancelOpen(new G.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new G.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
2801
|
-
},
|
|
2801
|
+
}, te.prototype.delete = function(e) {
|
|
2802
2802
|
var t = this;
|
|
2803
2803
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2804
2804
|
var n = 0 < arguments.length && typeof arguments[0] != "object", i = this._state;
|
|
@@ -2814,23 +2814,23 @@ var jr = { exports: {} };
|
|
|
2814
2814
|
if (n) throw new G.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
2815
2815
|
i.isBeingOpened ? i.dbReadyPromise.then(s) : s();
|
|
2816
2816
|
});
|
|
2817
|
-
},
|
|
2817
|
+
}, te.prototype.backendDB = function() {
|
|
2818
2818
|
return this.idbdb;
|
|
2819
|
-
},
|
|
2819
|
+
}, te.prototype.isOpen = function() {
|
|
2820
2820
|
return this.idbdb !== null;
|
|
2821
|
-
},
|
|
2821
|
+
}, te.prototype.hasBeenClosed = function() {
|
|
2822
2822
|
var e = this._state.dbOpenError;
|
|
2823
2823
|
return e && e.name === "DatabaseClosed";
|
|
2824
|
-
},
|
|
2824
|
+
}, te.prototype.hasFailed = function() {
|
|
2825
2825
|
return this._state.dbOpenError !== null;
|
|
2826
|
-
},
|
|
2826
|
+
}, te.prototype.dynamicallyOpened = function() {
|
|
2827
2827
|
return this._state.autoSchema;
|
|
2828
|
-
}, Object.defineProperty(
|
|
2828
|
+
}, Object.defineProperty(te.prototype, "tables", { get: function() {
|
|
2829
2829
|
var e = this;
|
|
2830
|
-
return
|
|
2830
|
+
return M(this._allTables).map(function(t) {
|
|
2831
2831
|
return e._allTables[t];
|
|
2832
2832
|
});
|
|
2833
|
-
}, enumerable: !1, configurable: !0 }),
|
|
2833
|
+
}, enumerable: !1, configurable: !0 }), te.prototype.transaction = function() {
|
|
2834
2834
|
var e = (function(t, n, i) {
|
|
2835
2835
|
var a = arguments.length;
|
|
2836
2836
|
if (a < 2) throw new G.InvalidArgument("Too few arguments");
|
|
@@ -2838,7 +2838,7 @@ var jr = { exports: {} };
|
|
|
2838
2838
|
return i = o.pop(), [t, Xn(o), i];
|
|
2839
2839
|
}).apply(this, arguments);
|
|
2840
2840
|
return this._transaction.apply(this, e);
|
|
2841
|
-
},
|
|
2841
|
+
}, te.prototype._transaction = function(e, t, n) {
|
|
2842
2842
|
var i = this, a = L.trans;
|
|
2843
2843
|
a && a.db === this && e.indexOf("!") === -1 || (a = null);
|
|
2844
2844
|
var o, s, u = e.indexOf("?") !== -1;
|
|
@@ -2867,7 +2867,7 @@ var jr = { exports: {} };
|
|
|
2867
2867
|
} catch (h) {
|
|
2868
2868
|
return a ? a._promise(null, function(b, d) {
|
|
2869
2869
|
d(h);
|
|
2870
|
-
}) :
|
|
2870
|
+
}) : ee(h);
|
|
2871
2871
|
}
|
|
2872
2872
|
var g = (function h(b, d, v, p, m) {
|
|
2873
2873
|
return N.resolve().then(function() {
|
|
@@ -2878,37 +2878,37 @@ var jr = { exports: {} };
|
|
|
2878
2878
|
} catch (O) {
|
|
2879
2879
|
return O.name === nn.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
2880
2880
|
return h(b, d, v, null, m);
|
|
2881
|
-
})) :
|
|
2881
|
+
})) : ee(O);
|
|
2882
2882
|
}
|
|
2883
|
-
var
|
|
2883
|
+
var _, E = tn(m);
|
|
2884
2884
|
return E && Je(), w = N.follow(function() {
|
|
2885
2885
|
var O;
|
|
2886
|
-
(
|
|
2887
|
-
}, w), (
|
|
2888
|
-
return y.active ? O :
|
|
2886
|
+
(_ = m.call(y, y)) && (E ? (O = Pe.bind(null, null), _.then(O, O)) : typeof _.next == "function" && typeof _.throw == "function" && (_ = Tn(_)));
|
|
2887
|
+
}, w), (_ && typeof _.then == "function" ? N.resolve(_).then(function(O) {
|
|
2888
|
+
return y.active ? O : ee(new G.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2889
2889
|
}) : w.then(function() {
|
|
2890
|
-
return
|
|
2890
|
+
return _;
|
|
2891
2891
|
})).then(function(O) {
|
|
2892
2892
|
return p && y._resolve(), y._completion.then(function() {
|
|
2893
2893
|
return O;
|
|
2894
2894
|
});
|
|
2895
2895
|
}).catch(function(O) {
|
|
2896
|
-
return y._reject(O),
|
|
2896
|
+
return y._reject(O), ee(O);
|
|
2897
2897
|
});
|
|
2898
2898
|
});
|
|
2899
2899
|
}).bind(null, this, o, s, a, n);
|
|
2900
2900
|
return a ? a._promise(o, g, "lock") : L.trans ? Le(L.transless, function() {
|
|
2901
2901
|
return i._whenReady(g);
|
|
2902
2902
|
}) : this._whenReady(g);
|
|
2903
|
-
},
|
|
2904
|
-
if (!
|
|
2903
|
+
}, te.prototype.table = function(e) {
|
|
2904
|
+
if (!ae(this._allTables, e)) throw new G.InvalidTable("Table ".concat(e, " does not exist"));
|
|
2905
2905
|
return this._allTables[e];
|
|
2906
|
-
},
|
|
2907
|
-
function
|
|
2906
|
+
}, te);
|
|
2907
|
+
function te(e, t) {
|
|
2908
2908
|
var n = this;
|
|
2909
2909
|
this._middlewares = {}, this.verno = 0;
|
|
2910
|
-
var i =
|
|
2911
|
-
this._options = t = l({ addons:
|
|
2910
|
+
var i = te.dependencies;
|
|
2911
|
+
this._options = t = l({ addons: te.addons, autoOpen: !0, indexedDB: i.indexedDB, IDBKeyRange: i.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, i = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2912
2912
|
var a, o, s, u, g, h = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Q, dbReadyPromise: null, cancelOpen: Q, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2913
2913
|
h.dbReadyPromise = new N(function(d) {
|
|
2914
2914
|
h.dbReadyResolve = d;
|
|
@@ -2916,14 +2916,14 @@ var jr = { exports: {} };
|
|
|
2916
2916
|
h.cancelOpen = v;
|
|
2917
2917
|
}), this._state = h, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [rn, Q] }), this.on.ready.subscribe = Hn(this.on.ready.subscribe, function(d) {
|
|
2918
2918
|
return function(v, p) {
|
|
2919
|
-
|
|
2919
|
+
te.vip(function() {
|
|
2920
2920
|
var m, w = n._state;
|
|
2921
2921
|
w.openComplete ? (w.dbOpenError || N.resolve().then(v), p && d(v)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(v), p && d(v)) : (d(v), m = n, p || d(function y() {
|
|
2922
2922
|
m.on.ready.unsubscribe(v), m.on.ready.unsubscribe(y);
|
|
2923
2923
|
}));
|
|
2924
2924
|
});
|
|
2925
2925
|
};
|
|
2926
|
-
}), this.Collection = (a = this, ft(ai.prototype, function(
|
|
2926
|
+
}), this.Collection = (a = this, ft(ai.prototype, function(_, y) {
|
|
2927
2927
|
this.db = a;
|
|
2928
2928
|
var p = or, m = null;
|
|
2929
2929
|
if (y) try {
|
|
@@ -2931,19 +2931,19 @@ var jr = { exports: {} };
|
|
|
2931
2931
|
} catch (E) {
|
|
2932
2932
|
m = E;
|
|
2933
2933
|
}
|
|
2934
|
-
var w =
|
|
2935
|
-
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: m, or: w.or, valueMapper:
|
|
2934
|
+
var w = _._ctx, y = w.table, _ = y.hook.reading.fire;
|
|
2935
|
+
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: m, or: w.or, valueMapper: _ !== at ? _ : null };
|
|
2936
2936
|
})), this.Table = (o = this, ft(lr.prototype, function(d, v, p) {
|
|
2937
2937
|
this.db = o, this._tx = p, this.name = d, this.schema = v, this.hook = o._allTables[d] ? o._allTables[d].hook : dt(null, { creating: [Vr, Q], reading: [Xr, at], updating: [Zr, Q], deleting: [Jr, Q] });
|
|
2938
2938
|
})), this.Transaction = (s = this, ft(ci.prototype, function(d, v, p, m, w) {
|
|
2939
2939
|
var y = this;
|
|
2940
|
-
this.db = s, this.mode = d, this.storeNames = v, this.schema = p, this.chromeTransactionDurability = m, 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 N(function(
|
|
2941
|
-
y._resolve =
|
|
2940
|
+
this.db = s, this.mode = d, this.storeNames = v, this.schema = p, this.chromeTransactionDurability = m, 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 N(function(_, E) {
|
|
2941
|
+
y._resolve = _, y._reject = E;
|
|
2942
2942
|
}), this._completion.then(function() {
|
|
2943
2943
|
y.active = !1, y.on.complete.fire();
|
|
2944
|
-
}, function(
|
|
2944
|
+
}, function(_) {
|
|
2945
2945
|
var E = y.active;
|
|
2946
|
-
return y.active = !1, y.on.error.fire(
|
|
2946
|
+
return y.active = !1, y.on.error.fire(_), y.parent ? y.parent._reject(_) : E && y.idbtrans && y.idbtrans.abort(), ee(_);
|
|
2947
2947
|
});
|
|
2948
2948
|
})), this.Version = (u = this, ft(gi.prototype, function(d) {
|
|
2949
2949
|
this.db = u, this._cfg = { version: d, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
@@ -3010,8 +3010,8 @@ var jr = { exports: {} };
|
|
|
3010
3010
|
}, p = function(w) {
|
|
3011
3011
|
zt(g, w), Pn(h, g) && v();
|
|
3012
3012
|
}, m = function() {
|
|
3013
|
-
var w, y,
|
|
3014
|
-
!u && Xt.indexedDB && (g = {}, w = {}, s && s.abort(), s = new AbortController(),
|
|
3013
|
+
var w, y, _;
|
|
3014
|
+
!u && Xt.indexedDB && (g = {}, w = {}, s && s.abort(), s = new AbortController(), _ = function(E) {
|
|
3015
3015
|
var O = Xe();
|
|
3016
3016
|
try {
|
|
3017
3017
|
o && Je();
|
|
@@ -3020,9 +3020,9 @@ var jr = { exports: {} };
|
|
|
3020
3020
|
} finally {
|
|
3021
3021
|
O && Ve();
|
|
3022
3022
|
}
|
|
3023
|
-
}(y = { subscr: w, signal: s.signal, requery: v, querier: e, trans: null }), Promise.resolve(
|
|
3023
|
+
}(y = { subscr: w, signal: s.signal, requery: v, querier: e, trans: null }), Promise.resolve(_).then(function(E) {
|
|
3024
3024
|
n = !0, t = E, u || y.signal.aborted || (g = {}, function(O) {
|
|
3025
|
-
for (var x in O) if (
|
|
3025
|
+
for (var x in O) if (ae(O, x)) return;
|
|
3026
3026
|
return 1;
|
|
3027
3027
|
}(h = w) || d || (Re(gt, p), d = !0), fn(function() {
|
|
3028
3028
|
return !u && a.next && a.next(E);
|
|
@@ -3068,7 +3068,7 @@ var jr = { exports: {} };
|
|
|
3068
3068
|
});
|
|
3069
3069
|
}) : xn(n, t).toCollection().primaryKeys()).then(e);
|
|
3070
3070
|
} catch {
|
|
3071
|
-
return
|
|
3071
|
+
return ee(new G.MissingAPI());
|
|
3072
3072
|
}
|
|
3073
3073
|
var t, n;
|
|
3074
3074
|
}, defineClass: function() {
|
|
@@ -3083,7 +3083,7 @@ var jr = { exports: {} };
|
|
|
3083
3083
|
var t = Tn(e.apply(this, arguments));
|
|
3084
3084
|
return t && typeof t.then == "function" ? t : N.resolve(t);
|
|
3085
3085
|
} catch (n) {
|
|
3086
|
-
return
|
|
3086
|
+
return ee(n);
|
|
3087
3087
|
}
|
|
3088
3088
|
};
|
|
3089
3089
|
}, spawn: function(e, t, n) {
|
|
@@ -3091,7 +3091,7 @@ var jr = { exports: {} };
|
|
|
3091
3091
|
var i = Tn(e.apply(n, t || []));
|
|
3092
3092
|
return i && typeof i.then == "function" ? i : N.resolve(i);
|
|
3093
3093
|
} catch (a) {
|
|
3094
|
-
return
|
|
3094
|
+
return ee(a);
|
|
3095
3095
|
}
|
|
3096
3096
|
}, currentTransaction: { get: function() {
|
|
3097
3097
|
return L.trans || null;
|
|
@@ -3101,9 +3101,9 @@ var jr = { exports: {} };
|
|
|
3101
3101
|
return ye;
|
|
3102
3102
|
}, set: function(e) {
|
|
3103
3103
|
qn(e);
|
|
3104
|
-
} }, derive: ze, extend: J, props: xe, override: Hn, Events: dt, on: Re, liveQuery: Ir, extendObservabilitySet: zt, getByKeyPath: ve, setByKeyPath:
|
|
3105
|
-
typeof t == "string" ?
|
|
3106
|
-
|
|
3104
|
+
} }, derive: ze, extend: J, props: xe, override: Hn, Events: dt, on: Re, liveQuery: Ir, extendObservabilitySet: zt, getByKeyPath: ve, setByKeyPath: de, delByKeyPath: function(e, t) {
|
|
3105
|
+
typeof t == "string" ? de(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3106
|
+
de(e, n, void 0);
|
|
3107
3107
|
});
|
|
3108
3108
|
}, shallowClone: Qn, deepClone: je, getObjectDiff: jn, cmp: H, asap: Yn, minKey: -1 / 0, addons: [], connections: Ze, errnames: nn, dependencies: Xt, cache: Fe, semVer: "4.0.8", version: "4.0.8".split(".").map(function(e) {
|
|
3109
3109
|
return parseInt(e);
|
|
@@ -3160,10 +3160,10 @@ function nt(f) {
|
|
|
3160
3160
|
}
|
|
3161
3161
|
function _t(f, r) {
|
|
3162
3162
|
var B;
|
|
3163
|
-
let c, l, k, D,
|
|
3163
|
+
let c, l, k, D, M;
|
|
3164
3164
|
switch (f.moderation) {
|
|
3165
3165
|
case Zt.BEFORE:
|
|
3166
|
-
c = /* @__PURE__ */ new Date(), l = (B = f.beforeTime) == null ? void 0 : B.split(":"), k = Number.parseInt(l ? l[0] : "00"), D = Number.parseInt(l ? l[1] : "00"),
|
|
3166
|
+
c = /* @__PURE__ */ new Date(), l = (B = f.beforeTime) == null ? void 0 : B.split(":"), k = Number.parseInt(l ? l[0] : "00"), D = Number.parseInt(l ? l[1] : "00"), M = Number.parseInt(l ? l[2] : "00"), r.before = c.setHours(k, D, M, 0) / 1e3, r.period || (r.period = c.getDay() === 1 ? 72 : 24);
|
|
3167
3167
|
break;
|
|
3168
3168
|
case Zt.DELAYED:
|
|
3169
3169
|
f.delay && f.delay > 0 && (r.delay = `${f.delay}`);
|
|
@@ -3190,9 +3190,9 @@ class Mr {
|
|
|
3190
3190
|
const c = await this.db.table(K.CLOUD).where({ id: r.widget }).last().catch(() => {
|
|
3191
3191
|
console.warn(
|
|
3192
3192
|
"%capi%C %ccloud",
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3193
|
+
S.API,
|
|
3194
|
+
S.NONE,
|
|
3195
|
+
S.CLOUD,
|
|
3196
3196
|
r.slide,
|
|
3197
3197
|
r.widget
|
|
3198
3198
|
);
|
|
@@ -3208,9 +3208,9 @@ class Mr {
|
|
|
3208
3208
|
const c = await this.db.table(K.SERIES).where({ id: r.widget }).last().catch(() => {
|
|
3209
3209
|
console.warn(
|
|
3210
3210
|
"%capi%c %cseries",
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3211
|
+
S.API,
|
|
3212
|
+
S.NONE,
|
|
3213
|
+
S.SERIES,
|
|
3214
3214
|
r.slide,
|
|
3215
3215
|
r.widget
|
|
3216
3216
|
);
|
|
@@ -3228,26 +3228,26 @@ class Mr {
|
|
|
3228
3228
|
const D = await this.db.table(K.TOPICS).orderBy("utc").reverse().filter(c).filter(l).filter(k).limit((r == null ? void 0 : r.limit) ?? 25).toArray().catch(() => {
|
|
3229
3229
|
console.warn(
|
|
3230
3230
|
"%capi%c %cmessages",
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3231
|
+
S.API,
|
|
3232
|
+
S.NONE,
|
|
3233
|
+
S.MESSAGES,
|
|
3234
3234
|
r.slide,
|
|
3235
3235
|
r.widget
|
|
3236
3236
|
);
|
|
3237
3237
|
});
|
|
3238
3238
|
if (D.length === 0)
|
|
3239
3239
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3240
|
-
const
|
|
3241
|
-
(
|
|
3242
|
-
),
|
|
3243
|
-
(
|
|
3240
|
+
const M = D[0] ? D[0].title : "No title", B = D.map(
|
|
3241
|
+
(le) => le.message_id
|
|
3242
|
+
), q = (await this.db.table(K.MESSAGES).where("id").anyOf(B).toArray().then((le) => le.sort((ae, xe) => xe.utc - ae.utc))).map(
|
|
3243
|
+
(le) => le.data
|
|
3244
3244
|
);
|
|
3245
3245
|
return {
|
|
3246
3246
|
data: {
|
|
3247
3247
|
presentation: (r == null ? void 0 : r.presentation) || "not set",
|
|
3248
3248
|
slide: (r == null ? void 0 : r.slide) || "not set",
|
|
3249
|
-
messages:
|
|
3250
|
-
title:
|
|
3249
|
+
messages: q,
|
|
3250
|
+
title: M,
|
|
3251
3251
|
topics: [r.dashboard, r.widget].join("-"),
|
|
3252
3252
|
query: r
|
|
3253
3253
|
},
|
|
@@ -3255,7 +3255,7 @@ class Mr {
|
|
|
3255
3255
|
success: !0
|
|
3256
3256
|
};
|
|
3257
3257
|
} catch (D) {
|
|
3258
|
-
return console.error("%cstorage",
|
|
3258
|
+
return console.error("%cstorage", S.STORAGE, "set", r, D), { data: null, message: "Messages Data error", success: !1 };
|
|
3259
3259
|
}
|
|
3260
3260
|
});
|
|
3261
3261
|
/**
|
|
@@ -3268,7 +3268,7 @@ class Mr {
|
|
|
3268
3268
|
id: r.widget,
|
|
3269
3269
|
dashboard_id: r.dashboard,
|
|
3270
3270
|
data: c.data
|
|
3271
|
-
}).then(() => 201).catch((l) => (console.error("%cstorage",
|
|
3271
|
+
}).then(() => 201).catch((l) => (console.error("%cstorage", S.STORAGE, "set", r, l.message), 400)) : 400);
|
|
3272
3272
|
/**
|
|
3273
3273
|
* Update Series
|
|
3274
3274
|
* @param query IQuery
|
|
@@ -3279,7 +3279,7 @@ class Mr {
|
|
|
3279
3279
|
id: r.widget,
|
|
3280
3280
|
dashboard_id: r.dashboard,
|
|
3281
3281
|
data: c.data
|
|
3282
|
-
}).then(() => 201).catch((l) => (console.error("%cstorage",
|
|
3282
|
+
}).then(() => 201).catch((l) => (console.error("%cstorage", S.STORAGE, "set", r, l.message), 400)) : 400);
|
|
3283
3283
|
/**
|
|
3284
3284
|
* Update Messages
|
|
3285
3285
|
* @param query IQuery
|
|
@@ -3289,81 +3289,68 @@ class Mr {
|
|
|
3289
3289
|
A(this, "setMessages", async (r, c) => {
|
|
3290
3290
|
if (r.type !== K.MESSAGES)
|
|
3291
3291
|
return 400;
|
|
3292
|
-
const l = c.data.title
|
|
3293
|
-
let
|
|
3294
|
-
return c.data.messages.forEach(async (
|
|
3295
|
-
var B, J,
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
"%cstorage",
|
|
3299
|
-
_.STORAGE,
|
|
3300
|
-
"set message",
|
|
3301
|
-
l,
|
|
3302
|
-
k,
|
|
3303
|
-
R,
|
|
3304
|
-
q.message
|
|
3305
|
-
);
|
|
3306
|
-
}).catch((q) => {
|
|
3307
|
-
D++, console.error(
|
|
3292
|
+
const l = c.data.title;
|
|
3293
|
+
let k = 0;
|
|
3294
|
+
return c.data.messages.forEach(async (D) => {
|
|
3295
|
+
var M, B, J, q;
|
|
3296
|
+
D != null && D.id && (await this.db.table(K.MESSAGES).put({ id: D.id, utc: D.utc, data: D, expires: D.expires }).catch((le) => {
|
|
3297
|
+
k++, console.error(
|
|
3308
3298
|
"%cstorage",
|
|
3309
|
-
|
|
3299
|
+
S.STORAGE,
|
|
3310
3300
|
"set message",
|
|
3311
3301
|
`title: ${l}`,
|
|
3312
|
-
|
|
3313
|
-
|
|
3302
|
+
D,
|
|
3303
|
+
le.message
|
|
3314
3304
|
);
|
|
3315
3305
|
}), await this.db.table(K.TOPICS).put({
|
|
3316
3306
|
widget_id: r.widget,
|
|
3317
|
-
message_id:
|
|
3307
|
+
message_id: D.id,
|
|
3318
3308
|
dashboard_id: r.dashboard,
|
|
3319
3309
|
title: l,
|
|
3320
|
-
engagement: (
|
|
3321
|
-
impressions: (
|
|
3322
|
-
reach: (
|
|
3323
|
-
sentiment: ((
|
|
3324
|
-
utc:
|
|
3325
|
-
|
|
3326
|
-
|
|
3310
|
+
engagement: (M = D.dynamics) == null ? void 0 : M.engagement,
|
|
3311
|
+
impressions: (B = D.dynamics) == null ? void 0 : B.semrush_visits,
|
|
3312
|
+
reach: (J = D.dynamics) == null ? void 0 : J.potential_reach,
|
|
3313
|
+
sentiment: ((q = D.topics[0]) == null ? void 0 : q.sentiment) || 0,
|
|
3314
|
+
utc: D.utc,
|
|
3315
|
+
expires: D.expires
|
|
3316
|
+
}).catch((le) => {
|
|
3317
|
+
k++, console.error(
|
|
3327
3318
|
"%cstorage",
|
|
3328
|
-
|
|
3319
|
+
S.STORAGE,
|
|
3329
3320
|
"set topic",
|
|
3330
3321
|
`title: ${l}`,
|
|
3331
|
-
|
|
3332
|
-
|
|
3322
|
+
D,
|
|
3323
|
+
le.message
|
|
3333
3324
|
);
|
|
3334
3325
|
}));
|
|
3335
|
-
}),
|
|
3326
|
+
}), k === 0 ? 201 : 400;
|
|
3336
3327
|
});
|
|
3337
3328
|
/**
|
|
3338
3329
|
* Wipe Message data after number of seconds
|
|
3339
3330
|
* @param retentionDuration
|
|
3340
3331
|
*/
|
|
3341
3332
|
A(this, "cleanMessages", async (r) => {
|
|
3342
|
-
const c = Date.now() / 1e3, l = (
|
|
3343
|
-
return await this.db.table(K.TOPICS).orderBy("
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
D.message
|
|
3351
|
-
), 0)), await this.db.table(K.MESSAGES).orderBy("utc").filter(k).modify((D, R) => {
|
|
3352
|
-
delete R.value;
|
|
3353
|
-
}).catch((D) => (console.error(
|
|
3333
|
+
const c = Date.now() / 1e3, l = (M) => M.expires < c, k = (M) => M.expires < c;
|
|
3334
|
+
return await this.db.table(K.TOPICS).orderBy("expires").filter(l).delete().catch((M) => (console.error(
|
|
3335
|
+
"%cstorage%c %cclean",
|
|
3336
|
+
S.STORAGE,
|
|
3337
|
+
S.NONE,
|
|
3338
|
+
S.MESSAGES,
|
|
3339
|
+
M.message
|
|
3340
|
+
), 0)), await this.db.table(K.MESSAGES).orderBy("expires").filter(k).delete().catch((M) => (console.error(
|
|
3354
3341
|
"%cstorage%c %clean",
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3342
|
+
S.STORAGE,
|
|
3343
|
+
S.NONE,
|
|
3344
|
+
S.MESSAGES,
|
|
3345
|
+
M.message
|
|
3359
3346
|
), 0));
|
|
3360
3347
|
});
|
|
3361
3348
|
A(this, "hideMessage", async (r, c) => {
|
|
3362
3349
|
await this.db.table(K.TOPICS).where("message_id").equals(r).modify({ visible: c }).catch((l) => (console.error(
|
|
3363
3350
|
"%cstorage%c %chide",
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3351
|
+
S.STORAGE,
|
|
3352
|
+
S.NONE,
|
|
3353
|
+
S.HIDE,
|
|
3367
3354
|
l.message
|
|
3368
3355
|
), 0));
|
|
3369
3356
|
});
|
|
@@ -3378,7 +3365,7 @@ class Mr {
|
|
|
3378
3365
|
type: r.type
|
|
3379
3366
|
}).then(() => 201).catch((c) => (console.error(
|
|
3380
3367
|
"%cstorage",
|
|
3381
|
-
|
|
3368
|
+
S.STORAGE,
|
|
3382
3369
|
K.WIDGET,
|
|
3383
3370
|
r,
|
|
3384
3371
|
c.message
|
|
@@ -3392,9 +3379,9 @@ class Mr {
|
|
|
3392
3379
|
(l) => l.widget === r.widget
|
|
3393
3380
|
).length > 0 || (r.type === K.MESSAGES && (r = _t(this.options, r)), console.debug(
|
|
3394
3381
|
"%cstorage%c %csubscribe",
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3382
|
+
S.STORAGE,
|
|
3383
|
+
S.NONE,
|
|
3384
|
+
S.SUBSCRIBE,
|
|
3398
3385
|
r.slide,
|
|
3399
3386
|
r.widget
|
|
3400
3387
|
), this.subscribers.push(r)), null));
|
|
@@ -3412,9 +3399,9 @@ class Mr {
|
|
|
3412
3399
|
const c = await this.db.table(K.SLIDE).where({ id: r.id }).last().catch(() => {
|
|
3413
3400
|
console.warn(
|
|
3414
3401
|
"%capi%c %cseries",
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3402
|
+
S.API,
|
|
3403
|
+
S.NONE,
|
|
3404
|
+
S.SERIES,
|
|
3418
3405
|
r.id
|
|
3419
3406
|
);
|
|
3420
3407
|
});
|
|
@@ -3433,12 +3420,12 @@ class Mr {
|
|
|
3433
3420
|
css: r.data.css || ""
|
|
3434
3421
|
}).then(() => 200).catch((c) => (console.error(
|
|
3435
3422
|
"%cstorage",
|
|
3436
|
-
|
|
3437
|
-
|
|
3423
|
+
S.STORAGE,
|
|
3424
|
+
ne.SLIDE_STORE,
|
|
3438
3425
|
r,
|
|
3439
3426
|
c.message
|
|
3440
3427
|
), 422)) : 422);
|
|
3441
|
-
this.options = r, this.db = new Un(r.app), this.db.version(
|
|
3428
|
+
this.options = r, this.db = new Un(r.app), this.db.version(4).stores({
|
|
3442
3429
|
player: "id,title,name,location",
|
|
3443
3430
|
monitor: "id,player_id,cols,rows,order,width,height,physicalwidth,physicalheight,devicePixelRatio,screenLeft,screenTop,orientation,monitor",
|
|
3444
3431
|
display: "id,monitor_id,presentation_id,colstart,colend,rowstart,rowend",
|
|
@@ -3446,9 +3433,9 @@ class Mr {
|
|
|
3446
3433
|
presentation: "id,name,data",
|
|
3447
3434
|
slide: "id,title,json,html,css",
|
|
3448
3435
|
cloud: "id,dashboard_id,data",
|
|
3449
|
-
messages: "id,utc,
|
|
3436
|
+
messages: "id,utc,expires,data",
|
|
3450
3437
|
series: "id,dashboard_id,data",
|
|
3451
|
-
topics: "[widget_id+message_id],widget_id,dashboard_id,title,engagement,impressions,reach,sentiment,visible,utc",
|
|
3438
|
+
topics: "[widget_id+message_id],widget_id,dashboard_id,title,engagement,impressions,reach,sentiment,visible,utc,expires",
|
|
3452
3439
|
widgets: "id,dashboard_id,type"
|
|
3453
3440
|
}), this.db.open();
|
|
3454
3441
|
}
|
|
@@ -3462,7 +3449,7 @@ function Ci(f, r) {
|
|
|
3462
3449
|
const c = indexedDB.open(f);
|
|
3463
3450
|
c.onupgradeneeded = () => c.result.createObjectStore(r);
|
|
3464
3451
|
const l = Wn(c);
|
|
3465
|
-
return (k, D) => l.then((
|
|
3452
|
+
return (k, D) => l.then((M) => D(M.transaction(r, k).objectStore(r)));
|
|
3466
3453
|
}
|
|
3467
3454
|
let Gn;
|
|
3468
3455
|
function Kr() {
|
|
@@ -3480,15 +3467,15 @@ class Nr {
|
|
|
3480
3467
|
A(this, "options");
|
|
3481
3468
|
A(this, "getCloud", async (r) => {
|
|
3482
3469
|
const c = X(r);
|
|
3483
|
-
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi",
|
|
3470
|
+
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API, K.CLOUD, r.slide, r.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3484
3471
|
});
|
|
3485
3472
|
A(this, "getSeries", async (r) => {
|
|
3486
3473
|
const c = X(r);
|
|
3487
|
-
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi",
|
|
3474
|
+
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API, K.SERIES, r.slide, r.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3488
3475
|
});
|
|
3489
3476
|
A(this, "getMessages", async (r) => {
|
|
3490
3477
|
const c = X(r);
|
|
3491
|
-
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi",
|
|
3478
|
+
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API, K.MESSAGES, r.slide, r.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3492
3479
|
});
|
|
3493
3480
|
/**
|
|
3494
3481
|
* Update Cloud
|
|
@@ -3500,7 +3487,7 @@ class Nr {
|
|
|
3500
3487
|
if (!c.success)
|
|
3501
3488
|
return 400;
|
|
3502
3489
|
const l = X(r);
|
|
3503
|
-
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((k) => (console.error("%cstorage",
|
|
3490
|
+
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((k) => (console.error("%cstorage", S.STORAGE, K.CLOUD, r, k.message), 400));
|
|
3504
3491
|
});
|
|
3505
3492
|
/**
|
|
3506
3493
|
* Update Series
|
|
@@ -3512,7 +3499,7 @@ class Nr {
|
|
|
3512
3499
|
if (!c.success)
|
|
3513
3500
|
return 400;
|
|
3514
3501
|
const l = X(r);
|
|
3515
|
-
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((k) => (console.error("%cstorage",
|
|
3502
|
+
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((k) => (console.error("%cstorage", S.STORAGE, K.SERIES, r, k.message), 400));
|
|
3516
3503
|
});
|
|
3517
3504
|
/**
|
|
3518
3505
|
* Update Messages
|
|
@@ -3524,7 +3511,7 @@ class Nr {
|
|
|
3524
3511
|
if (!c.success)
|
|
3525
3512
|
return 400;
|
|
3526
3513
|
const l = X(r);
|
|
3527
|
-
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((k) => (console.error("%cstorage",
|
|
3514
|
+
return delete c.success, delete c.message, await wt(l, c).then(() => 201).catch((k) => (console.error("%cstorage", S.STORAGE, K.MESSAGES, r, k.message), 400));
|
|
3528
3515
|
});
|
|
3529
3516
|
A(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c(0))));
|
|
3530
3517
|
A(this, "hideMessage", async (r, c) => {
|
|
@@ -3543,7 +3530,7 @@ class Nr {
|
|
|
3543
3530
|
dashboard_id: r.dashboard,
|
|
3544
3531
|
type: r.type
|
|
3545
3532
|
};
|
|
3546
|
-
return await wt(c, l).then(() => 201).catch((k) => (console.error("%cstorage",
|
|
3533
|
+
return await wt(c, l).then(() => 201).catch((k) => (console.error("%cstorage", S.STORAGE, K.WIDGET, r, k.message), 400));
|
|
3547
3534
|
});
|
|
3548
3535
|
/**
|
|
3549
3536
|
* Add component subscriber
|
|
@@ -3554,9 +3541,9 @@ class Nr {
|
|
|
3554
3541
|
(l) => l.widget === r.widget
|
|
3555
3542
|
).length > 0 || (console.debug(
|
|
3556
3543
|
"%cstorage%c %csubscribe",
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3544
|
+
S.STORAGE,
|
|
3545
|
+
S.NONE,
|
|
3546
|
+
S.SUBSCRIBE,
|
|
3560
3547
|
r.slide,
|
|
3561
3548
|
r.widget
|
|
3562
3549
|
), this.subscribers.push(r)), null));
|
|
@@ -3567,7 +3554,7 @@ class Nr {
|
|
|
3567
3554
|
A(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3568
3555
|
A(this, "loadSlide", async (r) => {
|
|
3569
3556
|
const c = X(r);
|
|
3570
|
-
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi",
|
|
3557
|
+
return await Jt(c).then((l) => l).catch(() => (console.warn("%capi", S.API, K.SLIDE, r.slide), { data: null, message: "Slide Load error", success: !1 }));
|
|
3571
3558
|
});
|
|
3572
3559
|
/**
|
|
3573
3560
|
* Update Slide
|
|
@@ -3582,7 +3569,7 @@ class Nr {
|
|
|
3582
3569
|
html: r.data.html || "",
|
|
3583
3570
|
css: r.data.css || ""
|
|
3584
3571
|
};
|
|
3585
|
-
return await wt(c, l).then(() => 201).catch((k) => (console.error("%cstorage",
|
|
3572
|
+
return await wt(c, l).then(() => 201).catch((k) => (console.error("%cstorage", S.STORAGE, K.SLIDE, r, k.message), 400));
|
|
3586
3573
|
});
|
|
3587
3574
|
this.options = r;
|
|
3588
3575
|
}
|
|
@@ -3596,7 +3583,7 @@ class Br {
|
|
|
3596
3583
|
try {
|
|
3597
3584
|
return localStorage.getObject(c);
|
|
3598
3585
|
} catch (l) {
|
|
3599
|
-
return console.warn("%capi",
|
|
3586
|
+
return console.warn("%capi", S.API, K.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3600
3587
|
}
|
|
3601
3588
|
});
|
|
3602
3589
|
A(this, "getSeries", async (r) => {
|
|
@@ -3604,7 +3591,7 @@ class Br {
|
|
|
3604
3591
|
try {
|
|
3605
3592
|
return localStorage.getObject(c);
|
|
3606
3593
|
} catch (l) {
|
|
3607
|
-
return console.warn("%capi",
|
|
3594
|
+
return console.warn("%capi", S.API, K.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3608
3595
|
}
|
|
3609
3596
|
});
|
|
3610
3597
|
A(this, "getMessages", async (r) => {
|
|
@@ -3612,7 +3599,7 @@ class Br {
|
|
|
3612
3599
|
try {
|
|
3613
3600
|
return localStorage.getObject(c);
|
|
3614
3601
|
} catch (l) {
|
|
3615
|
-
return console.warn("%capi",
|
|
3602
|
+
return console.warn("%capi", S.API, K.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3616
3603
|
}
|
|
3617
3604
|
});
|
|
3618
3605
|
/**
|
|
@@ -3626,7 +3613,7 @@ class Br {
|
|
|
3626
3613
|
try {
|
|
3627
3614
|
return localStorage.setObject(l, c), 201;
|
|
3628
3615
|
} catch (k) {
|
|
3629
|
-
return console.error("%cstorage",
|
|
3616
|
+
return console.error("%cstorage", S.STORAGE, K.CLOUD, r, k), 400;
|
|
3630
3617
|
}
|
|
3631
3618
|
});
|
|
3632
3619
|
/**
|
|
@@ -3640,7 +3627,7 @@ class Br {
|
|
|
3640
3627
|
try {
|
|
3641
3628
|
return localStorage.setObject(l, c), 201;
|
|
3642
3629
|
} catch (k) {
|
|
3643
|
-
return console.error("%cstorage",
|
|
3630
|
+
return console.error("%cstorage", S.STORAGE, K.SERIES, r, k), 400;
|
|
3644
3631
|
}
|
|
3645
3632
|
});
|
|
3646
3633
|
/**
|
|
@@ -3654,7 +3641,7 @@ class Br {
|
|
|
3654
3641
|
try {
|
|
3655
3642
|
return localStorage.setObject(l, c), 200;
|
|
3656
3643
|
} catch (k) {
|
|
3657
|
-
return console.error("%cstorage",
|
|
3644
|
+
return console.error("%cstorage", S.STORAGE, K.MESSAGES, r, k), 400;
|
|
3658
3645
|
}
|
|
3659
3646
|
});
|
|
3660
3647
|
A(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c(0))));
|
|
@@ -3666,7 +3653,7 @@ class Br {
|
|
|
3666
3653
|
try {
|
|
3667
3654
|
return localStorage.setObject(c, r), 201;
|
|
3668
3655
|
} catch (l) {
|
|
3669
|
-
return console.error("%cstorage",
|
|
3656
|
+
return console.error("%cstorage", S.STORAGE, K.WIDGET, r, l), 400;
|
|
3670
3657
|
}
|
|
3671
3658
|
});
|
|
3672
3659
|
/**
|
|
@@ -3678,9 +3665,9 @@ class Br {
|
|
|
3678
3665
|
(l) => l.widget === r.widget
|
|
3679
3666
|
).length || (console.debug(
|
|
3680
3667
|
"%cstorage%c %csubscribe",
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3668
|
+
S.STORAGE,
|
|
3669
|
+
S.NONE,
|
|
3670
|
+
S.SUBSCRIBE,
|
|
3684
3671
|
r.slide,
|
|
3685
3672
|
r.widget
|
|
3686
3673
|
), this.subscribers.push(r)), null));
|
|
@@ -3693,7 +3680,7 @@ class Br {
|
|
|
3693
3680
|
try {
|
|
3694
3681
|
return localStorage.getObject(`${r.type}.${r.id}`);
|
|
3695
3682
|
} catch (c) {
|
|
3696
|
-
return console.warn("%capi",
|
|
3683
|
+
return console.warn("%capi", S.API, K.SLIDE, r.id, c), { data: null, message: "Slide Load error", success: !1 };
|
|
3697
3684
|
}
|
|
3698
3685
|
});
|
|
3699
3686
|
A(this, "storeSlide", async (r) => {
|
|
@@ -3706,7 +3693,7 @@ class Br {
|
|
|
3706
3693
|
css: r.data.css || ""
|
|
3707
3694
|
}), 201;
|
|
3708
3695
|
} catch (c) {
|
|
3709
|
-
return console.error("%cstorage",
|
|
3696
|
+
return console.error("%cstorage", S.STORAGE, K.SLIDE, r, c), 400;
|
|
3710
3697
|
}
|
|
3711
3698
|
});
|
|
3712
3699
|
this.options = r, Storage.prototype.setObject = function(c, l) {
|
|
@@ -3726,7 +3713,7 @@ class Lr {
|
|
|
3726
3713
|
try {
|
|
3727
3714
|
return sessionStorage.getObject(c);
|
|
3728
3715
|
} catch (l) {
|
|
3729
|
-
return console.warn("%capi",
|
|
3716
|
+
return console.warn("%capi", S.API, K.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3730
3717
|
}
|
|
3731
3718
|
});
|
|
3732
3719
|
A(this, "getSeries", async (r) => {
|
|
@@ -3734,7 +3721,7 @@ class Lr {
|
|
|
3734
3721
|
try {
|
|
3735
3722
|
return sessionStorage.getObject(c);
|
|
3736
3723
|
} catch (l) {
|
|
3737
|
-
return console.warn("%capi",
|
|
3724
|
+
return console.warn("%capi", S.API, K.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3738
3725
|
}
|
|
3739
3726
|
});
|
|
3740
3727
|
A(this, "getMessages", async (r) => {
|
|
@@ -3742,7 +3729,7 @@ class Lr {
|
|
|
3742
3729
|
try {
|
|
3743
3730
|
return sessionStorage.getObject(c);
|
|
3744
3731
|
} catch (l) {
|
|
3745
|
-
return console.warn("%capi",
|
|
3732
|
+
return console.warn("%capi", S.API, K.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3746
3733
|
}
|
|
3747
3734
|
});
|
|
3748
3735
|
/**
|
|
@@ -3756,7 +3743,7 @@ class Lr {
|
|
|
3756
3743
|
try {
|
|
3757
3744
|
return sessionStorage.setObject(l, c), 201;
|
|
3758
3745
|
} catch (k) {
|
|
3759
|
-
return console.error("%cstorage",
|
|
3746
|
+
return console.error("%cstorage", S.STORAGE, K.CLOUD, r, k), 400;
|
|
3760
3747
|
}
|
|
3761
3748
|
});
|
|
3762
3749
|
/**
|
|
@@ -3770,7 +3757,7 @@ class Lr {
|
|
|
3770
3757
|
try {
|
|
3771
3758
|
return sessionStorage.setObject(l, c), 201;
|
|
3772
3759
|
} catch (k) {
|
|
3773
|
-
return console.error("%cstorage",
|
|
3760
|
+
return console.error("%cstorage", S.STORAGE, K.SERIES, r, k), 400;
|
|
3774
3761
|
}
|
|
3775
3762
|
});
|
|
3776
3763
|
/**
|
|
@@ -3784,7 +3771,7 @@ class Lr {
|
|
|
3784
3771
|
try {
|
|
3785
3772
|
return sessionStorage.setObject(l, c), 200;
|
|
3786
3773
|
} catch (k) {
|
|
3787
|
-
return console.error("%cstorage",
|
|
3774
|
+
return console.error("%cstorage", S.STORAGE, K.MESSAGES, r, k), 400;
|
|
3788
3775
|
}
|
|
3789
3776
|
});
|
|
3790
3777
|
A(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c(0))));
|
|
@@ -3796,7 +3783,7 @@ class Lr {
|
|
|
3796
3783
|
try {
|
|
3797
3784
|
return sessionStorage.setObject(c, r), 201;
|
|
3798
3785
|
} catch (l) {
|
|
3799
|
-
return console.error("%cstorage",
|
|
3786
|
+
return console.error("%cstorage", S.STORAGE, K.WIDGET, r, l), 400;
|
|
3800
3787
|
}
|
|
3801
3788
|
});
|
|
3802
3789
|
/**
|
|
@@ -3808,9 +3795,9 @@ class Lr {
|
|
|
3808
3795
|
(l) => l.widget === r.widget
|
|
3809
3796
|
).length || (console.debug(
|
|
3810
3797
|
"%cstorage%c %csubscribe",
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3798
|
+
S.STORAGE,
|
|
3799
|
+
S.NONE,
|
|
3800
|
+
S.SUBSCRIBE,
|
|
3814
3801
|
r.slide,
|
|
3815
3802
|
r.widget
|
|
3816
3803
|
), this.subscribers.push(r)), null));
|
|
@@ -3823,7 +3810,7 @@ class Lr {
|
|
|
3823
3810
|
try {
|
|
3824
3811
|
return sessionStorage.getObject(`${r.type}.${r.id}`);
|
|
3825
3812
|
} catch (c) {
|
|
3826
|
-
return console.warn("%capi",
|
|
3813
|
+
return console.warn("%capi", S.API, K.SLIDE, r.id, c), { data: null, message: "Store Load error", success: !1 };
|
|
3827
3814
|
}
|
|
3828
3815
|
});
|
|
3829
3816
|
/**
|
|
@@ -3841,7 +3828,7 @@ class Lr {
|
|
|
3841
3828
|
css: r.data.css || ""
|
|
3842
3829
|
}), 200;
|
|
3843
3830
|
} catch (c) {
|
|
3844
|
-
return console.error("%cstorage",
|
|
3831
|
+
return console.error("%cstorage", S.STORAGE, K.SLIDE, r, c), 400;
|
|
3845
3832
|
}
|
|
3846
3833
|
});
|
|
3847
3834
|
this.options = r, Storage.prototype.setObject = function(c, l) {
|
|
@@ -3861,7 +3848,7 @@ class Gr {
|
|
|
3861
3848
|
try {
|
|
3862
3849
|
return window.BuzzCasting.WidgetData[c];
|
|
3863
3850
|
} catch (l) {
|
|
3864
|
-
return console.warn("%capi",
|
|
3851
|
+
return console.warn("%capi", S.API, K.CLOUD, r.slide, r.widget, l), { data: null, message: "Cloud Data error", success: !1 };
|
|
3865
3852
|
}
|
|
3866
3853
|
});
|
|
3867
3854
|
A(this, "getSeries", async (r) => {
|
|
@@ -3869,7 +3856,7 @@ class Gr {
|
|
|
3869
3856
|
try {
|
|
3870
3857
|
return window.BuzzCasting.WidgetData[c];
|
|
3871
3858
|
} catch (l) {
|
|
3872
|
-
return console.warn("%capi",
|
|
3859
|
+
return console.warn("%capi", S.API, K.SERIES, r.slide, r.widget, l), { data: null, message: "Series Data error", success: !1 };
|
|
3873
3860
|
}
|
|
3874
3861
|
});
|
|
3875
3862
|
A(this, "getMessages", async (r) => {
|
|
@@ -3877,7 +3864,7 @@ class Gr {
|
|
|
3877
3864
|
try {
|
|
3878
3865
|
return window.BuzzCasting.WidgetData[c];
|
|
3879
3866
|
} catch (l) {
|
|
3880
|
-
return console.warn("%capi",
|
|
3867
|
+
return console.warn("%capi", S.API, K.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3881
3868
|
}
|
|
3882
3869
|
});
|
|
3883
3870
|
/**
|
|
@@ -3891,7 +3878,7 @@ class Gr {
|
|
|
3891
3878
|
try {
|
|
3892
3879
|
return window.BuzzCasting.WidgetData[l] = c, 201;
|
|
3893
3880
|
} catch (k) {
|
|
3894
|
-
return console.error("%cstorage",
|
|
3881
|
+
return console.error("%cstorage", S.STORAGE, "set", r, k), 400;
|
|
3895
3882
|
}
|
|
3896
3883
|
});
|
|
3897
3884
|
/**
|
|
@@ -3905,7 +3892,7 @@ class Gr {
|
|
|
3905
3892
|
try {
|
|
3906
3893
|
return window.BuzzCasting.WidgetData[l] = c, 201;
|
|
3907
3894
|
} catch (k) {
|
|
3908
|
-
return console.error("%cstorage",
|
|
3895
|
+
return console.error("%cstorage", S.STORAGE, "set", r, k), 400;
|
|
3909
3896
|
}
|
|
3910
3897
|
});
|
|
3911
3898
|
/**
|
|
@@ -3919,7 +3906,7 @@ class Gr {
|
|
|
3919
3906
|
try {
|
|
3920
3907
|
return window.BuzzCasting.WidgetData[l] = c, 201;
|
|
3921
3908
|
} catch (k) {
|
|
3922
|
-
return console.error("%cstorage",
|
|
3909
|
+
return console.error("%cstorage", S.STORAGE, "set", r, k), 400;
|
|
3923
3910
|
}
|
|
3924
3911
|
});
|
|
3925
3912
|
A(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c(0))));
|
|
@@ -3931,7 +3918,7 @@ class Gr {
|
|
|
3931
3918
|
try {
|
|
3932
3919
|
return window.BuzzCasting.WidgetData[c] = r, 201;
|
|
3933
3920
|
} catch (l) {
|
|
3934
|
-
return console.error("%cstorage",
|
|
3921
|
+
return console.error("%cstorage", S.STORAGE, K.WIDGET, r, l), 400;
|
|
3935
3922
|
}
|
|
3936
3923
|
});
|
|
3937
3924
|
/**
|
|
@@ -3943,9 +3930,9 @@ class Gr {
|
|
|
3943
3930
|
(l) => l.widget === r.widget
|
|
3944
3931
|
).length || (console.debug(
|
|
3945
3932
|
"%cstorage%c %csubscribe",
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3933
|
+
S.STORAGE,
|
|
3934
|
+
S.NONE,
|
|
3935
|
+
S.SUBSCRIBE,
|
|
3949
3936
|
r.slide,
|
|
3950
3937
|
r.widget
|
|
3951
3938
|
), this.subscribers.push(r)), null));
|
|
@@ -3958,7 +3945,7 @@ class Gr {
|
|
|
3958
3945
|
try {
|
|
3959
3946
|
return window.BuzzCasting.SlideData[r.id];
|
|
3960
3947
|
} catch (c) {
|
|
3961
|
-
return console.warn("%capi",
|
|
3948
|
+
return console.warn("%capi", S.API, K.SLIDE, r.id, c), { data: null, message: "Slide Load error", success: !1 };
|
|
3962
3949
|
}
|
|
3963
3950
|
});
|
|
3964
3951
|
A(this, "storeSlide", async (r) => {
|
|
@@ -3971,7 +3958,7 @@ class Gr {
|
|
|
3971
3958
|
css: r.data.css || ""
|
|
3972
3959
|
}, 201;
|
|
3973
3960
|
} catch (c) {
|
|
3974
|
-
return console.error("%cstorage",
|
|
3961
|
+
return console.error("%cstorage", S.STORAGE, K.SLIDE, r, c), 400;
|
|
3975
3962
|
}
|
|
3976
3963
|
});
|
|
3977
3964
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
@@ -4066,7 +4053,7 @@ function Ti(f) {
|
|
|
4066
4053
|
r.selectNodeContents(f), r.deleteContents();
|
|
4067
4054
|
}
|
|
4068
4055
|
function zi(f, r = "font-bold") {
|
|
4069
|
-
return `${(f == null ? void 0 : f.title.length) > 0 ? `<div class="${r}">${f.title}</div
|
|
4056
|
+
return `${(f == null ? void 0 : f.title.length) > 0 ? `<div class="${r}">${f.title}</div>` : ""}${f != null && f.content ? f.content.replace(/\n\n/g, `
|
|
4070
4057
|
`).replace(/\n/g, "<br/>") : ""}`;
|
|
4071
4058
|
}
|
|
4072
4059
|
function ji(f, r) {
|
|
@@ -4103,8 +4090,8 @@ function $r(f, r, c, l) {
|
|
|
4103
4090
|
return D;
|
|
4104
4091
|
try {
|
|
4105
4092
|
return Oe(D, String(r.valueOf()));
|
|
4106
|
-
} catch (
|
|
4107
|
-
return Oe(D, `[valueOf exception]${
|
|
4093
|
+
} catch (M) {
|
|
4094
|
+
return Oe(D, `[valueOf exception]${M.stack || M.message}`);
|
|
4108
4095
|
}
|
|
4109
4096
|
}
|
|
4110
4097
|
return Oe(k, r.toString());
|
|
@@ -4159,8 +4146,8 @@ function Qi(f) {
|
|
|
4159
4146
|
}
|
|
4160
4147
|
function Xi(f) {
|
|
4161
4148
|
return f.forEach((r) => {
|
|
4162
|
-
var c, l, k, D,
|
|
4163
|
-
if (r.content = ((c = r.content) == null ? void 0 : c.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", r.sender !== null ? ((((l = r.sender) == null ? void 0 : l.title) === "Unknown author" || ((k = r.sender) == null ? void 0 : k.title) === null) && (r.sender.title = ""), ((D = r.sender) == null ? void 0 : D.name) !== "" && r.sender.title === "" && (r.sender.title = r.sender.name), ((
|
|
4149
|
+
var c, l, k, D, M;
|
|
4150
|
+
if (r.content = ((c = r.content) == null ? void 0 : c.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", r.sender !== null ? ((((l = r.sender) == null ? void 0 : l.title) === "Unknown author" || ((k = r.sender) == null ? void 0 : k.title) === null) && (r.sender.title = ""), ((D = r.sender) == null ? void 0 : D.name) !== "" && r.sender.title === "" && (r.sender.title = r.sender.name), ((M = r.sender) == null ? void 0 : M.name) !== "" && r.channel === "tw" && (r.sender.name = `@${r.sender.name}`)) : r.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, r.sender.title === "" && r.link !== "") {
|
|
4164
4151
|
const B = new URL(r.link);
|
|
4165
4152
|
r.sender.title = B.hostname.replace("www.", "");
|
|
4166
4153
|
}
|
|
@@ -4191,94 +4178,94 @@ class Ji {
|
|
|
4191
4178
|
l.push(this.api.get(k));
|
|
4192
4179
|
}), await Promise.allSettled(l).then(
|
|
4193
4180
|
(k) => k.forEach(async (D) => {
|
|
4194
|
-
let
|
|
4181
|
+
let M = 400;
|
|
4195
4182
|
if (D.status === "fulfilled") {
|
|
4196
4183
|
const B = D.value;
|
|
4197
4184
|
if (this.sm === null)
|
|
4198
4185
|
return 400;
|
|
4199
4186
|
if (B.success === !0) {
|
|
4200
4187
|
const J = this.sm.subscribers.filter(
|
|
4201
|
-
(
|
|
4188
|
+
(le) => le.widget === B.query.widget
|
|
4202
4189
|
)[0];
|
|
4203
|
-
let
|
|
4190
|
+
let q = "";
|
|
4204
4191
|
switch (B.query.type) {
|
|
4205
4192
|
case K.MESSAGES:
|
|
4206
|
-
if (
|
|
4193
|
+
if (q = $n(B.data.messages), J.hash === q)
|
|
4207
4194
|
return console.debug(
|
|
4208
4195
|
"%capi%c %cno updates",
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4196
|
+
S.API,
|
|
4197
|
+
S.NONE,
|
|
4198
|
+
S.NO_UPDATES,
|
|
4212
4199
|
K.MESSAGES,
|
|
4213
4200
|
B.query.slide,
|
|
4214
4201
|
B.query.widget
|
|
4215
4202
|
), 204;
|
|
4216
|
-
J.hash =
|
|
4203
|
+
J.hash = q, M = await this.sm.setMessages(B.query, B);
|
|
4217
4204
|
break;
|
|
4218
4205
|
case K.CLOUD:
|
|
4219
|
-
|
|
4206
|
+
q = $n(B.data), J.hash === q ? (console.debug(
|
|
4220
4207
|
"%capi%c %cno updates",
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4208
|
+
S.API,
|
|
4209
|
+
S.NONE,
|
|
4210
|
+
S.NO_UPDATES,
|
|
4224
4211
|
K.CLOUD,
|
|
4225
4212
|
B.query.slide,
|
|
4226
4213
|
B.query.widget
|
|
4227
|
-
),
|
|
4214
|
+
), M = 204) : (J.hash = q, M = await this.sm.setCloud(B.query, B));
|
|
4228
4215
|
break;
|
|
4229
4216
|
case K.SERIES:
|
|
4230
|
-
|
|
4217
|
+
q = $n(B.data), J.hash === q ? (console.debug(
|
|
4231
4218
|
"%capi%c %cno updates",
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4219
|
+
S.API,
|
|
4220
|
+
S.NONE,
|
|
4221
|
+
S.NO_UPDATES,
|
|
4235
4222
|
K.SERIES,
|
|
4236
4223
|
B.query.slide,
|
|
4237
4224
|
B.query.widget
|
|
4238
|
-
),
|
|
4225
|
+
), M = 204) : (J.hash = q, M = await this.sm.setSeries(B.query, B));
|
|
4239
4226
|
break;
|
|
4240
4227
|
default:
|
|
4241
4228
|
console.warn(
|
|
4242
4229
|
"%capi%c %cstorage",
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4230
|
+
S.API,
|
|
4231
|
+
S.NONE,
|
|
4232
|
+
S.STORAGE,
|
|
4246
4233
|
"error",
|
|
4247
4234
|
`data type ${B.query.type} unknown`
|
|
4248
4235
|
);
|
|
4249
4236
|
}
|
|
4250
4237
|
} else
|
|
4251
|
-
|
|
4252
|
-
switch (
|
|
4238
|
+
M = 401;
|
|
4239
|
+
switch (M) {
|
|
4253
4240
|
case 201:
|
|
4254
4241
|
console.info(
|
|
4255
4242
|
"%capp%c %cbroadcast",
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4243
|
+
S.API,
|
|
4244
|
+
S.NONE,
|
|
4245
|
+
S.BROADCAST,
|
|
4259
4246
|
B.query.slide,
|
|
4260
4247
|
B.data.title ?? B.query.widget
|
|
4261
|
-
), this.bc.postMessage({ event:
|
|
4248
|
+
), this.bc.postMessage({ event: ne.WIDGET_UPDATE, data: B });
|
|
4262
4249
|
break;
|
|
4263
4250
|
case 400:
|
|
4264
4251
|
console.warn(
|
|
4265
4252
|
"%capp%c %cbroadcast",
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4253
|
+
S.API,
|
|
4254
|
+
S.NONE,
|
|
4255
|
+
S.BROADCAST,
|
|
4269
4256
|
B.query.slide,
|
|
4270
4257
|
B.data.title ?? B.query.widget
|
|
4271
4258
|
);
|
|
4272
4259
|
break;
|
|
4273
4260
|
}
|
|
4274
|
-
return
|
|
4261
|
+
return M;
|
|
4275
4262
|
} else
|
|
4276
4263
|
return console.warn(
|
|
4277
4264
|
"%capi%c %cstorage",
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4265
|
+
S.API,
|
|
4266
|
+
S.NONE,
|
|
4267
|
+
S.STORAGE,
|
|
4268
|
+
ne.ERROR
|
|
4282
4269
|
), 400;
|
|
4283
4270
|
})
|
|
4284
4271
|
);
|
|
@@ -4289,16 +4276,16 @@ class Ji {
|
|
|
4289
4276
|
A(this, "actions", async (r) => {
|
|
4290
4277
|
var c;
|
|
4291
4278
|
switch (r.data.event) {
|
|
4292
|
-
case
|
|
4279
|
+
case ne.SUBSCRIBE:
|
|
4293
4280
|
(c = this.sm) == null || c.subscribe(r.data.data);
|
|
4294
4281
|
break;
|
|
4295
|
-
case
|
|
4282
|
+
case ne.UPDATE:
|
|
4296
4283
|
console.debug(
|
|
4297
4284
|
"%capi%c %cstorage",
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4285
|
+
S.API,
|
|
4286
|
+
S.NONE,
|
|
4287
|
+
S.STORAGE,
|
|
4288
|
+
ne.UPDATE,
|
|
4302
4289
|
r.data
|
|
4303
4290
|
), await this.update();
|
|
4304
4291
|
break;
|
|
@@ -4311,9 +4298,9 @@ class Ji {
|
|
|
4311
4298
|
));
|
|
4312
4299
|
console.info(
|
|
4313
4300
|
"%cstorage%c %cstorage",
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4301
|
+
S.STORAGE,
|
|
4302
|
+
S.NONE,
|
|
4303
|
+
S.MESSAGES,
|
|
4317
4304
|
`${c} messages deleted`
|
|
4318
4305
|
);
|
|
4319
4306
|
});
|
|
@@ -4322,9 +4309,9 @@ class Ji {
|
|
|
4322
4309
|
const c = await ((l = this.sm) == null ? void 0 : l.hideMessage(r.id, 0));
|
|
4323
4310
|
return console.info(
|
|
4324
4311
|
"%cstorage%c %cstorage",
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4312
|
+
S.STORAGE,
|
|
4313
|
+
S.NONE,
|
|
4314
|
+
S.HIDE,
|
|
4328
4315
|
`${c} messages hidden`
|
|
4329
4316
|
), await this.api.hideMessage(r);
|
|
4330
4317
|
});
|
|
@@ -4342,24 +4329,24 @@ class Ji {
|
|
|
4342
4329
|
});
|
|
4343
4330
|
console.info(
|
|
4344
4331
|
"%cstorage%c %cslide",
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4332
|
+
S.STORAGE,
|
|
4333
|
+
S.NONE,
|
|
4334
|
+
S.SLIDE,
|
|
4348
4335
|
r.slide,
|
|
4349
|
-
|
|
4336
|
+
ne.VERSION,
|
|
4350
4337
|
Ai
|
|
4351
4338
|
), this.options = r, this.sm = null;
|
|
4352
4339
|
const c = (r == null ? void 0 : r.slide) || r.app;
|
|
4353
4340
|
switch (this.bc = new BroadcastChannel(c), console.info(
|
|
4354
4341
|
"%capi%c %cbroadcast",
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4342
|
+
S.API,
|
|
4343
|
+
S.NONE,
|
|
4344
|
+
S.BROADCAST,
|
|
4345
|
+
ne.CHANNEL,
|
|
4359
4346
|
c
|
|
4360
4347
|
), this.bc.onmessage = (l) => {
|
|
4361
4348
|
this.actions(l);
|
|
4362
|
-
}, this.bc.postMessage({ event:
|
|
4349
|
+
}, this.bc.postMessage({ event: ne.STORAGE_INIT, data: {} }), this.api = new Di(r), r.storage) {
|
|
4363
4350
|
case ge.DEXIE:
|
|
4364
4351
|
this.sm = new Mr(r);
|
|
4365
4352
|
break;
|
|
@@ -4390,9 +4377,9 @@ class Ni {
|
|
|
4390
4377
|
var c;
|
|
4391
4378
|
return r.type !== K.CLOUD ? (console.warn(
|
|
4392
4379
|
"%capp%c %get",
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4380
|
+
S.APP,
|
|
4381
|
+
S.NONE,
|
|
4382
|
+
S.GET_DATA,
|
|
4396
4383
|
r.widget,
|
|
4397
4384
|
"wrong method call for getMessages, type used is",
|
|
4398
4385
|
r.type
|
|
@@ -4411,9 +4398,9 @@ class Ni {
|
|
|
4411
4398
|
var c;
|
|
4412
4399
|
return r.type !== K.MESSAGES ? (console.warn(
|
|
4413
4400
|
"%capp%c %get",
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4401
|
+
S.APP,
|
|
4402
|
+
S.NONE,
|
|
4403
|
+
S.GET_DATA,
|
|
4417
4404
|
r.widget,
|
|
4418
4405
|
"wrong method call for getMessages, type used is",
|
|
4419
4406
|
r.type
|
|
@@ -4432,9 +4419,9 @@ class Ni {
|
|
|
4432
4419
|
var c;
|
|
4433
4420
|
return r.type !== K.SERIES ? (console.warn(
|
|
4434
4421
|
"%capp%c %get",
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4422
|
+
S.APP,
|
|
4423
|
+
S.NONE,
|
|
4424
|
+
S.GET_DATA,
|
|
4438
4425
|
r.widget,
|
|
4439
4426
|
"wrong method call for getMessages, type used is",
|
|
4440
4427
|
r.type
|
|
@@ -4504,9 +4491,9 @@ class Zi {
|
|
|
4504
4491
|
*/
|
|
4505
4492
|
A(this, "getCloud", async () => this.query.type !== K.CLOUD ? (console.warn(
|
|
4506
4493
|
"%cstorage%c %cwidget",
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4494
|
+
S.STORAGE,
|
|
4495
|
+
S.NONE,
|
|
4496
|
+
S.WIDGET,
|
|
4510
4497
|
this.query.widget,
|
|
4511
4498
|
"Wrong method call for getCloud, expected type is",
|
|
4512
4499
|
this.query.type
|
|
@@ -4522,9 +4509,9 @@ class Zi {
|
|
|
4522
4509
|
*/
|
|
4523
4510
|
A(this, "getMessages", async () => this.query.type !== K.MESSAGES ? (console.warn(
|
|
4524
4511
|
"%cstorage%c %cwidget",
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4512
|
+
S.STORAGE,
|
|
4513
|
+
S.NONE,
|
|
4514
|
+
S.WIDGET,
|
|
4528
4515
|
this.query.widget,
|
|
4529
4516
|
"Wrong method call for getMessages, expected type is",
|
|
4530
4517
|
this.query.type
|
|
@@ -4540,9 +4527,9 @@ class Zi {
|
|
|
4540
4527
|
*/
|
|
4541
4528
|
A(this, "getSeries", async () => this.query.type !== K.SERIES ? (console.warn(
|
|
4542
4529
|
"%cstorage%c %cwidget",
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4530
|
+
S.STORAGE,
|
|
4531
|
+
S.NONE,
|
|
4532
|
+
S.WIDGET,
|
|
4546
4533
|
this.query.widget,
|
|
4547
4534
|
"Wrong method call for getSeries, expected type is",
|
|
4548
4535
|
this.query.type
|
|
@@ -4566,13 +4553,13 @@ class Zi {
|
|
|
4566
4553
|
const l = { ...r.props, ...c };
|
|
4567
4554
|
console.debug(
|
|
4568
4555
|
"%cwidget",
|
|
4569
|
-
|
|
4570
|
-
|
|
4556
|
+
S.WIDGET,
|
|
4557
|
+
ne.SHOW_MODAL,
|
|
4571
4558
|
r.showComponent,
|
|
4572
4559
|
// @ts-expect-error cannot get string type out of IFilteredAttributes props
|
|
4573
4560
|
c["data-widget"]
|
|
4574
4561
|
);
|
|
4575
|
-
const k = new CustomEvent(
|
|
4562
|
+
const k = new CustomEvent(ne.SHOW_MODAL, {
|
|
4576
4563
|
detail: {
|
|
4577
4564
|
component: r.showComponent,
|
|
4578
4565
|
props: l,
|
|
@@ -4584,10 +4571,10 @@ class Zi {
|
|
|
4584
4571
|
});
|
|
4585
4572
|
window.dispatchEvent(k);
|
|
4586
4573
|
});
|
|
4587
|
-
var
|
|
4574
|
+
var M;
|
|
4588
4575
|
this.element = r, this.listeners = c, l = typeof l < "u" ? l : "buzzcasting-slide";
|
|
4589
4576
|
let k;
|
|
4590
|
-
k = { ...r.dataset }, delete k.hmr, k.slide = ((
|
|
4577
|
+
k = { ...r.dataset }, delete k.hmr, k.slide = ((M = r.closest(l.toUpperCase())) == null ? void 0 : M.id) ?? `${l} not found`, k = nt(k), this.query = k, Ti(r);
|
|
4591
4578
|
const D = window.BuzzCasting.getOptions();
|
|
4592
4579
|
this.storageReader = new Ni(D), this.broadcastChannel = new BroadcastChannel(k.slide), this.startListener();
|
|
4593
4580
|
}
|
|
@@ -4602,12 +4589,12 @@ class Zi {
|
|
|
4602
4589
|
this.broadcastChannel.onmessage = async (c) => {
|
|
4603
4590
|
const l = c.data.data;
|
|
4604
4591
|
switch (c.data.event) {
|
|
4605
|
-
case
|
|
4592
|
+
case ne.WIDGET_UPDATE:
|
|
4606
4593
|
l.query.slide === r.slide && l.query.widget === r.widget && this.listeners.forEach((k) => {
|
|
4607
4594
|
k(c.data.data);
|
|
4608
4595
|
});
|
|
4609
4596
|
break;
|
|
4610
|
-
case
|
|
4597
|
+
case ne.SLIDE_READY:
|
|
4611
4598
|
this.subscribe();
|
|
4612
4599
|
break;
|
|
4613
4600
|
}
|
|
@@ -4620,13 +4607,13 @@ class Zi {
|
|
|
4620
4607
|
subscribe() {
|
|
4621
4608
|
console.debug(
|
|
4622
4609
|
"%cwidget%c %csubscribe",
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4610
|
+
S.WIDGET,
|
|
4611
|
+
S.NONE,
|
|
4612
|
+
S.SUBSCRIBE,
|
|
4626
4613
|
this.query.slide,
|
|
4627
4614
|
this.query.widget
|
|
4628
4615
|
), this.broadcastChannel.postMessage({
|
|
4629
|
-
event:
|
|
4616
|
+
event: ne.SUBSCRIBE,
|
|
4630
4617
|
data: this.query
|
|
4631
4618
|
});
|
|
4632
4619
|
}
|
|
@@ -4638,8 +4625,8 @@ export {
|
|
|
4638
4625
|
K as API,
|
|
4639
4626
|
Ji as BuzzcastingStorageManager,
|
|
4640
4627
|
Ni as BuzzcastingStorageReader,
|
|
4641
|
-
|
|
4642
|
-
|
|
4628
|
+
S as CSS,
|
|
4629
|
+
ne as EVENTS,
|
|
4643
4630
|
Zt as MODERATION,
|
|
4644
4631
|
ge as STORAGE,
|
|
4645
4632
|
Zi as Widget,
|