buzzcasting-storage 3.7.2 → 3.7.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.d.ts +1 -1
- package/dist/buzzcasting-storage.esm.js +1026 -1024
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Aa = Object.defineProperty;
|
|
2
2
|
var Pa = (d, t, s) => t in d ? Aa(d, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : d[t] = s;
|
|
3
3
|
var b = (d, t, s) => Pa(d, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
-
var _ = /* @__PURE__ */ ((d) => (d.MESSAGES = "messages", d.CLOUD = "cloud", d.SERIES = "series", d.TOPICS = "topics", d.WIDGET = "widget", d.WIDGETS = "widgets", d.DASHBOARD = "dashboard", d.DASHBOARDS = "dashboards", d.SLIDE = "slide", d.SLIDES = "slides", d.PRESENTATION = "presentation", d.PRESENTATIONS = "presentations", d.PREFERENCE = "preference", d.PREFERENCES = "preferences", d))(_ || {}), l = /* @__PURE__ */ ((d) => (d.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", d.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", d.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", d.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", d.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", d.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", d.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", d.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", d.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", d.NONE = "color:transparent;background-color:transparent;", d.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", d.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", d.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", d.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", d.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", d.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", d.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", d))(l || {}), q = /* @__PURE__ */ ((d) => (d.ADD_SLIDE = "addSlide", d.APP_READY = "appReady", d.API_UPDATE = "apiUpdate", d.WS_API_REQUEST = "wsApiRequest", d.WS_API_RESPONSE = "wsApiResponse", d.WS_API_UPDATE = "wsApiRUpdate", d.APPROVE_MESSAGE = "approveMessage", d.CHANNEL = "channel", d.CLEAN_MESSAGES = "cleanMessages", d.CLOSE_MODAL = "closeModal", d.CLOSE_BUILDER_MODAL = "closeBuilderModal", d.DASHBOARD_LOAD = "loadDashboard", d.DASHBOARD_STORE = "storeDashboard", d.ERROR = "error", d.HIDE_MESSAGE = "hideMessage", d.HIDE_LABELS = "hideLabels", d.MAUPPUT_UPDATE = "layoutUpdate", d.PAUSE_PRESENTATION = "pausePresentation", d.PRESENTATION_READY = "presentationReady", d.PREV_SLIDE = "prevSlide", d.RELOAD_PRESENTATION = "reloadPresentation", d.SHOW_MODAL = "showModal", d.STAR_MESSAGE = "starMessage", d.GOTO_SLIDE = "gotoSlide", d.NEXT_SLIDE = "nextSlide", d.PREFERENCE_LOAD = "loadPreference", d.PREFERENCE_STORE = "storePreference", d.PRESENTATION_LOAD = "loadPresentation", d.PRESENTATION_STORE = "storePresentation", d.SHOW_BUILDER_MODAL = "showBuilderModal", d.SLIDE_DID_LOAD = "slideDidLoad", d.SLIDE_GOTO = "slideGoto", d.SLIDE_READY = "slideReady", d.SLIDE_LOAD = "loadSlide", d.SLIDE_STORE = "storeSlide", d.SLIDE_TRANSITIONER = "slideTransitioner", d.START_TRANSITIONER = "startTransitioner", d.STORAGE_INIT = "storageInit", d.SUBSCRIBE = "subscribe", d.SUSPEND_ACCOUNT = "suspendAccount", d.SWITCH_PRESENTATION = "switchPresentation", d.REMOVE_CLOUD = "removeCloud", d.UPDATE = "update", d.VERSION = "version", d.WIDGET_LOAD = "widgetLoad", d.WIDGET_STORE = "widgetStore", d.WIDGET_UPDATE = "widgetUpdate", d))(q || {}),
|
|
5
|
-
const Da = "3.7.
|
|
4
|
+
var _ = /* @__PURE__ */ ((d) => (d.MESSAGES = "messages", d.CLOUD = "cloud", d.SERIES = "series", d.TOPICS = "topics", d.WIDGET = "widget", d.WIDGETS = "widgets", d.DASHBOARD = "dashboard", d.DASHBOARDS = "dashboards", d.SLIDE = "slide", d.SLIDES = "slides", d.PRESENTATION = "presentation", d.PRESENTATIONS = "presentations", d.PREFERENCE = "preference", d.PREFERENCES = "preferences", d))(_ || {}), l = /* @__PURE__ */ ((d) => (d.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", d.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", d.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", d.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", d.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", d.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", d.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", d.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", d.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", d.NONE = "color:transparent;background-color:transparent;", d.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", d.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", d.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", d.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", d.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", d.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", d.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", d))(l || {}), q = /* @__PURE__ */ ((d) => (d.ADD_SLIDE = "addSlide", d.APP_READY = "appReady", d.API_UPDATE = "apiUpdate", d.WS_API_REQUEST = "wsApiRequest", d.WS_API_RESPONSE = "wsApiResponse", d.WS_API_UPDATE = "wsApiRUpdate", d.APPROVE_MESSAGE = "approveMessage", d.CHANNEL = "channel", d.CLEAN_MESSAGES = "cleanMessages", d.CLOSE_MODAL = "closeModal", d.CLOSE_BUILDER_MODAL = "closeBuilderModal", d.DASHBOARD_LOAD = "loadDashboard", d.DASHBOARD_STORE = "storeDashboard", d.ERROR = "error", d.HIDE_MESSAGE = "hideMessage", d.HIDE_LABELS = "hideLabels", d.MAUPPUT_UPDATE = "layoutUpdate", d.PAUSE_PRESENTATION = "pausePresentation", d.PRESENTATION_READY = "presentationReady", d.PREV_SLIDE = "prevSlide", d.RELOAD_PRESENTATION = "reloadPresentation", d.SHOW_MODAL = "showModal", d.STAR_MESSAGE = "starMessage", d.GOTO_SLIDE = "gotoSlide", d.NEXT_SLIDE = "nextSlide", d.PREFERENCE_LOAD = "loadPreference", d.PREFERENCE_STORE = "storePreference", d.PRESENTATION_LOAD = "loadPresentation", d.PRESENTATION_STORE = "storePresentation", d.SHOW_BUILDER_MODAL = "showBuilderModal", d.SLIDE_DID_LOAD = "slideDidLoad", d.SLIDE_GOTO = "slideGoto", d.SLIDE_READY = "slideReady", d.SLIDE_LOAD = "loadSlide", d.SLIDE_STORE = "storeSlide", d.SLIDE_TRANSITIONER = "slideTransitioner", d.START_TRANSITIONER = "startTransitioner", d.STORAGE_INIT = "storageInit", d.SUBSCRIBE = "subscribe", d.SUSPEND_ACCOUNT = "suspendAccount", d.SWITCH_PRESENTATION = "switchPresentation", d.REMOVE_CLOUD = "removeCloud", d.UPDATE = "update", d.VERSION = "version", d.WIDGET_LOAD = "widgetLoad", d.WIDGET_STORE = "widgetStore", d.WIDGET_UPDATE = "widgetUpdate", d))(q || {}), an = /* @__PURE__ */ ((d) => (d.APPROVED = "approved", d.BEFORE = "before", d.DELAYED = "delayed", d.NONE = "none", d.REALTIME = "realtime", d))(an || {}), we = /* @__PURE__ */ ((d) => (d.KEYVAL = "keyval", d.LOCAL = "local", d.SESSION = "session", d.DEXIE = "dexie", d.WINDOW = "window", d))(we || {});
|
|
5
|
+
const Da = "3.7.3";
|
|
6
6
|
function Ua(d) {
|
|
7
7
|
const t = d.toUpperCase().split(/[\s_-]+/);
|
|
8
8
|
return t.length > 0 ? (t.forEach((s, c) => {
|
|
@@ -115,7 +115,7 @@ function ka(d, t) {
|
|
|
115
115
|
d = `0${d}`;
|
|
116
116
|
return d;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Re(d, t) {
|
|
119
119
|
let s, c, v;
|
|
120
120
|
if (t.length === 0)
|
|
121
121
|
return d;
|
|
@@ -125,36 +125,36 @@ function Pe(d, t) {
|
|
|
125
125
|
}
|
|
126
126
|
function Ta(d, t, s) {
|
|
127
127
|
return Object.keys(t).sort().reduce(c, d);
|
|
128
|
-
function c(v,
|
|
129
|
-
return
|
|
128
|
+
function c(v, A) {
|
|
129
|
+
return Mr(v, t[A], A, s);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
const v =
|
|
132
|
+
function Mr(d, t, s, c) {
|
|
133
|
+
const v = Re(Re(Re(d, s), Na(t)), typeof t);
|
|
134
134
|
if (t === null)
|
|
135
|
-
return
|
|
135
|
+
return Re(v, "null");
|
|
136
136
|
if (t === void 0)
|
|
137
|
-
return
|
|
137
|
+
return Re(v, "undefined");
|
|
138
138
|
if (typeof t == "object" || typeof t == "function") {
|
|
139
139
|
if (c.includes(t))
|
|
140
|
-
return
|
|
140
|
+
return Re(v, `[Circular]${s}`);
|
|
141
141
|
c.push(t);
|
|
142
|
-
const
|
|
142
|
+
const A = Ta(v, t, c);
|
|
143
143
|
if (!("valueOf" in t) || typeof t.valueOf != "function")
|
|
144
|
-
return
|
|
144
|
+
return A;
|
|
145
145
|
try {
|
|
146
|
-
return
|
|
146
|
+
return Re(A, String(t.valueOf()));
|
|
147
147
|
} catch (I) {
|
|
148
|
-
return
|
|
148
|
+
return Re(A, `[valueOf exception]${I.stack || I.message}`);
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
return
|
|
151
|
+
return Re(v, t.toString());
|
|
152
152
|
}
|
|
153
153
|
function Na(d) {
|
|
154
154
|
return Object.prototype.toString.call(d);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
return ka(
|
|
156
|
+
function Qn(d) {
|
|
157
|
+
return ka(Mr(0, d, "", []).toString(16), 8);
|
|
158
158
|
}
|
|
159
159
|
function Va(d, t) {
|
|
160
160
|
if (d = d.toString().replace(/[^0-9.]/g, ""), d < 1e3)
|
|
@@ -300,17 +300,17 @@ function Ca(d) {
|
|
|
300
300
|
}
|
|
301
301
|
return d;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
var
|
|
305
|
-
let s, c, v,
|
|
303
|
+
function At(d, t) {
|
|
304
|
+
var Y;
|
|
305
|
+
let s, c, v, A, I;
|
|
306
306
|
switch (d.moderation) {
|
|
307
|
-
case
|
|
308
|
-
s = /* @__PURE__ */ new Date(), c = (
|
|
307
|
+
case an.BEFORE:
|
|
308
|
+
s = /* @__PURE__ */ new Date(), c = (Y = d.beforeTime) == null ? void 0 : Y.split(":"), v = Number.parseInt(c ? c[0] : "00"), A = Number.parseInt(c ? c[1] : "00"), I = Number.parseInt(c ? c[2] : "00"), t.before = s.setHours(v, A, I, 0) / 1e3, t.period || (t.period = s.getDay() === 1 ? 72 : 24);
|
|
309
309
|
break;
|
|
310
|
-
case
|
|
310
|
+
case an.DELAYED:
|
|
311
311
|
d.delay && d.delay > 0 && (t.delay = `${d.delay}`);
|
|
312
312
|
break;
|
|
313
|
-
case
|
|
313
|
+
case an.APPROVED:
|
|
314
314
|
t.approved = "1";
|
|
315
315
|
break;
|
|
316
316
|
default:
|
|
@@ -349,7 +349,7 @@ class $a {
|
|
|
349
349
|
async get(t) {
|
|
350
350
|
const { version: s } = this.options, c = this.headers(), v = Object.assign({}, t);
|
|
351
351
|
delete v.type, delete v.hash, delete v.order, delete v.presentation;
|
|
352
|
-
const
|
|
352
|
+
const A = Object.keys(v).length > 0 ? `?${new URLSearchParams(v).toString()}` : "";
|
|
353
353
|
return L(3, [
|
|
354
354
|
"%capi%c %cfetch",
|
|
355
355
|
l.API,
|
|
@@ -365,7 +365,7 @@ class $a {
|
|
|
365
365
|
t.type,
|
|
366
366
|
v
|
|
367
367
|
]), await fetch(
|
|
368
|
-
[this.url, "api", s, t.type].join("/") +
|
|
368
|
+
[this.url, "api", s, t.type].join("/") + A,
|
|
369
369
|
{ ...c, method: "get" }
|
|
370
370
|
).then(async (I) => {
|
|
371
371
|
if (!I.ok)
|
|
@@ -386,16 +386,16 @@ class $a {
|
|
|
386
386
|
), await fetch(
|
|
387
387
|
[this.url, "api", s, "messages", t.id].join("/") + v,
|
|
388
388
|
{ ...c, method: "put" }
|
|
389
|
-
).then((
|
|
390
|
-
if (!
|
|
391
|
-
throw new Error(
|
|
392
|
-
return
|
|
393
|
-
}).then((
|
|
389
|
+
).then((A) => {
|
|
390
|
+
if (!A.ok)
|
|
391
|
+
throw new Error(A.statusText);
|
|
392
|
+
return A;
|
|
393
|
+
}).then((A) => A.json()).catch((A) => ({ succes: !1, message: A, data: [] }));
|
|
394
394
|
}
|
|
395
395
|
async hideLabels(t) {
|
|
396
|
-
const { version: s } = this.options, c = this.formHeaders(), v = new URLSearchParams(),
|
|
397
|
-
for (const [I,
|
|
398
|
-
v.append(`custom_filters[${I}]`,
|
|
396
|
+
const { version: s } = this.options, c = this.formHeaders(), v = new URLSearchParams(), A = t.labels || [];
|
|
397
|
+
for (const [I, Y] of A.entries())
|
|
398
|
+
v.append(`custom_filters[${I}]`, Y);
|
|
399
399
|
return console.info(
|
|
400
400
|
"%capi%c %cput",
|
|
401
401
|
l.API,
|
|
@@ -403,7 +403,7 @@ class $a {
|
|
|
403
403
|
l.GET_DATA,
|
|
404
404
|
q.HIDE_LABELS,
|
|
405
405
|
t.widget,
|
|
406
|
-
|
|
406
|
+
A
|
|
407
407
|
), await fetch(
|
|
408
408
|
[this.url, "api", s, t.type, t.widget].join("/"),
|
|
409
409
|
{ ...c, body: v, method: "put" }
|
|
@@ -418,11 +418,11 @@ class $a {
|
|
|
418
418
|
return delete v.type, delete v.hash, L(3, ["%capi%c %cloadSlide", l.API, l.NONE, l.SLIDE, t.id]), await fetch(
|
|
419
419
|
[this.url, "api", s, "slides", t.id].join("/"),
|
|
420
420
|
{ ...c, method: "get" }
|
|
421
|
-
).then(async (
|
|
422
|
-
if (!
|
|
423
|
-
throw new Error(`${
|
|
424
|
-
return
|
|
425
|
-
}).then((
|
|
421
|
+
).then(async (A) => {
|
|
422
|
+
if (!A.ok)
|
|
423
|
+
throw new Error(`${A.status}`);
|
|
424
|
+
return A;
|
|
425
|
+
}).then((A) => A.json()).then((A) => (A.query = t, A)).catch((A) => ({ success: !1, message: `${A}`, data: null }));
|
|
426
426
|
}
|
|
427
427
|
/**
|
|
428
428
|
* Store slide definition
|
|
@@ -445,11 +445,11 @@ class $a {
|
|
|
445
445
|
), await fetch(
|
|
446
446
|
[this.url, "api", s, "slides", t.id].join("/"),
|
|
447
447
|
{ ...c, body: v, method: "put" }
|
|
448
|
-
).then((
|
|
449
|
-
if (!
|
|
450
|
-
throw new Error(
|
|
451
|
-
return
|
|
452
|
-
}).then((
|
|
448
|
+
).then((A) => {
|
|
449
|
+
if (!A.ok)
|
|
450
|
+
throw new Error(A.statusText);
|
|
451
|
+
return A;
|
|
452
|
+
}).then((A) => A.json()).catch((A) => ({ succes: !1, message: A, data: [] }));
|
|
453
453
|
}
|
|
454
454
|
async loadPresentation(t) {
|
|
455
455
|
const { version: s } = this.options, c = this.headers();
|
|
@@ -482,11 +482,11 @@ class $a {
|
|
|
482
482
|
return L(2, ["%capi%c %cput", l.API, l.NONE, l.PRESENTATION, t.name]), await fetch(
|
|
483
483
|
[this.url, "api", s, _.PRESENTATIONS, t.id].join("/"),
|
|
484
484
|
{ ...c, body: v, method: "put" }
|
|
485
|
-
).then((
|
|
486
|
-
if (!
|
|
487
|
-
throw new Error(
|
|
488
|
-
return
|
|
489
|
-
}).then((
|
|
485
|
+
).then((A) => {
|
|
486
|
+
if (!A.ok)
|
|
487
|
+
throw new Error(A.statusText);
|
|
488
|
+
return A;
|
|
489
|
+
}).then((A) => A.json()).catch((A) => ({ succes: !1, message: A, data: [] }));
|
|
490
490
|
}
|
|
491
491
|
async loadPreference(t) {
|
|
492
492
|
const { version: s } = this.options, c = this.headers();
|
|
@@ -518,11 +518,11 @@ class $a {
|
|
|
518
518
|
), await fetch(
|
|
519
519
|
[this.url, "api", s, _.PREFERENCES, t.id].join("/"),
|
|
520
520
|
{ ...c, body: v, method: "put" }
|
|
521
|
-
).then((
|
|
522
|
-
if (!
|
|
523
|
-
throw new Error(
|
|
524
|
-
return
|
|
525
|
-
}).then((
|
|
521
|
+
).then((A) => {
|
|
522
|
+
if (!A.ok)
|
|
523
|
+
throw new Error(A.statusText);
|
|
524
|
+
return A;
|
|
525
|
+
}).then((A) => A.json()).catch((A) => ({ succes: !1, message: A, data: [] }));
|
|
526
526
|
}
|
|
527
527
|
/*public async loadDashboardWidgets(query: IQuery): Promise<any> {
|
|
528
528
|
if (query?.dashboard === undefined)
|
|
@@ -584,9 +584,9 @@ var ja = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
584
584
|
function Ma(d) {
|
|
585
585
|
return d && d.__esModule && Object.prototype.hasOwnProperty.call(d, "default") ? d.default : d;
|
|
586
586
|
}
|
|
587
|
-
var
|
|
587
|
+
var sn = { exports: {} }, Ba = sn.exports, $r;
|
|
588
588
|
function Ga() {
|
|
589
|
-
return
|
|
589
|
+
return $r || ($r = 1, function(d, t) {
|
|
590
590
|
(function(s, c) {
|
|
591
591
|
d.exports = c();
|
|
592
592
|
})(Ba, function() {
|
|
@@ -606,50 +606,50 @@ function Ga() {
|
|
|
606
606
|
for (var a, i = 0, o = n.length; i < o; i++) !a && i in n || ((a = a || Array.prototype.slice.call(n, 0, i))[i] = n[i]);
|
|
607
607
|
return e.concat(a || Array.prototype.slice.call(n));
|
|
608
608
|
}
|
|
609
|
-
var
|
|
609
|
+
var A = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : ja, I = Object.keys, Y = Array.isArray;
|
|
610
610
|
function ne(e, n) {
|
|
611
611
|
return typeof n != "object" || I(n).forEach(function(r) {
|
|
612
612
|
e[r] = n[r];
|
|
613
613
|
}), e;
|
|
614
614
|
}
|
|
615
|
-
typeof Promise > "u" ||
|
|
616
|
-
var
|
|
615
|
+
typeof Promise > "u" || A.Promise || (A.Promise = Promise);
|
|
616
|
+
var ue = Object.getPrototypeOf, U = {}.hasOwnProperty;
|
|
617
617
|
function Q(e, n) {
|
|
618
618
|
return U.call(e, n);
|
|
619
619
|
}
|
|
620
620
|
function re(e, n) {
|
|
621
|
-
typeof n == "function" && (n = n(
|
|
622
|
-
|
|
621
|
+
typeof n == "function" && (n = n(ue(e))), (typeof Reflect > "u" ? I : Reflect.ownKeys)(n).forEach(function(r) {
|
|
622
|
+
ae(e, r, n[r]);
|
|
623
623
|
});
|
|
624
624
|
}
|
|
625
|
-
var
|
|
626
|
-
function
|
|
627
|
-
|
|
625
|
+
var Ie = Object.defineProperty;
|
|
626
|
+
function ae(e, n, r, a) {
|
|
627
|
+
Ie(e, n, ne(r && Q(r, "get") && typeof r.get == "function" ? { get: r.get, set: r.set, configurable: !0 } : { value: r, configurable: !0, writable: !0 }, a));
|
|
628
628
|
}
|
|
629
|
-
function
|
|
629
|
+
function _e(e) {
|
|
630
630
|
return { from: function(n) {
|
|
631
|
-
return e.prototype = Object.create(n.prototype),
|
|
631
|
+
return e.prototype = Object.create(n.prototype), ae(e.prototype, "constructor", e), { extend: re.bind(null, e.prototype) };
|
|
632
632
|
} };
|
|
633
633
|
}
|
|
634
|
-
var
|
|
635
|
-
function
|
|
636
|
-
return
|
|
634
|
+
var Pt = Object.getOwnPropertyDescriptor, Dt = [].slice;
|
|
635
|
+
function Ge(e, n, r) {
|
|
636
|
+
return Dt.call(e, n, r);
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function ut(e, n) {
|
|
639
639
|
return n(e);
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function ge(e) {
|
|
642
642
|
if (!e) throw new Error("Assertion Failed");
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
|
|
644
|
+
function Rt(e) {
|
|
645
|
+
A.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function ve(e, n) {
|
|
648
648
|
if (typeof n == "string" && Q(e, n)) return e[n];
|
|
649
649
|
if (!n) return e;
|
|
650
650
|
if (typeof n != "string") {
|
|
651
651
|
for (var r = [], a = 0, i = n.length; a < i; ++a) {
|
|
652
|
-
var o =
|
|
652
|
+
var o = ve(e, n[a]);
|
|
653
653
|
r.push(o);
|
|
654
654
|
}
|
|
655
655
|
return r;
|
|
@@ -657,71 +657,71 @@ function Ga() {
|
|
|
657
657
|
var u = n.indexOf(".");
|
|
658
658
|
if (u !== -1) {
|
|
659
659
|
var f = e[n.substr(0, u)];
|
|
660
|
-
return f == null ? void 0 :
|
|
660
|
+
return f == null ? void 0 : ve(f, n.substr(u + 1));
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function he(e, n, r) {
|
|
664
664
|
if (e && n !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof n != "string" && "length" in n) {
|
|
665
|
-
|
|
666
|
-
for (var a = 0, i = n.length; a < i; ++a)
|
|
665
|
+
ge(typeof r != "string" && "length" in r);
|
|
666
|
+
for (var a = 0, i = n.length; a < i; ++a) he(e, n[a], r[a]);
|
|
667
667
|
} else {
|
|
668
668
|
var o, u, f = n.indexOf(".");
|
|
669
|
-
f !== -1 ? (o = n.substr(0, f), (u = n.substr(f + 1)) === "" ? r === void 0 ?
|
|
669
|
+
f !== -1 ? (o = n.substr(0, f), (u = n.substr(f + 1)) === "" ? r === void 0 ? Y(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = r : he(f = !(f = e[o]) || !Q(e, o) ? e[o] = {} : f, u, r)) : r === void 0 ? Y(e) && !isNaN(parseInt(n)) ? e.splice(n, 1) : delete e[n] : e[n] = r;
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function xt(e) {
|
|
673
673
|
var n, r = {};
|
|
674
674
|
for (n in e) Q(e, n) && (r[n] = e[n]);
|
|
675
675
|
return r;
|
|
676
676
|
}
|
|
677
677
|
var Ur = [].concat;
|
|
678
|
-
function
|
|
678
|
+
function Vn(e) {
|
|
679
679
|
return Ur.apply([], e);
|
|
680
680
|
}
|
|
681
|
-
var
|
|
681
|
+
var We = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Vn([8, 16, 32, 64].map(function(e) {
|
|
682
682
|
return ["Int", "Uint", "Float"].map(function(n) {
|
|
683
683
|
return n + e + "Array";
|
|
684
684
|
});
|
|
685
685
|
}))).filter(function(e) {
|
|
686
|
-
return
|
|
687
|
-
}),
|
|
688
|
-
return
|
|
689
|
-
})),
|
|
690
|
-
function
|
|
691
|
-
return
|
|
686
|
+
return A[e];
|
|
687
|
+
}), qn = new Set(We.map(function(e) {
|
|
688
|
+
return A[e];
|
|
689
|
+
})), lt = null;
|
|
690
|
+
function Ke(e) {
|
|
691
|
+
return lt = /* @__PURE__ */ new WeakMap(), e = function n(r) {
|
|
692
692
|
if (!r || typeof r != "object") return r;
|
|
693
|
-
var a =
|
|
693
|
+
var a = lt.get(r);
|
|
694
694
|
if (a) return a;
|
|
695
|
-
if (
|
|
696
|
-
a = [],
|
|
695
|
+
if (Y(r)) {
|
|
696
|
+
a = [], lt.set(r, a);
|
|
697
697
|
for (var i = 0, o = r.length; i < o; ++i) a.push(n(r[i]));
|
|
698
|
-
} else if (
|
|
698
|
+
} else if (qn.has(r.constructor)) a = r;
|
|
699
699
|
else {
|
|
700
|
-
var u, f =
|
|
701
|
-
for (u in a = f === Object.prototype ? {} : Object.create(f),
|
|
700
|
+
var u, f = ue(r);
|
|
701
|
+
for (u in a = f === Object.prototype ? {} : Object.create(f), lt.set(r, a), r) Q(r, u) && (a[u] = n(r[u]));
|
|
702
702
|
}
|
|
703
703
|
return a;
|
|
704
|
-
}(e),
|
|
704
|
+
}(e), lt = null, e;
|
|
705
705
|
}
|
|
706
706
|
var zr = {}.toString;
|
|
707
|
-
function
|
|
707
|
+
function cn(e) {
|
|
708
708
|
return zr.call(e).slice(8, -1);
|
|
709
709
|
}
|
|
710
|
-
var
|
|
710
|
+
var un = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", Hr = typeof un == "symbol" ? function(e) {
|
|
711
711
|
var n;
|
|
712
|
-
return e != null && (n = e[
|
|
712
|
+
return e != null && (n = e[un]) && n.apply(e);
|
|
713
713
|
} : function() {
|
|
714
714
|
return null;
|
|
715
715
|
};
|
|
716
|
-
function
|
|
716
|
+
function Le(e, n) {
|
|
717
717
|
return n = e.indexOf(n), 0 <= n && e.splice(n, 1), 0 <= n;
|
|
718
718
|
}
|
|
719
|
-
var
|
|
720
|
-
function
|
|
719
|
+
var qe = {};
|
|
720
|
+
function Ae(e) {
|
|
721
721
|
var n, r, a, i;
|
|
722
722
|
if (arguments.length === 1) {
|
|
723
|
-
if (
|
|
724
|
-
if (this ===
|
|
723
|
+
if (Y(e)) return e.slice();
|
|
724
|
+
if (this === qe && typeof e == "string") return [e];
|
|
725
725
|
if (i = Hr(e)) {
|
|
726
726
|
for (r = []; !(a = i.next()).done; ) r.push(a.value);
|
|
727
727
|
return r;
|
|
@@ -734,15 +734,15 @@ function Ga() {
|
|
|
734
734
|
for (n = arguments.length, r = new Array(n); n--; ) r[n] = arguments[n];
|
|
735
735
|
return r;
|
|
736
736
|
}
|
|
737
|
-
var
|
|
737
|
+
var ln = typeof Symbol < "u" ? function(e) {
|
|
738
738
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
739
739
|
} : function() {
|
|
740
740
|
return !1;
|
|
741
|
-
},
|
|
742
|
-
function
|
|
741
|
+
}, ht = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], ye = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(ht), Yr = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
742
|
+
function et(e, n) {
|
|
743
743
|
this.name = e, this.message = n;
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function er(e, n) {
|
|
746
746
|
return e + ". Errors: " + Object.keys(n).map(function(r) {
|
|
747
747
|
return n[r].toString();
|
|
748
748
|
}).filter(function(r, a, i) {
|
|
@@ -750,44 +750,44 @@ function Ga() {
|
|
|
750
750
|
}).join(`
|
|
751
751
|
`);
|
|
752
752
|
}
|
|
753
|
-
function
|
|
754
|
-
this.failures = n, this.failedKeys = a, this.successCount = r, this.message =
|
|
753
|
+
function It(e, n, r, a) {
|
|
754
|
+
this.failures = n, this.failedKeys = a, this.successCount = r, this.message = er(e, n);
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function tt(e, n) {
|
|
757
757
|
this.name = "BulkError", this.failures = Object.keys(n).map(function(r) {
|
|
758
758
|
return n[r];
|
|
759
|
-
}), this.failuresByPos = n, this.message =
|
|
759
|
+
}), this.failuresByPos = n, this.message = er(e, this.failures);
|
|
760
760
|
}
|
|
761
|
-
|
|
761
|
+
_e(et).from(Error).extend({ toString: function() {
|
|
762
762
|
return this.name + ": " + this.message;
|
|
763
|
-
} }),
|
|
764
|
-
var
|
|
763
|
+
} }), _e(It).from(et), _e(tt).from(et);
|
|
764
|
+
var dn = ye.reduce(function(e, n) {
|
|
765
765
|
return e[n] = n + "Error", e;
|
|
766
|
-
}, {}), Qr =
|
|
766
|
+
}, {}), Qr = et, K = ye.reduce(function(e, n) {
|
|
767
767
|
var r = n + "Error";
|
|
768
768
|
function a(i, o) {
|
|
769
769
|
this.name = r, i ? typeof i == "string" ? (this.message = "".concat(i).concat(o ? `
|
|
770
770
|
` + o : ""), this.inner = o || null) : typeof i == "object" && (this.message = "".concat(i.name, " ").concat(i.message), this.inner = i) : (this.message = Yr[n] || r, this.inner = null);
|
|
771
771
|
}
|
|
772
|
-
return
|
|
772
|
+
return _e(a).from(Qr), e[n] = a, e;
|
|
773
773
|
}, {});
|
|
774
774
|
K.Syntax = SyntaxError, K.Type = TypeError, K.Range = RangeError;
|
|
775
|
-
var
|
|
775
|
+
var tr = ht.reduce(function(e, n) {
|
|
776
776
|
return e[n + "Error"] = K[n], e;
|
|
777
|
-
}, {}),
|
|
777
|
+
}, {}), kt = ye.reduce(function(e, n) {
|
|
778
778
|
return ["Syntax", "Type", "Range"].indexOf(n) === -1 && (e[n + "Error"] = K[n]), e;
|
|
779
779
|
}, {});
|
|
780
780
|
function V() {
|
|
781
781
|
}
|
|
782
|
-
function
|
|
782
|
+
function dt(e) {
|
|
783
783
|
return e;
|
|
784
784
|
}
|
|
785
785
|
function Xr(e, n) {
|
|
786
|
-
return e == null || e ===
|
|
786
|
+
return e == null || e === dt ? n : function(r) {
|
|
787
787
|
return n(e(r));
|
|
788
788
|
};
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function Fe(e, n) {
|
|
791
791
|
return function() {
|
|
792
792
|
e.apply(this, arguments), n.apply(this, arguments);
|
|
793
793
|
};
|
|
@@ -799,14 +799,14 @@ function Ga() {
|
|
|
799
799
|
var a = this.onsuccess, i = this.onerror;
|
|
800
800
|
this.onsuccess = null, this.onerror = null;
|
|
801
801
|
var o = n.apply(this, arguments);
|
|
802
|
-
return a && (this.onsuccess = this.onsuccess ?
|
|
802
|
+
return a && (this.onsuccess = this.onsuccess ? Fe(a, this.onsuccess) : a), i && (this.onerror = this.onerror ? Fe(i, this.onerror) : i), o !== void 0 ? o : r;
|
|
803
803
|
};
|
|
804
804
|
}
|
|
805
805
|
function Zr(e, n) {
|
|
806
806
|
return e === V ? n : function() {
|
|
807
807
|
e.apply(this, arguments);
|
|
808
808
|
var r = this.onsuccess, a = this.onerror;
|
|
809
|
-
this.onsuccess = this.onerror = null, n.apply(this, arguments), r && (this.onsuccess = this.onsuccess ?
|
|
809
|
+
this.onsuccess = this.onerror = null, n.apply(this, arguments), r && (this.onsuccess = this.onsuccess ? Fe(r, this.onsuccess) : r), a && (this.onerror = this.onerror ? Fe(a, this.onerror) : a);
|
|
810
810
|
};
|
|
811
811
|
}
|
|
812
812
|
function Vr(e, n) {
|
|
@@ -814,7 +814,7 @@ function Ga() {
|
|
|
814
814
|
var a = e.apply(this, arguments);
|
|
815
815
|
ne(r, a);
|
|
816
816
|
var i = this.onsuccess, o = this.onerror;
|
|
817
|
-
return this.onsuccess = null, this.onerror = null, r = n.apply(this, arguments), i && (this.onsuccess = this.onsuccess ?
|
|
817
|
+
return this.onsuccess = null, this.onerror = null, r = n.apply(this, arguments), i && (this.onsuccess = this.onsuccess ? Fe(i, this.onsuccess) : i), o && (this.onerror = this.onerror ? Fe(o, this.onerror) : o), a === void 0 ? r === void 0 ? void 0 : r : ne(a, r);
|
|
818
818
|
};
|
|
819
819
|
}
|
|
820
820
|
function qr(e, n) {
|
|
@@ -822,7 +822,7 @@ function Ga() {
|
|
|
822
822
|
return n.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function fn(e, n) {
|
|
826
826
|
return e === V ? n : function() {
|
|
827
827
|
var r = e.apply(this, arguments);
|
|
828
828
|
if (r && typeof r.then == "function") {
|
|
@@ -834,147 +834,147 @@ function Ga() {
|
|
|
834
834
|
return n.apply(this, arguments);
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
|
-
|
|
838
|
-
var
|
|
839
|
-
function
|
|
840
|
-
|
|
837
|
+
kt.ModifyError = It, kt.DexieError = et, kt.BulkError = tt;
|
|
838
|
+
var Ee = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
839
|
+
function nr(e) {
|
|
840
|
+
Ee = e;
|
|
841
841
|
}
|
|
842
|
-
var
|
|
842
|
+
var ft = {}, rr = 100, We = typeof Promise > "u" ? [] : function() {
|
|
843
843
|
var e = Promise.resolve();
|
|
844
|
-
if (typeof crypto > "u" || !crypto.subtle) return [e,
|
|
844
|
+
if (typeof crypto > "u" || !crypto.subtle) return [e, ue(e), e];
|
|
845
845
|
var n = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
846
|
-
return [n,
|
|
847
|
-
}(),
|
|
848
|
-
|
|
849
|
-
},
|
|
846
|
+
return [n, ue(n), e];
|
|
847
|
+
}(), ht = We[0], ye = We[1], We = We[2], ye = ye && ye.then, Ue = ht && ht.constructor, hn = !!We, pt = function(e, n) {
|
|
848
|
+
gt.push([e, n]), Tt && (queueMicrotask(ta), Tt = !1);
|
|
849
|
+
}, pn = !0, Tt = !0, ze = [], Nt = [], gn = dt, ke = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: V, pgp: !1, env: {}, finalize: V }, G = ke, gt = [], He = 0, Ct = [];
|
|
850
850
|
function M(e) {
|
|
851
851
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
852
852
|
this._listeners = [], this._lib = !1;
|
|
853
853
|
var n = this._PSD = G;
|
|
854
854
|
if (typeof e != "function") {
|
|
855
|
-
if (e !==
|
|
856
|
-
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 &&
|
|
855
|
+
if (e !== ft) throw new TypeError("Not a function");
|
|
856
|
+
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && bn(this, this._value));
|
|
857
857
|
}
|
|
858
858
|
this._state = null, this._value = null, ++n.ref, function r(a, i) {
|
|
859
859
|
try {
|
|
860
860
|
i(function(o) {
|
|
861
861
|
if (a._state === null) {
|
|
862
862
|
if (o === a) throw new TypeError("A promise cannot be resolved with itself.");
|
|
863
|
-
var u = a._lib &&
|
|
863
|
+
var u = a._lib && nt();
|
|
864
864
|
o && typeof o.then == "function" ? r(a, function(f, p) {
|
|
865
865
|
o instanceof M ? o._then(f, p) : o.then(f, p);
|
|
866
|
-
}) : (a._state = !0, a._value = o,
|
|
866
|
+
}) : (a._state = !0, a._value = o, sr(a)), u && rt();
|
|
867
867
|
}
|
|
868
|
-
},
|
|
868
|
+
}, bn.bind(null, a));
|
|
869
869
|
} catch (o) {
|
|
870
|
-
|
|
870
|
+
bn(a, o);
|
|
871
871
|
}
|
|
872
872
|
}(this, e);
|
|
873
873
|
}
|
|
874
|
-
var
|
|
875
|
-
var e = G, n =
|
|
874
|
+
var mn = { get: function() {
|
|
875
|
+
var e = G, n = Bt;
|
|
876
876
|
function r(a, i) {
|
|
877
|
-
var o = this, u = !e.global && (e !== G || n !==
|
|
878
|
-
|
|
877
|
+
var o = this, u = !e.global && (e !== G || n !== Bt), f = u && !Ne(), p = new M(function(m, E) {
|
|
878
|
+
yn(o, new ar(or(a, e, u, f), or(i, e, u, f), m, E, e));
|
|
879
879
|
});
|
|
880
880
|
return this._consoleTask && (p._consoleTask = this._consoleTask), p;
|
|
881
881
|
}
|
|
882
|
-
return r.prototype =
|
|
882
|
+
return r.prototype = ft, r;
|
|
883
883
|
}, set: function(e) {
|
|
884
|
-
|
|
884
|
+
ae(this, "then", e && e.prototype === ft ? mn : { get: function() {
|
|
885
885
|
return e;
|
|
886
|
-
}, set:
|
|
886
|
+
}, set: mn.set });
|
|
887
887
|
} };
|
|
888
|
-
function
|
|
888
|
+
function ar(e, n, r, a, i) {
|
|
889
889
|
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof n == "function" ? n : null, this.resolve = r, this.reject = a, this.psd = i;
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function bn(e, n) {
|
|
892
892
|
var r, a;
|
|
893
|
-
|
|
893
|
+
Nt.push(n), e._state === null && (r = e._lib && nt(), n = gn(n), e._state = !1, e._value = n, a = e, ze.some(function(i) {
|
|
894
894
|
return i._value === a._value;
|
|
895
|
-
}) ||
|
|
895
|
+
}) || ze.push(a), sr(e), r && rt());
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function sr(e) {
|
|
898
898
|
var n = e._listeners;
|
|
899
899
|
e._listeners = [];
|
|
900
|
-
for (var r = 0, a = n.length; r < a; ++r)
|
|
900
|
+
for (var r = 0, a = n.length; r < a; ++r) yn(e, n[r]);
|
|
901
901
|
var i = e._PSD;
|
|
902
|
-
--i.ref || i.finalize(),
|
|
903
|
-
--
|
|
902
|
+
--i.ref || i.finalize(), He === 0 && (++He, pt(function() {
|
|
903
|
+
--He == 0 && vn();
|
|
904
904
|
}, []));
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function yn(e, n) {
|
|
907
907
|
if (e._state !== null) {
|
|
908
908
|
var r = e._state ? n.onFulfilled : n.onRejected;
|
|
909
909
|
if (r === null) return (e._state ? n.resolve : n.reject)(e._value);
|
|
910
|
-
++n.psd.ref, ++
|
|
910
|
+
++n.psd.ref, ++He, pt(ea, [r, e, n]);
|
|
911
911
|
} else e._listeners.push(n);
|
|
912
912
|
}
|
|
913
913
|
function ea(e, n, r) {
|
|
914
914
|
try {
|
|
915
915
|
var a, i = n._value;
|
|
916
|
-
!n._state &&
|
|
916
|
+
!n._state && Nt.length && (Nt = []), a = Ee && n._consoleTask ? n._consoleTask.run(function() {
|
|
917
917
|
return e(i);
|
|
918
|
-
}) : e(i), n._state ||
|
|
919
|
-
for (var u =
|
|
918
|
+
}) : e(i), n._state || Nt.indexOf(i) !== -1 || function(o) {
|
|
919
|
+
for (var u = ze.length; u; ) if (ze[--u]._value === o._value) return ze.splice(u, 1);
|
|
920
920
|
}(n), r.resolve(a);
|
|
921
921
|
} catch (o) {
|
|
922
922
|
r.reject(o);
|
|
923
923
|
} finally {
|
|
924
|
-
--
|
|
924
|
+
--He == 0 && vn(), --r.psd.ref || r.psd.finalize();
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
927
|
function ta() {
|
|
928
|
-
|
|
929
|
-
|
|
928
|
+
Ye(ke, function() {
|
|
929
|
+
nt() && rt();
|
|
930
930
|
});
|
|
931
931
|
}
|
|
932
|
-
function
|
|
933
|
-
var e =
|
|
934
|
-
return
|
|
932
|
+
function nt() {
|
|
933
|
+
var e = pn;
|
|
934
|
+
return Tt = pn = !1, e;
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function rt() {
|
|
937
937
|
var e, n, r;
|
|
938
938
|
do
|
|
939
|
-
for (; 0 <
|
|
939
|
+
for (; 0 < gt.length; ) for (e = gt, gt = [], r = e.length, n = 0; n < r; ++n) {
|
|
940
940
|
var a = e[n];
|
|
941
941
|
a[0].apply(null, a[1]);
|
|
942
942
|
}
|
|
943
|
-
while (0 <
|
|
944
|
-
|
|
943
|
+
while (0 < gt.length);
|
|
944
|
+
Tt = pn = !0;
|
|
945
945
|
}
|
|
946
|
-
function
|
|
947
|
-
var e =
|
|
948
|
-
|
|
946
|
+
function vn() {
|
|
947
|
+
var e = ze;
|
|
948
|
+
ze = [], e.forEach(function(a) {
|
|
949
949
|
a._PSD.onunhandled.call(null, a._value, a);
|
|
950
950
|
});
|
|
951
|
-
for (var n =
|
|
951
|
+
for (var n = Ct.slice(0), r = n.length; r; ) n[--r]();
|
|
952
952
|
}
|
|
953
|
-
function
|
|
954
|
-
return new M(
|
|
953
|
+
function $t(e) {
|
|
954
|
+
return new M(ft, !1, e);
|
|
955
955
|
}
|
|
956
956
|
function te(e, n) {
|
|
957
957
|
var r = G;
|
|
958
958
|
return function() {
|
|
959
|
-
var a =
|
|
959
|
+
var a = nt(), i = G;
|
|
960
960
|
try {
|
|
961
|
-
return
|
|
961
|
+
return Ce(r, !0), e.apply(this, arguments);
|
|
962
962
|
} catch (o) {
|
|
963
963
|
n && n(o);
|
|
964
964
|
} finally {
|
|
965
|
-
|
|
965
|
+
Ce(i, !1), a && rt();
|
|
966
966
|
}
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
|
-
re(M.prototype, { then:
|
|
970
|
-
|
|
969
|
+
re(M.prototype, { then: mn, _then: function(e, n) {
|
|
970
|
+
yn(this, new ar(null, null, e, n, G));
|
|
971
971
|
}, catch: function(e) {
|
|
972
972
|
if (arguments.length === 1) return this.then(null, e);
|
|
973
973
|
var n = e, r = arguments[1];
|
|
974
974
|
return typeof n == "function" ? this.then(null, function(a) {
|
|
975
|
-
return (a instanceof n ? r :
|
|
975
|
+
return (a instanceof n ? r : $t)(a);
|
|
976
976
|
}) : this.then(null, function(a) {
|
|
977
|
-
return (a && a.name === n ? r :
|
|
977
|
+
return (a && a.name === n ? r : $t)(a);
|
|
978
978
|
});
|
|
979
979
|
}, finally: function(e) {
|
|
980
980
|
return this.then(function(n) {
|
|
@@ -983,7 +983,7 @@ function Ga() {
|
|
|
983
983
|
});
|
|
984
984
|
}, function(n) {
|
|
985
985
|
return M.resolve(e()).then(function() {
|
|
986
|
-
return
|
|
986
|
+
return $t(n);
|
|
987
987
|
});
|
|
988
988
|
});
|
|
989
989
|
}, timeout: function(e, n) {
|
|
@@ -994,8 +994,8 @@ function Ga() {
|
|
|
994
994
|
}, e);
|
|
995
995
|
r.then(a, i).finally(clearTimeout.bind(null, o));
|
|
996
996
|
}) : this;
|
|
997
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag &&
|
|
998
|
-
var e =
|
|
997
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && ae(M.prototype, Symbol.toStringTag, "Dexie.Promise"), ke.env = ir(), re(M, { all: function() {
|
|
998
|
+
var e = Ae.apply(null, arguments).map(Gt);
|
|
999
999
|
return new M(function(n, r) {
|
|
1000
1000
|
e.length === 0 && n([]);
|
|
1001
1001
|
var a = e.length;
|
|
@@ -1008,9 +1008,9 @@ function Ga() {
|
|
|
1008
1008
|
}, resolve: function(e) {
|
|
1009
1009
|
return e instanceof M ? e : e && typeof e.then == "function" ? new M(function(n, r) {
|
|
1010
1010
|
e.then(n, r);
|
|
1011
|
-
}) : new M(
|
|
1012
|
-
}, reject:
|
|
1013
|
-
var e =
|
|
1011
|
+
}) : new M(ft, !0, e);
|
|
1012
|
+
}, reject: $t, race: function() {
|
|
1013
|
+
var e = Ae.apply(null, arguments).map(Gt);
|
|
1014
1014
|
return new M(function(n, r) {
|
|
1015
1015
|
e.map(function(a) {
|
|
1016
1016
|
return M.resolve(a).then(n, r);
|
|
@@ -1021,33 +1021,33 @@ function Ga() {
|
|
|
1021
1021
|
}, set: function(e) {
|
|
1022
1022
|
return G = e;
|
|
1023
1023
|
} }, totalEchoes: { get: function() {
|
|
1024
|
-
return
|
|
1025
|
-
} }, newPSD:
|
|
1026
|
-
return
|
|
1024
|
+
return Bt;
|
|
1025
|
+
} }, newPSD: Te, usePSD: Ye, scheduler: { get: function() {
|
|
1026
|
+
return pt;
|
|
1027
1027
|
}, set: function(e) {
|
|
1028
|
-
|
|
1028
|
+
pt = e;
|
|
1029
1029
|
} }, rejectionMapper: { get: function() {
|
|
1030
|
-
return
|
|
1030
|
+
return gn;
|
|
1031
1031
|
}, set: function(e) {
|
|
1032
|
-
|
|
1032
|
+
gn = e;
|
|
1033
1033
|
} }, follow: function(e, n) {
|
|
1034
1034
|
return new M(function(r, a) {
|
|
1035
|
-
return
|
|
1035
|
+
return Te(function(i, o) {
|
|
1036
1036
|
var u = G;
|
|
1037
|
-
u.unhandleds = [], u.onunhandled = o, u.finalize =
|
|
1037
|
+
u.unhandleds = [], u.onunhandled = o, u.finalize = Fe(function() {
|
|
1038
1038
|
var f, p = this;
|
|
1039
1039
|
f = function() {
|
|
1040
1040
|
p.unhandleds.length === 0 ? i() : o(p.unhandleds[0]);
|
|
1041
|
-
},
|
|
1042
|
-
f(),
|
|
1043
|
-
}), ++
|
|
1044
|
-
--
|
|
1041
|
+
}, Ct.push(function m() {
|
|
1042
|
+
f(), Ct.splice(Ct.indexOf(m), 1);
|
|
1043
|
+
}), ++He, pt(function() {
|
|
1044
|
+
--He == 0 && vn();
|
|
1045
1045
|
}, []);
|
|
1046
1046
|
}, u.finalize), e();
|
|
1047
1047
|
}, n, r, a);
|
|
1048
1048
|
});
|
|
1049
|
-
} }),
|
|
1050
|
-
var e =
|
|
1049
|
+
} }), Ue && (Ue.allSettled && ae(M, "allSettled", function() {
|
|
1050
|
+
var e = Ae.apply(null, arguments).map(Gt);
|
|
1051
1051
|
return new M(function(n) {
|
|
1052
1052
|
e.length === 0 && n([]);
|
|
1053
1053
|
var r = e.length, a = new Array(r);
|
|
@@ -1061,8 +1061,8 @@ function Ga() {
|
|
|
1061
1061
|
});
|
|
1062
1062
|
});
|
|
1063
1063
|
});
|
|
1064
|
-
}),
|
|
1065
|
-
var e =
|
|
1064
|
+
}), Ue.any && typeof AggregateError < "u" && ae(M, "any", function() {
|
|
1065
|
+
var e = Ae.apply(null, arguments).map(Gt);
|
|
1066
1066
|
return new M(function(n, r) {
|
|
1067
1067
|
e.length === 0 && r(new AggregateError([]));
|
|
1068
1068
|
var a = e.length, i = new Array(a);
|
|
@@ -1074,84 +1074,84 @@ function Ga() {
|
|
|
1074
1074
|
});
|
|
1075
1075
|
});
|
|
1076
1076
|
});
|
|
1077
|
-
}),
|
|
1078
|
-
var
|
|
1079
|
-
function
|
|
1077
|
+
}), Ue.withResolvers && (M.withResolvers = Ue.withResolvers));
|
|
1078
|
+
var oe = { awaits: 0, echoes: 0, id: 0 }, na = 0, jt = [], Mt = 0, Bt = 0, ra = 0;
|
|
1079
|
+
function Te(e, n, r, a) {
|
|
1080
1080
|
var i = G, o = Object.create(i);
|
|
1081
|
-
return o.parent = i, o.ref = 0, o.global = !1, o.id = ++ra,
|
|
1081
|
+
return o.parent = i, o.ref = 0, o.global = !1, o.id = ++ra, ke.env, o.env = hn ? { 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 && ne(o, n), ++i.ref, o.finalize = function() {
|
|
1082
1082
|
--this.parent.ref || this.parent.finalize();
|
|
1083
|
-
}, a =
|
|
1083
|
+
}, a = Ye(o, e, r, a), o.ref === 0 && o.finalize(), a;
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1086
|
-
return
|
|
1085
|
+
function at() {
|
|
1086
|
+
return oe.id || (oe.id = ++na), ++oe.awaits, oe.echoes += rr, oe.id;
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1089
|
-
return !!
|
|
1088
|
+
function Ne() {
|
|
1089
|
+
return !!oe.awaits && (--oe.awaits == 0 && (oe.id = 0), oe.echoes = oe.awaits * rr, !0);
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1092
|
-
return
|
|
1093
|
-
return
|
|
1091
|
+
function Gt(e) {
|
|
1092
|
+
return oe.echoes && e && e.constructor === Ue ? (at(), e.then(function(n) {
|
|
1093
|
+
return Ne(), n;
|
|
1094
1094
|
}, function(n) {
|
|
1095
|
-
return
|
|
1095
|
+
return Ne(), se(n);
|
|
1096
1096
|
})) : e;
|
|
1097
1097
|
}
|
|
1098
1098
|
function aa() {
|
|
1099
|
-
var e =
|
|
1100
|
-
|
|
1099
|
+
var e = jt[jt.length - 1];
|
|
1100
|
+
jt.pop(), Ce(e, !1);
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1102
|
+
function Ce(e, n) {
|
|
1103
1103
|
var r, a = G;
|
|
1104
|
-
(n ? !
|
|
1105
|
-
++
|
|
1106
|
-
}).bind(null, e) : aa), e !== G && (G = e, a ===
|
|
1104
|
+
(n ? !oe.echoes || Mt++ && e === G : !Mt || --Mt && e === G) || queueMicrotask(n ? (function(i) {
|
|
1105
|
+
++Bt, oe.echoes && --oe.echoes != 0 || (oe.echoes = oe.awaits = oe.id = 0), jt.push(G), Ce(i, !0);
|
|
1106
|
+
}).bind(null, e) : aa), e !== G && (G = e, a === ke && (ke.env = ir()), hn && (r = ke.env.Promise, n = e.env, (a.global || e.global) && (Object.defineProperty(A, "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))));
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1109
|
-
var e =
|
|
1110
|
-
return
|
|
1108
|
+
function ir() {
|
|
1109
|
+
var e = A.Promise;
|
|
1110
|
+
return hn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(A, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
1111
1111
|
}
|
|
1112
|
-
function
|
|
1112
|
+
function Ye(e, n, r, a, i) {
|
|
1113
1113
|
var o = G;
|
|
1114
1114
|
try {
|
|
1115
|
-
return
|
|
1115
|
+
return Ce(e, !0), n(r, a, i);
|
|
1116
1116
|
} finally {
|
|
1117
|
-
|
|
1117
|
+
Ce(o, !1);
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
|
-
function
|
|
1120
|
+
function or(e, n, r, a) {
|
|
1121
1121
|
return typeof e != "function" ? e : function() {
|
|
1122
1122
|
var i = G;
|
|
1123
|
-
r &&
|
|
1123
|
+
r && at(), Ce(n, !0);
|
|
1124
1124
|
try {
|
|
1125
1125
|
return e.apply(this, arguments);
|
|
1126
1126
|
} finally {
|
|
1127
|
-
|
|
1127
|
+
Ce(i, !1), a && queueMicrotask(Ne);
|
|
1128
1128
|
}
|
|
1129
1129
|
};
|
|
1130
1130
|
}
|
|
1131
|
-
function
|
|
1132
|
-
Promise ===
|
|
1131
|
+
function wn(e) {
|
|
1132
|
+
Promise === Ue && oe.echoes === 0 ? Mt === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
1133
1133
|
}
|
|
1134
|
-
("" +
|
|
1135
|
-
var
|
|
1136
|
-
function
|
|
1134
|
+
("" + ye).indexOf("[native code]") === -1 && (at = Ne = V);
|
|
1135
|
+
var se = M.reject, Qe = "", Pe = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", cr = "String expected.", st = [], Kt = "__dbnames", En = "readonly", Sn = "readwrite";
|
|
1136
|
+
function Xe(e, n) {
|
|
1137
1137
|
return e ? n ? function() {
|
|
1138
1138
|
return e.apply(this, arguments) && n.apply(this, arguments);
|
|
1139
1139
|
} : e : n;
|
|
1140
1140
|
}
|
|
1141
|
-
var
|
|
1142
|
-
function
|
|
1141
|
+
var ur = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
1142
|
+
function Lt(e) {
|
|
1143
1143
|
return typeof e != "string" || /\./.test(e) ? function(n) {
|
|
1144
1144
|
return n;
|
|
1145
1145
|
} : function(n) {
|
|
1146
|
-
return n[e] === void 0 && e in n && delete (n =
|
|
1146
|
+
return n[e] === void 0 && e in n && delete (n = Ke(n))[e], n;
|
|
1147
1147
|
};
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1149
|
+
function lr() {
|
|
1150
1150
|
throw K.Type();
|
|
1151
1151
|
}
|
|
1152
1152
|
function X(e, n) {
|
|
1153
1153
|
try {
|
|
1154
|
-
var r =
|
|
1154
|
+
var r = dr(e), a = dr(n);
|
|
1155
1155
|
if (r !== a) return r === "Array" ? 1 : a === "Array" ? -1 : r === "binary" ? 1 : a === "binary" ? -1 : r === "string" ? 1 : a === "string" ? -1 : r === "Date" ? 1 : a !== "Date" ? NaN : -1;
|
|
1156
1156
|
switch (r) {
|
|
1157
1157
|
case "number":
|
|
@@ -1162,7 +1162,7 @@ function Ga() {
|
|
|
1162
1162
|
return function(i, o) {
|
|
1163
1163
|
for (var u = i.length, f = o.length, p = u < f ? u : f, m = 0; m < p; ++m) if (i[m] !== o[m]) return i[m] < o[m] ? -1 : 1;
|
|
1164
1164
|
return u === f ? 0 : u < f ? -1 : 1;
|
|
1165
|
-
}(
|
|
1165
|
+
}(fr(e), fr(n));
|
|
1166
1166
|
case "Array":
|
|
1167
1167
|
return function(i, o) {
|
|
1168
1168
|
for (var u = i.length, f = o.length, p = u < f ? u : f, m = 0; m < p; ++m) {
|
|
@@ -1176,22 +1176,22 @@ function Ga() {
|
|
|
1176
1176
|
}
|
|
1177
1177
|
return NaN;
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1179
|
+
function dr(e) {
|
|
1180
1180
|
var n = typeof e;
|
|
1181
|
-
return n != "object" ? n : ArrayBuffer.isView(e) ? "binary" : (e =
|
|
1181
|
+
return n != "object" ? n : ArrayBuffer.isView(e) ? "binary" : (e = cn(e), e === "ArrayBuffer" ? "binary" : e);
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
1183
|
+
function fr(e) {
|
|
1184
1184
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
1185
1185
|
}
|
|
1186
|
-
var
|
|
1187
|
-
var a = this._tx || G.trans, i = this.name, o =
|
|
1186
|
+
var hr = (ee.prototype._trans = function(e, n, r) {
|
|
1187
|
+
var a = this._tx || G.trans, i = this.name, o = Ee && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
1188
1188
|
function u(m, E, h) {
|
|
1189
1189
|
if (!h.schema[i]) throw new K.NotFound("Table " + i + " not part of transaction");
|
|
1190
1190
|
return n(h.idbtrans, h);
|
|
1191
1191
|
}
|
|
1192
|
-
var f =
|
|
1192
|
+
var f = nt();
|
|
1193
1193
|
try {
|
|
1194
|
-
var p = a && a.db._novip === this.db._novip ? a === G.trans ? a._promise(e, u, r) :
|
|
1194
|
+
var p = a && a.db._novip === this.db._novip ? a === G.trans ? a._promise(e, u, r) : Te(function() {
|
|
1195
1195
|
return a._promise(e, u, r);
|
|
1196
1196
|
}, { trans: a, transless: G.transless || G }) : function m(E, h, O, g) {
|
|
1197
1197
|
if (E.idbdb && (E._state.openComplete || G.letThrough || E._vip)) {
|
|
@@ -1199,12 +1199,12 @@ function Ga() {
|
|
|
1199
1199
|
try {
|
|
1200
1200
|
w.create(), E._state.PR1398_maxLoop = 3;
|
|
1201
1201
|
} catch (S) {
|
|
1202
|
-
return S.name ===
|
|
1202
|
+
return S.name === dn.InvalidState && E.isOpen() && 0 < --E._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), E.close({ disableAutoOpen: !1 }), E.open().then(function() {
|
|
1203
1203
|
return m(E, h, O, g);
|
|
1204
|
-
})) :
|
|
1204
|
+
})) : se(S);
|
|
1205
1205
|
}
|
|
1206
1206
|
return w._promise(h, function(S, y) {
|
|
1207
|
-
return
|
|
1207
|
+
return Te(function() {
|
|
1208
1208
|
return G.trans = w, g(S, y, w);
|
|
1209
1209
|
});
|
|
1210
1210
|
}).then(function(S) {
|
|
@@ -1217,9 +1217,9 @@ function Ga() {
|
|
|
1217
1217
|
});
|
|
1218
1218
|
});
|
|
1219
1219
|
}
|
|
1220
|
-
if (E._state.openComplete) return
|
|
1220
|
+
if (E._state.openComplete) return se(new K.DatabaseClosed(E._state.dbOpenError));
|
|
1221
1221
|
if (!E._state.isBeingOpened) {
|
|
1222
|
-
if (!E._state.autoOpen) return
|
|
1222
|
+
if (!E._state.autoOpen) return se(new K.DatabaseClosed());
|
|
1223
1223
|
E.open().catch(V);
|
|
1224
1224
|
}
|
|
1225
1225
|
return E._state.dbReadyPromise.then(function() {
|
|
@@ -1227,21 +1227,21 @@ function Ga() {
|
|
|
1227
1227
|
});
|
|
1228
1228
|
}(this.db, e, [this.name], u);
|
|
1229
1229
|
return o && (p._consoleTask = o, p = p.catch(function(m) {
|
|
1230
|
-
return console.trace(m),
|
|
1230
|
+
return console.trace(m), se(m);
|
|
1231
1231
|
})), p;
|
|
1232
1232
|
} finally {
|
|
1233
|
-
f &&
|
|
1233
|
+
f && rt();
|
|
1234
1234
|
}
|
|
1235
1235
|
}, ee.prototype.get = function(e, n) {
|
|
1236
1236
|
var r = this;
|
|
1237
|
-
return e && e.constructor === Object ? this.where(e).first(n) : e == null ?
|
|
1237
|
+
return e && e.constructor === Object ? this.where(e).first(n) : e == null ? se(new K.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(a) {
|
|
1238
1238
|
return r.core.get({ trans: a, key: e }).then(function(i) {
|
|
1239
1239
|
return r.hook.reading.fire(i);
|
|
1240
1240
|
});
|
|
1241
1241
|
}).then(n);
|
|
1242
1242
|
}, ee.prototype.where = function(e) {
|
|
1243
1243
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
1244
|
-
if (
|
|
1244
|
+
if (Y(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
1245
1245
|
var n = I(e);
|
|
1246
1246
|
if (n.length === 1) return this.where(n[0]).equals(e[n[0]]);
|
|
1247
1247
|
var r = this.schema.indexes.concat(this.schema.primKey).filter(function(f) {
|
|
@@ -1255,25 +1255,25 @@ function Ga() {
|
|
|
1255
1255
|
}).sort(function(f, p) {
|
|
1256
1256
|
return f.keyPath.length - p.keyPath.length;
|
|
1257
1257
|
})[0];
|
|
1258
|
-
if (r && this.db._maxKey !==
|
|
1258
|
+
if (r && this.db._maxKey !== Qe) {
|
|
1259
1259
|
var o = r.keyPath.slice(0, n.length);
|
|
1260
1260
|
return this.where(o).equals(o.map(function(p) {
|
|
1261
1261
|
return e[p];
|
|
1262
1262
|
}));
|
|
1263
1263
|
}
|
|
1264
|
-
!r &&
|
|
1264
|
+
!r && Ee && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(n.join("+"), "]"));
|
|
1265
1265
|
var a = this.schema.idxByName;
|
|
1266
1266
|
function i(f, p) {
|
|
1267
1267
|
return X(f, p) === 0;
|
|
1268
1268
|
}
|
|
1269
1269
|
var u = n.reduce(function(h, p) {
|
|
1270
1270
|
var m = h[0], E = h[1], h = a[p], O = e[p];
|
|
1271
|
-
return [m || h, m || !h ?
|
|
1272
|
-
return g =
|
|
1271
|
+
return [m || h, m || !h ? Xe(E, h && h.multi ? function(g) {
|
|
1272
|
+
return g = ve(g, p), Y(g) && g.some(function(w) {
|
|
1273
1273
|
return i(O, w);
|
|
1274
1274
|
});
|
|
1275
1275
|
} : function(g) {
|
|
1276
|
-
return i(O,
|
|
1276
|
+
return i(O, ve(g, p));
|
|
1277
1277
|
}) : E];
|
|
1278
1278
|
}, [null, null]), o = u[0], u = u[1];
|
|
1279
1279
|
return o ? this.where(o.name).equals(e[o.keyPath]).filter(u) : r ? this.filter(u) : this.where(n).equals("");
|
|
@@ -1292,7 +1292,7 @@ function Ga() {
|
|
|
1292
1292
|
}, ee.prototype.toCollection = function() {
|
|
1293
1293
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
1294
1294
|
}, ee.prototype.orderBy = function(e) {
|
|
1295
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
1295
|
+
return new this.db.Collection(new this.db.WhereClause(this, Y(e) ? "[".concat(e.join("+"), "]") : e));
|
|
1296
1296
|
}, ee.prototype.reverse = function() {
|
|
1297
1297
|
return this.toCollection().reverse();
|
|
1298
1298
|
}, ee.prototype.mapToClass = function(e) {
|
|
@@ -1300,7 +1300,7 @@ function Ga() {
|
|
|
1300
1300
|
function i() {
|
|
1301
1301
|
return n !== null && n.apply(this, arguments) || this;
|
|
1302
1302
|
}
|
|
1303
|
-
(this.schema.mappedClass = e).prototype instanceof
|
|
1303
|
+
(this.schema.mappedClass = e).prototype instanceof lr && (function(p, m) {
|
|
1304
1304
|
if (typeof m != "function" && m !== null) throw new TypeError("Class extends value " + String(m) + " is not a constructor or null");
|
|
1305
1305
|
function E() {
|
|
1306
1306
|
this.constructor = p;
|
|
@@ -1311,7 +1311,7 @@ function Ga() {
|
|
|
1311
1311
|
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
1312
1312
|
return a;
|
|
1313
1313
|
}, e = i);
|
|
1314
|
-
for (var o = /* @__PURE__ */ new Set(), u = e.prototype; u; u =
|
|
1314
|
+
for (var o = /* @__PURE__ */ new Set(), u = e.prototype; u; u = ue(u)) Object.getOwnPropertyNames(u).forEach(function(p) {
|
|
1315
1315
|
return o.add(p);
|
|
1316
1316
|
});
|
|
1317
1317
|
function f(p) {
|
|
@@ -1330,28 +1330,28 @@ function Ga() {
|
|
|
1330
1330
|
});
|
|
1331
1331
|
}, ee.prototype.add = function(e, n) {
|
|
1332
1332
|
var r = this, a = this.schema.primKey, i = a.auto, o = a.keyPath, u = e;
|
|
1333
|
-
return o && i && (u =
|
|
1333
|
+
return o && i && (u = Lt(o)(e)), this._trans("readwrite", function(f) {
|
|
1334
1334
|
return r.core.mutate({ trans: f, type: "add", keys: n != null ? [n] : null, values: [u] });
|
|
1335
1335
|
}).then(function(f) {
|
|
1336
1336
|
return f.numFailures ? M.reject(f.failures[0]) : f.lastResult;
|
|
1337
1337
|
}).then(function(f) {
|
|
1338
1338
|
if (o) try {
|
|
1339
|
-
|
|
1339
|
+
he(e, o, f);
|
|
1340
1340
|
} catch {
|
|
1341
1341
|
}
|
|
1342
1342
|
return f;
|
|
1343
1343
|
});
|
|
1344
1344
|
}, ee.prototype.update = function(e, n) {
|
|
1345
|
-
return typeof e != "object" ||
|
|
1345
|
+
return typeof e != "object" || Y(e) ? this.where(":id").equals(e).modify(n) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? se(new K.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(n));
|
|
1346
1346
|
}, ee.prototype.put = function(e, n) {
|
|
1347
1347
|
var r = this, a = this.schema.primKey, i = a.auto, o = a.keyPath, u = e;
|
|
1348
|
-
return o && i && (u =
|
|
1348
|
+
return o && i && (u = Lt(o)(e)), this._trans("readwrite", function(f) {
|
|
1349
1349
|
return r.core.mutate({ trans: f, type: "put", values: [u], keys: n != null ? [n] : null });
|
|
1350
1350
|
}).then(function(f) {
|
|
1351
1351
|
return f.numFailures ? M.reject(f.failures[0]) : f.lastResult;
|
|
1352
1352
|
}).then(function(f) {
|
|
1353
1353
|
if (o) try {
|
|
1354
|
-
|
|
1354
|
+
he(e, o, f);
|
|
1355
1355
|
} catch {
|
|
1356
1356
|
}
|
|
1357
1357
|
return f;
|
|
@@ -1366,7 +1366,7 @@ function Ga() {
|
|
|
1366
1366
|
}, ee.prototype.clear = function() {
|
|
1367
1367
|
var e = this;
|
|
1368
1368
|
return this._trans("readwrite", function(n) {
|
|
1369
|
-
return e.core.mutate({ trans: n, type: "deleteRange", range:
|
|
1369
|
+
return e.core.mutate({ trans: n, type: "deleteRange", range: ur });
|
|
1370
1370
|
}).then(function(n) {
|
|
1371
1371
|
return n.numFailures ? M.reject(n.failures[0]) : void 0;
|
|
1372
1372
|
});
|
|
@@ -1385,11 +1385,11 @@ function Ga() {
|
|
|
1385
1385
|
var m = a.schema.primKey, f = m.auto, m = m.keyPath;
|
|
1386
1386
|
if (m && i) throw new K.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
1387
1387
|
if (i && i.length !== e.length) throw new K.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1388
|
-
var p = e.length, m = m && f ? e.map(
|
|
1388
|
+
var p = e.length, m = m && f ? e.map(Lt(m)) : e;
|
|
1389
1389
|
return a.core.mutate({ trans: u, type: "add", keys: i, values: m, wantResults: o }).then(function(w) {
|
|
1390
1390
|
var h = w.numFailures, O = w.results, g = w.lastResult, w = w.failures;
|
|
1391
1391
|
if (h === 0) return o ? O : g;
|
|
1392
|
-
throw new
|
|
1392
|
+
throw new tt("".concat(a.name, ".bulkAdd(): ").concat(h, " of ").concat(p, " operations failed"), w);
|
|
1393
1393
|
});
|
|
1394
1394
|
});
|
|
1395
1395
|
}, ee.prototype.bulkPut = function(e, n, r) {
|
|
@@ -1398,11 +1398,11 @@ function Ga() {
|
|
|
1398
1398
|
var m = a.schema.primKey, f = m.auto, m = m.keyPath;
|
|
1399
1399
|
if (m && i) throw new K.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
1400
1400
|
if (i && i.length !== e.length) throw new K.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1401
|
-
var p = e.length, m = m && f ? e.map(
|
|
1401
|
+
var p = e.length, m = m && f ? e.map(Lt(m)) : e;
|
|
1402
1402
|
return a.core.mutate({ trans: u, type: "put", keys: i, values: m, wantResults: o }).then(function(w) {
|
|
1403
1403
|
var h = w.numFailures, O = w.results, g = w.lastResult, w = w.failures;
|
|
1404
1404
|
if (h === 0) return o ? O : g;
|
|
1405
|
-
throw new
|
|
1405
|
+
throw new tt("".concat(a.name, ".bulkPut(): ").concat(h, " of ").concat(p, " operations failed"), w);
|
|
1406
1406
|
});
|
|
1407
1407
|
});
|
|
1408
1408
|
}, ee.prototype.bulkUpdate = function(e) {
|
|
@@ -1417,11 +1417,11 @@ function Ga() {
|
|
|
1417
1417
|
e.forEach(function(h, O) {
|
|
1418
1418
|
var g = h.key, w = h.changes, S = f[O];
|
|
1419
1419
|
if (S) {
|
|
1420
|
-
for (var y = 0,
|
|
1421
|
-
var D =
|
|
1420
|
+
for (var y = 0, P = Object.keys(w); y < P.length; y++) {
|
|
1421
|
+
var D = P[y], R = w[D];
|
|
1422
1422
|
if (D === n.schema.primKey.keyPath) {
|
|
1423
1423
|
if (X(R, g) !== 0) throw new K.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1424
|
-
} else
|
|
1424
|
+
} else he(S, D, R);
|
|
1425
1425
|
}
|
|
1426
1426
|
o.push(O), p.push(g), m.push(S);
|
|
1427
1427
|
}
|
|
@@ -1431,10 +1431,10 @@ function Ga() {
|
|
|
1431
1431
|
var O = h.numFailures, g = h.failures;
|
|
1432
1432
|
if (O === 0) return E;
|
|
1433
1433
|
for (var w = 0, S = Object.keys(g); w < S.length; w++) {
|
|
1434
|
-
var y,
|
|
1435
|
-
D != null && (y = g[
|
|
1434
|
+
var y, P = S[w], D = o[Number(P)];
|
|
1435
|
+
D != null && (y = g[P], delete g[P], g[D] = y);
|
|
1436
1436
|
}
|
|
1437
|
-
throw new
|
|
1437
|
+
throw new tt("".concat(n.name, ".bulkUpdate(): ").concat(O, " of ").concat(E, " operations failed"), g);
|
|
1438
1438
|
});
|
|
1439
1439
|
});
|
|
1440
1440
|
});
|
|
@@ -1445,12 +1445,12 @@ function Ga() {
|
|
|
1445
1445
|
}).then(function(u) {
|
|
1446
1446
|
var i = u.numFailures, o = u.lastResult, u = u.failures;
|
|
1447
1447
|
if (i === 0) return o;
|
|
1448
|
-
throw new
|
|
1448
|
+
throw new tt("".concat(n.name, ".bulkDelete(): ").concat(i, " of ").concat(r, " operations failed"), u);
|
|
1449
1449
|
});
|
|
1450
1450
|
}, ee);
|
|
1451
1451
|
function ee() {
|
|
1452
1452
|
}
|
|
1453
|
-
function
|
|
1453
|
+
function mt(e) {
|
|
1454
1454
|
function n(u, f) {
|
|
1455
1455
|
if (f) {
|
|
1456
1456
|
for (var p = arguments.length, m = new Array(p - 1); --p; ) m[p - 1] = arguments[p];
|
|
@@ -1477,13 +1477,13 @@ function Ga() {
|
|
|
1477
1477
|
}
|
|
1478
1478
|
I(m = u).forEach(function(h) {
|
|
1479
1479
|
var O = m[h];
|
|
1480
|
-
if (
|
|
1480
|
+
if (Y(O)) o(h, m[h][0], m[h][1]);
|
|
1481
1481
|
else {
|
|
1482
1482
|
if (O !== "asap") throw new K.InvalidArgument("Invalid event config");
|
|
1483
|
-
var g = o(h,
|
|
1483
|
+
var g = o(h, dt, function() {
|
|
1484
1484
|
for (var w = arguments.length, S = new Array(w); w--; ) S[w] = arguments[w];
|
|
1485
1485
|
g.subscribers.forEach(function(y) {
|
|
1486
|
-
|
|
1486
|
+
Rt(function() {
|
|
1487
1487
|
y.apply(null, S);
|
|
1488
1488
|
});
|
|
1489
1489
|
});
|
|
@@ -1492,33 +1492,33 @@ function Ga() {
|
|
|
1492
1492
|
});
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
|
-
function
|
|
1496
|
-
return
|
|
1495
|
+
function bt(e, n) {
|
|
1496
|
+
return _e(n).from({ prototype: e }), n;
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1498
|
+
function it(e, n) {
|
|
1499
1499
|
return !(e.filter || e.algorithm || e.or) && (n ? e.justLimit : !e.replayFilter);
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1502
|
-
e.filter =
|
|
1501
|
+
function On(e, n) {
|
|
1502
|
+
e.filter = Xe(e.filter, n);
|
|
1503
1503
|
}
|
|
1504
|
-
function
|
|
1504
|
+
function _n(e, n, r) {
|
|
1505
1505
|
var a = e.replayFilter;
|
|
1506
1506
|
e.replayFilter = a ? function() {
|
|
1507
|
-
return
|
|
1507
|
+
return Xe(a(), n());
|
|
1508
1508
|
} : n, e.justLimit = r && !a;
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1510
|
+
function Ft(e, n) {
|
|
1511
1511
|
if (e.isPrimKey) return n.primaryKey;
|
|
1512
1512
|
var r = n.getIndexByKeyPath(e.index);
|
|
1513
1513
|
if (!r) throw new K.Schema("KeyPath " + e.index + " on object store " + n.name + " is not indexed");
|
|
1514
1514
|
return r;
|
|
1515
1515
|
}
|
|
1516
|
-
function
|
|
1517
|
-
var a =
|
|
1516
|
+
function pr(e, n, r) {
|
|
1517
|
+
var a = Ft(e, n.schema);
|
|
1518
1518
|
return n.openCursor({ trans: r, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: a, range: e.range } });
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1521
|
-
var i = e.replayFilter ?
|
|
1520
|
+
function Wt(e, n, r, a) {
|
|
1521
|
+
var i = e.replayFilter ? Xe(e.filter, e.replayFilter()) : e.filter;
|
|
1522
1522
|
if (e.or) {
|
|
1523
1523
|
var o = {}, u = function(f, p, m) {
|
|
1524
1524
|
var E, h;
|
|
@@ -1528,11 +1528,11 @@ function Ga() {
|
|
|
1528
1528
|
return p.fail(O);
|
|
1529
1529
|
}) || ((h = "" + (E = p.primaryKey)) == "[object ArrayBuffer]" && (h = "" + new Uint8Array(E)), Q(o, h) || (o[h] = !0, n(f, p, m)));
|
|
1530
1530
|
};
|
|
1531
|
-
return Promise.all([e.or._iterate(u, r),
|
|
1531
|
+
return Promise.all([e.or._iterate(u, r), gr(pr(e, a, r), e.algorithm, u, !e.keysOnly && e.valueMapper)]);
|
|
1532
1532
|
}
|
|
1533
|
-
return
|
|
1533
|
+
return gr(pr(e, a, r), Xe(e.algorithm, i), n, !e.keysOnly && e.valueMapper);
|
|
1534
1534
|
}
|
|
1535
|
-
function
|
|
1535
|
+
function gr(e, n, r, a) {
|
|
1536
1536
|
var i = te(a ? function(o, u, f) {
|
|
1537
1537
|
return r(a(o), u, f);
|
|
1538
1538
|
} : r);
|
|
@@ -1553,11 +1553,11 @@ function Ga() {
|
|
|
1553
1553
|
});
|
|
1554
1554
|
});
|
|
1555
1555
|
}
|
|
1556
|
-
var
|
|
1556
|
+
var yt = (mr.prototype.execute = function(e) {
|
|
1557
1557
|
var n = this["@@propmod"];
|
|
1558
1558
|
if (n.add !== void 0) {
|
|
1559
1559
|
var r = n.add;
|
|
1560
|
-
if (
|
|
1560
|
+
if (Y(r)) return v(v([], Y(e) ? e : [], !0), r).sort();
|
|
1561
1561
|
if (typeof r == "number") return (Number(e) || 0) + r;
|
|
1562
1562
|
if (typeof r == "bigint") try {
|
|
1563
1563
|
return BigInt(e) + r;
|
|
@@ -1568,7 +1568,7 @@ function Ga() {
|
|
|
1568
1568
|
}
|
|
1569
1569
|
if (n.remove !== void 0) {
|
|
1570
1570
|
var a = n.remove;
|
|
1571
|
-
if (
|
|
1571
|
+
if (Y(a)) return Y(e) ? e.filter(function(i) {
|
|
1572
1572
|
return !a.includes(i);
|
|
1573
1573
|
}).sort() : [];
|
|
1574
1574
|
if (typeof a == "number") return Number(e) - a;
|
|
@@ -1580,21 +1580,21 @@ function Ga() {
|
|
|
1580
1580
|
throw new TypeError("Invalid subtrahend ".concat(a));
|
|
1581
1581
|
}
|
|
1582
1582
|
return r = (r = n.replacePrefix) === null || r === void 0 ? void 0 : r[0], r && typeof e == "string" && e.startsWith(r) ? n.replacePrefix[1] + e.substring(r.length) : e;
|
|
1583
|
-
},
|
|
1584
|
-
function
|
|
1583
|
+
}, mr);
|
|
1584
|
+
function mr(e) {
|
|
1585
1585
|
this["@@propmod"] = e;
|
|
1586
1586
|
}
|
|
1587
1587
|
var sa = (J.prototype._read = function(e, n) {
|
|
1588
1588
|
var r = this._ctx;
|
|
1589
|
-
return r.error ? r.table._trans(null,
|
|
1589
|
+
return r.error ? r.table._trans(null, se.bind(null, r.error)) : r.table._trans("readonly", e).then(n);
|
|
1590
1590
|
}, J.prototype._write = function(e) {
|
|
1591
1591
|
var n = this._ctx;
|
|
1592
|
-
return n.error ? n.table._trans(null,
|
|
1592
|
+
return n.error ? n.table._trans(null, se.bind(null, n.error)) : n.table._trans("readwrite", e, "locked");
|
|
1593
1593
|
}, J.prototype._addAlgorithm = function(e) {
|
|
1594
1594
|
var n = this._ctx;
|
|
1595
|
-
n.algorithm =
|
|
1595
|
+
n.algorithm = Xe(n.algorithm, e);
|
|
1596
1596
|
}, J.prototype._iterate = function(e, n) {
|
|
1597
|
-
return
|
|
1597
|
+
return Wt(this._ctx, e, n, this._ctx.table.core);
|
|
1598
1598
|
}, J.prototype.clone = function(e) {
|
|
1599
1599
|
var n = Object.create(this.constructor.prototype), r = Object.create(this._ctx);
|
|
1600
1600
|
return e && ne(r, e), n._ctx = r, n;
|
|
@@ -1603,17 +1603,17 @@ function Ga() {
|
|
|
1603
1603
|
}, J.prototype.each = function(e) {
|
|
1604
1604
|
var n = this._ctx;
|
|
1605
1605
|
return this._read(function(r) {
|
|
1606
|
-
return
|
|
1606
|
+
return Wt(n, e, r, n.table.core);
|
|
1607
1607
|
});
|
|
1608
1608
|
}, J.prototype.count = function(e) {
|
|
1609
1609
|
var n = this;
|
|
1610
1610
|
return this._read(function(r) {
|
|
1611
1611
|
var a = n._ctx, i = a.table.core;
|
|
1612
|
-
if (
|
|
1612
|
+
if (it(a, !0)) return i.count({ trans: r, query: { index: Ft(a, i.schema), range: a.range } }).then(function(u) {
|
|
1613
1613
|
return Math.min(u, a.limit);
|
|
1614
1614
|
});
|
|
1615
1615
|
var o = 0;
|
|
1616
|
-
return
|
|
1616
|
+
return Wt(a, function() {
|
|
1617
1617
|
return ++o, !1;
|
|
1618
1618
|
}, r, i).then(function() {
|
|
1619
1619
|
return o;
|
|
@@ -1635,14 +1635,14 @@ function Ga() {
|
|
|
1635
1635
|
var n = this;
|
|
1636
1636
|
return this._read(function(r) {
|
|
1637
1637
|
var a = n._ctx;
|
|
1638
|
-
if (a.dir === "next" &&
|
|
1639
|
-
var i = a.valueMapper, o =
|
|
1638
|
+
if (a.dir === "next" && it(a, !0) && 0 < a.limit) {
|
|
1639
|
+
var i = a.valueMapper, o = Ft(a, a.table.core.schema);
|
|
1640
1640
|
return a.table.core.query({ trans: r, limit: a.limit, values: !0, query: { index: o, range: a.range } }).then(function(f) {
|
|
1641
1641
|
return f = f.result, i ? f.map(i) : f;
|
|
1642
1642
|
});
|
|
1643
1643
|
}
|
|
1644
1644
|
var u = [];
|
|
1645
|
-
return
|
|
1645
|
+
return Wt(a, function(f) {
|
|
1646
1646
|
return u.push(f);
|
|
1647
1647
|
}, r, a.table.core).then(function() {
|
|
1648
1648
|
return u;
|
|
@@ -1650,28 +1650,28 @@ function Ga() {
|
|
|
1650
1650
|
}, e);
|
|
1651
1651
|
}, J.prototype.offset = function(e) {
|
|
1652
1652
|
var n = this._ctx;
|
|
1653
|
-
return e <= 0 || (n.offset += e,
|
|
1653
|
+
return e <= 0 || (n.offset += e, it(n) ? _n(n, function() {
|
|
1654
1654
|
var r = e;
|
|
1655
1655
|
return function(a, i) {
|
|
1656
1656
|
return r === 0 || (r === 1 ? --r : i(function() {
|
|
1657
1657
|
a.advance(r), r = 0;
|
|
1658
1658
|
}), !1);
|
|
1659
1659
|
};
|
|
1660
|
-
}) :
|
|
1660
|
+
}) : _n(n, function() {
|
|
1661
1661
|
var r = e;
|
|
1662
1662
|
return function() {
|
|
1663
1663
|
return --r < 0;
|
|
1664
1664
|
};
|
|
1665
1665
|
})), this;
|
|
1666
1666
|
}, J.prototype.limit = function(e) {
|
|
1667
|
-
return this._ctx.limit = Math.min(this._ctx.limit, e),
|
|
1667
|
+
return this._ctx.limit = Math.min(this._ctx.limit, e), _n(this._ctx, function() {
|
|
1668
1668
|
var n = e;
|
|
1669
1669
|
return function(r, a, i) {
|
|
1670
1670
|
return --n <= 0 && a(i), 0 <= n;
|
|
1671
1671
|
};
|
|
1672
1672
|
}, !0), this;
|
|
1673
1673
|
}, J.prototype.until = function(e, n) {
|
|
1674
|
-
return
|
|
1674
|
+
return On(this._ctx, function(r, a, i) {
|
|
1675
1675
|
return !e(r.value) || (a(i), n);
|
|
1676
1676
|
}), this;
|
|
1677
1677
|
}, J.prototype.first = function(e) {
|
|
@@ -1682,9 +1682,9 @@ function Ga() {
|
|
|
1682
1682
|
return this.reverse().first(e);
|
|
1683
1683
|
}, J.prototype.filter = function(e) {
|
|
1684
1684
|
var n;
|
|
1685
|
-
return
|
|
1685
|
+
return On(this._ctx, function(r) {
|
|
1686
1686
|
return e(r.value);
|
|
1687
|
-
}), (n = this._ctx).isMatch =
|
|
1687
|
+
}), (n = this._ctx).isMatch = Xe(n.isMatch, e), this;
|
|
1688
1688
|
}, J.prototype.and = function(e) {
|
|
1689
1689
|
return this.filter(e);
|
|
1690
1690
|
}, J.prototype.or = function(e) {
|
|
@@ -1716,8 +1716,8 @@ function Ga() {
|
|
|
1716
1716
|
}).then(e);
|
|
1717
1717
|
}, J.prototype.primaryKeys = function(e) {
|
|
1718
1718
|
var n = this._ctx;
|
|
1719
|
-
if (n.dir === "next" &&
|
|
1720
|
-
var i =
|
|
1719
|
+
if (n.dir === "next" && it(n, !0) && 0 < n.limit) return this._read(function(a) {
|
|
1720
|
+
var i = Ft(n, n.table.core.schema);
|
|
1721
1721
|
return n.table.core.query({ trans: a, values: !1, limit: n.limit, query: { index: i, range: n.range } });
|
|
1722
1722
|
}).then(function(a) {
|
|
1723
1723
|
return a.result;
|
|
@@ -1741,7 +1741,7 @@ function Ga() {
|
|
|
1741
1741
|
var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
|
|
1742
1742
|
if (!e || !e.multi) return this;
|
|
1743
1743
|
var n = {};
|
|
1744
|
-
return
|
|
1744
|
+
return On(this._ctx, function(i) {
|
|
1745
1745
|
var a = i.primaryKey.toString(), i = Q(n, a);
|
|
1746
1746
|
return n[a] = !0, !i;
|
|
1747
1747
|
}), this;
|
|
@@ -1750,11 +1750,11 @@ function Ga() {
|
|
|
1750
1750
|
return this._write(function(a) {
|
|
1751
1751
|
var i, o, u;
|
|
1752
1752
|
u = typeof e == "function" ? e : (i = I(e), o = i.length, function(y) {
|
|
1753
|
-
for (var
|
|
1754
|
-
var R = i[D], x = e[R], k =
|
|
1755
|
-
x instanceof
|
|
1753
|
+
for (var P = !1, D = 0; D < o; ++D) {
|
|
1754
|
+
var R = i[D], x = e[R], k = ve(y, R);
|
|
1755
|
+
x instanceof yt ? (he(y, R, x.execute(k)), P = !0) : k !== x && (he(y, R, x), P = !0);
|
|
1756
1756
|
}
|
|
1757
|
-
return
|
|
1757
|
+
return P;
|
|
1758
1758
|
});
|
|
1759
1759
|
var f = r.table.core, h = f.schema.primaryKey, p = h.outbound, m = h.extractKey, E = 200, h = n.db._options.modifyChunkSize;
|
|
1760
1760
|
h && (E = typeof h == "object" ? h[f.name] || h["*"] || 200 : h);
|
|
@@ -1768,54 +1768,54 @@ function Ga() {
|
|
|
1768
1768
|
}
|
|
1769
1769
|
var g = [], w = 0, S = [];
|
|
1770
1770
|
return n.clone().primaryKeys().then(function(y) {
|
|
1771
|
-
function
|
|
1771
|
+
function P(R) {
|
|
1772
1772
|
var x = Math.min(E, y.length - R);
|
|
1773
1773
|
return f.getMany({ trans: a, keys: y.slice(R, R + x), cache: "immutable" }).then(function(k) {
|
|
1774
1774
|
for (var $ = [], T = [], N = p ? [] : null, j = [], C = 0; C < x; ++C) {
|
|
1775
|
-
var B = k[C], W = { value:
|
|
1775
|
+
var B = k[C], W = { value: Ke(B), primKey: y[R + C] };
|
|
1776
1776
|
u.call(W, W.value, W) !== !1 && (W.value == null ? j.push(y[R + C]) : p || X(m(B), m(W.value)) === 0 ? (T.push(W.value), p && N.push(y[R + C])) : (j.push(y[R + C]), $.push(W.value)));
|
|
1777
1777
|
}
|
|
1778
|
-
return Promise.resolve(0 < $.length && f.mutate({ trans: a, type: "add", values: $ }).then(function(
|
|
1779
|
-
for (var
|
|
1780
|
-
O($.length,
|
|
1778
|
+
return Promise.resolve(0 < $.length && f.mutate({ trans: a, type: "add", values: $ }).then(function(z) {
|
|
1779
|
+
for (var H in z.failures) j.splice(parseInt(H), 1);
|
|
1780
|
+
O($.length, z);
|
|
1781
1781
|
})).then(function() {
|
|
1782
|
-
return (0 < T.length || D && typeof e == "object") && f.mutate({ trans: a, type: "put", keys: N, values: T, criteria: D, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < R }).then(function(
|
|
1783
|
-
return O(T.length,
|
|
1782
|
+
return (0 < T.length || D && typeof e == "object") && f.mutate({ trans: a, type: "put", keys: N, values: T, criteria: D, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < R }).then(function(z) {
|
|
1783
|
+
return O(T.length, z);
|
|
1784
1784
|
});
|
|
1785
1785
|
}).then(function() {
|
|
1786
|
-
return (0 < j.length || D && e ===
|
|
1787
|
-
return O(j.length,
|
|
1786
|
+
return (0 < j.length || D && e === An) && f.mutate({ trans: a, type: "delete", keys: j, criteria: D, isAdditionalChunk: 0 < R }).then(function(z) {
|
|
1787
|
+
return O(j.length, z);
|
|
1788
1788
|
});
|
|
1789
1789
|
}).then(function() {
|
|
1790
|
-
return y.length > R + x &&
|
|
1790
|
+
return y.length > R + x && P(R + E);
|
|
1791
1791
|
});
|
|
1792
1792
|
});
|
|
1793
1793
|
}
|
|
1794
|
-
var D =
|
|
1795
|
-
return
|
|
1796
|
-
if (0 < g.length) throw new
|
|
1794
|
+
var D = it(r) && r.limit === 1 / 0 && (typeof e != "function" || e === An) && { index: r.index, range: r.range };
|
|
1795
|
+
return P(0).then(function() {
|
|
1796
|
+
if (0 < g.length) throw new It("Error modifying one or more objects", g, w, S);
|
|
1797
1797
|
return y.length;
|
|
1798
1798
|
});
|
|
1799
1799
|
});
|
|
1800
1800
|
});
|
|
1801
1801
|
}, J.prototype.delete = function() {
|
|
1802
1802
|
var e = this._ctx, n = e.range;
|
|
1803
|
-
return
|
|
1803
|
+
return it(e) && (e.isPrimKey || n.type === 3) ? this._write(function(r) {
|
|
1804
1804
|
var a = e.table.core.schema.primaryKey, i = n;
|
|
1805
1805
|
return e.table.core.count({ trans: r, query: { index: a, range: i } }).then(function(o) {
|
|
1806
1806
|
return e.table.core.mutate({ trans: r, type: "deleteRange", range: i }).then(function(u) {
|
|
1807
1807
|
var f = u.failures;
|
|
1808
|
-
if (u.lastResult, u.results, u = u.numFailures, u) throw new
|
|
1808
|
+
if (u.lastResult, u.results, u = u.numFailures, u) throw new It("Could not delete some values", Object.keys(f).map(function(p) {
|
|
1809
1809
|
return f[p];
|
|
1810
1810
|
}), o - u);
|
|
1811
1811
|
return o - u;
|
|
1812
1812
|
});
|
|
1813
1813
|
});
|
|
1814
|
-
}) : this.modify(
|
|
1814
|
+
}) : this.modify(An);
|
|
1815
1815
|
}, J);
|
|
1816
1816
|
function J() {
|
|
1817
1817
|
}
|
|
1818
|
-
var
|
|
1818
|
+
var An = function(e, n) {
|
|
1819
1819
|
return n.value = null;
|
|
1820
1820
|
};
|
|
1821
1821
|
function ia(e, n) {
|
|
@@ -1824,19 +1824,19 @@ function Ga() {
|
|
|
1824
1824
|
function oa(e, n) {
|
|
1825
1825
|
return n < e ? -1 : e === n ? 0 : 1;
|
|
1826
1826
|
}
|
|
1827
|
-
function
|
|
1828
|
-
return e = e instanceof
|
|
1827
|
+
function me(e, n, r) {
|
|
1828
|
+
return e = e instanceof yr ? new e.Collection(e) : e, e._ctx.error = new (r || TypeError)(n), e;
|
|
1829
1829
|
}
|
|
1830
|
-
function
|
|
1830
|
+
function ot(e) {
|
|
1831
1831
|
return new e.Collection(e, function() {
|
|
1832
|
-
return
|
|
1832
|
+
return br("");
|
|
1833
1833
|
}).limit(0);
|
|
1834
1834
|
}
|
|
1835
|
-
function
|
|
1835
|
+
function Ut(e, n, r, a) {
|
|
1836
1836
|
var i, o, u, f, p, m, E, h = r.length;
|
|
1837
1837
|
if (!r.every(function(w) {
|
|
1838
1838
|
return typeof w == "string";
|
|
1839
|
-
})) return
|
|
1839
|
+
})) return me(e, cr);
|
|
1840
1840
|
function O(w) {
|
|
1841
1841
|
i = w === "next" ? function(y) {
|
|
1842
1842
|
return y.toUpperCase();
|
|
@@ -1849,8 +1849,8 @@ function Ga() {
|
|
|
1849
1849
|
}, u = w === "next" ? ia : oa;
|
|
1850
1850
|
var S = r.map(function(y) {
|
|
1851
1851
|
return { lower: o(y), upper: i(y) };
|
|
1852
|
-
}).sort(function(y,
|
|
1853
|
-
return u(y.lower,
|
|
1852
|
+
}).sort(function(y, P) {
|
|
1853
|
+
return u(y.lower, P.lower);
|
|
1854
1854
|
});
|
|
1855
1855
|
f = S.map(function(y) {
|
|
1856
1856
|
return y.upper;
|
|
@@ -1859,25 +1859,25 @@ function Ga() {
|
|
|
1859
1859
|
}), E = (m = w) === "next" ? "" : a;
|
|
1860
1860
|
}
|
|
1861
1861
|
O("next"), e = new e.Collection(e, function() {
|
|
1862
|
-
return
|
|
1862
|
+
return $e(f[0], p[h - 1] + a);
|
|
1863
1863
|
}), e._ondirectionchange = function(w) {
|
|
1864
1864
|
O(w);
|
|
1865
1865
|
};
|
|
1866
1866
|
var g = 0;
|
|
1867
1867
|
return e._addAlgorithm(function(w, S, y) {
|
|
1868
|
-
var
|
|
1869
|
-
if (typeof
|
|
1870
|
-
var D = o(
|
|
1868
|
+
var P = w.key;
|
|
1869
|
+
if (typeof P != "string") return !1;
|
|
1870
|
+
var D = o(P);
|
|
1871
1871
|
if (n(D, p, g)) return !0;
|
|
1872
1872
|
for (var R = null, x = g; x < h; ++x) {
|
|
1873
1873
|
var k = function($, T, N, j, C, B) {
|
|
1874
|
-
for (var W = Math.min($.length, j.length),
|
|
1875
|
-
var
|
|
1876
|
-
if (
|
|
1877
|
-
C($[
|
|
1874
|
+
for (var W = Math.min($.length, j.length), z = -1, H = 0; H < W; ++H) {
|
|
1875
|
+
var be = T[H];
|
|
1876
|
+
if (be !== j[H]) return C($[H], N[H]) < 0 ? $.substr(0, H) + N[H] + N.substr(H + 1) : C($[H], j[H]) < 0 ? $.substr(0, H) + j[H] + N.substr(H + 1) : 0 <= z ? $.substr(0, z) + T[z] + N.substr(z + 1) : null;
|
|
1877
|
+
C($[H], be) < 0 && (z = H);
|
|
1878
1878
|
}
|
|
1879
|
-
return W < j.length && B === "next" ? $ + N.substr($.length) : W < $.length && B === "prev" ? $.substr(0, N.length) :
|
|
1880
|
-
}(
|
|
1879
|
+
return W < j.length && B === "next" ? $ + N.substr($.length) : W < $.length && B === "prev" ? $.substr(0, N.length) : z < 0 ? null : $.substr(0, z) + j[z] + N.substr(z + 1);
|
|
1880
|
+
}(P, D, f[x], p[x], u, m);
|
|
1881
1881
|
k === null && R === null ? g = x + 1 : (R === null || 0 < u(R, k)) && (R = k);
|
|
1882
1882
|
}
|
|
1883
1883
|
return S(R !== null ? function() {
|
|
@@ -1885,75 +1885,75 @@ function Ga() {
|
|
|
1885
1885
|
} : y), !1;
|
|
1886
1886
|
}), e;
|
|
1887
1887
|
}
|
|
1888
|
-
function
|
|
1888
|
+
function $e(e, n, r, a) {
|
|
1889
1889
|
return { type: 2, lower: e, upper: n, lowerOpen: r, upperOpen: a };
|
|
1890
1890
|
}
|
|
1891
|
-
function
|
|
1891
|
+
function br(e) {
|
|
1892
1892
|
return { type: 1, lower: e, upper: e };
|
|
1893
1893
|
}
|
|
1894
|
-
var
|
|
1894
|
+
var yr = (Object.defineProperty(ce.prototype, "Collection", { get: function() {
|
|
1895
1895
|
return this._ctx.table.db.Collection;
|
|
1896
|
-
}, enumerable: !1, configurable: !0 }),
|
|
1896
|
+
}, enumerable: !1, configurable: !0 }), ce.prototype.between = function(e, n, r, a) {
|
|
1897
1897
|
r = r !== !1, a = a === !0;
|
|
1898
1898
|
try {
|
|
1899
|
-
return 0 < this._cmp(e, n) || this._cmp(e, n) === 0 && (r || a) && (!r || !a) ?
|
|
1900
|
-
return
|
|
1899
|
+
return 0 < this._cmp(e, n) || this._cmp(e, n) === 0 && (r || a) && (!r || !a) ? ot(this) : new this.Collection(this, function() {
|
|
1900
|
+
return $e(e, n, !r, !a);
|
|
1901
1901
|
});
|
|
1902
1902
|
} catch {
|
|
1903
|
-
return
|
|
1903
|
+
return me(this, Pe);
|
|
1904
1904
|
}
|
|
1905
|
-
},
|
|
1906
|
-
return e == null ?
|
|
1907
|
-
return
|
|
1905
|
+
}, ce.prototype.equals = function(e) {
|
|
1906
|
+
return e == null ? me(this, Pe) : new this.Collection(this, function() {
|
|
1907
|
+
return br(e);
|
|
1908
1908
|
});
|
|
1909
|
-
},
|
|
1910
|
-
return e == null ?
|
|
1911
|
-
return
|
|
1909
|
+
}, ce.prototype.above = function(e) {
|
|
1910
|
+
return e == null ? me(this, Pe) : new this.Collection(this, function() {
|
|
1911
|
+
return $e(e, void 0, !0);
|
|
1912
1912
|
});
|
|
1913
|
-
},
|
|
1914
|
-
return e == null ?
|
|
1915
|
-
return
|
|
1913
|
+
}, ce.prototype.aboveOrEqual = function(e) {
|
|
1914
|
+
return e == null ? me(this, Pe) : new this.Collection(this, function() {
|
|
1915
|
+
return $e(e, void 0, !1);
|
|
1916
1916
|
});
|
|
1917
|
-
},
|
|
1918
|
-
return e == null ?
|
|
1919
|
-
return
|
|
1917
|
+
}, ce.prototype.below = function(e) {
|
|
1918
|
+
return e == null ? me(this, Pe) : new this.Collection(this, function() {
|
|
1919
|
+
return $e(void 0, e, !1, !0);
|
|
1920
1920
|
});
|
|
1921
|
-
},
|
|
1922
|
-
return e == null ?
|
|
1923
|
-
return
|
|
1921
|
+
}, ce.prototype.belowOrEqual = function(e) {
|
|
1922
|
+
return e == null ? me(this, Pe) : new this.Collection(this, function() {
|
|
1923
|
+
return $e(void 0, e);
|
|
1924
1924
|
});
|
|
1925
|
-
},
|
|
1926
|
-
return typeof e != "string" ?
|
|
1927
|
-
},
|
|
1928
|
-
return e === "" ? this.startsWith(e) :
|
|
1925
|
+
}, ce.prototype.startsWith = function(e) {
|
|
1926
|
+
return typeof e != "string" ? me(this, cr) : this.between(e, e + Qe, !0, !0);
|
|
1927
|
+
}, ce.prototype.startsWithIgnoreCase = function(e) {
|
|
1928
|
+
return e === "" ? this.startsWith(e) : Ut(this, function(n, r) {
|
|
1929
1929
|
return n.indexOf(r[0]) === 0;
|
|
1930
|
-
}, [e],
|
|
1931
|
-
},
|
|
1932
|
-
return
|
|
1930
|
+
}, [e], Qe);
|
|
1931
|
+
}, ce.prototype.equalsIgnoreCase = function(e) {
|
|
1932
|
+
return Ut(this, function(n, r) {
|
|
1933
1933
|
return n === r[0];
|
|
1934
1934
|
}, [e], "");
|
|
1935
|
-
},
|
|
1936
|
-
var e =
|
|
1937
|
-
return e.length === 0 ?
|
|
1935
|
+
}, ce.prototype.anyOfIgnoreCase = function() {
|
|
1936
|
+
var e = Ae.apply(qe, arguments);
|
|
1937
|
+
return e.length === 0 ? ot(this) : Ut(this, function(n, r) {
|
|
1938
1938
|
return r.indexOf(n) !== -1;
|
|
1939
1939
|
}, e, "");
|
|
1940
|
-
},
|
|
1941
|
-
var e =
|
|
1942
|
-
return e.length === 0 ?
|
|
1940
|
+
}, ce.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1941
|
+
var e = Ae.apply(qe, arguments);
|
|
1942
|
+
return e.length === 0 ? ot(this) : Ut(this, function(n, r) {
|
|
1943
1943
|
return r.some(function(a) {
|
|
1944
1944
|
return n.indexOf(a) === 0;
|
|
1945
1945
|
});
|
|
1946
|
-
}, e,
|
|
1947
|
-
},
|
|
1948
|
-
var e = this, n =
|
|
1946
|
+
}, e, Qe);
|
|
1947
|
+
}, ce.prototype.anyOf = function() {
|
|
1948
|
+
var e = this, n = Ae.apply(qe, arguments), r = this._cmp;
|
|
1949
1949
|
try {
|
|
1950
1950
|
n.sort(r);
|
|
1951
1951
|
} catch {
|
|
1952
|
-
return
|
|
1952
|
+
return me(this, Pe);
|
|
1953
1953
|
}
|
|
1954
|
-
if (n.length === 0) return
|
|
1954
|
+
if (n.length === 0) return ot(this);
|
|
1955
1955
|
var a = new this.Collection(this, function() {
|
|
1956
|
-
return
|
|
1956
|
+
return $e(n[0], n[n.length - 1]);
|
|
1957
1957
|
});
|
|
1958
1958
|
a._ondirectionchange = function(o) {
|
|
1959
1959
|
r = o === "next" ? e._ascending : e._descending, n.sort(r);
|
|
@@ -1965,32 +1965,32 @@ function Ga() {
|
|
|
1965
1965
|
o.continue(n[i]);
|
|
1966
1966
|
}), !1);
|
|
1967
1967
|
}), a;
|
|
1968
|
-
},
|
|
1968
|
+
}, ce.prototype.notEqual = function(e) {
|
|
1969
1969
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1970
|
-
},
|
|
1971
|
-
var e =
|
|
1970
|
+
}, ce.prototype.noneOf = function() {
|
|
1971
|
+
var e = Ae.apply(qe, arguments);
|
|
1972
1972
|
if (e.length === 0) return new this.Collection(this);
|
|
1973
1973
|
try {
|
|
1974
1974
|
e.sort(this._ascending);
|
|
1975
1975
|
} catch {
|
|
1976
|
-
return
|
|
1976
|
+
return me(this, Pe);
|
|
1977
1977
|
}
|
|
1978
1978
|
var n = e.reduce(function(r, a) {
|
|
1979
1979
|
return r ? r.concat([[r[r.length - 1][1], a]]) : [[-1 / 0, a]];
|
|
1980
1980
|
}, null);
|
|
1981
1981
|
return n.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(n, { includeLowers: !1, includeUppers: !1 });
|
|
1982
|
-
},
|
|
1982
|
+
}, ce.prototype.inAnyRange = function(P, n) {
|
|
1983
1983
|
var r = this, a = this._cmp, i = this._ascending, o = this._descending, u = this._min, f = this._max;
|
|
1984
|
-
if (
|
|
1985
|
-
if (!
|
|
1984
|
+
if (P.length === 0) return ot(this);
|
|
1985
|
+
if (!P.every(function(D) {
|
|
1986
1986
|
return D[0] !== void 0 && D[1] !== void 0 && i(D[0], D[1]) <= 0;
|
|
1987
|
-
})) return
|
|
1987
|
+
})) return me(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", K.InvalidArgument);
|
|
1988
1988
|
var p = !n || n.includeLowers !== !1, m = n && n.includeUppers === !0, E, h = i;
|
|
1989
1989
|
function O(D, R) {
|
|
1990
1990
|
return h(D[0], R[0]);
|
|
1991
1991
|
}
|
|
1992
1992
|
try {
|
|
1993
|
-
(E =
|
|
1993
|
+
(E = P.reduce(function(D, R) {
|
|
1994
1994
|
for (var x = 0, k = D.length; x < k; ++x) {
|
|
1995
1995
|
var $ = D[x];
|
|
1996
1996
|
if (a(R[0], $[1]) < 0 && 0 < a(R[1], $[0])) {
|
|
@@ -2001,7 +2001,7 @@ function Ga() {
|
|
|
2001
2001
|
return x === k && D.push(R), D;
|
|
2002
2002
|
}, [])).sort(O);
|
|
2003
2003
|
} catch {
|
|
2004
|
-
return
|
|
2004
|
+
return me(this, Pe);
|
|
2005
2005
|
}
|
|
2006
2006
|
var g = 0, w = m ? function(D) {
|
|
2007
2007
|
return 0 < i(D, E[g][1]);
|
|
@@ -2011,53 +2011,53 @@ function Ga() {
|
|
|
2011
2011
|
return 0 < o(D, E[g][0]);
|
|
2012
2012
|
} : function(D) {
|
|
2013
2013
|
return 0 <= o(D, E[g][0]);
|
|
2014
|
-
}, y = w,
|
|
2015
|
-
return
|
|
2014
|
+
}, y = w, P = new this.Collection(this, function() {
|
|
2015
|
+
return $e(E[0][0], E[E.length - 1][1], !p, !m);
|
|
2016
2016
|
});
|
|
2017
|
-
return
|
|
2017
|
+
return P._ondirectionchange = function(D) {
|
|
2018
2018
|
h = D === "next" ? (y = w, i) : (y = S, o), E.sort(O);
|
|
2019
|
-
},
|
|
2019
|
+
}, P._addAlgorithm(function(D, R, x) {
|
|
2020
2020
|
for (var k, $ = D.key; y($); ) if (++g === E.length) return R(x), !1;
|
|
2021
2021
|
return !w(k = $) && !S(k) || (r._cmp($, E[g][1]) === 0 || r._cmp($, E[g][0]) === 0 || R(function() {
|
|
2022
2022
|
h === i ? D.continue(E[g][0]) : D.continue(E[g][1]);
|
|
2023
2023
|
}), !1);
|
|
2024
|
-
}),
|
|
2025
|
-
},
|
|
2026
|
-
var e =
|
|
2024
|
+
}), P;
|
|
2025
|
+
}, ce.prototype.startsWithAnyOf = function() {
|
|
2026
|
+
var e = Ae.apply(qe, arguments);
|
|
2027
2027
|
return e.every(function(n) {
|
|
2028
2028
|
return typeof n == "string";
|
|
2029
|
-
}) ? e.length === 0 ?
|
|
2030
|
-
return [n, n +
|
|
2031
|
-
})) :
|
|
2032
|
-
},
|
|
2033
|
-
function
|
|
2029
|
+
}) ? e.length === 0 ? ot(this) : this.inAnyRange(e.map(function(n) {
|
|
2030
|
+
return [n, n + Qe];
|
|
2031
|
+
})) : me(this, "startsWithAnyOf() only works with strings");
|
|
2032
|
+
}, ce);
|
|
2033
|
+
function ce() {
|
|
2034
2034
|
}
|
|
2035
|
-
function
|
|
2035
|
+
function Se(e) {
|
|
2036
2036
|
return te(function(n) {
|
|
2037
|
-
return
|
|
2037
|
+
return vt(n), e(n.target.error), !1;
|
|
2038
2038
|
});
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2040
|
+
function vt(e) {
|
|
2041
2041
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
2042
2042
|
}
|
|
2043
|
-
var
|
|
2044
|
-
return
|
|
2045
|
-
},
|
|
2046
|
-
if (
|
|
2043
|
+
var wt = "storagemutated", Pn = "x-storagemutated-1", je = mt(null, wt), ca = (Oe.prototype._lock = function() {
|
|
2044
|
+
return ge(!G.global), ++this._reculock, this._reculock !== 1 || G.global || (G.lockOwnerFor = this), this;
|
|
2045
|
+
}, Oe.prototype._unlock = function() {
|
|
2046
|
+
if (ge(!G.global), --this._reculock == 0) for (G.global || (G.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
2047
2047
|
var e = this._blockedFuncs.shift();
|
|
2048
2048
|
try {
|
|
2049
|
-
|
|
2049
|
+
Ye(e[1], e[0]);
|
|
2050
2050
|
} catch {
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
2053
|
return this;
|
|
2054
|
-
},
|
|
2054
|
+
}, Oe.prototype._locked = function() {
|
|
2055
2055
|
return this._reculock && G.lockOwnerFor !== this;
|
|
2056
|
-
},
|
|
2056
|
+
}, Oe.prototype.create = function(e) {
|
|
2057
2057
|
var n = this;
|
|
2058
2058
|
if (!this.mode) return this;
|
|
2059
2059
|
var r = this.db.idbdb, a = this.db._state.dbOpenError;
|
|
2060
|
-
if (
|
|
2060
|
+
if (ge(!this.idbtrans), !e && !r) switch (a && a.name) {
|
|
2061
2061
|
case "DatabaseClosedError":
|
|
2062
2062
|
throw new K.DatabaseClosed(a);
|
|
2063
2063
|
case "MissingAPIError":
|
|
@@ -2066,23 +2066,23 @@ function Ga() {
|
|
|
2066
2066
|
throw new K.OpenFailed(a);
|
|
2067
2067
|
}
|
|
2068
2068
|
if (!this.active) throw new K.TransactionInactive();
|
|
2069
|
-
return
|
|
2070
|
-
|
|
2069
|
+
return ge(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || r).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = te(function(i) {
|
|
2070
|
+
vt(i), n._reject(e.error);
|
|
2071
2071
|
}), e.onabort = te(function(i) {
|
|
2072
|
-
|
|
2072
|
+
vt(i), n.active && n._reject(new K.Abort(e.error)), n.active = !1, n.on("abort").fire(i);
|
|
2073
2073
|
}), e.oncomplete = te(function() {
|
|
2074
|
-
n.active = !1, n._resolve(), "mutatedParts" in e &&
|
|
2074
|
+
n.active = !1, n._resolve(), "mutatedParts" in e && je.storagemutated.fire(e.mutatedParts);
|
|
2075
2075
|
}), this;
|
|
2076
|
-
},
|
|
2076
|
+
}, Oe.prototype._promise = function(e, n, r) {
|
|
2077
2077
|
var a = this;
|
|
2078
|
-
if (e === "readwrite" && this.mode !== "readwrite") return
|
|
2079
|
-
if (!this.active) return
|
|
2078
|
+
if (e === "readwrite" && this.mode !== "readwrite") return se(new K.ReadOnly("Transaction is readonly"));
|
|
2079
|
+
if (!this.active) return se(new K.TransactionInactive());
|
|
2080
2080
|
if (this._locked()) return new M(function(o, u) {
|
|
2081
2081
|
a._blockedFuncs.push([function() {
|
|
2082
2082
|
a._promise(e, n, r).then(o, u);
|
|
2083
2083
|
}, G]);
|
|
2084
2084
|
});
|
|
2085
|
-
if (r) return
|
|
2085
|
+
if (r) return Te(function() {
|
|
2086
2086
|
var o = new M(function(u, f) {
|
|
2087
2087
|
a._lock();
|
|
2088
2088
|
var p = n(u, f, a);
|
|
@@ -2097,9 +2097,9 @@ function Ga() {
|
|
|
2097
2097
|
f && f.then && f.then(o, u);
|
|
2098
2098
|
});
|
|
2099
2099
|
return i._lib = !0, i;
|
|
2100
|
-
},
|
|
2100
|
+
}, Oe.prototype._root = function() {
|
|
2101
2101
|
return this.parent ? this.parent._root() : this;
|
|
2102
|
-
},
|
|
2102
|
+
}, Oe.prototype.waitFor = function(e) {
|
|
2103
2103
|
var n, r = this._root(), a = M.resolve(e);
|
|
2104
2104
|
r._waitingFor ? r._waitingFor = r._waitingFor.then(function() {
|
|
2105
2105
|
return a;
|
|
@@ -2117,24 +2117,24 @@ function Ga() {
|
|
|
2117
2117
|
r._waitingFor === i && (r._waitingFor = null);
|
|
2118
2118
|
});
|
|
2119
2119
|
});
|
|
2120
|
-
},
|
|
2120
|
+
}, Oe.prototype.abort = function() {
|
|
2121
2121
|
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new K.Abort()));
|
|
2122
|
-
},
|
|
2122
|
+
}, Oe.prototype.table = function(e) {
|
|
2123
2123
|
var n = this._memoizedTables || (this._memoizedTables = {});
|
|
2124
2124
|
if (Q(n, e)) return n[e];
|
|
2125
2125
|
var r = this.schema[e];
|
|
2126
2126
|
if (!r) throw new K.NotFound("Table " + e + " not part of transaction");
|
|
2127
2127
|
return r = new this.db.Table(e, r, this), r.core = this.db.core.table(e), n[e] = r;
|
|
2128
|
-
},
|
|
2129
|
-
function
|
|
2128
|
+
}, Oe);
|
|
2129
|
+
function Oe() {
|
|
2130
2130
|
}
|
|
2131
|
-
function
|
|
2132
|
-
return { name: e, keyPath: n, unique: r, multi: a, auto: i, compound: o, src: (r && !u ? "&" : "") + (a ? "*" : "") + (i ? "++" : "") +
|
|
2131
|
+
function Dn(e, n, r, a, i, o, u) {
|
|
2132
|
+
return { name: e, keyPath: n, unique: r, multi: a, auto: i, compound: o, src: (r && !u ? "&" : "") + (a ? "*" : "") + (i ? "++" : "") + vr(n) };
|
|
2133
2133
|
}
|
|
2134
|
-
function
|
|
2134
|
+
function vr(e) {
|
|
2135
2135
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
2136
2136
|
}
|
|
2137
|
-
function
|
|
2137
|
+
function Rn(e, n, r) {
|
|
2138
2138
|
return { name: e, primKey: n, indexes: r, mappedClass: null, idxByName: (a = function(i) {
|
|
2139
2139
|
return [i.name, i];
|
|
2140
2140
|
}, r.reduce(function(i, o, u) {
|
|
@@ -2142,33 +2142,33 @@ function Ga() {
|
|
|
2142
2142
|
}, {})) };
|
|
2143
2143
|
var a;
|
|
2144
2144
|
}
|
|
2145
|
-
var
|
|
2145
|
+
var Et = function(e) {
|
|
2146
2146
|
try {
|
|
2147
|
-
return e.only([[]]),
|
|
2147
|
+
return e.only([[]]), Et = function() {
|
|
2148
2148
|
return [[]];
|
|
2149
2149
|
}, [[]];
|
|
2150
2150
|
} catch {
|
|
2151
|
-
return
|
|
2152
|
-
return
|
|
2153
|
-
},
|
|
2151
|
+
return Et = function() {
|
|
2152
|
+
return Qe;
|
|
2153
|
+
}, Qe;
|
|
2154
2154
|
}
|
|
2155
2155
|
};
|
|
2156
|
-
function
|
|
2156
|
+
function xn(e) {
|
|
2157
2157
|
return e == null ? function() {
|
|
2158
2158
|
} : typeof e == "string" ? (n = e).split(".").length === 1 ? function(r) {
|
|
2159
2159
|
return r[n];
|
|
2160
2160
|
} : function(r) {
|
|
2161
|
-
return
|
|
2161
|
+
return ve(r, n);
|
|
2162
2162
|
} : function(r) {
|
|
2163
|
-
return
|
|
2163
|
+
return ve(r, e);
|
|
2164
2164
|
};
|
|
2165
2165
|
var n;
|
|
2166
2166
|
}
|
|
2167
|
-
function
|
|
2167
|
+
function wr(e) {
|
|
2168
2168
|
return [].slice.call(e);
|
|
2169
2169
|
}
|
|
2170
2170
|
var ua = 0;
|
|
2171
|
-
function
|
|
2171
|
+
function St(e) {
|
|
2172
2172
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
2173
2173
|
}
|
|
2174
2174
|
function la(e, n, p) {
|
|
@@ -2181,75 +2181,75 @@ function Ga() {
|
|
|
2181
2181
|
function i(O) {
|
|
2182
2182
|
var g, w = O.name;
|
|
2183
2183
|
return { name: w, schema: O, mutate: function(S) {
|
|
2184
|
-
var y = S.trans,
|
|
2184
|
+
var y = S.trans, P = S.type, D = S.keys, R = S.values, x = S.range;
|
|
2185
2185
|
return new Promise(function(k, $) {
|
|
2186
2186
|
k = te(k);
|
|
2187
|
-
var T = y.objectStore(w), N = T.keyPath == null, j =
|
|
2188
|
-
if (!j &&
|
|
2187
|
+
var T = y.objectStore(w), N = T.keyPath == null, j = P === "put" || P === "add";
|
|
2188
|
+
if (!j && P !== "delete" && P !== "deleteRange") throw new Error("Invalid operation type: " + P);
|
|
2189
2189
|
var C, B = (D || R || { length: 1 }).length;
|
|
2190
2190
|
if (D && R && D.length !== R.length) throw new Error("Given keys array must have same length as given values array.");
|
|
2191
2191
|
if (B === 0) return k({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
2192
|
-
function W(
|
|
2193
|
-
++
|
|
2192
|
+
function W(pe) {
|
|
2193
|
+
++be, vt(pe);
|
|
2194
2194
|
}
|
|
2195
|
-
var
|
|
2196
|
-
if (
|
|
2197
|
-
if (x.type === 4) return k({ numFailures:
|
|
2198
|
-
x.type === 3 ?
|
|
2195
|
+
var z = [], H = [], be = 0;
|
|
2196
|
+
if (P === "deleteRange") {
|
|
2197
|
+
if (x.type === 4) return k({ numFailures: be, failures: H, results: [], lastResult: void 0 });
|
|
2198
|
+
x.type === 3 ? z.push(C = T.clear()) : z.push(C = T.delete(a(x)));
|
|
2199
2199
|
} else {
|
|
2200
2200
|
var N = j ? N ? [R, D] : [R, null] : [D, null], F = N[0], de = N[1];
|
|
2201
|
-
if (j) for (var fe = 0; fe < B; ++fe)
|
|
2202
|
-
else for (fe = 0; fe < B; ++fe)
|
|
2201
|
+
if (j) for (var fe = 0; fe < B; ++fe) z.push(C = de && de[fe] !== void 0 ? T[P](F[fe], de[fe]) : T[P](F[fe])), C.onerror = W;
|
|
2202
|
+
else for (fe = 0; fe < B; ++fe) z.push(C = T[P](F[fe])), C.onerror = W;
|
|
2203
2203
|
}
|
|
2204
|
-
function
|
|
2205
|
-
|
|
2206
|
-
return
|
|
2207
|
-
}), k({ numFailures:
|
|
2208
|
-
return
|
|
2209
|
-
}), lastResult:
|
|
2204
|
+
function rn(pe) {
|
|
2205
|
+
pe = pe.target.result, z.forEach(function(Ve, Yn) {
|
|
2206
|
+
return Ve.error != null && (H[Yn] = Ve.error);
|
|
2207
|
+
}), k({ numFailures: be, failures: H, results: P === "delete" ? D : z.map(function(Ve) {
|
|
2208
|
+
return Ve.result;
|
|
2209
|
+
}), lastResult: pe });
|
|
2210
2210
|
}
|
|
2211
|
-
C.onerror = function(
|
|
2212
|
-
W(
|
|
2213
|
-
}, C.onsuccess =
|
|
2211
|
+
C.onerror = function(pe) {
|
|
2212
|
+
W(pe), rn(pe);
|
|
2213
|
+
}, C.onsuccess = rn;
|
|
2214
2214
|
});
|
|
2215
2215
|
}, getMany: function(S) {
|
|
2216
|
-
var y = S.trans,
|
|
2216
|
+
var y = S.trans, P = S.keys;
|
|
2217
2217
|
return new Promise(function(D, R) {
|
|
2218
2218
|
D = te(D);
|
|
2219
|
-
for (var x, k = y.objectStore(w), $ =
|
|
2220
|
-
|
|
2221
|
-
}, B =
|
|
2219
|
+
for (var x, k = y.objectStore(w), $ = P.length, T = new Array($), N = 0, j = 0, C = function(z) {
|
|
2220
|
+
z = z.target, T[z._pos] = z.result, ++j === N && D(T);
|
|
2221
|
+
}, B = Se(R), W = 0; W < $; ++W) P[W] != null && ((x = k.get(P[W]))._pos = W, x.onsuccess = C, x.onerror = B, ++N);
|
|
2222
2222
|
N === 0 && D(T);
|
|
2223
2223
|
});
|
|
2224
2224
|
}, get: function(S) {
|
|
2225
|
-
var y = S.trans,
|
|
2225
|
+
var y = S.trans, P = S.key;
|
|
2226
2226
|
return new Promise(function(D, R) {
|
|
2227
2227
|
D = te(D);
|
|
2228
|
-
var x = y.objectStore(w).get(
|
|
2228
|
+
var x = y.objectStore(w).get(P);
|
|
2229
2229
|
x.onsuccess = function(k) {
|
|
2230
2230
|
return D(k.target.result);
|
|
2231
|
-
}, x.onerror =
|
|
2231
|
+
}, x.onerror = Se(R);
|
|
2232
2232
|
});
|
|
2233
2233
|
}, query: (g = m, function(S) {
|
|
2234
|
-
return new Promise(function(y,
|
|
2234
|
+
return new Promise(function(y, P) {
|
|
2235
2235
|
y = te(y);
|
|
2236
2236
|
var D, R, x, N = S.trans, k = S.values, $ = S.limit, C = S.query, T = $ === 1 / 0 ? void 0 : $, j = C.index, C = C.range, N = N.objectStore(w), j = j.isPrimaryKey ? N : N.index(j.name), C = a(C);
|
|
2237
2237
|
if ($ === 0) return y({ result: [] });
|
|
2238
2238
|
g ? ((T = k ? j.getAll(C, T) : j.getAllKeys(C, T)).onsuccess = function(B) {
|
|
2239
2239
|
return y({ result: B.target.result });
|
|
2240
|
-
}, T.onerror =
|
|
2240
|
+
}, T.onerror = Se(P)) : (D = 0, R = !k && "openKeyCursor" in j ? j.openKeyCursor(C) : j.openCursor(C), x = [], R.onsuccess = function(B) {
|
|
2241
2241
|
var W = R.result;
|
|
2242
2242
|
return W ? (x.push(k ? W.value : W.primaryKey), ++D === $ ? y({ result: x }) : void W.continue()) : y({ result: x });
|
|
2243
|
-
}, R.onerror =
|
|
2243
|
+
}, R.onerror = Se(P));
|
|
2244
2244
|
});
|
|
2245
2245
|
}), openCursor: function(S) {
|
|
2246
|
-
var y = S.trans,
|
|
2246
|
+
var y = S.trans, P = S.values, D = S.query, R = S.reverse, x = S.unique;
|
|
2247
2247
|
return new Promise(function(k, $) {
|
|
2248
2248
|
k = te(k);
|
|
2249
|
-
var j = D.index, T = D.range, N = y.objectStore(w), N = j.isPrimaryKey ? N : N.index(j.name), j = R ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", C = !
|
|
2250
|
-
C.onerror =
|
|
2251
|
-
var W,
|
|
2252
|
-
F ? (F.___id = ++ua, F.done = !1, W = F.continue.bind(F),
|
|
2249
|
+
var j = D.index, T = D.range, N = y.objectStore(w), N = j.isPrimaryKey ? N : N.index(j.name), j = R ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", C = !P && "openKeyCursor" in N ? N.openKeyCursor(a(T), j) : N.openCursor(a(T), j);
|
|
2250
|
+
C.onerror = Se($), C.onsuccess = te(function(B) {
|
|
2251
|
+
var W, z, H, be, F = C.result;
|
|
2252
|
+
F ? (F.___id = ++ua, F.done = !1, W = F.continue.bind(F), z = (z = F.continuePrimaryKey) && z.bind(F), H = F.advance.bind(F), be = function() {
|
|
2253
2253
|
throw new Error("Cursor not stopped");
|
|
2254
2254
|
}, F.trans = y, F.stop = F.continue = F.continuePrimaryKey = F.advance = function() {
|
|
2255
2255
|
throw new Error("Cursor not started");
|
|
@@ -2264,53 +2264,53 @@ function Ga() {
|
|
|
2264
2264
|
function fe() {
|
|
2265
2265
|
if (C.result) try {
|
|
2266
2266
|
de();
|
|
2267
|
-
} catch (
|
|
2268
|
-
F.fail(
|
|
2267
|
+
} catch (pe) {
|
|
2268
|
+
F.fail(pe);
|
|
2269
2269
|
}
|
|
2270
2270
|
else F.done = !0, F.start = function() {
|
|
2271
2271
|
throw new Error("Cursor behind last entry");
|
|
2272
2272
|
}, F.stop();
|
|
2273
2273
|
}
|
|
2274
|
-
var
|
|
2275
|
-
|
|
2276
|
-
F.stop = F.continue = F.continuePrimaryKey = F.advance =
|
|
2274
|
+
var rn = new Promise(function(pe, Ve) {
|
|
2275
|
+
pe = te(pe), C.onerror = Se(Ve), F.fail = Ve, F.stop = function(Yn) {
|
|
2276
|
+
F.stop = F.continue = F.continuePrimaryKey = F.advance = be, pe(Yn);
|
|
2277
2277
|
};
|
|
2278
2278
|
});
|
|
2279
|
-
return C.onsuccess = te(function(
|
|
2279
|
+
return C.onsuccess = te(function(pe) {
|
|
2280
2280
|
C.onsuccess = fe, fe();
|
|
2281
|
-
}), F.continue = W, F.continuePrimaryKey =
|
|
2281
|
+
}), F.continue = W, F.continuePrimaryKey = z, F.advance = H, fe(), rn;
|
|
2282
2282
|
}, k(F)) : k(null);
|
|
2283
2283
|
}, $);
|
|
2284
2284
|
});
|
|
2285
2285
|
}, count: function(S) {
|
|
2286
|
-
var y = S.query,
|
|
2286
|
+
var y = S.query, P = S.trans, D = y.index, R = y.range;
|
|
2287
2287
|
return new Promise(function(x, k) {
|
|
2288
|
-
var $ =
|
|
2288
|
+
var $ = P.objectStore(w), T = D.isPrimaryKey ? $ : $.index(D.name), $ = a(R), T = $ ? T.count($) : T.count();
|
|
2289
2289
|
T.onsuccess = te(function(N) {
|
|
2290
2290
|
return x(N.target.result);
|
|
2291
|
-
}), T.onerror =
|
|
2291
|
+
}), T.onerror = Se(k);
|
|
2292
2292
|
});
|
|
2293
2293
|
} };
|
|
2294
2294
|
}
|
|
2295
|
-
var o, u, f, E = (u = p, f =
|
|
2295
|
+
var o, u, f, E = (u = p, f = wr((o = e).objectStoreNames), { schema: { name: o.name, tables: f.map(function(O) {
|
|
2296
2296
|
return u.objectStore(O);
|
|
2297
2297
|
}).map(function(O) {
|
|
2298
|
-
var g = O.keyPath, y = O.autoIncrement, w =
|
|
2299
|
-
return O.index(
|
|
2298
|
+
var g = O.keyPath, y = O.autoIncrement, w = Y(g), S = {}, y = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: g == null, compound: w, keyPath: g, autoIncrement: y, unique: !0, extractKey: xn(g) }, indexes: wr(O.indexNames).map(function(P) {
|
|
2299
|
+
return O.index(P);
|
|
2300
2300
|
}).map(function(x) {
|
|
2301
|
-
var D = x.name, R = x.unique, k = x.multiEntry, x = x.keyPath, k = { name: D, compound:
|
|
2302
|
-
return S[
|
|
2303
|
-
}), getIndexByKeyPath: function(
|
|
2304
|
-
return S[
|
|
2301
|
+
var D = x.name, R = x.unique, k = x.multiEntry, x = x.keyPath, k = { name: D, compound: Y(x), keyPath: x, unique: R, multiEntry: k, extractKey: xn(x) };
|
|
2302
|
+
return S[St(x)] = k;
|
|
2303
|
+
}), getIndexByKeyPath: function(P) {
|
|
2304
|
+
return S[St(P)];
|
|
2305
2305
|
} };
|
|
2306
|
-
return S[":id"] = y.primaryKey, g != null && (S[
|
|
2306
|
+
return S[":id"] = y.primaryKey, g != null && (S[St(g)] = y.primaryKey), y;
|
|
2307
2307
|
}) }, hasGetAll: 0 < f.length && "getAll" in u.objectStore(f[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), p = E.schema, m = E.hasGetAll, E = p.tables.map(i), h = {};
|
|
2308
2308
|
return E.forEach(function(O) {
|
|
2309
2309
|
return h[O.name] = O;
|
|
2310
2310
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(O) {
|
|
2311
2311
|
if (!h[O]) throw new Error("Table '".concat(O, "' not found"));
|
|
2312
2312
|
return h[O];
|
|
2313
|
-
}, MIN_KEY: -1 / 0, MAX_KEY:
|
|
2313
|
+
}, MIN_KEY: -1 / 0, MAX_KEY: Et(n), schema: p };
|
|
2314
2314
|
}
|
|
2315
2315
|
function da(e, n, r, a) {
|
|
2316
2316
|
var i = r.IDBKeyRange;
|
|
@@ -2318,7 +2318,7 @@ function Ga() {
|
|
|
2318
2318
|
return u = u.create, c(c({}, o), u(o));
|
|
2319
2319
|
}, a)) };
|
|
2320
2320
|
}
|
|
2321
|
-
function
|
|
2321
|
+
function zt(e, a) {
|
|
2322
2322
|
var r = a.db, a = da(e._middlewares, r, e._deps, a);
|
|
2323
2323
|
e.core = a.dbcore, e.tables.forEach(function(i) {
|
|
2324
2324
|
var o = i.name;
|
|
@@ -2327,22 +2327,22 @@ function Ga() {
|
|
|
2327
2327
|
}) && (i.core = e.core.table(o), e[o] instanceof e.Table && (e[o].core = i.core));
|
|
2328
2328
|
});
|
|
2329
2329
|
}
|
|
2330
|
-
function
|
|
2330
|
+
function Ht(e, n, r, a) {
|
|
2331
2331
|
r.forEach(function(i) {
|
|
2332
2332
|
var o = a[i];
|
|
2333
2333
|
n.forEach(function(u) {
|
|
2334
2334
|
var f = function p(m, E) {
|
|
2335
|
-
return
|
|
2335
|
+
return Pt(m, E) || (m = ue(m)) && p(m, E);
|
|
2336
2336
|
}(u, i);
|
|
2337
|
-
(!f || "value" in f && f.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ?
|
|
2337
|
+
(!f || "value" in f && f.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ? ae(u, i, { get: function() {
|
|
2338
2338
|
return this.table(i);
|
|
2339
2339
|
}, set: function(p) {
|
|
2340
|
-
|
|
2340
|
+
Ie(this, i, { value: p, writable: !0, configurable: !0, enumerable: !0 });
|
|
2341
2341
|
} }) : u[i] = new e.Table(i, o));
|
|
2342
2342
|
});
|
|
2343
2343
|
});
|
|
2344
2344
|
}
|
|
2345
|
-
function
|
|
2345
|
+
function In(e, n) {
|
|
2346
2346
|
n.forEach(function(r) {
|
|
2347
2347
|
for (var a in r) r[a] instanceof e.Table && delete r[a];
|
|
2348
2348
|
});
|
|
@@ -2352,89 +2352,89 @@ function Ga() {
|
|
|
2352
2352
|
}
|
|
2353
2353
|
function ha(e, n, r, a) {
|
|
2354
2354
|
var i = e._dbSchema;
|
|
2355
|
-
r.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta =
|
|
2355
|
+
r.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = Rn("$meta", Sr("")[0], []), e._storeNames.push("$meta"));
|
|
2356
2356
|
var o = e._createTransaction("readwrite", e._storeNames, i);
|
|
2357
2357
|
o.create(r), o._completion.catch(a);
|
|
2358
2358
|
var u = o._reject.bind(o), f = G.transless || G;
|
|
2359
|
-
|
|
2360
|
-
return G.trans = o, G.transless = f, n !== 0 ? (
|
|
2359
|
+
Te(function() {
|
|
2360
|
+
return G.trans = o, G.transless = f, n !== 0 ? (zt(e, r), m = n, ((p = o).storeNames.includes("$meta") ? p.table("$meta").get("version").then(function(E) {
|
|
2361
2361
|
return E ?? m;
|
|
2362
2362
|
}) : M.resolve(m)).then(function(E) {
|
|
2363
|
-
return O = E, g = o, w = r, S = [], E = (h = e)._versions, y = h._dbSchema =
|
|
2364
|
-
return
|
|
2365
|
-
})).length !== 0 ? (E.forEach(function(
|
|
2363
|
+
return O = E, g = o, w = r, S = [], E = (h = e)._versions, y = h._dbSchema = Qt(0, h.idbdb, w), (E = E.filter(function(P) {
|
|
2364
|
+
return P._cfg.version >= O;
|
|
2365
|
+
})).length !== 0 ? (E.forEach(function(P) {
|
|
2366
2366
|
S.push(function() {
|
|
2367
|
-
var D = y, R =
|
|
2368
|
-
|
|
2369
|
-
var x =
|
|
2367
|
+
var D = y, R = P._cfg.dbschema;
|
|
2368
|
+
Xt(h, D, w), Xt(h, R, w), y = h._dbSchema = R;
|
|
2369
|
+
var x = kn(D, R);
|
|
2370
2370
|
x.add.forEach(function(j) {
|
|
2371
|
-
|
|
2371
|
+
Tn(w, j[0], j[1].primKey, j[1].indexes);
|
|
2372
2372
|
}), x.change.forEach(function(j) {
|
|
2373
2373
|
if (j.recreate) throw new K.Upgrade("Not yet support for changing primary key");
|
|
2374
2374
|
var C = w.objectStore(j.name);
|
|
2375
2375
|
j.add.forEach(function(B) {
|
|
2376
|
-
return
|
|
2376
|
+
return Yt(C, B);
|
|
2377
2377
|
}), j.change.forEach(function(B) {
|
|
2378
|
-
C.deleteIndex(B.name),
|
|
2378
|
+
C.deleteIndex(B.name), Yt(C, B);
|
|
2379
2379
|
}), j.del.forEach(function(B) {
|
|
2380
2380
|
return C.deleteIndex(B);
|
|
2381
2381
|
});
|
|
2382
2382
|
});
|
|
2383
|
-
var k =
|
|
2384
|
-
if (k &&
|
|
2385
|
-
|
|
2386
|
-
var $ =
|
|
2383
|
+
var k = P._cfg.contentUpgrade;
|
|
2384
|
+
if (k && P._cfg.version > O) {
|
|
2385
|
+
zt(h, w), g._memoizedTables = {};
|
|
2386
|
+
var $ = xt(R);
|
|
2387
2387
|
x.del.forEach(function(j) {
|
|
2388
2388
|
$[j] = D[j];
|
|
2389
|
-
}),
|
|
2390
|
-
var T, N =
|
|
2391
|
-
return N &&
|
|
2389
|
+
}), In(h, [h.Transaction.prototype]), Ht(h, [h.Transaction.prototype], I($), $), g.schema = $;
|
|
2390
|
+
var T, N = ln(k);
|
|
2391
|
+
return N && at(), x = M.follow(function() {
|
|
2392
2392
|
var j;
|
|
2393
|
-
(T = k(g)) && N && (j =
|
|
2393
|
+
(T = k(g)) && N && (j = Ne.bind(null, null), T.then(j, j));
|
|
2394
2394
|
}), T && typeof T.then == "function" ? M.resolve(T) : x.then(function() {
|
|
2395
2395
|
return T;
|
|
2396
2396
|
});
|
|
2397
2397
|
}
|
|
2398
2398
|
}), S.push(function(D) {
|
|
2399
|
-
var R, x, k =
|
|
2399
|
+
var R, x, k = P._cfg.dbschema;
|
|
2400
2400
|
R = k, x = D, [].slice.call(x.db.objectStoreNames).forEach(function($) {
|
|
2401
2401
|
return R[$] == null && x.db.deleteObjectStore($);
|
|
2402
|
-
}),
|
|
2402
|
+
}), In(h, [h.Transaction.prototype]), Ht(h, [h.Transaction.prototype], h._storeNames, h._dbSchema), g.schema = h._dbSchema;
|
|
2403
2403
|
}), S.push(function(D) {
|
|
2404
|
-
h.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(h.idbdb.version / 10) ===
|
|
2404
|
+
h.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(h.idbdb.version / 10) === P._cfg.version ? (h.idbdb.deleteObjectStore("$meta"), delete h._dbSchema.$meta, h._storeNames = h._storeNames.filter(function(R) {
|
|
2405
2405
|
return R !== "$meta";
|
|
2406
|
-
})) : D.objectStore("$meta").put(
|
|
2406
|
+
})) : D.objectStore("$meta").put(P._cfg.version, "version"));
|
|
2407
2407
|
});
|
|
2408
|
-
}), function
|
|
2409
|
-
return S.length ? M.resolve(S.shift()(g.idbtrans)).then(
|
|
2408
|
+
}), function P() {
|
|
2409
|
+
return S.length ? M.resolve(S.shift()(g.idbtrans)).then(P) : M.resolve();
|
|
2410
2410
|
}().then(function() {
|
|
2411
|
-
|
|
2411
|
+
Er(y, w);
|
|
2412
2412
|
})) : M.resolve();
|
|
2413
2413
|
var h, O, g, w, S, y;
|
|
2414
2414
|
}).catch(u)) : (I(i).forEach(function(E) {
|
|
2415
|
-
|
|
2416
|
-
}),
|
|
2415
|
+
Tn(r, E, i[E].primKey, i[E].indexes);
|
|
2416
|
+
}), zt(e, r), void M.follow(function() {
|
|
2417
2417
|
return e.on.populate.fire(o);
|
|
2418
2418
|
}).catch(u));
|
|
2419
2419
|
var p, m;
|
|
2420
2420
|
});
|
|
2421
2421
|
}
|
|
2422
2422
|
function pa(e, n) {
|
|
2423
|
-
|
|
2424
|
-
var r =
|
|
2425
|
-
|
|
2426
|
-
for (var a = 0, i =
|
|
2423
|
+
Er(e._dbSchema, n), n.db.version % 10 != 0 || n.objectStoreNames.contains("$meta") || n.db.createObjectStore("$meta").add(Math.ceil(n.db.version / 10 - 1), "version");
|
|
2424
|
+
var r = Qt(0, e.idbdb, n);
|
|
2425
|
+
Xt(e, e._dbSchema, n);
|
|
2426
|
+
for (var a = 0, i = kn(r, e._dbSchema).change; a < i.length; a++) {
|
|
2427
2427
|
var o = function(u) {
|
|
2428
2428
|
if (u.change.length || u.recreate) return console.warn("Unable to patch indexes of table ".concat(u.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
2429
2429
|
var f = n.objectStore(u.name);
|
|
2430
2430
|
u.add.forEach(function(p) {
|
|
2431
|
-
|
|
2431
|
+
Ee && console.debug("Dexie upgrade patch: Creating missing index ".concat(u.name, ".").concat(p.src)), Yt(f, p);
|
|
2432
2432
|
});
|
|
2433
2433
|
}(i[a]);
|
|
2434
2434
|
if (typeof o == "object") return o.value;
|
|
2435
2435
|
}
|
|
2436
2436
|
}
|
|
2437
|
-
function
|
|
2437
|
+
function kn(e, n) {
|
|
2438
2438
|
var r, a = { del: [], add: [], change: [] };
|
|
2439
2439
|
for (r in e) n[r] || a.del.push(r);
|
|
2440
2440
|
for (r in n) {
|
|
@@ -2455,83 +2455,83 @@ function Ga() {
|
|
|
2455
2455
|
}
|
|
2456
2456
|
return a;
|
|
2457
2457
|
}
|
|
2458
|
-
function
|
|
2458
|
+
function Tn(e, n, r, a) {
|
|
2459
2459
|
var i = e.db.createObjectStore(n, r.keyPath ? { keyPath: r.keyPath, autoIncrement: r.auto } : { autoIncrement: r.auto });
|
|
2460
2460
|
return a.forEach(function(o) {
|
|
2461
|
-
return
|
|
2461
|
+
return Yt(i, o);
|
|
2462
2462
|
}), i;
|
|
2463
2463
|
}
|
|
2464
|
-
function
|
|
2464
|
+
function Er(e, n) {
|
|
2465
2465
|
I(e).forEach(function(r) {
|
|
2466
|
-
n.db.objectStoreNames.contains(r) || (
|
|
2466
|
+
n.db.objectStoreNames.contains(r) || (Ee && console.debug("Dexie: Creating missing table", r), Tn(n, r, e[r].primKey, e[r].indexes));
|
|
2467
2467
|
});
|
|
2468
2468
|
}
|
|
2469
|
-
function
|
|
2469
|
+
function Yt(e, n) {
|
|
2470
2470
|
e.createIndex(n.name, n.keyPath, { unique: n.unique, multiEntry: n.multi });
|
|
2471
2471
|
}
|
|
2472
|
-
function
|
|
2472
|
+
function Qt(e, n, r) {
|
|
2473
2473
|
var a = {};
|
|
2474
|
-
return
|
|
2475
|
-
for (var o = r.objectStore(i), u =
|
|
2476
|
-
var E = o.index(o.indexNames[p]), m = E.keyPath, E =
|
|
2474
|
+
return Ge(n.objectStoreNames, 0).forEach(function(i) {
|
|
2475
|
+
for (var o = r.objectStore(i), u = Dn(vr(m = o.keyPath), m || "", !0, !1, !!o.autoIncrement, m && typeof m != "string", !0), f = [], p = 0; p < o.indexNames.length; ++p) {
|
|
2476
|
+
var E = o.index(o.indexNames[p]), m = E.keyPath, E = Dn(E.name, m, !!E.unique, !!E.multiEntry, !1, m && typeof m != "string", !1);
|
|
2477
2477
|
f.push(E);
|
|
2478
2478
|
}
|
|
2479
|
-
a[i] =
|
|
2479
|
+
a[i] = Rn(i, u, f);
|
|
2480
2480
|
}), a;
|
|
2481
2481
|
}
|
|
2482
|
-
function
|
|
2482
|
+
function Xt(e, n, r) {
|
|
2483
2483
|
for (var a = r.db.objectStoreNames, i = 0; i < a.length; ++i) {
|
|
2484
2484
|
var o = a[i], u = r.objectStore(o);
|
|
2485
2485
|
e._hasGetAll = "getAll" in u;
|
|
2486
2486
|
for (var f = 0; f < u.indexNames.length; ++f) {
|
|
2487
|
-
var p = u.indexNames[f], m = u.index(p).keyPath, E = typeof m == "string" ? m : "[" +
|
|
2487
|
+
var p = u.indexNames[f], m = u.index(p).keyPath, E = typeof m == "string" ? m : "[" + Ge(m).join("+") + "]";
|
|
2488
2488
|
!n[o] || (m = n[o].idxByName[E]) && (m.name = p, delete n[o].idxByName[E], n[o].idxByName[p] = m);
|
|
2489
2489
|
}
|
|
2490
2490
|
}
|
|
2491
|
-
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) &&
|
|
2491
|
+
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && A.WorkerGlobalScope && A instanceof A.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2492
2492
|
}
|
|
2493
|
-
function
|
|
2493
|
+
function Sr(e) {
|
|
2494
2494
|
return e.split(",").map(function(n, r) {
|
|
2495
2495
|
var a = (n = n.trim()).replace(/([&*]|\+\+)/g, ""), i = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
|
|
2496
|
-
return
|
|
2496
|
+
return Dn(a, i || null, /\&/.test(n), /\*/.test(n), /\+\+/.test(n), Y(i), r === 0);
|
|
2497
2497
|
});
|
|
2498
2498
|
}
|
|
2499
|
-
var ga = (
|
|
2499
|
+
var ga = (Jt.prototype._parseStoresSpec = function(e, n) {
|
|
2500
2500
|
I(e).forEach(function(r) {
|
|
2501
2501
|
if (e[r] !== null) {
|
|
2502
|
-
var a =
|
|
2502
|
+
var a = Sr(e[r]), i = a.shift();
|
|
2503
2503
|
if (i.unique = !0, i.multi) throw new K.Schema("Primary key cannot be multi-valued");
|
|
2504
2504
|
a.forEach(function(o) {
|
|
2505
2505
|
if (o.auto) throw new K.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2506
2506
|
if (!o.keyPath) throw new K.Schema("Index must have a name and cannot be an empty string");
|
|
2507
|
-
}), n[r] =
|
|
2507
|
+
}), n[r] = Rn(r, i, a);
|
|
2508
2508
|
}
|
|
2509
2509
|
});
|
|
2510
|
-
},
|
|
2510
|
+
}, Jt.prototype.stores = function(r) {
|
|
2511
2511
|
var n = this.db;
|
|
2512
2512
|
this._cfg.storesSource = this._cfg.storesSource ? ne(this._cfg.storesSource, r) : r;
|
|
2513
2513
|
var r = n._versions, a = {}, i = {};
|
|
2514
2514
|
return r.forEach(function(o) {
|
|
2515
2515
|
ne(a, o._cfg.storesSource), i = o._cfg.dbschema = {}, o._parseStoresSpec(a, i);
|
|
2516
|
-
}), n._dbSchema = i,
|
|
2517
|
-
},
|
|
2518
|
-
return this._cfg.contentUpgrade =
|
|
2519
|
-
},
|
|
2520
|
-
function
|
|
2516
|
+
}), n._dbSchema = i, In(n, [n._allTables, n, n.Transaction.prototype]), Ht(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], I(i), i), n._storeNames = I(i), this;
|
|
2517
|
+
}, Jt.prototype.upgrade = function(e) {
|
|
2518
|
+
return this._cfg.contentUpgrade = fn(this._cfg.contentUpgrade || V, e), this;
|
|
2519
|
+
}, Jt);
|
|
2520
|
+
function Jt() {
|
|
2521
2521
|
}
|
|
2522
|
-
function
|
|
2522
|
+
function Nn(e, n) {
|
|
2523
2523
|
var r = e._dbNamesDB;
|
|
2524
|
-
return r || (r = e._dbNamesDB = new
|
|
2524
|
+
return r || (r = e._dbNamesDB = new De(Kt, { addons: [], indexedDB: e, IDBKeyRange: n })).version(1).stores({ dbnames: "name" }), r.table("dbnames");
|
|
2525
2525
|
}
|
|
2526
|
-
function
|
|
2526
|
+
function Cn(e) {
|
|
2527
2527
|
return e && typeof e.databases == "function";
|
|
2528
2528
|
}
|
|
2529
|
-
function
|
|
2530
|
-
return
|
|
2529
|
+
function $n(e) {
|
|
2530
|
+
return Te(function() {
|
|
2531
2531
|
return G.letThrough = !0, e();
|
|
2532
2532
|
});
|
|
2533
2533
|
}
|
|
2534
|
-
function
|
|
2534
|
+
function jn(e) {
|
|
2535
2535
|
return !("from" in e);
|
|
2536
2536
|
}
|
|
2537
2537
|
var le = function(e, n) {
|
|
@@ -2541,34 +2541,34 @@ function Ga() {
|
|
|
2541
2541
|
}
|
|
2542
2542
|
ne(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? n : e } : { d: 0 });
|
|
2543
2543
|
};
|
|
2544
|
-
function
|
|
2544
|
+
function Ot(e, n, r) {
|
|
2545
2545
|
var a = X(n, r);
|
|
2546
2546
|
if (!isNaN(a)) {
|
|
2547
2547
|
if (0 < a) throw RangeError();
|
|
2548
|
-
if (
|
|
2548
|
+
if (jn(e)) return ne(e, { from: n, to: r, d: 1 });
|
|
2549
2549
|
var i = e.l, a = e.r;
|
|
2550
|
-
if (X(r, e.from) < 0) return i ?
|
|
2551
|
-
if (0 < X(n, e.to)) return a ?
|
|
2552
|
-
X(n, e.from) < 0 && (e.from = n, e.l = null, e.d = a ? a.d + 1 : 1), 0 < X(r, e.to) && (e.to = r, e.r = null, e.d = e.l ? e.l.d + 1 : 1), r = !e.r, i && !e.l &&
|
|
2550
|
+
if (X(r, e.from) < 0) return i ? Ot(i, n, r) : e.l = { from: n, to: r, d: 1, l: null, r: null }, _r(e);
|
|
2551
|
+
if (0 < X(n, e.to)) return a ? Ot(a, n, r) : e.r = { from: n, to: r, d: 1, l: null, r: null }, _r(e);
|
|
2552
|
+
X(n, e.from) < 0 && (e.from = n, e.l = null, e.d = a ? a.d + 1 : 1), 0 < X(r, e.to) && (e.to = r, e.r = null, e.d = e.l ? e.l.d + 1 : 1), r = !e.r, i && !e.l && _t(e, i), a && r && _t(e, a);
|
|
2553
2553
|
}
|
|
2554
2554
|
}
|
|
2555
|
-
function
|
|
2556
|
-
|
|
2555
|
+
function _t(e, n) {
|
|
2556
|
+
jn(n) || function r(a, p) {
|
|
2557
2557
|
var o = p.from, u = p.to, f = p.l, p = p.r;
|
|
2558
|
-
|
|
2558
|
+
Ot(a, o, u), f && r(a, f), p && r(a, p);
|
|
2559
2559
|
}(e, n);
|
|
2560
2560
|
}
|
|
2561
|
-
function
|
|
2562
|
-
var r =
|
|
2561
|
+
function Or(e, n) {
|
|
2562
|
+
var r = Zt(n), a = r.next();
|
|
2563
2563
|
if (a.done) return !1;
|
|
2564
|
-
for (var i = a.value, o =
|
|
2564
|
+
for (var i = a.value, o = Zt(e), u = o.next(i.from), f = u.value; !a.done && !u.done; ) {
|
|
2565
2565
|
if (X(f.from, i.to) <= 0 && 0 <= X(f.to, i.from)) return !0;
|
|
2566
2566
|
X(i.from, f.from) < 0 ? i = (a = r.next(f.from)).value : f = (u = o.next(i.from)).value;
|
|
2567
2567
|
}
|
|
2568
2568
|
return !1;
|
|
2569
2569
|
}
|
|
2570
|
-
function
|
|
2571
|
-
var n =
|
|
2570
|
+
function Zt(e) {
|
|
2571
|
+
var n = jn(e) ? null : { s: 0, n: e };
|
|
2572
2572
|
return { next: function(r) {
|
|
2573
2573
|
for (var a = 0 < arguments.length; n; ) switch (n.s) {
|
|
2574
2574
|
case 0:
|
|
@@ -2587,66 +2587,66 @@ function Ga() {
|
|
|
2587
2587
|
return { done: !0 };
|
|
2588
2588
|
} };
|
|
2589
2589
|
}
|
|
2590
|
-
function
|
|
2590
|
+
function _r(e) {
|
|
2591
2591
|
var n, r, a = (((n = e.r) === null || n === void 0 ? void 0 : n.d) || 0) - (((r = e.l) === null || r === void 0 ? void 0 : r.d) || 0), i = 1 < a ? "r" : a < -1 ? "l" : "";
|
|
2592
|
-
i && (n = i == "r" ? "l" : "r", r = c({}, e), a = e[i], e.from = a.from, e.to = a.to, e[i] = a[i], r[i] = a[n], (e[n] = r).d =
|
|
2592
|
+
i && (n = i == "r" ? "l" : "r", r = c({}, e), a = e[i], e.from = a.from, e.to = a.to, e[i] = a[i], r[i] = a[n], (e[n] = r).d = Ar(r)), e.d = Ar(e);
|
|
2593
2593
|
}
|
|
2594
|
-
function
|
|
2594
|
+
function Ar(r) {
|
|
2595
2595
|
var n = r.r, r = r.l;
|
|
2596
2596
|
return (n ? r ? Math.max(n.d, r.d) : n.d : r ? r.d : 0) + 1;
|
|
2597
2597
|
}
|
|
2598
|
-
function
|
|
2598
|
+
function Vt(e, n) {
|
|
2599
2599
|
return I(n).forEach(function(r) {
|
|
2600
|
-
e[r] ?
|
|
2600
|
+
e[r] ? _t(e[r], n[r]) : e[r] = function a(i) {
|
|
2601
2601
|
var o, u, f = {};
|
|
2602
|
-
for (o in i) Q(i, o) && (u = i[o], f[o] = !u || typeof u != "object" ||
|
|
2602
|
+
for (o in i) Q(i, o) && (u = i[o], f[o] = !u || typeof u != "object" || qn.has(u.constructor) ? u : a(u));
|
|
2603
2603
|
return f;
|
|
2604
2604
|
}(n[r]);
|
|
2605
2605
|
}), e;
|
|
2606
2606
|
}
|
|
2607
|
-
function
|
|
2607
|
+
function Mn(e, n) {
|
|
2608
2608
|
return e.all || n.all || Object.keys(e).some(function(r) {
|
|
2609
|
-
return n[r] &&
|
|
2609
|
+
return n[r] && Or(n[r], e[r]);
|
|
2610
2610
|
});
|
|
2611
2611
|
}
|
|
2612
|
-
re(le.prototype, ((
|
|
2613
|
-
return
|
|
2612
|
+
re(le.prototype, ((ye = { add: function(e) {
|
|
2613
|
+
return _t(this, e), this;
|
|
2614
2614
|
}, addKey: function(e) {
|
|
2615
|
-
return
|
|
2615
|
+
return Ot(this, e, e), this;
|
|
2616
2616
|
}, addKeys: function(e) {
|
|
2617
2617
|
var n = this;
|
|
2618
2618
|
return e.forEach(function(r) {
|
|
2619
|
-
return
|
|
2619
|
+
return Ot(n, r, r);
|
|
2620
2620
|
}), this;
|
|
2621
2621
|
}, hasKey: function(e) {
|
|
2622
|
-
var n =
|
|
2622
|
+
var n = Zt(this).next(e).value;
|
|
2623
2623
|
return n && X(n.from, e) <= 0 && 0 <= X(n.to, e);
|
|
2624
|
-
} })[
|
|
2625
|
-
return
|
|
2626
|
-
},
|
|
2627
|
-
var
|
|
2628
|
-
function
|
|
2629
|
-
|
|
2630
|
-
|
|
2624
|
+
} })[un] = function() {
|
|
2625
|
+
return Zt(this);
|
|
2626
|
+
}, ye));
|
|
2627
|
+
var Je = {}, Bn = {}, Gn = !1;
|
|
2628
|
+
function qt(e) {
|
|
2629
|
+
Vt(Bn, e), Gn || (Gn = !0, setTimeout(function() {
|
|
2630
|
+
Gn = !1, Kn(Bn, !(Bn = {}));
|
|
2631
2631
|
}, 0));
|
|
2632
2632
|
}
|
|
2633
|
-
function
|
|
2633
|
+
function Kn(e, n) {
|
|
2634
2634
|
n === void 0 && (n = !1);
|
|
2635
2635
|
var r = /* @__PURE__ */ new Set();
|
|
2636
|
-
if (e.all) for (var a = 0, i = Object.values(
|
|
2636
|
+
if (e.all) for (var a = 0, i = Object.values(Je); a < i.length; a++) Pr(u = i[a], e, r, n);
|
|
2637
2637
|
else for (var o in e) {
|
|
2638
2638
|
var u, f = /^idb\:\/\/(.*)\/(.*)\//.exec(o);
|
|
2639
|
-
f && (o = f[1], f = f[2], (u =
|
|
2639
|
+
f && (o = f[1], f = f[2], (u = Je["idb://".concat(o, "/").concat(f)]) && Pr(u, e, r, n));
|
|
2640
2640
|
}
|
|
2641
2641
|
r.forEach(function(p) {
|
|
2642
2642
|
return p();
|
|
2643
2643
|
});
|
|
2644
2644
|
}
|
|
2645
|
-
function
|
|
2645
|
+
function Pr(e, n, r, a) {
|
|
2646
2646
|
for (var i = [], o = 0, u = Object.entries(e.queries.query); o < u.length; o++) {
|
|
2647
2647
|
for (var f = u[o], p = f[0], m = [], E = 0, h = f[1]; E < h.length; E++) {
|
|
2648
2648
|
var O = h[E];
|
|
2649
|
-
|
|
2649
|
+
Mn(n, O.obsSet) ? O.subscribers.forEach(function(y) {
|
|
2650
2650
|
return r.add(y);
|
|
2651
2651
|
}) : a && m.push(O);
|
|
2652
2652
|
}
|
|
@@ -2660,7 +2660,7 @@ function Ga() {
|
|
|
2660
2660
|
function ma(e) {
|
|
2661
2661
|
var n = e._state, r = e._deps.indexedDB;
|
|
2662
2662
|
if (n.isBeingOpened || e.idbdb) return n.dbReadyPromise.then(function() {
|
|
2663
|
-
return n.dbOpenError ?
|
|
2663
|
+
return n.dbOpenError ? se(n.dbOpenError) : e;
|
|
2664
2664
|
});
|
|
2665
2665
|
n.isBeingOpened = !0, n.dbOpenError = null, n.openComplete = !1;
|
|
2666
2666
|
var a = n.openCanceller, i = Math.round(10 * e.verno), o = !1;
|
|
@@ -2672,28 +2672,28 @@ function Ga() {
|
|
|
2672
2672
|
if (u(), !r) throw new K.MissingAPI();
|
|
2673
2673
|
var w = e.name, S = n.autoSchema || !i ? r.open(w) : r.open(w, i);
|
|
2674
2674
|
if (!S) throw new K.MissingAPI();
|
|
2675
|
-
S.onerror =
|
|
2676
|
-
var
|
|
2677
|
-
E = S.transaction, n.autoSchema && !e._options.allowEmptyDB ? (S.onerror =
|
|
2675
|
+
S.onerror = Se(g), S.onblocked = te(e._fireOnBlocked), S.onupgradeneeded = te(function(y) {
|
|
2676
|
+
var P;
|
|
2677
|
+
E = S.transaction, n.autoSchema && !e._options.allowEmptyDB ? (S.onerror = vt, E.abort(), S.result.close(), (P = r.deleteDatabase(w)).onsuccess = P.onerror = te(function() {
|
|
2678
2678
|
g(new K.NoSuchDatabase("Database ".concat(w, " doesnt exist")));
|
|
2679
|
-
})) : (E.onerror =
|
|
2679
|
+
})) : (E.onerror = Se(g), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, h = y < 1, e.idbdb = S.result, o && pa(e, E), ha(e, y / 10, E, g));
|
|
2680
2680
|
}, g), S.onsuccess = te(function() {
|
|
2681
2681
|
E = null;
|
|
2682
|
-
var y,
|
|
2682
|
+
var y, P, D, R, x, k = e.idbdb = S.result, $ = Ge(k.objectStoreNames);
|
|
2683
2683
|
if (0 < $.length) try {
|
|
2684
2684
|
var T = k.transaction((R = $).length === 1 ? R[0] : R, "readonly");
|
|
2685
|
-
if (n.autoSchema)
|
|
2686
|
-
else if (
|
|
2685
|
+
if (n.autoSchema) P = k, D = T, (y = e).verno = P.version / 10, D = y._dbSchema = Qt(0, P, D), y._storeNames = Ge(P.objectStoreNames, 0), Ht(y, [y._allTables], I(D), D);
|
|
2686
|
+
else if (Xt(e, e._dbSchema, T), ((x = kn(Qt(0, (x = e).idbdb, T), x._dbSchema)).add.length || x.change.some(function(N) {
|
|
2687
2687
|
return N.add.length || N.change.length;
|
|
2688
2688
|
})) && !o) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), k.close(), i = k.version + 1, o = !0, O(f());
|
|
2689
|
-
|
|
2689
|
+
zt(e, T);
|
|
2690
2690
|
} catch {
|
|
2691
2691
|
}
|
|
2692
|
-
|
|
2692
|
+
st.push(e), k.onversionchange = te(function(N) {
|
|
2693
2693
|
n.vcFired = !0, e.on("versionchange").fire(N);
|
|
2694
2694
|
}), k.onclose = te(function(N) {
|
|
2695
2695
|
e.on("close").fire(N);
|
|
2696
|
-
}), h && (x = e._deps, T = w, k = x.indexedDB, x = x.IDBKeyRange,
|
|
2696
|
+
}), h && (x = e._deps, T = w, k = x.indexedDB, x = x.IDBKeyRange, Cn(k) || T === Kt || Nn(k, x).put({ name: T }).catch(V)), O();
|
|
2697
2697
|
}, g);
|
|
2698
2698
|
}).catch(function(O) {
|
|
2699
2699
|
switch (O == null ? void 0 : O.name) {
|
|
@@ -2715,12 +2715,12 @@ function Ga() {
|
|
|
2715
2715
|
}).finally(function() {
|
|
2716
2716
|
return clearInterval(p);
|
|
2717
2717
|
}) : Promise.resolve()).then(f)]).then(function() {
|
|
2718
|
-
return u(), n.onReadyBeingFired = [], M.resolve(
|
|
2718
|
+
return u(), n.onReadyBeingFired = [], M.resolve($n(function() {
|
|
2719
2719
|
return e.on.ready.fire(e.vip);
|
|
2720
2720
|
})).then(function O() {
|
|
2721
2721
|
if (0 < n.onReadyBeingFired.length) {
|
|
2722
|
-
var g = n.onReadyBeingFired.reduce(
|
|
2723
|
-
return n.onReadyBeingFired = [], M.resolve(
|
|
2722
|
+
var g = n.onReadyBeingFired.reduce(fn, V);
|
|
2723
|
+
return n.onReadyBeingFired = [], M.resolve($n(function() {
|
|
2724
2724
|
return g(e.vip);
|
|
2725
2725
|
})).then(O);
|
|
2726
2726
|
}
|
|
@@ -2733,7 +2733,7 @@ function Ga() {
|
|
|
2733
2733
|
E && E.abort();
|
|
2734
2734
|
} catch {
|
|
2735
2735
|
}
|
|
2736
|
-
return a === n.openCanceller && e._close(),
|
|
2736
|
+
return a === n.openCanceller && e._close(), se(O);
|
|
2737
2737
|
}).finally(function() {
|
|
2738
2738
|
n.openComplete = !0, m();
|
|
2739
2739
|
}).then(function() {
|
|
@@ -2742,10 +2742,10 @@ function Ga() {
|
|
|
2742
2742
|
g.schema.indexes.forEach(function(w) {
|
|
2743
2743
|
w.name && (O["idb://".concat(e.name, "/").concat(g.name, "/").concat(w.name)] = new le(-1 / 0, [[[]]]));
|
|
2744
2744
|
}), O["idb://".concat(e.name, "/").concat(g.name, "/")] = O["idb://".concat(e.name, "/").concat(g.name, "/:dels")] = new le(-1 / 0, [[[]]]);
|
|
2745
|
-
}),
|
|
2745
|
+
}), je(wt).fire(O), Kn(O, !0)), e;
|
|
2746
2746
|
});
|
|
2747
2747
|
}
|
|
2748
|
-
function
|
|
2748
|
+
function Ln(e) {
|
|
2749
2749
|
function n(o) {
|
|
2750
2750
|
return e.next(o);
|
|
2751
2751
|
}
|
|
@@ -2755,23 +2755,23 @@ function Ga() {
|
|
|
2755
2755
|
function i(o) {
|
|
2756
2756
|
return function(p) {
|
|
2757
2757
|
var f = o(p), p = f.value;
|
|
2758
|
-
return f.done ? p : p && typeof p.then == "function" ? p.then(r, a) :
|
|
2758
|
+
return f.done ? p : p && typeof p.then == "function" ? p.then(r, a) : Y(p) ? Promise.all(p).then(r, a) : r(p);
|
|
2759
2759
|
};
|
|
2760
2760
|
}
|
|
2761
2761
|
return i(n)();
|
|
2762
2762
|
}
|
|
2763
|
-
function
|
|
2764
|
-
for (var a =
|
|
2763
|
+
function en(e, n, r) {
|
|
2764
|
+
for (var a = Y(e) ? e.slice() : [e], i = 0; i < r; ++i) a.push(n);
|
|
2765
2765
|
return a;
|
|
2766
2766
|
}
|
|
2767
2767
|
var ba = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2768
2768
|
return c(c({}, e), { table: function(n) {
|
|
2769
2769
|
var r = e.table(n), a = r.schema, i = {}, o = [];
|
|
2770
2770
|
function u(h, O, g) {
|
|
2771
|
-
var w =
|
|
2772
|
-
return S.push(
|
|
2771
|
+
var w = St(h), S = i[w] = i[w] || [], y = h == null ? 0 : typeof h == "string" ? 1 : h.length, P = 0 < O, P = c(c({}, g), { name: P ? "".concat(w, "(virtual-from:").concat(g.name, ")") : g.name, lowLevelIndex: g, isVirtual: P, keyTail: O, keyLength: y, extractKey: xn(h), unique: !P && g.unique });
|
|
2772
|
+
return S.push(P), P.isPrimaryKey || o.push(P), 1 < y && u(y === 2 ? h[0] : h.slice(0, y - 1), O + 1, g), S.sort(function(D, R) {
|
|
2773
2773
|
return D.keyTail - R.keyTail;
|
|
2774
|
-
}),
|
|
2774
|
+
}), P;
|
|
2775
2775
|
}
|
|
2776
2776
|
n = u(a.primaryKey.keyPath, 0, a.primaryKey), i[":id"] = [n];
|
|
2777
2777
|
for (var f = 0, p = a.indexes; f < p.length; f++) {
|
|
@@ -2780,45 +2780,45 @@ function Ga() {
|
|
|
2780
2780
|
}
|
|
2781
2781
|
function E(h) {
|
|
2782
2782
|
var O, g = h.query.index;
|
|
2783
|
-
return g.isVirtual ? c(c({}, h), { query: { index: g.lowLevelIndex, range: (O = h.query.range, g = g.keyTail, { type: O.type === 1 ? 2 : O.type, lower:
|
|
2783
|
+
return g.isVirtual ? c(c({}, h), { query: { index: g.lowLevelIndex, range: (O = h.query.range, g = g.keyTail, { type: O.type === 1 ? 2 : O.type, lower: en(O.lower, O.lowerOpen ? e.MAX_KEY : e.MIN_KEY, g), lowerOpen: !0, upper: en(O.upper, O.upperOpen ? e.MIN_KEY : e.MAX_KEY, g), upperOpen: !0 }) } }) : h;
|
|
2784
2784
|
}
|
|
2785
2785
|
return c(c({}, r), { schema: c(c({}, a), { primaryKey: n, indexes: o, getIndexByKeyPath: function(h) {
|
|
2786
|
-
return (h = i[
|
|
2786
|
+
return (h = i[St(h)]) && h[0];
|
|
2787
2787
|
} }), count: function(h) {
|
|
2788
2788
|
return r.count(E(h));
|
|
2789
2789
|
}, query: function(h) {
|
|
2790
2790
|
return r.query(E(h));
|
|
2791
2791
|
}, openCursor: function(h) {
|
|
2792
2792
|
var O = h.query.index, g = O.keyTail, w = O.isVirtual, S = O.keyLength;
|
|
2793
|
-
return w ? r.openCursor(E(h)).then(function(
|
|
2794
|
-
return
|
|
2793
|
+
return w ? r.openCursor(E(h)).then(function(P) {
|
|
2794
|
+
return P && y(P);
|
|
2795
2795
|
}) : r.openCursor(h);
|
|
2796
|
-
function y(
|
|
2797
|
-
return Object.create(
|
|
2798
|
-
D != null ?
|
|
2796
|
+
function y(P) {
|
|
2797
|
+
return Object.create(P, { continue: { value: function(D) {
|
|
2798
|
+
D != null ? P.continue(en(D, h.reverse ? e.MAX_KEY : e.MIN_KEY, g)) : h.unique ? P.continue(P.key.slice(0, S).concat(h.reverse ? e.MIN_KEY : e.MAX_KEY, g)) : P.continue();
|
|
2799
2799
|
} }, continuePrimaryKey: { value: function(D, R) {
|
|
2800
|
-
|
|
2800
|
+
P.continuePrimaryKey(en(D, e.MAX_KEY, g), R);
|
|
2801
2801
|
} }, primaryKey: { get: function() {
|
|
2802
|
-
return
|
|
2802
|
+
return P.primaryKey;
|
|
2803
2803
|
} }, key: { get: function() {
|
|
2804
|
-
var D =
|
|
2804
|
+
var D = P.key;
|
|
2805
2805
|
return S === 1 ? D[0] : D.slice(0, S);
|
|
2806
2806
|
} }, value: { get: function() {
|
|
2807
|
-
return
|
|
2807
|
+
return P.value;
|
|
2808
2808
|
} } });
|
|
2809
2809
|
}
|
|
2810
2810
|
} });
|
|
2811
2811
|
} });
|
|
2812
2812
|
} };
|
|
2813
|
-
function
|
|
2813
|
+
function Fn(e, n, r, a) {
|
|
2814
2814
|
return r = r || {}, a = a || "", I(e).forEach(function(i) {
|
|
2815
2815
|
var o, u, f;
|
|
2816
|
-
Q(n, i) ? (o = e[i], u = n[i], typeof o == "object" && typeof u == "object" && o && u ? (f =
|
|
2816
|
+
Q(n, i) ? (o = e[i], u = n[i], typeof o == "object" && typeof u == "object" && o && u ? (f = cn(o)) !== cn(u) ? r[a + i] = n[i] : f === "Object" ? Fn(o, u, r, a + i + ".") : o !== u && (r[a + i] = n[i]) : o !== u && (r[a + i] = n[i])) : r[a + i] = void 0;
|
|
2817
2817
|
}), I(n).forEach(function(i) {
|
|
2818
2818
|
Q(e, i) || (r[a + i] = n[i]);
|
|
2819
2819
|
}), r;
|
|
2820
2820
|
}
|
|
2821
|
-
function
|
|
2821
|
+
function Wn(e, n) {
|
|
2822
2822
|
return n.type === "delete" ? n.keys : n.keys || n.values.map(e.extractKey);
|
|
2823
2823
|
}
|
|
2824
2824
|
var ya = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
@@ -2848,8 +2848,8 @@ function Ga() {
|
|
|
2848
2848
|
return function h(O, g, w) {
|
|
2849
2849
|
return r.query({ trans: O, values: !1, query: { index: a, range: g }, limit: w }).then(function(S) {
|
|
2850
2850
|
var y = S.result;
|
|
2851
|
-
return E({ type: "delete", keys: y, trans: O }).then(function(
|
|
2852
|
-
return 0 <
|
|
2851
|
+
return E({ type: "delete", keys: y, trans: O }).then(function(P) {
|
|
2852
|
+
return 0 < P.numFailures ? Promise.reject(P.failures[0]) : y.length < w ? { failures: [], numFailures: 0, lastResult: void 0 } : h(O, c(c({}, g), { lower: y[y.length - 1], lowerOpen: !0 }), w);
|
|
2853
2853
|
});
|
|
2854
2854
|
});
|
|
2855
2855
|
}(i.trans, i.range, 1e4);
|
|
@@ -2857,19 +2857,19 @@ function Ga() {
|
|
|
2857
2857
|
}
|
|
2858
2858
|
return r.mutate(i);
|
|
2859
2859
|
function E(h) {
|
|
2860
|
-
var O, g, w, S = G.trans, y = h.keys ||
|
|
2860
|
+
var O, g, w, S = G.trans, y = h.keys || Wn(a, h);
|
|
2861
2861
|
if (!y) throw new Error("Keys missing");
|
|
2862
|
-
return (h = h.type === "add" || h.type === "put" ? c(c({}, h), { keys: y }) : c({}, h)).type !== "delete" && (h.values = v([], h.values)), h.keys && (h.keys = v([], h.keys)), O = r, w = y, ((g = h).type === "add" ? Promise.resolve([]) : O.getMany({ trans: g.trans, keys: w, cache: "immutable" })).then(function(
|
|
2862
|
+
return (h = h.type === "add" || h.type === "put" ? c(c({}, h), { keys: y }) : c({}, h)).type !== "delete" && (h.values = v([], h.values)), h.keys && (h.keys = v([], h.keys)), O = r, w = y, ((g = h).type === "add" ? Promise.resolve([]) : O.getMany({ trans: g.trans, keys: w, cache: "immutable" })).then(function(P) {
|
|
2863
2863
|
var D = y.map(function(R, x) {
|
|
2864
|
-
var k, $, T, N =
|
|
2865
|
-
return h.type === "delete" ? f.fire.call(j, R, N, S) : h.type === "add" || N === void 0 ? (k = p.fire.call(j, R, h.values[x], S), R == null && k != null && (h.keys[x] = R = k, a.outbound ||
|
|
2866
|
-
Q(T, C) ? T[C] = $[C] :
|
|
2864
|
+
var k, $, T, N = P[x], j = { onerror: null, onsuccess: null };
|
|
2865
|
+
return h.type === "delete" ? f.fire.call(j, R, N, S) : h.type === "add" || N === void 0 ? (k = p.fire.call(j, R, h.values[x], S), R == null && k != null && (h.keys[x] = R = k, a.outbound || he(h.values[x], a.keyPath, R))) : (k = Fn(N, h.values[x]), ($ = m.fire.call(j, k, R, N, S)) && (T = h.values[x], Object.keys($).forEach(function(C) {
|
|
2866
|
+
Q(T, C) ? T[C] = $[C] : he(T, C, $[C]);
|
|
2867
2867
|
}))), j;
|
|
2868
2868
|
});
|
|
2869
2869
|
return r.mutate(h).then(function(R) {
|
|
2870
2870
|
for (var x = R.failures, k = R.results, $ = R.numFailures, R = R.lastResult, T = 0; T < y.length; ++T) {
|
|
2871
2871
|
var N = (k || y)[T], j = D[T];
|
|
2872
|
-
N == null ? j.onerror && j.onerror(x[T]) : j.onsuccess && j.onsuccess(h.type === "put" &&
|
|
2872
|
+
N == null ? j.onerror && j.onerror(x[T]) : j.onsuccess && j.onsuccess(h.type === "put" && P[T] ? h.values[T] : N);
|
|
2873
2873
|
}
|
|
2874
2874
|
return { failures: x, results: k, numFailures: $, lastResult: R };
|
|
2875
2875
|
}).catch(function(R) {
|
|
@@ -2882,10 +2882,10 @@ function Ga() {
|
|
|
2882
2882
|
} });
|
|
2883
2883
|
} });
|
|
2884
2884
|
} };
|
|
2885
|
-
function
|
|
2885
|
+
function Dr(e, n, r) {
|
|
2886
2886
|
try {
|
|
2887
2887
|
if (!n || n.keys.length < e.length) return null;
|
|
2888
|
-
for (var a = [], i = 0, o = 0; i < n.keys.length && o < e.length; ++i) X(n.keys[i], e[o]) === 0 && (a.push(r ?
|
|
2888
|
+
for (var a = [], i = 0, o = 0; i < n.keys.length && o < e.length; ++i) X(n.keys[i], e[o]) === 0 && (a.push(r ? Ke(n.values[i]) : n.values[i]), ++o);
|
|
2889
2889
|
return a.length === e.length ? a : null;
|
|
2890
2890
|
} catch {
|
|
2891
2891
|
return null;
|
|
@@ -2896,19 +2896,19 @@ function Ga() {
|
|
|
2896
2896
|
var r = e.table(n);
|
|
2897
2897
|
return c(c({}, r), { getMany: function(a) {
|
|
2898
2898
|
if (!a.cache) return r.getMany(a);
|
|
2899
|
-
var i =
|
|
2899
|
+
var i = Dr(a.keys, a.trans._cache, a.cache === "clone");
|
|
2900
2900
|
return i ? M.resolve(i) : r.getMany(a).then(function(o) {
|
|
2901
|
-
return a.trans._cache = { keys: a.keys, values: a.cache === "clone" ?
|
|
2901
|
+
return a.trans._cache = { keys: a.keys, values: a.cache === "clone" ? Ke(o) : o }, o;
|
|
2902
2902
|
});
|
|
2903
2903
|
}, mutate: function(a) {
|
|
2904
2904
|
return a.type !== "add" && (a.trans._cache = null), r.mutate(a);
|
|
2905
2905
|
} });
|
|
2906
2906
|
} };
|
|
2907
2907
|
} };
|
|
2908
|
-
function
|
|
2908
|
+
function Rr(e, n) {
|
|
2909
2909
|
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !n.schema.primaryKey.outbound;
|
|
2910
2910
|
}
|
|
2911
|
-
function
|
|
2911
|
+
function xr(e, n) {
|
|
2912
2912
|
switch (e) {
|
|
2913
2913
|
case "query":
|
|
2914
2914
|
return n.values && !n.unique;
|
|
@@ -2931,22 +2931,22 @@ function Ga() {
|
|
|
2931
2931
|
function w(C) {
|
|
2932
2932
|
return C = "idb://".concat(n, "/").concat(a, "/").concat(C), R[C] || (R[C] = new le());
|
|
2933
2933
|
}
|
|
2934
|
-
var S, y,
|
|
2934
|
+
var S, y, P, D = g.trans, R = g.mutatedParts || (g.mutatedParts = {}), x = w(""), k = w(":dels"), $ = g.type, j = g.type === "deleteRange" ? [g.range] : g.type === "delete" ? [g.keys] : g.values.length < 50 ? [Wn(u, g).filter(function(C) {
|
|
2935
2935
|
return C;
|
|
2936
2936
|
}), g.values] : [], T = j[0], N = j[1], j = g.trans._cache;
|
|
2937
|
-
return
|
|
2937
|
+
return Y(T) ? (x.addKeys(T), (j = $ === "delete" || T.length === N.length ? Dr(T, j) : null) || k.addKeys(T), (j || N) && (S = w, y = j, P = N, o.indexes.forEach(function(C) {
|
|
2938
2938
|
var B = S(C.name || "");
|
|
2939
|
-
function W(
|
|
2940
|
-
return
|
|
2939
|
+
function W(H) {
|
|
2940
|
+
return H != null ? C.extractKey(H) : null;
|
|
2941
2941
|
}
|
|
2942
|
-
function H
|
|
2943
|
-
return C.multiEntry &&
|
|
2944
|
-
return B.addKey(
|
|
2945
|
-
}) : B.addKey(
|
|
2942
|
+
function z(H) {
|
|
2943
|
+
return C.multiEntry && Y(H) ? H.forEach(function(be) {
|
|
2944
|
+
return B.addKey(be);
|
|
2945
|
+
}) : B.addKey(H);
|
|
2946
2946
|
}
|
|
2947
|
-
(y ||
|
|
2948
|
-
var F = y && W(y[de]), de =
|
|
2949
|
-
X(F, de) !== 0 && (F != null &&
|
|
2947
|
+
(y || P).forEach(function(H, de) {
|
|
2948
|
+
var F = y && W(y[de]), de = P && W(P[de]);
|
|
2949
|
+
X(F, de) !== 0 && (F != null && z(F), de != null && z(de));
|
|
2950
2950
|
});
|
|
2951
2951
|
}))) : T ? (N = { from: (N = T.lower) !== null && N !== void 0 ? N : e.MIN_KEY, to: (N = T.upper) !== null && N !== void 0 ? N : e.MAX_KEY }, k.add(N), x.add(N)) : (x.add(r), k.add(r), o.indexes.forEach(function(C) {
|
|
2952
2952
|
return w(C.name).add(r);
|
|
@@ -2954,11 +2954,11 @@ function Ga() {
|
|
|
2954
2954
|
return !T || g.type !== "add" && g.type !== "put" || (x.addKeys(C.results), m && m.forEach(function(B) {
|
|
2955
2955
|
for (var W = g.values.map(function(F) {
|
|
2956
2956
|
return B.extractKey(F);
|
|
2957
|
-
}),
|
|
2957
|
+
}), z = B.keyPath.findIndex(function(F) {
|
|
2958
2958
|
return F === u.keyPath;
|
|
2959
|
-
}),
|
|
2959
|
+
}), H = 0, be = C.results.length; H < be; ++H) W[H][z] = C.results[H];
|
|
2960
2960
|
w(B.name).addKeys(W);
|
|
2961
|
-
})), D.mutatedParts =
|
|
2961
|
+
})), D.mutatedParts = Vt(D.mutatedParts || {}, R), C;
|
|
2962
2962
|
});
|
|
2963
2963
|
} }), h = function(w) {
|
|
2964
2964
|
var S = w.query, w = S.index, S = S.range;
|
|
@@ -2970,10 +2970,10 @@ function Ga() {
|
|
|
2970
2970
|
}, count: h, query: h, openCursor: h };
|
|
2971
2971
|
return I(O).forEach(function(g) {
|
|
2972
2972
|
E[g] = function(w) {
|
|
2973
|
-
var S = G.subscr, y = !!S,
|
|
2973
|
+
var S = G.subscr, y = !!S, P = Rr(G, i) && xr(g, w) ? w.obsSet = {} : S;
|
|
2974
2974
|
if (y) {
|
|
2975
2975
|
var D = function(N) {
|
|
2976
|
-
return N = "idb://".concat(n, "/").concat(a, "/").concat(N),
|
|
2976
|
+
return N = "idb://".concat(n, "/").concat(a, "/").concat(N), P[N] || (P[N] = new le());
|
|
2977
2977
|
}, R = D(""), x = D(":dels"), S = O[g](w), y = S[0], S = S[1];
|
|
2978
2978
|
if ((g === "query" && y.isPrimaryKey && !w.values ? x : D(y.name || "")).add(S), !y.isPrimaryKey) {
|
|
2979
2979
|
if (g !== "count") {
|
|
@@ -3007,29 +3007,29 @@ function Ga() {
|
|
|
3007
3007
|
}), E;
|
|
3008
3008
|
} });
|
|
3009
3009
|
} };
|
|
3010
|
-
function
|
|
3010
|
+
function Ir(e, n, r) {
|
|
3011
3011
|
if (r.numFailures === 0) return n;
|
|
3012
3012
|
if (n.type === "deleteRange") return null;
|
|
3013
3013
|
var a = n.keys ? n.keys.length : "values" in n && n.values ? n.values.length : 1;
|
|
3014
|
-
return r.numFailures === a ? null : (n = c({}, n),
|
|
3014
|
+
return r.numFailures === a ? null : (n = c({}, n), Y(n.keys) && (n.keys = n.keys.filter(function(i, o) {
|
|
3015
3015
|
return !(o in r.failures);
|
|
3016
|
-
})), "values" in n &&
|
|
3016
|
+
})), "values" in n && Y(n.values) && (n.values = n.values.filter(function(i, o) {
|
|
3017
3017
|
return !(o in r.failures);
|
|
3018
3018
|
})), n);
|
|
3019
3019
|
}
|
|
3020
|
-
function
|
|
3020
|
+
function Un(e, n) {
|
|
3021
3021
|
return r = e, ((a = n).lower === void 0 || (a.lowerOpen ? 0 < X(r, a.lower) : 0 <= X(r, a.lower))) && (e = e, (n = n).upper === void 0 || (n.upperOpen ? X(e, n.upper) < 0 : X(e, n.upper) <= 0));
|
|
3022
3022
|
var r, a;
|
|
3023
3023
|
}
|
|
3024
|
-
function
|
|
3024
|
+
function kr(e, n, O, a, i, o) {
|
|
3025
3025
|
if (!O || O.length === 0) return e;
|
|
3026
3026
|
var u = n.query.index, f = u.multiEntry, p = n.query.range, m = a.schema.primaryKey.extractKey, E = u.extractKey, h = (u.lowLevelIndex || u).extractKey, O = O.reduce(function(g, w) {
|
|
3027
3027
|
var S = g, y = [];
|
|
3028
|
-
if (w.type === "add" || w.type === "put") for (var
|
|
3028
|
+
if (w.type === "add" || w.type === "put") for (var P = new le(), D = w.values.length - 1; 0 <= D; --D) {
|
|
3029
3029
|
var R, x = w.values[D], k = m(x);
|
|
3030
|
-
|
|
3031
|
-
return
|
|
3032
|
-
}) :
|
|
3030
|
+
P.hasKey(k) || (R = E(x), (f && Y(R) ? R.some(function(C) {
|
|
3031
|
+
return Un(C, p);
|
|
3032
|
+
}) : Un(R, p)) && (P.addKey(k), y.push(x)));
|
|
3033
3033
|
}
|
|
3034
3034
|
switch (w.type) {
|
|
3035
3035
|
case "add":
|
|
@@ -3062,7 +3062,7 @@ function Ga() {
|
|
|
3062
3062
|
case "deleteRange":
|
|
3063
3063
|
var j = w.range;
|
|
3064
3064
|
S = g.filter(function(B) {
|
|
3065
|
-
return !
|
|
3065
|
+
return !Un(m(B), j);
|
|
3066
3066
|
});
|
|
3067
3067
|
}
|
|
3068
3068
|
return S;
|
|
@@ -3071,7 +3071,7 @@ function Ga() {
|
|
|
3071
3071
|
return X(h(g), h(w)) || X(m(g), m(w));
|
|
3072
3072
|
}), n.limit && n.limit < 1 / 0 && (O.length > n.limit ? O.length = n.limit : e.length === n.limit && O.length < n.limit && (i.dirty = !0)), o ? Object.freeze(O) : O);
|
|
3073
3073
|
}
|
|
3074
|
-
function
|
|
3074
|
+
function Tr(e, n) {
|
|
3075
3075
|
return X(e.lower, n.lower) === 0 && X(e.upper, n.upper) === 0 && !!e.lowerOpen == !!n.lowerOpen && !!e.upperOpen == !!n.upperOpen;
|
|
3076
3076
|
}
|
|
3077
3077
|
function Ea(e, n) {
|
|
@@ -3099,7 +3099,7 @@ function Ga() {
|
|
|
3099
3099
|
e.subscribers.add(r), a.addEventListener("abort", function() {
|
|
3100
3100
|
var i, o;
|
|
3101
3101
|
e.subscribers.delete(r), e.subscribers.size === 0 && (i = e, o = n, setTimeout(function() {
|
|
3102
|
-
i.subscribers.size === 0 &&
|
|
3102
|
+
i.subscribers.size === 0 && Le(o, i);
|
|
3103
3103
|
}, 3e3));
|
|
3104
3104
|
});
|
|
3105
3105
|
}
|
|
@@ -3111,21 +3111,21 @@ function Ga() {
|
|
|
3111
3111
|
return function() {
|
|
3112
3112
|
if (o.abort(), a === "readwrite") {
|
|
3113
3113
|
for (var m = /* @__PURE__ */ new Set(), E = 0, h = r; E < h.length; E++) {
|
|
3114
|
-
var O = h[E], g =
|
|
3114
|
+
var O = h[E], g = Je["idb://".concat(n, "/").concat(O)];
|
|
3115
3115
|
if (g) {
|
|
3116
3116
|
var w = e.table(O), S = g.optimisticOps.filter(function(B) {
|
|
3117
3117
|
return B.trans === f;
|
|
3118
3118
|
});
|
|
3119
|
-
if (f._explicit && p && f.mutatedParts) for (var y = 0,
|
|
3119
|
+
if (f._explicit && p && f.mutatedParts) for (var y = 0, P = Object.values(g.queries.query); y < P.length; y++) for (var D = 0, R = ($ = P[y]).slice(); D < R.length; D++) Mn((T = R[D]).obsSet, f.mutatedParts) && (Le($, T), T.subscribers.forEach(function(B) {
|
|
3120
3120
|
return m.add(B);
|
|
3121
3121
|
}));
|
|
3122
3122
|
else if (0 < S.length) {
|
|
3123
3123
|
g.optimisticOps = g.optimisticOps.filter(function(B) {
|
|
3124
3124
|
return B.trans !== f;
|
|
3125
3125
|
});
|
|
3126
|
-
for (var x = 0, k = Object.values(g.queries.query); x < k.length; x++) for (var $, T, N, j = 0, C = ($ = k[x]).slice(); j < C.length; j++) (T = C[j]).res != null && f.mutatedParts && (p && !T.dirty ? (N = Object.isFrozen(T.res), N =
|
|
3126
|
+
for (var x = 0, k = Object.values(g.queries.query); x < k.length; x++) for (var $, T, N, j = 0, C = ($ = k[x]).slice(); j < C.length; j++) (T = C[j]).res != null && f.mutatedParts && (p && !T.dirty ? (N = Object.isFrozen(T.res), N = kr(T.res, T.req, S, w, T, N), T.dirty ? (Le($, T), T.subscribers.forEach(function(B) {
|
|
3127
3127
|
return m.add(B);
|
|
3128
|
-
})) : N !== T.res && (T.res = N, T.promise = M.resolve({ result: N }))) : (T.dirty &&
|
|
3128
|
+
})) : N !== T.res && (T.res = N, T.promise = M.resolve({ result: N }))) : (T.dirty && Le($, T), T.subscribers.forEach(function(B) {
|
|
3129
3129
|
return m.add(B);
|
|
3130
3130
|
})));
|
|
3131
3131
|
}
|
|
@@ -3142,65 +3142,65 @@ function Ga() {
|
|
|
3142
3142
|
return c(c({}, a), { mutate: function(o) {
|
|
3143
3143
|
var u = G.trans;
|
|
3144
3144
|
if (i.outbound || u.db._options.cache === "disabled" || u.explicit || u.idbtrans.mode !== "readwrite") return a.mutate(o);
|
|
3145
|
-
var f =
|
|
3146
|
-
return f ? (u = a.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length ||
|
|
3145
|
+
var f = Je["idb://".concat(n, "/").concat(r)];
|
|
3146
|
+
return f ? (u = a.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length || Wn(i, o).some(function(p) {
|
|
3147
3147
|
return p == null;
|
|
3148
|
-
})) ? (f.optimisticOps.push(o), o.mutatedParts &&
|
|
3149
|
-
0 < p.numFailures && (
|
|
3148
|
+
})) ? (f.optimisticOps.push(o), o.mutatedParts && qt(o.mutatedParts), u.then(function(p) {
|
|
3149
|
+
0 < p.numFailures && (Le(f.optimisticOps, o), (p = Ir(0, o, p)) && f.optimisticOps.push(p), o.mutatedParts && qt(o.mutatedParts));
|
|
3150
3150
|
}), u.catch(function() {
|
|
3151
|
-
|
|
3151
|
+
Le(f.optimisticOps, o), o.mutatedParts && qt(o.mutatedParts);
|
|
3152
3152
|
})) : u.then(function(p) {
|
|
3153
|
-
var m =
|
|
3153
|
+
var m = Ir(0, c(c({}, o), { values: o.values.map(function(E, h) {
|
|
3154
3154
|
var O;
|
|
3155
|
-
return p.failures[h] ? E : (E = (O = i.keyPath) !== null && O !== void 0 && O.includes(".") ?
|
|
3155
|
+
return p.failures[h] ? E : (E = (O = i.keyPath) !== null && O !== void 0 && O.includes(".") ? Ke(E) : c({}, E), he(E, i.keyPath, p.results[h]), E);
|
|
3156
3156
|
}) }), p);
|
|
3157
3157
|
f.optimisticOps.push(m), queueMicrotask(function() {
|
|
3158
|
-
return o.mutatedParts &&
|
|
3158
|
+
return o.mutatedParts && qt(o.mutatedParts);
|
|
3159
3159
|
});
|
|
3160
3160
|
}), u) : a.mutate(o);
|
|
3161
3161
|
}, query: function(o) {
|
|
3162
|
-
if (!
|
|
3163
|
-
var u = ((m = G.trans) === null || m === void 0 ? void 0 : m.db._options.cache) === "immutable", h = G, f = h.requery, p = h.signal, m = function(w, S, y,
|
|
3164
|
-
var D =
|
|
3162
|
+
if (!Rr(G, a) || !xr("query", o)) return a.query(o);
|
|
3163
|
+
var u = ((m = G.trans) === null || m === void 0 ? void 0 : m.db._options.cache) === "immutable", h = G, f = h.requery, p = h.signal, m = function(w, S, y, P) {
|
|
3164
|
+
var D = Je["idb://".concat(w, "/").concat(S)];
|
|
3165
3165
|
if (!D) return [];
|
|
3166
3166
|
if (!(S = D.queries[y])) return [null, !1, D, null];
|
|
3167
|
-
var R = S[(
|
|
3167
|
+
var R = S[(P.query ? P.query.index.name : null) || ""];
|
|
3168
3168
|
if (!R) return [null, !1, D, null];
|
|
3169
3169
|
switch (y) {
|
|
3170
3170
|
case "query":
|
|
3171
3171
|
var x = R.find(function(k) {
|
|
3172
|
-
return k.req.limit ===
|
|
3172
|
+
return k.req.limit === P.limit && k.req.values === P.values && Tr(k.req.query.range, P.query.range);
|
|
3173
3173
|
});
|
|
3174
3174
|
return x ? [x, !0, D, R] : [R.find(function(k) {
|
|
3175
|
-
return ("limit" in k.req ? k.req.limit : 1 / 0) >=
|
|
3175
|
+
return ("limit" in k.req ? k.req.limit : 1 / 0) >= P.limit && (!P.values || k.req.values) && Ea(k.req.query.range, P.query.range);
|
|
3176
3176
|
}), !1, D, R];
|
|
3177
3177
|
case "count":
|
|
3178
3178
|
return x = R.find(function(k) {
|
|
3179
|
-
return
|
|
3179
|
+
return Tr(k.req.query.range, P.query.range);
|
|
3180
3180
|
}), [x, !!x, D, R];
|
|
3181
3181
|
}
|
|
3182
3182
|
}(n, r, "query", o), E = m[0], h = m[1], O = m[2], g = m[3];
|
|
3183
3183
|
return E && h ? E.obsSet = o.obsSet : (h = a.query(o).then(function(w) {
|
|
3184
3184
|
var S = w.result;
|
|
3185
3185
|
if (E && (E.res = S), u) {
|
|
3186
|
-
for (var y = 0,
|
|
3186
|
+
for (var y = 0, P = S.length; y < P; ++y) Object.freeze(S[y]);
|
|
3187
3187
|
Object.freeze(S);
|
|
3188
|
-
} else w.result =
|
|
3188
|
+
} else w.result = Ke(S);
|
|
3189
3189
|
return w;
|
|
3190
3190
|
}).catch(function(w) {
|
|
3191
|
-
return g && E &&
|
|
3192
|
-
}), E = { obsSet: o.obsSet, promise: h, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 }, g ? g.push(E) : (g = [E], (O = O || (
|
|
3193
|
-
return { result:
|
|
3191
|
+
return g && E && Le(g, E), Promise.reject(w);
|
|
3192
|
+
}), E = { obsSet: o.obsSet, promise: h, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 }, g ? g.push(E) : (g = [E], (O = O || (Je["idb://".concat(n, "/").concat(r)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[o.query.index.name || ""] = g)), Sa(E, g, f, p), E.promise.then(function(w) {
|
|
3193
|
+
return { result: kr(w.result, o, O == null ? void 0 : O.optimisticOps, a, E, u) };
|
|
3194
3194
|
});
|
|
3195
3195
|
} });
|
|
3196
3196
|
} });
|
|
3197
3197
|
} };
|
|
3198
|
-
function
|
|
3198
|
+
function tn(e, n) {
|
|
3199
3199
|
return new Proxy(e, { get: function(r, a, i) {
|
|
3200
3200
|
return a === "db" ? n : Reflect.get(r, a, i);
|
|
3201
3201
|
} });
|
|
3202
3202
|
}
|
|
3203
|
-
var
|
|
3203
|
+
var De = (ie.prototype.version = function(e) {
|
|
3204
3204
|
if (isNaN(e) || e < 0.1) throw new K.Type("Given version is not a positive number");
|
|
3205
3205
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new K.Schema("Cannot add version when database is open");
|
|
3206
3206
|
this.verno = Math.max(this.verno, e);
|
|
@@ -3208,7 +3208,7 @@ function Ga() {
|
|
|
3208
3208
|
return a._cfg.version === e;
|
|
3209
3209
|
})[0];
|
|
3210
3210
|
return r || (r = new this.Version(e), n.push(r), n.sort(fa), r.stores({}), this._state.autoSchema = !1, r);
|
|
3211
|
-
},
|
|
3211
|
+
}, ie.prototype._whenReady = function(e) {
|
|
3212
3212
|
var n = this;
|
|
3213
3213
|
return this.idbdb && (this._state.openComplete || G.letThrough || this._vip) ? e() : new M(function(r, a) {
|
|
3214
3214
|
if (n._state.openComplete) return a(new K.DatabaseClosed(n._state.dbOpenError));
|
|
@@ -3218,24 +3218,24 @@ function Ga() {
|
|
|
3218
3218
|
}
|
|
3219
3219
|
n._state.dbReadyPromise.then(r, a);
|
|
3220
3220
|
}).then(e);
|
|
3221
|
-
},
|
|
3221
|
+
}, ie.prototype.use = function(e) {
|
|
3222
3222
|
var n = e.stack, r = e.create, a = e.level, i = e.name;
|
|
3223
3223
|
return i && this.unuse({ stack: n, name: i }), e = this._middlewares[n] || (this._middlewares[n] = []), e.push({ stack: n, create: r, level: a ?? 10, name: i }), e.sort(function(o, u) {
|
|
3224
3224
|
return o.level - u.level;
|
|
3225
3225
|
}), this;
|
|
3226
|
-
},
|
|
3226
|
+
}, ie.prototype.unuse = function(e) {
|
|
3227
3227
|
var n = e.stack, r = e.name, a = e.create;
|
|
3228
3228
|
return n && this._middlewares[n] && (this._middlewares[n] = this._middlewares[n].filter(function(i) {
|
|
3229
3229
|
return a ? i.create !== a : !!r && i.name !== r;
|
|
3230
3230
|
})), this;
|
|
3231
|
-
},
|
|
3231
|
+
}, ie.prototype.open = function() {
|
|
3232
3232
|
var e = this;
|
|
3233
|
-
return
|
|
3233
|
+
return Ye(ke, function() {
|
|
3234
3234
|
return ma(e);
|
|
3235
3235
|
});
|
|
3236
|
-
},
|
|
3237
|
-
var e = this._state, n =
|
|
3238
|
-
if (0 <= n &&
|
|
3236
|
+
}, ie.prototype._close = function() {
|
|
3237
|
+
var e = this._state, n = st.indexOf(this);
|
|
3238
|
+
if (0 <= n && st.splice(n, 1), this.idbdb) {
|
|
3239
3239
|
try {
|
|
3240
3240
|
this.idbdb.close();
|
|
3241
3241
|
} catch {
|
|
@@ -3247,10 +3247,10 @@ function Ga() {
|
|
|
3247
3247
|
}), e.openCanceller = new M(function(r, a) {
|
|
3248
3248
|
e.cancelOpen = a;
|
|
3249
3249
|
}));
|
|
3250
|
-
},
|
|
3250
|
+
}, ie.prototype.close = function(r) {
|
|
3251
3251
|
var n = (r === void 0 ? { disableAutoOpen: !0 } : r).disableAutoOpen, r = this._state;
|
|
3252
3252
|
n ? (r.isBeingOpened && r.cancelOpen(new K.DatabaseClosed()), this._close(), r.autoOpen = !1, r.dbOpenError = new K.DatabaseClosed()) : (this._close(), r.autoOpen = this._options.autoOpen || r.isBeingOpened, r.openComplete = !1, r.dbOpenError = null);
|
|
3253
|
-
},
|
|
3253
|
+
}, ie.prototype.delete = function(e) {
|
|
3254
3254
|
var n = this;
|
|
3255
3255
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
3256
3256
|
var r = 0 < arguments.length && typeof arguments[0] != "object", a = this._state;
|
|
@@ -3260,37 +3260,37 @@ function Ga() {
|
|
|
3260
3260
|
var f = n._deps.indexedDB.deleteDatabase(n.name);
|
|
3261
3261
|
f.onsuccess = te(function() {
|
|
3262
3262
|
var p, m, E;
|
|
3263
|
-
p = n._deps, m = n.name, E = p.indexedDB, p = p.IDBKeyRange,
|
|
3264
|
-
}), f.onerror =
|
|
3263
|
+
p = n._deps, m = n.name, E = p.indexedDB, p = p.IDBKeyRange, Cn(E) || m === Kt || Nn(E, p).delete(m).catch(V), i();
|
|
3264
|
+
}), f.onerror = Se(o), f.onblocked = n._fireOnBlocked;
|
|
3265
3265
|
}
|
|
3266
3266
|
if (r) throw new K.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
3267
3267
|
a.isBeingOpened ? a.dbReadyPromise.then(u) : u();
|
|
3268
3268
|
});
|
|
3269
|
-
},
|
|
3269
|
+
}, ie.prototype.backendDB = function() {
|
|
3270
3270
|
return this.idbdb;
|
|
3271
|
-
},
|
|
3271
|
+
}, ie.prototype.isOpen = function() {
|
|
3272
3272
|
return this.idbdb !== null;
|
|
3273
|
-
},
|
|
3273
|
+
}, ie.prototype.hasBeenClosed = function() {
|
|
3274
3274
|
var e = this._state.dbOpenError;
|
|
3275
3275
|
return e && e.name === "DatabaseClosed";
|
|
3276
|
-
},
|
|
3276
|
+
}, ie.prototype.hasFailed = function() {
|
|
3277
3277
|
return this._state.dbOpenError !== null;
|
|
3278
|
-
},
|
|
3278
|
+
}, ie.prototype.dynamicallyOpened = function() {
|
|
3279
3279
|
return this._state.autoSchema;
|
|
3280
|
-
}, Object.defineProperty(
|
|
3280
|
+
}, Object.defineProperty(ie.prototype, "tables", { get: function() {
|
|
3281
3281
|
var e = this;
|
|
3282
3282
|
return I(this._allTables).map(function(n) {
|
|
3283
3283
|
return e._allTables[n];
|
|
3284
3284
|
});
|
|
3285
|
-
}, enumerable: !1, configurable: !0 }),
|
|
3285
|
+
}, enumerable: !1, configurable: !0 }), ie.prototype.transaction = function() {
|
|
3286
3286
|
var e = (function(n, r, a) {
|
|
3287
3287
|
var i = arguments.length;
|
|
3288
3288
|
if (i < 2) throw new K.InvalidArgument("Too few arguments");
|
|
3289
3289
|
for (var o = new Array(i - 1); --i; ) o[i - 1] = arguments[i];
|
|
3290
|
-
return a = o.pop(), [n,
|
|
3290
|
+
return a = o.pop(), [n, Vn(o), a];
|
|
3291
3291
|
}).apply(this, arguments);
|
|
3292
3292
|
return this._transaction.apply(this, e);
|
|
3293
|
-
},
|
|
3293
|
+
}, ie.prototype._transaction = function(e, n, r) {
|
|
3294
3294
|
var a = this, i = G.trans;
|
|
3295
3295
|
i && i.db === this && e.indexOf("!") === -1 || (i = null);
|
|
3296
3296
|
var o, u, f = e.indexOf("?") !== -1;
|
|
@@ -3299,13 +3299,13 @@ function Ga() {
|
|
|
3299
3299
|
if (u = n.map(function(m) {
|
|
3300
3300
|
if (m = m instanceof a.Table ? m.name : m, typeof m != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
3301
3301
|
return m;
|
|
3302
|
-
}), e == "r" || e ===
|
|
3302
|
+
}), e == "r" || e === En) o = En;
|
|
3303
3303
|
else {
|
|
3304
|
-
if (e != "rw" && e !=
|
|
3305
|
-
o =
|
|
3304
|
+
if (e != "rw" && e != Sn) throw new K.InvalidArgument("Invalid transaction mode: " + e);
|
|
3305
|
+
o = Sn;
|
|
3306
3306
|
}
|
|
3307
3307
|
if (i) {
|
|
3308
|
-
if (i.mode ===
|
|
3308
|
+
if (i.mode === En && o === Sn) {
|
|
3309
3309
|
if (!f) throw new K.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
3310
3310
|
i = null;
|
|
3311
3311
|
}
|
|
@@ -3319,7 +3319,7 @@ function Ga() {
|
|
|
3319
3319
|
} catch (m) {
|
|
3320
3320
|
return i ? i._promise(null, function(E, h) {
|
|
3321
3321
|
h(m);
|
|
3322
|
-
}) :
|
|
3322
|
+
}) : se(m);
|
|
3323
3323
|
}
|
|
3324
3324
|
var p = (function m(E, h, O, g, w) {
|
|
3325
3325
|
return M.resolve().then(function() {
|
|
@@ -3328,78 +3328,78 @@ function Ga() {
|
|
|
3328
3328
|
else try {
|
|
3329
3329
|
y.create(), y.idbtrans._explicit = !0, E._state.PR1398_maxLoop = 3;
|
|
3330
3330
|
} catch (R) {
|
|
3331
|
-
return R.name ===
|
|
3331
|
+
return R.name === dn.InvalidState && E.isOpen() && 0 < --E._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), E.close({ disableAutoOpen: !1 }), E.open().then(function() {
|
|
3332
3332
|
return m(E, h, O, null, w);
|
|
3333
|
-
})) :
|
|
3333
|
+
})) : se(R);
|
|
3334
3334
|
}
|
|
3335
|
-
var
|
|
3336
|
-
return D &&
|
|
3335
|
+
var P, D = ln(w);
|
|
3336
|
+
return D && at(), S = M.follow(function() {
|
|
3337
3337
|
var R;
|
|
3338
|
-
(
|
|
3339
|
-
}, S), (
|
|
3340
|
-
return y.active ? R :
|
|
3338
|
+
(P = w.call(y, y)) && (D ? (R = Ne.bind(null, null), P.then(R, R)) : typeof P.next == "function" && typeof P.throw == "function" && (P = Ln(P)));
|
|
3339
|
+
}, S), (P && typeof P.then == "function" ? M.resolve(P).then(function(R) {
|
|
3340
|
+
return y.active ? R : se(new K.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3341
3341
|
}) : S.then(function() {
|
|
3342
|
-
return
|
|
3342
|
+
return P;
|
|
3343
3343
|
})).then(function(R) {
|
|
3344
3344
|
return g && y._resolve(), y._completion.then(function() {
|
|
3345
3345
|
return R;
|
|
3346
3346
|
});
|
|
3347
3347
|
}).catch(function(R) {
|
|
3348
|
-
return y._reject(R),
|
|
3348
|
+
return y._reject(R), se(R);
|
|
3349
3349
|
});
|
|
3350
3350
|
});
|
|
3351
3351
|
}).bind(null, this, o, u, i, r);
|
|
3352
|
-
return i ? i._promise(o, p, "lock") : G.trans ?
|
|
3352
|
+
return i ? i._promise(o, p, "lock") : G.trans ? Ye(G.transless, function() {
|
|
3353
3353
|
return a._whenReady(p);
|
|
3354
3354
|
}) : this._whenReady(p);
|
|
3355
|
-
},
|
|
3355
|
+
}, ie.prototype.table = function(e) {
|
|
3356
3356
|
if (!Q(this._allTables, e)) throw new K.InvalidTable("Table ".concat(e, " does not exist"));
|
|
3357
3357
|
return this._allTables[e];
|
|
3358
|
-
},
|
|
3359
|
-
function
|
|
3358
|
+
}, ie);
|
|
3359
|
+
function ie(e, n) {
|
|
3360
3360
|
var r = this;
|
|
3361
3361
|
this._middlewares = {}, this.verno = 0;
|
|
3362
|
-
var a =
|
|
3363
|
-
this._options = n = c({ addons:
|
|
3362
|
+
var a = ie.dependencies;
|
|
3363
|
+
this._options = n = c({ addons: ie.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;
|
|
3364
3364
|
var i, o, u, f, p, m = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: V, dbReadyPromise: null, cancelOpen: V, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: n.autoOpen };
|
|
3365
3365
|
m.dbReadyPromise = new M(function(h) {
|
|
3366
3366
|
m.dbReadyResolve = h;
|
|
3367
3367
|
}), m.openCanceller = new M(function(h, O) {
|
|
3368
3368
|
m.cancelOpen = O;
|
|
3369
|
-
}), this._state = m, this.name = e, this.on =
|
|
3369
|
+
}), this._state = m, this.name = e, this.on = mt(this, "populate", "blocked", "versionchange", "close", { ready: [fn, V] }), this.on.ready.subscribe = ut(this.on.ready.subscribe, function(h) {
|
|
3370
3370
|
return function(O, g) {
|
|
3371
|
-
|
|
3371
|
+
ie.vip(function() {
|
|
3372
3372
|
var w, S = r._state;
|
|
3373
3373
|
S.openComplete ? (S.dbOpenError || M.resolve().then(O), g && h(O)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(O), g && h(O)) : (h(O), w = r, g || h(function y() {
|
|
3374
3374
|
w.on.ready.unsubscribe(O), w.on.ready.unsubscribe(y);
|
|
3375
3375
|
}));
|
|
3376
3376
|
});
|
|
3377
3377
|
};
|
|
3378
|
-
}), this.Collection = (i = this,
|
|
3378
|
+
}), this.Collection = (i = this, bt(sa.prototype, function(P, y) {
|
|
3379
3379
|
this.db = i;
|
|
3380
|
-
var g =
|
|
3380
|
+
var g = ur, w = null;
|
|
3381
3381
|
if (y) try {
|
|
3382
3382
|
g = y();
|
|
3383
3383
|
} catch (D) {
|
|
3384
3384
|
w = D;
|
|
3385
3385
|
}
|
|
3386
|
-
var S =
|
|
3387
|
-
this._ctx = { table: y, index: S.index, isPrimKey: !S.index || y.schema.primKey.keyPath && S.index === y.schema.primKey.name, range: g, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: w, or: S.or, valueMapper:
|
|
3388
|
-
})), this.Table = (o = this,
|
|
3389
|
-
this.db = o, this._tx = g, this.name = h, this.schema = O, this.hook = o._allTables[h] ? o._allTables[h].hook :
|
|
3390
|
-
})), this.Transaction = (u = this,
|
|
3386
|
+
var S = P._ctx, y = S.table, P = y.hook.reading.fire;
|
|
3387
|
+
this._ctx = { table: y, index: S.index, isPrimKey: !S.index || y.schema.primKey.keyPath && S.index === y.schema.primKey.name, range: g, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: w, or: S.or, valueMapper: P !== dt ? P : null };
|
|
3388
|
+
})), this.Table = (o = this, bt(hr.prototype, function(h, O, g) {
|
|
3389
|
+
this.db = o, this._tx = g, this.name = h, this.schema = O, this.hook = o._allTables[h] ? o._allTables[h].hook : mt(null, { creating: [Jr, V], reading: [Xr, dt], updating: [Vr, V], deleting: [Zr, V] });
|
|
3390
|
+
})), this.Transaction = (u = this, bt(ca.prototype, function(h, O, g, w, S) {
|
|
3391
3391
|
var y = this;
|
|
3392
|
-
this.db = u, this.mode = h, this.storeNames = O, this.schema = g, this.chromeTransactionDurability = w, this.idbtrans = null, this.on =
|
|
3393
|
-
y._resolve =
|
|
3392
|
+
this.db = u, this.mode = h, this.storeNames = O, this.schema = g, this.chromeTransactionDurability = w, this.idbtrans = null, this.on = mt(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(P, D) {
|
|
3393
|
+
y._resolve = P, y._reject = D;
|
|
3394
3394
|
}), this._completion.then(function() {
|
|
3395
3395
|
y.active = !1, y.on.complete.fire();
|
|
3396
|
-
}, function(
|
|
3396
|
+
}, function(P) {
|
|
3397
3397
|
var D = y.active;
|
|
3398
|
-
return y.active = !1, y.on.error.fire(
|
|
3398
|
+
return y.active = !1, y.on.error.fire(P), y.parent ? y.parent._reject(P) : D && y.idbtrans && y.idbtrans.abort(), se(P);
|
|
3399
3399
|
});
|
|
3400
|
-
})), this.Version = (f = this,
|
|
3400
|
+
})), this.Version = (f = this, bt(ga.prototype, function(h) {
|
|
3401
3401
|
this.db = f, this._cfg = { version: h, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3402
|
-
})), this.WhereClause = (p = this,
|
|
3402
|
+
})), this.WhereClause = (p = this, bt(yr.prototype, function(h, O, g) {
|
|
3403
3403
|
if (this.db = p, this._ctx = { table: h, index: O === ":id" ? null : O, or: g }, this._cmp = this._ascending = X, this._descending = function(w, S) {
|
|
3404
3404
|
return X(S, w);
|
|
3405
3405
|
}, this._max = function(w, S) {
|
|
@@ -3411,10 +3411,10 @@ function Ga() {
|
|
|
3411
3411
|
0 < h.newVersion ? console.warn("Another connection wants to upgrade database '".concat(r.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(r.name, "'. Closing db now to resume the delete request.")), r.close({ disableAutoOpen: !1 });
|
|
3412
3412
|
}), this.on("blocked", function(h) {
|
|
3413
3413
|
!h.newVersion || h.newVersion < h.oldVersion ? console.warn("Dexie.delete('".concat(r.name, "') was blocked")) : console.warn("Upgrade '".concat(r.name, "' blocked by other connection holding version ").concat(h.oldVersion / 10));
|
|
3414
|
-
}), this._maxKey =
|
|
3414
|
+
}), this._maxKey = Et(n.IDBKeyRange), this._createTransaction = function(h, O, g, w) {
|
|
3415
3415
|
return new r.Transaction(h, O, g, r._options.chromeTransactionDurability, w);
|
|
3416
3416
|
}, this._fireOnBlocked = function(h) {
|
|
3417
|
-
r.on("blocked").fire(h),
|
|
3417
|
+
r.on("blocked").fire(h), st.filter(function(O) {
|
|
3418
3418
|
return O.name === r.name && O !== r && !O._state.vcFired;
|
|
3419
3419
|
}).map(function(O) {
|
|
3420
3420
|
return O.on("versionchange").fire(h);
|
|
@@ -3423,64 +3423,64 @@ function Ga() {
|
|
|
3423
3423
|
var E = new Proxy(this, { get: function(h, O, g) {
|
|
3424
3424
|
if (O === "_vip") return !0;
|
|
3425
3425
|
if (O === "table") return function(S) {
|
|
3426
|
-
return
|
|
3426
|
+
return tn(r.table(S), E);
|
|
3427
3427
|
};
|
|
3428
3428
|
var w = Reflect.get(h, O, g);
|
|
3429
|
-
return w instanceof
|
|
3430
|
-
return
|
|
3429
|
+
return w instanceof hr ? tn(w, E) : O === "tables" ? w.map(function(S) {
|
|
3430
|
+
return tn(S, E);
|
|
3431
3431
|
}) : O === "_createTransaction" ? function() {
|
|
3432
|
-
return
|
|
3432
|
+
return tn(w.apply(this, arguments), E);
|
|
3433
3433
|
} : w;
|
|
3434
3434
|
} });
|
|
3435
3435
|
this.vip = E, a.forEach(function(h) {
|
|
3436
3436
|
return h(r);
|
|
3437
3437
|
});
|
|
3438
3438
|
}
|
|
3439
|
-
var
|
|
3439
|
+
var nn, ye = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", _a = (zn.prototype.subscribe = function(e, n, r) {
|
|
3440
3440
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: n, complete: r });
|
|
3441
|
-
},
|
|
3441
|
+
}, zn.prototype[ye] = function() {
|
|
3442
3442
|
return this;
|
|
3443
|
-
},
|
|
3444
|
-
function
|
|
3443
|
+
}, zn);
|
|
3444
|
+
function zn(e) {
|
|
3445
3445
|
this._subscribe = e;
|
|
3446
3446
|
}
|
|
3447
3447
|
try {
|
|
3448
|
-
|
|
3448
|
+
nn = { indexedDB: A.indexedDB || A.mozIndexedDB || A.webkitIndexedDB || A.msIndexedDB, IDBKeyRange: A.IDBKeyRange || A.webkitIDBKeyRange };
|
|
3449
3449
|
} catch {
|
|
3450
|
-
|
|
3450
|
+
nn = { indexedDB: null, IDBKeyRange: null };
|
|
3451
3451
|
}
|
|
3452
|
-
function
|
|
3452
|
+
function Nr(e) {
|
|
3453
3453
|
var n, r = !1, a = new _a(function(i) {
|
|
3454
|
-
var o =
|
|
3454
|
+
var o = ln(e), u, f = !1, p = {}, m = {}, E = { get closed() {
|
|
3455
3455
|
return f;
|
|
3456
3456
|
}, unsubscribe: function() {
|
|
3457
|
-
f || (f = !0, u && u.abort(), h &&
|
|
3457
|
+
f || (f = !0, u && u.abort(), h && je.storagemutated.unsubscribe(g));
|
|
3458
3458
|
} };
|
|
3459
3459
|
i.start && i.start(E);
|
|
3460
3460
|
var h = !1, O = function() {
|
|
3461
|
-
return
|
|
3461
|
+
return wn(w);
|
|
3462
3462
|
}, g = function(S) {
|
|
3463
|
-
|
|
3463
|
+
Vt(p, S), Mn(m, p) && O();
|
|
3464
3464
|
}, w = function() {
|
|
3465
|
-
var S, y,
|
|
3466
|
-
!f &&
|
|
3467
|
-
var R =
|
|
3465
|
+
var S, y, P;
|
|
3466
|
+
!f && nn.indexedDB && (p = {}, S = {}, u && u.abort(), u = new AbortController(), P = function(D) {
|
|
3467
|
+
var R = nt();
|
|
3468
3468
|
try {
|
|
3469
|
-
o &&
|
|
3470
|
-
var x =
|
|
3471
|
-
return x = o ? x.finally(
|
|
3469
|
+
o && at();
|
|
3470
|
+
var x = Te(e, D);
|
|
3471
|
+
return x = o ? x.finally(Ne) : x;
|
|
3472
3472
|
} finally {
|
|
3473
|
-
R &&
|
|
3473
|
+
R && rt();
|
|
3474
3474
|
}
|
|
3475
|
-
}(y = { subscr: S, signal: u.signal, requery: O, querier: e, trans: null }), Promise.resolve(
|
|
3475
|
+
}(y = { subscr: S, signal: u.signal, requery: O, querier: e, trans: null }), Promise.resolve(P).then(function(D) {
|
|
3476
3476
|
r = !0, n = D, f || y.signal.aborted || (p = {}, function(R) {
|
|
3477
3477
|
for (var x in R) if (Q(R, x)) return;
|
|
3478
3478
|
return 1;
|
|
3479
|
-
}(m = S) || h || (
|
|
3479
|
+
}(m = S) || h || (je(wt, g), h = !0), wn(function() {
|
|
3480
3480
|
return !f && i.next && i.next(D);
|
|
3481
3481
|
}));
|
|
3482
3482
|
}, function(D) {
|
|
3483
|
-
r = !1, ["DatabaseClosedError", "AbortError"].includes(D == null ? void 0 : D.name) || f ||
|
|
3483
|
+
r = !1, ["DatabaseClosedError", "AbortError"].includes(D == null ? void 0 : D.name) || f || wn(function() {
|
|
3484
3484
|
f || i.error && i.error(D);
|
|
3485
3485
|
});
|
|
3486
3486
|
}));
|
|
@@ -3493,34 +3493,34 @@ function Ga() {
|
|
|
3493
3493
|
return n;
|
|
3494
3494
|
}, a;
|
|
3495
3495
|
}
|
|
3496
|
-
var
|
|
3497
|
-
function
|
|
3498
|
-
var n =
|
|
3496
|
+
var Ze = De;
|
|
3497
|
+
function Hn(e) {
|
|
3498
|
+
var n = Me;
|
|
3499
3499
|
try {
|
|
3500
|
-
|
|
3500
|
+
Me = !0, je.storagemutated.fire(e), Kn(e, !0);
|
|
3501
3501
|
} finally {
|
|
3502
|
-
|
|
3502
|
+
Me = n;
|
|
3503
3503
|
}
|
|
3504
3504
|
}
|
|
3505
|
-
re(
|
|
3506
|
-
return new
|
|
3505
|
+
re(Ze, c(c({}, kt), { delete: function(e) {
|
|
3506
|
+
return new Ze(e, { addons: [] }).delete();
|
|
3507
3507
|
}, exists: function(e) {
|
|
3508
|
-
return new
|
|
3508
|
+
return new Ze(e, { addons: [] }).open().then(function(n) {
|
|
3509
3509
|
return n.close(), !0;
|
|
3510
3510
|
}).catch("NoSuchDatabaseError", function() {
|
|
3511
3511
|
return !1;
|
|
3512
3512
|
});
|
|
3513
3513
|
}, getDatabaseNames: function(e) {
|
|
3514
3514
|
try {
|
|
3515
|
-
return n =
|
|
3515
|
+
return n = Ze.dependencies, r = n.indexedDB, n = n.IDBKeyRange, (Cn(r) ? Promise.resolve(r.databases()).then(function(a) {
|
|
3516
3516
|
return a.map(function(i) {
|
|
3517
3517
|
return i.name;
|
|
3518
3518
|
}).filter(function(i) {
|
|
3519
|
-
return i !==
|
|
3519
|
+
return i !== Kt;
|
|
3520
3520
|
});
|
|
3521
|
-
}) :
|
|
3521
|
+
}) : Nn(r, n).toCollection().primaryKeys()).then(e);
|
|
3522
3522
|
} catch {
|
|
3523
|
-
return
|
|
3523
|
+
return se(new K.MissingAPI());
|
|
3524
3524
|
}
|
|
3525
3525
|
var n, r;
|
|
3526
3526
|
}, defineClass: function() {
|
|
@@ -3528,78 +3528,78 @@ function Ga() {
|
|
|
3528
3528
|
ne(this, e);
|
|
3529
3529
|
};
|
|
3530
3530
|
}, ignoreTransaction: function(e) {
|
|
3531
|
-
return G.trans ?
|
|
3532
|
-
}, vip:
|
|
3531
|
+
return G.trans ? Ye(G.transless, e) : e();
|
|
3532
|
+
}, vip: $n, async: function(e) {
|
|
3533
3533
|
return function() {
|
|
3534
3534
|
try {
|
|
3535
|
-
var n =
|
|
3535
|
+
var n = Ln(e.apply(this, arguments));
|
|
3536
3536
|
return n && typeof n.then == "function" ? n : M.resolve(n);
|
|
3537
3537
|
} catch (r) {
|
|
3538
|
-
return
|
|
3538
|
+
return se(r);
|
|
3539
3539
|
}
|
|
3540
3540
|
};
|
|
3541
3541
|
}, spawn: function(e, n, r) {
|
|
3542
3542
|
try {
|
|
3543
|
-
var a =
|
|
3543
|
+
var a = Ln(e.apply(r, n || []));
|
|
3544
3544
|
return a && typeof a.then == "function" ? a : M.resolve(a);
|
|
3545
3545
|
} catch (i) {
|
|
3546
|
-
return
|
|
3546
|
+
return se(i);
|
|
3547
3547
|
}
|
|
3548
3548
|
}, currentTransaction: { get: function() {
|
|
3549
3549
|
return G.trans || null;
|
|
3550
3550
|
} }, waitFor: function(e, n) {
|
|
3551
|
-
return n = M.resolve(typeof e == "function" ?
|
|
3551
|
+
return n = M.resolve(typeof e == "function" ? Ze.ignoreTransaction(e) : e).timeout(n || 6e4), G.trans ? G.trans.waitFor(n) : n;
|
|
3552
3552
|
}, Promise: M, debug: { get: function() {
|
|
3553
|
-
return
|
|
3553
|
+
return Ee;
|
|
3554
3554
|
}, set: function(e) {
|
|
3555
|
-
|
|
3556
|
-
} }, derive:
|
|
3557
|
-
typeof n == "string" ?
|
|
3558
|
-
|
|
3555
|
+
nr(e);
|
|
3556
|
+
} }, derive: _e, extend: ne, props: re, override: ut, Events: mt, on: je, liveQuery: Nr, extendObservabilitySet: Vt, getByKeyPath: ve, setByKeyPath: he, delByKeyPath: function(e, n) {
|
|
3557
|
+
typeof n == "string" ? he(e, n, void 0) : "length" in n && [].map.call(n, function(r) {
|
|
3558
|
+
he(e, r, void 0);
|
|
3559
3559
|
});
|
|
3560
|
-
}, shallowClone:
|
|
3560
|
+
}, shallowClone: xt, deepClone: Ke, getObjectDiff: Fn, cmp: X, asap: Rt, minKey: -1 / 0, addons: [], connections: st, errnames: dn, dependencies: nn, cache: Je, semVer: "4.0.11", version: "4.0.11".split(".").map(function(e) {
|
|
3561
3561
|
return parseInt(e);
|
|
3562
3562
|
}).reduce(function(e, n, r) {
|
|
3563
3563
|
return e + n / Math.pow(10, 2 * r);
|
|
3564
|
-
}) })),
|
|
3565
|
-
|
|
3566
|
-
}), addEventListener(
|
|
3567
|
-
e = e.detail,
|
|
3564
|
+
}) })), Ze.maxKey = Et(Ze.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (je(wt, function(e) {
|
|
3565
|
+
Me || (e = new CustomEvent(Pn, { detail: e }), Me = !0, dispatchEvent(e), Me = !1);
|
|
3566
|
+
}), addEventListener(Pn, function(e) {
|
|
3567
|
+
e = e.detail, Me || Hn(e);
|
|
3568
3568
|
}));
|
|
3569
|
-
var
|
|
3569
|
+
var ct, Me = !1, Cr = function() {
|
|
3570
3570
|
};
|
|
3571
|
-
return typeof BroadcastChannel < "u" && ((
|
|
3572
|
-
(
|
|
3573
|
-
return e.data &&
|
|
3571
|
+
return typeof BroadcastChannel < "u" && ((Cr = function() {
|
|
3572
|
+
(ct = new BroadcastChannel(Pn)).onmessage = function(e) {
|
|
3573
|
+
return e.data && Hn(e.data);
|
|
3574
3574
|
};
|
|
3575
|
-
})(), typeof
|
|
3576
|
-
|
|
3575
|
+
})(), typeof ct.unref == "function" && ct.unref(), je(wt, function(e) {
|
|
3576
|
+
Me || ct.postMessage(e);
|
|
3577
3577
|
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
3578
|
-
if (!
|
|
3579
|
-
|
|
3580
|
-
for (var n = 0, r =
|
|
3578
|
+
if (!De.disableBfCache && e.persisted) {
|
|
3579
|
+
Ee && console.debug("Dexie: handling persisted pagehide"), ct != null && ct.close();
|
|
3580
|
+
for (var n = 0, r = st; n < r.length; n++) r[n].close({ disableAutoOpen: !1 });
|
|
3581
3581
|
}
|
|
3582
3582
|
}), addEventListener("pageshow", function(e) {
|
|
3583
|
-
!
|
|
3583
|
+
!De.disableBfCache && e.persisted && (Ee && console.debug("Dexie: handling persisted pageshow"), Cr(), Hn({ all: new le(-1 / 0, [[]]) }));
|
|
3584
3584
|
})), M.rejectionMapper = function(e, n) {
|
|
3585
|
-
return !e || e instanceof
|
|
3585
|
+
return !e || e instanceof et || e instanceof TypeError || e instanceof SyntaxError || !e.name || !tr[e.name] ? e : (n = new tr[e.name](n || e.message, e), "stack" in e && ae(n, "stack", { get: function() {
|
|
3586
3586
|
return this.inner.stack;
|
|
3587
3587
|
} }), n);
|
|
3588
|
-
},
|
|
3589
|
-
return new
|
|
3588
|
+
}, nr(Ee), c(De, Object.freeze({ __proto__: null, Dexie: De, liveQuery: Nr, Entity: lr, cmp: X, PropModification: yt, replacePrefix: function(e, n) {
|
|
3589
|
+
return new yt({ replacePrefix: [e, n] });
|
|
3590
3590
|
}, add: function(e) {
|
|
3591
|
-
return new
|
|
3591
|
+
return new yt({ add: e });
|
|
3592
3592
|
}, remove: function(e) {
|
|
3593
|
-
return new
|
|
3594
|
-
}, default:
|
|
3593
|
+
return new yt({ remove: e });
|
|
3594
|
+
}, default: De, RangeSet: le, mergeRanges: _t, rangesOverlap: Or }), { default: De }), De;
|
|
3595
3595
|
});
|
|
3596
|
-
}(
|
|
3596
|
+
}(sn)), sn.exports;
|
|
3597
3597
|
}
|
|
3598
3598
|
var Ka = Ga();
|
|
3599
|
-
const
|
|
3600
|
-
if (
|
|
3601
|
-
throw new Error(`Two different versions of Dexie loaded in the same app: ${
|
|
3602
|
-
class
|
|
3599
|
+
const Jn = /* @__PURE__ */ Ma(Ka), jr = Symbol.for("Dexie"), on = globalThis[jr] || (globalThis[jr] = Jn);
|
|
3600
|
+
if (Jn.semVer !== on.semVer)
|
|
3601
|
+
throw new Error(`Two different versions of Dexie loaded in the same app: ${Jn.semVer} and ${on.semVer}`);
|
|
3602
|
+
class Br {
|
|
3603
3603
|
constructor(t) {
|
|
3604
3604
|
b(this, "db");
|
|
3605
3605
|
b(this, "subscribers", []);
|
|
@@ -3653,8 +3653,8 @@ class jr {
|
|
|
3653
3653
|
} : (s.message = `Dashboard ${t.id} retrieved from storage`, s.success = !0, s);
|
|
3654
3654
|
});
|
|
3655
3655
|
b(this, "getDashboards", async (t) => {
|
|
3656
|
-
const s = (
|
|
3657
|
-
let v = await this.db.table(_.DASHBOARD).toArray().then((
|
|
3656
|
+
const s = (A) => (t == null ? void 0 : t.id) === A.id, c = (A) => t != null && t.name ? A.name.includes(t == null ? void 0 : t.name) : !1;
|
|
3657
|
+
let v = await this.db.table(_.DASHBOARD).toArray().then((A) => t != null && t.id ? A.filter(s) : A).then((A) => t != null && t.name ? A.filter(c) : A).catch(() => {
|
|
3658
3658
|
L(2, ["%cstorage", l.STORAGE, q.DASHBOARD_LOAD, t]);
|
|
3659
3659
|
});
|
|
3660
3660
|
return v !== void 0 && L(3, [
|
|
@@ -3702,19 +3702,19 @@ class jr {
|
|
|
3702
3702
|
* Wipe Message data after expires timestamp
|
|
3703
3703
|
*/
|
|
3704
3704
|
b(this, "cleanMessages", async () => {
|
|
3705
|
-
const t = Date.now() / 1e3, s = (
|
|
3706
|
-
return await this.db.table(_.TOPICS).orderBy("expires").filter(s).delete().catch((
|
|
3705
|
+
const t = Date.now() / 1e3, s = (A) => A.expires < t, c = (A) => A.expires < t;
|
|
3706
|
+
return await this.db.table(_.TOPICS).orderBy("expires").filter(s).delete().catch((A) => (console.error(
|
|
3707
3707
|
"%cstorage%c %cclean",
|
|
3708
3708
|
l.STORAGE,
|
|
3709
3709
|
l.NONE,
|
|
3710
3710
|
l.MESSAGES,
|
|
3711
|
-
|
|
3712
|
-
), 0)), await this.db.table(_.MESSAGES).orderBy("expires").filter(c).delete().catch((
|
|
3711
|
+
A.message
|
|
3712
|
+
), 0)), await this.db.table(_.MESSAGES).orderBy("expires").filter(c).delete().catch((A) => (console.error(
|
|
3713
3713
|
"%cstorage%c %clean",
|
|
3714
3714
|
l.STORAGE,
|
|
3715
3715
|
l.NONE,
|
|
3716
3716
|
l.MESSAGES,
|
|
3717
|
-
|
|
3717
|
+
A.message
|
|
3718
3718
|
), 0));
|
|
3719
3719
|
});
|
|
3720
3720
|
/**
|
|
@@ -3725,21 +3725,21 @@ class jr {
|
|
|
3725
3725
|
b(this, "getMessages", async (t) => {
|
|
3726
3726
|
const s = (t == null ? void 0 : t.order) ?? "utc";
|
|
3727
3727
|
s !== "utc" && (t.since = Math.floor(Date.now() / 1e3) - 60 * 60 * 24 * 7), this.options.delay != 0 ? t.before = Math.floor(Date.now() / 1e3) - (this.options.delay || 0) : t.before = Math.floor(Date.now() / 1e3);
|
|
3728
|
-
const c = (I) => I.utc > ((t == null ? void 0 : t.since) || 0), v = (I) => I.utc < ((t == null ? void 0 : t.before) || Date.now() / 1e3),
|
|
3728
|
+
const c = (I) => I.utc > ((t == null ? void 0 : t.since) || 0), v = (I) => I.utc < ((t == null ? void 0 : t.before) || Date.now() / 1e3), A = (I) => (I == null ? void 0 : I.visible) !== 0;
|
|
3729
3729
|
try {
|
|
3730
|
-
const
|
|
3731
|
-
if (
|
|
3730
|
+
const Y = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(A).filter(c).filter(v).reverse().limit((t == null ? void 0 : t.limit) ?? 25).sortBy(s);
|
|
3731
|
+
if (Y.length === 0)
|
|
3732
3732
|
return {
|
|
3733
3733
|
data: null,
|
|
3734
3734
|
message: "No Messages error",
|
|
3735
3735
|
success: !1,
|
|
3736
3736
|
query: t
|
|
3737
3737
|
};
|
|
3738
|
-
let ne =
|
|
3739
|
-
return
|
|
3738
|
+
let ne = Y.map((ue) => this.db.table(_.MESSAGES).get({ id: ue.message_id }));
|
|
3739
|
+
return on.Promise.all(ne).then(async (ue) => {
|
|
3740
3740
|
const Q = {
|
|
3741
3741
|
data: {
|
|
3742
|
-
messages:
|
|
3742
|
+
messages: ue.map((re) => re.data)
|
|
3743
3743
|
},
|
|
3744
3744
|
query: t,
|
|
3745
3745
|
message: "Messages retrieved successfully",
|
|
@@ -3785,60 +3785,62 @@ class jr {
|
|
|
3785
3785
|
return 400;
|
|
3786
3786
|
const c = s.data.title;
|
|
3787
3787
|
let v = 0;
|
|
3788
|
-
return await s.data.messages.forEach(async (
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3788
|
+
return await s.data.messages.forEach(async (A) => {
|
|
3789
|
+
var I, Y, ne, ue, U, Q, re, Ie, ae, _e, Pt, Dt, Ge, ut;
|
|
3790
|
+
A.id !== null && (A.topics[0] = {
|
|
3791
|
+
message_id: A.id,
|
|
3792
|
+
engagement: ((I = A.topics[0]) == null ? void 0 : I.engagement) || ((Y = A.dynamics) == null ? void 0 : Y.engagement) || 0,
|
|
3793
|
+
impressions: ((ne = A.topics[0]) == null ? void 0 : ne.impressions) || ((ue = A.dynamics) == null ? void 0 : ue.semrush_visits) || 0,
|
|
3794
|
+
reach: ((U = A.topics[0]) == null ? void 0 : U.reach) || ((Q = A.dynamics) == null ? void 0 : Q.potential_reach) || 0,
|
|
3795
|
+
sentiment: ((re = A.topics[0]) == null ? void 0 : re.sentiment) || 0
|
|
3796
|
+
}, await this.db.table(_.MESSAGES).put({
|
|
3797
|
+
id: A.id,
|
|
3798
|
+
utc: A.utc,
|
|
3799
|
+
data: A,
|
|
3800
|
+
expires: A.expires
|
|
3801
|
+
}).catch((ge) => {
|
|
3795
3802
|
v++, console.error(
|
|
3796
3803
|
"%cstorage",
|
|
3797
3804
|
l.STORAGE,
|
|
3798
3805
|
"set message",
|
|
3799
3806
|
`title: ${c}`,
|
|
3800
|
-
|
|
3801
|
-
|
|
3807
|
+
A,
|
|
3808
|
+
ge.message
|
|
3809
|
+
);
|
|
3810
|
+
}), await this.db.table(_.TOPICS).put({
|
|
3811
|
+
title: c,
|
|
3812
|
+
widget_id: t.widget,
|
|
3813
|
+
message_id: A.id,
|
|
3814
|
+
dashboard_id: t.dashboard,
|
|
3815
|
+
engagement: ((Ie = A.topics[0]) == null ? void 0 : Ie.engagement) || ((ae = A.dynamics) == null ? void 0 : ae.engagement) || 0,
|
|
3816
|
+
impressions: ((_e = A.topics[0]) == null ? void 0 : _e.impressions) || ((Pt = A.dynamics) == null ? void 0 : Pt.semrush_visits) || 0,
|
|
3817
|
+
reach: ((Dt = A.topics[0]) == null ? void 0 : Dt.reach) || ((Ge = A.dynamics) == null ? void 0 : Ge.potential_reach) || 0,
|
|
3818
|
+
sentiment: ((ut = A.topics[0]) == null ? void 0 : ut.sentiment) || 0,
|
|
3819
|
+
utc: A.utc,
|
|
3820
|
+
expires: A.expires
|
|
3821
|
+
}).catch((ge) => {
|
|
3822
|
+
v++, console.error(
|
|
3823
|
+
"%cstorage",
|
|
3824
|
+
l.STORAGE,
|
|
3825
|
+
"set topic",
|
|
3826
|
+
`title: ${c}`,
|
|
3827
|
+
A,
|
|
3828
|
+
ge.message
|
|
3802
3829
|
);
|
|
3803
|
-
}).
|
|
3804
|
-
|
|
3805
|
-
await this.db.table(_.TOPICS).
|
|
3806
|
-
title: c,
|
|
3807
|
-
widget_id: t.widget,
|
|
3808
|
-
message_id: P.id,
|
|
3809
|
-
dashboard_id: t.dashboard,
|
|
3810
|
-
engagement: ((I = P.topics[0]) == null ? void 0 : I.engagement) || ((z = P.dynamics) == null ? void 0 : z.engagement) || 0,
|
|
3811
|
-
impressions: ((ne = P.topics[0]) == null ? void 0 : ne.impressions) || ((ie = P.dynamics) == null ? void 0 : ie.semrush_visits) || 0,
|
|
3812
|
-
reach: ((U = P.topics[0]) == null ? void 0 : U.reach) || ((Q = P.dynamics) == null ? void 0 : Q.potential_reach) || 0,
|
|
3813
|
-
sentiment: ((re = P.topics[0]) == null ? void 0 : re.sentiment) || 0,
|
|
3814
|
-
utc: P.utc,
|
|
3815
|
-
expires: P.expires
|
|
3816
|
-
}).catch((je) => {
|
|
3830
|
+
}), await s.data.topics.forEach(async (ge) => {
|
|
3831
|
+
const Rt = ge.message_id, ve = ge.visible ? 1 : 0, he = ge.title;
|
|
3832
|
+
await this.db.table(_.TOPICS).where("message_id").equals(Rt).modify({ visible: ve }).catch((xt) => {
|
|
3817
3833
|
v++, console.error(
|
|
3818
3834
|
"%cstorage",
|
|
3819
3835
|
l.STORAGE,
|
|
3820
|
-
"
|
|
3821
|
-
`title: ${
|
|
3822
|
-
|
|
3823
|
-
|
|
3836
|
+
"update message visibility",
|
|
3837
|
+
`title: ${he}`,
|
|
3838
|
+
`widget: ${ge.widget_id}`,
|
|
3839
|
+
xt.message
|
|
3824
3840
|
);
|
|
3825
3841
|
});
|
|
3826
|
-
})
|
|
3827
|
-
|
|
3828
|
-
const z = I.message_id, ne = I.visible ? 1 : 0, ie = I.title;
|
|
3829
|
-
await this.db.table(_.TOPICS).where("message_id").equals(z).modify({ visible: ne }).catch((U) => {
|
|
3830
|
-
v++, console.error(
|
|
3831
|
-
"%cstorage",
|
|
3832
|
-
l.STORAGE,
|
|
3833
|
-
"update message visibility",
|
|
3834
|
-
`title: ${ie}`,
|
|
3835
|
-
`widget: ${I.widget_id}`,
|
|
3836
|
-
U.message
|
|
3837
|
-
);
|
|
3838
|
-
});
|
|
3839
|
-
});
|
|
3840
|
-
}).then(() => v === 0 ? 201 : 400);
|
|
3841
|
-
});
|
|
3842
|
+
}));
|
|
3843
|
+
}), v === 0 ? 201 : 400;
|
|
3842
3844
|
});
|
|
3843
3845
|
/**
|
|
3844
3846
|
* Retrieve Series Data
|
|
@@ -3896,10 +3898,10 @@ class jr {
|
|
|
3896
3898
|
*/
|
|
3897
3899
|
b(this, "getWidgets", async (t) => {
|
|
3898
3900
|
const s = (I) => (t == null ? void 0 : t.dashboard) === I.dashboard_id, c = (I) => (t == null ? void 0 : t.type) === I.type, v = (I) => t != null && t.name ? I.name.includes(t == null ? void 0 : t.name) : !1;
|
|
3899
|
-
let
|
|
3901
|
+
let A = await this.db.table(_.WIDGET).toArray().then((I) => t != null && t.dashboard ? I.filter(s) : I).then((I) => t != null && t.type ? I.filter(c) : I).then((I) => t != null && t.name ? I.filter(v) : I).catch(() => {
|
|
3900
3902
|
L(2, ["%cstorage", l.STORAGE, q.WIDGET_LOAD, t]);
|
|
3901
3903
|
});
|
|
3902
|
-
return
|
|
3904
|
+
return A !== void 0 && L(3, [
|
|
3903
3905
|
"%cstorage%c %cwidgets",
|
|
3904
3906
|
l.STORAGE,
|
|
3905
3907
|
l.NONE,
|
|
@@ -3907,9 +3909,9 @@ class jr {
|
|
|
3907
3909
|
t
|
|
3908
3910
|
]), {
|
|
3909
3911
|
// @ts-ignore
|
|
3910
|
-
data:
|
|
3911
|
-
message:
|
|
3912
|
-
success:
|
|
3912
|
+
data: A !== void 0 ? { data: A, query: t } : null,
|
|
3913
|
+
message: A !== void 0 ? "Widgets loaded from storage" : "Widgets load error",
|
|
3914
|
+
success: A !== void 0
|
|
3913
3915
|
};
|
|
3914
3916
|
});
|
|
3915
3917
|
/**
|
|
@@ -3945,7 +3947,7 @@ class jr {
|
|
|
3945
3947
|
*/
|
|
3946
3948
|
b(this, "subscribe", (t) => (t = Ca(t), this.subscribers.filter(
|
|
3947
3949
|
(c) => c.widget === t.widget
|
|
3948
|
-
).length > 0 || (t.type === _.MESSAGES && (t =
|
|
3950
|
+
).length > 0 || (t.type === _.MESSAGES && (t = At(this.options, t)), console.info(
|
|
3949
3951
|
"%cstorage%c %csubscribe",
|
|
3950
3952
|
l.STORAGE,
|
|
3951
3953
|
l.NONE,
|
|
@@ -3986,12 +3988,12 @@ class jr {
|
|
|
3986
3988
|
* @returns IResponse
|
|
3987
3989
|
*/
|
|
3988
3990
|
b(this, "getSlides", async (t) => {
|
|
3989
|
-
const s = (I) => t != null && t.id ? t.id = I.id : !1, c = (I) => t != null && t.name ? I.name.includes(t == null ? void 0 : t.name) : !1,
|
|
3990
|
-
return
|
|
3991
|
+
const s = (I) => t != null && t.id ? t.id = I.id : !1, c = (I) => t != null && t.name ? I.name.includes(t == null ? void 0 : t.name) : !1, A = await this.db.table(_.SLIDE).toArray().then((I) => t != null && t.id ? I.filter(s) : I).then((I) => t != null && t.name ? I.filter(c) : I);
|
|
3992
|
+
return A !== void 0 && L(3, ["%cstorage%c %cslides", l.STORAGE, l.NONE, l.SLIDE, t]), {
|
|
3991
3993
|
// @ts-ignore
|
|
3992
|
-
data:
|
|
3993
|
-
message:
|
|
3994
|
-
success:
|
|
3994
|
+
data: A !== void 0 ? { slides: A, query: t } : null,
|
|
3995
|
+
message: A !== void 0 ? "Slides loaded from storage" : "Slides load error",
|
|
3996
|
+
success: A !== void 0
|
|
3995
3997
|
};
|
|
3996
3998
|
});
|
|
3997
3999
|
/**
|
|
@@ -4048,7 +4050,7 @@ class jr {
|
|
|
4048
4050
|
* @returns IResponse
|
|
4049
4051
|
*/
|
|
4050
4052
|
b(this, "getPresentations", async (t) => {
|
|
4051
|
-
const s = (
|
|
4053
|
+
const s = (A) => t != null && t.name ? A.name.includes(t == null ? void 0 : t.name) : !1, v = await this.db.table(_.PRESENTATION).toArray().then((A) => t != null && t.name ? A.filter(s) : A);
|
|
4052
4054
|
return v !== void 0 && L(3, [
|
|
4053
4055
|
"%cstorage%c %cpresentations",
|
|
4054
4056
|
l.STORAGE,
|
|
@@ -4114,7 +4116,7 @@ class jr {
|
|
|
4114
4116
|
* @returns IResponse
|
|
4115
4117
|
*/
|
|
4116
4118
|
b(this, "getPreferences", async (t) => {
|
|
4117
|
-
const s = (
|
|
4119
|
+
const s = (A) => t != null && t.id ? t.id = A.id : !1, v = await this.db.table(_.SLIDE).toArray().then((A) => t != null && t.id ? A.filter(s) : A);
|
|
4118
4120
|
return v !== void 0 && L(3, [
|
|
4119
4121
|
"%cstorage%c %cpreferences",
|
|
4120
4122
|
l.STORAGE,
|
|
@@ -4151,7 +4153,7 @@ class jr {
|
|
|
4151
4153
|
message: `Preference ${t.id} save error: ${s.message}`,
|
|
4152
4154
|
success: !1
|
|
4153
4155
|
})));
|
|
4154
|
-
this.options = t, this.db = new
|
|
4156
|
+
this.options = t, this.db = new on(t.app), this.db.version(11).stores({
|
|
4155
4157
|
channel: "id,slide_index",
|
|
4156
4158
|
cloud: "id,dashboard_id",
|
|
4157
4159
|
dashboard: "id,name,update",
|
|
@@ -4168,7 +4170,7 @@ class jr {
|
|
|
4168
4170
|
}), this.db.open();
|
|
4169
4171
|
}
|
|
4170
4172
|
}
|
|
4171
|
-
function
|
|
4173
|
+
function Zn(d) {
|
|
4172
4174
|
return new Promise((t, s) => {
|
|
4173
4175
|
d.oncomplete = d.onsuccess = () => t(d.result), d.onabort = d.onerror = () => s(d.error);
|
|
4174
4176
|
});
|
|
@@ -4176,34 +4178,34 @@ function Hn(d) {
|
|
|
4176
4178
|
function La(d, t) {
|
|
4177
4179
|
const s = indexedDB.open(d);
|
|
4178
4180
|
s.onupgradeneeded = () => s.result.createObjectStore(t);
|
|
4179
|
-
const c =
|
|
4180
|
-
return (v,
|
|
4181
|
+
const c = Zn(s);
|
|
4182
|
+
return (v, A) => c.then((I) => A(I.transaction(t, v).objectStore(t)));
|
|
4181
4183
|
}
|
|
4182
|
-
let
|
|
4183
|
-
function
|
|
4184
|
-
return
|
|
4184
|
+
let Xn;
|
|
4185
|
+
function Gr() {
|
|
4186
|
+
return Xn || (Xn = La("keyval-store", "keyval")), Xn;
|
|
4185
4187
|
}
|
|
4186
|
-
function
|
|
4187
|
-
return t("readonly", (s) =>
|
|
4188
|
+
function xe(d, t = Gr()) {
|
|
4189
|
+
return t("readonly", (s) => Zn(s.get(d)));
|
|
4188
4190
|
}
|
|
4189
|
-
function
|
|
4190
|
-
return s("readwrite", (c) => (c.put(t, d),
|
|
4191
|
+
function Be(d, t, s = Gr()) {
|
|
4192
|
+
return s("readwrite", (c) => (c.put(t, d), Zn(c.transaction)));
|
|
4191
4193
|
}
|
|
4192
|
-
class
|
|
4194
|
+
class Kr {
|
|
4193
4195
|
constructor(t) {
|
|
4194
4196
|
b(this, "subscribers", []);
|
|
4195
4197
|
b(this, "options");
|
|
4196
4198
|
b(this, "getCloud", async (t) => {
|
|
4197
4199
|
const s = Z(t);
|
|
4198
|
-
return await
|
|
4200
|
+
return await xe(s).then((c) => c).catch(() => (console.warn("%capi", l.API, _.CLOUD, t.slide, t.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
4199
4201
|
});
|
|
4200
4202
|
b(this, "getSeries", async (t) => {
|
|
4201
4203
|
const s = Z(t);
|
|
4202
|
-
return await
|
|
4204
|
+
return await xe(s).then((c) => c).catch(() => (console.warn("%capi", l.API, _.SERIES, t.slide, t.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
4203
4205
|
});
|
|
4204
4206
|
b(this, "getMessages", async (t) => {
|
|
4205
4207
|
const s = Z(t);
|
|
4206
|
-
return await
|
|
4208
|
+
return await xe(s).then((c) => c).catch(() => (console.warn("%capi", l.API, _.MESSAGES, t.slide, t.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
4207
4209
|
});
|
|
4208
4210
|
/**
|
|
4209
4211
|
* Update Cloud
|
|
@@ -4215,7 +4217,7 @@ class Br {
|
|
|
4215
4217
|
if (!s.success)
|
|
4216
4218
|
return 400;
|
|
4217
4219
|
const c = Z(t);
|
|
4218
|
-
return delete s.success, delete s.message, await
|
|
4220
|
+
return delete s.success, delete s.message, await Be(c, s).then(() => 201).catch((v) => (console.error(
|
|
4219
4221
|
"%cstorage",
|
|
4220
4222
|
l.STORAGE,
|
|
4221
4223
|
_.CLOUD,
|
|
@@ -4233,7 +4235,7 @@ class Br {
|
|
|
4233
4235
|
if (!s.success)
|
|
4234
4236
|
return 400;
|
|
4235
4237
|
const c = Z(t);
|
|
4236
|
-
return delete s.success, delete s.message, await
|
|
4238
|
+
return delete s.success, delete s.message, await Be(c, s).then(() => 201).catch((v) => (console.error(
|
|
4237
4239
|
"%cstorage",
|
|
4238
4240
|
l.STORAGE,
|
|
4239
4241
|
_.SERIES,
|
|
@@ -4251,7 +4253,7 @@ class Br {
|
|
|
4251
4253
|
if (!s.success)
|
|
4252
4254
|
return 400;
|
|
4253
4255
|
const c = Z(t);
|
|
4254
|
-
return delete s.success, delete s.message, await
|
|
4256
|
+
return delete s.success, delete s.message, await Be(c, s).then(() => 201).catch((v) => (console.error(
|
|
4255
4257
|
"%cstorage",
|
|
4256
4258
|
l.STORAGE,
|
|
4257
4259
|
_.MESSAGES,
|
|
@@ -4267,7 +4269,7 @@ class Br {
|
|
|
4267
4269
|
});
|
|
4268
4270
|
b(this, "getDashboard", async (t) => {
|
|
4269
4271
|
const s = Z(t);
|
|
4270
|
-
return await
|
|
4272
|
+
return await xe(s).then((c) => c).catch((c) => (console.warn("%capi", l.API, _.SLIDE, t.id), {
|
|
4271
4273
|
data: null,
|
|
4272
4274
|
message: `Widget ${t.data.id} load error: ${c.message}`,
|
|
4273
4275
|
success: !1
|
|
@@ -4288,7 +4290,7 @@ class Br {
|
|
|
4288
4290
|
id: t.dashboard,
|
|
4289
4291
|
name: t.name
|
|
4290
4292
|
};
|
|
4291
|
-
return await
|
|
4293
|
+
return await Be(s, c).then(() => ({
|
|
4292
4294
|
data: null,
|
|
4293
4295
|
message: `Dashboard ${t.data.id} saved to storage`,
|
|
4294
4296
|
success: !0
|
|
@@ -4306,7 +4308,7 @@ class Br {
|
|
|
4306
4308
|
});
|
|
4307
4309
|
b(this, "getWidget", async (t) => {
|
|
4308
4310
|
const s = Z(t);
|
|
4309
|
-
return await
|
|
4311
|
+
return await xe(s).then((c) => c).catch((c) => (console.warn("%capi", l.API, _.SLIDE, t.id), {
|
|
4310
4312
|
data: null,
|
|
4311
4313
|
message: `Widget ${t.data.id} load error: ${c.message}`,
|
|
4312
4314
|
success: !1
|
|
@@ -4329,7 +4331,7 @@ class Br {
|
|
|
4329
4331
|
dashboard_id: t.dashboard,
|
|
4330
4332
|
type: t.type
|
|
4331
4333
|
};
|
|
4332
|
-
return await
|
|
4334
|
+
return await Be(s, c).then(() => ({
|
|
4333
4335
|
data: null,
|
|
4334
4336
|
message: `Widget ${t.data.id} saved to storage`,
|
|
4335
4337
|
success: !0
|
|
@@ -4350,7 +4352,7 @@ class Br {
|
|
|
4350
4352
|
* @param query IQuery
|
|
4351
4353
|
* @returns null
|
|
4352
4354
|
*/
|
|
4353
|
-
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t =
|
|
4355
|
+
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t = At(this.options, t)), this.subscribers.filter(
|
|
4354
4356
|
(c) => c.widget === t.widget
|
|
4355
4357
|
).length > 0 || (console.debug(
|
|
4356
4358
|
"%cstorage%c %csubscribe",
|
|
@@ -4367,7 +4369,7 @@ class Br {
|
|
|
4367
4369
|
b(this, "getSubscribers", async () => await new Promise((t) => t(this.subscribers)));
|
|
4368
4370
|
b(this, "getSlide", async (t) => {
|
|
4369
4371
|
const s = Z(t);
|
|
4370
|
-
return await
|
|
4372
|
+
return await xe(s).then((c) => c).catch((c) => (console.warn("%capi", l.API, _.SLIDE, t.id), {
|
|
4371
4373
|
data: null,
|
|
4372
4374
|
message: `Slide ${t.data.id} load error: ${c.message}`,
|
|
4373
4375
|
success: !1
|
|
@@ -4390,7 +4392,7 @@ class Br {
|
|
|
4390
4392
|
json: t.data.json || {},
|
|
4391
4393
|
html: t.data.html || ""
|
|
4392
4394
|
};
|
|
4393
|
-
return await
|
|
4395
|
+
return await Be(s, c).then(() => ({
|
|
4394
4396
|
data: null,
|
|
4395
4397
|
message: `Slide ${t.data.id} saved to storage`,
|
|
4396
4398
|
success: !0
|
|
@@ -4408,7 +4410,7 @@ class Br {
|
|
|
4408
4410
|
});
|
|
4409
4411
|
b(this, "getPresentation", async (t) => {
|
|
4410
4412
|
const s = Z(t);
|
|
4411
|
-
return await
|
|
4413
|
+
return await xe(s).then((c) => c).catch((c) => (console.warn("%capi", l.API, _.PRESENTATION, t.id), {
|
|
4412
4414
|
data: null,
|
|
4413
4415
|
message: `Slide ${t.data.id} load error: ${c.message}`,
|
|
4414
4416
|
success: !1
|
|
@@ -4426,7 +4428,7 @@ class Br {
|
|
|
4426
4428
|
*/
|
|
4427
4429
|
b(this, "setPresentation", async (t) => {
|
|
4428
4430
|
const s = Z(t), c = t.data;
|
|
4429
|
-
return await
|
|
4431
|
+
return await Be(s, c).then(() => ({
|
|
4430
4432
|
data: null,
|
|
4431
4433
|
message: `Presentation ${t.data.id} saved to storage`,
|
|
4432
4434
|
success: !0
|
|
@@ -4442,12 +4444,12 @@ class Br {
|
|
|
4442
4444
|
success: !1
|
|
4443
4445
|
}));
|
|
4444
4446
|
});
|
|
4445
|
-
b(this, "getPreference", async (t) => await
|
|
4447
|
+
b(this, "getPreference", async (t) => await xe(`${_.PREFERENCE}.${t.id}`).then((s) => s).catch((s) => (console.warn("%capi", l.API, _.PREFERENCE, t.id), {
|
|
4446
4448
|
data: null,
|
|
4447
4449
|
message: `Preference ${t.id} get error: ${s.message}`,
|
|
4448
4450
|
success: !1
|
|
4449
4451
|
})));
|
|
4450
|
-
b(this, "getPreferences", async () => await
|
|
4452
|
+
b(this, "getPreferences", async () => await xe(`${_.PREFERENCE}`).then((t) => t).catch((t) => (console.warn("%capi", l.API, _.PREFERENCE), {
|
|
4451
4453
|
data: null,
|
|
4452
4454
|
message: `Preferences get error: ${t.message}`,
|
|
4453
4455
|
success: !1
|
|
@@ -4457,7 +4459,7 @@ class Br {
|
|
|
4457
4459
|
* @param preference IPreference
|
|
4458
4460
|
* @returns number
|
|
4459
4461
|
*/
|
|
4460
|
-
b(this, "setPreference", async (t) => await
|
|
4462
|
+
b(this, "setPreference", async (t) => await Be(`${_.PREFERENCE}.${t.id}`, t.value).then(() => ({
|
|
4461
4463
|
data: null,
|
|
4462
4464
|
message: `Preference ${t.id} save error`,
|
|
4463
4465
|
success: !0
|
|
@@ -4475,7 +4477,7 @@ class Br {
|
|
|
4475
4477
|
this.options = t;
|
|
4476
4478
|
}
|
|
4477
4479
|
}
|
|
4478
|
-
class
|
|
4480
|
+
class Lr {
|
|
4479
4481
|
constructor(t) {
|
|
4480
4482
|
b(this, "subscribers", []);
|
|
4481
4483
|
b(this, "options");
|
|
@@ -4641,7 +4643,7 @@ class Gr {
|
|
|
4641
4643
|
* @param query IQuery
|
|
4642
4644
|
* @returns null
|
|
4643
4645
|
*/
|
|
4644
|
-
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t =
|
|
4646
|
+
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t = At(this.options, t)), this.subscribers.filter(
|
|
4645
4647
|
(c) => c.widget === t.widget
|
|
4646
4648
|
).length || (console.debug(
|
|
4647
4649
|
"%cstorage%c %csubscribe",
|
|
@@ -4789,7 +4791,7 @@ class Gr {
|
|
|
4789
4791
|
};
|
|
4790
4792
|
}
|
|
4791
4793
|
}
|
|
4792
|
-
class
|
|
4794
|
+
class Fr {
|
|
4793
4795
|
constructor(t) {
|
|
4794
4796
|
b(this, "subscribers", []);
|
|
4795
4797
|
b(this, "options");
|
|
@@ -4955,7 +4957,7 @@ class Kr {
|
|
|
4955
4957
|
* @param query IQuery
|
|
4956
4958
|
* @returns null
|
|
4957
4959
|
*/
|
|
4958
|
-
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t =
|
|
4960
|
+
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t = At(this.options, t)), this.subscribers.filter(
|
|
4959
4961
|
(c) => c.widget === t.widget
|
|
4960
4962
|
).length || (console.debug(
|
|
4961
4963
|
"%cstorage%c %csubscribe",
|
|
@@ -5108,7 +5110,7 @@ class Kr {
|
|
|
5108
5110
|
};
|
|
5109
5111
|
}
|
|
5110
5112
|
}
|
|
5111
|
-
class
|
|
5113
|
+
class Wr {
|
|
5112
5114
|
constructor(t) {
|
|
5113
5115
|
b(this, "subscribers", []);
|
|
5114
5116
|
b(this, "options");
|
|
@@ -5274,7 +5276,7 @@ class Lr {
|
|
|
5274
5276
|
* @param query IQuery
|
|
5275
5277
|
* @returns null
|
|
5276
5278
|
*/
|
|
5277
|
-
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t =
|
|
5279
|
+
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t = At(this.options, t)), this.subscribers.filter(
|
|
5278
5280
|
(c) => c.widget === t.widget
|
|
5279
5281
|
).length || (console.debug(
|
|
5280
5282
|
"%cstorage%c %csubscribe",
|
|
@@ -5431,8 +5433,8 @@ class os {
|
|
|
5431
5433
|
s.push(this.api.get(c));
|
|
5432
5434
|
}), await Promise.allSettled(s).then(
|
|
5433
5435
|
(c) => c.forEach(async (v) => {
|
|
5434
|
-
var
|
|
5435
|
-
let
|
|
5436
|
+
var Y, ne, ue;
|
|
5437
|
+
let A, I = 400;
|
|
5436
5438
|
if (v.status === "fulfilled") {
|
|
5437
5439
|
let U = v.value;
|
|
5438
5440
|
if (U.success === !0) {
|
|
@@ -5440,10 +5442,10 @@ class os {
|
|
|
5440
5442
|
let re = "";
|
|
5441
5443
|
switch (U.query.type) {
|
|
5442
5444
|
case _.MESSAGES:
|
|
5443
|
-
let
|
|
5444
|
-
|
|
5445
|
-
(
|
|
5446
|
-
), U.data.messages =
|
|
5445
|
+
let Ie;
|
|
5446
|
+
Ie = U.data.messages.filter(
|
|
5447
|
+
(ae) => ae.id !== null
|
|
5448
|
+
), U.data.messages = Ie, re = Qn(U.data.messages), Q != null && Q.hash && Q.hash === re ? (L(3, [
|
|
5447
5449
|
"%capi%c %cno updates",
|
|
5448
5450
|
l.API,
|
|
5449
5451
|
l.NONE,
|
|
@@ -5457,12 +5459,12 @@ class os {
|
|
|
5457
5459
|
l.NO_UPDATES,
|
|
5458
5460
|
_.MESSAGES,
|
|
5459
5461
|
U
|
|
5460
|
-
]), I = 204) : (
|
|
5461
|
-
setTimeout(() => (
|
|
5462
|
+
]), I = 204) : (A = U, Q.hash = re, I = await ((Y = this.sm) == null ? void 0 : Y.setMessages(U.query, U).then((ae) => {
|
|
5463
|
+
setTimeout(() => (ae = 201, this.broadcastUpdate(ae, U), ae), 500);
|
|
5462
5464
|
})));
|
|
5463
5465
|
break;
|
|
5464
5466
|
case _.CLOUD:
|
|
5465
|
-
re =
|
|
5467
|
+
re = Qn(U.data.cloud), Q != null && Q.hash && Q.hash === re ? (L(3, [
|
|
5466
5468
|
"%capi%c %cno updates",
|
|
5467
5469
|
l.API,
|
|
5468
5470
|
l.NONE,
|
|
@@ -5476,17 +5478,17 @@ class os {
|
|
|
5476
5478
|
l.NO_UPDATES,
|
|
5477
5479
|
_.CLOUD,
|
|
5478
5480
|
U
|
|
5479
|
-
]), I = 204) : (Q.hash = re,
|
|
5481
|
+
]), I = 204) : (Q.hash = re, A = {
|
|
5480
5482
|
data: {
|
|
5481
5483
|
cloud: U.data
|
|
5482
5484
|
},
|
|
5483
5485
|
message: U.message,
|
|
5484
5486
|
success: U.success,
|
|
5485
5487
|
query: U.query
|
|
5486
|
-
}, I = await ((ne = this.sm) == null ? void 0 : ne.setCloud(U.query,
|
|
5488
|
+
}, I = await ((ne = this.sm) == null ? void 0 : ne.setCloud(U.query, A.data).then((ae) => this.broadcastUpdate(ae, U))));
|
|
5487
5489
|
break;
|
|
5488
5490
|
case _.SERIES:
|
|
5489
|
-
re =
|
|
5491
|
+
re = Qn(U.data.series), Q != null && Q.hash && Q.hash === re ? (L(3, [
|
|
5490
5492
|
"%capi%c %cno updates",
|
|
5491
5493
|
l.API,
|
|
5492
5494
|
l.NONE,
|
|
@@ -5500,12 +5502,12 @@ class os {
|
|
|
5500
5502
|
l.NO_UPDATES,
|
|
5501
5503
|
_.SERIES,
|
|
5502
5504
|
U
|
|
5503
|
-
]), I = 204) : (Q.hash = re,
|
|
5505
|
+
]), I = 204) : (Q.hash = re, A = {
|
|
5504
5506
|
data: U.data,
|
|
5505
5507
|
message: U.message,
|
|
5506
5508
|
success: U.success,
|
|
5507
5509
|
query: U.query
|
|
5508
|
-
}, I = await ((
|
|
5510
|
+
}, I = await ((ue = this.sm) == null ? void 0 : ue.setSeries(U.query, U.data).then((ae) => this.broadcastUpdate(ae, U))));
|
|
5509
5511
|
break;
|
|
5510
5512
|
default:
|
|
5511
5513
|
L(4, [
|
|
@@ -5585,7 +5587,7 @@ class os {
|
|
|
5585
5587
|
}
|
|
5586
5588
|
});
|
|
5587
5589
|
b(this, "cleanMessages", async () => {
|
|
5588
|
-
var c, v,
|
|
5590
|
+
var c, v, A;
|
|
5589
5591
|
if ((c = this.options) != null && c.suspended) {
|
|
5590
5592
|
L(2, [
|
|
5591
5593
|
"%cstorage%c %cstorage",
|
|
@@ -5596,7 +5598,7 @@ class os {
|
|
|
5596
5598
|
]);
|
|
5597
5599
|
return;
|
|
5598
5600
|
}
|
|
5599
|
-
const t = ((v = this.options) == null ? void 0 : v.retention) || 86400 * 4, s = await ((
|
|
5601
|
+
const t = ((v = this.options) == null ? void 0 : v.retention) || 86400 * 4, s = await ((A = this.sm) == null ? void 0 : A.cleanMessages(
|
|
5600
5602
|
t
|
|
5601
5603
|
));
|
|
5602
5604
|
L(2, [
|
|
@@ -5710,20 +5712,20 @@ class os {
|
|
|
5710
5712
|
]), this.bc.onmessage = (c) => {
|
|
5711
5713
|
this.actions(c);
|
|
5712
5714
|
}, this.bc.postMessage({ event: q.STORAGE_INIT, data: {} }), this.api = new $a(t), t.storage) {
|
|
5713
|
-
case
|
|
5714
|
-
this.sm = new
|
|
5715
|
+
case we.DEXIE:
|
|
5716
|
+
this.sm = new Br(t);
|
|
5715
5717
|
break;
|
|
5716
|
-
case
|
|
5717
|
-
this.sm = new
|
|
5718
|
+
case we.LOCAL:
|
|
5719
|
+
this.sm = new Fr(t);
|
|
5718
5720
|
break;
|
|
5719
|
-
case
|
|
5720
|
-
this.sm = new
|
|
5721
|
+
case we.SESSION:
|
|
5722
|
+
this.sm = new Lr(t);
|
|
5721
5723
|
break;
|
|
5722
|
-
case
|
|
5723
|
-
this.sm = new
|
|
5724
|
+
case we.KEYVAL:
|
|
5725
|
+
this.sm = new Kr(t);
|
|
5724
5726
|
break;
|
|
5725
|
-
case
|
|
5726
|
-
this.sm = new
|
|
5727
|
+
case we.WINDOW:
|
|
5728
|
+
this.sm = new Wr(t);
|
|
5727
5729
|
break;
|
|
5728
5730
|
}
|
|
5729
5731
|
}
|
|
@@ -5798,20 +5800,20 @@ class Fa {
|
|
|
5798
5800
|
}) : await ((s = this.sm) == null ? void 0 : s.getSeries(t));
|
|
5799
5801
|
});
|
|
5800
5802
|
switch (this.sm = null, t.storage) {
|
|
5801
|
-
case
|
|
5802
|
-
this.sm = new
|
|
5803
|
+
case we.DEXIE:
|
|
5804
|
+
this.sm = new Br(t);
|
|
5803
5805
|
break;
|
|
5804
|
-
case
|
|
5805
|
-
this.sm = new
|
|
5806
|
+
case we.LOCAL:
|
|
5807
|
+
this.sm = new Fr(t);
|
|
5806
5808
|
break;
|
|
5807
|
-
case
|
|
5808
|
-
this.sm = new
|
|
5809
|
+
case we.SESSION:
|
|
5810
|
+
this.sm = new Lr(t);
|
|
5809
5811
|
break;
|
|
5810
|
-
case
|
|
5811
|
-
this.sm = new
|
|
5812
|
+
case we.KEYVAL:
|
|
5813
|
+
this.sm = new Kr(t);
|
|
5812
5814
|
break;
|
|
5813
|
-
case
|
|
5814
|
-
this.sm = new
|
|
5815
|
+
case we.WINDOW:
|
|
5816
|
+
this.sm = new Wr(t);
|
|
5815
5817
|
break;
|
|
5816
5818
|
}
|
|
5817
5819
|
}
|
|
@@ -5822,7 +5824,7 @@ class cs {
|
|
|
5822
5824
|
*
|
|
5823
5825
|
* @param element widget web component
|
|
5824
5826
|
* @param callbacks functions in the widget that will receive the update
|
|
5825
|
-
* @param selector container for the element - by default buzzcasting-
|
|
5827
|
+
* @param selector container for the element - by default buzzcasting-app (optional)
|
|
5826
5828
|
*/
|
|
5827
5829
|
constructor(t, s, c) {
|
|
5828
5830
|
b(this, "storageReader");
|
|
@@ -5952,11 +5954,11 @@ class cs {
|
|
|
5952
5954
|
window.dispatchEvent(s);
|
|
5953
5955
|
});
|
|
5954
5956
|
var I;
|
|
5955
|
-
this.element = t, this.callbacks = s, c = typeof c < "u" ? c : "buzzcasting-
|
|
5957
|
+
this.element = t, this.callbacks = s, c = typeof c < "u" ? c : "buzzcasting-app";
|
|
5956
5958
|
let v;
|
|
5957
|
-
v = { ...t.dataset }, delete v.hmr, v.presentation = ((I = t.closest(c.toUpperCase())) == null ? void 0 : I.
|
|
5958
|
-
const
|
|
5959
|
-
this.storageReader = new Fa(
|
|
5959
|
+
v = { ...t.dataset }, delete v.hmr, v.presentation = ((I = t.closest(c.toUpperCase())) == null ? void 0 : I.presentation) ?? `${c} not found`, this.query = v, xa(t);
|
|
5960
|
+
const A = window.BuzzCasting.getOptions();
|
|
5961
|
+
this.storageReader = new Fa(A), this.broadcastChannel = new BroadcastChannel(v.presentation), this.broadcastListener();
|
|
5960
5962
|
}
|
|
5961
5963
|
addCallbackListener(t) {
|
|
5962
5964
|
this.callbacks.push(t);
|
|
@@ -5981,8 +5983,8 @@ class cs {
|
|
|
5981
5983
|
]);
|
|
5982
5984
|
try {
|
|
5983
5985
|
c.widget === t.widget && this.callbacks.forEach(async (v) => {
|
|
5984
|
-
const
|
|
5985
|
-
v(
|
|
5986
|
+
const A = await this.getData();
|
|
5987
|
+
v(A);
|
|
5986
5988
|
});
|
|
5987
5989
|
} catch {
|
|
5988
5990
|
L(4, [q.WIDGET_UPDATE, c]);
|
|
@@ -6027,8 +6029,8 @@ export {
|
|
|
6027
6029
|
Fa as BuzzcastingStorageReader,
|
|
6028
6030
|
l as CSS,
|
|
6029
6031
|
q as EVENTS,
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
+
an as MODERATION,
|
|
6033
|
+
we as STORAGE,
|
|
6032
6034
|
cs as Widget,
|
|
6033
6035
|
Ua as anonymize,
|
|
6034
6036
|
za as attachedMedia,
|
|
@@ -6041,7 +6043,7 @@ export {
|
|
|
6041
6043
|
Ia as deepMerge,
|
|
6042
6044
|
Ha as filterAttributes,
|
|
6043
6045
|
Za as formatContent,
|
|
6044
|
-
|
|
6046
|
+
Qn as hashSum,
|
|
6045
6047
|
Va as intToString,
|
|
6046
6048
|
qa as numberFormatter,
|
|
6047
6049
|
ss as randomValue,
|