buzzcasting-storage 3.12.3 → 3.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buzzcasting-storage.esm.js +505 -504
- package/package.json +2 -2
|
@@ -26,8 +26,8 @@ function Oe(h, t) {
|
|
|
26
26
|
}
|
|
27
27
|
function Na(h, t, o) {
|
|
28
28
|
return Object.keys(t).sort().reduce(l, h);
|
|
29
|
-
function l(g,
|
|
30
|
-
return jr(g, t[
|
|
29
|
+
function l(g, v) {
|
|
30
|
+
return jr(g, t[v], v, o);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function jr(h, t, o, l) {
|
|
@@ -40,13 +40,13 @@ function jr(h, t, o, l) {
|
|
|
40
40
|
if (l.includes(t))
|
|
41
41
|
return Oe(g, `[Circular]${o}`);
|
|
42
42
|
l.push(t);
|
|
43
|
-
const
|
|
43
|
+
const v = Na(g, t, l);
|
|
44
44
|
if (!("valueOf" in t) || typeof t.valueOf != "function")
|
|
45
|
-
return
|
|
45
|
+
return v;
|
|
46
46
|
try {
|
|
47
|
-
return Oe(
|
|
48
|
-
} catch (
|
|
49
|
-
return Oe(
|
|
47
|
+
return Oe(v, String(t.valueOf()));
|
|
48
|
+
} catch (C) {
|
|
49
|
+
return Oe(v, `[valueOf exception]${C.stack || C.message}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
return Oe(g, t.toString());
|
|
@@ -76,7 +76,7 @@ st(
|
|
|
76
76
|
"checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"
|
|
77
77
|
);
|
|
78
78
|
st("script,style");
|
|
79
|
-
const
|
|
79
|
+
const K = (h = 0, t) => {
|
|
80
80
|
switch (!0) {
|
|
81
81
|
case h > 3:
|
|
82
82
|
console.debug(...t);
|
|
@@ -117,10 +117,10 @@ function Ta(h) {
|
|
|
117
117
|
}
|
|
118
118
|
function Ot(h, t) {
|
|
119
119
|
var o;
|
|
120
|
-
let l, g,
|
|
120
|
+
let l, g, v, C, j;
|
|
121
121
|
switch (h.moderation) {
|
|
122
122
|
case en.BEFORE:
|
|
123
|
-
l = /* @__PURE__ */ new Date(), g = (o = h.beforeTime) == null ? void 0 : o.split(":"),
|
|
123
|
+
l = /* @__PURE__ */ new Date(), g = (o = h.beforeTime) == null ? void 0 : o.split(":"), v = Number.parseInt(g ? g[0] : "00"), C = Number.parseInt(g ? g[1] : "00"), j = Number.parseInt(g ? g[2] : "00"), t.before = l.setHours(v, C, j, 0) / 1e3, t.period || (t.period = l.getDay() === 1 ? 72 : 24);
|
|
124
124
|
break;
|
|
125
125
|
case en.DELAYED:
|
|
126
126
|
h.delay && h.delay > 0 && (t.delay = `${h.delay}`);
|
|
@@ -133,7 +133,7 @@ function Ot(h, t) {
|
|
|
133
133
|
}
|
|
134
134
|
return t;
|
|
135
135
|
}
|
|
136
|
-
const xa = "3.12.
|
|
136
|
+
const xa = "3.12.3";
|
|
137
137
|
class ka {
|
|
138
138
|
options;
|
|
139
139
|
url;
|
|
@@ -173,35 +173,35 @@ class ka {
|
|
|
173
173
|
async get(t) {
|
|
174
174
|
const { version: o } = this.options, l = this.headers(), g = Object.assign({}, t);
|
|
175
175
|
delete g.type, delete g.hash, delete g.order, g.topics = `${g.dashboard}-${g.widget}`, delete g.presentation;
|
|
176
|
-
const
|
|
177
|
-
let
|
|
176
|
+
const v = Object.keys(g).length > 0 ? `?${new URLSearchParams(g).toString()}` : "";
|
|
177
|
+
let C = "";
|
|
178
178
|
switch (t.type) {
|
|
179
179
|
case _.MESSAGES:
|
|
180
|
-
|
|
180
|
+
C = c.MESSAGES;
|
|
181
181
|
break;
|
|
182
182
|
case _.SERIES:
|
|
183
|
-
|
|
183
|
+
C = c.SERIES;
|
|
184
184
|
break;
|
|
185
185
|
case _.CLOUD:
|
|
186
|
-
|
|
186
|
+
C = c.CLOUD;
|
|
187
187
|
break;
|
|
188
188
|
}
|
|
189
|
-
return
|
|
189
|
+
return K(3, [
|
|
190
190
|
`%cfetch%c %capi%c %c${t.type}`,
|
|
191
191
|
c.OK,
|
|
192
192
|
c.NONE,
|
|
193
193
|
c.API,
|
|
194
194
|
c.NONE,
|
|
195
|
-
|
|
195
|
+
C,
|
|
196
196
|
t.widget
|
|
197
|
-
]),
|
|
198
|
-
[this.url, "api", o, t.type].join("/") +
|
|
197
|
+
]), K(4, [t.type, g]), await fetch(
|
|
198
|
+
[this.url, "api", o, t.type].join("/") + v,
|
|
199
199
|
{ ...l, method: "get" }
|
|
200
|
-
).then(async (
|
|
201
|
-
if (!
|
|
202
|
-
throw new Error(`${
|
|
203
|
-
return
|
|
204
|
-
}).then((
|
|
200
|
+
).then(async (j) => {
|
|
201
|
+
if (!j.ok)
|
|
202
|
+
throw new Error(`${j.status}`);
|
|
203
|
+
return j;
|
|
204
|
+
}).then((j) => j.json()).then((j) => (j.query = t, j)).catch((j) => ({ success: !1, message: `${j}`, data: null, query: t }));
|
|
205
205
|
}
|
|
206
206
|
async hideMessage(t) {
|
|
207
207
|
const { version: o } = this.options, l = this.headers(), g = "?action=visible";
|
|
@@ -216,16 +216,16 @@ class ka {
|
|
|
216
216
|
), await fetch(
|
|
217
217
|
[this.url, "api", o, "messages", t.id].join("/") + g,
|
|
218
218
|
{ ...l, method: "put" }
|
|
219
|
-
).then((
|
|
220
|
-
if (!
|
|
221
|
-
throw new Error(
|
|
222
|
-
return
|
|
223
|
-
}).then((
|
|
219
|
+
).then((v) => {
|
|
220
|
+
if (!v.ok)
|
|
221
|
+
throw new Error(v.statusText);
|
|
222
|
+
return v;
|
|
223
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
224
224
|
}
|
|
225
225
|
async hideLabels(t) {
|
|
226
|
-
const { version: o } = this.options, l = this.formHeaders(), g = new URLSearchParams(),
|
|
227
|
-
for (const [
|
|
228
|
-
g.append(`custom_filters[${
|
|
226
|
+
const { version: o } = this.options, l = this.formHeaders(), g = new URLSearchParams(), v = t.labels || [];
|
|
227
|
+
for (const [C, j] of v.entries())
|
|
228
|
+
g.append(`custom_filters[${C}]`, j);
|
|
229
229
|
return console.info(
|
|
230
230
|
"%capi%c %cput",
|
|
231
231
|
c.API,
|
|
@@ -233,26 +233,26 @@ class ka {
|
|
|
233
233
|
c.GET_DATA,
|
|
234
234
|
X.HIDE_LABELS,
|
|
235
235
|
t.widget,
|
|
236
|
-
|
|
236
|
+
v
|
|
237
237
|
), await fetch(
|
|
238
238
|
[this.url, "api", o, t.type, t.widget].join("/"),
|
|
239
239
|
{ ...l, body: g, method: "put" }
|
|
240
|
-
).then((
|
|
241
|
-
if (!
|
|
242
|
-
throw new Error(
|
|
243
|
-
return
|
|
244
|
-
}).then((
|
|
240
|
+
).then((C) => {
|
|
241
|
+
if (!C.ok)
|
|
242
|
+
throw new Error(C.statusText);
|
|
243
|
+
return C;
|
|
244
|
+
}).then((C) => C.json()).catch((C) => ({ succes: !1, message: C, data: [] }));
|
|
245
245
|
}
|
|
246
246
|
async loadSlide(t) {
|
|
247
247
|
const { version: o } = this.options, l = this.headers(), g = Object.assign({}, t);
|
|
248
|
-
return delete g.type, delete g.hash,
|
|
248
|
+
return delete g.type, delete g.hash, K(3, ["%capi%c %cloadSlide", c.API, c.NONE, c.SLIDE, t.id]), await fetch(
|
|
249
249
|
[this.url, "api", o, "slides", t.id].join("/"),
|
|
250
250
|
{ ...l, method: "get" }
|
|
251
|
-
).then(async (
|
|
252
|
-
if (!
|
|
253
|
-
throw new Error(`${
|
|
254
|
-
return
|
|
255
|
-
}).then((
|
|
251
|
+
).then(async (v) => {
|
|
252
|
+
if (!v.ok)
|
|
253
|
+
throw new Error(`${v.status}`);
|
|
254
|
+
return v;
|
|
255
|
+
}).then((v) => v.json()).then((v) => (v.query = t, v.data && v.data.json && (v.data.json = JSON.parse(v.data.json)), v)).catch((v) => ({ success: !1, message: `${v}`, data: null }));
|
|
256
256
|
}
|
|
257
257
|
/**
|
|
258
258
|
* Store slide definition
|
|
@@ -265,7 +265,7 @@ class ka {
|
|
|
265
265
|
const { version: o } = this.options, l = this.formHeaders();
|
|
266
266
|
delete t.update, delete t.type;
|
|
267
267
|
const g = JSON.stringify(t);
|
|
268
|
-
return
|
|
268
|
+
return K(3, [
|
|
269
269
|
"%cput%c %capi%c %cslide",
|
|
270
270
|
c.OK,
|
|
271
271
|
c.NONE,
|
|
@@ -277,15 +277,15 @@ class ka {
|
|
|
277
277
|
]), await fetch(
|
|
278
278
|
[this.url, "api", o, "slides", t.id].join("/"),
|
|
279
279
|
{ ...l, body: g, method: "put" }
|
|
280
|
-
).then((
|
|
281
|
-
if (!
|
|
282
|
-
throw new Error(
|
|
283
|
-
return
|
|
284
|
-
}).then((
|
|
280
|
+
).then((v) => {
|
|
281
|
+
if (!v.ok)
|
|
282
|
+
throw new Error(v.statusText);
|
|
283
|
+
return v;
|
|
284
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
285
285
|
}
|
|
286
286
|
async loadPresentation(t) {
|
|
287
287
|
const { version: o } = this.options, l = this.headers();
|
|
288
|
-
return delete t.update,
|
|
288
|
+
return delete t.update, K(3, [
|
|
289
289
|
"%cload%c %capi%c %cloadPresentation",
|
|
290
290
|
c.OK,
|
|
291
291
|
c.NONE,
|
|
@@ -313,18 +313,18 @@ class ka {
|
|
|
313
313
|
const { version: o } = this.options, l = this.formHeaders();
|
|
314
314
|
delete t.update;
|
|
315
315
|
const g = JSON.stringify(t);
|
|
316
|
-
return
|
|
316
|
+
return K(2, ["%capi%c %cput", c.API, c.NONE, c.PRESENTATION, t.name]), await fetch(
|
|
317
317
|
[this.url, "api", o, _.PRESENTATIONS, t.id].join("/"),
|
|
318
318
|
{ ...l, body: g, method: "put" }
|
|
319
|
-
).then((
|
|
320
|
-
if (!
|
|
321
|
-
throw new Error(
|
|
322
|
-
return
|
|
323
|
-
}).then((
|
|
319
|
+
).then((v) => {
|
|
320
|
+
if (!v.ok)
|
|
321
|
+
throw new Error(v.statusText);
|
|
322
|
+
return v;
|
|
323
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
324
324
|
}
|
|
325
325
|
async loadPreference(t) {
|
|
326
326
|
const { version: o } = this.options, l = this.headers();
|
|
327
|
-
return
|
|
327
|
+
return K(3, [
|
|
328
328
|
"%capi%c %cloadPreference",
|
|
329
329
|
c.API,
|
|
330
330
|
c.NONE,
|
|
@@ -352,11 +352,11 @@ class ka {
|
|
|
352
352
|
), await fetch(
|
|
353
353
|
[this.url, "api", o, _.PREFERENCES, t.id].join("/"),
|
|
354
354
|
{ ...l, body: g, method: "put" }
|
|
355
|
-
).then((
|
|
356
|
-
if (!
|
|
357
|
-
throw new Error(
|
|
358
|
-
return
|
|
359
|
-
}).then((
|
|
355
|
+
).then((v) => {
|
|
356
|
+
if (!v.ok)
|
|
357
|
+
throw new Error(v.statusText);
|
|
358
|
+
return v;
|
|
359
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
360
360
|
}
|
|
361
361
|
/*public async loadDashboardWidgets(query: IQuery): Promise<any> {
|
|
362
362
|
if (query?.dashboard === undefined)
|
|
@@ -397,7 +397,7 @@ class ka {
|
|
|
397
397
|
}*/
|
|
398
398
|
async loadDashboards(t) {
|
|
399
399
|
const { version: o } = this.options, l = this.headers();
|
|
400
|
-
return
|
|
400
|
+
return K(3, ["%capi%c %cdashboards", c.API, c.NONE, c.WIDGET]), await fetch(
|
|
401
401
|
[this.url, "api", o, _.WIDGETS, t?.id || ""].join("/"),
|
|
402
402
|
{
|
|
403
403
|
...l,
|
|
@@ -450,11 +450,11 @@ class ka {
|
|
|
450
450
|
body: g,
|
|
451
451
|
method: "post"
|
|
452
452
|
}
|
|
453
|
-
).then((
|
|
454
|
-
if (!
|
|
455
|
-
throw new Error(
|
|
456
|
-
return
|
|
457
|
-
}).then((
|
|
453
|
+
).then((v) => {
|
|
454
|
+
if (!v.ok)
|
|
455
|
+
throw new Error(v.statusText);
|
|
456
|
+
return v;
|
|
457
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
458
458
|
}
|
|
459
459
|
async deleteImage(t, o) {
|
|
460
460
|
const { version: l } = this.options, g = this.formHeaders();
|
|
@@ -469,11 +469,11 @@ class ka {
|
|
|
469
469
|
"/"
|
|
470
470
|
)}?folder=${t}`,
|
|
471
471
|
{ ...g, method: "delete" }
|
|
472
|
-
).then((
|
|
473
|
-
if (!
|
|
474
|
-
throw new Error(
|
|
475
|
-
return
|
|
476
|
-
}).then((
|
|
472
|
+
).then((v) => {
|
|
473
|
+
if (!v.ok)
|
|
474
|
+
throw new Error(v.statusText);
|
|
475
|
+
return v;
|
|
476
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
var Ca = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -502,19 +502,19 @@ function Ma() {
|
|
|
502
502
|
for (var a, s = 0, i = n.length; s < i; s++) !a && s in n || ((a = a || Array.prototype.slice.call(n, 0, s))[s] = n[s]);
|
|
503
503
|
return e.concat(a || Array.prototype.slice.call(n));
|
|
504
504
|
}
|
|
505
|
-
var
|
|
505
|
+
var v = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca, C = Object.keys, j = Array.isArray;
|
|
506
506
|
function te(e, n) {
|
|
507
|
-
return typeof n != "object" ||
|
|
507
|
+
return typeof n != "object" || C(n).forEach(function(r) {
|
|
508
508
|
e[r] = n[r];
|
|
509
509
|
}), e;
|
|
510
510
|
}
|
|
511
|
-
typeof Promise > "u" ||
|
|
511
|
+
typeof Promise > "u" || v.Promise || (v.Promise = Promise);
|
|
512
512
|
var ge = Object.getPrototypeOf, Ce = {}.hasOwnProperty;
|
|
513
513
|
function ie(e, n) {
|
|
514
514
|
return Ce.call(e, n);
|
|
515
515
|
}
|
|
516
516
|
function be(e, n) {
|
|
517
|
-
typeof n == "function" && (n = n(ge(e))), (typeof Reflect > "u" ?
|
|
517
|
+
typeof n == "function" && (n = n(ge(e))), (typeof Reflect > "u" ? C : Reflect.ownKeys)(n).forEach(function(r) {
|
|
518
518
|
Ae(e, r, n[r]);
|
|
519
519
|
});
|
|
520
520
|
}
|
|
@@ -538,7 +538,7 @@ function Ma() {
|
|
|
538
538
|
if (!e) throw new Error("Assertion Failed");
|
|
539
539
|
}
|
|
540
540
|
function Yn(e) {
|
|
541
|
-
|
|
541
|
+
v.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
542
542
|
}
|
|
543
543
|
function ve(e, n) {
|
|
544
544
|
if (typeof n == "string" && ie(e, n)) return e[n];
|
|
@@ -562,7 +562,7 @@ function Ma() {
|
|
|
562
562
|
for (var a = 0, s = n.length; a < s; ++a) ue(e, n[a], r[a]);
|
|
563
563
|
} else {
|
|
564
564
|
var i, u, d = n.indexOf(".");
|
|
565
|
-
d !== -1 ? (i = n.substr(0, d), (u = n.substr(d + 1)) === "" ? r === void 0 ?
|
|
565
|
+
d !== -1 ? (i = n.substr(0, d), (u = n.substr(d + 1)) === "" ? r === void 0 ? j(e) && !isNaN(parseInt(i)) ? e.splice(i, 1) : delete e[i] : e[i] = r : ue(d = !(d = e[i]) || !ie(e, i) ? e[i] = {} : d, u, r)) : r === void 0 ? j(e) && !isNaN(parseInt(n)) ? e.splice(n, 1) : delete e[n] : e[n] = r;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
function Qn(e) {
|
|
@@ -579,16 +579,16 @@ function Ma() {
|
|
|
579
579
|
return n + e + "Array";
|
|
580
580
|
});
|
|
581
581
|
}))).filter(function(e) {
|
|
582
|
-
return
|
|
582
|
+
return v[e];
|
|
583
583
|
}), Jn = new Set(Ge.map(function(e) {
|
|
584
|
-
return
|
|
584
|
+
return v[e];
|
|
585
585
|
})), it = null;
|
|
586
586
|
function $e(e) {
|
|
587
587
|
return it = /* @__PURE__ */ new WeakMap(), e = function n(r) {
|
|
588
588
|
if (!r || typeof r != "object") return r;
|
|
589
589
|
var a = it.get(r);
|
|
590
590
|
if (a) return a;
|
|
591
|
-
if (
|
|
591
|
+
if (j(r)) {
|
|
592
592
|
a = [], it.set(r, a);
|
|
593
593
|
for (var s = 0, i = r.length; s < i; ++s) a.push(n(r[s]));
|
|
594
594
|
} else if (Jn.has(r.constructor)) a = r;
|
|
@@ -616,7 +616,7 @@ function Ma() {
|
|
|
616
616
|
function Ee(e) {
|
|
617
617
|
var n, r, a, s;
|
|
618
618
|
if (arguments.length === 1) {
|
|
619
|
-
if (
|
|
619
|
+
if (j(e)) return e.slice();
|
|
620
620
|
if (this === Qe && typeof e == "string") return [e];
|
|
621
621
|
if (s = Vr(e)) {
|
|
622
622
|
for (r = []; !(a = s.next()).done; ) r.push(a.value);
|
|
@@ -743,7 +743,7 @@ function Ma() {
|
|
|
743
743
|
}(), lt = Ge[0], fe = Ge[1], Ge = Ge[2], fe = fe && fe.then, Ke = lt && lt.constructor, cn = !!Ge, dt = function(e, n) {
|
|
744
744
|
ft.push([e, n]), It && (queueMicrotask(na), It = !1);
|
|
745
745
|
}, un = !0, It = !0, Be = [], Nt = [], ln = ct, Pe = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Q, pgp: !1, env: {}, finalize: Q }, B = Pe, ft = [], Le = 0, Rt = [];
|
|
746
|
-
function
|
|
746
|
+
function M(e) {
|
|
747
747
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
748
748
|
this._listeners = [], this._lib = !1;
|
|
749
749
|
var n = this._PSD = B;
|
|
@@ -758,7 +758,7 @@ function Ma() {
|
|
|
758
758
|
if (i === a) throw new TypeError("A promise cannot be resolved with itself.");
|
|
759
759
|
var u = a._lib && Ze();
|
|
760
760
|
i && typeof i.then == "function" ? r(a, function(d, p) {
|
|
761
|
-
i instanceof
|
|
761
|
+
i instanceof M ? i._then(d, p) : i.then(d, p);
|
|
762
762
|
}) : (a._state = !0, a._value = i, rr(a)), u && qe();
|
|
763
763
|
}
|
|
764
764
|
}, fn.bind(null, a));
|
|
@@ -770,7 +770,7 @@ function Ma() {
|
|
|
770
770
|
var dn = { get: function() {
|
|
771
771
|
var e = B, n = Ct;
|
|
772
772
|
function r(a, s) {
|
|
773
|
-
var i = this, u = !e.global && (e !== B || n !== Ct), d = u && !Ie(), p = new
|
|
773
|
+
var i = this, u = !e.global && (e !== B || n !== Ct), d = u && !Ie(), p = new M(function(y, w) {
|
|
774
774
|
hn(i, new nr(sr(a, e, u, d), sr(s, e, u, d), y, w, e));
|
|
775
775
|
});
|
|
776
776
|
return this._consoleTask && (p._consoleTask = this._consoleTask), p;
|
|
@@ -847,7 +847,7 @@ function Ma() {
|
|
|
847
847
|
for (var n = Rt.slice(0), r = n.length; r; ) n[--r]();
|
|
848
848
|
}
|
|
849
849
|
function Tt(e) {
|
|
850
|
-
return new
|
|
850
|
+
return new M(ut, !1, e);
|
|
851
851
|
}
|
|
852
852
|
function Z(e, n) {
|
|
853
853
|
var r = B;
|
|
@@ -862,7 +862,7 @@ function Ma() {
|
|
|
862
862
|
}
|
|
863
863
|
};
|
|
864
864
|
}
|
|
865
|
-
be(
|
|
865
|
+
be(M.prototype, { then: dn, _then: function(e, n) {
|
|
866
866
|
hn(this, new nr(null, null, e, n, B));
|
|
867
867
|
}, catch: function(e) {
|
|
868
868
|
if (arguments.length === 1) return this.then(null, e);
|
|
@@ -874,42 +874,42 @@ function Ma() {
|
|
|
874
874
|
});
|
|
875
875
|
}, finally: function(e) {
|
|
876
876
|
return this.then(function(n) {
|
|
877
|
-
return
|
|
877
|
+
return M.resolve(e()).then(function() {
|
|
878
878
|
return n;
|
|
879
879
|
});
|
|
880
880
|
}, function(n) {
|
|
881
|
-
return
|
|
881
|
+
return M.resolve(e()).then(function() {
|
|
882
882
|
return Tt(n);
|
|
883
883
|
});
|
|
884
884
|
});
|
|
885
885
|
}, timeout: function(e, n) {
|
|
886
886
|
var r = this;
|
|
887
|
-
return e < 1 / 0 ? new
|
|
887
|
+
return e < 1 / 0 ? new M(function(a, s) {
|
|
888
888
|
var i = setTimeout(function() {
|
|
889
889
|
return s(new L.Timeout(n));
|
|
890
890
|
}, e);
|
|
891
891
|
r.then(a, s).finally(clearTimeout.bind(null, i));
|
|
892
892
|
}) : this;
|
|
893
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(
|
|
893
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(M.prototype, Symbol.toStringTag, "Dexie.Promise"), Pe.env = ar(), be(M, { all: function() {
|
|
894
894
|
var e = Ee.apply(null, arguments).map($t);
|
|
895
|
-
return new
|
|
895
|
+
return new M(function(n, r) {
|
|
896
896
|
e.length === 0 && n([]);
|
|
897
897
|
var a = e.length;
|
|
898
898
|
e.forEach(function(s, i) {
|
|
899
|
-
return
|
|
899
|
+
return M.resolve(s).then(function(u) {
|
|
900
900
|
e[i] = u, --a || n(e);
|
|
901
901
|
}, r);
|
|
902
902
|
});
|
|
903
903
|
});
|
|
904
904
|
}, resolve: function(e) {
|
|
905
|
-
return e instanceof
|
|
905
|
+
return e instanceof M ? e : e && typeof e.then == "function" ? new M(function(n, r) {
|
|
906
906
|
e.then(n, r);
|
|
907
|
-
}) : new
|
|
907
|
+
}) : new M(ut, !0, e);
|
|
908
908
|
}, reject: Tt, race: function() {
|
|
909
909
|
var e = Ee.apply(null, arguments).map($t);
|
|
910
|
-
return new
|
|
910
|
+
return new M(function(n, r) {
|
|
911
911
|
e.map(function(a) {
|
|
912
|
-
return
|
|
912
|
+
return M.resolve(a).then(n, r);
|
|
913
913
|
});
|
|
914
914
|
});
|
|
915
915
|
}, PSD: { get: function() {
|
|
@@ -927,7 +927,7 @@ function Ma() {
|
|
|
927
927
|
}, set: function(e) {
|
|
928
928
|
ln = e;
|
|
929
929
|
} }, follow: function(e, n) {
|
|
930
|
-
return new
|
|
930
|
+
return new M(function(r, a) {
|
|
931
931
|
return De(function(s, i) {
|
|
932
932
|
var u = B;
|
|
933
933
|
u.unhandleds = [], u.onunhandled = i, u.finalize = Me(function() {
|
|
@@ -942,13 +942,13 @@ function Ma() {
|
|
|
942
942
|
}, u.finalize), e();
|
|
943
943
|
}, n, r, a);
|
|
944
944
|
});
|
|
945
|
-
} }), Ke && (Ke.allSettled && Ae(
|
|
945
|
+
} }), Ke && (Ke.allSettled && Ae(M, "allSettled", function() {
|
|
946
946
|
var e = Ee.apply(null, arguments).map($t);
|
|
947
|
-
return new
|
|
947
|
+
return new M(function(n) {
|
|
948
948
|
e.length === 0 && n([]);
|
|
949
949
|
var r = e.length, a = new Array(r);
|
|
950
950
|
e.forEach(function(s, i) {
|
|
951
|
-
return
|
|
951
|
+
return M.resolve(s).then(function(u) {
|
|
952
952
|
return a[i] = { status: "fulfilled", value: u };
|
|
953
953
|
}, function(u) {
|
|
954
954
|
return a[i] = { status: "rejected", reason: u };
|
|
@@ -957,24 +957,24 @@ function Ma() {
|
|
|
957
957
|
});
|
|
958
958
|
});
|
|
959
959
|
});
|
|
960
|
-
}), Ke.any && typeof AggregateError < "u" && Ae(
|
|
960
|
+
}), Ke.any && typeof AggregateError < "u" && Ae(M, "any", function() {
|
|
961
961
|
var e = Ee.apply(null, arguments).map($t);
|
|
962
|
-
return new
|
|
962
|
+
return new M(function(n, r) {
|
|
963
963
|
e.length === 0 && r(new AggregateError([]));
|
|
964
964
|
var a = e.length, s = new Array(a);
|
|
965
965
|
e.forEach(function(i, u) {
|
|
966
|
-
return
|
|
966
|
+
return M.resolve(i).then(function(d) {
|
|
967
967
|
return n(d);
|
|
968
968
|
}, function(d) {
|
|
969
969
|
s[u] = d, --a || r(new AggregateError(s));
|
|
970
970
|
});
|
|
971
971
|
});
|
|
972
972
|
});
|
|
973
|
-
}), Ke.withResolvers && (
|
|
973
|
+
}), Ke.withResolvers && (M.withResolvers = Ke.withResolvers));
|
|
974
974
|
var ne = { awaits: 0, echoes: 0, id: 0 }, ra = 0, xt = [], kt = 0, Ct = 0, aa = 0;
|
|
975
975
|
function De(e, n, r, a) {
|
|
976
976
|
var s = B, i = Object.create(s);
|
|
977
|
-
return i.parent = s, i.ref = 0, i.global = !1, i.id = ++aa, Pe.env, i.env = cn ? { Promise:
|
|
977
|
+
return i.parent = s, i.ref = 0, i.global = !1, i.id = ++aa, Pe.env, i.env = cn ? { Promise: M, PromiseProp: { value: M, configurable: !0, writable: !0 }, all: M.all, race: M.race, allSettled: M.allSettled, any: M.any, resolve: M.resolve, reject: M.reject } : {}, n && te(i, n), ++s.ref, i.finalize = function() {
|
|
978
978
|
--this.parent.ref || this.parent.finalize();
|
|
979
979
|
}, a = We(i, e, r, a), i.ref === 0 && i.finalize(), a;
|
|
980
980
|
}
|
|
@@ -999,11 +999,11 @@ function Ma() {
|
|
|
999
999
|
var r, a = B;
|
|
1000
1000
|
(n ? !ne.echoes || kt++ && e === B : !kt || --kt && e === B) || queueMicrotask(n ? function(s) {
|
|
1001
1001
|
++Ct, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), xt.push(B), Ne(s, !0);
|
|
1002
|
-
}.bind(null, e) : sa), e !== B && (B = e, a === Pe && (Pe.env = ar()), cn && (r = Pe.env.Promise, n = e.env, (a.global || e.global) && (Object.defineProperty(
|
|
1002
|
+
}.bind(null, e) : sa), e !== B && (B = e, a === Pe && (Pe.env = ar()), cn && (r = Pe.env.Promise, n = e.env, (a.global || e.global) && (Object.defineProperty(v, "Promise", n.PromiseProp), r.all = n.all, r.race = n.race, r.resolve = n.resolve, r.reject = n.reject, n.allSettled && (r.allSettled = n.allSettled), n.any && (r.any = n.any))));
|
|
1003
1003
|
}
|
|
1004
1004
|
function ar() {
|
|
1005
|
-
var e =
|
|
1006
|
-
return cn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(
|
|
1005
|
+
var e = v.Promise;
|
|
1006
|
+
return cn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(v, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
1007
1007
|
}
|
|
1008
1008
|
function We(e, n, r, a, s) {
|
|
1009
1009
|
var i = B;
|
|
@@ -1028,7 +1028,7 @@ function Ma() {
|
|
|
1028
1028
|
Promise === Ke && ne.echoes === 0 ? kt === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
1029
1029
|
}
|
|
1030
1030
|
("" + fe).indexOf("[native code]") === -1 && (et = Ie = Q);
|
|
1031
|
-
var q =
|
|
1031
|
+
var q = M.reject, Fe = "", we = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", or = "String expected.", tt = [], jt = "__dbnames", mn = "readonly", yn = "readwrite";
|
|
1032
1032
|
function Ue(e, n) {
|
|
1033
1033
|
return e ? n ? function() {
|
|
1034
1034
|
return e.apply(this, arguments) && n.apply(this, arguments);
|
|
@@ -1099,9 +1099,9 @@ function Ma() {
|
|
|
1099
1099
|
return y(w, f, O, m);
|
|
1100
1100
|
})) : q(S);
|
|
1101
1101
|
}
|
|
1102
|
-
return E._promise(f, function(S,
|
|
1102
|
+
return E._promise(f, function(S, b) {
|
|
1103
1103
|
return De(function() {
|
|
1104
|
-
return B.trans = E, m(S,
|
|
1104
|
+
return B.trans = E, m(S, b, E);
|
|
1105
1105
|
});
|
|
1106
1106
|
}).then(function(S) {
|
|
1107
1107
|
if (f === "readwrite") try {
|
|
@@ -1137,8 +1137,8 @@ function Ma() {
|
|
|
1137
1137
|
}).then(n);
|
|
1138
1138
|
}, J.prototype.where = function(e) {
|
|
1139
1139
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
1140
|
-
if (
|
|
1141
|
-
var n =
|
|
1140
|
+
if (j(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
1141
|
+
var n = C(e);
|
|
1142
1142
|
if (n.length === 1) return this.where(n[0]).equals(e[n[0]]);
|
|
1143
1143
|
var r = this.schema.indexes.concat(this.schema.primKey).filter(function(d) {
|
|
1144
1144
|
if (d.compound && n.every(function(y) {
|
|
@@ -1165,7 +1165,7 @@ function Ma() {
|
|
|
1165
1165
|
var u = n.reduce(function(f, p) {
|
|
1166
1166
|
var y = f[0], w = f[1], f = a[p], O = e[p];
|
|
1167
1167
|
return [y || f, y || !f ? Ue(w, f && f.multi ? function(m) {
|
|
1168
|
-
return m = ve(m, p),
|
|
1168
|
+
return m = ve(m, p), j(m) && m.some(function(E) {
|
|
1169
1169
|
return s(O, E);
|
|
1170
1170
|
});
|
|
1171
1171
|
} : function(m) {
|
|
@@ -1188,7 +1188,7 @@ function Ma() {
|
|
|
1188
1188
|
}, J.prototype.toCollection = function() {
|
|
1189
1189
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
1190
1190
|
}, J.prototype.orderBy = function(e) {
|
|
1191
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
1191
|
+
return new this.db.Collection(new this.db.WhereClause(this, j(e) ? "[".concat(e.join("+"), "]") : e));
|
|
1192
1192
|
}, J.prototype.reverse = function() {
|
|
1193
1193
|
return this.toCollection().reverse();
|
|
1194
1194
|
}, J.prototype.mapToClass = function(e) {
|
|
@@ -1229,7 +1229,7 @@ function Ma() {
|
|
|
1229
1229
|
return i && s && (u = Mt(i)(e)), this._trans("readwrite", function(d) {
|
|
1230
1230
|
return r.core.mutate({ trans: d, type: "add", keys: n != null ? [n] : null, values: [u] });
|
|
1231
1231
|
}).then(function(d) {
|
|
1232
|
-
return d.numFailures ?
|
|
1232
|
+
return d.numFailures ? M.reject(d.failures[0]) : d.lastResult;
|
|
1233
1233
|
}).then(function(d) {
|
|
1234
1234
|
if (i) try {
|
|
1235
1235
|
ue(e, i, d);
|
|
@@ -1238,13 +1238,13 @@ function Ma() {
|
|
|
1238
1238
|
return d;
|
|
1239
1239
|
});
|
|
1240
1240
|
}, J.prototype.update = function(e, n) {
|
|
1241
|
-
return typeof e != "object" ||
|
|
1241
|
+
return typeof e != "object" || j(e) ? this.where(":id").equals(e).modify(n) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? q(new L.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(n));
|
|
1242
1242
|
}, J.prototype.put = function(e, n) {
|
|
1243
1243
|
var r = this, a = this.schema.primKey, s = a.auto, i = a.keyPath, u = e;
|
|
1244
1244
|
return i && s && (u = Mt(i)(e)), this._trans("readwrite", function(d) {
|
|
1245
1245
|
return r.core.mutate({ trans: d, type: "put", values: [u], keys: n != null ? [n] : null });
|
|
1246
1246
|
}).then(function(d) {
|
|
1247
|
-
return d.numFailures ?
|
|
1247
|
+
return d.numFailures ? M.reject(d.failures[0]) : d.lastResult;
|
|
1248
1248
|
}).then(function(d) {
|
|
1249
1249
|
if (i) try {
|
|
1250
1250
|
ue(e, i, d);
|
|
@@ -1257,14 +1257,14 @@ function Ma() {
|
|
|
1257
1257
|
return this._trans("readwrite", function(r) {
|
|
1258
1258
|
return n.core.mutate({ trans: r, type: "delete", keys: [e] });
|
|
1259
1259
|
}).then(function(r) {
|
|
1260
|
-
return r.numFailures ?
|
|
1260
|
+
return r.numFailures ? M.reject(r.failures[0]) : void 0;
|
|
1261
1261
|
});
|
|
1262
1262
|
}, J.prototype.clear = function() {
|
|
1263
1263
|
var e = this;
|
|
1264
1264
|
return this._trans("readwrite", function(n) {
|
|
1265
1265
|
return e.core.mutate({ trans: n, type: "deleteRange", range: ir });
|
|
1266
1266
|
}).then(function(n) {
|
|
1267
|
-
return n.numFailures ?
|
|
1267
|
+
return n.numFailures ? M.reject(n.failures[0]) : void 0;
|
|
1268
1268
|
});
|
|
1269
1269
|
}, J.prototype.bulkGet = function(e) {
|
|
1270
1270
|
var n = this;
|
|
@@ -1313,8 +1313,8 @@ function Ma() {
|
|
|
1313
1313
|
e.forEach(function(f, O) {
|
|
1314
1314
|
var m = f.key, E = f.changes, S = d[O];
|
|
1315
1315
|
if (S) {
|
|
1316
|
-
for (var
|
|
1317
|
-
var P = A[
|
|
1316
|
+
for (var b = 0, A = Object.keys(E); b < A.length; b++) {
|
|
1317
|
+
var P = A[b], D = E[P];
|
|
1318
1318
|
if (P === n.schema.primKey.keyPath) {
|
|
1319
1319
|
if (H(D, m) !== 0) throw new L.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1320
1320
|
} else ue(S, P, D);
|
|
@@ -1327,8 +1327,8 @@ function Ma() {
|
|
|
1327
1327
|
var O = f.numFailures, m = f.failures;
|
|
1328
1328
|
if (O === 0) return w;
|
|
1329
1329
|
for (var E = 0, S = Object.keys(m); E < S.length; E++) {
|
|
1330
|
-
var
|
|
1331
|
-
P != null && (
|
|
1330
|
+
var b, A = S[E], P = i[Number(A)];
|
|
1331
|
+
P != null && (b = m[A], delete m[A], m[P] = b);
|
|
1332
1332
|
}
|
|
1333
1333
|
throw new Je("".concat(n.name, ".bulkUpdate(): ").concat(O, " of ").concat(w, " operations failed"), m);
|
|
1334
1334
|
});
|
|
@@ -1371,16 +1371,16 @@ function Ma() {
|
|
|
1371
1371
|
} };
|
|
1372
1372
|
return r[u] = n[u] = w;
|
|
1373
1373
|
}
|
|
1374
|
-
|
|
1374
|
+
C(y = u).forEach(function(f) {
|
|
1375
1375
|
var O = y[f];
|
|
1376
|
-
if (
|
|
1376
|
+
if (j(O)) i(f, y[f][0], y[f][1]);
|
|
1377
1377
|
else {
|
|
1378
1378
|
if (O !== "asap") throw new L.InvalidArgument("Invalid event config");
|
|
1379
1379
|
var m = i(f, ct, function() {
|
|
1380
1380
|
for (var E = arguments.length, S = new Array(E); E--; ) S[E] = arguments[E];
|
|
1381
|
-
m.subscribers.forEach(function(
|
|
1381
|
+
m.subscribers.forEach(function(b) {
|
|
1382
1382
|
Yn(function() {
|
|
1383
|
-
|
|
1383
|
+
b.apply(null, S);
|
|
1384
1384
|
});
|
|
1385
1385
|
});
|
|
1386
1386
|
});
|
|
@@ -1453,7 +1453,7 @@ function Ma() {
|
|
|
1453
1453
|
var n = this["@@propmod"];
|
|
1454
1454
|
if (n.add !== void 0) {
|
|
1455
1455
|
var r = n.add;
|
|
1456
|
-
if (
|
|
1456
|
+
if (j(r)) return g(g([], j(e) ? e : [], !0), r).sort();
|
|
1457
1457
|
if (typeof r == "number") return (Number(e) || 0) + r;
|
|
1458
1458
|
if (typeof r == "bigint") try {
|
|
1459
1459
|
return BigInt(e) + r;
|
|
@@ -1464,7 +1464,7 @@ function Ma() {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
if (n.remove !== void 0) {
|
|
1466
1466
|
var a = n.remove;
|
|
1467
|
-
if (
|
|
1467
|
+
if (j(a)) return j(e) ? e.filter(function(s) {
|
|
1468
1468
|
return !a.includes(s);
|
|
1469
1469
|
}).sort() : [];
|
|
1470
1470
|
if (typeof a == "number") return Number(e) - a;
|
|
@@ -1645,35 +1645,35 @@ function Ma() {
|
|
|
1645
1645
|
var n = this, r = this._ctx;
|
|
1646
1646
|
return this._write(function(a) {
|
|
1647
1647
|
var s, i, u;
|
|
1648
|
-
u = typeof e == "function" ? e : (s =
|
|
1648
|
+
u = typeof e == "function" ? e : (s = C(e), i = s.length, function(b) {
|
|
1649
1649
|
for (var A = !1, P = 0; P < i; ++P) {
|
|
1650
|
-
var D = s[P], I = e[D], N = ve(
|
|
1651
|
-
I instanceof pt ? (ue(
|
|
1650
|
+
var D = s[P], I = e[D], N = ve(b, D);
|
|
1651
|
+
I instanceof pt ? (ue(b, D, I.execute(N)), A = !0) : N !== I && (ue(b, D, I), A = !0);
|
|
1652
1652
|
}
|
|
1653
1653
|
return A;
|
|
1654
1654
|
});
|
|
1655
1655
|
var d = r.table.core, f = d.schema.primaryKey, p = f.outbound, y = f.extractKey, w = 200, f = n.db._options.modifyChunkSize;
|
|
1656
1656
|
f && (w = typeof f == "object" ? f[d.name] || f["*"] || 200 : f);
|
|
1657
|
-
function O(
|
|
1657
|
+
function O(b, D) {
|
|
1658
1658
|
var P = D.failures, D = D.numFailures;
|
|
1659
|
-
E +=
|
|
1660
|
-
for (var I = 0, N =
|
|
1661
|
-
var
|
|
1662
|
-
m.push(P[
|
|
1659
|
+
E += b - D;
|
|
1660
|
+
for (var I = 0, N = C(P); I < N.length; I++) {
|
|
1661
|
+
var k = N[I];
|
|
1662
|
+
m.push(P[k]);
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
1665
|
var m = [], E = 0, S = [];
|
|
1666
|
-
return n.clone().primaryKeys().then(function(
|
|
1666
|
+
return n.clone().primaryKeys().then(function(b) {
|
|
1667
1667
|
function A(D) {
|
|
1668
|
-
var I = Math.min(w,
|
|
1669
|
-
return d.getMany({ trans: a, keys:
|
|
1670
|
-
for (var
|
|
1671
|
-
var
|
|
1672
|
-
u.call(F, F.value, F) !== !1 && (F.value == null ? $.push(
|
|
1668
|
+
var I = Math.min(w, b.length - D);
|
|
1669
|
+
return d.getMany({ trans: a, keys: b.slice(D, D + I), cache: "immutable" }).then(function(N) {
|
|
1670
|
+
for (var k = [], R = [], T = p ? [] : null, $ = [], x = 0; x < I; ++x) {
|
|
1671
|
+
var G = N[x], F = { value: $e(G), primKey: b[D + x] };
|
|
1672
|
+
u.call(F, F.value, F) !== !1 && (F.value == null ? $.push(b[D + x]) : p || H(y(G), y(F.value)) === 0 ? (R.push(F.value), p && T.push(b[D + x])) : ($.push(b[D + x]), k.push(F.value)));
|
|
1673
1673
|
}
|
|
1674
|
-
return Promise.resolve(0 <
|
|
1674
|
+
return Promise.resolve(0 < k.length && d.mutate({ trans: a, type: "add", values: k }).then(function(U) {
|
|
1675
1675
|
for (var z in U.failures) $.splice(parseInt(z), 1);
|
|
1676
|
-
O(
|
|
1676
|
+
O(k.length, U);
|
|
1677
1677
|
})).then(function() {
|
|
1678
1678
|
return (0 < R.length || P && typeof e == "object") && d.mutate({ trans: a, type: "put", keys: T, values: R, criteria: P, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < D }).then(function(U) {
|
|
1679
1679
|
return O(R.length, U);
|
|
@@ -1683,14 +1683,14 @@ function Ma() {
|
|
|
1683
1683
|
return O($.length, U);
|
|
1684
1684
|
});
|
|
1685
1685
|
}).then(function() {
|
|
1686
|
-
return
|
|
1686
|
+
return b.length > D + I && A(D + w);
|
|
1687
1687
|
});
|
|
1688
1688
|
});
|
|
1689
1689
|
}
|
|
1690
1690
|
var P = nt(r) && r.limit === 1 / 0 && (typeof e != "function" || e === En) && { index: r.index, range: r.range };
|
|
1691
1691
|
return A(0).then(function() {
|
|
1692
1692
|
if (0 < m.length) throw new Pt("Error modifying one or more objects", m, E, S);
|
|
1693
|
-
return
|
|
1693
|
+
return b.length;
|
|
1694
1694
|
});
|
|
1695
1695
|
});
|
|
1696
1696
|
});
|
|
@@ -1734,24 +1734,24 @@ function Ma() {
|
|
|
1734
1734
|
return typeof E == "string";
|
|
1735
1735
|
})) return le(e, or);
|
|
1736
1736
|
function O(E) {
|
|
1737
|
-
s = E === "next" ? function(
|
|
1738
|
-
return
|
|
1739
|
-
} : function(
|
|
1740
|
-
return
|
|
1741
|
-
}, i = E === "next" ? function(
|
|
1742
|
-
return
|
|
1743
|
-
} : function(
|
|
1744
|
-
return
|
|
1737
|
+
s = E === "next" ? function(b) {
|
|
1738
|
+
return b.toUpperCase();
|
|
1739
|
+
} : function(b) {
|
|
1740
|
+
return b.toLowerCase();
|
|
1741
|
+
}, i = E === "next" ? function(b) {
|
|
1742
|
+
return b.toLowerCase();
|
|
1743
|
+
} : function(b) {
|
|
1744
|
+
return b.toUpperCase();
|
|
1745
1745
|
}, u = E === "next" ? ia : ca;
|
|
1746
|
-
var S = r.map(function(
|
|
1747
|
-
return { lower: i(
|
|
1748
|
-
}).sort(function(
|
|
1749
|
-
return u(
|
|
1746
|
+
var S = r.map(function(b) {
|
|
1747
|
+
return { lower: i(b), upper: s(b) };
|
|
1748
|
+
}).sort(function(b, A) {
|
|
1749
|
+
return u(b.lower, A.lower);
|
|
1750
1750
|
});
|
|
1751
|
-
d = S.map(function(
|
|
1752
|
-
return
|
|
1753
|
-
}), p = S.map(function(
|
|
1754
|
-
return
|
|
1751
|
+
d = S.map(function(b) {
|
|
1752
|
+
return b.upper;
|
|
1753
|
+
}), p = S.map(function(b) {
|
|
1754
|
+
return b.lower;
|
|
1755
1755
|
}), w = (y = E) === "next" ? "" : a;
|
|
1756
1756
|
}
|
|
1757
1757
|
O("next"), e = new e.Collection(e, function() {
|
|
@@ -1760,25 +1760,25 @@ function Ma() {
|
|
|
1760
1760
|
O(E);
|
|
1761
1761
|
};
|
|
1762
1762
|
var m = 0;
|
|
1763
|
-
return e._addAlgorithm(function(E, S,
|
|
1763
|
+
return e._addAlgorithm(function(E, S, b) {
|
|
1764
1764
|
var A = E.key;
|
|
1765
1765
|
if (typeof A != "string") return !1;
|
|
1766
1766
|
var P = i(A);
|
|
1767
1767
|
if (n(P, p, m)) return !0;
|
|
1768
1768
|
for (var D = null, I = m; I < f; ++I) {
|
|
1769
|
-
var N = function(
|
|
1770
|
-
for (var F = Math.min(
|
|
1769
|
+
var N = function(k, R, T, $, x, G) {
|
|
1770
|
+
for (var F = Math.min(k.length, $.length), U = -1, z = 0; z < F; ++z) {
|
|
1771
1771
|
var de = R[z];
|
|
1772
|
-
if (de !== $[z]) return x(
|
|
1773
|
-
x(
|
|
1772
|
+
if (de !== $[z]) return x(k[z], T[z]) < 0 ? k.substr(0, z) + T[z] + T.substr(z + 1) : x(k[z], $[z]) < 0 ? k.substr(0, z) + $[z] + T.substr(z + 1) : 0 <= U ? k.substr(0, U) + R[U] + T.substr(U + 1) : null;
|
|
1773
|
+
x(k[z], de) < 0 && (U = z);
|
|
1774
1774
|
}
|
|
1775
|
-
return F < $.length &&
|
|
1775
|
+
return F < $.length && G === "next" ? k + T.substr(k.length) : F < k.length && G === "prev" ? k.substr(0, T.length) : U < 0 ? null : k.substr(0, U) + $[U] + T.substr(U + 1);
|
|
1776
1776
|
}(A, P, d[I], p[I], u, y);
|
|
1777
1777
|
N === null && D === null ? m = I + 1 : (D === null || 0 < u(D, N)) && (D = N);
|
|
1778
1778
|
}
|
|
1779
1779
|
return S(D !== null ? function() {
|
|
1780
1780
|
E.continue(D + w);
|
|
1781
|
-
} :
|
|
1781
|
+
} : b), !1;
|
|
1782
1782
|
}), e;
|
|
1783
1783
|
}
|
|
1784
1784
|
function Re(e, n, r, a) {
|
|
@@ -1888,9 +1888,9 @@ function Ma() {
|
|
|
1888
1888
|
try {
|
|
1889
1889
|
(w = A.reduce(function(P, D) {
|
|
1890
1890
|
for (var I = 0, N = P.length; I < N; ++I) {
|
|
1891
|
-
var
|
|
1892
|
-
if (a(D[0],
|
|
1893
|
-
|
|
1891
|
+
var k = P[I];
|
|
1892
|
+
if (a(D[0], k[1]) < 0 && 0 < a(D[1], k[0])) {
|
|
1893
|
+
k[0] = u(k[0], D[0]), k[1] = d(k[1], D[1]);
|
|
1894
1894
|
break;
|
|
1895
1895
|
}
|
|
1896
1896
|
}
|
|
@@ -1907,14 +1907,14 @@ function Ma() {
|
|
|
1907
1907
|
return 0 < i(P, w[m][0]);
|
|
1908
1908
|
} : function(P) {
|
|
1909
1909
|
return 0 <= i(P, w[m][0]);
|
|
1910
|
-
},
|
|
1910
|
+
}, b = E, A = new this.Collection(this, function() {
|
|
1911
1911
|
return Re(w[0][0], w[w.length - 1][1], !p, !y);
|
|
1912
1912
|
});
|
|
1913
1913
|
return A._ondirectionchange = function(P) {
|
|
1914
|
-
f = P === "next" ? (
|
|
1914
|
+
f = P === "next" ? (b = E, s) : (b = S, i), w.sort(O);
|
|
1915
1915
|
}, A._addAlgorithm(function(P, D, I) {
|
|
1916
|
-
for (var N,
|
|
1917
|
-
return !E(N =
|
|
1916
|
+
for (var N, k = P.key; b(k); ) if (++m === w.length) return D(I), !1;
|
|
1917
|
+
return !E(N = k) && !S(N) || (r._cmp(k, w[m][1]) === 0 || r._cmp(k, w[m][0]) === 0 || D(function() {
|
|
1918
1918
|
f === s ? P.continue(w[m][0]) : P.continue(w[m][1]);
|
|
1919
1919
|
}), !1);
|
|
1920
1920
|
}), A;
|
|
@@ -1973,13 +1973,13 @@ function Ma() {
|
|
|
1973
1973
|
var a = this;
|
|
1974
1974
|
if (e === "readwrite" && this.mode !== "readwrite") return q(new L.ReadOnly("Transaction is readonly"));
|
|
1975
1975
|
if (!this.active) return q(new L.TransactionInactive());
|
|
1976
|
-
if (this._locked()) return new
|
|
1976
|
+
if (this._locked()) return new M(function(i, u) {
|
|
1977
1977
|
a._blockedFuncs.push([function() {
|
|
1978
1978
|
a._promise(e, n, r).then(i, u);
|
|
1979
1979
|
}, B]);
|
|
1980
1980
|
});
|
|
1981
1981
|
if (r) return De(function() {
|
|
1982
|
-
var i = new
|
|
1982
|
+
var i = new M(function(u, d) {
|
|
1983
1983
|
a._lock();
|
|
1984
1984
|
var p = n(u, d, a);
|
|
1985
1985
|
p && p.then && p.then(u, d);
|
|
@@ -1988,7 +1988,7 @@ function Ma() {
|
|
|
1988
1988
|
return a._unlock();
|
|
1989
1989
|
}), i._lib = !0, i;
|
|
1990
1990
|
});
|
|
1991
|
-
var s = new
|
|
1991
|
+
var s = new M(function(i, u) {
|
|
1992
1992
|
var d = n(i, u, a);
|
|
1993
1993
|
d && d.then && d.then(i, u);
|
|
1994
1994
|
});
|
|
@@ -1996,7 +1996,7 @@ function Ma() {
|
|
|
1996
1996
|
}, ye.prototype._root = function() {
|
|
1997
1997
|
return this.parent ? this.parent._root() : this;
|
|
1998
1998
|
}, ye.prototype.waitFor = function(e) {
|
|
1999
|
-
var n, r = this._root(), a =
|
|
1999
|
+
var n, r = this._root(), a = M.resolve(e);
|
|
2000
2000
|
r._waitingFor ? r._waitingFor = r._waitingFor.then(function() {
|
|
2001
2001
|
return a;
|
|
2002
2002
|
}) : (r._waitingFor = a, r._waitingQueue = [], n = r.idbtrans.objectStore(r.storeNames[0]), function i() {
|
|
@@ -2004,7 +2004,7 @@ function Ma() {
|
|
|
2004
2004
|
r._waitingFor && (n.get(-1 / 0).onsuccess = i);
|
|
2005
2005
|
}());
|
|
2006
2006
|
var s = r._waitingFor;
|
|
2007
|
-
return new
|
|
2007
|
+
return new M(function(i, u) {
|
|
2008
2008
|
a.then(function(d) {
|
|
2009
2009
|
return r._waitingQueue.push(Z(i.bind(null, d)));
|
|
2010
2010
|
}, function(d) {
|
|
@@ -2068,23 +2068,23 @@ function Ma() {
|
|
|
2068
2068
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
2069
2069
|
}
|
|
2070
2070
|
function da(e, n, p) {
|
|
2071
|
-
function a(
|
|
2072
|
-
if (
|
|
2073
|
-
if (
|
|
2074
|
-
var m =
|
|
2075
|
-
return m === void 0 ? E === void 0 ? null : n.upperBound(E, !!
|
|
2071
|
+
function a(b) {
|
|
2072
|
+
if (b.type === 3) return null;
|
|
2073
|
+
if (b.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
2074
|
+
var m = b.lower, E = b.upper, S = b.lowerOpen, b = b.upperOpen;
|
|
2075
|
+
return m === void 0 ? E === void 0 ? null : n.upperBound(E, !!b) : E === void 0 ? n.lowerBound(m, !!S) : n.bound(m, E, !!S, !!b);
|
|
2076
2076
|
}
|
|
2077
2077
|
function s(O) {
|
|
2078
2078
|
var m, E = O.name;
|
|
2079
2079
|
return { name: E, schema: O, mutate: function(S) {
|
|
2080
|
-
var
|
|
2081
|
-
return new Promise(function(N,
|
|
2080
|
+
var b = S.trans, A = S.type, P = S.keys, D = S.values, I = S.range;
|
|
2081
|
+
return new Promise(function(N, k) {
|
|
2082
2082
|
N = Z(N);
|
|
2083
|
-
var R =
|
|
2083
|
+
var R = b.objectStore(E), T = R.keyPath == null, $ = A === "put" || A === "add";
|
|
2084
2084
|
if (!$ && A !== "delete" && A !== "deleteRange") throw new Error("Invalid operation type: " + A);
|
|
2085
|
-
var x,
|
|
2085
|
+
var x, G = (P || D || { length: 1 }).length;
|
|
2086
2086
|
if (P && D && P.length !== D.length) throw new Error("Given keys array must have same length as given values array.");
|
|
2087
|
-
if (
|
|
2087
|
+
if (G === 0) return N({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
2088
2088
|
function F(ce) {
|
|
2089
2089
|
++de, mt(ce);
|
|
2090
2090
|
}
|
|
@@ -2094,8 +2094,8 @@ function Ma() {
|
|
|
2094
2094
|
I.type === 3 ? U.push(x = R.clear()) : U.push(x = R.delete(a(I)));
|
|
2095
2095
|
} else {
|
|
2096
2096
|
var T = $ ? T ? [D, P] : [D, null] : [P, null], W = T[0], se = T[1];
|
|
2097
|
-
if ($) for (var oe = 0; oe <
|
|
2098
|
-
else for (oe = 0; oe <
|
|
2097
|
+
if ($) for (var oe = 0; oe < G; ++oe) U.push(x = se && se[oe] !== void 0 ? R[A](W[oe], se[oe]) : R[A](W[oe])), x.onerror = F;
|
|
2098
|
+
else for (oe = 0; oe < G; ++oe) U.push(x = R[A](W[oe])), x.onerror = F;
|
|
2099
2099
|
}
|
|
2100
2100
|
function qt(ce) {
|
|
2101
2101
|
ce = ce.target.result, U.forEach(function(Ve, Wn) {
|
|
@@ -2109,47 +2109,47 @@ function Ma() {
|
|
|
2109
2109
|
}, x.onsuccess = qt;
|
|
2110
2110
|
});
|
|
2111
2111
|
}, getMany: function(S) {
|
|
2112
|
-
var
|
|
2112
|
+
var b = S.trans, A = S.keys;
|
|
2113
2113
|
return new Promise(function(P, D) {
|
|
2114
2114
|
P = Z(P);
|
|
2115
|
-
for (var I, N =
|
|
2115
|
+
for (var I, N = b.objectStore(E), k = A.length, R = new Array(k), T = 0, $ = 0, x = function(U) {
|
|
2116
2116
|
U = U.target, R[U._pos] = U.result, ++$ === T && P(R);
|
|
2117
|
-
},
|
|
2117
|
+
}, G = me(D), F = 0; F < k; ++F) A[F] != null && ((I = N.get(A[F]))._pos = F, I.onsuccess = x, I.onerror = G, ++T);
|
|
2118
2118
|
T === 0 && P(R);
|
|
2119
2119
|
});
|
|
2120
2120
|
}, get: function(S) {
|
|
2121
|
-
var
|
|
2121
|
+
var b = S.trans, A = S.key;
|
|
2122
2122
|
return new Promise(function(P, D) {
|
|
2123
2123
|
P = Z(P);
|
|
2124
|
-
var I =
|
|
2124
|
+
var I = b.objectStore(E).get(A);
|
|
2125
2125
|
I.onsuccess = function(N) {
|
|
2126
2126
|
return P(N.target.result);
|
|
2127
2127
|
}, I.onerror = me(D);
|
|
2128
2128
|
});
|
|
2129
2129
|
}, query: (m = y, function(S) {
|
|
2130
|
-
return new Promise(function(
|
|
2131
|
-
|
|
2132
|
-
var P, D, I, T = S.trans, N = S.values,
|
|
2133
|
-
if (
|
|
2134
|
-
m ? ((R = N ? $.getAll(x, R) : $.getAllKeys(x, R)).onsuccess = function(
|
|
2135
|
-
return
|
|
2136
|
-
}, R.onerror = me(A)) : (P = 0, D = !N && "openKeyCursor" in $ ? $.openKeyCursor(x) : $.openCursor(x), I = [], D.onsuccess = function(
|
|
2130
|
+
return new Promise(function(b, A) {
|
|
2131
|
+
b = Z(b);
|
|
2132
|
+
var P, D, I, T = S.trans, N = S.values, k = S.limit, x = S.query, R = k === 1 / 0 ? void 0 : k, $ = x.index, x = x.range, T = T.objectStore(E), $ = $.isPrimaryKey ? T : T.index($.name), x = a(x);
|
|
2133
|
+
if (k === 0) return b({ result: [] });
|
|
2134
|
+
m ? ((R = N ? $.getAll(x, R) : $.getAllKeys(x, R)).onsuccess = function(G) {
|
|
2135
|
+
return b({ result: G.target.result });
|
|
2136
|
+
}, R.onerror = me(A)) : (P = 0, D = !N && "openKeyCursor" in $ ? $.openKeyCursor(x) : $.openCursor(x), I = [], D.onsuccess = function(G) {
|
|
2137
2137
|
var F = D.result;
|
|
2138
|
-
return F ? (I.push(N ? F.value : F.primaryKey), ++P ===
|
|
2138
|
+
return F ? (I.push(N ? F.value : F.primaryKey), ++P === k ? b({ result: I }) : void F.continue()) : b({ result: I });
|
|
2139
2139
|
}, D.onerror = me(A));
|
|
2140
2140
|
});
|
|
2141
2141
|
}), openCursor: function(S) {
|
|
2142
|
-
var
|
|
2143
|
-
return new Promise(function(N,
|
|
2142
|
+
var b = S.trans, A = S.values, P = S.query, D = S.reverse, I = S.unique;
|
|
2143
|
+
return new Promise(function(N, k) {
|
|
2144
2144
|
N = Z(N);
|
|
2145
|
-
var $ = P.index, R = P.range, T =
|
|
2146
|
-
x.onerror = me(
|
|
2145
|
+
var $ = P.index, R = P.range, T = b.objectStore(E), T = $.isPrimaryKey ? T : T.index($.name), $ = D ? I ? "prevunique" : "prev" : I ? "nextunique" : "next", x = !A && "openKeyCursor" in T ? T.openKeyCursor(a(R), $) : T.openCursor(a(R), $);
|
|
2146
|
+
x.onerror = me(k), x.onsuccess = Z(function(G) {
|
|
2147
2147
|
var F, U, z, de, W = x.result;
|
|
2148
2148
|
W ? (W.___id = ++la, W.done = !1, F = W.continue.bind(W), U = (U = W.continuePrimaryKey) && U.bind(W), z = W.advance.bind(W), de = function() {
|
|
2149
2149
|
throw new Error("Cursor not stopped");
|
|
2150
|
-
}, W.trans =
|
|
2150
|
+
}, W.trans = b, W.stop = W.continue = W.continuePrimaryKey = W.advance = function() {
|
|
2151
2151
|
throw new Error("Cursor not started");
|
|
2152
|
-
}, W.fail = Z(
|
|
2152
|
+
}, W.fail = Z(k), W.next = function() {
|
|
2153
2153
|
var se = this, oe = 1;
|
|
2154
2154
|
return this.start(function() {
|
|
2155
2155
|
return oe-- ? se.continue() : se.stop();
|
|
@@ -2176,12 +2176,12 @@ function Ma() {
|
|
|
2176
2176
|
x.onsuccess = oe, oe();
|
|
2177
2177
|
}), W.continue = F, W.continuePrimaryKey = U, W.advance = z, oe(), qt;
|
|
2178
2178
|
}, N(W)) : N(null);
|
|
2179
|
-
},
|
|
2179
|
+
}, k);
|
|
2180
2180
|
});
|
|
2181
2181
|
}, count: function(S) {
|
|
2182
|
-
var
|
|
2182
|
+
var b = S.query, A = S.trans, P = b.index, D = b.range;
|
|
2183
2183
|
return new Promise(function(I, N) {
|
|
2184
|
-
var
|
|
2184
|
+
var k = A.objectStore(E), R = P.isPrimaryKey ? k : k.index(P.name), k = a(D), R = k ? R.count(k) : R.count();
|
|
2185
2185
|
R.onsuccess = Z(function(T) {
|
|
2186
2186
|
return I(T.target.result);
|
|
2187
2187
|
}), R.onerror = me(N);
|
|
@@ -2191,15 +2191,15 @@ function Ma() {
|
|
|
2191
2191
|
var i, u, d, w = (u = p, d = br((i = e).objectStoreNames), { schema: { name: i.name, tables: d.map(function(O) {
|
|
2192
2192
|
return u.objectStore(O);
|
|
2193
2193
|
}).map(function(O) {
|
|
2194
|
-
var m = O.keyPath,
|
|
2194
|
+
var m = O.keyPath, b = O.autoIncrement, E = j(m), S = {}, b = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: m == null, compound: E, keyPath: m, autoIncrement: b, unique: !0, extractKey: _n(m) }, indexes: br(O.indexNames).map(function(A) {
|
|
2195
2195
|
return O.index(A);
|
|
2196
2196
|
}).map(function(I) {
|
|
2197
|
-
var P = I.name, D = I.unique, N = I.multiEntry, I = I.keyPath, N = { name: P, compound:
|
|
2197
|
+
var P = I.name, D = I.unique, N = I.multiEntry, I = I.keyPath, N = { name: P, compound: j(I), keyPath: I, unique: D, multiEntry: N, extractKey: _n(I) };
|
|
2198
2198
|
return S[vt(I)] = N;
|
|
2199
2199
|
}), getIndexByKeyPath: function(A) {
|
|
2200
2200
|
return S[vt(A)];
|
|
2201
2201
|
} };
|
|
2202
|
-
return S[":id"] =
|
|
2202
|
+
return S[":id"] = b.primaryKey, m != null && (S[vt(m)] = b.primaryKey), b;
|
|
2203
2203
|
}) }, hasGetAll: 0 < d.length && "getAll" in u.objectStore(d[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), p = w.schema, y = w.hasGetAll, w = p.tables.map(s), f = {};
|
|
2204
2204
|
return w.forEach(function(O) {
|
|
2205
2205
|
return f[O.name] = O;
|
|
@@ -2255,46 +2255,46 @@ function Ma() {
|
|
|
2255
2255
|
De(function() {
|
|
2256
2256
|
return B.trans = i, B.transless = d, n !== 0 ? (Lt(e, r), y = n, ((p = i).storeNames.includes("$meta") ? p.table("$meta").get("version").then(function(w) {
|
|
2257
2257
|
return w ?? y;
|
|
2258
|
-
}) :
|
|
2259
|
-
return O = w, m = i, E = r, S = [], w = (f = e)._versions,
|
|
2258
|
+
}) : M.resolve(y)).then(function(w) {
|
|
2259
|
+
return O = w, m = i, E = r, S = [], w = (f = e)._versions, b = f._dbSchema = Ut(0, f.idbdb, E), (w = w.filter(function(A) {
|
|
2260
2260
|
return A._cfg.version >= O;
|
|
2261
2261
|
})).length !== 0 ? (w.forEach(function(A) {
|
|
2262
2262
|
S.push(function() {
|
|
2263
|
-
var P =
|
|
2264
|
-
zt(f, P, E), zt(f, D, E),
|
|
2263
|
+
var P = b, D = A._cfg.dbschema;
|
|
2264
|
+
zt(f, P, E), zt(f, D, E), b = f._dbSchema = D;
|
|
2265
2265
|
var I = Pn(P, D);
|
|
2266
2266
|
I.add.forEach(function($) {
|
|
2267
2267
|
Dn(E, $[0], $[1].primKey, $[1].indexes);
|
|
2268
2268
|
}), I.change.forEach(function($) {
|
|
2269
2269
|
if ($.recreate) throw new L.Upgrade("Not yet support for changing primary key");
|
|
2270
2270
|
var x = E.objectStore($.name);
|
|
2271
|
-
$.add.forEach(function(
|
|
2272
|
-
return Ft(x,
|
|
2273
|
-
}), $.change.forEach(function(
|
|
2274
|
-
x.deleteIndex(
|
|
2275
|
-
}), $.del.forEach(function(
|
|
2276
|
-
return x.deleteIndex(
|
|
2271
|
+
$.add.forEach(function(G) {
|
|
2272
|
+
return Ft(x, G);
|
|
2273
|
+
}), $.change.forEach(function(G) {
|
|
2274
|
+
x.deleteIndex(G.name), Ft(x, G);
|
|
2275
|
+
}), $.del.forEach(function(G) {
|
|
2276
|
+
return x.deleteIndex(G);
|
|
2277
2277
|
});
|
|
2278
2278
|
});
|
|
2279
2279
|
var N = A._cfg.contentUpgrade;
|
|
2280
2280
|
if (N && A._cfg.version > O) {
|
|
2281
2281
|
Lt(f, E), m._memoizedTables = {};
|
|
2282
|
-
var
|
|
2282
|
+
var k = Qn(D);
|
|
2283
2283
|
I.del.forEach(function($) {
|
|
2284
|
-
|
|
2285
|
-
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], k
|
|
2284
|
+
k[$] = P[$];
|
|
2285
|
+
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], C(k), k), m.schema = k;
|
|
2286
2286
|
var R, T = an(N);
|
|
2287
|
-
return T && et(), I =
|
|
2287
|
+
return T && et(), I = M.follow(function() {
|
|
2288
2288
|
var $;
|
|
2289
2289
|
(R = N(m)) && T && ($ = Ie.bind(null, null), R.then($, $));
|
|
2290
|
-
}), R && typeof R.then == "function" ?
|
|
2290
|
+
}), R && typeof R.then == "function" ? M.resolve(R) : I.then(function() {
|
|
2291
2291
|
return R;
|
|
2292
2292
|
});
|
|
2293
2293
|
}
|
|
2294
2294
|
}), S.push(function(P) {
|
|
2295
2295
|
var D, I, N = A._cfg.dbschema;
|
|
2296
|
-
D = N, I = P, [].slice.call(I.db.objectStoreNames).forEach(function(
|
|
2297
|
-
return D[
|
|
2296
|
+
D = N, I = P, [].slice.call(I.db.objectStoreNames).forEach(function(k) {
|
|
2297
|
+
return D[k] == null && I.db.deleteObjectStore(k);
|
|
2298
2298
|
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), m.schema = f._dbSchema;
|
|
2299
2299
|
}), S.push(function(P) {
|
|
2300
2300
|
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) === A._cfg.version ? (f.idbdb.deleteObjectStore("$meta"), delete f._dbSchema.$meta, f._storeNames = f._storeNames.filter(function(D) {
|
|
@@ -2302,14 +2302,14 @@ function Ma() {
|
|
|
2302
2302
|
})) : P.objectStore("$meta").put(A._cfg.version, "version"));
|
|
2303
2303
|
});
|
|
2304
2304
|
}), function A() {
|
|
2305
|
-
return S.length ?
|
|
2305
|
+
return S.length ? M.resolve(S.shift()(m.idbtrans)).then(A) : M.resolve();
|
|
2306
2306
|
}().then(function() {
|
|
2307
|
-
vr(
|
|
2308
|
-
})) :
|
|
2309
|
-
var f, O, m, E, S,
|
|
2310
|
-
}).catch(u)) : (
|
|
2307
|
+
vr(b, E);
|
|
2308
|
+
})) : M.resolve();
|
|
2309
|
+
var f, O, m, E, S, b;
|
|
2310
|
+
}).catch(u)) : (C(s).forEach(function(w) {
|
|
2311
2311
|
Dn(r, w, s[w].primKey, s[w].indexes);
|
|
2312
|
-
}), Lt(e, r), void
|
|
2312
|
+
}), Lt(e, r), void M.follow(function() {
|
|
2313
2313
|
return e.on.populate.fire(i);
|
|
2314
2314
|
}).catch(u));
|
|
2315
2315
|
var p, y;
|
|
@@ -2358,7 +2358,7 @@ function Ma() {
|
|
|
2358
2358
|
}), s;
|
|
2359
2359
|
}
|
|
2360
2360
|
function vr(e, n) {
|
|
2361
|
-
|
|
2361
|
+
C(e).forEach(function(r) {
|
|
2362
2362
|
n.db.objectStoreNames.contains(r) || (pe && console.debug("Dexie: Creating missing table", r), Dn(n, r, e[r].primKey, e[r].indexes));
|
|
2363
2363
|
});
|
|
2364
2364
|
}
|
|
@@ -2384,16 +2384,16 @@ function Ma() {
|
|
|
2384
2384
|
!n[i] || (y = n[i].idxByName[w]) && (y.name = p, delete n[i].idxByName[w], n[i].idxByName[p] = y);
|
|
2385
2385
|
}
|
|
2386
2386
|
}
|
|
2387
|
-
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) &&
|
|
2387
|
+
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && v.WorkerGlobalScope && v instanceof v.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2388
2388
|
}
|
|
2389
2389
|
function Er(e) {
|
|
2390
2390
|
return e.split(",").map(function(n, r) {
|
|
2391
2391
|
var a = (n = n.trim()).replace(/([&*]|\+\+)/g, ""), s = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
|
|
2392
|
-
return Sn(a, s || null, /\&/.test(n), /\*/.test(n), /\+\+/.test(n),
|
|
2392
|
+
return Sn(a, s || null, /\&/.test(n), /\*/.test(n), /\+\+/.test(n), j(s), r === 0);
|
|
2393
2393
|
});
|
|
2394
2394
|
}
|
|
2395
2395
|
var ma = (Ht.prototype._parseStoresSpec = function(e, n) {
|
|
2396
|
-
|
|
2396
|
+
C(e).forEach(function(r) {
|
|
2397
2397
|
if (e[r] !== null) {
|
|
2398
2398
|
var a = Er(e[r]), s = a.shift();
|
|
2399
2399
|
if (s.unique = !0, s.multi) throw new L.Schema("Primary key cannot be multi-valued");
|
|
@@ -2409,7 +2409,7 @@ function Ma() {
|
|
|
2409
2409
|
var r = n._versions, a = {}, s = {};
|
|
2410
2410
|
return r.forEach(function(i) {
|
|
2411
2411
|
te(a, i._cfg.storesSource), s = i._cfg.dbschema = {}, i._parseStoresSpec(a, s);
|
|
2412
|
-
}), n._dbSchema = s, An(n, [n._allTables, n, n.Transaction.prototype]), Wt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables],
|
|
2412
|
+
}), n._dbSchema = s, An(n, [n._allTables, n, n.Transaction.prototype]), Wt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], C(s), s), n._storeNames = C(s), this;
|
|
2413
2413
|
}, Ht.prototype.upgrade = function(e) {
|
|
2414
2414
|
return this._cfg.contentUpgrade = on(this._cfg.contentUpgrade || Q, e), this;
|
|
2415
2415
|
}, Ht);
|
|
@@ -2492,7 +2492,7 @@ function Ma() {
|
|
|
2492
2492
|
return (n ? r ? Math.max(n.d, r.d) : n.d : r ? r.d : 0) + 1;
|
|
2493
2493
|
}
|
|
2494
2494
|
function Yt(e, n) {
|
|
2495
|
-
return
|
|
2495
|
+
return C(n).forEach(function(r) {
|
|
2496
2496
|
e[r] ? wt(e[r], n[r]) : e[r] = function a(s) {
|
|
2497
2497
|
var i, u, d = {};
|
|
2498
2498
|
for (i in s) ie(s, i) && (u = s[i], d[i] = !u || typeof u != "object" || Jn.has(u.constructor) ? u : a(u));
|
|
@@ -2542,8 +2542,8 @@ function Ma() {
|
|
|
2542
2542
|
for (var s = [], i = 0, u = Object.entries(e.queries.query); i < u.length; i++) {
|
|
2543
2543
|
for (var d = u[i], p = d[0], y = [], w = 0, f = d[1]; w < f.length; w++) {
|
|
2544
2544
|
var O = f[w];
|
|
2545
|
-
xn(n, O.obsSet) ? O.subscribers.forEach(function(
|
|
2546
|
-
return r.add(
|
|
2545
|
+
xn(n, O.obsSet) ? O.subscribers.forEach(function(b) {
|
|
2546
|
+
return r.add(b);
|
|
2547
2547
|
}) : a && y.push(O);
|
|
2548
2548
|
}
|
|
2549
2549
|
a && s.push([p, y]);
|
|
@@ -2564,21 +2564,21 @@ function Ma() {
|
|
|
2564
2564
|
if (n.openCanceller !== a) throw new L.DatabaseClosed("db.open() was cancelled");
|
|
2565
2565
|
}
|
|
2566
2566
|
function d() {
|
|
2567
|
-
return new
|
|
2567
|
+
return new M(function(O, m) {
|
|
2568
2568
|
if (u(), !r) throw new L.MissingAPI();
|
|
2569
2569
|
var E = e.name, S = n.autoSchema || !s ? r.open(E) : r.open(E, s);
|
|
2570
2570
|
if (!S) throw new L.MissingAPI();
|
|
2571
|
-
S.onerror = me(m), S.onblocked = Z(e._fireOnBlocked), S.onupgradeneeded = Z(function(
|
|
2571
|
+
S.onerror = me(m), S.onblocked = Z(e._fireOnBlocked), S.onupgradeneeded = Z(function(b) {
|
|
2572
2572
|
var A;
|
|
2573
2573
|
w = S.transaction, n.autoSchema && !e._options.allowEmptyDB ? (S.onerror = mt, w.abort(), S.result.close(), (A = r.deleteDatabase(E)).onsuccess = A.onerror = Z(function() {
|
|
2574
2574
|
m(new L.NoSuchDatabase("Database ".concat(E, " doesnt exist")));
|
|
2575
|
-
})) : (w.onerror = me(m),
|
|
2575
|
+
})) : (w.onerror = me(m), b = b.oldVersion > Math.pow(2, 62) ? 0 : b.oldVersion, f = b < 1, e.idbdb = S.result, i && pa(e, w), ga(e, b / 10, w, m));
|
|
2576
2576
|
}, m), S.onsuccess = Z(function() {
|
|
2577
2577
|
w = null;
|
|
2578
|
-
var
|
|
2579
|
-
if (0 <
|
|
2580
|
-
var R = N.transaction((D =
|
|
2581
|
-
if (n.autoSchema) A = N, P = R, (
|
|
2578
|
+
var b, A, P, D, I, N = e.idbdb = S.result, k = At(N.objectStoreNames);
|
|
2579
|
+
if (0 < k.length) try {
|
|
2580
|
+
var R = N.transaction((D = k).length === 1 ? D[0] : D, "readonly");
|
|
2581
|
+
if (n.autoSchema) A = N, P = R, (b = e).verno = A.version / 10, P = b._dbSchema = Ut(0, A, P), b._storeNames = At(A.objectStoreNames, 0), Wt(b, [b._allTables], C(P), P);
|
|
2582
2582
|
else if (zt(e, e._dbSchema, R), ((I = Pn(Ut(0, (I = e).idbdb, R), I._dbSchema)).add.length || I.change.some(function(T) {
|
|
2583
2583
|
return T.add.length || T.change.length;
|
|
2584
2584
|
})) && !i) 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."), N.close(), s = N.version + 1, i = !0, O(d());
|
|
@@ -2599,11 +2599,11 @@ function Ma() {
|
|
|
2599
2599
|
case "VersionError":
|
|
2600
2600
|
if (0 < s) return s = 0, d();
|
|
2601
2601
|
}
|
|
2602
|
-
return
|
|
2602
|
+
return M.reject(O);
|
|
2603
2603
|
});
|
|
2604
2604
|
}
|
|
2605
2605
|
var p, y = n.dbReadyResolve, w = null, f = !1;
|
|
2606
|
-
return
|
|
2606
|
+
return M.race([a, (typeof navigator > "u" ? M.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(O) {
|
|
2607
2607
|
function m() {
|
|
2608
2608
|
return indexedDB.databases().finally(O);
|
|
2609
2609
|
}
|
|
@@ -2611,12 +2611,12 @@ function Ma() {
|
|
|
2611
2611
|
}).finally(function() {
|
|
2612
2612
|
return clearInterval(p);
|
|
2613
2613
|
}) : Promise.resolve()).then(d)]).then(function() {
|
|
2614
|
-
return u(), n.onReadyBeingFired = [],
|
|
2614
|
+
return u(), n.onReadyBeingFired = [], M.resolve(Rn(function() {
|
|
2615
2615
|
return e.on.ready.fire(e.vip);
|
|
2616
2616
|
})).then(function O() {
|
|
2617
2617
|
if (0 < n.onReadyBeingFired.length) {
|
|
2618
2618
|
var m = n.onReadyBeingFired.reduce(on, Q);
|
|
2619
|
-
return n.onReadyBeingFired = [],
|
|
2619
|
+
return n.onReadyBeingFired = [], M.resolve(Rn(function() {
|
|
2620
2620
|
return m(e.vip);
|
|
2621
2621
|
})).then(O);
|
|
2622
2622
|
}
|
|
@@ -2651,21 +2651,21 @@ function Ma() {
|
|
|
2651
2651
|
function s(i) {
|
|
2652
2652
|
return function(p) {
|
|
2653
2653
|
var d = i(p), p = d.value;
|
|
2654
|
-
return d.done ? p : p && typeof p.then == "function" ? p.then(r, a) :
|
|
2654
|
+
return d.done ? p : p && typeof p.then == "function" ? p.then(r, a) : j(p) ? Promise.all(p).then(r, a) : r(p);
|
|
2655
2655
|
};
|
|
2656
2656
|
}
|
|
2657
2657
|
return s(n)();
|
|
2658
2658
|
}
|
|
2659
2659
|
function Xt(e, n, r) {
|
|
2660
|
-
for (var a =
|
|
2660
|
+
for (var a = j(e) ? e.slice() : [e], s = 0; s < r; ++s) a.push(n);
|
|
2661
2661
|
return a;
|
|
2662
2662
|
}
|
|
2663
2663
|
var ba = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2664
2664
|
return l(l({}, e), { table: function(n) {
|
|
2665
2665
|
var r = e.table(n), a = r.schema, s = {}, i = [];
|
|
2666
2666
|
function u(f, O, m) {
|
|
2667
|
-
var E = vt(f), S = s[E] = s[E] || [],
|
|
2668
|
-
return S.push(A), A.isPrimaryKey || i.push(A), 1 <
|
|
2667
|
+
var E = vt(f), S = s[E] = s[E] || [], b = f == null ? 0 : typeof f == "string" ? 1 : f.length, A = 0 < O, A = l(l({}, m), { name: A ? "".concat(E, "(virtual-from:").concat(m.name, ")") : m.name, lowLevelIndex: m, isVirtual: A, keyTail: O, keyLength: b, extractKey: _n(f), unique: !A && m.unique });
|
|
2668
|
+
return S.push(A), A.isPrimaryKey || i.push(A), 1 < b && u(b === 2 ? f[0] : f.slice(0, b - 1), O + 1, m), S.sort(function(P, D) {
|
|
2669
2669
|
return P.keyTail - D.keyTail;
|
|
2670
2670
|
}), A;
|
|
2671
2671
|
}
|
|
@@ -2687,9 +2687,9 @@ function Ma() {
|
|
|
2687
2687
|
}, openCursor: function(f) {
|
|
2688
2688
|
var O = f.query.index, m = O.keyTail, E = O.isVirtual, S = O.keyLength;
|
|
2689
2689
|
return E ? r.openCursor(w(f)).then(function(A) {
|
|
2690
|
-
return A &&
|
|
2690
|
+
return A && b(A);
|
|
2691
2691
|
}) : r.openCursor(f);
|
|
2692
|
-
function
|
|
2692
|
+
function b(A) {
|
|
2693
2693
|
return Object.create(A, { continue: { value: function(P) {
|
|
2694
2694
|
P != null ? A.continue(Xt(P, f.reverse ? e.MAX_KEY : e.MIN_KEY, m)) : f.unique ? A.continue(A.key.slice(0, S).concat(f.reverse ? e.MIN_KEY : e.MAX_KEY, m)) : A.continue();
|
|
2695
2695
|
} }, continuePrimaryKey: { value: function(P, D) {
|
|
@@ -2707,10 +2707,10 @@ function Ma() {
|
|
|
2707
2707
|
} });
|
|
2708
2708
|
} };
|
|
2709
2709
|
function Mn(e, n, r, a) {
|
|
2710
|
-
return r = r || {}, a = a || "",
|
|
2710
|
+
return r = r || {}, a = a || "", C(e).forEach(function(s) {
|
|
2711
2711
|
var i, u, d;
|
|
2712
2712
|
ie(n, s) ? (i = e[s], u = n[s], typeof i == "object" && typeof u == "object" && i && u ? (d = nn(i)) !== nn(u) ? r[a + s] = n[s] : d === "Object" ? Mn(i, u, r, a + s + ".") : i !== u && (r[a + s] = n[s]) : i !== u && (r[a + s] = n[s])) : r[a + s] = void 0;
|
|
2713
|
-
}),
|
|
2713
|
+
}), C(n).forEach(function(s) {
|
|
2714
2714
|
ie(e, s) || (r[a + s] = n[s]);
|
|
2715
2715
|
}), r;
|
|
2716
2716
|
}
|
|
@@ -2743,9 +2743,9 @@ function Ma() {
|
|
|
2743
2743
|
return i._promise("readwrite", function() {
|
|
2744
2744
|
return function f(O, m, E) {
|
|
2745
2745
|
return r.query({ trans: O, values: !1, query: { index: a, range: m }, limit: E }).then(function(S) {
|
|
2746
|
-
var
|
|
2747
|
-
return w({ type: "delete", keys:
|
|
2748
|
-
return 0 < A.numFailures ? Promise.reject(A.failures[0]) :
|
|
2746
|
+
var b = S.result;
|
|
2747
|
+
return w({ type: "delete", keys: b, trans: O }).then(function(A) {
|
|
2748
|
+
return 0 < A.numFailures ? Promise.reject(A.failures[0]) : b.length < E ? { failures: [], numFailures: 0, lastResult: void 0 } : f(O, l(l({}, m), { lower: b[b.length - 1], lowerOpen: !0 }), E);
|
|
2749
2749
|
});
|
|
2750
2750
|
});
|
|
2751
2751
|
}(s.trans, s.range, 1e4);
|
|
@@ -2753,21 +2753,21 @@ function Ma() {
|
|
|
2753
2753
|
}
|
|
2754
2754
|
return r.mutate(s);
|
|
2755
2755
|
function w(f) {
|
|
2756
|
-
var O, m, E, S = B.trans,
|
|
2757
|
-
if (!
|
|
2758
|
-
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys:
|
|
2759
|
-
var P =
|
|
2760
|
-
var N,
|
|
2761
|
-
return f.type === "delete" ? d.fire.call($, D, T, S) : f.type === "add" || T === void 0 ? (N = p.fire.call($, D, f.values[I], S), D == null && N != null && (f.keys[I] = D = N, a.outbound || ue(f.values[I], a.keyPath, D))) : (N = Mn(T, f.values[I]), (
|
|
2762
|
-
ie(R, x) ? R[x] =
|
|
2756
|
+
var O, m, E, S = B.trans, b = f.keys || Gn(a, f);
|
|
2757
|
+
if (!b) throw new Error("Keys missing");
|
|
2758
|
+
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: b }) : l({}, f)).type !== "delete" && (f.values = g([], f.values)), f.keys && (f.keys = g([], f.keys)), O = r, E = b, ((m = f).type === "add" ? Promise.resolve([]) : O.getMany({ trans: m.trans, keys: E, cache: "immutable" })).then(function(A) {
|
|
2759
|
+
var P = b.map(function(D, I) {
|
|
2760
|
+
var N, k, R, T = A[I], $ = { onerror: null, onsuccess: null };
|
|
2761
|
+
return f.type === "delete" ? d.fire.call($, D, T, S) : f.type === "add" || T === void 0 ? (N = p.fire.call($, D, f.values[I], S), D == null && N != null && (f.keys[I] = D = N, a.outbound || ue(f.values[I], a.keyPath, D))) : (N = Mn(T, f.values[I]), (k = y.fire.call($, N, D, T, S)) && (R = f.values[I], Object.keys(k).forEach(function(x) {
|
|
2762
|
+
ie(R, x) ? R[x] = k[x] : ue(R, x, k[x]);
|
|
2763
2763
|
}))), $;
|
|
2764
2764
|
});
|
|
2765
2765
|
return r.mutate(f).then(function(D) {
|
|
2766
|
-
for (var I = D.failures, N = D.results,
|
|
2767
|
-
var T = (N ||
|
|
2766
|
+
for (var I = D.failures, N = D.results, k = D.numFailures, D = D.lastResult, R = 0; R < b.length; ++R) {
|
|
2767
|
+
var T = (N || b)[R], $ = P[R];
|
|
2768
2768
|
T == null ? $.onerror && $.onerror(I[R]) : $.onsuccess && $.onsuccess(f.type === "put" && A[R] ? f.values[R] : T);
|
|
2769
2769
|
}
|
|
2770
|
-
return { failures: I, results: N, numFailures:
|
|
2770
|
+
return { failures: I, results: N, numFailures: k, lastResult: D };
|
|
2771
2771
|
}).catch(function(D) {
|
|
2772
2772
|
return P.forEach(function(I) {
|
|
2773
2773
|
return I.onerror && I.onerror(D);
|
|
@@ -2793,7 +2793,7 @@ function Ma() {
|
|
|
2793
2793
|
return l(l({}, r), { getMany: function(a) {
|
|
2794
2794
|
if (!a.cache) return r.getMany(a);
|
|
2795
2795
|
var s = Ar(a.keys, a.trans._cache, a.cache === "clone");
|
|
2796
|
-
return s ?
|
|
2796
|
+
return s ? M.resolve(s) : r.getMany(a).then(function(i) {
|
|
2797
2797
|
return a.trans._cache = { keys: a.keys, values: a.cache === "clone" ? $e(i) : i }, i;
|
|
2798
2798
|
});
|
|
2799
2799
|
}, mutate: function(a) {
|
|
@@ -2827,33 +2827,33 @@ function Ma() {
|
|
|
2827
2827
|
function E(x) {
|
|
2828
2828
|
return x = "idb://".concat(n, "/").concat(a, "/").concat(x), D[x] || (D[x] = new ae());
|
|
2829
2829
|
}
|
|
2830
|
-
var S,
|
|
2830
|
+
var S, b, A, P = m.trans, D = m.mutatedParts || (m.mutatedParts = {}), I = E(""), N = E(":dels"), k = m.type, $ = m.type === "deleteRange" ? [m.range] : m.type === "delete" ? [m.keys] : m.values.length < 50 ? [Gn(u, m).filter(function(x) {
|
|
2831
2831
|
return x;
|
|
2832
2832
|
}), m.values] : [], R = $[0], T = $[1], $ = m.trans._cache;
|
|
2833
|
-
return
|
|
2834
|
-
var
|
|
2833
|
+
return j(R) ? (I.addKeys(R), ($ = k === "delete" || R.length === T.length ? Ar(R, $) : null) || N.addKeys(R), ($ || T) && (S = E, b = $, A = T, i.indexes.forEach(function(x) {
|
|
2834
|
+
var G = S(x.name || "");
|
|
2835
2835
|
function F(z) {
|
|
2836
2836
|
return z != null ? x.extractKey(z) : null;
|
|
2837
2837
|
}
|
|
2838
2838
|
function U(z) {
|
|
2839
|
-
return x.multiEntry &&
|
|
2840
|
-
return
|
|
2841
|
-
}) :
|
|
2839
|
+
return x.multiEntry && j(z) ? z.forEach(function(de) {
|
|
2840
|
+
return G.addKey(de);
|
|
2841
|
+
}) : G.addKey(z);
|
|
2842
2842
|
}
|
|
2843
|
-
(
|
|
2844
|
-
var W =
|
|
2843
|
+
(b || A).forEach(function(z, se) {
|
|
2844
|
+
var W = b && F(b[se]), se = A && F(A[se]);
|
|
2845
2845
|
H(W, se) !== 0 && (W != null && U(W), se != null && U(se));
|
|
2846
2846
|
});
|
|
2847
2847
|
}))) : R ? (T = { from: (T = R.lower) !== null && T !== void 0 ? T : e.MIN_KEY, to: (T = R.upper) !== null && T !== void 0 ? T : e.MAX_KEY }, N.add(T), I.add(T)) : (I.add(r), N.add(r), i.indexes.forEach(function(x) {
|
|
2848
2848
|
return E(x.name).add(r);
|
|
2849
2849
|
})), s.mutate(m).then(function(x) {
|
|
2850
|
-
return !R || m.type !== "add" && m.type !== "put" || (I.addKeys(x.results), y && y.forEach(function(
|
|
2850
|
+
return !R || m.type !== "add" && m.type !== "put" || (I.addKeys(x.results), y && y.forEach(function(G) {
|
|
2851
2851
|
for (var F = m.values.map(function(W) {
|
|
2852
|
-
return
|
|
2853
|
-
}), U =
|
|
2852
|
+
return G.extractKey(W);
|
|
2853
|
+
}), U = G.keyPath.findIndex(function(W) {
|
|
2854
2854
|
return W === u.keyPath;
|
|
2855
2855
|
}), z = 0, de = x.results.length; z < de; ++z) F[z][U] = x.results[z];
|
|
2856
|
-
E(
|
|
2856
|
+
E(G.name).addKeys(F);
|
|
2857
2857
|
})), P.mutatedParts = Yt(P.mutatedParts || {}, D), x;
|
|
2858
2858
|
});
|
|
2859
2859
|
} }), f = function(E) {
|
|
@@ -2864,14 +2864,14 @@ function Ma() {
|
|
|
2864
2864
|
}, getMany: function(m) {
|
|
2865
2865
|
return [u, new ae().addKeys(m.keys)];
|
|
2866
2866
|
}, count: f, query: f, openCursor: f };
|
|
2867
|
-
return
|
|
2867
|
+
return C(O).forEach(function(m) {
|
|
2868
2868
|
w[m] = function(E) {
|
|
2869
|
-
var S = B.subscr,
|
|
2870
|
-
if (
|
|
2869
|
+
var S = B.subscr, b = !!S, A = Pr(B, s) && Dr(m, E) ? E.obsSet = {} : S;
|
|
2870
|
+
if (b) {
|
|
2871
2871
|
var P = function(T) {
|
|
2872
2872
|
return T = "idb://".concat(n, "/").concat(a, "/").concat(T), A[T] || (A[T] = new ae());
|
|
2873
|
-
}, D = P(""), I = P(":dels"), S = O[m](E),
|
|
2874
|
-
if ((m === "query" &&
|
|
2873
|
+
}, D = P(""), I = P(":dels"), S = O[m](E), b = S[0], S = S[1];
|
|
2874
|
+
if ((m === "query" && b.isPrimaryKey && !E.values ? I : P(b.name || "")).add(S), !b.isPrimaryKey) {
|
|
2875
2875
|
if (m !== "count") {
|
|
2876
2876
|
var N = m === "query" && p && E.values && s.query(l(l({}, E), { values: !1 }));
|
|
2877
2877
|
return s[m].apply(this, arguments).then(function(T) {
|
|
@@ -2882,14 +2882,14 @@ function Ma() {
|
|
|
2882
2882
|
var $ = E.values ? T.result.map(d) : T.result;
|
|
2883
2883
|
(E.values ? D : I).addKeys($);
|
|
2884
2884
|
} else if (m === "openCursor") {
|
|
2885
|
-
var x = T,
|
|
2885
|
+
var x = T, G = E.values;
|
|
2886
2886
|
return x && Object.create(x, { key: { get: function() {
|
|
2887
2887
|
return I.addKey(x.primaryKey), x.key;
|
|
2888
2888
|
} }, primaryKey: { get: function() {
|
|
2889
2889
|
var F = x.primaryKey;
|
|
2890
2890
|
return I.addKey(F), F;
|
|
2891
2891
|
} }, value: { get: function() {
|
|
2892
|
-
return
|
|
2892
|
+
return G && D.addKey(x.primaryKey), x.value;
|
|
2893
2893
|
} } });
|
|
2894
2894
|
}
|
|
2895
2895
|
return T;
|
|
@@ -2907,9 +2907,9 @@ function Ma() {
|
|
|
2907
2907
|
if (r.numFailures === 0) return n;
|
|
2908
2908
|
if (n.type === "deleteRange") return null;
|
|
2909
2909
|
var a = n.keys ? n.keys.length : "values" in n && n.values ? n.values.length : 1;
|
|
2910
|
-
return r.numFailures === a ? null : (n = l({}, n),
|
|
2910
|
+
return r.numFailures === a ? null : (n = l({}, n), j(n.keys) && (n.keys = n.keys.filter(function(s, i) {
|
|
2911
2911
|
return !(i in r.failures);
|
|
2912
|
-
})), "values" in n &&
|
|
2912
|
+
})), "values" in n && j(n.values) && (n.values = n.values.filter(function(s, i) {
|
|
2913
2913
|
return !(i in r.failures);
|
|
2914
2914
|
})), n);
|
|
2915
2915
|
}
|
|
@@ -2920,45 +2920,45 @@ function Ma() {
|
|
|
2920
2920
|
function Nr(e, n, O, a, s, i) {
|
|
2921
2921
|
if (!O || O.length === 0) return e;
|
|
2922
2922
|
var u = n.query.index, d = u.multiEntry, p = n.query.range, y = a.schema.primaryKey.extractKey, w = u.extractKey, f = (u.lowLevelIndex || u).extractKey, O = O.reduce(function(m, E) {
|
|
2923
|
-
var S = m,
|
|
2923
|
+
var S = m, b = [];
|
|
2924
2924
|
if (E.type === "add" || E.type === "put") for (var A = new ae(), P = E.values.length - 1; 0 <= P; --P) {
|
|
2925
2925
|
var D, I = E.values[P], N = y(I);
|
|
2926
|
-
A.hasKey(N) || (D = w(I), (d &&
|
|
2926
|
+
A.hasKey(N) || (D = w(I), (d && j(D) ? D.some(function(x) {
|
|
2927
2927
|
return Kn(x, p);
|
|
2928
|
-
}) : Kn(D, p)) && (A.addKey(N),
|
|
2928
|
+
}) : Kn(D, p)) && (A.addKey(N), b.push(I)));
|
|
2929
2929
|
}
|
|
2930
2930
|
switch (E.type) {
|
|
2931
2931
|
case "add":
|
|
2932
|
-
var
|
|
2933
|
-
return y(
|
|
2934
|
-
}) : m), S = m.concat(n.values ?
|
|
2935
|
-
return
|
|
2936
|
-
}) :
|
|
2937
|
-
return y(
|
|
2938
|
-
}).filter(function(
|
|
2939
|
-
return !
|
|
2932
|
+
var k = new ae().addKeys(n.values ? m.map(function(G) {
|
|
2933
|
+
return y(G);
|
|
2934
|
+
}) : m), S = m.concat(n.values ? b.filter(function(G) {
|
|
2935
|
+
return G = y(G), !k.hasKey(G) && (k.addKey(G), !0);
|
|
2936
|
+
}) : b.map(function(G) {
|
|
2937
|
+
return y(G);
|
|
2938
|
+
}).filter(function(G) {
|
|
2939
|
+
return !k.hasKey(G) && (k.addKey(G), !0);
|
|
2940
2940
|
}));
|
|
2941
2941
|
break;
|
|
2942
2942
|
case "put":
|
|
2943
|
-
var R = new ae().addKeys(E.values.map(function(
|
|
2944
|
-
return y(
|
|
2943
|
+
var R = new ae().addKeys(E.values.map(function(G) {
|
|
2944
|
+
return y(G);
|
|
2945
2945
|
}));
|
|
2946
|
-
S = m.filter(function(
|
|
2947
|
-
return !R.hasKey(n.values ? y(
|
|
2948
|
-
}).concat(n.values ?
|
|
2949
|
-
return y(
|
|
2946
|
+
S = m.filter(function(G) {
|
|
2947
|
+
return !R.hasKey(n.values ? y(G) : G);
|
|
2948
|
+
}).concat(n.values ? b : b.map(function(G) {
|
|
2949
|
+
return y(G);
|
|
2950
2950
|
}));
|
|
2951
2951
|
break;
|
|
2952
2952
|
case "delete":
|
|
2953
2953
|
var T = new ae().addKeys(E.keys);
|
|
2954
|
-
S = m.filter(function(
|
|
2955
|
-
return !T.hasKey(n.values ? y(
|
|
2954
|
+
S = m.filter(function(G) {
|
|
2955
|
+
return !T.hasKey(n.values ? y(G) : G);
|
|
2956
2956
|
});
|
|
2957
2957
|
break;
|
|
2958
2958
|
case "deleteRange":
|
|
2959
2959
|
var $ = E.range;
|
|
2960
|
-
S = m.filter(function(
|
|
2961
|
-
return !Kn(y(
|
|
2960
|
+
S = m.filter(function(G) {
|
|
2961
|
+
return !Kn(y(G), $);
|
|
2962
2962
|
});
|
|
2963
2963
|
}
|
|
2964
2964
|
return S;
|
|
@@ -3009,26 +3009,26 @@ function Ma() {
|
|
|
3009
3009
|
for (var y = /* @__PURE__ */ new Set(), w = 0, f = r; w < f.length; w++) {
|
|
3010
3010
|
var O = f[w], m = ze["idb://".concat(n, "/").concat(O)];
|
|
3011
3011
|
if (m) {
|
|
3012
|
-
var E = e.table(O), S = m.optimisticOps.filter(function(
|
|
3013
|
-
return
|
|
3012
|
+
var E = e.table(O), S = m.optimisticOps.filter(function(G) {
|
|
3013
|
+
return G.trans === d;
|
|
3014
3014
|
});
|
|
3015
|
-
if (d._explicit && p && d.mutatedParts) for (var
|
|
3016
|
-
return y.add(
|
|
3015
|
+
if (d._explicit && p && d.mutatedParts) for (var b = 0, A = Object.values(m.queries.query); b < A.length; b++) for (var P = 0, D = (k = A[b]).slice(); P < D.length; P++) xn((R = D[P]).obsSet, d.mutatedParts) && (je(k, R), R.subscribers.forEach(function(G) {
|
|
3016
|
+
return y.add(G);
|
|
3017
3017
|
}));
|
|
3018
3018
|
else if (0 < S.length) {
|
|
3019
|
-
m.optimisticOps = m.optimisticOps.filter(function(
|
|
3020
|
-
return
|
|
3019
|
+
m.optimisticOps = m.optimisticOps.filter(function(G) {
|
|
3020
|
+
return G.trans !== d;
|
|
3021
3021
|
});
|
|
3022
|
-
for (var I = 0, N = Object.values(m.queries.query); I < N.length; I++) for (var
|
|
3023
|
-
return y.add(
|
|
3024
|
-
})) : T !== R.res && (R.res = T, R.promise =
|
|
3025
|
-
return y.add(
|
|
3022
|
+
for (var I = 0, N = Object.values(m.queries.query); I < N.length; I++) for (var k, R, T, $ = 0, x = (k = N[I]).slice(); $ < x.length; $++) (R = x[$]).res != null && d.mutatedParts && (p && !R.dirty ? (T = Object.isFrozen(R.res), T = Nr(R.res, R.req, S, E, R, T), R.dirty ? (je(k, R), R.subscribers.forEach(function(G) {
|
|
3023
|
+
return y.add(G);
|
|
3024
|
+
})) : T !== R.res && (R.res = T, R.promise = M.resolve({ result: T }))) : (R.dirty && je(k, R), R.subscribers.forEach(function(G) {
|
|
3025
|
+
return y.add(G);
|
|
3026
3026
|
})));
|
|
3027
3027
|
}
|
|
3028
3028
|
}
|
|
3029
3029
|
}
|
|
3030
|
-
y.forEach(function(
|
|
3031
|
-
return
|
|
3030
|
+
y.forEach(function(G) {
|
|
3031
|
+
return G();
|
|
3032
3032
|
});
|
|
3033
3033
|
}
|
|
3034
3034
|
};
|
|
@@ -3056,13 +3056,13 @@ function Ma() {
|
|
|
3056
3056
|
}), u) : a.mutate(i);
|
|
3057
3057
|
}, query: function(i) {
|
|
3058
3058
|
if (!Pr(B, a) || !Dr("query", i)) return a.query(i);
|
|
3059
|
-
var u = ((y = B.trans) === null || y === void 0 ? void 0 : y.db._options.cache) === "immutable", f = B, d = f.requery, p = f.signal, y = function(E, S,
|
|
3059
|
+
var u = ((y = B.trans) === null || y === void 0 ? void 0 : y.db._options.cache) === "immutable", f = B, d = f.requery, p = f.signal, y = function(E, S, b, A) {
|
|
3060
3060
|
var P = ze["idb://".concat(E, "/").concat(S)];
|
|
3061
3061
|
if (!P) return [];
|
|
3062
|
-
if (!(S = P.queries[
|
|
3062
|
+
if (!(S = P.queries[b])) return [null, !1, P, null];
|
|
3063
3063
|
var D = S[(A.query ? A.query.index.name : null) || ""];
|
|
3064
3064
|
if (!D) return [null, !1, P, null];
|
|
3065
|
-
switch (
|
|
3065
|
+
switch (b) {
|
|
3066
3066
|
case "query":
|
|
3067
3067
|
var I = D.find(function(N) {
|
|
3068
3068
|
return N.req.limit === A.limit && N.req.values === A.values && Rr(N.req.query.range, A.query.range);
|
|
@@ -3079,7 +3079,7 @@ function Ma() {
|
|
|
3079
3079
|
return w && f ? w.obsSet = i.obsSet : (f = a.query(i).then(function(E) {
|
|
3080
3080
|
var S = E.result;
|
|
3081
3081
|
if (w && (w.res = S), u) {
|
|
3082
|
-
for (var
|
|
3082
|
+
for (var b = 0, A = S.length; b < A; ++b) Object.freeze(S[b]);
|
|
3083
3083
|
Object.freeze(S);
|
|
3084
3084
|
} else E.result = $e(S);
|
|
3085
3085
|
return E;
|
|
@@ -3106,7 +3106,7 @@ function Ma() {
|
|
|
3106
3106
|
return r || (r = new this.Version(e), n.push(r), n.sort(ha), r.stores({}), this._state.autoSchema = !1, r);
|
|
3107
3107
|
}, ee.prototype._whenReady = function(e) {
|
|
3108
3108
|
var n = this;
|
|
3109
|
-
return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new
|
|
3109
|
+
return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new M(function(r, a) {
|
|
3110
3110
|
if (n._state.openComplete) return a(new L.DatabaseClosed(n._state.dbOpenError));
|
|
3111
3111
|
if (!n._state.isBeingOpened) {
|
|
3112
3112
|
if (!n._state.autoOpen) return void a(new L.DatabaseClosed());
|
|
@@ -3138,9 +3138,9 @@ function Ma() {
|
|
|
3138
3138
|
}
|
|
3139
3139
|
this.idbdb = null;
|
|
3140
3140
|
}
|
|
3141
|
-
e.isBeingOpened || (e.dbReadyPromise = new
|
|
3141
|
+
e.isBeingOpened || (e.dbReadyPromise = new M(function(r) {
|
|
3142
3142
|
e.dbReadyResolve = r;
|
|
3143
|
-
}), e.openCanceller = new
|
|
3143
|
+
}), e.openCanceller = new M(function(r, a) {
|
|
3144
3144
|
e.cancelOpen = a;
|
|
3145
3145
|
}));
|
|
3146
3146
|
}, ee.prototype.close = function(r) {
|
|
@@ -3150,7 +3150,7 @@ function Ma() {
|
|
|
3150
3150
|
var n = this;
|
|
3151
3151
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
3152
3152
|
var r = 0 < arguments.length && typeof arguments[0] != "object", a = this._state;
|
|
3153
|
-
return new
|
|
3153
|
+
return new M(function(s, i) {
|
|
3154
3154
|
function u() {
|
|
3155
3155
|
n.close(e);
|
|
3156
3156
|
var d = n._deps.indexedDB.deleteDatabase(n.name);
|
|
@@ -3175,7 +3175,7 @@ function Ma() {
|
|
|
3175
3175
|
return this._state.autoSchema;
|
|
3176
3176
|
}, Object.defineProperty(ee.prototype, "tables", { get: function() {
|
|
3177
3177
|
var e = this;
|
|
3178
|
-
return
|
|
3178
|
+
return C(this._allTables).map(function(n) {
|
|
3179
3179
|
return e._allTables[n];
|
|
3180
3180
|
});
|
|
3181
3181
|
}, enumerable: !1, configurable: !0 }), ee.prototype.transaction = function() {
|
|
@@ -3218,30 +3218,30 @@ function Ma() {
|
|
|
3218
3218
|
}) : q(y);
|
|
3219
3219
|
}
|
|
3220
3220
|
var p = function y(w, f, O, m, E) {
|
|
3221
|
-
return
|
|
3222
|
-
var S = B.transless || B,
|
|
3223
|
-
if (
|
|
3221
|
+
return M.resolve().then(function() {
|
|
3222
|
+
var S = B.transless || B, b = w._createTransaction(f, O, w._dbSchema, m);
|
|
3223
|
+
if (b.explicit = !0, S = { trans: b, transless: S }, m) b.idbtrans = m.idbtrans;
|
|
3224
3224
|
else try {
|
|
3225
|
-
|
|
3225
|
+
b.create(), b.idbtrans._explicit = !0, w._state.PR1398_maxLoop = 3;
|
|
3226
3226
|
} catch (D) {
|
|
3227
3227
|
return D.name === sn.InvalidState && w.isOpen() && 0 < --w._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), w.close({ disableAutoOpen: !1 }), w.open().then(function() {
|
|
3228
3228
|
return y(w, f, O, null, E);
|
|
3229
3229
|
})) : q(D);
|
|
3230
3230
|
}
|
|
3231
3231
|
var A, P = an(E);
|
|
3232
|
-
return P && et(), S =
|
|
3232
|
+
return P && et(), S = M.follow(function() {
|
|
3233
3233
|
var D;
|
|
3234
|
-
(A = E.call(
|
|
3235
|
-
}, S), (A && typeof A.then == "function" ?
|
|
3236
|
-
return
|
|
3234
|
+
(A = E.call(b, b)) && (P ? (D = Ie.bind(null, null), A.then(D, D)) : typeof A.next == "function" && typeof A.throw == "function" && (A = jn(A)));
|
|
3235
|
+
}, S), (A && typeof A.then == "function" ? M.resolve(A).then(function(D) {
|
|
3236
|
+
return b.active ? D : q(new L.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3237
3237
|
}) : S.then(function() {
|
|
3238
3238
|
return A;
|
|
3239
3239
|
})).then(function(D) {
|
|
3240
|
-
return m &&
|
|
3240
|
+
return m && b._resolve(), b._completion.then(function() {
|
|
3241
3241
|
return D;
|
|
3242
3242
|
});
|
|
3243
3243
|
}).catch(function(D) {
|
|
3244
|
-
return
|
|
3244
|
+
return b._reject(D), q(D);
|
|
3245
3245
|
});
|
|
3246
3246
|
});
|
|
3247
3247
|
}.bind(null, this, i, u, s, r);
|
|
@@ -3258,40 +3258,40 @@ function Ma() {
|
|
|
3258
3258
|
var a = ee.dependencies;
|
|
3259
3259
|
this._options = n = l({ addons: ee.addons, autoOpen: !0, indexedDB: a.indexedDB, IDBKeyRange: a.IDBKeyRange, cache: "cloned" }, n), this._deps = { indexedDB: n.indexedDB, IDBKeyRange: n.IDBKeyRange }, a = n.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3260
3260
|
var s, i, u, d, p, y = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Q, dbReadyPromise: null, cancelOpen: Q, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: n.autoOpen };
|
|
3261
|
-
y.dbReadyPromise = new
|
|
3261
|
+
y.dbReadyPromise = new M(function(f) {
|
|
3262
3262
|
y.dbReadyResolve = f;
|
|
3263
|
-
}), y.openCanceller = new
|
|
3263
|
+
}), y.openCanceller = new M(function(f, O) {
|
|
3264
3264
|
y.cancelOpen = O;
|
|
3265
3265
|
}), this._state = y, this.name = e, this.on = ht(this, "populate", "blocked", "versionchange", "close", { ready: [on, Q] }), this.on.ready.subscribe = Vn(this.on.ready.subscribe, function(f) {
|
|
3266
3266
|
return function(O, m) {
|
|
3267
3267
|
ee.vip(function() {
|
|
3268
3268
|
var E, S = r._state;
|
|
3269
|
-
S.openComplete ? (S.dbOpenError ||
|
|
3270
|
-
E.on.ready.unsubscribe(O), E.on.ready.unsubscribe(
|
|
3269
|
+
S.openComplete ? (S.dbOpenError || M.resolve().then(O), m && f(O)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(O), m && f(O)) : (f(O), E = r, m || f(function b() {
|
|
3270
|
+
E.on.ready.unsubscribe(O), E.on.ready.unsubscribe(b);
|
|
3271
3271
|
}));
|
|
3272
3272
|
});
|
|
3273
3273
|
};
|
|
3274
|
-
}), this.Collection = (s = this, gt(oa.prototype, function(A,
|
|
3274
|
+
}), this.Collection = (s = this, gt(oa.prototype, function(A, b) {
|
|
3275
3275
|
this.db = s;
|
|
3276
3276
|
var m = ir, E = null;
|
|
3277
|
-
if (
|
|
3278
|
-
m =
|
|
3277
|
+
if (b) try {
|
|
3278
|
+
m = b();
|
|
3279
3279
|
} catch (P) {
|
|
3280
3280
|
E = P;
|
|
3281
3281
|
}
|
|
3282
|
-
var S = A._ctx,
|
|
3283
|
-
this._ctx = { table:
|
|
3282
|
+
var S = A._ctx, b = S.table, A = b.hook.reading.fire;
|
|
3283
|
+
this._ctx = { table: b, index: S.index, isPrimKey: !S.index || b.schema.primKey.keyPath && S.index === b.schema.primKey.name, range: m, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: E, or: S.or, valueMapper: A !== ct ? A : null };
|
|
3284
3284
|
})), this.Table = (i = this, gt(dr.prototype, function(f, O, m) {
|
|
3285
3285
|
this.db = i, this._tx = m, this.name = f, this.schema = O, this.hook = i._allTables[f] ? i._allTables[f].hook : ht(null, { creating: [Jr, Q], reading: [Xr, ct], updating: [qr, Q], deleting: [Zr, Q] });
|
|
3286
3286
|
})), this.Transaction = (u = this, gt(ua.prototype, function(f, O, m, E, S) {
|
|
3287
|
-
var
|
|
3288
|
-
this.db = u, this.mode = f, this.storeNames = O, this.schema = m, this.chromeTransactionDurability = E, this.idbtrans = null, this.on = ht(this, "complete", "error", "abort"), this.parent = S || 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
|
|
3289
|
-
|
|
3287
|
+
var b = this;
|
|
3288
|
+
this.db = u, this.mode = f, this.storeNames = O, this.schema = m, this.chromeTransactionDurability = E, this.idbtrans = null, this.on = ht(this, "complete", "error", "abort"), this.parent = S || 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 M(function(A, P) {
|
|
3289
|
+
b._resolve = A, b._reject = P;
|
|
3290
3290
|
}), this._completion.then(function() {
|
|
3291
|
-
|
|
3291
|
+
b.active = !1, b.on.complete.fire();
|
|
3292
3292
|
}, function(A) {
|
|
3293
|
-
var P =
|
|
3294
|
-
return
|
|
3293
|
+
var P = b.active;
|
|
3294
|
+
return b.active = !1, b.on.error.fire(A), b.parent ? b.parent._reject(A) : P && b.idbtrans && b.idbtrans.abort(), q(A);
|
|
3295
3295
|
});
|
|
3296
3296
|
})), this.Version = (d = this, gt(ma.prototype, function(f) {
|
|
3297
3297
|
this.db = d, this._cfg = { version: f, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
@@ -3341,7 +3341,7 @@ function Ma() {
|
|
|
3341
3341
|
this._subscribe = e;
|
|
3342
3342
|
}
|
|
3343
3343
|
try {
|
|
3344
|
-
Zt = { indexedDB:
|
|
3344
|
+
Zt = { indexedDB: v.indexedDB || v.mozIndexedDB || v.webkitIndexedDB || v.msIndexedDB, IDBKeyRange: v.IDBKeyRange || v.webkitIDBKeyRange };
|
|
3345
3345
|
} catch {
|
|
3346
3346
|
Zt = { indexedDB: null, IDBKeyRange: null };
|
|
3347
3347
|
}
|
|
@@ -3358,7 +3358,7 @@ function Ma() {
|
|
|
3358
3358
|
}, m = function(S) {
|
|
3359
3359
|
Yt(p, S), xn(y, p) && O();
|
|
3360
3360
|
}, E = function() {
|
|
3361
|
-
var S,
|
|
3361
|
+
var S, b, A;
|
|
3362
3362
|
!d && Zt.indexedDB && (p = {}, S = {}, u && u.abort(), u = new AbortController(), A = function(P) {
|
|
3363
3363
|
var D = Ze();
|
|
3364
3364
|
try {
|
|
@@ -3368,8 +3368,8 @@ function Ma() {
|
|
|
3368
3368
|
} finally {
|
|
3369
3369
|
D && qe();
|
|
3370
3370
|
}
|
|
3371
|
-
}(
|
|
3372
|
-
r = !0, n = P, d ||
|
|
3371
|
+
}(b = { subscr: S, signal: u.signal, requery: O, querier: e, trans: null }), Promise.resolve(A).then(function(P) {
|
|
3372
|
+
r = !0, n = P, d || b.signal.aborted || (p = {}, function(D) {
|
|
3373
3373
|
for (var I in D) if (ie(D, I)) return;
|
|
3374
3374
|
return 1;
|
|
3375
3375
|
}(y = S) || f || (Te(yt, m), f = !0), pn(function() {
|
|
@@ -3429,7 +3429,7 @@ function Ma() {
|
|
|
3429
3429
|
return function() {
|
|
3430
3430
|
try {
|
|
3431
3431
|
var n = jn(e.apply(this, arguments));
|
|
3432
|
-
return n && typeof n.then == "function" ? n :
|
|
3432
|
+
return n && typeof n.then == "function" ? n : M.resolve(n);
|
|
3433
3433
|
} catch (r) {
|
|
3434
3434
|
return q(r);
|
|
3435
3435
|
}
|
|
@@ -3437,15 +3437,15 @@ function Ma() {
|
|
|
3437
3437
|
}, spawn: function(e, n, r) {
|
|
3438
3438
|
try {
|
|
3439
3439
|
var a = jn(e.apply(r, n || []));
|
|
3440
|
-
return a && typeof a.then == "function" ? a :
|
|
3440
|
+
return a && typeof a.then == "function" ? a : M.resolve(a);
|
|
3441
3441
|
} catch (s) {
|
|
3442
3442
|
return q(s);
|
|
3443
3443
|
}
|
|
3444
3444
|
}, currentTransaction: { get: function() {
|
|
3445
3445
|
return B.trans || null;
|
|
3446
3446
|
} }, waitFor: function(e, n) {
|
|
3447
|
-
return n =
|
|
3448
|
-
}, Promise:
|
|
3447
|
+
return n = M.resolve(typeof e == "function" ? He.ignoreTransaction(e) : e).timeout(n || 6e4), B.trans ? B.trans.waitFor(n) : n;
|
|
3448
|
+
}, Promise: M, debug: { get: function() {
|
|
3449
3449
|
return pe;
|
|
3450
3450
|
}, set: function(e) {
|
|
3451
3451
|
er(e);
|
|
@@ -3477,7 +3477,7 @@ function Ma() {
|
|
|
3477
3477
|
}
|
|
3478
3478
|
}), addEventListener("pageshow", function(e) {
|
|
3479
3479
|
!Se.disableBfCache && e.persisted && (pe && console.debug("Dexie: handling persisted pageshow"), xr(), Ln({ all: new ae(-1 / 0, [[]]) }));
|
|
3480
|
-
})),
|
|
3480
|
+
})), M.rejectionMapper = function(e, n) {
|
|
3481
3481
|
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !qn[e.name] ? e : (n = new qn[e.name](n || e.message, e), "stack" in e && Ae(n, "stack", { get: function() {
|
|
3482
3482
|
return this.inner.stack;
|
|
3483
3483
|
} }), n);
|
|
@@ -3521,7 +3521,7 @@ class Mr {
|
|
|
3521
3521
|
messages: "id,utc,expires",
|
|
3522
3522
|
monitor: "id,player_id,cols,rows,order,width,height,physicalwidth,physicalheight,devicePixelRatio,screenLeft,screenTop,orientation,monitor",
|
|
3523
3523
|
player: "id,title,name,location",
|
|
3524
|
-
preference: "id,value",
|
|
3524
|
+
preference: "id,value,update",
|
|
3525
3525
|
presentation: "id,name,update",
|
|
3526
3526
|
series: "id,dashboard_id",
|
|
3527
3527
|
slide: "id,name,presentation_id,order_index,json,html,update",
|
|
@@ -3536,7 +3536,7 @@ class Mr {
|
|
|
3536
3536
|
*/
|
|
3537
3537
|
getCloud = async (t) => {
|
|
3538
3538
|
if (t.widget === "")
|
|
3539
|
-
return
|
|
3539
|
+
return K(3, [
|
|
3540
3540
|
"%cget%c %cstorage%c %ccloud",
|
|
3541
3541
|
c.KO,
|
|
3542
3542
|
c.NONE,
|
|
@@ -3551,7 +3551,7 @@ class Mr {
|
|
|
3551
3551
|
query: t
|
|
3552
3552
|
};
|
|
3553
3553
|
const o = await this.db.table(_.CLOUD).where({ id: t.widget }).last().catch(() => {
|
|
3554
|
-
|
|
3554
|
+
K(2, ["%capi%C %ccloud", c.API, c.NONE, c.CLOUD, t.widget]);
|
|
3555
3555
|
});
|
|
3556
3556
|
if (typeof o > "u")
|
|
3557
3557
|
return { data: null, message: "Cloud Data error", success: !1, query: t };
|
|
@@ -3561,7 +3561,7 @@ class Mr {
|
|
|
3561
3561
|
success: o !== void 0,
|
|
3562
3562
|
query: t
|
|
3563
3563
|
};
|
|
3564
|
-
return
|
|
3564
|
+
return K(3, [
|
|
3565
3565
|
"%cget%c %cstorage%c %ccloud",
|
|
3566
3566
|
c.OK,
|
|
3567
3567
|
c.NONE,
|
|
@@ -3582,7 +3582,7 @@ class Mr {
|
|
|
3582
3582
|
dashboard_id: t.dashboard,
|
|
3583
3583
|
// data: data.data,
|
|
3584
3584
|
data: o
|
|
3585
|
-
}).then(() => 201).catch((l) => (
|
|
3585
|
+
}).then(() => 201).catch((l) => (K(2, [
|
|
3586
3586
|
"%cset%c %cstorage%c %ccloud",
|
|
3587
3587
|
c.KO,
|
|
3588
3588
|
c.NONE,
|
|
@@ -3594,7 +3594,7 @@ class Mr {
|
|
|
3594
3594
|
]), 400)) : 400;
|
|
3595
3595
|
getDashboard = async (t) => {
|
|
3596
3596
|
const o = await this.db.table(_.DASHBOARD).where({ id: t.id }).last().catch(() => {
|
|
3597
|
-
|
|
3597
|
+
K(2, ["%cstorage", c.STORAGE, X.DASHBOARD_LOAD, t.id]);
|
|
3598
3598
|
});
|
|
3599
3599
|
return o === void 0 ? {
|
|
3600
3600
|
data: null,
|
|
@@ -3603,10 +3603,10 @@ class Mr {
|
|
|
3603
3603
|
} : (o.message = `Dashboard ${t.id} retrieved from storage`, o.success = !0, o);
|
|
3604
3604
|
};
|
|
3605
3605
|
getDashboards = async (t) => {
|
|
3606
|
-
const o = (
|
|
3607
|
-
|
|
3606
|
+
const o = (v) => t?.id === v.id, l = (v) => t?.name ? v.name.includes(t?.name) : !1, g = await this.db.table(_.DASHBOARD).toArray().then((v) => t?.id ? v.filter(o) : v).then((v) => t?.name ? v.filter(l) : v).catch(() => {
|
|
3607
|
+
K(2, ["%cstorage", c.STORAGE, X.DASHBOARD_LOAD, t]);
|
|
3608
3608
|
});
|
|
3609
|
-
return g !== void 0 &&
|
|
3609
|
+
return g !== void 0 && K(3, [
|
|
3610
3610
|
"%cstorage%c %cdashboards",
|
|
3611
3611
|
c.STORAGE,
|
|
3612
3612
|
c.NONE,
|
|
@@ -3635,7 +3635,7 @@ class Mr {
|
|
|
3635
3635
|
data: null,
|
|
3636
3636
|
message: `Dashboard ${o.data.id} saved to storage`,
|
|
3637
3637
|
success: !0
|
|
3638
|
-
})).catch((l) => (
|
|
3638
|
+
})).catch((l) => (K(4, ["%cstorage", c.STORAGE, _.WIDGET, t, l.message]), {
|
|
3639
3639
|
data: null,
|
|
3640
3640
|
message: `Dashboard ${o.data.id} save error: ${l.message}`,
|
|
3641
3641
|
success: !1
|
|
@@ -3645,21 +3645,21 @@ class Mr {
|
|
|
3645
3645
|
* Wipe Message data after expires timestamp
|
|
3646
3646
|
*/
|
|
3647
3647
|
cleanMessages = async () => {
|
|
3648
|
-
const t = Date.now() / 1e3, o = (
|
|
3649
|
-
return await this.db.table(_.TOPICS).orderBy("expires").filter(o).delete().catch((
|
|
3648
|
+
const t = Date.now() / 1e3, o = (v) => v.expires < t, l = (v) => v.expires < t;
|
|
3649
|
+
return await this.db.table(_.TOPICS).orderBy("expires").filter(o).delete().catch((v) => (console.error(
|
|
3650
3650
|
"%cstorage%c %cclean",
|
|
3651
3651
|
c.STORAGE,
|
|
3652
3652
|
c.NONE,
|
|
3653
3653
|
c.MESSAGES,
|
|
3654
|
-
|
|
3655
|
-
), 0)), await this.db.table(_.MESSAGES).orderBy("expires").filter(l).delete().catch((
|
|
3654
|
+
v.message
|
|
3655
|
+
), 0)), await this.db.table(_.MESSAGES).orderBy("expires").filter(l).delete().catch((v) => (console.error(
|
|
3656
3656
|
"%clean%c %cstorage%c %cmessages",
|
|
3657
3657
|
c.OK,
|
|
3658
3658
|
c.NONE,
|
|
3659
3659
|
c.STORAGE,
|
|
3660
3660
|
c.NONE,
|
|
3661
3661
|
c.MESSAGES,
|
|
3662
|
-
|
|
3662
|
+
v.message
|
|
3663
3663
|
), 0));
|
|
3664
3664
|
};
|
|
3665
3665
|
/**
|
|
@@ -3669,7 +3669,7 @@ class Mr {
|
|
|
3669
3669
|
*/
|
|
3670
3670
|
getMessages = async (t) => {
|
|
3671
3671
|
if (t.widget === "")
|
|
3672
|
-
return
|
|
3672
|
+
return K(3, [
|
|
3673
3673
|
"%cget%c %cstorage%c %cmessages",
|
|
3674
3674
|
c.KO,
|
|
3675
3675
|
c.NONE,
|
|
@@ -3685,9 +3685,9 @@ class Mr {
|
|
|
3685
3685
|
};
|
|
3686
3686
|
const o = t?.order ?? "utc", l = Math.floor(Date.now() / 1e3);
|
|
3687
3687
|
o !== "utc" && (t.since = l - 60 * 60 * 24 * 30), this.options.delay != 0 ? t.before = l - (this.options.delay || 0) : t.before = l;
|
|
3688
|
-
const g = (
|
|
3688
|
+
const g = (j) => j.utc > (t?.since || 0), v = (j) => j.utc < (t?.before || l), C = (j) => j?.visible !== 0;
|
|
3689
3689
|
try {
|
|
3690
|
-
const te = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(
|
|
3690
|
+
const te = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(C).filter(g).filter(v).reverse().limit(t?.limit ?? 25).sortBy(o);
|
|
3691
3691
|
if (te.length === 0)
|
|
3692
3692
|
return {
|
|
3693
3693
|
data: null,
|
|
@@ -3705,7 +3705,7 @@ class Mr {
|
|
|
3705
3705
|
message: "Messages retrieved successfully",
|
|
3706
3706
|
success: !0
|
|
3707
3707
|
};
|
|
3708
|
-
return
|
|
3708
|
+
return K(3, [
|
|
3709
3709
|
"%cget%c %cstorage%c %cmessages",
|
|
3710
3710
|
c.OK,
|
|
3711
3711
|
c.NONE,
|
|
@@ -3715,8 +3715,8 @@ class Mr {
|
|
|
3715
3715
|
be
|
|
3716
3716
|
]), be;
|
|
3717
3717
|
});
|
|
3718
|
-
} catch (
|
|
3719
|
-
return
|
|
3718
|
+
} catch (j) {
|
|
3719
|
+
return K(2, [
|
|
3720
3720
|
"%cget%c %cstorage%c %cmessages",
|
|
3721
3721
|
c.OK,
|
|
3722
3722
|
c.NONE,
|
|
@@ -3724,7 +3724,7 @@ class Mr {
|
|
|
3724
3724
|
c.NONE,
|
|
3725
3725
|
c.NO_UPDATES,
|
|
3726
3726
|
t,
|
|
3727
|
-
|
|
3727
|
+
j.message
|
|
3728
3728
|
]), { data: null, message: "Messages Data error", success: !1 };
|
|
3729
3729
|
}
|
|
3730
3730
|
};
|
|
@@ -3750,62 +3750,62 @@ class Mr {
|
|
|
3750
3750
|
return 400;
|
|
3751
3751
|
const l = o.data.title;
|
|
3752
3752
|
let g = 0;
|
|
3753
|
-
return await o.data.messages.forEach(async (
|
|
3754
|
-
|
|
3755
|
-
message_id:
|
|
3756
|
-
engagement:
|
|
3757
|
-
impressions:
|
|
3758
|
-
reach:
|
|
3759
|
-
sentiment:
|
|
3753
|
+
return await o.data.messages.forEach(async (v) => {
|
|
3754
|
+
v.id !== null && (v.topics[0] = {
|
|
3755
|
+
message_id: v.id,
|
|
3756
|
+
engagement: v.topics[0]?.engagement || v.dynamics?.engagement || 0,
|
|
3757
|
+
impressions: v.topics[0]?.impressions || v.dynamics?.semrush_visits || 0,
|
|
3758
|
+
reach: v.topics[0]?.reach || v.dynamics?.potential_reach || 0,
|
|
3759
|
+
sentiment: v.topics[0]?.sentiment || 0
|
|
3760
3760
|
}, await this.db.table(_.MESSAGES).put({
|
|
3761
|
-
id:
|
|
3762
|
-
utc:
|
|
3763
|
-
data:
|
|
3764
|
-
expires:
|
|
3765
|
-
}).catch((
|
|
3766
|
-
g++,
|
|
3761
|
+
id: v.id,
|
|
3762
|
+
utc: v.utc,
|
|
3763
|
+
data: v,
|
|
3764
|
+
expires: v.expires
|
|
3765
|
+
}).catch((C) => {
|
|
3766
|
+
g++, K(4, [
|
|
3767
3767
|
"%cset%c %cstorage",
|
|
3768
3768
|
c.KO,
|
|
3769
3769
|
c.NONE,
|
|
3770
3770
|
c.STORAGE,
|
|
3771
3771
|
"set message",
|
|
3772
3772
|
`title: ${l}`,
|
|
3773
|
-
|
|
3774
|
-
|
|
3773
|
+
v,
|
|
3774
|
+
C.message
|
|
3775
3775
|
]);
|
|
3776
3776
|
}), await this.db.table(_.TOPICS).put({
|
|
3777
3777
|
title: l,
|
|
3778
3778
|
widget_id: t.widget,
|
|
3779
|
-
message_id:
|
|
3779
|
+
message_id: v.id,
|
|
3780
3780
|
dashboard_id: t.dashboard,
|
|
3781
|
-
engagement:
|
|
3782
|
-
impressions:
|
|
3783
|
-
reach:
|
|
3784
|
-
sentiment:
|
|
3785
|
-
utc:
|
|
3786
|
-
expires:
|
|
3787
|
-
}).catch((
|
|
3788
|
-
g++,
|
|
3781
|
+
engagement: v.topics[0]?.engagement || v.dynamics?.engagement || 0,
|
|
3782
|
+
impressions: v.topics[0]?.impressions || v.dynamics?.semrush_visits || 0,
|
|
3783
|
+
reach: v.topics[0]?.reach || v.dynamics?.potential_reach || 0,
|
|
3784
|
+
sentiment: v.topics[0]?.sentiment || 0,
|
|
3785
|
+
utc: v.utc,
|
|
3786
|
+
expires: v.expires
|
|
3787
|
+
}).catch((C) => {
|
|
3788
|
+
g++, K(4, [
|
|
3789
3789
|
"%cset%c %cstorage",
|
|
3790
3790
|
c.KO,
|
|
3791
3791
|
c.NONE,
|
|
3792
3792
|
c.STORAGE,
|
|
3793
3793
|
"set topic",
|
|
3794
3794
|
`title: ${l}`,
|
|
3795
|
-
|
|
3796
|
-
|
|
3795
|
+
v,
|
|
3796
|
+
C.message
|
|
3797
3797
|
]);
|
|
3798
|
-
}), await o.data.topics.forEach(async (
|
|
3799
|
-
const
|
|
3800
|
-
await this.db.table(_.TOPICS).where("message_id").equals(
|
|
3801
|
-
g++,
|
|
3798
|
+
}), await o.data.topics.forEach(async (C) => {
|
|
3799
|
+
const j = C.message_id, te = C.visible ? 1 : 0, ge = C.title;
|
|
3800
|
+
await this.db.table(_.TOPICS).where("message_id").equals(j).modify({ visible: te }).catch((Ce) => {
|
|
3801
|
+
g++, K(4, [
|
|
3802
3802
|
"%cset%c %cstorage",
|
|
3803
3803
|
c.KO,
|
|
3804
3804
|
c.NONE,
|
|
3805
3805
|
c.STORAGE,
|
|
3806
3806
|
"update message visibility",
|
|
3807
3807
|
`title: ${ge}`,
|
|
3808
|
-
`widget: ${
|
|
3808
|
+
`widget: ${C.widget_id}`,
|
|
3809
3809
|
Ce.message
|
|
3810
3810
|
]);
|
|
3811
3811
|
});
|
|
@@ -3819,7 +3819,7 @@ class Mr {
|
|
|
3819
3819
|
*/
|
|
3820
3820
|
getSeries = async (t) => {
|
|
3821
3821
|
if (t.widget === "")
|
|
3822
|
-
return
|
|
3822
|
+
return K(3, [
|
|
3823
3823
|
"%cget%c %cstorage%c %cseries",
|
|
3824
3824
|
c.KO,
|
|
3825
3825
|
c.NONE,
|
|
@@ -3834,7 +3834,7 @@ class Mr {
|
|
|
3834
3834
|
query: t
|
|
3835
3835
|
};
|
|
3836
3836
|
const o = await this.db.table(_.SERIES).where({ id: t.widget }).last().catch(() => {
|
|
3837
|
-
|
|
3837
|
+
K(2, [
|
|
3838
3838
|
"%cget%c %cstorage%c %cseries",
|
|
3839
3839
|
c.KO,
|
|
3840
3840
|
c.NONE,
|
|
@@ -3849,7 +3849,7 @@ class Mr {
|
|
|
3849
3849
|
success: o !== void 0,
|
|
3850
3850
|
query: t
|
|
3851
3851
|
};
|
|
3852
|
-
return
|
|
3852
|
+
return K(3, [
|
|
3853
3853
|
"%cget%c %cstorage%c %cseries",
|
|
3854
3854
|
c.OK,
|
|
3855
3855
|
c.NONE,
|
|
@@ -3870,7 +3870,7 @@ class Mr {
|
|
|
3870
3870
|
dashboard_id: t.dashboard,
|
|
3871
3871
|
// data: data.data,
|
|
3872
3872
|
data: o
|
|
3873
|
-
}).then(() => 201).catch((l) => (
|
|
3873
|
+
}).then(() => 201).catch((l) => (K(2, [
|
|
3874
3874
|
"%cset%c %cstorage%c %cseries",
|
|
3875
3875
|
c.KO,
|
|
3876
3876
|
c.NONE,
|
|
@@ -3887,7 +3887,7 @@ class Mr {
|
|
|
3887
3887
|
*/
|
|
3888
3888
|
getWidget = async (t) => {
|
|
3889
3889
|
if (t.id === "")
|
|
3890
|
-
return
|
|
3890
|
+
return K(3, [
|
|
3891
3891
|
"%cget%c %cstorage%c %cwidget",
|
|
3892
3892
|
c.KO,
|
|
3893
3893
|
c.NONE,
|
|
@@ -3916,10 +3916,10 @@ class Mr {
|
|
|
3916
3916
|
* @returns IResponse
|
|
3917
3917
|
*/
|
|
3918
3918
|
getWidgets = async (t) => {
|
|
3919
|
-
const o = (
|
|
3920
|
-
|
|
3919
|
+
const o = (C) => t?.dashboard === C.dashboard_id, l = (C) => t?.type === C.type, g = (C) => t?.name ? C.name.includes(t?.name) : !1, v = await this.db.table(_.WIDGET).toArray().then((C) => t?.dashboard ? C.filter(o) : C).then((C) => t?.type ? C.filter(l) : C).then((C) => t?.name ? C.filter(g) : C).catch(() => {
|
|
3920
|
+
K(2, ["%cstorage", c.STORAGE, X.WIDGET_LOAD, t]);
|
|
3921
3921
|
});
|
|
3922
|
-
return
|
|
3922
|
+
return v !== void 0 && K(3, [
|
|
3923
3923
|
"%cstorage%c %cwidgets",
|
|
3924
3924
|
c.STORAGE,
|
|
3925
3925
|
c.NONE,
|
|
@@ -3927,9 +3927,9 @@ class Mr {
|
|
|
3927
3927
|
t
|
|
3928
3928
|
]), {
|
|
3929
3929
|
// @ts-ignore
|
|
3930
|
-
data:
|
|
3931
|
-
message:
|
|
3932
|
-
success:
|
|
3930
|
+
data: v !== void 0 ? { data: v, query: t } : null,
|
|
3931
|
+
message: v !== void 0 ? "Widgets loaded from storage" : "Widgets load error",
|
|
3932
|
+
success: v !== void 0
|
|
3933
3933
|
};
|
|
3934
3934
|
};
|
|
3935
3935
|
/**
|
|
@@ -3991,7 +3991,7 @@ class Mr {
|
|
|
3991
3991
|
*/
|
|
3992
3992
|
getSlide = async (t) => {
|
|
3993
3993
|
const o = await this.db.table(_.SLIDE).where({ id: t.id }).last().catch(() => {
|
|
3994
|
-
|
|
3994
|
+
K(2, ["%cstorage", c.STORAGE, X.SLIDE_LOAD, t.id]);
|
|
3995
3995
|
});
|
|
3996
3996
|
return {
|
|
3997
3997
|
// @ts-ignore
|
|
@@ -4006,12 +4006,12 @@ class Mr {
|
|
|
4006
4006
|
* @returns IResponse
|
|
4007
4007
|
*/
|
|
4008
4008
|
getSlides = async (t) => {
|
|
4009
|
-
const o = (
|
|
4010
|
-
return
|
|
4009
|
+
const o = (j) => t?.id ? j.id = t.id : !1, l = (j) => t?.name ? j.name.includes(t?.name) : !1, g = (j) => t?.presentation_id ? j.presentation_id = t.presentation_id : !1, C = await this.db.table(_.SLIDE).toArray().then((j) => t?.presentation_id ? j.filter(g) : j).then((j) => t?.id ? j.filter(o) : j).then((j) => t?.name ? j.filter(l) : j);
|
|
4010
|
+
return C !== void 0 && K(3, ["%cstorage%c %cslides", c.STORAGE, c.NONE, c.SLIDE, t]), {
|
|
4011
4011
|
// @ts-ignore
|
|
4012
|
-
data:
|
|
4013
|
-
message:
|
|
4014
|
-
success:
|
|
4012
|
+
data: C !== void 0 ? { slides: C, query: t } : null,
|
|
4013
|
+
message: C !== void 0 ? "Slides loaded from storage" : "Slides load error",
|
|
4014
|
+
success: C !== void 0
|
|
4015
4015
|
};
|
|
4016
4016
|
};
|
|
4017
4017
|
/**
|
|
@@ -4068,8 +4068,8 @@ class Mr {
|
|
|
4068
4068
|
* @returns IResponse
|
|
4069
4069
|
*/
|
|
4070
4070
|
getPresentations = async (t) => {
|
|
4071
|
-
const o = (
|
|
4072
|
-
return g !== void 0 &&
|
|
4071
|
+
const o = (v) => t?.name ? v.name.includes(t?.name) : !1, g = await this.db.table(_.PRESENTATION).toArray().then((v) => t?.name ? v.filter(o) : v);
|
|
4072
|
+
return g !== void 0 && K(3, [
|
|
4073
4073
|
"%cstorage%c %cpresentations",
|
|
4074
4074
|
c.STORAGE,
|
|
4075
4075
|
c.NONE,
|
|
@@ -4114,7 +4114,7 @@ class Mr {
|
|
|
4114
4114
|
*/
|
|
4115
4115
|
getPreference = async (t) => {
|
|
4116
4116
|
const o = await this.db.table(_.PREFERENCE).where({ id: t.id }).last().catch(() => {
|
|
4117
|
-
|
|
4117
|
+
K(2, [
|
|
4118
4118
|
"%cstorage",
|
|
4119
4119
|
c.STORAGE,
|
|
4120
4120
|
X.PREFERENCE_LOAD,
|
|
@@ -4136,8 +4136,8 @@ class Mr {
|
|
|
4136
4136
|
* @returns IResponse
|
|
4137
4137
|
*/
|
|
4138
4138
|
getPreferences = async (t) => {
|
|
4139
|
-
const o = (
|
|
4140
|
-
return g !== void 0 &&
|
|
4139
|
+
const o = (v) => t?.id ? t.id = v.id : !1, g = await this.db.table(_.SLIDE).toArray().then((v) => t?.id ? v.filter(o) : v);
|
|
4140
|
+
return g !== void 0 && K(3, [
|
|
4141
4141
|
"%cstorage%c %cpreferences",
|
|
4142
4142
|
c.STORAGE,
|
|
4143
4143
|
c.NONE,
|
|
@@ -4157,7 +4157,8 @@ class Mr {
|
|
|
4157
4157
|
*/
|
|
4158
4158
|
setPreference = async (t) => await this.db.table(_.PREFERENCE).put({
|
|
4159
4159
|
id: t.id,
|
|
4160
|
-
value: t.value
|
|
4160
|
+
value: t.value,
|
|
4161
|
+
update: t.update
|
|
4161
4162
|
}).then(() => ({
|
|
4162
4163
|
data: null,
|
|
4163
4164
|
message: `Preference ${t.id} saved to storage`,
|
|
@@ -4179,8 +4180,8 @@ class Mr {
|
|
|
4179
4180
|
* @returns IResponse
|
|
4180
4181
|
*/
|
|
4181
4182
|
getImages = async (t) => {
|
|
4182
|
-
const o = (
|
|
4183
|
-
return g !== void 0 &&
|
|
4183
|
+
const o = (v) => t?.id ? v.includes(t.id) : !1, g = await this.db.table(_.IMAGES).toArray().then((v) => t?.id ? v.filter(o) : v);
|
|
4184
|
+
return g !== void 0 && K(3, [
|
|
4184
4185
|
"%cstorage%c %cimages",
|
|
4185
4186
|
c.STORAGE,
|
|
4186
4187
|
c.NONE,
|
|
@@ -4232,12 +4233,12 @@ function Ka(h, t) {
|
|
|
4232
4233
|
if (o)
|
|
4233
4234
|
return o;
|
|
4234
4235
|
const g = indexedDB.open(h);
|
|
4235
|
-
return g.onupgradeneeded = () => g.result.createObjectStore(t), o = Hn(g), o.then((
|
|
4236
|
-
|
|
4236
|
+
return g.onupgradeneeded = () => g.result.createObjectStore(t), o = Hn(g), o.then((v) => {
|
|
4237
|
+
v.onclose = () => o = void 0;
|
|
4237
4238
|
}, () => {
|
|
4238
4239
|
}), o;
|
|
4239
4240
|
};
|
|
4240
|
-
return (g,
|
|
4241
|
+
return (g, v) => l().then((C) => v(C.transaction(t, g).objectStore(t)));
|
|
4241
4242
|
}
|
|
4242
4243
|
let Un;
|
|
4243
4244
|
function Gr() {
|
|
@@ -5559,7 +5560,7 @@ class Ja {
|
|
|
5559
5560
|
subscribers = [];
|
|
5560
5561
|
// private temp: {[x:string]:any} = []
|
|
5561
5562
|
constructor(t) {
|
|
5562
|
-
|
|
5563
|
+
K(3, [
|
|
5563
5564
|
"%cpresentation",
|
|
5564
5565
|
c.PRESENTATION,
|
|
5565
5566
|
t.presentation,
|
|
@@ -5567,7 +5568,7 @@ class Ja {
|
|
|
5567
5568
|
xa
|
|
5568
5569
|
]), this.options = t, this.sm = null;
|
|
5569
5570
|
const o = t.presentation;
|
|
5570
|
-
switch (this.bc = new BroadcastChannel(o),
|
|
5571
|
+
switch (this.bc = new BroadcastChannel(o), K(3, ["%cchannel%c %capi", c.BROADCAST, c.NONE, c.API, o]), this.bc.onmessage = (l) => {
|
|
5571
5572
|
this.actions(l);
|
|
5572
5573
|
}, this.bc.postMessage({ event: X.STORAGE_INIT, data: {} }), this.api = new ka(t), t.storage) {
|
|
5573
5574
|
case he.DEXIE:
|
|
@@ -5606,13 +5607,13 @@ class Ja {
|
|
|
5606
5607
|
let o, l = 400;
|
|
5607
5608
|
if (t.success === !0) {
|
|
5608
5609
|
const g = this.subscribers[t.query.widget];
|
|
5609
|
-
let
|
|
5610
|
+
let v = "";
|
|
5610
5611
|
switch (t.query.type) {
|
|
5611
5612
|
case _.MESSAGES:
|
|
5612
|
-
let
|
|
5613
|
-
|
|
5614
|
-
(
|
|
5615
|
-
), t.data.messages =
|
|
5613
|
+
let C;
|
|
5614
|
+
C = t.data.messages.filter(
|
|
5615
|
+
(j) => j.id !== null
|
|
5616
|
+
), t.data.messages = C, v = t.data.messages.length > 0 ? Fn(t.data.messages[0].utc) : "none", g?.hash && g.hash === v ? (K(3, [
|
|
5616
5617
|
"%cload%c %cmessages%c %cno updates",
|
|
5617
5618
|
c.OK,
|
|
5618
5619
|
c.NONE,
|
|
@@ -5620,10 +5621,10 @@ class Ja {
|
|
|
5620
5621
|
c.NONE,
|
|
5621
5622
|
c.NO_UPDATES,
|
|
5622
5623
|
t.query.widget
|
|
5623
|
-
]),
|
|
5624
|
+
]), K(4, ["%cmessages", c.MESSAGES, t]), l = 204) : (o = t, g.hash = v, l = await this.sm?.setMessages(t.query, t).then(async (j) => (j = 201, this.broadcastUpdate(j, t))));
|
|
5624
5625
|
break;
|
|
5625
5626
|
case _.CLOUD:
|
|
5626
|
-
|
|
5627
|
+
v = Fn(t.data.cloud), g?.hash && g.hash === v ? (K(3, [
|
|
5627
5628
|
"%cload%c %ccloud%c %cno updates",
|
|
5628
5629
|
c.OK,
|
|
5629
5630
|
c.NONE,
|
|
@@ -5631,17 +5632,17 @@ class Ja {
|
|
|
5631
5632
|
c.NONE,
|
|
5632
5633
|
c.NO_UPDATES,
|
|
5633
5634
|
t.query.widget
|
|
5634
|
-
]),
|
|
5635
|
+
]), K(4, ["%ccloud", c.CLOUD, t.query]), l = 204) : (g.hash = v, o = {
|
|
5635
5636
|
data: {
|
|
5636
5637
|
cloud: t.data
|
|
5637
5638
|
},
|
|
5638
5639
|
message: t.message,
|
|
5639
5640
|
success: t.success,
|
|
5640
5641
|
query: t.query
|
|
5641
|
-
}, l = await this.sm?.setCloud(t.query, o.data).then((
|
|
5642
|
+
}, l = await this.sm?.setCloud(t.query, o.data).then((j) => this.broadcastUpdate(j, t)));
|
|
5642
5643
|
break;
|
|
5643
5644
|
case _.SERIES:
|
|
5644
|
-
|
|
5645
|
+
v = Fn(t.data.series), g?.hash && g.hash === v ? (K(3, [
|
|
5645
5646
|
"%cload%c %cseries%c %cno updates",
|
|
5646
5647
|
c.OK,
|
|
5647
5648
|
c.NONE,
|
|
@@ -5649,15 +5650,15 @@ class Ja {
|
|
|
5649
5650
|
c.NONE,
|
|
5650
5651
|
c.NO_UPDATES,
|
|
5651
5652
|
t.query.widget
|
|
5652
|
-
]),
|
|
5653
|
+
]), K(4, ["%cseries", c.SERIES, t]), l = 204) : (g.hash = v, o = {
|
|
5653
5654
|
data: t.data,
|
|
5654
5655
|
message: t.message,
|
|
5655
5656
|
success: t.success,
|
|
5656
5657
|
query: t.query
|
|
5657
|
-
}, l = await this.sm?.setSeries(t.query, t.data).then((
|
|
5658
|
+
}, l = await this.sm?.setSeries(t.query, t.data).then((j) => this.broadcastUpdate(j, t)));
|
|
5658
5659
|
break;
|
|
5659
5660
|
default:
|
|
5660
|
-
return
|
|
5661
|
+
return K(4, [
|
|
5661
5662
|
"%cfetch%c %capi%c %cno updates",
|
|
5662
5663
|
c.KO,
|
|
5663
5664
|
c.NONE,
|
|
@@ -5668,7 +5669,7 @@ class Ja {
|
|
|
5668
5669
|
]), t;
|
|
5669
5670
|
}
|
|
5670
5671
|
} else
|
|
5671
|
-
switch (
|
|
5672
|
+
switch (K(4, [
|
|
5672
5673
|
`%cload%c %c${t.query}%c %bad request`,
|
|
5673
5674
|
c.KO,
|
|
5674
5675
|
c.NONE,
|
|
@@ -5695,7 +5696,7 @@ class Ja {
|
|
|
5695
5696
|
broadcastUpdate = (t, o) => {
|
|
5696
5697
|
switch (t) {
|
|
5697
5698
|
case 201:
|
|
5698
|
-
|
|
5699
|
+
K(3, [
|
|
5699
5700
|
`%cupdate%c %cwidget%c %c${o.query?.type}`,
|
|
5700
5701
|
c.BROADCAST,
|
|
5701
5702
|
c.NONE,
|
|
@@ -5704,7 +5705,7 @@ class Ja {
|
|
|
5704
5705
|
kr(o.query),
|
|
5705
5706
|
// @ts-ignore
|
|
5706
5707
|
`${o.data?.title ?? ""} ${o.query.widget}`
|
|
5707
|
-
]),
|
|
5708
|
+
]), K(4, [
|
|
5708
5709
|
"%cevent",
|
|
5709
5710
|
c.BROADCAST,
|
|
5710
5711
|
// @ts-ignore
|
|
@@ -5717,7 +5718,7 @@ class Ja {
|
|
|
5717
5718
|
case 204:
|
|
5718
5719
|
break;
|
|
5719
5720
|
default:
|
|
5720
|
-
|
|
5721
|
+
K(2, [
|
|
5721
5722
|
`%cupdate%c %cwidget%c %c${o.query?.type}`,
|
|
5722
5723
|
c.KO,
|
|
5723
5724
|
c.NONE,
|
|
@@ -5740,7 +5741,7 @@ class Ja {
|
|
|
5740
5741
|
this.addSubscriber(t.data.data);
|
|
5741
5742
|
break;
|
|
5742
5743
|
case X.UPDATE:
|
|
5743
|
-
|
|
5744
|
+
K(3, [
|
|
5744
5745
|
"%cupdate%c %capi%c %cstorage",
|
|
5745
5746
|
c.BROADCAST,
|
|
5746
5747
|
c.NONE,
|
|
@@ -5754,7 +5755,7 @@ class Ja {
|
|
|
5754
5755
|
};
|
|
5755
5756
|
cleanMessages = async () => {
|
|
5756
5757
|
if (this.options?.suspended) {
|
|
5757
|
-
|
|
5758
|
+
K(2, [
|
|
5758
5759
|
"%cclean%c %cstorage%c %cmessages",
|
|
5759
5760
|
c.KO,
|
|
5760
5761
|
c.NONE,
|
|
@@ -5768,7 +5769,7 @@ class Ja {
|
|
|
5768
5769
|
const t = this.options?.retention || 86400 * 4, o = await this.sm?.cleanMessages(
|
|
5769
5770
|
t
|
|
5770
5771
|
);
|
|
5771
|
-
|
|
5772
|
+
K(3, [
|
|
5772
5773
|
"%cclean%c %cstorage%c %cmessages",
|
|
5773
5774
|
c.OK,
|
|
5774
5775
|
c.NONE,
|
|
@@ -5780,7 +5781,7 @@ class Ja {
|
|
|
5780
5781
|
};
|
|
5781
5782
|
hideMessage = async (t) => {
|
|
5782
5783
|
const o = await this.sm?.hideMessage(t.id, 0);
|
|
5783
|
-
return
|
|
5784
|
+
return K(3, [
|
|
5784
5785
|
"%chide%c %cstorage%c %cmessages",
|
|
5785
5786
|
c.OK,
|
|
5786
5787
|
c.NONE,
|
|
@@ -5922,8 +5923,8 @@ class Za {
|
|
|
5922
5923
|
this.element = t, this.callbacks = o, l = typeof l < "u" ? l : "buzzcasting-app";
|
|
5923
5924
|
let g;
|
|
5924
5925
|
g = { ...t.dataset }, delete g.hmr, g.presentation = window.BuzzCasting.getOptions()?.presentation ?? `${l} not found`, this.query = g, Da(t);
|
|
5925
|
-
const
|
|
5926
|
-
this.storageReader = new Ba(
|
|
5926
|
+
const v = window.BuzzCasting.getOptions();
|
|
5927
|
+
this.storageReader = new Ba(v), this.broadcastChannel = new BroadcastChannel(g.presentation), this.broadcastListener();
|
|
5927
5928
|
}
|
|
5928
5929
|
addCallbackListener(t) {
|
|
5929
5930
|
this.callbacks.push(t);
|
|
@@ -5941,7 +5942,7 @@ class Za {
|
|
|
5941
5942
|
try {
|
|
5942
5943
|
if (l.dashboard === t.dashboard && l.widget === t.widget) {
|
|
5943
5944
|
const g = await this.getData();
|
|
5944
|
-
g?.success && (
|
|
5945
|
+
g?.success && (K(4, [
|
|
5945
5946
|
"%cset%c %cbroadcast%c %cwidget",
|
|
5946
5947
|
c.OK,
|
|
5947
5948
|
c.NONE,
|
|
@@ -5949,12 +5950,12 @@ class Za {
|
|
|
5949
5950
|
c.NONE,
|
|
5950
5951
|
c.WIDGET,
|
|
5951
5952
|
this.query
|
|
5952
|
-
]), this.callbacks.forEach(async (
|
|
5953
|
-
|
|
5953
|
+
]), this.callbacks.forEach(async (v) => {
|
|
5954
|
+
v(g);
|
|
5954
5955
|
}));
|
|
5955
5956
|
}
|
|
5956
5957
|
} catch {
|
|
5957
|
-
|
|
5958
|
+
K(4, [X.WIDGET_UPDATE, l]);
|
|
5958
5959
|
}
|
|
5959
5960
|
break;
|
|
5960
5961
|
case X.APP_READY:
|
|
@@ -5968,14 +5969,14 @@ class Za {
|
|
|
5968
5969
|
* This takes place when the container indicates it has finished loading (ready)
|
|
5969
5970
|
*/
|
|
5970
5971
|
subscribe() {
|
|
5971
|
-
|
|
5972
|
+
K(3, [
|
|
5972
5973
|
"%csubscribe%c %cwidget",
|
|
5973
5974
|
c.SUBSCRIBE,
|
|
5974
5975
|
c.NONE,
|
|
5975
5976
|
c.WIDGET,
|
|
5976
5977
|
this.query.presentation,
|
|
5977
5978
|
this.query.widget
|
|
5978
|
-
]),
|
|
5979
|
+
]), K(4, ["%cwidget", c.WIDGET, this.query]), this.broadcastChannel.postMessage({
|
|
5979
5980
|
event: X.SUBSCRIBE,
|
|
5980
5981
|
data: this.query
|
|
5981
5982
|
});
|
|
@@ -6006,7 +6007,7 @@ class Za {
|
|
|
6006
6007
|
*
|
|
6007
6008
|
* @returns IResponse
|
|
6008
6009
|
*/
|
|
6009
|
-
getCloud = async () => this.query.type !== _.CLOUD ? (
|
|
6010
|
+
getCloud = async () => this.query.type !== _.CLOUD ? (K(3, [
|
|
6010
6011
|
"%cget%c %cstorage%c %cwidget",
|
|
6011
6012
|
c.KO,
|
|
6012
6013
|
c.NONE,
|
|
@@ -6016,7 +6017,7 @@ class Za {
|
|
|
6016
6017
|
this.query.widget,
|
|
6017
6018
|
"Wrong method call for getCloud, expected type is",
|
|
6018
6019
|
this.query.type
|
|
6019
|
-
]),
|
|
6020
|
+
]), K(4, ["%ccloud", c.CLOUD, this.query]), {
|
|
6020
6021
|
data: null,
|
|
6021
6022
|
message: `wrong method call for getCloud, expected type is '${this.query.type}'`,
|
|
6022
6023
|
success: !1,
|
|
@@ -6027,7 +6028,7 @@ class Za {
|
|
|
6027
6028
|
*
|
|
6028
6029
|
* @returns IResponse
|
|
6029
6030
|
*/
|
|
6030
|
-
getMessages = async () => this.query.type !== _.MESSAGES ? (
|
|
6031
|
+
getMessages = async () => this.query.type !== _.MESSAGES ? (K(3, [
|
|
6031
6032
|
"%cget%c %cstorage%c %cwidget",
|
|
6032
6033
|
c.KO,
|
|
6033
6034
|
c.NONE,
|
|
@@ -6037,7 +6038,7 @@ class Za {
|
|
|
6037
6038
|
this.query.widget,
|
|
6038
6039
|
"Wrong method call for getMessages, expected type is",
|
|
6039
6040
|
this.query.type
|
|
6040
|
-
]),
|
|
6041
|
+
]), K(4, ["%cmessages", c.MESSAGES, this.query]), {
|
|
6041
6042
|
data: null,
|
|
6042
6043
|
message: `wrong method call for getMessages, expected type is '${this.query.type}'`,
|
|
6043
6044
|
success: !1
|
|
@@ -6047,7 +6048,7 @@ class Za {
|
|
|
6047
6048
|
*
|
|
6048
6049
|
* @returns IResponse
|
|
6049
6050
|
*/
|
|
6050
|
-
getSeries = async () => this.query.type !== _.SERIES ? (
|
|
6051
|
+
getSeries = async () => this.query.type !== _.SERIES ? (K(3, [
|
|
6051
6052
|
"%cget%c %cstorage%c %cwidget",
|
|
6052
6053
|
c.KO,
|
|
6053
6054
|
c.NONE,
|
|
@@ -6057,7 +6058,7 @@ class Za {
|
|
|
6057
6058
|
this.query.widget,
|
|
6058
6059
|
"Wrong method call for getSeries, expected type is",
|
|
6059
6060
|
this.query.type
|
|
6060
|
-
]),
|
|
6061
|
+
]), K(4, ["%cseries", this.query]), {
|
|
6061
6062
|
data: null,
|
|
6062
6063
|
message: `wrong method call for getSeries, expected type is '${this.query.type}'`,
|
|
6063
6064
|
success: !1,
|
|
@@ -6070,7 +6071,7 @@ class Za {
|
|
|
6070
6071
|
* @param modal IModal
|
|
6071
6072
|
*/
|
|
6072
6073
|
showModal = (t) => {
|
|
6073
|
-
|
|
6074
|
+
K(3, [
|
|
6074
6075
|
"%cwidget",
|
|
6075
6076
|
c.WIDGET,
|
|
6076
6077
|
X.SHOW_MODAL,
|